create-harness-btp 0.2.0 → 0.2.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/AI/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # harness-btp
2
2
 
3
- [![version](https://img.shields.io/badge/version-v0.2.0-blue)](https://github.com/horangelmillan/harness-btp/releases/tag/v0.2.0)
3
+ [![version](https://img.shields.io/badge/version-v0.2.1-blue)](https://github.com/horangelmillan/harness-btp/releases/tag/v0.2.1)
4
4
  [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
5
5
  [![platform](https://img.shields.io/badge/platform-windows%20%7C%20linux%20%7C%20macos-lightgrey)](https://github.com/horangelmillan/harness-btp)
6
6
  [![agent](https://img.shields.io/badge/agent-any%20AGENTS.md--compatible-purple)](https://github.com/horangelmillan/harness-btp)
@@ -15,6 +15,7 @@ Para quien construye MVPs SAP BTP y quiere empezar cada proyecto con el mismo fl
15
15
  - [Requisitos](#requisitos)
16
16
  - [Quickstart](#quickstart)
17
17
  - [Instalación](#instalación)
18
+ - [Instalación asistida por agente](#instalación-asistida-por-agente)
18
19
  - [Actualizar y desinstalar](#actualizar-y-desinstalar)
19
20
  - [Adaptadores opcionales](#adaptadores-opcionales)
20
21
  - [Estructura del repo](#estructura-del-repo)
@@ -54,7 +55,7 @@ El camino de 30 segundos en un proyecto nuevo. Elige tu shell:
54
55
  PowerShell (Windows):
55
56
 
56
57
  ```powershell
57
- npx -p degit degit horangelmillan/harness-btp#v0.2.0 AI-tmp -- AI-tmp
58
+ npx -p degit degit horangelmillan/harness-btp#v0.2.1 AI-tmp -- AI-tmp
58
59
  powershell -ExecutionPolicy Bypass -File AI-tmp/install.ps1 -Dest .
59
60
  Remove-Item -Recurse -Force AI-tmp
60
61
  ```
@@ -62,7 +63,7 @@ Remove-Item -Recurse -Force AI-tmp
62
63
  bash (Linux, macOS o Git Bash):
63
64
 
64
65
  ```bash
65
- npx -p degit degit horangelmillan/harness-btp#v0.2.0 AI-tmp -- AI-tmp
66
+ npx -p degit degit horangelmillan/harness-btp#v0.2.1 AI-tmp -- AI-tmp
66
67
  sh AI-tmp/install.sh --dest .
67
68
  rm -rf AI-tmp
68
69
  ```
@@ -78,7 +79,7 @@ Descarga solo lo necesario, sin historial git:
78
79
  PowerShell:
79
80
 
80
81
  ```powershell
81
- npx -p degit degit horangelmillan/harness-btp#v0.2.0 AI-tmp -- AI-tmp
82
+ npx -p degit degit horangelmillan/harness-btp#v0.2.1 AI-tmp -- AI-tmp
82
83
  powershell -ExecutionPolicy Bypass -File AI-tmp/install.ps1 -Dest .
83
84
  Remove-Item -Recurse -Force AI-tmp
84
85
  ```
@@ -86,7 +87,7 @@ Remove-Item -Recurse -Force AI-tmp
86
87
  bash:
87
88
 
88
89
  ```bash
89
- npx -p degit degit horangelmillan/harness-btp#v0.2.0 AI-tmp -- AI-tmp
90
+ npx -p degit degit horangelmillan/harness-btp#v0.2.1 AI-tmp -- AI-tmp
90
91
  sh AI-tmp/install.sh --dest .
91
92
  rm -rf AI-tmp
92
93
  ```
@@ -98,7 +99,7 @@ Clon superficial anclado al tag:
98
99
  PowerShell:
99
100
 
100
101
  ```powershell
101
- git clone --branch v0.2.0 --depth 1 https://github.com/horangelmillan/harness-btp AI-tmp
102
+ git clone --branch v0.2.1 --depth 1 https://github.com/horangelmillan/harness-btp AI-tmp
102
103
  powershell -ExecutionPolicy Bypass -File AI-tmp/install.ps1 -Dest .
103
104
  Remove-Item -Recurse -Force AI-tmp
104
105
  ```
@@ -106,7 +107,7 @@ Remove-Item -Recurse -Force AI-tmp
106
107
  bash:
107
108
 
108
109
  ```bash
109
- git clone --branch v0.2.0 --depth 1 https://github.com/horangelmillan/harness-btp AI-tmp
110
+ git clone --branch v0.2.1 --depth 1 https://github.com/horangelmillan/harness-btp AI-tmp
110
111
  sh AI-tmp/install.sh --dest .
111
112
  rm -rf AI-tmp
112
113
  ```
@@ -116,7 +117,7 @@ rm -rf AI-tmp
116
117
  Sin descargas manuales (requiere publicar `create-harness-btp` en el registry). Igual en todos los SO:
117
118
 
118
119
  ```bash
119
- pnpm dlx create-harness-btp --dest .
120
+ pnpm dlx create-harness-btp@0.2.1 --dest .
120
121
  ```
121
122
 
122
123
  ### Qué hace el instalador
@@ -131,7 +132,15 @@ Salida típica en proyecto nuevo:
131
132
  ```text
132
133
  CREATE: AI/
133
134
  CREATE: AGENTS.md
134
- OK: harness v0.2.0 instalado
135
+ OK: harness v0.2.1 instalado
136
+ ```
137
+
138
+ ## Instalación asistida por agente
139
+
140
+ Si prefieres que tu agente lo instale por ti, pégale este bloque:
141
+
142
+ ```text
143
+ Pégale esto a tu agente: Instala el harness BTP versión 0.2.1 en la raíz del proyecto: 1) Lee el README del repo harness-btp (opción pnpm). 2) Ejecuta EXACTAMENTE pnpm dlx create-harness-btp@0.2.1 --dest . (sin --force salvo que AI/ ya exista y yo lo autorice; con --force verifica BACKUP primero). 3) PROHIBIDO pisar o borrar: AGENTS.md raíz existente, package.json, mta.yaml, lockfiles. 4) Verifica lo INSTALADO (no vale pnpm view): AI/VERSION debe decir 0.2.1. 5) Si migraste npm→pnpm con import+install+test en verde, borra package-lock.json. 6) Corre AI/scripts/check-prereqs y reporta faltantes. 7) Si hay placeholders por adaptar, dímelos antes de desplegar. Sin secretos en el reporte. Repórtame: comando, salida del instalador, contenido de AI/VERSION, git status y pendientes.
135
144
  ```
136
145
 
137
146
  ## Actualizar y desinstalar
@@ -141,7 +150,7 @@ OK: harness v0.2.0 instalado
141
150
  PowerShell:
142
151
 
143
152
  ```powershell
144
- npx -p degit degit horangelmillan/harness-btp#v0.2.0 AI-tmp -- AI-tmp
153
+ npx -p degit degit horangelmillan/harness-btp#v0.2.1 AI-tmp -- AI-tmp
145
154
  powershell -ExecutionPolicy Bypass -File AI-tmp/install.ps1 -Dest . -Force
146
155
  Remove-Item -Recurse -Force AI-tmp
147
156
  # tu versión anterior queda en AI.bak por si quieres comparar
@@ -150,7 +159,7 @@ Remove-Item -Recurse -Force AI-tmp
150
159
  bash:
151
160
 
152
161
  ```bash
153
- npx -p degit degit horangelmillan/harness-btp#v0.2.0 AI-tmp -- AI-tmp
162
+ npx -p degit degit horangelmillan/harness-btp#v0.2.1 AI-tmp -- AI-tmp
154
163
  sh AI-tmp/install.sh --dest . --force
155
164
  rm -rf AI-tmp
156
165
  # tu versión anterior queda en AI.bak por si quieres comparar
@@ -202,7 +211,7 @@ harness-btp/
202
211
  ├── install.ps1 / install.sh # instaladores idempotentes (SKIP / CREATE / BACKUP / OK)
203
212
  ├── bin/ # ejecutable de create-harness-btp (pnpm dlx)
204
213
  ├── package.json # name create-harness-btp
205
- └── VERSION # 0.2.0
214
+ └── VERSION # 0.2.1
206
215
  ```
207
216
 
208
217
  ## Cómo lo descubre el agente
@@ -223,7 +232,7 @@ Tú no configuras nada: el agente se adapta solo.
223
232
  | Líneas duplicadas en `.gitignore` | edición manual tras la fusión | el instalador fusiona sin duplicar; borra el duplicado a mano |
224
233
  | `ExecutionPolicy` bloquea `install.ps1` | política de PowerShell | `powershell -ExecutionPolicy Bypass -File AI-tmp/install.ps1 -Dest .` (o usa `install.sh` en Git Bash) |
225
234
  | `ABORT: opción desconocida` en `install.sh` | flag inexistente | `sh install.sh --help` lista `--dest`, `--force` |
226
- | `degit` falla sin Node | `degit` corre sobre Node 18+ | instala Node o usa `git clone --branch v0.2.0` |
235
+ | `degit` falla sin Node | `degit` corre sobre Node 18+ | instala Node o usa `git clone --branch v0.2.1` |
227
236
  | Tu cliente no lee los agentes de `.opencode/` | layout específico de OpenCode | son un adapter opcional; el flujo está en `AI/AGENTS.md` + `AI/INICIO.md` |
228
237
 
229
238
  ## Compatibilidad
@@ -242,7 +251,7 @@ Matriz honesta cliente × SO (`verificado` = probado con evidencia; `esperado` =
242
251
 
243
252
  - Abre un issue antes que un PR si el cambio afecta reglas o scripts.
244
253
  - PRs pequeños, en español, con evidencia del comando corrido.
245
- - Versionado semver: los cambios se publican como tags `vX.Y.Z` (`VERSION` + `package.json` + tag git coinciden).
254
+ - Versionado semver: los cambios se publican como tags `vX.Y.Z` (`package.json` + `VERSION` + `AI/VERSION` + tag git coinciden; el workflow lo verifica).
246
255
 
247
256
  ## Licencia
248
257
 
@@ -250,4 +259,5 @@ MIT. Haz lo que quieras con el harness; sin garantía.
250
259
 
251
260
  ## Changelog
252
261
 
262
+ - **v0.2.1** — trazabilidad y versión visible: `AI/VERSION` viaja en el paquete, los instaladores imprimen la versión (`OK: harness vX.Y.Z…`, `BACKUP` con vieja→nueva) y el workflow exige que `package.json`, `VERSION` y `AI/VERSION` coincidan. Comandos fijados a `@0.2.1` / `#v0.2.1` / `--branch v0.2.1`.
253
263
  - **v0.2.0** — versión inicial: carpeta `AI/` parametrizada, instaladores idempotentes `install.ps1` / `install.sh`, `create-harness-btp` vía `pnpm dlx`, plantilla de puntero, docs de flujo / cf-safe / habilitación trial, plantilla de spec.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -29,22 +29,28 @@ if (!fs.existsSync(path.join(src, "AI"))) {
29
29
  console.log("ABORT: no se encontró AI/ junto al paquete");
30
30
  process.exit(1);
31
31
  }
32
+ function readVer(p) {
33
+ try {
34
+ return fs.readFileSync(p, "utf8").split(/\r?\n/)[0].trim() || "desconocida";
35
+ } catch { return "desconocida"; }
36
+ }
37
+ const harnessVersion = readVer(path.join(src, "AI", "VERSION"));
32
38
 
33
39
  const aiDst = path.join(dest, "AI");
34
40
  if (fs.existsSync(aiDst)) {
35
41
  if (force) {
42
+ const oldVersion = readVer(path.join(aiDst, "VERSION"));
36
43
  const bak = path.join(dest, "AI.bak");
37
44
  fs.rmSync(bak, { recursive: true, force: true });
38
45
  fs.renameSync(aiDst, bak);
39
- console.log("BACKUP: AI/ -> AI.bak");
40
46
  fs.cpSync(path.join(src, "AI"), aiDst, { recursive: true });
41
- console.log("CREATE: AI/ (reinstalado con --force)");
47
+ console.log("BACKUP: AI/ (v" + oldVersion + ") -> AI.bak; CREATE: AI/ (v" + harnessVersion + ")");
42
48
  } else {
43
49
  console.log("SKIP: AI/ ya existe (usa --force para reinstalar con backup .bak)");
44
50
  }
45
51
  } else {
46
52
  fs.cpSync(path.join(src, "AI"), aiDst, { recursive: true });
47
- console.log("CREATE: AI/");
53
+ console.log("CREATE: AI/ (v" + harnessVersion + ")");
48
54
  }
49
55
 
50
56
  const agentsDst = path.join(dest, "AGENTS.md");
@@ -67,4 +73,4 @@ if (missing.length === 0) {
67
73
  fs.appendFileSync(giDst, (cur.length ? "" : "") + missing.join("\n") + "\n");
68
74
  console.log("CREATE: .gitignore (+" + missing.length + " líneas)");
69
75
  }
70
- console.log("OK: harness instalado en " + dest + " (package.json y mta.yaml intactos)");
76
+ console.log("OK: harness v" + harnessVersion + " instalado en " + dest + " (package.json y mta.yaml intactos)");
package/install.ps1 CHANGED
@@ -16,21 +16,29 @@ $TplPointer = Join-Path $Src "templates\AGENTS.pointer.md"
16
16
 
17
17
  if (-not (Test-Path $AiSrc)) { Write-Output "ABORT: no se encontró AI/ junto a install.ps1"; exit 1 }
18
18
 
19
+ $HarnessVersion = "desconocida"
20
+ $VersionFile = Join-Path $AiSrc "VERSION"
21
+ if (Test-Path $VersionFile) { $HarnessVersion = ((Get-Content $VersionFile | Select-Object -First 1) + "").Trim() }
22
+ if (-not $HarnessVersion) { $HarnessVersion = "desconocida" }
23
+
19
24
  $AiDst = Join-Path $Dest "AI"
20
25
  if (Test-Path $AiDst) {
21
26
  if ($Force) {
27
+ $OldVersion = "desconocida"
28
+ $DstVersionFile = Join-Path $AiDst "VERSION"
29
+ if (Test-Path $DstVersionFile) { $OldVersion = ((Get-Content $DstVersionFile | Select-Object -First 1) + "").Trim() }
30
+ if (-not $OldVersion) { $OldVersion = "desconocida" }
22
31
  $Bak = Join-Path $Dest "AI.bak"
23
32
  if (Test-Path $Bak) { Remove-Item $Bak -Recurse -Force }
24
33
  Rename-Item $AiDst "AI.bak"
25
- Write-Output "BACKUP: AI/ -> AI.bak"
26
34
  Copy-Item $AiSrc $AiDst -Recurse -Force
27
- Write-Output "CREATE: AI/ (reinstalado con -Force)"
35
+ Write-Output "BACKUP: AI/ (v$OldVersion) -> AI.bak; CREATE: AI/ (v$HarnessVersion)"
28
36
  } else {
29
37
  Write-Output "SKIP: AI/ ya existe (usa -Force para reinstalar con backup .bak)"
30
38
  }
31
39
  } else {
32
40
  Copy-Item $AiSrc $AiDst -Recurse -Force
33
- Write-Output "CREATE: AI/"
41
+ Write-Output "CREATE: AI/ (v$HarnessVersion)"
34
42
  }
35
43
 
36
44
  $AgentsDst = Join-Path $Dest "AGENTS.md"
@@ -57,7 +65,7 @@ if (Test-Path $GiDst) {
57
65
  Write-Output "CREATE: .gitignore"
58
66
  }
59
67
 
60
- Write-Output "OK: harness instalado en $Dest (package.json y mta.yaml intactos)"
68
+ Write-Output "OK: harness v$HarnessVersion instalado en $Dest (package.json y mta.yaml intactos)"
61
69
 
62
70
  # Verificación de prerrequisitos en modo aviso (no bloquea la instalación).
63
71
  try {
package/install.sh CHANGED
@@ -19,17 +19,22 @@ while [ $# -gt 0 ]; do
19
19
  done
20
20
  SRC="$(cd "$(dirname "$0")" && pwd)"
21
21
  if [ ! -d "$SRC/AI" ]; then echo "ABORT: no se encontró AI/ junto a install.sh"; exit 1; fi
22
+ HARNESS_VERSION="desconocida"
23
+ if [ -f "$SRC/AI/VERSION" ]; then HARNESS_VERSION="$(tr -d '[:space:]' < "$SRC/AI/VERSION")"; fi
24
+ [ -n "$HARNESS_VERSION" ] || HARNESS_VERSION="desconocida"
22
25
 
23
26
  if [ -d "$DEST/AI" ]; then
24
27
  if [ "$FORCE" -eq 1 ]; then
28
+ OLD_VERSION="desconocida"
29
+ if [ -f "$DEST/AI/VERSION" ]; then OLD_VERSION="$(tr -d '[:space:]' < "$DEST/AI/VERSION")"; fi
30
+ [ -n "$OLD_VERSION" ] || OLD_VERSION="desconocida"
25
31
  rm -rf "$DEST/AI.bak" && mv "$DEST/AI" "$DEST/AI.bak"
26
- echo "BACKUP: AI/ -> AI.bak"
27
- cp -r "$SRC/AI" "$DEST/AI" && echo "CREATE: AI/ (reinstalado con --force)"
32
+ cp -r "$SRC/AI" "$DEST/AI" && echo "BACKUP: AI/ (v$OLD_VERSION) -> AI.bak; CREATE: AI/ (v$HARNESS_VERSION)"
28
33
  else
29
34
  echo "SKIP: AI/ ya existe (usa --force para reinstalar con backup .bak)"
30
35
  fi
31
36
  else
32
- cp -r "$SRC/AI" "$DEST/AI" && echo "CREATE: AI/"
37
+ cp -r "$SRC/AI" "$DEST/AI" && echo "CREATE: AI/ (v$HARNESS_VERSION)"
33
38
  fi
34
39
 
35
40
  if [ -f "$DEST/AGENTS.md" ]; then
@@ -51,7 +56,7 @@ done < "$FRAG"
51
56
  if [ "$ADDED" -eq 0 ]; then echo "SKIP: .gitignore ya contiene el fragmento"
52
57
  else echo "CREATE: .gitignore (+$ADDED líneas)"; fi
53
58
 
54
- echo "OK: harness instalado en $DEST (package.json y mta.yaml intactos)"
59
+ echo "OK: harness v$HARNESS_VERSION instalado en $DEST (package.json y mta.yaml intactos)"
55
60
 
56
61
  # Verificación de prerrequisitos en modo aviso (no bloquea la instalación).
57
62
  if [ -f "$SRC/AI/scripts/check-prereqs.sh" ]; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-harness-btp",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Instala el harness MVP SAP BTP como carpeta AI/ en cualquier proyecto",
5
5
  "keywords": ["sap-btp", "opencode", "harness", "agents", "scaffolder", "create"],
6
6
  "homepage": "https://github.com/horangelmillan/harness-btp#readme",