@cluesmith/codev 1.1.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/bin/af.js +8 -0
- package/bin/codev.js +4 -0
- package/bin/consult.js +7 -0
- package/dist/agent-farm/cli.d.ts +11 -0
- package/dist/agent-farm/cli.d.ts.map +1 -0
- package/dist/agent-farm/cli.js +359 -0
- package/dist/agent-farm/cli.js.map +1 -0
- package/dist/agent-farm/commands/cleanup.d.ts +12 -0
- package/dist/agent-farm/commands/cleanup.d.ts.map +1 -0
- package/dist/agent-farm/commands/cleanup.js +154 -0
- package/dist/agent-farm/commands/cleanup.js.map +1 -0
- package/dist/agent-farm/commands/db.d.ts +38 -0
- package/dist/agent-farm/commands/db.d.ts.map +1 -0
- package/dist/agent-farm/commands/db.js +133 -0
- package/dist/agent-farm/commands/db.js.map +1 -0
- package/dist/agent-farm/commands/index.d.ts +11 -0
- package/dist/agent-farm/commands/index.d.ts.map +1 -0
- package/dist/agent-farm/commands/index.js +11 -0
- package/dist/agent-farm/commands/index.js.map +1 -0
- package/dist/agent-farm/commands/open.d.ts +15 -0
- package/dist/agent-farm/commands/open.d.ts.map +1 -0
- package/dist/agent-farm/commands/open.js +118 -0
- package/dist/agent-farm/commands/open.js.map +1 -0
- package/dist/agent-farm/commands/rename.d.ts +13 -0
- package/dist/agent-farm/commands/rename.d.ts.map +1 -0
- package/dist/agent-farm/commands/rename.js +33 -0
- package/dist/agent-farm/commands/rename.js.map +1 -0
- package/dist/agent-farm/commands/send.d.ts +9 -0
- package/dist/agent-farm/commands/send.d.ts.map +1 -0
- package/dist/agent-farm/commands/send.js +282 -0
- package/dist/agent-farm/commands/send.js.map +1 -0
- package/dist/agent-farm/commands/spawn.d.ts +15 -0
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -0
- package/dist/agent-farm/commands/spawn.js +575 -0
- package/dist/agent-farm/commands/spawn.js.map +1 -0
- package/dist/agent-farm/commands/start.d.ts +9 -0
- package/dist/agent-farm/commands/start.d.ts.map +1 -0
- package/dist/agent-farm/commands/start.js +175 -0
- package/dist/agent-farm/commands/start.js.map +1 -0
- package/dist/agent-farm/commands/status.d.ts +8 -0
- package/dist/agent-farm/commands/status.d.ts.map +1 -0
- package/dist/agent-farm/commands/status.js +123 -0
- package/dist/agent-farm/commands/status.js.map +1 -0
- package/dist/agent-farm/commands/stop.d.ts +8 -0
- package/dist/agent-farm/commands/stop.d.ts.map +1 -0
- package/dist/agent-farm/commands/stop.js +76 -0
- package/dist/agent-farm/commands/stop.js.map +1 -0
- package/dist/agent-farm/commands/tower.d.ts +19 -0
- package/dist/agent-farm/commands/tower.d.ts.map +1 -0
- package/dist/agent-farm/commands/tower.js +125 -0
- package/dist/agent-farm/commands/tower.js.map +1 -0
- package/dist/agent-farm/commands/tutorial.d.ts +10 -0
- package/dist/agent-farm/commands/tutorial.d.ts.map +1 -0
- package/dist/agent-farm/commands/tutorial.js +49 -0
- package/dist/agent-farm/commands/tutorial.js.map +1 -0
- package/dist/agent-farm/commands/util.d.ts +15 -0
- package/dist/agent-farm/commands/util.d.ts.map +1 -0
- package/dist/agent-farm/commands/util.js +108 -0
- package/dist/agent-farm/commands/util.js.map +1 -0
- package/dist/agent-farm/db/errors.d.ts +17 -0
- package/dist/agent-farm/db/errors.d.ts.map +1 -0
- package/dist/agent-farm/db/errors.js +46 -0
- package/dist/agent-farm/db/errors.js.map +1 -0
- package/dist/agent-farm/db/index.d.ts +41 -0
- package/dist/agent-farm/db/index.d.ts.map +1 -0
- package/dist/agent-farm/db/index.js +168 -0
- package/dist/agent-farm/db/index.js.map +1 -0
- package/dist/agent-farm/db/migrate.d.ts +15 -0
- package/dist/agent-farm/db/migrate.d.ts.map +1 -0
- package/dist/agent-farm/db/migrate.js +137 -0
- package/dist/agent-farm/db/migrate.js.map +1 -0
- package/dist/agent-farm/db/schema.d.ts +16 -0
- package/dist/agent-farm/db/schema.d.ts.map +1 -0
- package/dist/agent-farm/db/schema.js +103 -0
- package/dist/agent-farm/db/schema.js.map +1 -0
- package/dist/agent-farm/db/types.d.ts +87 -0
- package/dist/agent-farm/db/types.d.ts.map +1 -0
- package/dist/agent-farm/db/types.js +65 -0
- package/dist/agent-farm/db/types.js.map +1 -0
- package/dist/agent-farm/index.d.ts +7 -0
- package/dist/agent-farm/index.d.ts.map +1 -0
- package/dist/agent-farm/index.js +373 -0
- package/dist/agent-farm/index.js.map +1 -0
- package/dist/agent-farm/servers/annotate-server.d.ts +9 -0
- package/dist/agent-farm/servers/annotate-server.d.ts.map +1 -0
- package/dist/agent-farm/servers/annotate-server.js +136 -0
- package/dist/agent-farm/servers/annotate-server.js.map +1 -0
- package/dist/agent-farm/servers/dashboard-server.d.ts +9 -0
- package/dist/agent-farm/servers/dashboard-server.d.ts.map +1 -0
- package/dist/agent-farm/servers/dashboard-server.js +939 -0
- package/dist/agent-farm/servers/dashboard-server.js.map +1 -0
- package/dist/agent-farm/servers/tower-server.d.ts +9 -0
- package/dist/agent-farm/servers/tower-server.d.ts.map +1 -0
- package/dist/agent-farm/servers/tower-server.js +463 -0
- package/dist/agent-farm/servers/tower-server.js.map +1 -0
- package/dist/agent-farm/state.d.ts +93 -0
- package/dist/agent-farm/state.d.ts.map +1 -0
- package/dist/agent-farm/state.js +253 -0
- package/dist/agent-farm/state.js.map +1 -0
- package/dist/agent-farm/tutorial/index.d.ts +8 -0
- package/dist/agent-farm/tutorial/index.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/index.js +8 -0
- package/dist/agent-farm/tutorial/index.js.map +1 -0
- package/dist/agent-farm/tutorial/prompts.d.ts +57 -0
- package/dist/agent-farm/tutorial/prompts.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/prompts.js +147 -0
- package/dist/agent-farm/tutorial/prompts.js.map +1 -0
- package/dist/agent-farm/tutorial/runner.d.ts +52 -0
- package/dist/agent-farm/tutorial/runner.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/runner.js +204 -0
- package/dist/agent-farm/tutorial/runner.js.map +1 -0
- package/dist/agent-farm/tutorial/state.d.ts +26 -0
- package/dist/agent-farm/tutorial/state.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/state.js +89 -0
- package/dist/agent-farm/tutorial/state.js.map +1 -0
- package/dist/agent-farm/tutorial/steps/first-spec.d.ts +7 -0
- package/dist/agent-farm/tutorial/steps/first-spec.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/steps/first-spec.js +136 -0
- package/dist/agent-farm/tutorial/steps/first-spec.js.map +1 -0
- package/dist/agent-farm/tutorial/steps/implementation.d.ts +7 -0
- package/dist/agent-farm/tutorial/steps/implementation.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/steps/implementation.js +76 -0
- package/dist/agent-farm/tutorial/steps/implementation.js.map +1 -0
- package/dist/agent-farm/tutorial/steps/index.d.ts +10 -0
- package/dist/agent-farm/tutorial/steps/index.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/steps/index.js +10 -0
- package/dist/agent-farm/tutorial/steps/index.js.map +1 -0
- package/dist/agent-farm/tutorial/steps/planning.d.ts +7 -0
- package/dist/agent-farm/tutorial/steps/planning.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/steps/planning.js +143 -0
- package/dist/agent-farm/tutorial/steps/planning.js.map +1 -0
- package/dist/agent-farm/tutorial/steps/review.d.ts +7 -0
- package/dist/agent-farm/tutorial/steps/review.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/steps/review.js +78 -0
- package/dist/agent-farm/tutorial/steps/review.js.map +1 -0
- package/dist/agent-farm/tutorial/steps/setup.d.ts +7 -0
- package/dist/agent-farm/tutorial/steps/setup.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/steps/setup.js +126 -0
- package/dist/agent-farm/tutorial/steps/setup.js.map +1 -0
- package/dist/agent-farm/tutorial/steps/welcome.d.ts +7 -0
- package/dist/agent-farm/tutorial/steps/welcome.d.ts.map +1 -0
- package/dist/agent-farm/tutorial/steps/welcome.js +50 -0
- package/dist/agent-farm/tutorial/steps/welcome.js.map +1 -0
- package/dist/agent-farm/types.d.ts +131 -0
- package/dist/agent-farm/types.d.ts.map +1 -0
- package/dist/agent-farm/types.js +5 -0
- package/dist/agent-farm/types.js.map +1 -0
- package/dist/agent-farm/utils/config.d.ts +27 -0
- package/dist/agent-farm/utils/config.d.ts.map +1 -0
- package/dist/agent-farm/utils/config.js +242 -0
- package/dist/agent-farm/utils/config.js.map +1 -0
- package/dist/agent-farm/utils/deps.d.ts +51 -0
- package/dist/agent-farm/utils/deps.d.ts.map +1 -0
- package/dist/agent-farm/utils/deps.js +194 -0
- package/dist/agent-farm/utils/deps.js.map +1 -0
- package/dist/agent-farm/utils/index.d.ts +6 -0
- package/dist/agent-farm/utils/index.d.ts.map +1 -0
- package/dist/agent-farm/utils/index.js +6 -0
- package/dist/agent-farm/utils/index.js.map +1 -0
- package/dist/agent-farm/utils/logger.d.ts +31 -0
- package/dist/agent-farm/utils/logger.d.ts.map +1 -0
- package/dist/agent-farm/utils/logger.js +58 -0
- package/dist/agent-farm/utils/logger.js.map +1 -0
- package/dist/agent-farm/utils/orphan-handler.d.ts +27 -0
- package/dist/agent-farm/utils/orphan-handler.d.ts.map +1 -0
- package/dist/agent-farm/utils/orphan-handler.js +127 -0
- package/dist/agent-farm/utils/orphan-handler.js.map +1 -0
- package/dist/agent-farm/utils/port-registry.d.ts +58 -0
- package/dist/agent-farm/utils/port-registry.d.ts.map +1 -0
- package/dist/agent-farm/utils/port-registry.js +149 -0
- package/dist/agent-farm/utils/port-registry.js.map +1 -0
- package/dist/agent-farm/utils/shell.d.ts +45 -0
- package/dist/agent-farm/utils/shell.d.ts.map +1 -0
- package/dist/agent-farm/utils/shell.js +120 -0
- package/dist/agent-farm/utils/shell.js.map +1 -0
- package/dist/cli.d.ts +10 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +160 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/adopt.d.ts +12 -0
- package/dist/commands/adopt.d.ts.map +1 -0
- package/dist/commands/adopt.js +178 -0
- package/dist/commands/adopt.js.map +1 -0
- package/dist/commands/consult/index.d.ts +17 -0
- package/dist/commands/consult/index.d.ts.map +1 -0
- package/dist/commands/consult/index.js +405 -0
- package/dist/commands/consult/index.js.map +1 -0
- package/dist/commands/doctor.d.ts +10 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +346 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +12 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +167 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/tower.d.ts +16 -0
- package/dist/commands/tower.d.ts.map +1 -0
- package/dist/commands/tower.js +21 -0
- package/dist/commands/tower.js.map +1 -0
- package/dist/commands/update.d.ts +13 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +137 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/lib/templates.d.ts +57 -0
- package/dist/lib/templates.d.ts.map +1 -0
- package/dist/lib/templates.js +205 -0
- package/dist/lib/templates.js.map +1 -0
- package/package.json +55 -0
- package/templates/AGENTS.md +49 -0
- package/templates/CLAUDE.md +47 -0
- package/templates/DEPENDENCIES.md +344 -0
- package/templates/agents/architecture-documenter.md +189 -0
- package/templates/agents/codev-updater.md +276 -0
- package/templates/agents/spider-protocol-updater.md +118 -0
- package/templates/annotate.html +903 -0
- package/templates/bin/agent-farm +18 -0
- package/templates/bin/annotate-server.js +140 -0
- package/templates/bin/codev-doctor +335 -0
- package/templates/builders.md +30 -0
- package/templates/config.json +7 -0
- package/templates/dashboard-split.html +1679 -0
- package/templates/dashboard.html +149 -0
- package/templates/plans/.gitkeep +0 -0
- package/templates/protocols/experiment/protocol.md +229 -0
- package/templates/protocols/experiment/templates/notes.md +97 -0
- package/templates/protocols/maintain/protocol.md +235 -0
- package/templates/protocols/spider/protocol.md +639 -0
- package/templates/protocols/spider/templates/plan.md +169 -0
- package/templates/protocols/spider/templates/review.md +207 -0
- package/templates/protocols/spider/templates/spec.md +140 -0
- package/templates/protocols/spider-solo/protocol.md +619 -0
- package/templates/protocols/spider-solo/templates/plan.md +169 -0
- package/templates/protocols/spider-solo/templates/review.md +207 -0
- package/templates/protocols/spider-solo/templates/spec.md +140 -0
- package/templates/protocols/tick/protocol.md +250 -0
- package/templates/protocols/tick/templates/plan.md +67 -0
- package/templates/protocols/tick/templates/review.md +90 -0
- package/templates/protocols/tick/templates/spec.md +61 -0
- package/templates/reviews/.gitkeep +0 -0
- package/templates/roles/architect.md +230 -0
- package/templates/roles/builder.md +175 -0
- package/templates/roles/consultant.md +27 -0
- package/templates/specs/.gitkeep +0 -0
- package/templates/templates/projectlist.md +129 -0
- package/templates/tower.html +1032 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite Schema Definitions
|
|
3
|
+
*
|
|
4
|
+
* Defines the schema for both local state (state.db) and global registry (global.db)
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Local state schema (state.db)
|
|
8
|
+
* Stores dashboard state: architect, builders, utils, annotations
|
|
9
|
+
*/
|
|
10
|
+
export const LOCAL_SCHEMA = `
|
|
11
|
+
-- Schema versioning
|
|
12
|
+
CREATE TABLE IF NOT EXISTS _migrations (
|
|
13
|
+
version INTEGER PRIMARY KEY,
|
|
14
|
+
applied_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
-- Architect session (singleton)
|
|
18
|
+
CREATE TABLE IF NOT EXISTS architect (
|
|
19
|
+
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
20
|
+
pid INTEGER NOT NULL,
|
|
21
|
+
port INTEGER NOT NULL,
|
|
22
|
+
cmd TEXT NOT NULL,
|
|
23
|
+
started_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
24
|
+
tmux_session TEXT
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
-- Builder sessions
|
|
28
|
+
CREATE TABLE IF NOT EXISTS builders (
|
|
29
|
+
id TEXT PRIMARY KEY,
|
|
30
|
+
name TEXT NOT NULL,
|
|
31
|
+
port INTEGER NOT NULL UNIQUE,
|
|
32
|
+
pid INTEGER NOT NULL,
|
|
33
|
+
status TEXT NOT NULL DEFAULT 'spawning'
|
|
34
|
+
CHECK(status IN ('spawning', 'implementing', 'blocked', 'pr-ready', 'complete')),
|
|
35
|
+
phase TEXT NOT NULL DEFAULT '',
|
|
36
|
+
worktree TEXT NOT NULL,
|
|
37
|
+
branch TEXT NOT NULL,
|
|
38
|
+
tmux_session TEXT,
|
|
39
|
+
type TEXT NOT NULL DEFAULT 'spec'
|
|
40
|
+
CHECK(type IN ('spec', 'task', 'protocol', 'shell', 'worktree')),
|
|
41
|
+
task_text TEXT,
|
|
42
|
+
protocol_name TEXT,
|
|
43
|
+
started_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
44
|
+
updated_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
-- Indexes for common queries
|
|
48
|
+
CREATE INDEX IF NOT EXISTS idx_builders_status ON builders(status);
|
|
49
|
+
CREATE INDEX IF NOT EXISTS idx_builders_port ON builders(port);
|
|
50
|
+
|
|
51
|
+
-- Utility terminals
|
|
52
|
+
CREATE TABLE IF NOT EXISTS utils (
|
|
53
|
+
id TEXT PRIMARY KEY,
|
|
54
|
+
name TEXT NOT NULL,
|
|
55
|
+
port INTEGER NOT NULL UNIQUE,
|
|
56
|
+
pid INTEGER NOT NULL,
|
|
57
|
+
tmux_session TEXT,
|
|
58
|
+
started_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
-- Annotations (file viewers)
|
|
62
|
+
CREATE TABLE IF NOT EXISTS annotations (
|
|
63
|
+
id TEXT PRIMARY KEY,
|
|
64
|
+
file TEXT NOT NULL,
|
|
65
|
+
port INTEGER NOT NULL UNIQUE,
|
|
66
|
+
pid INTEGER NOT NULL,
|
|
67
|
+
parent_type TEXT NOT NULL CHECK(parent_type IN ('architect', 'builder', 'util')),
|
|
68
|
+
parent_id TEXT,
|
|
69
|
+
started_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
-- Trigger to update updated_at on builders
|
|
73
|
+
CREATE TRIGGER IF NOT EXISTS builders_updated_at
|
|
74
|
+
AFTER UPDATE ON builders
|
|
75
|
+
FOR EACH ROW
|
|
76
|
+
BEGIN
|
|
77
|
+
UPDATE builders SET updated_at = datetime('now') WHERE id = NEW.id;
|
|
78
|
+
END;
|
|
79
|
+
`;
|
|
80
|
+
/**
|
|
81
|
+
* Global registry schema (global.db)
|
|
82
|
+
* Stores port allocations across all projects
|
|
83
|
+
*/
|
|
84
|
+
export const GLOBAL_SCHEMA = `
|
|
85
|
+
-- Schema versioning
|
|
86
|
+
CREATE TABLE IF NOT EXISTS _migrations (
|
|
87
|
+
version INTEGER PRIMARY KEY,
|
|
88
|
+
applied_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
-- Port allocations
|
|
92
|
+
CREATE TABLE IF NOT EXISTS port_allocations (
|
|
93
|
+
project_path TEXT PRIMARY KEY,
|
|
94
|
+
base_port INTEGER NOT NULL UNIQUE
|
|
95
|
+
CHECK(base_port >= 4200 AND base_port % 100 = 0),
|
|
96
|
+
pid INTEGER,
|
|
97
|
+
registered_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
98
|
+
last_used_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
CREATE INDEX IF NOT EXISTS idx_port_allocations_base_port ON port_allocations(base_port);
|
|
102
|
+
`;
|
|
103
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/agent-farm/db/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqE3B,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;CAkB5B,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* TypeScript interfaces matching the SQLite schema.
|
|
5
|
+
* These types represent the database row format.
|
|
6
|
+
*/
|
|
7
|
+
import type { Builder, ArchitectState, UtilTerminal, Annotation } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Database row type for architect table
|
|
10
|
+
*/
|
|
11
|
+
export interface DbArchitect {
|
|
12
|
+
id: number;
|
|
13
|
+
pid: number;
|
|
14
|
+
port: number;
|
|
15
|
+
cmd: string;
|
|
16
|
+
started_at: string;
|
|
17
|
+
tmux_session: string | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Database row type for builders table
|
|
21
|
+
*/
|
|
22
|
+
export interface DbBuilder {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
port: number;
|
|
26
|
+
pid: number;
|
|
27
|
+
status: string;
|
|
28
|
+
phase: string;
|
|
29
|
+
worktree: string;
|
|
30
|
+
branch: string;
|
|
31
|
+
tmux_session: string | null;
|
|
32
|
+
type: string;
|
|
33
|
+
task_text: string | null;
|
|
34
|
+
protocol_name: string | null;
|
|
35
|
+
started_at: string;
|
|
36
|
+
updated_at: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Database row type for utils table
|
|
40
|
+
*/
|
|
41
|
+
export interface DbUtil {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
port: number;
|
|
45
|
+
pid: number;
|
|
46
|
+
tmux_session: string | null;
|
|
47
|
+
started_at: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Database row type for annotations table
|
|
51
|
+
*/
|
|
52
|
+
export interface DbAnnotation {
|
|
53
|
+
id: string;
|
|
54
|
+
file: string;
|
|
55
|
+
port: number;
|
|
56
|
+
pid: number;
|
|
57
|
+
parent_type: string;
|
|
58
|
+
parent_id: string | null;
|
|
59
|
+
started_at: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Database row type for port_allocations table
|
|
63
|
+
*/
|
|
64
|
+
export interface DbPortAllocation {
|
|
65
|
+
project_path: string;
|
|
66
|
+
base_port: number;
|
|
67
|
+
pid: number | null;
|
|
68
|
+
registered_at: string;
|
|
69
|
+
last_used_at: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Convert database architect row to application type
|
|
73
|
+
*/
|
|
74
|
+
export declare function dbArchitectToArchitectState(row: DbArchitect): ArchitectState;
|
|
75
|
+
/**
|
|
76
|
+
* Convert database builder row to application type
|
|
77
|
+
*/
|
|
78
|
+
export declare function dbBuilderToBuilder(row: DbBuilder): Builder;
|
|
79
|
+
/**
|
|
80
|
+
* Convert database util row to application type
|
|
81
|
+
*/
|
|
82
|
+
export declare function dbUtilToUtilTerminal(row: DbUtil): UtilTerminal;
|
|
83
|
+
/**
|
|
84
|
+
* Convert database annotation row to application type
|
|
85
|
+
*/
|
|
86
|
+
export declare function dbAnnotationToAnnotation(row: DbAnnotation): Annotation;
|
|
87
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/db/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAe,MAAM,aAAa,CAAC;AAElG;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B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E,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,WAAW,GAAG,cAAc,CAQ5E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAe1D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAQ9D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAWtE"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Database Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* TypeScript interfaces matching the SQLite schema.
|
|
5
|
+
* These types represent the database row format.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Convert database architect row to application type
|
|
9
|
+
*/
|
|
10
|
+
export function dbArchitectToArchitectState(row) {
|
|
11
|
+
return {
|
|
12
|
+
pid: row.pid,
|
|
13
|
+
port: row.port,
|
|
14
|
+
cmd: row.cmd,
|
|
15
|
+
startedAt: row.started_at,
|
|
16
|
+
tmuxSession: row.tmux_session ?? undefined,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Convert database builder row to application type
|
|
21
|
+
*/
|
|
22
|
+
export function dbBuilderToBuilder(row) {
|
|
23
|
+
return {
|
|
24
|
+
id: row.id,
|
|
25
|
+
name: row.name,
|
|
26
|
+
port: row.port,
|
|
27
|
+
pid: row.pid,
|
|
28
|
+
status: row.status,
|
|
29
|
+
phase: row.phase,
|
|
30
|
+
worktree: row.worktree,
|
|
31
|
+
branch: row.branch,
|
|
32
|
+
tmuxSession: row.tmux_session ?? undefined,
|
|
33
|
+
type: row.type,
|
|
34
|
+
taskText: row.task_text ?? undefined,
|
|
35
|
+
protocolName: row.protocol_name ?? undefined,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Convert database util row to application type
|
|
40
|
+
*/
|
|
41
|
+
export function dbUtilToUtilTerminal(row) {
|
|
42
|
+
return {
|
|
43
|
+
id: row.id,
|
|
44
|
+
name: row.name,
|
|
45
|
+
port: row.port,
|
|
46
|
+
pid: row.pid,
|
|
47
|
+
tmuxSession: row.tmux_session ?? undefined,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Convert database annotation row to application type
|
|
52
|
+
*/
|
|
53
|
+
export function dbAnnotationToAnnotation(row) {
|
|
54
|
+
return {
|
|
55
|
+
id: row.id,
|
|
56
|
+
file: row.file,
|
|
57
|
+
port: row.port,
|
|
58
|
+
pid: row.pid,
|
|
59
|
+
parent: {
|
|
60
|
+
type: row.parent_type,
|
|
61
|
+
id: row.parent_id ?? undefined,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/agent-farm/db/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwEH;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,GAAgB;IAC1D,OAAO;QACL,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,SAAS,EAAE,GAAG,CAAC,UAAU;QACzB,WAAW,EAAE,GAAG,CAAC,YAAY,IAAI,SAAS;KAC3C,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAc;IAC/C,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,IAAI,EAAE,GAAG,CA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|
+
/**
|
|
3
|
+
* Agent Farm CLI
|
|
4
|
+
* A multi-agent orchestration tool for software development
|
|
5
|
+
*/
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import { start, stop } from './commands/index.js';
|
|
8
|
+
import { logger } from './utils/logger.js';
|
|
9
|
+
import { setCliOverrides, getResolvedCommands, initializePorts } from './utils/config.js';
|
|
10
|
+
const program = new Command();
|
|
11
|
+
program
|
|
12
|
+
.name('agent-farm')
|
|
13
|
+
.description('Multi-agent orchestration for software development')
|
|
14
|
+
.version('0.1.0');
|
|
15
|
+
// Global options for command overrides
|
|
16
|
+
program
|
|
17
|
+
.option('--architect-cmd <command>', 'Override architect command (takes precedence over config.json)')
|
|
18
|
+
.option('--builder-cmd <command>', 'Override builder command (takes precedence over config.json)')
|
|
19
|
+
.option('--shell-cmd <command>', 'Override shell command (takes precedence over config.json)');
|
|
20
|
+
// Process global options before commands
|
|
21
|
+
program.hook('preAction', (thisCommand) => {
|
|
22
|
+
const opts = thisCommand.opts();
|
|
23
|
+
const overrides = {};
|
|
24
|
+
if (opts.architectCmd)
|
|
25
|
+
overrides.architect = opts.architectCmd;
|
|
26
|
+
if (opts.builderCmd)
|
|
27
|
+
overrides.builder = opts.builderCmd;
|
|
28
|
+
if (opts.shellCmd)
|
|
29
|
+
overrides.shell = opts.shellCmd;
|
|
30
|
+
if (Object.keys(overrides).length > 0) {
|
|
31
|
+
setCliOverrides(overrides);
|
|
32
|
+
}
|
|
33
|
+
// Initialize port allocation for this project
|
|
34
|
+
initializePorts();
|
|
35
|
+
});
|
|
36
|
+
// Start command
|
|
37
|
+
program
|
|
38
|
+
.command('start')
|
|
39
|
+
.description('Start the architect dashboard')
|
|
40
|
+
.option('-c, --cmd <command>', 'Command to run in architect terminal (shorthand for --architect-cmd)')
|
|
41
|
+
.option('-p, --port <port>', 'Port for architect terminal')
|
|
42
|
+
.option('--no-role', 'Skip loading architect role prompt')
|
|
43
|
+
.action(async (options) => {
|
|
44
|
+
try {
|
|
45
|
+
// -c flag overrides config if provided (for backward compatibility)
|
|
46
|
+
const commands = getResolvedCommands();
|
|
47
|
+
await start({
|
|
48
|
+
cmd: options.cmd || commands.architect,
|
|
49
|
+
port: options.port ? parseInt(options.port, 10) : undefined,
|
|
50
|
+
noRole: !options.role,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
// Stop command
|
|
59
|
+
program
|
|
60
|
+
.command('stop')
|
|
61
|
+
.description('Stop all agent farm processes')
|
|
62
|
+
.action(async () => {
|
|
63
|
+
try {
|
|
64
|
+
await stop();
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
// Status command (placeholder)
|
|
72
|
+
program
|
|
73
|
+
.command('status')
|
|
74
|
+
.description('Show status of all agents')
|
|
75
|
+
.action(async () => {
|
|
76
|
+
const { status } = await import('./commands/status.js');
|
|
77
|
+
try {
|
|
78
|
+
await status();
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
// Spawn command
|
|
86
|
+
program
|
|
87
|
+
.command('spawn')
|
|
88
|
+
.description('Spawn a new builder in various modes')
|
|
89
|
+
.option('-p, --project <id>', 'Spawn builder for a spec (e.g., -p 0009)')
|
|
90
|
+
.option('--task <text>', 'Spawn builder with a task description')
|
|
91
|
+
.option('--protocol <name>', 'Spawn builder to run a protocol (e.g., cleanup)')
|
|
92
|
+
.option('--shell', 'Spawn a bare Claude session (no prompt, no worktree)')
|
|
93
|
+
.option('--worktree', 'Spawn worktree session (worktree+branch, no prompt)')
|
|
94
|
+
.option('--files <files>', 'Context files for task mode (comma-separated)')
|
|
95
|
+
.option('--no-role', 'Skip loading role prompt')
|
|
96
|
+
.addHelpText('after', `
|
|
97
|
+
Examples:
|
|
98
|
+
# Spec mode (existing behavior)
|
|
99
|
+
af spawn -p 0009 # Spawn for spec 0009
|
|
100
|
+
|
|
101
|
+
# Task mode (ad-hoc tasks)
|
|
102
|
+
af spawn --task "Fix the login bug" # Simple task
|
|
103
|
+
af spawn --task "Refactor auth" --files src/auth.ts,src/login.ts
|
|
104
|
+
|
|
105
|
+
# Protocol mode (run a protocol)
|
|
106
|
+
af spawn --protocol cleanup # Run cleanup protocol
|
|
107
|
+
af spawn --protocol experiment # Run experiment protocol
|
|
108
|
+
|
|
109
|
+
# Worktree mode (isolated branch, no prompt)
|
|
110
|
+
af spawn --worktree # Worktree for quick fixes
|
|
111
|
+
|
|
112
|
+
# Shell mode (bare session)
|
|
113
|
+
af spawn --shell # Just Claude, no prompt/worktree
|
|
114
|
+
`)
|
|
115
|
+
.action(async (options) => {
|
|
116
|
+
const { spawn } = await import('./commands/spawn.js');
|
|
117
|
+
try {
|
|
118
|
+
const files = options.files ? options.files.split(',').map((f) => f.trim()) : undefined;
|
|
119
|
+
await spawn({
|
|
120
|
+
project: options.project,
|
|
121
|
+
task: options.task,
|
|
122
|
+
protocol: options.protocol,
|
|
123
|
+
shell: options.shell,
|
|
124
|
+
worktree: options.worktree,
|
|
125
|
+
files,
|
|
126
|
+
noRole: !options.role,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
// Util/Shell command - spawns a utility terminal
|
|
135
|
+
program
|
|
136
|
+
.command('util')
|
|
137
|
+
.alias('shell')
|
|
138
|
+
.description('Spawn a utility shell terminal')
|
|
139
|
+
.option('-n, --name <name>', 'Name for the shell terminal')
|
|
140
|
+
.action(async (options) => {
|
|
141
|
+
const { util } = await import('./commands/util.js');
|
|
142
|
+
try {
|
|
143
|
+
await util({ name: options.name });
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
// Open command - opens file annotation viewer
|
|
151
|
+
program
|
|
152
|
+
.command('open <file>')
|
|
153
|
+
.description('Open file annotation viewer')
|
|
154
|
+
.action(async (file) => {
|
|
155
|
+
const { open } = await import('./commands/open.js');
|
|
156
|
+
try {
|
|
157
|
+
await open({ file });
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
161
|
+
process.exit(1);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
// Cleanup command - remove builder worktree and branch
|
|
165
|
+
program
|
|
166
|
+
.command('cleanup')
|
|
167
|
+
.description('Clean up a builder worktree and branch after PR merge')
|
|
168
|
+
.requiredOption('-p, --project <id>', 'Builder ID to clean up')
|
|
169
|
+
.option('-f, --force', 'Force cleanup even if branch not merged')
|
|
170
|
+
.action(async (options) => {
|
|
171
|
+
const { cleanup } = await import('./commands/cleanup.js');
|
|
172
|
+
try {
|
|
173
|
+
await cleanup({ project: options.project, force: options.force });
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
177
|
+
process.exit(1);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
// Rename command - rename a builder or utility terminal
|
|
181
|
+
program
|
|
182
|
+
.command('rename <id> <name>')
|
|
183
|
+
.description('Rename a builder or utility terminal')
|
|
184
|
+
.action(async (id, name) => {
|
|
185
|
+
const { rename } = await import('./commands/rename.js');
|
|
186
|
+
try {
|
|
187
|
+
rename({ id, name });
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
191
|
+
process.exit(1);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
// Send command - send instructions to running builders
|
|
195
|
+
program
|
|
196
|
+
.command('send [builder] [message]')
|
|
197
|
+
.description('Send instructions to a running builder')
|
|
198
|
+
.option('--all', 'Send to all builders')
|
|
199
|
+
.option('--file <path>', 'Include file content in message')
|
|
200
|
+
.option('--interrupt', 'Send Ctrl+C first to interrupt current activity')
|
|
201
|
+
.option('--raw', 'Skip structured message formatting')
|
|
202
|
+
.option('--no-enter', 'Do not send Enter after message')
|
|
203
|
+
.action(async (builder, message, options) => {
|
|
204
|
+
const { send } = await import('./commands/send.js');
|
|
205
|
+
try {
|
|
206
|
+
await send({
|
|
207
|
+
builder,
|
|
208
|
+
message,
|
|
209
|
+
all: options.all,
|
|
210
|
+
file: options.file,
|
|
211
|
+
interrupt: options.interrupt,
|
|
212
|
+
raw: options.raw,
|
|
213
|
+
noEnter: !options.enter,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
218
|
+
process.exit(1);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
// Ports command - manage global port registry
|
|
222
|
+
const portsCmd = program
|
|
223
|
+
.command('ports')
|
|
224
|
+
.description('Manage global port registry');
|
|
225
|
+
portsCmd
|
|
226
|
+
.command('list')
|
|
227
|
+
.description('List all port allocations')
|
|
228
|
+
.action(async () => {
|
|
229
|
+
const { listAllocations } = await import('./utils/port-registry.js');
|
|
230
|
+
const allocations = listAllocations();
|
|
231
|
+
if (allocations.length === 0) {
|
|
232
|
+
logger.info('No port allocations found.');
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
logger.header('Port Allocations');
|
|
236
|
+
for (const alloc of allocations) {
|
|
237
|
+
const status = alloc.exists ? '' : ' (missing)';
|
|
238
|
+
logger.info(`${alloc.basePort}-${alloc.basePort + 99}: ${alloc.path}${status}`);
|
|
239
|
+
}
|
|
240
|
+
});
|
|
241
|
+
portsCmd
|
|
242
|
+
.command('cleanup')
|
|
243
|
+
.description('Remove stale port allocations (deleted projects)')
|
|
244
|
+
.action(async () => {
|
|
245
|
+
const { cleanupStaleEntries } = await import('./utils/port-registry.js');
|
|
246
|
+
const result = cleanupStaleEntries();
|
|
247
|
+
if (result.removed.length === 0) {
|
|
248
|
+
logger.info('No stale entries found.');
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
logger.success(`Removed ${result.removed.length} stale entries:`);
|
|
252
|
+
for (const path of result.removed) {
|
|
253
|
+
logger.info(` - ${path}`);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
logger.info(`Remaining allocations: ${result.remaining}`);
|
|
257
|
+
});
|
|
258
|
+
// Tutorial command - interactive onboarding for new users
|
|
259
|
+
program
|
|
260
|
+
.command('tutorial')
|
|
261
|
+
.description('Interactive tutorial for new users')
|
|
262
|
+
.option('--reset', 'Start tutorial fresh')
|
|
263
|
+
.option('--skip', 'Skip current step')
|
|
264
|
+
.option('--status', 'Show tutorial progress')
|
|
265
|
+
.action(async (options) => {
|
|
266
|
+
const { tutorial } = await import('./commands/tutorial.js');
|
|
267
|
+
try {
|
|
268
|
+
await tutorial(options);
|
|
269
|
+
}
|
|
270
|
+
catch (error) {
|
|
271
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
272
|
+
process.exit(1);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
// Tower command - centralized view of all agent-farm instances
|
|
276
|
+
const towerCmd = program
|
|
277
|
+
.command('tower')
|
|
278
|
+
.description('Manage the tower dashboard showing all instances');
|
|
279
|
+
towerCmd
|
|
280
|
+
.command('start')
|
|
281
|
+
.description('Start the tower dashboard')
|
|
282
|
+
.option('-p, --port <port>', 'Port to run on (default: 4100)')
|
|
283
|
+
.action(async (options) => {
|
|
284
|
+
const { towerStart } = await import('./commands/tower.js');
|
|
285
|
+
try {
|
|
286
|
+
await towerStart({
|
|
287
|
+
port: options.port ? parseInt(options.port, 10) : undefined,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
292
|
+
process.exit(1);
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
towerCmd
|
|
296
|
+
.command('stop')
|
|
297
|
+
.description('Stop the tower dashboard')
|
|
298
|
+
.option('-p, --port <port>', 'Port to stop (default: 4100)')
|
|
299
|
+
.action(async (options) => {
|
|
300
|
+
const { towerStop } = await import('./commands/tower.js');
|
|
301
|
+
try {
|
|
302
|
+
await towerStop({
|
|
303
|
+
port: options.port ? parseInt(options.port, 10) : undefined,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
catch (error) {
|
|
307
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
308
|
+
process.exit(1);
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
// Database commands - debugging and maintenance
|
|
312
|
+
const dbCmd = program
|
|
313
|
+
.command('db')
|
|
314
|
+
.description('Database debugging and maintenance commands');
|
|
315
|
+
dbCmd
|
|
316
|
+
.command('dump')
|
|
317
|
+
.description('Export all tables to JSON')
|
|
318
|
+
.option('--global', 'Dump global.db instead of local state.db')
|
|
319
|
+
.action(async (options) => {
|
|
320
|
+
const { dbDump } = await import('./commands/db.js');
|
|
321
|
+
try {
|
|
322
|
+
dbDump({ global: options.global });
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
326
|
+
process.exit(1);
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
dbCmd
|
|
330
|
+
.command('query <sql>')
|
|
331
|
+
.description('Run a SELECT query against the database')
|
|
332
|
+
.option('--global', 'Query global.db instead of local state.db')
|
|
333
|
+
.action(async (sql, options) => {
|
|
334
|
+
const { dbQuery } = await import('./commands/db.js');
|
|
335
|
+
try {
|
|
336
|
+
dbQuery(sql, { global: options.global });
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
340
|
+
process.exit(1);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
dbCmd
|
|
344
|
+
.command('reset')
|
|
345
|
+
.description('Delete database and start fresh (DESTRUCTIVE)')
|
|
346
|
+
.option('--global', 'Reset global.db instead of local state.db')
|
|
347
|
+
.option('--force', 'Skip confirmation')
|
|
348
|
+
.action(async (options) => {
|
|
349
|
+
const { dbReset } = await import('./commands/db.js');
|
|
350
|
+
try {
|
|
351
|
+
dbReset({ global: options.global, force: options.force });
|
|
352
|
+
}
|
|
353
|
+
catch (error) {
|
|
354
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
355
|
+
process.exit(1);
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
dbCmd
|
|
359
|
+
.command('stats')
|
|
360
|
+
.description('Show database statistics')
|
|
361
|
+
.option('--global', 'Show stats for global.db')
|
|
362
|
+
.action(async (options) => {
|
|
363
|
+
const { dbStats } = await import('./commands/db.js');
|
|
364
|
+
try {
|
|
365
|
+
dbStats({ global: options.global });
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
369
|
+
process.exit(1);
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
program.parse();
|
|
373
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent-farm/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAa,eAAe,EAAE,mB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