@cluesmith/codev 3.0.2 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +44 -0
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/attach.d.ts.map +1 -1
- package/dist/agent-farm/commands/attach.js +2 -117
- package/dist/agent-farm/commands/attach.js.map +1 -1
- package/dist/agent-farm/commands/dev.d.ts +20 -0
- package/dist/agent-farm/commands/dev.d.ts.map +1 -0
- package/dist/agent-farm/commands/dev.js +124 -0
- package/dist/agent-farm/commands/dev.js.map +1 -0
- package/dist/agent-farm/commands/setup.d.ts +27 -0
- package/dist/agent-farm/commands/setup.d.ts.map +1 -0
- package/dist/agent-farm/commands/setup.js +55 -0
- package/dist/agent-farm/commands/setup.js.map +1 -0
- package/dist/agent-farm/commands/spawn-worktree.d.ts +21 -2
- package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.js +42 -4
- package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +30 -15
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/commands/status.d.ts.map +1 -1
- package/dist/agent-farm/commands/status.js +4 -1
- package/dist/agent-farm/commands/status.js.map +1 -1
- package/dist/agent-farm/commands/stop.d.ts.map +1 -1
- package/dist/agent-farm/commands/stop.js +15 -8
- package/dist/agent-farm/commands/stop.js.map +1 -1
- package/dist/agent-farm/commands/workspace-add-architect.d.ts +18 -0
- package/dist/agent-farm/commands/workspace-add-architect.d.ts.map +1 -0
- package/dist/agent-farm/commands/workspace-add-architect.js +54 -0
- package/dist/agent-farm/commands/workspace-add-architect.js.map +1 -0
- package/dist/agent-farm/db/index.d.ts.map +1 -1
- package/dist/agent-farm/db/index.js +54 -1
- package/dist/agent-farm/db/index.js.map +1 -1
- package/dist/agent-farm/db/migrate.js +2 -2
- package/dist/agent-farm/db/migrate.js.map +1 -1
- package/dist/agent-farm/db/schema.d.ts +1 -1
- package/dist/agent-farm/db/schema.d.ts.map +1 -1
- package/dist/agent-farm/db/schema.js +3 -2
- package/dist/agent-farm/db/schema.js.map +1 -1
- package/dist/agent-farm/db/types.d.ts +7 -2
- package/dist/agent-farm/db/types.d.ts.map +1 -1
- package/dist/agent-farm/db/types.js +2 -0
- package/dist/agent-farm/db/types.js.map +1 -1
- package/dist/agent-farm/lib/builder-lookup.d.ts +26 -0
- package/dist/agent-farm/lib/builder-lookup.d.ts.map +1 -0
- package/dist/agent-farm/lib/builder-lookup.js +103 -0
- package/dist/agent-farm/lib/builder-lookup.js.map +1 -0
- package/dist/agent-farm/servers/tower-instances.d.ts +20 -1
- package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-instances.js +260 -16
- package/dist/agent-farm/servers/tower-instances.js.map +1 -1
- package/dist/agent-farm/servers/tower-messages.d.ts +10 -1
- package/dist/agent-farm/servers/tower-messages.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-messages.js +137 -7
- package/dist/agent-farm/servers/tower-messages.js.map +1 -1
- package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-routes.js +97 -31
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts +17 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.js +78 -29
- package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.js +3 -2
- package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
- package/dist/agent-farm/servers/tower-types.d.ts +18 -6
- package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
- package/dist/agent-farm/state.d.ts +50 -4
- package/dist/agent-farm/state.d.ts.map +1 -1
- package/dist/agent-farm/state.js +118 -12
- package/dist/agent-farm/state.js.map +1 -1
- package/dist/agent-farm/types.d.ts +28 -0
- package/dist/agent-farm/types.d.ts.map +1 -1
- package/dist/agent-farm/utils/agent-names.d.ts +5 -30
- package/dist/agent-farm/utils/agent-names.d.ts.map +1 -1
- package/dist/agent-farm/utils/agent-names.js +5 -54
- package/dist/agent-farm/utils/agent-names.js.map +1 -1
- package/dist/agent-farm/utils/architect-name.d.ts +37 -0
- package/dist/agent-farm/utils/architect-name.d.ts.map +1 -0
- package/dist/agent-farm/utils/architect-name.js +63 -0
- package/dist/agent-farm/utils/architect-name.js.map +1 -0
- package/dist/agent-farm/utils/config.d.ts +19 -0
- package/dist/agent-farm/utils/config.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.js +16 -0
- package/dist/agent-farm/utils/config.js.map +1 -1
- package/dist/agent-farm/utils/git.d.ts +29 -0
- package/dist/agent-farm/utils/git.d.ts.map +1 -0
- package/dist/agent-farm/utils/git.js +38 -0
- package/dist/agent-farm/utils/git.js.map +1 -0
- package/dist/agent-farm/utils/shell.d.ts +13 -0
- package/dist/agent-farm/utils/shell.d.ts.map +1 -1
- package/dist/agent-farm/utils/shell.js +28 -0
- package/dist/agent-farm/utils/shell.js.map +1 -1
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +5 -0
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/consult/index.d.ts.map +1 -1
- package/dist/commands/consult/index.js +2 -0
- package/dist/commands/consult/index.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -0
- package/dist/commands/init.js.map +1 -1
- package/package.json +5 -5
- package/skeleton/protocols/air/builder-prompt.md +6 -0
- package/skeleton/protocols/air/consult-types/impl-review.md +6 -0
- package/skeleton/protocols/air/consult-types/pr-review.md +6 -0
- package/skeleton/protocols/air/prompts/implement.md +6 -0
- package/skeleton/protocols/air/protocol.md +4 -0
- package/skeleton/protocols/aspir/builder-prompt.md +19 -3
- package/skeleton/protocols/aspir/consult-types/plan-review.md +6 -0
- package/skeleton/protocols/aspir/consult-types/spec-review.md +6 -0
- package/skeleton/protocols/aspir/prompts/specify.md +6 -0
- package/skeleton/protocols/aspir/protocol.md +4 -0
- package/skeleton/protocols/bugfix/consult-types/impl-review.md +44 -37
- package/skeleton/protocols/bugfix/consult-types/pr-review.md +65 -40
- package/skeleton/protocols/spir/builder-prompt.md +19 -3
- package/skeleton/protocols/spir/consult-types/plan-review.md +6 -0
- package/skeleton/protocols/spir/consult-types/spec-review.md +6 -0
- package/skeleton/protocols/spir/prompts/specify.md +6 -0
- package/skeleton/protocols/spir/protocol.md +4 -0
package/dist/agent-farm/state.js
CHANGED
|
@@ -4,17 +4,29 @@
|
|
|
4
4
|
* Uses SQLite for ACID-compliant state persistence with proper concurrency handling.
|
|
5
5
|
* All operations are synchronous and atomic.
|
|
6
6
|
*/
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { existsSync } from 'node:fs';
|
|
9
|
+
import Database from 'better-sqlite3';
|
|
7
10
|
import { getDb, closeDb } from './db/index.js';
|
|
8
11
|
import { dbArchitectToArchitectState, dbBuilderToBuilder, dbUtilToUtilTerminal, dbAnnotationToAnnotation, } from './db/types.js';
|
|
9
12
|
import { isPortConflictError } from './db/errors.js';
|
|
10
13
|
/**
|
|
11
14
|
* Load complete state from database
|
|
12
|
-
*
|
|
15
|
+
*
|
|
16
|
+
* Spec 755: `DashboardState.architect` remains a scalar shape in v1. We load
|
|
17
|
+
* the architect named 'main' if present, otherwise the first registered
|
|
18
|
+
* architect (alphabetical by name). The /api/state contract is preserved so
|
|
19
|
+
* the dashboard and VSCode extension see no shape change. Multi-architect UI
|
|
20
|
+
* is deferred to issue #2 — see plan codev/plans/755-*.md.
|
|
13
21
|
*/
|
|
14
22
|
export function loadState() {
|
|
15
23
|
const db = getDb();
|
|
16
|
-
// Load architect (
|
|
17
|
-
|
|
24
|
+
// Load architect (Spec 755: scalar shim — prefer 'main', else the
|
|
25
|
+
// first-registered architect, ordered by started_at, not lexicographic name).
|
|
26
|
+
let architectRow = db.prepare("SELECT * FROM architect WHERE id = 'main'").get();
|
|
27
|
+
if (!architectRow) {
|
|
28
|
+
architectRow = db.prepare('SELECT * FROM architect ORDER BY started_at LIMIT 1').get();
|
|
29
|
+
}
|
|
18
30
|
const architect = architectRow ? dbArchitectToArchitectState(architectRow) : null;
|
|
19
31
|
// Load builders
|
|
20
32
|
const builderRows = db.prepare('SELECT * FROM builders ORDER BY started_at').all();
|
|
@@ -33,18 +45,23 @@ export function loadState() {
|
|
|
33
45
|
};
|
|
34
46
|
}
|
|
35
47
|
/**
|
|
36
|
-
* Update architect state
|
|
37
|
-
*
|
|
48
|
+
* Update architect state (main-only setter — preserved for backward-compat with
|
|
49
|
+
* existing callers like `workspace start` / `stop`). Spec 755 added per-name
|
|
50
|
+
* setters/getters below.
|
|
51
|
+
*
|
|
52
|
+
* If `architect` is provided with a non-default `name`, callers should use
|
|
53
|
+
* `setArchitectByName(name, architect)` instead — this function always
|
|
54
|
+
* writes the row with id = 'main'.
|
|
38
55
|
*/
|
|
39
56
|
export function setArchitect(architect) {
|
|
40
57
|
const db = getDb();
|
|
41
58
|
if (architect === null) {
|
|
42
|
-
db.prepare(
|
|
59
|
+
db.prepare("DELETE FROM architect WHERE id = 'main'").run();
|
|
43
60
|
}
|
|
44
61
|
else {
|
|
45
62
|
db.prepare(`
|
|
46
63
|
INSERT OR REPLACE INTO architect (id, pid, port, cmd, started_at, terminal_id)
|
|
47
|
-
VALUES (
|
|
64
|
+
VALUES ('main', 0, 0, @cmd, @startedAt, @terminalId)
|
|
48
65
|
`).run({
|
|
49
66
|
cmd: architect.cmd,
|
|
50
67
|
startedAt: architect.startedAt,
|
|
@@ -52,6 +69,27 @@ export function setArchitect(architect) {
|
|
|
52
69
|
});
|
|
53
70
|
}
|
|
54
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Update architect state by name (Spec 755). Used by the Phase 2 CLI for
|
|
74
|
+
* registering additional named architects. When `architect` is null, removes
|
|
75
|
+
* just that named architect; non-null upserts it.
|
|
76
|
+
*/
|
|
77
|
+
export function setArchitectByName(name, architect) {
|
|
78
|
+
const db = getDb();
|
|
79
|
+
if (architect === null) {
|
|
80
|
+
db.prepare('DELETE FROM architect WHERE id = ?').run(name);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
db.prepare(`
|
|
84
|
+
INSERT OR REPLACE INTO architect (id, pid, port, cmd, started_at, terminal_id)
|
|
85
|
+
VALUES (@name, 0, 0, @cmd, @startedAt, @terminalId)
|
|
86
|
+
`).run({
|
|
87
|
+
name,
|
|
88
|
+
cmd: architect.cmd,
|
|
89
|
+
startedAt: architect.startedAt,
|
|
90
|
+
terminalId: architect.terminalId ?? null,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
55
93
|
/**
|
|
56
94
|
* Add or update a builder
|
|
57
95
|
* Note: This is now synchronous
|
|
@@ -61,11 +99,11 @@ export function upsertBuilder(builder) {
|
|
|
61
99
|
db.prepare(`
|
|
62
100
|
INSERT INTO builders (
|
|
63
101
|
id, name, port, pid, status, phase, worktree, branch,
|
|
64
|
-
type, task_text, protocol_name, issue_number, terminal_id
|
|
102
|
+
type, task_text, protocol_name, issue_number, terminal_id, spawned_by_architect
|
|
65
103
|
)
|
|
66
104
|
VALUES (
|
|
67
105
|
@id, @name, 0, 0, @status, @phase, @worktree, @branch,
|
|
68
|
-
@type, @taskText, @protocolName, @issueNumber, @terminalId
|
|
106
|
+
@type, @taskText, @protocolName, @issueNumber, @terminalId, @spawnedByArchitect
|
|
69
107
|
)
|
|
70
108
|
ON CONFLICT(id) DO UPDATE SET
|
|
71
109
|
name = excluded.name,
|
|
@@ -77,7 +115,8 @@ export function upsertBuilder(builder) {
|
|
|
77
115
|
task_text = excluded.task_text,
|
|
78
116
|
protocol_name = excluded.protocol_name,
|
|
79
117
|
issue_number = excluded.issue_number,
|
|
80
|
-
terminal_id = excluded.terminal_id
|
|
118
|
+
terminal_id = excluded.terminal_id,
|
|
119
|
+
spawned_by_architect = COALESCE(excluded.spawned_by_architect, builders.spawned_by_architect)
|
|
81
120
|
`).run({
|
|
82
121
|
id: builder.id,
|
|
83
122
|
name: builder.name,
|
|
@@ -90,6 +129,7 @@ export function upsertBuilder(builder) {
|
|
|
90
129
|
protocolName: builder.protocolName ?? null,
|
|
91
130
|
issueNumber: builder.issueNumber != null ? String(builder.issueNumber) : null,
|
|
92
131
|
terminalId: builder.terminalId ?? null,
|
|
132
|
+
spawnedByArchitect: builder.spawnedByArchitect ?? null,
|
|
93
133
|
});
|
|
94
134
|
}
|
|
95
135
|
/**
|
|
@@ -245,13 +285,79 @@ export function clearState() {
|
|
|
245
285
|
clear();
|
|
246
286
|
}
|
|
247
287
|
/**
|
|
248
|
-
* Get architect state
|
|
288
|
+
* Get architect state (main-only — Spec 755 scalar shim).
|
|
289
|
+
* Returns the architect named 'main' if present, otherwise the first
|
|
290
|
+
* registered architect by name. For multi-architect access, use
|
|
291
|
+
* `getArchitects()` or `getArchitectByName(name)` below.
|
|
249
292
|
*/
|
|
250
293
|
export function getArchitect() {
|
|
251
294
|
const db = getDb();
|
|
252
|
-
|
|
295
|
+
let row = db.prepare("SELECT * FROM architect WHERE id = 'main'").get();
|
|
296
|
+
if (!row) {
|
|
297
|
+
// Spec 755: when 'main' is absent, fall back to the first-registered
|
|
298
|
+
// architect (started_at ordering), not the lexicographically-first name.
|
|
299
|
+
row = db.prepare('SELECT * FROM architect ORDER BY started_at LIMIT 1').get();
|
|
300
|
+
}
|
|
301
|
+
return row ? dbArchitectToArchitectState(row) : null;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Get all architects (Spec 755).
|
|
305
|
+
*/
|
|
306
|
+
export function getArchitects() {
|
|
307
|
+
const db = getDb();
|
|
308
|
+
const rows = db.prepare('SELECT * FROM architect ORDER BY id').all();
|
|
309
|
+
return rows.map(dbArchitectToArchitectState);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Get a single architect by name (Spec 755).
|
|
313
|
+
*/
|
|
314
|
+
export function getArchitectByName(name) {
|
|
315
|
+
const db = getDb();
|
|
316
|
+
const row = db.prepare('SELECT * FROM architect WHERE id = ?').get(name);
|
|
253
317
|
return row ? dbArchitectToArchitectState(row) : null;
|
|
254
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* Look up a builder's spawning-architect name (Spec 755).
|
|
321
|
+
*
|
|
322
|
+
* Returns:
|
|
323
|
+
* - `string` — the recorded `spawned_by_architect` (builder context with explicit name)
|
|
324
|
+
* - `null` — a row exists for that builder ID but `spawned_by_architect` is NULL (legacy row)
|
|
325
|
+
* - `undefined` — no row exists for that ID (not a builder)
|
|
326
|
+
*
|
|
327
|
+
* This three-valued return cleanly distinguishes "legacy builder" from
|
|
328
|
+
* "non-builder sender." Used by the Phase 3 affinity-aware resolver.
|
|
329
|
+
*
|
|
330
|
+
* When `workspacePath` is supplied, opens a per-workspace readonly handle
|
|
331
|
+
* directly — the right thing for Tower, which serves multiple workspaces
|
|
332
|
+
* and cannot rely on the singleton `getDb()` (which is tied to the process's
|
|
333
|
+
* startup CWD). When omitted, falls back to the singleton — convenient for
|
|
334
|
+
* CLI callers that already ran inside one workspace. Mirrors the pattern in
|
|
335
|
+
* `servers/overview.ts`.
|
|
336
|
+
*/
|
|
337
|
+
export function lookupBuilderSpawningArchitect(builderId, workspacePath) {
|
|
338
|
+
if (workspacePath) {
|
|
339
|
+
const dbPath = path.join(workspacePath, '.agent-farm', 'state.db');
|
|
340
|
+
if (!existsSync(dbPath))
|
|
341
|
+
return undefined;
|
|
342
|
+
const wsDb = new Database(dbPath, { readonly: true });
|
|
343
|
+
try {
|
|
344
|
+
const row = wsDb
|
|
345
|
+
.prepare('SELECT spawned_by_architect FROM builders WHERE id = ?')
|
|
346
|
+
.get(builderId);
|
|
347
|
+
if (!row)
|
|
348
|
+
return undefined;
|
|
349
|
+
return row.spawned_by_architect;
|
|
350
|
+
}
|
|
351
|
+
finally {
|
|
352
|
+
wsDb.close();
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
const db = getDb();
|
|
356
|
+
const row = db.prepare('SELECT spawned_by_architect FROM builders WHERE id = ?').get(builderId);
|
|
357
|
+
if (!row)
|
|
358
|
+
return undefined;
|
|
359
|
+
return row.spawned_by_architect;
|
|
360
|
+
}
|
|
255
361
|
// Re-export closeDb for cleanup
|
|
256
362
|
export { closeDb };
|
|
257
363
|
//# sourceMappingURL=state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/agent-farm/state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/agent-farm/state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IAEnB,kEAAkE;IAClE,8EAA8E;IAC9E,IAAI,YAAY,GAAG,EAAE,CAAC,OAAO,CAAC,2CAA2C,CAAC,CAAC,GAAG,EAA6B,CAAC;IAC5G,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,YAAY,GAAG,EAAE,CAAC,OAAO,CAAC,qDAAqD,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AO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -14,6 +14,7 @@ export interface Builder {
|
|
|
14
14
|
protocolName?: string;
|
|
15
15
|
issueNumber?: number | string;
|
|
16
16
|
terminalId?: string;
|
|
17
|
+
spawnedByArchitect?: string;
|
|
17
18
|
}
|
|
18
19
|
export interface UtilTerminal {
|
|
19
20
|
id: string;
|
|
@@ -30,6 +31,7 @@ export interface Annotation {
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
export interface ArchitectState {
|
|
34
|
+
name: string;
|
|
33
35
|
cmd: string;
|
|
34
36
|
startedAt: string;
|
|
35
37
|
terminalId?: string;
|
|
@@ -147,6 +149,32 @@ export interface UserConfig {
|
|
|
147
149
|
};
|
|
148
150
|
/** Forge concept command overrides. Keys are concept names, values are command strings or null (disabled). */
|
|
149
151
|
forge?: Record<string, string | null>;
|
|
152
|
+
/**
|
|
153
|
+
* Runnable worktree setup. Opt-in — when omitted, builders spawn with only
|
|
154
|
+
* the existing root `.env` + `.codev/config.json` symlinks (zero behavior change).
|
|
155
|
+
*/
|
|
156
|
+
worktree?: {
|
|
157
|
+
/**
|
|
158
|
+
* Glob patterns of files to symlink from the workspace root into each new
|
|
159
|
+
* worktree. Resolved at spawn time relative to the workspace root.
|
|
160
|
+
* Example values: '.env.local', 'packages/<any>/.env', 'turbo.json'.
|
|
161
|
+
* Note: root `.env` and `.codev/config.json` are always symlinked regardless.
|
|
162
|
+
*/
|
|
163
|
+
symlinks?: string[];
|
|
164
|
+
/**
|
|
165
|
+
* Shell commands to run inside each new worktree after `createWorktree`
|
|
166
|
+
* completes. Executed sequentially with cwd = worktree path. A non-zero
|
|
167
|
+
* exit aborts the spawn.
|
|
168
|
+
* Example: ['pnpm install --frozen-lockfile'].
|
|
169
|
+
*/
|
|
170
|
+
postSpawn?: string[];
|
|
171
|
+
/**
|
|
172
|
+
* Command consumed by `afx dev <builder-id>` to start the worktree's dev
|
|
173
|
+
* server. Required for `afx dev` to work.
|
|
174
|
+
* Example: 'pnpm dev'.
|
|
175
|
+
*/
|
|
176
|
+
devCommand?: string;
|
|
177
|
+
};
|
|
150
178
|
}
|
|
151
179
|
/**
|
|
152
180
|
* Resolved shell commands (after processing config hierarchy)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent-farm/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEzF,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,IAAI,GAAG,UAAU,CAAC;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent-farm/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEzF,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,IAAI,GAAG,UAAU,CAAC;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM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AC,EAAE;QACT,OAAO,CAAC,EAAE,UAAU,CAAC;KACtB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;KAC/B,CAAC;IACF,8GAA8G;IAC9G,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,EAAE;QACT;;;;;WAKG;QACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB;;;;;WAKG;QACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB;;;;WAIG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -8,19 +8,13 @@
|
|
|
8
8
|
* Branch name: builder/{protocol}-{id}[-{slug}]
|
|
9
9
|
*
|
|
10
10
|
* All names are stored and compared in lowercase per spec.
|
|
11
|
-
*/
|
|
12
|
-
import type { Builder, BuilderType } from '../types.js';
|
|
13
|
-
/**
|
|
14
|
-
* Strip leading zeros from a numeric ID string.
|
|
15
|
-
* Non-numeric IDs are returned unchanged.
|
|
16
11
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* '0' → '0'
|
|
21
|
-
* 'AbCd' → 'AbCd'
|
|
12
|
+
* `stripLeadingZeros` and `resolveAgentName` live in codev-core so the
|
|
13
|
+
* VS Code extension can use the same matching semantics; we re-export
|
|
14
|
+
* them here so existing agent-farm callsites are unaffected.
|
|
22
15
|
*/
|
|
23
|
-
|
|
16
|
+
import type { BuilderType } from '../types.js';
|
|
17
|
+
export { stripLeadingZeros, resolveAgentName } from '@cluesmith/codev-core/agent-names';
|
|
24
18
|
/**
|
|
25
19
|
* Build a canonical agent name from builder type and ID.
|
|
26
20
|
* Returns lowercase with leading zeros stripped from numeric IDs.
|
|
@@ -63,23 +57,4 @@ export declare function parseAddress(target: string): {
|
|
|
63
57
|
project?: string;
|
|
64
58
|
agent: string;
|
|
65
59
|
};
|
|
66
|
-
/**
|
|
67
|
-
* Resolve an agent name against a list of builders using case-insensitive
|
|
68
|
-
* matching with tail-match fallback.
|
|
69
|
-
*
|
|
70
|
-
* Resolution order:
|
|
71
|
-
* 1. Exact match (case-insensitive): 'builder-spir-109' matches 'builder-spir-109'
|
|
72
|
-
* 2. Tail match: bare ID matches the trailing segment of builder-{protocol}-{id}.
|
|
73
|
-
* E.g., '109' matches 'builder-spir-109' because the name ends with '-109'.
|
|
74
|
-
* Leading zeros are stripped before comparison: '0109' → '109'.
|
|
75
|
-
* Also handles partial names: 'bugfix-42' matches 'builder-bugfix-42'.
|
|
76
|
-
* 3. Returns null if no match found or multiple ambiguous tail matches.
|
|
77
|
-
*
|
|
78
|
-
* @returns { builder, ambiguous? } — builder is the matched Builder or null.
|
|
79
|
-
* If ambiguous, candidates are provided for error messaging.
|
|
80
|
-
*/
|
|
81
|
-
export declare function resolveAgentName(target: string, builders: Builder[]): {
|
|
82
|
-
builder: Builder | null;
|
|
83
|
-
ambiguous?: Builder[];
|
|
84
|
-
};
|
|
85
60
|
//# sourceMappingURL=agent-names.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-names.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/agent-names.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-names.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/agent-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGxF;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAwBvF;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAKpF;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAShF"}
|
|
@@ -8,23 +8,13 @@
|
|
|
8
8
|
* Branch name: builder/{protocol}-{id}[-{slug}]
|
|
9
9
|
*
|
|
10
10
|
* All names are stored and compared in lowercase per spec.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Strip leading zeros from a numeric ID string.
|
|
14
|
-
* Non-numeric IDs are returned unchanged.
|
|
15
11
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* '0' → '0'
|
|
20
|
-
* 'AbCd' → 'AbCd'
|
|
12
|
+
* `stripLeadingZeros` and `resolveAgentName` live in codev-core so the
|
|
13
|
+
* VS Code extension can use the same matching semantics; we re-export
|
|
14
|
+
* them here so existing agent-farm callsites are unaffected.
|
|
21
15
|
*/
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
return String(Number(id));
|
|
25
|
-
}
|
|
26
|
-
return id;
|
|
27
|
-
}
|
|
16
|
+
export { stripLeadingZeros, resolveAgentName } from '@cluesmith/codev-core/agent-names';
|
|
17
|
+
import { stripLeadingZeros } from '@cluesmith/codev-core/agent-names';
|
|
28
18
|
/**
|
|
29
19
|
* Build a canonical agent name from builder type and ID.
|
|
30
20
|
* Returns lowercase with leading zeros stripped from numeric IDs.
|
|
@@ -98,43 +88,4 @@ export function parseAddress(target) {
|
|
|
98
88
|
}
|
|
99
89
|
return { agent: target.toLowerCase() };
|
|
100
90
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Resolve an agent name against a list of builders using case-insensitive
|
|
103
|
-
* matching with tail-match fallback.
|
|
104
|
-
*
|
|
105
|
-
* Resolution order:
|
|
106
|
-
* 1. Exact match (case-insensitive): 'builder-spir-109' matches 'builder-spir-109'
|
|
107
|
-
* 2. Tail match: bare ID matches the trailing segment of builder-{protocol}-{id}.
|
|
108
|
-
* E.g., '109' matches 'builder-spir-109' because the name ends with '-109'.
|
|
109
|
-
* Leading zeros are stripped before comparison: '0109' → '109'.
|
|
110
|
-
* Also handles partial names: 'bugfix-42' matches 'builder-bugfix-42'.
|
|
111
|
-
* 3. Returns null if no match found or multiple ambiguous tail matches.
|
|
112
|
-
*
|
|
113
|
-
* @returns { builder, ambiguous? } — builder is the matched Builder or null.
|
|
114
|
-
* If ambiguous, candidates are provided for error messaging.
|
|
115
|
-
*/
|
|
116
|
-
export function resolveAgentName(target, builders) {
|
|
117
|
-
const originalTarget = target.toLowerCase();
|
|
118
|
-
const strippedTarget = stripLeadingZeros(target).toLowerCase();
|
|
119
|
-
// 1. Exact match (case-insensitive) — try original first, then stripped
|
|
120
|
-
const exact = builders.find(b => {
|
|
121
|
-
const id = b.id.toLowerCase();
|
|
122
|
-
return id === originalTarget || id === strippedTarget;
|
|
123
|
-
});
|
|
124
|
-
if (exact)
|
|
125
|
-
return { builder: exact };
|
|
126
|
-
// 2. Tail match: check if any builder ID ends with -{strippedTarget}
|
|
127
|
-
const tailMatches = builders.filter(b => {
|
|
128
|
-
const builderId = b.id.toLowerCase();
|
|
129
|
-
// Check if the builder ID ends with the target as a tail segment
|
|
130
|
-
// e.g., builder-spir-109 ends with -109, -spir-109
|
|
131
|
-
return builderId.endsWith(`-${strippedTarget}`);
|
|
132
|
-
});
|
|
133
|
-
if (tailMatches.length === 1)
|
|
134
|
-
return { builder: tailMatches[0] };
|
|
135
|
-
if (tailMatches.length > 1)
|
|
136
|
-
return { builder: null, ambiguous: tailMatches };
|
|
137
|
-
// 3. No match
|
|
138
|
-
return { builder: null };
|
|
139
|
-
}
|
|
140
91
|
//# sourceMappingURL=agent-names.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-names.js","sourceRoot":"","sources":["../../../src/agent-farm/utils/agent-names.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"agent-names.js","sourceRoot":"","sources":["../../../src/agent-farm/utils/agent-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,IAAiB,EAAE,EAAU,EAAE,QAAiB;IAC7E,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAEzC,iCAAiC;IACjC,IAAI,eAAuB,CAAC;IAC5B,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,MAAM;YACT,eAAe,GAAG,QAAQ,IAAI,MAAM,CAAC;YACrC,MAAM;QACR,KAAK,QAAQ;YACX,eAAe,GAAG,QAA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forces the [a-z][a-z0-9-]* rule with a 64-char cap.
|
|
5
|
+
* - autoNumberArchitectName: returns the next available `architect-<N>` name
|
|
6
|
+
* (smallest unused integer ≥ 2) given the set of already-registered names.
|
|
7
|
+
*
|
|
8
|
+
* Both functions are pure — they don't read process state or Tower; the caller
|
|
9
|
+
* is responsible for sourcing the existing-names set. Keeping them pure makes
|
|
10
|
+
* them trivially unit-testable.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ARCHITECT_NAME_PATTERN: RegExp;
|
|
13
|
+
export declare const MAX_ARCHITECT_NAME_LENGTH = 64;
|
|
14
|
+
/** Reserved default for the singleton case. */
|
|
15
|
+
export declare const DEFAULT_ARCHITECT_NAME = "main";
|
|
16
|
+
/**
|
|
17
|
+
* Validate an architect name. Returns `null` if valid, or a human-readable
|
|
18
|
+
* error message otherwise. Callers should treat a non-null return as "reject
|
|
19
|
+
* with this message" — the text is intentionally operator-facing.
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateArchitectName(name: string): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* Compute the next auto-numbered architect name, given the set of names
|
|
24
|
+
* already in use. Uses "smallest unused integer ≥ 2" semantics:
|
|
25
|
+
*
|
|
26
|
+
* - {} → 'architect-2'
|
|
27
|
+
* - {'main'} → 'architect-2'
|
|
28
|
+
* - {'main', 'architect-2'} → 'architect-3'
|
|
29
|
+
* - {'main', 'architect-3'} → 'architect-2' (fills the gap)
|
|
30
|
+
* - {'main', 'architect-2', 'architect-3'} → 'architect-4'
|
|
31
|
+
* - {'main', 'sibling'} → 'architect-2' (custom names don't shift numbering)
|
|
32
|
+
*
|
|
33
|
+
* Custom names (anything not matching `architect-<N>` exactly) are ignored
|
|
34
|
+
* by the numbering loop — they're not part of the auto-numbered sequence.
|
|
35
|
+
*/
|
|
36
|
+
export declare function autoNumberArchitectName(existingNames: Iterable<string>): string;
|
|
37
|
+
//# sourceMappingURL=architect-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architect-name.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/architect-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,sBAAsB,QAAsB,CAAC;AAC1D,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,+CAA+C;AAC/C,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWjE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAc/E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Architect-name utilities (Spec 755).
|
|
3
|
+
*
|
|
4
|
+
* - validateArchitectName: enforces the [a-z][a-z0-9-]* rule with a 64-char cap.
|
|
5
|
+
* - autoNumberArchitectName: returns the next available `architect-<N>` name
|
|
6
|
+
* (smallest unused integer ≥ 2) given the set of already-registered names.
|
|
7
|
+
*
|
|
8
|
+
* Both functions are pure — they don't read process state or Tower; the caller
|
|
9
|
+
* is responsible for sourcing the existing-names set. Keeping them pure makes
|
|
10
|
+
* them trivially unit-testable.
|
|
11
|
+
*/
|
|
12
|
+
export const ARCHITECT_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
13
|
+
export const MAX_ARCHITECT_NAME_LENGTH = 64;
|
|
14
|
+
/** Reserved default for the singleton case. */
|
|
15
|
+
export const DEFAULT_ARCHITECT_NAME = 'main';
|
|
16
|
+
/**
|
|
17
|
+
* Validate an architect name. Returns `null` if valid, or a human-readable
|
|
18
|
+
* error message otherwise. Callers should treat a non-null return as "reject
|
|
19
|
+
* with this message" — the text is intentionally operator-facing.
|
|
20
|
+
*/
|
|
21
|
+
export function validateArchitectName(name) {
|
|
22
|
+
if (!name) {
|
|
23
|
+
return 'Architect name cannot be empty.';
|
|
24
|
+
}
|
|
25
|
+
if (name.length > MAX_ARCHITECT_NAME_LENGTH) {
|
|
26
|
+
return `Architect name must be at most ${MAX_ARCHITECT_NAME_LENGTH} characters (got ${name.length}).`;
|
|
27
|
+
}
|
|
28
|
+
if (!ARCHITECT_NAME_PATTERN.test(name)) {
|
|
29
|
+
return `Architect name '${name}' is invalid. Names must match [a-z][a-z0-9-]* (lowercase letter, then lowercase letters / digits / dashes).`;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Compute the next auto-numbered architect name, given the set of names
|
|
35
|
+
* already in use. Uses "smallest unused integer ≥ 2" semantics:
|
|
36
|
+
*
|
|
37
|
+
* - {} → 'architect-2'
|
|
38
|
+
* - {'main'} → 'architect-2'
|
|
39
|
+
* - {'main', 'architect-2'} → 'architect-3'
|
|
40
|
+
* - {'main', 'architect-3'} → 'architect-2' (fills the gap)
|
|
41
|
+
* - {'main', 'architect-2', 'architect-3'} → 'architect-4'
|
|
42
|
+
* - {'main', 'sibling'} → 'architect-2' (custom names don't shift numbering)
|
|
43
|
+
*
|
|
44
|
+
* Custom names (anything not matching `architect-<N>` exactly) are ignored
|
|
45
|
+
* by the numbering loop — they're not part of the auto-numbered sequence.
|
|
46
|
+
*/
|
|
47
|
+
export function autoNumberArchitectName(existingNames) {
|
|
48
|
+
const usedNumbers = new Set();
|
|
49
|
+
for (const name of existingNames) {
|
|
50
|
+
const match = /^architect-(\d+)$/.exec(name);
|
|
51
|
+
if (match) {
|
|
52
|
+
const n = Number.parseInt(match[1], 10);
|
|
53
|
+
if (Number.isFinite(n) && n >= 2) {
|
|
54
|
+
usedNumbers.add(n);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
let n = 2;
|
|
59
|
+
while (usedNumbers.has(n))
|
|
60
|
+
n++;
|
|
61
|
+
return `architect-${n}`;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=archit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B,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QAAE,CAAC,EAAE,CAAC;IAC/B,OAAO,aAAa,CAAC,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -38,6 +38,25 @@ export declare function getArchitectHarness(workspaceRoot?: string): HarnessProv
|
|
|
38
38
|
* Resolution: explicit builderHarness → auto-detect from builder command → default claude.
|
|
39
39
|
*/
|
|
40
40
|
export declare function getBuilderHarness(workspaceRoot?: string): HarnessProvider;
|
|
41
|
+
/**
|
|
42
|
+
* Resolved view of the `worktree` config block with defaults applied.
|
|
43
|
+
* Unset fields collapse to empty / null so callers don't have to branch.
|
|
44
|
+
*/
|
|
45
|
+
export interface ResolvedWorktreeConfig {
|
|
46
|
+
/** Glob patterns to symlink from workspace root into each worktree. `[]` when unset. */
|
|
47
|
+
symlinks: string[];
|
|
48
|
+
/** Shell commands to run in each worktree after creation. `[]` when unset. */
|
|
49
|
+
postSpawn: string[];
|
|
50
|
+
/** Command for `afx dev <builder-id>`. `null` when unset. */
|
|
51
|
+
devCommand: string | null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Load the `worktree` block from .codev/config.json, applying defaults.
|
|
55
|
+
* Unconfigured repos get `{ symlinks: [], postSpawn: [], devCommand: null }`
|
|
56
|
+
* — equivalent to the pre-#689 behavior (no glob symlinks, no post-spawn
|
|
57
|
+
* commands, `afx dev` errors with a clear message pointing at the config).
|
|
58
|
+
*/
|
|
59
|
+
export declare function getWorktreeConfig(workspaceRoot?: string): ResolvedWorktreeConfig;
|
|
41
60
|
/**
|
|
42
61
|
* Build configuration for the current project
|
|
43
62
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/agent-farm/utils/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,MAA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GAAG,MAAM,CAuCnE;AA8GD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAE1E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAY5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,eAAe,CAS3E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,eAAe,CASzE;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,wFAAwF;IACxF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,sBAAsB,CAShF;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAelC;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWrE;AAGD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,CAAC"}
|
|
@@ -227,6 +227,22 @@ export function getBuilderHarness(workspaceRoot) {
|
|
|
227
227
|
const builderCmd = resolveCommand(userConfig?.shell?.builder, DEFAULT_COMMANDS.builder);
|
|
228
228
|
return resolveHarness(userConfig?.shell?.builderHarness, userConfig?.harness, builderCmd);
|
|
229
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Load the `worktree` block from .codev/config.json, applying defaults.
|
|
232
|
+
* Unconfigured repos get `{ symlinks: [], postSpawn: [], devCommand: null }`
|
|
233
|
+
* — equivalent to the pre-#689 behavior (no glob symlinks, no post-spawn
|
|
234
|
+
* commands, `afx dev` errors with a clear message pointing at the config).
|
|
235
|
+
*/
|
|
236
|
+
export function getWorktreeConfig(workspaceRoot) {
|
|
237
|
+
const root = workspaceRoot || findWorkspaceRoot();
|
|
238
|
+
const userConfig = loadUserConfig(root);
|
|
239
|
+
const w = userConfig?.worktree;
|
|
240
|
+
return {
|
|
241
|
+
symlinks: w?.symlinks ?? [],
|
|
242
|
+
postSpawn: w?.postSpawn ?? [],
|
|
243
|
+
devCommand: w?.devCommand ?? null,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
230
246
|
/**
|
|
231
247
|
* Build configuration for the current project
|
|
232
248
|
*/
|