|
6 | 6 | "net/http" |
7 | 7 | "os" |
8 | 8 | "path/filepath" |
| 9 | + "sort" |
9 | 10 | "strings" |
10 | 11 | "time" |
11 | 12 |
|
@@ -133,7 +134,9 @@ func runStatus(jsonOut bool) error { |
133 | 134 | "context-surfacing", |
134 | 135 | "decision-extractor", |
135 | 136 | "handoff-generator", |
| 137 | + "feedback-loop", |
136 | 138 | "staleness-check", |
| 139 | + "session-bootstrap", |
137 | 140 | } |
138 | 141 | for _, name := range hookNames { |
139 | 142 | data.Hooks[name] = hookStatus[name] |
@@ -260,21 +263,63 @@ func runStatus(jsonOut bool) error { |
260 | 263 | cli.Dim, cli.Reset) |
261 | 264 | } |
262 | 265 |
|
263 | | - // Vaults |
| 266 | + // Vaults — show active vault prominently, then registered list |
264 | 267 | reg := config.LoadRegistry() |
265 | | - if len(reg.Vaults) > 0 { |
266 | | - cli.Section("Vaults") |
267 | | - fmt.Printf(" Registered: %d vault(s)\n", len(reg.Vaults)) |
268 | | - for name, path := range reg.Vaults { |
| 268 | + |
| 269 | + // Determine which registered vault name maps to the active vault path |
| 270 | + activeName := "" |
| 271 | + for name, path := range reg.Vaults { |
| 272 | + if path == vp { |
| 273 | + activeName = name |
| 274 | + break |
| 275 | + } |
| 276 | + } |
| 277 | + |
| 278 | + // Determine how the active vault was resolved |
| 279 | + activeSource := "" |
| 280 | + if config.VaultOverride != "" { |
| 281 | + activeSource = "via --vault flag" |
| 282 | + } else if cwd, err := os.Getwd(); err == nil && cwd == vp { |
| 283 | + activeSource = "auto-detected from cwd" |
| 284 | + } else if activeName != "" && activeName == reg.Default { |
| 285 | + activeSource = "registry default" |
| 286 | + } |
| 287 | + |
| 288 | + cli.Section("Vault") |
| 289 | + if activeName != "" { |
| 290 | + sourceHint := "" |
| 291 | + if activeSource != "" { |
| 292 | + sourceHint = fmt.Sprintf(" %s(%s)%s", cli.Dim, activeSource, cli.Reset) |
| 293 | + } |
| 294 | + fmt.Printf(" Active: %s %s%s\n", activeName, cli.ShortenHome(vp), sourceHint) |
| 295 | + } else { |
| 296 | + sourceHint := "" |
| 297 | + if activeSource != "" { |
| 298 | + sourceHint = fmt.Sprintf(" %s(%s)%s", cli.Dim, activeSource, cli.Reset) |
| 299 | + } |
| 300 | + fmt.Printf(" Active: %s%s\n", cli.ShortenHome(vp), sourceHint) |
| 301 | + } |
| 302 | + |
| 303 | + if len(reg.Vaults) > 1 { |
| 304 | + cli.Section("Registered Vaults") |
| 305 | + // Sort vault names for deterministic output |
| 306 | + names := make([]string, 0, len(reg.Vaults)) |
| 307 | + for name := range reg.Vaults { |
| 308 | + names = append(names, name) |
| 309 | + } |
| 310 | + sort.Strings(names) |
| 311 | + |
| 312 | + for _, name := range names { |
| 313 | + path := reg.Vaults[name] |
269 | 314 | marker := " " |
270 | | - if name == reg.Default { |
| 315 | + if name == activeName { |
| 316 | + marker = cli.Green + "→ " + cli.Reset |
| 317 | + } else if name == reg.Default { |
271 | 318 | marker = "* " |
272 | 319 | } |
273 | | - fmt.Printf(" %s%-15s %s\n", marker, name, cli.ShortenHome(path)) |
274 | | - } |
275 | | - if reg.Default != "" { |
276 | | - fmt.Printf("\n %s(* = default · use --all to search across vaults)%s\n", cli.Dim, cli.Reset) |
| 320 | + fmt.Printf(" %s%-18s %s\n", marker, name, cli.ShortenHome(path)) |
277 | 321 | } |
| 322 | + fmt.Printf("\n %s(* = default · → = active · switch with 'same vault default <name>')%s\n", cli.Dim, cli.Reset) |
278 | 323 | } |
279 | 324 |
|
280 | 325 | // Config |
|
0 commit comments