trace-mcp 1.16.0 → 1.17.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/dist/cli.js +98 -45
- package/dist/cli.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/scripts/postinstall-app.mjs +107 -0
package/dist/cli.js
CHANGED
|
@@ -88582,7 +88582,7 @@ init_schema();
|
|
|
88582
88582
|
init_store();
|
|
88583
88583
|
init_registry();
|
|
88584
88584
|
init_config();
|
|
88585
|
-
import { Command as
|
|
88585
|
+
import { Command as Command15 } from "commander";
|
|
88586
88586
|
import path120 from "path";
|
|
88587
88587
|
import fs111 from "fs";
|
|
88588
88588
|
import { randomUUID } from "crypto";
|
|
@@ -88596,7 +88596,7 @@ import https from "https";
|
|
|
88596
88596
|
import { spawnSync } from "child_process";
|
|
88597
88597
|
import path63 from "path";
|
|
88598
88598
|
import fs64 from "fs";
|
|
88599
|
-
var CURRENT_VERSION = true ? "1.
|
|
88599
|
+
var CURRENT_VERSION = true ? "1.17.0" : "0.0.0-dev";
|
|
88600
88600
|
var UPDATE_CACHE_PATH = path63.join(TRACE_MCP_HOME, "update-check.json");
|
|
88601
88601
|
function readCache() {
|
|
88602
88602
|
try {
|
|
@@ -105959,7 +105959,7 @@ function buildFederatedGraph(mainStore, opts) {
|
|
|
105959
105959
|
opts.granularity ?? "file",
|
|
105960
105960
|
opts.hideIsolated === true
|
|
105961
105961
|
);
|
|
105962
|
-
const mainPrefix =
|
|
105962
|
+
const mainPrefix = allRepos.find((r) => r.repo_root === projectRoot)?.name ?? path94.basename(projectRoot);
|
|
105963
105963
|
for (const n of mainResult.nodes) {
|
|
105964
105964
|
n.repo = mainPrefix;
|
|
105965
105965
|
allNodes.push(n);
|
|
@@ -106505,7 +106505,7 @@ DATA.edges.forEach(e => {
|
|
|
106505
106505
|
});
|
|
106506
106506
|
|
|
106507
106507
|
// BFS to collect neighbors at N levels deep \u2014 returns Map<nodeId, depthLevel>
|
|
106508
|
-
let highlightDepth = ${opts
|
|
106508
|
+
let highlightDepth = ${opts?.highlightDepth ?? 1};
|
|
106509
106509
|
function getNeighborsAtDepth(startId, maxDepth) {
|
|
106510
106510
|
const depthMap = new Map(); // nodeId \u2192 depth level (1-based)
|
|
106511
106511
|
let frontier = new Set([startId]);
|
|
@@ -108775,7 +108775,7 @@ function registerAdvancedTools(server, ctx) {
|
|
|
108775
108775
|
symbolKinds: symbol_kinds,
|
|
108776
108776
|
maxFiles: max_files,
|
|
108777
108777
|
maxNodes: max_nodes,
|
|
108778
|
-
topoStore: ctx.topoStore,
|
|
108778
|
+
topoStore: ctx.topoStore ?? void 0,
|
|
108779
108779
|
projectRoot
|
|
108780
108780
|
});
|
|
108781
108781
|
if (result.isErr()) return { content: [{ type: "text", text: j3(formatToolError(result.error)) }], isError: true };
|
|
@@ -115505,7 +115505,7 @@ var TopologyStore = class {
|
|
|
115505
115505
|
};
|
|
115506
115506
|
|
|
115507
115507
|
// src/server/server.ts
|
|
115508
|
-
var PKG_VERSION = true ? "1.
|
|
115508
|
+
var PKG_VERSION = true ? "1.17.0" : "0.0.0-dev";
|
|
115509
115509
|
function j2(value) {
|
|
115510
115510
|
return JSON.stringify(value, (_key, val) => val === null || val === void 0 ? void 0 : val);
|
|
115511
115511
|
}
|
|
@@ -116079,7 +116079,7 @@ function isServerRunning(db) {
|
|
|
116079
116079
|
import http from "http";
|
|
116080
116080
|
|
|
116081
116081
|
// src/cli/init.ts
|
|
116082
|
-
import { Command } from "commander";
|
|
116082
|
+
import { Command as Command2 } from "commander";
|
|
116083
116083
|
import fs102 from "fs";
|
|
116084
116084
|
import path113 from "path";
|
|
116085
116085
|
import * as p from "@clack/prompts";
|
|
@@ -117766,9 +117766,13 @@ import path112 from "path";
|
|
|
117766
117766
|
import os13 from "os";
|
|
117767
117767
|
import https2 from "https";
|
|
117768
117768
|
import { execSync as execSync6 } from "child_process";
|
|
117769
|
+
import { Command } from "commander";
|
|
117769
117770
|
var GITHUB_REPO = "nikolai-vysotskyi/trace-mcp";
|
|
117770
117771
|
var APP_NAME = "trace-mcp.app";
|
|
117771
117772
|
var INSTALL_DIR = path112.join(os13.homedir(), "Applications");
|
|
117773
|
+
function sleep(ms2) {
|
|
117774
|
+
return new Promise((resolve3) => setTimeout(resolve3, ms2));
|
|
117775
|
+
}
|
|
117772
117776
|
function fetchLatestRelease(timeoutMs = 1e4) {
|
|
117773
117777
|
return new Promise((resolve3, reject) => {
|
|
117774
117778
|
const req = https2.get(
|
|
@@ -117856,17 +117860,36 @@ function downloadFile(url2, dest, timeoutMs = 6e4) {
|
|
|
117856
117860
|
doGet(url2);
|
|
117857
117861
|
});
|
|
117858
117862
|
}
|
|
117859
|
-
async function installGuiApp() {
|
|
117863
|
+
async function installGuiApp(opts = {}) {
|
|
117860
117864
|
if (process.platform !== "darwin") {
|
|
117861
117865
|
return { installed: false, error: "Menu bar app is macOS only" };
|
|
117862
117866
|
}
|
|
117867
|
+
const { retries = 3, retryDelayMs = 15e3, onRetry } = opts;
|
|
117863
117868
|
const arch = process.arch === "arm64" ? "arm64" : "x64";
|
|
117864
|
-
const
|
|
117869
|
+
const findAsset = (assets) => {
|
|
117870
|
+
const zips = assets.filter((a) => /trace-mcp.*\.zip$/i.test(a.name));
|
|
117871
|
+
if (arch === "arm64") {
|
|
117872
|
+
return zips.find((a) => /arm64/i.test(a.name));
|
|
117873
|
+
}
|
|
117874
|
+
return zips.find((a) => !/arm64/i.test(a.name));
|
|
117875
|
+
};
|
|
117865
117876
|
try {
|
|
117866
|
-
|
|
117867
|
-
|
|
117877
|
+
let release;
|
|
117878
|
+
let asset;
|
|
117879
|
+
for (let attempt = 0; attempt <= retries; attempt++) {
|
|
117880
|
+
release = await fetchLatestRelease();
|
|
117881
|
+
asset = findAsset(release.assets);
|
|
117882
|
+
if (asset) break;
|
|
117883
|
+
if (attempt < retries) {
|
|
117884
|
+
onRetry?.(attempt + 1, retries);
|
|
117885
|
+
await sleep(retryDelayMs);
|
|
117886
|
+
}
|
|
117887
|
+
}
|
|
117868
117888
|
if (!asset) {
|
|
117869
|
-
return {
|
|
117889
|
+
return {
|
|
117890
|
+
installed: false,
|
|
117891
|
+
error: `No ${arch} zip found in release ${release.tag} (${release.assets.length} assets available: ${release.assets.map((a) => a.name).join(", ") || "none"}). The build may still be in progress \u2014 try again in a few minutes with: trace-mcp install-app`
|
|
117892
|
+
};
|
|
117870
117893
|
}
|
|
117871
117894
|
const tmpDir = fs101.mkdtempSync(path112.join(os13.tmpdir(), "trace-mcp-app-"));
|
|
117872
117895
|
const zipPath = path112.join(tmpDir, asset.name);
|
|
@@ -117887,9 +117910,32 @@ async function installGuiApp() {
|
|
|
117887
117910
|
function isAppInstalled() {
|
|
117888
117911
|
return fs101.existsSync(path112.join(INSTALL_DIR, APP_NAME));
|
|
117889
117912
|
}
|
|
117913
|
+
var installAppCommand = new Command("install-app").description("Download and install (or update) the trace-mcp menu bar app (macOS)").option("--retries <n>", "Number of retries if asset not yet uploaded", "3").option("--retry-delay <ms>", "Delay between retries in ms", "15000").action(async (opts) => {
|
|
117914
|
+
if (process.platform !== "darwin") {
|
|
117915
|
+
console.error("Error: Menu bar app is macOS only.");
|
|
117916
|
+
process.exit(1);
|
|
117917
|
+
}
|
|
117918
|
+
const retries = parseInt(opts.retries, 10);
|
|
117919
|
+
const retryDelayMs = parseInt(opts.retryDelay, 10);
|
|
117920
|
+
const already = isAppInstalled();
|
|
117921
|
+
console.log(already ? "Updating trace-mcp menu bar app\u2026" : "Installing trace-mcp menu bar app\u2026");
|
|
117922
|
+
const result = await installGuiApp({
|
|
117923
|
+
retries,
|
|
117924
|
+
retryDelayMs,
|
|
117925
|
+
onRetry: (attempt, total) => {
|
|
117926
|
+
console.log(` Asset not yet available, retrying (${attempt}/${total})\u2026`);
|
|
117927
|
+
}
|
|
117928
|
+
});
|
|
117929
|
+
if (result.installed) {
|
|
117930
|
+
console.log(`\u2713 ${already ? "Updated" : "Installed"} \u2192 ${result.path}`);
|
|
117931
|
+
} else {
|
|
117932
|
+
console.error(`\u2717 ${result.error}`);
|
|
117933
|
+
process.exit(1);
|
|
117934
|
+
}
|
|
117935
|
+
});
|
|
117890
117936
|
|
|
117891
117937
|
// src/cli/init.ts
|
|
117892
|
-
var initCommand = new
|
|
117938
|
+
var initCommand = new Command2("init").description("One-time global setup: configure MCP clients, install hooks, set up CLAUDE.md").option("--yes", "Skip prompts, use recommended defaults").option("--skip-hooks", "Do not install guard hooks").option("--skip-mcp-client", "Do not configure MCP client").option("--skip-claude-md", "Do not add CLAUDE.md block").option("--mcp-client <name>", "Force MCP client: claude-code | claude-desktop | cursor | windsurf | continue").option("--force", "Overwrite existing configuration").option("--dry-run", "Show what would be done without writing files").option("--json", "Output results as JSON (implies --yes)").option("--index", "Also register and index the current project").action(async (opts) => {
|
|
117893
117939
|
const nonInteractive = opts.yes || opts.json || opts.dryRun;
|
|
117894
117940
|
let migrationStep;
|
|
117895
117941
|
if (!opts.dryRun) {
|
|
@@ -117948,15 +117994,15 @@ var initCommand = new Command("init").description("One-time global setup: config
|
|
|
117948
117994
|
{
|
|
117949
117995
|
value: "standard",
|
|
117950
117996
|
label: "Standard \u2014 CLAUDE.md + hooks",
|
|
117951
|
-
hint: "guard hooks intercept tool calls at runtime
|
|
117997
|
+
hint: "guard hooks intercept tool calls at runtime"
|
|
117952
117998
|
},
|
|
117953
117999
|
{
|
|
117954
118000
|
value: "max",
|
|
117955
118001
|
label: "Max \u2014 CLAUDE.md + hooks + tweakcc",
|
|
117956
|
-
hint: tweakccState.installed ? "patches Claude's system prompts (
|
|
118002
|
+
hint: tweakccState.installed ? "patches Claude's system prompts (recommended)" : "requires tweakcc \u2014 install with `npx tweakcc` first (recommended)"
|
|
117957
118003
|
}
|
|
117958
118004
|
],
|
|
117959
|
-
initialValue: "
|
|
118005
|
+
initialValue: "max"
|
|
117960
118006
|
});
|
|
117961
118007
|
if (p.isCancel(levelResult)) {
|
|
117962
118008
|
p.cancel("Cancelled.");
|
|
@@ -118154,7 +118200,13 @@ var initCommand = new Command("init").description("One-time global setup: config
|
|
|
118154
118200
|
if (installApp && !opts.dryRun) {
|
|
118155
118201
|
const spin = p.spinner();
|
|
118156
118202
|
spin.start("Downloading trace-mcp menu bar app\u2026");
|
|
118157
|
-
const appResult = await installGuiApp(
|
|
118203
|
+
const appResult = await installGuiApp({
|
|
118204
|
+
retries: 3,
|
|
118205
|
+
retryDelayMs: 15e3,
|
|
118206
|
+
onRetry: (attempt, total) => {
|
|
118207
|
+
spin.message(`App asset not uploaded yet, retrying (${attempt}/${total})\u2026`);
|
|
118208
|
+
}
|
|
118209
|
+
});
|
|
118158
118210
|
if (appResult.installed) {
|
|
118159
118211
|
spin.stop(`Installed \u2192 ${appResult.path}`);
|
|
118160
118212
|
steps.push({ target: appResult.path, action: "created", detail: "Menu bar app installed" });
|
|
@@ -118368,10 +118420,10 @@ init_pipeline();
|
|
|
118368
118420
|
init_logger();
|
|
118369
118421
|
init_registry2();
|
|
118370
118422
|
init_global();
|
|
118371
|
-
import { Command as
|
|
118423
|
+
import { Command as Command3 } from "commander";
|
|
118372
118424
|
import fs103 from "fs";
|
|
118373
118425
|
import path114 from "path";
|
|
118374
|
-
var upgradeCommand = new
|
|
118426
|
+
var upgradeCommand = new Command3("upgrade").description("Upgrade trace-mcp: run DB migrations, reindex with latest plugins, update hooks and CLAUDE.md").argument("[dir]", "Project directory (omit to upgrade all registered projects)").option("--skip-hooks", "Do not update guard hooks").option("--skip-reindex", "Do not trigger reindex").option("--skip-claude-md", "Do not update CLAUDE.md block").option("--dry-run", "Show what would be done without writing files").option("--json", "Output results as JSON").action(async (dir, opts) => {
|
|
118375
118427
|
const projectRoots = [];
|
|
118376
118428
|
if (dir) {
|
|
118377
118429
|
projectRoots.push(path114.resolve(dir));
|
|
@@ -118475,7 +118527,7 @@ var upgradeCommand = new Command2("upgrade").description("Upgrade trace-mcp: run
|
|
|
118475
118527
|
});
|
|
118476
118528
|
|
|
118477
118529
|
// src/cli/add.ts
|
|
118478
|
-
import { Command as
|
|
118530
|
+
import { Command as Command4 } from "commander";
|
|
118479
118531
|
import fs104 from "fs";
|
|
118480
118532
|
import path115 from "path";
|
|
118481
118533
|
import * as p2 from "@clack/prompts";
|
|
@@ -118521,7 +118573,7 @@ function formatDuration2(ms2) {
|
|
|
118521
118573
|
if (ms2 < 1e3) return `${ms2}ms`;
|
|
118522
118574
|
return `${(ms2 / 1e3).toFixed(1)}s`;
|
|
118523
118575
|
}
|
|
118524
|
-
var addCommand = new
|
|
118576
|
+
var addCommand = new Command4("add").description("Register a project for indexing: detect root, create DB, add to registry").argument("[dir]", "Project directory (default: current directory)", ".").option("--force", "Re-register even if already registered").option("--no-index", "Skip indexing after registration").option("--json", "Output results as JSON").action(async (dir, opts) => {
|
|
118525
118577
|
const resolvedDir = path115.resolve(dir);
|
|
118526
118578
|
if (!fs104.existsSync(resolvedDir)) {
|
|
118527
118579
|
console.error(`Directory does not exist: ${resolvedDir}`);
|
|
@@ -118777,14 +118829,14 @@ function shortPath4(p5) {
|
|
|
118777
118829
|
}
|
|
118778
118830
|
|
|
118779
118831
|
// src/cli/doctor.ts
|
|
118780
|
-
import { Command as
|
|
118832
|
+
import { Command as Command5 } from "commander";
|
|
118781
118833
|
import * as p3 from "@clack/prompts";
|
|
118782
118834
|
var SEVERITY_LABEL = {
|
|
118783
118835
|
critical: "CRITICAL",
|
|
118784
118836
|
warning: "WARNING",
|
|
118785
118837
|
info: "INFO"
|
|
118786
118838
|
};
|
|
118787
|
-
var doctorCommand = new
|
|
118839
|
+
var doctorCommand = new Command5("doctor").description("Check for competing tools that may conflict with trace-mcp").option("--fix", "Automatically fix all fixable conflicts").option("--fix-interactive", "Fix conflicts interactively (ask for each)").option("--dry-run", "Show what --fix would do without making changes").option("--json", "Output results as JSON").action(async (opts) => {
|
|
118788
118840
|
let projectRoot;
|
|
118789
118841
|
try {
|
|
118790
118842
|
projectRoot = findProjectRoot(process.cwd());
|
|
@@ -118923,7 +118975,7 @@ init_pipeline();
|
|
|
118923
118975
|
init_config();
|
|
118924
118976
|
init_global();
|
|
118925
118977
|
init_registry2();
|
|
118926
|
-
import { Command as
|
|
118978
|
+
import { Command as Command6 } from "commander";
|
|
118927
118979
|
import { execFileSync as execFileSync7 } from "child_process";
|
|
118928
118980
|
import path116 from "path";
|
|
118929
118981
|
import fs105 from "fs";
|
|
@@ -119564,7 +119616,7 @@ function resolveDbPath(projectRoot) {
|
|
|
119564
119616
|
if (entry) return entry.dbPath;
|
|
119565
119617
|
return getDbPath(projectRoot);
|
|
119566
119618
|
}
|
|
119567
|
-
var ciReportCommand = new
|
|
119619
|
+
var ciReportCommand = new Command6("ci-report").description("Generate a change impact report for a PR/branch").option("--base <ref>", "Base git ref (default: main)", "main").option("--head <ref>", "Head git ref (default: HEAD)", "HEAD").option("--format <fmt>", "Output format: markdown | json (default: markdown)", "markdown").option("--output <path>", "Output file path (default: stdout, use - for stdout)", "-").option("--fail-on <level>", "Exit with code 1 if risk >= level: critical | high | medium", "").option("--index", "Index the project before generating the report", false).option("--no-project-aware", "Disable domain/ownership/deployment analysis").option("--save-baseline", "Save current scores as quality baseline", false).option("--fail-regression", "Exit 1 if quality regressed vs baseline", false).option("--annotations <format>", "Output annotations: github-actions | json").action(async (opts) => {
|
|
119568
119620
|
let projectRoot;
|
|
119569
119621
|
try {
|
|
119570
119622
|
projectRoot = findProjectRoot(process.cwd());
|
|
@@ -119696,7 +119748,7 @@ init_store();
|
|
|
119696
119748
|
init_config();
|
|
119697
119749
|
init_global();
|
|
119698
119750
|
init_registry2();
|
|
119699
|
-
import { Command as
|
|
119751
|
+
import { Command as Command7 } from "commander";
|
|
119700
119752
|
init_logger();
|
|
119701
119753
|
init_pipeline();
|
|
119702
119754
|
init_registry();
|
|
@@ -119708,7 +119760,7 @@ function resolveDbPath2(projectRoot) {
|
|
|
119708
119760
|
if (entry) return entry.dbPath;
|
|
119709
119761
|
return getDbPath(projectRoot);
|
|
119710
119762
|
}
|
|
119711
|
-
var checkCommand = new
|
|
119763
|
+
var checkCommand = new Command7("check").description("Run quality gate checks against the indexed project (exit code 0 = pass, 1 = fail)").option("--config <path>", "Path to config file with quality_gates section").option("--format <fmt>", "Output format: text | json (default: text)", "text").option("--index", "Re-index the project before checking", false).option("--fail-on <level>", "Override fail_on: error | warning | none").action(async (opts) => {
|
|
119712
119764
|
let projectRoot;
|
|
119713
119765
|
try {
|
|
119714
119766
|
projectRoot = findProjectRoot(process.cwd());
|
|
@@ -119799,7 +119851,7 @@ function getDefaultGatesConfig() {
|
|
|
119799
119851
|
}
|
|
119800
119852
|
|
|
119801
119853
|
// src/cli/bundles.ts
|
|
119802
|
-
import { Command as
|
|
119854
|
+
import { Command as Command8 } from "commander";
|
|
119803
119855
|
init_global();
|
|
119804
119856
|
init_registry2();
|
|
119805
119857
|
function resolveDbPath3(projectRoot) {
|
|
@@ -119807,7 +119859,7 @@ function resolveDbPath3(projectRoot) {
|
|
|
119807
119859
|
if (entry) return entry.dbPath;
|
|
119808
119860
|
return getDbPath(projectRoot);
|
|
119809
119861
|
}
|
|
119810
|
-
var bundlesCommand = new
|
|
119862
|
+
var bundlesCommand = new Command8("bundles").description("Manage pre-indexed bundles for dependency libraries");
|
|
119811
119863
|
bundlesCommand.command("list").description("List installed bundles").action(() => {
|
|
119812
119864
|
ensureBundlesDir();
|
|
119813
119865
|
const bundles = listBundles();
|
|
@@ -119850,7 +119902,7 @@ bundlesCommand.command("remove").description("Remove an installed bundle").requi
|
|
|
119850
119902
|
});
|
|
119851
119903
|
|
|
119852
119904
|
// src/cli/federation.ts
|
|
119853
|
-
import { Command as
|
|
119905
|
+
import { Command as Command9 } from "commander";
|
|
119854
119906
|
init_global();
|
|
119855
119907
|
init_logger();
|
|
119856
119908
|
function createManager() {
|
|
@@ -119859,7 +119911,7 @@ function createManager() {
|
|
|
119859
119911
|
const manager = new FederationManager(topoStore);
|
|
119860
119912
|
return { manager, topoStore };
|
|
119861
119913
|
}
|
|
119862
|
-
var federationCommand = new
|
|
119914
|
+
var federationCommand = new Command9("federation").description("Multi-repo graph federation \u2014 link API contracts across repositories").alias("fed");
|
|
119863
119915
|
federationCommand.command("add").description("Add a repository to the federation").requiredOption("--repo <path>", "Path to the repository").option("--contract <paths...>", "Explicit contract file paths (relative to repo root)").option("--name <name>", "Name for this repo (default: directory basename)").action((opts) => {
|
|
119864
119916
|
const { manager, topoStore } = createManager();
|
|
119865
119917
|
try {
|
|
@@ -119996,7 +120048,7 @@ federationCommand.command("impact").description("Cross-repo impact analysis: who
|
|
|
119996
120048
|
});
|
|
119997
120049
|
|
|
119998
120050
|
// src/cli/analytics.ts
|
|
119999
|
-
import { Command as
|
|
120051
|
+
import { Command as Command10 } from "commander";
|
|
120000
120052
|
init_schema();
|
|
120001
120053
|
init_store();
|
|
120002
120054
|
init_global();
|
|
@@ -120049,7 +120101,7 @@ function printSingleReport(result) {
|
|
|
120049
120101
|
}
|
|
120050
120102
|
console.log("");
|
|
120051
120103
|
}
|
|
120052
|
-
var analyticsCommand = new
|
|
120104
|
+
var analyticsCommand = new Command10("analytics").description("AI agent session analytics: sync logs, view reports, find optimizations");
|
|
120053
120105
|
analyticsCommand.command("sync").description("Parse Claude Code session logs into analytics database").option("--full", "Force full rescan of all sessions", false).option("--project <path>", "Filter by project path").action(async (opts) => {
|
|
120054
120106
|
ensureGlobalDirs();
|
|
120055
120107
|
const analyticsStore = new AnalyticsStore();
|
|
@@ -120337,14 +120389,14 @@ analyticsCommand.command("trends").description("Show daily usage trends: tokens,
|
|
|
120337
120389
|
});
|
|
120338
120390
|
|
|
120339
120391
|
// src/cli/remove.ts
|
|
120340
|
-
import { Command as
|
|
120392
|
+
import { Command as Command11 } from "commander";
|
|
120341
120393
|
import fs107 from "fs";
|
|
120342
120394
|
import path117 from "path";
|
|
120343
120395
|
import * as p4 from "@clack/prompts";
|
|
120344
120396
|
init_registry2();
|
|
120345
120397
|
init_config();
|
|
120346
120398
|
init_global();
|
|
120347
|
-
var removeCommand = new
|
|
120399
|
+
var removeCommand = new Command11("remove").description("Unregister a project and delete its index").argument("[dir]", "Project directory (default: current directory)", ".").option("--force", "Remove without confirmation").option("--keep-db", "Keep the database file (only unregister)").option("--json", "Output results as JSON").action(async (dir, opts) => {
|
|
120348
120400
|
const resolvedDir = path117.resolve(dir);
|
|
120349
120401
|
const isInteractive = !opts.json;
|
|
120350
120402
|
let projectRoot;
|
|
@@ -120533,7 +120585,7 @@ function shortPath6(p5) {
|
|
|
120533
120585
|
// src/cli/status.ts
|
|
120534
120586
|
init_global();
|
|
120535
120587
|
init_registry2();
|
|
120536
|
-
import { Command as
|
|
120588
|
+
import { Command as Command12 } from "commander";
|
|
120537
120589
|
import fs108 from "fs";
|
|
120538
120590
|
import Database9 from "better-sqlite3";
|
|
120539
120591
|
function resolveDbPath5(projectRoot) {
|
|
@@ -120571,7 +120623,7 @@ function formatPipeline(name, p5) {
|
|
|
120571
120623
|
return ` ${label} ${p5.phase}`;
|
|
120572
120624
|
}
|
|
120573
120625
|
}
|
|
120574
|
-
var statusCommand = new
|
|
120626
|
+
var statusCommand = new Command12("status").description("Show indexing progress for the current project").option("--json", "Output as JSON").action((opts) => {
|
|
120575
120627
|
let projectRoot;
|
|
120576
120628
|
try {
|
|
120577
120629
|
projectRoot = findProjectRoot(process.cwd());
|
|
@@ -120631,7 +120683,7 @@ import { execSync as execSync7 } from "child_process";
|
|
|
120631
120683
|
import fs109 from "fs";
|
|
120632
120684
|
import os14 from "os";
|
|
120633
120685
|
import path118 from "path";
|
|
120634
|
-
import { Command as
|
|
120686
|
+
import { Command as Command13 } from "commander";
|
|
120635
120687
|
init_registry2();
|
|
120636
120688
|
function openInBrowser(filePath) {
|
|
120637
120689
|
const platform = process.platform;
|
|
@@ -120642,7 +120694,7 @@ function openInBrowser(filePath) {
|
|
|
120642
120694
|
} catch {
|
|
120643
120695
|
}
|
|
120644
120696
|
}
|
|
120645
|
-
var visualizeCommand = new
|
|
120697
|
+
var visualizeCommand = new Command13("visualize").alias("viz").description("Generate an interactive dependency graph and open it in the browser").argument("[scope]", `what to visualize
|
|
120646
120698
|
|
|
120647
120699
|
Scope can be:
|
|
120648
120700
|
project whole project graph
|
|
@@ -120703,7 +120755,7 @@ var visualizeCommand = new Command12("visualize").alias("viz").description("Gene
|
|
|
120703
120755
|
topoStore?.close();
|
|
120704
120756
|
db.close();
|
|
120705
120757
|
if (result.isErr()) {
|
|
120706
|
-
console.error("Error:", result.error.message);
|
|
120758
|
+
console.error("Error:", "message" in result.error ? result.error.message : result.error.code);
|
|
120707
120759
|
process.exit(1);
|
|
120708
120760
|
}
|
|
120709
120761
|
console.log(`Graph: ${result.value.nodes} nodes, ${result.value.edges} edges, ${result.value.communities} communities`);
|
|
@@ -120722,7 +120774,7 @@ visualizeCommand.command("federation").alias("fed").description("Open federation
|
|
|
120722
120774
|
});
|
|
120723
120775
|
topoStore.close();
|
|
120724
120776
|
if (result.isErr()) {
|
|
120725
|
-
console.error("Error:", result.error.message);
|
|
120777
|
+
console.error("Error:", "message" in result.error ? result.error.message : result.error.code);
|
|
120726
120778
|
process.exit(1);
|
|
120727
120779
|
}
|
|
120728
120780
|
console.log(`Federation: ${result.value.services} services, ${result.value.edges} edges`);
|
|
@@ -120734,7 +120786,7 @@ visualizeCommand.command("federation").alias("fed").description("Open federation
|
|
|
120734
120786
|
|
|
120735
120787
|
// src/cli/daemon.ts
|
|
120736
120788
|
init_global();
|
|
120737
|
-
import { Command as
|
|
120789
|
+
import { Command as Command14 } from "commander";
|
|
120738
120790
|
import fs110 from "fs";
|
|
120739
120791
|
import path119 from "path";
|
|
120740
120792
|
import { execSync as execSync8, spawn as spawn2 } from "child_process";
|
|
@@ -120815,7 +120867,7 @@ function isPlistLoaded() {
|
|
|
120815
120867
|
return false;
|
|
120816
120868
|
}
|
|
120817
120869
|
}
|
|
120818
|
-
var daemonCommand = new
|
|
120870
|
+
var daemonCommand = new Command14("daemon").description("Manage the trace-mcp background daemon");
|
|
120819
120871
|
daemonCommand.command("start").description("Start the daemon (installs launchd plist and loads it)").option("-p, --port <port>", "Port to listen on", String(DEFAULT_DAEMON_PORT)).action(async (opts) => {
|
|
120820
120872
|
const port = parseInt(opts.port, 10);
|
|
120821
120873
|
if (process.platform !== "darwin") {
|
|
@@ -121085,7 +121137,7 @@ var ProjectManager = class {
|
|
|
121085
121137
|
|
|
121086
121138
|
// src/cli.ts
|
|
121087
121139
|
init_global();
|
|
121088
|
-
var PKG_VERSION2 = true ? "1.
|
|
121140
|
+
var PKG_VERSION2 = true ? "1.17.0" : "0.0.0-dev";
|
|
121089
121141
|
function registerDefaultPlugins2(registry) {
|
|
121090
121142
|
for (const p5 of createAllLanguagePlugins()) registry.registerLanguagePlugin(p5);
|
|
121091
121143
|
for (const p5 of createAllIntegrationPlugins()) registry.registerFrameworkPlugin(p5);
|
|
@@ -121124,7 +121176,7 @@ function runFederationAutoSync2(projectRoot, config) {
|
|
|
121124
121176
|
logger.warn({ error: e }, "Federation auto-sync failed (non-fatal)");
|
|
121125
121177
|
}
|
|
121126
121178
|
}
|
|
121127
|
-
var program = new
|
|
121179
|
+
var program = new Command15();
|
|
121128
121180
|
program.name("trace-mcp").description("Framework-Aware Code Intelligence for Laravel/Vue/Inertia/Nuxt").version(PKG_VERSION2, "-v, --version");
|
|
121129
121181
|
program.command("serve").description("Start MCP server (stdio transport)").action(async () => {
|
|
121130
121182
|
const projectRoot = process.cwd();
|
|
@@ -122213,6 +122265,7 @@ program.addCommand(analyticsCommand);
|
|
|
122213
122265
|
program.addCommand(statusCommand);
|
|
122214
122266
|
program.addCommand(visualizeCommand);
|
|
122215
122267
|
program.addCommand(daemonCommand);
|
|
122268
|
+
program.addCommand(installAppCommand);
|
|
122216
122269
|
program.parse();
|
|
122217
122270
|
/*! Bundled license information:
|
|
122218
122271
|
|