@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
package/dist/tools/taskflow.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TaskFlow MCP tools — Kynver-native managed-flow lifecycle parity for Hermes/harness.
|
|
3
|
-
*
|
|
4
|
-
* agent_os_taskflow_list → GET …/taskflow
|
|
5
|
-
* agent_os_taskflow_get → GET …/taskflow?flowId=
|
|
6
|
-
* agent_os_taskflow_mutate → POST …/taskflow (create / resume / wait / finish / fail / request_cancel)
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
import { get, post } from "../lib/kynver-client.js";
|
|
10
|
-
async function resolveAgentOsId(slug) {
|
|
11
|
-
const row = await get(`/agent-os/${encodeURIComponent(slug)}`);
|
|
12
|
-
const id = typeof row.id === "string" ? row.id.trim() : "";
|
|
13
|
-
if (!id) {
|
|
14
|
-
throw new Error(`AgentOS slug "${slug}" did not resolve to an id.`);
|
|
15
|
-
}
|
|
16
|
-
return id;
|
|
17
|
-
}
|
|
18
|
-
const idSchema = {
|
|
19
|
-
agentOsId: z.string().uuid().optional().describe("AgentOS workspace id"),
|
|
20
|
-
slug: z.string().optional().describe("AgentOS slug (resolved to id when agentOsId omitted)"),
|
|
21
|
-
};
|
|
22
|
-
export function registerTaskflowTools({ register, resolveToolSlug, jsonResult, }) {
|
|
23
|
-
register("agent_os_taskflow_list", [
|
|
24
|
-
"List Kynver-native managed TaskFlows projected to the openclaw adapter wire shape.",
|
|
25
|
-
"Defaults: scope=active, detail=compact (use scope=all|recent and detail=full for audits).",
|
|
26
|
-
"Supports limit/offset flow pagination; taskWindow.truncated signals the shared 1000-row board window was saturated.",
|
|
27
|
-
"Safe for verify_live — read-only.",
|
|
28
|
-
].join(" "), {
|
|
29
|
-
...idSchema,
|
|
30
|
-
scope: z
|
|
31
|
-
.enum(["active", "recent", "all"])
|
|
32
|
-
.optional()
|
|
33
|
-
.describe("Flow inventory scope (default active — non-terminal only)"),
|
|
34
|
-
detail: z
|
|
35
|
-
.enum(["compact", "full"])
|
|
36
|
-
.optional()
|
|
37
|
-
.describe("Projection detail (default compact — pruned terminal state)"),
|
|
38
|
-
limit: z
|
|
39
|
-
.number()
|
|
40
|
-
.int()
|
|
41
|
-
.positive()
|
|
42
|
-
.max(200)
|
|
43
|
-
.optional()
|
|
44
|
-
.describe("Max flows per page (default 50, max 200)"),
|
|
45
|
-
offset: z
|
|
46
|
-
.number()
|
|
47
|
-
.int()
|
|
48
|
-
.nonnegative()
|
|
49
|
-
.optional()
|
|
50
|
-
.describe("Flow page offset (default 0)"),
|
|
51
|
-
}, async (args) => {
|
|
52
|
-
const agentOsId = args.agentOsId?.trim() ||
|
|
53
|
-
(await resolveAgentOsId(args.slug ?? (await resolveToolSlug())));
|
|
54
|
-
const params = new URLSearchParams();
|
|
55
|
-
if (args.scope)
|
|
56
|
-
params.set("scope", args.scope);
|
|
57
|
-
if (args.detail)
|
|
58
|
-
params.set("detail", args.detail);
|
|
59
|
-
if (args.limit !== undefined)
|
|
60
|
-
params.set("limit", String(args.limit));
|
|
61
|
-
if (args.offset !== undefined)
|
|
62
|
-
params.set("offset", String(args.offset));
|
|
63
|
-
const qs = params.toString();
|
|
64
|
-
const data = await get(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/taskflow${qs ? `?${qs}` : ""}`);
|
|
65
|
-
return jsonResult(data);
|
|
66
|
-
});
|
|
67
|
-
register("agent_os_taskflow_get", [
|
|
68
|
-
"Fetch one managed TaskFlow by flowId using the Hermes/native adapter wire shape.",
|
|
69
|
-
"Safe for verify_live — read-only.",
|
|
70
|
-
].join(" "), {
|
|
71
|
-
...idSchema,
|
|
72
|
-
flowId: z.string().describe("TaskFlow flowId"),
|
|
73
|
-
}, async (args) => {
|
|
74
|
-
const agentOsId = args.agentOsId?.trim() ||
|
|
75
|
-
(await resolveAgentOsId(args.slug ?? (await resolveToolSlug())));
|
|
76
|
-
const data = await get(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/taskflow?flowId=${encodeURIComponent(args.flowId)}`);
|
|
77
|
-
return jsonResult(data);
|
|
78
|
-
});
|
|
79
|
-
register("agent_os_taskflow_mutate", [
|
|
80
|
-
"Create or mutate a Kynver-native managed TaskFlow (create, resume, wait, finish, fail, request_cancel).",
|
|
81
|
-
"Lifecycle actions require expectedRevision for optimistic concurrency — matches openclaw TF2 guards.",
|
|
82
|
-
].join(" "), {
|
|
83
|
-
...idSchema,
|
|
84
|
-
action: z
|
|
85
|
-
.enum(["create", "resume", "wait", "finish", "fail", "request_cancel"])
|
|
86
|
-
.describe("Lifecycle action"),
|
|
87
|
-
flowId: z.string().describe("TaskFlow flowId"),
|
|
88
|
-
templateId: z.string().optional().describe("Required for create"),
|
|
89
|
-
goal: z.string().optional().describe("Required for create"),
|
|
90
|
-
expectedRevision: z.number().int().nonnegative().optional(),
|
|
91
|
-
currentStep: z.string().optional(),
|
|
92
|
-
stateJson: z.record(z.unknown()).optional().describe("Managed-flow state blob (includes __taskflow cursor)"),
|
|
93
|
-
waitJson: z.record(z.unknown()).optional().describe("Wait payload when action=wait"),
|
|
94
|
-
blockedTaskId: z.string().optional(),
|
|
95
|
-
blockedSummary: z.string().optional(),
|
|
96
|
-
callbackKey: z
|
|
97
|
-
.object({
|
|
98
|
-
flowId: z.string(),
|
|
99
|
-
revision: z.number().int().nonnegative(),
|
|
100
|
-
idempotencyKey: z.string(),
|
|
101
|
-
stepGeneration: z.number().int().nonnegative().optional(),
|
|
102
|
-
childAttempt: z.number().int().nonnegative().optional(),
|
|
103
|
-
})
|
|
104
|
-
.optional()
|
|
105
|
-
.describe("TF2 callback guard key — stale/terminal/duplicate mint rejection"),
|
|
106
|
-
}, async (args) => {
|
|
107
|
-
const agentOsId = args.agentOsId?.trim() ||
|
|
108
|
-
(await resolveAgentOsId(args.slug ?? (await resolveToolSlug())));
|
|
109
|
-
const data = await post(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/taskflow`, {
|
|
110
|
-
action: args.action,
|
|
111
|
-
flowId: args.flowId,
|
|
112
|
-
templateId: args.templateId,
|
|
113
|
-
goal: args.goal,
|
|
114
|
-
expectedRevision: args.expectedRevision,
|
|
115
|
-
currentStep: args.currentStep,
|
|
116
|
-
stateJson: args.stateJson,
|
|
117
|
-
waitJson: args.waitJson,
|
|
118
|
-
blockedTaskId: args.blockedTaskId,
|
|
119
|
-
blockedSummary: args.blockedSummary,
|
|
120
|
-
callbackKey: args.callbackKey,
|
|
121
|
-
});
|
|
122
|
-
return jsonResult(data);
|
|
123
|
-
});
|
|
124
|
-
}
|
package/dist/tools/tasks.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AgentTask board MCP tools — batch 1 (Ghost-facing CRUD) and batch 1.5
|
|
3
|
-
* (steering / lease). Each tool proxies to `/api/agent-os/{slug}/tasks/*`.
|
|
4
|
-
*
|
|
5
|
-
* Kept in its own module so server.ts does not grow monolithic. server.ts
|
|
6
|
-
* calls `registerTaskTools` with the helpers it already has in scope.
|
|
7
|
-
*/
|
|
8
|
-
type ToolResult = {
|
|
9
|
-
content: {
|
|
10
|
-
type: "text";
|
|
11
|
-
text: string;
|
|
12
|
-
}[];
|
|
13
|
-
structuredContent?: unknown;
|
|
14
|
-
};
|
|
15
|
-
export interface TaskToolDeps {
|
|
16
|
-
/** server.ts's thin wrapper over `server.registerTool`. */
|
|
17
|
-
register: (name: string, description: string, inputSchema: Record<string, unknown>, cb: (args: any) => any) => void;
|
|
18
|
-
/** Resolve the effective AgentOS slug (explicit arg → env → discovered primary). */
|
|
19
|
-
resolveToolSlug: (explicitSlug?: string) => Promise<string>;
|
|
20
|
-
/** Wrap a value as an MCP text + structuredContent result. */
|
|
21
|
-
jsonResult: (data: unknown) => ToolResult;
|
|
22
|
-
/** Drop `undefined` entries from an object. */
|
|
23
|
-
compact: (source: Record<string, unknown>) => Record<string, unknown>;
|
|
24
|
-
}
|
|
25
|
-
export declare function registerTaskTools({ register, resolveToolSlug, jsonResult, compact, }: TaskToolDeps): void;
|
|
26
|
-
export {};
|
package/dist/tools/tasks.js
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AgentTask board MCP tools — batch 1 (Ghost-facing CRUD) and batch 1.5
|
|
3
|
-
* (steering / lease). Each tool proxies to `/api/agent-os/{slug}/tasks/*`.
|
|
4
|
-
*
|
|
5
|
-
* Kept in its own module so server.ts does not grow monolithic. server.ts
|
|
6
|
-
* calls `registerTaskTools` with the helpers it already has in scope.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
import { get, post, patch } from "../lib/kynver-client.js";
|
|
10
|
-
const taskStatus = z
|
|
11
|
-
.enum([
|
|
12
|
-
"ready",
|
|
13
|
-
"running",
|
|
14
|
-
"waiting",
|
|
15
|
-
"scheduled",
|
|
16
|
-
"blocked",
|
|
17
|
-
"needs_input",
|
|
18
|
-
"awaiting_review",
|
|
19
|
-
"done",
|
|
20
|
-
"failed",
|
|
21
|
-
"cancelled",
|
|
22
|
-
])
|
|
23
|
-
.describe("Work-state lifecycle. `ready` = admitted, can start now. " +
|
|
24
|
-
"`running` = an executor holds a live lease. `waiting` = gated on upstream tasks (set dependsOnTaskIds; auto-promotes " +
|
|
25
|
-
"to ready when they're all done). `scheduled` = deferred to a time (set scheduledFor; auto-promotes to ready when it " +
|
|
26
|
-
"passes). `blocked`/`needs_input` = a human must resolve. `awaiting_review` = review gate open. Don't hand-set " +
|
|
27
|
-
"ready→running; the dispatcher/executor lease owns that.");
|
|
28
|
-
const taskPriority = z
|
|
29
|
-
.enum(["low", "normal", "high", "critical"])
|
|
30
|
-
.describe("Priority is a worker-capacity queue signal, not importance. Default 'normal' (cleanup 'low'). " +
|
|
31
|
-
"Do NOT inherit plan/goal priority. Use 'high' only when harness workers are saturated and ready work waits for slots. " +
|
|
32
|
-
"Use 'critical' only for live production/security incidents — pass priorityEscalationReason or cite in title/description. " +
|
|
33
|
-
"When slots are free, omit priority and dispatch at normal. The API downgrades importance-style high/critical.");
|
|
34
|
-
const priorityEscalationReason = z
|
|
35
|
-
.string()
|
|
36
|
-
.optional()
|
|
37
|
-
.describe("Required for critical: quote the requesting user or name the live production/security incident. " +
|
|
38
|
-
"High does not use this field — high requires worker-capacity contention at create time.");
|
|
39
|
-
const taskExecutor = z.enum(["inline", "harness", "acp", "manual"]);
|
|
40
|
-
const taskEventType = z.enum([
|
|
41
|
-
"created",
|
|
42
|
-
"started",
|
|
43
|
-
"worker_update",
|
|
44
|
-
"blocked",
|
|
45
|
-
"steer",
|
|
46
|
-
"artifact",
|
|
47
|
-
"review",
|
|
48
|
-
"done",
|
|
49
|
-
"failed",
|
|
50
|
-
]);
|
|
51
|
-
const artifactVisibility = z.enum(["internal", "telegram_safe", "public_pr_safe"]);
|
|
52
|
-
const personaSlug = z
|
|
53
|
-
.string()
|
|
54
|
-
.nullable()
|
|
55
|
-
.optional()
|
|
56
|
-
.describe("Lane-expert worker slug to attribute the task to, or null to clear/filter unassigned tasks.");
|
|
57
|
-
const scheduledFor = z
|
|
58
|
-
.string()
|
|
59
|
-
.nullable()
|
|
60
|
-
.optional()
|
|
61
|
-
.describe("ISO-8601 timestamp to defer the task to. A future time creates the task as `scheduled`; the operator loop " +
|
|
62
|
-
"auto-promotes it to `ready` once the time passes. null clears the schedule.");
|
|
63
|
-
const dependsOnTaskIds = z
|
|
64
|
-
.array(z.string())
|
|
65
|
-
.optional()
|
|
66
|
-
.describe("Upstream task ids this task waits on. Creates the task as `waiting`; the operator loop auto-promotes it to " +
|
|
67
|
-
"`ready` once every listed task is `done` (a failed/cancelled upstream keeps it waiting).");
|
|
68
|
-
export function registerTaskTools({ register, resolveToolSlug, jsonResult, compact, }) {
|
|
69
|
-
const slugField = z
|
|
70
|
-
.string()
|
|
71
|
-
.optional()
|
|
72
|
-
.describe("AgentOS slug. Omit to use env or the server-discovered primary.");
|
|
73
|
-
register("agent_os_task_create", "Create an AgentTask on the board. New tasks start `ready` (dispatchable now) unless you defer them: pass scheduledFor for a timed start (→ `scheduled`) or dependsOnTaskIds to gate on upstream work (→ `waiting`); both auto-promote to `ready` when their gate clears. Idempotent within the AgentOS: pass idempotencyKey (or requestId) from the foreground turn so a Telegram retry or Ghost restart returns the existing task instead of spawning a duplicate. Response includes `created` (false = an existing task was returned). Do NOT create closeout-only bookkeeping tasks whose purpose is merely to close/reconcile/clean up another task — complete/update/block/cancel the existing task (or spawn a child only for genuine unresolved implementation work).", {
|
|
74
|
-
title: z
|
|
75
|
-
.string()
|
|
76
|
-
.describe("Short task title (required). Never a closeout-only sweep — mutate/close the existing task instead."),
|
|
77
|
-
description: z.string().optional(),
|
|
78
|
-
priority: taskPriority.optional(),
|
|
79
|
-
priorityEscalationReason,
|
|
80
|
-
executor: taskExecutor.optional().describe("How the task runs: inline | harness | acp | manual."),
|
|
81
|
-
executorRef: z.string().optional().describe("Opaque ref to the executor process / unit."),
|
|
82
|
-
parentTaskId: z.string().optional().describe("Parent task id when this is one of 2+ coordinated workers."),
|
|
83
|
-
goalId: z.string().optional(),
|
|
84
|
-
projectId: z.string().optional(),
|
|
85
|
-
planId: z
|
|
86
|
-
.string()
|
|
87
|
-
.optional()
|
|
88
|
-
.describe("AgentPlan id to link this task to; required for plan-scoped harness work."),
|
|
89
|
-
planStageId: z.string().optional().describe("Optional AgentPlan stage id for finer plan lineage."),
|
|
90
|
-
personaSlug,
|
|
91
|
-
scheduledFor,
|
|
92
|
-
dependsOnTaskIds,
|
|
93
|
-
standaloneReason: z
|
|
94
|
-
.string()
|
|
95
|
-
.optional()
|
|
96
|
-
.describe("Required when intentionally creating an unscoped harness task without parentTaskId or planId; explain why it is standalone."),
|
|
97
|
-
idempotencyKey: z.string().optional().describe("Dedupe key from the foreground turn. Strongly recommended."),
|
|
98
|
-
requestId: z.string().optional().describe("Raw foreground request id; used as the dedupe key if idempotencyKey is absent."),
|
|
99
|
-
slug: slugField,
|
|
100
|
-
}, async (args) => {
|
|
101
|
-
const { slug, ...body } = args;
|
|
102
|
-
const s = await resolveToolSlug(slug);
|
|
103
|
-
return jsonResult(await post(`/agent-os/${s}/tasks`, compact(body)));
|
|
104
|
-
});
|
|
105
|
-
register("agent_os_task_get", "Fetch one AgentTask by id, including lease, artifact, and steer-cursor fields.", { taskId: z.string(), slug: slugField }, async (args) => {
|
|
106
|
-
const s = await resolveToolSlug(args.slug);
|
|
107
|
-
return jsonResult(await get(`/agent-os/${s}/tasks/${args.taskId}`));
|
|
108
|
-
});
|
|
109
|
-
register("agent_os_task_list", "List AgentTasks on the board, optionally filtered by status, executor, or parent task.", {
|
|
110
|
-
status: taskStatus.optional(),
|
|
111
|
-
executor: taskExecutor.optional(),
|
|
112
|
-
parentTaskId: z.string().optional(),
|
|
113
|
-
personaSlug,
|
|
114
|
-
limit: z.number().optional().describe("Max rows (default 50, max 200)."),
|
|
115
|
-
slug: slugField,
|
|
116
|
-
}, async (args) => {
|
|
117
|
-
const params = new URLSearchParams();
|
|
118
|
-
if (args.status)
|
|
119
|
-
params.set("status", args.status);
|
|
120
|
-
if (args.executor)
|
|
121
|
-
params.set("executor", args.executor);
|
|
122
|
-
if (args.parentTaskId)
|
|
123
|
-
params.set("parentTaskId", args.parentTaskId);
|
|
124
|
-
if (args.personaSlug !== undefined)
|
|
125
|
-
params.set("personaSlug", args.personaSlug ?? "");
|
|
126
|
-
if (args.limit)
|
|
127
|
-
params.set("limit", String(args.limit));
|
|
128
|
-
const qs = params.toString();
|
|
129
|
-
const s = await resolveToolSlug(args.slug);
|
|
130
|
-
return jsonResult(await get(`/agent-os/${s}/tasks${qs ? `?${qs}` : ""}`));
|
|
131
|
-
});
|
|
132
|
-
register("agent_os_task_update", "Patch an AgentTask: status, priority, executor, links, schedule (scheduledFor), dependencies (dependsOnTaskIds), progress summary, blocker, or first-class artifact refs (branch/worktreePath/prUrl/headCommit). Does not touch lease fields — use claim/renew for those.", {
|
|
133
|
-
taskId: z.string(),
|
|
134
|
-
title: z.string().optional(),
|
|
135
|
-
description: z.string().optional(),
|
|
136
|
-
status: taskStatus.optional(),
|
|
137
|
-
priority: taskPriority.optional(),
|
|
138
|
-
priorityEscalationReason,
|
|
139
|
-
executor: taskExecutor.optional(),
|
|
140
|
-
executorRef: z.string().optional(),
|
|
141
|
-
parentTaskId: z.string().optional(),
|
|
142
|
-
goalId: z.string().optional(),
|
|
143
|
-
projectId: z.string().optional(),
|
|
144
|
-
planId: z.string().nullable().optional(),
|
|
145
|
-
planStageId: z.string().nullable().optional(),
|
|
146
|
-
personaSlug,
|
|
147
|
-
scheduledFor,
|
|
148
|
-
dependsOnTaskIds,
|
|
149
|
-
lastSummary: z.string().optional().describe("Latest progress summary."),
|
|
150
|
-
blocker: z.string().nullable().optional().describe("Blocker text, or null to clear it."),
|
|
151
|
-
branch: z.string().optional(),
|
|
152
|
-
worktreePath: z.string().optional(),
|
|
153
|
-
prUrl: z.string().optional(),
|
|
154
|
-
headCommit: z.string().optional(),
|
|
155
|
-
slug: slugField,
|
|
156
|
-
}, async (args) => {
|
|
157
|
-
const { slug, taskId, ...body } = args;
|
|
158
|
-
const s = await resolveToolSlug(slug);
|
|
159
|
-
return jsonResult(await patch(`/agent-os/${s}/tasks/${taskId}`, compact(body)));
|
|
160
|
-
});
|
|
161
|
-
register("agent_os_task_log_event", "Append one event to a task's append-only journal: worker_update, blocked, artifact, review, etc. For artifact events set artifactVisibility (internal | telegram_safe | public_pr_safe) and put branch/prUrl/headCommit/worktreePath in payload — they are promoted to the task. Pass a stable eventKey so a board-down spool can replay without duplicates.", {
|
|
162
|
-
taskId: z.string(),
|
|
163
|
-
type: taskEventType.describe("Event type."),
|
|
164
|
-
payload: z.record(z.string(), z.unknown()).optional().describe("Structured event detail."),
|
|
165
|
-
artifactVisibility: artifactVisibility
|
|
166
|
-
.optional()
|
|
167
|
-
.describe("Required mental model for artifact events; defaults to internal (most conservative)."),
|
|
168
|
-
eventKey: z.string().optional().describe("Stable idempotency key for spool replay."),
|
|
169
|
-
slug: slugField,
|
|
170
|
-
}, async (args) => {
|
|
171
|
-
const { slug, taskId, ...body } = args;
|
|
172
|
-
const s = await resolveToolSlug(slug);
|
|
173
|
-
return jsonResult(await post(`/agent-os/${s}/tasks/${taskId}/events`, compact(body)));
|
|
174
|
-
});
|
|
175
|
-
register("agent_os_task_close", "Close a task into a terminal status (done | failed | cancelled, default done). Stamps closedAt, releases the lease, records the summary, and appends a terminal journal event.", {
|
|
176
|
-
taskId: z.string(),
|
|
177
|
-
status: z.enum(["done", "failed", "cancelled"]).optional(),
|
|
178
|
-
summary: z.string().optional().describe("Closing summary."),
|
|
179
|
-
slug: slugField,
|
|
180
|
-
}, async (args) => {
|
|
181
|
-
const { slug, taskId, ...body } = args;
|
|
182
|
-
const s = await resolveToolSlug(slug);
|
|
183
|
-
return jsonResult(await post(`/agent-os/${s}/tasks/${taskId}/close`, compact(body)));
|
|
184
|
-
});
|
|
185
|
-
register("agent_os_task_steer", "Append a steer event to a task. Steers are an ordered log — two concurrent steers never overwrite each other; the task's lastSteerEventId tracks the newest. The executor reads steers between its cursor and lastSteerEventId.", {
|
|
186
|
-
taskId: z.string(),
|
|
187
|
-
message: z.string().describe("The steering instruction."),
|
|
188
|
-
detail: z.record(z.string(), z.unknown()).optional(),
|
|
189
|
-
eventKey: z.string().optional().describe("Stable idempotency key for spool replay."),
|
|
190
|
-
slug: slugField,
|
|
191
|
-
}, async (args) => {
|
|
192
|
-
const { slug, taskId, ...body } = args;
|
|
193
|
-
const s = await resolveToolSlug(slug);
|
|
194
|
-
return jsonResult(await post(`/agent-os/${s}/tasks/${taskId}/steer`, compact(body)));
|
|
195
|
-
});
|
|
196
|
-
register("agent_os_task_abort", "Hard-abort a task: marks it cancelled and stamps a closing event. Local executor / worktree teardown is the executor's job — this only updates durable board state.", {
|
|
197
|
-
taskId: z.string(),
|
|
198
|
-
reason: z.string().optional(),
|
|
199
|
-
slug: slugField,
|
|
200
|
-
}, async (args) => {
|
|
201
|
-
const { slug, taskId, ...body } = args;
|
|
202
|
-
const s = await resolveToolSlug(slug);
|
|
203
|
-
return jsonResult(await post(`/agent-os/${s}/tasks/${taskId}/abort`, compact(body)));
|
|
204
|
-
});
|
|
205
|
-
register("agent_os_task_claim", "Atomically claim a task lease. Succeeds only when the task is non-terminal and its lease is free (never set or expired). The same conditional update increments `attempt` and flips the task to running. A failed claim returns ok=false with a reason (lease_held | terminal | not_found).", {
|
|
206
|
-
taskId: z.string(),
|
|
207
|
-
leaseOwner: z.string().describe("Unique id of the claiming executor."),
|
|
208
|
-
leaseDurationMs: z.number().optional().describe("Lease duration in ms (default 300000)."),
|
|
209
|
-
slug: slugField,
|
|
210
|
-
}, async (args) => {
|
|
211
|
-
const { slug, taskId, ...body } = args;
|
|
212
|
-
const s = await resolveToolSlug(slug);
|
|
213
|
-
return jsonResult(await post(`/agent-os/${s}/tasks/${taskId}/claim`, compact(body)));
|
|
214
|
-
});
|
|
215
|
-
register("agent_os_task_renew_lease", "Renew a lease the caller already owns — call periodically while the executor is alive. Succeeds only when leaseOwner matches and the lease has not expired. A failed renew returns ok=false with reason owner_mismatch or lease_expired; the caller must re-claim.", {
|
|
216
|
-
taskId: z.string(),
|
|
217
|
-
leaseOwner: z.string().describe("Must match the current lease owner."),
|
|
218
|
-
leaseDurationMs: z.number().optional().describe("New lease duration in ms (default 300000)."),
|
|
219
|
-
slug: slugField,
|
|
220
|
-
}, async (args) => {
|
|
221
|
-
const { slug, taskId, ...body } = args;
|
|
222
|
-
const s = await resolveToolSlug(slug);
|
|
223
|
-
return jsonResult(await post(`/agent-os/${s}/tasks/${taskId}/renew-lease`, compact(body)));
|
|
224
|
-
});
|
|
225
|
-
const operatorPriorityLevel = z
|
|
226
|
-
.enum(["high", "critical"])
|
|
227
|
-
.optional()
|
|
228
|
-
.describe("Override dispatch level when expediting (default high). Separate from stored task priority — " +
|
|
229
|
-
"uses audited operatorPriority* fields, not priority inflation.");
|
|
230
|
-
register("agent_os_task_operator_priority", "Expedite a ready task to the front of the operator dispatch queue, or clear the override. " +
|
|
231
|
-
"Requires tasks:write. Set action=set with reason (12+ chars); action=clear to demote. " +
|
|
232
|
-
"Does not bypass blockers, dependencies, scheduledFor, Will/security gates, or lane filters — " +
|
|
233
|
-
"only reorders eligible dispatch candidates.", {
|
|
234
|
-
taskId: z.string(),
|
|
235
|
-
action: z
|
|
236
|
-
.enum(["set", "clear"])
|
|
237
|
-
.optional()
|
|
238
|
-
.describe("set = front-of-queue override (default). clear = remove override."),
|
|
239
|
-
reason: z
|
|
240
|
-
.string()
|
|
241
|
-
.optional()
|
|
242
|
-
.describe("Required for set — operator-authored reason (min 12 chars)."),
|
|
243
|
-
level: operatorPriorityLevel,
|
|
244
|
-
clearNote: z.string().optional().describe("Optional note when clearing the override."),
|
|
245
|
-
slug: slugField,
|
|
246
|
-
}, async (args) => {
|
|
247
|
-
const { slug, taskId, ...body } = args;
|
|
248
|
-
const s = await resolveToolSlug(slug);
|
|
249
|
-
return jsonResult(await post(`/agent-os/${s}/tasks/${taskId}/operator-priority`, compact(body)));
|
|
250
|
-
});
|
|
251
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workbench control MCP tools (M1) — steer the whole Command Center view.
|
|
3
|
-
*/
|
|
4
|
-
type ToolResult = {
|
|
5
|
-
content: {
|
|
6
|
-
type: "text";
|
|
7
|
-
text: string;
|
|
8
|
-
}[];
|
|
9
|
-
structuredContent?: unknown;
|
|
10
|
-
};
|
|
11
|
-
export interface WorkbenchToolDeps {
|
|
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 registerWorkbenchTools({ register, resolveToolSlug, jsonResult, }: WorkbenchToolDeps): void;
|
|
17
|
-
export {};
|
package/dist/tools/workbench.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workbench control MCP tools (M1) — steer the whole Command Center view.
|
|
3
|
-
*/
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { get, post } from "../lib/kynver-client.js";
|
|
6
|
-
const commandKind = z.enum([
|
|
7
|
-
"navigate",
|
|
8
|
-
"focus",
|
|
9
|
-
"drill",
|
|
10
|
-
"drill_pop",
|
|
11
|
-
"open_panel",
|
|
12
|
-
"open_report",
|
|
13
|
-
"open_pr_history",
|
|
14
|
-
"highlight",
|
|
15
|
-
"annotate",
|
|
16
|
-
"filter",
|
|
17
|
-
"graph",
|
|
18
|
-
"reset",
|
|
19
|
-
"yield",
|
|
20
|
-
"take",
|
|
21
|
-
]);
|
|
22
|
-
/** Keep in sync with COMMAND_CENTER_VIEW_MODES in command-center-url-state.ts */
|
|
23
|
-
const workbenchView = z.enum([
|
|
24
|
-
"overview",
|
|
25
|
-
"flow",
|
|
26
|
-
"marketing",
|
|
27
|
-
"projects",
|
|
28
|
-
"tasks",
|
|
29
|
-
"goals",
|
|
30
|
-
"dq",
|
|
31
|
-
"web",
|
|
32
|
-
"review",
|
|
33
|
-
"system",
|
|
34
|
-
"health",
|
|
35
|
-
]);
|
|
36
|
-
export function registerWorkbenchTools({ register, resolveToolSlug, jsonResult, }) {
|
|
37
|
-
register("agent_os_workbench_query", [
|
|
38
|
-
"Read the operator's current workbench focus (view mode, drilldown stack, focused entity)",
|
|
39
|
-
"plus a compact rollup digest. Use before steering so you and the operator share context.",
|
|
40
|
-
"Read-only.",
|
|
41
|
-
].join(" "), {
|
|
42
|
-
slug: z.string().optional().describe("AgentOS slug. Defaults to env/primary."),
|
|
43
|
-
}, async (args) => {
|
|
44
|
-
const slug = await resolveToolSlug(args.slug);
|
|
45
|
-
return jsonResult(await get(`/agent-os/${slug}/workbench/focus`));
|
|
46
|
-
});
|
|
47
|
-
register("agent_os_workbench_view", [
|
|
48
|
-
"Steer the Command Center workbench (navigate, focus, drill, open panels, filter, reset).",
|
|
49
|
-
"View-control only — does not mutate tasks/plans. Delivered over SSE to open surfaces.",
|
|
50
|
-
"For 3D graph camera commands, use kind=graph or agent_os_graph_view.",
|
|
51
|
-
].join(" "), {
|
|
52
|
-
slug: z.string().optional(),
|
|
53
|
-
kind: commandKind,
|
|
54
|
-
view: workbenchView.optional(),
|
|
55
|
-
target: z.string().optional().describe("EntityRef e.g. task:<id>, plan:<id>"),
|
|
56
|
-
push: z.boolean().optional().describe("For drill: push onto stack (default true)"),
|
|
57
|
-
panel: z
|
|
58
|
-
.string()
|
|
59
|
-
.optional()
|
|
60
|
-
.describe("For open_panel: plan-detail | task-detail | goal-detail | project-detail | dq | lane-experts | graph-rail | system-console | system-group:<groupId> | system:<panelId>"),
|
|
61
|
-
tab: z.string().optional(),
|
|
62
|
-
personaSlug: z.string().optional(),
|
|
63
|
-
planId: z.string().optional(),
|
|
64
|
-
prUrl: z.string().optional(),
|
|
65
|
-
refs: z
|
|
66
|
-
.array(z.string())
|
|
67
|
-
.optional()
|
|
68
|
-
.describe("For highlight: EntityRefs to point at (max 20) — renders a visible callout"),
|
|
69
|
-
ttlMs: z
|
|
70
|
-
.number()
|
|
71
|
-
.optional()
|
|
72
|
-
.describe("For highlight: callout duration ms (2000–120000, default 12000)"),
|
|
73
|
-
note: z.string().optional().describe("For annotate: note text (≤500 chars) shown with target"),
|
|
74
|
-
chip: z.string().optional(),
|
|
75
|
-
review: z.string().optional(),
|
|
76
|
-
q: z.string().optional(),
|
|
77
|
-
sessionId: z.string().optional(),
|
|
78
|
-
nodeId: z.string().optional().describe("For kind=graph: graph node id"),
|
|
79
|
-
graphKind: z.enum(["focus", "filter", "reset", "highlight"]).optional(),
|
|
80
|
-
}, async (args) => {
|
|
81
|
-
const slug = await resolveToolSlug(args.slug);
|
|
82
|
-
const body = {
|
|
83
|
-
kind: args.kind,
|
|
84
|
-
source: "agent",
|
|
85
|
-
sessionId: args.sessionId,
|
|
86
|
-
personaSlug: args.personaSlug,
|
|
87
|
-
};
|
|
88
|
-
switch (args.kind) {
|
|
89
|
-
case "navigate":
|
|
90
|
-
body.navigate = { view: args.view };
|
|
91
|
-
break;
|
|
92
|
-
case "focus":
|
|
93
|
-
body.focus = { target: args.target };
|
|
94
|
-
break;
|
|
95
|
-
case "drill":
|
|
96
|
-
body.drill = { target: args.target, push: args.push };
|
|
97
|
-
break;
|
|
98
|
-
case "drill_pop":
|
|
99
|
-
body.drill_pop = {};
|
|
100
|
-
break;
|
|
101
|
-
case "open_panel":
|
|
102
|
-
body.open_panel = { panel: args.panel, tab: args.tab };
|
|
103
|
-
break;
|
|
104
|
-
case "open_report":
|
|
105
|
-
body.open_report = { personaSlug: args.personaSlug };
|
|
106
|
-
break;
|
|
107
|
-
case "open_pr_history":
|
|
108
|
-
body.open_pr_history = { planId: args.planId, prUrl: args.prUrl };
|
|
109
|
-
break;
|
|
110
|
-
case "highlight":
|
|
111
|
-
body.highlight = { refs: args.refs, ttlMs: args.ttlMs };
|
|
112
|
-
break;
|
|
113
|
-
case "annotate":
|
|
114
|
-
body.annotate = { target: args.target, note: args.note };
|
|
115
|
-
break;
|
|
116
|
-
case "filter":
|
|
117
|
-
body.filter = { chip: args.chip, review: args.review, q: args.q };
|
|
118
|
-
break;
|
|
119
|
-
case "graph":
|
|
120
|
-
body.graph = {
|
|
121
|
-
command: {
|
|
122
|
-
kind: args.graphKind ?? "focus",
|
|
123
|
-
nodeId: args.nodeId,
|
|
124
|
-
source: "agent",
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
break;
|
|
128
|
-
default:
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
return jsonResult(await post(`/agent-os/${slug}/workbench/command`, body));
|
|
132
|
-
});
|
|
133
|
-
register("agent_os_workbench_present", [
|
|
134
|
-
"Present a full-screen slideshow on the operator's open Command Center — walk the user",
|
|
135
|
-
"through points/status/reviews as large-type slides while you narrate in chat.",
|
|
136
|
-
"action=start with your own slides, OR compose=\"working_on\" to auto-build a",
|
|
137
|
-
"'What we're working on' deck from the live rollup server-side. Drive with",
|
|
138
|
-
"action=next/prev/goto/close. Slides may carry an EntityRef (task:<id>, plan:<id>)",
|
|
139
|
-
"for a 'Show in Command Center' button. View-control only; user can dismiss (Esc).",
|
|
140
|
-
].join(" "), {
|
|
141
|
-
slug: z.string().optional(),
|
|
142
|
-
action: z.enum(["start", "next", "prev", "goto", "close"]).optional()
|
|
143
|
-
.describe("Default start."),
|
|
144
|
-
compose: z.enum(["working_on"]).optional()
|
|
145
|
-
.describe("Auto-compose the deck from the live rollup (ignores slides)."),
|
|
146
|
-
title: z.string().optional().describe("Deck headline (start)."),
|
|
147
|
-
slides: z
|
|
148
|
-
.array(z.object({
|
|
149
|
-
title: z.string(),
|
|
150
|
-
body: z.string().optional(),
|
|
151
|
-
bullets: z.array(z.string()).optional(),
|
|
152
|
-
metric: z.object({ value: z.string(), label: z.string() }).optional(),
|
|
153
|
-
ref: z.string().optional().describe("EntityRef e.g. task:<id>, plan:<id>"),
|
|
154
|
-
tone: z.enum(["info", "good", "warn", "risk"]).optional(),
|
|
155
|
-
}))
|
|
156
|
-
.optional()
|
|
157
|
-
.describe("Slides for action=start (max 16)."),
|
|
158
|
-
index: z.number().optional().describe("Target slide for action=goto (0-based)."),
|
|
159
|
-
autoAdvanceMs: z.number().optional().describe("Optional auto-advance (3000–120000 ms)."),
|
|
160
|
-
sessionId: z.string().optional(),
|
|
161
|
-
}, async (args) => {
|
|
162
|
-
const slug = await resolveToolSlug(args.slug);
|
|
163
|
-
const body = {
|
|
164
|
-
kind: "present",
|
|
165
|
-
source: "agent",
|
|
166
|
-
sessionId: args.sessionId,
|
|
167
|
-
compose: args.compose,
|
|
168
|
-
present: {
|
|
169
|
-
action: args.action ?? "start",
|
|
170
|
-
title: args.title,
|
|
171
|
-
slides: args.slides,
|
|
172
|
-
index: args.index,
|
|
173
|
-
autoAdvanceMs: args.autoAdvanceMs,
|
|
174
|
-
},
|
|
175
|
-
};
|
|
176
|
-
return jsonResult(await post(`/agent-os/${slug}/workbench/command`, body));
|
|
177
|
-
});
|
|
178
|
-
}
|