worktree-for-agents 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/GUIDE.md CHANGED
@@ -1,45 +1,45 @@
1
- Vas a implementar un cambio, ejecutar una spec o iniciar un flujo. ¿Quieres crear un worktree para hacerlo aislado?
1
+ You are going to implement a change, run a spec, or start a flow. Do you want to create a worktree to work in isolation?
2
2
 
3
- Esta guía explica cómo usar el gestor `worktree-for-agents` para trabajar
4
- aislado en un worktree antes de tocar la rama principal.
3
+ This guide explains how to use the `worktree-for-agents` manager to work
4
+ isolated in a worktree before touching the main branch.
5
5
 
6
- ## Las siete herramientas
6
+ ## The seven tools
7
7
 
8
- El servicio MCP expone exactamente siete herramientas:
8
+ The MCP service exposes exactly seven tools:
9
9
 
10
- - `worktree_create`: crea un worktree y su rama para un identificador de trabajo.
11
- - `worktree_complete`: integra el worktree en la rama base y retira el worktree.
12
- - `worktree_cleanup`: retira el worktree y su rama sin integrar.
13
- - `worktree_recover`: recupera una transacción pendiente por su identificador.
14
- - `worktree_list`: lista los worktrees del repositorio.
15
- - `worktree_prune`: poda la información de worktrees que ya no existen.
16
- - `worktree_status`: muestra el estado de un trabajo.
10
+ - `worktree_create`: creates a worktree and its branch for a work identifier.
11
+ - `worktree_complete`: merges the worktree into the base branch and removes the worktree.
12
+ - `worktree_cleanup`: removes the worktree and its branch without merging.
13
+ - `worktree_recover`: recovers a pending transaction by its identifier.
14
+ - `worktree_list`: lists the repository worktrees.
15
+ - `worktree_prune`: prunes worktree information that no longer exists.
16
+ - `worktree_status`: shows the status of a work item.
17
17
 
18
- Todas exigen una ruta absoluta de repositorio Git en `repo`.
18
+ All of them require an absolute Git repository path in `repo`.
19
19
 
20
- ## Cuándo ofrecer el worktree
20
+ ## When to offer the worktree
21
21
 
22
- Antes de trabajar en la rama principal, ofrece crear un worktree con
23
- `worktree_create`. Trabaja dentro del worktree y luego integra con
24
- `worktree_complete`. Si el trabajo se descarta, usa `worktree_cleanup`.
22
+ Before working on the main branch, offer to create a worktree with
23
+ `worktree_create`. Work inside the worktree and then merge with
24
+ `worktree_complete`. If the work is discarded, use `worktree_cleanup`.
25
25
 
26
- ## Lanzamiento sin bin
26
+ ## Launch without bin
27
27
 
28
- El paquete no expone bin ni `npx`. El servicio MCP se lanza con Node y la
29
- ruta absoluta del paquete:
28
+ The package exposes no bin or `npx`. The MCP service is launched with Node and the
29
+ absolute package path:
30
30
 
31
31
  ```sh
32
- node <paquete>/mcp-server.mjs
32
+ node <package>/mcp-server.mjs
33
33
  ```
34
34
 
35
- La CLI se lanza del mismo modo:
35
+ The CLI is launched the same way:
36
36
 
37
37
  ```sh
38
- node <paquete>/worktree.mjs --version
38
+ node <package>/worktree.mjs --version
39
39
  ```
40
40
 
41
- El diagnóstico de la instalación se obtiene con:
41
+ The installation diagnostics are obtained with:
42
42
 
43
43
  ```sh
44
- node <paquete>/setup.mjs
44
+ node <package>/setup.mjs
45
45
  ```
package/README.md CHANGED
@@ -1,154 +1,153 @@
1
- # Gestor de worktrees
1
+ # Worktree manager
2
2
 
3
- Gestor standalone para crear, completar, limpiar y recuperar worktrees de un
4
- repositorio Git. El proyecto no conoce FlowTask ni depende de sus rutas, refs
5
- heredadas o mecanismos de coordinación.
3
+ Standalone manager to create, complete, clean up, and recover worktrees of a
4
+ Git repository. The project does not know FlowTask and does not depend on its paths, legacy
5
+ refs, or coordination mechanisms.
6
6
 
7
- ## Requisitos
7
+ ## Requirements
8
8
 
9
- - **Python 3.9 o posterior.** El entrypoint sólo comprueba que `python3` esté
10
- disponible en el `PATH`; el piso de 3.9 lo valida el postinstall del paquete
11
- y `node <paquete>/setup.mjs`. El paquete usa sólo la biblioteca estándar.
12
- - **Git 2.17.0 o posterior**, por `git worktree remove`, que es el comando más
13
- reciente que usa el gestor. La línea base de las pruebas es Git 2.54.0. El
14
- gestor no comprueba la versión de Git en tiempo de ejecución.
15
- - **Node 18 o posterior** para los lanzadores `mcp-server.mjs`, `worktree.mjs`
16
- y `setup.mjs`.
17
- - **`bash`** para ejecutar las suites de pruebas.
9
+ - **Python 3.9 or later.** The entrypoint only checks that `python3` is
10
+ available on the `PATH`; the 3.9 floor is validated by the package postinstall
11
+ and `node <package>/setup.mjs`. The package uses only the standard library.
12
+ - **Git 2.17.0 or later**, for `git worktree remove`, which is the most
13
+ recent command used by the manager. The test baseline is Git 2.54.0. The
14
+ manager does not check the Git version at runtime.
15
+ - **Node 18 or later** for the `mcp-server.mjs`, `worktree.mjs`
16
+ and `setup.mjs` launchers.
17
+ - **`bash`** to run the test suites.
18
18
 
19
- ## Instalación
19
+ ## Installation
20
20
 
21
- El gestor se distribuye como paquete npm `worktree-for-agents`, versión
22
- `1.0.0`, sin bin ni `npx`:
21
+ The manager is distributed as the npm package `worktree-for-agents`, version
22
+ `1.0.0`, with no bin or `npx`:
23
23
 
24
24
  ```sh
25
25
  npm install -g worktree-for-agents@latest
26
26
  pnpm add -g worktree-for-agents@latest
27
27
  ```
28
28
 
29
- Comprueba el diagnóstico de la instalación:
29
+ Check the installation diagnostics:
30
30
 
31
31
  ```sh
32
- node <paquete>/setup.mjs
32
+ node <package>/setup.mjs
33
33
  ```
34
34
 
35
- El clon del repositorio queda solo para desarrollo. No hay `pip install` ni
36
- dependencias que resolver: el gestor usa sólo la biblioteca estándar de
37
- Python. Una vez instalado, el gestor funciona sin red.
35
+ The repository clone is for development only. There is no `pip install` and no
36
+ dependencies to resolve: the manager uses only the Python standard
37
+ library. Once installed, the manager works without a network.
38
38
 
39
- ## Uso rápido
39
+ ## Quick start
40
40
 
41
- Las opciones globales van antes del subcomando y `--repo` exige una ruta
42
- absoluta.
41
+ Global options go before the subcommand and `--repo` requires an absolute
42
+ path.
43
43
 
44
44
  ```text
45
45
  worktree.sh [--repo ABS] [--config ABS] [--json] create <id> [--base BRANCH] [--init-submodules] [--prepare] [--verify]
46
- worktree.sh [globales] complete <id> [--preserve-dirty] [--title TEXTO] [--body TEXTO]
47
- worktree.sh [globales] cleanup <id> [--discard]
48
- worktree.sh [globales] recover [<transaction-id>]
49
- worktree.sh [globales] prune
50
- worktree.sh [globales] list
46
+ worktree.sh [globals] complete <id> [--preserve-dirty] [--title TEXT] [--body TEXT]
47
+ worktree.sh [globals] cleanup <id> [--discard]
48
+ worktree.sh [globals] recover [<transaction-id>]
49
+ worktree.sh [globals] prune
50
+ worktree.sh [globals] list
51
51
  ```
52
52
 
53
- Target-direct opera sobre el repositorio indicado en `--repo` y no crea un
54
- worktree del parent ni modifica su `HEAD`. Su sintaxis coloca `--parent-repo`
55
- después de la acción y exige `--submodule-path` en `create`:
53
+ Target-direct operates on the repository given in `--repo` and does not create a
54
+ parent worktree nor modify its `HEAD`. Its syntax places `--parent-repo`
55
+ after the action and requires `--submodule-path` in `create`:
56
56
 
57
57
  ```text
58
- worktree.sh [--repo ABS] target-direct <acción> <id> --parent-repo <parent> [--target submodule] [--submodule-path <REL>] [--base BRANCH] [--link-parent staged-only] [--descriptor PATH]
58
+ worktree.sh [--repo ABS] target-direct <action> <id> --parent-repo <parent> [--target submodule] [--submodule-path <REL>] [--base BRANCH] [--link-parent staged-only] [--descriptor PATH]
59
59
  ```
60
60
 
61
- Las acciones son `create`, `link-parent`, `abort`, `complete` y `recover`, y el
62
- único modo de enlace admitido es `--link-parent staged-only`.
61
+ The actions are `create`, `link-parent`, `abort`, `complete` and `recover`, and the
62
+ only supported link mode is `--link-parent staged-only`.
63
63
 
64
- `--json` publica un único documento JSON. `--request-json <archivo|->` publica
65
- el mismo sobre de nueve claves que usa el transporte MCP, y acepta `--json` de
66
- forma opcional. Un dry run de `create` publica `planned: true` y no crea
67
- worktree ni rama.
64
+ `--json` publishes a single JSON document. `--request-json <file|->` publishes
65
+ the same nine-key envelope used by the MCP transport, and optionally accepts `--json`.
66
+ A dry run of `create` publishes `planned: true` and creates no
67
+ worktree or branch.
68
68
 
69
- El servicio MCP se publica por stdio. Desde el paquete instalado se lanza sin
69
+ The MCP service is published over stdio. From the installed package it is launched without
70
70
  bin:
71
71
 
72
72
  ```sh
73
- node <paquete>/mcp-server.mjs
73
+ node <package>/mcp-server.mjs
74
74
  ```
75
75
 
76
- La CLI se usa del mismo modo:
76
+ The CLI is used the same way:
77
77
 
78
78
  ```sh
79
- node <paquete>/worktree.mjs --version
79
+ node <package>/worktree.mjs --version
80
80
  ```
81
81
 
82
- El `initialize` del MCP publica la guía en `instructions`:
82
+ The MCP `initialize` publishes the guide in `instructions`:
83
83
 
84
84
  ```text
85
- Vas a implementar un cambio, ejecutar una spec o iniciar un flujo. ¿Quieres crear un worktree para hacerlo aislado?
85
+ You are going to implement a change, run a spec, or start a flow. Do you want to create a worktree to work in isolation?
86
86
  ```
87
87
 
88
- Para desarrollo, el transporte también arranca desde el checkout:
88
+ For development, the transport also starts from the checkout:
89
89
 
90
90
  ```sh
91
91
  PYTHONPATH=. python3 -m worktree_manager.mcp_transport
92
92
  ```
93
93
 
94
- ## Configuración
94
+ ## Configuration
95
95
 
96
- La configuración es un archivo opcional de `clave=valor`, seleccionado con
97
- `--config` o tomado de `.worktree-manager.conf` en la raíz del repositorio.
98
- Las once claves y sus valores por defecto son:
96
+ The configuration is an optional `key=value` file, selected with
97
+ `--config` or taken from `.worktree-manager.conf` at the repository root.
98
+ The eleven keys and their default values are:
99
99
 
100
- | Clave | Por defecto | Restricción |
100
+ | Key | Default | Restriction |
101
101
  |---|---|---|
102
- | `worktrees_dir` | `.worktrees` | No puede empezar por `-` |
102
+ | `worktrees_dir` | `.worktrees` | Must not start with `-` |
103
103
  | `branch_prefix` | `worktree/` | — |
104
- | `state_dir` | `worktree-manager` | Ruta relativa segura |
105
- | `backup_dir` | `backups` | No es una ruta absoluta y no contiene `..` |
106
- | `backup_ref_prefix` | `worktree-manager/backups` | Sin `..` |
107
- | `lock_dir` | `locks` | Ruta relativa segura |
108
- | `prepare_command` | `''` (vacío) | Requerida cuando `prepare_enabled=true` |
109
- | `verify_command` | `''` (vacío) | Requerida cuando `verify_enabled=true` |
110
- | `prepare_enabled` | `false` | `true` o `false` |
111
- | `verify_enabled` | `false` | `true` o `false` |
112
- | `preserve_dirty` | `false` | `true` o `false` |
113
-
114
- Cada clave puede aparecer una sola vez. Las claves desconocidas, las líneas mal
115
- formadas, los booleanos inválidos y las rutas inseguras se rechazan como
116
- `invalid_configuration` con código de salida `3`. La variable de entorno
117
- `WORKTREE_MANAGER_<CLAVE>`, con la clave en mayúsculas, reemplaza el valor
118
- leído del archivo.
119
-
120
- ## Arquitectura
121
-
122
- `worktree.sh` es el entrypoint y delega el lifecycle en el paquete Python
123
- `worktree_manager`, que se ejecuta con `python3 -m worktree_manager`. El paquete
124
- es la única implementación del lifecycle: no existe un motor shell alternativo.
125
-
126
- El paquete se organiza en módulos con una responsabilidad cada uno:
127
-
128
- | Módulo | Responsabilidad |
104
+ | `state_dir` | `worktree-manager` | Safe relative path |
105
+ | `backup_dir` | `backups` | Not an absolute path and contains no `..` |
106
+ | `backup_ref_prefix` | `worktree-manager/backups` | No `..` |
107
+ | `lock_dir` | `locks` | Safe relative path |
108
+ | `prepare_command` | `''` (empty) | Required when `prepare_enabled=true` |
109
+ | `verify_command` | `''` (empty) | Required when `verify_enabled=true` |
110
+ | `prepare_enabled` | `false` | `true` or `false` |
111
+ | `verify_enabled` | `false` | `true` or `false` |
112
+ | `preserve_dirty` | `false` | `true` or `false` |
113
+
114
+ Each key may appear only once. Unknown keys, malformed lines, invalid booleans, and unsafe paths are rejected as
115
+ `invalid_configuration` with exit code `3`. The environment variable
116
+ `WORKTREE_MANAGER_<KEY>`, with the key in uppercase, overrides the value
117
+ read from the file.
118
+
119
+ ## Architecture
120
+
121
+ `worktree.sh` is the entrypoint and delegates the lifecycle to the Python
122
+ package `worktree_manager`, which runs with `python3 -m worktree_manager`. The package
123
+ is the only lifecycle implementation: there is no alternative shell engine.
124
+
125
+ The package is organized in modules with one responsibility each:
126
+
127
+ | Module | Responsibility |
129
128
  | --- | --- |
130
- | `worktree_manager.cli` | Despachador de comandos, despacho target-direct y contrato de salida. |
131
- | `worktree_manager.configuration` | Lectura y validación de la configuración `clave=valor`. |
132
- | `worktree_manager.models` | Valores de dominio compartidos: resultados, errores e identidades. |
133
- | `worktree_manager.output` | Publicación del resultado como texto legible o como JSON. |
134
- | `worktree_manager.git_repository` | Acceso compartido a Git para los módulos del lifecycle. |
135
- | `worktree_manager.worktree_lifecycle` | Operaciones `create`, `complete`, `cleanup` y `prune`. |
136
- | `worktree_manager.commit_message` | Composición determinista del mensaje de cierre y fallback neutro. |
137
- | `worktree_manager.target_direct_adapter` | Operaciones target-direct sobre un submódulo. |
138
- | `worktree_manager.recovery_manager` | Recuperación de transacciones pendientes. |
139
- | `worktree_manager.transaction_journal` | Journal durable de transacciones y enlaces. |
140
- | `worktree_manager.backup_store` | Referencias de respaldo retenidas. |
141
- | `worktree_manager.lock_manager` | Exclusión mutua entre procesos. |
142
- | `worktree_manager.state_digest` | Digest canónico del estado del repositorio y de un plan. |
143
- | `worktree_manager.mcp_server` | Servicio MCP publicado por stdio. |
144
- | `worktree_manager.mcp_contract` | Contratos estrictos y versionados de petición y de sobre. |
145
- | `worktree_manager.mcp_operations` | Fachada sobre los servicios de lifecycle y de recuperación. |
146
- | `worktree_manager.mcp_transport` | Punto de entrada del transporte por stdio. |
147
-
148
- El paquete contiene además el marcador de paquete `__init__.py` y el punto de
149
- entrada `__main__.py`, que es lo que ejecuta `python3 -m worktree_manager`.
150
-
151
- ## Pruebas
129
+ | `worktree_manager.cli` | Command dispatcher, target-direct dispatch, and output contract. |
130
+ | `worktree_manager.configuration` | Reading and validating the `key=value` configuration. |
131
+ | `worktree_manager.models` | Shared domain values: results, errors, and identities. |
132
+ | `worktree_manager.output` | Publishing the result as readable text or as JSON. |
133
+ | `worktree_manager.git_repository` | Shared Git access for the lifecycle modules. |
134
+ | `worktree_manager.worktree_lifecycle` | `create`, `complete`, `cleanup`, and `prune` operations. |
135
+ | `worktree_manager.commit_message` | Deterministic closing message composition and neutral fallback. |
136
+ | `worktree_manager.target_direct_adapter` | Target-direct operations on a submodule. |
137
+ | `worktree_manager.recovery_manager` | Recovery of pending transactions. |
138
+ | `worktree_manager.transaction_journal` | Durable transaction and link journal. |
139
+ | `worktree_manager.backup_store` | Retained backup references. |
140
+ | `worktree_manager.lock_manager` | Mutual exclusion between processes. |
141
+ | `worktree_manager.state_digest` | Canonical digest of the repository state and of a plan. |
142
+ | `worktree_manager.mcp_server` | MCP service published over stdio. |
143
+ | `worktree_manager.mcp_contract` | Strict versioned request and envelope contracts. |
144
+ | `worktree_manager.mcp_operations` | Facade over the lifecycle and recovery services. |
145
+ | `worktree_manager.mcp_transport` | Stdio transport entrypoint. |
146
+
147
+ The package also contains the package marker `__init__.py` and the
148
+ entrypoint `__main__.py`, which is what `python3 -m worktree_manager` runs.
149
+
150
+ ## Tests
152
151
 
153
152
  ```sh
154
153
  bash tests/cli-usage.sh
@@ -160,22 +159,22 @@ PYTHONPATH=. python3 -m unittest discover -s tests -p 'test_*.py'
160
159
  PYTHONPATH=. python3 -m unittest discover -s tests -p 'test_mcp*.py' -v
161
160
  ```
162
161
 
163
- ## Documentación
162
+ ## Documentation
164
163
 
165
- - [Contrato de salida de la CLI](docs/cli-contract-v1.md) — contrato.
166
- - [Contrato del servicio MCP](docs/mcp-contract.md) — contrato.
167
- - [Guía de instalación y uso](docs/installation.md) — guía.
168
- - [Histórico bash → Python](docs/history-bash-to-python.md) — memoria, no contrato.
164
+ - [CLI output contract](docs/cli-contract-v1.md) — contract.
165
+ - [MCP service contract](docs/mcp-contract.md) — contract.
166
+ - [Installation and usage guide](docs/installation.md) — guide.
167
+ - [History bash → Python](docs/history-bash-to-python.md) — notes, not a contract.
169
168
 
170
- Los contratos fijan el comportamiento verificable. La guía explica cómo usarlo.
171
- El histórico registra la transición y no sustituye a los contratos.
169
+ Contracts pin the verifiable behavior. The guide explains how to use it.
170
+ The history records the transition and does not replace the contracts.
172
171
 
173
- ## Fuente y distribución
172
+ ## Source and distribution
174
173
 
175
- Este repositorio es la fuente de verdad de la implementación, de los contratos,
176
- de la instalación y del histórico del gestor.
174
+ This repository is the source of truth for the implementation, the contracts,
175
+ the installation, and the manager history.
177
176
 
178
- El consumidor que integra este repositorio documenta el adaptador, el bridge y
179
- la frontera del submódulo: **la documentación de esa integración vive en el
180
- repositorio consumidor**. El gestor no mantiene una copia vendorizada de sí
181
- mismo y no conoce al consumidor.
177
+ The consumer that integrates this repository documents the adapter, the bridge, and
178
+ the submodule boundary: **that integration documentation lives in the
179
+ consumer repository**. The manager does not keep a vendored copy of itself
180
+ and does not know the consumer.
@@ -1,15 +1,15 @@
1
- # Instalación y uso del gestor de worktrees
1
+ # Installation and usage of the worktree manager
2
2
 
3
- Esta guía explica cómo instalar el gestor como paquete npm y cómo usarlo
4
- sobre un repositorio de prueba. La integración con un consumidor concreto
5
- se documenta en el repositorio que integra el gestor.
3
+ This guide explains how to install the manager as an npm package and how to use it
4
+ on a test repository. Integration with a specific consumer
5
+ is documented in the repository that integrates the manager.
6
6
 
7
- Los ejemplos usan `$HOME` porque `--repo` exige una ruta absoluta. `<paquete>`
8
- es la ruta del paquete instalado.
7
+ The examples use `$HOME` because `--repo` requires an absolute path. `<package>`
8
+ is the installed package path.
9
9
 
10
- ## 1. Requisitos
10
+ ## 1. Requirements
11
11
 
12
- Comprueba las versiones disponibles:
12
+ Check the available versions:
13
13
 
14
14
  ```sh
15
15
  python3 --version
@@ -17,39 +17,38 @@ git --version
17
17
  node --version
18
18
  ```
19
19
 
20
- - **Python 3.9 o posterior.** El postinstall del paquete verifica el piso de
21
- 3.9 y falla de forma visible si falta o es anterior. `node
22
- <paquete>/setup.mjs` informa el intérprete detectado.
23
- - **Git 2.17.0 o posterior**, por `git worktree remove`. La línea base de las
24
- pruebas es Git 2.54.0. El gestor no comprueba la versión de Git en tiempo de
25
- ejecución.
26
- - **Node 18 o posterior** para los lanzadores `mcp-server.mjs`, `worktree.mjs`
27
- y `setup.mjs`.
28
- - **`bash`** para ejecutar las suites de pruebas.
20
+ - **Python 3.9 or later.** The package postinstall checks the
21
+ 3.9 floor and fails visibly if it is missing or older. `node
22
+ <package>/setup.mjs` reports the detected interpreter.
23
+ - **Git 2.17.0 or later**, for `git worktree remove`. The test baseline is
24
+ Git 2.54.0. The manager does not check the Git version at runtime.
25
+ - **Node 18 or later** for the `mcp-server.mjs`, `worktree.mjs`
26
+ and `setup.mjs` launchers.
27
+ - **`bash`** to run the test suites.
29
28
 
30
- ## 2. Instalar el paquete
29
+ ## 2. Install the package
31
30
 
32
31
  ```sh
33
32
  npm install -g worktree-for-agents@latest
34
33
  pnpm add -g worktree-for-agents@latest
35
34
  ```
36
35
 
37
- Comprueba el diagnóstico:
36
+ Check the diagnostics:
38
37
 
39
38
  ```sh
40
- node <paquete>/setup.mjs
39
+ node <package>/setup.mjs
41
40
  ```
42
41
 
43
- El paquete no expone bin ni `npx`: el MCP se lanza con `node
44
- <paquete>/mcp-server.mjs` y la CLI con `node <paquete>/worktree.mjs`. El clon
45
- del repositorio queda solo para desarrollo. No hay `pip install` ni
46
- dependencias que resolver: el gestor usa sólo la biblioteca estándar de
47
- Python. Una vez instalado, el gestor funciona sin red.
42
+ The package exposes no bin or `npx`: the MCP is launched with `node
43
+ <package>/mcp-server.mjs` and the CLI with `node <package>/worktree.mjs`. The
44
+ repository clone is for development only. There is no `pip install` and no
45
+ dependencies to resolve: the manager uses only the Python standard
46
+ library. Once installed, the manager works without a network.
48
47
 
49
- ## 3. Un repositorio de prueba
48
+ ## 3. A test repository
50
49
 
51
- El gestor exige que la ruta del worktree esté ignorada por Git, y
52
- `.worktrees/` en el `.gitignore` cumple esa condición.
50
+ The manager requires the worktree path to be ignored by Git, and
51
+ `.worktrees/` in `.gitignore` satisfies that condition.
53
52
 
54
53
  ```sh
55
54
  mkdir "$HOME/demo" && cd "$HOME/demo"
@@ -62,113 +61,113 @@ git add file .gitignore
62
61
  git commit -m "base"
63
62
  ```
64
63
 
65
- Crea el worktree:
64
+ Create the worktree:
66
65
 
67
66
  ```sh
68
67
  "$HOME/worktree-manager/worktree.sh" --repo "$HOME/demo" create demo --base main
69
68
  ```
70
69
 
71
- Qué deja cada paso:
70
+ What each step leaves behind:
72
71
 
73
- - `git init` crea el repositorio y su rama `main`.
74
- - El commit inicial fija la base sobre la que se construye el worktree.
75
- - `create` crea la rama `worktree/demo`, el worktree en `$HOME/demo/.worktrees/demo`
76
- y el journal de la transacción en el directorio de estado del repositorio.
72
+ - `git init` creates the repository and its `main` branch.
73
+ - The initial commit pins the base on top of which the worktree is built.
74
+ - `create` creates the `worktree/demo` branch, the worktree at `$HOME/demo/.worktrees/demo`
75
+ and the transaction journal in the repository state directory.
77
76
 
78
- Comprueba el estado:
77
+ Check the status:
79
78
 
80
79
  ```sh
81
80
  "$HOME/worktree-manager/worktree.sh" --repo "$HOME/demo" list
82
81
  ```
83
82
 
84
- Trabaja dentro del worktree y luego intégralo:
83
+ Work inside the worktree and then merge it:
85
84
 
86
85
  ```sh
87
86
  cd "$HOME/demo/.worktrees/demo"
88
- printf 'cambio\n' >> file
87
+ printf 'change\n' >> file
89
88
  git add file
90
- git commit -m "cambio"
89
+ git commit -m "change"
91
90
  cd "$HOME/demo"
92
91
  "$HOME/worktree-manager/worktree.sh" --repo "$HOME/demo" complete demo --base main
93
92
  ```
94
93
 
95
- `complete` exige que el repositorio esté en la rama base, que el worktree no
96
- tenga cambios sin commitear y que el destino tampoco los tenga, salvo que se
97
- use `--preserve-dirty`. Al terminar, el cambio queda integrado como un commit
98
- de squash en `main`, y el worktree y su rama se retiran.
94
+ `complete` requires the repository to be on the base branch, the worktree to have
95
+ no uncommitted changes, and the destination to have none either, unless
96
+ `--preserve-dirty` is used. When finished, the change is merged as a squash
97
+ commit on `main`, and the worktree and its branch are removed.
99
98
 
100
- Para dejar un commit de cierre diciente, pasa `--title` y, opcionalmente,
99
+ To leave an expressive closing commit, pass `--title` and optionally
101
100
  `--body`:
102
101
 
103
102
  ```sh
104
103
  "$HOME/worktree-manager/worktree.sh" --repo "$HOME/demo" complete demo --base main \
105
- --title "Cierre de demo" --body "Entrega: cambio integrado. Motivo: verificacion."
104
+ --title "Demo closing" --body "Delivery: merged change. Reason: verification."
106
105
  ```
107
106
 
108
- Si no se pasa `--title`, el gestor usa el fallback generico:
109
- `Complete <work_id> (generic closure)` con el cuerpo
107
+ If `--title` is not passed, the manager uses the generic fallback:
108
+ `Complete <work_id> (generic closure)` with the body
110
109
  `No delivery description was available at closure time.`.
111
110
 
112
- ## 4. Configuración
111
+ ## 4. Configuration
113
112
 
114
- La configuración es un archivo de `clave=valor`. El gestor lo toma de
115
- `.worktree-manager.conf` en la raíz del repositorio, o del archivo que se le
116
- pase con `--config`, que debe existir y ser una ruta absoluta. Si se pasan
117
- ambos, `--config` prevalece. Después, la variable de entorno
118
- `WORKTREE_MANAGER_<CLAVE>`, con la clave en mayúsculas, reemplaza el valor
119
- leído del archivo.
113
+ The configuration is a `key=value` file. The manager reads it from
114
+ `.worktree-manager.conf` at the repository root, or from the file passed
115
+ with `--config`, which must exist and be an absolute path. If both are
116
+ given, `--config` wins. Afterwards, the environment variable
117
+ `WORKTREE_MANAGER_<KEY>`, with the key in uppercase, overrides the value
118
+ read from the file.
120
119
 
121
- Las once claves y sus valores por defecto son:
120
+ The eleven keys and their default values are:
122
121
 
123
- | Clave | Por defecto | Restricción |
122
+ | Key | Default | Restriction |
124
123
  |---|---|---|
125
- | `worktrees_dir` | `.worktrees` | No puede empezar por `-` |
124
+ | `worktrees_dir` | `.worktrees` | Must not start with `-` |
126
125
  | `branch_prefix` | `worktree/` | — |
127
- | `state_dir` | `worktree-manager` | Ruta relativa segura |
128
- | `backup_dir` | `backups` | No es una ruta absoluta y no contiene `..` |
129
- | `backup_ref_prefix` | `worktree-manager/backups` | Sin `..` |
130
- | `lock_dir` | `locks` | Ruta relativa segura |
131
- | `prepare_command` | `''` (vacío) | Requerida cuando `prepare_enabled=true` |
132
- | `verify_command` | `''` (vacío) | Requerida cuando `verify_enabled=true` |
133
- | `prepare_enabled` | `false` | `true` o `false` |
134
- | `verify_enabled` | `false` | `true` o `false` |
135
- | `preserve_dirty` | `false` | `true` o `false` |
136
-
137
- Cada clave puede aparecer una sola vez. Una clave desconocida, una línea sin
138
- `=`, un booleano inválido o una ruta insegura se rechazan como
139
- `invalid_configuration` con código de salida `3`, antes de cualquier efecto.
140
-
141
- ## 5. Contratos de salida
142
-
143
- - `--json` publica un único documento JSON con siete claves: `contract_version`,
144
- `tool_version`, `operation`, `result`, `data`, `warnings` y `error`.
145
- - `--request-json <archivo|->` publica el mismo documento de nueve claves que
146
- usa el transporte MCP: las siete anteriores más `repository` y
147
- `transaction_id`. Acepta `--json` de forma opcional y el documento publicado
148
- no cambia.
149
- - Un dry run de `create` publica `planned: true` y no crea worktree ni rama.
150
- `init_submodules_result` es `planned` o `not_requested`, y `prepare` y
151
- `verify` son `planned` o `skipped`.
152
- - El servicio MCP se publica por stdio y expone siete herramientas. Desde el
153
- paquete instalado se lanza sin bin:
126
+ | `state_dir` | `worktree-manager` | Safe relative path |
127
+ | `backup_dir` | `backups` | Not an absolute path and contains no `..` |
128
+ | `backup_ref_prefix` | `worktree-manager/backups` | No `..` |
129
+ | `lock_dir` | `locks` | Safe relative path |
130
+ | `prepare_command` | `''` (empty) | Required when `prepare_enabled=true` |
131
+ | `verify_command` | `''` (empty) | Required when `verify_enabled=true` |
132
+ | `prepare_enabled` | `false` | `true` or `false` |
133
+ | `verify_enabled` | `false` | `true` or `false` |
134
+ | `preserve_dirty` | `false` | `true` or `false` |
135
+
136
+ Each key may appear only once. An unknown key, a line without
137
+ `=`, an invalid boolean, or an unsafe path is rejected as
138
+ `invalid_configuration` with exit code `3`, before any effect.
139
+
140
+ ## 5. Output contracts
141
+
142
+ - `--json` publishes a single JSON document with seven keys: `contract_version`,
143
+ `tool_version`, `operation`, `result`, `data`, `warnings` and `error`.
144
+ - `--request-json <file|->` publishes the same nine-key document used by
145
+ the MCP transport: the previous seven plus `repository` and
146
+ `transaction_id`. It optionally accepts `--json` and the published document
147
+ does not change.
148
+ - A dry run of `create` publishes `planned: true` and creates no worktree or branch.
149
+ `init_submodules_result` is `planned` or `not_requested`, and `prepare` and
150
+ `verify` are `planned` or `skipped`.
151
+ - The MCP service is published over stdio and exposes seven tools. From the
152
+ installed package it is launched without bin:
154
153
 
155
154
  ```sh
156
- node <paquete>/mcp-server.mjs
155
+ node <package>/mcp-server.mjs
157
156
  ```
158
157
 
159
- El `initialize` publica la guía en `instructions`:
158
+ `initialize` publishes the guide in `instructions`:
160
159
 
161
160
  ```text
162
- Vas a implementar un cambio, ejecutar una spec o iniciar un flujo. ¿Quieres crear un worktree para hacerlo aislado?
161
+ You are going to implement a change, run a spec, or start a flow. Do you want to create a worktree to work in isolation?
163
162
  ```
164
163
 
165
- Para desarrollo, el transporte también arranca desde el checkout:
164
+ For development, the transport also starts from the checkout:
166
165
 
167
166
  ```sh
168
167
  PYTHONPATH=. python3 -m worktree_manager.mcp_transport
169
168
  ```
170
169
 
171
- ## 6. Pruebas
170
+ ## 6. Tests
172
171
 
173
172
  ```sh
174
173
  bash tests/cli-usage.sh
@@ -180,35 +179,35 @@ PYTHONPATH=. python3 -m unittest discover -s tests -p 'test_*.py'
180
179
  PYTHONPATH=. python3 -m unittest discover -s tests -p 'test_mcp*.py' -v
181
180
  ```
182
181
 
183
- ## 7. Consumo como submódulo y coexistencia
182
+ ## 7. Consumption as a submodule and coexistence
184
183
 
185
- Un repositorio consumidor puede materializar el gestor como submódulo. La
186
- regla es única: el checkout materializado y el gitlink registrado deben ser el
187
- mismo commit.
184
+ A consumer repository may materialize the manager as a submodule. The
185
+ rule is unique: the materialized checkout and the registered gitlink must be the
186
+ same commit.
188
187
 
189
- El paquete npm `worktree-for-agents` es independiente del submódulo: embarca
190
- el runtime Python y funciona sin red una vez instalado. `node
191
- <paquete>/setup.mjs` diagnostica qué instalación está activa cuando coexisten
192
- el paquete npm, la copia global de FlowTask y el submódulo local. El clon del
193
- repositorio queda solo para desarrollo y no se promete otra distribución.
188
+ The npm package `worktree-for-agents` is independent of the submodule: it ships
189
+ the Python runtime and works without a network once installed. `node
190
+ <package>/setup.mjs` diagnoses which installation is active when the
191
+ npm package, the global FlowTask copy, and the local submodule coexist. The repository
192
+ clone is for development only and no other distribution is promised.
194
193
 
195
- ## 8. Solución de problemas
194
+ ## 8. Troubleshooting
196
195
 
197
- - **`python3` no está en el `PATH`.** El entrypoint termina con el código `127`
198
- y el mensaje
196
+ - **`python3` is not on the `PATH`.** The entrypoint exits with code `127`
197
+ and the message
199
198
  `worktree manager requires Python 3 (python3) on PATH; install Python 3 and retry.`
200
- - **Falta el punto de entrada del paquete.** El entrypoint termina con el
201
- código `126` y el mensaje
202
- `worktree manager Python entry point is missing: <ruta>/worktree_manager/__main__.py`.
203
- - **La ruta del repositorio es relativa.** La operación se rechaza con el
204
- código `invalid_repository`, el código de salida `3` y el mensaje
199
+ - **The package entrypoint is missing.** The entrypoint exits with
200
+ code `126` and the message
201
+ `worktree manager Python entry point is missing: <path>/worktree_manager/__main__.py`.
202
+ - **The repository path is relative.** The operation is rejected with
203
+ code `invalid_repository`, exit code `3`, and the message
205
204
  `Repository path must be absolute`.
206
- - **La versión de Python es anterior a 3.9.** El instalador del consumidor lo
207
- informa como `python <version> is older than the required 3.9`. El entrypoint
208
- de este repositorio no comprueba la versión.
205
+ - **The Python version is older than 3.9.** The consumer installer reports
206
+ it as `python <version> is older than the required 3.9`. The entrypoint
207
+ of this repository does not check the version.
209
208
 
210
- ## 9. Qué no cubre
209
+ ## 9. What it does not cover
211
210
 
212
- Esta guía no cubre la integración con un consumidor: ni el adaptador, ni el
213
- bridge, ni la validación del gitlink, ni el procedimiento de instalación del
214
- consumidor. Eso se documenta en el repositorio consumidor.
211
+ This guide does not cover integration with a consumer: neither the adapter, nor the
212
+ bridge, nor gitlink validation, nor the consumer installation procedure.
213
+ That is documented in the consumer repository.
@@ -18,7 +18,7 @@ The `initialize` result carries `serverInfo.name "worktree-for-agents"` and
18
18
  an `instructions` field with the literal guide text:
19
19
 
20
20
  ```text
21
- Vas a implementar un cambio, ejecutar una spec o iniciar un flujo. ¿Quieres crear un worktree para hacerlo aislado?
21
+ You are going to implement a change, run a spec, or start a flow. Do you want to create a worktree to work in isolation?
22
22
  ```
23
23
 
24
24
  When installed from npm, the service is launched without a bin entry via:
@@ -68,11 +68,11 @@ on independent equivalent repositories. When `MCP_E2E_EVIDENCE_DIR` is set,
68
68
  each test writes its request/response trace there as JSON. No evidence or Git
69
69
  fixture is written into the checked-out repository by default.
70
70
 
71
- ## Mensaje de cierre
71
+ ## Closing message
72
72
 
73
- `worktree_complete` acepta `commit_title` y `commit_body` (strings opcionales).
74
- Se validan como strings y se incluyen en el plan hash solo para esta operacion.
75
- El dry-run publica `commit_subject` y `commit_body` compuestos; execute los
76
- pasa al lifecycle. Si faltan, el gestor usa el fallback neutro
73
+ `worktree_complete` accepts `commit_title` and `commit_body` (optional strings).
74
+ They are validated as strings and included in the plan hash only for this operation.
75
+ The dry run publishes the composed `commit_subject` and `commit_body`; execute passes them
76
+ to the lifecycle. If missing, the manager uses the neutral fallback
77
77
  `Complete <work_id> (generic closure)` / `No delivery description was available
78
78
  at closure time.`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "worktree-for-agents",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Standalone Git worktree manager with a stdio MCP service usable by any coding agent",
5
5
  "type": "module",
6
6
  "engines": {
@@ -1,2 +1,2 @@
1
1
  """Standalone Python worktree management backend."""
2
- __version__ = '1.0.0'
2
+ __version__ = '1.0.1'
@@ -6,7 +6,7 @@ from .mcp_contract import TOOL_NAMES, absolute_repository, error_envelope
6
6
  from .mcp_operations import call
7
7
  from .models import ManagerError
8
8
 
9
- MCP_INSTRUCTIONS = "Vas a implementar un cambio, ejecutar una spec o iniciar un flujo. ¿Quieres crear un worktree para hacerlo aislado?"
9
+ MCP_INSTRUCTIONS = "You are going to implement a change, run a spec, or start a flow. Do you want to create a worktree to work in isolation?"
10
10
 
11
11
  def schemas():
12
12
  from .mcp_contract import FIELDS, REQUIRED, output_schema