vaspera-pm 2.10.1 → 2.10.3

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 CHANGED
@@ -292,11 +292,13 @@ async function validateApiKey(apiKey) {
292
292
  }
293
293
  };
294
294
  }
295
+ const errorMessage = error2 instanceof Error ? error2.message : "Unknown error";
296
+ const isNetworkError = errorMessage.includes("ECONNREFUSED") || errorMessage.includes("ENOTFOUND") || errorMessage.includes("fetch failed") || errorMessage.includes("network");
295
297
  return {
296
298
  valid: false,
297
299
  error: {
298
- code: "VPM-INTERNAL-001",
299
- message: "Failed to validate API key. Please try again."
300
+ code: isNetworkError ? "VPM-NETWORK-001" : "VPM-INTERNAL-001",
301
+ message: isNetworkError ? "Unable to reach VasperaPM servers. Check your internet connection or try again later." : `API key validation failed: ${errorMessage}`
300
302
  }
301
303
  };
302
304
  }
@@ -31713,7 +31715,7 @@ var BANNER = `
31713
31715
  \u2551 \u2551
31714
31716
  \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
31715
31717
  `;
31716
- var VERSION7 = true ? "2.10.1" : "2.3.1";
31718
+ var VERSION7 = true ? "2.10.3" : "2.3.1";
31717
31719
  var HELP = `
31718
31720
  \x1B[1mUsage:\x1B[0m vaspera-pm <command> [path] [options]
31719
31721
 
@@ -31780,6 +31782,57 @@ function getProjectMcpConfigPath() {
31780
31782
  function getVasperaConfigPath() {
31781
31783
  return join23(homedir2(), ".vasperapm", "config.json");
31782
31784
  }
31785
+ var VASPERA_PM_INSTRUCTIONS = `
31786
+ # VasperaPM Integration
31787
+
31788
+ This project uses VasperaPM for AI-powered product management.
31789
+
31790
+ ## Available MCP Tools
31791
+ When VasperaPM MCP server is connected, you have access to these tools:
31792
+ - \`synthesize_requirements\` - Extract requirements from documents
31793
+ - \`infer_prd_from_code\` - Reverse-engineer PRD from code
31794
+ - \`verify_docs_code\` - Detect documentation drift
31795
+ - \`generate_api_docs\` - Create OpenAPI specifications
31796
+ - \`generate_test_specs\` - Generate test plans
31797
+ - \`sync_to_tracker\` - Export to Jira/Linear/GitHub/ADO
31798
+ - \`explode_backlog\` - Break features into user stories
31799
+ - \`review_prd\` - Quality review PRDs
31800
+
31801
+ ## Usage Tips
31802
+ - Use \`verify_docs_code\` to check if documentation is in sync with code
31803
+ - Use \`generate_api_docs\` to auto-generate API documentation
31804
+ - Use \`sync_to_tracker\` to export requirements to your project tracker
31805
+ `;
31806
+ function updateProjectInstructions(projectId) {
31807
+ const cwd = process.cwd();
31808
+ const claudeMdPath = join23(cwd, "CLAUDE.md");
31809
+ const cursorRulesPath = join23(cwd, ".cursorrules");
31810
+ let targetFile;
31811
+ let existingContent = null;
31812
+ if (existsSync19(claudeMdPath)) {
31813
+ targetFile = claudeMdPath;
31814
+ existingContent = readFileSync15(claudeMdPath, "utf-8");
31815
+ } else if (existsSync19(cursorRulesPath)) {
31816
+ targetFile = cursorRulesPath;
31817
+ existingContent = readFileSync15(cursorRulesPath, "utf-8");
31818
+ } else {
31819
+ targetFile = claudeMdPath;
31820
+ }
31821
+ if (existingContent?.includes("# VasperaPM Integration")) {
31822
+ return { updated: false, file: targetFile, action: "Skipped" };
31823
+ }
31824
+ const projectSection = `
31825
+ ## Project ID
31826
+ \`${projectId}\`
31827
+ `;
31828
+ const newContent = existingContent ? existingContent.trimEnd() + "\n\n---\n" + VASPERA_PM_INSTRUCTIONS + projectSection : VASPERA_PM_INSTRUCTIONS.trim() + projectSection;
31829
+ writeFileSync6(targetFile, newContent);
31830
+ return {
31831
+ updated: true,
31832
+ file: targetFile.split("/").pop() || targetFile,
31833
+ action: existingContent ? "Updated" : "Created"
31834
+ };
31835
+ }
31783
31836
  function detectMcpConfigLocations() {
31784
31837
  const locations = [
31785
31838
  { path: getCursorConfigPath(), name: "Cursor (global)" },
@@ -31986,7 +32039,7 @@ async function install() {
31986
32039
  console.log(" To manually configure MCP, add this to your mcp.json:\n");
31987
32040
  console.log(' \x1B[36m"vaspera-pm": {\x1B[0m');
31988
32041
  console.log(' \x1B[36m "command": "npx",\x1B[0m');
31989
- console.log(' \x1B[36m "args": ["-y", "vaspera-pm@latest"],\x1B[0m');
32042
+ console.log(' \x1B[36m "args": ["-y", "vaspera-pm@latest", "serve"],\x1B[0m');
31990
32043
  console.log(' \x1B[36m "env": {\x1B[0m');
31991
32044
  if (vasperaApiKey) {
31992
32045
  console.log(` \x1B[36m "VASPERA_API_KEY": "${vasperaApiKey}"\x1B[0m`);
@@ -32205,6 +32258,10 @@ async function connect() {
32205
32258
  success("Added .vaspera/ to .gitignore");
32206
32259
  }
32207
32260
  }
32261
+ const claudeMdResult = updateProjectInstructions(projectId);
32262
+ if (claudeMdResult.updated) {
32263
+ success(`${claudeMdResult.action} ${claudeMdResult.file} with VasperaPM context`);
32264
+ }
32208
32265
  console.log("\n");
32209
32266
  success("Project connected successfully!");
32210
32267
  console.log("\n\x1B[1mConfiguration saved to:\x1B[0m .vaspera/config.json");