🛟 Updated.
16cca31 parent: 097fb4d modified
.gitignore +2 -1 | @@ -24,4 +24,5 @@ sidekicks | ||
| 24 | 24 | |
| 25 | 25 | bob |
| 26 | 26 | bob-the-bot |
| 27 | -bob-the-smoll | |
| \ No newline at end of file | ||
| 27 | +bob-the-smoll | |
| 28 | +bob-coder | |
| @@ -24,4 +24,5 @@ sidekicks | |||
| 24 | 24 | ||
| 25 | bob | 25 | bob |
| 26 | bob-the-bot | 26 | bob-the-bot |
| 27 | -bob-the-smoll | ||
| \ No newline at end of file | \ No newline at end of file | ||
| 27 | +bob-the-smoll | ||
| 28 | +bob-coder | ||
added
.tickets/issues/0209-mm-sbxinit-no-agent-config-for-a-mm-project-with-a.yaml +119 -0 | new file mode 100644 | ||
| @@ -0,0 +1,119 @@ | ||
| 1 | +# Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | |
| 2 | +id: 209 | |
| 3 | +title: "mm sbxinit: no AGENT_CONFIG / PROJECT_DIR for a .mm project with a kit that ships mm 1.0.7+" | |
| 4 | +state: open | |
| 5 | +author: | |
| 6 | + name: k33g | |
| 7 | + email: ph.charriere@gmail.com | |
| 8 | +createdAt: 2026-11-13T13:00:20.000Z | |
| 9 | +updatedAt: 2026-11-13T13:06:01.000Z | |
| 10 | +labels: | |
| 11 | + - enhancement | |
| 12 | + - kind::feature | |
| 13 | +milestone: v1.0.8 | |
| 14 | +epic: Scaffolding | |
| 15 | +related: | |
| 16 | + - 208 | |
| 17 | +body: | | |
| 18 | + For a `.mm` project, `mm sbxinit` (ticket 208, | |
| 19 | + [internal/sbxinit/mmfolder.go](internal/sbxinit/mmfolder.go)) writes | |
| 20 | + `args.PROJECT_DIR` (required) and `env.AGENT_CONFIG: ${{ env.args.PROJECT_DIR }}/.mm/agent.yaml`, | |
| 21 | + so every `sbx env` command needs `--env-arg PROJECT_DIR="$PWD"`. That was chosen so the | |
| 22 | + file would not depend on the mm the kit ships (`mini-me-kit:0.1.4` ships an mm without | |
| 23 | + ticket 204). | |
| 24 | + | |
| 25 | + `mini-me-kit:0.1.5` ships mm 1.0.7, which finds `.mm/agent.yaml` on its own when it | |
| 26 | + starts in the workspace. The user expected no `PROJECT_DIR` with it (seen 2026-11-13 in | |
| 27 | + `bob-coder/`, fixed there by hand: `args` and `env` removed). | |
| 28 | + | |
| 29 | + ## Wanted | |
| 30 | + - For a `.mm` project, when the kit written in the file ships mm 1.0.7 or later, no | |
| 31 | + `args` and no `env.AGENT_CONFIG`; the commands shown (output and file comments) without | |
| 32 | + `--env-arg`. The read-only `.mm` mount and the writable `sessions.dir` / `trace.dir` | |
| 33 | + mounts stay. | |
| 34 | + - Decided (2026-11-13): `PROJECT_DIR` is dropped from `mini-me-kit:0.1.5` on. `mm sbxinit` | |
| 35 | + always writes the latest kit (or `latest` when the version cannot be read, which is the | |
| 36 | + latest too), so the generated file never needs it: the `PROJECT_DIR` form goes away, no | |
| 37 | + kit-version table. | |
| 38 | + - A comment in the file says why there is no AGENT_CONFIG (mm 1.0.7+ in the kit finds | |
| 39 | + `.mm/agent.yaml` from the workspace). | |
| 40 | + | |
| 41 | + ## To check / decide | |
| 42 | + - ~~Which kit version first ships mm 1.0.7, and how sbxinit knows it~~ — not needed: the | |
| 43 | + first one is 0.1.5 and sbxinit only ever writes the latest kit. | |
| 44 | + - The kit starts mm in the workspace (the lookup depends on it): check with a banner | |
| 45 | + `config: …/.mm/agent.yaml` after `sbx env run`. | |
| 46 | + - Editors (ACP): `sbx exec -i <sandbox> mm -acp` — in which directory does mm start? The | |
| 47 | + how-to shows `-config <absolute path>` for Zed; keep it unless the working directory is | |
| 48 | + the workspace. | |
| 49 | + | |
| 50 | + ## Acceptance criteria | |
| 51 | + - Tests: a `.mm` project → no args/env, commands without --env-arg, the mounts kept. | |
| 52 | + - Docs EN+FR: how-to sandbox § ".mm folder", CLI reference of `mm sbxinit`; the Zed | |
| 53 | + snippet for a sandboxed `.mm` project. | |
| 54 | +tasks: | |
| 55 | + - id: 1 | |
| 56 | + title: "Decide: drop PROJECT_DIR only for kits with mm 1.0.7+, or always" | |
| 57 | + state: closed | |
| 58 | + priority: none | |
| 59 | + author: | |
| 60 | + name: k33g | |
| 61 | + email: ph.charriere@gmail.com | |
| 62 | + createdAt: 2026-11-13T13:00:20.000Z | |
| 63 | + updatedAt: 2026-11-13T13:03:21.000Z | |
| 64 | + closedAt: 2026-11-13T13:03:21.000Z | |
| 65 | + - id: 2 | |
| 66 | + title: "Know the mm version a kit ships (minimum kit version or table)" | |
| 67 | + state: closed | |
| 68 | + priority: none | |
| 69 | + author: | |
| 70 | + name: k33g | |
| 71 | + email: ph.charriere@gmail.com | |
| 72 | + createdAt: 2026-11-13T13:00:20.000Z | |
| 73 | + updatedAt: 2026-11-13T13:03:21.000Z | |
| 74 | + closedAt: 2026-11-13T13:03:21.000Z | |
| 75 | + - id: 3 | |
| 76 | + title: "Generate the simple form (no args/env, no --env-arg) for those kits" | |
| 77 | + state: closed | |
| 78 | + priority: none | |
| 79 | + author: | |
| 80 | + name: k33g | |
| 81 | + email: ph.charriere@gmail.com | |
| 82 | + createdAt: 2026-11-13T13:00:20.000Z | |
| 83 | + updatedAt: 2026-11-13T13:06:01.000Z | |
| 84 | + closedAt: 2026-11-13T13:06:01.000Z | |
| 85 | + - id: 4 | |
| 86 | + title: "Check in sbx: mm starts in the workspace (terminal) and under sbx exec (ACP)" | |
| 87 | + state: open | |
| 88 | + priority: none | |
| 89 | + author: | |
| 90 | + name: k33g | |
| 91 | + email: ph.charriere@gmail.com | |
| 92 | + createdAt: 2026-11-13T13:00:20.000Z | |
| 93 | + - id: 5 | |
| 94 | + title: "Tests, docs EN+FR (incl. the Zed settings for a sandboxed .mm project)" | |
| 95 | + state: closed | |
| 96 | + priority: none | |
| 97 | + author: | |
| 98 | + name: k33g | |
| 99 | + email: ph.charriere@gmail.com | |
| 100 | + createdAt: 2026-11-13T13:00:20.000Z | |
| 101 | + updatedAt: 2026-11-13T13:06:01.000Z | |
| 102 | + closedAt: 2026-11-13T13:06:01.000Z | |
| 103 | +comments: | |
| 104 | + - id: 1 | |
| 105 | + author: | |
| 106 | + name: k33g | |
| 107 | + email: ph.charriere@gmail.com | |
| 108 | + createdAt: 2026-11-13T13:03:21.000Z | |
| 109 | + body: | | |
| 110 | + User's decision: drop PROJECT_DIR from mini-me-kit:0.1.5 on; sbxinit always generates with the latest kit, hence the most recent mm. Tasks 1 and 2 closed by this decision. | |
| 111 | + - id: 2 | |
| 112 | + author: | |
| 113 | + name: k33g | |
| 114 | + email: ph.charriere@gmail.com | |
| 115 | + createdAt: 2026-11-13T13:06:01.000Z | |
| 116 | + body: | | |
| 117 | + Implemented (not committed, on main's working tree): [internal/sbxinit/mmfolder.go](internal/sbxinit/mmfolder.go) no longer writes `args.PROJECT_DIR` nor `env.AGENT_CONFIG` for a `.mm` project, and a comment says why; [internal/sbxinit/sbxinit.go](internal/sbxinit/sbxinit.go) prints and writes the `sbx env` commands without `--env-arg`. Mounts unchanged (`.mm` read-only, `sessions.dir` / `trace.dir` writable, relative paths). Tests updated (`TestMainMountsTheMMFolderReadOnly`, `TestMMFolderInASubWorkspace`); `go test ./...` green. The output matches the user's hand-fixed `bob-coder/sbxenv.yaml`. | |
| 118 | + Docs EN+FR: how-to sandbox § `.mm` (example without args/env, what to do if the banner says `config: built-in defaults`, how to clean a file written by sbxinit 1.0.7, Zed settings with `sbx exec … mm -acp -config <absolute path>`), CLI reference `--agent`. | |
| 119 | + Task 4 stays open: check in sbx that the kit's mm starts in the workspace (banner `config: .mm/agent.yaml`), and the working directory under `sbx exec`. | |
| new file mode 100644 | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | +# Managed by IssueSpec. Hand edits are welcome; keep the schema valid. | ||
| 2 | +id: 209 | ||
| 3 | +title: "mm sbxinit: no AGENT_CONFIG / PROJECT_DIR for a .mm project with a kit that ships mm 1.0.7+" | ||
| 4 | +state: open | ||
| 5 | +author: | ||
| 6 | + name: k33g | ||
| 7 | + email: ph.charriere@gmail.com | ||
| 8 | +createdAt: 2026-11-13T13:00:20.000Z | ||
| 9 | +updatedAt: 2026-11-13T13:06:01.000Z | ||
| 10 | +labels: | ||
| 11 | + - enhancement | ||
| 12 | + - kind::feature | ||
| 13 | +milestone: v1.0.8 | ||
| 14 | +epic: Scaffolding | ||
| 15 | +related: | ||
| 16 | + - 208 | ||
| 17 | +body: | | ||
| 18 | + For a `.mm` project, `mm sbxinit` (ticket 208, | ||
| 19 | + [internal/sbxinit/mmfolder.go](internal/sbxinit/mmfolder.go)) writes | ||
| 20 | + `args.PROJECT_DIR` (required) and `env.AGENT_CONFIG: ${{ env.args.PROJECT_DIR }}/.mm/agent.yaml`, | ||
| 21 | + so every `sbx env` command needs `--env-arg PROJECT_DIR="$PWD"`. That was chosen so the | ||
| 22 | + file would not depend on the mm the kit ships (`mini-me-kit:0.1.4` ships an mm without | ||
| 23 | + ticket 204). | ||
| 24 | + | ||
| 25 | + `mini-me-kit:0.1.5` ships mm 1.0.7, which finds `.mm/agent.yaml` on its own when it | ||
| 26 | + starts in the workspace. The user expected no `PROJECT_DIR` with it (seen 2026-11-13 in | ||
| 27 | + `bob-coder/`, fixed there by hand: `args` and `env` removed). | ||
| 28 | + | ||
| 29 | + ## Wanted | ||
| 30 | + - For a `.mm` project, when the kit written in the file ships mm 1.0.7 or later, no | ||
| 31 | + `args` and no `env.AGENT_CONFIG`; the commands shown (output and file comments) without | ||
| 32 | + `--env-arg`. The read-only `.mm` mount and the writable `sessions.dir` / `trace.dir` | ||
| 33 | + mounts stay. | ||
| 34 | + - Decided (2026-11-13): `PROJECT_DIR` is dropped from `mini-me-kit:0.1.5` on. `mm sbxinit` | ||
| 35 | + always writes the latest kit (or `latest` when the version cannot be read, which is the | ||
| 36 | + latest too), so the generated file never needs it: the `PROJECT_DIR` form goes away, no | ||
| 37 | + kit-version table. | ||
| 38 | + - A comment in the file says why there is no AGENT_CONFIG (mm 1.0.7+ in the kit finds | ||
| 39 | + `.mm/agent.yaml` from the workspace). | ||
| 40 | + | ||
| 41 | + ## To check / decide | ||
| 42 | + - ~~Which kit version first ships mm 1.0.7, and how sbxinit knows it~~ — not needed: the | ||
| 43 | + first one is 0.1.5 and sbxinit only ever writes the latest kit. | ||
| 44 | + - The kit starts mm in the workspace (the lookup depends on it): check with a banner | ||
| 45 | + `config: …/.mm/agent.yaml` after `sbx env run`. | ||
| 46 | + - Editors (ACP): `sbx exec -i <sandbox> mm -acp` — in which directory does mm start? The | ||
| 47 | + how-to shows `-config <absolute path>` for Zed; keep it unless the working directory is | ||
| 48 | + the workspace. | ||
| 49 | + | ||
| 50 | + ## Acceptance criteria | ||
| 51 | + - Tests: a `.mm` project → no args/env, commands without --env-arg, the mounts kept. | ||
| 52 | + - Docs EN+FR: how-to sandbox § ".mm folder", CLI reference of `mm sbxinit`; the Zed | ||
| 53 | + snippet for a sandboxed `.mm` project. | ||
| 54 | +tasks: | ||
| 55 | + - id: 1 | ||
| 56 | + title: "Decide: drop PROJECT_DIR only for kits with mm 1.0.7+, or always" | ||
| 57 | + state: closed | ||
| 58 | + priority: none | ||
| 59 | + author: | ||
| 60 | + name: k33g | ||
| 61 | + email: ph.charriere@gmail.com | ||
| 62 | + createdAt: 2026-11-13T13:00:20.000Z | ||
| 63 | + updatedAt: 2026-11-13T13:03:21.000Z | ||
| 64 | + closedAt: 2026-11-13T13:03:21.000Z | ||
| 65 | + - id: 2 | ||
| 66 | + title: "Know the mm version a kit ships (minimum kit version or table)" | ||
| 67 | + state: closed | ||
| 68 | + priority: none | ||
| 69 | + author: | ||
| 70 | + name: k33g | ||
| 71 | + email: ph.charriere@gmail.com | ||
| 72 | + createdAt: 2026-11-13T13:00:20.000Z | ||
| 73 | + updatedAt: 2026-11-13T13:03:21.000Z | ||
| 74 | + closedAt: 2026-11-13T13:03:21.000Z | ||
| 75 | + - id: 3 | ||
| 76 | + title: "Generate the simple form (no args/env, no --env-arg) for those kits" | ||
| 77 | + state: closed | ||
| 78 | + priority: none | ||
| 79 | + author: | ||
| 80 | + name: k33g | ||
| 81 | + email: ph.charriere@gmail.com | ||
| 82 | + createdAt: 2026-11-13T13:00:20.000Z | ||
| 83 | + updatedAt: 2026-11-13T13:06:01.000Z | ||
| 84 | + closedAt: 2026-11-13T13:06:01.000Z | ||
| 85 | + - id: 4 | ||
| 86 | + title: "Check in sbx: mm starts in the workspace (terminal) and under sbx exec (ACP)" | ||
| 87 | + state: open | ||
| 88 | + priority: none | ||
| 89 | + author: | ||
| 90 | + name: k33g | ||
| 91 | + email: ph.charriere@gmail.com | ||
| 92 | + createdAt: 2026-11-13T13:00:20.000Z | ||
| 93 | + - id: 5 | ||
| 94 | + title: "Tests, docs EN+FR (incl. the Zed settings for a sandboxed .mm project)" | ||
| 95 | + state: closed | ||
| 96 | + priority: none | ||
| 97 | + author: | ||
| 98 | + name: k33g | ||
| 99 | + email: ph.charriere@gmail.com | ||
| 100 | + createdAt: 2026-11-13T13:00:20.000Z | ||
| 101 | + updatedAt: 2026-11-13T13:06:01.000Z | ||
| 102 | + closedAt: 2026-11-13T13:06:01.000Z | ||
| 103 | +comments: | ||
| 104 | + - id: 1 | ||
| 105 | + author: | ||
| 106 | + name: k33g | ||
| 107 | + email: ph.charriere@gmail.com | ||
| 108 | + createdAt: 2026-11-13T13:03:21.000Z | ||
| 109 | + body: | | ||
| 110 | + User's decision: drop PROJECT_DIR from mini-me-kit:0.1.5 on; sbxinit always generates with the latest kit, hence the most recent mm. Tasks 1 and 2 closed by this decision. | ||
| 111 | + - id: 2 | ||
| 112 | + author: | ||
| 113 | + name: k33g | ||
| 114 | + email: ph.charriere@gmail.com | ||
| 115 | + createdAt: 2026-11-13T13:06:01.000Z | ||
| 116 | + body: | | ||
| 117 | + Implemented (not committed, on main's working tree): [internal/sbxinit/mmfolder.go](internal/sbxinit/mmfolder.go) no longer writes `args.PROJECT_DIR` nor `env.AGENT_CONFIG` for a `.mm` project, and a comment says why; [internal/sbxinit/sbxinit.go](internal/sbxinit/sbxinit.go) prints and writes the `sbx env` commands without `--env-arg`. Mounts unchanged (`.mm` read-only, `sessions.dir` / `trace.dir` writable, relative paths). Tests updated (`TestMainMountsTheMMFolderReadOnly`, `TestMMFolderInASubWorkspace`); `go test ./...` green. The output matches the user's hand-fixed `bob-coder/sbxenv.yaml`. | ||
| 118 | + Docs EN+FR: how-to sandbox § `.mm` (example without args/env, what to do if the banner says `config: built-in defaults`, how to clean a file written by sbxinit 1.0.7, Zed settings with `sbx exec … mm -acp -config <absolute path>`), CLI reference `--agent`. | ||
| 119 | + Task 4 stays open: check in sbx that the kit's mm starts in the workspace (banner `config: .mm/agent.yaml`), and the working directory under `sbx exec`. | ||
modified
.tickets/milestones.yaml +2 -0 | @@ -60,3 +60,5 @@ milestones: | ||
| 60 | 60 | - title: v1.0.7 |
| 61 | 61 | state: closed |
| 62 | 62 | dueOn: 2026-11-14 |
| 63 | + - title: v1.0.8 | |
| 64 | + state: open | |
| @@ -60,3 +60,5 @@ milestones: | |||
| 60 | - title: v1.0.7 | 60 | - title: v1.0.7 |
| 61 | state: closed | 61 | state: closed |
| 62 | dueOn: 2026-11-14 | 62 | dueOn: 2026-11-14 |
| 63 | + - title: v1.0.8 | ||
| 64 | + state: open | ||
modified
docs/en/how-to/run-in-a-docker-sandbox.md +18 -9 | @@ -171,21 +171,30 @@ additionalWorkspaces: | ||
| 171 | 171 | - path: ./.mm # read-only over the workspace |
| 172 | 172 | readOnly: true |
| 173 | 173 | - path: ./.mm/sessions # sessions.dir: writable again |
| 174 | - | |
| 175 | -args: | |
| 176 | - PROJECT_DIR: | |
| 177 | - required: true | |
| 178 | - | |
| 179 | -env: | |
| 180 | - AGENT_CONFIG: ${{ env.args.PROJECT_DIR }}/.mm/agent.yaml | |
| 181 | 174 | ``` |
| 182 | 175 | |
| 183 | 176 | - `.mm/` is read-only in the sandbox: the agent cannot change its settings, skills or hooks. |
| 184 | 177 | - The folders mm writes in are writable again, read from the agent file: `sessions.dir` when the sessions are on, `trace.dir` when the trace is on. Their paths are the agent file's, so a mount and a setting cannot disagree. |
| 185 | -- `AGENT_CONFIG` names the agent file through `PROJECT_DIR`, the project's folder as the sandbox sees it (the same path as on your machine): it works whatever mm's version in the kit and its working directory, `mm -acp` from an editor included. Every `sbx env` command then takes `--env-arg PROJECT_DIR="$PWD"`, run from the folder of `sbxenv.yaml`. | |
| 178 | +- No `AGENT_CONFIG`: the file always names the latest kit, and from `mini-me-kit:0.1.5` on the kit ships mm 1.0.7 or later, which finds `.mm/agent.yaml` on its own when it starts in the workspace. The commands take no argument: `sbx env create --force`, `sbx env run --force`. If the banner says `config: built-in defaults`, the kit started mm elsewhere: add `env: {AGENT_CONFIG: <absolute path of .mm/agent.yaml>}` (the workspace is mounted at the same path as on your machine). | |
| 186 | 179 | - Every path is relative to the folder of `sbxenv.yaml`, as sbx reads them: the file does not depend on where the project is, and can be committed. |
| 187 | 180 | |
| 188 | -Anything else written under `.mm/` needs a line of its own — a hook that keeps a log there, for instance: with `onError: ignore`, it would fail without a word. After changing the agent's sessions or trace, run `mm sbxinit` again (answer `yes` to replace the file), then re-create the sandbox: `sbx env rm --force --env-arg PROJECT_DIR="$PWD"`, then `sbx env create --force --env-arg PROJECT_DIR="$PWD"` — a sandbox keeps the mounts it was created with. If `sbx env` answers that a sandbox of that name "shows no sign of ever being created by sbx env", one was made another way (`sbx run --name …`): remove it with `sbx rm <name>`, or change `name:`. | |
| 181 | +Anything else written under `.mm/` needs a line of its own — a hook that keeps a log there, for instance: with `onError: ignore`, it would fail without a word. After changing the agent's sessions or trace, run `mm sbxinit` again (answer `yes` to replace the file), then re-create the sandbox: `sbx env rm --force`, then `sbx env create --force` — a sandbox keeps the mounts it was created with. A file written by `mm sbxinit` 1.0.7 sets `args.PROJECT_DIR` and `AGENT_CONFIG`: with a kit of 0.1.5 or later you can remove both, as the current version does. | |
| 182 | + | |
| 183 | +From an editor, run mm in that sandbox with `sbx exec`, and name the agent file with its absolute path — it does not depend on the directory `sbx exec` starts mm in: | |
| 184 | + | |
| 185 | +```json | |
| 186 | +{ | |
| 187 | + "agent_servers": { | |
| 188 | + "bob (sandbox)": { | |
| 189 | + "type": "custom", | |
| 190 | + "command": "sbx", | |
| 191 | + "args": ["exec", "-i", "bob-sbx", "mm", "-acp", "-config", "/home/me/bob/.mm/agent.yaml"] | |
| 192 | + } | |
| 193 | + } | |
| 194 | +} | |
| 195 | +``` | |
| 196 | + | |
| 197 | +The sandbox must exist (`sbx env create --force`) before the editor opens its agent panel. If `sbx env` answers that a sandbox of that name "shows no sign of ever being created by sbx env", one was made another way (`sbx run --name …`): remove it with `sbx rm <name>`, or change `name:`. | |
| 189 | 198 | |
| 190 | 199 | ## The model server stays on the host |
| 191 | 200 | |
| @@ -171,21 +171,30 @@ additionalWorkspaces: | |||
| 171 | - path: ./.mm # read-only over the workspace | 171 | - path: ./.mm # read-only over the workspace |
| 172 | readOnly: true | 172 | readOnly: true |
| 173 | - path: ./.mm/sessions # sessions.dir: writable again | 173 | - path: ./.mm/sessions # sessions.dir: writable again |
| 174 | - | ||
| 175 | -args: | ||
| 176 | - PROJECT_DIR: | ||
| 177 | - required: true | ||
| 178 | - | ||
| 179 | -env: | ||
| 180 | - AGENT_CONFIG: ${{ env.args.PROJECT_DIR }}/.mm/agent.yaml | ||
| 181 | ``` | 174 | ``` |
| 182 | 175 | ||
| 183 | - `.mm/` is read-only in the sandbox: the agent cannot change its settings, skills or hooks. | 176 | - `.mm/` is read-only in the sandbox: the agent cannot change its settings, skills or hooks. |
| 184 | - The folders mm writes in are writable again, read from the agent file: `sessions.dir` when the sessions are on, `trace.dir` when the trace is on. Their paths are the agent file's, so a mount and a setting cannot disagree. | 177 | - The folders mm writes in are writable again, read from the agent file: `sessions.dir` when the sessions are on, `trace.dir` when the trace is on. Their paths are the agent file's, so a mount and a setting cannot disagree. |
| 185 | -- `AGENT_CONFIG` names the agent file through `PROJECT_DIR`, the project's folder as the sandbox sees it (the same path as on your machine): it works whatever mm's version in the kit and its working directory, `mm -acp` from an editor included. Every `sbx env` command then takes `--env-arg PROJECT_DIR="$PWD"`, run from the folder of `sbxenv.yaml`. | 178 | +- No `AGENT_CONFIG`: the file always names the latest kit, and from `mini-me-kit:0.1.5` on the kit ships mm 1.0.7 or later, which finds `.mm/agent.yaml` on its own when it starts in the workspace. The commands take no argument: `sbx env create --force`, `sbx env run --force`. If the banner says `config: built-in defaults`, the kit started mm elsewhere: add `env: {AGENT_CONFIG: <absolute path of .mm/agent.yaml>}` (the workspace is mounted at the same path as on your machine). |
| 186 | - Every path is relative to the folder of `sbxenv.yaml`, as sbx reads them: the file does not depend on where the project is, and can be committed. | 179 | - Every path is relative to the folder of `sbxenv.yaml`, as sbx reads them: the file does not depend on where the project is, and can be committed. |
| 187 | 180 | ||
| 188 | -Anything else written under `.mm/` needs a line of its own — a hook that keeps a log there, for instance: with `onError: ignore`, it would fail without a word. After changing the agent's sessions or trace, run `mm sbxinit` again (answer `yes` to replace the file), then re-create the sandbox: `sbx env rm --force --env-arg PROJECT_DIR="$PWD"`, then `sbx env create --force --env-arg PROJECT_DIR="$PWD"` — a sandbox keeps the mounts it was created with. If `sbx env` answers that a sandbox of that name "shows no sign of ever being created by sbx env", one was made another way (`sbx run --name …`): remove it with `sbx rm <name>`, or change `name:`. | 181 | +Anything else written under `.mm/` needs a line of its own — a hook that keeps a log there, for instance: with `onError: ignore`, it would fail without a word. After changing the agent's sessions or trace, run `mm sbxinit` again (answer `yes` to replace the file), then re-create the sandbox: `sbx env rm --force`, then `sbx env create --force` — a sandbox keeps the mounts it was created with. A file written by `mm sbxinit` 1.0.7 sets `args.PROJECT_DIR` and `AGENT_CONFIG`: with a kit of 0.1.5 or later you can remove both, as the current version does. |
| 182 | + | ||
| 183 | +From an editor, run mm in that sandbox with `sbx exec`, and name the agent file with its absolute path — it does not depend on the directory `sbx exec` starts mm in: | ||
| 184 | + | ||
| 185 | +```json | ||
| 186 | +{ | ||
| 187 | + "agent_servers": { | ||
| 188 | + "bob (sandbox)": { | ||
| 189 | + "type": "custom", | ||
| 190 | + "command": "sbx", | ||
| 191 | + "args": ["exec", "-i", "bob-sbx", "mm", "-acp", "-config", "/home/me/bob/.mm/agent.yaml"] | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | +} | ||
| 195 | +``` | ||
| 196 | + | ||
| 197 | +The sandbox must exist (`sbx env create --force`) before the editor opens its agent panel. If `sbx env` answers that a sandbox of that name "shows no sign of ever being created by sbx env", one was made another way (`sbx run --name …`): remove it with `sbx rm <name>`, or change `name:`. | ||
| 189 | 198 | ||
| 190 | ## The model server stays on the host | 199 | ## The model server stays on the host |
| 191 | 200 | ||
modified
docs/en/reference/cli.md +1 -1 | @@ -226,7 +226,7 @@ Each existing file is asked about, the default being `no`: that file is kept, th | ||
| 226 | 226 | |------|---------|---------| |
| 227 | 227 | | `--workspace` | The folder the sandbox mounts, relative to the current directory or absolute. The file always holds an absolute path | the current directory | |
| 228 | 228 | | `--name` | The agent's name, as lower case letters and digits joined by dashes. The sandbox is `<name>-sbx` | `acp.name` in the agent file, else `mm` | |
| 229 | -| `--agent` | The agent file that names the sandbox, looked for in the current directory, then in the workspace. Without the flag, `.mm/agent.yaml` is looked for too, after `agent.yaml` (the order mm follows); found in `<workspace>/.mm/`, the file mounts `.mm/` read-only, mounts the agent file's `sessions.dir` and `trace.dir` (when on and under `.mm/`) writable again, and sets `AGENT_CONFIG` to `${{ env.args.PROJECT_DIR }}/…/.mm/agent.yaml` with a required `PROJECT_DIR` argument; paths are relative to the folder of `sbxenv.yaml`, and the printed commands add `--env-arg PROJECT_DIR="$PWD"` | `agent.yaml`, then `.mm/agent.yaml` | | |
| 229 | +| `--agent` | The agent file that names the sandbox, looked for in the current directory, then in the workspace. Without the flag, `.mm/agent.yaml` is looked for too, after `agent.yaml` (the order mm follows); found in `<workspace>/.mm/`, the file mounts `.mm/` read-only, mounts the agent file's `sessions.dir` and `trace.dir` (when on and under `.mm/`) writable again, with paths relative to the folder of `sbxenv.yaml`; no `AGENT_CONFIG`, no argument — the latest kit's mm (1.0.7 or later, from `mini-me-kit:0.1.5`) finds `.mm/agent.yaml` on its own | `agent.yaml`, then `.mm/agent.yaml` | | |
| 230 | 230 | | `--yes` | Ask nothing. An existing file stops everything: nothing is overwritten | off | |
| 231 | 231 | |
| 232 | 232 | An agent file outside the workspace only gives a warning: see [when the agent file is outside the workspace](../how-to/run-in-a-docker-sandbox.md#when-the-agent-file-is-outside-the-workspace). The `mini-me-kit` version is read from its latest release on Rickub, with a 5 s limit; the tag `latest` is used if that fails. The file sets `sandboxOptions.pullPolicy: always`. An existing file is asked about, the default being `no`. Exit codes: `0` done, `1` a file exists and nobody could answer, or a write failed, `2` wrong flags or arguments. |
| @@ -226,7 +226,7 @@ Each existing file is asked about, the default being `no`: that file is kept, th | |||
| 226 | |------|---------|---------| | 226 | |------|---------|---------| |
| 227 | | `--workspace` | The folder the sandbox mounts, relative to the current directory or absolute. The file always holds an absolute path | the current directory | | 227 | | `--workspace` | The folder the sandbox mounts, relative to the current directory or absolute. The file always holds an absolute path | the current directory | |
| 228 | | `--name` | The agent's name, as lower case letters and digits joined by dashes. The sandbox is `<name>-sbx` | `acp.name` in the agent file, else `mm` | | 228 | | `--name` | The agent's name, as lower case letters and digits joined by dashes. The sandbox is `<name>-sbx` | `acp.name` in the agent file, else `mm` | |
| 229 | -| `--agent` | The agent file that names the sandbox, looked for in the current directory, then in the workspace. Without the flag, `.mm/agent.yaml` is looked for too, after `agent.yaml` (the order mm follows); found in `<workspace>/.mm/`, the file mounts `.mm/` read-only, mounts the agent file's `sessions.dir` and `trace.dir` (when on and under `.mm/`) writable again, and sets `AGENT_CONFIG` to `${{ env.args.PROJECT_DIR }}/…/.mm/agent.yaml` with a required `PROJECT_DIR` argument; paths are relative to the folder of `sbxenv.yaml`, and the printed commands add `--env-arg PROJECT_DIR="$PWD"` | `agent.yaml`, then `.mm/agent.yaml` | | 229 | +| `--agent` | The agent file that names the sandbox, looked for in the current directory, then in the workspace. Without the flag, `.mm/agent.yaml` is looked for too, after `agent.yaml` (the order mm follows); found in `<workspace>/.mm/`, the file mounts `.mm/` read-only, mounts the agent file's `sessions.dir` and `trace.dir` (when on and under `.mm/`) writable again, with paths relative to the folder of `sbxenv.yaml`; no `AGENT_CONFIG`, no argument — the latest kit's mm (1.0.7 or later, from `mini-me-kit:0.1.5`) finds `.mm/agent.yaml` on its own | `agent.yaml`, then `.mm/agent.yaml` | |
| 230 | | `--yes` | Ask nothing. An existing file stops everything: nothing is overwritten | off | | 230 | | `--yes` | Ask nothing. An existing file stops everything: nothing is overwritten | off | |
| 231 | 231 | ||
| 232 | An agent file outside the workspace only gives a warning: see [when the agent file is outside the workspace](../how-to/run-in-a-docker-sandbox.md#when-the-agent-file-is-outside-the-workspace). The `mini-me-kit` version is read from its latest release on Rickub, with a 5 s limit; the tag `latest` is used if that fails. The file sets `sandboxOptions.pullPolicy: always`. An existing file is asked about, the default being `no`. Exit codes: `0` done, `1` a file exists and nobody could answer, or a write failed, `2` wrong flags or arguments. | 232 | An agent file outside the workspace only gives a warning: see [when the agent file is outside the workspace](../how-to/run-in-a-docker-sandbox.md#when-the-agent-file-is-outside-the-workspace). The `mini-me-kit` version is read from its latest release on Rickub, with a 5 s limit; the tag `latest` is used if that fails. The file sets `sandboxOptions.pullPolicy: always`. An existing file is asked about, the default being `no`. Exit codes: `0` done, `1` a file exists and nobody could answer, or a write failed, `2` wrong flags or arguments. |
modified
docs/fr/how-to/run-in-a-docker-sandbox.md +18 -9 | @@ -171,21 +171,30 @@ additionalWorkspaces: | ||
| 171 | 171 | - path: ./.mm # lecture seule par-dessus le workspace |
| 172 | 172 | readOnly: true |
| 173 | 173 | - path: ./.mm/sessions # sessions.dir : de nouveau inscriptible |
| 174 | - | |
| 175 | -args: | |
| 176 | - PROJECT_DIR: | |
| 177 | - required: true | |
| 178 | - | |
| 179 | -env: | |
| 180 | - AGENT_CONFIG: ${{ env.args.PROJECT_DIR }}/.mm/agent.yaml | |
| 181 | 174 | ``` |
| 182 | 175 | |
| 183 | 176 | - `.mm/` est en lecture seule dans la sandbox : l'agent ne peut modifier ni ses réglages, ni ses skills, ni ses hooks. |
| 184 | 177 | - Les dossiers où mm écrit redeviennent inscriptibles, lus dans le fichier d'agent : `sessions.dir` quand les sessions sont activées, `trace.dir` quand la trace l'est. Leurs chemins sont ceux du fichier d'agent : un montage et un réglage ne peuvent pas diverger. |
| 185 | -- `AGENT_CONFIG` désigne le fichier d'agent via `PROJECT_DIR`, le dossier du projet tel que la sandbox le voit (le même chemin que sur votre machine) : ça marche quelle que soit la version de mm du kit et son répertoire de travail, `mm -acp` depuis un éditeur compris. Chaque commande `sbx env` prend alors `--env-arg PROJECT_DIR="$PWD"`, lancée depuis le dossier de `sbxenv.yaml`. | |
| 178 | +- Pas d'`AGENT_CONFIG` : le fichier désigne toujours le dernier kit, et à partir de `mini-me-kit:0.1.5` le kit embarque mm 1.0.7 ou plus récent, qui trouve `.mm/agent.yaml` tout seul quand il démarre dans le workspace. Les commandes ne prennent aucun argument : `sbx env create --force`, `sbx env run --force`. Si la bannière affiche `config: built-in defaults`, le kit a lancé mm ailleurs : ajoutez `env: {AGENT_CONFIG: <chemin absolu de .mm/agent.yaml>}` (le workspace est monté au même chemin que sur votre machine). | |
| 186 | 179 | - Tous les chemins sont relatifs au dossier de `sbxenv.yaml`, comme sbx les lit : le fichier ne dépend pas de l'endroit où se trouve le projet, et peut être commité. |
| 187 | 180 | |
| 188 | -Tout ce qui est écrit d'autre sous `.mm/` demande sa propre ligne — un hook qui y tient un journal, par exemple : avec `onError: ignore`, il échouerait sans rien dire. Après avoir changé les sessions ou la trace de l'agent, relancez `mm sbxinit` (répondez `yes` pour remplacer le fichier), puis recréez la sandbox : `sbx env rm --force --env-arg PROJECT_DIR="$PWD"`, puis `sbx env create --force --env-arg PROJECT_DIR="$PWD"` — une sandbox garde les montages de sa création. Si `sbx env` répond qu'une sandbox de ce nom « shows no sign of ever being created by sbx env », elle a été créée autrement (`sbx run --name …`) : supprimez-la avec `sbx rm <nom>`, ou changez `name:`. | |
| 181 | +Tout ce qui est écrit d'autre sous `.mm/` demande sa propre ligne — un hook qui y tient un journal, par exemple : avec `onError: ignore`, il échouerait sans rien dire. Après avoir changé les sessions ou la trace de l'agent, relancez `mm sbxinit` (répondez `yes` pour remplacer le fichier), puis recréez la sandbox : `sbx env rm --force`, puis `sbx env create --force` — une sandbox garde les montages de sa création. Un fichier écrit par `mm sbxinit` 1.0.7 fixe `args.PROJECT_DIR` et `AGENT_CONFIG` : avec un kit 0.1.5 ou plus récent, vous pouvez retirer les deux, comme le fait la version actuelle. | |
| 182 | + | |
| 183 | +Depuis un éditeur, lancez mm dans cette sandbox avec `sbx exec`, et désignez le fichier d'agent par son chemin absolu — ça ne dépend pas du répertoire où `sbx exec` lance mm : | |
| 184 | + | |
| 185 | +```json | |
| 186 | +{ | |
| 187 | + "agent_servers": { | |
| 188 | + "bob (sandbox)": { | |
| 189 | + "type": "custom", | |
| 190 | + "command": "sbx", | |
| 191 | + "args": ["exec", "-i", "bob-sbx", "mm", "-acp", "-config", "/home/me/bob/.mm/agent.yaml"] | |
| 192 | + } | |
| 193 | + } | |
| 194 | +} | |
| 195 | +``` | |
| 196 | + | |
| 197 | +La sandbox doit exister (`sbx env create --force`) avant que l'éditeur n'ouvre son panneau d'agent. Si `sbx env` répond qu'une sandbox de ce nom « shows no sign of ever being created by sbx env », elle a été créée autrement (`sbx run --name …`) : supprimez-la avec `sbx rm <nom>`, ou changez `name:`. | |
| 189 | 198 | |
| 190 | 199 | ## Le serveur de modèles reste sur l'hôte |
| 191 | 200 | |
| @@ -171,21 +171,30 @@ additionalWorkspaces: | |||
| 171 | - path: ./.mm # lecture seule par-dessus le workspace | 171 | - path: ./.mm # lecture seule par-dessus le workspace |
| 172 | readOnly: true | 172 | readOnly: true |
| 173 | - path: ./.mm/sessions # sessions.dir : de nouveau inscriptible | 173 | - path: ./.mm/sessions # sessions.dir : de nouveau inscriptible |
| 174 | - | ||
| 175 | -args: | ||
| 176 | - PROJECT_DIR: | ||
| 177 | - required: true | ||
| 178 | - | ||
| 179 | -env: | ||
| 180 | - AGENT_CONFIG: ${{ env.args.PROJECT_DIR }}/.mm/agent.yaml | ||
| 181 | ``` | 174 | ``` |
| 182 | 175 | ||
| 183 | - `.mm/` est en lecture seule dans la sandbox : l'agent ne peut modifier ni ses réglages, ni ses skills, ni ses hooks. | 176 | - `.mm/` est en lecture seule dans la sandbox : l'agent ne peut modifier ni ses réglages, ni ses skills, ni ses hooks. |
| 184 | - Les dossiers où mm écrit redeviennent inscriptibles, lus dans le fichier d'agent : `sessions.dir` quand les sessions sont activées, `trace.dir` quand la trace l'est. Leurs chemins sont ceux du fichier d'agent : un montage et un réglage ne peuvent pas diverger. | 177 | - Les dossiers où mm écrit redeviennent inscriptibles, lus dans le fichier d'agent : `sessions.dir` quand les sessions sont activées, `trace.dir` quand la trace l'est. Leurs chemins sont ceux du fichier d'agent : un montage et un réglage ne peuvent pas diverger. |
| 185 | -- `AGENT_CONFIG` désigne le fichier d'agent via `PROJECT_DIR`, le dossier du projet tel que la sandbox le voit (le même chemin que sur votre machine) : ça marche quelle que soit la version de mm du kit et son répertoire de travail, `mm -acp` depuis un éditeur compris. Chaque commande `sbx env` prend alors `--env-arg PROJECT_DIR="$PWD"`, lancée depuis le dossier de `sbxenv.yaml`. | 178 | +- Pas d'`AGENT_CONFIG` : le fichier désigne toujours le dernier kit, et à partir de `mini-me-kit:0.1.5` le kit embarque mm 1.0.7 ou plus récent, qui trouve `.mm/agent.yaml` tout seul quand il démarre dans le workspace. Les commandes ne prennent aucun argument : `sbx env create --force`, `sbx env run --force`. Si la bannière affiche `config: built-in defaults`, le kit a lancé mm ailleurs : ajoutez `env: {AGENT_CONFIG: <chemin absolu de .mm/agent.yaml>}` (le workspace est monté au même chemin que sur votre machine). |
| 186 | - Tous les chemins sont relatifs au dossier de `sbxenv.yaml`, comme sbx les lit : le fichier ne dépend pas de l'endroit où se trouve le projet, et peut être commité. | 179 | - Tous les chemins sont relatifs au dossier de `sbxenv.yaml`, comme sbx les lit : le fichier ne dépend pas de l'endroit où se trouve le projet, et peut être commité. |
| 187 | 180 | ||
| 188 | -Tout ce qui est écrit d'autre sous `.mm/` demande sa propre ligne — un hook qui y tient un journal, par exemple : avec `onError: ignore`, il échouerait sans rien dire. Après avoir changé les sessions ou la trace de l'agent, relancez `mm sbxinit` (répondez `yes` pour remplacer le fichier), puis recréez la sandbox : `sbx env rm --force --env-arg PROJECT_DIR="$PWD"`, puis `sbx env create --force --env-arg PROJECT_DIR="$PWD"` — une sandbox garde les montages de sa création. Si `sbx env` répond qu'une sandbox de ce nom « shows no sign of ever being created by sbx env », elle a été créée autrement (`sbx run --name …`) : supprimez-la avec `sbx rm <nom>`, ou changez `name:`. | 181 | +Tout ce qui est écrit d'autre sous `.mm/` demande sa propre ligne — un hook qui y tient un journal, par exemple : avec `onError: ignore`, il échouerait sans rien dire. Après avoir changé les sessions ou la trace de l'agent, relancez `mm sbxinit` (répondez `yes` pour remplacer le fichier), puis recréez la sandbox : `sbx env rm --force`, puis `sbx env create --force` — une sandbox garde les montages de sa création. Un fichier écrit par `mm sbxinit` 1.0.7 fixe `args.PROJECT_DIR` et `AGENT_CONFIG` : avec un kit 0.1.5 ou plus récent, vous pouvez retirer les deux, comme le fait la version actuelle. |
| 182 | + | ||
| 183 | +Depuis un éditeur, lancez mm dans cette sandbox avec `sbx exec`, et désignez le fichier d'agent par son chemin absolu — ça ne dépend pas du répertoire où `sbx exec` lance mm : | ||
| 184 | + | ||
| 185 | +```json | ||
| 186 | +{ | ||
| 187 | + "agent_servers": { | ||
| 188 | + "bob (sandbox)": { | ||
| 189 | + "type": "custom", | ||
| 190 | + "command": "sbx", | ||
| 191 | + "args": ["exec", "-i", "bob-sbx", "mm", "-acp", "-config", "/home/me/bob/.mm/agent.yaml"] | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | +} | ||
| 195 | +``` | ||
| 196 | + | ||
| 197 | +La sandbox doit exister (`sbx env create --force`) avant que l'éditeur n'ouvre son panneau d'agent. Si `sbx env` répond qu'une sandbox de ce nom « shows no sign of ever being created by sbx env », elle a été créée autrement (`sbx run --name …`) : supprimez-la avec `sbx rm <nom>`, ou changez `name:`. | ||
| 189 | 198 | ||
| 190 | ## Le serveur de modèles reste sur l'hôte | 199 | ## Le serveur de modèles reste sur l'hôte |
| 191 | 200 | ||
modified
docs/fr/reference/cli.md +1 -1 | @@ -226,7 +226,7 @@ La question est posée pour chaque fichier existant, avec `no` par défaut : ce | ||
| 226 | 226 | |--------|---------------|--------| |
| 227 | 227 | | `--workspace` | Le dossier monté par la sandbox, relatif au dossier courant ou absolu. Le fichier contient toujours un chemin absolu | le dossier courant | |
| 228 | 228 | | `--name` | Le nom de l'agent, en minuscules et chiffres reliés par des tirets. La sandbox est `<nom>-sbx` | `acp.name` dans le fichier d'agent, sinon `mm` | |
| 229 | -| `--agent` | Le fichier d'agent qui nomme la sandbox, cherché dans le dossier courant, puis dans le workspace. Sans l'option, `.mm/agent.yaml` est cherché aussi, après `agent.yaml` (l'ordre que suit mm) ; trouvé dans `<workspace>/.mm/`, le fichier monte `.mm/` en lecture seule, remonte en écriture le `sessions.dir` et le `trace.dir` du fichier d'agent (quand ils sont activés et sous `.mm/`), et fixe `AGENT_CONFIG` à `${{ env.args.PROJECT_DIR }}/…/.mm/agent.yaml` avec un argument `PROJECT_DIR` obligatoire ; les chemins sont relatifs au dossier de `sbxenv.yaml`, et les commandes affichées ajoutent `--env-arg PROJECT_DIR="$PWD"` | `agent.yaml`, puis `.mm/agent.yaml` | | |
| 229 | +| `--agent` | Le fichier d'agent qui nomme la sandbox, cherché dans le dossier courant, puis dans le workspace. Sans l'option, `.mm/agent.yaml` est cherché aussi, après `agent.yaml` (l'ordre que suit mm) ; trouvé dans `<workspace>/.mm/`, le fichier monte `.mm/` en lecture seule, remonte en écriture le `sessions.dir` et le `trace.dir` du fichier d'agent (quand ils sont activés et sous `.mm/`), avec des chemins relatifs au dossier de `sbxenv.yaml` ; pas d'`AGENT_CONFIG`, aucun argument — le mm du dernier kit (1.0.7 ou plus récent, à partir de `mini-me-kit:0.1.5`) trouve `.mm/agent.yaml` tout seul | `agent.yaml`, puis `.mm/agent.yaml` | | |
| 230 | 230 | | `--yes` | Ne rien demander. Un fichier existant arrête tout : rien n'est écrasé | désactivé | |
| 231 | 231 | |
| 232 | 232 | Un fichier d'agent hors du workspace ne donne qu'un avertissement : voir [quand le fichier d'agent est hors du workspace](../how-to/run-in-a-docker-sandbox.md#quand-le-fichier-dagent-est-hors-du-workspace). La version de `mini-me-kit` est lue dans sa dernière release sur Rickub, avec une limite de 5 s ; le tag `latest` est utilisé en cas d'échec. Le fichier définit `sandboxOptions.pullPolicy: always`. Pour un fichier existant, la question est posée avec `no` par défaut. Codes de sortie : `0` terminé, `1` un fichier existe et personne ne pouvait répondre, ou écriture en échec, `2` options ou arguments incorrects. |
| @@ -226,7 +226,7 @@ La question est posée pour chaque fichier existant, avec `no` par défaut : ce | |||
| 226 | |--------|---------------|--------| | 226 | |--------|---------------|--------| |
| 227 | | `--workspace` | Le dossier monté par la sandbox, relatif au dossier courant ou absolu. Le fichier contient toujours un chemin absolu | le dossier courant | | 227 | | `--workspace` | Le dossier monté par la sandbox, relatif au dossier courant ou absolu. Le fichier contient toujours un chemin absolu | le dossier courant | |
| 228 | | `--name` | Le nom de l'agent, en minuscules et chiffres reliés par des tirets. La sandbox est `<nom>-sbx` | `acp.name` dans le fichier d'agent, sinon `mm` | | 228 | | `--name` | Le nom de l'agent, en minuscules et chiffres reliés par des tirets. La sandbox est `<nom>-sbx` | `acp.name` dans le fichier d'agent, sinon `mm` | |
| 229 | -| `--agent` | Le fichier d'agent qui nomme la sandbox, cherché dans le dossier courant, puis dans le workspace. Sans l'option, `.mm/agent.yaml` est cherché aussi, après `agent.yaml` (l'ordre que suit mm) ; trouvé dans `<workspace>/.mm/`, le fichier monte `.mm/` en lecture seule, remonte en écriture le `sessions.dir` et le `trace.dir` du fichier d'agent (quand ils sont activés et sous `.mm/`), et fixe `AGENT_CONFIG` à `${{ env.args.PROJECT_DIR }}/…/.mm/agent.yaml` avec un argument `PROJECT_DIR` obligatoire ; les chemins sont relatifs au dossier de `sbxenv.yaml`, et les commandes affichées ajoutent `--env-arg PROJECT_DIR="$PWD"` | `agent.yaml`, puis `.mm/agent.yaml` | | 229 | +| `--agent` | Le fichier d'agent qui nomme la sandbox, cherché dans le dossier courant, puis dans le workspace. Sans l'option, `.mm/agent.yaml` est cherché aussi, après `agent.yaml` (l'ordre que suit mm) ; trouvé dans `<workspace>/.mm/`, le fichier monte `.mm/` en lecture seule, remonte en écriture le `sessions.dir` et le `trace.dir` du fichier d'agent (quand ils sont activés et sous `.mm/`), avec des chemins relatifs au dossier de `sbxenv.yaml` ; pas d'`AGENT_CONFIG`, aucun argument — le mm du dernier kit (1.0.7 ou plus récent, à partir de `mini-me-kit:0.1.5`) trouve `.mm/agent.yaml` tout seul | `agent.yaml`, puis `.mm/agent.yaml` | |
| 230 | | `--yes` | Ne rien demander. Un fichier existant arrête tout : rien n'est écrasé | désactivé | | 230 | | `--yes` | Ne rien demander. Un fichier existant arrête tout : rien n'est écrasé | désactivé | |
| 231 | 231 | ||
| 232 | Un fichier d'agent hors du workspace ne donne qu'un avertissement : voir [quand le fichier d'agent est hors du workspace](../how-to/run-in-a-docker-sandbox.md#quand-le-fichier-dagent-est-hors-du-workspace). La version de `mini-me-kit` est lue dans sa dernière release sur Rickub, avec une limite de 5 s ; le tag `latest` est utilisé en cas d'échec. Le fichier définit `sandboxOptions.pullPolicy: always`. Pour un fichier existant, la question est posée avec `no` par défaut. Codes de sortie : `0` terminé, `1` un fichier existe et personne ne pouvait répondre, ou écriture en échec, `2` options ou arguments incorrects. | 232 | Un fichier d'agent hors du workspace ne donne qu'un avertissement : voir [quand le fichier d'agent est hors du workspace](../how-to/run-in-a-docker-sandbox.md#quand-le-fichier-dagent-est-hors-du-workspace). La version de `mini-me-kit` est lue dans sa dernière release sur Rickub, avec une limite de 5 s ; le tag `latest` est utilisé en cas d'échec. Le fichier définit `sandboxOptions.pullPolicy: always`. Pour un fichier existant, la question est posée avec `no` par défaut. Codes de sortie : `0` terminé, `1` un fichier existe et personne ne pouvait répondre, ou écriture en échec, `2` options ou arguments incorrects. |
modified
internal/sbxinit/mmfolder.go +7 -26 | @@ -11,9 +11,10 @@ import ( | ||
| 11 | 11 | ) |
| 12 | 12 | |
| 13 | 13 | // MMFolder is a project whose agent is <workspace>/.mm/<file> (ticket 208): |
| 14 | -// the sandbox mounts .mm/ read-only over the workspace, gives write access | |
| 15 | -// back to the folders mm writes in, and names the agent file through the | |
| 16 | -// PROJECT_DIR argument — like the user's bob-the-bot/sbxenv.yaml. Its paths | |
| 14 | +// the sandbox mounts .mm/ read-only over the workspace and gives write access | |
| 15 | +// back to the folders mm writes in. The agent file is not named: the kit | |
| 16 | +// (always the latest, mini-me-kit 0.1.5 or later) ships mm 1.0.7+, which | |
| 17 | +// finds .mm/agent.yaml on its own from the workspace (ticket 209). Its paths | |
| 17 | 18 | // are written relative to Base, the folder of sbxenv.yaml, which is how sbx |
| 18 | 19 | // reads them: the file does not depend on where the project is. |
| 19 | 20 | type MMFolder struct { |
| @@ -114,24 +115,11 @@ func (m *MMFolder) workspace(absolute string) string { | ||
| 114 | 115 | return m.rel(absolute) |
| 115 | 116 | } |
| 116 | 117 | |
| 117 | -// envArg is what every sbx env command of a .mm project needs. | |
| 118 | -func (m *MMFolder) envArg() string { | |
| 119 | - if m == nil { | |
| 120 | - return "" | |
| 121 | - } | |
| 122 | - return ` --env-arg PROJECT_DIR="$PWD"` | |
| 123 | -} | |
| 124 | - | |
| 125 | 118 | // block is the part of sbxenv.yaml a .mm project adds after the workspace. |
| 126 | 119 | func (m *MMFolder) block() string { |
| 127 | 120 | if m == nil { |
| 128 | 121 | return "" |
| 129 | 122 | } |
| 130 | - agent := m.rel(m.Agent) | |
| 131 | - config := "${{ env.args.PROJECT_DIR }}/" + strings.TrimPrefix(agent, "./") | |
| 132 | - if !strings.HasPrefix(agent, "./") { | |
| 133 | - config = agent // not below the folder of sbxenv.yaml: its own path | |
| 134 | - } | |
| 135 | 123 | var b strings.Builder |
| 136 | 124 | b.WriteString(` |
| 137 | 125 | # The agent is .mm/agent.yaml (mm init --project yes). .mm/ is mounted |
| @@ -148,16 +136,9 @@ additionalWorkspaces: | ||
| 148 | 136 | b.WriteString(" - path: " + yamlScalar(m.rel(w.Path)) + " # " + w.Key + "\n") |
| 149 | 137 | } |
| 150 | 138 | b.WriteString(` |
| 151 | -# This folder as the sandbox sees it: give it on every sbx env command, | |
| 152 | -# --env-arg PROJECT_DIR="$PWD". | |
| 153 | -args: | |
| 154 | - PROJECT_DIR: | |
| 155 | - required: true | |
| 156 | - | |
| 157 | -env: | |
| 158 | - # mm, mm tui and mm -acp read this agent, whatever mm's version and its | |
| 159 | - # working directory. | |
| 160 | - AGENT_CONFIG: ` + yamlScalar(config) + ` | |
| 139 | +# No AGENT_CONFIG: the kit's mm (1.0.7 or later) starts in the workspace and | |
| 140 | +# finds .mm/agent.yaml on its own. An editor that runs mm with sbx exec names | |
| 141 | +# it with -config (see the how-to). | |
| 161 | 142 | `) |
| 162 | 143 | return b.String() |
| 163 | 144 | } |
| @@ -11,9 +11,10 @@ import ( | |||
| 11 | ) | 11 | ) |
| 12 | 12 | ||
| 13 | // MMFolder is a project whose agent is <workspace>/.mm/<file> (ticket 208): | 13 | // MMFolder is a project whose agent is <workspace>/.mm/<file> (ticket 208): |
| 14 | -// the sandbox mounts .mm/ read-only over the workspace, gives write access | 14 | +// the sandbox mounts .mm/ read-only over the workspace and gives write access |
| 15 | -// back to the folders mm writes in, and names the agent file through the | 15 | +// back to the folders mm writes in. The agent file is not named: the kit |
| 16 | -// PROJECT_DIR argument — like the user's bob-the-bot/sbxenv.yaml. Its paths | 16 | +// (always the latest, mini-me-kit 0.1.5 or later) ships mm 1.0.7+, which |
| 17 | +// finds .mm/agent.yaml on its own from the workspace (ticket 209). Its paths | ||
| 17 | // are written relative to Base, the folder of sbxenv.yaml, which is how sbx | 18 | // are written relative to Base, the folder of sbxenv.yaml, which is how sbx |
| 18 | // reads them: the file does not depend on where the project is. | 19 | // reads them: the file does not depend on where the project is. |
| 19 | type MMFolder struct { | 20 | type MMFolder struct { |
| @@ -114,24 +115,11 @@ func (m *MMFolder) workspace(absolute string) string { | |||
| 114 | return m.rel(absolute) | 115 | return m.rel(absolute) |
| 115 | } | 116 | } |
| 116 | 117 | ||
| 117 | -// envArg is what every sbx env command of a .mm project needs. | ||
| 118 | -func (m *MMFolder) envArg() string { | ||
| 119 | - if m == nil { | ||
| 120 | - return "" | ||
| 121 | - } | ||
| 122 | - return ` --env-arg PROJECT_DIR="$PWD"` | ||
| 123 | -} | ||
| 124 | - | ||
| 125 | // block is the part of sbxenv.yaml a .mm project adds after the workspace. | 118 | // block is the part of sbxenv.yaml a .mm project adds after the workspace. |
| 126 | func (m *MMFolder) block() string { | 119 | func (m *MMFolder) block() string { |
| 127 | if m == nil { | 120 | if m == nil { |
| 128 | return "" | 121 | return "" |
| 129 | } | 122 | } |
| 130 | - agent := m.rel(m.Agent) | ||
| 131 | - config := "${{ env.args.PROJECT_DIR }}/" + strings.TrimPrefix(agent, "./") | ||
| 132 | - if !strings.HasPrefix(agent, "./") { | ||
| 133 | - config = agent // not below the folder of sbxenv.yaml: its own path | ||
| 134 | - } | ||
| 135 | var b strings.Builder | 123 | var b strings.Builder |
| 136 | b.WriteString(` | 124 | b.WriteString(` |
| 137 | # The agent is .mm/agent.yaml (mm init --project yes). .mm/ is mounted | 125 | # The agent is .mm/agent.yaml (mm init --project yes). .mm/ is mounted |
| @@ -148,16 +136,9 @@ additionalWorkspaces: | |||
| 148 | b.WriteString(" - path: " + yamlScalar(m.rel(w.Path)) + " # " + w.Key + "\n") | 136 | b.WriteString(" - path: " + yamlScalar(m.rel(w.Path)) + " # " + w.Key + "\n") |
| 149 | } | 137 | } |
| 150 | b.WriteString(` | 138 | b.WriteString(` |
| 151 | -# This folder as the sandbox sees it: give it on every sbx env command, | 139 | +# No AGENT_CONFIG: the kit's mm (1.0.7 or later) starts in the workspace and |
| 152 | -# --env-arg PROJECT_DIR="$PWD". | 140 | +# finds .mm/agent.yaml on its own. An editor that runs mm with sbx exec names |
| 153 | -args: | 141 | +# it with -config (see the how-to). |
| 154 | - PROJECT_DIR: | ||
| 155 | - required: true | ||
| 156 | - | ||
| 157 | -env: | ||
| 158 | - # mm, mm tui and mm -acp read this agent, whatever mm's version and its | ||
| 159 | - # working directory. | ||
| 160 | - AGENT_CONFIG: ` + yamlScalar(config) + ` | ||
| 161 | `) | 142 | `) |
| 162 | return b.String() | 143 | return b.String() |
| 163 | } | 144 | } |
modified
internal/sbxinit/sbxinit.go +4 -4 | @@ -83,9 +83,9 @@ workspace: %[4]s | ||
| 83 | 83 | sandboxOptions: |
| 84 | 84 | pullPolicy: always |
| 85 | 85 | |
| 86 | -# sbx env create --force%[6]s | |
| 87 | -# sbx env rm --force%[6]s | |
| 88 | -`, name, howToURL, kitTag, yamlScalar(mm.workspace(workspace)), mm.block(), mm.envArg()) | |
| 86 | +# sbx env create --force | |
| 87 | +# sbx env rm --force | |
| 88 | +`, name, howToURL, kitTag, yamlScalar(mm.workspace(workspace)), mm.block()) | |
| 89 | 89 | return text |
| 90 | 90 | } |
| 91 | 91 | |
| @@ -166,7 +166,7 @@ func run(args []string, stdin io.Reader, stdout io.Writer, latest func() (string | ||
| 166 | 166 | } |
| 167 | 167 | fmt.Fprintln(stdout) |
| 168 | 168 | } |
| 169 | - fmt.Fprintf(stdout, "\nCreate the sandbox %s:\n sbx env create --force%s\n\nRemove it:\n sbx env rm --force%s\n", sandbox, mmFolder.envArg(), mmFolder.envArg()) | |
| 169 | + fmt.Fprintf(stdout, "\nCreate the sandbox %s:\n sbx env create --force\n\nRemove it:\n sbx env rm --force\n", sandbox) | |
| 170 | 170 | } |
| 171 | 171 | return 0 |
| 172 | 172 | } |
| @@ -83,9 +83,9 @@ workspace: %[4]s | |||
| 83 | sandboxOptions: | 83 | sandboxOptions: |
| 84 | pullPolicy: always | 84 | pullPolicy: always |
| 85 | 85 | ||
| 86 | -# sbx env create --force%[6]s | 86 | +# sbx env create --force |
| 87 | -# sbx env rm --force%[6]s | 87 | +# sbx env rm --force |
| 88 | -`, name, howToURL, kitTag, yamlScalar(mm.workspace(workspace)), mm.block(), mm.envArg()) | 88 | +`, name, howToURL, kitTag, yamlScalar(mm.workspace(workspace)), mm.block()) |
| 89 | return text | 89 | return text |
| 90 | } | 90 | } |
| 91 | 91 | ||
| @@ -166,7 +166,7 @@ func run(args []string, stdin io.Reader, stdout io.Writer, latest func() (string | |||
| 166 | } | 166 | } |
| 167 | fmt.Fprintln(stdout) | 167 | fmt.Fprintln(stdout) |
| 168 | } | 168 | } |
| 169 | - fmt.Fprintf(stdout, "\nCreate the sandbox %s:\n sbx env create --force%s\n\nRemove it:\n sbx env rm --force%s\n", sandbox, mmFolder.envArg(), mmFolder.envArg()) | 169 | + fmt.Fprintf(stdout, "\nCreate the sandbox %s:\n sbx env create --force\n\nRemove it:\n sbx env rm --force\n", sandbox) |
| 170 | } | 170 | } |
| 171 | return 0 | 171 | return 0 |
| 172 | } | 172 | } |
modified
internal/sbxinit/sbxinit_test.go +12 -8 | @@ -256,11 +256,12 @@ func TestTheDocumentationLinkNamesAFileOfTheRepository(t *testing.T) { | ||
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | -// Ticket 208: a project made with `mm init --project yes` has only | |
| 260 | -// .mm/agent.yaml. Like the user's bob-the-bot/sbxenv.yaml: .mm/ read-only, | |
| 261 | -// the folders mm writes in writable again, AGENT_CONFIG through PROJECT_DIR — | |
| 259 | +// Tickets 208 and 209: a project made with `mm init --project yes` has only | |
| 260 | +// .mm/agent.yaml. .mm/ read-only, the folders mm writes in writable again, | |
| 262 | 261 | // every path relative to the folder of sbxenv.yaml, so the file can be |
| 263 | -// committed — and --env-arg on every command shown. | |
| 262 | +// committed. No AGENT_CONFIG and no PROJECT_DIR: the kit is always the latest | |
| 263 | +// (0.1.5 or later), whose mm finds .mm/agent.yaml on its own — so no | |
| 264 | +// --env-arg in the commands either. | |
| 264 | 265 | func TestMainMountsTheMMFolderReadOnly(t *testing.T) { |
| 265 | 266 | agent := "acp:\n name: Bob The Bot\nsessions:\n enabled: true\n dir: .mm/sessions\ntrace:\n enabled: true\n dir: .mm/trace\n" |
| 266 | 267 | _, code, out := runIn(t, map[string]string{".mm/agent.yaml": agent}, "", version) |
| @@ -268,14 +269,17 @@ func TestMainMountsTheMMFolderReadOnly(t *testing.T) { | ||
| 268 | 269 | t.Fatalf("exit %d:\n%s", code, out) |
| 269 | 270 | } |
| 270 | 271 | got := readSbxEnv(t) |
| 271 | - if got.Name != "bob-the-bot-sbx" || got.Workspace != "." || !got.Args["PROJECT_DIR"]["required"] || got.Env["AGENT_CONFIG"] != "${{ env.args.PROJECT_DIR }}/.mm/agent.yaml" { | |
| 272 | + if got.Name != "bob-the-bot-sbx" || got.Workspace != "." || got.Args != nil || got.Env != nil { | |
| 272 | 273 | t.Errorf("name %q, workspace %q, args %v, env %v", got.Name, got.Workspace, got.Args, got.Env) |
| 273 | 274 | } |
| 274 | 275 | if want := "./.mm ro, ./.mm/sessions, ./.mm/trace"; got.mounts() != want { |
| 275 | 276 | t.Errorf("additionalWorkspaces = %s, want %s", got.mounts(), want) |
| 276 | 277 | } |
| 277 | - if !strings.Contains(out, `sbx env create --force --env-arg PROJECT_DIR="$PWD"`) || !strings.Contains(readFile(t), `# sbx env rm --force --env-arg PROJECT_DIR="$PWD"`) { | |
| 278 | - t.Errorf("the commands lack --env-arg:\n%s", out) | |
| 278 | + if strings.Contains(out, "--env-arg") || strings.Contains(readFile(t), "PROJECT_DIR") { | |
| 279 | + t.Errorf("PROJECT_DIR is still asked for:\n%s\n%s", out, readFile(t)) | |
| 280 | + } | |
| 281 | + if !strings.Contains(readFile(t), "finds .mm/agent.yaml on its own") { | |
| 282 | + t.Errorf("the file does not say why there is no AGENT_CONFIG:\n%s", readFile(t)) | |
| 279 | 283 | } |
| 280 | 284 | } |
| 281 | 285 | |
| @@ -287,7 +291,7 @@ func TestMMFolderInASubWorkspace(t *testing.T) { | ||
| 287 | 291 | t.Fatalf("exit %d:\n%s", code, out) |
| 288 | 292 | } |
| 289 | 293 | got := readSbxEnv(t) |
| 290 | - if got.Workspace != "./work" || got.Env["AGENT_CONFIG"] != "${{ env.args.PROJECT_DIR }}/work/.mm/agent.yaml" || got.mounts() != "./work/.mm ro, ./work/.mm/sessions" { | |
| 294 | + if got.Workspace != "./work" || got.Env != nil || got.mounts() != "./work/.mm ro, ./work/.mm/sessions" { | |
| 291 | 295 | t.Errorf("workspace %q, env %v, mounts %s", got.Workspace, got.Env, got.mounts()) |
| 292 | 296 | } |
| 293 | 297 | } |
| @@ -256,11 +256,12 @@ func TestTheDocumentationLinkNamesAFileOfTheRepository(t *testing.T) { | |||
| 256 | } | 256 | } |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | -// Ticket 208: a project made with `mm init --project yes` has only | 259 | +// Tickets 208 and 209: a project made with `mm init --project yes` has only |
| 260 | -// .mm/agent.yaml. Like the user's bob-the-bot/sbxenv.yaml: .mm/ read-only, | 260 | +// .mm/agent.yaml. .mm/ read-only, the folders mm writes in writable again, |
| 261 | -// the folders mm writes in writable again, AGENT_CONFIG through PROJECT_DIR — | ||
| 262 | // every path relative to the folder of sbxenv.yaml, so the file can be | 261 | // every path relative to the folder of sbxenv.yaml, so the file can be |
| 263 | -// committed — and --env-arg on every command shown. | 262 | +// committed. No AGENT_CONFIG and no PROJECT_DIR: the kit is always the latest |
| 263 | +// (0.1.5 or later), whose mm finds .mm/agent.yaml on its own — so no | ||
| 264 | +// --env-arg in the commands either. | ||
| 264 | func TestMainMountsTheMMFolderReadOnly(t *testing.T) { | 265 | func TestMainMountsTheMMFolderReadOnly(t *testing.T) { |
| 265 | agent := "acp:\n name: Bob The Bot\nsessions:\n enabled: true\n dir: .mm/sessions\ntrace:\n enabled: true\n dir: .mm/trace\n" | 266 | agent := "acp:\n name: Bob The Bot\nsessions:\n enabled: true\n dir: .mm/sessions\ntrace:\n enabled: true\n dir: .mm/trace\n" |
| 266 | _, code, out := runIn(t, map[string]string{".mm/agent.yaml": agent}, "", version) | 267 | _, code, out := runIn(t, map[string]string{".mm/agent.yaml": agent}, "", version) |
| @@ -268,14 +269,17 @@ func TestMainMountsTheMMFolderReadOnly(t *testing.T) { | |||
| 268 | t.Fatalf("exit %d:\n%s", code, out) | 269 | t.Fatalf("exit %d:\n%s", code, out) |
| 269 | } | 270 | } |
| 270 | got := readSbxEnv(t) | 271 | got := readSbxEnv(t) |
| 271 | - if got.Name != "bob-the-bot-sbx" || got.Workspace != "." || !got.Args["PROJECT_DIR"]["required"] || got.Env["AGENT_CONFIG"] != "${{ env.args.PROJECT_DIR }}/.mm/agent.yaml" { | 272 | + if got.Name != "bob-the-bot-sbx" || got.Workspace != "." || got.Args != nil || got.Env != nil { |
| 272 | t.Errorf("name %q, workspace %q, args %v, env %v", got.Name, got.Workspace, got.Args, got.Env) | 273 | t.Errorf("name %q, workspace %q, args %v, env %v", got.Name, got.Workspace, got.Args, got.Env) |
| 273 | } | 274 | } |
| 274 | if want := "./.mm ro, ./.mm/sessions, ./.mm/trace"; got.mounts() != want { | 275 | if want := "./.mm ro, ./.mm/sessions, ./.mm/trace"; got.mounts() != want { |
| 275 | t.Errorf("additionalWorkspaces = %s, want %s", got.mounts(), want) | 276 | t.Errorf("additionalWorkspaces = %s, want %s", got.mounts(), want) |
| 276 | } | 277 | } |
| 277 | - if !strings.Contains(out, `sbx env create --force --env-arg PROJECT_DIR="$PWD"`) || !strings.Contains(readFile(t), `# sbx env rm --force --env-arg PROJECT_DIR="$PWD"`) { | 278 | + if strings.Contains(out, "--env-arg") || strings.Contains(readFile(t), "PROJECT_DIR") { |
| 278 | - t.Errorf("the commands lack --env-arg:\n%s", out) | 279 | + t.Errorf("PROJECT_DIR is still asked for:\n%s\n%s", out, readFile(t)) |
| 280 | + } | ||
| 281 | + if !strings.Contains(readFile(t), "finds .mm/agent.yaml on its own") { | ||
| 282 | + t.Errorf("the file does not say why there is no AGENT_CONFIG:\n%s", readFile(t)) | ||
| 279 | } | 283 | } |
| 280 | } | 284 | } |
| 281 | 285 | ||
| @@ -287,7 +291,7 @@ func TestMMFolderInASubWorkspace(t *testing.T) { | |||
| 287 | t.Fatalf("exit %d:\n%s", code, out) | 291 | t.Fatalf("exit %d:\n%s", code, out) |
| 288 | } | 292 | } |
| 289 | got := readSbxEnv(t) | 293 | got := readSbxEnv(t) |
| 290 | - if got.Workspace != "./work" || got.Env["AGENT_CONFIG"] != "${{ env.args.PROJECT_DIR }}/work/.mm/agent.yaml" || got.mounts() != "./work/.mm ro, ./work/.mm/sessions" { | 294 | + if got.Workspace != "./work" || got.Env != nil || got.mounts() != "./work/.mm ro, ./work/.mm/sessions" { |
| 291 | t.Errorf("workspace %q, env %v, mounts %s", got.Workspace, got.Env, got.mounts()) | 295 | t.Errorf("workspace %q, env %v, mounts %s", got.Workspace, got.Env, got.mounts()) |
| 292 | } | 296 | } |
| 293 | } | 297 | } |