@detergent-software/conductor 3.0.0-dev.2 → 3.0.0-dev.20
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/CHANGELOG.md +161 -0
- package/README.md +154 -42
- package/build/brief-cli.js +1 -1
- package/build/brief-cli.js.map +1 -1
- package/build/broker-cli.js +24 -25
- package/build/broker-cli.js.map +1 -1
- package/build/broker.js +66 -92
- package/build/broker.js.map +1 -1
- package/build/claude.js +50 -7
- package/build/claude.js.map +1 -1
- package/build/cli.js +119 -54
- package/build/cli.js.map +1 -1
- package/build/clones.js +92 -0
- package/build/clones.js.map +1 -0
- package/build/code-host-cli.js +95 -22
- package/build/code-host-cli.js.map +1 -1
- package/build/code-host.js +13 -8
- package/build/code-host.js.map +1 -1
- package/build/config.js +31 -12
- package/build/config.js.map +1 -1
- package/build/console.js +40 -24
- package/build/console.js.map +1 -1
- package/build/credentials.js +26 -24
- package/build/credentials.js.map +1 -1
- package/build/daemon.js +35 -21
- package/build/daemon.js.map +1 -1
- package/build/help.js +138 -28
- package/build/help.js.map +1 -1
- package/build/host/credential-manager.js +109 -0
- package/build/host/credential-manager.js.map +1 -0
- package/build/host/keychain.js +44 -0
- package/build/host/keychain.js.map +1 -0
- package/build/host/libsecret.js +40 -0
- package/build/host/libsecret.js.map +1 -0
- package/build/host/macos-terminal.js +63 -0
- package/build/host/macos-terminal.js.map +1 -0
- package/build/host/platform.js +4 -0
- package/build/host/platform.js.map +1 -0
- package/build/host/secrets.js +46 -0
- package/build/host/secrets.js.map +1 -0
- package/build/host/shell.js +26 -0
- package/build/host/shell.js.map +1 -0
- package/build/host/terminal.js +46 -0
- package/build/host/terminal.js.map +1 -0
- package/build/host/tmux.js +39 -0
- package/build/host/tmux.js.map +1 -0
- package/build/host/windows-terminal.js +46 -0
- package/build/host/windows-terminal.js.map +1 -0
- package/build/in-process.js +6 -5
- package/build/in-process.js.map +1 -1
- package/build/inbox.js +50 -5
- package/build/inbox.js.map +1 -1
- package/build/init.js +508 -0
- package/build/init.js.map +1 -0
- package/build/lib/providers/ado/pipelines.js +79 -13
- package/build/lib/providers/ado/pipelines.js.map +1 -1
- package/build/lib/providers/github/actions.js +85 -2
- package/build/lib/providers/github/actions.js.map +1 -1
- package/build/lib/providers/index.js +2 -1
- package/build/lib/providers/index.js.map +1 -1
- package/build/lib/providers/npm/stage.js +14 -4
- package/build/lib/providers/npm/stage.js.map +1 -1
- package/build/lib/providers/timing.js +10 -0
- package/build/lib/providers/timing.js.map +1 -0
- package/build/local-files.js +95 -0
- package/build/local-files.js.map +1 -0
- package/build/manager.js +171 -47
- package/build/manager.js.map +1 -1
- package/build/note.js +1 -1
- package/build/note.js.map +1 -1
- package/build/npm-reads.js +323 -0
- package/build/npm-reads.js.map +1 -0
- package/build/paths.js +44 -1
- package/build/paths.js.map +1 -1
- package/build/plugin.js +10 -0
- package/build/plugin.js.map +1 -1
- package/build/profile-fields.js +149 -0
- package/build/profile-fields.js.map +1 -0
- package/build/profile-layers.js +264 -0
- package/build/profile-layers.js.map +1 -0
- package/build/profile.js +60 -38
- package/build/profile.js.map +1 -1
- package/build/project-check-cli.js +18 -10
- package/build/project-check-cli.js.map +1 -1
- package/build/project-check.js +179 -97
- package/build/project-check.js.map +1 -1
- package/build/pushover.js +5 -5
- package/build/pushover.js.map +1 -1
- package/build/registry.js +195 -36
- package/build/registry.js.map +1 -1
- package/build/rule-actions.js +3 -1
- package/build/rule-actions.js.map +1 -1
- package/build/rules-service.js +101 -44
- package/build/rules-service.js.map +1 -1
- package/build/rules.js +11 -2
- package/build/rules.js.map +1 -1
- package/build/runs.js +49 -0
- package/build/runs.js.map +1 -1
- package/build/scheduler.js +11 -1
- package/build/scheduler.js.map +1 -1
- package/build/server.js +3 -24
- package/build/server.js.map +1 -1
- package/build/spend.js +4 -0
- package/build/spend.js.map +1 -1
- package/build/store.js +82 -25
- package/build/store.js.map +1 -1
- package/build/timeline.js +104 -0
- package/build/timeline.js.map +1 -0
- package/build/tracker-reads-cli.js +4 -5
- package/build/tracker-reads-cli.js.map +1 -1
- package/build/train-cli.js +6 -5
- package/build/train-cli.js.map +1 -1
- package/build/upgrade.js +16 -1
- package/build/upgrade.js.map +1 -1
- package/build/wait.js +6 -6
- package/build/wait.js.map +1 -1
- package/build/watchers/ado.js +3 -2
- package/build/watchers/ado.js.map +1 -1
- package/build/watchers/github.js +3 -2
- package/build/watchers/github.js.map +1 -1
- package/build/watchers/npm.js +6 -4
- package/build/watchers/npm.js.map +1 -1
- package/build/worktrees.js +199 -92
- package/build/worktrees.js.map +1 -1
- package/package.json +61 -61
- package/plugin/skills/conductor-console/SKILL.md +3 -3
- package/plugin/skills/work-item/SKILL.md +5 -3
- package/build/checkout-sync.js +0 -249
- package/build/checkout-sync.js.map +0 -1
- package/build/credential.js +0 -66
- package/build/credential.js.map +0 -1
- package/build/tab.js +0 -32
- package/build/tab.js.map +0 -1
package/build/worktrees.js
CHANGED
|
@@ -1,62 +1,168 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
import {
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { rm } from 'node:fs/promises';
|
|
3
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
import { realDirty, runGit, scratchClones } from "./checkout.js";
|
|
5
6
|
import { ConductorError } from "./errors.js";
|
|
7
|
+
import { copyLocalFiles } from "./local-files.js";
|
|
8
|
+
import { realOr, samePath } from "./paths.js";
|
|
9
|
+
import { missingProjectSkills } from "./plugin.js";
|
|
6
10
|
import { outputOf, run } from "./run.js";
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export function
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
return names.flatMap((name) => {
|
|
22
|
-
const found = entries.filter((e) => e.name === name);
|
|
23
|
-
if (found.length === 0)
|
|
24
|
-
return [`${name} not installed`];
|
|
25
|
-
return found.filter((e) => e.status !== 'ok').map((e) => `${name}${e.version ? ` ${e.version}` : ''} ${e.status}`);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
const auditSchema = z.looseObject({
|
|
29
|
-
tools: z.array(z.looseObject({
|
|
30
|
-
entries: z
|
|
31
|
-
.array(z.looseObject({ name: z.string(), status: z.string(), version: z.string().nullish() }))
|
|
32
|
-
.optional(),
|
|
33
|
-
})),
|
|
34
|
-
});
|
|
35
|
-
export function gitWorktrees() {
|
|
11
|
+
import { claudeSkillsDir } from "./spend.js";
|
|
12
|
+
export const BRANCH_PREFIX = 'worktree-';
|
|
13
|
+
// Each setup command's limit: ATK's `pnpm install` takes about a minute.
|
|
14
|
+
const SETUP_MS = 10 * 60_000;
|
|
15
|
+
// How long a removal waits for a process to let go of the worktree before it gives up.
|
|
16
|
+
const RELEASE_MS = 15_000;
|
|
17
|
+
// A .trash-* folder older than this is an interrupted removal's, not one still deleting.
|
|
18
|
+
const STALE_TRASH_MS = 60 * 60_000;
|
|
19
|
+
export const SESSION_SETTINGS = join('.claude', 'settings.local.json');
|
|
20
|
+
export function gitWorktrees(deps = {}) {
|
|
21
|
+
const gitRun = deps.git ?? runGit;
|
|
22
|
+
const skillsHome = deps.skillsHome ?? claudeSkillsDir();
|
|
23
|
+
const platform = deps.platform ?? process.platform;
|
|
24
|
+
const sleep = deps.sleep ?? ((ms) => new Promise((done) => setTimeout(done, ms)));
|
|
36
25
|
// Untrimmed: porcelain status starts with a space for a file changed only in the worktree.
|
|
37
26
|
const git = async (args, cwd) => {
|
|
38
|
-
const result = await
|
|
27
|
+
const result = await gitRun(args, cwd);
|
|
39
28
|
return result.code === 0 ? result.stdout : null;
|
|
40
29
|
};
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
if (!existsSync(path)) {
|
|
44
|
-
throw new ConductorError(`no worktree hooks at ${path}`, ['the project needs the ATK worktree-kit bundle']);
|
|
45
|
-
}
|
|
46
|
-
// The hook reads CLAUDE_PROJECT_DIR the way Claude Code runs it.
|
|
47
|
-
const result = await run('node', [path], {
|
|
48
|
-
cwd: root,
|
|
49
|
-
env: { ...process.env, CLAUDE_PROJECT_DIR: root },
|
|
50
|
-
input: JSON.stringify({ ...input, cwd: root }),
|
|
51
|
-
timeoutMs,
|
|
52
|
-
});
|
|
30
|
+
const must = async (args, cwd, what) => {
|
|
31
|
+
const result = await gitRun(args, cwd);
|
|
53
32
|
if (result.code !== 0)
|
|
54
|
-
throw new ConductorError(
|
|
55
|
-
|
|
33
|
+
throw new ConductorError(what, [outputOf(result, 500)]);
|
|
34
|
+
};
|
|
35
|
+
const branchOf = async (path) => (await git(['symbolic-ref', '--quiet', '--short', 'HEAD'], path))?.trim() || null;
|
|
36
|
+
const create = async (request) => {
|
|
37
|
+
const { base, clone, env, localFilesFrom, name, path, sessionEnv, setup } = request;
|
|
38
|
+
const reused = existsSync(join(path, '.git'));
|
|
39
|
+
if (reused) {
|
|
40
|
+
// Never deleted: it may hold someone's work, and a git call can fail for a moment.
|
|
41
|
+
if ((await git(['rev-parse', '--is-inside-work-tree'], path))?.trim() !== 'true')
|
|
42
|
+
throw new ConductorError(`${path} has a .git that git can't read`, [
|
|
43
|
+
`look at what is in it, then delete it, or run git -C "${clone}" worktree repair`,
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// Left over from a removal that didn't finish: no .git, so no worktree's work.
|
|
48
|
+
if (existsSync(path))
|
|
49
|
+
await rm(path, { force: true, maxRetries: 3, recursive: true });
|
|
50
|
+
// Git still lists a worktree whose directory went without it, and refuses to add at its path.
|
|
51
|
+
await git(['worktree', 'prune'], clone);
|
|
52
|
+
// Deep node_modules paths in a worktree pass 260 characters, and without this Git for Windows
|
|
53
|
+
// can't check them out or remove them.
|
|
54
|
+
if (platform === 'win32')
|
|
55
|
+
await git(['config', 'core.longpaths', 'true'], clone);
|
|
56
|
+
// Offline, the worktree starts from the origin/<base> fetched last; with none, the add says so.
|
|
57
|
+
await git(['fetch', '--quiet', 'origin', base], clone);
|
|
58
|
+
const branch = `${BRANCH_PREFIX}${name}`;
|
|
59
|
+
const known = await hasBranch(clone, branch);
|
|
60
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
61
|
+
await must(known ? ['worktree', 'add', path, branch] : ['worktree', 'add', '-b', branch, path, `origin/${base}`], clone, `git worktree add failed for ${path}`);
|
|
62
|
+
}
|
|
63
|
+
// A reused worktree's own changes (a kept worker's) are its; only what setup changes counts.
|
|
64
|
+
const before = new Set(reused ? (await realDirty(gitRun, path)).dirty : []);
|
|
65
|
+
if (localFilesFrom !== undefined)
|
|
66
|
+
await copyLocalFiles(gitRun, localFilesFrom, path);
|
|
67
|
+
for (const command of setup) {
|
|
68
|
+
// Through the shell: a setup command is the profile's, a command line as a person would type it.
|
|
69
|
+
const result = await run(command, [], {
|
|
70
|
+
cwd: path,
|
|
71
|
+
env: { ...process.env, ...env },
|
|
72
|
+
shell: true,
|
|
73
|
+
timeoutMs: SETUP_MS,
|
|
74
|
+
});
|
|
75
|
+
if (result.code !== 0)
|
|
76
|
+
throw new ConductorError(`setup "${command}" failed in ${path}`, [outputOf(result, 1500)]);
|
|
77
|
+
}
|
|
78
|
+
// A worker that starts with changes it didn't make takes them for its own, and retire then
|
|
79
|
+
// refuses them as unfinished work: setup builds gitignored files only. (atk install rewrites
|
|
80
|
+
// .atk-lock.json when the registry's checksums aren't the base branch's.)
|
|
81
|
+
const dirty = (await realDirty(gitRun, path)).dirty.filter((file) => !before.has(file));
|
|
82
|
+
if (dirty.length > 0)
|
|
83
|
+
throw new ConductorError(`setup left changes in ${path}: ${dirty.join(', ')}`, [
|
|
84
|
+
'setup must build only gitignored files; fix the command that changed them, or ignore them in the repo',
|
|
85
|
+
]);
|
|
86
|
+
// Last, so no setup command can write over it.
|
|
87
|
+
writeSessionEnv(path, sessionEnv);
|
|
88
|
+
return path;
|
|
89
|
+
};
|
|
90
|
+
const hasBranch = async (root, branch) => (await git(['show-ref', '--verify', '--quiet', `refs/heads/${branch}`], root)) !== null;
|
|
91
|
+
const repoOf = async (path) => {
|
|
92
|
+
if (!existsSync(path))
|
|
93
|
+
return null;
|
|
94
|
+
const common = (await git(['rev-parse', '--path-format=absolute', '--git-common-dir'], path))?.trim();
|
|
95
|
+
return common ? dirname(resolve(common)) : null;
|
|
96
|
+
};
|
|
97
|
+
// The linked worktrees git lists for a repository: not its main checkout, which comes first.
|
|
98
|
+
const linked = async (repo) => ((await git(['worktree', 'list', '--porcelain'], repo)) ?? '')
|
|
99
|
+
.split(/\r?\n/)
|
|
100
|
+
.filter((line) => line.startsWith('worktree '))
|
|
101
|
+
.slice(1)
|
|
102
|
+
.map((line) => line.slice('worktree '.length));
|
|
103
|
+
// Not `git worktree remove`, which leaves pnpm's node_modules junctions behind on Windows: the
|
|
104
|
+
// worktree is moved aside, which frees its path at once, git forgets it, and Node deletes the
|
|
105
|
+
// directory, unlinking junctions without following them (the worktree-kit hook's way). It removes
|
|
106
|
+
// only a linked worktree its repository lists, or a folder with no .git under a `worktrees`
|
|
107
|
+
// folder (a create that failed part way): never a main checkout, never anything else.
|
|
108
|
+
const remove = async (path, { deleteBranch, repo: given }) => {
|
|
109
|
+
const there = existsSync(path);
|
|
110
|
+
// Git runs in the folder only when it has a .git of its own: in one without, git would walk up to
|
|
111
|
+
// whatever repository encloses it.
|
|
112
|
+
const own = there && existsSync(join(path, '.git'));
|
|
113
|
+
const repo = (own ? await repoOf(path) : null) ?? given;
|
|
114
|
+
if (own) {
|
|
115
|
+
// Real paths on both sides: git lists the long form of a path given in 8.3 short form.
|
|
116
|
+
if (!(await linked(repo)).some((listed) => samePath(realOr(listed), realOr(path))))
|
|
117
|
+
throw new ConductorError(`${path} isn't a linked worktree of ${repo}`, [
|
|
118
|
+
'the conductor removes only the worktrees it makes',
|
|
119
|
+
]);
|
|
120
|
+
}
|
|
121
|
+
else if (there && basename(dirname(path)) !== 'worktrees') {
|
|
122
|
+
throw new ConductorError(`${path} isn't a worktree`, ['the conductor removes only the worktrees it makes']);
|
|
123
|
+
}
|
|
124
|
+
// With no worktree there (gone, or a create that failed before git made it), the branch a launch
|
|
125
|
+
// made, but only while no commit of it is anywhere else: nothing on a remote is lost by deleting
|
|
126
|
+
// it, and nothing else is deleted.
|
|
127
|
+
let branch = own ? await branchOf(path) : null;
|
|
128
|
+
if (branch === null && deleteBranch) {
|
|
129
|
+
const made = `${BRANCH_PREFIX}${basename(path)}`;
|
|
130
|
+
const unpushed = (await hasBranch(repo, made))
|
|
131
|
+
? await git(['rev-list', '--count', made, '--not', '--remotes'], repo)
|
|
132
|
+
: null;
|
|
133
|
+
if (unpushed?.trim() === '0')
|
|
134
|
+
branch = made;
|
|
135
|
+
}
|
|
136
|
+
let trash = null;
|
|
137
|
+
for (let waited = 0; existsSync(path); waited += 1000) {
|
|
138
|
+
trash = moveAside(path);
|
|
139
|
+
if (trash)
|
|
140
|
+
break;
|
|
141
|
+
if (waited >= RELEASE_MS)
|
|
142
|
+
throw new ConductorError(`${path} is in use`, [
|
|
143
|
+
'a process still holds a file in it, such as a dev server it started',
|
|
144
|
+
]);
|
|
145
|
+
await sleep(1000);
|
|
146
|
+
}
|
|
147
|
+
await must(['worktree', 'prune'], repo, 'git worktree prune failed');
|
|
148
|
+
if (deleteBranch && branch)
|
|
149
|
+
await must(['branch', '-D', branch], repo, `git couldn't delete the branch ${branch}`);
|
|
150
|
+
// Asynchronous: a worktree's node_modules takes a minute to delete, and the daemon's API and
|
|
151
|
+
// sweeps go on answering meanwhile.
|
|
152
|
+
if (trash)
|
|
153
|
+
await rm(trash, { force: true, maxRetries: 5, recursive: true, retryDelay: 500 });
|
|
154
|
+
// A removal interrupted earlier leaves its .trash-* folder; one under an hour old may be another
|
|
155
|
+
// removal's, still deleting.
|
|
156
|
+
const dir = dirname(path);
|
|
157
|
+
for (const entry of existsSync(dir) ? readdirSync(dir) : []) {
|
|
158
|
+
const at = Number(/^\.trash-.+-(\d+)$/.exec(entry)?.[1] ?? Number.NaN);
|
|
159
|
+
if (Date.now() - at > STALE_TRASH_MS)
|
|
160
|
+
await rm(join(dir, entry), { force: true, maxRetries: 5, recursive: true });
|
|
161
|
+
}
|
|
56
162
|
};
|
|
57
163
|
// One checkout's uncommitted changes (without line-ending-only ones) and commits on no remote.
|
|
58
164
|
const workIn = async (path) => {
|
|
59
|
-
const { dirty } = await realDirty(
|
|
165
|
+
const { dirty } = await realDirty(gitRun, path);
|
|
60
166
|
const count = await git(['rev-list', '--count', 'HEAD', '--not', '--remotes'], path);
|
|
61
167
|
const unpushed = Number(count ?? 0);
|
|
62
168
|
return {
|
|
@@ -66,52 +172,12 @@ export function gitWorktrees() {
|
|
|
66
172
|
...(count === null ? { unknown: `git rev-list failed in ${path}` } : {}),
|
|
67
173
|
};
|
|
68
174
|
};
|
|
69
|
-
const atk = (args) => run('atk', args, { shell: true, timeoutMs: REMOVE_MS });
|
|
70
|
-
const audit = async (worktree, skills) => {
|
|
71
|
-
const result = await atk(['audit', '--json', '-P', worktree]); // exits 1 when a checksum fails
|
|
72
|
-
try {
|
|
73
|
-
return staleSkills(JSON.parse(result.stdout), skills);
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
// An audit that can't run proves nothing matches.
|
|
77
|
-
return [`atk audit failed (${String(error)}: ${outputOf(result, 300)})`];
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
175
|
return {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
let stale = await audit(worktree, skills);
|
|
87
|
-
let installError = '';
|
|
88
|
-
if (stale.length > 0) {
|
|
89
|
-
const installed = await atk(['install', '--json', '-P', worktree]);
|
|
90
|
-
if (installed.code !== 0)
|
|
91
|
-
installError = ` (atk install: ${outputOf(installed, 300)})`;
|
|
92
|
-
stale = await audit(worktree, skills);
|
|
93
|
-
}
|
|
94
|
-
if (stale.length > 0)
|
|
95
|
-
return `${stale.join(', ')} against ${LOCKFILE}, and atk install didn't fix it${installError}`;
|
|
96
|
-
// atk install rewrites the lockfile when its checksums aren't the registry's. The worker would
|
|
97
|
-
// start with a change it didn't make, and retire would refuse it as uncommitted work.
|
|
98
|
-
if (await git(['status', '--porcelain', '--', LOCKFILE], worktree)) {
|
|
99
|
-
await git(['checkout', '--', LOCKFILE], worktree); // not work to keep
|
|
100
|
-
return `atk install rewrote ${LOCKFILE}: the checksums on the base branch differ from the registry's`;
|
|
101
|
-
}
|
|
102
|
-
return null;
|
|
103
|
-
},
|
|
104
|
-
create: async (root, name) => {
|
|
105
|
-
const path = await hook(root, { hook_event_name: 'WorktreeCreate', name }, CREATE_MS);
|
|
106
|
-
if (!path)
|
|
107
|
-
throw new ConductorError('the WorktreeCreate hook printed no path');
|
|
108
|
-
return path;
|
|
109
|
-
},
|
|
110
|
-
remove: async (root, path) => {
|
|
111
|
-
await hook(root, { hook_event_name: 'WorktreeRemove', worktree_path: path }, REMOVE_MS);
|
|
112
|
-
if (existsSync(path))
|
|
113
|
-
throw new ConductorError(`${path} is still there after the WorktreeRemove hook`);
|
|
114
|
-
},
|
|
176
|
+
branchOf,
|
|
177
|
+
create,
|
|
178
|
+
missingSkills: (worktree, skills) => missingProjectSkills(worktree, skills, skillsHome),
|
|
179
|
+
remove,
|
|
180
|
+
repoOf,
|
|
115
181
|
unfinishedWork: async (path) => {
|
|
116
182
|
if (!existsSync(path))
|
|
117
183
|
return null;
|
|
@@ -132,4 +198,45 @@ export function gitWorktrees() {
|
|
|
132
198
|
},
|
|
133
199
|
};
|
|
134
200
|
}
|
|
201
|
+
// Merges the env into the worktree's .claude/settings.local.json, whose `env` Claude Code applies to
|
|
202
|
+
// every session in the folder, and to each resume of one. Claude Code's convention gitignores the
|
|
203
|
+
// file, so it isn't work of the worker's (`conduct project check` warns when the repo doesn't).
|
|
204
|
+
export function writeSessionEnv(worktree, env) {
|
|
205
|
+
if (Object.keys(env).length === 0)
|
|
206
|
+
return;
|
|
207
|
+
const file = join(worktree, SESSION_SETTINGS);
|
|
208
|
+
let settings = {};
|
|
209
|
+
if (existsSync(file)) {
|
|
210
|
+
const parsed = settingsSchema.safeParse(parseOrNull(readFileSync(file, 'utf8')));
|
|
211
|
+
if (!parsed.success)
|
|
212
|
+
throw new ConductorError(`${file} is not a JSON object`, [
|
|
213
|
+
'fix or delete it: the conductor writes the ports into its env',
|
|
214
|
+
]);
|
|
215
|
+
settings = parsed.data;
|
|
216
|
+
}
|
|
217
|
+
const current = envSchema.safeParse(settings.env).data ?? {};
|
|
218
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
219
|
+
writeFileSync(file, `${JSON.stringify({ ...settings, env: { ...current, ...env } }, null, 2)}\n`);
|
|
220
|
+
}
|
|
221
|
+
const settingsSchema = z.record(z.string(), z.unknown());
|
|
222
|
+
const envSchema = z.record(z.string(), z.string());
|
|
223
|
+
// Renames a directory to .trash-<name>-<time> beside it; null when something holds it.
|
|
224
|
+
function moveAside(dir) {
|
|
225
|
+
const trash = join(dirname(dir), `.trash-${basename(dir)}-${Date.now()}`);
|
|
226
|
+
try {
|
|
227
|
+
renameSync(dir, trash);
|
|
228
|
+
return trash;
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
function parseOrNull(text) {
|
|
235
|
+
try {
|
|
236
|
+
return JSON.parse(text);
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
135
242
|
//# sourceMappingURL=worktrees.js.map
|
package/build/worktrees.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktrees.js","sourceRoot":"","sources":["../src/worktrees.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SA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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
2
|
+
"name": "@detergent-software/conductor",
|
|
3
|
+
"version": "3.0.0-dev.20",
|
|
4
|
+
"description": "Conductor: the local daemon that runs conducted projects' work loops (conduct serve) and its conduct CLI.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"conduct": "./build/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"build",
|
|
11
|
+
"!build/__tests__",
|
|
12
|
+
"plugin",
|
|
13
|
+
"!plugin/tests",
|
|
14
|
+
"!plugin/.claude-plugin/types",
|
|
15
|
+
"protocol",
|
|
16
|
+
"CHANGELOG.md"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit",
|
|
21
|
+
"directory": "apps/conductor"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=24.5.0"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"registry": "https://registry.npmjs.org",
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"jsonc-parser": "^3.3.1",
|
|
32
|
+
"semver": "^7.7.0",
|
|
33
|
+
"zod": "^4.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
37
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
38
|
+
"@semantic-release/git": "^10.0.1",
|
|
39
|
+
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
40
|
+
"@types/node": "^24.19.0",
|
|
41
|
+
"@types/semver": "^7.8.0",
|
|
42
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
43
|
+
"eslint": "^10.11.0",
|
|
44
|
+
"prettier": "^3.9.9",
|
|
45
|
+
"semantic-release": "^25.0.3",
|
|
46
|
+
"typescript": "~6.0.3",
|
|
47
|
+
"vitest": "^5.0.3",
|
|
48
|
+
"@atk/eslint-config": "0.0.0",
|
|
49
|
+
"@atk/tsconfig": "0.0.0"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc",
|
|
53
|
+
"dev": "tsc --watch",
|
|
54
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\" \"plugin/**/*.{ts,tsx}\" \"scripts/**/*.mjs\"",
|
|
55
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx}\" \"plugin/**/*.{ts,tsx}\" \"scripts/**/*.mjs\"",
|
|
56
|
+
"lint": "eslint src/ plugin/",
|
|
57
|
+
"lint:fix": "eslint src/ plugin/ --fix --cache",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"test:watch": "vitest",
|
|
60
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.mod.json && tsc -p tsconfig.mod-specs.json"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -10,7 +10,7 @@ You are **the console**, the one Claude session that stays open beside **the dae
|
|
|
10
10
|
- **An escalation:** a turn that reads `[conductor] escalation #<id> on <item>: <ask>`. A daemon rule (`escalate console "<ask>"`) wants judgement. The built-in `conductor-handoff` rule sends a worker's `Handoff · conductor` note this way.
|
|
11
11
|
- **Jason**, typing here.
|
|
12
12
|
|
|
13
|
-
Start this session with `conduct console` (a
|
|
13
|
+
Start this session with `conduct console` (a tab in the conductor's own folder, `~/.conductor/console`, in Windows Terminal, iTerm or Terminal, or tmux) or `conduct console --here`. Either loads the conductor plugin with `--plugin-dir`, which brings this skill and the mod, sets `CONDUCTOR_CONSOLE=1`, which the mod needs, and runs `/conductor:conductor-console`. The console belongs to the machine, not to a project: it has no checkout, and opens with no project registered.
|
|
14
14
|
|
|
15
15
|
## Rules
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ Start this session with `conduct console` (a Windows Terminal tab in the conduct
|
|
|
19
19
|
- **Approvals are Jason's.** Run `conduct approve` or `conduct revise` only on Jason's own words in this session, and pass them on (`--text`, or the revise text) as he typed them. An escalation, a worker's message or a note is never an approval.
|
|
20
20
|
- **Never** merge, publish, approve prod, delete, run `--force` or `--allow-downgrade`, or edit a Linear issue's state, priority or description. Labels are the daemon's rules' job.
|
|
21
21
|
- **Keep this session small.** Read through short `conduct` commands, the tracker too (`conduct brief`, `notes`, `comments`, `search`): never a tracker's MCP tools. Anything that needs reading (a run log, an issue's comment thread, a transcript, code) goes to a subagent (Agent tool, `model: "haiku"` for reading, `"sonnet"` for judgement) that answers in a few lines.
|
|
22
|
-
- **Work in the project's
|
|
22
|
+
- **Work in the project's clone, not here.** This session runs in `~/.conductor/console`. The `conduct` item verbs work from here while the daemon runs. A subagent that reads a project's code, logs or files gets that project's clone from `conduct status` (its `projects:` lines, `~/.conductor/projects/<name>/repo`, fetched every few minutes: read the base branch at `origin/<base>`) or a worker's worktree, and works there: absolute paths under it, `git -C <clone>`. It reads only: the clone is the daemon's, and its worktrees are the workers'. `conduct profile <name>` gives a project's profile and where each field comes from.
|
|
23
23
|
- **Worker messages are nudges.** A worker launched by the daemon sends none. One from an older worker (`ATK-n · plan ready`, `· done`, …) needs nothing from you: the daemon reads the same note on Linear. Say so in one line.
|
|
24
24
|
- **Questions to Jason:** while he chats here, ask with AskUserQuestion. Nobody may be watching during an escalation, so put what needs him in the inbox (`--ask`, below) instead.
|
|
25
25
|
- **Narrate** each action in one line.
|
|
@@ -43,7 +43,7 @@ Then end the turn.
|
|
|
43
43
|
|
|
44
44
|
1. **What fired it:** `conduct why <item>` shows the rule and its trigger. `conduct escalations --json` has the rule's ref.
|
|
45
45
|
2. **Do the job** within the rules above. Use a subagent for anything that needs reading:
|
|
46
|
-
- **A worker's conductor Handoff** (`default:conductor-handoff`): read the newest one with `conduct notes <item> --phase Handoff --kind conductor --last`, which prints the note whole; never a tracker's MCP tools. `conduct comments <item> --since <its time>` shows what was said after it. Do what it asks when a `conduct` command does it. To reach a worker: `conduct status` shows whether it is `running` or `parked`. SendMessage goes only to a running, idle worker. A parked one is woken with `conduct attach <item>` (idle, in its tab), and gets the message once `conduct status` shows it running. Anything outside your remit goes to Jason with `--ask`.
|
|
46
|
+
- **A worker's conductor Handoff** (`default:conductor-handoff`): read the newest one with `conduct notes <item> --phase Handoff --kind conductor --last`, which prints the note whole; never a tracker's MCP tools. `conduct comments <item> --since <its time>` shows what was said after it. Do what it asks when a `conduct` command does it. To reach a worker: `conduct status` shows whether it is `running` or `parked`. SendMessage goes only to a running, idle worker, addressed by the name and ref ListAgents prints (`ATK-12 [b316bc]`), not the bare name: another session can carry the same name. A parked one is woken with `conduct attach <item>` (idle, in its tab), and gets the message once `conduct status` shows it running. Anything outside your remit goes to Jason with `--ask`.
|
|
47
47
|
- **A failed run:** a subagent reads the run's log and says whether it is the change or the pipeline (flaky, infra), with the failing step and line.
|
|
48
48
|
- **A stall:** `conduct status` (activity, waits, phase), `conduct inbox` (its `permission`, `stall` or `failed` item) and `conduct why <item>`. Say what it waits on and who can move it.
|
|
49
49
|
- **A vague item:** a subagent reads it (`conduct brief <item>`, `conduct comments <item>`) and drafts a sharper description and a "done when". Put the draft in the `--ask` for Jason to adopt; never edit the description.
|
|
@@ -29,6 +29,8 @@ This skill is the order of work. **Conductor does the rest**: every read and wri
|
|
|
29
29
|
| Open the PR; read its threads; answer one | `conduct pr create …`; `conduct pr threads <pr>`; `conduct reply <pr> [<thread>] --body-file <file>` |
|
|
30
30
|
| Arm the landing and read its verdict; wait for it | `conduct land <pr> …`; `conduct wait pr <pr>` |
|
|
31
31
|
| A merge's runs, failed logs and npm stages; wait for them | `conduct runs <sha> [--for …]`; `conduct wait merge <sha> [--for …]` |
|
|
32
|
+
| What a merge's run printed, or never printed, succeeded or not (a dev proof) | `conduct runs <sha> --for <pipeline> --grep <pattern>` |
|
|
33
|
+
| How long a run's tasks took, and the named tasks' log lines; the same over a pipeline's last runs on a branch, with no merge commit | `conduct timeline <run> [--task <regex>] [--grep <regex>]`; `conduct timeline --for <pipeline> [--branch <b>] [--count <n>] …` |
|
|
32
34
|
| A version on npm | `conduct wait npm <version> --tag <dist-tag> --package <name>` |
|
|
33
35
|
| The browser lock every session shares | `conduct lock acquire\|release chrome` |
|
|
34
36
|
|
|
@@ -61,7 +63,7 @@ The tracker's vocabulary (what each lifecycle status is called, what an Area is,
|
|
|
61
63
|
- **Shell in a worktree.** The worktree guard refuses compound commands, so:
|
|
62
64
|
- Stay in the worktree root; never `cd`. A `cd` stays in force for every later call. Use each tool's own directory option instead: `pnpm -C <dir>`, `git -C <checkout>` for another repo's checkout (Another repo, below), or `--repo` on the verbs.
|
|
63
65
|
- Run one `git`, `az`, `gh` or `conduct` command per call, with no `&&`, `;`, pipe, loop or `$( )` around it.
|
|
64
|
-
- `git -C` works only on a path inside the worktree. The guard refuses it on the main checkout or any other path outside.
|
|
66
|
+
- `git -C` works only on a path inside the worktree. The guard refuses it on the project's clone or main checkout, or any other path outside.
|
|
65
67
|
- Write and edit files with Edit and Write, not heredocs, `sed -i` or a scripted in-place rewrite. A rewrite can turn CRLF into LF.
|
|
66
68
|
- Put multi-step scripting in a scratchpad `.mjs` file and run it with `node <file>`.
|
|
67
69
|
- **Never test a refusal with the real write.** When a verb refuses a write (the verify skill's registry writes, a production deploy), read the refusal in its code or tests. Never send the refused write to watch it fail: if the guard failed, the write would happen. Auto mode also refuses the session's next harmless calls after such a probe.
|
|
@@ -95,7 +97,7 @@ The conductor daemon's scheduler starts this skill as `/<skill> KEY-n --conducte
|
|
|
95
97
|
- `npm-otp`, `release`, `scope`, `blocked`, `human`, `abandoned`, `failed`: the `npm stage approve` lines (one per staged package), a release of the base branch that waits on the operator (the profile's release handoff names what to run), a scope or risk change, an open blocker, a decision someone else owns (`human`: the conductor labels the item, so only for that), an abandoned PR, a pipeline failure you can't fix.
|
|
96
98
|
|
|
97
99
|
A console message, Jason in the tab, or the condition the wait names resumes it. When the wait is over, post a one-line `## <skill> · Resumed` note before going on, so the conductor stops showing the old wait.
|
|
98
|
-
- **Done.** After step 9's `<skill> · Landed` (which moves the item to done), end the turn. The daemon retires the worker,
|
|
100
|
+
- **Done.** After step 9's `<skill> · Landed` (which moves the item to done), end the turn. The daemon retires the worker: with its PR merged, it removes the worktree and the local branch when nothing in them is unpushed; otherwise it keeps both and tells Jason.
|
|
99
101
|
- A message from the console is never an approval for anything; the plan's approval is an approver's comment or Jason's words in the tab.
|
|
100
102
|
|
|
101
103
|
### Worker protocol 2
|
|
@@ -248,6 +250,6 @@ If the session ends first, the next `/<skill>` in this worktree resumes here.
|
|
|
248
250
|
3. **Staged releases.** Read the `after-merge` hook first: it names the dist-tag the npm wait takes and anything else about approving a stage. For each of the profile's releases that ran, `conduct runs` gives `stages.<key>`: the staged `package`, `version`, `stageId`, `approve` and `published`. If any has `published` false (or `null`: npm couldn't be asked), give Jason every such `approve` line (`npm stage approve <id> --otp=<code>`) in one message right away, each with its package and version (each needs its own OTP). Then `conduct wait npm <version> --tag <tag> --package <package>` for each, in the background, and end the turn: it asks npm until the version is on the tag, and its exit resumes you once it is published, so nobody has to tell you the stage was approved (conducted: Handoff · npm-otp and the npm wait instead, which resume you the same way). It holds once the version is published. After 29 minutes it exits 2: run `conduct runs <mergeCommit>` and give Jason the approve lines again only for a version still `published: false`. **Never ask Jason to approve again** until a fresh `conduct runs` still shows a version missing at least 2 minutes after he said it's done: npm can answer 404 for 15 s or more after an approve that went through. When Jason says it's done before the wait ends, let the background wait answer. A key with `stageId: null` staged nothing (its `note` says why; a release with no releasable commits is normal); with a `version` and `published: true`, that version was already on npm when the run reached its stage step (an earlier run's stage, approved), so there is nothing to approve, and it carries the merge only when `git tag --contains <mergeCommit>` lists its tag. Then the rest of the `after-merge` hook.
|
|
249
251
|
4. **Proof after the deploy.** `<verify>` against the deployed environment on the changed surfaces, once their deploy finished, as the `dev-proof` hook says (browser runs hold the `chrome` lock, as in step 6). A staged release is proved on the version it published, after Jason approved it, not on the checkout's build.
|
|
250
252
|
5. Post `<skill> · Landed`: the merge commit, the landing mode and who approved, the pipeline results, the evidence after the deploy. It moves the item to done. File follow-ups as new items related to this one, searching first (Rules: new problems become new items, once).
|
|
251
|
-
6. Wrap up. The branch is still checked out in this worktree, so leave it. Tell Jason the item is done and that `/exit` removes the worktree; the hook keeps a renamed branch, so `git branch -d <branch>` from the main checkout clears it. Conducted: end the turn; the daemon retires the worker once the item is done.
|
|
253
|
+
6. Wrap up. The branch is still checked out in this worktree, so leave it. Tell Jason the item is done and that `/exit` removes the worktree; the hook keeps a renamed branch, so `git branch -d <branch>` from the main checkout clears it. Conducted: end the turn; the daemon retires the worker once the item is done, and removes its worktree and branch once the PR has merged.
|
|
252
254
|
|
|
253
255
|
Releases are out of scope: the profile's release handoff (`release.handoff`) says how the base branch ships.
|