@hasna/mcps 0.0.11 → 0.0.12

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/bin/index.js CHANGED
@@ -19288,7 +19288,7 @@ var init_sources = __esm(() => {
19288
19288
  var require_package = __commonJS((exports, module) => {
19289
19289
  module.exports = {
19290
19290
  name: "@hasna/mcps",
19291
- version: "0.0.11",
19291
+ version: "0.0.12",
19292
19292
  description: "Meta-MCP registry & CLI \u2014 discover, manage, and proxy MCP servers",
19293
19293
  type: "module",
19294
19294
  main: "dist/index.js",
@@ -21011,8 +21011,6 @@ import React10 from "react";
21011
21011
  import { render } from "ink";
21012
21012
  import chalk2 from "chalk";
21013
21013
  import { readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "fs";
21014
- import { join as join12, dirname as dirname5 } from "path";
21015
- import { fileURLToPath as fileURLToPath3 } from "url";
21016
21014
 
21017
21015
  // src/lib/registry.ts
21018
21016
  init_db();
@@ -37986,23 +37984,40 @@ class StdioServerTransport {
37986
37984
 
37987
37985
  // src/mcp/index.ts
37988
37986
  init_dist();
37989
- import { readFileSync as readFileSync5 } from "fs";
37990
- import { join as join10, dirname as dirname3 } from "path";
37991
- import { fileURLToPath } from "url";
37992
37987
  init_sources();
37993
37988
  init_config2();
37994
37989
  init_db();
37990
+
37991
+ // src/lib/version.ts
37992
+ import { existsSync as existsSync9, readFileSync as readFileSync5 } from "fs";
37993
+ import { dirname as dirname3, join as join10 } from "path";
37994
+ import { fileURLToPath } from "url";
37995
+ var FALLBACK_VERSION = "0.0.1";
37996
+ function readPackageVersion(moduleUrl, fallback = FALLBACK_VERSION) {
37997
+ const baseDir = dirname3(fileURLToPath(moduleUrl));
37998
+ const candidates = [
37999
+ join10(baseDir, "..", "..", "package.json"),
38000
+ join10(baseDir, "..", "package.json"),
38001
+ join10(baseDir, "package.json")
38002
+ ];
38003
+ for (const candidate of candidates) {
38004
+ if (!existsSync9(candidate))
38005
+ continue;
38006
+ try {
38007
+ const pkg = JSON.parse(readFileSync5(candidate, "utf-8"));
38008
+ if (pkg.version)
38009
+ return pkg.version;
38010
+ } catch {}
38011
+ }
38012
+ return fallback;
38013
+ }
38014
+
38015
+ // src/mcp/index.ts
37995
38016
  function redactServerEnv(server) {
37996
38017
  return { ...server, env: {} };
37997
38018
  }
37998
38019
  var VERSION = (() => {
37999
- try {
38000
- const pkgPath = join10(dirname3(fileURLToPath(import.meta.url)), "..", "..", "package.json");
38001
- const pkg = JSON.parse(readFileSync5(pkgPath, "utf-8"));
38002
- return pkg.version || "0.0.1";
38003
- } catch {
38004
- return "0.0.1";
38005
- }
38020
+ return readPackageVersion(import.meta.url);
38006
38021
  })();
38007
38022
  var server = new McpServer({
38008
38023
  name: "mcps",
@@ -38465,7 +38480,7 @@ if (isDirectRun) {
38465
38480
  }
38466
38481
 
38467
38482
  // src/server/serve.ts
38468
- import { existsSync as existsSync9 } from "fs";
38483
+ import { existsSync as existsSync10 } from "fs";
38469
38484
  import { join as join11, dirname as dirname4, extname, resolve, relative as relative2, sep } from "path";
38470
38485
  import { fileURLToPath as fileURLToPath2 } from "url";
38471
38486
  init_sources();
@@ -38487,7 +38502,7 @@ function resolveDashboardDir() {
38487
38502
  }
38488
38503
  candidates.push(join11(process.cwd(), "dashboard", "dist"));
38489
38504
  for (const candidate of candidates) {
38490
- if (existsSync9(candidate))
38505
+ if (existsSync10(candidate))
38491
38506
  return candidate;
38492
38507
  }
38493
38508
  return join11(process.cwd(), "dashboard", "dist");
@@ -38578,7 +38593,7 @@ function getAllServersWithToolCount() {
38578
38593
  }));
38579
38594
  }
38580
38595
  function serveStaticFile(filePath) {
38581
- if (!existsSync9(filePath))
38596
+ if (!existsSync10(filePath))
38582
38597
  return null;
38583
38598
  const ext = extname(filePath);
38584
38599
  const contentType = MIME_TYPES[ext] || "application/octet-stream";
@@ -38611,7 +38626,7 @@ async function startServer(port, options) {
38611
38626
  const host = options?.host ?? "127.0.0.1";
38612
38627
  getDb();
38613
38628
  const dashboardDir = resolveDashboardDir();
38614
- const dashboardExists = existsSync9(dashboardDir);
38629
+ const dashboardExists = existsSync10(dashboardDir);
38615
38630
  if (!dashboardExists) {
38616
38631
  console.error(`
38617
38632
  Dashboard not found at: ${dashboardDir}`);
@@ -40093,13 +40108,7 @@ function App() {
40093
40108
 
40094
40109
  // src/cli/index.tsx
40095
40110
  var VERSION2 = (() => {
40096
- try {
40097
- const pkgPath = join12(dirname5(fileURLToPath3(import.meta.url)), "..", "..", "package.json");
40098
- const pkg = JSON.parse(readFileSync6(pkgPath, "utf-8"));
40099
- return pkg.version || "0.0.1";
40100
- } catch {
40101
- return "0.0.1";
40102
- }
40111
+ return readPackageVersion(import.meta.url);
40103
40112
  })();
40104
40113
  var MACHINE_PLATFORMS = ["linux", "darwin", "unknown"];
40105
40114
  var MACHINE_ARCHES = ["arm64", "x64", "unknown"];
package/bin/mcp.js CHANGED
@@ -30508,9 +30508,6 @@ class StdioServerTransport {
30508
30508
 
30509
30509
  // src/mcp/index.ts
30510
30510
  init_dist();
30511
- import { readFileSync as readFileSync5 } from "fs";
30512
- import { join as join10, dirname as dirname3 } from "path";
30513
- import { fileURLToPath } from "url";
30514
30511
 
30515
30512
  // src/lib/registry.ts
30516
30513
  init_db();
@@ -34373,18 +34370,36 @@ async function runFleetInstall(options = {}, dependencies = {}) {
34373
34370
  }));
34374
34371
  }
34375
34372
 
34373
+ // src/lib/version.ts
34374
+ import { existsSync as existsSync9, readFileSync as readFileSync5 } from "fs";
34375
+ import { dirname as dirname3, join as join10 } from "path";
34376
+ import { fileURLToPath } from "url";
34377
+ var FALLBACK_VERSION = "0.0.1";
34378
+ function readPackageVersion(moduleUrl, fallback = FALLBACK_VERSION) {
34379
+ const baseDir = dirname3(fileURLToPath(moduleUrl));
34380
+ const candidates = [
34381
+ join10(baseDir, "..", "..", "package.json"),
34382
+ join10(baseDir, "..", "package.json"),
34383
+ join10(baseDir, "package.json")
34384
+ ];
34385
+ for (const candidate of candidates) {
34386
+ if (!existsSync9(candidate))
34387
+ continue;
34388
+ try {
34389
+ const pkg = JSON.parse(readFileSync5(candidate, "utf-8"));
34390
+ if (pkg.version)
34391
+ return pkg.version;
34392
+ } catch {}
34393
+ }
34394
+ return fallback;
34395
+ }
34396
+
34376
34397
  // src/mcp/index.ts
34377
34398
  function redactServerEnv(server) {
34378
34399
  return { ...server, env: {} };
34379
34400
  }
34380
34401
  var VERSION = (() => {
34381
- try {
34382
- const pkgPath = join10(dirname3(fileURLToPath(import.meta.url)), "..", "..", "package.json");
34383
- const pkg = JSON.parse(readFileSync5(pkgPath, "utf-8"));
34384
- return pkg.version || "0.0.1";
34385
- } catch {
34386
- return "0.0.1";
34387
- }
34402
+ return readPackageVersion(import.meta.url);
34388
34403
  })();
34389
34404
  var server = new McpServer({
34390
34405
  name: "mcps",
package/dist/index.d.ts CHANGED
@@ -11,5 +11,6 @@ export type { AgentTarget, InstallResult } from "./lib/install.js";
11
11
  export type { McpSource, AddSourceOptions } from "./types.js";
12
12
  export { addMachine, upsertMachine, listMachines, getMachine, updateMachine, removeMachine, seedDefaultMachines, DEFAULT_MACHINE_SEEDS, } from "./lib/machines.js";
13
13
  export { listHasnaMcpCatalog, runFleetHealthCheck, runFleetInstall } from "./lib/fleet.js";
14
+ export { readPackageVersion } from "./lib/version.js";
14
15
  export { connectToServer, disconnectServer, listAllTools, callTool, refreshTools, disconnectAll, } from "./lib/proxy.js";
15
16
  export { getDb, closeDb } from "./lib/db.js";
package/dist/index.js CHANGED
@@ -26404,6 +26404,29 @@ async function runFleetInstall(options = {}, dependencies = {}) {
26404
26404
  }
26405
26405
  }));
26406
26406
  }
26407
+ // src/lib/version.ts
26408
+ import { existsSync as existsSync9, readFileSync as readFileSync5 } from "fs";
26409
+ import { dirname as dirname3, join as join10 } from "path";
26410
+ import { fileURLToPath } from "url";
26411
+ var FALLBACK_VERSION = "0.0.1";
26412
+ function readPackageVersion(moduleUrl, fallback = FALLBACK_VERSION) {
26413
+ const baseDir = dirname3(fileURLToPath(moduleUrl));
26414
+ const candidates = [
26415
+ join10(baseDir, "..", "..", "package.json"),
26416
+ join10(baseDir, "..", "package.json"),
26417
+ join10(baseDir, "package.json")
26418
+ ];
26419
+ for (const candidate of candidates) {
26420
+ if (!existsSync9(candidate))
26421
+ continue;
26422
+ try {
26423
+ const pkg = JSON.parse(readFileSync5(candidate, "utf-8"));
26424
+ if (pkg.version)
26425
+ return pkg.version;
26426
+ } catch {}
26427
+ }
26428
+ return fallback;
26429
+ }
26407
26430
 
26408
26431
  // src/index.ts
26409
26432
  init_db();
@@ -26421,6 +26444,7 @@ export {
26421
26444
  removeServer,
26422
26445
  removeMachine,
26423
26446
  refreshTools,
26447
+ readPackageVersion,
26424
26448
  listSources,
26425
26449
  listServers,
26426
26450
  listMachines,
@@ -0,0 +1 @@
1
+ export declare function readPackageVersion(moduleUrl: string, fallback?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/mcps",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Meta-MCP registry & CLI — discover, manage, and proxy MCP servers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",