@agentistics/mcp 2.151.0 → 2.151.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.
@@ -1108,10 +1108,9 @@ function pickAccount(candidates) {
1108
1108
  return candidates.map((b, i) => ({ b, i })).sort((x, y) => (x.b.daysToWeekReset > 0 ? x.b.weekResetsAt : Infinity) - (y.b.daysToWeekReset > 0 ? y.b.weekResetsAt : Infinity) || roomOf(x.b) - roomOf(y.b) || (y.b.updatedAt ?? 0) - (x.b.updatedAt ?? 0) || y.i - x.i)[0]?.b;
1109
1109
  }
1110
1110
  function routeRecommendation(budgets, kind, authorHarness) {
1111
- const allowTight = kind === "lead";
1112
1111
  const aggregates = new Map(harnessAggregate(budgets.filter((b) => b.plan !== "unregistered")).map((a) => [a.harness, a]));
1113
- const eligibleHarness = (agg) => eligibleAccounts(agg.harness).length > 0 && agg.status !== "hold" && (allowTight || agg.status !== "tight") && agg.harness !== (kind === "qa" ? authorHarness : undefined);
1114
- const eligibleAccounts = (h) => budgets.filter((b) => b.harness === h && b.spawnable !== false && b.plan !== "unregistered" && !b.yieldsTo && b.status !== "hold" && (allowTight || b.status !== "tight"));
1112
+ const eligibleHarness = (agg) => eligibleAccounts(agg.harness).length > 0 && agg.status !== "hold" && agg.harness !== (kind === "qa" ? authorHarness : undefined);
1113
+ const eligibleAccounts = (h) => budgets.filter((b) => b.harness === h && b.spawnable !== false && b.plan !== "unregistered" && !b.yieldsTo && b.status !== "hold");
1115
1114
  const harnesses = [...aggregates.values()].filter(eligibleHarness);
1116
1115
  const ordered = [...harnesses].sort((a, b) => {
1117
1116
  const ap = a.paceStatus === "under" ? 0 : 1;
@@ -1129,9 +1128,11 @@ function routeRecommendation(budgets, kind, authorHarness) {
1129
1128
  if (budgets.length && budgets.every((b) => b.spawnable === false)) {
1130
1129
  return { harness: null, reason: "No harness can start a new session.", alternatives: [], accountAlternatives: [], cadence: { parallel: 0, note: "Install or repair a harness before opening workers." } };
1131
1130
  }
1132
- const earliest = budgets.filter((b) => b.status === "hold").sort((a, b) => a.weekResetsAt - b.weekResetsAt)[0];
1133
- const reset = earliest ? new Date(earliest.weekResetsAt).toISOString() : "the next reset";
1134
- return { harness: null, reason: `all plans on hold until ${reset}`, alternatives: [], accountAlternatives: [], cadence: { parallel: 0, note: "Wait for a plan to renew." } };
1131
+ if (budgets.length && budgets.every((b) => b.status === "hold")) {
1132
+ const earliest = Math.min(...budgets.map((b) => b.pauseUntil ?? b.weekResetsAt));
1133
+ return { harness: null, reason: `all plans on hold until ${new Date(earliest).toISOString()}`, alternatives: [], accountAlternatives: [], cadence: { parallel: 0, note: "Wait for a plan to renew." } };
1134
+ }
1135
+ return { harness: null, reason: `No eligible plan for ${kind}.`, alternatives: [], accountAlternatives: [], cadence: { parallel: 0, note: "Check plan registration, account availability, and author-harness exclusions." } };
1135
1136
  };
1136
1137
  if (!pickAgg)
1137
1138
  return noRoute();
@@ -1143,6 +1144,7 @@ function routeRecommendation(budgets, kind, authorHarness) {
1143
1144
  const alternatives = ordered.filter((a) => a.harness !== pick.harness).map((a) => a.harness);
1144
1145
  const accountAlternatives = ordered.flatMap((a) => eligibleAccounts(a.harness).filter((b) => !(b.harness === pick.harness && b.account === pick.account)).map((b) => ({ harness: b.harness, account: b.account ?? "default" })));
1145
1146
  const paceText = pick.note ? ` ${pick.note}` : "";
1147
+ const budgetText = pick.status === "tight" ? " Tight budget warning." : "";
1146
1148
  const measured = candidates.some((b) => b.freeSlotsMeasured);
1147
1149
  const parallel = measured ? pickAgg.freeSlots : candidates.length > 1 ? candidates.reduce((sum, b) => sum + (b.suggestedParallel ?? 1), 0) : pick.suggestedParallel ?? 1;
1148
1150
  return {
@@ -1150,7 +1152,7 @@ function routeRecommendation(budgets, kind, authorHarness) {
1150
1152
  ...pick.account ? { account: pick.account } : {},
1151
1153
  ...pick.accountLabel ? { accountLabel: pick.accountLabel } : {},
1152
1154
  ...selected?.[1] ? { model: selected[1] } : {},
1153
- reason: `${pick.harness} is the preferred eligible plan for ${kind}.${paceText}`,
1155
+ reason: `${pick.harness} is the preferred eligible plan for ${kind}.${budgetText}${paceText}`,
1154
1156
  alternatives,
1155
1157
  accountAlternatives,
1156
1158
  cadence: { parallel, note: pick.note ?? "Keep one worker running." }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentistics/mcp",
3
- "version": "2.151.0",
3
+ "version": "2.151.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",