@kynver-app/mcp-agent-os 0.3.13 → 0.3.16
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 +18 -1
- package/dist/tools/command-center.d.ts +20 -0
- package/dist/tools/command-center.js +62 -0
- package/dist/tools/tasks.js +1 -2
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -14,6 +14,7 @@ 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
16
|
import { registerGraphTools } from "./tools/graph.js";
|
|
17
|
+
import { registerCommandCenterTools } from "./tools/command-center.js";
|
|
17
18
|
function jsonResult(data) {
|
|
18
19
|
return {
|
|
19
20
|
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
@@ -268,9 +269,17 @@ export function createAgentOsServer() {
|
|
|
268
269
|
const s = await resolveToolSlug(slug);
|
|
269
270
|
return jsonResult(await patch(`/agent-os/${s}/projects/${projectId}`, body));
|
|
270
271
|
});
|
|
271
|
-
register("agent_os_search_memory", "Semantic + keyword hybrid search over the agent's long-term MARM memory (ownerType=agent). Use to recall specific decisions, project details, or lessons without loading full context. Replaces grep/reading MEMORY.md. Results include rrfScore — a Reciprocal Rank Fusion score where ~0.033 is a near-perfect match. Higher is better; do not treat low numbers as poor results.", {
|
|
272
|
+
register("agent_os_search_memory", "Semantic + keyword hybrid search over the agent's long-term MARM memory (ownerType=agent). Use to recall specific decisions, project details, or lessons without loading full context. Replaces grep/reading MEMORY.md. Optionally restrict to one source namespace via sourceId, or several via sourceIds (sourceId takes precedence when both are set). Results include rrfScore — a Reciprocal Rank Fusion score where ~0.033 is a near-perfect match. Higher is better; do not treat low numbers as poor results.", {
|
|
272
273
|
query: z.string().describe("Natural language query to search memory."),
|
|
273
274
|
k: z.number().optional().describe("Number of results (default 10, max 50)."),
|
|
275
|
+
sourceId: z
|
|
276
|
+
.string()
|
|
277
|
+
.optional()
|
|
278
|
+
.describe("Restrict search to a single memory source namespace (e.g. agent:session). Takes precedence over sourceIds when both are set."),
|
|
279
|
+
sourceIds: z
|
|
280
|
+
.array(z.string())
|
|
281
|
+
.optional()
|
|
282
|
+
.describe("Restrict search to any of these source namespaces. Ignored when sourceId is also set."),
|
|
274
283
|
ticker: z.string().optional().describe("Trading desk: filter hits to this ticker symbol."),
|
|
275
284
|
debatePersona: z.enum(["bull", "bear"]).optional().describe("Trading desk: filter to bull or bear advocate memories."),
|
|
276
285
|
slug: slugField,
|
|
@@ -278,6 +287,12 @@ export function createAgentOsServer() {
|
|
|
278
287
|
const params = new URLSearchParams({ q: args.query });
|
|
279
288
|
if (args.k)
|
|
280
289
|
params.set("k", String(args.k));
|
|
290
|
+
if (args.sourceId)
|
|
291
|
+
params.set("sourceId", args.sourceId);
|
|
292
|
+
if (args.sourceIds?.length) {
|
|
293
|
+
for (const id of args.sourceIds)
|
|
294
|
+
params.append("sourceIds", id);
|
|
295
|
+
}
|
|
281
296
|
if (args.ticker)
|
|
282
297
|
params.set("ticker", args.ticker);
|
|
283
298
|
if (args.debatePersona)
|
|
@@ -617,5 +632,7 @@ export function createAgentOsServer() {
|
|
|
617
632
|
registerActionRequiredTools({ register, jsonResult, compact });
|
|
618
633
|
// Operational graph insights — Agent SEE (agent_os_graph_query).
|
|
619
634
|
registerGraphTools({ register, resolveToolSlug, jsonResult });
|
|
635
|
+
// Command Center rollup (by-id route; includes packageVersionHealth).
|
|
636
|
+
registerCommandCenterTools({ register, resolveToolSlug, jsonResult });
|
|
620
637
|
return server;
|
|
621
638
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Center MCP tools — unified rollup for AgentOS operators.
|
|
3
|
+
*
|
|
4
|
+
* agent_os_command_center_get proxies to GET `/api/agent-os/by-id/{agentOsId}/command-center`,
|
|
5
|
+
* the same payload the browser Command Center uses (includes `packageVersionHealth` since #220).
|
|
6
|
+
*/
|
|
7
|
+
type ToolResult = {
|
|
8
|
+
content: {
|
|
9
|
+
type: "text";
|
|
10
|
+
text: string;
|
|
11
|
+
}[];
|
|
12
|
+
structuredContent?: unknown;
|
|
13
|
+
};
|
|
14
|
+
export interface CommandCenterToolDeps {
|
|
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 registerCommandCenterTools({ register, resolveToolSlug, jsonResult, }: CommandCenterToolDeps): void;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command Center MCP tools — unified rollup for AgentOS operators.
|
|
3
|
+
*
|
|
4
|
+
* agent_os_command_center_get proxies to GET `/api/agent-os/by-id/{agentOsId}/command-center`,
|
|
5
|
+
* the same payload the browser Command Center uses (includes `packageVersionHealth` since #220).
|
|
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 registerCommandCenterTools({ register, resolveToolSlug, jsonResult, }) {
|
|
18
|
+
register("agent_os_command_center_get", [
|
|
19
|
+
"Fetch the unified Command Center rollup for the AgentOS workspace:",
|
|
20
|
+
"plan rollups, project hierarchy, action-required items, DQ inbox, harness summaries,",
|
|
21
|
+
"runtime capacity, and packageVersionHealth (managed npm alignment for @kynver-app/runtime).",
|
|
22
|
+
"Same aggregate as the browser Command Center. Omit slug to use env/primary workspace;",
|
|
23
|
+
"pass agentOsId when already known from a prior identity fetch.",
|
|
24
|
+
].join(" "), {
|
|
25
|
+
slug: z
|
|
26
|
+
.string()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe("AgentOS slug. Defaults to the configured env/primary AgentOS."),
|
|
29
|
+
agentOsId: z
|
|
30
|
+
.string()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe("Optional AgentOS row id. When omitted, resolved from slug via GET /api/agent-os/{slug}."),
|
|
33
|
+
since: z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe("ISO timestamp — only include tasks updated after this instant."),
|
|
37
|
+
limit: z
|
|
38
|
+
.number()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("Max tasks to load (server cap 10000)."),
|
|
41
|
+
harnessLimit: z
|
|
42
|
+
.number()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe("Max harness runs in the rollup (server cap 200)."),
|
|
45
|
+
}, async (args) => {
|
|
46
|
+
const slug = await resolveToolSlug(args.slug);
|
|
47
|
+
const agentOsId = typeof args.agentOsId === "string" && args.agentOsId.trim()
|
|
48
|
+
? args.agentOsId.trim()
|
|
49
|
+
: await resolveAgentOsId(slug);
|
|
50
|
+
const qs = new URLSearchParams();
|
|
51
|
+
if (typeof args.since === "string" && args.since.trim())
|
|
52
|
+
qs.set("since", args.since.trim());
|
|
53
|
+
if (typeof args.limit === "number" && Number.isFinite(args.limit)) {
|
|
54
|
+
qs.set("limit", String(args.limit));
|
|
55
|
+
}
|
|
56
|
+
if (typeof args.harnessLimit === "number" && Number.isFinite(args.harnessLimit)) {
|
|
57
|
+
qs.set("harnessLimit", String(args.harnessLimit));
|
|
58
|
+
}
|
|
59
|
+
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
60
|
+
return jsonResult(await get(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/command-center${suffix}`));
|
|
61
|
+
});
|
|
62
|
+
}
|
package/dist/tools/tasks.js
CHANGED
|
@@ -9,7 +9,6 @@ import { z } from "zod";
|
|
|
9
9
|
import { get, post, patch } from "../lib/kynver-client.js";
|
|
10
10
|
const taskStatus = z
|
|
11
11
|
.enum([
|
|
12
|
-
"queued",
|
|
13
12
|
"ready",
|
|
14
13
|
"running",
|
|
15
14
|
"waiting",
|
|
@@ -21,7 +20,7 @@ const taskStatus = z
|
|
|
21
20
|
"failed",
|
|
22
21
|
"cancelled",
|
|
23
22
|
])
|
|
24
|
-
.describe("Work-state lifecycle. `ready` = admitted, can start now
|
|
23
|
+
.describe("Work-state lifecycle. `ready` = admitted, can start now. " +
|
|
25
24
|
"`running` = an executor holds a live lease. `waiting` = gated on upstream tasks (set dependsOnTaskIds; auto-promotes " +
|
|
26
25
|
"to ready when they're all done). `scheduled` = deferred to a time (set scheduledFor; auto-promotes to ready when it " +
|
|
27
26
|
"passes). `blocked`/`needs_input` = a human must resolve. `awaiting_review` = review gate open. Don't hand-set " +
|
package/package.json
CHANGED