@bradygaster/squad-cli 0.9.6-insider.1 → 0.9.6-insider.3
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/dist/cli/commands/doctor.d.ts.map +1 -1
- package/dist/cli/commands/doctor.js +29 -0
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/export.d.ts +7 -3
- package/dist/cli/commands/export.d.ts.map +1 -1
- package/dist/cli/commands/export.js +68 -16
- package/dist/cli/commands/export.js.map +1 -1
- package/dist/cli/commands/import.d.ts +7 -3
- package/dist/cli/commands/import.d.ts.map +1 -1
- package/dist/cli/commands/import.js +140 -42
- package/dist/cli/commands/import.js.map +1 -1
- package/dist/cli/commands/link.d.ts.map +1 -1
- package/dist/cli/commands/link.js +7 -1
- package/dist/cli/commands/link.js.map +1 -1
- package/dist/cli/commands/memory.d.ts +2 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +304 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/commands/plugin.d.ts.map +1 -1
- package/dist/cli/commands/plugin.js +420 -5
- package/dist/cli/commands/plugin.js.map +1 -1
- package/dist/cli/commands/state-mcp.d.ts +25 -0
- package/dist/cli/commands/state-mcp.d.ts.map +1 -0
- package/dist/cli/commands/state-mcp.js +168 -0
- package/dist/cli/commands/state-mcp.js.map +1 -0
- package/dist/cli/commands/watch/capabilities/board.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/board.js +2 -1
- package/dist/cli/commands/watch/capabilities/board.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/decision-hygiene.js +1 -1
- package/dist/cli/commands/watch/capabilities/decision-hygiene.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/execute.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/execute.js +12 -1
- package/dist/cli/commands/watch/capabilities/execute.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-email.d.ts +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-email.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-email.js +19 -3
- package/dist/cli/commands/watch/capabilities/monitor-email.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts.map +1 -1
- package/dist/cli/commands/watch/capabilities/monitor-teams.js +19 -4
- package/dist/cli/commands/watch/capabilities/monitor-teams.js.map +1 -1
- package/dist/cli/commands/watch/capabilities/retro.js +1 -1
- package/dist/cli/commands/watch/capabilities/retro.js.map +1 -1
- package/dist/cli/commands/watch/index.d.ts.map +1 -1
- package/dist/cli/commands/watch/index.js +9 -6
- 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 +132 -1
- package/dist/cli/core/cast.js.map +1 -1
- package/dist/cli/core/init.d.ts +2 -0
- package/dist/cli/core/init.d.ts.map +1 -1
- package/dist/cli/core/init.js +13 -1
- package/dist/cli/core/init.js.map +1 -1
- package/dist/cli/core/templates.d.ts.map +1 -1
- package/dist/cli/core/templates.js +31 -0
- package/dist/cli/core/templates.js.map +1 -1
- package/dist/cli/core/upgrade.d.ts +1 -0
- package/dist/cli/core/upgrade.d.ts.map +1 -1
- package/dist/cli/core/upgrade.js +171 -4
- package/dist/cli/core/upgrade.js.map +1 -1
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/shell/components/App.js +1 -1
- package/dist/cli/shell/components/App.js.map +1 -1
- package/dist/cli/shell/components/MessageStream.js +2 -2
- package/dist/cli/shell/components/MessageStream.js.map +1 -1
- package/dist/cli/shell/coordinator.js +2 -2
- package/dist/cli/shell/index.d.ts.map +1 -1
- package/dist/cli/shell/index.js +2 -1
- package/dist/cli/shell/index.js.map +1 -1
- package/dist/cli-entry.js +51 -9
- package/dist/cli-entry.js.map +1 -1
- package/package.json +7 -3
- package/templates/after-agent-reference.md +64 -0
- package/templates/ceremony-reference.md +82 -0
- package/templates/client-compatibility-reference.md +46 -0
- package/templates/copilot-agent.md +96 -0
- package/templates/copilot-instructions.md +14 -0
- package/templates/model-selection-reference.md +101 -0
- package/templates/prd-intake.md +105 -0
- package/templates/rai-charter.md +110 -0
- package/templates/rai-policy.md +103 -0
- package/templates/ralph-reference.md +141 -0
- package/templates/routing.md +1 -0
- package/templates/scribe-charter.md +18 -151
- package/templates/session-init-reference.md +199 -0
- package/templates/skills/e2e-template-testing/SKILL.md +557 -0
- package/templates/skills/squad-commands/SKILL.md +303 -0
- package/templates/skills/squad-version-check/SKILL.md +160 -0
- package/templates/spawn-reference.md +132 -0
- package/templates/squad.agent.md.template +187 -622
- package/templates/worktree-reference.md +126 -0
|
@@ -24,62 +24,11 @@
|
|
|
24
24
|
|
|
25
25
|
**Worktree awareness:** Use the `TEAM ROOT` provided in the spawn prompt to resolve all `.squad/` paths. If no TEAM ROOT is given, run `git rev-parse --show-toplevel` as fallback. Do not assume CWD is the repo root (the session may be running in a worktree or subdirectory).
|
|
26
26
|
|
|
27
|
-
**State backend awareness:** Check `STATE_BACKEND` from the spawn prompt.
|
|
28
|
-
|
|
29
|
-
### State Leak Guard (orphan/git-notes backends only)
|
|
30
|
-
|
|
31
|
-
Before logging or merging, check if any agent accidentally committed state files to the working branch:
|
|
32
|
-
|
|
33
|
-
```powershell
|
|
34
|
-
# Check if state files are staged or committed but shouldn't be
|
|
35
|
-
$stateFiles = @(
|
|
36
|
-
'.squad/decisions.md',
|
|
37
|
-
'.squad/decisions-archive.md'
|
|
38
|
-
)
|
|
39
|
-
$statePatterns = @(
|
|
40
|
-
'.squad/agents/*/history.md',
|
|
41
|
-
'.squad/agents/*/history-archive.md',
|
|
42
|
-
'.squad/log/*',
|
|
43
|
-
'.squad/orchestration-log/*',
|
|
44
|
-
'.squad/decisions/inbox/*'
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
# 1. Check git status for accidentally staged state files
|
|
48
|
-
$dirty = git status --porcelain | Where-Object { $_.Length -gt 3 } | ForEach-Object {
|
|
49
|
-
$_.Substring(3) -replace '^.* -> ',''
|
|
50
|
-
} | Where-Object {
|
|
51
|
-
$f = $_
|
|
52
|
-
($f -in $stateFiles) -or ($statePatterns | Where-Object { $f -like $_ })
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if ($dirty) {
|
|
56
|
-
# Unstage any accidentally added state files
|
|
57
|
-
$dirty | ForEach-Object { git reset HEAD -- $_ 2>$null }
|
|
58
|
-
# Restore from HEAD (discard working tree changes for state files)
|
|
59
|
-
$dirty | ForEach-Object { git checkout HEAD -- $_ 2>$null }
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
# 2. Check if the most recent commit on this branch has state files
|
|
63
|
-
$lastCommitFiles = git diff-tree --no-commit-id --name-only -r HEAD 2>$null
|
|
64
|
-
$leakedInCommit = $lastCommitFiles | Where-Object {
|
|
65
|
-
$f = $_
|
|
66
|
-
($f -in $stateFiles) -or ($statePatterns | Where-Object { $f -like $_ })
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if ($leakedInCommit) {
|
|
70
|
-
# State files leaked into the last commit — amend to remove them
|
|
71
|
-
$leakedInCommit | ForEach-Object { git rm --cached -- $_ 2>$null }
|
|
72
|
-
git commit --amend --no-edit 2>$null
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
If any files were cleaned, log: `⚠️ State leak guard: removed {N} state file(s) from working branch.`
|
|
77
|
-
|
|
78
|
-
After the guard, proceed with normal Scribe work (but persist state via the configured backend, not the working branch).
|
|
27
|
+
**State backend awareness:** Check `STATE_BACKEND` from the spawn prompt. Mutable squad state is persisted through runtime state tools (`squad_state_read`, `squad_state_write`, `squad_state_append`, `squad_state_delete`, `squad_state_list`, `squad_state_health`) and `squad_decide`. Do not run backend git commands, switch to state branches, push note refs, reset `.squad/`, or commit mutable state by hand. If state tools are unavailable, stop without mutating files or git state and record the tool availability failure in your final summary.
|
|
79
28
|
|
|
80
29
|
After every substantial work session:
|
|
81
30
|
|
|
82
|
-
1. **Log the session** to
|
|
31
|
+
1. **Log the session** to `log/{timestamp}-{topic}.md` with `squad_state_write`:
|
|
83
32
|
- Who worked
|
|
84
33
|
- What was done
|
|
85
34
|
- Decisions made
|
|
@@ -87,119 +36,37 @@ After every substantial work session:
|
|
|
87
36
|
- Brief. Facts only.
|
|
88
37
|
|
|
89
38
|
2. **Merge the decision inbox:**
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
39
|
+
- List all files in `decisions/inbox/` with `squad_state_list`
|
|
40
|
+
- Read each entry with `squad_state_read`
|
|
41
|
+
- Append each decision's contents to `decisions.md` with `squad_state_write` after dedupe
|
|
42
|
+
- Delete each inbox file after merging with `squad_state_delete`
|
|
93
43
|
|
|
94
44
|
3. **Deduplicate and consolidate decisions.md:**
|
|
95
45
|
- Parse the file into decision blocks (each block starts with `### `).
|
|
96
46
|
- **Exact duplicates:** If two blocks share the same heading, keep the first and remove the rest.
|
|
97
47
|
- **Overlapping decisions:** Compare block content across all remaining blocks. If two or more blocks cover the same area (same topic, same architectural concern, same component) but were written independently (different dates, different authors), consolidate them:
|
|
98
48
|
a. Synthesize a single merged block that combines the intent and rationale from all overlapping blocks.
|
|
99
|
-
b. Use the CURRENT_DATETIME value from your spawn prompt and a new heading: `###
|
|
49
|
+
b. Use the literal CURRENT_DATETIME value from your spawn prompt and a new heading: `### <CURRENT_DATETIME value>: {consolidated topic} (consolidated)`. Substitute the actual timestamp; do not write placeholder text.
|
|
100
50
|
c. Credit all original authors: `**By:** {Name1}, {Name2}`
|
|
101
51
|
d. Under **What:**, combine the decisions. Note any differences or evolution.
|
|
102
52
|
e. Under **Why:**, merge the rationale, preserving unique reasoning from each.
|
|
103
53
|
f. Remove the original overlapping blocks.
|
|
104
|
-
- Write the updated file back
|
|
54
|
+
- Write the updated file back with `squad_state_write`. This handles duplicates and convergent decisions introduced by concurrent agent writes.
|
|
105
55
|
|
|
106
56
|
4. **Propagate cross-agent updates:**
|
|
107
|
-
For any newly merged decision that affects other agents, append to their `history.md
|
|
57
|
+
For any newly merged decision that affects other agents, append to their `agents/{agent}/history.md` with `squad_state_append`. Replace the parenthetical timestamp with the literal CURRENT_DATETIME value from your spawn prompt; do not write placeholder text.
|
|
108
58
|
```
|
|
109
|
-
📌 Team update (
|
|
59
|
+
📌 Team update (<CURRENT_DATETIME value>): {summary} — decided by {Name}
|
|
110
60
|
```
|
|
111
61
|
|
|
112
|
-
5. **Commit
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
- Identify changed `.squad/` state files via `git status --porcelain` filtered to allowed paths.
|
|
121
|
-
- For each file, use git plumbing to write to the orphan branch:
|
|
122
|
-
```powershell
|
|
123
|
-
# Create a temporary worktree for the orphan branch
|
|
124
|
-
$orphanWt = Join-Path ([System.IO.Path]::GetTempPath()) "squad-state-$(Get-Random)"
|
|
125
|
-
git worktree add $orphanWt squad-state 2>$null
|
|
126
|
-
if ($LASTEXITCODE -ne 0) { git worktree add --orphan $orphanWt squad-state }
|
|
127
|
-
# Copy state files to orphan worktree
|
|
128
|
-
$filesToSync | ForEach-Object {
|
|
129
|
-
$dest = Join-Path $orphanWt $_
|
|
130
|
-
New-Item -ItemType Directory -Path (Split-Path $dest) -Force | Out-Null
|
|
131
|
-
Copy-Item $_ $dest -Force
|
|
132
|
-
}
|
|
133
|
-
# Commit in orphan worktree
|
|
134
|
-
Push-Location $orphanWt
|
|
135
|
-
git add .squad/
|
|
136
|
-
git diff --cached --quiet
|
|
137
|
-
if ($LASTEXITCODE -ne 0) {
|
|
138
|
-
$msgFile = [System.IO.Path]::GetTempFileName()
|
|
139
|
-
Set-Content -Path $msgFile -Value "docs(ai-team): $summary" -Encoding utf8
|
|
140
|
-
git commit -F $msgFile
|
|
141
|
-
Remove-Item $msgFile
|
|
142
|
-
git push origin squad-state
|
|
143
|
-
}
|
|
144
|
-
Pop-Location
|
|
145
|
-
git worktree remove $orphanWt --force
|
|
146
|
-
```
|
|
147
|
-
- After committing to orphan, reset working tree state files: `git checkout HEAD -- .squad/`
|
|
148
|
-
- ⚠️ NEVER commit `.squad/` state files to the working branch when using orphan backend.
|
|
149
|
-
|
|
150
|
-
**If STATE_BACKEND is "git-notes":**
|
|
151
|
-
State is already persisted in git notes refs by agents. Scribe only needs to:
|
|
152
|
-
- Push any locally created note refs: `git push origin 'refs/notes/squad/*'`
|
|
153
|
-
- Commit decisions.md (the merged canonical file) to the working branch as normal.
|
|
154
|
-
|
|
155
|
-
**If STATE_BACKEND is "worktree" (default):**
|
|
156
|
-
Commit to the working branch as normal:
|
|
157
|
-
- `cd` into the team root first.
|
|
158
|
-
- Stage only files Scribe actually modified in this session.
|
|
159
|
-
Use `git status --porcelain` to build an explicit file list filtered to allowed `.squad/` paths:
|
|
160
|
-
```powershell
|
|
161
|
-
$allowed = @(
|
|
162
|
-
'.squad/decisions.md',
|
|
163
|
-
'.squad/decisions-archive.md'
|
|
164
|
-
)
|
|
165
|
-
$allowedPatterns = @(
|
|
166
|
-
'.squad/agents/*/history.md',
|
|
167
|
-
'.squad/agents/*/history-archive.md',
|
|
168
|
-
'.squad/log/*',
|
|
169
|
-
'.squad/orchestration-log/*'
|
|
170
|
-
)
|
|
171
|
-
$filesToStage = git status --porcelain | Where-Object { $_.Length -gt 3 } | ForEach-Object { $_.Substring(3) -replace '^.* -> ','' } | Where-Object {
|
|
172
|
-
$f = $_
|
|
173
|
-
($f -in $allowed) -or ($allowedPatterns | Where-Object { $f -like $_ })
|
|
174
|
-
}
|
|
175
|
-
if ($filesToStage) { $filesToStage | Where-Object { $_ } | ForEach-Object { git add -- $_ } }
|
|
176
|
-
```
|
|
177
|
-
⚠️ NEVER use `git add .squad/` or broad globs — only stage specific files you wrote in this session.
|
|
178
|
-
- Check for staged changes: `git diff --cached --quiet`
|
|
179
|
-
If exit code is 0, no changes — skip silently.
|
|
180
|
-
- Write the commit message to a temp file, then commit with `-F`:
|
|
181
|
-
```
|
|
182
|
-
$msg = @"
|
|
183
|
-
docs(ai-team): {brief summary}
|
|
184
|
-
|
|
185
|
-
Session: {timestamp}-{topic}
|
|
186
|
-
Requested by: {user name}
|
|
187
|
-
|
|
188
|
-
Changes:
|
|
189
|
-
- {what was logged}
|
|
190
|
-
- {what decisions were merged}
|
|
191
|
-
- {what decisions were deduplicated}
|
|
192
|
-
- {what cross-agent updates were propagated}
|
|
193
|
-
"@
|
|
194
|
-
$msgFile = [System.IO.Path]::GetTempFileName()
|
|
195
|
-
Set-Content -Path $msgFile -Value $msg -Encoding utf8
|
|
196
|
-
git commit -F $msgFile
|
|
197
|
-
Remove-Item $msgFile
|
|
198
|
-
```
|
|
199
|
-
- **Verify the commit landed:** Run `git log --oneline -1` and confirm the
|
|
200
|
-
output matches the expected message. If it doesn't, report the error.
|
|
201
|
-
|
|
202
|
-
6. **Never speak to the user.** Never appear in responses. Work silently.
|
|
62
|
+
5. **Commit and verify persistence through the runtime backend:**
|
|
63
|
+
- Run `squad_state_health` when available.
|
|
64
|
+
- Re-read `decisions.md`, `log/{timestamp}-{topic}.md`, and any updated histories with `squad_state_read`.
|
|
65
|
+
- Never amend, reset, checkout, push notes, or switch branches to persist mutable squad state. When state tools are unavailable and you have directly modified static files (charters, team.md, skills), commit those changes with `git commit`.
|
|
66
|
+
|
|
67
|
+
6. **Commit handling:** Never commit mutable squad state. If non-state repo files changed, report them for coordinator handling.
|
|
68
|
+
|
|
69
|
+
7. **Never speak to the user.** Never appear in responses. Work silently.
|
|
203
70
|
|
|
204
71
|
## The Memory Architecture
|
|
205
72
|
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Session Init Reference
|
|
2
|
+
|
|
3
|
+
Procedures the coordinator runs at session start, in order. Each step is
|
|
4
|
+
self-contained, fails silent, and degrades to "show normal greeting."
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Step 1: Update Check
|
|
9
|
+
|
|
10
|
+
Check whether a newer Squad version exists for the user's channel. Append to
|
|
11
|
+
the greeting if a newer version is found. Never block the session; every
|
|
12
|
+
failure path ends at "show normal greeting."
|
|
13
|
+
|
|
14
|
+
### 1.1 Kill Switch
|
|
15
|
+
|
|
16
|
+
If the environment variable `SQUAD_NO_UPDATE_CHECK` is set to `1`, **skip
|
|
17
|
+
Step 1 entirely** and show the normal greeting. This is the same kill switch
|
|
18
|
+
as the upstream CLI banner — one opt-out disables both.
|
|
19
|
+
|
|
20
|
+
### 1.2 Channel Detection
|
|
21
|
+
|
|
22
|
+
Read the stamped version from the `<!-- version: X -->` HTML comment at the
|
|
23
|
+
top of `squad.agent.md` (or from the `- **Version:** X` identity line as
|
|
24
|
+
fallback). Classify the channel:
|
|
25
|
+
|
|
26
|
+
| Stamped version contains | Channel |
|
|
27
|
+
|--------------------------|-----------|
|
|
28
|
+
| `-insider` | `insider` |
|
|
29
|
+
| `-preview` | `preview` |
|
|
30
|
+
| (neither) | `latest` |
|
|
31
|
+
|
|
32
|
+
Store the stamped version as `currentVersion` and the detected channel.
|
|
33
|
+
|
|
34
|
+
### 1.3 Hybrid Cache Strategy
|
|
35
|
+
|
|
36
|
+
The strategy differs by channel to avoid redundant network calls for the
|
|
37
|
+
common (`latest`) case.
|
|
38
|
+
|
|
39
|
+
#### For `latest` channel — read upstream OS-specific cache
|
|
40
|
+
|
|
41
|
+
The upstream Squad CLI (`self-update.ts`) already fetches the latest version
|
|
42
|
+
on startup and writes it to an OS-specific path with a 24h TTL. Read that
|
|
43
|
+
cache instead of making a new npm call.
|
|
44
|
+
|
|
45
|
+
**One-liner to read the upstream cache:**
|
|
46
|
+
```
|
|
47
|
+
node -e "const p=require('path'),o=require('os');const b=process.env.APPDATA||(process.platform==='darwin'?p.join(o.homedir(),'Library','Application Support'):p.join(o.homedir(),'.config'));const f=p.join(b,'squad-cli','update-check.json');try{const d=JSON.parse(require('fs').readFileSync(f,'utf8'));const age=Date.now()-d.checkedAt;if(age<86400000)console.log(JSON.stringify(d));else console.log('STALE')}catch{console.log('MISS')}"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Output semantics:
|
|
51
|
+
- Valid JSON `{"latestVersion":"X.Y.Z","checkedAt":N}` → cache hit; use `latestVersion`
|
|
52
|
+
- `STALE` → cache expired (older than 24h); treat as no data
|
|
53
|
+
- `MISS` → cache missing or corrupt; treat as no data
|
|
54
|
+
|
|
55
|
+
On `STALE` or `MISS`, show the normal greeting (no notice). Do **not** make an
|
|
56
|
+
independent npm call for `latest`-channel users — the upstream CLI will refresh
|
|
57
|
+
the cache on its next run.
|
|
58
|
+
|
|
59
|
+
**OS-specific cache path for reference:**
|
|
60
|
+
- Windows: `%APPDATA%\squad-cli\update-check.json`
|
|
61
|
+
- Linux: `~/.config/squad-cli/update-check.json`
|
|
62
|
+
- macOS: `~/Library/Application Support/squad-cli/update-check.json`
|
|
63
|
+
|
|
64
|
+
#### For `insider` / `preview` channels — own probe with repo-local cache
|
|
65
|
+
|
|
66
|
+
The upstream cache only stores the `latest` dist-tag and is not useful for
|
|
67
|
+
pre-release channels. Use a separate probe.
|
|
68
|
+
|
|
69
|
+
**Step A — Check repo-local cache:**
|
|
70
|
+
|
|
71
|
+
Read `.squad/.cache/version-check.json`. If the file exists, is not older than
|
|
72
|
+
24h, and `currentVersion` matches `stamped version`, use `channelVersion` from
|
|
73
|
+
it. Skip the npm probe.
|
|
74
|
+
|
|
75
|
+
**Repo-local cache schema:**
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"checkedAt": "2026-05-26T14:13:28.492Z",
|
|
79
|
+
"currentVersion": "0.9.6-insider.2",
|
|
80
|
+
"channel": "insider",
|
|
81
|
+
"channelVersion": "0.9.7-insider.1"
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Step B — npm probe (on cache miss / stale / version mismatch):**
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
npm view @bradygaster/squad-cli dist-tags --json
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- Timeout: **5 seconds.** If the command does not respond within 5 seconds,
|
|
92
|
+
abandon and show normal greeting.
|
|
93
|
+
- On success: extract `dist-tags[channel]` (e.g., `dist-tags["insider"]`).
|
|
94
|
+
Write `.squad/.cache/version-check.json` with the schema above.
|
|
95
|
+
Create `.squad/.cache/` if it does not exist.
|
|
96
|
+
- On any error (network failure, registry unreachable, parse error): show
|
|
97
|
+
normal greeting.
|
|
98
|
+
|
|
99
|
+
### 1.4 Comparison
|
|
100
|
+
|
|
101
|
+
Compare `currentVersion` against the resolved `latestVersionForChannel` using
|
|
102
|
+
semver ordering (pre-release suffixes sort lower than their release counterpart,
|
|
103
|
+
e.g., `0.9.5-insider.1 < 0.9.5`).
|
|
104
|
+
|
|
105
|
+
- `latestVersionForChannel > currentVersion` → update available
|
|
106
|
+
- Equal or older → no notice
|
|
107
|
+
|
|
108
|
+
### 1.5 Greeting Append
|
|
109
|
+
|
|
110
|
+
When an update is available, append to the normal greeting (on the same line,
|
|
111
|
+
separated by ` · `):
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
· 🆕 v{latestVersionForChannel} available — say "upgrade squad"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Example complete greeting line:
|
|
118
|
+
```
|
|
119
|
+
Squad v0.9.4-insider.1 · 🆕 v0.9.7-insider.1 available — say "upgrade squad"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Do not mention the update check, the cache, or the mechanism. Just the notice.
|
|
123
|
+
|
|
124
|
+
### 1.6 Upgrade Flow
|
|
125
|
+
|
|
126
|
+
**Trigger phrases** (case-insensitive, match anywhere in user message):
|
|
127
|
+
- "upgrade squad"
|
|
128
|
+
- "update squad"
|
|
129
|
+
- "what's new" *(when a version notice has been shown in this session)*
|
|
130
|
+
- "install the update"
|
|
131
|
+
- "yes upgrade"
|
|
132
|
+
|
|
133
|
+
**Flow:**
|
|
134
|
+
|
|
135
|
+
1. **Confirm** — ask the user to confirm before running the upgrade:
|
|
136
|
+
> "I'll run `squad upgrade` now. This overwrites `squad.agent.md` and
|
|
137
|
+
> casting files but preserves `config.json`, `team.md`, `decisions.md`,
|
|
138
|
+
> and all agent history. Ready?"
|
|
139
|
+
Wait for affirmative response before proceeding.
|
|
140
|
+
|
|
141
|
+
2. **Run upgrade:**
|
|
142
|
+
```
|
|
143
|
+
squad upgrade
|
|
144
|
+
```
|
|
145
|
+
Capture output. On failure (non-zero exit, error output), report the error
|
|
146
|
+
to the user and stop.
|
|
147
|
+
|
|
148
|
+
3. **What's-new digest** — after successful upgrade, fetch and summarize
|
|
149
|
+
release notes:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
gh api repos/bradygaster/squad/releases --jq '[.[] | select(.tag_name | test("^v"))]'
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
- Extract 3–6 bullet points from releases between `oldVersion` and
|
|
156
|
+
`newVersion`, inclusive.
|
|
157
|
+
- Priority: `feat` entries first, then `fix`, then `docs`.
|
|
158
|
+
- Format:
|
|
159
|
+
```
|
|
160
|
+
📋 What's new in v{newVersion}:
|
|
161
|
+
• {feat summary 1}
|
|
162
|
+
• {feat summary 2}
|
|
163
|
+
• {fix summary}
|
|
164
|
+
```
|
|
165
|
+
- **Fallback chain:**
|
|
166
|
+
- `gh` not authenticated → "See full release notes at:
|
|
167
|
+
https://github.com/bradygaster/squad/releases"
|
|
168
|
+
- No releases found → "No release notes found for this version range."
|
|
169
|
+
- Network failure → link to releases page
|
|
170
|
+
|
|
171
|
+
4. **Restart prompt** — after showing the digest, prompt the user:
|
|
172
|
+
> "`squad.agent.md` has been updated. For the new coordinator instructions
|
|
173
|
+
> to take effect, please start a new session (close and re-open this chat).
|
|
174
|
+
> Your team state and decisions are unchanged."
|
|
175
|
+
|
|
176
|
+
### 1.7 Failure Modes
|
|
177
|
+
|
|
178
|
+
Every failure path ends at "show normal greeting." The update check never
|
|
179
|
+
interrupts or delays the session.
|
|
180
|
+
|
|
181
|
+
| Failure | Behavior |
|
|
182
|
+
|---------|----------|
|
|
183
|
+
| `node` not on PATH | `MISS` → normal greeting |
|
|
184
|
+
| Upstream cache missing / corrupt | `MISS` → normal greeting |
|
|
185
|
+
| Upstream cache stale (`latest` channel) | Normal greeting (no npm call) |
|
|
186
|
+
| npm probe timeout (5s) | Normal greeting |
|
|
187
|
+
| npm probe network error | Normal greeting |
|
|
188
|
+
| npm probe parse error | Normal greeting |
|
|
189
|
+
| `.squad/.cache/` write error | Normal greeting (skip cache write) |
|
|
190
|
+
| `gh` not available / unauthenticated | Upgrade flow: link to releases page |
|
|
191
|
+
| `squad upgrade` exits non-zero | Report error, stop flow |
|
|
192
|
+
| Any unexpected exception | Log to `.squad/orchestration-log/`, normal greeting |
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## (Future steps reserved)
|
|
197
|
+
|
|
198
|
+
- Step 2: \<reserved\> — e.g., dependency drift check
|
|
199
|
+
- Step 3: \<reserved\> — e.g., repo policy / state-backend audit
|