steroids-cli 0.8.13 → 0.8.15
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 +2 -2
- package/dist/cleanup/directory-size.d.ts +39 -0
- package/dist/cleanup/directory-size.d.ts.map +1 -0
- package/dist/cleanup/directory-size.js +130 -0
- package/dist/cleanup/directory-size.js.map +1 -0
- package/dist/cleanup/text-logs.d.ts +22 -0
- package/dist/cleanup/text-logs.d.ts.map +1 -0
- package/dist/cleanup/text-logs.js +118 -0
- package/dist/cleanup/text-logs.js.map +1 -0
- package/dist/commands/about.d.ts +1 -2
- package/dist/commands/about.d.ts.map +1 -1
- package/dist/commands/about.js +3 -251
- package/dist/commands/about.js.map +1 -1
- package/dist/commands/llm.d.ts.map +1 -1
- package/dist/commands/llm.js +104 -3
- package/dist/commands/llm.js.map +1 -1
- package/dist/commands/loop-phases.d.ts +13 -2
- package/dist/commands/loop-phases.d.ts.map +1 -1
- package/dist/commands/loop-phases.js +42 -0
- package/dist/commands/loop-phases.js.map +1 -1
- package/dist/commands/loop.d.ts.map +1 -1
- package/dist/commands/loop.js +29 -3
- package/dist/commands/loop.js.map +1 -1
- package/dist/database/queries.d.ts +29 -0
- package/dist/database/queries.d.ts.map +1 -1
- package/dist/database/queries.js +54 -0
- package/dist/database/queries.js.map +1 -1
- package/dist/health/stuck-task-detector.d.ts +1 -1
- package/dist/health/stuck-task-detector.d.ts.map +1 -1
- package/dist/health/stuck-task-detector.js.map +1 -1
- package/dist/hooks/events.d.ts +10 -1
- package/dist/hooks/events.d.ts.map +1 -1
- package/dist/hooks/events.js +17 -1
- package/dist/hooks/events.js.map +1 -1
- package/dist/hooks/integration.d.ts +15 -1
- package/dist/hooks/integration.d.ts.map +1 -1
- package/dist/hooks/integration.js +18 -0
- package/dist/hooks/integration.js.map +1 -1
- package/dist/hooks/payload.d.ts +45 -1
- package/dist/hooks/payload.d.ts.map +1 -1
- package/dist/hooks/payload.js +45 -0
- package/dist/hooks/payload.js.map +1 -1
- package/dist/hooks/templates.d.ts +7 -0
- package/dist/hooks/templates.d.ts.map +1 -1
- package/dist/hooks/templates.js +40 -0
- package/dist/hooks/templates.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/providers/interface.d.ts +15 -1
- package/dist/providers/interface.d.ts.map +1 -1
- package/dist/providers/interface.js +74 -0
- package/dist/providers/interface.js.map +1 -1
- package/dist/runners/credit-pause.d.ts +44 -0
- package/dist/runners/credit-pause.d.ts.map +1 -0
- package/dist/runners/credit-pause.js +137 -0
- package/dist/runners/credit-pause.js.map +1 -0
- package/dist/runners/daemon.d.ts.map +1 -1
- package/dist/runners/daemon.js +3 -0
- package/dist/runners/daemon.js.map +1 -1
- package/dist/runners/orchestrator-loop.d.ts +1 -0
- package/dist/runners/orchestrator-loop.d.ts.map +1 -1
- package/dist/runners/orchestrator-loop.js +63 -5
- package/dist/runners/orchestrator-loop.js.map +1 -1
- package/dist/runners/projects.d.ts +5 -0
- package/dist/runners/projects.d.ts.map +1 -1
- package/dist/runners/projects.js +15 -0
- package/dist/runners/projects.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -246,9 +246,9 @@ That's it. Open your browser at:
|
|
|
246
246
|
| Command | Description |
|
|
247
247
|
|---------|-------------|
|
|
248
248
|
| `steroids init` | Initialize Steroids in current directory |
|
|
249
|
-
| `steroids
|
|
250
|
-
| `steroids llm` | Compact instructions for LLM agents (call when context lost) |
|
|
249
|
+
| `steroids llm` | Quick reference for LLM agents (project setup, commands, task flow) |
|
|
251
250
|
| `steroids llm --context` | Include current project context (active tasks, runners) |
|
|
251
|
+
| `steroids about` | Alias for `steroids llm` |
|
|
252
252
|
| `steroids loop` | Run the coder/reviewer loop interactively |
|
|
253
253
|
| `steroids loop --once` | Run one iteration only |
|
|
254
254
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface StorageBreakdown {
|
|
2
|
+
total_bytes: number;
|
|
3
|
+
total_human: string;
|
|
4
|
+
breakdown: {
|
|
5
|
+
database: {
|
|
6
|
+
bytes: number;
|
|
7
|
+
human: string;
|
|
8
|
+
};
|
|
9
|
+
invocations: {
|
|
10
|
+
bytes: number;
|
|
11
|
+
human: string;
|
|
12
|
+
file_count: number;
|
|
13
|
+
};
|
|
14
|
+
logs: {
|
|
15
|
+
bytes: number;
|
|
16
|
+
human: string;
|
|
17
|
+
file_count: number;
|
|
18
|
+
};
|
|
19
|
+
backups: {
|
|
20
|
+
bytes: number;
|
|
21
|
+
human: string;
|
|
22
|
+
backup_count: number;
|
|
23
|
+
};
|
|
24
|
+
other: {
|
|
25
|
+
bytes: number;
|
|
26
|
+
human: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
clearable_bytes: number;
|
|
30
|
+
clearable_human: string;
|
|
31
|
+
threshold_warning: 'orange' | 'red' | null;
|
|
32
|
+
}
|
|
33
|
+
export declare function formatBytes(bytes: number): string;
|
|
34
|
+
export declare function sumDirectorySize(dirPath: string, recursive?: boolean): Promise<{
|
|
35
|
+
bytes: number;
|
|
36
|
+
fileCount: number;
|
|
37
|
+
}>;
|
|
38
|
+
export declare function getStorageBreakdown(steroidsDir: string): Promise<StorageBreakdown>;
|
|
39
|
+
//# sourceMappingURL=directory-size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory-size.d.ts","sourceRoot":"","sources":["../../src/cleanup/directory-size.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE;QACT,QAAQ,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;QAC3C,WAAW,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;QAClE,IAAI,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;QAC3D,OAAO,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,YAAY,EAAE,MAAM,CAAA;SAAE,CAAC;QAChE,KAAK,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC;KACzC,CAAC;IACF,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,QAAQ,GAAG,KAAK,GAAG,IAAI,CAAC;CAC5C;AAQD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKjD;AAMD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,SAAS,UAAQ,GAChB,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAgB/C;AAgBD,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA+CxF"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatBytes = formatBytes;
|
|
4
|
+
exports.sumDirectorySize = sumDirectorySize;
|
|
5
|
+
exports.getStorageBreakdown = getStorageBreakdown;
|
|
6
|
+
/**
|
|
7
|
+
* Compute storage breakdown of a project's .steroids/ directory.
|
|
8
|
+
* Scans known subpaths only (not full recursive traversal) for speed.
|
|
9
|
+
* All fs operations are async — safe for use in API handlers.
|
|
10
|
+
*/
|
|
11
|
+
const node_fs_1 = require("node:fs");
|
|
12
|
+
const node_path_1 = require("node:path");
|
|
13
|
+
const MB = 1024 * 1024;
|
|
14
|
+
const THRESHOLD_ORANGE = 50 * MB;
|
|
15
|
+
const THRESHOLD_RED = 100 * MB;
|
|
16
|
+
const DB_FILES = ['steroids.db', 'steroids.db-wal', 'steroids.db-shm'];
|
|
17
|
+
const KNOWN_PATHS = new Set([...DB_FILES, 'invocations', 'logs', 'backup']);
|
|
18
|
+
function formatBytes(bytes) {
|
|
19
|
+
if (bytes < 1024)
|
|
20
|
+
return `${bytes} B`;
|
|
21
|
+
if (bytes < MB)
|
|
22
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
23
|
+
if (bytes < 1024 * MB)
|
|
24
|
+
return `${(bytes / MB).toFixed(1)} MB`;
|
|
25
|
+
return `${(bytes / (1024 * MB)).toFixed(1)} GB`;
|
|
26
|
+
}
|
|
27
|
+
async function safeStatSize(filePath) {
|
|
28
|
+
try {
|
|
29
|
+
return (await node_fs_1.promises.stat(filePath)).size;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async function sumDirectorySize(dirPath, recursive = false) {
|
|
36
|
+
let bytes = 0;
|
|
37
|
+
let fileCount = 0;
|
|
38
|
+
let entries;
|
|
39
|
+
try {
|
|
40
|
+
entries = await node_fs_1.promises.readdir(dirPath, { withFileTypes: true });
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return { bytes: 0, fileCount: 0 };
|
|
44
|
+
}
|
|
45
|
+
for (const entry of entries) {
|
|
46
|
+
const fullPath = (0, node_path_1.join)(dirPath, entry.name);
|
|
47
|
+
if (entry.isFile()) {
|
|
48
|
+
try {
|
|
49
|
+
const st = await node_fs_1.promises.stat(fullPath);
|
|
50
|
+
bytes += st.size;
|
|
51
|
+
fileCount++;
|
|
52
|
+
}
|
|
53
|
+
catch { /* tolerate */ }
|
|
54
|
+
}
|
|
55
|
+
else if (entry.isDirectory() && recursive) {
|
|
56
|
+
const sub = await sumDirectorySize(fullPath, true);
|
|
57
|
+
bytes += sub.bytes;
|
|
58
|
+
fileCount += sub.fileCount;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return { bytes, fileCount };
|
|
62
|
+
}
|
|
63
|
+
function emptyBreakdown() {
|
|
64
|
+
return {
|
|
65
|
+
total_bytes: 0, total_human: '0 B',
|
|
66
|
+
breakdown: {
|
|
67
|
+
database: { bytes: 0, human: '0 B' },
|
|
68
|
+
invocations: { bytes: 0, human: '0 B', file_count: 0 },
|
|
69
|
+
logs: { bytes: 0, human: '0 B', file_count: 0 },
|
|
70
|
+
backups: { bytes: 0, human: '0 B', backup_count: 0 },
|
|
71
|
+
other: { bytes: 0, human: '0 B' },
|
|
72
|
+
},
|
|
73
|
+
clearable_bytes: 0, clearable_human: '0 B', threshold_warning: null,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
async function getStorageBreakdown(steroidsDir) {
|
|
77
|
+
try {
|
|
78
|
+
await node_fs_1.promises.access(steroidsDir);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return emptyBreakdown();
|
|
82
|
+
}
|
|
83
|
+
const dbSizes = await Promise.all(DB_FILES.map(f => safeStatSize((0, node_path_1.join)(steroidsDir, f))));
|
|
84
|
+
const dbBytes = dbSizes.reduce((a, b) => a + b, 0);
|
|
85
|
+
const [invocations, logs, backups] = await Promise.all([
|
|
86
|
+
sumDirectorySize((0, node_path_1.join)(steroidsDir, 'invocations'), false),
|
|
87
|
+
sumDirectorySize((0, node_path_1.join)(steroidsDir, 'logs'), true),
|
|
88
|
+
sumDirectorySize((0, node_path_1.join)(steroidsDir, 'backup'), true),
|
|
89
|
+
]);
|
|
90
|
+
let backupCount = 0;
|
|
91
|
+
try {
|
|
92
|
+
const be = await node_fs_1.promises.readdir((0, node_path_1.join)(steroidsDir, 'backup'), { withFileTypes: true });
|
|
93
|
+
backupCount = be.filter(e => e.isDirectory()).length;
|
|
94
|
+
}
|
|
95
|
+
catch { /* no backup dir */ }
|
|
96
|
+
let otherBytes = 0;
|
|
97
|
+
try {
|
|
98
|
+
const allEntries = await node_fs_1.promises.readdir(steroidsDir, { withFileTypes: true });
|
|
99
|
+
for (const entry of allEntries) {
|
|
100
|
+
if (KNOWN_PATHS.has(entry.name))
|
|
101
|
+
continue;
|
|
102
|
+
const fullPath = (0, node_path_1.join)(steroidsDir, entry.name);
|
|
103
|
+
if (entry.isFile())
|
|
104
|
+
otherBytes += await safeStatSize(fullPath);
|
|
105
|
+
else if (entry.isDirectory())
|
|
106
|
+
otherBytes += (await sumDirectorySize(fullPath, true)).bytes;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch { /* tolerate */ }
|
|
110
|
+
const totalBytes = dbBytes + invocations.bytes + logs.bytes + backups.bytes + otherBytes;
|
|
111
|
+
const clearableBytes = invocations.bytes + logs.bytes;
|
|
112
|
+
let warning = null;
|
|
113
|
+
if (clearableBytes >= THRESHOLD_RED)
|
|
114
|
+
warning = 'red';
|
|
115
|
+
else if (clearableBytes >= THRESHOLD_ORANGE)
|
|
116
|
+
warning = 'orange';
|
|
117
|
+
return {
|
|
118
|
+
total_bytes: totalBytes, total_human: formatBytes(totalBytes),
|
|
119
|
+
breakdown: {
|
|
120
|
+
database: { bytes: dbBytes, human: formatBytes(dbBytes) },
|
|
121
|
+
invocations: { bytes: invocations.bytes, human: formatBytes(invocations.bytes), file_count: invocations.fileCount },
|
|
122
|
+
logs: { bytes: logs.bytes, human: formatBytes(logs.bytes), file_count: logs.fileCount },
|
|
123
|
+
backups: { bytes: backups.bytes, human: formatBytes(backups.bytes), backup_count: backupCount },
|
|
124
|
+
other: { bytes: otherBytes, human: formatBytes(otherBytes) },
|
|
125
|
+
},
|
|
126
|
+
clearable_bytes: clearableBytes, clearable_human: formatBytes(clearableBytes),
|
|
127
|
+
threshold_warning: warning,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=directory-size.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory-size.js","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roids/logs/YYYY-MM-DD/
|
|
6
|
+
*/
|
|
7
|
+
import type { CleanupInvocationLogsResult } from './invocation-logs.js';
|
|
8
|
+
export type CleanupTextLogsResult = CleanupInvocationLogsResult;
|
|
9
|
+
export interface CleanupTextLogsOptions {
|
|
10
|
+
retentionDays?: number;
|
|
11
|
+
dryRun?: boolean;
|
|
12
|
+
nowMs?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Delete old `.steroids/logs/YYYY-MM-DD/` directories based on date in name.
|
|
16
|
+
*
|
|
17
|
+
* Deletes entire date directories whose date is older than the retention window.
|
|
18
|
+
* Skips files modified in the last 60 seconds (runner may be writing).
|
|
19
|
+
* Tolerates ENOENT errors (files may disappear during cleanup).
|
|
20
|
+
*/
|
|
21
|
+
export declare function cleanupTextLogs(projectPath: string, options?: CleanupTextLogsOptions): CleanupTextLogsResult;
|
|
22
|
+
//# sourceMappingURL=text-logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-logs.d.ts","sourceRoot":"","sources":["../../src/cleanup/text-logs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAKxE,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,sBAA2B,GACnC,qBAAqB,CAgFvB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Retention cleanup for date-based text logs.
|
|
4
|
+
*
|
|
5
|
+
* These are stored in directories at:
|
|
6
|
+
* .steroids/logs/YYYY-MM-DD/
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.cleanupTextLogs = cleanupTextLogs;
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const node_path_1 = require("node:path");
|
|
12
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
13
|
+
const RECENTLY_MODIFIED_MS = 60_000; // 60 seconds
|
|
14
|
+
/**
|
|
15
|
+
* Parse a YYYY-MM-DD directory name to a Date.
|
|
16
|
+
* Returns null if the name doesn't match the expected format.
|
|
17
|
+
*/
|
|
18
|
+
function parseDateDir(name) {
|
|
19
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(name);
|
|
20
|
+
if (!match)
|
|
21
|
+
return null;
|
|
22
|
+
const year = Number(match[1]);
|
|
23
|
+
const month = Number(match[2]) - 1;
|
|
24
|
+
const day = Number(match[3]);
|
|
25
|
+
const d = new Date(year, month, day);
|
|
26
|
+
// Round-trip check: reject non-calendar dates like 2024-13-40
|
|
27
|
+
if (d.getFullYear() !== year || d.getMonth() !== month || d.getDate() !== day)
|
|
28
|
+
return null;
|
|
29
|
+
return d;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Delete old `.steroids/logs/YYYY-MM-DD/` directories based on date in name.
|
|
33
|
+
*
|
|
34
|
+
* Deletes entire date directories whose date is older than the retention window.
|
|
35
|
+
* Skips files modified in the last 60 seconds (runner may be writing).
|
|
36
|
+
* Tolerates ENOENT errors (files may disappear during cleanup).
|
|
37
|
+
*/
|
|
38
|
+
function cleanupTextLogs(projectPath, options = {}) {
|
|
39
|
+
const retentionDays = options.retentionDays ?? 7;
|
|
40
|
+
const nowMs = options.nowMs ?? Date.now();
|
|
41
|
+
const cutoffMs = nowMs - retentionDays * DAY_MS;
|
|
42
|
+
if (retentionDays <= 0) {
|
|
43
|
+
return { scannedFiles: 0, deletedFiles: 0, freedBytes: 0, cutoffMs };
|
|
44
|
+
}
|
|
45
|
+
const logsDir = (0, node_path_1.join)(projectPath, '.steroids', 'logs');
|
|
46
|
+
if (!(0, node_fs_1.existsSync)(logsDir)) {
|
|
47
|
+
return { scannedFiles: 0, deletedFiles: 0, freedBytes: 0, cutoffMs };
|
|
48
|
+
}
|
|
49
|
+
let scannedFiles = 0;
|
|
50
|
+
let deletedFiles = 0;
|
|
51
|
+
let freedBytes = 0;
|
|
52
|
+
try {
|
|
53
|
+
const dateDirs = (0, node_fs_1.readdirSync)(logsDir, { withFileTypes: true });
|
|
54
|
+
for (const dirEntry of dateDirs) {
|
|
55
|
+
if (!dirEntry.isDirectory())
|
|
56
|
+
continue;
|
|
57
|
+
const dirDate = parseDateDir(dirEntry.name);
|
|
58
|
+
if (!dirDate)
|
|
59
|
+
continue;
|
|
60
|
+
// Check if entire directory is older than retention
|
|
61
|
+
if (dirDate.getTime() >= cutoffMs)
|
|
62
|
+
continue;
|
|
63
|
+
const dirPath = (0, node_path_1.join)(logsDir, dirEntry.name);
|
|
64
|
+
let files;
|
|
65
|
+
try {
|
|
66
|
+
files = (0, node_fs_1.readdirSync)(dirPath, { withFileTypes: true });
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
continue; // ENOENT — directory may have been removed
|
|
70
|
+
}
|
|
71
|
+
let allDeleted = true;
|
|
72
|
+
for (const file of files) {
|
|
73
|
+
if (!file.isFile()) {
|
|
74
|
+
allDeleted = false;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
scannedFiles++;
|
|
78
|
+
const filePath = (0, node_path_1.join)(dirPath, file.name);
|
|
79
|
+
let st;
|
|
80
|
+
try {
|
|
81
|
+
st = (0, node_fs_1.statSync)(filePath);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
continue; // ENOENT
|
|
85
|
+
}
|
|
86
|
+
// Skip recently modified files (runner may be writing)
|
|
87
|
+
if (nowMs - st.mtimeMs < RECENTLY_MODIFIED_MS) {
|
|
88
|
+
allDeleted = false;
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
deletedFiles++;
|
|
92
|
+
freedBytes += st.size;
|
|
93
|
+
if (!options.dryRun) {
|
|
94
|
+
try {
|
|
95
|
+
(0, node_fs_1.unlinkSync)(filePath);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
allDeleted = false; // deletion failed, don't remove parent
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Try to remove the empty date directory (best-effort)
|
|
103
|
+
if (allDeleted && !options.dryRun) {
|
|
104
|
+
try {
|
|
105
|
+
(0, node_fs_1.rmdirSync)(dirPath);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// Directory not empty or already gone — tolerate
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return { scannedFiles: 0, deletedFiles: 0, freedBytes: 0, cutoffMs };
|
|
115
|
+
}
|
|
116
|
+
return { scannedFiles, deletedFiles, freedBytes, cutoffMs };
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=text-logs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-logs.js","sourceRoot":"","sources":["../../src/cleanup/text-logs.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAwCH,0CAmFC;AAzHD,qCAAmF;AACnF,yCAAiC;AAGjC,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACnC,MAAM,oBAAoB,GAAG,MAAM,CAAC,CAAC,aAAa;AAUlD;;;GAGG;AACH,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,KAAK,GAAG,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAA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;gBACvD,IAAI,KAAK,GAAG,EAAE,CAAC,OAAO,GAAG,oBAAoB,EAAE,CAAC;oBAC9C,UAAU,GAAG,KAAK,CAAC;oBACnB,SAAS;gBACX,CAAC;gBAED,YAAY,EAAE,CAAC;gBACf,UAAU,IAAI,EAAE,CAAC,IAAI,CAAC;gBACtB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;oBACpB,IAAI,CAAC;wBACH,IAAA,oBAAU,EAAC,QAAQ,CAAC,CAAC;oBACvB,CAAC;oBAAC,MAAM,CAAC;wBACP,UAAU,GAAG,KAAK,CAAC,CAAC,uCAAuC;oBAC7D,CAAC;gBACH,CAAC;YACH,CAAC;YAED,uDAAuD;YACvD,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBAClC,IAAI,CAAC;oBACH,IAAA,mBAAS,EAAC,OAAO,CAAC,CAAC;gBACrB,CAAC;gBAAC,MAAM,CAAC;oBACP,iDAAiD;gBACnD,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvE,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAC9D,CAAC"}
|
package/dist/commands/about.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* About Command
|
|
3
|
-
* Explains what Steroids is for LLMs discovering the tool
|
|
2
|
+
* About Command - Alias for llm command
|
|
4
3
|
*/
|
|
5
4
|
import type { GlobalFlags } from '../cli/flags.js';
|
|
6
5
|
export declare function aboutCommand(args: string[], flags: GlobalFlags): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about.d.ts","sourceRoot":"","sources":["../../src/commands/about.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"about.d.ts","sourceRoot":"","sources":["../../src/commands/about.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpF"}
|
package/dist/commands/about.js
CHANGED
|
@@ -1,259 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* About Command
|
|
4
|
-
* Explains what Steroids is for LLMs discovering the tool
|
|
3
|
+
* About Command - Alias for llm command
|
|
5
4
|
*/
|
|
6
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
6
|
exports.aboutCommand = aboutCommand;
|
|
8
|
-
const
|
|
9
|
-
const help_js_1 = require("../cli/help.js");
|
|
10
|
-
const ABOUT_TEXT = `
|
|
11
|
-
STEROIDS - Automated Task Execution System
|
|
12
|
-
===========================================
|
|
13
|
-
|
|
14
|
-
Steroids is an AI-powered task orchestration system that manages software
|
|
15
|
-
development tasks through a coder/reviewer loop. It enables LLMs to work
|
|
16
|
-
autonomously on codebases while maintaining quality through automated review.
|
|
17
|
-
|
|
18
|
-
CORE CONCEPT
|
|
19
|
-
------------
|
|
20
|
-
Tasks are organized into sections and processed by two AI roles:
|
|
21
|
-
|
|
22
|
-
1. CODER: Implements tasks by writing code, running builds, and tests
|
|
23
|
-
2. REVIEWER: Reviews completed work, approves or rejects with feedback
|
|
24
|
-
|
|
25
|
-
When rejected, tasks return to the coder with notes. This loop continues
|
|
26
|
-
until approval or a dispute is raised (after 15 rejections).
|
|
27
|
-
|
|
28
|
-
HOW IT WORKS
|
|
29
|
-
------------
|
|
30
|
-
1. Human creates tasks with specifications in markdown files
|
|
31
|
-
2. Runner daemon picks up pending tasks in priority order
|
|
32
|
-
3. Coder AI implements the task following the specification
|
|
33
|
-
4. Reviewer AI evaluates the implementation
|
|
34
|
-
5. On approval: task marked complete, next task starts
|
|
35
|
-
6. On rejection: task returns to coder with feedback
|
|
36
|
-
7. After 15 rejections: dispute raised for human resolution
|
|
37
|
-
|
|
38
|
-
KEY COMMANDS FOR LLMs
|
|
39
|
-
---------------------
|
|
40
|
-
steroids tasks list List pending tasks
|
|
41
|
-
steroids tasks list --status all Show all tasks with status
|
|
42
|
-
steroids sections list Show task sections
|
|
43
|
-
steroids tasks update <id> --status review Submit work for review
|
|
44
|
-
steroids tasks approve <id> Approve as reviewer
|
|
45
|
-
steroids tasks reject <id> --notes "..." Reject with feedback
|
|
46
|
-
steroids dispute create Raise a dispute
|
|
47
|
-
|
|
48
|
-
TASK LIFECYCLE
|
|
49
|
-
--------------
|
|
50
|
-
pending -> in_progress -> review -> completed
|
|
51
|
-
^ |
|
|
52
|
-
| v (rejected)
|
|
53
|
-
+----------+
|
|
54
|
-
|
|
55
|
-
SPECIFICATIONS
|
|
56
|
-
--------------
|
|
57
|
-
Each task has a sourceFile pointing to a markdown specification.
|
|
58
|
-
The coder MUST follow this specification exactly.
|
|
59
|
-
The reviewer MUST verify the implementation matches the spec.
|
|
60
|
-
|
|
61
|
-
PROJECT SETUP - HOW TO STRUCTURE WORK
|
|
62
|
-
-------------------------------------
|
|
63
|
-
Steroids works best when projects are structured correctly. Think of it like
|
|
64
|
-
building a house: sections are rooms, tasks are individual construction steps.
|
|
65
|
-
|
|
66
|
-
SECTIONS = Features or Functional Areas
|
|
67
|
-
- Each section represents ONE cohesive piece of functionality
|
|
68
|
-
- Sections should be independent enough to be worked on in isolation
|
|
69
|
-
- Name sections clearly: "Phase 1: User Authentication", "Phase 2: Dashboard"
|
|
70
|
-
- Sections have priorities and can depend on other sections
|
|
71
|
-
|
|
72
|
-
TASKS = Small, Atomic Implementation Steps
|
|
73
|
-
- Each task should be completable in ONE focused session (15-60 min of AI work)
|
|
74
|
-
- Tasks should do ONE thing well - if you say "and" you might need two tasks
|
|
75
|
-
- Tasks must have a clear specification file explaining exactly what to build
|
|
76
|
-
- Tasks are ordered within sections - earlier tasks may set up later ones
|
|
77
|
-
|
|
78
|
-
EXAMPLE FROM THIS PROJECT (steroids-cli):
|
|
79
|
-
Section: "Phase 0.7: Section Focus"
|
|
80
|
-
Tasks:
|
|
81
|
-
1. Add --section flag to loop command
|
|
82
|
-
2. Add sectionId parameter to TaskSelectionOptions
|
|
83
|
-
3. Update task selection queries to filter by section
|
|
84
|
-
4. Update loop display to show focused section
|
|
85
|
-
5. Add section validation
|
|
86
|
-
|
|
87
|
-
Each task is small and specific. Together they implement "section focus."
|
|
88
|
-
|
|
89
|
-
WRITING GOOD SPECIFICATIONS:
|
|
90
|
-
- Create a specs/ directory with markdown files
|
|
91
|
-
- Each spec should include: purpose, requirements, examples, edge cases
|
|
92
|
-
- Reference existing code patterns the implementation should follow
|
|
93
|
-
- Include acceptance criteria - how do we know it's done?
|
|
94
|
-
|
|
95
|
-
EXAMPLE SPEC STRUCTURE (specs/feature-name.md):
|
|
96
|
-
# Feature Name
|
|
97
|
-
|
|
98
|
-
## Overview
|
|
99
|
-
What this feature does and why.
|
|
100
|
-
|
|
101
|
-
## Requirements
|
|
102
|
-
- Specific requirement 1
|
|
103
|
-
- Specific requirement 2
|
|
104
|
-
|
|
105
|
-
## Implementation Notes
|
|
106
|
-
- Follow pattern in src/existing/similar.ts
|
|
107
|
-
- Use existing utility from src/utils/helper.ts
|
|
108
|
-
|
|
109
|
-
## Examples
|
|
110
|
-
\`\`\`bash
|
|
111
|
-
steroids command --flag value
|
|
112
|
-
# Expected output...
|
|
113
|
-
\`\`\`
|
|
114
|
-
|
|
115
|
-
## Acceptance Criteria
|
|
116
|
-
- [ ] Command works as shown in examples
|
|
117
|
-
- [ ] Tests pass
|
|
118
|
-
- [ ] Documentation updated
|
|
119
|
-
|
|
120
|
-
ADDING TASKS
|
|
121
|
-
-----------
|
|
122
|
-
steroids tasks add <title> --section <id> --source <spec-file> [options]
|
|
123
|
-
|
|
124
|
-
Required:
|
|
125
|
-
--section <id> Section the task belongs to
|
|
126
|
-
--source <file> Specification markdown file for the coder/reviewer
|
|
127
|
-
|
|
128
|
-
Optional:
|
|
129
|
-
--file <path> Anchor task to a specific file (must be committed in git)
|
|
130
|
-
--line <number> Line number in the anchored file (requires --file)
|
|
131
|
-
--feedback Add to "Needs User Input" section (skips --section/--source)
|
|
132
|
-
|
|
133
|
-
When --file is used, Steroids validates the file is tracked and clean in git,
|
|
134
|
-
then auto-captures the commit SHA and content hash. The coder/reviewer prompts
|
|
135
|
-
will reference this exact file location.
|
|
136
|
-
|
|
137
|
-
When --feedback is used, the task goes to a special skipped section called
|
|
138
|
-
"Needs User Input" that the runner ignores. Use for advisory items, disputes,
|
|
139
|
-
or anything needing human review.
|
|
140
|
-
|
|
141
|
-
Examples:
|
|
142
|
-
steroids tasks add "Implement login" --section abc123 --source specs/login.md
|
|
143
|
-
steroids tasks add "Fix null check" --section abc123 --source spec.md --file src/utils.ts --line 42
|
|
144
|
-
steroids tasks add "Review execSync usage" --feedback
|
|
145
|
-
|
|
146
|
-
INITIALIZING A PROJECT:
|
|
147
|
-
1. steroids init # Creates .steroids/ directory
|
|
148
|
-
2. Create specs/ with your specifications
|
|
149
|
-
3. steroids sections add "Phase 1: Feature Name"
|
|
150
|
-
4. steroids tasks add "Task title" --section <id> --source specs/spec.md
|
|
151
|
-
5. steroids loop # Start processing
|
|
152
|
-
|
|
153
|
-
IMPORTANT RULES
|
|
154
|
-
---------------
|
|
155
|
-
- Always run build AND tests before submitting for review
|
|
156
|
-
- Read the task specification thoroughly before implementing
|
|
157
|
-
- Make small, focused commits
|
|
158
|
-
- Never modify code outside the task scope
|
|
159
|
-
- If stuck, create a dispute rather than guessing
|
|
160
|
-
|
|
161
|
-
For full documentation:
|
|
162
|
-
- CLI: steroids --help
|
|
163
|
-
- Tasks: steroids tasks --help
|
|
164
|
-
- Config: steroids config show
|
|
165
|
-
`;
|
|
166
|
-
const HELP = (0, help_js_1.generateHelp)({
|
|
167
|
-
command: 'about',
|
|
168
|
-
description: 'Explains what Steroids is and how it works',
|
|
169
|
-
details: `Designed for LLMs discovering this tool for the first time.
|
|
170
|
-
Provides comprehensive overview of architecture, workflow, and best practices.
|
|
171
|
-
Use --json for structured output optimized for LLM parsing.`,
|
|
172
|
-
usage: ['steroids about [options]'],
|
|
173
|
-
examples: [
|
|
174
|
-
{ command: 'steroids about', description: 'Human-readable explanation' },
|
|
175
|
-
{ command: 'steroids about --json', description: 'Structured JSON for LLM parsing' },
|
|
176
|
-
],
|
|
177
|
-
related: [
|
|
178
|
-
{ command: 'steroids llm', description: 'Compact quick reference when context is lost' },
|
|
179
|
-
{ command: 'steroids --help', description: 'CLI help with all commands' },
|
|
180
|
-
],
|
|
181
|
-
showGlobalOptions: true,
|
|
182
|
-
showExitCodes: false,
|
|
183
|
-
showEnvVars: false,
|
|
184
|
-
});
|
|
7
|
+
const llm_js_1 = require("./llm.js");
|
|
185
8
|
async function aboutCommand(args, flags) {
|
|
186
|
-
|
|
187
|
-
if (flags.help) {
|
|
188
|
-
out.log(HELP);
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
const data = {
|
|
192
|
-
name: 'Steroids',
|
|
193
|
-
description: 'AI-powered task orchestration with coder/reviewer loop',
|
|
194
|
-
version: process.env.npm_package_version ?? '0.0.0',
|
|
195
|
-
concept: {
|
|
196
|
-
roles: [
|
|
197
|
-
{ name: 'coder', purpose: 'Implements tasks by writing code, running builds and tests' },
|
|
198
|
-
{ name: 'reviewer', purpose: 'Reviews completed work, approves or rejects with feedback' },
|
|
199
|
-
],
|
|
200
|
-
workflow: [
|
|
201
|
-
'Human creates tasks with specifications',
|
|
202
|
-
'Runner picks up pending tasks',
|
|
203
|
-
'Coder implements following specification',
|
|
204
|
-
'Reviewer evaluates implementation',
|
|
205
|
-
'Approved: task complete, next starts',
|
|
206
|
-
'Rejected: returns to coder with notes',
|
|
207
|
-
'After 15 rejections: dispute raised',
|
|
208
|
-
],
|
|
209
|
-
lifecycle: ['pending', 'in_progress', 'review', 'completed'],
|
|
210
|
-
},
|
|
211
|
-
projectSetup: {
|
|
212
|
-
sections: 'Features or functional areas - each represents ONE cohesive piece of functionality',
|
|
213
|
-
tasks: 'Small, atomic implementation steps - completable in 15-60 min, does ONE thing well',
|
|
214
|
-
specifications: 'Markdown files in specs/ with purpose, requirements, examples, acceptance criteria',
|
|
215
|
-
example: {
|
|
216
|
-
section: 'Phase 0.7: Section Focus',
|
|
217
|
-
tasks: [
|
|
218
|
-
'Add --section flag to loop command',
|
|
219
|
-
'Add sectionId parameter to TaskSelectionOptions',
|
|
220
|
-
'Update task selection queries to filter by section',
|
|
221
|
-
'Update loop display to show focused section',
|
|
222
|
-
'Add section validation',
|
|
223
|
-
],
|
|
224
|
-
},
|
|
225
|
-
steps: [
|
|
226
|
-
'steroids init - creates .steroids/ directory',
|
|
227
|
-
'Create specs/ with your specifications',
|
|
228
|
-
'steroids sections add "Phase 1: Feature Name"',
|
|
229
|
-
'steroids tasks add "Task title" --section <id> --source specs/spec.md',
|
|
230
|
-
'steroids tasks add "Task title" --section <id> --source spec.md --file src/foo.ts --line 42 (anchor to file)',
|
|
231
|
-
'steroids tasks add "Advisory note" --feedback (skipped section for human review)',
|
|
232
|
-
'steroids loop - start processing',
|
|
233
|
-
],
|
|
234
|
-
},
|
|
235
|
-
commands: [
|
|
236
|
-
{ command: 'steroids tasks list', description: 'List pending tasks' },
|
|
237
|
-
{ command: 'steroids tasks list --status all', description: 'Show all tasks' },
|
|
238
|
-
{ command: 'steroids sections list', description: 'Show task sections' },
|
|
239
|
-
{ command: 'steroids tasks update <id> --status review', description: 'Submit for review' },
|
|
240
|
-
{ command: 'steroids tasks approve <id>', description: 'Approve as reviewer' },
|
|
241
|
-
{ command: 'steroids tasks reject <id> --notes "..."', description: 'Reject with feedback' },
|
|
242
|
-
{ command: 'steroids dispute create', description: 'Raise a dispute' },
|
|
243
|
-
],
|
|
244
|
-
rules: [
|
|
245
|
-
'Always run build AND tests before submitting for review',
|
|
246
|
-
'Read the task specification thoroughly before implementing',
|
|
247
|
-
'Make small, focused commits',
|
|
248
|
-
'Never modify code outside the task scope',
|
|
249
|
-
'If stuck, create a dispute rather than guessing',
|
|
250
|
-
],
|
|
251
|
-
};
|
|
252
|
-
if (flags.json) {
|
|
253
|
-
out.success(data);
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
out.log(ABOUT_TEXT);
|
|
257
|
-
}
|
|
9
|
+
await (0, llm_js_1.llmCommand)(args, flags);
|
|
258
10
|
}
|
|
259
11
|
//# sourceMappingURL=about.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"about.js","sourceRoot":"","sources":["../../src/commands/about.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"about.js","sourceRoot":"","sources":["../../src/commands/about.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAKH,oCAEC;AAJD,qCAAsC;AAE/B,KAAK,UAAU,YAAY,CAAC,IAAc,EAAE,KAAkB;IACnE,MAAM,IAAA,mBAAU,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/commands/llm.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"llm.d.ts","sourceRoot":"","sources":["../../src/commands/llm.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AA6RnD,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA4KlF"}
|