zopkit-bug-resolution-mcp 1.9.0 → 1.9.1

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.
@@ -35,7 +35,7 @@
35
35
  import { readFileSync, writeFileSync, mkdirSync } from 'node:fs';
36
36
  import { join } from 'node:path';
37
37
  import { homedir, tmpdir } from 'node:os';
38
- import { loadConfig, post, readStdinJson, readClaudeAccount } from '../lib/zopkit-config.js';
38
+ import { loadConfig, post, readStdinJson, readClaudeAccount, reporterVersion } from '../lib/zopkit-config.js';
39
39
 
40
40
  // Per-session throttle. The status line fires on every assistant message; a
41
41
  // 40-turn session would otherwise be 40 POSTs. 15s keeps the panel's 10s
@@ -94,6 +94,9 @@ function buildHeartbeat(p, cfg, fresh) {
94
94
  sessionName: cfg.shareSessionName ? (p.session_name ?? null) : null,
95
95
  model: p.model?.id ?? null,
96
96
  version: p.version ?? null,
97
+ // This reporter's version, so the server can tell "old client" apart
98
+ // from "nothing to report" — they produce identical rows otherwise.
99
+ reporterVersion: reporterVersion(),
97
100
 
98
101
  contextTokens: p.context_window?.total_input_tokens ?? null,
99
102
  contextLimit: p.context_window?.context_window_size ?? null,
package/index.js CHANGED
@@ -91,7 +91,7 @@ if (!API_KEY) {
91
91
  'Generate one from the company-admin panel (Bug Reports → API Keys) and set it when registering this server.');
92
92
  }
93
93
 
94
- const server = new McpServer({ name: 'zopkit-bug-resolution', version: '1.9.0' });
94
+ const server = new McpServer({ name: 'zopkit-bug-resolution', version: '1.9.1' });
95
95
 
96
96
  const BUG_SEVERITIES = ['low', 'medium', 'high', 'critical'];
97
97
  // Keep in sync with BUG_STATUSES in backend/src/db/schema/platform/bug-reports.ts.
@@ -16,11 +16,36 @@
16
16
  // Create it with: npx zopkit-bug-resolution-mcp --init-usage-reporting
17
17
 
18
18
  import { readFileSync } from 'node:fs';
19
- import { join } from 'node:path';
19
+ import { join, dirname } from 'node:path';
20
20
  import { homedir } from 'node:os';
21
+ import { fileURLToPath } from 'node:url';
21
22
 
22
23
  export const CONFIG_PATH = join(homedir(), '.claude', '.zopkit-usage.json');
23
24
 
25
+ /**
26
+ * This reporter's own version, sent with every heartbeat.
27
+ *
28
+ * The server cannot otherwise tell an OLD reporter apart from a machine
29
+ * with nothing to report: a pre-1.9.0 client sends perfect session rows
30
+ * and silently omits the account, which looks identical to a machine that
31
+ * has no signed-in Claude account. Both show up as "not reporting" and
32
+ * need completely different fixes.
33
+ *
34
+ * Read from package.json rather than hardcoded, so it cannot drift from
35
+ * the published version the way a duplicated constant would.
36
+ */
37
+ let versionCache;
38
+ export function reporterVersion() {
39
+ if (versionCache !== undefined) return versionCache;
40
+ try {
41
+ const here = dirname(fileURLToPath(import.meta.url));
42
+ versionCache = JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8')).version ?? null;
43
+ } catch {
44
+ versionCache = null;
45
+ }
46
+ return versionCache;
47
+ }
48
+
24
49
  /**
25
50
  * Which Anthropic account this machine is signed in to.
26
51
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zopkit-bug-resolution-mcp",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "type": "module",
5
5
  "description": "MCP server + status-line/hook reporters for Zopkit wrapper bug reports: fetch full bug context (with screenshots), submit how a bug was fixed, list bugs assigned to you, file new bug reports, and report REAL Claude Code usage \u2014 live per-session context and account rate limits via the status line, plus per-bug token attribution via PostToolUse hooks. Requires a BUG_REPORT_API_KEY (generated in the company-admin panel) \u2014 see README.md.",
6
6
  "license": "UNLICENSED",