@kynver-app/mcp-agent-os 0.3.22 → 0.3.23

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
@@ -15,6 +15,8 @@ import { registerTaskTools } from "./tools/tasks.js";
15
15
  import { registerActionRequiredTools } from "./tools/action-required.js";
16
16
  import { registerGraphTools } from "./tools/graph.js";
17
17
  import { registerCommandCenterTools } from "./tools/command-center.js";
18
+ import { registerMemoryQualityFeedbackTools } from "./tools/memory-quality-feedback.js";
19
+ import { registerOperatingRulesTools } from "./tools/operating-rules.js";
18
20
  function jsonResult(data) {
19
21
  return {
20
22
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
@@ -31,7 +33,7 @@ function compact(source) {
31
33
  }
32
34
  const MCP_LEGACY_SLUG_FALLBACK = "ghost";
33
35
  export function createAgentOsServer() {
34
- const server = new McpServer({ name: "kynver-mcp-agent-os", version: "0.3.5" }, { capabilities: { tools: {} } });
36
+ const server = new McpServer({ name: "kynver-mcp-agent-os", version: "0.3.6" }, { capabilities: { tools: {} } });
35
37
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
38
  function register(name, description, inputSchema, cb) {
37
39
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -675,5 +677,9 @@ export function createAgentOsServer() {
675
677
  registerGraphTools({ register, resolveToolSlug, jsonResult });
676
678
  // Command Center rollup (by-id route; includes packageVersionHealth).
677
679
  registerCommandCenterTools({ register, resolveToolSlug, jsonResult });
680
+ // Memory quality feedback (M2): record events + query status.
681
+ registerMemoryQualityFeedbackTools({ register, resolveToolSlug, jsonResult, compact });
682
+ // Lane A instruction policy (operating rules boundary).
683
+ registerOperatingRulesTools({ register, resolveToolSlug, jsonResult, compact });
678
684
  return server;
679
685
  }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * MCP tools for the Memory Quality Feedback pipeline.
3
+ *
4
+ * agent_os_record_memory_quality_feedback — POST a feedback event (operator only).
5
+ * agent_os_memory_quality_status_get — GET recent feedback events with optional filters.
6
+ *
7
+ * Both proxy to `/api/agent-os/{slug}/memory/quality-feedback` on Kynver.
8
+ */
9
+ type ToolResult = {
10
+ content: {
11
+ type: "text";
12
+ text: string;
13
+ }[];
14
+ structuredContent?: unknown;
15
+ };
16
+ export interface MemoryQualityFeedbackToolDeps {
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
+ compact: (source: Record<string, unknown>) => Record<string, unknown>;
21
+ }
22
+ export declare function registerMemoryQualityFeedbackTools({ register, resolveToolSlug, jsonResult, compact, }: MemoryQualityFeedbackToolDeps): void;
23
+ export {};
@@ -0,0 +1,100 @@
1
+ /**
2
+ * MCP tools for the Memory Quality Feedback pipeline.
3
+ *
4
+ * agent_os_record_memory_quality_feedback — POST a feedback event (operator only).
5
+ * agent_os_memory_quality_status_get — GET recent feedback events with optional filters.
6
+ *
7
+ * Both proxy to `/api/agent-os/{slug}/memory/quality-feedback` on Kynver.
8
+ */
9
+ import { z } from "zod";
10
+ import { get, post } from "../lib/kynver-client.js";
11
+ const SIGNAL_VALUES = ["positive", "negative"];
12
+ const OUTCOME_KIND_VALUES = [
13
+ "retrieval_used",
14
+ "retrieval_miss",
15
+ "human_correction",
16
+ "task_review_pass",
17
+ "task_review_fail",
18
+ "pr_linked",
19
+ "eval_example",
20
+ "regression_failure",
21
+ ];
22
+ const signalEnum = z.enum(SIGNAL_VALUES);
23
+ const outcomeKindEnum = z.enum(OUTCOME_KIND_VALUES);
24
+ export function registerMemoryQualityFeedbackTools({ register, resolveToolSlug, jsonResult, compact, }) {
25
+ register("agent_os_record_memory_quality_feedback", [
26
+ "Record a memory quality feedback event for the AgentOS workspace.",
27
+ "Use this to signal whether a memory retrieval helped or hurt a task outcome.",
28
+ "Operator access required (owner or admin). Supports idempotency via idempotencyKey.",
29
+ "signal: 'positive' for helpful retrievals or correct outcomes, 'negative' for misses or corrections.",
30
+ "outcomeKind: one of retrieval_used | retrieval_miss | human_correction | task_review_pass",
31
+ "| task_review_fail | pr_linked | eval_example | regression_failure.",
32
+ ].join(" "), {
33
+ signal: signalEnum.describe("Quality signal: 'positive' or 'negative'."),
34
+ outcomeKind: outcomeKindEnum.describe("Outcome kind: retrieval_used | retrieval_miss | human_correction | task_review_pass | task_review_fail | pr_linked | eval_example | regression_failure."),
35
+ queryText: z
36
+ .string()
37
+ .optional()
38
+ .describe("The query text that triggered the retrieval (omit sensitive content)."),
39
+ memoryIds: z
40
+ .array(z.string())
41
+ .optional()
42
+ .describe("IDs of the memory rows that were retrieved or involved."),
43
+ taskId: z.string().optional().describe("AgentTask id associated with this outcome."),
44
+ planId: z.string().optional().describe("Plan id associated with this outcome."),
45
+ prUrl: z.string().optional().describe("GitHub PR URL linked to this outcome."),
46
+ note: z.string().optional().describe("Free-text operator note."),
47
+ idempotencyKey: z
48
+ .string()
49
+ .optional()
50
+ .describe("Unique key to prevent duplicate records for the same event."),
51
+ slug: z
52
+ .string()
53
+ .optional()
54
+ .describe("AgentOS slug. Defaults to the configured env/primary AgentOS."),
55
+ }, async (args) => {
56
+ const s = await resolveToolSlug(args.slug);
57
+ const { slug: _slug, ...body } = args;
58
+ return jsonResult(await post(`/agent-os/${encodeURIComponent(s)}/memory/quality-feedback`, compact(body)));
59
+ });
60
+ register("agent_os_memory_quality_status_get", [
61
+ "List recent memory quality feedback events for the AgentOS workspace.",
62
+ "Operator access required (owner or admin).",
63
+ "Supports filtering by signal (positive|negative), outcomeKind, and a time window via 'since'.",
64
+ "Returns items array and count. Pair with agent_os_command_center_get to see the memoryQuality rollup",
65
+ "(aggregate counts + regression gate status).",
66
+ ].join(" "), {
67
+ slug: z
68
+ .string()
69
+ .optional()
70
+ .describe("AgentOS slug. Defaults to the configured env/primary AgentOS."),
71
+ signal: signalEnum
72
+ .optional()
73
+ .describe("Filter by signal: 'positive' or 'negative'."),
74
+ outcomeKind: outcomeKindEnum
75
+ .optional()
76
+ .describe("Filter to a specific outcome kind."),
77
+ since: z
78
+ .string()
79
+ .optional()
80
+ .describe("ISO timestamp — only include events recorded after this instant."),
81
+ limit: z
82
+ .number()
83
+ .optional()
84
+ .describe("Max events to return (server default 50, max 500)."),
85
+ }, async (args) => {
86
+ const s = await resolveToolSlug(args.slug);
87
+ const qs = new URLSearchParams();
88
+ if (args.signal)
89
+ qs.set("signal", args.signal);
90
+ if (args.outcomeKind)
91
+ qs.set("outcomeKind", args.outcomeKind);
92
+ if (args.since)
93
+ qs.set("since", args.since);
94
+ if (typeof args.limit === "number" && Number.isFinite(args.limit)) {
95
+ qs.set("limit", String(args.limit));
96
+ }
97
+ const suffix = qs.toString() ? `?${qs.toString()}` : "";
98
+ return jsonResult(await get(`/agent-os/${encodeURIComponent(s)}/memory/quality-feedback${suffix}`));
99
+ });
100
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * MCP tools for Lane A instruction policy (operating rules boundary).
3
+ *
4
+ * agent_os_operating_rules_get — deterministic Lane A policy + optional injection markdown.
5
+ */
6
+ import type { MemoryQualityFeedbackToolDeps } from "./memory-quality-feedback.js";
7
+ export declare function registerOperatingRulesTools(deps: MemoryQualityFeedbackToolDeps): void;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * MCP tools for Lane A instruction policy (operating rules boundary).
3
+ *
4
+ * agent_os_operating_rules_get — deterministic Lane A policy + optional injection markdown.
5
+ */
6
+ import { z } from "zod";
7
+ import { get } from "../lib/kynver-client.js";
8
+ export function registerOperatingRulesTools(deps) {
9
+ const { register, resolveToolSlug, jsonResult, compact } = deps;
10
+ register("agent_os_operating_rules_get", [
11
+ "Return the AgentOS instruction policy (internal + custom operating-rule tiers).",
12
+ "Uses explicit kind=operating-rule Prisma fetch — not semantic Lane A recall.",
13
+ "Operator access required; internal-tier mechanics visible to Kynver platform admins only.",
14
+ "Set includeMarkdown=1 to receive prompt injection text.",
15
+ ].join(" "), {
16
+ slug: z.string().optional().describe("AgentOS slug (defaults from env / primary)."),
17
+ personaSlug: z
18
+ .string()
19
+ .optional()
20
+ .describe("Worker persona slug for additive persona rules."),
21
+ planId: z.string().optional().describe("Optional plan id for envelope context."),
22
+ includeMarkdown: z
23
+ .boolean()
24
+ .optional()
25
+ .describe("When true, include formatted markdown suitable for worker prompts."),
26
+ }, async (args) => {
27
+ const slug = await resolveToolSlug(args.slug);
28
+ const qs = new URLSearchParams();
29
+ if (args.personaSlug?.trim())
30
+ qs.set("personaSlug", args.personaSlug.trim());
31
+ if (args.includeMarkdown)
32
+ qs.set("includeMarkdown", "1");
33
+ const suffix = qs.toString() ? `?${qs}` : "";
34
+ const data = await get(`/agent-os/${encodeURIComponent(slug)}/memory/instruction-policy${suffix}`);
35
+ return jsonResult(compact({ slug, ...data }));
36
+ });
37
+ }
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { get, post } from "../lib/kynver-client.js";
3
- const progressStatus = z.enum(["todo", "running", "partial", "blocked", "done"]);
3
+ const progressStatus = z.enum(["todo", "in_progress", "running", "partial", "blocked", "done"]);
4
4
  const roleLane = z.enum([
5
5
  "plan_author",
6
6
  "plan_reviewer",
@@ -79,6 +79,20 @@ export function registerPlanProgressTools({ register, resolveToolSlug, jsonResul
79
79
  const { slug, planId, ...rest } = args;
80
80
  return jsonResult(await post(`/agent-os/${s}/plans/${planId}/review-tasks`, compact(rest)));
81
81
  });
82
+ register("agent_os_plan_progress_focus_set", "Set or clear the plan's agent-loop current focus (`in_progress` on a row). Does not claim an executor lease — use status `running` only when a worker holds a lease.", {
83
+ planId: z.string(),
84
+ rowKey: z.string().optional().describe("Row to focus; omit to clear current focus."),
85
+ rowId: z.string().optional(),
86
+ taskId: z.string().optional(),
87
+ roleLane: roleLane.optional().default("implementer"),
88
+ note: z.string().optional(),
89
+ executorRef: z.string().optional(),
90
+ slug: slugField,
91
+ }, async (args) => {
92
+ const s = await resolveToolSlug(args.slug);
93
+ const { slug, planId, ...rest } = args;
94
+ return jsonResult(await post(`/agent-os/${s}/plans/${planId}/progress-focus`, compact(rest)));
95
+ });
82
96
  register("agent_os_plan_progress_rows_list", "List structured progress rows for a plan.", { planId: z.string(), slug: slugField }, async (args) => {
83
97
  const s = await resolveToolSlug(args.slug);
84
98
  return jsonResult(await get(`/agent-os/${s}/plans/${args.planId}/progress-rows`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kynver-app/mcp-agent-os",
3
- "version": "0.3.22",
3
+ "version": "0.3.23",
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": {