bots-garden/sidekickspublic Fork
⑂ 0bd44f0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/sidekicks.git
git clone ssh://git@rickub.com/bots-garden/sidekicks.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

#99 Nom @ créé à partir du nom affiché dans les assistants

Le nom @ suit le nom affiché tant qu'il n'est pas tapé à la main
(sbxNameFromTitle sans « _ » pour une sandbox) ; Go renvoie les noms pris
(agents, dossiers, sandboxes) et l'interface propose une variante libre
et prévient avant l'envoi. L'assistant mini-me a son nom affiché.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agent committed 2026-11-15T04:25:02+01:00 Browse files
0bd44f0 parent: bb1554b
modified .tickets/issues/0099-assistants-nom-utilise-avec-cree-a-partir-du-nom.yaml +29 -7
@@ -6,7 +6,7 @@ author:
66 name: k33g
77 email: ph.charriere@gmail.com
88 createdAt: 2026-11-15T03:18:04.000Z
9-updatedAt: 2026-11-15T03:18:04.000Z
9+updatedAt: 2026-11-15T03:25:02.000Z
1010 labels:
1111 - kind::feature
1212 - area::ui
@@ -42,42 +42,64 @@ body: |
4242 tasks:
4343 - id: 1
4444 title: "Dérivation du nom @ depuis le nom affiché (agentform nameFromTitle ; variante sans _ pour sbx) et suivi tant qu'il n'est pas modifié"
45- state: open
45+ state: closed
4646 priority: high
4747 author:
4848 name: k33g
4949 email: ph.charriere@gmail.com
5050 createdAt: 2026-11-15T03:18:04.000Z
51+ updatedAt: 2026-11-15T03:25:02.000Z
52+ closedAt: 2026-11-15T03:25:02.000Z
5153 - id: 2
5254 title: "Variante libre proposée (agent, dossier, sandbox) avant l'envoi"
53- state: open
55+ state: closed
5456 priority: medium
5557 author:
5658 name: k33g
5759 email: ph.charriere@gmail.com
5860 createdAt: 2026-11-15T03:18:04.000Z
61+ updatedAt: 2026-11-15T03:25:02.000Z
62+ closedAt: 2026-11-15T03:25:02.000Z
5963 - id: 3
6064 title: "Assistant des sandboxes : nom affiché d'abord, nom @ qui suit"
61- state: open
65+ state: closed
6266 priority: high
6367 author:
6468 name: k33g
6569 email: ph.charriere@gmail.com
6670 createdAt: 2026-11-15T03:18:04.000Z
71+ updatedAt: 2026-11-15T03:25:02.000Z
72+ closedAt: 2026-11-15T03:25:02.000Z
6773 - id: 4
6874 title: "Assistant mini-me : ajouter le nom affiché (prérempli par mm), nom @ qui suit"
69- state: open
75+ state: closed
7076 priority: high
7177 author:
7278 name: k33g
7379 email: ph.charriere@gmail.com
7480 createdAt: 2026-11-15T03:18:04.000Z
81+ updatedAt: 2026-11-15T03:25:02.000Z
82+ closedAt: 2026-11-15T03:25:02.000Z
7583 - id: 5
7684 title: "Tests vitest, textes EN + FR, doc des guides"
77- state: open
85+ state: closed
7886 priority: medium
7987 author:
8088 name: k33g
8189 email: ph.charriere@gmail.com
8290 createdAt: 2026-11-15T03:18:04.000Z
83-comments: []
91+ updatedAt: 2026-11-15T03:25:02.000Z
92+ closedAt: 2026-11-15T03:25:02.000Z
93+comments:
94+ - id: 1
95+ author:
96+ name: k33g
97+ email: ph.charriere@gmail.com
98+ createdAt: 2026-11-15T03:25:02.000Z
99+ body: |
100+ Implémenté sur `feature/98-99-100` : `sbxNameFromTitle` et `freeName` (`lib/creator.ts`) ; Go renvoie les
101+ noms pris (`SbxCheck.taken`, `CreatorStart.taken` : agents, dossiers, sandboxes) ; dans les deux assistants le
102+ nom @ suit le nom affiché tant qu'il n'est pas tapé à la main, un nom pris est signalé avant l'envoi avec une
103+ suggestion ; l'assistant mini-me a son champ « Nom affiché » (prérempli par mm, transmis à `Finish` en
104+ `title`). Pour mini-me, le nom @ part du nom donné à mm (`marcel`) et ne suit le nom affiché qu'une fois
105+ celui-ci modifié. Tests Go et vitest, svelte-check ; doc des deux guides et de la référence.
@@ -6,7 +6,7 @@ author:
6 name: k33g6 name: k33g
7 email: ph.charriere@gmail.com7 email: ph.charriere@gmail.com
8 createdAt: 2026-11-15T03:18:04.000Z8 createdAt: 2026-11-15T03:18:04.000Z
9-updatedAt: 2026-11-15T03:18:04.000Z9+updatedAt: 2026-11-15T03:25:02.000Z
10 labels:10 labels:
11 - kind::feature11 - kind::feature
12 - area::ui12 - area::ui
@@ -42,42 +42,64 @@ body: |
42 tasks:42 tasks:
43 - id: 143 - id: 1
44 title: "Dérivation du nom @ depuis le nom affiché (agentform nameFromTitle ; variante sans _ pour sbx) et suivi tant qu'il n'est pas modifié"44 title: "Dérivation du nom @ depuis le nom affiché (agentform nameFromTitle ; variante sans _ pour sbx) et suivi tant qu'il n'est pas modifié"
45- state: open45+ state: closed
46 priority: high46 priority: high
47 author:47 author:
48 name: k33g48 name: k33g
49 email: ph.charriere@gmail.com49 email: ph.charriere@gmail.com
50 createdAt: 2026-11-15T03:18:04.000Z50 createdAt: 2026-11-15T03:18:04.000Z
51+ updatedAt: 2026-11-15T03:25:02.000Z
52+ closedAt: 2026-11-15T03:25:02.000Z
51 - id: 253 - id: 2
52 title: "Variante libre proposée (agent, dossier, sandbox) avant l'envoi"54 title: "Variante libre proposée (agent, dossier, sandbox) avant l'envoi"
53- state: open55+ state: closed
54 priority: medium56 priority: medium
55 author:57 author:
56 name: k33g58 name: k33g
57 email: ph.charriere@gmail.com59 email: ph.charriere@gmail.com
58 createdAt: 2026-11-15T03:18:04.000Z60 createdAt: 2026-11-15T03:18:04.000Z
61+ updatedAt: 2026-11-15T03:25:02.000Z
62+ closedAt: 2026-11-15T03:25:02.000Z
59 - id: 363 - id: 3
60 title: "Assistant des sandboxes : nom affiché d'abord, nom @ qui suit"64 title: "Assistant des sandboxes : nom affiché d'abord, nom @ qui suit"
61- state: open65+ state: closed
62 priority: high66 priority: high
63 author:67 author:
64 name: k33g68 name: k33g
65 email: ph.charriere@gmail.com69 email: ph.charriere@gmail.com
66 createdAt: 2026-11-15T03:18:04.000Z70 createdAt: 2026-11-15T03:18:04.000Z
71+ updatedAt: 2026-11-15T03:25:02.000Z
72+ closedAt: 2026-11-15T03:25:02.000Z
67 - id: 473 - id: 4
68 title: "Assistant mini-me : ajouter le nom affiché (prérempli par mm), nom @ qui suit"74 title: "Assistant mini-me : ajouter le nom affiché (prérempli par mm), nom @ qui suit"
69- state: open75+ state: closed
70 priority: high76 priority: high
71 author:77 author:
72 name: k33g78 name: k33g
73 email: ph.charriere@gmail.com79 email: ph.charriere@gmail.com
74 createdAt: 2026-11-15T03:18:04.000Z80 createdAt: 2026-11-15T03:18:04.000Z
81+ updatedAt: 2026-11-15T03:25:02.000Z
82+ closedAt: 2026-11-15T03:25:02.000Z
75 - id: 583 - id: 5
76 title: "Tests vitest, textes EN + FR, doc des guides"84 title: "Tests vitest, textes EN + FR, doc des guides"
77- state: open85+ state: closed
78 priority: medium86 priority: medium
79 author:87 author:
80 name: k33g88 name: k33g
81 email: ph.charriere@gmail.com89 email: ph.charriere@gmail.com
82 createdAt: 2026-11-15T03:18:04.000Z90 createdAt: 2026-11-15T03:18:04.000Z
83-comments: []91+ updatedAt: 2026-11-15T03:25:02.000Z
92+ closedAt: 2026-11-15T03:25:02.000Z
93+comments:
94+ - id: 1
95+ author:
96+ name: k33g
97+ email: ph.charriere@gmail.com
98+ createdAt: 2026-11-15T03:25:02.000Z
99+ body: |
100+ Implémenté sur `feature/98-99-100` : `sbxNameFromTitle` et `freeName` (`lib/creator.ts`) ; Go renvoie les
101+ noms pris (`SbxCheck.taken`, `CreatorStart.taken` : agents, dossiers, sandboxes) ; dans les deux assistants le
102+ nom @ suit le nom affiché tant qu'il n'est pas tapé à la main, un nom pris est signalé avant l'envoi avec une
103+ suggestion ; l'assistant mini-me a son champ « Nom affiché » (prérempli par mm, transmis à `Finish` en
104+ `title`). Pour mini-me, le nom @ part du nom donné à mm (`marcel`) et ne suit le nom affiché qu'une fois
105+ celui-ci modifié. Tests Go et vitest, svelte-check ; doc des deux guides et de la référence.
modified docs/en/how-to/create-a-mini-me-agent.md +2 -1
@@ -7,7 +7,8 @@ This guide shows how to create a new [mini-me](https://git.rickub.com/bots-garde
77 1. Open the assistant: **✨ Create my first agent** on the welcome screen, **✨ Create a mini-me agent** under the agents list, or **Create a mini-me agent** in the command palette (⌘K, Ctrl+K on Linux and Windows).
88 2. Answer the questions of mini-me, a few at a time: the model server, the model, what the agent is for, which machine runs the model, whether it asks before each command or file change, the agent's name… Each question comes with mini-me's default: **Next →** takes it. **About these choices** explains the options.
99 3. When mini-me has written the agent, give its last details:
10- - **Name**: what you call it with in a conversation (`@marcel`), and the name of its folder. It starts from the name you gave mini-me; lowercase letters, digits, `-` and `_`, starting with a letter.
10+ - **Name shown**: mini-me's (`Marcel (developer)`), which you can change.
11+ - **Name**: what you call it with in a conversation (`@marcel`), and the name of its folder. It starts from the name you gave mini-me, then follows the **Name shown** when you change it, until you type it yourself; lowercase letters, digits, `-` and `_`, starting with a letter. A name already used is said before you click, with a free one to try.
1112 - **Emoji**: pick one, or type any emoji.
1213 - **Where does it run?** **On this computer** (the simplest), **In a Docker container** (Docker must be installed) or **In a Docker Sandbox (sbx)** (sbx must be installed).
1314 4. Click **Add the agent**. Its direct conversation opens: write to it.
@@ -7,7 +7,8 @@ This guide shows how to create a new [mini-me](https://git.rickub.com/bots-garde
7 1. Open the assistant: **✨ Create my first agent** on the welcome screen, **✨ Create a mini-me agent** under the agents list, or **Create a mini-me agent** in the command palette (⌘K, Ctrl+K on Linux and Windows).7 1. Open the assistant: **✨ Create my first agent** on the welcome screen, **✨ Create a mini-me agent** under the agents list, or **Create a mini-me agent** in the command palette (⌘K, Ctrl+K on Linux and Windows).
8 2. Answer the questions of mini-me, a few at a time: the model server, the model, what the agent is for, which machine runs the model, whether it asks before each command or file change, the agent's name… Each question comes with mini-me's default: **Next →** takes it. **About these choices** explains the options.8 2. Answer the questions of mini-me, a few at a time: the model server, the model, what the agent is for, which machine runs the model, whether it asks before each command or file change, the agent's name… Each question comes with mini-me's default: **Next →** takes it. **About these choices** explains the options.
9 3. When mini-me has written the agent, give its last details:9 3. When mini-me has written the agent, give its last details:
10- - **Name**: what you call it with in a conversation (`@marcel`), and the name of its folder. It starts from the name you gave mini-me; lowercase letters, digits, `-` and `_`, starting with a letter.10+ - **Name shown**: mini-me's (`Marcel (developer)`), which you can change.
11+ - **Name**: what you call it with in a conversation (`@marcel`), and the name of its folder. It starts from the name you gave mini-me, then follows the **Name shown** when you change it, until you type it yourself; lowercase letters, digits, `-` and `_`, starting with a letter. A name already used is said before you click, with a free one to try.
11 - **Emoji**: pick one, or type any emoji.12 - **Emoji**: pick one, or type any emoji.
12 - **Where does it run?** **On this computer** (the simplest), **In a Docker container** (Docker must be installed) or **In a Docker Sandbox (sbx)** (sbx must be installed).13 - **Where does it run?** **On this computer** (the simplest), **In a Docker container** (Docker must be installed) or **In a Docker Sandbox (sbx)** (sbx must be installed).
13 4. Click **Add the agent**. Its direct conversation opens: write to it.14 4. Click **Add the agent**. Its direct conversation opens: write to it.
modified docs/en/how-to/create-an-agent-in-a-sandbox.md +1 -1
@@ -7,7 +7,7 @@ This guide shows how to create a new Claude, Gemini, Codex or Vibe agent that ru
77 1. Open the assistant: **✨ Create a Claude, Gemini, Codex or Vibe agent** on the welcome screen, **✨ Create an agent in a sandbox** under the agents list, or **Create an agent in a sandbox** in the command palette (⌘K, Ctrl+K on Linux and Windows).
88 2. Choose the agent: **Claude** (Anthropic's Claude Code), **Gemini** (Google's, through Antigravity), **Codex** (OpenAI's) or **Vibe** (Mistral AI's).
99 3. If sbx does not hold its key yet, paste it in **API key** and click **Save the key**. **Get a key…** opens the page where the company gives you one. Sidekicks hands the key to sbx, which keeps it and gives it to your sandboxes for their calls to that company only; it is never written in a file. A key already saved is shown as **✓ Your … key is stored in sbx**.
10-4. Give the agent its last details: **Name shown**, **Name** (what you call it with, `@claude`, and the name of its folder and of its sandbox: lowercase letters, digits and `-`, starting with a letter) and an **Emoji**. Sidekicks suggests a name nobody uses yet.
10+4. Give the agent its last details: **Name shown**, **Name** (what you call it with, `@claude`, and the name of its folder and of its sandbox: lowercase letters, digits and `-`, starting with a letter) and an **Emoji**. The **Name** follows the **Name shown** (`Marcel (assistant)` gives `marcel-assistant`) until you type it yourself; Sidekicks always suggests one nobody uses yet, and says so before you click when the one you typed is taken.
1111 5. Click **Add the agent**. Its conversation opens. Its sandbox is created the first time you write to it, so that first answer takes a while.
1212
1313 The agent's folder is created in your **Documents** folder, named after the agent (`~/Documents/claude`): its `sbxenv.yaml` and its `workspace/` folder, where the agent works.
@@ -7,7 +7,7 @@ This guide shows how to create a new Claude, Gemini, Codex or Vibe agent that ru
7 1. Open the assistant: **✨ Create a Claude, Gemini, Codex or Vibe agent** on the welcome screen, **✨ Create an agent in a sandbox** under the agents list, or **Create an agent in a sandbox** in the command palette (⌘K, Ctrl+K on Linux and Windows).7 1. Open the assistant: **✨ Create a Claude, Gemini, Codex or Vibe agent** on the welcome screen, **✨ Create an agent in a sandbox** under the agents list, or **Create an agent in a sandbox** in the command palette (⌘K, Ctrl+K on Linux and Windows).
8 2. Choose the agent: **Claude** (Anthropic's Claude Code), **Gemini** (Google's, through Antigravity), **Codex** (OpenAI's) or **Vibe** (Mistral AI's).8 2. Choose the agent: **Claude** (Anthropic's Claude Code), **Gemini** (Google's, through Antigravity), **Codex** (OpenAI's) or **Vibe** (Mistral AI's).
9 3. If sbx does not hold its key yet, paste it in **API key** and click **Save the key**. **Get a key…** opens the page where the company gives you one. Sidekicks hands the key to sbx, which keeps it and gives it to your sandboxes for their calls to that company only; it is never written in a file. A key already saved is shown as **✓ Your … key is stored in sbx**.9 3. If sbx does not hold its key yet, paste it in **API key** and click **Save the key**. **Get a key…** opens the page where the company gives you one. Sidekicks hands the key to sbx, which keeps it and gives it to your sandboxes for their calls to that company only; it is never written in a file. A key already saved is shown as **✓ Your … key is stored in sbx**.
10-4. Give the agent its last details: **Name shown**, **Name** (what you call it with, `@claude`, and the name of its folder and of its sandbox: lowercase letters, digits and `-`, starting with a letter) and an **Emoji**. Sidekicks suggests a name nobody uses yet.10+4. Give the agent its last details: **Name shown**, **Name** (what you call it with, `@claude`, and the name of its folder and of its sandbox: lowercase letters, digits and `-`, starting with a letter) and an **Emoji**. The **Name** follows the **Name shown** (`Marcel (assistant)` gives `marcel-assistant`) until you type it yourself; Sidekicks always suggests one nobody uses yet, and says so before you click when the one you typed is taken.
11 5. Click **Add the agent**. Its conversation opens. Its sandbox is created the first time you write to it, so that first answer takes a while.11 5. Click **Add the agent**. Its conversation opens. Its sandbox is created the first time you write to it, so that first answer takes a while.
12 12
13 The agent's folder is created in your **Documents** folder, named after the agent (`~/Documents/claude`): its `sbxenv.yaml` and its `workspace/` folder, where the agent works.13 The agent's folder is created in your **Documents** folder, named after the agent (`~/Documents/claude`): its `sbxenv.yaml` and its `workspace/` folder, where the agent works.
modified docs/en/reference/agents-and-events.md +3 -3
@@ -244,10 +244,10 @@ The assistant that creates a mini-me agent (issue #94, [How to create a mini-me
244244
245245 | Method | Effect |
246246 | --- | --- |
247-| `Start()` | Runs `mm --version` (`mini-me (mm) is not installed`; `mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed`; a version mm cannot tell is accepted), closes a wizard left open, creates the temporary folder (and removes those older than a day), starts mm there and sends `/start`. Returns `{view, agentsFolder, version}`. |
247+| `Start()` | Runs `mm --version` (`mini-me (mm) is not installed`; `mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed`; a version mm cannot tell is accepted), closes a wizard left open, creates the temporary folder (and removes those older than a day), starts mm there and sends `/start`. Returns `{view, agentsFolder, version, taken[]}` (`taken`: the names of the agents and of the folders of the agents' folder, issue #99). |
248248 | `Answer(answer)` | Answers the form shown: `{action: "accept", content: {name: value…}}`, `decline` or `cancel`. Returns the next `view`. |
249249 | `Send(text)` | Sends a message to mm (`/back`, `/restart`, `/start`…); refused while a form waits (decline it first). Returns the next `view`. |
250-| `Finish({name, icon, environment})` | Renames the temporary folder `<agentsFolder>/<name>` (mode 0755), then, for `container` or `sbx`, starts mm again in it and sends `/dockerinit` or `/sbxinit`; adds the agent with `mm --acp --config <folder>/.mm/agent.yaml`, through `docker exec -i <container>` or `sbx exec -i <sandbox>` with the lifecycle commands of the `compose.yaml` or `sbxenv.yaml` (as the "add an agent" assistant does with a dropped file), its title from `acp.title`. Returns `{problem, problems[], name, folder, messages[]}`: `problem` is `nameTaken`, `folderExists` or `invalidName` when nothing was changed and another name can be tried; `problems` are the configuration's. An existing folder is never touched. |
250+| `Finish({name, title, icon, environment})` | Renames the temporary folder `<agentsFolder>/<name>` (mode 0755), then, for `container` or `sbx`, starts mm again in it and sends `/dockerinit` or `/sbxinit`; adds the agent with `mm --acp --config <folder>/.mm/agent.yaml`, through `docker exec -i <container>` or `sbx exec -i <sandbox>` with the lifecycle commands of the `compose.yaml` or `sbxenv.yaml` (as the "add an agent" assistant does with a dropped file), its title `title`, else `acp.title`. Returns `{problem, problems[], name, folder, messages[]}`: `problem` is `nameTaken`, `folderExists` or `invalidName` when nothing was changed and another name can be tried; `problems` are the configuration's. An existing folder is never touched. |
251251 | `Cancel()` | Stops mm; before `Finish`, removes the temporary folder. Also done when Sidekicks quits. |
252252
253253 A `view` is `{messages[], form, written, name, title}`: mm's messages since the last call (each one whole), the form waiting (`{message, fields[{name, title, description, type, options[], default, required}]}`, `null` when none), and, once `.mm/agent.yaml` exists, `written` with mm's `acp.name` (turned into a valid name) and `acp.title`. The page shows mm's `⚠️` messages and folds the others; a `model` field asked as text means that no model server answered.
@@ -266,7 +266,7 @@ The assistant that creates an agent in a Docker Sandbox (issue #96, [How to crea
266266 | Method | Effect |
267267 | --- | --- |
268268 | `Kinds()` | The catalogue, in order: `{id, title, icon, agent, kit, program, service, keyUrl}`. |
269-| `Check(kind)` | `sbx is not installed` when sbx cannot be found (`sbx` in PATH, `/usr/local/bin`, `/opt/homebrew/bin`). Returns `{hasKey, name, agentsFolder}`: whether `sbx secret ls --service <service>` shows a global secret, and the first free name among `<kind>`, `<kind>-2`… — free as an agent of the configuration, a folder of the agents' folder and a sandbox (`sbx ls -q`). |
269+| `Check(kind)` | `sbx is not installed` when sbx cannot be found (`sbx` in PATH, `/usr/local/bin`, `/opt/homebrew/bin`). Returns `{hasKey, name, agentsFolder, taken[]}` (`taken`: the names used by an agent, a folder or a sandbox, issue #99): whether `sbx secret ls --service <service>` shows a global secret, and the first free name among `<kind>`, `<kind>-2`… — free as an agent of the configuration, a folder of the agents' folder and a sandbox (`sbx ls -q`). |
270270 | `SetKey(kind, key)` | `sbx secret set <service>` with the key on its standard input — never in its arguments, a file or a log; an error never repeats it. Global: every sandbox gets it. |
271271 | `Login()` | Runs `sbx login` (issue #97) — or joins the one in progress — and returns once sbx printed its device code and URL, 20 seconds at most: `{code, url, done, user, error, output[]}`. The code is the first `XXXX-XXXX`, the URL the first `https://…` naming `login`; `output` keeps every line for when sbx prints something else. Its standard input is empty: a question asked on the keyboard gets no answer. |
272272 | `LoginStatus()` | Waits, 20 seconds at most, for `sbx login` to end and returns the same state; `done` with `user` (from `Signed in as <user>.`) when signed in, else `error` (`cancelled` after `CancelLogin`). The interface calls it again until `done`. |
@@ -244,10 +244,10 @@ The assistant that creates a mini-me agent (issue #94, [How to create a mini-me
244 244
245 | Method | Effect |245 | Method | Effect |
246 | --- | --- |246 | --- | --- |
247-| `Start()` | Runs `mm --version` (`mini-me (mm) is not installed`; `mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed`; a version mm cannot tell is accepted), closes a wizard left open, creates the temporary folder (and removes those older than a day), starts mm there and sends `/start`. Returns `{view, agentsFolder, version}`. |247+| `Start()` | Runs `mm --version` (`mini-me (mm) is not installed`; `mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed`; a version mm cannot tell is accepted), closes a wizard left open, creates the temporary folder (and removes those older than a day), starts mm there and sends `/start`. Returns `{view, agentsFolder, version, taken[]}` (`taken`: the names of the agents and of the folders of the agents' folder, issue #99). |
248 | `Answer(answer)` | Answers the form shown: `{action: "accept", content: {name: value…}}`, `decline` or `cancel`. Returns the next `view`. |248 | `Answer(answer)` | Answers the form shown: `{action: "accept", content: {name: value…}}`, `decline` or `cancel`. Returns the next `view`. |
249 | `Send(text)` | Sends a message to mm (`/back`, `/restart`, `/start`…); refused while a form waits (decline it first). Returns the next `view`. |249 | `Send(text)` | Sends a message to mm (`/back`, `/restart`, `/start`…); refused while a form waits (decline it first). Returns the next `view`. |
250-| `Finish({name, icon, environment})` | Renames the temporary folder `<agentsFolder>/<name>` (mode 0755), then, for `container` or `sbx`, starts mm again in it and sends `/dockerinit` or `/sbxinit`; adds the agent with `mm --acp --config <folder>/.mm/agent.yaml`, through `docker exec -i <container>` or `sbx exec -i <sandbox>` with the lifecycle commands of the `compose.yaml` or `sbxenv.yaml` (as the "add an agent" assistant does with a dropped file), its title from `acp.title`. Returns `{problem, problems[], name, folder, messages[]}`: `problem` is `nameTaken`, `folderExists` or `invalidName` when nothing was changed and another name can be tried; `problems` are the configuration's. An existing folder is never touched. |250+| `Finish({name, title, icon, environment})` | Renames the temporary folder `<agentsFolder>/<name>` (mode 0755), then, for `container` or `sbx`, starts mm again in it and sends `/dockerinit` or `/sbxinit`; adds the agent with `mm --acp --config <folder>/.mm/agent.yaml`, through `docker exec -i <container>` or `sbx exec -i <sandbox>` with the lifecycle commands of the `compose.yaml` or `sbxenv.yaml` (as the "add an agent" assistant does with a dropped file), its title `title`, else `acp.title`. Returns `{problem, problems[], name, folder, messages[]}`: `problem` is `nameTaken`, `folderExists` or `invalidName` when nothing was changed and another name can be tried; `problems` are the configuration's. An existing folder is never touched. |
251 | `Cancel()` | Stops mm; before `Finish`, removes the temporary folder. Also done when Sidekicks quits. |251 | `Cancel()` | Stops mm; before `Finish`, removes the temporary folder. Also done when Sidekicks quits. |
252 252
253 A `view` is `{messages[], form, written, name, title}`: mm's messages since the last call (each one whole), the form waiting (`{message, fields[{name, title, description, type, options[], default, required}]}`, `null` when none), and, once `.mm/agent.yaml` exists, `written` with mm's `acp.name` (turned into a valid name) and `acp.title`. The page shows mm's `⚠️` messages and folds the others; a `model` field asked as text means that no model server answered.253 A `view` is `{messages[], form, written, name, title}`: mm's messages since the last call (each one whole), the form waiting (`{message, fields[{name, title, description, type, options[], default, required}]}`, `null` when none), and, once `.mm/agent.yaml` exists, `written` with mm's `acp.name` (turned into a valid name) and `acp.title`. The page shows mm's `⚠️` messages and folds the others; a `model` field asked as text means that no model server answered.
@@ -266,7 +266,7 @@ The assistant that creates an agent in a Docker Sandbox (issue #96, [How to crea
266 | Method | Effect |266 | Method | Effect |
267 | --- | --- |267 | --- | --- |
268 | `Kinds()` | The catalogue, in order: `{id, title, icon, agent, kit, program, service, keyUrl}`. |268 | `Kinds()` | The catalogue, in order: `{id, title, icon, agent, kit, program, service, keyUrl}`. |
269-| `Check(kind)` | `sbx is not installed` when sbx cannot be found (`sbx` in PATH, `/usr/local/bin`, `/opt/homebrew/bin`). Returns `{hasKey, name, agentsFolder}`: whether `sbx secret ls --service <service>` shows a global secret, and the first free name among `<kind>`, `<kind>-2`… — free as an agent of the configuration, a folder of the agents' folder and a sandbox (`sbx ls -q`). |269+| `Check(kind)` | `sbx is not installed` when sbx cannot be found (`sbx` in PATH, `/usr/local/bin`, `/opt/homebrew/bin`). Returns `{hasKey, name, agentsFolder, taken[]}` (`taken`: the names used by an agent, a folder or a sandbox, issue #99): whether `sbx secret ls --service <service>` shows a global secret, and the first free name among `<kind>`, `<kind>-2`… — free as an agent of the configuration, a folder of the agents' folder and a sandbox (`sbx ls -q`). |
270 | `SetKey(kind, key)` | `sbx secret set <service>` with the key on its standard input — never in its arguments, a file or a log; an error never repeats it. Global: every sandbox gets it. |270 | `SetKey(kind, key)` | `sbx secret set <service>` with the key on its standard input — never in its arguments, a file or a log; an error never repeats it. Global: every sandbox gets it. |
271 | `Login()` | Runs `sbx login` (issue #97) — or joins the one in progress — and returns once sbx printed its device code and URL, 20 seconds at most: `{code, url, done, user, error, output[]}`. The code is the first `XXXX-XXXX`, the URL the first `https://…` naming `login`; `output` keeps every line for when sbx prints something else. Its standard input is empty: a question asked on the keyboard gets no answer. |271 | `Login()` | Runs `sbx login` (issue #97) — or joins the one in progress — and returns once sbx printed its device code and URL, 20 seconds at most: `{code, url, done, user, error, output[]}`. The code is the first `XXXX-XXXX`, the URL the first `https://…` naming `login`; `output` keeps every line for when sbx prints something else. Its standard input is empty: a question asked on the keyboard gets no answer. |
272 | `LoginStatus()` | Waits, 20 seconds at most, for `sbx login` to end and returns the same state; `done` with `user` (from `Signed in as <user>.`) when signed in, else `error` (`cancelled` after `CancelLogin`). The interface calls it again until `done`. |272 | `LoginStatus()` | Waits, 20 seconds at most, for `sbx login` to end and returns the same state; `done` with `user` (from `Signed in as <user>.`) when signed in, else `error` (`cancelled` after `CancelLogin`). The interface calls it again until `done`. |
modified docs/fr/how-to/creer-un-agent-dans-une-sandbox.md +1 -1
@@ -7,7 +7,7 @@ Ce guide montre comment créer un nouvel agent Claude, Gemini, Codex ou Vibe qui
77 1. Ouvrez l'assistant : **✨ Créer un agent Claude, Gemini, Codex ou Vibe** sur l'écran d'accueil, **✨ Créer un agent dans une sandbox** sous la liste des agents, ou **Créer un agent dans une sandbox** dans la palette de commandes (⌘K, Ctrl+K sous Linux et Windows).
88 2. Choisissez l'agent : **Claude** (Claude Code, d'Anthropic), **Gemini** (de Google, via Antigravity), **Codex** (d'OpenAI) ou **Vibe** (de Mistral AI).
99 3. Si sbx n'a pas encore sa clé, collez-la dans **Clé d'API** et cliquez sur **Enregistrer la clé**. **Obtenir une clé…** ouvre la page où l'éditeur vous en donne une. Sidekicks confie la clé à sbx, qui la garde et la fournit à vos sandboxes seulement pour leurs appels à cet éditeur ; elle n'est jamais écrite dans un fichier. Une clé déjà enregistrée s'affiche **✓ Votre clé … est enregistrée dans sbx**.
10-4. Donnez à l'agent ses derniers détails : **Nom affiché**, **Nom** (ce qui l'appelle, `@claude`, et le nom de son dossier et de sa sandbox : minuscules, chiffres et `-`, en commençant par une lettre) et un **Emoji**. Sidekicks propose un nom que personne n'utilise encore.
10+4. Donnez à l'agent ses derniers détails : **Nom affiché**, **Nom** (ce qui l'appelle, `@claude`, et le nom de son dossier et de sa sandbox : minuscules, chiffres et `-`, en commençant par une lettre) et un **Emoji**. Le **Nom** suit le **Nom affiché** (`Marcel (assistant)` donne `marcel-assistant`) tant que vous ne le tapez pas vous-même ; Sidekicks en propose toujours un que personne n'utilise encore, et prévient avant le clic quand celui que vous avez tapé est pris.
1111 5. Cliquez sur **Ajouter l'agent**. Sa conversation s'ouvre. Sa sandbox est créée la première fois que vous lui écrivez : cette première réponse prend un moment.
1212
1313 Le dossier de l'agent est créé dans votre dossier **Documents**, au nom de l'agent (`~/Documents/claude`) : son `sbxenv.yaml` et son dossier `workspace/`, où l'agent travaille.
@@ -7,7 +7,7 @@ Ce guide montre comment créer un nouvel agent Claude, Gemini, Codex ou Vibe qui
7 1. Ouvrez l'assistant : **✨ Créer un agent Claude, Gemini, Codex ou Vibe** sur l'écran d'accueil, **✨ Créer un agent dans une sandbox** sous la liste des agents, ou **Créer un agent dans une sandbox** dans la palette de commandes (⌘K, Ctrl+K sous Linux et Windows).7 1. Ouvrez l'assistant : **✨ Créer un agent Claude, Gemini, Codex ou Vibe** sur l'écran d'accueil, **✨ Créer un agent dans une sandbox** sous la liste des agents, ou **Créer un agent dans une sandbox** dans la palette de commandes (⌘K, Ctrl+K sous Linux et Windows).
8 2. Choisissez l'agent : **Claude** (Claude Code, d'Anthropic), **Gemini** (de Google, via Antigravity), **Codex** (d'OpenAI) ou **Vibe** (de Mistral AI).8 2. Choisissez l'agent : **Claude** (Claude Code, d'Anthropic), **Gemini** (de Google, via Antigravity), **Codex** (d'OpenAI) ou **Vibe** (de Mistral AI).
9 3. Si sbx n'a pas encore sa clé, collez-la dans **Clé d'API** et cliquez sur **Enregistrer la clé**. **Obtenir une clé…** ouvre la page où l'éditeur vous en donne une. Sidekicks confie la clé à sbx, qui la garde et la fournit à vos sandboxes seulement pour leurs appels à cet éditeur ; elle n'est jamais écrite dans un fichier. Une clé déjà enregistrée s'affiche **✓ Votre clé … est enregistrée dans sbx**.9 3. Si sbx n'a pas encore sa clé, collez-la dans **Clé d'API** et cliquez sur **Enregistrer la clé**. **Obtenir une clé…** ouvre la page où l'éditeur vous en donne une. Sidekicks confie la clé à sbx, qui la garde et la fournit à vos sandboxes seulement pour leurs appels à cet éditeur ; elle n'est jamais écrite dans un fichier. Une clé déjà enregistrée s'affiche **✓ Votre clé … est enregistrée dans sbx**.
10-4. Donnez à l'agent ses derniers détails : **Nom affiché**, **Nom** (ce qui l'appelle, `@claude`, et le nom de son dossier et de sa sandbox : minuscules, chiffres et `-`, en commençant par une lettre) et un **Emoji**. Sidekicks propose un nom que personne n'utilise encore.10+4. Donnez à l'agent ses derniers détails : **Nom affiché**, **Nom** (ce qui l'appelle, `@claude`, et le nom de son dossier et de sa sandbox : minuscules, chiffres et `-`, en commençant par une lettre) et un **Emoji**. Le **Nom** suit le **Nom affiché** (`Marcel (assistant)` donne `marcel-assistant`) tant que vous ne le tapez pas vous-même ; Sidekicks en propose toujours un que personne n'utilise encore, et prévient avant le clic quand celui que vous avez tapé est pris.
11 5. Cliquez sur **Ajouter l'agent**. Sa conversation s'ouvre. Sa sandbox est créée la première fois que vous lui écrivez : cette première réponse prend un moment.11 5. Cliquez sur **Ajouter l'agent**. Sa conversation s'ouvre. Sa sandbox est créée la première fois que vous lui écrivez : cette première réponse prend un moment.
12 12
13 Le dossier de l'agent est créé dans votre dossier **Documents**, au nom de l'agent (`~/Documents/claude`) : son `sbxenv.yaml` et son dossier `workspace/`, où l'agent travaille.13 Le dossier de l'agent est créé dans votre dossier **Documents**, au nom de l'agent (`~/Documents/claude`) : son `sbxenv.yaml` et son dossier `workspace/`, où l'agent travaille.
modified docs/fr/how-to/creer-un-agent-mini-me.md +2 -1
@@ -7,7 +7,8 @@ Ce guide montre comment créer un nouvel agent [mini-me](https://git.rickub.com/
77 1. Ouvrez l'assistant : **✨ Créer mon premier agent** sur l'écran d'accueil, **✨ Créer un agent mini-me** sous la liste des agents, ou **Créer un agent mini-me** dans la palette de commandes (⌘K, Ctrl+K sous Linux et Windows).
88 2. Répondez aux questions de mini-me, quelques-unes à la fois : le serveur de modèles, le modèle, à quoi sert l'agent, quelle machine fait tourner le modèle, s'il demande avant chaque commande ou modification de fichier, le nom de l'agent… Chaque question arrive avec la valeur par défaut de mini-me : **Suivant →** la prend. **À propos de ces choix** explique les options. Les questions sont celles de mini-me, en anglais.
99 3. Quand mini-me a écrit l'agent, donnez ses derniers détails :
10- - **Nom** : ce qui l'appelle dans une conversation (`@marcel`), et le nom de son dossier. Il part du nom donné à mini-me ; minuscules, chiffres, `-` et `_`, en commençant par une lettre.
10+ - **Nom affiché** : celui de mini-me (`Marcel (developer)`), modifiable.
11+ - **Nom** : ce qui l'appelle dans une conversation (`@marcel`), et le nom de son dossier. Il part du nom donné à mini-me, puis suit le **Nom affiché** quand vous le changez, tant que vous ne le tapez pas vous-même ; minuscules, chiffres, `-` et `_`, en commençant par une lettre. Un nom déjà utilisé est signalé avant le clic, avec un nom libre à essayer.
1112 - **Emoji** : choisissez-en un, ou tapez n'importe quel emoji.
1213 - **Où s'exécute-t-il ?** **Sur cet ordinateur** (le plus simple), **Dans un conteneur Docker** (Docker doit être installé) ou **Dans une Docker Sandbox (sbx)** (sbx doit être installé).
1314 4. Cliquez sur **Ajouter l'agent**. Sa conversation directe s'ouvre : écrivez-lui.
@@ -7,7 +7,8 @@ Ce guide montre comment créer un nouvel agent [mini-me](https://git.rickub.com/
7 1. Ouvrez l'assistant : **✨ Créer mon premier agent** sur l'écran d'accueil, **✨ Créer un agent mini-me** sous la liste des agents, ou **Créer un agent mini-me** dans la palette de commandes (⌘K, Ctrl+K sous Linux et Windows).7 1. Ouvrez l'assistant : **✨ Créer mon premier agent** sur l'écran d'accueil, **✨ Créer un agent mini-me** sous la liste des agents, ou **Créer un agent mini-me** dans la palette de commandes (⌘K, Ctrl+K sous Linux et Windows).
8 2. Répondez aux questions de mini-me, quelques-unes à la fois : le serveur de modèles, le modèle, à quoi sert l'agent, quelle machine fait tourner le modèle, s'il demande avant chaque commande ou modification de fichier, le nom de l'agent… Chaque question arrive avec la valeur par défaut de mini-me : **Suivant →** la prend. **À propos de ces choix** explique les options. Les questions sont celles de mini-me, en anglais.8 2. Répondez aux questions de mini-me, quelques-unes à la fois : le serveur de modèles, le modèle, à quoi sert l'agent, quelle machine fait tourner le modèle, s'il demande avant chaque commande ou modification de fichier, le nom de l'agent… Chaque question arrive avec la valeur par défaut de mini-me : **Suivant →** la prend. **À propos de ces choix** explique les options. Les questions sont celles de mini-me, en anglais.
9 3. Quand mini-me a écrit l'agent, donnez ses derniers détails :9 3. Quand mini-me a écrit l'agent, donnez ses derniers détails :
10- - **Nom** : ce qui l'appelle dans une conversation (`@marcel`), et le nom de son dossier. Il part du nom donné à mini-me ; minuscules, chiffres, `-` et `_`, en commençant par une lettre.10+ - **Nom affiché** : celui de mini-me (`Marcel (developer)`), modifiable.
11+ - **Nom** : ce qui l'appelle dans une conversation (`@marcel`), et le nom de son dossier. Il part du nom donné à mini-me, puis suit le **Nom affiché** quand vous le changez, tant que vous ne le tapez pas vous-même ; minuscules, chiffres, `-` et `_`, en commençant par une lettre. Un nom déjà utilisé est signalé avant le clic, avec un nom libre à essayer.
11 - **Emoji** : choisissez-en un, ou tapez n'importe quel emoji.12 - **Emoji** : choisissez-en un, ou tapez n'importe quel emoji.
12 - **Où s'exécute-t-il ?** **Sur cet ordinateur** (le plus simple), **Dans un conteneur Docker** (Docker doit être installé) ou **Dans une Docker Sandbox (sbx)** (sbx doit être installé).13 - **Où s'exécute-t-il ?** **Sur cet ordinateur** (le plus simple), **Dans un conteneur Docker** (Docker doit être installé) ou **Dans une Docker Sandbox (sbx)** (sbx doit être installé).
13 4. Cliquez sur **Ajouter l'agent**. Sa conversation directe s'ouvre : écrivez-lui.14 4. Cliquez sur **Ajouter l'agent**. Sa conversation directe s'ouvre : écrivez-lui.
modified docs/fr/reference/agents-et-evenements.md +3 -3
@@ -244,10 +244,10 @@ L'assistant qui crée un agent mini-me (issue #94, [Créer un agent mini-me](../
244244
245245 | Méthode | Effet |
246246 | --- | --- |
247-| `Start()` | Lance `mm --version` (`mini-me (mm) is not installed` ; `mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed` ; une version que mm ne sait pas dire est acceptée), ferme un assistant resté ouvert, crée le dossier temporaire (et supprime ceux de plus d'un jour), y démarre mm et envoie `/start`. Renvoie `{view, agentsFolder, version}`. |
247+| `Start()` | Lance `mm --version` (`mini-me (mm) is not installed` ; `mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed` ; une version que mm ne sait pas dire est acceptée), ferme un assistant resté ouvert, crée le dossier temporaire (et supprime ceux de plus d'un jour), y démarre mm et envoie `/start`. Renvoie `{view, agentsFolder, version, taken[]}` (`taken` : les noms des agents et des dossiers du dossier des agents, issue #99). |
248248 | `Answer(answer)` | Répond au formulaire affiché : `{action: "accept", content: {nom: valeur…}}`, `decline` ou `cancel`. Renvoie la `view` suivante. |
249249 | `Send(text)` | Envoie un message à mm (`/back`, `/restart`, `/start`…) ; refusé tant qu'un formulaire attend (le refuser d'abord). Renvoie la `view` suivante. |
250-| `Finish({name, icon, environment})` | Renomme le dossier temporaire en `<agentsFolder>/<name>` (mode 0755), puis, pour `container` ou `sbx`, y redémarre mm et envoie `/dockerinit` ou `/sbxinit` ; ajoute l'agent avec `mm --acp --config <dossier>/.mm/agent.yaml`, à travers `docker exec -i <conteneur>` ou `sbx exec -i <sandbox>` avec les commandes de cycle de vie du `compose.yaml` ou du `sbxenv.yaml` (comme l'assistant « ajouter un agent » avec un fichier déposé), son titre venant de `acp.title`. Renvoie `{problem, problems[], name, folder, messages[]}` : `problem` vaut `nameTaken`, `folderExists` ou `invalidName` quand rien n'a été changé et qu'un autre nom peut être essayé ; `problems` sont ceux de la configuration. Un dossier existant n'est jamais touché. |
250+| `Finish({name, title, icon, environment})` | Renomme le dossier temporaire en `<agentsFolder>/<name>` (mode 0755), puis, pour `container` ou `sbx`, y redémarre mm et envoie `/dockerinit` ou `/sbxinit` ; ajoute l'agent avec `mm --acp --config <dossier>/.mm/agent.yaml`, à travers `docker exec -i <conteneur>` ou `sbx exec -i <sandbox>` avec les commandes de cycle de vie du `compose.yaml` ou du `sbxenv.yaml` (comme l'assistant « ajouter un agent » avec un fichier déposé), son titre étant `title`, sinon `acp.title`. Renvoie `{problem, problems[], name, folder, messages[]}` : `problem` vaut `nameTaken`, `folderExists` ou `invalidName` quand rien n'a été changé et qu'un autre nom peut être essayé ; `problems` sont ceux de la configuration. Un dossier existant n'est jamais touché. |
251251 | `Cancel()` | Arrête mm ; avant `Finish`, supprime le dossier temporaire. Fait aussi quand Sidekicks se ferme. |
252252
253253 Une `view` vaut `{messages[], form, written, name, title}` : les messages de mm depuis le dernier appel (chacun entier), le formulaire en attente (`{message, fields[{name, title, description, type, options[], default, required}]}`, `null` sinon) et, dès que `.mm/agent.yaml` existe, `written` avec le `acp.name` de mm (transformé en nom valide) et le `acp.title`. La page affiche les messages `⚠️` de mm et replie les autres ; un champ `model` demandé en texte signifie qu'aucun serveur de modèles n'a répondu.
@@ -266,7 +266,7 @@ L'assistant qui crée un agent dans une Docker Sandbox (issue #96, [Créer un ag
266266 | Méthode | Effet |
267267 | --- | --- |
268268 | `Kinds()` | Le catalogue, dans l'ordre : `{id, title, icon, agent, kit, program, service, keyUrl}`. |
269-| `Check(kind)` | `sbx is not installed` quand sbx est introuvable (`sbx` dans le PATH, `/usr/local/bin`, `/opt/homebrew/bin`). Renvoie `{hasKey, name, agentsFolder}` : si `sbx secret ls --service <service>` montre un secret global, et le premier nom libre parmi `<type>`, `<type>-2`… — libre comme agent de la configuration, dossier du dossier des agents et sandbox (`sbx ls -q`). |
269+| `Check(kind)` | `sbx is not installed` quand sbx est introuvable (`sbx` dans le PATH, `/usr/local/bin`, `/opt/homebrew/bin`). Renvoie `{hasKey, name, agentsFolder, taken[]}` (`taken` : les noms pris par un agent, un dossier ou une sandbox, issue #99) : si `sbx secret ls --service <service>` montre un secret global, et le premier nom libre parmi `<type>`, `<type>-2`… — libre comme agent de la configuration, dossier du dossier des agents et sandbox (`sbx ls -q`). |
270270 | `SetKey(kind, key)` | `sbx secret set <service>` avec la clé sur son entrée standard — jamais dans ses arguments, un fichier ou un journal ; une erreur ne la répète jamais. Globale : toutes les sandboxes l'ont. |
271271 | `Login()` | Lance `sbx login` (issue #97) — ou rejoint celui en cours — et revient dès que sbx a affiché son code et son adresse, 20 secondes au plus : `{code, url, done, user, error, output[]}`. Le code est le premier `XXXX-XXXX`, l'adresse le premier `https://…` qui contient `login` ; `output` garde chaque ligne pour le cas où sbx affiche autre chose. Son entrée standard est vide : une question posée au clavier n'a pas de réponse. |
272272 | `LoginStatus()` | Attend, 20 secondes au plus, la fin de `sbx login` et renvoie le même état ; `done` avec `user` (tiré de `Signed in as <user>.`) une fois connecté, sinon `error` (`cancelled` après `CancelLogin`). L'interface le rappelle jusqu'à `done`. |
@@ -244,10 +244,10 @@ L'assistant qui crée un agent mini-me (issue #94, [Créer un agent mini-me](../
244 244
245 | Méthode | Effet |245 | Méthode | Effet |
246 | --- | --- |246 | --- | --- |
247-| `Start()` | Lance `mm --version` (`mini-me (mm) is not installed` ; `mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed` ; une version que mm ne sait pas dire est acceptée), ferme un assistant resté ouvert, crée le dossier temporaire (et supprime ceux de plus d'un jour), y démarre mm et envoie `/start`. Renvoie `{view, agentsFolder, version}`. |247+| `Start()` | Lance `mm --version` (`mini-me (mm) is not installed` ; `mini-me (mm) 1.0.8 is too old: version 1.0.9 or later is needed` ; une version que mm ne sait pas dire est acceptée), ferme un assistant resté ouvert, crée le dossier temporaire (et supprime ceux de plus d'un jour), y démarre mm et envoie `/start`. Renvoie `{view, agentsFolder, version, taken[]}` (`taken` : les noms des agents et des dossiers du dossier des agents, issue #99). |
248 | `Answer(answer)` | Répond au formulaire affiché : `{action: "accept", content: {nom: valeur…}}`, `decline` ou `cancel`. Renvoie la `view` suivante. |248 | `Answer(answer)` | Répond au formulaire affiché : `{action: "accept", content: {nom: valeur…}}`, `decline` ou `cancel`. Renvoie la `view` suivante. |
249 | `Send(text)` | Envoie un message à mm (`/back`, `/restart`, `/start`…) ; refusé tant qu'un formulaire attend (le refuser d'abord). Renvoie la `view` suivante. |249 | `Send(text)` | Envoie un message à mm (`/back`, `/restart`, `/start`…) ; refusé tant qu'un formulaire attend (le refuser d'abord). Renvoie la `view` suivante. |
250-| `Finish({name, icon, environment})` | Renomme le dossier temporaire en `<agentsFolder>/<name>` (mode 0755), puis, pour `container` ou `sbx`, y redémarre mm et envoie `/dockerinit` ou `/sbxinit` ; ajoute l'agent avec `mm --acp --config <dossier>/.mm/agent.yaml`, à travers `docker exec -i <conteneur>` ou `sbx exec -i <sandbox>` avec les commandes de cycle de vie du `compose.yaml` ou du `sbxenv.yaml` (comme l'assistant « ajouter un agent » avec un fichier déposé), son titre venant de `acp.title`. Renvoie `{problem, problems[], name, folder, messages[]}` : `problem` vaut `nameTaken`, `folderExists` ou `invalidName` quand rien n'a été changé et qu'un autre nom peut être essayé ; `problems` sont ceux de la configuration. Un dossier existant n'est jamais touché. |250+| `Finish({name, title, icon, environment})` | Renomme le dossier temporaire en `<agentsFolder>/<name>` (mode 0755), puis, pour `container` ou `sbx`, y redémarre mm et envoie `/dockerinit` ou `/sbxinit` ; ajoute l'agent avec `mm --acp --config <dossier>/.mm/agent.yaml`, à travers `docker exec -i <conteneur>` ou `sbx exec -i <sandbox>` avec les commandes de cycle de vie du `compose.yaml` ou du `sbxenv.yaml` (comme l'assistant « ajouter un agent » avec un fichier déposé), son titre étant `title`, sinon `acp.title`. Renvoie `{problem, problems[], name, folder, messages[]}` : `problem` vaut `nameTaken`, `folderExists` ou `invalidName` quand rien n'a été changé et qu'un autre nom peut être essayé ; `problems` sont ceux de la configuration. Un dossier existant n'est jamais touché. |
251 | `Cancel()` | Arrête mm ; avant `Finish`, supprime le dossier temporaire. Fait aussi quand Sidekicks se ferme. |251 | `Cancel()` | Arrête mm ; avant `Finish`, supprime le dossier temporaire. Fait aussi quand Sidekicks se ferme. |
252 252
253 Une `view` vaut `{messages[], form, written, name, title}` : les messages de mm depuis le dernier appel (chacun entier), le formulaire en attente (`{message, fields[{name, title, description, type, options[], default, required}]}`, `null` sinon) et, dès que `.mm/agent.yaml` existe, `written` avec le `acp.name` de mm (transformé en nom valide) et le `acp.title`. La page affiche les messages `⚠️` de mm et replie les autres ; un champ `model` demandé en texte signifie qu'aucun serveur de modèles n'a répondu.253 Une `view` vaut `{messages[], form, written, name, title}` : les messages de mm depuis le dernier appel (chacun entier), le formulaire en attente (`{message, fields[{name, title, description, type, options[], default, required}]}`, `null` sinon) et, dès que `.mm/agent.yaml` existe, `written` avec le `acp.name` de mm (transformé en nom valide) et le `acp.title`. La page affiche les messages `⚠️` de mm et replie les autres ; un champ `model` demandé en texte signifie qu'aucun serveur de modèles n'a répondu.
@@ -266,7 +266,7 @@ L'assistant qui crée un agent dans une Docker Sandbox (issue #96, [Créer un ag
266 | Méthode | Effet |266 | Méthode | Effet |
267 | --- | --- |267 | --- | --- |
268 | `Kinds()` | Le catalogue, dans l'ordre : `{id, title, icon, agent, kit, program, service, keyUrl}`. |268 | `Kinds()` | Le catalogue, dans l'ordre : `{id, title, icon, agent, kit, program, service, keyUrl}`. |
269-| `Check(kind)` | `sbx is not installed` quand sbx est introuvable (`sbx` dans le PATH, `/usr/local/bin`, `/opt/homebrew/bin`). Renvoie `{hasKey, name, agentsFolder}` : si `sbx secret ls --service <service>` montre un secret global, et le premier nom libre parmi `<type>`, `<type>-2`… — libre comme agent de la configuration, dossier du dossier des agents et sandbox (`sbx ls -q`). |269+| `Check(kind)` | `sbx is not installed` quand sbx est introuvable (`sbx` dans le PATH, `/usr/local/bin`, `/opt/homebrew/bin`). Renvoie `{hasKey, name, agentsFolder, taken[]}` (`taken` : les noms pris par un agent, un dossier ou une sandbox, issue #99) : si `sbx secret ls --service <service>` montre un secret global, et le premier nom libre parmi `<type>`, `<type>-2`… — libre comme agent de la configuration, dossier du dossier des agents et sandbox (`sbx ls -q`). |
270 | `SetKey(kind, key)` | `sbx secret set <service>` avec la clé sur son entrée standard — jamais dans ses arguments, un fichier ou un journal ; une erreur ne la répète jamais. Globale : toutes les sandboxes l'ont. |270 | `SetKey(kind, key)` | `sbx secret set <service>` avec la clé sur son entrée standard — jamais dans ses arguments, un fichier ou un journal ; une erreur ne la répète jamais. Globale : toutes les sandboxes l'ont. |
271 | `Login()` | Lance `sbx login` (issue #97) — ou rejoint celui en cours — et revient dès que sbx a affiché son code et son adresse, 20 secondes au plus : `{code, url, done, user, error, output[]}`. Le code est le premier `XXXX-XXXX`, l'adresse le premier `https://…` qui contient `login` ; `output` garde chaque ligne pour le cas où sbx affiche autre chose. Son entrée standard est vide : une question posée au clavier n'a pas de réponse. |271 | `Login()` | Lance `sbx login` (issue #97) — ou rejoint celui en cours — et revient dès que sbx a affiché son code et son adresse, 20 secondes au plus : `{code, url, done, user, error, output[]}`. Le code est le premier `XXXX-XXXX`, l'adresse le premier `https://…` qui contient `login` ; `output` garde chaque ligne pour le cas où sbx affiche autre chose. Son entrée standard est vide : une question posée au clavier n'a pas de réponse. |
272 | `LoginStatus()` | Attend, 20 secondes au plus, la fin de `sbx login` et renvoie le même état ; `done` avec `user` (tiré de `Signed in as <user>.`) une fois connecté, sinon `error` (`cancelled` après `CancelLogin`). L'interface le rappelle jusqu'à `done`. |272 | `LoginStatus()` | Attend, 20 secondes au plus, la fin de `sbx login` et renvoie le même état ; `done` avec `user` (tiré de `Signed in as <user>.`) une fois connecté, sinon `error` (`cancelled` après `CancelLogin`). L'interface le rappelle jusqu'à `done`. |
modified frontend/bindings/git.rickub.com/bots-garden/sidekicks/internal/app/models.ts +17 -0
@@ -119,6 +119,11 @@ export interface ConfigView {
119119 */
120120 export interface CreatorFinish {
121121 "name": string;
122+
123+ /**
124+ * Title is the name shown; "" keeps mm's (acp.title).
125+ */
126+ "title": string;
122127 "icon": string;
123128 "environment": string;
124129 }
@@ -157,6 +162,12 @@ export interface CreatorStart {
157162 * Version is what mm --version said.
158163 */
159164 "version": string;
165+
166+ /**
167+ * Taken is the names already used, by an agent or by a folder of the
168+ * agents' folder: the interface suggests a free one (issue #99).
169+ */
170+ "taken": string[] | null;
160171 }
161172
162173 /**
@@ -243,6 +254,12 @@ export interface SbxCheck {
243254 "hasKey": boolean;
244255 "name": string;
245256 "agentsFolder": string;
257+
258+ /**
259+ * Taken is the names already used, by an agent, a folder of the agents'
260+ * folder or a sandbox: the interface suggests a free one (issue #99).
261+ */
262+ "taken": string[] | null;
246263 }
247264
248265 /**
@@ -119,6 +119,11 @@ export interface ConfigView {
119 */119 */
120 export interface CreatorFinish {120 export interface CreatorFinish {
121 "name": string;121 "name": string;
122+
123+ /**
124+ * Title is the name shown; "" keeps mm's (acp.title).
125+ */
126+ "title": string;
122 "icon": string;127 "icon": string;
123 "environment": string;128 "environment": string;
124 }129 }
@@ -157,6 +162,12 @@ export interface CreatorStart {
157 * Version is what mm --version said.162 * Version is what mm --version said.
158 */163 */
159 "version": string;164 "version": string;
165+
166+ /**
167+ * Taken is the names already used, by an agent or by a folder of the
168+ * agents' folder: the interface suggests a free one (issue #99).
169+ */
170+ "taken": string[] | null;
160 }171 }
161 172
162 /**173 /**
@@ -243,6 +254,12 @@ export interface SbxCheck {
243 "hasKey": boolean;254 "hasKey": boolean;
244 "name": string;255 "name": string;
245 "agentsFolder": string;256 "agentsFolder": string;
257+
258+ /**
259+ * Taken is the names already used, by an agent, a folder of the agents'
260+ * folder or a sandbox: the interface suggests a free one (issue #99).
261+ */
262+ "taken": string[] | null;
246 }263 }
247 264
248 /**265 /**
modified frontend/src/lib/agent/CreateMiniMeAgent.svelte +28 -8
@@ -10,7 +10,8 @@
1010 import { t, type MessageKey } from '../i18n/index.svelte'
1111 import { CreatorService } from '../../../bindings/git.rickub.com/bots-garden/sidekicks/internal/app'
1212 import { agentAdded, appState } from '../state.svelte'
13- import { agentFolder, contentOf, environments, iconChoices, initialValues, missingFields, noModelServer, problemKey, splitMessages, startProblem, validName, type Environment, type Form, type Value } from '../creator'
13+ import { agentFolder, contentOf, environments, freeName, iconChoices, initialValues, missingFields, noModelServer, problemKey, splitMessages, startProblem, validName, type Environment, type Form, type Value } from '../creator'
14+ import { nameFromTitle } from '../agentform'
1415 import AgentAvatar from './AgentAvatar.svelte'
1516 import ErrorText from '../chat/ErrorText.svelte'
1617 import Markdown from '../chat/Markdown.svelte'
@@ -32,6 +33,11 @@
3233 // The last step.
3334 let name = $state('')
3435 let title = $state('')
36+ // Issue #99: the @ name follows the name shown until it is typed by hand;
37+ // taken is the names already used (agents, folders of the agents' folder).
38+ let nameEdited = $state(false)
39+ let taken = $state<string[]>([])
40+ const takenNow = $derived(name !== '' && taken.includes(name))
3541 let icon = $state('🤖')
3642 let environment = $state<Environment>('local')
3743 let problem = $state('')
@@ -64,8 +70,9 @@
6470 step = 'questions'
6571 } else if (view.written) {
6672 form = null
67- name = name || view.name
68- title = view.title
73+ // mm's name, the one the user typed in the wizard, made free.
74+ name = name || freeName(view.name, taken)
75+ title = title || view.title
6976 step = 'ready'
7077 } else {
7178 form = null
@@ -92,6 +99,7 @@
9299 try {
93100 const started = await CreatorService.Start()
94101 agentsFolder = started.agentsFolder
102+ taken = started.taken ?? []
95103 show(started.view)
96104 } catch (caught) {
97105 failure = caught instanceof Error ? caught.message : String(caught)
@@ -128,7 +136,7 @@
128136 }
129137 busy = true
130138 try {
131- const result = await CreatorService.Finish({ name, icon: icon.trim(), environment })
139+ const result = await CreatorService.Finish({ name, title: title.trim(), icon: icon.trim(), environment })
132140 if (result.problem) problem = result.problem
133141 else if (result.problems && result.problems.length > 0) refused = result.problems
134142 else {
@@ -142,6 +150,14 @@
142150 }
143151 }
144152
153+ // The @ name made from the name shown, free, while it was not typed by hand.
154+ function followTitle() {
155+ if (nameEdited) return
156+ const made = nameFromTitle(title)
157+ if (made) name = freeName(made, taken)
158+ problem = ''
159+ }
160+
145161 function close() {
146162 appState.creator = ''
147163 }
@@ -210,12 +226,16 @@
210226 <div class="row">
211227 <span class="preview"><AgentAvatar icon={icon} title={title || name} name={name} size={34} /></span>
212228 <label class="grow">
213- {t('creator.name')}
214- <input bind:value={name} oninput={() => (problem = '')} aria-invalid={problem !== ''} aria-describedby="creator-name-hint" spellcheck="false" autocapitalize="off" />
229+ {t('creator.agentTitle')}
230+ <input bind:value={title} oninput={followTitle} />
215231 </label>
216232 </div>
217- <small id="creator-name-hint" class:problem-text={problem !== ''} role={problem ? 'alert' : undefined}>
218- {problem ? t(problemKey(problem)) : t('creator.nameHint', { name, folder: agentFolder(agentsFolder, name) })}
233+ <label>
234+ {t('creator.name')}
235+ <input bind:value={name} oninput={() => ((problem = ''), (nameEdited = true))} aria-invalid={problem !== '' || takenNow} aria-describedby="creator-name-hint" spellcheck="false" autocapitalize="off" />
236+ </label>
237+ <small id="creator-name-hint" class:problem-text={problem !== '' || takenNow} role={problem || takenNow ? 'alert' : undefined}>
238+ {#if problem}{t(problemKey(problem))}{:else if takenNow}{t('creator.problem.taken', { suggestion: freeName(name, taken) })}{:else}{t('creator.nameHint', { name, folder: agentFolder(agentsFolder, name) })}{/if}
219239 </small>
220240 <div class="group" aria-label={t('creator.icon')}>
221241 <span class="label">{t('creator.icon')}</span>
@@ -10,7 +10,8 @@
10 import { t, type MessageKey } from '../i18n/index.svelte'10 import { t, type MessageKey } from '../i18n/index.svelte'
11 import { CreatorService } from '../../../bindings/git.rickub.com/bots-garden/sidekicks/internal/app'11 import { CreatorService } from '../../../bindings/git.rickub.com/bots-garden/sidekicks/internal/app'
12 import { agentAdded, appState } from '../state.svelte'12 import { agentAdded, appState } from '../state.svelte'
13- import { agentFolder, contentOf, environments, iconChoices, initialValues, missingFields, noModelServer, problemKey, splitMessages, startProblem, validName, type Environment, type Form, type Value } from '../creator'13+ import { agentFolder, contentOf, environments, freeName, iconChoices, initialValues, missingFields, noModelServer, problemKey, splitMessages, startProblem, validName, type Environment, type Form, type Value } from '../creator'
14+ import { nameFromTitle } from '../agentform'
14 import AgentAvatar from './AgentAvatar.svelte'15 import AgentAvatar from './AgentAvatar.svelte'
15 import ErrorText from '../chat/ErrorText.svelte'16 import ErrorText from '../chat/ErrorText.svelte'
16 import Markdown from '../chat/Markdown.svelte'17 import Markdown from '../chat/Markdown.svelte'
@@ -32,6 +33,11 @@
32 // The last step.33 // The last step.
33 let name = $state('')34 let name = $state('')
34 let title = $state('')35 let title = $state('')
36+ // Issue #99: the @ name follows the name shown until it is typed by hand;
37+ // taken is the names already used (agents, folders of the agents' folder).
38+ let nameEdited = $state(false)
39+ let taken = $state<string[]>([])
40+ const takenNow = $derived(name !== '' && taken.includes(name))
35 let icon = $state('🤖')41 let icon = $state('🤖')
36 let environment = $state<Environment>('local')42 let environment = $state<Environment>('local')
37 let problem = $state('')43 let problem = $state('')
@@ -64,8 +70,9 @@
64 step = 'questions'70 step = 'questions'
65 } else if (view.written) {71 } else if (view.written) {
66 form = null72 form = null
67- name = name || view.name73+ // mm's name, the one the user typed in the wizard, made free.
68- title = view.title74+ name = name || freeName(view.name, taken)
75+ title = title || view.title
69 step = 'ready'76 step = 'ready'
70 } else {77 } else {
71 form = null78 form = null
@@ -92,6 +99,7 @@
92 try {99 try {
93 const started = await CreatorService.Start()100 const started = await CreatorService.Start()
94 agentsFolder = started.agentsFolder101 agentsFolder = started.agentsFolder
102+ taken = started.taken ?? []
95 show(started.view)103 show(started.view)
96 } catch (caught) {104 } catch (caught) {
97 failure = caught instanceof Error ? caught.message : String(caught)105 failure = caught instanceof Error ? caught.message : String(caught)
@@ -128,7 +136,7 @@
128 }136 }
129 busy = true137 busy = true
130 try {138 try {
131- const result = await CreatorService.Finish({ name, icon: icon.trim(), environment })139+ const result = await CreatorService.Finish({ name, title: title.trim(), icon: icon.trim(), environment })
132 if (result.problem) problem = result.problem140 if (result.problem) problem = result.problem
133 else if (result.problems && result.problems.length > 0) refused = result.problems141 else if (result.problems && result.problems.length > 0) refused = result.problems
134 else {142 else {
@@ -142,6 +150,14 @@
142 }150 }
143 }151 }
144 152
153+ // The @ name made from the name shown, free, while it was not typed by hand.
154+ function followTitle() {
155+ if (nameEdited) return
156+ const made = nameFromTitle(title)
157+ if (made) name = freeName(made, taken)
158+ problem = ''
159+ }
160+
145 function close() {161 function close() {
146 appState.creator = ''162 appState.creator = ''
147 }163 }
@@ -210,12 +226,16 @@
210 <div class="row">226 <div class="row">
211 <span class="preview"><AgentAvatar icon={icon} title={title || name} name={name} size={34} /></span>227 <span class="preview"><AgentAvatar icon={icon} title={title || name} name={name} size={34} /></span>
212 <label class="grow">228 <label class="grow">
213- {t('creator.name')}229+ {t('creator.agentTitle')}
214- <input bind:value={name} oninput={() => (problem = '')} aria-invalid={problem !== ''} aria-describedby="creator-name-hint" spellcheck="false" autocapitalize="off" />230+ <input bind:value={title} oninput={followTitle} />
215 </label>231 </label>
216 </div>232 </div>
217- <small id="creator-name-hint" class:problem-text={problem !== ''} role={problem ? 'alert' : undefined}>233+ <label>
218- {problem ? t(problemKey(problem)) : t('creator.nameHint', { name, folder: agentFolder(agentsFolder, name) })}234+ {t('creator.name')}
235+ <input bind:value={name} oninput={() => ((problem = ''), (nameEdited = true))} aria-invalid={problem !== '' || takenNow} aria-describedby="creator-name-hint" spellcheck="false" autocapitalize="off" />
236+ </label>
237+ <small id="creator-name-hint" class:problem-text={problem !== '' || takenNow} role={problem || takenNow ? 'alert' : undefined}>
238+ {#if problem}{t(problemKey(problem))}{:else if takenNow}{t('creator.problem.taken', { suggestion: freeName(name, taken) })}{:else}{t('creator.nameHint', { name, folder: agentFolder(agentsFolder, name) })}{/if}
219 </small>239 </small>
220 <div class="group" aria-label={t('creator.icon')}>240 <div class="group" aria-label={t('creator.icon')}>
221 <span class="label">{t('creator.icon')}</span>241 <span class="label">{t('creator.icon')}</span>
modified frontend/src/lib/agent/CreateSbxAgent.svelte +19 -5
@@ -11,7 +11,7 @@
1111 import { SbxCreatorService } from '../../../bindings/git.rickub.com/bots-garden/sidekicks/internal/app'
1212 import type { Kind } from '../../../bindings/git.rickub.com/bots-garden/sidekicks/internal/sbxcreate'
1313 import { agentAdded, appState } from '../state.svelte'
14- import { agentFolder, iconChoices, problemKey, sbxMissing, validSbxName } from '../creator'
14+ import { agentFolder, freeName, iconChoices, problemKey, sbxMissing, sbxNameFromTitle, validSbxName } from '../creator'
1515 import AgentAvatar from './AgentAvatar.svelte'
1616 import ErrorText from '../chat/ErrorText.svelte'
1717 import Spinner from '../chat/Spinner.svelte'
@@ -31,6 +31,11 @@
3131 let title = $state('')
3232 let icon = $state('')
3333 let problem = $state('')
34+ // Issue #99: the @ name follows the name shown until it is typed by hand;
35+ // taken is the names already used (agents, folders, sandboxes).
36+ let nameEdited = $state(false)
37+ let taken = $state<string[]>([])
38+ const takenNow = $derived(name !== '' && taken.includes(name))
3439 let refused = $state<string[]>([])
3540 let error = $state('')
3641
@@ -54,6 +59,7 @@
5459 const result = await SbxCreatorService.Check(kind.id)
5560 hasKey = result.hasKey
5661 agentsFolder = result.agentsFolder
62+ taken = result.taken ?? []
5763 name = name || result.name
5864 step = hasKey ? 'details' : 'key'
5965 } catch (caught) {
@@ -101,9 +107,17 @@
101107 }
102108 }
103109
110+ // The @ name made from the name shown, free, while it was not typed by hand.
111+ function followTitle() {
112+ if (nameEdited || !kind) return
113+ name = freeName(sbxNameFromTitle(title) || kind.id, taken)
114+ problem = ''
115+ }
116+
104117 function another() {
105118 kind = null
106119 name = ''
120+ nameEdited = false
107121 problem = ''
108122 step = 'kind'
109123 }
@@ -168,15 +182,15 @@
168182 <span class="preview"><AgentAvatar {icon} title={title || name} {name} size={34} /></span>
169183 <label class="grow">
170184 {t('sbxCreator.agentTitle')}
171- <input bind:value={title} />
185+ <input bind:value={title} oninput={followTitle} />
172186 </label>
173187 </div>
174188 <label>
175189 {t('sbxCreator.name')}
176- <input bind:value={name} oninput={() => (problem = '')} aria-invalid={problem !== ''} aria-describedby="sbx-name-hint" spellcheck="false" autocapitalize="off" />
190+ <input bind:value={name} oninput={() => ((problem = ''), (nameEdited = true))} aria-invalid={problem !== '' || takenNow} aria-describedby="sbx-name-hint" spellcheck="false" autocapitalize="off" />
177191 </label>
178- <small id="sbx-name-hint" class:problem-text={problem !== ''} role={problem ? 'alert' : undefined}>
179- {problem ? t(problemKey(problem)) : t('sbxCreator.nameHint', { name, folder: agentFolder(agentsFolder, name) })}
192+ <small id="sbx-name-hint" class:problem-text={problem !== '' || takenNow} role={problem || takenNow ? 'alert' : undefined}>
193+ {#if problem}{t(problemKey(problem))}{:else if takenNow}{t('creator.problem.taken', { suggestion: freeName(name, taken) })}{:else}{t('sbxCreator.nameHint', { name, folder: agentFolder(agentsFolder, name) })}{/if}
180194 </small>
181195 <div class="group" aria-label={t('creator.icon')}>
182196 <span class="label">{t('creator.icon')}</span>
@@ -11,7 +11,7 @@
11 import { SbxCreatorService } from '../../../bindings/git.rickub.com/bots-garden/sidekicks/internal/app'11 import { SbxCreatorService } from '../../../bindings/git.rickub.com/bots-garden/sidekicks/internal/app'
12 import type { Kind } from '../../../bindings/git.rickub.com/bots-garden/sidekicks/internal/sbxcreate'12 import type { Kind } from '../../../bindings/git.rickub.com/bots-garden/sidekicks/internal/sbxcreate'
13 import { agentAdded, appState } from '../state.svelte'13 import { agentAdded, appState } from '../state.svelte'
14- import { agentFolder, iconChoices, problemKey, sbxMissing, validSbxName } from '../creator'14+ import { agentFolder, freeName, iconChoices, problemKey, sbxMissing, sbxNameFromTitle, validSbxName } from '../creator'
15 import AgentAvatar from './AgentAvatar.svelte'15 import AgentAvatar from './AgentAvatar.svelte'
16 import ErrorText from '../chat/ErrorText.svelte'16 import ErrorText from '../chat/ErrorText.svelte'
17 import Spinner from '../chat/Spinner.svelte'17 import Spinner from '../chat/Spinner.svelte'
@@ -31,6 +31,11 @@
31 let title = $state('')31 let title = $state('')
32 let icon = $state('')32 let icon = $state('')
33 let problem = $state('')33 let problem = $state('')
34+ // Issue #99: the @ name follows the name shown until it is typed by hand;
35+ // taken is the names already used (agents, folders, sandboxes).
36+ let nameEdited = $state(false)
37+ let taken = $state<string[]>([])
38+ const takenNow = $derived(name !== '' && taken.includes(name))
34 let refused = $state<string[]>([])39 let refused = $state<string[]>([])
35 let error = $state('')40 let error = $state('')
36 41
@@ -54,6 +59,7 @@
54 const result = await SbxCreatorService.Check(kind.id)59 const result = await SbxCreatorService.Check(kind.id)
55 hasKey = result.hasKey60 hasKey = result.hasKey
56 agentsFolder = result.agentsFolder61 agentsFolder = result.agentsFolder
62+ taken = result.taken ?? []
57 name = name || result.name63 name = name || result.name
58 step = hasKey ? 'details' : 'key'64 step = hasKey ? 'details' : 'key'
59 } catch (caught) {65 } catch (caught) {
@@ -101,9 +107,17 @@
101 }107 }
102 }108 }
103 109
110+ // The @ name made from the name shown, free, while it was not typed by hand.
111+ function followTitle() {
112+ if (nameEdited || !kind) return
113+ name = freeName(sbxNameFromTitle(title) || kind.id, taken)
114+ problem = ''
115+ }
116+
104 function another() {117 function another() {
105 kind = null118 kind = null
106 name = ''119 name = ''
120+ nameEdited = false
107 problem = ''121 problem = ''
108 step = 'kind'122 step = 'kind'
109 }123 }
@@ -168,15 +182,15 @@
168 <span class="preview"><AgentAvatar {icon} title={title || name} {name} size={34} /></span>182 <span class="preview"><AgentAvatar {icon} title={title || name} {name} size={34} /></span>
169 <label class="grow">183 <label class="grow">
170 {t('sbxCreator.agentTitle')}184 {t('sbxCreator.agentTitle')}
171- <input bind:value={title} />185+ <input bind:value={title} oninput={followTitle} />
172 </label>186 </label>
173 </div>187 </div>
174 <label>188 <label>
175 {t('sbxCreator.name')}189 {t('sbxCreator.name')}
176- <input bind:value={name} oninput={() => (problem = '')} aria-invalid={problem !== ''} aria-describedby="sbx-name-hint" spellcheck="false" autocapitalize="off" />190+ <input bind:value={name} oninput={() => ((problem = ''), (nameEdited = true))} aria-invalid={problem !== '' || takenNow} aria-describedby="sbx-name-hint" spellcheck="false" autocapitalize="off" />
177 </label>191 </label>
178- <small id="sbx-name-hint" class:problem-text={problem !== ''} role={problem ? 'alert' : undefined}>192+ <small id="sbx-name-hint" class:problem-text={problem !== '' || takenNow} role={problem || takenNow ? 'alert' : undefined}>
179- {problem ? t(problemKey(problem)) : t('sbxCreator.nameHint', { name, folder: agentFolder(agentsFolder, name) })}193+ {#if problem}{t(problemKey(problem))}{:else if takenNow}{t('creator.problem.taken', { suggestion: freeName(name, taken) })}{:else}{t('sbxCreator.nameHint', { name, folder: agentFolder(agentsFolder, name) })}{/if}
180 </small>194 </small>
181 <div class="group" aria-label={t('creator.icon')}>195 <div class="group" aria-label={t('creator.icon')}>
182 <span class="label">{t('creator.icon')}</span>196 <span class="label">{t('creator.icon')}</span>
modified frontend/src/lib/creator.test.ts +16 -1
@@ -1,7 +1,7 @@
11 // Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE
22
33 import { describe, expect, it } from 'vitest'
4-import { agentFolder, contentOf, sbxMissing, validSbxName, initialValues, missingFields, noModelServer, problemKey, splitMessages, startProblem, validName, type Field, type Form } from './creator'
4+import { agentFolder, contentOf, freeName, sbxMissing, sbxNameFromTitle, validSbxName, initialValues, missingFields, noModelServer, problemKey, splitMessages, startProblem, validName, type Field, type Form } from './creator'
55
66 function field(name: string, type: string, extra: Partial<Field> = {}): Field {
77 return { name, title: name, description: '', type, options: null, default: null, required: true, ...extra }
@@ -83,6 +83,21 @@ describe('names and folders', () => {
8383 })
8484 })
8585
86+describe('the @ name from the name shown (issue #99)', () => {
87+ it('makes a sandbox name: no underscore', () => {
88+ expect(sbxNameFromTitle('Marcel (assistant)')).toBe('marcel-assistant')
89+ expect(sbxNameFromTitle('my_agent')).toBe('my-agent')
90+ expect(sbxNameFromTitle('Élodie')).toBe('elodie')
91+ expect(sbxNameFromTitle('42')).toBe('')
92+ })
93+ it('suggests the first free variant, within 32 characters', () => {
94+ expect(freeName('claude', [])).toBe('claude')
95+ expect(freeName('claude', ['claude', 'claude-2'])).toBe('claude-3')
96+ expect(freeName('a'.repeat(32), ['a'.repeat(32)])).toBe('a'.repeat(30) + '-2')
97+ expect(freeName('', ['x'])).toBe('')
98+ })
99+})
100+
86101 describe('the sbx assistant (issue #96)', () => {
87102 it('accepts sandbox names: no underscore', () => {
88103 expect(validSbxName('claude-2')).toBe(true)
@@ -1,7 +1,7 @@
1 // Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE1 // Copyright (c) 2026 Philippe Charrière — Sidekicks Source-Available License 1.0, see LICENSE
2 2
3 import { describe, expect, it } from 'vitest'3 import { describe, expect, it } from 'vitest'
4-import { agentFolder, contentOf, sbxMissing, validSbxName, initialValues, missingFields, noModelServer, problemKey, splitMessages, startProblem, validName, type Field, type Form } from './creator'4+import { agentFolder, contentOf, freeName, sbxMissing, sbxNameFromTitle, validSbxName, initialValues, missingFields, noModelServer, problemKey, splitMessages, startProblem, validName, type Field, type Form } from './creator'
5 5
6 function field(name: string, type: string, extra: Partial<Field> = {}): Field {6 function field(name: string, type: string, extra: Partial<Field> = {}): Field {
7 return { name, title: name, description: '', type, options: null, default: null, required: true, ...extra }7 return { name, title: name, description: '', type, options: null, default: null, required: true, ...extra }
@@ -83,6 +83,21 @@ describe('names and folders', () => {
83 })83 })
84 })84 })
85 85
86+describe('the @ name from the name shown (issue #99)', () => {
87+ it('makes a sandbox name: no underscore', () => {
88+ expect(sbxNameFromTitle('Marcel (assistant)')).toBe('marcel-assistant')
89+ expect(sbxNameFromTitle('my_agent')).toBe('my-agent')
90+ expect(sbxNameFromTitle('Élodie')).toBe('elodie')
91+ expect(sbxNameFromTitle('42')).toBe('')
92+ })
93+ it('suggests the first free variant, within 32 characters', () => {
94+ expect(freeName('claude', [])).toBe('claude')
95+ expect(freeName('claude', ['claude', 'claude-2'])).toBe('claude-3')
96+ expect(freeName('a'.repeat(32), ['a'.repeat(32)])).toBe('a'.repeat(30) + '-2')
97+ expect(freeName('', ['x'])).toBe('')
98+ })
99+})
100+
86 describe('the sbx assistant (issue #96)', () => {101 describe('the sbx assistant (issue #96)', () => {
87 it('accepts sandbox names: no underscore', () => {102 it('accepts sandbox names: no underscore', () => {
88 expect(validSbxName('claude-2')).toBe(true)103 expect(validSbxName('claude-2')).toBe(true)
modified frontend/src/lib/creator.ts +33 -0
@@ -6,6 +6,7 @@
66 // answer mm expects. No Svelte here, so that vitest can test it.
77
88 import type { MessageKey } from './i18n/index.svelte'
9+import { nameFromTitle } from './agentform'
910
1011 /** A question of a form, as acp.FormField gives it. */
1112 export interface Field {
@@ -119,6 +120,38 @@ export function validSbxName(name: string): boolean {
119120 return /^[a-z][a-z0-9-]{0,31}$/.test(name)
120121 }
121122
123+/**
124+ * The @ name made from the name shown (issue #99), for an agent in a
125+ * sandbox: as the "add an agent" assistant makes it, without "_", which sbx
126+ * refuses in a sandbox's name.
127+ *
128+ * @example
129+ * sbxNameFromTitle('Marcel (assistant)') // 'marcel-assistant'
130+ * sbxNameFromTitle('my_agent') // 'my-agent'
131+ */
132+export function sbxNameFromTitle(title: string): string {
133+ return nameFromTitle(title).replace(/_/g, '-').replace(/-{2,}/g, '-').replace(/-+$/, '')
134+}
135+
136+/**
137+ * The first of name, name-2, name-3… that is not taken; the suffix still
138+ * fits the 32 characters of a name. '' stays ''.
139+ *
140+ * @example
141+ * freeName('claude', ['claude', 'claude-2']) // 'claude-3'
142+ */
143+export function freeName(name: string, taken: string[] | null | undefined): string {
144+ if (!name) return ''
145+ const used = new Set(taken ?? [])
146+ if (!used.has(name)) return name
147+ for (let index = 2; index < 1000; index++) {
148+ const suffix = `-${index}`
149+ const candidate = name.slice(0, 32 - suffix.length).replace(/-+$/, '') + suffix
150+ if (!used.has(candidate)) return candidate
151+ }
152+ return name
153+}
154+
122155 /** An agent name Sidekicks accepts, which is also its folder's name. */
123156 export function validName(name: string): boolean {
124157 return /^[a-z][a-z0-9_-]{0,31}$/.test(name)
@@ -6,6 +6,7 @@
6 // answer mm expects. No Svelte here, so that vitest can test it.6 // answer mm expects. No Svelte here, so that vitest can test it.
7 7
8 import type { MessageKey } from './i18n/index.svelte'8 import type { MessageKey } from './i18n/index.svelte'
9+import { nameFromTitle } from './agentform'
9 10
10 /** A question of a form, as acp.FormField gives it. */11 /** A question of a form, as acp.FormField gives it. */
11 export interface Field {12 export interface Field {
@@ -119,6 +120,38 @@ export function validSbxName(name: string): boolean {
119 return /^[a-z][a-z0-9-]{0,31}$/.test(name)120 return /^[a-z][a-z0-9-]{0,31}$/.test(name)
120 }121 }
121 122
123+/**
124+ * The @ name made from the name shown (issue #99), for an agent in a
125+ * sandbox: as the "add an agent" assistant makes it, without "_", which sbx
126+ * refuses in a sandbox's name.
127+ *
128+ * @example
129+ * sbxNameFromTitle('Marcel (assistant)') // 'marcel-assistant'
130+ * sbxNameFromTitle('my_agent') // 'my-agent'
131+ */
132+export function sbxNameFromTitle(title: string): string {
133+ return nameFromTitle(title).replace(/_/g, '-').replace(/-{2,}/g, '-').replace(/-+$/, '')
134+}
135+
136+/**
137+ * The first of name, name-2, name-3… that is not taken; the suffix still
138+ * fits the 32 characters of a name. '' stays ''.
139+ *
140+ * @example
141+ * freeName('claude', ['claude', 'claude-2']) // 'claude-3'
142+ */
143+export function freeName(name: string, taken: string[] | null | undefined): string {
144+ if (!name) return ''
145+ const used = new Set(taken ?? [])
146+ if (!used.has(name)) return name
147+ for (let index = 2; index < 1000; index++) {
148+ const suffix = `-${index}`
149+ const candidate = name.slice(0, 32 - suffix.length).replace(/-+$/, '') + suffix
150+ if (!used.has(candidate)) return candidate
151+ }
152+ return name
153+}
154+
122 /** An agent name Sidekicks accepts, which is also its folder's name. */155 /** An agent name Sidekicks accepts, which is also its folder's name. */
123 export function validName(name: string): boolean {156 export function validName(name: string): boolean {
124 return /^[a-z][a-z0-9_-]{0,31}$/.test(name)157 return /^[a-z][a-z0-9_-]{0,31}$/.test(name)
modified frontend/src/lib/i18n/messages.ts +4 -0
@@ -338,6 +338,8 @@ export const en = {
338338 'welcome.createSbxFirst': '✨ Create a Claude, Gemini, Codex or Vibe agent',
339339 'action.createSbxAgent': 'Create an agent in a sandbox (Claude, Gemini, Codex, Vibe)',
340340 'creator.problem.sandboxExists': 'A sandbox with this name already exists: choose another name.',
341+ 'creator.problem.taken': 'This name is already used (by an agent, a folder or a sandbox): try {suggestion}.',
342+ 'creator.agentTitle': 'Name shown',
341343 'sbxCreator.title': 'Create an agent in a sandbox',
342344 'sbxCreator.intro': 'Choose the agent: it runs in a Docker Sandbox, isolated from your computer. Sidekicks prepares everything.',
343345 'sbxCreator.choose': 'Which agent?',
@@ -814,6 +816,8 @@ export const fr: Record<MessageKey, string> = {
814816 'welcome.createSbxFirst': '✨ Créer un agent Claude, Gemini, Codex ou Vibe',
815817 'action.createSbxAgent': 'Créer un agent dans une sandbox (Claude, Gemini, Codex, Vibe)',
816818 'creator.problem.sandboxExists': 'Une sandbox porte déjà ce nom : choisissez un autre nom.',
819+ 'creator.problem.taken': 'Ce nom est déjà utilisé (par un agent, un dossier ou une sandbox) : essayez {suggestion}.',
820+ 'creator.agentTitle': 'Nom affiché',
817821 'sbxCreator.title': 'Créer un agent dans une sandbox',
818822 'sbxCreator.intro': "Choisissez l'agent : il tourne dans une Docker Sandbox, isolé de votre ordinateur. Sidekicks prépare tout.",
819823 'sbxCreator.choose': 'Quel agent ?',
@@ -338,6 +338,8 @@ export const en = {
338 'welcome.createSbxFirst': '✨ Create a Claude, Gemini, Codex or Vibe agent',338 'welcome.createSbxFirst': '✨ Create a Claude, Gemini, Codex or Vibe agent',
339 'action.createSbxAgent': 'Create an agent in a sandbox (Claude, Gemini, Codex, Vibe)',339 'action.createSbxAgent': 'Create an agent in a sandbox (Claude, Gemini, Codex, Vibe)',
340 'creator.problem.sandboxExists': 'A sandbox with this name already exists: choose another name.',340 'creator.problem.sandboxExists': 'A sandbox with this name already exists: choose another name.',
341+ 'creator.problem.taken': 'This name is already used (by an agent, a folder or a sandbox): try {suggestion}.',
342+ 'creator.agentTitle': 'Name shown',
341 'sbxCreator.title': 'Create an agent in a sandbox',343 'sbxCreator.title': 'Create an agent in a sandbox',
342 'sbxCreator.intro': 'Choose the agent: it runs in a Docker Sandbox, isolated from your computer. Sidekicks prepares everything.',344 'sbxCreator.intro': 'Choose the agent: it runs in a Docker Sandbox, isolated from your computer. Sidekicks prepares everything.',
343 'sbxCreator.choose': 'Which agent?',345 'sbxCreator.choose': 'Which agent?',
@@ -814,6 +816,8 @@ export const fr: Record<MessageKey, string> = {
814 'welcome.createSbxFirst': '✨ Créer un agent Claude, Gemini, Codex ou Vibe',816 'welcome.createSbxFirst': '✨ Créer un agent Claude, Gemini, Codex ou Vibe',
815 'action.createSbxAgent': 'Créer un agent dans une sandbox (Claude, Gemini, Codex, Vibe)',817 'action.createSbxAgent': 'Créer un agent dans une sandbox (Claude, Gemini, Codex, Vibe)',
816 'creator.problem.sandboxExists': 'Une sandbox porte déjà ce nom : choisissez un autre nom.',818 'creator.problem.sandboxExists': 'Une sandbox porte déjà ce nom : choisissez un autre nom.',
819+ 'creator.problem.taken': 'Ce nom est déjà utilisé (par un agent, un dossier ou une sandbox) : essayez {suggestion}.',
820+ 'creator.agentTitle': 'Nom affiché',
817 'sbxCreator.title': 'Créer un agent dans une sandbox',821 'sbxCreator.title': 'Créer un agent dans une sandbox',
818 'sbxCreator.intro': "Choisissez l'agent : il tourne dans une Docker Sandbox, isolé de votre ordinateur. Sidekicks prépare tout.",822 'sbxCreator.intro': "Choisissez l'agent : il tourne dans une Docker Sandbox, isolé de votre ordinateur. Sidekicks prépare tout.",
819 'sbxCreator.choose': 'Quel agent ?',823 'sbxCreator.choose': 'Quel agent ?',
modified internal/app/creator.go +45 -3
@@ -6,7 +6,10 @@ import (
66 "context"
77 "errors"
88 "fmt"
9+ "os"
910 "path/filepath"
11+ "slices"
12+ "strings"
1013 "sync"
1114
1215 "git.rickub.com/bots-garden/sidekicks/internal/acp"
@@ -42,12 +45,17 @@ type CreatorStart struct {
4245 AgentsFolder string `json:"agentsFolder"`
4346 // Version is what mm --version said.
4447 Version string `json:"version"`
48+ // Taken is the names already used, by an agent or by a folder of the
49+ // agents' folder: the interface suggests a free one (issue #99).
50+ Taken []string `json:"taken"`
4551 }
4652
4753 // CreatorFinish is the last step: the agent's name (its folder's too), its
4854 // emoji, and where it runs: local, container or sbx.
4955 type CreatorFinish struct {
50- Name string `json:"name"`
56+ Name string `json:"name"`
57+ // Title is the name shown; "" keeps mm's (acp.title).
58+ Title string `json:"title"`
5159 Icon string `json:"icon"`
5260 Environment string `json:"environment"`
5361 }
@@ -112,7 +120,7 @@ func (s *CreatorService) Start(ctx context.Context) (CreatorStart, error) {
112120 }
113121 creation.session = session
114122 view, err := session.Begin(ctx)
115- return CreatorStart{View: view, AgentsFolder: options.AgentsFolder, Version: version}, err
123+ return CreatorStart{View: view, AgentsFolder: options.AgentsFolder, Version: version, Taken: s.Core.takenNames(options.AgentsFolder, nil)}, err
116124 }
117125
118126 // session is the wizard in progress, or ErrClosed.
@@ -191,6 +199,40 @@ func (s *CreatorService) Cancel() {
191199 }
192200 }
193201
202+// takenNames is the names an agent created by an assistant cannot take: the
203+// agents of the configuration, the folders of the agents' folder (but the
204+// assistants' temporary ones) and the sandboxes given, sorted.
205+func (c *Core) takenNames(folder string, sandboxes []string) []string {
206+ taken := map[string]bool{}
207+ c.mu.Lock()
208+ for _, agent := range c.cfg.Agents {
209+ taken[agent.Name] = true
210+ }
211+ c.mu.Unlock()
212+ entries, _ := os.ReadDir(folder)
213+ for _, entry := range entries {
214+ if !strings.HasPrefix(entry.Name(), ".") {
215+ taken[entry.Name()] = true
216+ }
217+ }
218+ for _, sandbox := range sandboxes {
219+ taken[sandbox] = true
220+ }
221+ names := make([]string, 0, len(taken))
222+ for name := range taken {
223+ names = append(names, name)
224+ }
225+ slices.Sort(names)
226+ return names
227+}
228+
229+func orDefault(value, fallback string) string {
230+ if value == "" {
231+ return fallback
232+ }
233+ return value
234+}
235+
194236 func (c *Core) hasAgent(name string) bool {
195237 c.mu.Lock()
196238 defer c.mu.Unlock()
@@ -205,7 +247,7 @@ func (c *Core) hasAgent(name string) bool {
205247 // agent file's path is the same inside.
206248 func agentFormOf(form CreatorFinish, result creator.Result) (AgentForm, error) {
207249 agent := AgentForm{
208- Name: form.Name, Title: result.Title, Icon: form.Icon, Environment: result.Environment,
250+ Name: form.Name, Title: orDefault(strings.TrimSpace(form.Title), result.Title), Icon: form.Icon, Environment: result.Environment,
209251 Program: "mm", Arguments: joinArguments([]string{"--acp", "--config", result.AgentFile}), Workspace: result.Folder,
210252 }
211253 switch result.Environment {
@@ -6,7 +6,10 @@ import (
6 "context"6 "context"
7 "errors"7 "errors"
8 "fmt"8 "fmt"
9+ "os"
9 "path/filepath"10 "path/filepath"
11+ "slices"
12+ "strings"
10 "sync"13 "sync"
11 14
12 "git.rickub.com/bots-garden/sidekicks/internal/acp"15 "git.rickub.com/bots-garden/sidekicks/internal/acp"
@@ -42,12 +45,17 @@ type CreatorStart struct {
42 AgentsFolder string `json:"agentsFolder"`45 AgentsFolder string `json:"agentsFolder"`
43 // Version is what mm --version said.46 // Version is what mm --version said.
44 Version string `json:"version"`47 Version string `json:"version"`
48+ // Taken is the names already used, by an agent or by a folder of the
49+ // agents' folder: the interface suggests a free one (issue #99).
50+ Taken []string `json:"taken"`
45 }51 }
46 52
47 // CreatorFinish is the last step: the agent's name (its folder's too), its53 // CreatorFinish is the last step: the agent's name (its folder's too), its
48 // emoji, and where it runs: local, container or sbx.54 // emoji, and where it runs: local, container or sbx.
49 type CreatorFinish struct {55 type CreatorFinish struct {
50- Name string `json:"name"`56+ Name string `json:"name"`
57+ // Title is the name shown; "" keeps mm's (acp.title).
58+ Title string `json:"title"`
51 Icon string `json:"icon"`59 Icon string `json:"icon"`
52 Environment string `json:"environment"`60 Environment string `json:"environment"`
53 }61 }
@@ -112,7 +120,7 @@ func (s *CreatorService) Start(ctx context.Context) (CreatorStart, error) {
112 }120 }
113 creation.session = session121 creation.session = session
114 view, err := session.Begin(ctx)122 view, err := session.Begin(ctx)
115- return CreatorStart{View: view, AgentsFolder: options.AgentsFolder, Version: version}, err123+ return CreatorStart{View: view, AgentsFolder: options.AgentsFolder, Version: version, Taken: s.Core.takenNames(options.AgentsFolder, nil)}, err
116 }124 }
117 125
118 // session is the wizard in progress, or ErrClosed.126 // session is the wizard in progress, or ErrClosed.
@@ -191,6 +199,40 @@ func (s *CreatorService) Cancel() {
191 }199 }
192 }200 }
193 201
202+// takenNames is the names an agent created by an assistant cannot take: the
203+// agents of the configuration, the folders of the agents' folder (but the
204+// assistants' temporary ones) and the sandboxes given, sorted.
205+func (c *Core) takenNames(folder string, sandboxes []string) []string {
206+ taken := map[string]bool{}
207+ c.mu.Lock()
208+ for _, agent := range c.cfg.Agents {
209+ taken[agent.Name] = true
210+ }
211+ c.mu.Unlock()
212+ entries, _ := os.ReadDir(folder)
213+ for _, entry := range entries {
214+ if !strings.HasPrefix(entry.Name(), ".") {
215+ taken[entry.Name()] = true
216+ }
217+ }
218+ for _, sandbox := range sandboxes {
219+ taken[sandbox] = true
220+ }
221+ names := make([]string, 0, len(taken))
222+ for name := range taken {
223+ names = append(names, name)
224+ }
225+ slices.Sort(names)
226+ return names
227+}
228+
229+func orDefault(value, fallback string) string {
230+ if value == "" {
231+ return fallback
232+ }
233+ return value
234+}
235+
194 func (c *Core) hasAgent(name string) bool {236 func (c *Core) hasAgent(name string) bool {
195 c.mu.Lock()237 c.mu.Lock()
196 defer c.mu.Unlock()238 defer c.mu.Unlock()
@@ -205,7 +247,7 @@ func (c *Core) hasAgent(name string) bool {
205 // agent file's path is the same inside.247 // agent file's path is the same inside.
206 func agentFormOf(form CreatorFinish, result creator.Result) (AgentForm, error) {248 func agentFormOf(form CreatorFinish, result creator.Result) (AgentForm, error) {
207 agent := AgentForm{249 agent := AgentForm{
208- Name: form.Name, Title: result.Title, Icon: form.Icon, Environment: result.Environment,250+ Name: form.Name, Title: orDefault(strings.TrimSpace(form.Title), result.Title), Icon: form.Icon, Environment: result.Environment,
209 Program: "mm", Arguments: joinArguments([]string{"--acp", "--config", result.AgentFile}), Workspace: result.Folder,251 Program: "mm", Arguments: joinArguments([]string{"--acp", "--config", result.AgentFile}), Workspace: result.Folder,
210 }252 }
211 switch result.Environment {253 switch result.Environment {
modified internal/app/creator_test.go +3 -3
@@ -38,7 +38,7 @@ func written(t *testing.T, service *app.CreatorService, name string) {
3838 if err != nil {
3939 t.Fatal(err)
4040 }
41- if start.View.Form == nil || start.Version != "mm v1.0.9" {
41+ if start.View.Form == nil || start.Version != "mm v1.0.9" || !slices.Contains(start.Taken, "alice") {
4242 t.Fatalf("start: %+v", start)
4343 }
4444 view, err := service.Answer(context.Background(), acp.FormAnswer{Action: acp.FormAccept, Content: map[string]any{"provider": "llmman", "name": name}})
@@ -50,7 +50,7 @@ func written(t *testing.T, service *app.CreatorService, name string) {
5050 func TestTheCreatedAgentIsAddedToTheConfiguration(t *testing.T) {
5151 service, path, folder := creatorFixture(t, "mm v1.0.9")
5252 written(t, service, "Bob")
53- result, err := service.Finish(context.Background(), app.CreatorFinish{Name: "bob", Icon: "🦊", Environment: creator.Local})
53+ result, err := service.Finish(context.Background(), app.CreatorFinish{Name: "bob", Title: "Bob the fox", Icon: "🦊", Environment: creator.Local})
5454 if err != nil || result.Problem != "" || len(result.Problems) != 0 || result.Name != "bob" {
5555 t.Fatalf("finish: %+v %v", result, err)
5656 }
@@ -60,7 +60,7 @@ func TestTheCreatedAgentIsAddedToTheConfiguration(t *testing.T) {
6060 }
6161 bob, ok := cfg.Agent("bob")
6262 agentFile := filepath.Join(folder, "bob", ".mm", "agent.yaml")
63- if !ok || bob.Icon != "🦊" || bob.Title != "Bob (developer)" || bob.Workspace != filepath.Join(folder, "bob") ||
63+ if !ok || bob.Icon != "🦊" || bob.Title != "Bob the fox" || bob.Workspace != filepath.Join(folder, "bob") ||
6464 !slices.Equal(bob.Args, []string{"--acp", "--config", agentFile}) || filepath.Base(bob.Command) != "mm" {
6565 t.Fatalf("bob: %+v", bob)
6666 }
@@ -38,7 +38,7 @@ func written(t *testing.T, service *app.CreatorService, name string) {
38 if err != nil {38 if err != nil {
39 t.Fatal(err)39 t.Fatal(err)
40 }40 }
41- if start.View.Form == nil || start.Version != "mm v1.0.9" {41+ if start.View.Form == nil || start.Version != "mm v1.0.9" || !slices.Contains(start.Taken, "alice") {
42 t.Fatalf("start: %+v", start)42 t.Fatalf("start: %+v", start)
43 }43 }
44 view, err := service.Answer(context.Background(), acp.FormAnswer{Action: acp.FormAccept, Content: map[string]any{"provider": "llmman", "name": name}})44 view, err := service.Answer(context.Background(), acp.FormAnswer{Action: acp.FormAccept, Content: map[string]any{"provider": "llmman", "name": name}})
@@ -50,7 +50,7 @@ func written(t *testing.T, service *app.CreatorService, name string) {
50 func TestTheCreatedAgentIsAddedToTheConfiguration(t *testing.T) {50 func TestTheCreatedAgentIsAddedToTheConfiguration(t *testing.T) {
51 service, path, folder := creatorFixture(t, "mm v1.0.9")51 service, path, folder := creatorFixture(t, "mm v1.0.9")
52 written(t, service, "Bob")52 written(t, service, "Bob")
53- result, err := service.Finish(context.Background(), app.CreatorFinish{Name: "bob", Icon: "🦊", Environment: creator.Local})53+ result, err := service.Finish(context.Background(), app.CreatorFinish{Name: "bob", Title: "Bob the fox", Icon: "🦊", Environment: creator.Local})
54 if err != nil || result.Problem != "" || len(result.Problems) != 0 || result.Name != "bob" {54 if err != nil || result.Problem != "" || len(result.Problems) != 0 || result.Name != "bob" {
55 t.Fatalf("finish: %+v %v", result, err)55 t.Fatalf("finish: %+v %v", result, err)
56 }56 }
@@ -60,7 +60,7 @@ func TestTheCreatedAgentIsAddedToTheConfiguration(t *testing.T) {
60 }60 }
61 bob, ok := cfg.Agent("bob")61 bob, ok := cfg.Agent("bob")
62 agentFile := filepath.Join(folder, "bob", ".mm", "agent.yaml")62 agentFile := filepath.Join(folder, "bob", ".mm", "agent.yaml")
63- if !ok || bob.Icon != "🦊" || bob.Title != "Bob (developer)" || bob.Workspace != filepath.Join(folder, "bob") ||63+ if !ok || bob.Icon != "🦊" || bob.Title != "Bob the fox" || bob.Workspace != filepath.Join(folder, "bob") ||
64 !slices.Equal(bob.Args, []string{"--acp", "--config", agentFile}) || filepath.Base(bob.Command) != "mm" {64 !slices.Equal(bob.Args, []string{"--acp", "--config", agentFile}) || filepath.Base(bob.Command) != "mm" {
65 t.Fatalf("bob: %+v", bob)65 t.Fatalf("bob: %+v", bob)
66 }66 }
modified internal/app/sbxcreator.go +4 -1
@@ -41,6 +41,9 @@ type SbxCheck struct {
4141 HasKey bool `json:"hasKey"`
4242 Name string `json:"name"`
4343 AgentsFolder string `json:"agentsFolder"`
44+ // Taken is the names already used, by an agent, a folder of the agents'
45+ // folder or a sandbox: the interface suggests a free one (issue #99).
46+ Taken []string `json:"taken"`
4447 }
4548
4649 // SbxCreateForm is the agent to create: its kind, its name (its folder's and
@@ -93,7 +96,7 @@ func (s *SbxCreatorService) Check(ctx context.Context, kindID string) (SbxCheck,
9396 return SbxCheck{}, err
9497 }
9598 folder := s.Core.agentsFolder()
96- check := SbxCheck{HasKey: hasKey, AgentsFolder: folder}
99+ check := SbxCheck{HasKey: hasKey, AgentsFolder: folder, Taken: s.Core.takenNames(folder, sandboxes)}
97100 for index := 1; index < 100; index++ {
98101 name := kind.ID
99102 if index > 1 {
@@ -41,6 +41,9 @@ type SbxCheck struct {
41 HasKey bool `json:"hasKey"`41 HasKey bool `json:"hasKey"`
42 Name string `json:"name"`42 Name string `json:"name"`
43 AgentsFolder string `json:"agentsFolder"`43 AgentsFolder string `json:"agentsFolder"`
44+ // Taken is the names already used, by an agent, a folder of the agents'
45+ // folder or a sandbox: the interface suggests a free one (issue #99).
46+ Taken []string `json:"taken"`
44 }47 }
45 48
46 // SbxCreateForm is the agent to create: its kind, its name (its folder's and49 // SbxCreateForm is the agent to create: its kind, its name (its folder's and
@@ -93,7 +96,7 @@ func (s *SbxCreatorService) Check(ctx context.Context, kindID string) (SbxCheck,
93 return SbxCheck{}, err96 return SbxCheck{}, err
94 }97 }
95 folder := s.Core.agentsFolder()98 folder := s.Core.agentsFolder()
96- check := SbxCheck{HasKey: hasKey, AgentsFolder: folder}99+ check := SbxCheck{HasKey: hasKey, AgentsFolder: folder, Taken: s.Core.takenNames(folder, sandboxes)}
97 for index := 1; index < 100; index++ {100 for index := 1; index < 100; index++ {
98 name := kind.ID101 name := kind.ID
99 if index > 1 {102 if index > 1 {
modified internal/app/sbxcreator_test.go +7 -1
@@ -8,6 +8,7 @@ import (
88 "fmt"
99 "os"
1010 "path/filepath"
11+ "slices"
1112 "strings"
1213 "testing"
1314
@@ -62,9 +63,14 @@ func TestCheckSuggestsAFreeNameAndTellsWhetherTheKeyIsStored(t *testing.T) {
6263 "gemini": {Name: "gemini-2", AgentsFolder: folder},
6364 "codex": {Name: "codex-2", HasKey: true, AgentsFolder: folder},
6465 } {
65- if got, err := service.Check(context.Background(), kind); err != nil || got != want {
66+ got, err := service.Check(context.Background(), kind)
67+ if err != nil || got.Name != want.Name || got.HasKey != want.HasKey || got.AgentsFolder != want.AgentsFolder {
6668 t.Errorf("%s: %+v %v, want %+v", kind, got, err, want)
6769 }
70+ // Issue #99: the names taken by an agent, a folder or a sandbox.
71+ if !slices.Equal(got.Taken, []string{"claude", "codex", "gemini"}) {
72+ t.Errorf("%s: taken %v", kind, got.Taken)
73+ }
6874 }
6975 if _, err := service.Check(context.Background(), "nope"); err == nil {
7076 t.Error("an unknown kind must be refused")
@@ -8,6 +8,7 @@ import (
8 "fmt"8 "fmt"
9 "os"9 "os"
10 "path/filepath"10 "path/filepath"
11+ "slices"
11 "strings"12 "strings"
12 "testing"13 "testing"
13 14
@@ -62,9 +63,14 @@ func TestCheckSuggestsAFreeNameAndTellsWhetherTheKeyIsStored(t *testing.T) {
62 "gemini": {Name: "gemini-2", AgentsFolder: folder},63 "gemini": {Name: "gemini-2", AgentsFolder: folder},
63 "codex": {Name: "codex-2", HasKey: true, AgentsFolder: folder},64 "codex": {Name: "codex-2", HasKey: true, AgentsFolder: folder},
64 } {65 } {
65- if got, err := service.Check(context.Background(), kind); err != nil || got != want {66+ got, err := service.Check(context.Background(), kind)
67+ if err != nil || got.Name != want.Name || got.HasKey != want.HasKey || got.AgentsFolder != want.AgentsFolder {
66 t.Errorf("%s: %+v %v, want %+v", kind, got, err, want)68 t.Errorf("%s: %+v %v, want %+v", kind, got, err, want)
67 }69 }
70+ // Issue #99: the names taken by an agent, a folder or a sandbox.
71+ if !slices.Equal(got.Taken, []string{"claude", "codex", "gemini"}) {
72+ t.Errorf("%s: taken %v", kind, got.Taken)
73+ }
68 }74 }
69 if _, err := service.Check(context.Background(), "nope"); err == nil {75 if _, err := service.Check(context.Background(), "nope"); err == nil {
70 t.Error("an unknown kind must be refused")76 t.Error("an unknown kind must be refused")