@swarmdo/cli 1.4.8 → 1.6.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/README.md +9 -6
- package/dist/src/commands/compact.d.ts +16 -0
- package/dist/src/commands/compact.d.ts.map +1 -0
- package/dist/src/commands/compact.js +106 -0
- package/dist/src/commands/compact.js.map +1 -0
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +26 -24
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +10 -3
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/integrations.d.ts +14 -0
- package/dist/src/commands/integrations.d.ts.map +1 -0
- package/dist/src/commands/integrations.js +158 -0
- package/dist/src/commands/integrations.js.map +1 -0
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +50 -1
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/providers.d.ts.map +1 -1
- package/dist/src/commands/providers.js +3 -0
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/release.d.ts +15 -0
- package/dist/src/commands/release.d.ts.map +1 -0
- package/dist/src/commands/release.js +241 -0
- package/dist/src/commands/release.js.map +1 -0
- package/dist/src/commands/security.d.ts.map +1 -1
- package/dist/src/commands/security.js +14 -0
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/transcript.d.ts.map +1 -1
- package/dist/src/commands/transcript.js +82 -1
- package/dist/src/commands/transcript.js.map +1 -1
- package/dist/src/commands/usage.d.ts.map +1 -1
- package/dist/src/commands/usage.js +80 -1
- package/dist/src/commands/usage.js.map +1 -1
- package/dist/src/compact/compact.d.ts +60 -0
- package/dist/src/compact/compact.d.ts.map +1 -0
- package/dist/src/compact/compact.js +170 -0
- package/dist/src/compact/compact.js.map +1 -0
- package/dist/src/config-lint/lint.d.ts.map +1 -1
- package/dist/src/config-lint/lint.js +11 -1
- package/dist/src/config-lint/lint.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/statusline-generator.js +6 -6
- package/dist/src/integrations/integrations.d.ts +54 -0
- package/dist/src/integrations/integrations.d.ts.map +1 -0
- package/dist/src/integrations/integrations.js +162 -0
- package/dist/src/integrations/integrations.js.map +1 -0
- package/dist/src/mcp-tools/agent-execute-core.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-execute-core.js +25 -3
- package/dist/src/mcp-tools/agent-execute-core.js.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.js +8 -8
- package/dist/src/mcp-tools/agentdb-tools.js.map +1 -1
- package/dist/src/memory/graph-edge-writer.d.ts +12 -0
- package/dist/src/memory/graph-edge-writer.d.ts.map +1 -1
- package/dist/src/memory/graph-edge-writer.js +32 -1
- package/dist/src/memory/graph-edge-writer.js.map +1 -1
- package/dist/src/memory-vault/watch.d.ts +32 -0
- package/dist/src/memory-vault/watch.d.ts.map +1 -0
- package/dist/src/memory-vault/watch.js +66 -0
- package/dist/src/memory-vault/watch.js.map +1 -0
- package/dist/src/providers/openrouter-config.d.ts +91 -0
- package/dist/src/providers/openrouter-config.d.ts.map +1 -0
- package/dist/src/providers/openrouter-config.js +186 -0
- package/dist/src/providers/openrouter-config.js.map +1 -0
- package/dist/src/release/release.d.ts +72 -0
- package/dist/src/release/release.d.ts.map +1 -0
- package/dist/src/release/release.js +86 -0
- package/dist/src/release/release.js.map +1 -0
- package/dist/src/resilience/backoff.d.ts +23 -0
- package/dist/src/resilience/backoff.d.ts.map +1 -0
- package/dist/src/resilience/backoff.js +30 -0
- package/dist/src/resilience/backoff.js.map +1 -0
- package/dist/src/swarmvector/model-router.d.ts.map +1 -1
- package/dist/src/swarmvector/model-router.js +14 -0
- package/dist/src/swarmvector/model-router.js.map +1 -1
- package/dist/src/transcript/search.d.ts +39 -0
- package/dist/src/transcript/search.d.ts.map +1 -0
- package/dist/src/transcript/search.js +67 -0
- package/dist/src/transcript/search.js.map +1 -0
- package/dist/src/usage/diff.d.ts +69 -0
- package/dist/src/usage/diff.d.ts.map +1 -0
- package/dist/src/usage/diff.js +112 -0
- package/dist/src/usage/diff.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -3
- package/plugins/swarmdo-metaharness/scripts/smoke.sh +11 -11
- package/plugins/swarmdo-metaharness/scripts/test-mcp-tools.mjs +16 -2
- package/vendor/cli-core/dist/src/index.js +1 -1
- package/vendor/cli-core/dist/src/index.js.map +1 -1
- package/vendor/neural/dist/flash-attention.d.ts +1 -1
- package/vendor/neural/dist/flash-attention.js +1 -1
- package/vendor/shared/dist/hooks/safety/git-commit.js +1 -1
- package/vendor/shared/dist/hooks/safety/git-commit.js.map +1 -1
- package/vendor/shared/dist/mcp/transport/http.d.ts.map +1 -1
- package/vendor/shared/dist/mcp/transport/http.js +8 -1
- package/vendor/shared/dist/mcp/transport/http.js.map +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://swarmdo.com)
|
|
4
4
|
|
|
5
|
-
[](https://img.shields.io/badge/npx%20swarmdo-v1.6.0-cb3837?style=for-the-badge&logo=npm&logoColor=white)](https://github.com/SwarmDo/swarmdo/releases)
|
|
6
6
|
[](https://github.com/SwarmDo/swarmdo/blob/main/LICENSE)
|
|
7
7
|
[](https://swarmdo.com)
|
|
8
8
|
[](https://github.com/SwarmDo/swarmdo)
|
|
@@ -89,7 +89,7 @@ This adds slash commands and agent definitions only. The Swarmdo MCP server is N
|
|
|
89
89
|
| [**swarmdo-agentdb**](plugins/swarmdo-agentdb/README.md) | Fast vector database for agent memory |
|
|
90
90
|
| [**swarmdo-rag-memory**](plugins/swarmdo-rag-memory/README.md) | Smart retrieval — hybrid search, graph hops, diversity ranking |
|
|
91
91
|
| [**swarmdo-rvf**](plugins/swarmdo-rvf/README.md) | Save and restore agent memory across sessions |
|
|
92
|
-
| [**swarmdo-swarmvector**](plugins/swarmdo-swarmvector/README.md) |
|
|
92
|
+
| [**swarmdo-swarmvector**](plugins/swarmdo-swarmvector/README.md) | `swarmvector` (vendored in-repo at `v3/vendor/swarmvector`) — GPU-accelerated search, Graph RAG, 103 tools |
|
|
93
93
|
| [**swarmdo-knowledge-graph**](plugins/swarmdo-knowledge-graph/README.md) | Build and traverse entity relationship maps |
|
|
94
94
|
|
|
95
95
|
#### Intelligence & Learning
|
|
@@ -269,19 +269,22 @@ The recent release train added a full day-to-day operations layer around the swa
|
|
|
269
269
|
|
|
270
270
|
| Command | What it does |
|
|
271
271
|
|---------|-------------|
|
|
272
|
-
| `swarmdo usage` (alias `cost`) | Claude Code **spend analytics** from your local transcripts — `daily`, `monthly`, `models`, `projects`, `sessions`, live 5-hour `blocks` burn, `errors` (tool-failure analytics),
|
|
272
|
+
| `swarmdo usage` (alias `cost`) | Claude Code **spend analytics** from your local transcripts — `daily`, `monthly`, `models`, `projects`, `sessions`, live 5-hour `blocks` burn, `errors` (tool-failure analytics), `cache` (prompt-cache efficiency + $ saved), and `diff` (period-over-period comparison with per-model movers) |
|
|
273
273
|
| `swarmdo usage guard` | **Budget policy** — limits for the active 5h block / today / month via flags or `SWARMDO_GUARD_*` env → ok / warn / over; `--strict` exits 1, safe for CI gates and Stop hooks |
|
|
274
274
|
| `swarmdo hud` | **One-screen ops HUD** — 5h block burn, task readiness, daemon workers, memory snapshots (`--watch`, `--json`) |
|
|
275
275
|
| `swarmdo repair` (alias `tdd-repair`) | **Test-Driven Repair** — a bounded, budget-capped headless `claude` loop that fixes source until a failing test passes; dry-run unless `--confirm` |
|
|
276
|
-
| `swarmdo task … --dependencies` | **Task dependency DAG** — `task ready` lists unblocked work, `task graph` renders the graph, the dispatcher gates on readiness |
|
|
276
|
+
| `swarmdo task … --dependencies` | **Task dependency DAG** — `task ready` lists unblocked work, `task graph` renders the graph, the dispatcher gates on readiness; `task parse-prd <spec.md>` decomposes a PRD straight into the DAG |
|
|
277
277
|
| `swarmdo worktree` (alias `wt`) | **Parallel-agent isolation** on git worktrees — add / list / diff / merge / remove |
|
|
278
|
-
| `swarmdo transcript` (alias `tx`) | **Export any Claude Code session** to clean markdown — system noise stripped, ready to share |
|
|
278
|
+
| `swarmdo transcript` (alias `tx`) | **Export any Claude Code session** to clean markdown — system noise stripped, ready to share; `transcript search <query>` full-text-searches every session |
|
|
279
|
+
| `swarmdo compact` | **Compress noisy command output** before it reaches an LLM — strip ANSI, collapse repeats, fold `node_modules` stack frames, window long logs. `npm test 2>&1 \| swarmdo compact` or `swarmdo compact -- npm test` (exit code propagates). Deterministic, zero tokens |
|
|
280
|
+
| `swarmdo integrations` (alias `integrate`) | **Use swarmdo from Codex CLI, GitHub Copilot CLI, and pi** — one command wires AGENTS.md + each CLI's MCP config (idempotent, dry-run first, never touches your Claude Code setup) |
|
|
281
|
+
| OpenRouter model pool | **Let swarms pick from any models you configure** — declare tier-mapped OpenRouter models in `swarmdo.config.json`; the router Thompson-samples among them per task and the execution layer dispatches the winner |
|
|
279
282
|
| `swarmdo changelog` (alias `notes`) | **Release notes from conventional commits** — `--out NOTES.md` feeds `gh release create --notes-file` |
|
|
280
283
|
| `swarmdo mcp doctor` | **MCP config diagnosis** — missing binaries, bad URLs, malformed entries across `.mcp.json` + `~/.claude.json` |
|
|
281
284
|
| `swarmdo hooks notify -d` | **Desktop notifications** — OS-native toast (macOS `osascript`, Linux `notify-send`) |
|
|
282
285
|
| `swarmdo hooks recipe` | **One-command Claude Code hooks** — "ping me when Claude finishes / needs input"; dry-run by default, idempotent merge that never clobbers your settings |
|
|
283
286
|
| `swarmdo preset` + `init --preset` | **5-tier capability ladder** — `minimal` → `basic`★ → `standard` → `advanced` → `max`; one word instead of dozens of flags |
|
|
284
|
-
| `swarmdo memory export/import -f obsidian` | **Obsidian vault roundtrip** — DB → markdown notes (YAML frontmatter, `[[wikilinks]]` stay live) → edit in Obsidian → sync back, re-embedded |
|
|
287
|
+
| `swarmdo memory export/import -f obsidian` | **Obsidian vault roundtrip** — DB → markdown notes (YAML frontmatter, `[[wikilinks]]` stay live) → edit in Obsidian → sync back, re-embedded; `import --watch` keeps the vault live-synced as you edit |
|
|
285
288
|
| `swarmdo memory backup` / `revectorize` | WAL-safe nightly DB snapshots · repair hash-era vectors |
|
|
286
289
|
|
|
287
290
|
```bash
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `swarmdo compact` — compress noisy command output before it reaches an LLM.
|
|
3
|
+
*
|
|
4
|
+
* Two modes:
|
|
5
|
+
* npm test 2>&1 | swarmdo compact # stdin filter
|
|
6
|
+
* swarmdo compact -- npm test # wrap a command (stdout+stderr)
|
|
7
|
+
*
|
|
8
|
+
* Compacted text goes to stdout (pipeable); a one-line savings summary goes to
|
|
9
|
+
* stderr unless --quiet. When wrapping a command, the command's exit code is
|
|
10
|
+
* propagated verbatim — `swarmdo compact -- npm test` still fails if the tests
|
|
11
|
+
* fail. Deterministic, zero tokens (see ../compact/compact.ts).
|
|
12
|
+
*/
|
|
13
|
+
import type { Command } from '../types.js';
|
|
14
|
+
export declare const compactCommand: Command;
|
|
15
|
+
export default compactCommand;
|
|
16
|
+
//# sourceMappingURL=compact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../src/commands/compact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AA4E1E,eAAO,MAAM,cAAc,EAAE,OAiB5B,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `swarmdo compact` — compress noisy command output before it reaches an LLM.
|
|
3
|
+
*
|
|
4
|
+
* Two modes:
|
|
5
|
+
* npm test 2>&1 | swarmdo compact # stdin filter
|
|
6
|
+
* swarmdo compact -- npm test # wrap a command (stdout+stderr)
|
|
7
|
+
*
|
|
8
|
+
* Compacted text goes to stdout (pipeable); a one-line savings summary goes to
|
|
9
|
+
* stderr unless --quiet. When wrapping a command, the command's exit code is
|
|
10
|
+
* propagated verbatim — `swarmdo compact -- npm test` still fails if the tests
|
|
11
|
+
* fail. Deterministic, zero tokens (see ../compact/compact.ts).
|
|
12
|
+
*/
|
|
13
|
+
import { spawnSync } from 'node:child_process';
|
|
14
|
+
import { output } from '../output.js';
|
|
15
|
+
import { compactOutput, formatSavings } from '../compact/compact.js';
|
|
16
|
+
/**
|
|
17
|
+
* Read all of stdin as UTF-8. A stream read (not readFileSync(0)) — the
|
|
18
|
+
* synchronous form throws EAGAIN on a non-blocking pipe on macOS/Linux.
|
|
19
|
+
*/
|
|
20
|
+
function readStdin() {
|
|
21
|
+
return new Promise((resolve) => {
|
|
22
|
+
const chunks = [];
|
|
23
|
+
process.stdin.on('data', (c) => chunks.push(Buffer.from(c)));
|
|
24
|
+
process.stdin.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));
|
|
25
|
+
process.stdin.on('error', () => resolve(Buffer.concat(chunks).toString('utf8')));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function optsFromFlags(ctx) {
|
|
29
|
+
const opts = {
|
|
30
|
+
stripAnsi: ctx.flags['no-ansi'] !== true,
|
|
31
|
+
foldNodeModules: ctx.flags['no-fold'] !== true,
|
|
32
|
+
collapseBlanks: true,
|
|
33
|
+
};
|
|
34
|
+
if (typeof ctx.flags['min-run'] === 'number')
|
|
35
|
+
opts.minRun = ctx.flags['min-run'];
|
|
36
|
+
else if (typeof ctx.flags['min-run'] === 'string')
|
|
37
|
+
opts.minRun = parseInt(ctx.flags['min-run'], 10) || 3;
|
|
38
|
+
const win = ctx.flags.window;
|
|
39
|
+
if (typeof win === 'string' && /^\d+:\d+$/.test(win)) {
|
|
40
|
+
const [head, tail] = win.split(':').map((n) => parseInt(n, 10));
|
|
41
|
+
opts.window = { head, tail };
|
|
42
|
+
}
|
|
43
|
+
return opts;
|
|
44
|
+
}
|
|
45
|
+
async function run(ctx) {
|
|
46
|
+
const opts = optsFromFlags(ctx);
|
|
47
|
+
const quiet = ctx.flags.quiet === true;
|
|
48
|
+
// Command-wrap mode: everything after `--` is the command to run.
|
|
49
|
+
if (ctx.args.length > 0) {
|
|
50
|
+
const [cmd, ...cmdArgs] = ctx.args;
|
|
51
|
+
const r = spawnSync(cmd, cmdArgs, {
|
|
52
|
+
cwd: ctx.cwd,
|
|
53
|
+
encoding: 'utf8',
|
|
54
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
55
|
+
// Merge streams so interleaved stdout/stderr stay in order.
|
|
56
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
57
|
+
});
|
|
58
|
+
if (r.error) {
|
|
59
|
+
output.printError(`failed to run ${cmd}: ${r.error.message}`);
|
|
60
|
+
return { success: false, exitCode: 127 };
|
|
61
|
+
}
|
|
62
|
+
const combined = (r.stdout || '') + (r.stderr || '');
|
|
63
|
+
const { text, stats } = compactOutput(combined, opts);
|
|
64
|
+
process.stdout.write(text);
|
|
65
|
+
if (!quiet)
|
|
66
|
+
process.stderr.write(formatSavings(stats) + '\n');
|
|
67
|
+
// Propagate the wrapped command's exit code verbatim.
|
|
68
|
+
const code = r.status ?? (r.signal ? 1 : 0);
|
|
69
|
+
return { success: code === 0, exitCode: code };
|
|
70
|
+
}
|
|
71
|
+
// Stdin-filter mode.
|
|
72
|
+
if (process.stdin.isTTY) {
|
|
73
|
+
output.writeln(output.error('Usage: swarmdo compact -- <command> OR <command> | swarmdo compact'));
|
|
74
|
+
return { success: false, exitCode: 1 };
|
|
75
|
+
}
|
|
76
|
+
const input = await readStdin();
|
|
77
|
+
const { text, stats } = compactOutput(input, opts);
|
|
78
|
+
if (ctx.flags['stats-json'] === true) {
|
|
79
|
+
process.stderr.write(JSON.stringify(stats) + '\n');
|
|
80
|
+
}
|
|
81
|
+
else if (!quiet) {
|
|
82
|
+
process.stderr.write(formatSavings(stats) + '\n');
|
|
83
|
+
}
|
|
84
|
+
process.stdout.write(text);
|
|
85
|
+
return { success: true, exitCode: 0 };
|
|
86
|
+
}
|
|
87
|
+
export const compactCommand = {
|
|
88
|
+
name: 'compact',
|
|
89
|
+
description: 'Compress noisy command output (tests/builds/logs) before it reaches an LLM — deterministic, zero tokens',
|
|
90
|
+
options: [
|
|
91
|
+
{ name: 'no-ansi', description: 'keep ANSI colour/escape codes (default: strip)', type: 'boolean' },
|
|
92
|
+
{ name: 'no-fold', description: 'keep full node_modules stack frames (default: fold)', type: 'boolean' },
|
|
93
|
+
{ name: 'min-run', description: 'collapse a run of ≥N identical lines (default 3; 0 disables)', type: 'string' },
|
|
94
|
+
{ name: 'window', description: 'keep first H + last T lines of long output, e.g. --window 40:20', type: 'string' },
|
|
95
|
+
{ name: 'stats-json', description: 'emit compaction stats as JSON on stderr (stdin mode)', type: 'boolean' },
|
|
96
|
+
{ name: 'quiet', description: 'suppress the savings summary on stderr', type: 'boolean' },
|
|
97
|
+
],
|
|
98
|
+
examples: [
|
|
99
|
+
{ command: 'npm test 2>&1 | swarmdo compact', description: 'Filter noisy test output on stdin' },
|
|
100
|
+
{ command: 'swarmdo compact -- npm run build', description: 'Wrap a command; exit code propagates' },
|
|
101
|
+
{ command: 'swarmdo compact --window 40:20 -- pnpm install', description: 'Head+tail window a long install log' },
|
|
102
|
+
],
|
|
103
|
+
action: run,
|
|
104
|
+
};
|
|
105
|
+
export default compactCommand;
|
|
106
|
+
//# sourceMappingURL=compact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compact.js","sourceRoot":"","sources":["../../../src/commands/compact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,E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@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AAuuK1E,eAAO,MAAM,YAAY,EAAE,OA2G1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -3413,32 +3413,34 @@ const statuslineCommand = {
|
|
|
3413
3413
|
const dddProgress = Math.min(100, Math.floor((domainsCompleted / totalDomains) * 100));
|
|
3414
3414
|
return { domainsCompleted, totalDomains, dddProgress, patternsLearned: learning.patterns, sessionsCompleted: learning.sessions };
|
|
3415
3415
|
}
|
|
3416
|
-
// Get security status
|
|
3416
|
+
// Get security status from the last real `security scan` artifact.
|
|
3417
|
+
// (Until v1.4.17 this counted files in never-written directories against a
|
|
3418
|
+
// hardcoded totalCves=3 — the V3-era CVE-1/2/3 tracker — so every install
|
|
3419
|
+
// showed PENDING forever.)
|
|
3417
3420
|
function getSecurityStatus() {
|
|
3418
|
-
const
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
const scans = fs.readdirSync(scanResultsPath).filter((f) => f.endsWith('.json'));
|
|
3424
|
-
cvesFixed = Math.min(totalCves, scans.length);
|
|
3425
|
-
}
|
|
3426
|
-
catch {
|
|
3427
|
-
// Ignore
|
|
3428
|
-
}
|
|
3429
|
-
}
|
|
3430
|
-
const auditPath = path.join(process.cwd(), '.swarm', 'security');
|
|
3431
|
-
if (fs.existsSync(auditPath)) {
|
|
3421
|
+
const candidates = [
|
|
3422
|
+
path.join(process.cwd(), '.swarmdo', 'security', 'last-scan.json'),
|
|
3423
|
+
path.join(process.cwd(), '.swarm', 'security', 'last-scan.json'), // legacy layout
|
|
3424
|
+
];
|
|
3425
|
+
for (const p of candidates) {
|
|
3432
3426
|
try {
|
|
3433
|
-
|
|
3434
|
-
|
|
3427
|
+
if (!fs.existsSync(p))
|
|
3428
|
+
continue;
|
|
3429
|
+
const scan = JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
3430
|
+
const critical = Number(scan.critical) || 0;
|
|
3431
|
+
const high = Number(scan.high) || 0;
|
|
3432
|
+
const total = Number(scan.total) || 0;
|
|
3433
|
+
const scannedAt = typeof scan.scannedAt === 'string' ? scan.scannedAt : null;
|
|
3434
|
+
const ageMs = scannedAt ? Date.now() - new Date(scannedAt).getTime() : Number.POSITIVE_INFINITY;
|
|
3435
|
+
const status = critical + high > 0 ? 'VULN' : ageMs > 7 * 24 * 3600 * 1000 ? 'STALE' : 'CLEAN';
|
|
3436
|
+
return { status, critical, high, total, scannedAt };
|
|
3435
3437
|
}
|
|
3436
3438
|
catch {
|
|
3437
|
-
//
|
|
3439
|
+
// unreadable artifact — try next candidate
|
|
3438
3440
|
}
|
|
3439
3441
|
}
|
|
3440
|
-
|
|
3441
|
-
return { status,
|
|
3442
|
+
// no scan has ever run — nothing is "pending", there is just no data
|
|
3443
|
+
return { status: 'NONE', critical: 0, high: 0, total: 0, scannedAt: null };
|
|
3442
3444
|
}
|
|
3443
3445
|
// Get swarm status
|
|
3444
3446
|
function getSwarmStatus() {
|
|
@@ -3578,7 +3580,7 @@ const statuslineCommand = {
|
|
|
3578
3580
|
const terminalCols = process.stdout.columns ?? 80;
|
|
3579
3581
|
const autoCompact = !ctx.flags.full && terminalCols < COMPACT_WIDTH_THRESHOLD;
|
|
3580
3582
|
if (ctx.flags.compact || autoCompact) {
|
|
3581
|
-
const line = `DDD:${progress.domainsCompleted}/${progress.totalDomains}
|
|
3583
|
+
const line = `DDD:${progress.domainsCompleted}/${progress.totalDomains} Sec:${security.status} Swarm:${swarm.activeAgents}/${swarm.maxAgents} Ctx:${system.contextPct}% Int:${system.intelligencePct}%`;
|
|
3582
3584
|
output.writeln(line);
|
|
3583
3585
|
return { success: true, data: statusData };
|
|
3584
3586
|
}
|
|
@@ -3752,13 +3754,13 @@ const statuslineCommand = {
|
|
|
3752
3754
|
perfIndicator;
|
|
3753
3755
|
const swarmIndicator = swarm.coordinationActive ? `${c.brightGreen}◉${c.reset}` : `${c.dim}○${c.reset}`;
|
|
3754
3756
|
const agentsColor = swarm.activeAgents > 0 ? c.brightGreen : c.red;
|
|
3755
|
-
const securityIcon = security.status === 'CLEAN' ? '🟢' : security.status === '
|
|
3756
|
-
const securityColor = security.status === 'CLEAN' ? c.brightGreen : security.status === '
|
|
3757
|
+
const securityIcon = security.status === 'CLEAN' ? '🟢' : security.status === 'STALE' ? '🟡' : security.status === 'NONE' ? '⚪' : '🔴';
|
|
3758
|
+
const securityColor = security.status === 'CLEAN' ? c.brightGreen : security.status === 'STALE' ? c.brightYellow : security.status === 'NONE' ? c.dim : c.brightRed;
|
|
3757
3759
|
const hooksColor = hooksStats.enabled > 0 ? c.brightGreen : c.dim;
|
|
3758
3760
|
const line2 = `${c.brightYellow}🤖 Swarm${c.reset} ${swarmIndicator} [${agentsColor}${String(swarm.activeAgents).padStart(2)}${c.reset}/${c.brightWhite}${swarm.maxAgents}${c.reset}] ` +
|
|
3759
3761
|
`${c.brightPurple}👥 ${system.subAgents}${c.reset} ` +
|
|
3760
3762
|
`${c.brightBlue}🪝 ${hooksColor}${hooksStats.enabled}${c.reset}/${c.brightWhite}${hooksStats.total}${c.reset} ` +
|
|
3761
|
-
`${securityIcon} ${securityColor}
|
|
3763
|
+
`${securityIcon} ${securityColor}sec ${security.status === 'VULN' ? (security.critical + security.high) + '!' : security.status === 'CLEAN' ? '✓' : security.status === 'STALE' ? 'stale' : '—'}${c.reset} ` +
|
|
3762
3764
|
`${c.brightCyan}💾 ${system.memoryMB}MB${c.reset} ` +
|
|
3763
3765
|
`${c.brightPurple}🧠 ${String(system.intelligencePct).padStart(3)}%${c.reset}`;
|
|
3764
3766
|
const dddColor = progress.dddProgress >= 50 ? c.brightGreen : progress.dddProgress > 0 ? c.yellow : c.red;
|