@kynver-app/mcp-agent-os 0.3.69 → 0.3.71
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/index.js +3 -19
- package/dist/sse.js +3 -15
- package/dist/worker.js +2 -0
- package/package.json +5 -4
- package/dist/context/context-budget-receipt.d.ts +0 -9
- package/dist/context/context-budget-receipt.js +0 -34
- package/dist/index.d.ts +0 -7
- package/dist/lib/kynver-client.d.ts +0 -23
- package/dist/lib/kynver-client.js +0 -151
- package/dist/lib/mcp-json-result.d.ts +0 -12
- package/dist/lib/mcp-json-result.js +0 -30
- package/dist/lib/mcp-sse-server.d.ts +0 -44
- package/dist/lib/mcp-sse-server.js +0 -441
- package/dist/lib/package-version.d.ts +0 -7
- package/dist/lib/package-version.js +0 -44
- package/dist/server.d.ts +0 -11
- package/dist/server.js +0 -753
- package/dist/sse.d.ts +0 -1
- package/dist/tools/action-required.d.ts +0 -24
- package/dist/tools/action-required.js +0 -140
- package/dist/tools/cmo-context-pack.d.ts +0 -20
- package/dist/tools/cmo-context-pack.js +0 -56
- package/dist/tools/cmo-control.d.ts +0 -20
- package/dist/tools/cmo-control.js +0 -26
- package/dist/tools/command-center.d.ts +0 -24
- package/dist/tools/command-center.js +0 -155
- package/dist/tools/context-expand.d.ts +0 -18
- package/dist/tools/context-expand.js +0 -26
- package/dist/tools/context-preview.d.ts +0 -14
- package/dist/tools/context-preview.js +0 -51
- package/dist/tools/current-focus.d.ts +0 -17
- package/dist/tools/current-focus.js +0 -126
- package/dist/tools/diagnostics.d.ts +0 -24
- package/dist/tools/diagnostics.js +0 -69
- package/dist/tools/graph.d.ts +0 -25
- package/dist/tools/graph.js +0 -153
- package/dist/tools/kariad-marketing-loop.d.ts +0 -21
- package/dist/tools/kariad-marketing-loop.js +0 -41
- package/dist/tools/kariad-outcome-import.d.ts +0 -17
- package/dist/tools/kariad-outcome-import.js +0 -37
- package/dist/tools/macro-controls.d.ts +0 -23
- package/dist/tools/macro-controls.js +0 -54
- package/dist/tools/memory-ledger.d.ts +0 -19
- package/dist/tools/memory-ledger.js +0 -48
- package/dist/tools/memory-quality-feedback.d.ts +0 -23
- package/dist/tools/memory-quality-feedback.js +0 -123
- package/dist/tools/memory-vault.d.ts +0 -21
- package/dist/tools/memory-vault.js +0 -24
- package/dist/tools/mesh-liveness.d.ts +0 -20
- package/dist/tools/mesh-liveness.js +0 -40
- package/dist/tools/monitor.d.ts +0 -17
- package/dist/tools/monitor.js +0 -51
- package/dist/tools/operating-rules.d.ts +0 -7
- package/dist/tools/operating-rules.js +0 -39
- package/dist/tools/plan-audit-rollup.d.ts +0 -19
- package/dist/tools/plan-audit-rollup.js +0 -49
- package/dist/tools/plan-progress.d.ts +0 -2
- package/dist/tools/plan-progress.js +0 -128
- package/dist/tools/plan-to-factory.d.ts +0 -2
- package/dist/tools/plan-to-factory.js +0 -23
- package/dist/tools/plans.d.ts +0 -29
- package/dist/tools/plans.js +0 -205
- package/dist/tools/pr-backlog.d.ts +0 -22
- package/dist/tools/pr-backlog.js +0 -43
- package/dist/tools/provider-evidence.d.ts +0 -23
- package/dist/tools/provider-evidence.js +0 -60
- package/dist/tools/skills.d.ts +0 -28
- package/dist/tools/skills.js +0 -79
- package/dist/tools/task-board-watchdog.d.ts +0 -20
- package/dist/tools/task-board-watchdog.js +0 -42
- package/dist/tools/taskflow.d.ts +0 -21
- package/dist/tools/taskflow.js +0 -124
- package/dist/tools/tasks.d.ts +0 -26
- package/dist/tools/tasks.js +0 -251
- package/dist/tools/workbench.d.ts +0 -17
- package/dist/tools/workbench.js +0 -178
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory ledger MCP tools (audited-memory M5) — agent-readable summaries so
|
|
3
|
-
* the runtime agent can narrate what was read and why, then steer the
|
|
4
|
-
* workbench to the Memory activity panel.
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { get } from "../lib/kynver-client.js";
|
|
8
|
-
export function registerMemoryLedgerTools({ register, resolveToolSlug, jsonResult, }) {
|
|
9
|
-
register("agent_os_memory_ledger_summary", [
|
|
10
|
-
"Read a narrated summary of the workspace owner's signed memory access ledger",
|
|
11
|
-
"(receipt counts, recent human-framed activity lines, chain integrity, and workbench",
|
|
12
|
-
"steering hints). Use when the operator asks what memories were read, what changed,",
|
|
13
|
-
"or wants a weekly digest. Customer vocabulary only — no retrieval mechanics.",
|
|
14
|
-
"After summarizing, offer to open Memory activity via agent_os_workbench_view",
|
|
15
|
-
"(kind=open_panel, panel=memory-activity). Read-only and safe for unattended use.",
|
|
16
|
-
].join(" "), {
|
|
17
|
-
slug: z.string().optional().describe("AgentOS slug. Defaults to env/primary."),
|
|
18
|
-
periodDays: z
|
|
19
|
-
.number()
|
|
20
|
-
.int()
|
|
21
|
-
.min(1)
|
|
22
|
-
.max(90)
|
|
23
|
-
.optional()
|
|
24
|
-
.describe("Rolling window in days when from/to omitted (default 7)."),
|
|
25
|
-
from: z.string().optional().describe("Inclusive ISO lower bound."),
|
|
26
|
-
to: z.string().optional().describe("Inclusive ISO upper bound."),
|
|
27
|
-
recentLimit: z
|
|
28
|
-
.number()
|
|
29
|
-
.int()
|
|
30
|
-
.min(1)
|
|
31
|
-
.max(25)
|
|
32
|
-
.optional()
|
|
33
|
-
.describe("Recent narrated lines (default 12)."),
|
|
34
|
-
}, async (args) => {
|
|
35
|
-
const slug = await resolveToolSlug(args.slug);
|
|
36
|
-
const params = new URLSearchParams();
|
|
37
|
-
if (args.periodDays != null)
|
|
38
|
-
params.set("periodDays", String(args.periodDays));
|
|
39
|
-
if (args.from)
|
|
40
|
-
params.set("from", args.from);
|
|
41
|
-
if (args.to)
|
|
42
|
-
params.set("to", args.to);
|
|
43
|
-
if (args.recentLimit != null)
|
|
44
|
-
params.set("recentLimit", String(args.recentLimit));
|
|
45
|
-
const qs = params.toString();
|
|
46
|
-
return jsonResult(await get(`/agent-os/${encodeURIComponent(slug)}/memory-ledger/summary${qs ? `?${qs}` : ""}`));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,123 +0,0 @@
|
|
|
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, put } 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_consent_get", [
|
|
61
|
-
"Get L2 aggregate learning consent for the AgentOS workspace.",
|
|
62
|
-
"Operator access required (owner or admin). L1 private learning is always on; L2 requires explicit opt-in.",
|
|
63
|
-
].join(" "), {
|
|
64
|
-
slug: z.string().optional().describe("AgentOS slug. Defaults to configured primary."),
|
|
65
|
-
}, async (args) => {
|
|
66
|
-
const s = await resolveToolSlug(args.slug);
|
|
67
|
-
return jsonResult(await get(`/agent-os/${encodeURIComponent(s)}/memory/quality-feedback/consent`));
|
|
68
|
-
});
|
|
69
|
-
register("agent_os_memory_quality_consent_set", [
|
|
70
|
-
"Transition L2 aggregate learning consent (request | grant | revoke | reset).",
|
|
71
|
-
"Operator access required. Grant enables de-identified aggregate export; revoke purges exported signals.",
|
|
72
|
-
].join(" "), {
|
|
73
|
-
action: z
|
|
74
|
-
.enum(["request", "grant", "revoke", "reset"])
|
|
75
|
-
.describe("Consent state-machine action."),
|
|
76
|
-
slug: z.string().optional().describe("AgentOS slug. Defaults to configured primary."),
|
|
77
|
-
}, async (args) => {
|
|
78
|
-
const s = await resolveToolSlug(args.slug);
|
|
79
|
-
return jsonResult(await put(`/agent-os/${encodeURIComponent(s)}/memory/quality-feedback/consent`, {
|
|
80
|
-
action: args.action,
|
|
81
|
-
}));
|
|
82
|
-
});
|
|
83
|
-
register("agent_os_memory_quality_status_get", [
|
|
84
|
-
"List recent memory quality feedback events for the AgentOS workspace.",
|
|
85
|
-
"Operator access required (owner or admin).",
|
|
86
|
-
"Supports filtering by signal (positive|negative), outcomeKind, and a time window via 'since'.",
|
|
87
|
-
"Returns items array and count. Pair with agent_os_command_center_get to see the memoryQuality rollup",
|
|
88
|
-
"(aggregate counts + regression gate status).",
|
|
89
|
-
].join(" "), {
|
|
90
|
-
slug: z
|
|
91
|
-
.string()
|
|
92
|
-
.optional()
|
|
93
|
-
.describe("AgentOS slug. Defaults to the configured env/primary AgentOS."),
|
|
94
|
-
signal: signalEnum
|
|
95
|
-
.optional()
|
|
96
|
-
.describe("Filter by signal: 'positive' or 'negative'."),
|
|
97
|
-
outcomeKind: outcomeKindEnum
|
|
98
|
-
.optional()
|
|
99
|
-
.describe("Filter to a specific outcome kind."),
|
|
100
|
-
since: z
|
|
101
|
-
.string()
|
|
102
|
-
.optional()
|
|
103
|
-
.describe("ISO timestamp — only include events recorded after this instant."),
|
|
104
|
-
limit: z
|
|
105
|
-
.number()
|
|
106
|
-
.optional()
|
|
107
|
-
.describe("Max events to return (server default 50, max 500)."),
|
|
108
|
-
}, async (args) => {
|
|
109
|
-
const s = await resolveToolSlug(args.slug);
|
|
110
|
-
const qs = new URLSearchParams();
|
|
111
|
-
if (args.signal)
|
|
112
|
-
qs.set("signal", args.signal);
|
|
113
|
-
if (args.outcomeKind)
|
|
114
|
-
qs.set("outcomeKind", args.outcomeKind);
|
|
115
|
-
if (args.since)
|
|
116
|
-
qs.set("since", args.since);
|
|
117
|
-
if (typeof args.limit === "number" && Number.isFinite(args.limit)) {
|
|
118
|
-
qs.set("limit", String(args.limit));
|
|
119
|
-
}
|
|
120
|
-
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
121
|
-
return jsonResult(await get(`/agent-os/${encodeURIComponent(s)}/memory/quality-feedback${suffix}`));
|
|
122
|
-
});
|
|
123
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory vault MCP tools (audited-memory M4) — sealed-memory label visibility
|
|
3
|
-
* for the runtime agent. STRICT contract: the agent may learn that sealed
|
|
4
|
-
* memories exist (label + slug + createdAt) and nothing else. Sealed content
|
|
5
|
-
* is encrypted client-side; opening requires the user's explicit per-request
|
|
6
|
-
* consent in the Kynver web chat, where they decrypt it locally.
|
|
7
|
-
*/
|
|
8
|
-
type ToolResult = {
|
|
9
|
-
content: {
|
|
10
|
-
type: "text";
|
|
11
|
-
text: string;
|
|
12
|
-
}[];
|
|
13
|
-
structuredContent?: unknown;
|
|
14
|
-
};
|
|
15
|
-
export interface MemoryVaultToolDeps {
|
|
16
|
-
register: (name: string, description: string, inputSchema: Record<string, unknown>, cb: (args: any) => any) => void;
|
|
17
|
-
resolveToolSlug: (explicitSlug?: string) => Promise<string>;
|
|
18
|
-
jsonResult: (data: unknown) => ToolResult;
|
|
19
|
-
}
|
|
20
|
-
export declare function registerMemoryVaultTools({ register, resolveToolSlug, jsonResult, }: MemoryVaultToolDeps): void;
|
|
21
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory vault MCP tools (audited-memory M4) — sealed-memory label visibility
|
|
3
|
-
* for the runtime agent. STRICT contract: the agent may learn that sealed
|
|
4
|
-
* memories exist (label + slug + createdAt) and nothing else. Sealed content
|
|
5
|
-
* is encrypted client-side; opening requires the user's explicit per-request
|
|
6
|
-
* consent in the Kynver web chat, where they decrypt it locally.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
import { get } from "../lib/kynver-client.js";
|
|
10
|
-
export function registerMemoryVaultTools({ register, resolveToolSlug, jsonResult, }) {
|
|
11
|
-
register("agent_os_vault_labels", [
|
|
12
|
-
"List the workspace owner's sealed (vault) memories — labels, slugs, and creation dates",
|
|
13
|
-
"ONLY. Sealed content is encrypted in the user's browser before upload and can never be",
|
|
14
|
-
"read by you or the platform; this tool proves a sealed memory exists, nothing more.",
|
|
15
|
-
"To use one, ask the user to open it — they decrypt it locally and choose per request",
|
|
16
|
-
"(opens happen in the Kynver web chat via a consent card; each open is receipted in the",
|
|
17
|
-
"Memory activity ledger). Read-only and safe for unattended use.",
|
|
18
|
-
].join(" "), {
|
|
19
|
-
slug: z.string().optional().describe("AgentOS slug. Defaults to env/primary."),
|
|
20
|
-
}, async (args) => {
|
|
21
|
-
const slug = await resolveToolSlug(args.slug);
|
|
22
|
-
return jsonResult(await get(`/agent-os/${encodeURIComponent(slug)}/memory/vault/labels`));
|
|
23
|
-
});
|
|
24
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mesh liveness MCP tool — read surface for connected-box heartbeats and cron lease.
|
|
3
|
-
*
|
|
4
|
-
* agent_os_mesh_liveness_get proxies to
|
|
5
|
-
* GET `/api/agent-os/by-id/{agentOsId}/mesh-liveness`.
|
|
6
|
-
*/
|
|
7
|
-
type ToolResult = {
|
|
8
|
-
content: {
|
|
9
|
-
type: "text";
|
|
10
|
-
text: string;
|
|
11
|
-
}[];
|
|
12
|
-
structuredContent?: unknown;
|
|
13
|
-
};
|
|
14
|
-
export interface MeshLivenessToolDeps {
|
|
15
|
-
register: (name: string, description: string, inputSchema: Record<string, unknown>, cb: (args: any) => any) => void;
|
|
16
|
-
resolveToolSlug: (explicitSlug?: string) => Promise<string>;
|
|
17
|
-
jsonResult: (data: unknown) => ToolResult;
|
|
18
|
-
}
|
|
19
|
-
export declare function registerMeshLivenessTools({ register, resolveToolSlug, jsonResult, }: MeshLivenessToolDeps): void;
|
|
20
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mesh liveness MCP tool — read surface for connected-box heartbeats and cron lease.
|
|
3
|
-
*
|
|
4
|
-
* agent_os_mesh_liveness_get proxies to
|
|
5
|
-
* GET `/api/agent-os/by-id/{agentOsId}/mesh-liveness`.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from "zod";
|
|
8
|
-
import { get } from "../lib/kynver-client.js";
|
|
9
|
-
async function resolveAgentOsId(slug) {
|
|
10
|
-
const row = await get(`/agent-os/${encodeURIComponent(slug)}`);
|
|
11
|
-
const id = typeof row.id === "string" ? row.id.trim() : "";
|
|
12
|
-
if (!id) {
|
|
13
|
-
throw new Error(`AgentOS slug "${slug}" did not resolve to an id. Pass agentOsId explicitly or ensure GET /api/agent-os/{slug} returns id.`);
|
|
14
|
-
}
|
|
15
|
-
return id;
|
|
16
|
-
}
|
|
17
|
-
export function registerMeshLivenessTools({ register, resolveToolSlug, jsonResult, }) {
|
|
18
|
-
register("agent_os_mesh_liveness_get", [
|
|
19
|
-
"Fetch connected-box mesh liveness for the AgentOS workspace: per-box heartbeats",
|
|
20
|
-
"(fresh/stale), cron watchdog lease holder, and recent peer rescue events.",
|
|
21
|
-
"Use during verify_live to confirm multi-box coordination without reading server logs.",
|
|
22
|
-
"Read-only and safe for unattended invocation.",
|
|
23
|
-
].join(" "), {
|
|
24
|
-
slug: z
|
|
25
|
-
.string()
|
|
26
|
-
.optional()
|
|
27
|
-
.describe("AgentOS slug. Defaults to the configured env/primary AgentOS."),
|
|
28
|
-
agentOsId: z
|
|
29
|
-
.string()
|
|
30
|
-
.optional()
|
|
31
|
-
.describe("Optional AgentOS row id. When omitted, resolved from slug."),
|
|
32
|
-
}, async (args) => {
|
|
33
|
-
const slug = await resolveToolSlug(args.slug);
|
|
34
|
-
const agentOsId = typeof args.agentOsId === "string" && args.agentOsId.trim()
|
|
35
|
-
? args.agentOsId.trim()
|
|
36
|
-
: await resolveAgentOsId(slug);
|
|
37
|
-
const payload = await get(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/mesh-liveness`);
|
|
38
|
-
return jsonResult(payload);
|
|
39
|
-
});
|
|
40
|
-
}
|
package/dist/tools/monitor.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Harness worker monitor MCP tools — backed by AgentOS harness/monitor HTTP routes.
|
|
3
|
-
*/
|
|
4
|
-
type ToolResult = {
|
|
5
|
-
content: {
|
|
6
|
-
type: "text";
|
|
7
|
-
text: string;
|
|
8
|
-
}[];
|
|
9
|
-
structuredContent?: unknown;
|
|
10
|
-
};
|
|
11
|
-
export interface MonitorToolDeps {
|
|
12
|
-
register: (name: string, description: string, inputSchema: Record<string, unknown>, cb: (args: any) => any) => void;
|
|
13
|
-
resolveToolSlug: (explicitSlug?: string) => Promise<string>;
|
|
14
|
-
jsonResult: (data: unknown) => ToolResult;
|
|
15
|
-
}
|
|
16
|
-
export declare function registerMonitorTools({ register, resolveToolSlug, jsonResult, }: MonitorToolDeps): void;
|
|
17
|
-
export {};
|
package/dist/tools/monitor.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Harness worker monitor MCP tools — backed by AgentOS harness/monitor HTTP routes.
|
|
3
|
-
*/
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { post } from "../lib/kynver-client.js";
|
|
6
|
-
const slugField = z
|
|
7
|
-
.string()
|
|
8
|
-
.optional()
|
|
9
|
-
.describe("AgentOS slug. Defaults to env/primary AgentOS.");
|
|
10
|
-
export function registerMonitorTools({ register, resolveToolSlug, jsonResult, }) {
|
|
11
|
-
register("agent_os_monitor_assess", [
|
|
12
|
-
"Assess harness worker health (healthy/stale/orphaned) and auto-complete eligibility",
|
|
13
|
-
"for a run on the runner host disk. Requires the harness run to exist under",
|
|
14
|
-
"KYNVER_HARNESS_ROOT on the server (or operator host posting via runner token).",
|
|
15
|
-
"Distinguishes AgentTask `running` (live executor lease) from plan-row focus.",
|
|
16
|
-
].join(" "), {
|
|
17
|
-
slug: slugField,
|
|
18
|
-
runId: z.string(),
|
|
19
|
-
workerName: z.string().optional().describe("Scope to one worker; omit for all workers in the run."),
|
|
20
|
-
}, async (args) => {
|
|
21
|
-
const slug = await resolveToolSlug(args.slug);
|
|
22
|
-
return jsonResult(await post(`/agent-os/${encodeURIComponent(slug)}/harness/monitor/assess`, {
|
|
23
|
-
runId: args.runId,
|
|
24
|
-
workerName: args.workerName,
|
|
25
|
-
}));
|
|
26
|
-
});
|
|
27
|
-
register("agent_os_monitor_list", "List active local harness monitor sidecars on the runner host (kynver monitor list). Requires runner execution context.", {
|
|
28
|
-
slug: slugField,
|
|
29
|
-
}, async () => {
|
|
30
|
-
return jsonResult({
|
|
31
|
-
note: "Use `kynver monitor list` on the runner host; MCP list is local-disk only.",
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
register("agent_os_monitor_auto_complete", [
|
|
35
|
-
"Run verified terminal auto-complete for one harness worker (poll + POST /harness/completion).",
|
|
36
|
-
"Refuses when blockers exist (heartbeat blocker, landing gate, completionBlocker).",
|
|
37
|
-
"Prefer `kynver monitor auto-complete --run RUN --name WORKER` on the runner host;",
|
|
38
|
-
"this MCP tool documents the contract — remote auto-complete requires runner CLI.",
|
|
39
|
-
].join(" "), {
|
|
40
|
-
slug: slugField,
|
|
41
|
-
runId: z.string(),
|
|
42
|
-
workerName: z.string(),
|
|
43
|
-
}, async (args) => {
|
|
44
|
-
await resolveToolSlug(args.slug);
|
|
45
|
-
return jsonResult({
|
|
46
|
-
ok: false,
|
|
47
|
-
reason: "Remote auto-complete must run via `kynver monitor auto-complete` on the runner host",
|
|
48
|
-
command: `kynver monitor auto-complete --run ${args.runId} --name ${args.workerName}`,
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP tools for the operating-rules instruction policy.
|
|
3
|
-
*
|
|
4
|
-
* agent_os_operating_rules_get — deterministic operating-rules policy + optional injection markdown.
|
|
5
|
-
*/
|
|
6
|
-
import type { MemoryQualityFeedbackToolDeps } from "./memory-quality-feedback.js";
|
|
7
|
-
export declare function registerOperatingRulesTools(deps: MemoryQualityFeedbackToolDeps): void;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP tools for the operating-rules instruction policy.
|
|
3
|
-
*
|
|
4
|
-
* agent_os_operating_rules_get — deterministic operating-rules 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
|
-
"Returns operating rules by exact lookup, not semantic search.",
|
|
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.planId?.trim())
|
|
32
|
-
qs.set("planId", args.planId.trim());
|
|
33
|
-
if (args.includeMarkdown)
|
|
34
|
-
qs.set("includeMarkdown", "1");
|
|
35
|
-
const suffix = qs.toString() ? `?${qs}` : "";
|
|
36
|
-
const data = await get(`/agent-os/${encodeURIComponent(slug)}/memory/instruction-policy${suffix}`);
|
|
37
|
-
return jsonResult(compact({ slug, ...data }));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compact active-plan audit rollup MCP tool.
|
|
3
|
-
*
|
|
4
|
-
* agent_os_plans_audit_rollup_get → GET `/api/agent-os/by-id/{agentOsId}/plans/audit-rollup`
|
|
5
|
-
*/
|
|
6
|
-
type ToolResult = {
|
|
7
|
-
content: {
|
|
8
|
-
type: "text";
|
|
9
|
-
text: string;
|
|
10
|
-
}[];
|
|
11
|
-
structuredContent?: unknown;
|
|
12
|
-
};
|
|
13
|
-
export interface PlanAuditRollupToolDeps {
|
|
14
|
-
register: (name: string, description: string, inputSchema: Record<string, unknown>, cb: (args: any) => any) => void;
|
|
15
|
-
resolveToolSlug: (explicitSlug?: string) => Promise<string>;
|
|
16
|
-
jsonResult: (data: unknown) => ToolResult;
|
|
17
|
-
}
|
|
18
|
-
export declare function registerPlanAuditRollupTools({ register, resolveToolSlug, jsonResult, }: PlanAuditRollupToolDeps): void;
|
|
19
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compact active-plan audit rollup MCP tool.
|
|
3
|
-
*
|
|
4
|
-
* agent_os_plans_audit_rollup_get → GET `/api/agent-os/by-id/{agentOsId}/plans/audit-rollup`
|
|
5
|
-
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { get } from "../lib/kynver-client.js";
|
|
8
|
-
async function resolveAgentOsId(slug) {
|
|
9
|
-
const row = await get(`/agent-os/${encodeURIComponent(slug)}`);
|
|
10
|
-
const id = typeof row.id === "string" ? row.id.trim() : "";
|
|
11
|
-
if (!id) {
|
|
12
|
-
throw new Error(`AgentOS slug "${slug}" did not resolve to an id. Pass agentOsId explicitly or ensure GET /api/agent-os/{slug} returns id.`);
|
|
13
|
-
}
|
|
14
|
-
return id;
|
|
15
|
-
}
|
|
16
|
-
export function registerPlanAuditRollupTools({ register, resolveToolSlug, jsonResult, }) {
|
|
17
|
-
const slugField = z
|
|
18
|
-
.string()
|
|
19
|
-
.optional()
|
|
20
|
-
.describe("AgentOS workspace slug. Omit to use env or the server-discovered primary.");
|
|
21
|
-
register("agent_os_plans_audit_rollup_get", [
|
|
22
|
-
"Compact one-row-per-active-plan audit projection for broad plan completion audits.",
|
|
23
|
-
"Returns classification, latest evidence, stale bookkeeping flags, PR refs, blocked/running tasks, remaining blockers, and recommended next action — without loading every plan body.",
|
|
24
|
-
"Prefer this over Command Center top/actionable slices when answering which plans still need completion.",
|
|
25
|
-
].join(" "), {
|
|
26
|
-
agentOsId: z
|
|
27
|
-
.string()
|
|
28
|
-
.optional()
|
|
29
|
-
.describe("AgentOS workspace id. Resolved from slug when omitted."),
|
|
30
|
-
slug: slugField,
|
|
31
|
-
planLimit: z
|
|
32
|
-
.number()
|
|
33
|
-
.int()
|
|
34
|
-
.min(1)
|
|
35
|
-
.max(200)
|
|
36
|
-
.optional()
|
|
37
|
-
.describe("Max active plans to scan (default 100)."),
|
|
38
|
-
}, async (args) => {
|
|
39
|
-
const slug = await resolveToolSlug(args.slug);
|
|
40
|
-
const agentOsId = typeof args.agentOsId === "string" && args.agentOsId.trim()
|
|
41
|
-
? args.agentOsId.trim()
|
|
42
|
-
: await resolveAgentOsId(slug);
|
|
43
|
-
const qs = new URLSearchParams();
|
|
44
|
-
if (args.planLimit)
|
|
45
|
-
qs.set("planLimit", String(args.planLimit));
|
|
46
|
-
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
47
|
-
return jsonResult(await get(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/plans/audit-rollup${suffix}`));
|
|
48
|
-
});
|
|
49
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { get, post } from "../lib/kynver-client.js";
|
|
3
|
-
const progressStatus = z.enum(["todo", "in_progress", "running", "partial", "blocked", "done"]);
|
|
4
|
-
const roleLane = z.enum([
|
|
5
|
-
"plan_author",
|
|
6
|
-
"plan_reviewer",
|
|
7
|
-
"implementer",
|
|
8
|
-
"report_reviewer",
|
|
9
|
-
"deep_reviewer",
|
|
10
|
-
"repair_implementer",
|
|
11
|
-
"runtime_verifier",
|
|
12
|
-
"user",
|
|
13
|
-
"system",
|
|
14
|
-
]);
|
|
15
|
-
const evidenceSchema = z.object({
|
|
16
|
-
type: z.enum(["path", "pr", "commit", "command", "url", "note"]),
|
|
17
|
-
value: z.string(),
|
|
18
|
-
exitCode: z.number().optional(),
|
|
19
|
-
stdoutTail: z.string().optional(),
|
|
20
|
-
});
|
|
21
|
-
const rowUpsertSchema = z.object({
|
|
22
|
-
rowKey: z.string(),
|
|
23
|
-
title: z.string(),
|
|
24
|
-
description: z.string().optional(),
|
|
25
|
-
ordinal: z.number(),
|
|
26
|
-
status: progressStatus.optional(),
|
|
27
|
-
stageId: z.string().optional(),
|
|
28
|
-
ownerLane: roleLane.optional(),
|
|
29
|
-
taskId: z.string().optional(),
|
|
30
|
-
});
|
|
31
|
-
export function registerPlanProgressTools({ register, resolveToolSlug, jsonResult, compact, }) {
|
|
32
|
-
const slugField = z
|
|
33
|
-
.string()
|
|
34
|
-
.optional()
|
|
35
|
-
.describe("AgentOS workspace slug. Omit to use env or the server-discovered primary.");
|
|
36
|
-
register("agent_os_plan_progress_rows_upsert", "Seed or update structured plan progress rows (canonical checklist state).", {
|
|
37
|
-
planId: z.string(),
|
|
38
|
-
rows: z.array(rowUpsertSchema),
|
|
39
|
-
slug: slugField,
|
|
40
|
-
}, async (args) => {
|
|
41
|
-
const s = await resolveToolSlug(args.slug);
|
|
42
|
-
return jsonResult(await post(`/agent-os/${s}/plans/${args.planId}/progress-rows`, {
|
|
43
|
-
rows: args.rows,
|
|
44
|
-
}));
|
|
45
|
-
});
|
|
46
|
-
register("agent_os_plan_progress_event_append", "Append a role-lane progress event and apply allowed row transition rules.", {
|
|
47
|
-
planId: z.string(),
|
|
48
|
-
rowKey: z.string().optional(),
|
|
49
|
-
rowId: z.string().optional(),
|
|
50
|
-
taskId: z.string().optional(),
|
|
51
|
-
reviewTaskId: z.string().optional(),
|
|
52
|
-
roleLane,
|
|
53
|
-
status: progressStatus,
|
|
54
|
-
note: z.string().optional(),
|
|
55
|
-
remainingWork: z.string().optional(),
|
|
56
|
-
evidence: z.array(evidenceSchema).optional(),
|
|
57
|
-
proposed: z.boolean().optional(),
|
|
58
|
-
executorRef: z.string().optional(),
|
|
59
|
-
slug: slugField,
|
|
60
|
-
}, async (args) => {
|
|
61
|
-
const s = await resolveToolSlug(args.slug);
|
|
62
|
-
const { slug, planId, remainingWork, ...rest } = args;
|
|
63
|
-
return jsonResult(await post(`/agent-os/${s}/plans/${planId}/progress-events`, compact({
|
|
64
|
-
...rest,
|
|
65
|
-
...(remainingWork !== undefined ? { remaining: remainingWork } : {}),
|
|
66
|
-
})));
|
|
67
|
-
});
|
|
68
|
-
register("agent_os_plan_review_task_create", "Create a discovery review/decision AgentTask linked to a progress row.", {
|
|
69
|
-
planId: z.string(),
|
|
70
|
-
title: z.string(),
|
|
71
|
-
description: z.string().optional(),
|
|
72
|
-
rowKey: z.string().optional(),
|
|
73
|
-
rowId: z.string().optional(),
|
|
74
|
-
forWill: z.boolean().optional(),
|
|
75
|
-
parentTaskId: z.string().optional(),
|
|
76
|
-
idempotencyKey: z.string().optional(),
|
|
77
|
-
slug: slugField,
|
|
78
|
-
}, async (args) => {
|
|
79
|
-
const s = await resolveToolSlug(args.slug);
|
|
80
|
-
const { slug, planId, ...rest } = args;
|
|
81
|
-
return jsonResult(await post(`/agent-os/${s}/plans/${planId}/review-tasks`, compact(rest)));
|
|
82
|
-
});
|
|
83
|
-
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.", {
|
|
84
|
-
planId: z.string(),
|
|
85
|
-
rowKey: z.string().optional().describe("Row to focus; omit to clear current focus."),
|
|
86
|
-
rowId: z.string().optional(),
|
|
87
|
-
taskId: z.string().optional(),
|
|
88
|
-
roleLane: roleLane.optional().default("implementer"),
|
|
89
|
-
note: z.string().optional(),
|
|
90
|
-
executorRef: z.string().optional(),
|
|
91
|
-
slug: slugField,
|
|
92
|
-
}, async (args) => {
|
|
93
|
-
const s = await resolveToolSlug(args.slug);
|
|
94
|
-
const { slug, planId, ...rest } = args;
|
|
95
|
-
return jsonResult(await post(`/agent-os/${s}/plans/${planId}/progress-focus`, compact(rest)));
|
|
96
|
-
});
|
|
97
|
-
register("agent_os_plan_progress_rows_list", "List structured progress rows for a plan.", { planId: z.string(), slug: slugField }, async (args) => {
|
|
98
|
-
const s = await resolveToolSlug(args.slug);
|
|
99
|
-
return jsonResult(await get(`/agent-os/${s}/plans/${args.planId}/progress-rows`));
|
|
100
|
-
});
|
|
101
|
-
register("agent_os_plan_progress_events_list", "List append-only progress events for a plan (audit trail).", {
|
|
102
|
-
planId: z.string(),
|
|
103
|
-
rowId: z.string().optional(),
|
|
104
|
-
limit: z.number().int().min(1).max(500).optional(),
|
|
105
|
-
slug: slugField,
|
|
106
|
-
}, async (args) => {
|
|
107
|
-
const s = await resolveToolSlug(args.slug);
|
|
108
|
-
const qs = new URLSearchParams();
|
|
109
|
-
if (args.rowId)
|
|
110
|
-
qs.set("rowId", args.rowId);
|
|
111
|
-
if (args.limit)
|
|
112
|
-
qs.set("limit", String(args.limit));
|
|
113
|
-
const q = qs.toString();
|
|
114
|
-
return jsonResult(await get(`/agent-os/${s}/plans/${args.planId}/progress-events${q ? `?${q}` : ""}`));
|
|
115
|
-
});
|
|
116
|
-
register("agent_os_plan_verify", "Run automated runtime verification (typecheck + test) or operator override for plan closure.", {
|
|
117
|
-
planId: z.string(),
|
|
118
|
-
worktreePath: z.string().optional(),
|
|
119
|
-
taskId: z.string().optional(),
|
|
120
|
-
humanOverride: z.boolean().optional(),
|
|
121
|
-
overrideReason: z.string().optional(),
|
|
122
|
-
slug: slugField,
|
|
123
|
-
}, async (args) => {
|
|
124
|
-
const s = await resolveToolSlug(args.slug);
|
|
125
|
-
const { slug, planId, ...rest } = args;
|
|
126
|
-
return jsonResult(await post(`/agent-os/${s}/plans/${planId}/verify`, compact(rest)));
|
|
127
|
-
});
|
|
128
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { post } from "../lib/kynver-client.js";
|
|
3
|
-
export function registerPlanToFactoryTools({ register, resolveToolSlug, jsonResult, }) {
|
|
4
|
-
const slugField = z
|
|
5
|
-
.string()
|
|
6
|
-
.optional()
|
|
7
|
-
.describe("AgentOS workspace slug. Omit to use env or the server-discovered primary.");
|
|
8
|
-
register("agent_os_plan_run_factory", "Run a plan through the factory: decompose progress rows, mint parent + child harness tasks, wire dependencies and owned paths, and return the next runnable slice.", {
|
|
9
|
-
planId: z.string(),
|
|
10
|
-
dryRun: z.boolean().optional(),
|
|
11
|
-
command: z
|
|
12
|
-
.string()
|
|
13
|
-
.optional()
|
|
14
|
-
.describe('Operator phrase; defaults to "run this plan through the factory".'),
|
|
15
|
-
slug: slugField,
|
|
16
|
-
}, async (args) => {
|
|
17
|
-
const s = await resolveToolSlug(args.slug);
|
|
18
|
-
return jsonResult(await post(`/agent-os/${s}/plans/${args.planId}/run-factory`, {
|
|
19
|
-
dryRun: args.dryRun,
|
|
20
|
-
command: args.command,
|
|
21
|
-
}));
|
|
22
|
-
});
|
|
23
|
-
}
|