vaspera-pm 2.12.14 → 2.12.16
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 +66 -16
- package/dist/cli.js.map +1 -1
- package/dist/server.js +58 -13
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -317,8 +317,12 @@ var init_auth = __esm({
|
|
|
317
317
|
|
|
318
318
|
// src/middleware/usage.ts
|
|
319
319
|
async function trackUsage(event) {
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
const authKey = INTERNAL_SERVICE_KEY || VASPERA_API_KEY;
|
|
321
|
+
const isLocalMcp = !INTERNAL_SERVICE_KEY && !!VASPERA_API_KEY;
|
|
322
|
+
if (!authKey) {
|
|
323
|
+
if (process.env.NODE_ENV !== "development" && process.env.VASPERA_DEV_MODE !== "true") {
|
|
324
|
+
console.error("[VasperaPM] No auth key configured for usage tracking (set VASPERA_API_KEY)");
|
|
325
|
+
}
|
|
322
326
|
return;
|
|
323
327
|
}
|
|
324
328
|
try {
|
|
@@ -326,7 +330,7 @@ async function trackUsage(event) {
|
|
|
326
330
|
method: "POST",
|
|
327
331
|
headers: {
|
|
328
332
|
"Content-Type": "application/json",
|
|
329
|
-
"Authorization": `Bearer ${
|
|
333
|
+
"Authorization": `Bearer ${authKey}`
|
|
330
334
|
},
|
|
331
335
|
body: JSON.stringify({
|
|
332
336
|
userId: event.userId,
|
|
@@ -337,15 +341,16 @@ async function trackUsage(event) {
|
|
|
337
341
|
success: event.success,
|
|
338
342
|
errorCode: event.errorCode,
|
|
339
343
|
metadata: event.metadata,
|
|
340
|
-
requestId: generateRequestId()
|
|
344
|
+
requestId: generateRequestId(),
|
|
345
|
+
source: isLocalMcp ? "local_mcp" : "cloud_api"
|
|
341
346
|
})
|
|
342
347
|
});
|
|
343
348
|
if (!response.ok) {
|
|
344
349
|
const error2 = await response.json().catch(() => ({}));
|
|
345
|
-
console.error("Failed to track usage:", error2);
|
|
350
|
+
console.error("[VasperaPM] Failed to track usage:", error2);
|
|
346
351
|
}
|
|
347
352
|
} catch (error2) {
|
|
348
|
-
console.error("Usage tracking error:", error2);
|
|
353
|
+
console.error("[VasperaPM] Usage tracking error:", error2);
|
|
349
354
|
}
|
|
350
355
|
}
|
|
351
356
|
function generateRequestId() {
|
|
@@ -361,14 +366,15 @@ async function getTrialCallsUsed(userId) {
|
|
|
361
366
|
if (process.env.VASPERA_DEV_MODE === "true" || process.env.NODE_ENV === "development") {
|
|
362
367
|
return 0;
|
|
363
368
|
}
|
|
364
|
-
|
|
369
|
+
const authKey = INTERNAL_SERVICE_KEY || VASPERA_API_KEY;
|
|
370
|
+
if (!authKey) {
|
|
365
371
|
return 0;
|
|
366
372
|
}
|
|
367
373
|
try {
|
|
368
374
|
const response = await fetch(`${USAGE_API_URL}/api/usage/trial-calls?userId=${userId}`, {
|
|
369
375
|
method: "GET",
|
|
370
376
|
headers: {
|
|
371
|
-
"Authorization": `Bearer ${
|
|
377
|
+
"Authorization": `Bearer ${authKey}`
|
|
372
378
|
}
|
|
373
379
|
});
|
|
374
380
|
if (!response.ok) {
|
|
@@ -392,12 +398,13 @@ function incrementTrialCallsCache(userId) {
|
|
|
392
398
|
trialCallsCache.set(userId, { count: 1, timestamp: Date.now() });
|
|
393
399
|
}
|
|
394
400
|
}
|
|
395
|
-
var USAGE_API_URL, INTERNAL_SERVICE_KEY, trialCallsCache, CACHE_TTL_MS;
|
|
401
|
+
var USAGE_API_URL, INTERNAL_SERVICE_KEY, VASPERA_API_KEY, trialCallsCache, CACHE_TTL_MS;
|
|
396
402
|
var init_usage = __esm({
|
|
397
403
|
"src/middleware/usage.ts"() {
|
|
398
404
|
"use strict";
|
|
399
405
|
USAGE_API_URL = process.env.VASPERA_API_URL || "https://vasperapm.com";
|
|
400
406
|
INTERNAL_SERVICE_KEY = process.env.INTERNAL_SERVICE_KEY;
|
|
407
|
+
VASPERA_API_KEY = process.env.VASPERA_API_KEY;
|
|
401
408
|
trialCallsCache = /* @__PURE__ */ new Map();
|
|
402
409
|
CACHE_TTL_MS = 6e4;
|
|
403
410
|
}
|
|
@@ -9482,12 +9489,29 @@ async function discoverCodeFiles(repoPath, codeFiles) {
|
|
|
9482
9489
|
const supportedExtensions = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".jsx", ".py", ".go"]);
|
|
9483
9490
|
const ignoreDirs = /* @__PURE__ */ new Set(["node_modules", "dist", "build", ".next", "coverage", "__tests__", ".git", "__mocks__"]);
|
|
9484
9491
|
const priorityPatterns = [
|
|
9492
|
+
// Core library paths (highest priority for implementations)
|
|
9485
9493
|
"/lib/",
|
|
9486
9494
|
"/src/",
|
|
9487
9495
|
"/services/",
|
|
9496
|
+
// Library subdirectories - common locations for feature implementations
|
|
9497
|
+
"/telemetry/",
|
|
9498
|
+
"/analytics/",
|
|
9499
|
+
"/monitoring/",
|
|
9500
|
+
"/observability/",
|
|
9501
|
+
"/integrations/",
|
|
9502
|
+
"/clients/",
|
|
9503
|
+
"/connectors/",
|
|
9504
|
+
"/adapters/",
|
|
9505
|
+
// API and route paths
|
|
9488
9506
|
"/api/",
|
|
9489
9507
|
"/routes/",
|
|
9508
|
+
"/controllers/",
|
|
9509
|
+
"/handlers/",
|
|
9510
|
+
// UI paths
|
|
9490
9511
|
"/components/",
|
|
9512
|
+
"/views/",
|
|
9513
|
+
"/pages/",
|
|
9514
|
+
// Utility paths
|
|
9491
9515
|
"/utils/",
|
|
9492
9516
|
"/helpers/",
|
|
9493
9517
|
"/middleware/",
|
|
@@ -9495,8 +9519,7 @@ async function discoverCodeFiles(repoPath, codeFiles) {
|
|
|
9495
9519
|
"/rules/",
|
|
9496
9520
|
"/gse/",
|
|
9497
9521
|
"/validation/",
|
|
9498
|
-
"/export/"
|
|
9499
|
-
"/connectors/"
|
|
9522
|
+
"/export/"
|
|
9500
9523
|
];
|
|
9501
9524
|
try {
|
|
9502
9525
|
const entries = readdirSync5(resolvedPath, { withFileTypes: true, recursive: true });
|
|
@@ -9519,6 +9542,9 @@ async function discoverCodeFiles(repoPath, codeFiles) {
|
|
|
9519
9542
|
break;
|
|
9520
9543
|
}
|
|
9521
9544
|
}
|
|
9545
|
+
if (pathLower.includes("/lib/") && (pathLower.includes("/telemetry/") || pathLower.includes("/analytics/") || pathLower.includes("/monitoring/") || pathLower.includes("/observability/") || pathLower.includes("/integrations/") || pathLower.includes("/clients/"))) {
|
|
9546
|
+
priority = 0;
|
|
9547
|
+
}
|
|
9522
9548
|
if (pathLower.includes("/app/") || pathLower.includes("/pages/")) {
|
|
9523
9549
|
priority = Math.min(priority, 5);
|
|
9524
9550
|
}
|
|
@@ -9529,6 +9555,7 @@ async function discoverCodeFiles(repoPath, codeFiles) {
|
|
|
9529
9555
|
}
|
|
9530
9556
|
allFiles.sort((a, b) => {
|
|
9531
9557
|
if (a.priority !== b.priority) return a.priority - b.priority;
|
|
9558
|
+
if (a.priority <= 1 && b.priority <= 1) return 0;
|
|
9532
9559
|
return a.relativePath.split("/").length - b.relativePath.split("/").length;
|
|
9533
9560
|
});
|
|
9534
9561
|
const selectedFiles = allFiles.slice(0, maxFiles);
|
|
@@ -9550,7 +9577,12 @@ async function discoverCodeFiles(repoPath, codeFiles) {
|
|
|
9550
9577
|
} catch {
|
|
9551
9578
|
}
|
|
9552
9579
|
}
|
|
9553
|
-
|
|
9580
|
+
const libFiles = files.filter((f) => f.relativePath.toLowerCase().includes("/lib/"));
|
|
9581
|
+
const libSubdirFiles = files.filter((f) => {
|
|
9582
|
+
const p = f.relativePath.toLowerCase();
|
|
9583
|
+
return p.includes("/telemetry/") || p.includes("/analytics/") || p.includes("/monitoring/") || p.includes("/integrations/");
|
|
9584
|
+
});
|
|
9585
|
+
console.error(`[VasperaPM] File discovery: ${allFiles.length} total, ${files.length} selected (${libFiles.length} lib/, ${libSubdirFiles.length} telemetry/analytics/integrations)`);
|
|
9554
9586
|
} catch {
|
|
9555
9587
|
}
|
|
9556
9588
|
return files;
|
|
@@ -10138,8 +10170,21 @@ ${repoPath ? "You are analyzing ACTUAL code files with AST-extracted structure I
|
|
|
10138
10170
|
Strictness: ${strictnessGuide[strictness]}
|
|
10139
10171
|
Validation Types: ${checkTypes.join(", ")}
|
|
10140
10172
|
|
|
10173
|
+
IMPORTANT - Where to look for implementations:
|
|
10174
|
+
1. **Library directories** (lib/, src/lib/): Core implementations often live here without direct UI exposure
|
|
10175
|
+
- lib/telemetry/ - Datadog, Sentry, monitoring integrations
|
|
10176
|
+
- lib/analytics/ - Cross-repo analysis, incident replay, custom lenses
|
|
10177
|
+
- lib/integrations/ - Third-party service clients
|
|
10178
|
+
2. **API routes** (api/, routes/): Backend endpoints
|
|
10179
|
+
3. **Components** (components/): UI implementations
|
|
10180
|
+
4. **Services** (services/): Business logic
|
|
10181
|
+
|
|
10182
|
+
DO NOT mark a requirement as "not_met" or "partial" just because there's no UI component -
|
|
10183
|
+
many requirements are satisfied by library-level implementations that are called by other code.
|
|
10184
|
+
Look for exported functions, classes, and types that fulfill the requirement's functionality.
|
|
10185
|
+
|
|
10141
10186
|
CRITICAL: The code has been parsed with line numbers in [L##] format. USE THESE EXACT LINE NUMBERS in your evidence!
|
|
10142
|
-
- File path where it's implemented (e.g., "
|
|
10187
|
+
- File path where it's implemented (e.g., "lib/telemetry/datadog.ts")
|
|
10143
10188
|
- Line numbers FROM THE AST (e.g., if you see "createUser [L42-67]" use lines 42-67)
|
|
10144
10189
|
- Code snippet quotes showing the implementation
|
|
10145
10190
|
|
|
@@ -28492,7 +28537,7 @@ var init_server = __esm({
|
|
|
28492
28537
|
init_tools();
|
|
28493
28538
|
init_dist();
|
|
28494
28539
|
init_tasks();
|
|
28495
|
-
VERSION6 = true ? "2.12.
|
|
28540
|
+
VERSION6 = true ? "2.12.16" : "2.12.0";
|
|
28496
28541
|
stats = getToolStats();
|
|
28497
28542
|
console.error(`[VasperaPM] Server initializing with ${stats.count} tools registered`);
|
|
28498
28543
|
validation = validateToolsAtStartup();
|
|
@@ -32014,7 +32059,7 @@ var BANNER = `
|
|
|
32014
32059
|
\u2551 \u2551
|
|
32015
32060
|
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\x1B[0m
|
|
32016
32061
|
`;
|
|
32017
|
-
var VERSION7 = true ? "2.12.
|
|
32062
|
+
var VERSION7 = true ? "2.12.16" : "2.12.0";
|
|
32018
32063
|
var HELP = `
|
|
32019
32064
|
\x1B[1mUsage:\x1B[0m npx vaspera-pm [command] [options]
|
|
32020
32065
|
|
|
@@ -32072,7 +32117,12 @@ var HELP = `
|
|
|
32072
32117
|
https://github.com/rcolkitt/VasperaPM
|
|
32073
32118
|
`;
|
|
32074
32119
|
function getClaudeConfigPath() {
|
|
32075
|
-
|
|
32120
|
+
if (process.platform === "darwin") {
|
|
32121
|
+
return join23(homedir2(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
32122
|
+
} else if (process.platform === "win32") {
|
|
32123
|
+
return join23(process.env.APPDATA || homedir2(), "Claude", "claude_desktop_config.json");
|
|
32124
|
+
}
|
|
32125
|
+
return join23(homedir2(), ".config", "Claude", "claude_desktop_config.json");
|
|
32076
32126
|
}
|
|
32077
32127
|
function getProjectMcpConfigPath() {
|
|
32078
32128
|
return join23(process.cwd(), ".mcp.json");
|