@vibescope/mcp-server 0.4.0 → 0.4.2

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.
Files changed (70) hide show
  1. package/dist/api-client/fallback.d.ts +33 -0
  2. package/dist/api-client/fallback.js +21 -0
  3. package/dist/api-client/findings.d.ts +69 -0
  4. package/dist/api-client/findings.js +36 -0
  5. package/dist/api-client/index.d.ts +78 -1
  6. package/dist/api-client/index.js +74 -4
  7. package/dist/api-client/milestones.d.ts +59 -0
  8. package/dist/api-client/milestones.js +30 -0
  9. package/dist/api-client/validation.d.ts +35 -0
  10. package/dist/api-client/validation.js +23 -0
  11. package/dist/api-client.d.ts +4 -0
  12. package/dist/cli-init.d.ts +17 -0
  13. package/dist/cli-init.js +497 -0
  14. package/dist/handlers/cloud-agents.d.ts +4 -0
  15. package/dist/handlers/cloud-agents.js +26 -12
  16. package/dist/handlers/discovery.js +15 -0
  17. package/dist/handlers/findings.js +1 -1
  18. package/dist/handlers/ideas.js +1 -1
  19. package/dist/handlers/index.d.ts +1 -0
  20. package/dist/handlers/index.js +3 -0
  21. package/dist/handlers/session.js +115 -2
  22. package/dist/handlers/tasks.js +7 -5
  23. package/dist/handlers/tool-docs.js +344 -0
  24. package/dist/handlers/version.d.ts +5 -0
  25. package/dist/handlers/version.js +53 -0
  26. package/dist/index.js +7 -0
  27. package/dist/templates/agent-guidelines.d.ts +3 -1
  28. package/dist/templates/agent-guidelines.js +5 -1
  29. package/dist/templates/help-content.js +2 -2
  30. package/dist/tools/chat.d.ts +7 -0
  31. package/dist/tools/chat.js +43 -0
  32. package/dist/tools/cloud-agents.js +31 -0
  33. package/dist/tools/index.d.ts +3 -1
  34. package/dist/tools/index.js +6 -1
  35. package/dist/tools/project.js +1 -1
  36. package/dist/tools/tasks.js +8 -0
  37. package/dist/tools/version.d.ts +5 -0
  38. package/dist/tools/version.js +28 -0
  39. package/dist/version.d.ts +28 -0
  40. package/dist/version.js +91 -0
  41. package/docs/TOOLS.md +93 -3
  42. package/package.json +4 -2
  43. package/src/api-client/fallback.ts +52 -0
  44. package/src/api-client/findings.ts +100 -0
  45. package/src/api-client/index.ts +91 -9
  46. package/src/api-client/milestones.ts +83 -0
  47. package/src/api-client/validation.ts +60 -0
  48. package/src/api-client.ts +4 -0
  49. package/src/cli-init.ts +557 -0
  50. package/src/handlers/cloud-agents.test.ts +438 -0
  51. package/src/handlers/cloud-agents.ts +35 -17
  52. package/src/handlers/discovery.ts +15 -0
  53. package/src/handlers/findings.ts +1 -1
  54. package/src/handlers/ideas.ts +1 -1
  55. package/src/handlers/index.ts +3 -0
  56. package/src/handlers/session.ts +128 -2
  57. package/src/handlers/tasks.ts +7 -5
  58. package/src/handlers/tool-docs.test.ts +511 -0
  59. package/src/handlers/tool-docs.ts +382 -0
  60. package/src/handlers/version.ts +63 -0
  61. package/src/index.ts +9 -0
  62. package/src/templates/agent-guidelines.ts +6 -1
  63. package/src/templates/help-content.ts +2 -2
  64. package/src/tools/chat.ts +46 -0
  65. package/src/tools/cloud-agents.ts +31 -0
  66. package/src/tools/index.ts +6 -0
  67. package/src/tools/project.ts +1 -1
  68. package/src/tools/tasks.ts +8 -0
  69. package/src/tools/version.ts +34 -0
  70. package/src/version.ts +109 -0
package/src/version.ts ADDED
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Version checking utilities
3
+ *
4
+ * Compares the locally installed version against the latest published
5
+ * version on npm to detect available updates.
6
+ */
7
+
8
+ import { readFileSync } from 'fs';
9
+ import { resolve, dirname } from 'path';
10
+ import { fileURLToPath } from 'url';
11
+
12
+ const NPM_REGISTRY_URL = 'https://registry.npmjs.org/@vibescope/mcp-server';
13
+ const PACKAGE_NAME = '@vibescope/mcp-server';
14
+
15
+ export interface VersionInfo {
16
+ current: string;
17
+ latest: string | null;
18
+ updateAvailable: boolean;
19
+ error?: string;
20
+ }
21
+
22
+ /**
23
+ * Get the current locally installed version from package.json
24
+ */
25
+ export function getLocalVersion(): string {
26
+ try {
27
+ const __dirname = dirname(fileURLToPath(import.meta.url));
28
+ const pkgPath = resolve(__dirname, '..', 'package.json');
29
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
30
+ return pkg.version;
31
+ } catch {
32
+ return 'unknown';
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Fetch the latest published version from npm registry
38
+ */
39
+ export async function getLatestVersion(): Promise<string | null> {
40
+ try {
41
+ const controller = new AbortController();
42
+ const timeout = setTimeout(() => controller.abort(), 5000);
43
+
44
+ const response = await fetch(`${NPM_REGISTRY_URL}/latest`, {
45
+ signal: controller.signal,
46
+ headers: { 'Accept': 'application/json' },
47
+ });
48
+
49
+ clearTimeout(timeout);
50
+
51
+ if (!response.ok) return null;
52
+
53
+ const data = (await response.json()) as { version?: string };
54
+ return data.version ?? null;
55
+ } catch {
56
+ return null;
57
+ }
58
+ }
59
+
60
+ /**
61
+ * Compare semver strings. Returns true if latest > current.
62
+ */
63
+ function isNewer(current: string, latest: string): boolean {
64
+ const parse = (v: string) => v.split('.').map(Number);
65
+ const c = parse(current);
66
+ const l = parse(latest);
67
+
68
+ for (let i = 0; i < 3; i++) {
69
+ if ((l[i] ?? 0) > (c[i] ?? 0)) return true;
70
+ if ((l[i] ?? 0) < (c[i] ?? 0)) return false;
71
+ }
72
+ return false;
73
+ }
74
+
75
+ /**
76
+ * Check if an update is available
77
+ */
78
+ export async function checkVersion(): Promise<VersionInfo> {
79
+ const current = getLocalVersion();
80
+ const latest = await getLatestVersion();
81
+
82
+ if (!latest) {
83
+ return {
84
+ current,
85
+ latest: null,
86
+ updateAvailable: false,
87
+ error: 'Could not reach npm registry to check for updates',
88
+ };
89
+ }
90
+
91
+ return {
92
+ current,
93
+ latest,
94
+ updateAvailable: isNewer(current, latest),
95
+ };
96
+ }
97
+
98
+ /**
99
+ * Get the update warning message for server instructions, or null if up to date
100
+ */
101
+ export async function getUpdateWarning(): Promise<string | null> {
102
+ const info = await checkVersion();
103
+
104
+ if (info.updateAvailable && info.latest) {
105
+ return `⚠️ UPDATE AVAILABLE: Vibescope MCP server v${info.current} is outdated. Latest version is v${info.latest}. Before starting work, inform the user that an update is available and recommend running the \`check_mcp_version\` tool, or ask them to update with: npm install -g ${PACKAGE_NAME}@latest (or npx @vibescope/mcp-server@latest for auto-update on next run).`;
106
+ }
107
+
108
+ return null;
109
+ }