@agentistics/mcp 2.131.0 → 2.132.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.
@@ -1083,7 +1083,7 @@ function routeRecommendation(budgets, kind, authorHarness) {
1083
1083
  ...selected?.[1] ? { model: selected[1] } : {},
1084
1084
  reason: `${pick.harness} is the preferred eligible plan for ${kind}.${paceText}`,
1085
1085
  alternatives,
1086
- cadence: { parallel: pick.suggestedParallel ?? 1, note: pick.note ?? "Keep one worker running." }
1086
+ cadence: { parallel: pick.freeSlotsMeasured ? pick.freeSlots ?? 0 : pick.suggestedParallel ?? 1, note: pick.note ?? "Keep one worker running." }
1087
1087
  };
1088
1088
  }
1089
1089
  var NEW_PERIOD_MS = 5 * 60000;
@@ -1476,7 +1476,15 @@ function sessionProof(env, readKey = (p) => readFileSync(p, "utf8"), readProc =
1476
1476
  function planLimitsTool(args, body) {
1477
1477
  const budgets = body.budgets ?? [];
1478
1478
  const recommendation = args?.kind ? routeRecommendation(budgets, args.kind, args.authorHarness) : undefined;
1479
- return { budgets, ...recommendation ? { recommendation } : {}, readAt: body.now ?? Date.now() };
1479
+ return {
1480
+ budgets,
1481
+ freeSlots: body.freeSlots ?? (budgets.length ? Math.max(...budgets.map((b) => b.freeSlots ?? 0)) : 0),
1482
+ freeSlotsByHarness: body.freeSlotsByHarness ?? Object.fromEntries(budgets.map((b) => [b.harness, b.freeSlots ?? 0])),
1483
+ liveSessions: body.liveSessions ?? budgets.flatMap((b) => b.liveSessions ?? []).filter((s, i, all) => all.findIndex((x) => x.id === s.id) === i),
1484
+ ...body.pauseUntil !== undefined ? { pauseUntil: body.pauseUntil } : {},
1485
+ ...recommendation ? { recommendation } : {},
1486
+ readAt: body.now ?? Date.now()
1487
+ };
1480
1488
  }
1481
1489
 
1482
1490
  // legacy-analytics.ts
@@ -2723,7 +2731,7 @@ async function callTool(req) {
2723
2731
  const body = await apiSend("POST", "/api/session-roles", {
2724
2732
  ...a?.ref ? { ref: a.ref } : {},
2725
2733
  ...a?.role !== undefined ? { role: a.role } : {},
2726
- session: sessionProof(process.env)
2734
+ session: sessionProof(process.env) ?? null
2727
2735
  });
2728
2736
  return { content: [{ type: "text", text: JSON.stringify(body, null, 2) }] };
2729
2737
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentistics/mcp",
3
- "version": "2.131.0",
3
+ "version": "2.132.1",
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",