project-graph-mcp 2.1.13 → 2.1.14
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.
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
|
|
2
|
+
# 🤖 Project Guidelines for AI Agents
|
|
3
|
+
|
|
4
|
+
## 1. Architecture Standards (Symbiote.js)
|
|
5
|
+
- **Component Structure**: Always use Triple-File Partitioning for components:
|
|
6
|
+
- `MyComponent.js`: Class logic (extends Symbiote)
|
|
7
|
+
- `MyComponent.tpl.js`: HTML template (export template)
|
|
8
|
+
- `MyComponent.css.js`: CSS styles (export rootStyles/shadowStyles)
|
|
9
|
+
- **State Management**: Use `this.init$` for local state and `this.sub()` for reactivity.
|
|
10
|
+
- **Directives**: Use `itemize` for lists, `js-d-kit` for static generation.
|
|
11
|
+
|
|
12
|
+
## 2. General Coding Rules
|
|
13
|
+
- **ESM Only**: Use `import` / `export`. No `require`.
|
|
14
|
+
- **No Dependencies**: Avoid adding new npm packages unless critical.
|
|
15
|
+
- **Comments**: Write clear JSDoc for all public methods.
|
|
16
|
+
- **Async/Await**: Prefer async/await over promises.
|
|
17
|
+
|
|
18
|
+
## 3. MCP Tools — Recommended Workflow
|
|
19
|
+
|
|
20
|
+
### Three Modes of `get_ai_context`
|
|
21
|
+
|
|
22
|
+
| Mode | Call | Returns | Tokens |
|
|
23
|
+
|------|------|---------|--------|
|
|
24
|
+
| **Code only** | `includeFiles: ["*"]` | All compressed source files | ~40-50k |
|
|
25
|
+
| **Code + context** | `includeFiles: ["*"], includeSkeleton: true, includeDocs: true` | Source + skeleton + docs | ~50-55k |
|
|
26
|
+
| **Overview** | _(default, no includeFiles)_ | Skeleton + docs only | ~2-3k |
|
|
27
|
+
|
|
28
|
+
### Quick Start: Full Codebase Context
|
|
29
|
+
For small/medium projects (under 100k tokens), load ALL code at once:
|
|
30
|
+
```
|
|
31
|
+
get_ai_context({ path: ".", includeFiles: ["*"] })
|
|
32
|
+
```
|
|
33
|
+
Returns compressed source of all JS files — pure code, no metadata noise.
|
|
34
|
+
|
|
35
|
+
To also get structural overview and documentation:
|
|
36
|
+
```
|
|
37
|
+
get_ai_context({ path: ".", includeFiles: ["*"], includeSkeleton: true, includeDocs: true })
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Step-by-Step: Large Projects
|
|
41
|
+
1. **Overview**: `get_ai_context({ path: "." })` → skeleton + docs (~2-3k tokens)
|
|
42
|
+
2. **Navigate**: `expand("ClassName")` → read specific class code
|
|
43
|
+
3. **Dependencies**: `deps("symbol")` / `usages("symbol")` → trace connections
|
|
44
|
+
4. **Focus Zone**: `get_focus_zone({ useGitDiff: true })` → recently changed files
|
|
45
|
+
|
|
46
|
+
### After Code Changes
|
|
47
|
+
- Call `invalidate_cache()` to refresh the graph.
|
|
48
|
+
|
|
49
|
+
### .contextignore
|
|
50
|
+
Placed in project root, controls which files are excluded from `includeFiles: ["*"]`.
|
|
51
|
+
Auto-created with sensible defaults (vendor/, *.min.js, chart.js, etc.).
|
|
52
|
+
Users can edit to add project-specific exclusions.
|
|
53
|
+
|
|
54
|
+
## 4. Custom Rules System
|
|
55
|
+
Configurable code analysis with auto-detection.
|
|
56
|
+
|
|
57
|
+
### Available Tools
|
|
58
|
+
- `get_custom_rules`: List all rulesets and their rules
|
|
59
|
+
- `set_custom_rule`: Add or update a rule in a ruleset
|
|
60
|
+
- `check_custom_rules`: Run analysis (auto-detects applicable rulesets)
|
|
61
|
+
|
|
62
|
+
### Auto-Detection
|
|
63
|
+
Rulesets are applied automatically based on:
|
|
64
|
+
1. `package.json` dependencies
|
|
65
|
+
2. Import patterns in source code
|
|
66
|
+
3. Code patterns (e.g., `extends Symbiote`)
|
|
67
|
+
|
|
68
|
+
### Creating New Rules
|
|
69
|
+
Use `set_custom_rule` to add framework-specific rules:
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"ruleSet": "my-framework-2x",
|
|
73
|
+
"rule": {
|
|
74
|
+
"id": "my-rule-id",
|
|
75
|
+
"name": "Rule Name",
|
|
76
|
+
"description": "What this rule checks",
|
|
77
|
+
"pattern": "badPattern",
|
|
78
|
+
"patternType": "string",
|
|
79
|
+
"replacement": "Use goodPattern instead",
|
|
80
|
+
"severity": "warning",
|
|
81
|
+
"filePattern": "*.js",
|
|
82
|
+
"docs": "https://docs.example.com/rule"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Severity Levels
|
|
88
|
+
- `error`: Critical issues that must be fixed
|
|
89
|
+
- `warning`: Important but not blocking
|
|
90
|
+
- `info`: Suggestions and best practices
|
|
91
|
+
|
package/package.json
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Files and directories excluded from AI context (get_ai_context includeFiles: ["*"])
|
|
2
|
+
# Glob patterns — one per line
|
|
3
|
+
|
|
4
|
+
# Vendored / bundled libs
|
|
5
|
+
vendor/
|
|
6
|
+
*.min.js
|
|
7
|
+
*.bundle.js
|
|
8
|
+
chart.js
|
|
9
|
+
d3.js
|
|
10
|
+
three.js
|
|
11
|
+
lodash.js
|
|
12
|
+
jquery*.js
|
|
13
|
+
|
|
14
|
+
# Generated
|
|
15
|
+
dist/
|
|
16
|
+
build/
|
|
17
|
+
coverage/
|
|
18
|
+
*.d.ts
|
|
19
|
+
|
|
20
|
+
# Tests
|
|
21
|
+
*.test.js
|
|
22
|
+
*.spec.js
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":1,"path":"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src","mtimes":{"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/analysis-cache.js":1776021880954.865,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/complexity.js":1776020743745.4976,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/custom-rules.js":1776020743746.4695,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/db-analysis.js":1776020743747.036,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/dead-code.js":1776020743747.205,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/full-analysis.js":1776020743747.434,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/jsdoc-checker.js":1776020743747.778,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/jsdoc-generator.js":1776020743748.1309,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/large-files.js":1775932068231.2554,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/outdated-patterns.js":1775932068241.3853,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/similar-functions.js":1776020743748.3684,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/test-annotations.js":1776021880973.3127,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/type-checker.js":1776020743790.671,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/undocumented.js":1776020743791.3872,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/cli/cli-handlers.js":1776020743791.534,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/cli/cli.js":1776009281031.448,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/ai-context.js":1776024855845.1536,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/compact-migrate.js":1776025662126.3894,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/compact.js":1776025662121.6743,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/compress.js":1776024835288.3477,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/ctx-resolver.js":1776024988359.2908,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/ctx-to-jsdoc.js":1776025604473.7043,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/doc-dialect.js":1776021881027.7375,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/expand.js":1776025662125.8457,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/framework-references.js":1775932068436.373,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/instructions.js":1775932068437.6816,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/jsdoc-builder.js":1776024792784.1958,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/mode-config.js":1776021881032.5818,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/split-declarations.js":1776020731393.9968,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/validate-pipeline.js":1776025626422.5903,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/event-bus.js":1776021881034.3083,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/file-walker.js":1776024739329.9265,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/filters.js":1776021881038.4585,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/graph-builder.js":1776020731524.8525,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/parser.js":1776021881058.1765,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/utils.js":1776024855849.509,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/workspace.js":1775932068530.74,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-go.js":1775932068546.679,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-python.js":1775932068554.9434,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-sql.js":1776021881068.4143,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-typescript.js":1775932068582.2983,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-utils.js":1775932068585.4934,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/mcp/mcp-server.js":1776017634423.9546,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/mcp/tool-defs.js":1776018403086.5388,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/mcp/tools.js":1776021881078.6213,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/backend-lifecycle.js":1776021881086.6484,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/backend.js":1775932249992.6167,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/local-gateway.js":1776020743913.1072,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/mdns.js":1776020743913.2654,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/server.js":1776016300633.3318,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/web-server.js":1776026310263.7048},"graph":{"v":1,"legend":{"computeContentHash":"CH","getCachePath":"CP","readCache":"rC","writeCache":"wC","isCacheValid":"CV","p":"p","u":"u","h":"h","analyzeComplexityFile":"CF","f":"f","getComplexity":"gC","y":"y","g":"g","x":"x","v":"v","$":"$","j":"j","S":"sS","b":"b","getCustomRules":"CR","setCustomRule":"CR1","deleteCustomRule":"CR2","detectProjectRuleSets":"PRS","checkCustomRules":"CR3","getDBSchema":"DBS","getTableUsage":"TU","getDBDeadTables":"DBD","m":"m","getDeadCode":"DC","w":"w","F":"fF","D":"dD","M":"mM","P":"pP","getFullAnalysis":"FA","getAnalysisSummaryOnly":"ASO","d":"d","checkJSDocFile":"JSD","checkJSDocConsistency":"JSD1","generateJSDoc":"JSD2","i":"i","o":"o","s":"s","generateJSDocFor":"JSD3","findJSFiles":"JSF","analyzeFile":"aF","getLargeFiles":"LF","analyzeFilePatterns":"FP","analyzePackageJson":"PJ","getOutdatedPatterns":"OP","getSimilarFunctions":"SF","a":"a","parseAnnotations":"pA","getAllFeatures":"AF","getPendingTests":"PT","markTestPassed":"TP","markTestFailed":"TF","getTestSummary":"TS","resetTestState":"TS1","l":"l","checkTypes":"cT","checkUndocumentedFile":"UF","getUndocumented":"gU","getUndocumentedSummary":"US","O":"oO","R":"rR","printHelp":"pH","runCLI":"CLI","getAiContext":"AC","compactMigrate":"cM","addTopLevelNewlines":"TLN","compactFile":"cF","beautifyFile":"bF","compactProject":"cP","expandProject":"eP","c":"c","compressFile":"cF1","editCompressed":"eC","resolveCtxPath":"CP1","resolveCtxRelPath":"CRP","readCtxFile":"CF1","parseCtxFile":"CF2","injectJSDoc":"JSD4","stripJSDoc":"JSD5","validateCtxContracts":"CC","generateDocDialect":"DD","readContextDocs":"CD","getProjectDocs":"PD","E":"eE","checkStaleness":"cS","generateContextFiles":"CF3","expandFile":"eF","fetchReference":"fR","listAvailable":"lA","getFrameworkReference":"FR","getInstructions":"gI","parseCtxParams":"CP2","sanitize":"sa","buildJSDocBlock":"JSD6","buildJSDocFromRaw":"JSD7","getConfig":"gC1","setConfig":"sC","getModeDescription":"MD","getModeWorkflow":"MW","splitDeclarations":"sD","isSingleLineBlob":"SLB","validatePipeline":"vP","emitToolCall":"TC","emitToolResult":"TR","onToolCall":"TC1","onToolResult":"TR1","removeToolListener":"TL","walkJSFiles":"JSF1","getFilters":"gF","setFilters":"sF","addExcludes":"aE","removeExcludes":"rE","resetFilters":"rF","parseGitignore":"pG","shouldExcludeDir":"ED","shouldExcludeFile":"EF","minifyLegend":"mL","e":"e","buildGraph":"bG","createSkeleton":"cS1","parseFile":"pF","discoverSubProjects":"SP","parseProject":"pP1","findAllProjectFiles":"APF","estimateTokens":"eT","setRoots":"sR","getWorkspaceRoot":"WR","resolvePath":"rP","parseGo":"pG1","extractImports":"eI","getBody":"gB","extractCalls":"eC1","parsePython":"pP2","isSQLString":"SQL","t":"t","extractSQLFromString":"SQL1","parseSQL":"SQL2","n":"n","extractSQLFromCode":"SQL3","extractORMFromCode":"ORM","parseTypeScript":"TS2","extractParams":"eP1","stripStringsAndComments":"SAC","createServer":"cS2","startStdioServer":"SS","getGraph":"gG","getSkeleton":"gS","getFocusZone":"FZ","expand":"ex","deps":"de","usages":"us","getCallChain":"CC1","invalidateCache":"iC","B":"bB","writePortFile":"PF","removePortFile":"PF1","listBackends":"lB","ensureBackend":"eB","startStdioProxy":"SP1","cleanup":"cl","registerService":"rS","getGatewayPort":"GP","registerLocal":"rL","k":"k","N":"nN","z":"z","A":"aA","startWebServer":"WS"},"reverseLegend":{"CH":"computeContentHash","CP":"getCachePath","rC":"readCache","wC":"writeCache","CV":"isCacheValid","p":"p","u":"u","h":"h","CF":"analyzeComplexityFile","f":"f","gC":"getComplexity","y":"y","g":"g","x":"x","v":"v","$":"$","j":"j","sS":"S","b":"b","CR":"getCustomRules","CR1":"setCustomRule","CR2":"deleteCustomRule","PRS":"detectProjectRuleSets","CR3":"checkCustomRules","DBS":"getDBSchema","TU":"getTableUsage","DBD":"getDBDeadTables","m":"m","DC":"getDeadCode","w":"w","fF":"F","dD":"D","mM":"M","pP":"P","FA":"getFullAnalysis","ASO":"getAnalysisSummaryOnly","d":"d","JSD":"checkJSDocFile","JSD1":"checkJSDocConsistency","JSD2":"generateJSDoc","i":"i","o":"o","s":"s","JSD3":"generateJSDocFor","JSF":"findJSFiles","aF":"analyzeFile","LF":"getLargeFiles","FP":"analyzeFilePatterns","PJ":"analyzePackageJson","OP":"getOutdatedPatterns","SF":"getSimilarFunctions","a":"a","pA":"parseAnnotations","AF":"getAllFeatures","PT":"getPendingTests","TP":"markTestPassed","TF":"markTestFailed","TS":"getTestSummary","TS1":"resetTestState","l":"l","cT":"checkTypes","UF":"checkUndocumentedFile","gU":"getUndocumented","US":"getUndocumentedSummary","oO":"O","rR":"R","pH":"printHelp","CLI":"runCLI","AC":"getAiContext","cM":"compactMigrate","TLN":"addTopLevelNewlines","cF":"compactFile","bF":"beautifyFile","cP":"compactProject","eP":"expandProject","c":"c","cF1":"compressFile","eC":"editCompressed","CP1":"resolveCtxPath","CRP":"resolveCtxRelPath","CF1":"readCtxFile","CF2":"parseCtxFile","JSD4":"injectJSDoc","JSD5":"stripJSDoc","CC":"validateCtxContracts","DD":"generateDocDialect","CD":"readContextDocs","PD":"getProjectDocs","eE":"E","cS":"checkStaleness","CF3":"generateContextFiles","eF":"expandFile","fR":"fetchReference","lA":"listAvailable","FR":"getFrameworkReference","gI":"getInstructions","CP2":"parseCtxParams","sa":"sanitize","JSD6":"buildJSDocBlock","JSD7":"buildJSDocFromRaw","gC1":"getConfig","sC":"setConfig","MD":"getModeDescription","MW":"getModeWorkflow","sD":"splitDeclarations","SLB":"isSingleLineBlob","vP":"validatePipeline","TC":"emitToolCall","TR":"emitToolResult","TC1":"onToolCall","TR1":"onToolResult","TL":"removeToolListener","JSF1":"walkJSFiles","gF":"getFilters","sF":"setFilters","aE":"addExcludes","rE":"removeExcludes","rF":"resetFilters","pG":"parseGitignore","ED":"shouldExcludeDir","EF":"shouldExcludeFile","mL":"minifyLegend","e":"e","bG":"buildGraph","cS1":"createSkeleton","pF":"parseFile","SP":"discoverSubProjects","pP1":"parseProject","APF":"findAllProjectFiles","eT":"estimateTokens","sR":"setRoots","WR":"getWorkspaceRoot","rP":"resolvePath","pG1":"parseGo","eI":"extractImports","gB":"getBody","eC1":"extractCalls","pP2":"parsePython","SQL":"isSQLString","t":"t","SQL1":"extractSQLFromString","SQL2":"parseSQL","n":"n","SQL3":"extractSQLFromCode","ORM":"extractORMFromCode","TS2":"parseTypeScript","eP1":"extractParams","SAC":"stripStringsAndComments","cS2":"createServer","SS":"startStdioServer","gG":"getGraph","gS":"getSkeleton","FZ":"getFocusZone","ex":"expand","de":"deps","us":"usages","CC1":"getCallChain","iC":"invalidateCache","bB":"B","PF":"writePortFile","PF1":"removePortFile","lB":"listBackends","eB":"ensureBackend","SP1":"startStdioProxy","cl":"cleanup","rS":"registerService","GP":"getGatewayPort","rL":"registerLocal","k":"k","nN":"N","z":"z","aA":"A","WS":"startWebServer"},"stats":{"files":51,"classes":0,"functions":240,"tables":0},"nodes":{"CH":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"CP":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"rC":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"wC":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"CV":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"p":{"t":"F","e":false,"f":"network/local-gateway.js"},"u":{"t":"F","e":false,"f":"network/web-server.js"},"h":{"t":"F","e":false,"f":"network/local-gateway.js"},"CF":{"t":"F","e":true,"f":"analysis/complexity.js"},"f":{"t":"F","e":false,"f":"network/local-gateway.js"},"gC":{"t":"F","e":true,"f":"analysis/complexity.js"},"y":{"t":"F","e":false,"f":"network/web-server.js"},"g":{"t":"F","e":false,"f":"network/web-server.js"},"x":{"t":"F","e":false,"f":"network/web-server.js"},"v":{"t":"F","e":false,"f":"core/parser.js"},"$":{"t":"F","e":false,"f":"analysis/custom-rules.js"},"j":{"t":"F","e":false,"f":"core/parser.js"},"sS":{"t":"F","e":false,"f":"network/web-server.js"},"b":{"t":"F","e":false,"f":"analysis/custom-rules.js"},"CR":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"CR1":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"CR2":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"PRS":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"CR3":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"DBS":{"t":"F","e":true,"f":"analysis/db-analysis.js"},"TU":{"t":"F","e":true,"f":"analysis/db-analysis.js"},"DBD":{"t":"F","e":true,"f":"analysis/db-analysis.js"},"m":{"t":"F","e":false,"f":"analysis/similar-functions.js"},"DC":{"t":"F","e":true,"f":"analysis/dead-code.js"},"w":{"t":"F","e":false,"f":"network/web-server.js"},"fF":{"t":"F","e":false,"f":"compact/ctx-to-jsdoc.js"},"dD":{"t":"F","e":false,"f":"compact/validate-pipeline.js"},"mM":{"t":"F","e":false,"f":"analysis/full-analysis.js"},"pP":{"t":"F","e":false,"f":"network/web-server.js"},"FA":{"t":"F","e":true,"f":"analysis/full-analysis.js"},"ASO":{"t":"F","e":true,"f":"analysis/full-analysis.js"},"d":{"t":"F","e":false,"f":"network/local-gateway.js"},"JSD":{"t":"F","e":true,"f":"analysis/jsdoc-checker.js"},"JSD1":{"t":"F","e":true,"f":"analysis/jsdoc-checker.js"},"JSD2":{"t":"F","e":true,"f":"analysis/jsdoc-generator.js"},"i":{"t":"F","e":false,"f":"analysis/type-checker.js"},"o":{"t":"F","e":false,"f":"network/mdns.js"},"s":{"t":"F","e":false,"f":"analysis/jsdoc-generator.js"},"JSD3":{"t":"F","e":true,"f":"analysis/jsdoc-generator.js"},"JSF":{"t":"F","e":true,"f":"core/parser.js"},"aF":{"t":"F","e":false,"f":"analysis/large-files.js"},"LF":{"t":"F","e":true,"f":"analysis/large-files.js"},"FP":{"t":"F","e":false,"f":"analysis/outdated-patterns.js"},"PJ":{"t":"F","e":false,"f":"analysis/outdated-patterns.js"},"OP":{"t":"F","e":true,"f":"analysis/outdated-patterns.js"},"SF":{"t":"F","e":true,"f":"analysis/similar-functions.js"},"a":{"t":"F","e":false,"f":"analysis/test-annotations.js"},"pA":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"AF":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"PT":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"TP":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"TF":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"TS":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"TS1":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"l":{"t":"F","e":false,"f":"network/local-gateway.js"},"cT":{"t":"F","e":true,"f":"analysis/type-checker.js"},"UF":{"t":"F","e":true,"f":"analysis/undocumented.js"},"gU":{"t":"F","e":true,"f":"analysis/undocumented.js"},"US":{"t":"F","e":true,"f":"analysis/undocumented.js"},"oO":{"t":"F","e":false,"f":"network/web-server.js"},"rR":{"t":"F","e":false,"f":"cli/cli-handlers.js"},"pH":{"t":"F","e":true,"f":"cli/cli.js"},"CLI":{"t":"F","e":true,"f":"cli/cli.js"},"AC":{"t":"F","e":true,"f":"compact/ai-context.js"},"cM":{"t":"F","e":true,"f":"compact/compact-migrate.js"},"TLN":{"t":"F","e":false,"f":"compact/compact.js"},"cF":{"t":"F","e":false,"f":"compact/compact.js"},"bF":{"t":"F","e":false,"f":"compact/compact.js"},"cP":{"t":"F","e":true,"f":"compact/compact.js"},"eP":{"t":"F","e":true,"f":"compact/expand.js"},"c":{"t":"F","e":false,"f":"network/mdns.js"},"cF1":{"t":"F","e":true,"f":"compact/compress.js"},"eC":{"t":"F","e":true,"f":"compact/compress.js"},"CP1":{"t":"F","e":true,"f":"compact/ctx-resolver.js"},"CRP":{"t":"F","e":true,"f":"compact/ctx-resolver.js"},"CF1":{"t":"F","e":true,"f":"compact/ctx-resolver.js"},"CF2":{"t":"F","e":true,"f":"compact/ctx-to-jsdoc.js"},"JSD4":{"t":"F","e":true,"f":"compact/ctx-to-jsdoc.js"},"JSD5":{"t":"F","e":true,"f":"compact/ctx-to-jsdoc.js"},"CC":{"t":"F","e":true,"f":"compact/ctx-to-jsdoc.js"},"DD":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"CD":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"PD":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"eE":{"t":"F","e":false,"f":"core/parser.js"},"cS":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"CF3":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"eF":{"t":"F","e":true,"f":"compact/expand.js"},"fR":{"t":"F","e":false,"f":"compact/framework-references.js"},"lA":{"t":"F","e":false,"f":"compact/framework-references.js"},"FR":{"t":"F","e":true,"f":"compact/framework-references.js"},"gI":{"t":"F","e":true,"f":"compact/instructions.js"},"CP2":{"t":"F","e":true,"f":"compact/jsdoc-builder.js"},"sa":{"t":"F","e":false,"f":"compact/jsdoc-builder.js"},"JSD6":{"t":"F","e":true,"f":"compact/jsdoc-builder.js"},"JSD7":{"t":"F","e":true,"f":"compact/jsdoc-builder.js"},"gC1":{"t":"F","e":true,"f":"compact/mode-config.js"},"sC":{"t":"F","e":true,"f":"compact/mode-config.js"},"MD":{"t":"F","e":true,"f":"compact/mode-config.js"},"MW":{"t":"F","e":true,"f":"compact/mode-config.js"},"sD":{"t":"F","e":true,"f":"compact/split-declarations.js"},"SLB":{"t":"F","e":true,"f":"compact/split-declarations.js"},"vP":{"t":"F","e":true,"f":"compact/validate-pipeline.js"},"TC":{"t":"F","e":true,"f":"core/event-bus.js"},"TR":{"t":"F","e":true,"f":"core/event-bus.js"},"TC1":{"t":"F","e":true,"f":"core/event-bus.js"},"TR1":{"t":"F","e":true,"f":"core/event-bus.js"},"TL":{"t":"F","e":true,"f":"core/event-bus.js"},"JSF1":{"t":"F","e":true,"f":"core/file-walker.js"},"gF":{"t":"F","e":true,"f":"core/filters.js"},"sF":{"t":"F","e":true,"f":"core/filters.js"},"aE":{"t":"F","e":true,"f":"core/filters.js"},"rE":{"t":"F","e":true,"f":"core/filters.js"},"rF":{"t":"F","e":true,"f":"core/filters.js"},"pG":{"t":"F","e":true,"f":"core/filters.js"},"ED":{"t":"F","e":true,"f":"core/filters.js"},"EF":{"t":"F","e":true,"f":"core/filters.js"},"mL":{"t":"F","e":true,"f":"core/graph-builder.js"},"e":{"t":"F","e":false,"f":"core/graph-builder.js"},"bG":{"t":"F","e":true,"f":"core/graph-builder.js"},"cS1":{"t":"F","e":true,"f":"core/graph-builder.js"},"pF":{"t":"F","e":true,"f":"core/parser.js"},"SP":{"t":"F","e":true,"f":"core/parser.js"},"pP1":{"t":"F","e":true,"f":"core/parser.js"},"APF":{"t":"F","e":true,"f":"core/parser.js"},"eT":{"t":"F","e":true,"f":"core/utils.js"},"sR":{"t":"F","e":true,"f":"core/workspace.js"},"WR":{"t":"F","e":true,"f":"core/workspace.js"},"rP":{"t":"F","e":true,"f":"core/workspace.js"},"pG1":{"t":"F","e":true,"f":"lang/lang-go.js"},"eI":{"t":"F","e":false,"f":"lang/lang-go.js"},"gB":{"t":"F","e":false,"f":"lang/lang-go.js"},"eC1":{"t":"F","e":false,"f":"lang/lang-go.js"},"pP2":{"t":"F","e":true,"f":"lang/lang-python.js"},"SQL":{"t":"F","e":true,"f":"lang/lang-sql.js"},"t":{"t":"F","e":false,"f":"lang/lang-sql.js"},"SQL1":{"t":"F","e":true,"f":"lang/lang-sql.js"},"SQL2":{"t":"F","e":true,"f":"lang/lang-sql.js"},"n":{"t":"F","e":false,"f":"network/mdns.js"},"SQL3":{"t":"F","e":true,"f":"lang/lang-sql.js"},"ORM":{"t":"F","e":true,"f":"lang/lang-sql.js"},"TS2":{"t":"F","e":true,"f":"lang/lang-typescript.js"},"eP1":{"t":"F","e":false,"f":"lang/lang-typescript.js"},"SAC":{"t":"F","e":true,"f":"lang/lang-utils.js"},"cS2":{"t":"F","e":true,"f":"mcp/mcp-server.js"},"SS":{"t":"F","e":true,"f":"mcp/mcp-server.js"},"gG":{"t":"F","e":true,"f":"mcp/tools.js"},"gS":{"t":"F","e":true,"f":"mcp/tools.js"},"FZ":{"t":"F","e":true,"f":"mcp/tools.js"},"ex":{"t":"F","e":true,"f":"mcp/tools.js"},"de":{"t":"F","e":true,"f":"mcp/tools.js"},"us":{"t":"F","e":true,"f":"mcp/tools.js"},"CC1":{"t":"F","e":true,"f":"mcp/tools.js"},"iC":{"t":"F","e":true,"f":"mcp/tools.js"},"bB":{"t":"F","e":false,"f":"network/backend-lifecycle.js"},"PF":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"PF1":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"lB":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"eB":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"SP1":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"cl":{"t":"F","e":false,"f":"network/backend.js"},"rS":{"t":"F","e":true,"f":"network/local-gateway.js"},"GP":{"t":"F","e":true,"f":"network/local-gateway.js"},"rL":{"t":"F","e":true,"f":"network/mdns.js"},"k":{"t":"F","e":false,"f":"network/web-server.js"},"nN":{"t":"F","e":false,"f":"network/web-server.js"},"z":{"t":"F","e":false,"f":"network/web-server.js"},"aA":{"t":"F","e":false,"f":"network/web-server.js"},"WS":{"t":"F","e":true,"f":"network/web-server.js"}},"edges":[],"orphans":["p","u","h","f","y","g","x","v","$","j","S","b","m","w","F","D","M","P","d","i","o","s","analyzeFile","analyzeFilePatterns","analyzePackageJson","a","l","O","R","addTopLevelNewlines","compactFile","beautifyFile","c","E","fetchReference","listAvailable","sanitize","e","extractImports","getBody","extractCalls","t","n","extractParams","B","cleanup","k","N","z","A"],"duplicates":{},"files":["analysis/analysis-cache.js","analysis/complexity.js","analysis/custom-rules.js","analysis/db-analysis.js","analysis/dead-code.js","analysis/full-analysis.js","analysis/jsdoc-checker.js","analysis/jsdoc-generator.js","analysis/large-files.js","analysis/outdated-patterns.js","analysis/similar-functions.js","analysis/test-annotations.js","analysis/type-checker.js","analysis/undocumented.js","cli/cli-handlers.js","cli/cli.js","compact/ai-context.js","compact/compact-migrate.js","compact/compact.js","compact/compress.js","compact/ctx-resolver.js","compact/ctx-to-jsdoc.js","compact/doc-dialect.js","compact/expand.js","compact/framework-references.js","compact/instructions.js","compact/jsdoc-builder.js","compact/mode-config.js","compact/split-declarations.js","compact/validate-pipeline.js","core/event-bus.js","core/file-walker.js","core/filters.js","core/graph-builder.js","core/parser.js","core/utils.js","core/workspace.js","lang/lang-go.js","lang/lang-python.js","lang/lang-sql.js","lang/lang-typescript.js","lang/lang-utils.js","mcp/mcp-server.js","mcp/tool-defs.js","mcp/tools.js","network/backend-lifecycle.js","network/backend.js","network/local-gateway.js","network/mdns.js","network/server.js","network/web-server.js"]}}
|
|
1
|
+
{"version":1,"path":"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src","mtimes":{"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/analysis-cache.js":1776021880954.865,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/complexity.js":1776020743745.4976,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/custom-rules.js":1776020743746.4695,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/db-analysis.js":1776020743747.036,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/dead-code.js":1776020743747.205,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/full-analysis.js":1776020743747.434,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/jsdoc-checker.js":1776020743747.778,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/jsdoc-generator.js":1776020743748.1309,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/large-files.js":1775932068231.2554,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/outdated-patterns.js":1775932068241.3853,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/similar-functions.js":1776020743748.3684,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/test-annotations.js":1776021880973.3127,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/type-checker.js":1776020743790.671,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/analysis/undocumented.js":1776020743791.3872,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/cli/cli-handlers.js":1776020743791.534,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/cli/cli.js":1776009281031.448,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/ai-context.js":1776090090709.129,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/compact-migrate.js":1776025662126.3894,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/compact.js":1776025662121.6743,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/compress.js":1776077544228.2026,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/ctx-resolver.js":1776024988359.2908,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/ctx-to-jsdoc.js":1776025604473.7043,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/doc-dialect.js":1776021881027.7375,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/expand.js":1776025662125.8457,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/framework-references.js":1775932068436.373,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/instructions.js":1776089868557.5547,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/jsdoc-builder.js":1776024792784.1958,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/mode-config.js":1776021881032.5818,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/split-declarations.js":1776020731393.9968,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/compact/validate-pipeline.js":1776025626422.5903,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/event-bus.js":1776021881034.3083,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/file-walker.js":1776024739329.9265,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/filters.js":1776021881038.4585,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/graph-builder.js":1776020731524.8525,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/parser.js":1776021881058.1765,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/utils.js":1776024855849.509,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/core/workspace.js":1775932068530.74,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-go.js":1775932068546.679,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-python.js":1775932068554.9434,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-sql.js":1776021881068.4143,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-typescript.js":1775932068582.2983,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/lang/lang-utils.js":1775932068585.4934,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/mcp/mcp-server.js":1776087281350.1672,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/mcp/tool-defs.js":1776089667319.6912,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/mcp/tools.js":1776021881078.6213,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/backend-lifecycle.js":1776087982767.4238,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/backend.js":1775932249992.6167,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/local-gateway.js":1776081624832.668,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/mdns.js":1776020743913.2654,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/server.js":1776088001724.466,"/Users/v.matiyasevich/Documents/GitHub/project-graph-mcp/src/network/web-server.js":1776087374451.2217},"graph":{"v":1,"legend":{"computeContentHash":"CH","getCachePath":"CP","readCache":"rC","writeCache":"wC","isCacheValid":"CV","p":"p","u":"u","h":"h","analyzeComplexityFile":"CF","f":"f","getComplexity":"gC","y":"y","g":"g","x":"x","v":"v","$":"$","j":"j","S":"sS","b":"b","getCustomRules":"CR","setCustomRule":"CR1","deleteCustomRule":"CR2","detectProjectRuleSets":"PRS","checkCustomRules":"CR3","getDBSchema":"DBS","getTableUsage":"TU","getDBDeadTables":"DBD","m":"m","getDeadCode":"DC","w":"w","F":"fF","D":"dD","M":"mM","P":"pP","getFullAnalysis":"FA","getAnalysisSummaryOnly":"ASO","d":"d","checkJSDocFile":"JSD","checkJSDocConsistency":"JSD1","generateJSDoc":"JSD2","i":"i","o":"o","s":"s","generateJSDocFor":"JSD3","findJSFiles":"JSF","analyzeFile":"aF","getLargeFiles":"LF","analyzeFilePatterns":"FP","analyzePackageJson":"PJ","getOutdatedPatterns":"OP","getSimilarFunctions":"SF","a":"a","parseAnnotations":"pA","getAllFeatures":"AF","getPendingTests":"PT","markTestPassed":"TP","markTestFailed":"TF","getTestSummary":"TS","resetTestState":"TS1","l":"l","checkTypes":"cT","checkUndocumentedFile":"UF","getUndocumented":"gU","getUndocumentedSummary":"US","O":"oO","R":"rR","printHelp":"pH","runCLI":"CLI","_loadIgnore":"_I","_parseIgnore":"_I1","_shouldIgnore":"_I2","getAiContext":"AC","compactMigrate":"cM","addTopLevelNewlines":"TLN","compactFile":"cF","beautifyFile":"bF","compactProject":"cP","expandProject":"eP","c":"c","compressFile":"cF1","editCompressed":"eC","resolveCtxPath":"CP1","resolveCtxRelPath":"CRP","readCtxFile":"CF1","parseCtxFile":"CF2","injectJSDoc":"JSD4","stripJSDoc":"JSD5","validateCtxContracts":"CC","generateDocDialect":"DD","readContextDocs":"CD","getProjectDocs":"PD","E":"eE","checkStaleness":"cS","generateContextFiles":"CF3","expandFile":"eF","fetchReference":"fR","listAvailable":"lA","getFrameworkReference":"FR","getInstructions":"gI","parseCtxParams":"CP2","sanitize":"sa","buildJSDocBlock":"JSD6","buildJSDocFromRaw":"JSD7","getConfig":"gC1","setConfig":"sC","getModeDescription":"MD","getModeWorkflow":"MW","splitDeclarations":"sD","isSingleLineBlob":"SLB","validatePipeline":"vP","emitToolCall":"TC","emitToolResult":"TR","onToolCall":"TC1","onToolResult":"TR1","removeToolListener":"TL","walkJSFiles":"JSF1","getFilters":"gF","setFilters":"sF","addExcludes":"aE","removeExcludes":"rE","resetFilters":"rF","parseGitignore":"pG","shouldExcludeDir":"ED","shouldExcludeFile":"EF","minifyLegend":"mL","e":"e","buildGraph":"bG","createSkeleton":"cS1","parseFile":"pF","discoverSubProjects":"SP","parseProject":"pP1","findAllProjectFiles":"APF","estimateTokens":"eT","setRoots":"sR","getWorkspaceRoot":"WR","resolvePath":"rP","parseGo":"pG1","extractImports":"eI","getBody":"gB","extractCalls":"eC1","parsePython":"pP2","isSQLString":"SQL","t":"t","extractSQLFromString":"SQL1","parseSQL":"SQL2","n":"n","extractSQLFromCode":"SQL3","extractORMFromCode":"ORM","parseTypeScript":"TS2","extractParams":"eP1","stripStringsAndComments":"SAC","createServer":"cS2","startStdioServer":"SS","getGraph":"gG","getSkeleton":"gS","getFocusZone":"FZ","expand":"ex","deps":"de","usages":"us","getCallChain":"CC1","invalidateCache":"iC","_getVersion":"_V","B":"bB","writePortFile":"PF","removePortFile":"PF1","listBackends":"lB","ensureBackend":"eB","startStdioProxy":"SP1","cleanup":"cl","registerService":"rS","getGatewayPort":"GP","registerLocal":"rL","_rv":"_r","k":"k","_clearCache":"_C","N":"nN","z":"z","A":"aA","startWebServer":"WS"},"reverseLegend":{"CH":"computeContentHash","CP":"getCachePath","rC":"readCache","wC":"writeCache","CV":"isCacheValid","p":"p","u":"u","h":"h","CF":"analyzeComplexityFile","f":"f","gC":"getComplexity","y":"y","g":"g","x":"x","v":"v","$":"$","j":"j","sS":"S","b":"b","CR":"getCustomRules","CR1":"setCustomRule","CR2":"deleteCustomRule","PRS":"detectProjectRuleSets","CR3":"checkCustomRules","DBS":"getDBSchema","TU":"getTableUsage","DBD":"getDBDeadTables","m":"m","DC":"getDeadCode","w":"w","fF":"F","dD":"D","mM":"M","pP":"P","FA":"getFullAnalysis","ASO":"getAnalysisSummaryOnly","d":"d","JSD":"checkJSDocFile","JSD1":"checkJSDocConsistency","JSD2":"generateJSDoc","i":"i","o":"o","s":"s","JSD3":"generateJSDocFor","JSF":"findJSFiles","aF":"analyzeFile","LF":"getLargeFiles","FP":"analyzeFilePatterns","PJ":"analyzePackageJson","OP":"getOutdatedPatterns","SF":"getSimilarFunctions","a":"a","pA":"parseAnnotations","AF":"getAllFeatures","PT":"getPendingTests","TP":"markTestPassed","TF":"markTestFailed","TS":"getTestSummary","TS1":"resetTestState","l":"l","cT":"checkTypes","UF":"checkUndocumentedFile","gU":"getUndocumented","US":"getUndocumentedSummary","oO":"O","rR":"R","pH":"printHelp","CLI":"runCLI","_I":"_loadIgnore","_I1":"_parseIgnore","_I2":"_shouldIgnore","AC":"getAiContext","cM":"compactMigrate","TLN":"addTopLevelNewlines","cF":"compactFile","bF":"beautifyFile","cP":"compactProject","eP":"expandProject","c":"c","cF1":"compressFile","eC":"editCompressed","CP1":"resolveCtxPath","CRP":"resolveCtxRelPath","CF1":"readCtxFile","CF2":"parseCtxFile","JSD4":"injectJSDoc","JSD5":"stripJSDoc","CC":"validateCtxContracts","DD":"generateDocDialect","CD":"readContextDocs","PD":"getProjectDocs","eE":"E","cS":"checkStaleness","CF3":"generateContextFiles","eF":"expandFile","fR":"fetchReference","lA":"listAvailable","FR":"getFrameworkReference","gI":"getInstructions","CP2":"parseCtxParams","sa":"sanitize","JSD6":"buildJSDocBlock","JSD7":"buildJSDocFromRaw","gC1":"getConfig","sC":"setConfig","MD":"getModeDescription","MW":"getModeWorkflow","sD":"splitDeclarations","SLB":"isSingleLineBlob","vP":"validatePipeline","TC":"emitToolCall","TR":"emitToolResult","TC1":"onToolCall","TR1":"onToolResult","TL":"removeToolListener","JSF1":"walkJSFiles","gF":"getFilters","sF":"setFilters","aE":"addExcludes","rE":"removeExcludes","rF":"resetFilters","pG":"parseGitignore","ED":"shouldExcludeDir","EF":"shouldExcludeFile","mL":"minifyLegend","e":"e","bG":"buildGraph","cS1":"createSkeleton","pF":"parseFile","SP":"discoverSubProjects","pP1":"parseProject","APF":"findAllProjectFiles","eT":"estimateTokens","sR":"setRoots","WR":"getWorkspaceRoot","rP":"resolvePath","pG1":"parseGo","eI":"extractImports","gB":"getBody","eC1":"extractCalls","pP2":"parsePython","SQL":"isSQLString","t":"t","SQL1":"extractSQLFromString","SQL2":"parseSQL","n":"n","SQL3":"extractSQLFromCode","ORM":"extractORMFromCode","TS2":"parseTypeScript","eP1":"extractParams","SAC":"stripStringsAndComments","cS2":"createServer","SS":"startStdioServer","gG":"getGraph","gS":"getSkeleton","FZ":"getFocusZone","ex":"expand","de":"deps","us":"usages","CC1":"getCallChain","iC":"invalidateCache","_V":"_getVersion","bB":"B","PF":"writePortFile","PF1":"removePortFile","lB":"listBackends","eB":"ensureBackend","SP1":"startStdioProxy","cl":"cleanup","rS":"registerService","GP":"getGatewayPort","rL":"registerLocal","_r":"_rv","k":"k","_C":"_clearCache","nN":"N","z":"z","aA":"A","WS":"startWebServer"},"stats":{"files":51,"classes":0,"functions":246,"tables":0},"nodes":{"CH":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"CP":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"rC":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"wC":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"CV":{"t":"F","e":true,"f":"analysis/analysis-cache.js"},"p":{"t":"F","e":false,"f":"network/local-gateway.js"},"u":{"t":"F","e":false,"f":"network/web-server.js"},"h":{"t":"F","e":false,"f":"network/local-gateway.js"},"CF":{"t":"F","e":true,"f":"analysis/complexity.js"},"f":{"t":"F","e":false,"f":"network/local-gateway.js"},"gC":{"t":"F","e":true,"f":"analysis/complexity.js"},"y":{"t":"F","e":false,"f":"network/web-server.js"},"g":{"t":"F","e":false,"f":"network/web-server.js"},"x":{"t":"F","e":false,"f":"network/web-server.js"},"v":{"t":"F","e":false,"f":"core/parser.js"},"$":{"t":"F","e":false,"f":"analysis/custom-rules.js"},"j":{"t":"F","e":false,"f":"core/parser.js"},"sS":{"t":"F","e":false,"f":"network/web-server.js"},"b":{"t":"F","e":false,"f":"analysis/custom-rules.js"},"CR":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"CR1":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"CR2":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"PRS":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"CR3":{"t":"F","e":true,"f":"analysis/custom-rules.js"},"DBS":{"t":"F","e":true,"f":"analysis/db-analysis.js"},"TU":{"t":"F","e":true,"f":"analysis/db-analysis.js"},"DBD":{"t":"F","e":true,"f":"analysis/db-analysis.js"},"m":{"t":"F","e":false,"f":"analysis/similar-functions.js"},"DC":{"t":"F","e":true,"f":"analysis/dead-code.js"},"w":{"t":"F","e":false,"f":"network/web-server.js"},"fF":{"t":"F","e":false,"f":"compact/ctx-to-jsdoc.js"},"dD":{"t":"F","e":false,"f":"compact/validate-pipeline.js"},"mM":{"t":"F","e":false,"f":"analysis/full-analysis.js"},"pP":{"t":"F","e":false,"f":"network/web-server.js"},"FA":{"t":"F","e":true,"f":"analysis/full-analysis.js"},"ASO":{"t":"F","e":true,"f":"analysis/full-analysis.js"},"d":{"t":"F","e":false,"f":"network/local-gateway.js"},"JSD":{"t":"F","e":true,"f":"analysis/jsdoc-checker.js"},"JSD1":{"t":"F","e":true,"f":"analysis/jsdoc-checker.js"},"JSD2":{"t":"F","e":true,"f":"analysis/jsdoc-generator.js"},"i":{"t":"F","e":false,"f":"analysis/type-checker.js"},"o":{"t":"F","e":false,"f":"network/mdns.js"},"s":{"t":"F","e":false,"f":"analysis/jsdoc-generator.js"},"JSD3":{"t":"F","e":true,"f":"analysis/jsdoc-generator.js"},"JSF":{"t":"F","e":true,"f":"core/parser.js"},"aF":{"t":"F","e":false,"f":"analysis/large-files.js"},"LF":{"t":"F","e":true,"f":"analysis/large-files.js"},"FP":{"t":"F","e":false,"f":"analysis/outdated-patterns.js"},"PJ":{"t":"F","e":false,"f":"analysis/outdated-patterns.js"},"OP":{"t":"F","e":true,"f":"analysis/outdated-patterns.js"},"SF":{"t":"F","e":true,"f":"analysis/similar-functions.js"},"a":{"t":"F","e":false,"f":"analysis/test-annotations.js"},"pA":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"AF":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"PT":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"TP":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"TF":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"TS":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"TS1":{"t":"F","e":true,"f":"analysis/test-annotations.js"},"l":{"t":"F","e":false,"f":"network/local-gateway.js"},"cT":{"t":"F","e":true,"f":"analysis/type-checker.js"},"UF":{"t":"F","e":true,"f":"analysis/undocumented.js"},"gU":{"t":"F","e":true,"f":"analysis/undocumented.js"},"US":{"t":"F","e":true,"f":"analysis/undocumented.js"},"oO":{"t":"F","e":false,"f":"network/web-server.js"},"rR":{"t":"F","e":false,"f":"cli/cli-handlers.js"},"pH":{"t":"F","e":true,"f":"cli/cli.js"},"CLI":{"t":"F","e":true,"f":"cli/cli.js"},"_I":{"t":"F","e":false,"f":"compact/ai-context.js"},"_I1":{"t":"F","e":false,"f":"compact/ai-context.js"},"_I2":{"t":"F","e":false,"f":"compact/ai-context.js"},"AC":{"t":"F","e":true,"f":"compact/ai-context.js"},"cM":{"t":"F","e":true,"f":"compact/compact-migrate.js"},"TLN":{"t":"F","e":false,"f":"compact/compact.js"},"cF":{"t":"F","e":false,"f":"compact/compact.js"},"bF":{"t":"F","e":false,"f":"compact/compact.js"},"cP":{"t":"F","e":true,"f":"compact/compact.js"},"eP":{"t":"F","e":true,"f":"compact/expand.js"},"c":{"t":"F","e":false,"f":"network/mdns.js"},"cF1":{"t":"F","e":true,"f":"compact/compress.js"},"eC":{"t":"F","e":true,"f":"compact/compress.js"},"CP1":{"t":"F","e":true,"f":"compact/ctx-resolver.js"},"CRP":{"t":"F","e":true,"f":"compact/ctx-resolver.js"},"CF1":{"t":"F","e":true,"f":"compact/ctx-resolver.js"},"CF2":{"t":"F","e":true,"f":"compact/ctx-to-jsdoc.js"},"JSD4":{"t":"F","e":true,"f":"compact/ctx-to-jsdoc.js"},"JSD5":{"t":"F","e":true,"f":"compact/ctx-to-jsdoc.js"},"CC":{"t":"F","e":true,"f":"compact/ctx-to-jsdoc.js"},"DD":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"CD":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"PD":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"eE":{"t":"F","e":false,"f":"core/parser.js"},"cS":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"CF3":{"t":"F","e":true,"f":"compact/doc-dialect.js"},"eF":{"t":"F","e":true,"f":"compact/expand.js"},"fR":{"t":"F","e":false,"f":"compact/framework-references.js"},"lA":{"t":"F","e":false,"f":"compact/framework-references.js"},"FR":{"t":"F","e":true,"f":"compact/framework-references.js"},"gI":{"t":"F","e":true,"f":"compact/instructions.js"},"CP2":{"t":"F","e":true,"f":"compact/jsdoc-builder.js"},"sa":{"t":"F","e":false,"f":"compact/jsdoc-builder.js"},"JSD6":{"t":"F","e":true,"f":"compact/jsdoc-builder.js"},"JSD7":{"t":"F","e":true,"f":"compact/jsdoc-builder.js"},"gC1":{"t":"F","e":true,"f":"compact/mode-config.js"},"sC":{"t":"F","e":true,"f":"compact/mode-config.js"},"MD":{"t":"F","e":true,"f":"compact/mode-config.js"},"MW":{"t":"F","e":true,"f":"compact/mode-config.js"},"sD":{"t":"F","e":true,"f":"compact/split-declarations.js"},"SLB":{"t":"F","e":true,"f":"compact/split-declarations.js"},"vP":{"t":"F","e":true,"f":"compact/validate-pipeline.js"},"TC":{"t":"F","e":true,"f":"core/event-bus.js"},"TR":{"t":"F","e":true,"f":"core/event-bus.js"},"TC1":{"t":"F","e":true,"f":"core/event-bus.js"},"TR1":{"t":"F","e":true,"f":"core/event-bus.js"},"TL":{"t":"F","e":true,"f":"core/event-bus.js"},"JSF1":{"t":"F","e":true,"f":"core/file-walker.js"},"gF":{"t":"F","e":true,"f":"core/filters.js"},"sF":{"t":"F","e":true,"f":"core/filters.js"},"aE":{"t":"F","e":true,"f":"core/filters.js"},"rE":{"t":"F","e":true,"f":"core/filters.js"},"rF":{"t":"F","e":true,"f":"core/filters.js"},"pG":{"t":"F","e":true,"f":"core/filters.js"},"ED":{"t":"F","e":true,"f":"core/filters.js"},"EF":{"t":"F","e":true,"f":"core/filters.js"},"mL":{"t":"F","e":true,"f":"core/graph-builder.js"},"e":{"t":"F","e":false,"f":"core/graph-builder.js"},"bG":{"t":"F","e":true,"f":"core/graph-builder.js"},"cS1":{"t":"F","e":true,"f":"core/graph-builder.js"},"pF":{"t":"F","e":true,"f":"core/parser.js"},"SP":{"t":"F","e":true,"f":"core/parser.js"},"pP1":{"t":"F","e":true,"f":"core/parser.js"},"APF":{"t":"F","e":true,"f":"core/parser.js"},"eT":{"t":"F","e":true,"f":"core/utils.js"},"sR":{"t":"F","e":true,"f":"core/workspace.js"},"WR":{"t":"F","e":true,"f":"core/workspace.js"},"rP":{"t":"F","e":true,"f":"core/workspace.js"},"pG1":{"t":"F","e":true,"f":"lang/lang-go.js"},"eI":{"t":"F","e":false,"f":"lang/lang-go.js"},"gB":{"t":"F","e":false,"f":"lang/lang-go.js"},"eC1":{"t":"F","e":false,"f":"lang/lang-go.js"},"pP2":{"t":"F","e":true,"f":"lang/lang-python.js"},"SQL":{"t":"F","e":true,"f":"lang/lang-sql.js"},"t":{"t":"F","e":false,"f":"lang/lang-sql.js"},"SQL1":{"t":"F","e":true,"f":"lang/lang-sql.js"},"SQL2":{"t":"F","e":true,"f":"lang/lang-sql.js"},"n":{"t":"F","e":false,"f":"network/mdns.js"},"SQL3":{"t":"F","e":true,"f":"lang/lang-sql.js"},"ORM":{"t":"F","e":true,"f":"lang/lang-sql.js"},"TS2":{"t":"F","e":true,"f":"lang/lang-typescript.js"},"eP1":{"t":"F","e":false,"f":"lang/lang-typescript.js"},"SAC":{"t":"F","e":true,"f":"lang/lang-utils.js"},"cS2":{"t":"F","e":true,"f":"mcp/mcp-server.js"},"SS":{"t":"F","e":true,"f":"mcp/mcp-server.js"},"gG":{"t":"F","e":true,"f":"mcp/tools.js"},"gS":{"t":"F","e":true,"f":"mcp/tools.js"},"FZ":{"t":"F","e":true,"f":"mcp/tools.js"},"ex":{"t":"F","e":true,"f":"mcp/tools.js"},"de":{"t":"F","e":true,"f":"mcp/tools.js"},"us":{"t":"F","e":true,"f":"mcp/tools.js"},"CC1":{"t":"F","e":true,"f":"mcp/tools.js"},"iC":{"t":"F","e":true,"f":"mcp/tools.js"},"_V":{"t":"F","e":false,"f":"network/backend-lifecycle.js"},"bB":{"t":"F","e":false,"f":"network/backend-lifecycle.js"},"PF":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"PF1":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"lB":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"eB":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"SP1":{"t":"F","e":true,"f":"network/backend-lifecycle.js"},"cl":{"t":"F","e":false,"f":"network/backend.js"},"rS":{"t":"F","e":true,"f":"network/local-gateway.js"},"GP":{"t":"F","e":true,"f":"network/local-gateway.js"},"rL":{"t":"F","e":true,"f":"network/mdns.js"},"_r":{"t":"F","e":false,"f":"network/web-server.js"},"k":{"t":"F","e":false,"f":"network/web-server.js"},"_C":{"t":"F","e":false,"f":"network/web-server.js"},"nN":{"t":"F","e":false,"f":"network/web-server.js"},"z":{"t":"F","e":false,"f":"network/web-server.js"},"aA":{"t":"F","e":false,"f":"network/web-server.js"},"WS":{"t":"F","e":true,"f":"network/web-server.js"}},"edges":[],"orphans":["p","u","h","f","y","g","x","v","$","j","S","b","m","w","F","D","M","P","d","i","o","s","analyzeFile","analyzeFilePatterns","analyzePackageJson","a","l","O","R","_loadIgnore","_parseIgnore","_shouldIgnore","addTopLevelNewlines","compactFile","beautifyFile","c","E","fetchReference","listAvailable","sanitize","e","extractImports","getBody","extractCalls","t","n","extractParams","_getVersion","B","cleanup","_rv","k","_clearCache","N","z","A"],"duplicates":{},"files":["analysis/analysis-cache.js","analysis/complexity.js","analysis/custom-rules.js","analysis/db-analysis.js","analysis/dead-code.js","analysis/full-analysis.js","analysis/jsdoc-checker.js","analysis/jsdoc-generator.js","analysis/large-files.js","analysis/outdated-patterns.js","analysis/similar-functions.js","analysis/test-annotations.js","analysis/type-checker.js","analysis/undocumented.js","cli/cli-handlers.js","cli/cli.js","compact/ai-context.js","compact/compact-migrate.js","compact/compact.js","compact/compress.js","compact/ctx-resolver.js","compact/ctx-to-jsdoc.js","compact/doc-dialect.js","compact/expand.js","compact/framework-references.js","compact/instructions.js","compact/jsdoc-builder.js","compact/mode-config.js","compact/split-declarations.js","compact/validate-pipeline.js","core/event-bus.js","core/file-walker.js","core/filters.js","core/graph-builder.js","core/parser.js","core/utils.js","core/workspace.js","lang/lang-go.js","lang/lang-python.js","lang/lang-sql.js","lang/lang-typescript.js","lang/lang-utils.js","mcp/mcp-server.js","mcp/tool-defs.js","mcp/tools.js","network/backend-lifecycle.js","network/backend.js","network/local-gateway.js","network/mdns.js","network/server.js","network/web-server.js"]}}
|
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
// @ctx .context/src/compact/ai-context.ctx
|
|
2
|
-
import{estimateTokens}from"../core/utils.js";import{resolve as e,extname as t}from"path";import{getSkeleton as s,getGraph as o}from"../mcp/tools.js";import{getProjectDocs as n}from"./doc-dialect.js";import{compressFile as i}from"./compress.js";import{findJSFiles as r}from"../core/parser.js";
|
|
2
|
+
import{estimateTokens}from"../core/utils.js";import{resolve as e,extname as t,relative as _rel,join as _join,basename as _base}from"path";import{getSkeleton as s,getGraph as o}from"../mcp/tools.js";import{getProjectDocs as n}from"./doc-dialect.js";import{compressFile as i}from"./compress.js";import{findJSFiles as r}from"../core/parser.js";import{readFileSync as _rf,existsSync as _ex,writeFileSync as _wf}from"fs";
|
|
3
3
|
const c=new Set([".js",".mjs",".ts",".tsx"]);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const IGNORE_FILE=".contextignore";
|
|
5
|
+
const DEFAULT_IGNORE=`# Files and directories excluded from AI context (get_ai_context includeFiles: ["*"])
|
|
6
|
+
# Glob patterns — one per line
|
|
7
|
+
|
|
8
|
+
# Vendored / bundled libs
|
|
9
|
+
vendor/
|
|
10
|
+
*.min.js
|
|
11
|
+
*.bundle.js
|
|
12
|
+
chart.js
|
|
13
|
+
d3.js
|
|
14
|
+
three.js
|
|
15
|
+
lodash.js
|
|
16
|
+
jquery*.js
|
|
17
|
+
|
|
18
|
+
# Generated
|
|
19
|
+
dist/
|
|
20
|
+
build/
|
|
21
|
+
coverage/
|
|
22
|
+
*.d.ts
|
|
23
|
+
|
|
24
|
+
# Tests
|
|
25
|
+
*.test.js
|
|
26
|
+
*.spec.js
|
|
27
|
+
`;
|
|
28
|
+
function _loadIgnore(p){const f=_join(p,IGNORE_FILE);if(!_ex(f)){try{_wf(f,DEFAULT_IGNORE)}catch{}return _parseIgnore(DEFAULT_IGNORE)}return _parseIgnore(_rf(f,"utf-8"))}
|
|
29
|
+
function _parseIgnore(s){return s.split("\n").map(l=>l.trim()).filter(l=>l&&!l.startsWith("#"))}
|
|
30
|
+
function _shouldIgnore(relPath,patterns){for(const p of patterns){if(p.endsWith("/")&&relPath.startsWith(p.slice(0,-1)))return true;if(p.endsWith("/")&&relPath.includes("/"+p.slice(0,-1)))return true;const re=new RegExp("^"+p.replace(/\./g,"\\.").replace(/\*/g,".*").replace(/\?/g,".")+"$");if(re.test(_base(relPath))||re.test(relPath))return true}return false}
|
|
31
|
+
export async function getAiContext(a,l={}){if(!a)return{error:"path is required",hint:'Usage: get_ai_context({ path: ".", includeFiles: ["*"] })',modes:{overview:'get_ai_context({ path: "." }) → skeleton + docs (~2-3k tokens)',code:'get_ai_context({ path: ".", includeFiles: ["*"] }) → all source files',full:'get_ai_context({ path: ".", includeFiles: ["*"], includeSkeleton: true, includeDocs: true }) → everything'}};const p=e(a);if(!_ex(p))return{error:`Path not found: ${p}`,hint:"Provide an existing directory path"};const f=l.includeFiles||[];if(typeof f==="string")return{error:"includeFiles must be an array, got string",hint:`Use includeFiles: ["${f}"] or includeFiles: ["*"] for all files`};const u={};const allJS=r(p);const wantAll=f.includes("*");const useSkeleton="includeSkeleton"in l?l.includeSkeleton:!wantAll;const useDocs="includeDocs"in l?l.includeDocs:!wantAll;if(allJS.length===0){u.hint="No JS/TS files found. Check the path — it should point to your source directory.";}
|
|
32
|
+
let g=0;if(useSkeleton&&(u.skeleton=await s(p),g+=estimateTokens(u.skeleton)),useDocs){const e=await o(p);u.docs=n(e,p),g+=estimateTokens(u.docs)}if(wantAll||f.length>0){u.files={};const ignorePatterns=wantAll?_loadIgnore(p):[];
|
|
33
|
+
let targets;if(wantAll){targets=allJS.map(e=>_rel(p,e)).filter(f=>!_shouldIgnore(f,ignorePatterns));u.ignored=allJS.length-targets.length}else{targets=f}for(const s of targets){const o=allJS.find(e=>e.endsWith(s)||e.endsWith("/"+s));if(!o){u.files[s]={error:`File not found: ${s}`};continue}const n=t(o).toLowerCase();if(c.has(n))try{const e=await i(o,{beautify:!1,legend:!1});u.files[s]=e.code,g+=e.compressed}catch(e){u.files[s]={error:e.message}}else u.files[s]={error:`Unsupported file type: ${n}`}}}
|
|
34
|
+
let k=0;for(const e of allJS)try{k+=estimateTokens(_rf(e,"utf-8"))}catch{}const y=k>0?Math.round(100*(1-g/k)):0;return u.totalTokens=g,u.vsOriginal=k,u.savings=`${y}%`,u}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
// @ctx .context/src/compact/instructions.ctx
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import{readFileSync}from"fs";import{join,dirname}from"path";import{fileURLToPath}from"url";
|
|
3
|
+
const __dir=dirname(fileURLToPath(import.meta.url));
|
|
4
|
+
const _mdPath=join(__dir,"..","..","docs","AGENT_INSTRUCTIONS.md");
|
|
5
|
+
let _cached=null;
|
|
6
|
+
export function getInstructions(){if(!_cached)try{_cached=readFileSync(_mdPath,"utf-8")}catch{_cached="# Agent Instructions\n\nFile not found: "+_mdPath}return _cached}
|
|
7
|
+
export const AGENT_INSTRUCTIONS=getInstructions();
|
package/src/mcp/tool-defs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @ctx .context/src/mcp/tool-defs.ctx
|
|
2
|
-
const e={get_skeleton:{name:"get_skeleton",description:"Get compact minified project overview (10-50x smaller than source). Returns legend, stats, and node summaries.",inputSchema:{type:"object",properties:{path:{type:"string",description:'Path to scan (e.g., "src/components")'}},required:["path"]}},get_focus_zone:{name:"get_focus_zone",description:"Get enriched context for recently modified files. Auto-detects from git or accepts explicit file list.",inputSchema:{type:"object",properties:{path:{type:"string"},useGitDiff:{type:"boolean",description:"Auto-detect from git diff"},recentFiles:{type:"array",items:{type:"string"},description:"Explicit list of files to expand"}}}},get_ai_context:{name:"get_ai_context",description:"Boot AI agent context: skeleton +
|
|
2
|
+
const e={get_skeleton:{name:"get_skeleton",description:"Get compact minified project overview (10-50x smaller than source). Returns legend, stats, and node summaries.",inputSchema:{type:"object",properties:{path:{type:"string",description:'Path to scan (e.g., "src/components")'}},required:["path"]}},get_focus_zone:{name:"get_focus_zone",description:"Get enriched context for recently modified files. Auto-detects from git or accepts explicit file list.",inputSchema:{type:"object",properties:{path:{type:"string"},useGitDiff:{type:"boolean",description:"Auto-detect from git diff"},recentFiles:{type:"array",items:{type:"string"},description:"Explicit list of files to expand"}}}},get_ai_context:{name:"get_ai_context",description:"Boot AI agent context. Two modes:\n1. Default: returns skeleton + docs (2-3k tokens) for structure overview.\n2. includeFiles: ['*']: returns ALL compressed source code without skeleton/docs (pure code dump). Filters vendored files via .contextignore (auto-created on first call).\nCall FIRST when starting work. Use ['*'] for small/medium projects that fit in context.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Project root path"},includeFiles:{type:"array",items:{type:"string"},description:'Files to include. Use ["*"] for ALL source files (filtered by .contextignore). Or specific files: ["parser.js", "tools.js"]'},includeDocs:{type:"boolean",description:"Include doc-dialect documentation (default: true, auto-disabled with '*')"},includeSkeleton:{type:"boolean",description:"Include project skeleton (default: true, auto-disabled with '*')"}},required:["path"]}},invalidate_cache:{name:"invalidate_cache",description:"Invalidate the cached graph. Use after making code changes.",inputSchema:{type:"object",properties:{}}},get_usage_guide:{name:"get_usage_guide",description:"Get the comprehensive usage guide for project-graph with examples and best practices.\nCall this FIRST when planning how to analyze, navigate, or audit a codebase.\nReturns practical examples and recommended workflow for each feature area.\n\nAvailable topics: navigation, analysis, testing, documentation, rules, workflow.\nOmit topic to get the full guide.",inputSchema:{type:"object",properties:{topic:{type:"string",description:"Optional topic filter: navigation, analysis, testing, documentation, rules, workflow"}}}},get_agent_instructions:{name:"get_agent_instructions",description:"Get coding guidelines, architectural standards, and JSDoc rules for this project.",inputSchema:{type:"object",properties:{}}},get_custom_rules:{name:"get_custom_rules",description:"List all custom code analysis rules. Rules are stored in JSON files in rules/ directory.",inputSchema:{type:"object",properties:{}}},set_custom_rule:{name:"set_custom_rule",description:"Add or update a custom code analysis rule. Creates ruleset if it does not exist.",inputSchema:{type:"object",properties:{ruleSet:{type:"string",description:'Name of ruleset (e.g., "symbiote", "react", "custom")'},rule:{type:"object",description:"Rule definition with id, name, description, pattern, patternType, replacement, severity, filePattern"}},required:["ruleSet","rule"]}},check_custom_rules:{name:"check_custom_rules",description:"Run custom rules analysis on a directory. Returns violations found.",inputSchema:{type:"object",properties:{path:{type:"string",description:"Path to scan"},ruleSet:{type:"string",description:"Optional: specific ruleset to use"},severity:{type:"string",description:"Optional: filter by severity (error/warning/info)"}},required:["path"]}},get_framework_reference:{name:"get_framework_reference",description:"Get framework-specific AI reference documentation. Auto-detects framework from project or accepts explicit name. Returns full API reference, patterns, and common mistakes as agent context.",inputSchema:{type:"object",properties:{framework:{type:"string",description:'Framework reference name (e.g., "symbiote-3x"). If omitted, auto-detects from path.'},path:{type:"string",description:'Project path for auto-detection (e.g., "src/")'}}}}};
|
|
3
3
|
export const TOOLS=[e.get_skeleton,e.get_focus_zone,e.get_ai_context,e.invalidate_cache,e.get_usage_guide,e.get_agent_instructions,e.get_custom_rules,e.set_custom_rule,e.check_custom_rules,e.get_framework_reference,{name:"navigate",description:"Navigate the project graph. Actions: expand|deps|usages|call_chain|sub_projects",inputSchema:{type:"object",properties:{action:{type:"string",enum:["expand","deps","usages","call_chain","sub_projects"],description:"Navigation action to perform"},symbol:{type:"string",description:"Symbol name (for expand, deps, usages)"},from:{type:"string",description:"Starting symbol (for call_chain)"},to:{type:"string",description:"Target symbol (for call_chain)"},path:{type:"string",description:"Path to scan (for call_chain, sub_projects)"}},required:["action"]}},{name:"analyze",description:"Code quality analysis. Actions: dead_code|similar_functions|complexity|large_files|outdated_patterns|full_analysis|analysis_summary|undocumented",inputSchema:{type:"object",properties:{action:{type:"string",enum:["dead_code","similar_functions","complexity","large_files","outdated_patterns","full_analysis","analysis_summary","undocumented"],description:"Analysis type to run"},path:{type:"string",description:"Path to scan"},minComplexity:{type:"number",description:"For complexity: minimum threshold (default: 1)"},onlyProblematic:{type:"boolean",description:"For complexity/large_files: only show issues"},threshold:{type:"number",description:"For similar_functions: min similarity % (default: 60)"},includeItems:{type:"boolean",description:"For full_analysis: include individual items"},level:{type:"string",enum:["tests","params","all"],description:"For undocumented: strictness level"},codeOnly:{type:"boolean",description:"For outdated_patterns: only check code"},depsOnly:{type:"boolean",description:"For outdated_patterns: only check deps"}},required:["action","path"]}},{name:"testing",description:"Test checklist management. Actions: pending|pass|fail|summary|reset",inputSchema:{type:"object",properties:{action:{type:"string",enum:["pending","pass","fail","summary","reset"],description:"Test action to perform"},path:{type:"string",description:"Path to scan (for pending, summary)"},testId:{type:"string",description:"Test ID (for pass, fail)"},reason:{type:"string",description:"Failure reason (for fail)"}},required:["action"]}},{name:"filters",description:"Filter configuration. Actions: get|set|add_excludes|remove_excludes|reset",inputSchema:{type:"object",properties:{action:{type:"string",enum:["get","set","add_excludes","remove_excludes","reset"],description:"Filter action to perform"},excludeDirs:{type:"array",items:{type:"string"},description:"For set: directories to exclude"},excludePatterns:{type:"array",items:{type:"string"},description:"For set: file patterns to exclude"},useGitignore:{type:"boolean",description:"For set: use .gitignore patterns"},includeHidden:{type:"boolean",description:"For set: include hidden directories"},dirs:{type:"array",items:{type:"string"},description:"For add_excludes/remove_excludes"}},required:["action"]}},{name:"jsdoc",description:"JSDoc operations. Actions: check_consistency|check_types|generate",inputSchema:{type:"object",properties:{action:{type:"string",enum:["check_consistency","check_types","generate"],description:"JSDoc action to perform"},path:{type:"string",description:"Path to scan"},name:{type:"string",description:"For generate: specific function name"},files:{type:"array",items:{type:"string"},description:"For check_types: specific files"},maxDiagnostics:{type:"number",description:"For check_types: max diagnostics (default: 50)"}},required:["action","path"]}},{name:"docs",description:"Documentation (.ctx) management. Actions: get|generate|check_stale|validate_contracts",inputSchema:{type:"object",properties:{action:{type:"string",enum:["get","generate","check_stale","validate_contracts"],description:"Documentation action to perform"},path:{type:"string",description:"Project root path"},file:{type:"string",description:"For get: specific file docs"},overwrite:{type:"boolean",description:"For generate: overwrite existing (merge preserves descriptions)"},scope:{description:'For generate: "all", "focus" (git diff), or array of file paths'},strict:{type:"boolean",description:"For validate_contracts: report functions missing from .ctx"}},required:["action","path"]}},{name:"compact",description:"Compact code operations. Actions: compact_file|edit|compact_all|beautify|expand_file|expand_project|validate_pipeline|get_mode|set_mode",inputSchema:{type:"object",properties:{action:{type:"string",enum:["compact_file","edit","compact_all","beautify","expand_file","expand_project","validate_pipeline","get_mode","set_mode"],description:"Compact action to perform"},path:{type:"string",description:"Path to file or directory"},symbol:{type:"string",description:"For edit: function/class name to replace"},code:{type:"string",description:"For edit: new code for the symbol"},beautify:{type:"boolean",description:"Beautify output (default: true)"},legend:{type:"boolean",description:"For compact_file: include export legend"},dryRun:{type:"boolean",description:"Preview without modifying"},mode:{type:"number",description:"For set_mode: 1 (compact, recommended) or 2 (full)"},autoValidate:{type:"boolean",description:"For set_mode: auto-validate after edits"},stripJSDoc:{type:"boolean",description:"For set_mode: strip JSDoc when compacting"},strict:{type:"boolean",description:"For validate_pipeline: report fns missing from .ctx"},fix:{type:"boolean",description:"For validate_pipeline: auto-fix all style issues — generates .ctx documentation from readable code, then minifies (headers, imports, indentation, long names). Bidirectional: expand restores from .ctx."}},required:["action"]}},{name:"db",description:"Database analysis. Actions: schema|table_usage|dead_tables",inputSchema:{type:"object",properties:{action:{type:"string",enum:["schema","table_usage","dead_tables"],description:"Database analysis action"},path:{type:"string",description:"Path to scan"},table:{type:"string",description:"For table_usage: filter to specific table"}},required:["action","path"]}}];
|