@thelogicatelier/sylva 1.0.4 → 1.0.10
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 +20 -0
- package/dist/awareness/braveSearch.d.ts +18 -0
- package/dist/awareness/braveSearch.js +134 -0
- package/dist/awareness/detector.d.ts +18 -0
- package/dist/awareness/detector.js +176 -0
- package/dist/awareness/index.d.ts +11 -0
- package/dist/awareness/index.js +259 -0
- package/dist/awareness/manifestParsers/dotnetParsers.d.ts +13 -0
- package/dist/awareness/manifestParsers/dotnetParsers.js +151 -0
- package/dist/awareness/manifestParsers/goParsers.d.ts +9 -0
- package/dist/awareness/manifestParsers/goParsers.js +137 -0
- package/dist/awareness/manifestParsers/index.d.ts +13 -0
- package/dist/awareness/manifestParsers/index.js +182 -0
- package/dist/awareness/manifestParsers/javaParsers.d.ts +13 -0
- package/dist/awareness/manifestParsers/javaParsers.js +243 -0
- package/dist/awareness/manifestParsers/openclawParser.d.ts +6 -0
- package/dist/awareness/manifestParsers/openclawParser.js +103 -0
- package/dist/awareness/manifestParsers/packageJsonParser.d.ts +7 -0
- package/dist/awareness/manifestParsers/packageJsonParser.js +209 -0
- package/dist/awareness/manifestParsers/pythonParsers.d.ts +21 -0
- package/dist/awareness/manifestParsers/pythonParsers.js +344 -0
- package/dist/awareness/manifestParsers/rustParsers.d.ts +9 -0
- package/dist/awareness/manifestParsers/rustParsers.js +153 -0
- package/dist/awareness/manifestScanner.d.ts +11 -0
- package/dist/awareness/manifestScanner.js +182 -0
- package/dist/awareness/types.d.ts +105 -0
- package/dist/awareness/types.js +6 -0
- package/dist/awareness/versionResolver.d.ts +17 -0
- package/dist/awareness/versionResolver.js +62 -0
- package/dist/awareness/webGrounding.d.ts +20 -0
- package/dist/awareness/webGrounding.js +102 -0
- package/dist/cli.js +19 -4
- package/dist/constants.js +11 -0
- package/dist/modules.d.ts +5 -2
- package/dist/modules.js +17 -4
- package/dist/prompts.d.ts +6 -0
- package/dist/prompts.js +5 -2
- package/dist/utils.js +12 -6
- package/package.json +2 -2
package/dist/prompts.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.EXTRACT_AGENTS_SECTIONS_SIGNATURE = exports.COMPILE_CONVENTIONS_SIGNATUR
|
|
|
4
4
|
const ax_1 = require("@ax-llm/ax");
|
|
5
5
|
exports.CODEBASE_ANALYSIS_SIGNATURE = (0, ax_1.f)()
|
|
6
6
|
.input("sourceContext", ax_1.f.string())
|
|
7
|
+
.input("awarenessContext", ax_1.f.string("Deterministically detected framework/architecture constraints from repo manifest files. Treat this as AUTHORITATIVE — do not contradict it. Use detected stacks and versions; mark unknown/ambiguous when appropriate."))
|
|
7
8
|
.output("projectOverview", ax_1.f.string("Project Overview & Context: Exhaustively describe all primary sub-services, their purpose, and what languages or frameworks power them."))
|
|
8
9
|
.output("agentPersona", ax_1.f.string("Agent Persona / Role"))
|
|
9
10
|
.output("techStack", ax_1.f.string("Tech Stack & Versions: List EVERY distinct language, library, database, and external API dependency used. WARNING: Do NOT guess frameworks based on assumptions or the presence of a package.json. You must explicitly scan the actual code files (e.g. imports in .py, .ts, .js) and dependency manifests (e.g. requirements.txt, go.mod) to determine the EXACT tech stack."))
|
|
@@ -25,7 +26,7 @@ exports.CODEBASE_ANALYSIS_SIGNATURE = (0, ax_1.f)()
|
|
|
25
26
|
.build();
|
|
26
27
|
exports.CODEBASE_ANALYZER_IDENTITY = {
|
|
27
28
|
name: "CodebaseAnalyzer",
|
|
28
|
-
description: "A hyper-detailed technical architect generating strict developer manifests. You must analyze the structural backbone, data flow, and day-to-day coding conventions of the application using recursive analysis of the source code. NEVER hallucinate frameworks; always verify by scanning actual source imports and dependency files.",
|
|
29
|
+
description: "A hyper-detailed technical architect generating strict developer manifests. You must analyze the structural backbone, data flow, and day-to-day coding conventions of the application using recursive analysis of the source code. NEVER hallucinate frameworks; always verify by scanning actual source imports and dependency files. CRITICAL: You will receive an awarenessContext field containing ARCHITECTURE CONSTRAINTS derived from deterministic manifest analysis. Treat these constraints as AUTHORITATIVE. Do not contradict them. Do not invent frameworks, languages, entrypoints, or tooling not present in the evidence. If OpenClaw is detected as orchestrator, include an OpenClaw Runtime section and treat other stacks as workloads/subagents. Use detected stack and versions; mark unknown/ambiguous when appropriate.",
|
|
29
30
|
};
|
|
30
31
|
exports.COMPILE_CONVENTIONS_SIGNATURE = (0, ax_1.f)()
|
|
31
32
|
.input("projectOverview", ax_1.f.string("Project Overview & Context."))
|
|
@@ -46,11 +47,13 @@ exports.COMPILE_CONVENTIONS_SIGNATURE = (0, ax_1.f)()
|
|
|
46
47
|
.input("documentationStandards", ax_1.f.string("Documentation Standards."))
|
|
47
48
|
.input("agentWorkflow", ax_1.f.string("Agent Workflow / SOP."))
|
|
48
49
|
.input("fewShotExamples", ax_1.f.string("Few-Shot Examples."))
|
|
49
|
-
.
|
|
50
|
+
.input("awarenessContext", ax_1.f.string("ARCHITECTURE CONSTRAINTS (AUTHORITATIVE): Deterministically detected frameworks, versions, and architecture from manifest files. Do NOT contradict these constraints in the compiled output. The compiled conventions MUST reflect the detected stacks, version certainty levels, and orchestrator/workload structure exactly as specified. If OpenClaw is the orchestrator, the conventions must describe the OpenClaw runtime and its workloads."))
|
|
51
|
+
.output("markdownDocument", ax_1.f.string("Comprehensive CODEBASE_CONVENTIONS.md document formatted with clear headings, bullet points, and specific code/file snippets as evidence. The document MUST align with the ARCHITECTURE CONSTRAINTS provided in awarenessContext."))
|
|
50
52
|
.build();
|
|
51
53
|
exports.EXTRACT_AGENTS_SECTIONS_SIGNATURE = (0, ax_1.f)()
|
|
52
54
|
.input("conventionsMarkdown", ax_1.f.string("The extracted architectural, data flow, and granular coding conventions"))
|
|
53
55
|
.input("repositoryName", ax_1.f.string("The name of the repository or project"))
|
|
56
|
+
.input("awarenessContext", ax_1.f.string("Deterministically detected framework/architecture constraints. AUTHORITATIVE — do not contradict. If OpenClaw orchestrator is present, include OpenClaw Runtime section. Show version certainty for each framework. Include Framework References when web refs are available."))
|
|
54
57
|
.output("projectOverview", ax_1.f.string("Comprehensive description of the project: what it does, its tech stack, its primary languages, and its overall purpose and functionality."))
|
|
55
58
|
.output("techStack", ax_1.f.string("Explicit and exhaustive list of supported languages, frameworks, UI libraries, backend runtimes, and tools used in the repository. Annotate what each technology is used for (e.g., 'X Framework for UI', 'Y Language for REST Services')."))
|
|
56
59
|
.output("architecture", ax_1.f.string("Deep mapping of where things live: directory layout, key modules, entry points, and their responsibilities. You MUST generate an ASCII diagram showing the architecture, module relationships, and sub-services. Break down complex monorepos explicitly (e.g., separating frontend code vs backend code)."))
|
package/dist/utils.js
CHANGED
|
@@ -60,7 +60,7 @@ function loadSourceTree(rootDir) {
|
|
|
60
60
|
stat = fs.statSync(fullPath);
|
|
61
61
|
}
|
|
62
62
|
catch {
|
|
63
|
-
console.
|
|
63
|
+
console.warn(`⚠️ Cannot read ${fullPath} (permission denied or broken symlink) — skipping.`);
|
|
64
64
|
continue;
|
|
65
65
|
}
|
|
66
66
|
if (stat.isDirectory()) {
|
|
@@ -82,11 +82,13 @@ function loadSourceTree(rootDir) {
|
|
|
82
82
|
tree[entry] = content;
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
|
-
console.warn(
|
|
85
|
+
console.warn(`⚠️ Skipping ${entry}: file is too large (${(content.length / 1000).toFixed(0)}K chars, limit is 500K).\n` +
|
|
86
|
+
` Consider adding this file to .gitignore if it's generated.`);
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
89
|
catch (error) {
|
|
89
|
-
console.warn(
|
|
90
|
+
console.warn(`⚠️ Skipping ${entry}: could not read file — ${error.message}\n` +
|
|
91
|
+
` This may be a binary file or use an unsupported encoding.`);
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
}
|
|
@@ -112,9 +114,12 @@ function cloneRepo(repoUrl, destDir) {
|
|
|
112
114
|
(0, child_process_1.execSync)(`git clone --depth 1 ${repoUrl} ${destDir}`, { stdio: "pipe" });
|
|
113
115
|
}
|
|
114
116
|
catch (error) {
|
|
115
|
-
console.error(
|
|
117
|
+
console.error(`❌ Failed to clone repository: ${error.message}\n` +
|
|
118
|
+
` URL: ${repoUrl}\n` +
|
|
119
|
+
` Destination: ${destDir}\n` +
|
|
120
|
+
` Ensure the URL is correct, the repo is public or you have access, and git is installed.`);
|
|
116
121
|
if (error.stderr)
|
|
117
|
-
console.error(error.stderr.toString());
|
|
122
|
+
console.error(` Git stderr: ${error.stderr.toString().trim()}`);
|
|
118
123
|
throw new Error("Git clone failed", { cause: error });
|
|
119
124
|
}
|
|
120
125
|
}
|
|
@@ -136,7 +141,8 @@ function saveAgentsToDisk(repoName, agentsContent, baseDir = "projects") {
|
|
|
136
141
|
console.log(`✅ Successfully saved AGENTS.md to: ${filePath}`);
|
|
137
142
|
}
|
|
138
143
|
catch (error) {
|
|
139
|
-
console.error(
|
|
144
|
+
console.error(`❌ Failed to save AGENTS.md to ${filePath}: ${error.message}\n` +
|
|
145
|
+
` Check that the output directory exists and you have write permissions.`);
|
|
140
146
|
}
|
|
141
147
|
}
|
|
142
148
|
const AGENTS_SECTION_HEADINGS = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thelogicatelier/sylva",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Auto-generate AGENTS.md for your repository using Ax-LLM. Analyze the structural backbone, data flow, and day-to-day coding conventions natively.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -63,4 +63,4 @@
|
|
|
63
63
|
"prettier": "^3.8.1",
|
|
64
64
|
"typescript-eslint": "^8.56.1"
|
|
65
65
|
}
|
|
66
|
-
}
|
|
66
|
+
}
|