auditor-lambda 0.3.4 → 0.3.6
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/audit-code-wrapper-lib.mjs +327 -242
- package/dist/cli.js +418 -54
- package/dist/orchestrator/fileAnchors.d.ts +32 -0
- package/dist/orchestrator/fileAnchors.js +217 -0
- package/dist/orchestrator/reviewPackets.js +10 -0
- package/dist/providers/claudeCodeProvider.js +3 -1
- package/dist/providers/index.js +2 -1
- package/dist/supervisor/operatorHandoff.js +22 -11
- package/dist/types/sessionConfig.d.ts +1 -0
- package/dist/validation/auditResults.js +50 -2
- package/dist/validation/sessionConfig.js +5 -0
- package/docs/agent-integrations.md +5 -2
- package/docs/bootstrap-install.md +6 -1
- package/docs/contract.md +3 -0
- package/docs/dispatch-implementation-plan.md +74 -23
- package/docs/github-copilot.md +1 -1
- package/docs/model-selection.md +11 -0
- package/docs/next-steps.md +2 -2
- package/docs/packaging.md +4 -2
- package/docs/production-launch-bar.md +3 -1
- package/docs/production-readiness.md +6 -6
- package/docs/run-flow.md +5 -3
- package/docs/session-config.md +11 -3
- package/docs/supervisor.md +5 -3
- package/docs/workflow-refactor-brief.md +14 -5
- package/package.json +1 -1
- package/skills/audit-code/SKILL.md +4 -0
- package/skills/audit-code/audit-code.prompt.md +16 -6
|
@@ -260,9 +260,11 @@ function printHelp({ usageName, preferredEntrypoint }) {
|
|
|
260
260
|
'- validate checks the current artifact bundle plus session-config/provider readiness and exits non-zero when issues exist',
|
|
261
261
|
'- validate-results --results FILE validates AuditResult payloads against the active task manifest without ingesting them',
|
|
262
262
|
'- explain-task <task_id> prints the resolved file coverage and current status for a task id',
|
|
263
|
-
'- prepare-dispatch --run-id <id> [--artifacts-dir <dir>] creates
|
|
264
|
-
'-
|
|
263
|
+
'- prepare-dispatch --run-id <id> [--artifacts-dir <dir>] creates packet prompt files and a slim dispatch-plan.json for parallel subagent dispatch',
|
|
264
|
+
'- submit-packet --run-id <id> --packet-id <id> [--artifacts-dir <dir>] validates AuditResult[] from stdin and writes only backend-assigned result files',
|
|
265
|
+
'- merge-and-ingest --run-id <id> [--root <dir>] [--artifacts-dir <dir>] merges assigned packet results and ingests them into the coverage matrix',
|
|
265
266
|
'- validate-result --run-id <id> --task-id <id> [--artifacts-dir <dir>] validates a single task result against the schema and line counts',
|
|
267
|
+
' generated packet prompts may use --run-id-b64, --task-id-b64, and --artifacts-dir-b64 to avoid shell-sensitive raw ids',
|
|
266
268
|
'',
|
|
267
269
|
'Primary usage:',
|
|
268
270
|
'- from the repository root, run the wrapper with no arguments',
|
|
@@ -405,6 +407,42 @@ async function writeGeneratedJson(targetPath, value) {
|
|
|
405
407
|
};
|
|
406
408
|
}
|
|
407
409
|
|
|
410
|
+
async function readJsonObjectIfExists(targetPath, description) {
|
|
411
|
+
if (!(await fileExists(targetPath))) {
|
|
412
|
+
return {};
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
let parsed;
|
|
416
|
+
try {
|
|
417
|
+
parsed = JSON.parse(await readFile(targetPath, 'utf8'));
|
|
418
|
+
} catch (error) {
|
|
419
|
+
throw new Error(
|
|
420
|
+
`${description} exists but is not valid JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
425
|
+
throw new Error(`${description} must be a JSON object when it already exists.`);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
return parsed;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
async function writeMergedGeneratedJson(targetPath, description, buildValue) {
|
|
432
|
+
const existed = await fileExists(targetPath);
|
|
433
|
+
const existing = await readJsonObjectIfExists(targetPath, description);
|
|
434
|
+
await mkdir(dirname(targetPath), { recursive: true });
|
|
435
|
+
await writeFile(
|
|
436
|
+
targetPath,
|
|
437
|
+
JSON.stringify(buildValue(existing), null, 2) + '\n',
|
|
438
|
+
'utf8',
|
|
439
|
+
);
|
|
440
|
+
return {
|
|
441
|
+
path: targetPath,
|
|
442
|
+
mode: existed ? 'updated' : 'created',
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
|
|
408
446
|
async function writeGeneratedBinary(targetPath, content) {
|
|
409
447
|
const existed = await fileExists(targetPath);
|
|
410
448
|
await mkdir(dirname(targetPath), { recursive: true });
|
|
@@ -479,70 +517,99 @@ function renderCodexAutomationRecipe() {
|
|
|
479
517
|
|
|
480
518
|
function renderOpenCodeProjectConfig(root) {
|
|
481
519
|
const launcher = replaceBackslashes(toRepoRelativePath(root, join(root, '.audit-code', 'install', MCP_LAUNCHER_FILENAME)));
|
|
482
|
-
return
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
timeout: 10000,
|
|
491
|
-
},
|
|
520
|
+
return {
|
|
521
|
+
$schema: 'https://opencode.ai/config.json',
|
|
522
|
+
mcp: {
|
|
523
|
+
auditor: {
|
|
524
|
+
type: 'local',
|
|
525
|
+
command: ['node', launcher],
|
|
526
|
+
enabled: true,
|
|
527
|
+
timeout: 10000,
|
|
492
528
|
},
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
529
|
+
},
|
|
530
|
+
permission: {
|
|
531
|
+
read: 'allow',
|
|
532
|
+
glob: 'allow',
|
|
533
|
+
grep: 'allow',
|
|
534
|
+
edit: 'ask',
|
|
535
|
+
bash: {
|
|
536
|
+
'*': 'ask',
|
|
537
|
+
'git status*': 'allow',
|
|
538
|
+
'git diff*': 'allow',
|
|
539
|
+
'grep *': 'allow',
|
|
540
|
+
'rm *': 'deny',
|
|
505
541
|
},
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
question: 'allow',
|
|
542
|
+
},
|
|
543
|
+
agent: {
|
|
544
|
+
auditor: {
|
|
545
|
+
description:
|
|
546
|
+
'Read-heavy audit orchestration agent for the /audit-code workflow.',
|
|
547
|
+
tools: {
|
|
548
|
+
'auditor*': true,
|
|
549
|
+
},
|
|
550
|
+
permission: {
|
|
551
|
+
edit: 'ask',
|
|
552
|
+
bash: {
|
|
553
|
+
'*': 'ask',
|
|
554
|
+
'git status*': 'allow',
|
|
555
|
+
'git diff*': 'allow',
|
|
556
|
+
'grep *': 'allow',
|
|
557
|
+
'rm *': 'deny',
|
|
523
558
|
},
|
|
559
|
+
question: 'allow',
|
|
524
560
|
},
|
|
525
561
|
},
|
|
526
562
|
},
|
|
527
|
-
|
|
528
|
-
2,
|
|
529
|
-
) + '\n';
|
|
563
|
+
};
|
|
530
564
|
}
|
|
531
565
|
|
|
532
566
|
function renderVSCodeMcpConfig() {
|
|
533
|
-
return
|
|
534
|
-
{
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
args: ['${workspaceFolder}/.audit-code/install/run-mcp-server.mjs'],
|
|
540
|
-
},
|
|
567
|
+
return {
|
|
568
|
+
servers: {
|
|
569
|
+
auditor: {
|
|
570
|
+
type: 'stdio',
|
|
571
|
+
command: 'node',
|
|
572
|
+
args: ['${workspaceFolder}/.audit-code/install/run-mcp-server.mjs'],
|
|
541
573
|
},
|
|
542
574
|
},
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
function objectValue(value) {
|
|
579
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
580
|
+
? value
|
|
581
|
+
: {};
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function buildMergedOpenCodeProjectConfig(existing, root) {
|
|
585
|
+
const generated = renderOpenCodeProjectConfig(root);
|
|
586
|
+
return {
|
|
587
|
+
...existing,
|
|
588
|
+
$schema: existing.$schema ?? generated.$schema,
|
|
589
|
+
mcp: {
|
|
590
|
+
...objectValue(existing.mcp),
|
|
591
|
+
auditor: generated.mcp.auditor,
|
|
592
|
+
},
|
|
593
|
+
permission:
|
|
594
|
+
existing.permission && typeof existing.permission === 'object' && !Array.isArray(existing.permission)
|
|
595
|
+
? existing.permission
|
|
596
|
+
: generated.permission,
|
|
597
|
+
agent: {
|
|
598
|
+
...objectValue(existing.agent),
|
|
599
|
+
auditor: generated.agent.auditor,
|
|
600
|
+
},
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
function buildMergedVSCodeMcpConfig(existing) {
|
|
605
|
+
const generated = renderVSCodeMcpConfig();
|
|
606
|
+
return {
|
|
607
|
+
...existing,
|
|
608
|
+
servers: {
|
|
609
|
+
...objectValue(existing.servers),
|
|
610
|
+
auditor: generated.servers.auditor,
|
|
611
|
+
},
|
|
612
|
+
};
|
|
546
613
|
}
|
|
547
614
|
|
|
548
615
|
function renderClaudeDesktopProjectTemplate() {
|
|
@@ -930,116 +997,203 @@ async function buildClaudeDesktopBundle(root, results) {
|
|
|
930
997
|
};
|
|
931
998
|
}
|
|
932
999
|
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1000
|
+
const INSTALL_PROFILE_FLAGS = [
|
|
1001
|
+
'writeVSCode',
|
|
1002
|
+
'writeCopilotInstructions',
|
|
1003
|
+
'writeOpenCode',
|
|
1004
|
+
'writeCodex',
|
|
1005
|
+
'writeClaudeDesktop',
|
|
1006
|
+
'writeAntigravity',
|
|
1007
|
+
'writeAgents',
|
|
1008
|
+
];
|
|
1009
|
+
|
|
1010
|
+
const INSTALL_HOST_ORDER = [
|
|
1011
|
+
'codex',
|
|
1012
|
+
'claude-desktop',
|
|
1013
|
+
'opencode',
|
|
1014
|
+
'vscode',
|
|
1015
|
+
'antigravity',
|
|
1016
|
+
];
|
|
1017
|
+
|
|
1018
|
+
const INSTALL_HOST_DEFINITIONS = {
|
|
1019
|
+
codex: {
|
|
1020
|
+
host: 'codex',
|
|
1021
|
+
label: 'Codex',
|
|
1022
|
+
support_level: 'supported',
|
|
1023
|
+
setup_kind: 'skills+mcp+instructions',
|
|
1024
|
+
summary:
|
|
1025
|
+
'Use the generated Codex skill bundle, AGENTS instructions, and shared MCP launcher so Codex can drive the backend through native tools instead of raw shell commands.',
|
|
1026
|
+
primary_path_key: 'codexSkillPath',
|
|
1027
|
+
supporting_path_keys: [
|
|
1028
|
+
'agentsInstructionsPath',
|
|
1029
|
+
'codexMcpSetupPath',
|
|
1030
|
+
'codexAutomationRecipePath',
|
|
1031
|
+
],
|
|
1032
|
+
steps: [
|
|
1033
|
+
'Open this repository in Codex.',
|
|
1034
|
+
'Ensure Codex can access the repo-local auditor MCP server using the generated setup guide.',
|
|
1035
|
+
'Ask Codex to use the auditor MCP tools to start or continue `/audit-code`.',
|
|
1036
|
+
],
|
|
1037
|
+
profile: {
|
|
1038
|
+
writeCodex: true,
|
|
1039
|
+
writeAgents: true,
|
|
953
1040
|
},
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1041
|
+
},
|
|
1042
|
+
'claude-desktop': {
|
|
1043
|
+
host: 'claude-desktop',
|
|
1044
|
+
label: 'Claude Desktop',
|
|
1045
|
+
support_level: 'supported',
|
|
1046
|
+
setup_kind: 'local-mcp-bundle',
|
|
1047
|
+
summary:
|
|
1048
|
+
'Install the generated local MCP bundle in Claude Desktop, then use the project template and prompt asset as supporting context.',
|
|
1049
|
+
primary_path_key: 'claudeDesktopDxtPath',
|
|
1050
|
+
supporting_path_keys: [
|
|
1051
|
+
'claudeDesktopMcpbPath',
|
|
1052
|
+
'claudeDesktopProjectTemplatePath',
|
|
1053
|
+
'claudeDesktopRemoteConnectorPath',
|
|
1054
|
+
'installedPromptPath',
|
|
1055
|
+
],
|
|
1056
|
+
steps: [
|
|
1057
|
+
'Open Claude Desktop Settings and install the generated `.dxt` bundle.',
|
|
1058
|
+
'Configure the repository root when prompted so the bundle can launch the local auditor MCP server.',
|
|
1059
|
+
'Use the project template and prompt asset to kick off `/audit-code` in conversation.',
|
|
1060
|
+
],
|
|
1061
|
+
profile: {
|
|
1062
|
+
writeClaudeDesktop: true,
|
|
973
1063
|
},
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1064
|
+
},
|
|
1065
|
+
opencode: {
|
|
1066
|
+
host: 'opencode',
|
|
1067
|
+
label: 'OpenCode',
|
|
1068
|
+
support_level: 'supported',
|
|
1069
|
+
setup_kind: 'command+agent+mcp',
|
|
1070
|
+
summary:
|
|
1071
|
+
'Use the generated OpenCode command and project config so `/audit-code` and the local auditor MCP server are available together.',
|
|
1072
|
+
primary_path_key: 'opencodeCommandPath',
|
|
1073
|
+
supporting_path_keys: [
|
|
1074
|
+
'opencodeConfigPath',
|
|
1075
|
+
'opencodeSkillPath',
|
|
1076
|
+
'agentsInstructionsPath',
|
|
1077
|
+
'mcpLauncherPath',
|
|
1078
|
+
],
|
|
1079
|
+
steps: [
|
|
1080
|
+
'Open this repository in OpenCode.',
|
|
1081
|
+
'Let OpenCode load the generated `opencode.json` so the auditor MCP server is available.',
|
|
1082
|
+
'Invoke `/audit-code` and keep the audit loop on the auditor MCP tools.',
|
|
1083
|
+
],
|
|
1084
|
+
profile: {
|
|
1085
|
+
writeOpenCode: true,
|
|
1086
|
+
writeAgents: true,
|
|
993
1087
|
},
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1088
|
+
},
|
|
1089
|
+
vscode: {
|
|
1090
|
+
host: 'vscode',
|
|
1091
|
+
label: 'VS Code',
|
|
1092
|
+
support_level: 'supported',
|
|
1093
|
+
setup_kind: 'prompt+agent+mcp',
|
|
1094
|
+
summary:
|
|
1095
|
+
'Use the generated prompt file, custom agent, and workspace MCP configuration for the cleanest VS Code integration.',
|
|
1096
|
+
primary_path_key: 'vscodePromptPath',
|
|
1097
|
+
supporting_path_keys: [
|
|
1098
|
+
'vscodeAgentPath',
|
|
1099
|
+
'vscodeMcpConfigPath',
|
|
1100
|
+
'copilotInstructionsPath',
|
|
1101
|
+
],
|
|
1102
|
+
steps: [
|
|
1103
|
+
'Open this repository in VS Code with Copilot.',
|
|
1104
|
+
'Allow VS Code to discover the workspace MCP server from `.vscode/mcp.json`.',
|
|
1105
|
+
'Invoke `/audit-code` in chat and use the custom auditor agent when you want the dedicated orchestration persona.',
|
|
1106
|
+
],
|
|
1107
|
+
profile: {
|
|
1108
|
+
writeVSCode: true,
|
|
1109
|
+
writeCopilotInstructions: true,
|
|
1012
1110
|
},
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1111
|
+
},
|
|
1112
|
+
antigravity: {
|
|
1113
|
+
host: 'antigravity',
|
|
1114
|
+
label: 'Antigravity',
|
|
1115
|
+
support_level: 'guided',
|
|
1116
|
+
setup_kind: 'planning-guide+mcp-ready',
|
|
1117
|
+
summary:
|
|
1118
|
+
'Start in Planning mode with the generated guide and AGENTS instructions, then use the shared MCP launcher once Antigravity is ready to call structured tools.',
|
|
1119
|
+
primary_path_key: 'antigravityPlanningGuidePath',
|
|
1120
|
+
supporting_path_keys: [
|
|
1121
|
+
'agentsInstructionsPath',
|
|
1122
|
+
'mcpLauncherPath',
|
|
1123
|
+
'installedPromptPath',
|
|
1124
|
+
],
|
|
1125
|
+
steps: [
|
|
1126
|
+
'Open this repository in Antigravity Planning mode.',
|
|
1127
|
+
'Load the generated planning guide and AGENTS instructions before starting the audit.',
|
|
1128
|
+
'Use the shared auditor MCP server when Antigravity needs structured audit state instead of free-form shell guesses.',
|
|
1129
|
+
],
|
|
1130
|
+
profile: {
|
|
1131
|
+
writeAntigravity: true,
|
|
1132
|
+
writeAgents: true,
|
|
1031
1133
|
},
|
|
1032
|
-
}
|
|
1134
|
+
},
|
|
1135
|
+
};
|
|
1136
|
+
|
|
1137
|
+
function supportedInstallHostsMessage() {
|
|
1138
|
+
return ['all', 'copilot', ...INSTALL_HOST_ORDER].join(', ');
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
function getInstallHostKeys(host) {
|
|
1142
|
+
if (host === 'all') {
|
|
1143
|
+
return INSTALL_HOST_ORDER;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
if (host === 'copilot') {
|
|
1147
|
+
return ['vscode'];
|
|
1148
|
+
}
|
|
1033
1149
|
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1150
|
+
if (INSTALL_HOST_DEFINITIONS[host]) {
|
|
1151
|
+
return [host];
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
throw new Error(
|
|
1155
|
+
`Unsupported host "${host}". Supported hosts: ${supportedInstallHostsMessage()}.`,
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
function getInstallProfile(host) {
|
|
1160
|
+
const profile = Object.fromEntries(
|
|
1161
|
+
INSTALL_PROFILE_FLAGS.map((flag) => [flag, false]),
|
|
1162
|
+
);
|
|
1163
|
+
|
|
1164
|
+
for (const hostKey of getInstallHostKeys(host)) {
|
|
1165
|
+
const hostProfile = INSTALL_HOST_DEFINITIONS[hostKey].profile;
|
|
1166
|
+
for (const flag of INSTALL_PROFILE_FLAGS) {
|
|
1167
|
+
profile[flag] = profile[flag] || Boolean(hostProfile[flag]);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
return profile;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
function buildHostCatalog({ root, host, assets }) {
|
|
1175
|
+
return getInstallHostKeys(host)
|
|
1176
|
+
.map((hostKey) => {
|
|
1177
|
+
const definition = INSTALL_HOST_DEFINITIONS[hostKey];
|
|
1178
|
+
const primaryPath = assets[definition.primary_path_key];
|
|
1179
|
+
if (!primaryPath) {
|
|
1180
|
+
return null;
|
|
1181
|
+
}
|
|
1039
1182
|
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1183
|
+
return {
|
|
1184
|
+
host: definition.host,
|
|
1185
|
+
label: definition.label,
|
|
1186
|
+
support_level: definition.support_level,
|
|
1187
|
+
setup_kind: definition.setup_kind,
|
|
1188
|
+
summary: definition.summary,
|
|
1189
|
+
primary_path: primaryPath,
|
|
1190
|
+
supporting_paths: definition.supporting_path_keys
|
|
1191
|
+
.map((key) => assets[key])
|
|
1192
|
+
.filter(Boolean),
|
|
1193
|
+
steps: definition.steps,
|
|
1194
|
+
};
|
|
1195
|
+
})
|
|
1196
|
+
.filter(Boolean)
|
|
1043
1197
|
.map((entry) => ({
|
|
1044
1198
|
...entry,
|
|
1045
1199
|
primary_path: entry.primary_path,
|
|
@@ -1100,6 +1254,7 @@ function renderInstallGuide({
|
|
|
1100
1254
|
lines.push('', 'Backend fallback:');
|
|
1101
1255
|
lines.push('- from the repository root, run `audit-code` only when you intentionally need the repo-local backend wrapper');
|
|
1102
1256
|
lines.push('- run `audit-code verify-install` after bootstrap when you want to smoke-test the generated launchers and host configs');
|
|
1257
|
+
lines.push('- rerun `audit-code install` to refresh every generated host surface from the shared prompt, skill, and MCP launcher assets together');
|
|
1103
1258
|
|
|
1104
1259
|
if (host !== 'all') {
|
|
1105
1260
|
lines.push('');
|
|
@@ -1110,85 +1265,6 @@ function renderInstallGuide({
|
|
|
1110
1265
|
return lines.join('\n');
|
|
1111
1266
|
}
|
|
1112
1267
|
|
|
1113
|
-
function getInstallProfile(host) {
|
|
1114
|
-
switch (host) {
|
|
1115
|
-
case 'all':
|
|
1116
|
-
return {
|
|
1117
|
-
writeVSCode: true,
|
|
1118
|
-
writeCopilotInstructions: true,
|
|
1119
|
-
writeOpenCode: true,
|
|
1120
|
-
writeCodex: true,
|
|
1121
|
-
writeClaudeDesktop: true,
|
|
1122
|
-
writeAntigravity: true,
|
|
1123
|
-
writeAgents: true,
|
|
1124
|
-
};
|
|
1125
|
-
case 'copilot':
|
|
1126
|
-
return {
|
|
1127
|
-
writeVSCode: true,
|
|
1128
|
-
writeCopilotInstructions: true,
|
|
1129
|
-
writeAgents: false,
|
|
1130
|
-
writeOpenCode: false,
|
|
1131
|
-
writeCodex: false,
|
|
1132
|
-
writeClaudeDesktop: false,
|
|
1133
|
-
writeAntigravity: false,
|
|
1134
|
-
};
|
|
1135
|
-
case 'vscode':
|
|
1136
|
-
return {
|
|
1137
|
-
writeVSCode: true,
|
|
1138
|
-
writeCopilotInstructions: true,
|
|
1139
|
-
writeAgents: false,
|
|
1140
|
-
writeOpenCode: false,
|
|
1141
|
-
writeCodex: false,
|
|
1142
|
-
writeClaudeDesktop: false,
|
|
1143
|
-
writeAntigravity: false,
|
|
1144
|
-
};
|
|
1145
|
-
case 'opencode':
|
|
1146
|
-
return {
|
|
1147
|
-
writeVSCode: false,
|
|
1148
|
-
writeCopilotInstructions: false,
|
|
1149
|
-
writeAgents: true,
|
|
1150
|
-
writeOpenCode: true,
|
|
1151
|
-
writeCodex: false,
|
|
1152
|
-
writeClaudeDesktop: false,
|
|
1153
|
-
writeAntigravity: false,
|
|
1154
|
-
};
|
|
1155
|
-
case 'codex':
|
|
1156
|
-
return {
|
|
1157
|
-
writeVSCode: false,
|
|
1158
|
-
writeCopilotInstructions: false,
|
|
1159
|
-
writeAgents: true,
|
|
1160
|
-
writeOpenCode: false,
|
|
1161
|
-
writeCodex: true,
|
|
1162
|
-
writeClaudeDesktop: false,
|
|
1163
|
-
writeAntigravity: false,
|
|
1164
|
-
};
|
|
1165
|
-
case 'claude-desktop':
|
|
1166
|
-
return {
|
|
1167
|
-
writeVSCode: false,
|
|
1168
|
-
writeCopilotInstructions: false,
|
|
1169
|
-
writeAgents: false,
|
|
1170
|
-
writeOpenCode: false,
|
|
1171
|
-
writeCodex: false,
|
|
1172
|
-
writeClaudeDesktop: true,
|
|
1173
|
-
writeAntigravity: false,
|
|
1174
|
-
};
|
|
1175
|
-
case 'antigravity':
|
|
1176
|
-
return {
|
|
1177
|
-
writeVSCode: false,
|
|
1178
|
-
writeCopilotInstructions: false,
|
|
1179
|
-
writeAgents: true,
|
|
1180
|
-
writeOpenCode: false,
|
|
1181
|
-
writeCodex: false,
|
|
1182
|
-
writeClaudeDesktop: false,
|
|
1183
|
-
writeAntigravity: true,
|
|
1184
|
-
};
|
|
1185
|
-
default:
|
|
1186
|
-
throw new Error(
|
|
1187
|
-
`Unsupported host "${host}". Supported hosts: all, copilot, vscode, opencode, codex, claude-desktop, antigravity.`,
|
|
1188
|
-
);
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
1268
|
async function assertDirectoryExists(path, description) {
|
|
1193
1269
|
let stats;
|
|
1194
1270
|
try {
|
|
@@ -1510,7 +1586,7 @@ async function verifyInstalledBootstrap(argv) {
|
|
|
1510
1586
|
(installManifest.hosts ?? []).map((entry) => [entry.host, entry]),
|
|
1511
1587
|
);
|
|
1512
1588
|
const selectedHosts = requestedHost && requestedHost !== 'all'
|
|
1513
|
-
?
|
|
1589
|
+
? getInstallHostKeys(requestedHost)
|
|
1514
1590
|
: [...hostCatalog.keys()];
|
|
1515
1591
|
|
|
1516
1592
|
await collectVerifyCheck(generalChecks, 'install_guide', async () => {
|
|
@@ -2054,9 +2130,10 @@ async function installBootstrap(argv) {
|
|
|
2054
2130
|
),
|
|
2055
2131
|
);
|
|
2056
2132
|
results.push(
|
|
2057
|
-
await
|
|
2133
|
+
await writeMergedGeneratedJson(
|
|
2058
2134
|
assetPaths.opencodeConfigPath,
|
|
2059
|
-
|
|
2135
|
+
'OpenCode project config',
|
|
2136
|
+
(existing) => buildMergedOpenCodeProjectConfig(existing, root),
|
|
2060
2137
|
),
|
|
2061
2138
|
);
|
|
2062
2139
|
}
|
|
@@ -2082,9 +2159,10 @@ async function installBootstrap(argv) {
|
|
|
2082
2159
|
),
|
|
2083
2160
|
);
|
|
2084
2161
|
results.push(
|
|
2085
|
-
await
|
|
2162
|
+
await writeMergedGeneratedJson(
|
|
2086
2163
|
assetPaths.vscodeMcpConfigPath,
|
|
2087
|
-
|
|
2164
|
+
'VS Code MCP config',
|
|
2165
|
+
buildMergedVSCodeMcpConfig,
|
|
2088
2166
|
),
|
|
2089
2167
|
);
|
|
2090
2168
|
}
|
|
@@ -2114,6 +2192,7 @@ async function installBootstrap(argv) {
|
|
|
2114
2192
|
install_manifest_path: installManifestPath,
|
|
2115
2193
|
mcp_server_launcher_path: mcpLauncherPath,
|
|
2116
2194
|
source_prompt_path: resolve(promptAssetPath),
|
|
2195
|
+
source_skill_path: resolve(skillAssetPath),
|
|
2117
2196
|
asset_paths: assetPaths,
|
|
2118
2197
|
hosts: hostGuidance,
|
|
2119
2198
|
};
|
|
@@ -2153,6 +2232,7 @@ async function installBootstrap(argv) {
|
|
|
2153
2232
|
install_manifest_path: installManifestPath,
|
|
2154
2233
|
mcp_server_launcher_path: mcpLauncherPath,
|
|
2155
2234
|
source_prompt_path: resolve(promptAssetPath),
|
|
2235
|
+
source_skill_path: resolve(skillAssetPath),
|
|
2156
2236
|
files: results,
|
|
2157
2237
|
slash_command_surfaces: {
|
|
2158
2238
|
vscode_prompt: assetPaths.vscodePromptPath,
|
|
@@ -2281,6 +2361,11 @@ export async function runAuditCodeWrapper({
|
|
|
2281
2361
|
return;
|
|
2282
2362
|
}
|
|
2283
2363
|
|
|
2364
|
+
if (argv[0] === 'submit-packet') {
|
|
2365
|
+
await runDistCommand('submit-packet', argv.slice(1));
|
|
2366
|
+
return;
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2284
2369
|
if (argv[0] === 'merge-and-ingest') {
|
|
2285
2370
|
await runDistCommand('merge-and-ingest', argv.slice(1), { ensureArtifactsDir: true });
|
|
2286
2371
|
return;
|