@agentistics/mcp 2.111.2 → 2.112.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.
@@ -1000,10 +1000,16 @@ var AGENT_TOOL_POLICY = {
1000
1000
  routes: ["POST /api/session-notify"],
1001
1001
  reason: "a per-session on/off switch for delivery; reversible, and the session state is untouched"
1002
1002
  },
1003
+ agentistics_session_message: {
1004
+ ...GROUPS,
1005
+ risk: "W",
1006
+ routes: ["POST /api/session-message"],
1007
+ reason: "types a message into another session through the composer path; additive, rate-limited, sender verified"
1008
+ },
1003
1009
  agentistics_summary: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/data", "GET /api/runtime/metrics"], reason: "reads computed metrics" },
1004
1010
  agentistics_harnesses: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/data", "GET /api/runtime/metrics"], reason: "reads computed metrics per harness" },
1005
1011
  agentistics_projects: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/data", "GET /api/runtime/metrics"], reason: "reads computed metrics per project" },
1006
- agentistics_sessions: { ...DATA, risk: "R", routes: ["GET /api/data"], reason: "reads session metadata (first_prompt is untrusted text, §4.8)" },
1012
+ 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)" },
1007
1013
  agentistics_costs: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/data", "GET /api/runtime/metrics"], reason: "reads computed costs" },
1008
1014
  agentistics_repos: { ...DATA, capability: "localTranscripts", host: true, risk: "R", routes: ["GET /api/data", "GET /api/runtime/metrics"], reason: "reads computed metrics per repository" },
1009
1015
  agentistics_component_catalog: { ...DATA, risk: "R", routes: [], reason: "returns a static list; calls nothing" },
@@ -1096,6 +1102,19 @@ function toolsForGate(tools, nativeVisible) {
1096
1102
  return { ...t, inputSchema: { ...t.inputSchema, properties: { ...props, harness: param } } };
1097
1103
  });
1098
1104
  }
1105
+ function startedByIndex(rows) {
1106
+ const out = new Map;
1107
+ for (const r of rows) {
1108
+ if (!r.parentSessionId)
1109
+ continue;
1110
+ const parent = (r.parentConversationId ? rows.find((p) => p.conversationId === r.parentConversationId) : undefined) ?? rows.find((p) => p.id === r.parentSessionId || p.conversationId === r.parentSessionId);
1111
+ const who = { id: parent?.id ?? r.parentSessionId, ...parent?.title ? { title: parent.title } : {} };
1112
+ out.set(r.id, who);
1113
+ if (r.conversationId)
1114
+ out.set(r.conversationId, who);
1115
+ }
1116
+ return out;
1117
+ }
1099
1118
 
1100
1119
  // agent-audit.ts
1101
1120
  import { createHash } from "node:crypto";
@@ -2143,6 +2162,19 @@ var TOOLS = [
2143
2162
  required: ["ref"]
2144
2163
  }
2145
2164
  },
2165
+ {
2166
+ name: "agentistics_session_message",
2167
+ description: "Send a message to ANOTHER agentistics session — the standard channel between a session and the one that started it (or the ones it started). `to` is a session reference (managed id, conversation id, exact title or unique id prefix); `kind` is handback (work finished/committed), block (you cannot continue) or question (you need a decision); `body` is the text. It is typed into the target's own conversation through the same path its composer uses, headed `[from session <id> · <kind>]`, and — when YOUR session is filed on a task or subtask — also recorded there as a comment of that kind. Use it to report to the session that started you instead of asking the user; a parent may message its children the same way. Refused for a session that does not exist, for yourself, from a process that is not a verified agentop session, and more than once per 2 seconds to the same session.",
2168
+ inputSchema: {
2169
+ type: "object",
2170
+ properties: {
2171
+ to: { type: "string", description: "The target session reference." },
2172
+ kind: { type: "string", enum: ["handback", "block", "question"] },
2173
+ body: { type: "string", description: "The message." }
2174
+ },
2175
+ required: ["to", "kind", "body"]
2176
+ }
2177
+ },
2146
2178
  {
2147
2179
  name: "agentistics_summary",
2148
2180
  description: "Get an overview of AI coding usage metrics (across all tracked harnesses — Claude Code, Codex, Gemini, Copilot, Antigravity — or scoped to one): total tokens, estimated cost, sessions, streak, most used model, and top project. Good starting point for any metrics question.",
@@ -2571,6 +2603,16 @@ async function callTool(req) {
2571
2603
  });
2572
2604
  return { content: [{ type: "text", text: JSON.stringify(body, null, 2) }] };
2573
2605
  }
2606
+ case "agentistics_session_message": {
2607
+ const a = args;
2608
+ const body = await apiSend("POST", "/api/session-message", {
2609
+ to: a?.to,
2610
+ kind: a?.kind,
2611
+ body: a?.body,
2612
+ session: sessionProof(process.env)
2613
+ });
2614
+ return { content: [{ type: "text", text: JSON.stringify(body, null, 2) }] };
2615
+ }
2574
2616
  case "agentistics_summary": {
2575
2617
  const harness = args?.harness;
2576
2618
  return text(await analytics("agentistics_summary", harness, {
@@ -2595,6 +2637,7 @@ async function callTool(req) {
2595
2637
  const limit = Math.min(args?.limit ?? 20, 50);
2596
2638
  const harness = args?.harness;
2597
2639
  const data = await apiGet("/api/data");
2640
+ const startedBy = await apiGet("/api/fleet").then((f) => startedByIndex(f?.rows ?? [])).catch(() => new Map);
2598
2641
  const rows = filterSessions(data.sessions ?? [], harness).slice(0, limit).map((s) => {
2599
2642
  const { input, output, cacheRead, cacheWrite, cost, unpriced } = sessionTokens2(s);
2600
2643
  return {
@@ -2611,7 +2654,8 @@ async function callTool(req) {
2611
2654
  totalTokens: input + output + cacheRead + cacheWrite,
2612
2655
  estimatedCostUSD: unpriced > 0 && unpriced === input + output + cacheRead + cacheWrite ? null : Math.round(cost * 1e4) / 1e4,
2613
2656
  ...unpriced > 0 ? { unpricedTokens: unpriced } : {},
2614
- model: s.model ?? null
2657
+ model: s.model ?? null,
2658
+ ...startedBy.get(s.session_id) ? { startedBy: startedBy.get(s.session_id) } : {}
2615
2659
  };
2616
2660
  });
2617
2661
  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.111.2",
3
+ "version": "2.112.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",