compound-agent 1.7.3 → 1.7.4
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 +18 -1
- package/dist/cli.js +525 -72
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +117 -10
- package/dist/index.js.map +1 -1
- package/docs/research/index.md +1 -1
- package/docs/research/software_architecture/01-science-of-decomposition.md +615 -0
- package/docs/research/software_architecture/02-architecture-under-uncertainty.md +649 -0
- package/docs/research/software_architecture/03-emergent-behavior-in-composed-systems.md +644 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3697,4 +3697,34 @@ declare function writeCctPatterns(repoRoot: string, patterns: CctPattern[]): Pro
|
|
|
3697
3697
|
*/
|
|
3698
3698
|
declare function synthesizePattern(cluster: MemoryItem[], clusterId: string): CctPattern;
|
|
3699
3699
|
|
|
3700
|
-
|
|
3700
|
+
/**
|
|
3701
|
+
* Linter detection utility.
|
|
3702
|
+
*
|
|
3703
|
+
* Scans a directory for linter config files and returns
|
|
3704
|
+
* info about the first detected linter.
|
|
3705
|
+
*/
|
|
3706
|
+
|
|
3707
|
+
/** Supported linter identifiers. */
|
|
3708
|
+
declare const LinterNameSchema: z.ZodEnum<["eslint", "ruff", "clippy", "golangci-lint", "ast-grep", "semgrep", "unknown"]>;
|
|
3709
|
+
/** Result of linter detection. */
|
|
3710
|
+
declare const LinterInfoSchema: z.ZodObject<{
|
|
3711
|
+
linter: z.ZodEnum<["eslint", "ruff", "clippy", "golangci-lint", "ast-grep", "semgrep", "unknown"]>;
|
|
3712
|
+
configPath: z.ZodNullable<z.ZodString>;
|
|
3713
|
+
}, "strip", z.ZodTypeAny, {
|
|
3714
|
+
linter: "unknown" | "eslint" | "ruff" | "clippy" | "golangci-lint" | "ast-grep" | "semgrep";
|
|
3715
|
+
configPath: string | null;
|
|
3716
|
+
}, {
|
|
3717
|
+
linter: "unknown" | "eslint" | "ruff" | "clippy" | "golangci-lint" | "ast-grep" | "semgrep";
|
|
3718
|
+
configPath: string | null;
|
|
3719
|
+
}>;
|
|
3720
|
+
type LinterInfo = z.infer<typeof LinterInfoSchema>;
|
|
3721
|
+
type LinterName = z.infer<typeof LinterNameSchema>;
|
|
3722
|
+
/**
|
|
3723
|
+
* Detect the linter used in a repository by scanning for config files.
|
|
3724
|
+
*
|
|
3725
|
+
* Checks linters in priority order; first match wins.
|
|
3726
|
+
* Returns `{ linter: 'unknown', configPath: null }` if nothing found.
|
|
3727
|
+
*/
|
|
3728
|
+
declare function detectLinter(repoRoot: string): LinterInfo;
|
|
3729
|
+
|
|
3730
|
+
export { type ActionabilityResult, type AuditFinding, AuditFindingSchema, type AuditOptions, type AuditReport, AuditReportSchema, CANDIDATE_MULTIPLIER, CCT_PATTERNS_PATH, type CctPattern, CctPatternSchema, type ClusterResult, type Context, type CorrectionSignal, DB_PATH, DEFAULT_TEXT_WEIGHT, DEFAULT_VECTOR_WEIGHT, type DetectedCorrection, type DetectedSelfCorrection, type DetectedTestFailure, type EditEntry, type EditHistory, type EmbedChunksOptions, type EmbedChunksResult, type EmbedStatus, type HybridMergeOptions, type IndexOptions, type IndexResult, KNOWLEDGE_DB_PATH, KNOWLEDGE_SCHEMA_VERSION, type KnowledgeChunk, type KnowledgeDbOptions, type KnowledgeSearchOptions, LESSONS_PATH, type Lesson, LessonItemSchema, type LessonRecord, LessonSchema, type LessonType, type LinterInfo, LinterInfoSchema, type LinterName, LinterNameSchema, type LockResult, MODEL_FILENAME, MODEL_URI, type MemoryItem, type MemoryItemRecord, MemoryItemRecordSchema, MemoryItemSchema, type MemoryItemType, MemoryItemTypeSchema, type NoveltyOptions, type NoveltyResult, type ParseError, type PatternItem, PatternItemSchema, type PlanRetrievalResult, type Preference, PreferenceItemSchema, type ProposeResult, type RankedLesson, type ReadLessonsOptions, type ReadLessonsResult, type ReadMemoryItemsResult, type ScoredChunk, type ScoredKeywordResult, type ScoredLesson, type SearchVectorOptions, type Severity, type Solution, SolutionItemSchema, type Source, type SpawnEmbedResult, type SpecificityResult, type TestResult, type UsabilityResult, VERSION, acquireEmbedLock, appendLesson, appendMemoryItem, buildSimilarityMatrix, calculateScore, chunkFile, closeDb, closeKnowledgeDb, clusterBySimilarity, collectCachedChunkEmbeddings, confirmationBoost, cosineSimilarity, detectLinter, detectSelfCorrection, detectTestFailure, detectUserCorrection, embedChunks, embedText, embedTexts, formatLessonsCheck, generateId, getCachedChunkEmbedding, getEmbedding, getPrimeContext, getUnembeddedChunkCount, indexAndSpawnEmbed, indexDocs, isActionable, isEmbedLocked, isModelAvailable, isModelUsable, isNovel, isSpecific, loadSessionLessons, mergeHybridResults, normalizeBm25Rank, openKnowledgeDb, rankLessons, readCctPatterns, readEmbedStatus, readLessons, readMemoryItems, rebuildIndex, recencyBoost, resolveModel, retrieveForPlan, runAudit, runBackgroundEmbed, searchChunksKeywordScored, searchKeyword, searchKnowledge, searchKnowledgeVector, searchVector, setCachedChunkEmbedding, severityBoost, shouldPropose, spawnBackgroundEmbed, synthesizePattern, unloadEmbedding, writeCctPatterns, writeEmbedStatus };
|
package/dist/index.js
CHANGED
|
@@ -2638,7 +2638,10 @@ async function fetchLatestVersion(packageName = "compound-agent") {
|
|
|
2638
2638
|
});
|
|
2639
2639
|
if (!res.ok) return null;
|
|
2640
2640
|
const data = await res.json();
|
|
2641
|
-
|
|
2641
|
+
const tags = data["dist-tags"];
|
|
2642
|
+
if (typeof tags !== "object" || tags === null) return null;
|
|
2643
|
+
const latest = tags["latest"];
|
|
2644
|
+
return typeof latest === "string" ? latest : null;
|
|
2642
2645
|
} catch {
|
|
2643
2646
|
return null;
|
|
2644
2647
|
}
|
|
@@ -2651,7 +2654,7 @@ async function checkForUpdate(cacheDir) {
|
|
|
2651
2654
|
return {
|
|
2652
2655
|
current: VERSION,
|
|
2653
2656
|
latest: cached.latest,
|
|
2654
|
-
updateAvailable: cached.latest
|
|
2657
|
+
updateAvailable: semverGt(cached.latest, VERSION)
|
|
2655
2658
|
};
|
|
2656
2659
|
}
|
|
2657
2660
|
const latest = await fetchLatestVersion();
|
|
@@ -2665,12 +2668,23 @@ async function checkForUpdate(cacheDir) {
|
|
|
2665
2668
|
return {
|
|
2666
2669
|
current: VERSION,
|
|
2667
2670
|
latest,
|
|
2668
|
-
updateAvailable: latest
|
|
2671
|
+
updateAvailable: semverGt(latest, VERSION)
|
|
2669
2672
|
};
|
|
2670
2673
|
} catch {
|
|
2671
2674
|
return null;
|
|
2672
2675
|
}
|
|
2673
2676
|
}
|
|
2677
|
+
function semverGt(a, b) {
|
|
2678
|
+
const parse = (v) => {
|
|
2679
|
+
const parts = v.split(".").map((n) => parseInt(n, 10) || 0);
|
|
2680
|
+
return [parts[0] ?? 0, parts[1] ?? 0, parts[2] ?? 0];
|
|
2681
|
+
};
|
|
2682
|
+
const [aMaj, aMin, aPat] = parse(a);
|
|
2683
|
+
const [bMaj, bMin, bPat] = parse(b);
|
|
2684
|
+
if (aMaj !== bMaj) return aMaj > bMaj;
|
|
2685
|
+
if (aMin !== bMin) return aMin > bMin;
|
|
2686
|
+
return aPat > bPat;
|
|
2687
|
+
}
|
|
2674
2688
|
function readCache(cachePath) {
|
|
2675
2689
|
try {
|
|
2676
2690
|
const stat = statSync(cachePath);
|
|
@@ -2796,16 +2810,18 @@ ${formattedLessons}
|
|
|
2796
2810
|
if (cookitSection !== null) {
|
|
2797
2811
|
output += cookitSection;
|
|
2798
2812
|
}
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2813
|
+
if (!process.stdout.isTTY) {
|
|
2814
|
+
try {
|
|
2815
|
+
const updateResult = await checkForUpdate(join(root, ".claude", ".cache"));
|
|
2816
|
+
if (updateResult?.updateAvailable) {
|
|
2817
|
+
output += `
|
|
2803
2818
|
---
|
|
2804
2819
|
# Update Available
|
|
2805
|
-
compound-agent v${updateResult.latest} is available (current: v${updateResult.current}). Run \`pnpm update compound-agent\` to update.
|
|
2820
|
+
compound-agent v${updateResult.latest} is available (current: v${updateResult.current}). Run \`pnpm update --latest compound-agent\` to update.
|
|
2806
2821
|
`;
|
|
2822
|
+
}
|
|
2823
|
+
} catch {
|
|
2807
2824
|
}
|
|
2808
|
-
} catch {
|
|
2809
2825
|
}
|
|
2810
2826
|
return output;
|
|
2811
2827
|
}
|
|
@@ -3126,8 +3142,99 @@ init_search2();
|
|
|
3126
3142
|
|
|
3127
3143
|
// src/index.ts
|
|
3128
3144
|
init_compound();
|
|
3145
|
+
var LinterNameSchema = z.enum([
|
|
3146
|
+
"eslint",
|
|
3147
|
+
"ruff",
|
|
3148
|
+
"clippy",
|
|
3149
|
+
"golangci-lint",
|
|
3150
|
+
"ast-grep",
|
|
3151
|
+
"semgrep",
|
|
3152
|
+
"unknown"
|
|
3153
|
+
]);
|
|
3154
|
+
var LinterInfoSchema = z.object({
|
|
3155
|
+
linter: LinterNameSchema,
|
|
3156
|
+
configPath: z.string().nullable()
|
|
3157
|
+
});
|
|
3158
|
+
var DETECTION_RULES = [
|
|
3159
|
+
{
|
|
3160
|
+
linter: "eslint",
|
|
3161
|
+
configs: [
|
|
3162
|
+
// Flat config (ESLint v9+)
|
|
3163
|
+
"eslint.config.js",
|
|
3164
|
+
"eslint.config.mjs",
|
|
3165
|
+
"eslint.config.cjs",
|
|
3166
|
+
"eslint.config.ts",
|
|
3167
|
+
"eslint.config.mts",
|
|
3168
|
+
"eslint.config.cts",
|
|
3169
|
+
// Legacy config
|
|
3170
|
+
".eslintrc.js",
|
|
3171
|
+
".eslintrc.cjs",
|
|
3172
|
+
".eslintrc.json",
|
|
3173
|
+
".eslintrc.yml",
|
|
3174
|
+
".eslintrc.yaml"
|
|
3175
|
+
]
|
|
3176
|
+
},
|
|
3177
|
+
{
|
|
3178
|
+
linter: "ruff",
|
|
3179
|
+
configs: ["ruff.toml", ".ruff.toml"]
|
|
3180
|
+
},
|
|
3181
|
+
{
|
|
3182
|
+
linter: "clippy",
|
|
3183
|
+
configs: ["clippy.toml", ".clippy.toml"]
|
|
3184
|
+
},
|
|
3185
|
+
{
|
|
3186
|
+
linter: "golangci-lint",
|
|
3187
|
+
configs: [".golangci.yml", ".golangci.yaml", ".golangci.toml", ".golangci.json"]
|
|
3188
|
+
},
|
|
3189
|
+
{
|
|
3190
|
+
linter: "ast-grep",
|
|
3191
|
+
configs: ["sgconfig.yml"]
|
|
3192
|
+
},
|
|
3193
|
+
{
|
|
3194
|
+
linter: "semgrep",
|
|
3195
|
+
configs: [".semgrep.yml", ".semgrep.yaml"]
|
|
3196
|
+
}
|
|
3197
|
+
];
|
|
3198
|
+
function unknown() {
|
|
3199
|
+
return { linter: "unknown", configPath: null };
|
|
3200
|
+
}
|
|
3201
|
+
function isFile(filePath) {
|
|
3202
|
+
try {
|
|
3203
|
+
return statSync(filePath).isFile();
|
|
3204
|
+
} catch {
|
|
3205
|
+
return false;
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
function pyprojectHasRuff(repoRoot) {
|
|
3209
|
+
const filePath = join(repoRoot, "pyproject.toml");
|
|
3210
|
+
try {
|
|
3211
|
+
const content = readFileSync(filePath, "utf-8");
|
|
3212
|
+
return /^\s*\[tool\.ruff\b/m.test(content);
|
|
3213
|
+
} catch {
|
|
3214
|
+
return false;
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
function detectLinter(repoRoot) {
|
|
3218
|
+
try {
|
|
3219
|
+
for (const rule of DETECTION_RULES) {
|
|
3220
|
+
for (const config of rule.configs) {
|
|
3221
|
+
if (isFile(join(repoRoot, config))) {
|
|
3222
|
+
return { linter: rule.linter, configPath: config };
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
if (rule.linter === "ruff" && pyprojectHasRuff(repoRoot)) {
|
|
3226
|
+
return { linter: "ruff", configPath: "pyproject.toml" };
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
} catch {
|
|
3230
|
+
return unknown();
|
|
3231
|
+
}
|
|
3232
|
+
return unknown();
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
// src/index.ts
|
|
3129
3236
|
init_types();
|
|
3130
3237
|
|
|
3131
|
-
export { AuditFindingSchema, AuditReportSchema, CANDIDATE_MULTIPLIER, CCT_PATTERNS_PATH, CctPatternSchema, DB_PATH, DEFAULT_TEXT_WEIGHT, DEFAULT_VECTOR_WEIGHT, KNOWLEDGE_DB_PATH, KNOWLEDGE_SCHEMA_VERSION, LESSONS_PATH, LessonItemSchema, LessonSchema, MODEL_FILENAME, MODEL_URI, MemoryItemRecordSchema, MemoryItemSchema, MemoryItemTypeSchema, PatternItemSchema, PreferenceItemSchema, SolutionItemSchema, VERSION, acquireEmbedLock, appendLesson, appendMemoryItem, buildSimilarityMatrix, calculateScore, chunkFile, closeDb, closeKnowledgeDb, clusterBySimilarity, collectCachedChunkEmbeddings, confirmationBoost, cosineSimilarity, detectSelfCorrection, detectTestFailure, detectUserCorrection, embedChunks, embedText, embedTexts, formatLessonsCheck, generateId, getCachedChunkEmbedding, getEmbedding, getPrimeContext, getUnembeddedChunkCount, indexAndSpawnEmbed, indexDocs, isActionable, isEmbedLocked, isModelAvailable, isModelUsable, isNovel, isSpecific, loadSessionLessons, mergeHybridResults, normalizeBm25Rank, openKnowledgeDb, rankLessons, readCctPatterns, readEmbedStatus, readLessons, readMemoryItems, rebuildIndex, recencyBoost, resolveModel, retrieveForPlan, runAudit, runBackgroundEmbed, searchChunksKeywordScored, searchKeyword, searchKnowledge, searchKnowledgeVector, searchVector, setCachedChunkEmbedding, severityBoost, shouldPropose, spawnBackgroundEmbed, synthesizePattern, unloadEmbedding, writeCctPatterns, writeEmbedStatus };
|
|
3238
|
+
export { AuditFindingSchema, AuditReportSchema, CANDIDATE_MULTIPLIER, CCT_PATTERNS_PATH, CctPatternSchema, DB_PATH, DEFAULT_TEXT_WEIGHT, DEFAULT_VECTOR_WEIGHT, KNOWLEDGE_DB_PATH, KNOWLEDGE_SCHEMA_VERSION, LESSONS_PATH, LessonItemSchema, LessonSchema, LinterInfoSchema, LinterNameSchema, MODEL_FILENAME, MODEL_URI, MemoryItemRecordSchema, MemoryItemSchema, MemoryItemTypeSchema, PatternItemSchema, PreferenceItemSchema, SolutionItemSchema, VERSION, acquireEmbedLock, appendLesson, appendMemoryItem, buildSimilarityMatrix, calculateScore, chunkFile, closeDb, closeKnowledgeDb, clusterBySimilarity, collectCachedChunkEmbeddings, confirmationBoost, cosineSimilarity, detectLinter, detectSelfCorrection, detectTestFailure, detectUserCorrection, embedChunks, embedText, embedTexts, formatLessonsCheck, generateId, getCachedChunkEmbedding, getEmbedding, getPrimeContext, getUnembeddedChunkCount, indexAndSpawnEmbed, indexDocs, isActionable, isEmbedLocked, isModelAvailable, isModelUsable, isNovel, isSpecific, loadSessionLessons, mergeHybridResults, normalizeBm25Rank, openKnowledgeDb, rankLessons, readCctPatterns, readEmbedStatus, readLessons, readMemoryItems, rebuildIndex, recencyBoost, resolveModel, retrieveForPlan, runAudit, runBackgroundEmbed, searchChunksKeywordScored, searchKeyword, searchKnowledge, searchKnowledgeVector, searchVector, setCachedChunkEmbedding, severityBoost, shouldPropose, spawnBackgroundEmbed, synthesizePattern, unloadEmbedding, writeCctPatterns, writeEmbedStatus };
|
|
3132
3239
|
//# sourceMappingURL=index.js.map
|
|
3133
3240
|
//# sourceMappingURL=index.js.map
|