ctxloom-pro 1.0.6 → 1.0.8

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,48 @@
1
+ {
2
+ "name": "@ctxloom/dashboard",
3
+ "private": true,
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev:server": "tsx server/index.ts",
8
+ "dev:client": "vite",
9
+ "build:server": "tsup --config tsup.server.config.ts",
10
+ "build:client": "vite build",
11
+ "build": "npm run build:server && npm run build:client",
12
+ "test": "vitest run",
13
+ "preview": "vite preview"
14
+ },
15
+ "dependencies": {
16
+ "@ctxloom/core": "*",
17
+ "cors": "^2.8.5",
18
+ "express": "^4.18.0",
19
+ "open": "^10.1.0"
20
+ },
21
+ "devDependencies": {
22
+ "@testing-library/jest-dom": "^6.4.0",
23
+ "@testing-library/react": "^16.0.0",
24
+ "@testing-library/user-event": "^14.6.1",
25
+ "@types/cors": "^2.8.17",
26
+ "@types/d3": "^7.4.0",
27
+ "@types/express": "^4.17.21",
28
+ "@types/node": "^22.0.0",
29
+ "@types/react": "^18.3.0",
30
+ "@types/react-dom": "^18.3.0",
31
+ "@types/supertest": "^6.0.0",
32
+ "@vitejs/plugin-react": "^4.3.0",
33
+ "autoprefixer": "^10.4.0",
34
+ "d3": "^7.9.0",
35
+ "jsdom": "^24.0.0",
36
+ "postcss": "^8.4.0",
37
+ "react": "^18.3.0",
38
+ "react-dom": "^18.3.0",
39
+ "react-router-dom": "^6.23.0",
40
+ "recharts": "^2.12.0",
41
+ "supertest": "^7.0.0",
42
+ "tailwindcss": "^3.4.0",
43
+ "tsx": "^4.0.0",
44
+ "typescript": "^5.7.0",
45
+ "vite": "^5.3.0",
46
+ "vitest": "^3.0.0"
47
+ }
48
+ }
@@ -0,0 +1,8 @@
1
+ import {
2
+ VectorStore
3
+ } from "./chunk-NEHYSE2Y.js";
4
+ import "./chunk-TYDMSHV7.js";
5
+ export {
6
+ VectorStore
7
+ };
8
+ //# sourceMappingURL=VectorStore-HOSUSLV7.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-YXMXRVFH.js";
3
+ } from "./chunk-TYDMSHV7.js";
4
4
 
5
5
  // packages/core/src/db/VectorStore.ts
6
6
  import lancedb from "@lancedb/lancedb";
@@ -141,4 +141,4 @@ var VectorStore = class {
141
141
  export {
142
142
  VectorStore
143
143
  };
144
- //# sourceMappingURL=chunk-NC4L5MCD.js.map
144
+ //# sourceMappingURL=chunk-NEHYSE2Y.js.map
@@ -0,0 +1,62 @@
1
+ // packages/core/src/utils/logger.ts
2
+ var LEVELS = {
3
+ debug: 0,
4
+ info: 1,
5
+ warn: 2,
6
+ error: 3
7
+ };
8
+ var ANSI = {
9
+ reset: "\x1B[0m",
10
+ dim: "\x1B[2m",
11
+ yellow: "\x1B[33m",
12
+ red: "\x1B[31m"
13
+ };
14
+ function getConfiguredLevel() {
15
+ const raw = (process.env["LOG_LEVEL"] ?? "info").toLowerCase();
16
+ return raw in LEVELS ? raw : "info";
17
+ }
18
+ function getMode() {
19
+ if (process.env["CTXLOOM_LOG_MODE"] === "cli") return "cli";
20
+ if (process.env["CTXLOOM_LOG_MODE"] === "json") return "json";
21
+ return process.argv.length > 2 ? "cli" : "json";
22
+ }
23
+ function isTTY() {
24
+ return process.stderr.isTTY === true;
25
+ }
26
+ function writeJson(level, msg, extra) {
27
+ const entry = { ts: (/* @__PURE__ */ new Date()).toISOString(), level, msg };
28
+ if (extra) Object.assign(entry, extra);
29
+ process.stderr.write(JSON.stringify(entry) + "\n");
30
+ }
31
+ function writeCli(level, msg, extra) {
32
+ if (level === "debug" || level === "info") return;
33
+ const color = level === "error" ? ANSI.red : ANSI.yellow;
34
+ const icon = level === "error" ? isTTY() ? "\u2717" : "X" : isTTY() ? "\u26A0" : "!";
35
+ const prefix = isTTY() ? `${color}${icon}${ANSI.reset}` : icon;
36
+ let line = ` ${prefix} ${msg}`;
37
+ if (extra && Object.keys(extra).length > 0) {
38
+ const pairs = Object.entries(extra).map(([k, v]) => `${k}=${typeof v === "string" ? v : JSON.stringify(v)}`).join(" ");
39
+ const dim = isTTY() ? `${ANSI.dim}${pairs}${ANSI.reset}` : pairs;
40
+ line += ` ${dim}`;
41
+ }
42
+ process.stderr.write(line + "\n");
43
+ }
44
+ function write(level, msg, extra) {
45
+ if (LEVELS[level] < LEVELS[getConfiguredLevel()]) return;
46
+ if (getMode() === "cli") {
47
+ writeCli(level, msg, extra);
48
+ } else {
49
+ writeJson(level, msg, extra);
50
+ }
51
+ }
52
+ var logger = {
53
+ debug: (msg, extra) => write("debug", msg, extra),
54
+ info: (msg, extra) => write("info", msg, extra),
55
+ warn: (msg, extra) => write("warn", msg, extra),
56
+ error: (msg, extra) => write("error", msg, extra)
57
+ };
58
+
59
+ export {
60
+ logger
61
+ };
62
+ //# sourceMappingURL=chunk-TYDMSHV7.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-YXMXRVFH.js";
3
+ } from "./chunk-TYDMSHV7.js";
4
4
 
5
5
  // packages/core/src/indexer/embedder.ts
6
6
  import { pipeline } from "@huggingface/transformers";
@@ -89,7 +89,7 @@ function collectFiles(dir, results = []) {
89
89
  return results;
90
90
  }
91
91
  async function indexDirectory(rootDir, onProgress) {
92
- const { VectorStore } = await import("./VectorStore-G6RNAVQC.js");
92
+ const { VectorStore } = await import("./VectorStore-HOSUSLV7.js");
93
93
  const store = new VectorStore(path.join(rootDir, ".ctxloom", "vectors.lancedb"));
94
94
  await store.init();
95
95
  const files = collectFiles(rootDir);
@@ -142,4 +142,4 @@ export {
142
142
  collectFiles,
143
143
  indexDirectory
144
144
  };
145
- //# sourceMappingURL=chunk-MZRK5LFU.js.map
145
+ //# sourceMappingURL=chunk-U3AVIYSJ.js.map
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  VectorStore
3
- } from "./chunk-NC4L5MCD.js";
3
+ } from "./chunk-NEHYSE2Y.js";
4
4
  import {
5
5
  collectFiles,
6
6
  generateEmbedding
7
- } from "./chunk-MZRK5LFU.js";
7
+ } from "./chunk-U3AVIYSJ.js";
8
8
  import {
9
9
  logger
10
- } from "./chunk-YXMXRVFH.js";
10
+ } from "./chunk-TYDMSHV7.js";
11
11
 
12
12
  // packages/core/src/graph/DependencyGraph.ts
13
13
  import fs6 from "fs";
@@ -339,7 +339,7 @@ var ASTParser = class {
339
339
  const wasmPath = await this.grammarLoader.ensureGrammar("python");
340
340
  this.pyLang = await TreeSitter.Language.load(wasmPath);
341
341
  } catch (err) {
342
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
342
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
343
343
  logger2.warn("Python grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
344
344
  }
345
345
  }
@@ -352,7 +352,7 @@ var ASTParser = class {
352
352
  const wasmPath = await this.grammarLoader.ensureGrammar("go");
353
353
  this.goLang = await TreeSitter.Language.load(wasmPath);
354
354
  } catch (err) {
355
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
355
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
356
356
  logger2.warn("Go grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
357
357
  }
358
358
  }
@@ -365,7 +365,7 @@ var ASTParser = class {
365
365
  const wasmPath = await this.grammarLoader.ensureGrammar("rust");
366
366
  this.rustLang = await TreeSitter.Language.load(wasmPath);
367
367
  } catch (err) {
368
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
368
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
369
369
  logger2.warn("Rust grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
370
370
  }
371
371
  }
@@ -378,7 +378,7 @@ var ASTParser = class {
378
378
  const wasmPath = await this.grammarLoader.ensureGrammar("java");
379
379
  this.javaLang = await TreeSitter.Language.load(wasmPath);
380
380
  } catch (err) {
381
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
381
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
382
382
  logger2.warn("Java grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
383
383
  }
384
384
  }
@@ -388,7 +388,7 @@ var ASTParser = class {
388
388
  const wasmPath = await this.grammarLoader.ensureGrammar("csharp");
389
389
  this.csLang = await TreeSitter.Language.load(wasmPath);
390
390
  } catch (err) {
391
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
391
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
392
392
  logger2.warn("C# grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
393
393
  }
394
394
  }
@@ -398,7 +398,7 @@ var ASTParser = class {
398
398
  const wasmPath = await this.grammarLoader.ensureGrammar("ruby");
399
399
  this.rubyLang = await TreeSitter.Language.load(wasmPath);
400
400
  } catch (err) {
401
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
401
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
402
402
  logger2.warn("Ruby grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
403
403
  }
404
404
  }
@@ -408,7 +408,7 @@ var ASTParser = class {
408
408
  const wasmPath = await this.grammarLoader.ensureGrammar("kotlin");
409
409
  this.kotlinLang = await TreeSitter.Language.load(wasmPath);
410
410
  } catch (err) {
411
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
411
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
412
412
  logger2.warn("Kotlin grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
413
413
  }
414
414
  }
@@ -418,7 +418,7 @@ var ASTParser = class {
418
418
  const wasmPath = await this.grammarLoader.ensureGrammar("swift");
419
419
  this.swiftLang = await TreeSitter.Language.load(wasmPath);
420
420
  } catch (err) {
421
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
421
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
422
422
  logger2.warn("Swift grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
423
423
  }
424
424
  }
@@ -428,7 +428,7 @@ var ASTParser = class {
428
428
  const wasmPath = await this.grammarLoader.ensureGrammar("php");
429
429
  this.phpLang = await TreeSitter.Language.load(wasmPath);
430
430
  } catch (err) {
431
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
431
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
432
432
  logger2.warn("PHP grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
433
433
  }
434
434
  }
@@ -438,7 +438,7 @@ var ASTParser = class {
438
438
  const wasmPath = await this.grammarLoader.ensureGrammar("dart");
439
439
  this.dartLang = await TreeSitter.Language.load(wasmPath);
440
440
  } catch (err) {
441
- const { logger: logger2 } = await import("./logger-SVRJYSFC.js");
441
+ const { logger: logger2 } = await import("./logger-PDXPCKJ6.js");
442
442
  logger2.warn("Dart grammar unavailable", { detail: err instanceof Error ? err.message : String(err) });
443
443
  }
444
444
  }
@@ -5442,9 +5442,9 @@ function registerGraphExportTool(registry, ctx) {
5442
5442
 
5443
5443
  // packages/core/src/tools/git-diff-review.ts
5444
5444
  import { z as z16 } from "zod";
5445
- import { exec as exec2 } from "child_process";
5445
+ import { execFile } from "child_process";
5446
5446
  import { promisify as promisify2 } from "util";
5447
- var execAsync2 = promisify2(exec2);
5447
+ var execFileAsync = promisify2(execFile);
5448
5448
  var Schema16 = z16.object({
5449
5449
  changed_files: z16.array(z16.string()).optional().describe(
5450
5450
  "Changed file paths (relative to project root). Omit to auto-detect from git diff HEAD~1."
@@ -5462,8 +5462,13 @@ function escapeXML16(text) {
5462
5462
  return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
5463
5463
  }
5464
5464
  async function getFileDiff(projectRoot, file) {
5465
+ if (file.includes("\0") || file.startsWith("-")) return "";
5465
5466
  try {
5466
- const { stdout } = await execAsync2(`git diff HEAD~1 -- "${file}"`, { cwd: projectRoot });
5467
+ const { stdout } = await execFileAsync(
5468
+ "git",
5469
+ ["diff", "HEAD~1", "--", file],
5470
+ { cwd: projectRoot, maxBuffer: 10 * 1024 * 1024 }
5471
+ );
5467
5472
  return stdout.trim();
5468
5473
  } catch {
5469
5474
  return "";
@@ -5504,10 +5509,15 @@ function registerGitDiffReviewTool(registry, ctx) {
5504
5509
  },
5505
5510
  async (args) => {
5506
5511
  const { changed_files, depth, use_git, include_skeletons, max_diff_lines } = Schema16.parse(args);
5507
- let files = changed_files ?? [];
5512
+ const validator = ctx.getPathValidator();
5513
+ let files = (changed_files ?? []).filter((f) => validator.isWithinRoot(f));
5508
5514
  if (files.length === 0 && use_git) {
5509
5515
  try {
5510
- const { stdout } = await execAsync2("git diff HEAD~1 --name-only", { cwd: ctx.projectRoot });
5516
+ const { stdout } = await execFileAsync(
5517
+ "git",
5518
+ ["diff", "HEAD~1", "--name-only"],
5519
+ { cwd: ctx.projectRoot, maxBuffer: 10 * 1024 * 1024 }
5520
+ );
5511
5521
  files = stdout.trim().split("\n").filter(Boolean);
5512
5522
  } catch {
5513
5523
  logger.warn("git diff failed \u2014 no changed files detected");
@@ -6083,9 +6093,9 @@ function registerApplyRefactorTool(registry, ctx) {
6083
6093
 
6084
6094
  // packages/core/src/tools/detect-changes.ts
6085
6095
  import { z as z21 } from "zod";
6086
- import { exec as exec3 } from "child_process";
6096
+ import { exec as exec2 } from "child_process";
6087
6097
  import { promisify as promisify3 } from "util";
6088
- var execAsync3 = promisify3(exec3);
6098
+ var execAsync2 = promisify3(exec2);
6089
6099
  var Schema21 = z21.object({
6090
6100
  changed_files: z21.array(z21.string()).optional(),
6091
6101
  use_git: z21.boolean().optional().default(true),
@@ -6099,7 +6109,7 @@ function escapeXML21(text) {
6099
6109
  }
6100
6110
  async function detectChangedFiles2(projectRoot) {
6101
6111
  try {
6102
- const { stdout } = await execAsync3("git diff HEAD~1 --name-only", { cwd: projectRoot });
6112
+ const { stdout } = await execAsync2("git diff HEAD~1 --name-only", { cwd: projectRoot });
6103
6113
  return stdout.trim().split("\n").filter(Boolean);
6104
6114
  } catch {
6105
6115
  logger.warn("git diff failed for detect_changes");
@@ -6263,7 +6273,7 @@ function registerFullTextSearchTool(registry, ctx) {
6263
6273
  const { query, mode, case_sensitive, limit, context_lines } = Schema22.parse(args);
6264
6274
  if (mode === "semantic") {
6265
6275
  try {
6266
- const { generateEmbedding: generateEmbedding2 } = await import("./embedder-MUH5U4NC.js");
6276
+ const { generateEmbedding: generateEmbedding2 } = await import("./embedder-BV7V7BHZ.js");
6267
6277
  const store = await ctx.getStore();
6268
6278
  const embedding = await generateEmbedding2(query);
6269
6279
  const results = await store.search(embedding, limit);
@@ -6300,7 +6310,7 @@ function registerFullTextSearchTool(registry, ctx) {
6300
6310
  let merged = keywordResults.slice(0, limit);
6301
6311
  if (mode === "hybrid") {
6302
6312
  try {
6303
- const { generateEmbedding: generateEmbedding2 } = await import("./embedder-MUH5U4NC.js");
6313
+ const { generateEmbedding: generateEmbedding2 } = await import("./embedder-BV7V7BHZ.js");
6304
6314
  const store = await ctx.getStore();
6305
6315
  const embedding = await generateEmbedding2(query);
6306
6316
  const vectorResults = await store.search(embedding, Math.ceil(limit / 2));
@@ -6334,9 +6344,9 @@ function registerFullTextSearchTool(registry, ctx) {
6334
6344
 
6335
6345
  // packages/core/src/tools/suggested-questions.ts
6336
6346
  import { z as z23 } from "zod";
6337
- import { exec as exec4 } from "child_process";
6347
+ import { exec as exec3 } from "child_process";
6338
6348
  import { promisify as promisify4 } from "util";
6339
- var execAsync4 = promisify4(exec4);
6349
+ var execAsync3 = promisify4(exec3);
6340
6350
  var Schema23 = z23.object({
6341
6351
  changed_files: z23.array(z23.string()).optional(),
6342
6352
  use_git: z23.boolean().optional().default(true)
@@ -6347,7 +6357,7 @@ function escapeXML23(text) {
6347
6357
  }
6348
6358
  async function detectChangedFiles3(projectRoot) {
6349
6359
  try {
6350
- const { stdout } = await execAsync4("git diff HEAD~1 --name-only", { cwd: projectRoot });
6360
+ const { stdout } = await execAsync3("git diff HEAD~1 --name-only", { cwd: projectRoot });
6351
6361
  return stdout.trim().split("\n").filter(Boolean);
6352
6362
  } catch {
6353
6363
  logger.warn("git diff failed for suggested_questions");
@@ -7154,9 +7164,9 @@ function registerRulesCheckTool(registry, ctx) {
7154
7164
 
7155
7165
  // packages/core/src/tools/get-affected-flows.ts
7156
7166
  import { z as z31 } from "zod";
7157
- import { exec as exec5 } from "child_process";
7167
+ import { exec as exec4 } from "child_process";
7158
7168
  import { promisify as promisify5 } from "util";
7159
- var execAsync5 = promisify5(exec5);
7169
+ var execAsync4 = promisify5(exec4);
7160
7170
  var Schema27 = z31.object({
7161
7171
  changed_files: z31.array(z31.string()).optional().describe(
7162
7172
  "Changed file paths (relative). Defaults to auto-detection from git diff HEAD~1."
@@ -7211,7 +7221,7 @@ function buildFlow(entrySymbol, entryFile, maxDepth, maxSteps, graph, callIdx) {
7211
7221
  }
7212
7222
  async function detectChangedFiles4(projectRoot) {
7213
7223
  try {
7214
- const { stdout } = await execAsync5("git diff HEAD~1 --name-only", { cwd: projectRoot });
7224
+ const { stdout } = await execAsync4("git diff HEAD~1 --name-only", { cwd: projectRoot });
7215
7225
  return stdout.trim().split("\n").filter(Boolean);
7216
7226
  } catch {
7217
7227
  logger.warn("git diff failed for get_affected_flows \u2014 no changed files detected");
@@ -8021,7 +8031,7 @@ var LicenseStore = class {
8021
8031
  } catch (err) {
8022
8032
  if (process.env["CTXLOOM_DEBUG"]) {
8023
8033
  const detail = err instanceof Error ? err.message : String(err);
8024
- process.stderr.write(`[ctxloom] LicenseStore.read failed at ${this.filePath}: ${detail}
8034
+ process.stderr.write(`[ctxloom] LicenseStore.read failed: ${detail}
8025
8035
  `);
8026
8036
  }
8027
8037
  return null;
@@ -8029,7 +8039,10 @@ var LicenseStore = class {
8029
8039
  }
8030
8040
  async write(license) {
8031
8041
  mkdirSync(path28.dirname(this.filePath), { recursive: true });
8032
- writeFileSync(this.filePath, JSON.stringify(license, null, 2), "utf8");
8042
+ writeFileSync(this.filePath, JSON.stringify(license, null, 2), {
8043
+ encoding: "utf8",
8044
+ mode: 384
8045
+ });
8033
8046
  if (process.platform !== "win32") {
8034
8047
  chmodSync(this.filePath, 384);
8035
8048
  }
@@ -8253,15 +8266,16 @@ async function startTrial(email, opts = {}) {
8253
8266
  }
8254
8267
 
8255
8268
  // packages/core/src/license/telemetry.ts
8269
+ var TELEMETRY_DISABLED = process.env["CTXLOOM_NO_TELEMETRY"] === "1" || process.env["DO_NOT_TRACK"] === "1";
8256
8270
  var POSTHOG_HOST = "https://eu.i.posthog.com";
8257
- var POSTHOG_KEY = process.env["POSTHOG_API_KEY"] ?? "phc_xAusXPkHxhjhzRguxcyylLO6s5Hn1ZNNeThATGP4Dlf";
8258
- var SENTRY_DSN = process.env["SENTRY_DSN"] ?? "https://e52f4c5fdc82eca82dadb4261e474069@o4508531702497280.ingest.de.sentry.io/4511256875368528";
8271
+ var POSTHOG_KEY = process.env["POSTHOG_API_KEY"] ?? (true ? "phc_CiDkmFLcZ2K6uCpcoSUQLmFrnnUvsyXGhSxopX5TVKE6" : "");
8272
+ var SENTRY_DSN = process.env["SENTRY_DSN"] ?? (true ? "https://81c94a0f04a8e242dee493ac1e17f733@o4508531702497280.ingest.de.sentry.io/4511256875368528" : "");
8259
8273
  function track(event, distinctId, props = {}) {
8260
- if (!POSTHOG_KEY) return;
8274
+ if (TELEMETRY_DISABLED || !POSTHOG_KEY) return;
8261
8275
  void sendPostHog(event, distinctId, props);
8262
8276
  }
8263
8277
  function captureError(err, context = {}) {
8264
- if (!SENTRY_DSN) return;
8278
+ if (TELEMETRY_DISABLED || !SENTRY_DSN) return;
8265
8279
  void sendSentry(err, context);
8266
8280
  }
8267
8281
  async function sendPostHog(event, distinctId, props) {
@@ -8406,4 +8420,4 @@ export {
8406
8420
  track,
8407
8421
  captureError
8408
8422
  };
8409
- //# sourceMappingURL=chunk-KPNCYRWW.js.map
8423
+ //# sourceMappingURL=chunk-UMFIYUGI.js.map
@@ -3,11 +3,11 @@ import path from "path";
3
3
  import { fileURLToPath } from "url";
4
4
  var __dirname = path.dirname(fileURLToPath(import.meta.url));
5
5
  async function startDashboard(options) {
6
- const serverPath = path.resolve(__dirname, "../apps/dashboard/server/index.js");
6
+ const serverPath = path.resolve(__dirname, "../apps/dashboard/dist/server/index.js");
7
7
  const mod = await import(serverPath);
8
8
  await mod.startDashboard(options);
9
9
  }
10
10
  export {
11
11
  startDashboard
12
12
  };
13
- //# sourceMappingURL=dashboard-LVSRXGZN.js.map
13
+ //# sourceMappingURL=dashboard-MD73U3AR.js.map
@@ -3,12 +3,12 @@ import {
3
3
  collectFiles,
4
4
  generateEmbedding,
5
5
  indexDirectory
6
- } from "./chunk-MZRK5LFU.js";
7
- import "./chunk-YXMXRVFH.js";
6
+ } from "./chunk-U3AVIYSJ.js";
7
+ import "./chunk-TYDMSHV7.js";
8
8
  export {
9
9
  EMBEDDING_DIMENSION,
10
10
  collectFiles,
11
11
  generateEmbedding,
12
12
  indexDirectory
13
13
  };
14
- //# sourceMappingURL=embedder-MUH5U4NC.js.map
14
+ //# sourceMappingURL=embedder-BV7V7BHZ.js.map
package/dist/index.js CHANGED
@@ -34,17 +34,17 @@ import {
34
34
  startTrial,
35
35
  track,
36
36
  writeCODEOWNERS
37
- } from "./chunk-KPNCYRWW.js";
37
+ } from "./chunk-UMFIYUGI.js";
38
38
  import {
39
39
  VectorStore
40
- } from "./chunk-NC4L5MCD.js";
40
+ } from "./chunk-NEHYSE2Y.js";
41
41
  import {
42
42
  generateEmbedding,
43
43
  indexDirectory
44
- } from "./chunk-MZRK5LFU.js";
44
+ } from "./chunk-U3AVIYSJ.js";
45
45
  import {
46
46
  logger
47
- } from "./chunk-YXMXRVFH.js";
47
+ } from "./chunk-TYDMSHV7.js";
48
48
 
49
49
  // src/server.ts
50
50
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
@@ -55,10 +55,13 @@ import fs from "fs";
55
55
  var PROJECT_ROOT = (() => {
56
56
  if (process.env.CTXLOOM_ROOT) return process.env.CTXLOOM_ROOT;
57
57
  const cwd = process.cwd();
58
- logger.warn(
59
- "CTXLOOM_ROOT not set \u2014 defaulting to cwd. Set CTXLOOM_ROOT in your MCP server config to point at the project you want to index.",
60
- { cwd }
61
- );
58
+ const isCli = process.argv.length > 2;
59
+ if (!isCli) {
60
+ logger.warn(
61
+ "CTXLOOM_ROOT not set \u2014 defaulting to cwd. Set CTXLOOM_ROOT in your MCP server config to point at the project you want to index.",
62
+ { cwd }
63
+ );
64
+ }
62
65
  return cwd;
63
66
  })();
64
67
  var DB_PATH = path.join(PROJECT_ROOT, ".ctxloom", "vectors.lancedb");
@@ -571,14 +574,12 @@ function buildActivityFromOverlay(store) {
571
574
  lastCommitTimestamp
572
575
  }));
573
576
  }
574
- var LICENSE_BYPASS = process.env["CTXLOOM_LICENSE_BYPASS"] === "1";
575
577
  var LICENSE_GATE_BYPASS_COMMANDS = /* @__PURE__ */ new Set(["trial", "activate", "deactivate", "status", "--help"]);
576
578
  async function checkLicense() {
577
- if (LICENSE_BYPASS) return;
578
579
  if (command !== void 0 && LICENSE_GATE_BYPASS_COMMANDS.has(command)) return;
579
580
  const ciKey = process.env["CTXLOOM_LICENSE_KEY"];
580
581
  if (ciKey) {
581
- const { ApiClient } = await import("./src-GYVQEDV5.js");
582
+ const { ApiClient } = await import("./src-D3CS3BFE.js");
582
583
  const client = new ApiClient(process.env["CTXLOOM_API_BASE"]);
583
584
  try {
584
585
  const result = await client.validate(ciKey, "ci-ephemeral");
@@ -934,7 +935,7 @@ async function main() {
934
935
  );
935
936
  const open = args.includes("--open") || args.includes("-o");
936
937
  const root = process.env.CTXLOOM_ROOT ?? process.cwd();
937
- const { startDashboard } = await import("./dashboard-LVSRXGZN.js");
938
+ const { startDashboard } = await import("./dashboard-MD73U3AR.js");
938
939
  await startDashboard({ root, port, open });
939
940
  break;
940
941
  }
@@ -1099,7 +1100,7 @@ Suggested reviewers for ${files.length} file(s):`);
1099
1100
  process.stderr.write("[ctxloom] --limit must be a non-negative integer (0 for unlimited)\n");
1100
1101
  process.exit(2);
1101
1102
  }
1102
- const { loadRulesConfig, RulesChecker, formatText, formatJson, RulesConfigError } = await import("./src-GYVQEDV5.js");
1103
+ const { loadRulesConfig, RulesChecker, formatText, formatJson, RulesConfigError } = await import("./src-D3CS3BFE.js");
1103
1104
  let config;
1104
1105
  try {
1105
1106
  config = await loadRulesConfig(root);
@@ -1123,7 +1124,7 @@ Suggested reviewers for ${files.length} file(s):`);
1123
1124
  }
1124
1125
  let graph;
1125
1126
  if (useSnapshot) {
1126
- const { DependencyGraph: DG } = await import("./src-GYVQEDV5.js");
1127
+ const { DependencyGraph: DG } = await import("./src-D3CS3BFE.js");
1127
1128
  graph = new DG();
1128
1129
  const loaded = await graph.loadSnapshotOnly(root);
1129
1130
  if (!loaded) {
@@ -1132,7 +1133,7 @@ Suggested reviewers for ${files.length} file(s):`);
1132
1133
  }
1133
1134
  } else {
1134
1135
  process.stderr.write("[ctxloom] Building dependency graph...\n");
1135
- const { ASTParser: ASTParser2, DependencyGraph: DependencyGraph2 } = await import("./src-GYVQEDV5.js");
1136
+ const { ASTParser: ASTParser2, DependencyGraph: DependencyGraph2 } = await import("./src-D3CS3BFE.js");
1136
1137
  let parser;
1137
1138
  try {
1138
1139
  parser = new ASTParser2();
@@ -0,0 +1,7 @@
1
+ import {
2
+ logger
3
+ } from "./chunk-TYDMSHV7.js";
4
+ export {
5
+ logger
6
+ };
7
+ //# sourceMappingURL=logger-PDXPCKJ6.js.map
@@ -69,19 +69,19 @@ import {
69
69
  startTrial,
70
70
  track,
71
71
  writeCODEOWNERS
72
- } from "./chunk-KPNCYRWW.js";
72
+ } from "./chunk-UMFIYUGI.js";
73
73
  import {
74
74
  VectorStore
75
- } from "./chunk-NC4L5MCD.js";
75
+ } from "./chunk-NEHYSE2Y.js";
76
76
  import {
77
77
  EMBEDDING_DIMENSION,
78
78
  collectFiles,
79
79
  generateEmbedding,
80
80
  indexDirectory
81
- } from "./chunk-MZRK5LFU.js";
81
+ } from "./chunk-U3AVIYSJ.js";
82
82
  import {
83
83
  logger
84
- } from "./chunk-YXMXRVFH.js";
84
+ } from "./chunk-TYDMSHV7.js";
85
85
  export {
86
86
  ASTParser,
87
87
  ApiClient,
@@ -160,4 +160,4 @@ export {
160
160
  track,
161
161
  writeCODEOWNERS
162
162
  };
163
- //# sourceMappingURL=src-GYVQEDV5.js.map
163
+ //# sourceMappingURL=src-D3CS3BFE.js.map
@@ -1,16 +1,31 @@
1
1
  import {
2
2
  VectorStore
3
- } from "../chunk-NC4L5MCD.js";
3
+ } from "../chunk-NEHYSE2Y.js";
4
4
  import {
5
5
  generateEmbedding
6
- } from "../chunk-MZRK5LFU.js";
7
- import "../chunk-YXMXRVFH.js";
6
+ } from "../chunk-U3AVIYSJ.js";
7
+ import "../chunk-TYDMSHV7.js";
8
8
 
9
9
  // packages/core/src/workers/indexerWorker.ts
10
10
  import { parentPort, workerData } from "worker_threads";
11
11
  import path from "path";
12
+ import { z } from "zod";
13
+ var WorkerDataSchema = z.object({
14
+ filePath: z.string().min(1),
15
+ content: z.string(),
16
+ root: z.string().min(1),
17
+ dbPath: z.string().min(1)
18
+ });
12
19
  async function run() {
13
- const { filePath, content, root, dbPath } = workerData;
20
+ const parsed = WorkerDataSchema.safeParse(workerData);
21
+ if (!parsed.success) {
22
+ parentPort?.postMessage({
23
+ status: "error",
24
+ error: `invalid workerData: ${parsed.error.message}`
25
+ });
26
+ return;
27
+ }
28
+ const { filePath, content, root, dbPath } = parsed.data;
14
29
  let store = null;
15
30
  try {
16
31
  const relPath = path.relative(root, filePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctxloom-pro",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "ctxloom — The Universal Code Context Engine. A local-first MCP server providing intelligent code context via hybrid Vector + AST + Graph search with Skeletonization (92% token reduction).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,11 +21,16 @@
21
21
  "files": [
22
22
  "dist/**/*",
23
23
  "!dist/**/*.map",
24
+ "apps/dashboard/dist/**/*",
25
+ "!apps/dashboard/dist/**/*.map",
26
+ "apps/dashboard/package.json",
24
27
  "LICENSE"
25
28
  ],
26
29
  "scripts": {
27
- "build": "tsup",
28
- "prepublishOnly": "tsup",
30
+ "build": "tsup && npm run -w @ctxloom/dashboard build",
31
+ "build:cli": "tsup",
32
+ "build:dashboard": "npm run -w @ctxloom/dashboard build",
33
+ "prepublishOnly": "tsup && npm run -w @ctxloom/dashboard build",
29
34
  "start": "node dist/index.js",
30
35
  "dev": "tsx src/index.ts",
31
36
  "test": "vitest run",
@@ -1,8 +0,0 @@
1
- import {
2
- VectorStore
3
- } from "./chunk-NC4L5MCD.js";
4
- import "./chunk-YXMXRVFH.js";
5
- export {
6
- VectorStore
7
- };
8
- //# sourceMappingURL=VectorStore-G6RNAVQC.js.map