@orchestrator-claude/definitions 3.32.2 → 3.34.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/README.md +145 -0
- package/agents/adversarial-reviewer.md +2 -2
- package/agents/azure-devops-engineer.md +9 -1
- package/agents/cicd-platform-engineer.md +477 -0
- package/agents/debug-sidecar.md +6 -1
- package/agents/doc-sidecar.md +6 -1
- package/agents/frontend-engineer.md +173 -0
- package/agents/implementer.md +39 -23
- package/agents/methodology-researcher.md +2 -1
- package/agents/operational-artifact-builder.md +2 -1
- package/agents/orchestrator.md +47 -76
- package/agents/planner.md +2 -2
- package/agents/presentation-engineer.md +1 -1
- package/agents/python-data-engineer.md +214 -0
- package/agents/reviewer.md +16 -8
- package/agents/specifier.md +1 -1
- package/agents/task-generator.md +1 -1
- package/agents/test-sidecar.md +15 -4
- package/dist/cli.js +78 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/DiffCommand.js +1 -1
- package/dist/commands/DiffCommand.js.map +1 -1
- package/dist/commands/InstallCommand.d.ts +41 -0
- package/dist/commands/InstallCommand.d.ts.map +1 -0
- package/dist/commands/InstallCommand.js +253 -0
- package/dist/commands/InstallCommand.js.map +1 -0
- package/dist/http/ApiClient.d.ts +5 -0
- package/dist/http/ApiClient.d.ts.map +1 -1
- package/dist/http/ApiClient.js.map +1 -1
- package/dist/install/DevCheckoutDetector.d.ts +66 -0
- package/dist/install/DevCheckoutDetector.d.ts.map +1 -0
- package/dist/install/DevCheckoutDetector.js +150 -0
- package/dist/install/DevCheckoutDetector.js.map +1 -0
- package/dist/install/HooksWirer.d.ts +29 -0
- package/dist/install/HooksWirer.d.ts.map +1 -0
- package/dist/install/HooksWirer.js +80 -0
- package/dist/install/HooksWirer.js.map +1 -0
- package/dist/install/LocalDiffReporter.d.ts +25 -0
- package/dist/install/LocalDiffReporter.d.ts.map +1 -0
- package/dist/install/LocalDiffReporter.js +50 -0
- package/dist/install/LocalDiffReporter.js.map +1 -0
- package/dist/install/Materializer.d.ts +67 -0
- package/dist/install/Materializer.d.ts.map +1 -0
- package/dist/install/Materializer.js +196 -0
- package/dist/install/Materializer.js.map +1 -0
- package/dist/install/McpRegistrar.d.ts +63 -0
- package/dist/install/McpRegistrar.d.ts.map +1 -0
- package/dist/install/McpRegistrar.js +114 -0
- package/dist/install/McpRegistrar.js.map +1 -0
- package/dist/install/ProcessRunner.d.ts +25 -0
- package/dist/install/ProcessRunner.d.ts.map +1 -0
- package/dist/install/ProcessRunner.js +41 -0
- package/dist/install/ProcessRunner.js.map +1 -0
- package/dist/install/ProjectSettingsNeutralizer.d.ts +39 -0
- package/dist/install/ProjectSettingsNeutralizer.d.ts.map +1 -0
- package/dist/install/ProjectSettingsNeutralizer.js +100 -0
- package/dist/install/ProjectSettingsNeutralizer.js.map +1 -0
- package/dist/install/types.d.ts +52 -0
- package/dist/install/types.d.ts.map +1 -0
- package/dist/install/types.js +8 -0
- package/dist/install/types.js.map +1 -0
- package/dist/manifest/ManifestLoader.d.ts.map +1 -1
- package/dist/manifest/ManifestLoader.js +3 -2
- package/dist/manifest/ManifestLoader.js.map +1 -1
- package/dist/manifest/types.d.ts +3 -0
- package/dist/manifest/types.d.ts.map +1 -1
- package/dist/scripts/bundle-hooks.d.ts +39 -0
- package/dist/scripts/bundle-hooks.d.ts.map +1 -0
- package/dist/scripts/bundle-hooks.js +165 -0
- package/dist/scripts/bundle-hooks.js.map +1 -0
- package/dist/scripts/generate-manifest.d.ts +22 -3
- package/dist/scripts/generate-manifest.d.ts.map +1 -1
- package/dist/scripts/generate-manifest.js +78 -35
- package/dist/scripts/generate-manifest.js.map +1 -1
- package/hooks/dangling-guard.mjs +7426 -0
- package/hooks/dangling-guard.ts +223 -6
- package/hooks/gate-guardian.mjs +463 -0
- package/hooks/hooks.json +63 -0
- package/hooks/lib/additional-directories-sync.ts +295 -0
- package/hooks/lib/api-client.ts +388 -7
- package/hooks/lib/session-selection.ts +81 -0
- package/hooks/mailbox-listener.mjs +259 -0
- package/hooks/post-compact.mjs +7931 -0
- package/hooks/post-implement.mjs +238 -0
- package/hooks/session-start.mjs +8234 -0
- package/hooks/session-start.ts +264 -23
- package/hooks/sprint-registry.mjs +59 -0
- package/hooks/subagent-start.mjs +289 -0
- package/hooks/subagent-stop.mjs +7793 -0
- package/hooks/subagent-stop.ts +4 -2
- package/hooks/user-prompt.mjs +329 -0
- package/hooks/workflow-guard.mjs +7805 -0
- package/hooks/workflow-guard.ts +360 -119
- package/hooks-settings-template.json +63 -0
- package/manifest.json +124 -90
- package/mcp-servers.json +48 -0
- package/package.json +10 -4
- package/personas/auditor-compliance.md +104 -0
- package/personas/cfo-conservador.md +88 -0
- package/personas/designer-perfeccionista.md +104 -0
- package/personas/diretor-cetico-fmcg.md +80 -0
- package/personas/engenheiro-cetico-construcao.md +107 -0
- package/skills/artifact-generator/SKILL.md +1 -1
- package/skills/artifact-production/SKILL.md +28 -0
- package/skills/backlog-synthesis/SKILL.md +8 -3
- package/skills/checkpoint-protocol/SKILL.md +7 -0
- package/skills/infographic-engine/SKILL.md +116 -0
- package/skills/orchestrator/SKILL.md +93 -7
- package/skills/persona-library/SKILL.md +1 -1
- package/skills/project-conventions/SKILL.md +53 -30
- package/skills/project-management-enterprise/SKILL.md +1 -1
- package/skills/python-data-engineering/SKILL.md +792 -0
- package/skills/release/SKILL.md +29 -18
- package/skills/release/release.sh +65 -4
- package/skills/storybook-validated-loop/SKILL.md +110 -0
- package/skills/tdd-discipline/SKILL.md +16 -0
- package/skills/workflow-coordination/SKILL.md +117 -16
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InstallCommand - orchestrates the 5 SRP install modules (Materializer,
|
|
3
|
+
* McpRegistrar, HooksWirer, ProjectSettingsNeutralizer, DevCheckoutDetector)
|
|
4
|
+
* per spec §6's 7-step atomicity sequence:
|
|
5
|
+
* 1. Stage (Materializer.stage() + copySkillAssets())
|
|
6
|
+
* 2. Verify (Materializer.verify(stagingDir))
|
|
7
|
+
* 3. MCP (McpRegistrar.checkClaudeAvailable() + ensureRegistered())
|
|
8
|
+
* 4. Swap (Materializer.swap(stagingDir) + HooksWirer.wire())
|
|
9
|
+
* 5. Backup (ProjectSettingsNeutralizer.backup())
|
|
10
|
+
* 6. Neutralize — the point of no return (ProjectSettingsNeutralizer.neutralize())
|
|
11
|
+
* 7. Report
|
|
12
|
+
*
|
|
13
|
+
* ADR-001: this class is deliberately thin — pure orchestration, no I/O logic
|
|
14
|
+
* of its own beyond reading the 2 bundled JSON assets (hooks template, MCP
|
|
15
|
+
* server list) that the constructor's `packageRoot` ships alongside the
|
|
16
|
+
* manifest. Never imports `ApiClient` (ADR-005) — `install`'s target is the
|
|
17
|
+
* operator's local filesystem + the `claude` CLI, not the orchestrator API.
|
|
18
|
+
*
|
|
19
|
+
* Atomicity (AC-005, TASK-031/032): every step from `stage()` through
|
|
20
|
+
* `swap()`'s post-swap verification runs inside ONE try/catch. Any throw —
|
|
21
|
+
* whether from `stage()`, `verify()`, the MCP step, or `swap()` — jumps
|
|
22
|
+
* straight to the catch, which builds an abort `InstallResult` WITHOUT ever
|
|
23
|
+
* reaching `ProjectSettingsNeutralizer.backup()`/`neutralize()` (both
|
|
24
|
+
* declared strictly AFTER the post-swap verification, by construction — no
|
|
25
|
+
* code path reaches them except after a verified-successful swap). Only
|
|
26
|
+
* `neutralize()` itself has a nested try/catch that calls
|
|
27
|
+
* `ProjectSettingsNeutralizer.restore(bakPath)` before propagating (AC-006).
|
|
28
|
+
*/
|
|
29
|
+
import { existsSync, readFileSync, rmSync } from 'node:fs';
|
|
30
|
+
import { createRequire } from 'node:module';
|
|
31
|
+
import { homedir } from 'node:os';
|
|
32
|
+
import { join } from 'node:path';
|
|
33
|
+
import { ManifestLoader } from '../manifest/ManifestLoader.js';
|
|
34
|
+
import { Materializer } from '../install/Materializer.js';
|
|
35
|
+
import { McpRegistrar } from '../install/McpRegistrar.js';
|
|
36
|
+
import { NodeProcessRunner } from '../install/ProcessRunner.js';
|
|
37
|
+
import { HooksWirer } from '../install/HooksWirer.js';
|
|
38
|
+
import { ProjectSettingsNeutralizer } from '../install/ProjectSettingsNeutralizer.js';
|
|
39
|
+
import { DevCheckoutDetector } from '../install/DevCheckoutDetector.js';
|
|
40
|
+
import { LocalDiffReporter } from '../install/LocalDiffReporter.js';
|
|
41
|
+
const MONOREPO_ROOT_PLACEHOLDER = '{{MONOREPO_ROOT}}';
|
|
42
|
+
function emptySummary() {
|
|
43
|
+
return {
|
|
44
|
+
filesWritten: 0,
|
|
45
|
+
filesUnchanged: 0,
|
|
46
|
+
mcpServersRegistered: 0,
|
|
47
|
+
mcpServersSkipped: 0,
|
|
48
|
+
hooksWired: false,
|
|
49
|
+
projectNeutralized: false,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export class InstallCommand {
|
|
53
|
+
loader;
|
|
54
|
+
constructor(packageRoot) {
|
|
55
|
+
this.loader = new ManifestLoader(packageRoot);
|
|
56
|
+
}
|
|
57
|
+
async execute(options) {
|
|
58
|
+
const homeDir = options.homeDir ?? homedir();
|
|
59
|
+
const cwd = options.cwd ?? process.cwd();
|
|
60
|
+
const targetRoot = join(homeDir, '.claude');
|
|
61
|
+
const targetSettingsPath = join(targetRoot, 'settings.json');
|
|
62
|
+
const projectSettingsPath = join(cwd, '.claude', 'settings.json');
|
|
63
|
+
const warnings = [];
|
|
64
|
+
const errors = [];
|
|
65
|
+
const summary = emptySummary();
|
|
66
|
+
const manifest = this.loader.load();
|
|
67
|
+
const manifestAgentSlugs = manifest.definitions.agents.map((entry) => entry.slug);
|
|
68
|
+
const detector = new DevCheckoutDetector(manifestAgentSlugs);
|
|
69
|
+
const detection = detector.detect(cwd);
|
|
70
|
+
// Gate: dev-checkout without explicit ack aborts BEFORE step 1 (RF-002, AC-010) —
|
|
71
|
+
// no other module is ever touched on this path.
|
|
72
|
+
if (detection.mode === 'dev-checkout' && !options.devCheckoutAck) {
|
|
73
|
+
return this.buildResult(false, detection.mode, options, summary, warnings, [detection.reason]);
|
|
74
|
+
}
|
|
75
|
+
const materializer = new Materializer(this.loader, targetRoot);
|
|
76
|
+
const localDiffReporter = new LocalDiffReporter(this.loader, targetRoot);
|
|
77
|
+
let stagingDir;
|
|
78
|
+
try {
|
|
79
|
+
// Step 1: Stage
|
|
80
|
+
const staged = await materializer.stage();
|
|
81
|
+
stagingDir = staged.stagingDir;
|
|
82
|
+
await materializer.copySkillAssets(stagingDir);
|
|
83
|
+
// Step 2: Verify (staged content vs. manifest checksums)
|
|
84
|
+
const verifyResult = materializer.verify(stagingDir);
|
|
85
|
+
if (!verifyResult.valid) {
|
|
86
|
+
errors.push(`Checksum verification failed for staged entries: ${verifyResult.mismatches.map((m) => m.file).join(', ')}`);
|
|
87
|
+
return this.buildResult(false, detection.mode, options, summary, warnings, errors);
|
|
88
|
+
}
|
|
89
|
+
// LocalDiffReporter's plan, computed once — reused by both the
|
|
90
|
+
// --dry-run report below AND the idempotency short-circuit (RF-007).
|
|
91
|
+
const diff = localDiffReporter.report(stagingDir);
|
|
92
|
+
// --dry-run short-circuit (RF-008, AC-011): stops BEFORE step 3 (MCP) and
|
|
93
|
+
// step 4 (swap) — reports the "would-write" plan via LocalDiffReporter,
|
|
94
|
+
// never invokes `claude mcp add`, never touches targetRoot/project settings.
|
|
95
|
+
if (options.dryRun) {
|
|
96
|
+
summary.filesWritten = diff.entries.filter((e) => e.status !== 'unchanged').length;
|
|
97
|
+
summary.filesUnchanged = diff.entries.filter((e) => e.status === 'unchanged').length;
|
|
98
|
+
return this.buildResult(true, detection.mode, options, summary, warnings, errors);
|
|
99
|
+
}
|
|
100
|
+
const runner = new NodeProcessRunner();
|
|
101
|
+
const servers = this.resolveMcpServers(options.monorepoRoot, warnings);
|
|
102
|
+
const registrar = new McpRegistrar(runner, servers);
|
|
103
|
+
// Idempotency short-circuit (RF-007, AC-004 completo): nothing changed
|
|
104
|
+
// since the last install (diff has no changes) AND every configured MCP
|
|
105
|
+
// server is already registered -> skip steps 3-6 entirely, zero writes,
|
|
106
|
+
// zero `claude mcp add`.
|
|
107
|
+
const alreadyRegisteredNames = new Set(await registrar.listRegistered());
|
|
108
|
+
const allServersAlreadyRegistered = servers.every((server) => alreadyRegisteredNames.has(server.name));
|
|
109
|
+
if (!diff.hasChanges && allServersAlreadyRegistered) {
|
|
110
|
+
summary.filesWritten = 0;
|
|
111
|
+
summary.filesUnchanged = diff.entries.length;
|
|
112
|
+
summary.mcpServersRegistered = 0;
|
|
113
|
+
summary.mcpServersSkipped = servers.length;
|
|
114
|
+
return this.buildResult(true, detection.mode, options, summary, warnings, errors);
|
|
115
|
+
}
|
|
116
|
+
// Step 3: MCP registration (R-3: availability checked BEFORE any add)
|
|
117
|
+
const claudeAvailable = await registrar.checkClaudeAvailable();
|
|
118
|
+
if (!claudeAvailable) {
|
|
119
|
+
errors.push('claude CLI not found in PATH. Register MCP servers manually: ' +
|
|
120
|
+
servers.map((s) => s.name).join(', '));
|
|
121
|
+
return this.buildResult(false, detection.mode, options, summary, warnings, errors);
|
|
122
|
+
}
|
|
123
|
+
const mcpResult = await registrar.ensureRegistered();
|
|
124
|
+
summary.mcpServersRegistered = mcpResult.registered.length;
|
|
125
|
+
summary.mcpServersSkipped = mcpResult.skipped.length;
|
|
126
|
+
// Step 4: Swap + hooks wiring
|
|
127
|
+
const swapResult = await materializer.swap(stagingDir);
|
|
128
|
+
stagingDir = undefined; // swap() cleans up staging in its own finally, whether it succeeds or throws
|
|
129
|
+
summary.filesWritten = swapResult.filesWritten;
|
|
130
|
+
summary.filesUnchanged = swapResult.filesUnchanged;
|
|
131
|
+
// Post-swap verification (spec §6.4): read back targetRoot and re-compare
|
|
132
|
+
// checksums BEFORE the point of no return. `neutralize()` (step 6) must
|
|
133
|
+
// never be reached unless this passes — by construction, throwing here
|
|
134
|
+
// jumps straight to the outer catch, skipping hooks-wire/backup/neutralize.
|
|
135
|
+
const postSwapVerify = materializer.verify(targetRoot);
|
|
136
|
+
if (!postSwapVerify.valid) {
|
|
137
|
+
throw new Error(`Post-swap verification failed for: ${postSwapVerify.mismatches.map((m) => m.file).join(', ')}`);
|
|
138
|
+
}
|
|
139
|
+
const hooksTemplate = this.loadHooksTemplate();
|
|
140
|
+
const hooksWirer = new HooksWirer(hooksTemplate, targetSettingsPath);
|
|
141
|
+
hooksWirer.wire();
|
|
142
|
+
summary.hooksWired = true;
|
|
143
|
+
// Steps 5-6: Backup + neutralize (only when the project has settings to neutralize)
|
|
144
|
+
if (existsSync(projectSettingsPath)) {
|
|
145
|
+
const neutralizer = new ProjectSettingsNeutralizer(projectSettingsPath);
|
|
146
|
+
const bakPath = neutralizer.backup();
|
|
147
|
+
try {
|
|
148
|
+
const neutralizeResult = neutralizer.neutralize();
|
|
149
|
+
summary.projectNeutralized = neutralizeResult.neutralized;
|
|
150
|
+
}
|
|
151
|
+
catch (neutralizeError) {
|
|
152
|
+
neutralizer.restore(bakPath);
|
|
153
|
+
throw new Error(`Failed to neutralize project settings (restored from backup): ${neutralizeError.message}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Step 7: Report
|
|
157
|
+
return this.buildResult(true, detection.mode, options, summary, warnings, errors);
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
errors.push(error.message);
|
|
161
|
+
return this.buildResult(false, detection.mode, options, summary, warnings, errors);
|
|
162
|
+
}
|
|
163
|
+
finally {
|
|
164
|
+
if (stagingDir && existsSync(stagingDir)) {
|
|
165
|
+
rmSync(stagingDir, { recursive: true, force: true });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
buildResult(success, mode, options, summary, warnings, errors) {
|
|
170
|
+
return { success, mode, dryRun: !!options.dryRun, summary, warnings, errors };
|
|
171
|
+
}
|
|
172
|
+
loadHooksTemplate() {
|
|
173
|
+
const raw = readFileSync(join(this.loader.getPackageRoot(), 'hooks-settings-template.json'), 'utf-8');
|
|
174
|
+
return JSON.parse(raw);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Loads the bundled MCP server specs (ADR-007), resolving the
|
|
178
|
+
* `{{MONOREPO_ROOT}}` placeholder in stdio `args` per mode:
|
|
179
|
+
*
|
|
180
|
+
* - dev-checkout (`monorepoRoot` provided): in-place string
|
|
181
|
+
* substitution of the placeholder token within each arg — UNCHANGED
|
|
182
|
+
* from the original ADR-007 behavior (RNF-001, byte-for-byte).
|
|
183
|
+
* - npm-user (`monorepoRoot` absent, ADR-P001/ADR-P003): resolves the
|
|
184
|
+
* REAL installed location of `@orchestrator-claude/mcp-server` via
|
|
185
|
+
* `resolveModulePath()` and replaces ONLY the placeholder-bearing arg
|
|
186
|
+
* with the FULL resolved path — never a substring splice inside the
|
|
187
|
+
* original arg, which would leave a duplicated/invalid path (e.g.
|
|
188
|
+
* `.../mcp-server/dist/index.js/packages/mcp-server/dist/index.js`).
|
|
189
|
+
* On any resolution failure (AD-004 — e.g. a from-scratch npm install
|
|
190
|
+
* without hoisting, Yarn PnP, etc.), falls back to the pre-existing
|
|
191
|
+
* skip+warning behavior, unchanged. `resolveModulePath()` is never
|
|
192
|
+
* called at all when `monorepoRoot` is provided (AD-001).
|
|
193
|
+
*/
|
|
194
|
+
resolveMcpServers(monorepoRoot, warnings) {
|
|
195
|
+
const raw = JSON.parse(readFileSync(join(this.loader.getPackageRoot(), 'mcp-servers.json'), 'utf-8'));
|
|
196
|
+
if (monorepoRoot) {
|
|
197
|
+
return raw.servers.map((server) => ({
|
|
198
|
+
...server,
|
|
199
|
+
...(server.args
|
|
200
|
+
? { args: server.args.map((arg) => arg.replaceAll(MONOREPO_ROOT_PLACEHOLDER, monorepoRoot)) }
|
|
201
|
+
: {}),
|
|
202
|
+
}));
|
|
203
|
+
}
|
|
204
|
+
let resolvedMcpServerPath;
|
|
205
|
+
try {
|
|
206
|
+
resolvedMcpServerPath = this.resolveModulePath('@orchestrator-claude/mcp-server');
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
resolvedMcpServerPath = undefined;
|
|
210
|
+
}
|
|
211
|
+
if (resolvedMcpServerPath !== undefined) {
|
|
212
|
+
const resolvedPath = resolvedMcpServerPath;
|
|
213
|
+
return raw.servers.map((server) => ({
|
|
214
|
+
...server,
|
|
215
|
+
...(server.args
|
|
216
|
+
? {
|
|
217
|
+
args: server.args.map((arg) => arg.includes(MONOREPO_ROOT_PLACEHOLDER) ? resolvedPath : arg),
|
|
218
|
+
}
|
|
219
|
+
: {}),
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
const resolvable = [];
|
|
223
|
+
const skipped = [];
|
|
224
|
+
for (const server of raw.servers) {
|
|
225
|
+
const needsMonorepoRoot = server.args?.some((arg) => arg.includes(MONOREPO_ROOT_PLACEHOLDER)) ?? false;
|
|
226
|
+
if (needsMonorepoRoot) {
|
|
227
|
+
skipped.push(server.name);
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
resolvable.push(server);
|
|
231
|
+
}
|
|
232
|
+
if (skipped.length > 0) {
|
|
233
|
+
warnings.push(`monorepoRoot not resolved — skipping MCP servers that require it: ${skipped.join(', ')}. Use --monorepo-root to register them.`);
|
|
234
|
+
}
|
|
235
|
+
return resolvable;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Resolves a bare module specifier to its real on-disk path (ADR-P001).
|
|
239
|
+
* This file is ESM (`"type": "module"`) — bare `require.resolve` doesn't
|
|
240
|
+
* exist here, so `createRequire(import.meta.url)` is used to synthesize a
|
|
241
|
+
* CJS-style resolver bound to this file's location. Deliberately NOT
|
|
242
|
+
* `import.meta.resolve` (rejected — historically unstable/experimental
|
|
243
|
+
* across Node versions). An instance method (not a standalone function)
|
|
244
|
+
* so it is mockable via `vi.spyOn(InstallCommand.prototype,
|
|
245
|
+
* 'resolveModulePath')`, the same DI-via-prototype-spy seam already used
|
|
246
|
+
* for `Materializer`/`NodeProcessRunner`/`ProjectSettingsNeutralizer` in
|
|
247
|
+
* this class's tests.
|
|
248
|
+
*/
|
|
249
|
+
resolveModulePath(specifier) {
|
|
250
|
+
return createRequire(import.meta.url).resolve(specifier);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=InstallCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstallCommand.js","sourceRoot":"","sources":["../../src/commands/InstallCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACtF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,MAAM,yBAAyB,GAAG,mBAAmB,CAAC;AAEtD,SAAS,YAAY;IACnB,OAAO;QACL,YAAY,EAAE,CAAC;QACf,cAAc,EAAE,CAAC;QACjB,oBAAoB,EAAE,CAAC;QACvB,iBAAiB,EAAE,CAAC;QACpB,UAAU,EAAE,KAAK;QACjB,kBAAkB,EAAE,KAAK;KAC1B,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,cAAc;IACR,MAAM,CAAiB;IAExC,YAAY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,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,EAAE;YACrD,GAAG,IAAI;YACP,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,GAAI,IAAI,CAAC,OAA8C,EAAE;SACjF,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,CAAC,MAAM,IAAI,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC;QAC9E,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DevCheckoutDetector — read-only dual-condition heuristic (RF-002 / spec
|
|
3
|
+
* §5.1, ADR-004) for the "inverted precedence" risk between `.claude/agents`
|
|
4
|
+
* (project-scope) and `.claude/skills` (user-scope, per Claude Code's
|
|
5
|
+
* documentation): once the installer lands, `~/.claude/agents` resolves from
|
|
6
|
+
* the distributed package while `<repo>/.claude/agents` remains the authored
|
|
7
|
+
* source — they can diverge silently.
|
|
8
|
+
*
|
|
9
|
+
* Detection requires BOTH conditions (reduces false-positives, risk R-6):
|
|
10
|
+
* (i) walk-up from `cwd` to the nearest ancestor `package.json` whose
|
|
11
|
+
* `name` matches the orchestrator monorepo root package
|
|
12
|
+
* (`@orchestrator-cli/core` — confirmed via direct Read of
|
|
13
|
+
* `/home/cmac/workOrch-Claude/orchestrator/package.json`, plan
|
|
14
|
+
* §11 Verify-Before-Assert);
|
|
15
|
+
* (ii) that same ancestor's `.claude/agents/*.md` contains REAL files
|
|
16
|
+
* (never symlinks — `lstatSync(...).isSymbolicLink()`, distinguishing
|
|
17
|
+
* authored files from the C6/TD-204 INTERIM per-file symlinks) whose
|
|
18
|
+
* slug (basename without `.md`) collides with `manifestSlugs`.
|
|
19
|
+
*
|
|
20
|
+
* Never mutates anything — `detect()` only reads `package.json` and lists
|
|
21
|
+
* `.claude/agents/`. This module is purely read-only by design.
|
|
22
|
+
*
|
|
23
|
+
* ---
|
|
24
|
+
* MEASURED WARNING TEXT (TASK-036/AC-007 gate — CLOSED, S385):
|
|
25
|
+
* `DEV_CHECKOUT_WARNING_REASON` previously named the precedence risk
|
|
26
|
+
* WITHOUT asserting a verified direction ("provisional" — Universal
|
|
27
|
+
* Invariant 6 forbids hard-coding an unverified claim about third-party CLI
|
|
28
|
+
* behavior). `scripts/probes/ac007-precedence-probe.ts` (TASK-035) has since
|
|
29
|
+
* run the AC-007 gate for real (TASK-036): isolated `CLAUDE_CONFIG_DIR` probe
|
|
30
|
+
* (S382 method), 3/3 deterministic runs per axis, real-`~/.claude`
|
|
31
|
+
* hard-isolation-gate verified unchanged. **Verdict: CONFIRMS the documented
|
|
32
|
+
* claim** — agents resolve by PROJECT-scope, skills resolve by USER-scope.
|
|
33
|
+
* The precedence direction is NOT inverted. The text below now states this
|
|
34
|
+
* as measured fact and names the real practical risk it implies: the two
|
|
35
|
+
* scopes can still silently DRIFT APART over time (a project-scope skill
|
|
36
|
+
* edit has no effect on a live session until `orch-defs install` refreshes
|
|
37
|
+
* `~/.claude/skills`, unless the file happens to be an INTERIM symlink —
|
|
38
|
+
* C6/TD-204), independent of the (now-settled) precedence-direction
|
|
39
|
+
* question. Raw probe output: `tests/install/fixtures/
|
|
40
|
+
* ac007-precedence-probe-output.md`.
|
|
41
|
+
*/
|
|
42
|
+
import type { DetectionResult } from './types.js';
|
|
43
|
+
export declare class DevCheckoutDetector {
|
|
44
|
+
private readonly manifestSlugs;
|
|
45
|
+
constructor(manifestSlugs: string[]);
|
|
46
|
+
/**
|
|
47
|
+
* Read-only detection. Never throws on a missing `.claude/agents`
|
|
48
|
+
* directory or a missing/unparseable ancestor `package.json` — those
|
|
49
|
+
* cases simply resolve to `'clean-install'`.
|
|
50
|
+
*/
|
|
51
|
+
detect(cwd: string): DetectionResult;
|
|
52
|
+
/**
|
|
53
|
+
* Walks up from `cwd` looking for the nearest ancestor directory whose
|
|
54
|
+
* `package.json` has `name === MONOREPO_PACKAGE_NAME` (§5.1: "presença de
|
|
55
|
+
* package.json na raiz do cwd, ou ancestral via walk-up").
|
|
56
|
+
*/
|
|
57
|
+
private findAncestorWithMatchingPackageName;
|
|
58
|
+
private hasMatchingName;
|
|
59
|
+
/**
|
|
60
|
+
* Real (non-symlink) `.claude/agents/*.md` files at `root` whose slug
|
|
61
|
+
* (basename without `.md`) collides with `manifestSlugs`.
|
|
62
|
+
*/
|
|
63
|
+
private findMatchingRealAgentSlugs;
|
|
64
|
+
private cleanInstall;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=DevCheckoutDetector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevCheckoutDetector.d.ts","sourceRoot":"","sources":["../../src/install/DevCheckoutDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA4BlD,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,MAAM,EAAE;IAEpD;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe;IAkBpC;;;;OAIG;IACH,OAAO,CAAC,mCAAmC;IAiB3C,OAAO,CAAC,eAAe;IASvB;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IA4BlC,OAAO,CAAC,YAAY;CAOrB"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DevCheckoutDetector — read-only dual-condition heuristic (RF-002 / spec
|
|
3
|
+
* §5.1, ADR-004) for the "inverted precedence" risk between `.claude/agents`
|
|
4
|
+
* (project-scope) and `.claude/skills` (user-scope, per Claude Code's
|
|
5
|
+
* documentation): once the installer lands, `~/.claude/agents` resolves from
|
|
6
|
+
* the distributed package while `<repo>/.claude/agents` remains the authored
|
|
7
|
+
* source — they can diverge silently.
|
|
8
|
+
*
|
|
9
|
+
* Detection requires BOTH conditions (reduces false-positives, risk R-6):
|
|
10
|
+
* (i) walk-up from `cwd` to the nearest ancestor `package.json` whose
|
|
11
|
+
* `name` matches the orchestrator monorepo root package
|
|
12
|
+
* (`@orchestrator-cli/core` — confirmed via direct Read of
|
|
13
|
+
* `/home/cmac/workOrch-Claude/orchestrator/package.json`, plan
|
|
14
|
+
* §11 Verify-Before-Assert);
|
|
15
|
+
* (ii) that same ancestor's `.claude/agents/*.md` contains REAL files
|
|
16
|
+
* (never symlinks — `lstatSync(...).isSymbolicLink()`, distinguishing
|
|
17
|
+
* authored files from the C6/TD-204 INTERIM per-file symlinks) whose
|
|
18
|
+
* slug (basename without `.md`) collides with `manifestSlugs`.
|
|
19
|
+
*
|
|
20
|
+
* Never mutates anything — `detect()` only reads `package.json` and lists
|
|
21
|
+
* `.claude/agents/`. This module is purely read-only by design.
|
|
22
|
+
*
|
|
23
|
+
* ---
|
|
24
|
+
* MEASURED WARNING TEXT (TASK-036/AC-007 gate — CLOSED, S385):
|
|
25
|
+
* `DEV_CHECKOUT_WARNING_REASON` previously named the precedence risk
|
|
26
|
+
* WITHOUT asserting a verified direction ("provisional" — Universal
|
|
27
|
+
* Invariant 6 forbids hard-coding an unverified claim about third-party CLI
|
|
28
|
+
* behavior). `scripts/probes/ac007-precedence-probe.ts` (TASK-035) has since
|
|
29
|
+
* run the AC-007 gate for real (TASK-036): isolated `CLAUDE_CONFIG_DIR` probe
|
|
30
|
+
* (S382 method), 3/3 deterministic runs per axis, real-`~/.claude`
|
|
31
|
+
* hard-isolation-gate verified unchanged. **Verdict: CONFIRMS the documented
|
|
32
|
+
* claim** — agents resolve by PROJECT-scope, skills resolve by USER-scope.
|
|
33
|
+
* The precedence direction is NOT inverted. The text below now states this
|
|
34
|
+
* as measured fact and names the real practical risk it implies: the two
|
|
35
|
+
* scopes can still silently DRIFT APART over time (a project-scope skill
|
|
36
|
+
* edit has no effect on a live session until `orch-defs install` refreshes
|
|
37
|
+
* `~/.claude/skills`, unless the file happens to be an INTERIM symlink —
|
|
38
|
+
* C6/TD-204), independent of the (now-settled) precedence-direction
|
|
39
|
+
* question. Raw probe output: `tests/install/fixtures/
|
|
40
|
+
* ac007-precedence-probe-output.md`.
|
|
41
|
+
*/
|
|
42
|
+
import { existsSync, lstatSync, readFileSync, readdirSync } from 'node:fs';
|
|
43
|
+
import { dirname, join, resolve } from 'node:path';
|
|
44
|
+
/** Root package name of the orchestrator monorepo (Verify-Before-Assert, plan §11). */
|
|
45
|
+
const MONOREPO_PACKAGE_NAME = '@orchestrator-cli/core';
|
|
46
|
+
/**
|
|
47
|
+
* DEFINITIVE (measured — see module JSDoc / TASK-036 gate, S385). Names the
|
|
48
|
+
* precedence direction as a settled, empirically-confirmed fact and the
|
|
49
|
+
* real practical risk it implies (silent drift), not a hypothetical.
|
|
50
|
+
*/
|
|
51
|
+
const DEV_CHECKOUT_WARNING_REASON = 'Dev-checkout detectado: este cwd pertence ao monorepo orchestrator e ' +
|
|
52
|
+
'`.claude/agents/` contém arquivos reais cujos slugs colidem com o ' +
|
|
53
|
+
'manifest do pacote. Precedência MEDIDA empiricamente (AC-007/TASK-036, ' +
|
|
54
|
+
'gate S385, 3/3 runs determinísticos por eixo, probe isolado): agents ' +
|
|
55
|
+
'resolvem por PROJECT-scope (edições locais neste repo têm efeito ' +
|
|
56
|
+
'imediato numa sessão live) e skills resolvem por USER-scope ' +
|
|
57
|
+
'(`~/.claude/skills`) — editar um skill aqui NÃO afeta uma sessão live ' +
|
|
58
|
+
'até rodar `orch-defs install` novamente, a menos que o arquivo esteja ' +
|
|
59
|
+
'symlinkado (INTERIM/C6-TD-204). Isso CONFIRMA a direção documentada ' +
|
|
60
|
+
'pelo Claude Code (não é uma precedência invertida) — o risco real é a ' +
|
|
61
|
+
'divergência SILENCIOSA entre as duas cópias ao longo do tempo, não a ' +
|
|
62
|
+
'direção da precedência em si.';
|
|
63
|
+
export class DevCheckoutDetector {
|
|
64
|
+
manifestSlugs;
|
|
65
|
+
constructor(manifestSlugs) {
|
|
66
|
+
this.manifestSlugs = manifestSlugs;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Read-only detection. Never throws on a missing `.claude/agents`
|
|
70
|
+
* directory or a missing/unparseable ancestor `package.json` — those
|
|
71
|
+
* cases simply resolve to `'clean-install'`.
|
|
72
|
+
*/
|
|
73
|
+
detect(cwd) {
|
|
74
|
+
const monorepoRoot = this.findAncestorWithMatchingPackageName(cwd);
|
|
75
|
+
if (!monorepoRoot) {
|
|
76
|
+
return this.cleanInstall();
|
|
77
|
+
}
|
|
78
|
+
const matchedSlugs = this.findMatchingRealAgentSlugs(monorepoRoot);
|
|
79
|
+
if (matchedSlugs.length === 0) {
|
|
80
|
+
return this.cleanInstall();
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
mode: 'dev-checkout',
|
|
84
|
+
matchedSlugs,
|
|
85
|
+
reason: DEV_CHECKOUT_WARNING_REASON,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Walks up from `cwd` looking for the nearest ancestor directory whose
|
|
90
|
+
* `package.json` has `name === MONOREPO_PACKAGE_NAME` (§5.1: "presença de
|
|
91
|
+
* package.json na raiz do cwd, ou ancestral via walk-up").
|
|
92
|
+
*/
|
|
93
|
+
findAncestorWithMatchingPackageName(cwd) {
|
|
94
|
+
let current = resolve(cwd);
|
|
95
|
+
while (true) {
|
|
96
|
+
const packageJsonPath = join(current, 'package.json');
|
|
97
|
+
if (existsSync(packageJsonPath) && this.hasMatchingName(packageJsonPath)) {
|
|
98
|
+
return current;
|
|
99
|
+
}
|
|
100
|
+
const parent = dirname(current);
|
|
101
|
+
if (parent === current) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
current = parent;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
hasMatchingName(packageJsonPath) {
|
|
108
|
+
try {
|
|
109
|
+
const parsed = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
|
|
110
|
+
return parsed.name === MONOREPO_PACKAGE_NAME;
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Real (non-symlink) `.claude/agents/*.md` files at `root` whose slug
|
|
118
|
+
* (basename without `.md`) collides with `manifestSlugs`.
|
|
119
|
+
*/
|
|
120
|
+
findMatchingRealAgentSlugs(root) {
|
|
121
|
+
const agentsDir = join(root, '.claude', 'agents');
|
|
122
|
+
if (!existsSync(agentsDir)) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
const manifestSlugSet = new Set(this.manifestSlugs);
|
|
126
|
+
const matched = [];
|
|
127
|
+
for (const name of readdirSync(agentsDir)) {
|
|
128
|
+
if (!name.endsWith('.md')) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const filePath = join(agentsDir, name);
|
|
132
|
+
if (lstatSync(filePath).isSymbolicLink()) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
const slug = name.slice(0, -'.md'.length);
|
|
136
|
+
if (manifestSlugSet.has(slug)) {
|
|
137
|
+
matched.push(slug);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return matched;
|
|
141
|
+
}
|
|
142
|
+
cleanInstall() {
|
|
143
|
+
return {
|
|
144
|
+
mode: 'clean-install',
|
|
145
|
+
matchedSlugs: [],
|
|
146
|
+
reason: 'Nenhuma condição de dev-checkout detectada (package.json não corresponde ao monorepo, ou nenhum agent real com slug colidente).',
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=DevCheckoutDetector.js.map
|
|
@@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EAAE,IAAI,CAAC,CAAC;YACvC,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC;gBACzC,SAAS;YACX,CAAC;YAED,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC1C,IAAI,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC9B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,YAAY;QAClB,OAAO;YACL,IAAI,EAAE,eAAe;YACrB,YAAY,EAAE,EAAE;YAChB,MAAM,EAAE,iIAAiI;SAC1I,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { HooksTemplate } from './types.js';
|
|
2
|
+
type HooksBlock = HooksTemplate['hooks'];
|
|
3
|
+
export declare class HooksWirer {
|
|
4
|
+
private readonly template;
|
|
5
|
+
private readonly targetSettingsPath;
|
|
6
|
+
constructor(template: HooksTemplate, targetSettingsPath: string);
|
|
7
|
+
wire(): {
|
|
8
|
+
merged: boolean;
|
|
9
|
+
hooksBlock: HooksBlock;
|
|
10
|
+
};
|
|
11
|
+
private readExistingSettings;
|
|
12
|
+
/**
|
|
13
|
+
* Turns every relative `command` path in the template (e.g.
|
|
14
|
+
* `hooks/session-start.mjs`) into a runnable shell command anchored at
|
|
15
|
+
* `targetRoot` (`dirname(targetSettingsPath)`).
|
|
16
|
+
*
|
|
17
|
+
* TASK-043 (RFC-040 installer, hook bundling): the template now references
|
|
18
|
+
* pre-bundled, self-contained ESM `.mjs` files (esbuild, build-time —
|
|
19
|
+
* `bundle-hooks.ts`), so the command is a plain `node <path>` — no `npx
|
|
20
|
+
* tsx` (and no node_modules resolution) required at all on the install
|
|
21
|
+
* target. This is the fix for the AC-008 probe's `MODULE_NOT_FOUND`
|
|
22
|
+
* finding: a fresh install target has no node_modules for `tsx` to resolve
|
|
23
|
+
* a raw `.ts` hook's non-builtin imports against.
|
|
24
|
+
*/
|
|
25
|
+
private resolveTemplateHooks;
|
|
26
|
+
private writeSettings;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=HooksWirer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HooksWirer.d.ts","sourceRoot":"","sources":["../../src/install/HooksWirer.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,KAAK,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAOzC,qBAAa,UAAU;IAEnB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,kBAAkB;gBADlB,QAAQ,EAAE,aAAa,EACvB,kBAAkB,EAAE,MAAM;IAG7C,IAAI,IAAI;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,UAAU,EAAE,UAAU,CAAA;KAAE;IAenD,OAAO,CAAC,oBAAoB;IAQ5B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,oBAAoB;IAkB5B,OAAO,CAAC,aAAa;CAItB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HooksWirer - read-modify-write merge of the (pre-filtered, ADR-006) hooks
|
|
3
|
+
* template into a target `settings.json` (RF-005).
|
|
4
|
+
*
|
|
5
|
+
* Non-destructive at two levels (TASK-013):
|
|
6
|
+
* 1. Root of the JSON document — every non-`hooks` key already present
|
|
7
|
+
* (`env`, `permissions`, ...) is preserved untouched.
|
|
8
|
+
* 2. Inside the `hooks` object — any event key NOT managed by this
|
|
9
|
+
* template (e.g. a foreign plugin's event) is preserved untouched;
|
|
10
|
+
* only the template's own event keys are (re)written, so re-running
|
|
11
|
+
* `wire()` is idempotent for those keys (no duplication).
|
|
12
|
+
*
|
|
13
|
+
* `targetSettingsPath` is injected (ADR-004) — never resolved internally.
|
|
14
|
+
* `targetRoot` (the directory commands are prefixed with) is derived from
|
|
15
|
+
* `dirname(targetSettingsPath)`, since the template stores bare relative
|
|
16
|
+
* paths (e.g. `hooks/session-start.mjs`, a bundled artifact since TASK-043)
|
|
17
|
+
* that only become a runnable command once joined with the install target
|
|
18
|
+
* root.
|
|
19
|
+
*/
|
|
20
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
21
|
+
import { dirname, join } from 'node:path';
|
|
22
|
+
export class HooksWirer {
|
|
23
|
+
template;
|
|
24
|
+
targetSettingsPath;
|
|
25
|
+
constructor(template, targetSettingsPath) {
|
|
26
|
+
this.template = template;
|
|
27
|
+
this.targetSettingsPath = targetSettingsPath;
|
|
28
|
+
}
|
|
29
|
+
wire() {
|
|
30
|
+
const existingSettings = this.readExistingSettings();
|
|
31
|
+
const resolvedTemplateHooks = this.resolveTemplateHooks();
|
|
32
|
+
const mergedHooks = {
|
|
33
|
+
...(existingSettings.hooks ?? {}),
|
|
34
|
+
...resolvedTemplateHooks,
|
|
35
|
+
};
|
|
36
|
+
const mergedSettings = { ...existingSettings, hooks: mergedHooks };
|
|
37
|
+
this.writeSettings(mergedSettings);
|
|
38
|
+
return { merged: true, hooksBlock: mergedHooks };
|
|
39
|
+
}
|
|
40
|
+
readExistingSettings() {
|
|
41
|
+
if (!existsSync(this.targetSettingsPath)) {
|
|
42
|
+
return {};
|
|
43
|
+
}
|
|
44
|
+
const raw = readFileSync(this.targetSettingsPath, 'utf-8');
|
|
45
|
+
return JSON.parse(raw);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Turns every relative `command` path in the template (e.g.
|
|
49
|
+
* `hooks/session-start.mjs`) into a runnable shell command anchored at
|
|
50
|
+
* `targetRoot` (`dirname(targetSettingsPath)`).
|
|
51
|
+
*
|
|
52
|
+
* TASK-043 (RFC-040 installer, hook bundling): the template now references
|
|
53
|
+
* pre-bundled, self-contained ESM `.mjs` files (esbuild, build-time —
|
|
54
|
+
* `bundle-hooks.ts`), so the command is a plain `node <path>` — no `npx
|
|
55
|
+
* tsx` (and no node_modules resolution) required at all on the install
|
|
56
|
+
* target. This is the fix for the AC-008 probe's `MODULE_NOT_FOUND`
|
|
57
|
+
* finding: a fresh install target has no node_modules for `tsx` to resolve
|
|
58
|
+
* a raw `.ts` hook's non-builtin imports against.
|
|
59
|
+
*/
|
|
60
|
+
resolveTemplateHooks() {
|
|
61
|
+
const targetRoot = dirname(this.targetSettingsPath);
|
|
62
|
+
const resolved = {};
|
|
63
|
+
for (const [eventName, groups] of Object.entries(this.template.hooks)) {
|
|
64
|
+
resolved[eventName] = groups.map((group) => ({
|
|
65
|
+
matcher: group.matcher,
|
|
66
|
+
hooks: group.hooks.map((hook) => ({
|
|
67
|
+
type: hook.type,
|
|
68
|
+
command: `node ${join(targetRoot, hook.command)}`,
|
|
69
|
+
timeout: hook.timeout,
|
|
70
|
+
})),
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
return resolved;
|
|
74
|
+
}
|
|
75
|
+
writeSettings(settings) {
|
|
76
|
+
mkdirSync(dirname(this.targetSettingsPath), { recursive: true });
|
|
77
|
+
writeFileSync(this.targetSettingsPath, JSON.stringify(settings, null, 2));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=HooksWirer.js.map
|