ctxo-mcp 0.4.2 → 0.5.0
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 +21 -19
- package/dist/{staleness-detector-VSDPTPX7.js → chunk-PSKDDLSF.js} +2 -2
- package/dist/{staleness-detector-VSDPTPX7.js.map → chunk-PSKDDLSF.js.map} +1 -1
- package/dist/{chunk-JIDIH7DS.js → chunk-WNEGGJMV.js} +5 -1
- package/dist/{cli-router-H557TJAM.js → cli-router-L64DKAXT.js} +904 -39
- package/dist/cli-router-L64DKAXT.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/{json-index-reader-Z6VHJ47M.js → json-index-reader-G32HWTCX.js} +2 -2
- package/dist/picocolors-XDVZHPEC.js +78 -0
- package/dist/picocolors-XDVZHPEC.js.map +1 -0
- package/dist/staleness-detector-3BEYKOPH.js +9 -0
- package/dist/staleness-detector-3BEYKOPH.js.map +1 -0
- package/package.json +2 -1
- package/dist/cli-router-H557TJAM.js.map +0 -1
- /package/dist/{chunk-JIDIH7DS.js.map → chunk-WNEGGJMV.js.map} +0 -0
- /package/dist/{json-index-reader-Z6VHJ47M.js.map → json-index-reader-G32HWTCX.js.map} +0 -0
package/README.md
CHANGED
|
@@ -41,17 +41,13 @@ Ctxo is an **MCP server** that **enhances** your existing AI tools with dependen
|
|
|
41
41
|
|
|
42
42
|
## Quick Start
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
# 1. Index your codebase
|
|
46
|
-
npx ctxo-mcp index
|
|
47
|
-
|
|
48
|
-
# 2. Add to your IDE's MCP config
|
|
49
|
-
# (see IDE Setup below)
|
|
44
|
+
One command sets up everything — index directory, AI tool rules, and git hooks:
|
|
50
45
|
|
|
51
|
-
|
|
46
|
+
```Shell
|
|
47
|
+
npx ctxo-mcp init
|
|
52
48
|
```
|
|
53
49
|
|
|
54
|
-
|
|
50
|
+
Then add ctxo to your IDE's MCP config:
|
|
55
51
|
|
|
56
52
|
**Claude Code / Cursor / Windsurf / Cline** — `.mcp.json`:
|
|
57
53
|
|
|
@@ -107,17 +103,23 @@ Onboarding? → get_architectural_overlay → get_symbol_importanc
|
|
|
107
103
|
## CLI Commands
|
|
108
104
|
|
|
109
105
|
```Shell
|
|
110
|
-
|
|
111
|
-
npx ctxo-mcp
|
|
112
|
-
npx ctxo-mcp
|
|
113
|
-
npx ctxo-mcp
|
|
114
|
-
npx ctxo-mcp init
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
npx ctxo-mcp
|
|
118
|
-
npx ctxo-mcp
|
|
119
|
-
npx ctxo-mcp
|
|
120
|
-
npx ctxo-mcp
|
|
106
|
+
# Setup
|
|
107
|
+
npx ctxo-mcp init # Interactive setup (index, AI tool rules, git hooks)
|
|
108
|
+
npx ctxo-mcp init --tools claude-code,cursor -y # Non-interactive setup
|
|
109
|
+
npx ctxo-mcp init --rules # Regenerate AI tool rules only
|
|
110
|
+
npx ctxo-mcp init --dry-run # Preview what would be created
|
|
111
|
+
|
|
112
|
+
# Indexing
|
|
113
|
+
npx ctxo-mcp index # Build full codebase index
|
|
114
|
+
npx ctxo-mcp index --check # CI gate: fail if index stale
|
|
115
|
+
npx ctxo-mcp index --skip-history # Fast re-index without git history
|
|
116
|
+
npx ctxo-mcp watch # File watcher for incremental re-index
|
|
117
|
+
npx ctxo-mcp sync # Rebuild SQLite cache from committed JSON
|
|
118
|
+
|
|
119
|
+
# Diagnostics
|
|
120
|
+
npx ctxo-mcp status # Show index manifest
|
|
121
|
+
npx ctxo-mcp doctor # Health check all subsystems (--json, --quiet)
|
|
122
|
+
npx ctxo-mcp stats # Show usage statistics (--json, --days N, --clear)
|
|
121
123
|
```
|
|
122
124
|
|
|
123
125
|
**Example output:**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-JIDIH7DS.js";
|
|
3
2
|
|
|
4
3
|
// src/core/staleness/staleness-detector.ts
|
|
5
4
|
import { statSync, existsSync } from "fs";
|
|
@@ -34,7 +33,8 @@ var StalenessDetector = class {
|
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
35
|
};
|
|
36
|
+
|
|
37
37
|
export {
|
|
38
38
|
StalenessDetector
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=
|
|
40
|
+
//# sourceMappingURL=chunk-PSKDDLSF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/staleness/staleness-detector.ts"],"sourcesContent":["import { statSync, existsSync } from 'node:fs';\nimport { join } from 'node:path';\n\nexport interface StalenessWarning {\n readonly staleFiles: string[];\n readonly message: string;\n}\n\nexport class StalenessDetector {\n private readonly projectRoot: string;\n private readonly indexDir: string;\n\n constructor(projectRoot: string, ctxoRoot: string) {\n this.projectRoot = projectRoot;\n this.indexDir = join(ctxoRoot, 'index');\n }\n\n check(indexedFiles: readonly string[]): StalenessWarning | undefined {\n if (!existsSync(this.indexDir)) return undefined;\n\n const staleFiles: string[] = [];\n\n for (const relativePath of indexedFiles) {\n const sourcePath = join(this.projectRoot, relativePath);\n const indexPath = join(this.indexDir, `${relativePath}.json`);\n\n if (!existsSync(sourcePath) || !existsSync(indexPath)) continue;\n\n try {\n const sourceMtime = Math.floor(statSync(sourcePath).mtimeMs / 1000);\n const indexMtime = Math.floor(statSync(indexPath).mtimeMs / 1000);\n\n if (sourceMtime > indexMtime) {\n staleFiles.push(relativePath);\n }\n } catch {\n // Skip files we can't stat\n }\n }\n\n if (staleFiles.length === 0) return undefined;\n\n return {\n staleFiles,\n message: `Index may be stale for ${staleFiles.length} file(s). Run \"ctxo index\" to refresh.`,\n };\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/core/staleness/staleness-detector.ts"],"sourcesContent":["import { statSync, existsSync } from 'node:fs';\nimport { join } from 'node:path';\n\nexport interface StalenessWarning {\n readonly staleFiles: string[];\n readonly message: string;\n}\n\nexport class StalenessDetector {\n private readonly projectRoot: string;\n private readonly indexDir: string;\n\n constructor(projectRoot: string, ctxoRoot: string) {\n this.projectRoot = projectRoot;\n this.indexDir = join(ctxoRoot, 'index');\n }\n\n check(indexedFiles: readonly string[]): StalenessWarning | undefined {\n if (!existsSync(this.indexDir)) return undefined;\n\n const staleFiles: string[] = [];\n\n for (const relativePath of indexedFiles) {\n const sourcePath = join(this.projectRoot, relativePath);\n const indexPath = join(this.indexDir, `${relativePath}.json`);\n\n if (!existsSync(sourcePath) || !existsSync(indexPath)) continue;\n\n try {\n const sourceMtime = Math.floor(statSync(sourcePath).mtimeMs / 1000);\n const indexMtime = Math.floor(statSync(indexPath).mtimeMs / 1000);\n\n if (sourceMtime > indexMtime) {\n staleFiles.push(relativePath);\n }\n } catch {\n // Skip files we can't stat\n }\n }\n\n if (staleFiles.length === 0) return undefined;\n\n return {\n staleFiles,\n message: `Index may be stale for ${staleFiles.length} file(s). Run \"ctxo index\" to refresh.`,\n };\n }\n}\n"],"mappings":";;;AAAA,SAAS,UAAU,kBAAkB;AACrC,SAAS,YAAY;AAOd,IAAM,oBAAN,MAAwB;AAAA,EACZ;AAAA,EACA;AAAA,EAEjB,YAAY,aAAqB,UAAkB;AACjD,SAAK,cAAc;AACnB,SAAK,WAAW,KAAK,UAAU,OAAO;AAAA,EACxC;AAAA,EAEA,MAAM,cAA+D;AACnE,QAAI,CAAC,WAAW,KAAK,QAAQ,EAAG,QAAO;AAEvC,UAAM,aAAuB,CAAC;AAE9B,eAAW,gBAAgB,cAAc;AACvC,YAAM,aAAa,KAAK,KAAK,aAAa,YAAY;AACtD,YAAM,YAAY,KAAK,KAAK,UAAU,GAAG,YAAY,OAAO;AAE5D,UAAI,CAAC,WAAW,UAAU,KAAK,CAAC,WAAW,SAAS,EAAG;AAEvD,UAAI;AACF,cAAM,cAAc,KAAK,MAAM,SAAS,UAAU,EAAE,UAAU,GAAI;AAClE,cAAM,aAAa,KAAK,MAAM,SAAS,SAAS,EAAE,UAAU,GAAI;AAEhE,YAAI,cAAc,YAAY;AAC5B,qBAAW,KAAK,YAAY;AAAA,QAC9B;AAAA,MACF,QAAQ;AAAA,MAER;AAAA,IACF;AAEA,QAAI,WAAW,WAAW,EAAG,QAAO;AAEpC,WAAO;AAAA,MACL;AAAA,MACA,SAAS,0BAA0B,WAAW,MAAM;AAAA,IACtD;AAAA,EACF;AACF;","names":[]}
|
|
@@ -6,6 +6,9 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
6
6
|
var __esm = (fn, res) => function __init() {
|
|
7
7
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
8
|
};
|
|
9
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
10
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
|
+
};
|
|
9
12
|
var __export = (target, all) => {
|
|
10
13
|
for (var name in all)
|
|
11
14
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -22,7 +25,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
25
|
|
|
23
26
|
export {
|
|
24
27
|
__esm,
|
|
28
|
+
__commonJS,
|
|
25
29
|
__export,
|
|
26
30
|
__toCommonJS
|
|
27
31
|
};
|
|
28
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-WNEGGJMV.js.map
|