@adhdev/daemon-standalone 1.0.42 → 1.0.43

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.
@@ -1,46 +1,5 @@
1
1
  {
2
2
  "name": "@adhdev/mcp-server",
3
- "version": "1.0.42",
4
- "description": "ADHDev MCP server \u2014 expose IDE agents as MCP tools",
5
- "main": "dist/index.js",
6
- "bin": {
7
- "adhdev-mcp": "./dist/index.js"
8
- },
9
- "scripts": {
10
- "build": "tsup",
11
- "dev": "tsx src/index.ts",
12
- "test": "node --import tsx --import ./test/setup-test-env.ts --test test/*.test.ts",
13
- "typecheck": "tsc --noEmit -p tsconfig.json"
14
- },
15
- "files": [
16
- "dist",
17
- "README.md"
18
- ],
19
- "publishConfig": {
20
- "access": "public"
21
- },
22
- "keywords": [
23
- "adhdev",
24
- "mcp",
25
- "model-context-protocol",
26
- "ide-agents"
27
- ],
28
- "author": "vilmire",
29
- "license": "AGPL-3.0-or-later",
30
- "dependencies": {
31
- "@adhdev/daemon-core": "*",
32
- "@modelcontextprotocol/sdk": "^1.0.0"
33
- },
34
- "devDependencies": {
35
- "@types/node": "^22.0.0",
36
- "tsup": "^8.2.0",
37
- "tsx": "^4.19.0",
38
- "typescript": "^5.5.0"
39
- },
40
- "repository": {
41
- "type": "git",
42
- "url": "https://github.com/vilmire/adhdev.git",
43
- "directory": "packages/mcp-server"
44
- },
45
- "homepage": "https://github.com/vilmire/adhdev#readme"
46
- }
3
+ "private": true,
4
+ "main": "./index.js"
5
+ }
@@ -36,7 +36,7 @@ __export(index_exports, {
36
36
  module.exports = __toCommonJS(index_exports);
37
37
  var import_crypto = require("crypto");
38
38
  var fs4 = __toESM(require("fs"));
39
- var path2 = __toESM(require("path"));
39
+ var path3 = __toESM(require("path"));
40
40
  var import_session_host_core6 = require("@adhdev/session-host-core");
41
41
 
42
42
  // src/server.ts
@@ -489,8 +489,18 @@ var SessionHostStorage = class {
489
489
  };
490
490
 
491
491
  // src/session-diagnostics.ts
492
+ var path2 = __toESM(require("path"));
492
493
  var import_session_host_core3 = require("@adhdev/session-host-core");
493
494
  var MAX_RECENT_DIAGNOSTICS = 200;
495
+ function resolveHostEntryPath() {
496
+ const entry = process.argv[1];
497
+ if (typeof entry !== "string" || !entry.trim()) return void 0;
498
+ try {
499
+ return path2.resolve(entry);
500
+ } catch {
501
+ return entry;
502
+ }
503
+ }
494
504
  function pushRecent(bucket, entry, max = MAX_RECENT_DIAGNOSTICS) {
495
505
  bucket.push(entry);
496
506
  if (bucket.length > max) {
@@ -544,6 +554,9 @@ function buildHostDiagnostics(params) {
544
554
  return {
545
555
  hostStartedAt: params.hostStartedAt,
546
556
  endpoint: params.endpointPath,
557
+ // Self-reported so a client can tell WHICH install this host runs from
558
+ // without needing process-inspection privileges. See SessionHostDiagnostics.
559
+ hostEntryPath: resolveHostEntryPath(),
547
560
  runtimeCount: params.runtimeCount,
548
561
  supportedRequestTypes: [...import_session_host_core3.SESSION_HOST_SUPPORTED_REQUEST_TYPES],
549
562
  sessions,
@@ -734,8 +747,8 @@ var SessionHostServer = class extends import_events.EventEmitter {
734
747
  void this.handleIncomingRequest(socket, envelope);
735
748
  }));
736
749
  });
737
- await new Promise((resolve, reject) => {
738
- this.ipcServer?.once("listening", () => resolve());
750
+ await new Promise((resolve2, reject) => {
751
+ this.ipcServer?.once("listening", () => resolve2());
739
752
  this.ipcServer?.once("error", reject);
740
753
  this.ipcServer?.listen(this.endpoint.path);
741
754
  });
@@ -769,7 +782,7 @@ var SessionHostServer = class extends import_events.EventEmitter {
769
782
  if (this.ipcServer) {
770
783
  const server = this.ipcServer;
771
784
  this.ipcServer = null;
772
- await new Promise((resolve) => server.close(() => resolve()));
785
+ await new Promise((resolve2) => server.close(() => resolve2()));
773
786
  }
774
787
  if (this.endpoint.kind === "unix") {
775
788
  try {
@@ -1193,7 +1206,7 @@ var SessionHostServer = class extends import_events.EventEmitter {
1193
1206
  if (!this.runtimes.has(sessionId)) {
1194
1207
  return Promise.resolve(this.registry.getSession(sessionId)?.lifecycle === "failed" ? 1 : 0);
1195
1208
  }
1196
- return new Promise((resolve, reject) => {
1209
+ return new Promise((resolve2, reject) => {
1197
1210
  const timeout = setTimeout(() => {
1198
1211
  const waiters2 = this.exitWaiters.get(sessionId) || [];
1199
1212
  this.exitWaiters.set(sessionId, waiters2.filter((waiter) => waiter !== onExit));
@@ -1201,7 +1214,7 @@ var SessionHostServer = class extends import_events.EventEmitter {
1201
1214
  }, timeoutMs);
1202
1215
  const onExit = (exitCode) => {
1203
1216
  clearTimeout(timeout);
1204
- resolve(exitCode);
1217
+ resolve2(exitCode);
1205
1218
  };
1206
1219
  const waiters = this.exitWaiters.get(sessionId) || [];
1207
1220
  waiters.push(onExit);
@@ -1420,12 +1433,12 @@ function getSessionHostEndpoint() {
1420
1433
  return (0, import_session_host_core6.getDefaultSessionHostEndpoint)(SESSION_HOST_APP_NAME, { ipcKey: INSTANCE_IPC_KEY });
1421
1434
  }
1422
1435
  function getSessionHostStorageRoot() {
1423
- return path2.join(INSTANCE_CONFIG_DIR, "session-host", SESSION_HOST_APP_NAME);
1436
+ return path3.join(INSTANCE_CONFIG_DIR, "session-host", SESSION_HOST_APP_NAME);
1424
1437
  }
1425
1438
  function getSessionHostPidFile(appName) {
1426
1439
  const dir = INSTANCE_CONFIG_DIR;
1427
1440
  if (!fs4.existsSync(dir)) fs4.mkdirSync(dir, { recursive: true });
1428
- return path2.join(dir, `${appName}-session-host.pid`);
1441
+ return path3.join(dir, `${appName}-session-host.pid`);
1429
1442
  }
1430
1443
  function writeSessionHostPid(appName) {
1431
1444
  fs4.writeFileSync(getSessionHostPidFile(appName), String(process.pid), "utf8");