@bradygaster/squad-cli 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +555 -0
- package/README.md +6 -6
- package/dist/cli/commands/aspire.d.ts +1 -1
- package/dist/cli/commands/aspire.js +2 -2
- package/dist/cli/commands/aspire.js.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +30 -9
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/cross-squad.d.ts +15 -2
- package/dist/cli/commands/cross-squad.d.ts.map +1 -1
- package/dist/cli/commands/cross-squad.js +78 -4
- package/dist/cli/commands/cross-squad.js.map +1 -1
- package/dist/cli/commands/loop.js +1 -1
- package/dist/cli/commands/loop.js.map +1 -1
- package/dist/cli/commands/migrate-backend.d.ts.map +1 -1
- package/dist/cli/commands/migrate-backend.js +23 -0
- package/dist/cli/commands/migrate-backend.js.map +1 -1
- package/dist/cli/commands/preset.d.ts +1 -0
- package/dist/cli/commands/preset.d.ts.map +1 -1
- package/dist/cli/commands/preset.js +60 -3
- package/dist/cli/commands/preset.js.map +1 -1
- package/dist/cli/commands/skill.d.ts.map +1 -1
- package/dist/cli/commands/skill.js +4 -3
- package/dist/cli/commands/skill.js.map +1 -1
- package/dist/cli/commands/state-mcp.d.ts.map +1 -1
- package/dist/cli/commands/state-mcp.js +50 -16
- package/dist/cli/commands/state-mcp.js.map +1 -1
- package/dist/cli/commands/watch/agent-spawn.d.ts +21 -1
- package/dist/cli/commands/watch/agent-spawn.d.ts.map +1 -1
- package/dist/cli/commands/watch/agent-spawn.js +38 -5
- package/dist/cli/commands/watch/agent-spawn.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/decision-hygiene.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/decision-hygiene.js +1 -25
- package/dist/cli/commands/watch/capabilities/decision-hygiene.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-email.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-email.js +2 -25
- package/dist/cli/commands/watch/capabilities/monitor-email.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-teams.js +2 -26
- package/dist/cli/commands/watch/capabilities/monitor-teams.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/retro.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/retro.js +1 -25
- package/dist/cli/commands/watch/capabilities/retro.js.map +1 -1
- package/dist/cli/commands/watch/config.d.ts.map +1 -1
- package/dist/cli/commands/watch/config.js +5 -0
- package/dist/cli/commands/watch/config.js.map +1 -1
- package/dist/cli/commands/watch/index.d.ts.map +1 -1
- package/dist/cli/commands/watch/index.js +3 -1
- package/dist/cli/commands/watch/index.js.map +1 -1
- package/dist/cli/core/cast.d.ts.map +1 -1
- package/dist/cli/core/cast.js +84 -0
- package/dist/cli/core/cast.js.map +1 -1
- package/dist/cli/core/command-help.d.ts.map +1 -1
- package/dist/cli/core/command-help.js +25 -12
- package/dist/cli/core/command-help.js.map +1 -1
- package/dist/cli/core/gh-cli.d.ts +6 -1
- package/dist/cli/core/gh-cli.d.ts.map +1 -1
- package/dist/cli/core/gh-cli.js +8 -3
- package/dist/cli/core/gh-cli.js.map +1 -1
- package/dist/cli/core/init.d.ts.map +1 -1
- package/dist/cli/core/init.js +82 -3
- package/dist/cli/core/init.js.map +1 -1
- package/dist/cli/core/mcp-root.d.ts +14 -1
- package/dist/cli/core/mcp-root.d.ts.map +1 -1
- package/dist/cli/core/mcp-root.js +72 -1
- package/dist/cli/core/mcp-root.js.map +1 -1
- package/dist/cli/core/mcp-spec.d.ts.map +1 -1
- package/dist/cli/core/mcp-spec.js +3 -2
- package/dist/cli/core/mcp-spec.js.map +1 -1
- package/dist/cli/core/templates.d.ts.map +1 -1
- package/dist/cli/core/templates.js +72 -12
- package/dist/cli/core/templates.js.map +1 -1
- package/dist/cli/core/upgrade.d.ts +26 -0
- package/dist/cli/core/upgrade.d.ts.map +1 -1
- package/dist/cli/core/upgrade.js +236 -11
- package/dist/cli/core/upgrade.js.map +1 -1
- package/dist/cli/shell/components/InputPrompt.d.ts.map +1 -1
- package/dist/cli/shell/components/InputPrompt.js +17 -9
- package/dist/cli/shell/components/InputPrompt.js.map +1 -1
- package/dist/cli/shell/index.js +1 -1
- package/dist/cli/shell/index.js.map +1 -1
- package/dist/cli-entry.js +28 -11
- package/dist/cli-entry.js.map +1 -1
- package/package.json +10 -9
- package/templates/casting-reference.md +18 -0
- package/templates/fact-checker-policy.md +104 -0
- package/templates/skills/cli-wiring/SKILL.md +2 -2
- package/templates/skills/coordinator-init-mode/SKILL.md +83 -0
- package/templates/skills/coordinator-response-mode/SKILL.md +97 -0
- package/templates/skills/coordinator-source-of-truth/SKILL.md +45 -0
- package/templates/skills/cross-squad/SKILL.md +66 -6
- package/templates/skills/cross-squad-communication/SKILL.md +399 -0
- package/templates/skills/init-mode/SKILL.md +4 -4
- package/templates/skills/personal-squad/SKILL.md +3 -2
- package/templates/skills/release-process/SKILL.md +2 -2
- package/templates/skills/{squad-commands → squad}/SKILL.md +8 -12
- package/templates/skills/squad-help/SKILL.md +97 -0
- package/templates/skills/squad-version-check/SKILL.md +9 -0
- package/templates/skills/tiered-memory/SKILL.md +31 -44
- package/templates/spawn-reference.md +57 -2
- package/templates/squad.agent.md.template +204 -180
- package/templates/workflows/squad-heartbeat.yml +2 -5
- package/templates/workflows/squad-issue-assign.yml +3 -7
- package/templates/workflows/squad-triage.yml +3 -11
- package/templates/workflows/sync-squad-labels.yml +2 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-spec.js","sourceRoot":"","sources":["../../../src/cli/core/mcp-spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAWH,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAU9C,qEAAqE;AACrE,MAAM,UAA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AM,MAAM,CAAC,mBAAmB,CAAC,CAAC;IACzE,OAAO,MAAM,0BAA0B,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/cli/core/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,+BAA+B;AAC/B,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/cli/core/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,+BAA+B;AAC/B,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,kBAAkB,EAAE,OAAO,CAAC;IAC5B,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,YAAY,EA6W3C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAWxC"}
|
|
@@ -136,6 +136,12 @@ export const TEMPLATE_MANIFEST = [
|
|
|
136
136
|
overwriteOnUpgrade: true,
|
|
137
137
|
description: 'Fact checker charter template',
|
|
138
138
|
},
|
|
139
|
+
{
|
|
140
|
+
source: 'fact-checker-policy.md',
|
|
141
|
+
destination: 'templates/fact-checker-policy.md',
|
|
142
|
+
overwriteOnUpgrade: true,
|
|
143
|
+
description: 'Fact checker policy template (verification + DA methodology)',
|
|
144
|
+
},
|
|
139
145
|
{
|
|
140
146
|
source: 'skill.md',
|
|
141
147
|
destination: 'templates/skill.md',
|
|
@@ -178,64 +184,118 @@ export const TEMPLATE_MANIFEST = [
|
|
|
178
184
|
// Skills subdirectory (squad-owned)
|
|
179
185
|
{
|
|
180
186
|
source: 'skills/squad-conventions/SKILL.md',
|
|
181
|
-
destination: '../.
|
|
187
|
+
destination: '../.github/skills/squad-conventions/SKILL.md',
|
|
182
188
|
overwriteOnUpgrade: true,
|
|
183
189
|
description: 'Squad conventions skill definition',
|
|
184
190
|
},
|
|
185
191
|
{
|
|
186
192
|
source: 'skills/error-recovery/SKILL.md',
|
|
187
|
-
destination: '../.
|
|
193
|
+
destination: '../.github/skills/error-recovery/SKILL.md',
|
|
188
194
|
overwriteOnUpgrade: true,
|
|
189
195
|
description: 'Graceful error recovery patterns',
|
|
190
196
|
},
|
|
191
197
|
{
|
|
192
198
|
source: 'skills/secret-handling/SKILL.md',
|
|
193
|
-
destination: '../.
|
|
199
|
+
destination: '../.github/skills/secret-handling/SKILL.md',
|
|
194
200
|
overwriteOnUpgrade: true,
|
|
195
201
|
description: 'Secrets management and credential safety',
|
|
196
202
|
},
|
|
197
203
|
{
|
|
198
204
|
source: 'skills/git-workflow/SKILL.md',
|
|
199
|
-
destination: '../.
|
|
205
|
+
destination: '../.github/skills/git-workflow/SKILL.md',
|
|
200
206
|
overwriteOnUpgrade: true,
|
|
201
207
|
description: 'Git workflow conventions and branch management',
|
|
202
208
|
},
|
|
203
209
|
{
|
|
204
210
|
source: 'skills/session-recovery/SKILL.md',
|
|
205
|
-
destination: '../.
|
|
211
|
+
destination: '../.github/skills/session-recovery/SKILL.md',
|
|
206
212
|
overwriteOnUpgrade: true,
|
|
207
213
|
description: 'Session checkpoint and recovery patterns',
|
|
208
214
|
},
|
|
209
215
|
{
|
|
210
216
|
source: 'skills/reviewer-protocol/SKILL.md',
|
|
211
|
-
destination: '../.
|
|
217
|
+
destination: '../.github/skills/reviewer-protocol/SKILL.md',
|
|
212
218
|
overwriteOnUpgrade: true,
|
|
213
219
|
description: 'Code review protocol and reviewer gate patterns',
|
|
214
220
|
},
|
|
215
221
|
{
|
|
216
222
|
source: 'skills/test-discipline/SKILL.md',
|
|
217
|
-
destination: '../.
|
|
223
|
+
destination: '../.github/skills/test-discipline/SKILL.md',
|
|
218
224
|
overwriteOnUpgrade: true,
|
|
219
225
|
description: 'Test-first discipline and coverage expectations',
|
|
220
226
|
},
|
|
221
227
|
{
|
|
222
228
|
source: 'skills/agent-collaboration/SKILL.md',
|
|
223
|
-
destination: '../.
|
|
229
|
+
destination: '../.github/skills/agent-collaboration/SKILL.md',
|
|
224
230
|
overwriteOnUpgrade: true,
|
|
225
231
|
description: 'Multi-agent collaboration and handoff patterns',
|
|
226
232
|
},
|
|
227
233
|
{
|
|
228
|
-
source: 'skills/squad
|
|
229
|
-
destination: '../.
|
|
234
|
+
source: 'skills/squad/SKILL.md',
|
|
235
|
+
destination: '../.github/skills/squad/SKILL.md',
|
|
230
236
|
overwriteOnUpgrade: true,
|
|
231
|
-
description: '
|
|
237
|
+
description: 'Squad command catalog — invokable via /squad slash command',
|
|
232
238
|
},
|
|
233
239
|
{
|
|
234
240
|
source: 'skills/squad-version-check/SKILL.md',
|
|
235
|
-
destination: '../.
|
|
241
|
+
destination: '../.github/skills/squad-version-check/SKILL.md',
|
|
236
242
|
overwriteOnUpgrade: true,
|
|
237
243
|
description: 'Squad CLI internals — version stamping & upgrade mechanics',
|
|
238
244
|
},
|
|
245
|
+
{
|
|
246
|
+
source: 'skills/squad-help/SKILL.md',
|
|
247
|
+
destination: '../.github/skills/squad-help/SKILL.md',
|
|
248
|
+
overwriteOnUpgrade: true,
|
|
249
|
+
description: 'How to actually use Squad — agent vs skill vs slash command (#1297 redirect)',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
source: 'skills/cross-squad-communication/SKILL.md',
|
|
253
|
+
destination: '../.github/skills/cross-squad-communication/SKILL.md',
|
|
254
|
+
overwriteOnUpgrade: true,
|
|
255
|
+
description: 'Cross-squad delegation — calling another squad as a sub-agent',
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
source: 'skills/tiered-memory/SKILL.md',
|
|
259
|
+
destination: '../.github/skills/tiered-memory/SKILL.md',
|
|
260
|
+
overwriteOnUpgrade: true,
|
|
261
|
+
description: 'Tiered-memory access patterns (hot/cold/wiki)',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
source: 'skills/iterative-retrieval/SKILL.md',
|
|
265
|
+
destination: '../.github/skills/iterative-retrieval/SKILL.md',
|
|
266
|
+
overwriteOnUpgrade: true,
|
|
267
|
+
description: 'Iterative retrieval for long-running squad work',
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
source: 'skills/reflect/SKILL.md',
|
|
271
|
+
destination: '../.github/skills/reflect/SKILL.md',
|
|
272
|
+
overwriteOnUpgrade: true,
|
|
273
|
+
description: 'Reflection skill for capturing session learnings',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
source: 'skills/cross-squad/SKILL.md',
|
|
277
|
+
destination: '../.github/skills/cross-squad/SKILL.md',
|
|
278
|
+
overwriteOnUpgrade: true,
|
|
279
|
+
description: 'Cross-squad discovery — finding peer squads via registry/upstream',
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
source: 'skills/coordinator-source-of-truth/SKILL.md',
|
|
283
|
+
destination: '../.github/skills/coordinator-source-of-truth/SKILL.md',
|
|
284
|
+
overwriteOnUpgrade: true,
|
|
285
|
+
description: 'Squad file-by-file source-of-truth hierarchy (extracted from squad.agent.md, #1308)',
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
source: 'skills/coordinator-response-mode/SKILL.md',
|
|
289
|
+
destination: '../.github/skills/coordinator-response-mode/SKILL.md',
|
|
290
|
+
overwriteOnUpgrade: true,
|
|
291
|
+
description: 'Response Mode Selection (Direct/Lightweight/Standard/Full) — full decision table + Lightweight spawn template',
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
source: 'skills/coordinator-init-mode/SKILL.md',
|
|
295
|
+
destination: '../.github/skills/coordinator-init-mode/SKILL.md',
|
|
296
|
+
overwriteOnUpgrade: true,
|
|
297
|
+
description: 'Init Mode two-phase protocol — propose team (Phase 1) then create .squad/ scaffolding (Phase 2)',
|
|
298
|
+
},
|
|
239
299
|
// Session init reference (squad-owned, coordinator reads at session start)
|
|
240
300
|
{
|
|
241
301
|
source: 'session-init-reference.md',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/cli/core/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAcxC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAmB;IAC/C,mBAAmB;IACnB;QACE,MAAM,EAAE,yBAAyB;QACjC,WAAW,EAAE,kCAAkC;QAC/C,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,gCAAgC;KAC9C;IAED,qDAAqD;IACrD,uEAAuE;IACvE,0EAA0E;IAC1E,0EAA0E;IAC1E;QACE,MAAM,EAAE,sBAAsB;QAC9B,WAAW,EAAE,sBAAsB;QACnC,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,0BAA0B;KACxC;IACD;QACE,MAAM,EAAE,qBAAqB;QAC7B,WAAW,EAAE,qBAAqB;QAClC,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,8BAA8B;KAC5C;IACD;QACE,MAAM,EAAE,uBAAuB;QAC/B,WAAW,EAAE,uBAAuB;QACpC,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,mC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B;QAC3C,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,kCAAkC;KAChD;IAED,oCAAoC;IACpC;QACE,MAAM,EAAE,mCAAmC;QAC3C,WAAW,EAAE
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../src/cli/core/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAcxC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAmB;IAC/C,mBAAmB;IACnB;QACE,MAAM,EAAE,yBAAyB;QACjC,WAAW,EAAE,kCAAkC;QAC/C,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,gCAAgC;KAC9C;IAED,qDAAqD;IACrD,uEAAuE;IACvE,0EAA0E;IAC1E,0EAA0E;IAC1E;QACE,MAAM,EAAE,sBAAsB;QAC9B,WAAW,EAAE,sBAAsB;QACnC,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,0BAA0B;KACxC;IACD;QACE,MAAM,EAAE,qBAAqB;QAC7B,WAAW,EAAE,qBAAqB;QAClC,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,8BAA8B;KAC5C;IACD;QACE,MAAM,EAAE,uBAAuB;QAC/B,WAAW,EAAE,uBAAuB;QACpC,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,mCAAmC;KACjD;IAED,iEAAiE;IACjE,kEAAkE;IAClE,yBAAyB;IACzB;QACE,MAAM,EAAE,YAAY;QACpB,WAAW,EAAE,sBAAsB;QACnC,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,wBAAwB;KACtC;IACD;QACE,MAAM,EAAE,wBAAwB;QAChC,W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7B,MAAM,WAAW,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnD,IAAI,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QACzC,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;QACpD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,MAAM;QAC1B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;AACnF,CAAC"}
|
|
@@ -5,12 +5,21 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { type SquadStateMcpSpec } from './mcp-spec.js';
|
|
7
7
|
export { resolveSquadStateMcpSpec } from './mcp-spec.js';
|
|
8
|
+
/**
|
|
9
|
+
* Returns true if the version looks like a local dev build or unpublished
|
|
10
|
+
* pre-release that cannot be resolved from the public npm registry.
|
|
11
|
+
* Guards against writing unresolvable version strings into MCP config
|
|
12
|
+
* (see #1204).
|
|
13
|
+
*/
|
|
14
|
+
export declare function isLocalOrUnpublishedVersion(version: string): boolean;
|
|
8
15
|
export interface UpgradeOptions {
|
|
9
16
|
migrateDirectory?: boolean;
|
|
10
17
|
self?: boolean;
|
|
11
18
|
force?: boolean;
|
|
12
19
|
/** When --self, install the insider (prerelease) tag instead of latest. */
|
|
13
20
|
insider?: boolean;
|
|
21
|
+
/** Preview what upgrade would change without writing. */
|
|
22
|
+
dryRun?: boolean;
|
|
14
23
|
}
|
|
15
24
|
export interface UpdateInfo {
|
|
16
25
|
fromVersion: string;
|
|
@@ -40,6 +49,23 @@ export declare function ensureCastingDefaults(dest: string, templatesDir?: strin
|
|
|
40
49
|
/** Human-readable single-line description of an McpSpec for success() messages. */
|
|
41
50
|
export declare function describeMcpSpec(spec: SquadStateMcpSpec): string;
|
|
42
51
|
export declare function ensureMemoryGovernanceUpgradeDefaults(dest: string): string[];
|
|
52
|
+
/**
|
|
53
|
+
* Scaffold always-on built-in agent charters (Rai, Fact Checker) that ship
|
|
54
|
+
* as templates but may be missing from older squads. Idempotent — only writes
|
|
55
|
+
* when the agent directory is absent. Never overwrites existing charters or
|
|
56
|
+
* history. Sources charter content from the shipped `templates/{name}-charter.md`
|
|
57
|
+
* files when available, falling back to a minimal placeholder otherwise.
|
|
58
|
+
*
|
|
59
|
+
* Scribe and Ralph are intentionally NOT scaffolded here — they should already
|
|
60
|
+
* exist in any squad that ran a prior init, and their charters are inlined in
|
|
61
|
+
* cast.ts (no shipped template file). Adding them here would risk overwriting
|
|
62
|
+
* customized versions on legacy squads.
|
|
63
|
+
*
|
|
64
|
+
* @param dest Root directory containing .squad/
|
|
65
|
+
* @param templatesDir Directory containing shipped charter templates
|
|
66
|
+
* @returns Paths (relative to dest) of created agent files
|
|
67
|
+
*/
|
|
68
|
+
export declare function ensureBuiltinAgents(dest: string, templatesDir: string): string[];
|
|
43
69
|
/**
|
|
44
70
|
* Run the upgrade command
|
|
45
71
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/cli/core/upgrade.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../../src/cli/core/upgrade.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACjF,OA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AM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,CA0LhG;AAMD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAiBD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDpF"}
|
package/dist/cli/core/upgrade.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { execFileSync } from 'node:child_process';
|
|
8
8
|
import { FSStorageProvider } from '@bradygaster/squad-sdk';
|
|
9
|
-
import { success, warn, info, dim } from './output.js';
|
|
9
|
+
import { success, warn, info, dim, bold } from './output.js';
|
|
10
10
|
import { fatal } from './errors.js';
|
|
11
11
|
import { detectSquadDir } from './detect-squad-dir.js';
|
|
12
12
|
import { TEMPLATE_MANIFEST, getTemplatesDir } from './templates.js';
|
|
@@ -16,14 +16,40 @@ import { resolveSquadStateMcpSpec } from './mcp-spec.js';
|
|
|
16
16
|
export { resolveSquadStateMcpSpec } from './mcp-spec.js';
|
|
17
17
|
import { ensureSquadStateMcpInRoot, tombstoneStaleSquadStateInProjectMcp } from './mcp-root.js';
|
|
18
18
|
const storage = new FSStorageProvider();
|
|
19
|
+
/**
|
|
20
|
+
* Returns true if the version looks like a local dev build or unpublished
|
|
21
|
+
* pre-release that cannot be resolved from the public npm registry.
|
|
22
|
+
* Guards against writing unresolvable version strings into MCP config
|
|
23
|
+
* (see #1204).
|
|
24
|
+
*/
|
|
25
|
+
export function isLocalOrUnpublishedVersion(version) {
|
|
26
|
+
if (!version || version === '0.0.0')
|
|
27
|
+
return true;
|
|
28
|
+
// Local linked builds often have 0.0.0-development or similar sentinel
|
|
29
|
+
if (/^0\.0\.0/.test(version))
|
|
30
|
+
return true;
|
|
31
|
+
// Versions with `+` build metadata (e.g. 0.10.0+local.1234) are not
|
|
32
|
+
// publishable to npm — they indicate a local build.
|
|
33
|
+
if (version.includes('+'))
|
|
34
|
+
return true;
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
19
37
|
function buildMcpServerSpecs(isGitHub, cliVersion) {
|
|
20
38
|
// Pin the squad-cli package to the currently-installed CLI version so that
|
|
21
39
|
// `npx -y @bradygaster/squad-cli state-mcp` does NOT silently resolve to the
|
|
22
40
|
// npm `latest` dist-tag (which may predate the `state-mcp` command and thus
|
|
23
41
|
// expose zero tools to Copilot — see MCP-BRIDGE-BROKEN root cause).
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
42
|
+
//
|
|
43
|
+
// #1204: When the CLI is a local dev build or unpublished pre-release, fall
|
|
44
|
+
// back to the @insider dist-tag to avoid writing an unresolvable version
|
|
45
|
+
// string that breaks npx resolution at session start.
|
|
46
|
+
let pkgSpec;
|
|
47
|
+
if (!cliVersion || isLocalOrUnpublishedVersion(cliVersion)) {
|
|
48
|
+
pkgSpec = '@bradygaster/squad-cli@insider';
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
pkgSpec = `@bradygaster/squad-cli@${cliVersion}`;
|
|
52
|
+
}
|
|
27
53
|
const servers = [
|
|
28
54
|
{
|
|
29
55
|
name: 'squad_state',
|
|
@@ -172,11 +198,37 @@ function detectIsGitHubForMcp(dest, config) {
|
|
|
172
198
|
}
|
|
173
199
|
return true;
|
|
174
200
|
}
|
|
175
|
-
function writeAgentTemplate(agentSrc, agentDest, cliVersion, mcpConfigMode, isGitHub) {
|
|
201
|
+
function writeAgentTemplate(agentSrc, agentDest, cliVersion, mcpConfigMode, isGitHub, options) {
|
|
176
202
|
let agentContent = storage.readSync(agentSrc) ?? '';
|
|
177
203
|
if (mcpConfigMode === 'agent-frontmatter') {
|
|
178
204
|
agentContent = injectMcpFrontmatter(agentContent, isGitHub, cliVersion);
|
|
179
205
|
}
|
|
206
|
+
// Back up locally-customized squad.agent.md before overwriting (#1052)
|
|
207
|
+
if (storage.existsSync(agentDest)) {
|
|
208
|
+
const existing = (storage.readSync(agentDest) ?? '').replace(/\r\n/g, '\n');
|
|
209
|
+
// Strip the version stamp before comparing (version line changes every upgrade)
|
|
210
|
+
const stripVersion = (s) => s.replace(/<!-- squad-cli v[\d.]+[-\w.]* -->\n?/g, '');
|
|
211
|
+
const normalizedExisting = stripVersion(existing);
|
|
212
|
+
const normalizedTemplate = stripVersion(agentContent.replace(/\r\n/g, '\n'));
|
|
213
|
+
if (normalizedExisting !== normalizedTemplate && normalizedExisting.trim().length > 0) {
|
|
214
|
+
const backupPath = agentDest + '.local-backup';
|
|
215
|
+
if (options?.dryRun) {
|
|
216
|
+
warn(`squad.agent.md has local customizations — would back up to ${path.basename(backupPath)}`);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
storage.writeSync(backupPath, existing);
|
|
220
|
+
warn(`squad.agent.md has local customizations — backed up to ${path.basename(backupPath)}`);
|
|
221
|
+
info(` To restore: copy ${path.basename(backupPath)} → ${path.basename(agentDest)}`);
|
|
222
|
+
}
|
|
223
|
+
else if (options?.dryRun) {
|
|
224
|
+
info('squad.agent.md is unmodified — would refresh with latest template');
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
else if (options?.dryRun) {
|
|
229
|
+
info('squad.agent.md does not exist — would create from template');
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
180
232
|
storage.writeSync(agentDest, agentContent);
|
|
181
233
|
stampVersion(agentDest, cliVersion);
|
|
182
234
|
}
|
|
@@ -394,7 +446,7 @@ const ENSURE_DIRECTORIES = [
|
|
|
394
446
|
'.squad/decisions/inbox',
|
|
395
447
|
'.squad/casting',
|
|
396
448
|
'.squad/agents',
|
|
397
|
-
'.
|
|
449
|
+
'.github/skills',
|
|
398
450
|
];
|
|
399
451
|
/**
|
|
400
452
|
* Ensure .gitattributes has required merge=union rules (idempotent)
|
|
@@ -549,7 +601,74 @@ function warnIfSkillCustomized(srcPath, destPath, sourceName) {
|
|
|
549
601
|
}
|
|
550
602
|
}
|
|
551
603
|
/**
|
|
552
|
-
*
|
|
604
|
+
* Migrate skills from the legacy `.copilot/skills/<name>/` location to the
|
|
605
|
+
* canonical `.github/skills/<name>/`. Only migrates skills that appear in
|
|
606
|
+
* `TEMPLATE_MANIFEST` (manifest-curated Squad skills) — does NOT touch
|
|
607
|
+
* user-added skills in `.copilot/skills/`. After successful migration,
|
|
608
|
+
* removes the now-empty `.copilot/skills/<name>/` directories.
|
|
609
|
+
*
|
|
610
|
+
* Idempotent: when a skill already exists at the new location the legacy
|
|
611
|
+
* copy is tombstoned without comparing content — this protects any
|
|
612
|
+
* in-place customization the user made at `.github/skills/<name>/` from
|
|
613
|
+
* being clobbered, and means re-running upgrade is a no-op on the new
|
|
614
|
+
* location. If only the legacy copy exists, it is moved over.
|
|
615
|
+
*
|
|
616
|
+
* See bradygaster/squad#1126 (canonical issue) — this is the migration
|
|
617
|
+
* piece of that fix; #1304 is the PR that implements it.
|
|
618
|
+
*/
|
|
619
|
+
function migrateLegacyCopilotSkills(dest) {
|
|
620
|
+
const legacyDir = path.join(dest, '.copilot', 'skills');
|
|
621
|
+
if (!storage.existsSync(legacyDir))
|
|
622
|
+
return { migrated: [], tombstoned: [] };
|
|
623
|
+
const manifestSkills = new Set(TEMPLATE_MANIFEST
|
|
624
|
+
.filter(f => f.source.startsWith('skills/'))
|
|
625
|
+
.map(f => f.source.split('/')[1]) // 'skills/foo/SKILL.md' -> 'foo'
|
|
626
|
+
.filter((s) => Boolean(s)));
|
|
627
|
+
const newDir = path.join(dest, '.github', 'skills');
|
|
628
|
+
const migrated = [];
|
|
629
|
+
const tombstoned = [];
|
|
630
|
+
for (const entry of storage.listSync(legacyDir)) {
|
|
631
|
+
if (!manifestSkills.has(entry))
|
|
632
|
+
continue; // leave user-added skills alone
|
|
633
|
+
const legacySkillDir = path.join(legacyDir, entry);
|
|
634
|
+
if (!storage.isDirectorySync(legacySkillDir))
|
|
635
|
+
continue;
|
|
636
|
+
const newSkillDir = path.join(newDir, entry);
|
|
637
|
+
if (storage.existsSync(newSkillDir)) {
|
|
638
|
+
// New location already has it — drop the legacy copy without overwriting.
|
|
639
|
+
try {
|
|
640
|
+
storage.deleteDirSync(legacySkillDir);
|
|
641
|
+
tombstoned.push(path.posix.join('.copilot/skills', entry));
|
|
642
|
+
}
|
|
643
|
+
catch {
|
|
644
|
+
// best-effort; leave the legacy dir if we can't remove it
|
|
645
|
+
}
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
try {
|
|
649
|
+
storage.mkdirSync(newDir, { recursive: true });
|
|
650
|
+
copyDirRecursive(legacySkillDir, newSkillDir);
|
|
651
|
+
storage.deleteDirSync(legacySkillDir);
|
|
652
|
+
migrated.push(path.posix.join('.github/skills', entry));
|
|
653
|
+
}
|
|
654
|
+
catch {
|
|
655
|
+
// best-effort; leave the legacy dir if anything fails
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
// If the legacy `.copilot/skills/` directory is now empty, remove it too.
|
|
659
|
+
try {
|
|
660
|
+
if (storage.existsSync(legacyDir) && storage.listSync(legacyDir).length === 0) {
|
|
661
|
+
storage.deleteDirSync(legacyDir);
|
|
662
|
+
tombstoned.push('.copilot/skills');
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
catch {
|
|
666
|
+
// best-effort
|
|
667
|
+
}
|
|
668
|
+
return { migrated, tombstoned };
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Sync manifest-declared skills to .github/skills/, respecting overwriteOnUpgrade.
|
|
553
672
|
* Only skills listed in TEMPLATE_MANIFEST are installed — not the entire templates/skills/ dir.
|
|
554
673
|
*/
|
|
555
674
|
function syncAllSkills(dest, templatesDir) {
|
|
@@ -622,18 +741,33 @@ async function runEnsureChecks(dest, templatesDir, filesUpdated) {
|
|
|
622
741
|
success(`scaffolded memory governance defaults (${memoryFiles.length} files/directories)`);
|
|
623
742
|
filesUpdated.push(...memoryFiles);
|
|
624
743
|
}
|
|
744
|
+
const builtinAgents = ensureBuiltinAgents(dest, templatesDir);
|
|
745
|
+
if (builtinAgents.length > 0) {
|
|
746
|
+
const uniqueAgentNames = Array.from(new Set(builtinAgents.map(p => path.basename(path.dirname(p)))));
|
|
747
|
+
success(`scaffolded ${uniqueAgentNames.length} built-in agent(s): ${uniqueAgentNames.join(', ')}`);
|
|
748
|
+
filesUpdated.push(...builtinAgents);
|
|
749
|
+
}
|
|
750
|
+
const skillMigration = migrateLegacyCopilotSkills(dest);
|
|
751
|
+
if (skillMigration.migrated.length > 0) {
|
|
752
|
+
success(`migrated ${skillMigration.migrated.length} skill(s) from .copilot/skills/ → .github/skills/`);
|
|
753
|
+
filesUpdated.push(...skillMigration.migrated);
|
|
754
|
+
}
|
|
755
|
+
if (skillMigration.tombstoned.length > 0) {
|
|
756
|
+
success(`removed ${skillMigration.tombstoned.length} stale .copilot/skills entries (now live at .github/skills/)`);
|
|
757
|
+
}
|
|
625
758
|
const skillCount = syncAllSkills(dest, templatesDir);
|
|
626
759
|
if (skillCount > 0) {
|
|
627
|
-
success(`synced ${skillCount} skills to .
|
|
760
|
+
success(`synced ${skillCount} skills to .github/skills/`);
|
|
628
761
|
filesUpdated.push(`skills (${skillCount})`);
|
|
629
762
|
}
|
|
630
763
|
refreshSquadTemplatesDir(dest, templatesDir);
|
|
631
764
|
success('refreshed .squad/templates/');
|
|
632
765
|
filesUpdated.push('.squad/templates/');
|
|
633
766
|
// iter-8: write squad_state MCP entry to repo-root `.mcp.json`
|
|
634
|
-
// (auto-loaded by Copilot CLI
|
|
635
|
-
// and tombstone any stale project-level
|
|
636
|
-
// versions in `.copilot/mcp-config.json`.
|
|
767
|
+
// (auto-loaded by Copilot CLI ≥1.0.59, which walks up from cwd to the
|
|
768
|
+
// git root looking for .mcp.json) and tombstone any stale project-level
|
|
769
|
+
// entry left by older Squad versions in `.copilot/mcp-config.json`.
|
|
770
|
+
// No HOME modifications.
|
|
637
771
|
const pinnedSpec = await resolveSquadStateMcpSpec(getPackageVersion());
|
|
638
772
|
try {
|
|
639
773
|
const rootResult = ensureSquadStateMcpInRoot(dest, getPackageVersion(), pinnedSpec);
|
|
@@ -645,6 +779,11 @@ async function runEnsureChecks(dest, templatesDir, filesUpdated) {
|
|
|
645
779
|
catch (err) {
|
|
646
780
|
warn(`Could not write .mcp.json: ${err instanceof Error ? err.message : err}`);
|
|
647
781
|
}
|
|
782
|
+
// iter-8: do NOT write to ~/.copilot/mcp-config.json on upgrade. The
|
|
783
|
+
// repo-root .mcp.json write above is sufficient for Copilot CLI ≥1.0.59
|
|
784
|
+
// (walks from cwd up looking for .mcp.json) AND for `copilot -p` from
|
|
785
|
+
// the project root. Out-of-tree `copilot -p` should use
|
|
786
|
+
// `--additional-mcp-config @.mcp.json`. See bradygaster/squad#1296.
|
|
648
787
|
const tomb = tombstoneStaleSquadStateInProjectMcp(dest);
|
|
649
788
|
if (tomb.removed) {
|
|
650
789
|
success(`removed stale squad_state from ${tomb.path} (now lives in .mcp.json)`);
|
|
@@ -696,6 +835,72 @@ export function ensureMemoryGovernanceUpgradeDefaults(dest) {
|
|
|
696
835
|
}
|
|
697
836
|
return created;
|
|
698
837
|
}
|
|
838
|
+
/**
|
|
839
|
+
* Scaffold always-on built-in agent charters (Rai, Fact Checker) that ship
|
|
840
|
+
* as templates but may be missing from older squads. Idempotent — only writes
|
|
841
|
+
* when the agent directory is absent. Never overwrites existing charters or
|
|
842
|
+
* history. Sources charter content from the shipped `templates/{name}-charter.md`
|
|
843
|
+
* files when available, falling back to a minimal placeholder otherwise.
|
|
844
|
+
*
|
|
845
|
+
* Scribe and Ralph are intentionally NOT scaffolded here — they should already
|
|
846
|
+
* exist in any squad that ran a prior init, and their charters are inlined in
|
|
847
|
+
* cast.ts (no shipped template file). Adding them here would risk overwriting
|
|
848
|
+
* customized versions on legacy squads.
|
|
849
|
+
*
|
|
850
|
+
* @param dest Root directory containing .squad/
|
|
851
|
+
* @param templatesDir Directory containing shipped charter templates
|
|
852
|
+
* @returns Paths (relative to dest) of created agent files
|
|
853
|
+
*/
|
|
854
|
+
export function ensureBuiltinAgents(dest, templatesDir) {
|
|
855
|
+
const agentsDir = path.join(dest, '.squad', 'agents');
|
|
856
|
+
if (!storage.existsSync(agentsDir)) {
|
|
857
|
+
storage.mkdirSync(agentsDir, { recursive: true });
|
|
858
|
+
}
|
|
859
|
+
// Built-in agents that ship as charter templates. Each entry maps to:
|
|
860
|
+
// - dirName: case-preserving directory name under .squad/agents/
|
|
861
|
+
// - templateFile: filename under templatesDir (charter template)
|
|
862
|
+
// - displayName: shown in history.md header
|
|
863
|
+
const builtins = [
|
|
864
|
+
{ dirName: 'Rai', templateFile: 'Rai-charter.md', displayName: 'Rai' },
|
|
865
|
+
{ dirName: 'fact-checker', templateFile: 'fact-checker-charter.md', displayName: 'Fact Checker' },
|
|
866
|
+
];
|
|
867
|
+
const created = [];
|
|
868
|
+
for (const agent of builtins) {
|
|
869
|
+
const agentDir = path.join(agentsDir, agent.dirName);
|
|
870
|
+
const charterPath = path.join(agentDir, 'charter.md');
|
|
871
|
+
const historyPath = path.join(agentDir, 'history.md');
|
|
872
|
+
// Idempotent: skip if agent directory already exists. Never overwrite
|
|
873
|
+
// existing charters or history files (preserves user customization).
|
|
874
|
+
if (storage.existsSync(agentDir))
|
|
875
|
+
continue;
|
|
876
|
+
// Source charter content from the shipped template; fall back to a
|
|
877
|
+
// minimal placeholder if the template file is missing (defensive — should
|
|
878
|
+
// not happen in a well-formed install, but better than crashing upgrade).
|
|
879
|
+
const tplPath = path.join(templatesDir, agent.templateFile);
|
|
880
|
+
let charterContent;
|
|
881
|
+
if (storage.existsSync(tplPath)) {
|
|
882
|
+
charterContent = storage.readSync(tplPath) ?? '';
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
charterContent = `# ${agent.displayName}\n\n> Charter template not found in shipped templates. Run \`squad upgrade\` after reinstalling the CLI to repair.\n`;
|
|
886
|
+
}
|
|
887
|
+
try {
|
|
888
|
+
storage.mkdirSync(agentDir, { recursive: true });
|
|
889
|
+
storage.writeSync(charterPath, charterContent);
|
|
890
|
+
created.push(path.join('.squad', 'agents', agent.dirName, 'charter.md'));
|
|
891
|
+
storage.writeSync(historyPath, `# ${agent.displayName} — History\n\n## Learnings\n\nInitial scaffold via \`squad upgrade\`. Ready for work.\n`);
|
|
892
|
+
created.push(path.join('.squad', 'agents', agent.dirName, 'history.md'));
|
|
893
|
+
}
|
|
894
|
+
catch (err) {
|
|
895
|
+
if (err instanceof Error && 'code' in err && ['EPERM', 'EACCES'].includes(err.code ?? '')) {
|
|
896
|
+
warn(`Could not scaffold built-in agent ${agent.displayName} (read-only). Create .squad/agents/${agent.dirName}/ manually.`);
|
|
897
|
+
continue;
|
|
898
|
+
}
|
|
899
|
+
throw err;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
return created;
|
|
903
|
+
}
|
|
699
904
|
/**
|
|
700
905
|
* Run the upgrade command
|
|
701
906
|
*/
|
|
@@ -721,6 +926,26 @@ export async function runUpgrade(dest, options = {}) {
|
|
|
721
926
|
// Check if already current
|
|
722
927
|
const isAlreadyCurrent = !options.force && oldVersion && oldVersion !== '0.0.0' && compareSemver(oldVersion, cliVersion) === 0;
|
|
723
928
|
const projectType = detectProjectType(dest);
|
|
929
|
+
// --dry-run: preview what upgrade would do without writing (#1052)
|
|
930
|
+
if (options.dryRun) {
|
|
931
|
+
info(`\n${bold('Dry run')} — previewing upgrade from ${oldVersion || 'unknown'} → ${cliVersion}\n`);
|
|
932
|
+
const templatesDir = getTemplatesDir();
|
|
933
|
+
const agentSrc = path.join(templatesDir, 'squad.agent.md.template');
|
|
934
|
+
if (storage.existsSync(agentSrc)) {
|
|
935
|
+
writeAgentTemplate(agentSrc, agentDest, cliVersion, mcpConfigMode, isGitHubForMcp, { dryRun: true });
|
|
936
|
+
}
|
|
937
|
+
const filesToUpgrade = TEMPLATE_MANIFEST.filter(f => f.overwriteOnUpgrade && f.source !== 'squad.agent.md.template');
|
|
938
|
+
if (filesToUpgrade.length > 0) {
|
|
939
|
+
info(`Would overwrite ${filesToUpgrade.length} squad-owned file(s):`);
|
|
940
|
+
for (const file of filesToUpgrade) {
|
|
941
|
+
const destPath = path.join(squadDirInfo.path, file.destination);
|
|
942
|
+
const exists = storage.existsSync(destPath);
|
|
943
|
+
console.log(` ${exists ? 'overwrite' : 'create'} ${file.destination}`);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
console.log(`\nRun without --dry-run to apply.\n`);
|
|
947
|
+
return { fromVersion: oldVersion, toVersion: cliVersion, filesUpdated: [], migrationsRun: [] };
|
|
948
|
+
}
|
|
724
949
|
if (isAlreadyCurrent) {
|
|
725
950
|
info(`Already up to date (v${cliVersion})`);
|
|
726
951
|
// Still run missing migrations
|