xtctx 0.3.2 → 0.11.1
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 +267 -122
- package/LICENSE +21 -21
- package/README.md +154 -121
- package/dist/src/cli/disconnect.d.ts +8 -0
- package/dist/src/cli/disconnect.d.ts.map +1 -0
- package/dist/src/cli/disconnect.js +42 -0
- package/dist/src/cli/disconnect.js.map +1 -0
- package/dist/src/cli/hook.d.ts +7 -0
- package/dist/src/cli/hook.d.ts.map +1 -0
- package/dist/src/cli/hook.js +21 -0
- package/dist/src/cli/hook.js.map +1 -0
- package/dist/src/cli/index.d.ts.map +1 -1
- package/dist/src/cli/index.js +71 -33
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/setup.d.ts +8 -0
- package/dist/src/cli/setup.d.ts.map +1 -0
- package/dist/src/cli/setup.js +77 -0
- package/dist/src/cli/setup.js.map +1 -0
- package/dist/src/cli/status.d.ts +7 -0
- package/dist/src/cli/status.d.ts.map +1 -0
- package/dist/src/cli/status.js +84 -0
- package/dist/src/cli/status.js.map +1 -0
- package/dist/src/config/disconnect.d.ts +32 -0
- package/dist/src/config/disconnect.d.ts.map +1 -0
- package/dist/src/config/disconnect.js +304 -0
- package/dist/src/config/disconnect.js.map +1 -0
- package/dist/src/config/mcp-config.d.ts +91 -0
- package/dist/src/config/mcp-config.d.ts.map +1 -0
- package/dist/src/config/mcp-config.js +462 -0
- package/dist/src/config/mcp-config.js.map +1 -0
- package/dist/src/config/setup.d.ts +37 -0
- package/dist/src/config/setup.d.ts.map +1 -0
- package/dist/src/config/setup.js +338 -0
- package/dist/src/config/setup.js.map +1 -0
- package/dist/src/config/skills.d.ts +73 -0
- package/dist/src/config/skills.d.ts.map +1 -0
- package/dist/src/config/skills.js +427 -0
- package/dist/src/config/skills.js.map +1 -0
- package/dist/src/handoff/embeddings.d.ts +15 -0
- package/dist/src/handoff/embeddings.d.ts.map +1 -0
- package/dist/src/handoff/embeddings.js +63 -0
- package/dist/src/handoff/embeddings.js.map +1 -0
- package/dist/src/handoff/sqlite-index.d.ts +43 -0
- package/dist/src/handoff/sqlite-index.d.ts.map +1 -0
- package/dist/src/handoff/sqlite-index.js +718 -0
- package/dist/src/handoff/sqlite-index.js.map +1 -0
- package/dist/src/handoff/types.d.ts +57 -0
- package/dist/src/handoff/types.d.ts.map +1 -0
- package/dist/src/handoff/types.js +2 -0
- package/dist/src/handoff/types.js.map +1 -0
- package/dist/src/handoff/vector.d.ts +4 -0
- package/dist/src/handoff/vector.d.ts.map +1 -0
- package/dist/src/handoff/vector.js +31 -0
- package/dist/src/handoff/vector.js.map +1 -0
- package/dist/src/mcp/server.d.ts +2 -19
- package/dist/src/mcp/server.d.ts.map +1 -1
- package/dist/src/mcp/server.js +75 -199
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/tools/continuity.d.ts +3 -0
- package/dist/src/mcp/tools/continuity.d.ts.map +1 -0
- package/dist/src/mcp/tools/continuity.js +30 -0
- package/dist/src/mcp/tools/continuity.js.map +1 -0
- package/dist/src/mcp/tools/manifest.d.ts +40 -0
- package/dist/src/mcp/tools/manifest.d.ts.map +1 -0
- package/dist/src/mcp/tools/manifest.js +96 -0
- package/dist/src/mcp/tools/manifest.js.map +1 -0
- package/dist/src/mcp/tools/sessions.d.ts +11 -32
- package/dist/src/mcp/tools/sessions.d.ts.map +1 -1
- package/dist/src/mcp/tools/sessions.js +47 -13
- package/dist/src/mcp/tools/sessions.js.map +1 -1
- package/dist/src/runtime/services.d.ts +11 -38
- package/dist/src/runtime/services.d.ts.map +1 -1
- package/dist/src/runtime/services.js +43 -202
- package/dist/src/runtime/services.js.map +1 -1
- package/dist/src/scrapers/antigravity.d.ts +41 -0
- package/dist/src/scrapers/antigravity.d.ts.map +1 -0
- package/dist/src/scrapers/antigravity.js +858 -0
- package/dist/src/scrapers/antigravity.js.map +1 -0
- package/dist/src/scrapers/base.d.ts +53 -1
- package/dist/src/scrapers/base.d.ts.map +1 -1
- package/dist/src/scrapers/base.js +89 -3
- package/dist/src/scrapers/base.js.map +1 -1
- package/dist/src/scrapers/claude-code.d.ts +20 -6
- package/dist/src/scrapers/claude-code.d.ts.map +1 -1
- package/dist/src/scrapers/claude-code.js +144 -26
- package/dist/src/scrapers/claude-code.js.map +1 -1
- package/dist/src/scrapers/codex.d.ts +36 -6
- package/dist/src/scrapers/codex.d.ts.map +1 -1
- package/dist/src/scrapers/codex.js +256 -46
- package/dist/src/scrapers/codex.js.map +1 -1
- package/dist/src/scrapers/copilot-cli.d.ts +33 -0
- package/dist/src/scrapers/copilot-cli.d.ts.map +1 -0
- package/dist/src/scrapers/copilot-cli.js +257 -0
- package/dist/src/scrapers/copilot-cli.js.map +1 -0
- package/dist/src/scrapers/copilot.d.ts +41 -8
- package/dist/src/scrapers/copilot.d.ts.map +1 -1
- package/dist/src/scrapers/copilot.js +256 -118
- package/dist/src/scrapers/copilot.js.map +1 -1
- package/dist/src/scrapers/cursor.d.ts +24 -9
- package/dist/src/scrapers/cursor.d.ts.map +1 -1
- package/dist/src/scrapers/cursor.js +247 -151
- package/dist/src/scrapers/cursor.js.map +1 -1
- package/dist/src/scrapers/index.d.ts +18 -0
- package/dist/src/scrapers/index.d.ts.map +1 -0
- package/dist/src/scrapers/index.js +17 -0
- package/dist/src/scrapers/index.js.map +1 -0
- package/dist/src/scrapers/opencode.d.ts +36 -0
- package/dist/src/scrapers/opencode.d.ts.map +1 -0
- package/dist/src/scrapers/opencode.js +248 -0
- package/dist/src/scrapers/opencode.js.map +1 -0
- package/dist/src/scrapers/registry.d.ts +1 -0
- package/dist/src/scrapers/registry.d.ts.map +1 -1
- package/dist/src/scrapers/registry.js +3 -0
- package/dist/src/scrapers/registry.js.map +1 -1
- package/dist/src/tools/sources.d.ts +28 -0
- package/dist/src/tools/sources.d.ts.map +1 -0
- package/dist/src/tools/sources.js +149 -0
- package/dist/src/tools/sources.js.map +1 -0
- package/dist/src/types/config.d.ts +24 -37
- package/dist/src/types/config.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +0 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +0 -2
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/scraper.d.ts +34 -5
- package/dist/src/types/scraper.d.ts.map +1 -1
- package/dist/src/utils/errors.d.ts +2 -0
- package/dist/src/utils/errors.d.ts.map +1 -0
- package/dist/src/utils/errors.js +7 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/package-info.d.ts +11 -0
- package/dist/src/utils/package-info.d.ts.map +1 -0
- package/dist/src/utils/package-info.js +30 -0
- package/dist/src/utils/package-info.js.map +1 -0
- package/dist/src/utils/project-scope.d.ts +3 -0
- package/dist/src/utils/project-scope.d.ts.map +1 -0
- package/dist/src/utils/project-scope.js +45 -0
- package/dist/src/utils/project-scope.js.map +1 -0
- package/package.json +70 -66
- package/dist/src/api/routes/config.d.ts +0 -4
- package/dist/src/api/routes/config.d.ts.map +0 -1
- package/dist/src/api/routes/config.js +0 -61
- package/dist/src/api/routes/config.js.map +0 -1
- package/dist/src/api/routes/knowledge.d.ts +0 -4
- package/dist/src/api/routes/knowledge.d.ts.map +0 -1
- package/dist/src/api/routes/knowledge.js +0 -40
- package/dist/src/api/routes/knowledge.js.map +0 -1
- package/dist/src/api/routes/search.d.ts +0 -7
- package/dist/src/api/routes/search.d.ts.map +0 -1
- package/dist/src/api/routes/search.js +0 -108
- package/dist/src/api/routes/search.js.map +0 -1
- package/dist/src/api/routes/sources.d.ts +0 -12
- package/dist/src/api/routes/sources.d.ts.map +0 -1
- package/dist/src/api/routes/sources.js +0 -70
- package/dist/src/api/routes/sources.js.map +0 -1
- package/dist/src/api/server.d.ts +0 -26
- package/dist/src/api/server.d.ts.map +0 -1
- package/dist/src/api/server.js +0 -312
- package/dist/src/api/server.js.map +0 -1
- package/dist/src/cli/ingest.d.ts +0 -6
- package/dist/src/cli/ingest.d.ts.map +0 -1
- package/dist/src/cli/ingest.js +0 -11
- package/dist/src/cli/ingest.js.map +0 -1
- package/dist/src/cli/init.d.ts +0 -6
- package/dist/src/cli/init.d.ts.map +0 -1
- package/dist/src/cli/init.js +0 -105
- package/dist/src/cli/init.js.map +0 -1
- package/dist/src/cli/serve.d.ts +0 -7
- package/dist/src/cli/serve.d.ts.map +0 -1
- package/dist/src/cli/serve.js +0 -100
- package/dist/src/cli/serve.js.map +0 -1
- package/dist/src/cli/sync.d.ts +0 -5
- package/dist/src/cli/sync.d.ts.map +0 -1
- package/dist/src/cli/sync.js +0 -13
- package/dist/src/cli/sync.js.map +0 -1
- package/dist/src/compaction/pipeline.d.ts +0 -19
- package/dist/src/compaction/pipeline.d.ts.map +0 -1
- package/dist/src/compaction/pipeline.js +0 -37
- package/dist/src/compaction/pipeline.js.map +0 -1
- package/dist/src/compaction/providers/cli.d.ts +0 -13
- package/dist/src/compaction/providers/cli.d.ts.map +0 -1
- package/dist/src/compaction/providers/cli.js +0 -60
- package/dist/src/compaction/providers/cli.js.map +0 -1
- package/dist/src/compaction/rule-based.d.ts +0 -8
- package/dist/src/compaction/rule-based.d.ts.map +0 -1
- package/dist/src/compaction/rule-based.js +0 -120
- package/dist/src/compaction/rule-based.js.map +0 -1
- package/dist/src/config/loader.d.ts +0 -12
- package/dist/src/config/loader.d.ts.map +0 -1
- package/dist/src/config/loader.js +0 -76
- package/dist/src/config/loader.js.map +0 -1
- package/dist/src/config/mappings/claude-code.d.ts +0 -3
- package/dist/src/config/mappings/claude-code.d.ts.map +0 -1
- package/dist/src/config/mappings/claude-code.js +0 -31
- package/dist/src/config/mappings/claude-code.js.map +0 -1
- package/dist/src/config/mappings/codex.d.ts +0 -3
- package/dist/src/config/mappings/codex.d.ts.map +0 -1
- package/dist/src/config/mappings/codex.js +0 -31
- package/dist/src/config/mappings/codex.js.map +0 -1
- package/dist/src/config/mappings/copilot.d.ts +0 -3
- package/dist/src/config/mappings/copilot.d.ts.map +0 -1
- package/dist/src/config/mappings/copilot.js +0 -33
- package/dist/src/config/mappings/copilot.js.map +0 -1
- package/dist/src/config/mappings/cursor.d.ts +0 -3
- package/dist/src/config/mappings/cursor.d.ts.map +0 -1
- package/dist/src/config/mappings/cursor.js +0 -29
- package/dist/src/config/mappings/cursor.js.map +0 -1
- package/dist/src/config/sync.d.ts +0 -13
- package/dist/src/config/sync.d.ts.map +0 -1
- package/dist/src/config/sync.js +0 -96
- package/dist/src/config/sync.js.map +0 -1
- package/dist/src/ingestion/coordinator.d.ts +0 -37
- package/dist/src/ingestion/coordinator.d.ts.map +0 -1
- package/dist/src/ingestion/coordinator.js +0 -127
- package/dist/src/ingestion/coordinator.js.map +0 -1
- package/dist/src/ingestion/daemon.d.ts +0 -17
- package/dist/src/ingestion/daemon.d.ts.map +0 -1
- package/dist/src/ingestion/daemon.js +0 -35
- package/dist/src/ingestion/daemon.js.map +0 -1
- package/dist/src/ingestion/watcher.d.ts +0 -19
- package/dist/src/ingestion/watcher.d.ts.map +0 -1
- package/dist/src/ingestion/watcher.js +0 -70
- package/dist/src/ingestion/watcher.js.map +0 -1
- package/dist/src/knowledge/autotag.d.ts +0 -3
- package/dist/src/knowledge/autotag.d.ts.map +0 -1
- package/dist/src/knowledge/autotag.js +0 -24
- package/dist/src/knowledge/autotag.js.map +0 -1
- package/dist/src/knowledge/dedup.d.ts +0 -7
- package/dist/src/knowledge/dedup.d.ts.map +0 -1
- package/dist/src/knowledge/dedup.js +0 -15
- package/dist/src/knowledge/dedup.js.map +0 -1
- package/dist/src/knowledge/repository.d.ts +0 -12
- package/dist/src/knowledge/repository.d.ts.map +0 -1
- package/dist/src/knowledge/repository.js +0 -74
- package/dist/src/knowledge/repository.js.map +0 -1
- package/dist/src/mcp/tools/config.d.ts +0 -36
- package/dist/src/mcp/tools/config.d.ts.map +0 -1
- package/dist/src/mcp/tools/config.js +0 -54
- package/dist/src/mcp/tools/config.js.map +0 -1
- package/dist/src/mcp/tools/knowledge.d.ts +0 -17
- package/dist/src/mcp/tools/knowledge.d.ts.map +0 -1
- package/dist/src/mcp/tools/knowledge.js +0 -46
- package/dist/src/mcp/tools/knowledge.js.map +0 -1
- package/dist/src/mcp/tools/search.d.ts +0 -22
- package/dist/src/mcp/tools/search.d.ts.map +0 -1
- package/dist/src/mcp/tools/search.js +0 -30
- package/dist/src/mcp/tools/search.js.map +0 -1
- package/dist/src/mcp/tools/write.d.ts +0 -38
- package/dist/src/mcp/tools/write.d.ts.map +0 -1
- package/dist/src/mcp/tools/write.js +0 -97
- package/dist/src/mcp/tools/write.js.map +0 -1
- package/dist/src/runtime/ingestion.d.ts +0 -17
- package/dist/src/runtime/ingestion.d.ts.map +0 -1
- package/dist/src/runtime/ingestion.js +0 -106
- package/dist/src/runtime/ingestion.js.map +0 -1
- package/dist/src/scrapers/gemini.d.ts +0 -17
- package/dist/src/scrapers/gemini.d.ts.map +0 -1
- package/dist/src/scrapers/gemini.js +0 -245
- package/dist/src/scrapers/gemini.js.map +0 -1
- package/dist/src/store/embeddings.d.ts +0 -9
- package/dist/src/store/embeddings.d.ts.map +0 -1
- package/dist/src/store/embeddings.js +0 -28
- package/dist/src/store/embeddings.js.map +0 -1
- package/dist/src/store/lance.d.ts +0 -25
- package/dist/src/store/lance.d.ts.map +0 -1
- package/dist/src/store/lance.js +0 -74
- package/dist/src/store/lance.js.map +0 -1
- package/dist/src/store/search.d.ts +0 -18
- package/dist/src/store/search.d.ts.map +0 -1
- package/dist/src/store/search.js +0 -55
- package/dist/src/store/search.js.map +0 -1
- package/dist/src/types/compaction.d.ts +0 -29
- package/dist/src/types/compaction.d.ts.map +0 -1
- package/dist/src/types/compaction.js +0 -2
- package/dist/src/types/compaction.js.map +0 -1
- package/dist/src/types/context.d.ts +0 -33
- package/dist/src/types/context.d.ts.map +0 -1
- package/dist/src/types/context.js +0 -18
- package/dist/src/types/context.js.map +0 -1
- package/dist/src/utils/retry.d.ts +0 -11
- package/dist/src/utils/retry.d.ts.map +0 -1
- package/dist/src/utils/retry.js +0 -46
- package/dist/src/utils/retry.js.map +0 -1
- package/dist/src/utils/shutdown.d.ts +0 -25
- package/dist/src/utils/shutdown.d.ts.map +0 -1
- package/dist/src/utils/shutdown.js +0 -56
- package/dist/src/utils/shutdown.js.map +0 -1
- package/dist/web/apple-touch-icon.png +0 -0
- package/dist/web/assets/index-Nuadr5ox.css +0 -1
- package/dist/web/assets/index-aA0u8eXA.js +0 -3504
- package/dist/web/assets/primeicons-C6QP2o4f.woff2 +0 -0
- package/dist/web/assets/primeicons-DMOk5skT.eot +0 -0
- package/dist/web/assets/primeicons-Dr5RGzOO.svg +0 -345
- package/dist/web/assets/primeicons-MpK4pl85.ttf +0 -0
- package/dist/web/assets/primeicons-WjwUDZjB.woff +0 -0
- package/dist/web/favicon.ico +0 -0
- package/dist/web/favicon.svg +0 -21
- package/dist/web/index.html +0 -21
- package/dist/web/site.webmanifest +0 -19
- package/dist/web/vite.svg +0 -1
|
@@ -1,227 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
3
|
import { parse as parseYaml } from "yaml";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
async listRecentSessions(_limit, _toolFilter) {
|
|
7
|
-
return [];
|
|
8
|
-
}
|
|
9
|
-
async getSessionDetail(_sessionRef, _offset, _limit) {
|
|
10
|
-
return [];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export class FileConfigStore {
|
|
14
|
-
configRoot;
|
|
15
|
-
constructor(configRoot) {
|
|
16
|
-
this.configRoot = configRoot;
|
|
17
|
-
}
|
|
18
|
-
async list(type) {
|
|
19
|
-
const types = type ? [type] : ["skill", "command", "agent"];
|
|
20
|
-
const all = [];
|
|
21
|
-
for (const configType of types) {
|
|
22
|
-
const dir = join(this.configRoot, `${configType}s`);
|
|
23
|
-
let files;
|
|
24
|
-
try {
|
|
25
|
-
files = await readdir(dir);
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
for (const file of files) {
|
|
31
|
-
const parsed = await this.parseFile(join(dir, file), configType);
|
|
32
|
-
if (parsed) {
|
|
33
|
-
all.push(parsed);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return all;
|
|
38
|
-
}
|
|
39
|
-
async get(type, name) {
|
|
40
|
-
const items = await this.list(type);
|
|
41
|
-
return items.find((item) => item.name === name) ?? null;
|
|
42
|
-
}
|
|
43
|
-
async toolPreferences(tool) {
|
|
44
|
-
const filePath = join(this.configRoot, "shared.yaml");
|
|
45
|
-
try {
|
|
46
|
-
const raw = await readFile(filePath, "utf-8");
|
|
47
|
-
const parsed = parseYaml(raw);
|
|
48
|
-
const prefs = parsed.toolPreferences;
|
|
49
|
-
if (prefs && typeof prefs === "object" && !Array.isArray(prefs)) {
|
|
50
|
-
const toolPrefs = prefs[tool];
|
|
51
|
-
if (toolPrefs && typeof toolPrefs === "object" && !Array.isArray(toolPrefs)) {
|
|
52
|
-
return toolPrefs;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
// fall through
|
|
58
|
-
}
|
|
59
|
-
return {};
|
|
60
|
-
}
|
|
61
|
-
async parseFile(filePath, type) {
|
|
62
|
-
try {
|
|
63
|
-
const raw = await readFile(filePath, "utf-8");
|
|
64
|
-
const name = filePath
|
|
65
|
-
.split(/[\\/]/)
|
|
66
|
-
.pop()
|
|
67
|
-
?.replace(/\.(json|ya?ml|md|txt)$/i, "");
|
|
68
|
-
if (!name) {
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
const extension = extname(filePath).toLowerCase();
|
|
72
|
-
if (extension === ".json") {
|
|
73
|
-
return { type, name, content: JSON.parse(raw) };
|
|
74
|
-
}
|
|
75
|
-
if (extension === ".yaml" || extension === ".yml") {
|
|
76
|
-
const parsed = parseYaml(raw);
|
|
77
|
-
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
78
|
-
return { type, name, content: parsed };
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return { type, name, content: { text: raw } };
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
4
|
+
import { SqliteHandoffIndex } from "../handoff/sqlite-index.js";
|
|
5
|
+
import { createDefaultScrapers } from "../tools/sources.js";
|
|
88
6
|
export async function createProjectServices(projectPath) {
|
|
89
7
|
const projectRoot = resolve(projectPath ?? process.cwd());
|
|
90
8
|
const xtctxDir = join(projectRoot, ".xtctx");
|
|
91
|
-
const storeDir = join(xtctxDir, ".store");
|
|
92
|
-
const knowledgeDir = join(xtctxDir, "knowledge");
|
|
93
|
-
const configRoot = join(xtctxDir, "tool-config");
|
|
94
9
|
const stateDir = join(xtctxDir, "state");
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
10
|
+
const dbPath = join(stateDir, "xtctx.db");
|
|
11
|
+
const configPath = join(xtctxDir, "config.yaml");
|
|
12
|
+
const config = await loadProjectConfig(configPath);
|
|
13
|
+
const overrides = Object.fromEntries(Object.entries(config.tools)
|
|
14
|
+
.filter(([, value]) => value.enabled !== false)
|
|
15
|
+
.map(([tool, value]) => [tool, value.storePath]));
|
|
16
|
+
const scrapers = createDefaultScrapers(stateDir, overrides, projectRoot).filter((scraper) => {
|
|
17
|
+
const toolConfig = config.tools[scraper.tool];
|
|
18
|
+
return toolConfig?.enabled !== false;
|
|
19
|
+
});
|
|
20
|
+
const sessions = new SqliteHandoffIndex(dbPath, projectRoot, scrapers.map((scraper) => ({ tool: scraper.tool, scraper })));
|
|
101
21
|
return {
|
|
102
22
|
projectRoot,
|
|
103
23
|
xtctxDir,
|
|
104
|
-
storeDir,
|
|
105
|
-
knowledgeDir,
|
|
106
|
-
configRoot,
|
|
107
24
|
stateDir,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
sessions: new EmptySessionService(),
|
|
113
|
-
configs: new FileConfigStore(configRoot),
|
|
25
|
+
dbPath,
|
|
26
|
+
configPath,
|
|
27
|
+
config,
|
|
28
|
+
sessions,
|
|
114
29
|
};
|
|
115
30
|
}
|
|
116
|
-
async function loadProjectConfig(
|
|
117
|
-
const configPath = join(xtctxDir, "config.yaml");
|
|
31
|
+
export async function loadProjectConfig(configPath) {
|
|
118
32
|
try {
|
|
119
33
|
const raw = await readFile(configPath, "utf-8");
|
|
120
34
|
const parsed = parseYaml(raw);
|
|
121
35
|
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
122
|
-
|
|
36
|
+
const root = parsed;
|
|
37
|
+
return {
|
|
38
|
+
tools: normalizeTools(root.tools),
|
|
39
|
+
};
|
|
123
40
|
}
|
|
124
41
|
}
|
|
125
42
|
catch {
|
|
126
|
-
//
|
|
43
|
+
// Missing config is valid: setup owns writing it, MCP can still run.
|
|
127
44
|
}
|
|
128
|
-
return {};
|
|
45
|
+
return { tools: {} };
|
|
129
46
|
}
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
if (web && typeof web === "object" && !Array.isArray(web)) {
|
|
133
|
-
const port = Number(web.port);
|
|
134
|
-
if (Number.isFinite(port) && port > 0 && port < 65536) {
|
|
135
|
-
return port;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return 3232;
|
|
139
|
-
}
|
|
140
|
-
function parseApiSecurityConfig(config) {
|
|
141
|
-
const api = config.api;
|
|
142
|
-
if (!api || typeof api !== "object" || Array.isArray(api)) {
|
|
47
|
+
function normalizeTools(input) {
|
|
48
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) {
|
|
143
49
|
return {};
|
|
144
50
|
}
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
parsed.allowedOrigins = value.allowedOrigins.filter((item) => typeof item === "string" && item.length > 0);
|
|
160
|
-
}
|
|
161
|
-
if (typeof value.allowLocalhostOrigins === "boolean") {
|
|
162
|
-
parsed.allowLocalhostOrigins = value.allowLocalhostOrigins;
|
|
163
|
-
}
|
|
164
|
-
const rateLimitWindowMs = Number(value.rateLimitWindowMs);
|
|
165
|
-
if (Number.isFinite(rateLimitWindowMs) && rateLimitWindowMs > 0) {
|
|
166
|
-
parsed.rateLimitWindowMs = Math.floor(rateLimitWindowMs);
|
|
167
|
-
}
|
|
168
|
-
const rateLimitMax = Number(value.rateLimitMax);
|
|
169
|
-
if (Number.isFinite(rateLimitMax) && rateLimitMax > 0) {
|
|
170
|
-
parsed.rateLimitMax = Math.floor(rateLimitMax);
|
|
171
|
-
}
|
|
172
|
-
return parsed;
|
|
173
|
-
}
|
|
174
|
-
function parseIngestionConfig(config, projectRoot) {
|
|
175
|
-
const ingestion = config.ingestion;
|
|
176
|
-
const defaults = {
|
|
177
|
-
scrapers: [],
|
|
178
|
-
watchPaths: [projectRoot],
|
|
179
|
-
pollIntervalMs: 30_000,
|
|
180
|
-
excludePatterns: ["node_modules/**", "dist/**"],
|
|
181
|
-
};
|
|
182
|
-
if (!ingestion || typeof ingestion !== "object" || Array.isArray(ingestion)) {
|
|
183
|
-
return defaults;
|
|
51
|
+
const tools = {};
|
|
52
|
+
for (const [tool, rawConfig] of Object.entries(input)) {
|
|
53
|
+
if (!rawConfig || typeof rawConfig !== "object" || Array.isArray(rawConfig)) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
const value = rawConfig;
|
|
57
|
+
const config = {};
|
|
58
|
+
if (typeof value.enabled === "boolean") {
|
|
59
|
+
config.enabled = value.enabled;
|
|
60
|
+
}
|
|
61
|
+
if (typeof value.storePath === "string" && value.storePath.trim().length > 0) {
|
|
62
|
+
config.storePath = resolve(value.storePath);
|
|
63
|
+
}
|
|
64
|
+
tools[tool] = config;
|
|
184
65
|
}
|
|
185
|
-
|
|
186
|
-
const watchPaths = Array.isArray(value.watchPaths)
|
|
187
|
-
? value.watchPaths
|
|
188
|
-
.filter((item) => typeof item === "string" && item.length > 0)
|
|
189
|
-
.map((item) => resolve(projectRoot, item))
|
|
190
|
-
: defaults.watchPaths;
|
|
191
|
-
const pollIntervalMs = Number(value.pollIntervalMs);
|
|
192
|
-
const excludePatterns = Array.isArray(value.excludePatterns)
|
|
193
|
-
? value.excludePatterns.filter((item) => typeof item === "string" && item.length > 0)
|
|
194
|
-
: defaults.excludePatterns;
|
|
195
|
-
const scrapers = Array.isArray(value.scrapers)
|
|
196
|
-
? value.scrapers
|
|
197
|
-
.map((item) => {
|
|
198
|
-
if (!item || typeof item !== "object" || Array.isArray(item)) {
|
|
199
|
-
return null;
|
|
200
|
-
}
|
|
201
|
-
const scraper = item;
|
|
202
|
-
const tool = typeof scraper.tool === "string" ? scraper.tool : "";
|
|
203
|
-
if (!tool) {
|
|
204
|
-
return null;
|
|
205
|
-
}
|
|
206
|
-
const enabled = scraper.enabled !== false;
|
|
207
|
-
if (typeof scraper.customStorePath === "string") {
|
|
208
|
-
return {
|
|
209
|
-
tool,
|
|
210
|
-
enabled,
|
|
211
|
-
customStorePath: resolve(projectRoot, scraper.customStorePath),
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
return { tool, enabled };
|
|
215
|
-
})
|
|
216
|
-
.filter((item) => item !== null)
|
|
217
|
-
: defaults.scrapers;
|
|
218
|
-
return {
|
|
219
|
-
scrapers,
|
|
220
|
-
watchPaths: watchPaths.length > 0 ? watchPaths : defaults.watchPaths,
|
|
221
|
-
pollIntervalMs: Number.isFinite(pollIntervalMs) && pollIntervalMs > 0
|
|
222
|
-
? Math.floor(pollIntervalMs)
|
|
223
|
-
: defaults.pollIntervalMs,
|
|
224
|
-
excludePatterns,
|
|
225
|
-
};
|
|
66
|
+
return tools;
|
|
226
67
|
}
|
|
227
68
|
//# sourceMappingURL=services.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/runtime/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/runtime/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAgB5D,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,WAAoB;IAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC1C,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAClC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;SACzB,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC;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KAAK,EAAE,EAAE,EAAE,CAAC;AACvB,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;QACjF,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YAC5E,SAAS;QACX,CAAC;QAED,MAAM,KAAK,GAAG,SAAoC,CAAC;QACnD,MAAM,MAAM,GAA8C,EAAE,CAAC;QAC7D,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QACjC,CAAC;QACD,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7E,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC9C,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AntigravityChunk } from "../types/scraper.js";
|
|
2
|
+
import { AbstractScraper } from "./base.js";
|
|
3
|
+
export interface AntigravityRuntimeMessage {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
timestamp: Date;
|
|
6
|
+
role: AntigravityChunk["role"];
|
|
7
|
+
content: string;
|
|
8
|
+
referencedFiles: string[];
|
|
9
|
+
sourcePath?: string;
|
|
10
|
+
stepType?: string;
|
|
11
|
+
toolName?: string;
|
|
12
|
+
model?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface AntigravityRuntimeConversation {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
createdAt?: Date;
|
|
18
|
+
workspaces: string[];
|
|
19
|
+
messages: AntigravityRuntimeMessage[];
|
|
20
|
+
}
|
|
21
|
+
export interface AntigravityRuntimeClient {
|
|
22
|
+
listConversations(conversationsDir: string): Promise<AntigravityRuntimeConversation[]>;
|
|
23
|
+
}
|
|
24
|
+
export declare class AntigravityScraper extends AbstractScraper<AntigravityChunk> {
|
|
25
|
+
private readonly antigravityRoot;
|
|
26
|
+
private readonly projectRoot?;
|
|
27
|
+
private readonly runtimeClient;
|
|
28
|
+
readonly tool = "antigravity";
|
|
29
|
+
constructor(antigravityRoot: string, stateDir: string, projectRoot?: string | undefined, runtimeClient?: AntigravityRuntimeClient);
|
|
30
|
+
detect(): Promise<boolean>;
|
|
31
|
+
getStorePaths(): string[];
|
|
32
|
+
scrape(since?: Date): AsyncIterable<AntigravityChunk>;
|
|
33
|
+
fullSync(): AsyncIterable<AntigravityChunk>;
|
|
34
|
+
parseRaw(raw: unknown): AntigravityChunk;
|
|
35
|
+
private readArtifacts;
|
|
36
|
+
private readSessionArtifacts;
|
|
37
|
+
private readRuntimeChunks;
|
|
38
|
+
private safeListRuntimeConversations;
|
|
39
|
+
}
|
|
40
|
+
export declare function parseAntigravityRuntimeSteps(sessionId: string, steps: unknown[], summary: Record<string, unknown>): AntigravityRuntimeMessage[];
|
|
41
|
+
//# sourceMappingURL=antigravity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../../../src/scrapers/antigravity.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CA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