compound-agent 1.2.4 → 1.2.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/CHANGELOG.md +27 -2
- package/dist/cli.js +613 -765
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +11 -41
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +91 -119
- package/dist/mcp.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -671,14 +671,14 @@ declare const AuditFindingSchema: z.ZodObject<{
|
|
|
671
671
|
}, "strip", z.ZodTypeAny, {
|
|
672
672
|
file: string;
|
|
673
673
|
source: "lesson" | "pattern" | "rule";
|
|
674
|
-
severity: "
|
|
674
|
+
severity: "warning" | "error" | "info";
|
|
675
675
|
issue: string;
|
|
676
676
|
relatedLessonId?: string | undefined;
|
|
677
677
|
suggestedFix?: string | undefined;
|
|
678
678
|
}, {
|
|
679
679
|
file: string;
|
|
680
680
|
source: "lesson" | "pattern" | "rule";
|
|
681
|
-
severity: "
|
|
681
|
+
severity: "warning" | "error" | "info";
|
|
682
682
|
issue: string;
|
|
683
683
|
relatedLessonId?: string | undefined;
|
|
684
684
|
suggestedFix?: string | undefined;
|
|
@@ -695,14 +695,14 @@ declare const AuditReportSchema: z.ZodObject<{
|
|
|
695
695
|
}, "strip", z.ZodTypeAny, {
|
|
696
696
|
file: string;
|
|
697
697
|
source: "lesson" | "pattern" | "rule";
|
|
698
|
-
severity: "
|
|
698
|
+
severity: "warning" | "error" | "info";
|
|
699
699
|
issue: string;
|
|
700
700
|
relatedLessonId?: string | undefined;
|
|
701
701
|
suggestedFix?: string | undefined;
|
|
702
702
|
}, {
|
|
703
703
|
file: string;
|
|
704
704
|
source: "lesson" | "pattern" | "rule";
|
|
705
|
-
severity: "
|
|
705
|
+
severity: "warning" | "error" | "info";
|
|
706
706
|
issue: string;
|
|
707
707
|
relatedLessonId?: string | undefined;
|
|
708
708
|
suggestedFix?: string | undefined;
|
|
@@ -729,7 +729,7 @@ declare const AuditReportSchema: z.ZodObject<{
|
|
|
729
729
|
findings: {
|
|
730
730
|
file: string;
|
|
731
731
|
source: "lesson" | "pattern" | "rule";
|
|
732
|
-
severity: "
|
|
732
|
+
severity: "warning" | "error" | "info";
|
|
733
733
|
issue: string;
|
|
734
734
|
relatedLessonId?: string | undefined;
|
|
735
735
|
suggestedFix?: string | undefined;
|
|
@@ -745,7 +745,7 @@ declare const AuditReportSchema: z.ZodObject<{
|
|
|
745
745
|
findings: {
|
|
746
746
|
file: string;
|
|
747
747
|
source: "lesson" | "pattern" | "rule";
|
|
748
|
-
severity: "
|
|
748
|
+
severity: "warning" | "error" | "info";
|
|
749
749
|
issue: string;
|
|
750
750
|
relatedLessonId?: string | undefined;
|
|
751
751
|
suggestedFix?: string | undefined;
|
package/dist/index.js
CHANGED
|
@@ -1187,42 +1187,23 @@ function getRepoRoot() {
|
|
|
1187
1187
|
return process.env["COMPOUND_AGENT_ROOT"] ?? process.cwd();
|
|
1188
1188
|
}
|
|
1189
1189
|
|
|
1190
|
-
// src/setup/claude-helpers.ts
|
|
1191
|
-
function getMcpJsonPath(repoRoot) {
|
|
1192
|
-
const root = repoRoot ?? getRepoRoot();
|
|
1193
|
-
return join(root, ".mcp.json");
|
|
1194
|
-
}
|
|
1195
|
-
async function readMcpJson(mcpPath) {
|
|
1196
|
-
if (!existsSync(mcpPath)) {
|
|
1197
|
-
return {};
|
|
1198
|
-
}
|
|
1199
|
-
const content = await readFile(mcpPath, "utf-8");
|
|
1200
|
-
return JSON.parse(content);
|
|
1201
|
-
}
|
|
1202
|
-
async function hasMcpServerInMcpJson(repoRoot) {
|
|
1203
|
-
const mcpPath = getMcpJsonPath(repoRoot);
|
|
1204
|
-
const config = await readMcpJson(mcpPath);
|
|
1205
|
-
const mcpServers = config.mcpServers;
|
|
1206
|
-
return !!mcpServers?.["compound-agent"];
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
1190
|
// src/commands/management-prime.ts
|
|
1210
1191
|
var TRUST_LANGUAGE_TEMPLATE = `# Compound Agent Active
|
|
1211
1192
|
|
|
1212
|
-
> **Context Recovery**: Run \`ca prime\` after compaction, clear, or new session
|
|
1193
|
+
> **Context Recovery**: Run \`npx ca prime\` after compaction, clear, or new session
|
|
1213
1194
|
|
|
1214
|
-
##
|
|
1195
|
+
## CLI Commands (ALWAYS USE THESE)
|
|
1215
1196
|
|
|
1216
|
-
**You MUST use
|
|
1197
|
+
**You MUST use CLI commands for lesson management:**
|
|
1217
1198
|
|
|
1218
|
-
|
|
|
1219
|
-
|
|
1220
|
-
| \`
|
|
1221
|
-
| \`
|
|
1199
|
+
| Command | Purpose |
|
|
1200
|
+
|---------|---------|
|
|
1201
|
+
| \`npx ca search "query"\` | Search lessons - call BEFORE architectural decisions |
|
|
1202
|
+
| \`npx ca learn "insight"\` | Capture lessons - call AFTER corrections or discoveries |
|
|
1222
1203
|
|
|
1223
1204
|
## Core Constraints
|
|
1224
1205
|
|
|
1225
|
-
**Default**: Use
|
|
1206
|
+
**Default**: Use CLI commands for lesson management
|
|
1226
1207
|
**Prohibited**: NEVER edit .claude/lessons/ files directly
|
|
1227
1208
|
|
|
1228
1209
|
**Default**: Propose lessons freely after corrections
|
|
@@ -1230,15 +1211,15 @@ var TRUST_LANGUAGE_TEMPLATE = `# Compound Agent Active
|
|
|
1230
1211
|
|
|
1231
1212
|
## Retrieval Protocol
|
|
1232
1213
|
|
|
1233
|
-
You MUST call \`
|
|
1214
|
+
You MUST call \`npx ca search\` BEFORE:
|
|
1234
1215
|
- Architectural decisions or complex planning
|
|
1235
1216
|
- Implementing patterns you've done before in this repo
|
|
1236
1217
|
|
|
1237
|
-
**NEVER skip
|
|
1218
|
+
**NEVER skip search for complex decisions.** Past mistakes will repeat.
|
|
1238
1219
|
|
|
1239
1220
|
## Capture Protocol
|
|
1240
1221
|
|
|
1241
|
-
|
|
1222
|
+
Run \`npx ca learn\` AFTER:
|
|
1242
1223
|
- User corrects you ("no", "wrong", "actually...")
|
|
1243
1224
|
- You self-correct after iteration failures
|
|
1244
1225
|
- Test fails then you fix it
|
|
@@ -1249,10 +1230,6 @@ Call \`memory_capture\` AFTER:
|
|
|
1249
1230
|
- Actionable (preferred, not mandatory)
|
|
1250
1231
|
|
|
1251
1232
|
**Workflow**: Search BEFORE deciding, capture AFTER learning.
|
|
1252
|
-
|
|
1253
|
-
## CLI (fallback only)
|
|
1254
|
-
|
|
1255
|
-
When MCP is unavailable: \`ca search "query"\`, \`ca learn "insight"\`, \`ca list\`
|
|
1256
1233
|
`;
|
|
1257
1234
|
function formatSource(source) {
|
|
1258
1235
|
switch (source) {
|
|
@@ -1283,13 +1260,6 @@ async function getPrimeContext(repoRoot) {
|
|
|
1283
1260
|
}
|
|
1284
1261
|
const lessons = await loadSessionLessons(root, 5);
|
|
1285
1262
|
let output = TRUST_LANGUAGE_TEMPLATE;
|
|
1286
|
-
const hasMcp = await hasMcpServerInMcpJson(root);
|
|
1287
|
-
if (!hasMcp) {
|
|
1288
|
-
output += `
|
|
1289
|
-
WARNING: MCP server not registered. Run 'npx ca setup' to enable memory_search/memory_capture tools.
|
|
1290
|
-
|
|
1291
|
-
`;
|
|
1292
|
-
}
|
|
1293
1263
|
if (lessons.length > 0) {
|
|
1294
1264
|
const formattedLessons = lessons.map(formatLessonForPrime).join("\n\n");
|
|
1295
1265
|
output += `
|