@agentistics/mcp 2.174.0 → 2.175.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.
@@ -1002,7 +1002,7 @@ var AGENT_TOOL_POLICY = {
1002
1002
  agentistics_harnesses: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/data", "GET /api/runtime/metrics", "GET /api/plan-limits"], reason: "reads computed metrics per harness and whether each can be spawned" },
1003
1003
  agentistics_plan_limits: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/plan-limits"], reason: "reads subscription windows and routing guidance; does not start work" },
1004
1004
  agentistics_projects: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/data", "GET /api/runtime/metrics"], reason: "reads computed metrics per project" },
1005
- agentistics_sessions: { ...DATA, capability: "localShell", host: true, risk: "R", routes: ["GET /api/data", "GET /api/fleet"], reason: "reads session metadata (first_prompt is untrusted text, §4.8)" },
1005
+ agentistics_sessions: { ...DATA, capability: "localShell", host: true, risk: "R", routes: ["GET /api/data", "GET /api/fleet", "GET /api/flows/delivered-open"], reason: "reads session metadata (first_prompt is untrusted text, §4.8)" },
1006
1006
  agentistics_costs: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/data", "GET /api/runtime/metrics"], reason: "reads computed costs" },
1007
1007
  agentistics_repos: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/data", "GET /api/runtime/metrics"], reason: "reads computed metrics per repository" },
1008
1008
  agentistics_component_catalog: { ...DATA, risk: "R", routes: [], reason: "returns a static list; calls nothing" },
@@ -1288,6 +1288,22 @@ function startedByIndex(rows) {
1288
1288
  function startedByFleetPayload(payload) {
1289
1289
  return startedByIndex(Array.isArray(payload.rows) ? payload.rows : []);
1290
1290
  }
1291
+ function deliveredOpenByConversation(payload) {
1292
+ const out = new Map;
1293
+ const list = payload && typeof payload === "object" && Array.isArray(payload.sessions) ? payload.sessions : [];
1294
+ for (const raw of list) {
1295
+ if (!raw || typeof raw !== "object")
1296
+ continue;
1297
+ const d = raw;
1298
+ if (typeof d.sessionId !== "string" || typeof d.handbackAt !== "string")
1299
+ continue;
1300
+ const entry = { managedId: d.sessionId, handbackAt: d.handbackAt, ...d.lastRun && typeof d.lastRun === "object" ? { lastRun: d.lastRun } : {} };
1301
+ if (typeof d.conversationId === "string")
1302
+ out.set(d.conversationId, entry);
1303
+ out.set(d.sessionId, entry);
1304
+ }
1305
+ return out;
1306
+ }
1291
1307
 
1292
1308
  // agent-audit.ts
1293
1309
  import { createHash } from "node:crypto";
@@ -2530,7 +2546,7 @@ var TOOLS = [
2530
2546
  },
2531
2547
  {
2532
2548
  name: "agentistics_sessions",
2533
- description: "Get the most recent sessions with harness, project path, duration, message count, token usage, and model. Optionally scope to a single harness.",
2549
+ description: "Get the most recent sessions with harness, project path, duration, message count, token usage, and model. Optionally scope to a single harness. With AGENTISTICS_FLOWS on, a worker that handed back and is still open carries `deliveredStillOpen` ({managedId, handbackAt, lastRun?}): close it with agentistics_flow_run name=fechar-entregue {sessionId: managedId}, which only closes it when stopped, clean and saved.",
2534
2550
  inputSchema: {
2535
2551
  type: "object",
2536
2552
  properties: {
@@ -3070,6 +3086,7 @@ async function callTool(req) {
3070
3086
  const harness = args?.harness;
3071
3087
  const data = await apiGet("/api/data");
3072
3088
  const startedBy = await apiGet("/api/fleet?format=links-v1").then((f) => startedByFleetPayload(f ?? {})).catch(() => new Map);
3089
+ const delivered = await apiGet("/api/flows/delivered-open").then((d) => deliveredOpenByConversation(d)).catch(() => new Map);
3073
3090
  const rows = filterSessions(data.sessions ?? [], harness).slice(0, limit).map((s) => {
3074
3091
  const { input, output, cacheRead, cacheWrite, cost, unpriced } = sessionTokens2(s);
3075
3092
  return {
@@ -3089,7 +3106,8 @@ async function callTool(req) {
3089
3106
  ...s.tokens_unavailable ? {} : { estimatedCostUSD: unpriced > 0 && unpriced === input + output + cacheRead + cacheWrite ? null : Math.round(cost * 1e4) / 1e4 },
3090
3107
  ...unpriced > 0 ? { unpricedTokens: unpriced } : {},
3091
3108
  model: s.model ?? null,
3092
- ...startedBy.get(s.session_id) ? { startedBy: startedBy.get(s.session_id) } : {}
3109
+ ...startedBy.get(s.session_id) ? { startedBy: startedBy.get(s.session_id) } : {},
3110
+ ...delivered.get(s.session_id) ? { deliveredStillOpen: delivered.get(s.session_id) } : {}
3093
3111
  };
3094
3112
  });
3095
3113
  return { content: [{ type: "text", text: JSON.stringify(rows, null, 2) }] };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentistics/mcp",
3
- "version": "2.174.0",
3
+ "version": "2.175.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",