MCPcopy Create free account
hub / github.com/SethGammon/Citadel / localRepairFor

Function localRepairFor

scripts/next-action.js:42–77  ·  view source on GitHub ↗
(action)

Source from the content-addressed store, hash-verified

40}
41
42function localRepairFor(action) {
43 const command = String(action?.command || '').trim();
44 if (!command) return null;
45
46 if (command === '/learn --doc-sync') {
47 return {
48 kind: 'local-repair',
49 command,
50 args: [path.join(__dirname, '..', 'hooks_src', 'doc-sync.js'), '--project-root'],
51 appendProjectRoot: true,
52 why: 'Drain queued doc-sync items and write the latest local review report.',
53 };
54 }
55
56 const packageMatch = command.match(/^node\s+scripts\/package-delivery\.js\s+(.+)$/);
57 if (packageMatch) {
58 return {
59 kind: 'local-repair',
60 command,
61 args: [path.join(__dirname, 'package-delivery.js'), packageMatch[1]],
62 why: 'Create the deterministic review package for a campaign that is ready to package.',
63 };
64 }
65
66 const completeMatch = command.match(/^node\s+scripts\/campaign\.js\s+complete\s+([^\s]+)\s+--archive$/);
67 if (completeMatch) {
68 return {
69 kind: 'local-repair',
70 command,
71 args: [path.join(__dirname, 'campaign.js'), 'complete', completeMatch[1], '--archive'],
72 why: 'Complete and archive a campaign whose phases are already complete.',
73 };
74 }
75
76 return null;
77}
78
79function runNode(projectRoot, repair) {
80 const args = [...repair.args];

Callers 5

boundaryForDecisionFunction · 0.85
buildConsoleFunction · 0.85
buildApprovalCapsuleFunction · 0.85
resolveNextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected