@agentistics/mcp 2.103.1 → 2.104.0

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.
@@ -82,6 +82,15 @@ var HARNESS_SORT = {
82
82
  };
83
83
  var HARNESS_ORDER = Object.keys(HARNESS_SORT).sort((a, b) => HARNESS_SORT[a] - HARNESS_SORT[b]);
84
84
  var SURFACE_HARNESS_ORDER = [...HARNESS_ORDER, NATIVE_HARNESS_ID];
85
+ function surfaceHarnesses(nativeVisible) {
86
+ return nativeVisible ? SURFACE_HARNESS_ORDER : SURFACE_HARNESS_ORDER.filter((h) => h !== NATIVE_HARNESS_ID);
87
+ }
88
+ function nativeVisibleFrom(status) {
89
+ if (!status || typeof status !== "object")
90
+ return false;
91
+ const s = status;
92
+ return s.present === true && s.manifest?.provides?.nativeRuntime === true && s.nativeExperimental === true;
93
+ }
85
94
  function canonicalProjectPath(path) {
86
95
  if (!path)
87
96
  return path;
@@ -1065,13 +1074,26 @@ function statsCacheTotals(sc) {
1065
1074
  }
1066
1075
  return { ...b, tokens: totalTokens(b), cost, topModel: top?.model ?? null };
1067
1076
  }
1068
- function harnessParam() {
1077
+ function harnessIds(nativeVisible) {
1078
+ return surfaceHarnesses(nativeVisible);
1079
+ }
1080
+ function harnessParam(nativeVisible) {
1081
+ const ids = harnessIds(nativeVisible);
1069
1082
  return {
1070
1083
  type: "string",
1071
- enum: ["all", ...SURFACE_HARNESS_ORDER],
1072
- description: `Scope to one harness (${SURFACE_HARNESS_ORDER.join(" | ")}), or 'all' (default) for the unified view across every harness.`
1084
+ enum: ["all", ...ids],
1085
+ description: `Scope to one harness (${ids.join(" | ")}), or 'all' (default) for the unified view across every harness.`
1073
1086
  };
1074
1087
  }
1088
+ function toolsForGate(tools, nativeVisible) {
1089
+ const param = harnessParam(nativeVisible);
1090
+ return tools.map((t) => {
1091
+ const props = t.inputSchema.properties;
1092
+ if (!props || !("harness" in props))
1093
+ return t;
1094
+ return { ...t, inputSchema: { ...t.inputSchema, properties: { ...props, harness: param } } };
1095
+ });
1096
+ }
1075
1097
 
1076
1098
  // agent-audit.ts
1077
1099
  import { createHash } from "node:crypto";
@@ -1630,7 +1652,15 @@ var PROJECTED_TOOLS = {
1630
1652
 
1631
1653
  // agentistics-mcp.ts
1632
1654
  var API = process.env.AGENTISTICS_API ?? "http://localhost:47291";
1633
- var HARNESS_PARAM = harnessParam();
1655
+ var HARNESS_PARAM = harnessParam(false);
1656
+ async function nativeVisibleNow() {
1657
+ try {
1658
+ const res = await fetch(`${API}/api/engine`, { signal: AbortSignal.timeout(2000) });
1659
+ return res.ok ? nativeVisibleFrom(await res.json()) : false;
1660
+ } catch {
1661
+ return false;
1662
+ }
1663
+ }
1634
1664
  var CATALOG = [
1635
1665
  { id: "kpi.messages", label: "Messages", category: "kpi", defaultW: 3, defaultH: 3, minW: 2, minH: 2, description: "Total message count in selected period" },
1636
1666
  { id: "kpi.sessions", label: "Sessions", category: "kpi", defaultW: 3, defaultH: 3, minW: 2, minH: 2, description: "Session count + avg msgs/session" },
@@ -2266,7 +2296,7 @@ var TOOLS = [
2266
2296
  inputSchema: { type: "object", properties: {}, required: [] }
2267
2297
  }
2268
2298
  ];
2269
- server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
2299
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: toolsForGate(TOOLS, await nativeVisibleNow()) }));
2270
2300
  var audit = createAgentAuditSink();
2271
2301
  process.on("exit", () => audit.flush());
2272
2302
  for (const sig of ["SIGINT", "SIGTERM"]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentistics/mcp",
3
- "version": "2.103.1",
3
+ "version": "2.104.0",
4
4
  "description": "Agentistics MCP server — Claude Code analytics for Claude Desktop and Claude Code",
5
5
  "type": "module",
6
6
  "main": "./dist/agentistics-mcp.js",