@groundnuty/macf 0.2.0-rc.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/dist/.build-info.json +4 -0
- package/dist/cli/build-info.d.ts +38 -0
- package/dist/cli/build-info.d.ts.map +1 -0
- package/dist/cli/build-info.js +119 -0
- package/dist/cli/build-info.js.map +1 -0
- package/dist/cli/claude-sh.d.ts +42 -0
- package/dist/cli/claude-sh.d.ts.map +1 -0
- package/dist/cli/claude-sh.js +247 -0
- package/dist/cli/claude-sh.js.map +1 -0
- package/dist/cli/commands/cd.d.ts +6 -0
- package/dist/cli/commands/cd.d.ts.map +1 -0
- package/dist/cli/commands/cd.js +17 -0
- package/dist/cli/commands/cd.js.map +1 -0
- package/dist/cli/commands/certs.d.ts +33 -0
- package/dist/cli/commands/certs.d.ts.map +1 -0
- package/dist/cli/commands/certs.js +233 -0
- package/dist/cli/commands/certs.js.map +1 -0
- package/dist/cli/commands/doctor.d.ts +91 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +235 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/init.d.ts +37 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +279 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/list.d.ts +5 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +21 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/migrate-ca-key.d.ts +36 -0
- package/dist/cli/commands/migrate-ca-key.d.ts.map +1 -0
- package/dist/cli/commands/migrate-ca-key.js +92 -0
- package/dist/cli/commands/migrate-ca-key.js.map +1 -0
- package/dist/cli/commands/peers.d.ts +8 -0
- package/dist/cli/commands/peers.d.ts.map +1 -0
- package/dist/cli/commands/peers.js +45 -0
- package/dist/cli/commands/peers.js.map +1 -0
- package/dist/cli/commands/repo-init.d.ts +43 -0
- package/dist/cli/commands/repo-init.d.ts.map +1 -0
- package/dist/cli/commands/repo-init.js +304 -0
- package/dist/cli/commands/repo-init.js.map +1 -0
- package/dist/cli/commands/rules-refresh.d.ts +14 -0
- package/dist/cli/commands/rules-refresh.d.ts.map +1 -0
- package/dist/cli/commands/rules-refresh.js +67 -0
- package/dist/cli/commands/rules-refresh.js.map +1 -0
- package/dist/cli/commands/self-update.d.ts +14 -0
- package/dist/cli/commands/self-update.d.ts.map +1 -0
- package/dist/cli/commands/self-update.js +112 -0
- package/dist/cli/commands/self-update.js.map +1 -0
- package/dist/cli/commands/status.d.ts +9 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +90 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/update.d.ts +25 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +316 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/config.d.ts +103 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +224 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +245 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/plugin-fetcher.d.ts +20 -0
- package/dist/cli/plugin-fetcher.d.ts.map +1 -0
- package/dist/cli/plugin-fetcher.js +83 -0
- package/dist/cli/plugin-fetcher.js.map +1 -0
- package/dist/cli/prompt.d.ts +17 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +109 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/registry-helper.d.ts +11 -0
- package/dist/cli/registry-helper.d.ts.map +1 -0
- package/dist/cli/registry-helper.js +18 -0
- package/dist/cli/registry-helper.js.map +1 -0
- package/dist/cli/rules.d.ts +39 -0
- package/dist/cli/rules.d.ts.map +1 -0
- package/dist/cli/rules.js +112 -0
- package/dist/cli/rules.js.map +1 -0
- package/dist/cli/settings-writer.d.ts +97 -0
- package/dist/cli/settings-writer.d.ts.map +1 -0
- package/dist/cli/settings-writer.js +270 -0
- package/dist/cli/settings-writer.js.map +1 -0
- package/dist/cli/version-resolver.d.ts +73 -0
- package/dist/cli/version-resolver.d.ts.map +1 -0
- package/dist/cli/version-resolver.js +238 -0
- package/dist/cli/version-resolver.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin/bin/macf-plugin-cli.d.ts +13 -0
- package/dist/plugin/bin/macf-plugin-cli.d.ts.map +1 -0
- package/dist/plugin/bin/macf-plugin-cli.js +127 -0
- package/dist/plugin/bin/macf-plugin-cli.js.map +1 -0
- package/dist/plugin/lib/format.d.ts +40 -0
- package/dist/plugin/lib/format.d.ts.map +1 -0
- package/dist/plugin/lib/format.js +137 -0
- package/dist/plugin/lib/format.js.map +1 -0
- package/dist/plugin/lib/health.d.ts +2 -0
- package/dist/plugin/lib/health.d.ts.map +1 -0
- package/dist/plugin/lib/health.js +6 -0
- package/dist/plugin/lib/health.js.map +1 -0
- package/dist/plugin/lib/index.d.ts +7 -0
- package/dist/plugin/lib/index.d.ts.map +1 -0
- package/dist/plugin/lib/index.js +5 -0
- package/dist/plugin/lib/index.js.map +1 -0
- package/dist/plugin/lib/registry.d.ts +18 -0
- package/dist/plugin/lib/registry.d.ts.map +1 -0
- package/dist/plugin/lib/registry.js +17 -0
- package/dist/plugin/lib/registry.js.map +1 -0
- package/dist/plugin/lib/work.d.ts +13 -0
- package/dist/plugin/lib/work.d.ts.map +1 -0
- package/dist/plugin/lib/work.js +27 -0
- package/dist/plugin/lib/work.js.map +1 -0
- package/package.json +43 -0
- package/plugin/rules/coordination.md +224 -0
- package/scripts/check-gh-token.sh +102 -0
- package/scripts/macf-gh-token.sh +130 -0
- package/scripts/macf-whoami.sh +51 -0
- package/scripts/tmux-send-to-claude.sh +51 -0
- package/scripts/write-build-info.mjs +48 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { generateToken } from '@groundnuty/macf-core';
|
|
5
|
+
const STATUS_LABELS = [
|
|
6
|
+
{ name: 'in-progress', color: 'fbca04', description: 'Actively being worked on' },
|
|
7
|
+
{ name: 'in-review', color: '0e8a16', description: 'PR created, awaiting review' },
|
|
8
|
+
{ name: 'blocked', color: 'e11d48', description: 'Needs help or input' },
|
|
9
|
+
{ name: 'agent-offline', color: 'b60205', description: 'Agent VM unreachable' },
|
|
10
|
+
];
|
|
11
|
+
const AGENT_LABEL_COLOR = '1d76db';
|
|
12
|
+
function ensureDir(filePath) {
|
|
13
|
+
const dir = dirname(filePath);
|
|
14
|
+
if (!existsSync(dir))
|
|
15
|
+
mkdirSync(dir, { recursive: true });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Detect owner/repo from git remote. Uses execFileSync (no shell injection).
|
|
19
|
+
*/
|
|
20
|
+
function detectRepoFromGit(cwd) {
|
|
21
|
+
try {
|
|
22
|
+
const remote = execFileSync('git', ['remote', 'get-url', 'origin'], {
|
|
23
|
+
cwd,
|
|
24
|
+
encoding: 'utf-8',
|
|
25
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
26
|
+
}).trim();
|
|
27
|
+
const match = /github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?$/.exec(remote);
|
|
28
|
+
if (match)
|
|
29
|
+
return `${match[1]}/${match[2]}`;
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function validateVersion(version) {
|
|
37
|
+
const validPatterns = [/^v\d+$/, /^v\d+\.\d+$/, /^v\d+\.\d+\.\d+$/];
|
|
38
|
+
const isTag = validPatterns.some(p => p.test(version));
|
|
39
|
+
if (!isTag && version !== 'main') {
|
|
40
|
+
process.stderr.write(`Warning: "${version}" is not a tag ref. Production repos should pin to a tag (v1, v1.0, or v1.0.0).\n`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export function generateWorkflow(actionsVersion) {
|
|
44
|
+
return [
|
|
45
|
+
'name: Agent Router',
|
|
46
|
+
'on:',
|
|
47
|
+
' issues:',
|
|
48
|
+
' types: [labeled, closed]',
|
|
49
|
+
' issue_comment:',
|
|
50
|
+
' types: [created]',
|
|
51
|
+
' pull_request:',
|
|
52
|
+
' types: [opened]',
|
|
53
|
+
' pull_request_review:',
|
|
54
|
+
' types: [submitted]',
|
|
55
|
+
'jobs:',
|
|
56
|
+
' route:',
|
|
57
|
+
` uses: groundnuty/macf-actions/.github/workflows/agent-router.yml@${actionsVersion}`,
|
|
58
|
+
' secrets: inherit',
|
|
59
|
+
'',
|
|
60
|
+
].join('\n');
|
|
61
|
+
}
|
|
62
|
+
const DEFAULT_LABEL_TO_STATUS = {
|
|
63
|
+
'in-progress': 'In Progress',
|
|
64
|
+
'in-review': 'In Review',
|
|
65
|
+
'blocked': 'Blocked',
|
|
66
|
+
};
|
|
67
|
+
function makeAgentEntry(agent, useWindows, sessionName, defaults) {
|
|
68
|
+
const sshUser = 'ubuntu';
|
|
69
|
+
const entry = {
|
|
70
|
+
app_name: agent,
|
|
71
|
+
host: '<agent-host-ip>',
|
|
72
|
+
tmux_session: useWindows ? sessionName : agent,
|
|
73
|
+
ssh_user: sshUser,
|
|
74
|
+
tmux_bin: 'tmux',
|
|
75
|
+
ssh_key_secret: 'AGENT_SSH_KEY',
|
|
76
|
+
};
|
|
77
|
+
if (useWindows)
|
|
78
|
+
entry.tmux_window = agent;
|
|
79
|
+
// Default workspace_dir = /home/<ssh_user>/repos/<owner>/<repo>. Covers
|
|
80
|
+
// the common case where agents are cloned into ~/repos/<owner>/<repo>
|
|
81
|
+
// on the host. Users override per-agent if their layout differs.
|
|
82
|
+
if (defaults) {
|
|
83
|
+
entry.workspace_dir = `/home/${sshUser}/repos/${defaults.owner}/${defaults.repo}`;
|
|
84
|
+
}
|
|
85
|
+
return entry;
|
|
86
|
+
}
|
|
87
|
+
export function generateAgentConfig(agents, sessionName, defaults) {
|
|
88
|
+
if (agents.length === 0) {
|
|
89
|
+
return JSON.stringify({
|
|
90
|
+
agents: {
|
|
91
|
+
'<agent-name>': {
|
|
92
|
+
app_name: '<github-app-name>',
|
|
93
|
+
host: '<agent-host-ip>',
|
|
94
|
+
tmux_session: '<tmux-session-name>',
|
|
95
|
+
ssh_user: 'ubuntu',
|
|
96
|
+
tmux_bin: 'tmux',
|
|
97
|
+
ssh_key_secret: 'AGENT_SSH_KEY',
|
|
98
|
+
workspace_dir: '/home/ubuntu/repos/<owner>/<repo>',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
label_to_status: { ...DEFAULT_LABEL_TO_STATUS },
|
|
102
|
+
}, null, 2) + '\n';
|
|
103
|
+
}
|
|
104
|
+
const useWindows = !!sessionName && agents.length > 1;
|
|
105
|
+
const agentEntries = {};
|
|
106
|
+
for (const agent of agents) {
|
|
107
|
+
agentEntries[agent] = makeAgentEntry(agent, useWindows, sessionName, defaults);
|
|
108
|
+
}
|
|
109
|
+
return JSON.stringify({
|
|
110
|
+
agents: agentEntries,
|
|
111
|
+
label_to_status: { ...DEFAULT_LABEL_TO_STATUS },
|
|
112
|
+
}, null, 2) + '\n';
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Merge-preserving regenerate for #76: update only tmux_session/tmux_window
|
|
116
|
+
* fields from user input, preserve app_name/host/ssh_key_secret/ssh_user
|
|
117
|
+
* /tmux_bin/unknown-fields, preserve top-level label_to_status and extras.
|
|
118
|
+
* Agents not in the --agents list are left alone.
|
|
119
|
+
*/
|
|
120
|
+
export function patchAgentConfig(existingJson, agents, sessionName, defaults) {
|
|
121
|
+
let parsed;
|
|
122
|
+
try {
|
|
123
|
+
parsed = JSON.parse(existingJson);
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
throw new Error('Existing agent-config.json is not valid JSON; aborting rather than overwrite.');
|
|
127
|
+
}
|
|
128
|
+
if (!parsed.agents || typeof parsed.agents !== 'object') {
|
|
129
|
+
throw new Error('Existing agent-config.json has no `agents` object; aborting.');
|
|
130
|
+
}
|
|
131
|
+
const useWindows = !!sessionName && agents.length > 1;
|
|
132
|
+
const agentEntries = { ...parsed.agents };
|
|
133
|
+
for (const agent of agents) {
|
|
134
|
+
const existing = parsed.agents[agent];
|
|
135
|
+
if (!existing) {
|
|
136
|
+
agentEntries[agent] = makeAgentEntry(agent, useWindows, sessionName, defaults);
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const patched = { ...existing };
|
|
140
|
+
patched.tmux_session = useWindows ? sessionName : agent;
|
|
141
|
+
if (useWindows) {
|
|
142
|
+
patched.tmux_window = agent;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
delete patched.tmux_window;
|
|
146
|
+
}
|
|
147
|
+
if (!patched.ssh_key_secret)
|
|
148
|
+
patched.ssh_key_secret = 'AGENT_SSH_KEY';
|
|
149
|
+
// Inject workspace_dir default for old entries that lack it, so
|
|
150
|
+
// existing configs self-upgrade to enable helper invocation without
|
|
151
|
+
// requiring a hand-edit. Users can customize afterwards.
|
|
152
|
+
if (!patched.workspace_dir && defaults) {
|
|
153
|
+
patched.workspace_dir = `/home/${patched.ssh_user || 'ubuntu'}/repos/${defaults.owner}/${defaults.repo}`;
|
|
154
|
+
}
|
|
155
|
+
agentEntries[agent] = patched;
|
|
156
|
+
}
|
|
157
|
+
const out = { ...parsed, agents: agentEntries };
|
|
158
|
+
if (!out.label_to_status) {
|
|
159
|
+
out.label_to_status = { ...DEFAULT_LABEL_TO_STATUS };
|
|
160
|
+
}
|
|
161
|
+
return JSON.stringify(out, null, 2) + '\n';
|
|
162
|
+
}
|
|
163
|
+
export async function createLabel(owner, repo, token, spec) {
|
|
164
|
+
const res = await fetch(`https://api.github.com/repos/${owner}/${repo}/labels`, {
|
|
165
|
+
method: 'POST',
|
|
166
|
+
headers: {
|
|
167
|
+
'Accept': 'application/vnd.github+json',
|
|
168
|
+
'Authorization': `Bearer ${token}`,
|
|
169
|
+
'X-GitHub-Api-Version': '2022-11-28',
|
|
170
|
+
'Content-Type': 'application/json',
|
|
171
|
+
},
|
|
172
|
+
body: JSON.stringify({
|
|
173
|
+
name: spec.name,
|
|
174
|
+
color: spec.color,
|
|
175
|
+
description: spec.description,
|
|
176
|
+
}),
|
|
177
|
+
});
|
|
178
|
+
if (res.status === 201)
|
|
179
|
+
return 'created';
|
|
180
|
+
if (res.status === 422)
|
|
181
|
+
return 'exists';
|
|
182
|
+
return 'failed';
|
|
183
|
+
}
|
|
184
|
+
function writeFileSafe(path, content, force) {
|
|
185
|
+
if (existsSync(path) && !force) {
|
|
186
|
+
process.stderr.write(`Skipping existing file (use --force to overwrite): ${path}\n`);
|
|
187
|
+
return 'skipped';
|
|
188
|
+
}
|
|
189
|
+
ensureDir(path);
|
|
190
|
+
writeFileSync(path, content);
|
|
191
|
+
return 'created';
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Bootstrap a repo for MACF routing.
|
|
195
|
+
*/
|
|
196
|
+
export async function repoInit(projectDir, opts) {
|
|
197
|
+
const absDir = resolve(projectDir);
|
|
198
|
+
validateVersion(opts.actionsVersion);
|
|
199
|
+
const repo = opts.repo ?? detectRepoFromGit(absDir);
|
|
200
|
+
if (!repo) {
|
|
201
|
+
throw new Error('--repo required (or run from a git repo with a GitHub origin remote)');
|
|
202
|
+
}
|
|
203
|
+
const parts = repo.split('/');
|
|
204
|
+
if (parts.length !== 2 || !parts[0] || !parts[1]) {
|
|
205
|
+
throw new Error(`Invalid repo format: "${repo}". Expected "owner/repo".`);
|
|
206
|
+
}
|
|
207
|
+
const [owner, repoName] = parts;
|
|
208
|
+
const agentList = opts.agents ? opts.agents.split(',').map(s => s.trim()).filter(Boolean) : [];
|
|
209
|
+
const workflowPath = join(absDir, '.github', 'workflows', 'agent-router.yml');
|
|
210
|
+
const configPath = join(absDir, '.github', 'agent-config.json');
|
|
211
|
+
const workflowResult = writeFileSafe(workflowPath, generateWorkflow(opts.actionsVersion), opts.force);
|
|
212
|
+
// Agent-config handling: always merge-preserve when the file exists,
|
|
213
|
+
// regardless of --force (#82). Previously --force was required even to
|
|
214
|
+
// add new agents to an existing config; the "fresh template wins"
|
|
215
|
+
// semantic was a UX trap — users running `macf repo-init --agents foo`
|
|
216
|
+
// on an existing repo saw "Skipping existing file" and thought agents
|
|
217
|
+
// were scaffolded when nothing changed.
|
|
218
|
+
//
|
|
219
|
+
// --force now only controls the workflow file (agent-router.yml) — the
|
|
220
|
+
// workflow is regenerated from scratch (no fields to preserve), so the
|
|
221
|
+
// old "don't overwrite" guard still makes sense there.
|
|
222
|
+
//
|
|
223
|
+
// Patch is safe to call repeatedly: unchanged inputs produce the same
|
|
224
|
+
// output (idempotent), new agents are added, existing agent entries
|
|
225
|
+
// preserve app_name/host/ssh_key_secret/ssh_user/tmux_bin/workspace_dir,
|
|
226
|
+
// and top-level label_to_status + unknown keys pass through.
|
|
227
|
+
const entryDefaults = { owner: owner, repo: repoName };
|
|
228
|
+
let configResult;
|
|
229
|
+
if (existsSync(configPath)) {
|
|
230
|
+
const patched = patchAgentConfig(readFileSync(configPath, 'utf-8'), agentList, opts.sessionName, entryDefaults);
|
|
231
|
+
writeFileSync(configPath, patched);
|
|
232
|
+
configResult = 'updated';
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
const fresh = generateAgentConfig(agentList, opts.sessionName, entryDefaults);
|
|
236
|
+
const writeRes = writeFileSafe(configPath, fresh, false);
|
|
237
|
+
configResult = writeRes; // 'created' (file didn't exist) is the expected path
|
|
238
|
+
}
|
|
239
|
+
const allLabels = [...STATUS_LABELS];
|
|
240
|
+
for (const agent of agentList) {
|
|
241
|
+
allLabels.push({
|
|
242
|
+
name: agent,
|
|
243
|
+
color: AGENT_LABEL_COLOR,
|
|
244
|
+
description: `Assigned to ${agent}[bot]`,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
let token;
|
|
248
|
+
try {
|
|
249
|
+
token = await generateToken();
|
|
250
|
+
}
|
|
251
|
+
catch (err) {
|
|
252
|
+
process.stderr.write(`Warning: could not generate token (${err instanceof Error ? err.message : 'unknown'}). Skipping label creation.\n`);
|
|
253
|
+
printResults(workflowResult, configResult, [], [], []);
|
|
254
|
+
printNextSteps(configResult, agentList);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const created = [];
|
|
258
|
+
const existed = [];
|
|
259
|
+
const failed = [];
|
|
260
|
+
for (const spec of allLabels) {
|
|
261
|
+
const result = await createLabel(owner, repoName, token, spec);
|
|
262
|
+
if (result === 'created')
|
|
263
|
+
created.push(spec.name);
|
|
264
|
+
else if (result === 'exists')
|
|
265
|
+
existed.push(spec.name);
|
|
266
|
+
else
|
|
267
|
+
failed.push(spec.name);
|
|
268
|
+
}
|
|
269
|
+
printResults(workflowResult, configResult, created, existed, failed);
|
|
270
|
+
printNextSteps(configResult, agentList);
|
|
271
|
+
}
|
|
272
|
+
function printResults(workflowResult, configResult, created, existed, failed) {
|
|
273
|
+
if (workflowResult === 'created')
|
|
274
|
+
console.log('✓ Created .github/workflows/agent-router.yml');
|
|
275
|
+
if (configResult === 'created')
|
|
276
|
+
console.log('✓ Created .github/agent-config.json');
|
|
277
|
+
if (configResult === 'updated')
|
|
278
|
+
console.log('✓ Patched .github/agent-config.json (preserving existing entries)');
|
|
279
|
+
if (created.length > 0)
|
|
280
|
+
console.log(`✓ Created labels: ${created.join(', ')}`);
|
|
281
|
+
if (existed.length > 0)
|
|
282
|
+
console.log(` Labels already exist: ${existed.join(', ')}`);
|
|
283
|
+
if (failed.length > 0)
|
|
284
|
+
console.error(`✗ Failed to create labels: ${failed.join(', ')}`);
|
|
285
|
+
}
|
|
286
|
+
function printNextSteps(configResult, agentList) {
|
|
287
|
+
console.log('\nNext steps:\n');
|
|
288
|
+
if (configResult === 'created' && agentList.length === 0) {
|
|
289
|
+
console.log(' 1. Edit .github/agent-config.json to set your agents\' hosts and tmux sessions');
|
|
290
|
+
}
|
|
291
|
+
else if (configResult === 'created') {
|
|
292
|
+
console.log(' 1. Edit .github/agent-config.json and replace <agent-host-ip> placeholders');
|
|
293
|
+
}
|
|
294
|
+
else if (configResult === 'updated') {
|
|
295
|
+
console.log(' 1. Review .github/agent-config.json — existing entries preserved, only tmux fields updated');
|
|
296
|
+
}
|
|
297
|
+
console.log(' 2. Set repo secrets (Settings → Secrets and variables → Actions):');
|
|
298
|
+
console.log(' - AGENT_SSH_KEY: SSH private key for connecting to agent hosts');
|
|
299
|
+
console.log(' - TS_OAUTH_CLIENT_ID: Tailscale OAuth client ID');
|
|
300
|
+
console.log(' - TS_OAUTH_SECRET: Tailscale OAuth secret');
|
|
301
|
+
console.log(' 3. Install your agent GitHub Apps on this repo');
|
|
302
|
+
console.log(' 4. Commit and push: git add .github/ && git commit -m "chore: bootstrap MACF routing"');
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=repo-init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-init.js","sourceRoot":"","sources":["../../../src/cli/commands/repo-init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAsBtD,MAAM,aAAa,GAAyB;IAC1C,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE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C;IACrF,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,yFAAyF,CAAC,CAAC;AACzG,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface RulesRefreshResult {
|
|
2
|
+
readonly rules: readonly string[];
|
|
3
|
+
readonly scripts: readonly string[];
|
|
4
|
+
readonly hookInstalled: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Copy canonical rules + scripts into <targetDir>/.claude/. Target must
|
|
8
|
+
* exist and be a directory. Returns copied filenames for caller logging.
|
|
9
|
+
*
|
|
10
|
+
* Unlike `macf update`, this does not read `.macf/macf-agent.json` — it
|
|
11
|
+
* runs against any Claude Code workspace, MACF-init'd or not.
|
|
12
|
+
*/
|
|
13
|
+
export declare function rulesRefresh(targetDir: string): RulesRefreshResult;
|
|
14
|
+
//# sourceMappingURL=rules-refresh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-refresh.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/rules-refresh.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAyClE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* macf rules refresh: distribute canonical coordination rules + helper
|
|
3
|
+
* scripts to a workspace, without requiring full `macf init`.
|
|
4
|
+
*
|
|
5
|
+
* `macf update` refreshes these assets too, but only for workspaces that
|
|
6
|
+
* already have a `.macf/macf-agent.json`. Several Claude Code workspaces
|
|
7
|
+
* coordinate with MACF agents but don't (or can't) run full `macf init`:
|
|
8
|
+
*
|
|
9
|
+
* - groundnuty/macf — the framework repo where code-agent lives; its
|
|
10
|
+
* .claude/ is hand-curated and predates `macf init`.
|
|
11
|
+
* - groundnuty/macf-science-agent — same situation for science-agent.
|
|
12
|
+
* - Any workspace operated by a bot that isn't a MACF-registered agent
|
|
13
|
+
* but still wants the canonical coordination rules (escalation,
|
|
14
|
+
* mergeStateStatus interpretation, @mention routing, etc.).
|
|
15
|
+
*
|
|
16
|
+
* For those workspaces, `macf rules refresh --dir <path>` copies the same
|
|
17
|
+
* canonical files that `macf init` / `macf update` would copy, with no
|
|
18
|
+
* dependence on App credentials, registry, certs, or pin state.
|
|
19
|
+
*/
|
|
20
|
+
import { existsSync, statSync } from 'node:fs';
|
|
21
|
+
import { copyCanonicalRules, copyCanonicalScripts } from '../rules.js';
|
|
22
|
+
import { installGhTokenHook, installPluginSkillPermissions, installSandboxFdAllowRead } from '../settings-writer.js';
|
|
23
|
+
/**
|
|
24
|
+
* Copy canonical rules + scripts into <targetDir>/.claude/. Target must
|
|
25
|
+
* exist and be a directory. Returns copied filenames for caller logging.
|
|
26
|
+
*
|
|
27
|
+
* Unlike `macf update`, this does not read `.macf/macf-agent.json` — it
|
|
28
|
+
* runs against any Claude Code workspace, MACF-init'd or not.
|
|
29
|
+
*/
|
|
30
|
+
export function rulesRefresh(targetDir) {
|
|
31
|
+
if (!existsSync(targetDir)) {
|
|
32
|
+
throw new Error(`Target directory does not exist: ${targetDir}`);
|
|
33
|
+
}
|
|
34
|
+
if (!statSync(targetDir).isDirectory()) {
|
|
35
|
+
throw new Error(`Target is not a directory: ${targetDir}`);
|
|
36
|
+
}
|
|
37
|
+
const rules = copyCanonicalRules(targetDir);
|
|
38
|
+
const scripts = copyCanonicalScripts(targetDir);
|
|
39
|
+
// Refresh the attribution-trap PreToolUse hook entry (merge-preserving,
|
|
40
|
+
// per #140). Keeps non-init'd workspaces (the macf repo itself, CV,
|
|
41
|
+
// etc.) in sync with the same structural guard as macf-init'd agents.
|
|
42
|
+
installGhTokenHook(targetDir);
|
|
43
|
+
// Pre-approve macf-agent plugin skills so SessionStart auto-pickup
|
|
44
|
+
// + /macf-status / /macf-issues don't hit interactive approval
|
|
45
|
+
// dialogs. See macf#189 sub-item 2.
|
|
46
|
+
installPluginSkillPermissions(targetDir);
|
|
47
|
+
// Install /proc/self/fd/** in sandbox.filesystem.allowRead so
|
|
48
|
+
// every Bash tool call stops failing with permission-denied on
|
|
49
|
+
// the harness fd. macf#200.
|
|
50
|
+
installSandboxFdAllowRead(targetDir);
|
|
51
|
+
if (rules.length > 0) {
|
|
52
|
+
console.log(`Refreshed ${rules.length} canonical rule file(s) in .claude/rules/:`);
|
|
53
|
+
for (const name of rules)
|
|
54
|
+
console.log(` ${name}`);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
console.log('No canonical rule files found in CLI package (nothing to copy).');
|
|
58
|
+
}
|
|
59
|
+
if (scripts.length > 0) {
|
|
60
|
+
console.log(`Refreshed ${scripts.length} helper script(s) in .claude/scripts/:`);
|
|
61
|
+
for (const name of scripts)
|
|
62
|
+
console.log(` ${name}`);
|
|
63
|
+
}
|
|
64
|
+
console.log('Refreshed gh-token guard hook in .claude/settings.json');
|
|
65
|
+
return { rules, scripts, hookInstalled: true };
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=rules-refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-refresh.js","sourceRoot":"","sources":["../../../src/cli/commands/rules-refresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CA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AAK,MAAM,IAAI,IAAI,OAAO;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IAEtE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SelfUpdateResult {
|
|
2
|
+
readonly updated: boolean;
|
|
3
|
+
readonly previousCommit: string;
|
|
4
|
+
readonly newCommit: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Run the self-update sequence in `sourceRepoDir` (typically the
|
|
8
|
+
* result of findCliPackageRoot()).
|
|
9
|
+
*
|
|
10
|
+
* Set MACF_SELF_UPDATE_SKIP_BUILD=1 to skip the `npm run build` step
|
|
11
|
+
* (used by unit tests that don't want to exercise npm).
|
|
12
|
+
*/
|
|
13
|
+
export declare function selfUpdate(sourceRepoDir: string): SelfUpdateResult;
|
|
14
|
+
//# sourceMappingURL=self-update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"self-update.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/self-update.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAUD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,gBAAgB,CA4FlE"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* macf self-update — pulls main + rebuilds the CLI's own dist/ (#144).
|
|
3
|
+
*
|
|
4
|
+
* Solves the stale-dist recurrence where operators `npm link`-ed to the
|
|
5
|
+
* macf source repo hit silent no-op behavior after a CLI-behavior PR
|
|
6
|
+
* merged: the installed binary points at an older `dist/cli/index.js`
|
|
7
|
+
* because no one ran `npm run build`.
|
|
8
|
+
*
|
|
9
|
+
* This command fetches + ff-merges origin/main into the local source
|
|
10
|
+
* checkout, then runs `npm run build` to refresh `dist/`. No-op when
|
|
11
|
+
* already up-to-date. Refuses to run on a dirty tree or divergent
|
|
12
|
+
* local commits — operator cleans up by hand; we don't guess.
|
|
13
|
+
*
|
|
14
|
+
* Bootstrap limitation: this command only helps CLI versions at or
|
|
15
|
+
* after #144. Pre-#144 upgrades were silent; existing workspaces pick
|
|
16
|
+
* up detection on first rebuild after this PR lands.
|
|
17
|
+
*/
|
|
18
|
+
import { execFileSync } from 'node:child_process';
|
|
19
|
+
import { existsSync } from 'node:fs';
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
function git(cwd, ...args) {
|
|
22
|
+
return execFileSync('git', args, {
|
|
23
|
+
cwd,
|
|
24
|
+
encoding: 'utf-8',
|
|
25
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
26
|
+
}).trim();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Run the self-update sequence in `sourceRepoDir` (typically the
|
|
30
|
+
* result of findCliPackageRoot()).
|
|
31
|
+
*
|
|
32
|
+
* Set MACF_SELF_UPDATE_SKIP_BUILD=1 to skip the `npm run build` step
|
|
33
|
+
* (used by unit tests that don't want to exercise npm).
|
|
34
|
+
*/
|
|
35
|
+
export function selfUpdate(sourceRepoDir) {
|
|
36
|
+
if (!existsSync(join(sourceRepoDir, '.git'))) {
|
|
37
|
+
throw new Error(`${sourceRepoDir} is not a git-cloned install (no .git/ directory). ` +
|
|
38
|
+
`self-update only works for npm-link dev installs, not tarball extracts. ` +
|
|
39
|
+
`See the bootstrap-limitation note in #144.`);
|
|
40
|
+
}
|
|
41
|
+
// Refuse dirty trees — operator may have in-flight work we'd lose.
|
|
42
|
+
// Clamp the status output to the first 20 lines so a pathological
|
|
43
|
+
// dirty state (e.g. `rm -rf node_modules/` before the rebuild) doesn't
|
|
44
|
+
// produce a wall of text in the error. 20 lines is enough context for
|
|
45
|
+
// a typical few-modified-files case; beyond that the operator needs
|
|
46
|
+
// to run `git status` themselves anyway. Per science-agent's #144
|
|
47
|
+
// review non-blocker.
|
|
48
|
+
const status = git(sourceRepoDir, 'status', '--porcelain');
|
|
49
|
+
if (status !== '') {
|
|
50
|
+
const lines = status.split('\n');
|
|
51
|
+
const shown = lines.slice(0, 20).join('\n');
|
|
52
|
+
const truncation = lines.length > 20
|
|
53
|
+
? `\n... (${lines.length - 20} more; run \`git status\` to see them all)`
|
|
54
|
+
: '';
|
|
55
|
+
throw new Error(`working tree is dirty in ${sourceRepoDir}:\n${shown}${truncation}\n` +
|
|
56
|
+
`self-update refuses to overwrite uncommitted changes. ` +
|
|
57
|
+
`Commit or stash first, then re-run.`);
|
|
58
|
+
}
|
|
59
|
+
const previousCommit = git(sourceRepoDir, 'rev-parse', 'HEAD');
|
|
60
|
+
// Fetch origin/main (don't merge yet — we want to decide based on
|
|
61
|
+
// divergence first).
|
|
62
|
+
git(sourceRepoDir, 'fetch', 'origin', 'main');
|
|
63
|
+
const remoteCommit = git(sourceRepoDir, 'rev-parse', 'origin/main');
|
|
64
|
+
if (previousCommit === remoteCommit) {
|
|
65
|
+
console.log(`Already up-to-date at ${previousCommit.slice(0, 7)} — no update needed.`);
|
|
66
|
+
return { updated: false, previousCommit, newCommit: previousCommit };
|
|
67
|
+
}
|
|
68
|
+
// Check for divergence: if local HEAD isn't an ancestor of remote,
|
|
69
|
+
// ff-only would fail — surface a clear error instead of letting git
|
|
70
|
+
// spit its usual "non-fast-forward" message.
|
|
71
|
+
try {
|
|
72
|
+
git(sourceRepoDir, 'merge-base', '--is-ancestor', previousCommit, remoteCommit);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
throw new Error(`local HEAD has diverged from origin/main (non-fast-forward, ff-only would fail). ` +
|
|
76
|
+
`Rebase or reset manually, then re-run self-update. Local: ${previousCommit.slice(0, 7)}, ` +
|
|
77
|
+
`remote: ${remoteCommit.slice(0, 7)}.`);
|
|
78
|
+
}
|
|
79
|
+
console.log(`Fast-forwarding ${previousCommit.slice(0, 7)} → ${remoteCommit.slice(0, 7)}...`);
|
|
80
|
+
git(sourceRepoDir, 'merge', '--ff-only', 'origin/main');
|
|
81
|
+
// Only reinstall deps when package-lock.json actually changed between
|
|
82
|
+
// commits. `npm ci` is load-bearing when deps move (nukes node_modules
|
|
83
|
+
// and reinstalls from lockfile — correctness-critical for a rebuild)
|
|
84
|
+
// but on the common case where a PR touches only `src/`, it's
|
|
85
|
+
// minutes of wasted cold-cache time. Caught in the post-#140 audit
|
|
86
|
+
// pass, 2026-04-20. `git diff --quiet` exits 0 on no-diff, non-zero
|
|
87
|
+
// on any diff — exactly the signal we want.
|
|
88
|
+
let lockChanged = false;
|
|
89
|
+
try {
|
|
90
|
+
execFileSync('git', ['diff', '--quiet', previousCommit, remoteCommit, '--', 'package-lock.json'], { cwd: sourceRepoDir, stdio: 'ignore' });
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
lockChanged = true;
|
|
94
|
+
}
|
|
95
|
+
if (lockChanged) {
|
|
96
|
+
console.log('package-lock.json changed; will run `npm ci` to refresh node_modules.');
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
console.log('package-lock.json unchanged; skipping `npm ci` (deps already up-to-date).');
|
|
100
|
+
}
|
|
101
|
+
if (process.env['MACF_SELF_UPDATE_SKIP_BUILD'] !== '1') {
|
|
102
|
+
if (lockChanged) {
|
|
103
|
+
execFileSync('npm', ['ci'], { cwd: sourceRepoDir, stdio: 'inherit' });
|
|
104
|
+
}
|
|
105
|
+
console.log('Running `npm run build` to refresh dist/...');
|
|
106
|
+
execFileSync('npm', ['run', 'build'], { cwd: sourceRepoDir, stdio: 'inherit' });
|
|
107
|
+
}
|
|
108
|
+
const newCommit = git(sourceRepoDir, 'rev-parse', 'HEAD');
|
|
109
|
+
console.log(`CLI refreshed — now at ${newCommit.slice(0, 7)}.`);
|
|
110
|
+
return { updated: true, previousCommit, newCommit };
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=self-update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"self-update.js","sourceRoot":"","sources":["../../../src/cli/commands/self-update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAQjC,SAAS,GAAG,CAAC,GAAW,EAAE,GAAG,IAAc;IACzC,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;QAC/B,GAAG;QACH,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;KAClC,CAAC,CAAC,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,aAAqB;IAC9C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CACb,GAAG,aAAa,qDAAqD;YACnE,0EAA0E;YAC1E,4CAA4C,CAC/C,CAAC;IACJ,CAAC;IAED,mEAAmE;IACnE,kEAAkE;IAClE,uEAAuE;IACvE,sEAAsE;IACtE,oEAAoE;IACpE,kEAAkE;IAClE,sBAAsB;IACtB,MAAM,MAAM,GAAG,GAAG,CAAC,aAAa,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;IAC3D,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QAClB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,KAAK,GAAG,K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,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,0BAA0B,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Show status of registered agents by pinging their /health endpoints.
|
|
3
|
+
*
|
|
4
|
+
* If projectDir is given, uses that project's config for registry access
|
|
5
|
+
* (scopes the view to that project's peers). Otherwise loads all agents
|
|
6
|
+
* from the global index and uses the first one's config.
|
|
7
|
+
*/
|
|
8
|
+
export declare function showStatus(projectDir?: string): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/status.ts"],"names":[],"mappings":"AAgBA;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkFnE"}
|