@kynver-app/mcp-agent-os 0.3.51 → 0.3.59
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/context/context-budget-receipt.d.ts +9 -0
- package/dist/context/context-budget-receipt.js +34 -0
- package/dist/lib/kynver-client.d.ts +3 -1
- package/dist/lib/kynver-client.js +2 -2
- package/dist/server.js +12 -0
- package/dist/tools/cmo-control.d.ts +20 -0
- package/dist/tools/cmo-control.js +26 -0
- package/dist/tools/context-expand.d.ts +18 -0
- package/dist/tools/context-expand.js +26 -0
- package/dist/tools/plan-audit-rollup.d.ts +19 -0
- package/dist/tools/plan-audit-rollup.js +49 -0
- package/dist/tools/task-board-watchdog.d.ts +20 -0
- package/dist/tools/task-board-watchdog.js +42 -0
- package/dist/tools/taskflow.d.ts +21 -0
- package/dist/tools/taskflow.js +89 -0
- package/dist/tools/tasks.js +2 -2
- package/dist/tools/workbench.js +45 -0
- package/package.json +4 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { estimateTokensFromChars, RUNTIME_CONTEXT_BUDGET_RECEIPT_V2_SCHEMA_VERSION, type ContextBudgetReceiptSurface, type RuntimeContextBudgetReceiptV2 } from "@kynver-app/runtime";
|
|
2
|
+
/** MCP tool-context measurement adapter (PR2) — metadata only; does not mutate payloads. */
|
|
3
|
+
export declare function measureMcpToolContextReceipt(payload: unknown, input?: {
|
|
4
|
+
agentOsId?: string | null;
|
|
5
|
+
taskId?: string | null;
|
|
6
|
+
selectedHandles?: string[];
|
|
7
|
+
expansionRoutes?: string[];
|
|
8
|
+
}): RuntimeContextBudgetReceiptV2;
|
|
9
|
+
export { RUNTIME_CONTEXT_BUDGET_RECEIPT_V2_SCHEMA_VERSION, estimateTokensFromChars, type ContextBudgetReceiptSurface, type RuntimeContextBudgetReceiptV2, };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { buildContextBudgetReceiptV2, estimateTokensFromChars, sectionReceiptFromMarkdown, RUNTIME_CONTEXT_BUDGET_RECEIPT_V2_SCHEMA_VERSION, } from "@kynver-app/runtime";
|
|
2
|
+
const MCP_TOOL_RESULT_BUDGET_BYTES = 12_288;
|
|
3
|
+
function utf8ByteLength(value) {
|
|
4
|
+
return new TextEncoder().encode(JSON.stringify(value)).length;
|
|
5
|
+
}
|
|
6
|
+
/** MCP tool-context measurement adapter (PR2) — metadata only; does not mutate payloads. */
|
|
7
|
+
export function measureMcpToolContextReceipt(payload, input) {
|
|
8
|
+
const bytes = utf8ByteLength(payload);
|
|
9
|
+
const serialized = JSON.stringify(payload);
|
|
10
|
+
return buildContextBudgetReceiptV2({
|
|
11
|
+
surface: "mcp_tool_context",
|
|
12
|
+
agentOsId: input?.agentOsId ?? null,
|
|
13
|
+
taskId: input?.taskId ?? null,
|
|
14
|
+
planId: null,
|
|
15
|
+
personaSlug: null,
|
|
16
|
+
mode: "routine",
|
|
17
|
+
generatedAt: new Date(0).toISOString(),
|
|
18
|
+
finalSerializedChars: serialized.length,
|
|
19
|
+
sections: [sectionReceiptFromMarkdown("structural", serialized)],
|
|
20
|
+
usefulContextCoverage: {
|
|
21
|
+
requiredOperatingRuleSlugsPresent: ["kynver-workspace-isolation"],
|
|
22
|
+
requiredOperatingRuleDenominator: 1,
|
|
23
|
+
activeTaskHandlePresent: Boolean(input?.taskId),
|
|
24
|
+
planHandlePresent: false,
|
|
25
|
+
selectedHandles: input?.selectedHandles ?? [],
|
|
26
|
+
omittedHandles: [],
|
|
27
|
+
expansionRoutes: input?.expansionRoutes ?? ["agent_os_search_memory"],
|
|
28
|
+
memoryQualityTraceId: null,
|
|
29
|
+
},
|
|
30
|
+
budgetSatisfied: bytes <= MCP_TOOL_RESULT_BUDGET_BYTES,
|
|
31
|
+
overBudgetReason: bytes > MCP_TOOL_RESULT_BUDGET_BYTES ? "mcp_transport_budget_exceeded" : null,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
export { RUNTIME_CONTEXT_BUDGET_RECEIPT_V2_SCHEMA_VERSION, estimateTokensFromChars, };
|
|
@@ -12,7 +12,9 @@ interface RequestContext {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const requestContext: AsyncLocalStorage<RequestContext>;
|
|
14
14
|
export declare function get<T = unknown>(path: string): Promise<T>;
|
|
15
|
-
export declare function post<T = unknown>(path: string, body: unknown
|
|
15
|
+
export declare function post<T = unknown>(path: string, body: unknown, options?: {
|
|
16
|
+
headers?: Record<string, string>;
|
|
17
|
+
}): Promise<T>;
|
|
16
18
|
export declare function patch<T = unknown>(path: string, body: unknown): Promise<T>;
|
|
17
19
|
export declare function put<T = unknown>(path: string, body: unknown): Promise<T>;
|
|
18
20
|
export declare function del<T = unknown>(path: string): Promise<T>;
|
|
@@ -107,10 +107,10 @@ export async function get(path) {
|
|
|
107
107
|
});
|
|
108
108
|
return handleResponse(res);
|
|
109
109
|
}
|
|
110
|
-
export async function post(path, body) {
|
|
110
|
+
export async function post(path, body, options) {
|
|
111
111
|
const res = await fetchWithTimeout(path, {
|
|
112
112
|
method: "POST",
|
|
113
|
-
headers: getHeaders(),
|
|
113
|
+
headers: { ...getHeaders(), ...options?.headers },
|
|
114
114
|
body: JSON.stringify(body),
|
|
115
115
|
});
|
|
116
116
|
return handleResponse(res);
|
package/dist/server.js
CHANGED
|
@@ -21,15 +21,20 @@ import { registerMemoryQualityFeedbackTools } from "./tools/memory-quality-feedb
|
|
|
21
21
|
import { registerOperatingRulesTools } from "./tools/operating-rules.js";
|
|
22
22
|
import { registerProviderEvidenceTools } from "./tools/provider-evidence.js";
|
|
23
23
|
import { registerPrBacklogTools } from "./tools/pr-backlog.js";
|
|
24
|
+
import { registerTaskBoardWatchdogTools } from "./tools/task-board-watchdog.js";
|
|
25
|
+
import { registerTaskflowTools } from "./tools/taskflow.js";
|
|
26
|
+
import { registerPlanAuditRollupTools } from "./tools/plan-audit-rollup.js";
|
|
24
27
|
import { registerMeshLivenessTools } from "./tools/mesh-liveness.js";
|
|
25
28
|
import { registerDiagnosticsTools } from "./tools/diagnostics.js";
|
|
26
29
|
import { registerSkillsTools } from "./tools/skills.js";
|
|
27
30
|
import { registerMemoryLedgerTools } from "./tools/memory-ledger.js";
|
|
28
31
|
import { registerMemoryVaultTools } from "./tools/memory-vault.js";
|
|
32
|
+
import { registerContextExpandTools } from "./tools/context-expand.js";
|
|
29
33
|
import { registerMonitorTools } from "./tools/monitor.js";
|
|
30
34
|
import { registerMacroControlsTools } from "./tools/macro-controls.js";
|
|
31
35
|
import { registerKariAdMarketingLoopTools } from "./tools/kariad-marketing-loop.js";
|
|
32
36
|
import { registerKariAdOutcomeImportTools } from "./tools/kariad-outcome-import.js";
|
|
37
|
+
import { registerCmoControlTools } from "./tools/cmo-control.js";
|
|
33
38
|
import { registerCurrentFocusTools } from "./tools/current-focus.js";
|
|
34
39
|
import { readOwnPackageVersion } from "./lib/package-version.js";
|
|
35
40
|
const PACKAGE_VERSION = readOwnPackageVersion(import.meta.url);
|
|
@@ -734,6 +739,11 @@ export function createAgentOsServer() {
|
|
|
734
739
|
registerProviderEvidenceTools({ register, resolveToolSlug, jsonResult });
|
|
735
740
|
// PR backlog drain (read-only routing-funnel surface).
|
|
736
741
|
registerPrBacklogTools({ register, resolveToolSlug, jsonResult });
|
|
742
|
+
// Kynver-native task board watchdog (read + tick for verify_live).
|
|
743
|
+
registerTaskBoardWatchdogTools({ register, resolveToolSlug, jsonResult });
|
|
744
|
+
registerTaskflowTools({ register, resolveToolSlug, jsonResult });
|
|
745
|
+
// Compact active-plan audit rollup (broad completion audits).
|
|
746
|
+
registerPlanAuditRollupTools({ register, resolveToolSlug, jsonResult });
|
|
737
747
|
// Connected-box mesh liveness (heartbeats, cron lease, peer rescues).
|
|
738
748
|
registerMeshLivenessTools({ register, resolveToolSlug, jsonResult });
|
|
739
749
|
// Visible Diagnostics report (dispatch-funnel, closed-loop, verify-live health …).
|
|
@@ -742,11 +752,13 @@ export function createAgentOsServer() {
|
|
|
742
752
|
registerSkillsTools({ register, resolveToolSlug, jsonResult });
|
|
743
753
|
registerMemoryLedgerTools({ register, resolveToolSlug, jsonResult });
|
|
744
754
|
registerMemoryVaultTools({ register, resolveToolSlug, jsonResult });
|
|
755
|
+
registerContextExpandTools({ register, resolveToolSlug, jsonResult });
|
|
745
756
|
registerMonitorTools({ register, resolveToolSlug, jsonResult });
|
|
746
757
|
registerMacroControlsTools({ register, resolveToolSlug, jsonResult });
|
|
747
758
|
registerKariAdMarketingLoopTools({ register, resolveToolSlug, jsonResult });
|
|
748
759
|
// KariAd marketing loop — M6 outcome import (analytics feedback + memory learning).
|
|
749
760
|
registerKariAdOutcomeImportTools({ register, resolveToolSlug, jsonResult });
|
|
761
|
+
registerCmoControlTools({ register, resolveToolSlug, jsonResult });
|
|
750
762
|
// M5: Kynver current-focus / todo adapter (agent-loop focus ≠ executor lease).
|
|
751
763
|
registerCurrentFocusTools({ register, resolveToolSlug, jsonResult, compact });
|
|
752
764
|
return server;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M7 — CMO control status MCP tool (verify-live / agent steering).
|
|
3
|
+
*
|
|
4
|
+
* Read-only customer-safe marketing rollup: connection, approvals, trend
|
|
5
|
+
* snapshot summary, campaign evidence rows, and next actions.
|
|
6
|
+
*/
|
|
7
|
+
type ToolResult = {
|
|
8
|
+
content: {
|
|
9
|
+
type: "text";
|
|
10
|
+
text: string;
|
|
11
|
+
}[];
|
|
12
|
+
structuredContent?: unknown;
|
|
13
|
+
};
|
|
14
|
+
export interface CmoControlToolDeps {
|
|
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 registerCmoControlTools({ register, resolveToolSlug, jsonResult, }: CmoControlToolDeps): void;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M7 — CMO control status MCP tool (verify-live / agent steering).
|
|
3
|
+
*
|
|
4
|
+
* Read-only customer-safe marketing rollup: connection, approvals, trend
|
|
5
|
+
* snapshot summary, campaign evidence rows, and next actions.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { get } from "../lib/kynver-client.js";
|
|
9
|
+
const slugField = z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("AgentOS slug. Defaults to env/primary AgentOS.");
|
|
13
|
+
export function registerCmoControlTools({ register, resolveToolSlug, jsonResult, }) {
|
|
14
|
+
register("agent_os_cmo_control_status_get", [
|
|
15
|
+
"Fetch the user-facing marketing / CMO control status for Command Center.",
|
|
16
|
+
"Returns connection health, pending marketing approvals, trend snapshot summary,",
|
|
17
|
+
"recent campaign activity evidence, executive summary, and suggested next actions.",
|
|
18
|
+
"Customer-safe copy only — no credentials, lane names, or memory internals.",
|
|
19
|
+
"Read-only; safe for unattended verification.",
|
|
20
|
+
"Workbench: navigate to view=marketing or open_panel system:cmo-campaign.",
|
|
21
|
+
].join(" "), { slug: slugField }, async ({ slug }) => {
|
|
22
|
+
const s = await resolveToolSlug(slug);
|
|
23
|
+
const payload = await get(`/agent-os/${encodeURIComponent(s)}/cmo-control`);
|
|
24
|
+
return jsonResult(payload);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP adapter for authenticated memory-context expansion (PR5).
|
|
3
|
+
* Endpoints remain dark unless KYNVER_MEMORY_EXPANSION is enabled server-side.
|
|
4
|
+
*/
|
|
5
|
+
type ToolResult = {
|
|
6
|
+
content: {
|
|
7
|
+
type: "text";
|
|
8
|
+
text: string;
|
|
9
|
+
}[];
|
|
10
|
+
structuredContent?: unknown;
|
|
11
|
+
};
|
|
12
|
+
export interface ContextExpandToolDeps {
|
|
13
|
+
register: (name: string, description: string, inputSchema: Record<string, unknown>, cb: (args: any) => any) => void;
|
|
14
|
+
resolveToolSlug: (explicitSlug?: string) => Promise<string>;
|
|
15
|
+
jsonResult: (data: unknown) => ToolResult;
|
|
16
|
+
}
|
|
17
|
+
export declare function registerContextExpandTools({ register, resolveToolSlug, jsonResult, }: ContextExpandToolDeps): void;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP adapter for authenticated memory-context expansion (PR5).
|
|
3
|
+
* Endpoints remain dark unless KYNVER_MEMORY_EXPANSION is enabled server-side.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { post } from "../lib/kynver-client.js";
|
|
7
|
+
export function registerContextExpandTools({ register, resolveToolSlug, jsonResult, }) {
|
|
8
|
+
register("agent_os_context_expand", [
|
|
9
|
+
"Expand an opaque runtime-memory envelope handle into a customer-safe preview.",
|
|
10
|
+
"Requires a signed grantToken plus envelopeId from the runtime envelope.",
|
|
11
|
+
"Dark unless the deployment enables KYNVER_MEMORY_EXPANSION.",
|
|
12
|
+
"Read-only and safe for unattended synthetic verification.",
|
|
13
|
+
].join(" "), {
|
|
14
|
+
slug: z.string().optional().describe("AgentOS slug. Defaults to env/primary."),
|
|
15
|
+
grantToken: z.string().describe("Signed expansion grant (kve:g:…)."),
|
|
16
|
+
envelopeId: z.string().describe("Envelope id the grant was minted for."),
|
|
17
|
+
purpose: z.string().optional().describe("Caller purpose label for audit receipts."),
|
|
18
|
+
}, async (args) => {
|
|
19
|
+
const slug = await resolveToolSlug(args.slug);
|
|
20
|
+
return jsonResult(await post(`/agent-os/${encodeURIComponent(slug)}/memory-context/expand`, {
|
|
21
|
+
grantToken: args.grantToken,
|
|
22
|
+
envelopeId: args.envelopeId,
|
|
23
|
+
purpose: args.purpose ?? "mcp_context_expand",
|
|
24
|
+
}, { headers: { "X-Kynver-Expansion-Surface": "memory_context_mcp" } }));
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task board watchdog MCP tools — read/trigger the Kynver-native board sweep.
|
|
3
|
+
*
|
|
4
|
+
* agent_os_task_board_watchdog_get → GET …/task-board-watchdog (last snapshot)
|
|
5
|
+
* agent_os_task_board_watchdog_tick → POST …/task-board-watchdog (run one tick)
|
|
6
|
+
*/
|
|
7
|
+
type ToolResult = {
|
|
8
|
+
content: {
|
|
9
|
+
type: "text";
|
|
10
|
+
text: string;
|
|
11
|
+
}[];
|
|
12
|
+
structuredContent?: unknown;
|
|
13
|
+
};
|
|
14
|
+
export interface TaskBoardWatchdogToolDeps {
|
|
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 registerTaskBoardWatchdogTools({ register, resolveToolSlug, jsonResult, }: TaskBoardWatchdogToolDeps): void;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task board watchdog MCP tools — read/trigger the Kynver-native board sweep.
|
|
3
|
+
*
|
|
4
|
+
* agent_os_task_board_watchdog_get → GET …/task-board-watchdog (last snapshot)
|
|
5
|
+
* agent_os_task_board_watchdog_tick → POST …/task-board-watchdog (run one tick)
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { get, post } 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
|
+
const idSchema = {
|
|
18
|
+
agentOsId: z.string().uuid().optional().describe("AgentOS workspace id"),
|
|
19
|
+
slug: z.string().optional().describe("AgentOS slug (resolved to id when agentOsId omitted)"),
|
|
20
|
+
};
|
|
21
|
+
export function registerTaskBoardWatchdogTools({ register, resolveToolSlug, jsonResult, }) {
|
|
22
|
+
register("agent_os_task_board_watchdog_get", [
|
|
23
|
+
"Fetch the Kynver-native task board watchdog snapshot: last tick movement counts,",
|
|
24
|
+
"quiet flag, dispatch floor advice, and agentReadable summary.",
|
|
25
|
+
"Safe for verify_live — read-only.",
|
|
26
|
+
].join(" "), idSchema, async (args) => {
|
|
27
|
+
const agentOsId = args.agentOsId?.trim() ||
|
|
28
|
+
(await resolveAgentOsId(args.slug ?? (await resolveToolSlug())));
|
|
29
|
+
const data = await get(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/task-board-watchdog`);
|
|
30
|
+
return jsonResult(data);
|
|
31
|
+
});
|
|
32
|
+
register("agent_os_task_board_watchdog_tick", [
|
|
33
|
+
"Run one Kynver-native task board watchdog tick: board reconcile, expert supervisor,",
|
|
34
|
+
"bookkeeping drain, budget-reset PR lifecycle retry, and meaningful-change report.",
|
|
35
|
+
"Idempotent — safe for verify_live when a fresh snapshot is needed.",
|
|
36
|
+
].join(" "), idSchema, async (args) => {
|
|
37
|
+
const agentOsId = args.agentOsId?.trim() ||
|
|
38
|
+
(await resolveAgentOsId(args.slug ?? (await resolveToolSlug())));
|
|
39
|
+
const data = await post(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/task-board-watchdog`, {});
|
|
40
|
+
return jsonResult(data);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
type ToolResult = {
|
|
9
|
+
content: {
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
}[];
|
|
13
|
+
structuredContent?: unknown;
|
|
14
|
+
};
|
|
15
|
+
export interface TaskflowToolDeps {
|
|
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 registerTaskflowTools({ register, resolveToolSlug, jsonResult, }: TaskflowToolDeps): void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
"Safe for verify_live — read-only.",
|
|
26
|
+
].join(" "), idSchema, async (args) => {
|
|
27
|
+
const agentOsId = args.agentOsId?.trim() ||
|
|
28
|
+
(await resolveAgentOsId(args.slug ?? (await resolveToolSlug())));
|
|
29
|
+
const data = await get(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/taskflow`);
|
|
30
|
+
return jsonResult(data);
|
|
31
|
+
});
|
|
32
|
+
register("agent_os_taskflow_get", [
|
|
33
|
+
"Fetch one managed TaskFlow by flowId using the Hermes/native adapter wire shape.",
|
|
34
|
+
"Safe for verify_live — read-only.",
|
|
35
|
+
].join(" "), {
|
|
36
|
+
...idSchema,
|
|
37
|
+
flowId: z.string().describe("TaskFlow flowId"),
|
|
38
|
+
}, async (args) => {
|
|
39
|
+
const agentOsId = args.agentOsId?.trim() ||
|
|
40
|
+
(await resolveAgentOsId(args.slug ?? (await resolveToolSlug())));
|
|
41
|
+
const data = await get(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/taskflow?flowId=${encodeURIComponent(args.flowId)}`);
|
|
42
|
+
return jsonResult(data);
|
|
43
|
+
});
|
|
44
|
+
register("agent_os_taskflow_mutate", [
|
|
45
|
+
"Create or mutate a Kynver-native managed TaskFlow (create, resume, wait, finish, fail, request_cancel).",
|
|
46
|
+
"Lifecycle actions require expectedRevision for optimistic concurrency — matches openclaw TF2 guards.",
|
|
47
|
+
].join(" "), {
|
|
48
|
+
...idSchema,
|
|
49
|
+
action: z
|
|
50
|
+
.enum(["create", "resume", "wait", "finish", "fail", "request_cancel"])
|
|
51
|
+
.describe("Lifecycle action"),
|
|
52
|
+
flowId: z.string().describe("TaskFlow flowId"),
|
|
53
|
+
templateId: z.string().optional().describe("Required for create"),
|
|
54
|
+
goal: z.string().optional().describe("Required for create"),
|
|
55
|
+
expectedRevision: z.number().int().nonnegative().optional(),
|
|
56
|
+
currentStep: z.string().optional(),
|
|
57
|
+
stateJson: z.record(z.unknown()).optional().describe("Managed-flow state blob (includes __taskflow cursor)"),
|
|
58
|
+
waitJson: z.record(z.unknown()).optional().describe("Wait payload when action=wait"),
|
|
59
|
+
blockedTaskId: z.string().optional(),
|
|
60
|
+
blockedSummary: z.string().optional(),
|
|
61
|
+
callbackKey: z
|
|
62
|
+
.object({
|
|
63
|
+
flowId: z.string(),
|
|
64
|
+
revision: z.number().int().nonnegative(),
|
|
65
|
+
idempotencyKey: z.string(),
|
|
66
|
+
stepGeneration: z.number().int().nonnegative().optional(),
|
|
67
|
+
childAttempt: z.number().int().nonnegative().optional(),
|
|
68
|
+
})
|
|
69
|
+
.optional()
|
|
70
|
+
.describe("TF2 callback guard key — stale/terminal/duplicate mint rejection"),
|
|
71
|
+
}, async (args) => {
|
|
72
|
+
const agentOsId = args.agentOsId?.trim() ||
|
|
73
|
+
(await resolveAgentOsId(args.slug ?? (await resolveToolSlug())));
|
|
74
|
+
const data = await post(`/agent-os/by-id/${encodeURIComponent(agentOsId)}/taskflow`, {
|
|
75
|
+
action: args.action,
|
|
76
|
+
flowId: args.flowId,
|
|
77
|
+
templateId: args.templateId,
|
|
78
|
+
goal: args.goal,
|
|
79
|
+
expectedRevision: args.expectedRevision,
|
|
80
|
+
currentStep: args.currentStep,
|
|
81
|
+
stateJson: args.stateJson,
|
|
82
|
+
waitJson: args.waitJson,
|
|
83
|
+
blockedTaskId: args.blockedTaskId,
|
|
84
|
+
blockedSummary: args.blockedSummary,
|
|
85
|
+
callbackKey: args.callbackKey,
|
|
86
|
+
});
|
|
87
|
+
return jsonResult(data);
|
|
88
|
+
});
|
|
89
|
+
}
|
package/dist/tools/tasks.js
CHANGED
|
@@ -141,8 +141,8 @@ export function registerTaskTools({ register, resolveToolSlug, jsonResult, compa
|
|
|
141
141
|
parentTaskId: z.string().optional(),
|
|
142
142
|
goalId: z.string().optional(),
|
|
143
143
|
projectId: z.string().optional(),
|
|
144
|
-
planId: z.string().optional(),
|
|
145
|
-
planStageId: z.string().optional(),
|
|
144
|
+
planId: z.string().nullable().optional(),
|
|
145
|
+
planStageId: z.string().nullable().optional(),
|
|
146
146
|
personaSlug,
|
|
147
147
|
scheduledFor,
|
|
148
148
|
dependsOnTaskIds,
|
package/dist/tools/workbench.js
CHANGED
|
@@ -98,4 +98,49 @@ export function registerWorkbenchTools({ register, resolveToolSlug, jsonResult,
|
|
|
98
98
|
}
|
|
99
99
|
return jsonResult(await post(`/agent-os/${slug}/workbench/command`, body));
|
|
100
100
|
});
|
|
101
|
+
register("agent_os_workbench_present", [
|
|
102
|
+
"Present a full-screen slideshow on the operator's open Command Center — walk the user",
|
|
103
|
+
"through points/status/reviews as large-type slides while you narrate in chat.",
|
|
104
|
+
"action=start with your own slides, OR compose=\"working_on\" to auto-build a",
|
|
105
|
+
"'What we're working on' deck from the live rollup server-side. Drive with",
|
|
106
|
+
"action=next/prev/goto/close. Slides may carry an EntityRef (task:<id>, plan:<id>)",
|
|
107
|
+
"for a 'Show in Command Center' button. View-control only; user can dismiss (Esc).",
|
|
108
|
+
].join(" "), {
|
|
109
|
+
slug: z.string().optional(),
|
|
110
|
+
action: z.enum(["start", "next", "prev", "goto", "close"]).optional()
|
|
111
|
+
.describe("Default start."),
|
|
112
|
+
compose: z.enum(["working_on"]).optional()
|
|
113
|
+
.describe("Auto-compose the deck from the live rollup (ignores slides)."),
|
|
114
|
+
title: z.string().optional().describe("Deck headline (start)."),
|
|
115
|
+
slides: z
|
|
116
|
+
.array(z.object({
|
|
117
|
+
title: z.string(),
|
|
118
|
+
body: z.string().optional(),
|
|
119
|
+
bullets: z.array(z.string()).optional(),
|
|
120
|
+
metric: z.object({ value: z.string(), label: z.string() }).optional(),
|
|
121
|
+
ref: z.string().optional().describe("EntityRef e.g. task:<id>, plan:<id>"),
|
|
122
|
+
tone: z.enum(["info", "good", "warn", "risk"]).optional(),
|
|
123
|
+
}))
|
|
124
|
+
.optional()
|
|
125
|
+
.describe("Slides for action=start (max 16)."),
|
|
126
|
+
index: z.number().optional().describe("Target slide for action=goto (0-based)."),
|
|
127
|
+
autoAdvanceMs: z.number().optional().describe("Optional auto-advance (3000–120000 ms)."),
|
|
128
|
+
sessionId: z.string().optional(),
|
|
129
|
+
}, async (args) => {
|
|
130
|
+
const slug = await resolveToolSlug(args.slug);
|
|
131
|
+
const body = {
|
|
132
|
+
kind: "present",
|
|
133
|
+
source: "agent",
|
|
134
|
+
sessionId: args.sessionId,
|
|
135
|
+
compose: args.compose,
|
|
136
|
+
present: {
|
|
137
|
+
action: args.action ?? "start",
|
|
138
|
+
title: args.title,
|
|
139
|
+
slides: args.slides,
|
|
140
|
+
index: args.index,
|
|
141
|
+
autoAdvanceMs: args.autoAdvanceMs,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
return jsonResult(await post(`/agent-os/${slug}/workbench/command`, body));
|
|
145
|
+
});
|
|
101
146
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kynver-app/mcp-agent-os",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.59",
|
|
4
4
|
"description": "Kynver Agentic OS MCP server \u2014 slug-keyed agent identity, goals, projects, sessions, and long-term memory",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"start:sse": "node dist/sse.js"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
25
|
-
"node": ">=
|
|
25
|
+
"node": ">=24.11.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@kynver-app/runtime": "^0.
|
|
29
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
28
|
+
"@kynver-app/runtime": "^0.2.0",
|
|
29
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
30
30
|
"zod": "^3.23.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|