@kynver-app/mcp-agent-os 0.3.8 → 0.3.10

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.
package/dist/server.js CHANGED
@@ -13,6 +13,7 @@ import { registerPlanTools } from "./tools/plans.js";
13
13
  import { registerPlanProgressTools } from "./tools/plan-progress.js";
14
14
  import { registerTaskTools } from "./tools/tasks.js";
15
15
  import { registerActionRequiredTools } from "./tools/action-required.js";
16
+ import { registerGraphTools } from "./tools/graph.js";
16
17
  function jsonResult(data) {
17
18
  return {
18
19
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
@@ -614,5 +615,7 @@ export function createAgentOsServer() {
614
615
  registerPlanProgressTools({ register, resolveToolSlug, jsonResult, compact });
615
616
  // Action Required inbox: agent_os_ask_human + agent_os_await_action (slice 1).
616
617
  registerActionRequiredTools({ register, jsonResult, compact });
618
+ // Operational graph insights — Agent SEE (agent_os_graph_query).
619
+ registerGraphTools({ register, resolveToolSlug, jsonResult });
617
620
  return server;
618
621
  }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Operational-graph MCP tools — "Agent SEE" (graph M6).
3
+ *
4
+ * agent_os_graph_query proxies to GET `/api/agent-os/{slug}/graph/query`, which
5
+ * returns server-computed insights (bottlenecks, per-owner load, orphans) over
6
+ * the operational graph. Read-only; the Kynver route enforces session +
7
+ * workspace scope. Kept in its own module so server.ts stays slim.
8
+ */
9
+ type ToolResult = {
10
+ content: {
11
+ type: "text";
12
+ text: string;
13
+ }[];
14
+ structuredContent?: unknown;
15
+ };
16
+ export interface GraphToolDeps {
17
+ register: (name: string, description: string, inputSchema: Record<string, unknown>, cb: (args: any) => any) => void;
18
+ resolveToolSlug: (explicitSlug?: string) => Promise<string>;
19
+ jsonResult: (data: unknown) => ToolResult;
20
+ }
21
+ export declare function registerGraphTools({ register, resolveToolSlug, jsonResult }: GraphToolDeps): void;
22
+ export {};
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Operational-graph MCP tools — "Agent SEE" (graph M6).
3
+ *
4
+ * agent_os_graph_query proxies to GET `/api/agent-os/{slug}/graph/query`, which
5
+ * returns server-computed insights (bottlenecks, per-owner load, orphans) over
6
+ * the operational graph. Read-only; the Kynver route enforces session +
7
+ * workspace scope. Kept in its own module so server.ts stays slim.
8
+ */
9
+ import { z } from "zod";
10
+ import { get, post } from "../lib/kynver-client.js";
11
+ export function registerGraphTools({ register, resolveToolSlug, jsonResult }) {
12
+ register("agent_os_graph_query", [
13
+ "Read the operational graph's computed insights for the AgentOS:",
14
+ "top bottlenecks (highest downstream impact among still-active or blocked work),",
15
+ "per-owner load (who is carrying work and who is blocked), and orphaned tasks.",
16
+ "Use this to answer questions like 'what is my biggest bottleneck',",
17
+ "'what is blocking project X', 'what is <persona> working on', or 'what is unassigned'.",
18
+ "Read-only — modifies nothing. Returns { available, generatedAt, stats, insights }.",
19
+ ].join(" "), {
20
+ slug: z
21
+ .string()
22
+ .optional()
23
+ .describe("AgentOS slug. Defaults to the configured env/primary AgentOS."),
24
+ bottlenecks: z
25
+ .number()
26
+ .int()
27
+ .min(1)
28
+ .max(50)
29
+ .optional()
30
+ .describe("Max bottleneck rows to return (default 10)."),
31
+ owners: z
32
+ .number()
33
+ .int()
34
+ .min(1)
35
+ .max(50)
36
+ .optional()
37
+ .describe("Max per-owner load rows to return (default 12)."),
38
+ orphans: z
39
+ .number()
40
+ .int()
41
+ .min(1)
42
+ .max(100)
43
+ .optional()
44
+ .describe("Max orphan rows to return (default 25)."),
45
+ }, async (args) => {
46
+ const slug = await resolveToolSlug(args.slug);
47
+ const qs = new URLSearchParams();
48
+ if (args.bottlenecks !== undefined)
49
+ qs.set("bottlenecks", String(args.bottlenecks));
50
+ if (args.owners !== undefined)
51
+ qs.set("owners", String(args.owners));
52
+ if (args.orphans !== undefined)
53
+ qs.set("orphans", String(args.orphans));
54
+ const suffix = qs.toString() ? "?" + qs.toString() : "";
55
+ return jsonResult(await get(`/agent-os/${slug}/graph/query${suffix}`));
56
+ });
57
+ register("agent_os_graph_view", [
58
+ "Steer the human's open 3D web view (shared focus) — fly the camera to a node, filter, or reset,",
59
+ "so you and the user are provably looking at the same thing.",
60
+ "kind=focus needs nodeId (operational graph id, e.g. 'task:abc'); kind=filter sets which type/status",
61
+ "buckets are hidden; kind=reset clears focus + filters; kind=highlight focuses without isolating.",
62
+ "Takes effect only while the user has the 3D Web tab open (delivered over SSE).",
63
+ "Requires Redis in multi-instance/serverless prod to fan out; single-instance dev works without it.",
64
+ ].join(" "), {
65
+ slug: z.string().optional().describe("AgentOS slug. Defaults to env/primary."),
66
+ kind: z
67
+ .enum(["focus", "filter", "reset", "highlight"])
68
+ .describe("focus | highlight (camera) · filter (hide buckets) · reset (clear)."),
69
+ nodeId: z
70
+ .string()
71
+ .optional()
72
+ .describe("Target operational-graph node id for focus/highlight (e.g. 'task:abc123')."),
73
+ hiddenKinds: z
74
+ .array(z.string())
75
+ .optional()
76
+ .describe("For kind=filter: node kinds to hide (e.g. ['repo_file']). [] clears."),
77
+ hiddenStatuses: z
78
+ .array(z.string())
79
+ .optional()
80
+ .describe("For kind=filter: statuses to hide (e.g. ['done']). [] clears."),
81
+ }, async (args) => {
82
+ const slug = await resolveToolSlug(args.slug);
83
+ return jsonResult(await post(`/agent-os/${slug}/graph/view`, {
84
+ kind: args.kind,
85
+ nodeId: args.nodeId,
86
+ hiddenKinds: args.hiddenKinds,
87
+ hiddenStatuses: args.hiddenStatuses,
88
+ source: "agent",
89
+ }));
90
+ });
91
+ }
@@ -31,6 +31,11 @@ const taskEventType = z.enum([
31
31
  "failed",
32
32
  ]);
33
33
  const artifactVisibility = z.enum(["internal", "telegram_safe", "public_pr_safe"]);
34
+ const personaSlug = z
35
+ .string()
36
+ .nullable()
37
+ .optional()
38
+ .describe("Lane-expert worker slug to attribute the task to, or null to clear/filter unassigned tasks.");
34
39
  export function registerTaskTools({ register, resolveToolSlug, jsonResult, compact, }) {
35
40
  const slugField = z
36
41
  .string()
@@ -45,6 +50,7 @@ export function registerTaskTools({ register, resolveToolSlug, jsonResult, compa
45
50
  parentTaskId: z.string().optional().describe("Parent task id when this is one of 2+ coordinated workers."),
46
51
  goalId: z.string().optional(),
47
52
  projectId: z.string().optional(),
53
+ personaSlug,
48
54
  idempotencyKey: z.string().optional().describe("Dedupe key from the foreground turn. Strongly recommended."),
49
55
  requestId: z.string().optional().describe("Raw foreground request id; used as the dedupe key if idempotencyKey is absent."),
50
56
  slug: slugField,
@@ -61,6 +67,7 @@ export function registerTaskTools({ register, resolveToolSlug, jsonResult, compa
61
67
  status: taskStatus.optional(),
62
68
  executor: taskExecutor.optional(),
63
69
  parentTaskId: z.string().optional(),
70
+ personaSlug,
64
71
  limit: z.number().optional().describe("Max rows (default 50, max 200)."),
65
72
  slug: slugField,
66
73
  }, async (args) => {
@@ -71,6 +78,8 @@ export function registerTaskTools({ register, resolveToolSlug, jsonResult, compa
71
78
  params.set("executor", args.executor);
72
79
  if (args.parentTaskId)
73
80
  params.set("parentTaskId", args.parentTaskId);
81
+ if (args.personaSlug !== undefined)
82
+ params.set("personaSlug", args.personaSlug ?? "");
74
83
  if (args.limit)
75
84
  params.set("limit", String(args.limit));
76
85
  const qs = params.toString();
@@ -88,6 +97,7 @@ export function registerTaskTools({ register, resolveToolSlug, jsonResult, compa
88
97
  parentTaskId: z.string().optional(),
89
98
  goalId: z.string().optional(),
90
99
  projectId: z.string().optional(),
100
+ personaSlug,
91
101
  lastSummary: z.string().optional().describe("Latest progress summary."),
92
102
  blocker: z.string().optional(),
93
103
  branch: z.string().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kynver-app/mcp-agent-os",
3
- "version": "0.3.8",
3
+ "version": "0.3.10",
4
4
  "description": "Kynver Agentic OS MCP server — slug-keyed agent identity, goals, projects, sessions, and long-term memory",
5
5
  "type": "module",
6
6
  "bin": {