@muxoai/platform 1.4.3 → 1.4.4

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.
@@ -266,9 +266,16 @@ export const MUXO_MCP_RESOURCE_TEMPLATES = [
266
266
  uriTemplate: "skill://muxo/{skillName}/SKILL.md",
267
267
  name: "Muxo Agent Skill Markdown (SEP-2640)",
268
268
  title: "Muxo Agent Skill Markdown (SEP-2640)",
269
- description: "Read the SKILL.md entry point for a published Muxo Agent Skill ('muxo' or 'setup').",
269
+ description: "Read the SKILL.md entry point for a published Muxo Agent Skill ('muxo', 'setup', or domain automation/provisioning skills such as 'github-automation', 'supabase-provisioning').",
270
270
  mimeType: "text/markdown",
271
271
  },
272
+ {
273
+ uriTemplate: "muxo://skills/{skillSlug}",
274
+ name: "Muxo Governed Domain & Workflow Skill (SKILL.md + Metadata)",
275
+ title: "Muxo Governed Domain & Workflow Skill (SKILL.md + Metadata)",
276
+ description: "Read a transpiled Muxo Governed Skill (e.g. muxo://skills/github-automation, muxo://skills/supabase-provisioning, muxo://skills/changelog-generator) with tool sequences, pitfalls, and zero-OAuth Stripe Projects overrides.",
277
+ mimeType: "application/json",
278
+ },
272
279
  ];
273
280
  /**
274
281
  * Evaluates MCP `completion/complete` requests for prompt arguments and resource templates.
@@ -280,8 +287,27 @@ export function completeMcpArgument(params, toolSlugs = []) {
280
287
  const argName = String(argObj.name || "").trim();
281
288
  const prefix = String(argObj.value || "").trim().toLowerCase();
282
289
  let candidates = [];
283
- if (argName === "skillName" || argName === "name") {
284
- candidates = ["muxo", "setup"];
290
+ if (argName === "skillName" || argName === "name" || argName === "skillSlug") {
291
+ candidates = [
292
+ "muxo",
293
+ "setup",
294
+ "github-automation",
295
+ "gmail-automation",
296
+ "slack-automation",
297
+ "notion-automation",
298
+ "linear-automation",
299
+ "hubspot-automation",
300
+ "salesforce-automation",
301
+ "shopify-automation",
302
+ "metaads-automation",
303
+ "stripe-automation",
304
+ "supabase-provisioning",
305
+ "vercel-provisioning",
306
+ "turso-provisioning",
307
+ "changelog-generator",
308
+ "lead-research-assistant",
309
+ "security-audit",
310
+ ];
285
311
  }
286
312
  else if (argName === "focus") {
287
313
  candidates = ["full", "pending_approvals", "billing", "receipts", "memory"];
@@ -631,8 +657,17 @@ export function buildApprovalHumanHandoff(baseUrl, plan) {
631
657
  const approvalUrl = buildApprovalUrl(baseUrl, plan.id);
632
658
  const ctaLabel = "Review & approve";
633
659
  const headline = `Muxo needs your approval to run ${plan.toolSlug}`;
634
- const instructions = `Open ${approvalUrl} to review and approve this ${plan.riskLevel}-risk action with one click (or run \`muxo approve ${plan.id}\`). Nothing runs until you approve.`;
635
- const markdownForUser = `### Muxo Approval Required\n**[${ctaLabel} in Muxo](${approvalUrl})**\n\nPlan \`${plan.id}\` (\`${plan.toolSlug}\` · **${plan.riskLevel} risk**) is held by your Muxo workspace guardrails. Open the link above to review and approve it in one click (or run \`muxo approve ${plan.id}\`). Nothing executes until you approve.`;
660
+ const preview = plan.changePreview;
661
+ const costSnippet = preview?.costDisplay
662
+ ? ` · Est. cost: ${preview.costDisplay}`
663
+ : typeof plan.creditCost === "number"
664
+ ? ` · Est. cost: $${((plan.creditCost || 0) * 0.01).toFixed(2)} USD (${plan.creditCost} cr)`
665
+ : "";
666
+ const instructions = `Open ${approvalUrl} to review and approve this ${plan.riskLevel}-risk action with one click (or run \`muxo approve ${plan.id}\`).${costSnippet} Nothing runs until you approve.`;
667
+ const previewMarkdown = preview
668
+ ? `\n\n- **What changes:** ${preview.whatChanges}\n- **Affected target:** ${preview.whoIsAffected}\n- **Estimated cost:** ${preview.costDisplay}\n- **Triggered guardrail:** ${preview.triggeredRule}`
669
+ : "";
670
+ const markdownForUser = `### Muxo Approval Required\n**[${ctaLabel} in Muxo](${approvalUrl})**\n\nPlan \`${plan.id}\` (\`${plan.toolSlug}\` · **${plan.riskLevel} risk**) is held by your Muxo workspace guardrails.${previewMarkdown}\n\nOpen the link above to review and approve it in one click (or run \`muxo approve ${plan.id}\`). Nothing executes until you approve.`;
636
671
  return {
637
672
  kind: "approval",
638
673
  brand: "Muxo",
@@ -1061,7 +1096,13 @@ export const MUXO_MCP_TOOLS = [
1061
1096
  "otel_traces",
1062
1097
  "roi_analytics",
1063
1098
  "playbooks",
1099
+ "create_playbook",
1064
1100
  "run_playbook",
1101
+ "rollback_workflow",
1102
+ "signal_workflow",
1103
+ "workflow_history",
1104
+ "configure_harness",
1105
+ "harness_presets",
1065
1106
  "kill_switch",
1066
1107
  "governance_status",
1067
1108
  "scan_context",
@@ -1069,11 +1110,11 @@ export const MUXO_MCP_TOOLS = [
1069
1110
  "switch_workspace",
1070
1111
  "onboard_team",
1071
1112
  ],
1072
- description: "Control-plane operation: 'inspect' (default), 'remember' (save fact/preference), 'recall' (list memories), 'forget' (delete matching memories), 'memory_graph' (Graphiti bi-temporal entity/relationship lineage with optional as_of time-travel & focal_entity 2-hop BFS), 'set_guardrail' (apply plain-English or structured parameter_rules guardrail), 'reset_guardrails' (restore default safe guardrails), 'check_policy' (dry-run evaluate tool_slug + input against policy and parameter guardrails before planning), 'cedar_policy' (compile/evaluate AWS Cedar & OPA Rego policy-as-code), 'otel_traces' (export W3C OpenTelemetry GenAI/MCP spans & Langfuse batch), 'roi_analytics' (FinOps & BYOK unit-economics ROI report), 'playbooks' / 'run_playbook' (list or execute turnkey multi-step Temporal Saga playbooks), 'kill_switch' (pause/resume agent execution), 'governance_status' (Microsoft 9-module status + LLM policy brief), 'scan_context' (OWASP ASI-06 check), 'list_workspaces', 'switch_workspace', or 'onboard_team'",
1113
+ description: "Control-plane operation (or omit action and pass any plain-English prompt): 'inspect' (default), 'remember' (save fact/preference), 'recall' (list memories), 'forget' (delete matching memories), 'memory_graph' (Graphiti bi-temporal entity/relationship lineage with optional as_of time-travel & focal_entity 2-hop BFS), 'set_guardrail' (apply plain-English or structured parameter_rules guardrail), 'reset_guardrails' (restore default safe guardrails), 'check_policy' (dry-run evaluate tool_slug + input against policy and parameter guardrails before planning), 'cedar_policy' (compile/evaluate AWS Cedar & OPA Rego policy-as-code), 'otel_traces' (export W3C OpenTelemetry GenAI/MCP spans & Langfuse batch), 'roi_analytics' (FinOps & BYOK unit-economics ROI report), 'playbooks' / 'create_playbook' / 'run_playbook' (list, author custom, or execute multi-step Temporal Saga playbooks), 'rollback_workflow' / 'signal_workflow' / 'workflow_history' (Temporal workflow lifecycle; accepts workflow_id='latest'), 'configure_harness' / 'harness_presets' (apply turnkey harness presets like startup-builder, strict-production, read-only-auditor, finops-byok-zero-cost and generate ready-to-paste harness config blocks), 'kill_switch' (pause/resume agent execution), 'governance_status' (Microsoft 9-module status + LLM policy brief), 'scan_context' (OWASP ASI-06 check), 'list_workspaces', 'switch_workspace', or 'onboard_team'",
1073
1114
  },
1074
1115
  prompt: {
1075
1116
  type: "string",
1076
- description: "Natural-language instruction when action is 'remember', 'set_guardrail', 'kill_switch', or 'scan_context' (e.g. 'Only allow sending emails to @muxo.ai' or 'Require approval for Stripe refunds over $50, auto-approve under $50')",
1117
+ description: "Plain-English instruction for any control-plane or OSS operation (e.g. 'Run the fullstack cloud bootstrap playbook for acme', 'Rollback the latest workflow because staging failed', 'Show my knowledge graph as of yesterday within 2 hops of workspace', 'Configure harness preset strict-production', or 'Only allow sending emails to @muxo.ai')",
1077
1118
  },
1078
1119
  tool_slug: {
1079
1120
  type: "string",
@@ -1180,7 +1221,23 @@ export const MUXO_MCP_TOOLS = [
1180
1221
  },
1181
1222
  slug: {
1182
1223
  type: "string",
1183
- description: "Optional playbook slug when action='run_playbook' (e.g. 'fullstack-cloud-bootstrap', 'competitor-seo-growth-brief', 'incident-containment-audit', 'customer-release-readiness')",
1224
+ description: "Optional playbook slug or natural-language name when action='run_playbook' (e.g. 'fullstack-cloud-bootstrap', 'competitor-seo-growth-brief', 'incident-containment-audit', 'customer-release-readiness')",
1225
+ },
1226
+ workflow_id: {
1227
+ type: "string",
1228
+ description: "Workflow ID or 'latest' when action is 'rollback_workflow', 'signal_workflow', or 'workflow_history'",
1229
+ },
1230
+ signal_name: {
1231
+ type: "string",
1232
+ description: "Temporal signal name when action='signal_workflow' (default: 'human.approval.granted')",
1233
+ },
1234
+ preset: {
1235
+ type: "string",
1236
+ description: "Turnkey harness preset slug when action='configure_harness' ('startup-builder', 'strict-production', 'read-only-auditor', 'finops-byok-zero-cost')",
1237
+ },
1238
+ harness: {
1239
+ type: "string",
1240
+ description: "Target agent harness when action='configure_harness' ('claude-code', 'cursor', 'codex', 'chatgpt', 'claude-desktop', 'factory-droid', or 'all')",
1184
1241
  },
1185
1242
  plan_id: {
1186
1243
  type: "string",
package/dist/mcp.js CHANGED
@@ -3,6 +3,7 @@ import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import { ROOT_DIR } from "./config.js";
5
5
  import { APPROVED_PLAN_STATUSES, DEFAULT_LEGACY_MCP_PROTOCOL_VERSION, DEFAULT_TOOL_SECURITY_SCHEMES, LATEST_MCP_PROTOCOL_VERSION, MCP_ERR_HEADER_MISMATCH, MCP_ERR_MISSING_REQUIRED_CLIENT_CAPABILITY, MCP_ERR_UNSUPPORTED_PROTOCOL_VERSION, MUXO_MCP_RESOURCE_TEMPLATES, MUXO_MCP_SERVER_INSTRUCTIONS, MUXO_MCP_TOOLS, MUXO_UI_MCP_APP_URI, MUXO_UI_RESOURCES, MUXO_UI_WIDGET_URI, OPENAI_COMPANY_KNOWLEDGE_TOOLS, PUBLIC_MCP_TOOL_NAMES, PUBLIC_TOOL_SECURITY_SCHEMES, SUPPORTED_MCP_PROTOCOL_VERSIONS, UI_RENDERED_MCP_TOOL_NAMES, attachMcpHarnessGuidance, MuxoToolError, buildApprovalUrl, buildMcpDiscoverResult, buildMcpErrorResultMeta, buildMcpToolDescriptor, buildMcpToolResultMeta, buildOnboardTeamGuide, clampWaitSeconds, completeMcpArgument, decodeMcpHeaderValue, errorPayloadFrom, extractOpenAiClientMeta, findMcpSkill, isSupportedMcpProtocolVersion, renderMuxoUiWidgetHtml, securitySchemesForTool, validateMcpHttpHeadersAndMeta, } from "./mcp-schema.js";
6
+ import { buildMuxoMcpSkillBundles, getMuxoSkill, listMuxoSkills, renderMuxoSkillMarkdown, } from "./skills-catalog.js";
6
7
  import { MUXO_VERSION } from "./version.js";
7
8
  export { DEFAULT_LEGACY_MCP_PROTOCOL_VERSION, DEFAULT_TOOL_SECURITY_SCHEMES, LATEST_MCP_PROTOCOL_VERSION, MCP_ERR_HEADER_MISMATCH, MCP_ERR_MISSING_REQUIRED_CLIENT_CAPABILITY, MCP_ERR_UNSUPPORTED_PROTOCOL_VERSION, MUXO_MCP_RESOURCE_TEMPLATES, MUXO_MCP_SERVER_INSTRUCTIONS, MUXO_MCP_TOOLS, MUXO_UI_MCP_APP_URI, MUXO_UI_RESOURCES, MUXO_UI_WIDGET_URI, OPENAI_COMPANY_KNOWLEDGE_TOOLS, PUBLIC_MCP_TOOL_NAMES, PUBLIC_TOOL_SECURITY_SCHEMES, SUPPORTED_MCP_PROTOCOL_VERSIONS, UI_RENDERED_MCP_TOOL_NAMES, attachMcpHarnessGuidance, buildMcpDiscoverResult, buildMcpErrorResultMeta, buildMcpToolDescriptor, buildMcpToolResultMeta, completeMcpArgument, decodeMcpHeaderValue, extractOpenAiClientMeta, isSupportedMcpProtocolVersion, renderMuxoUiWidgetHtml, securitySchemesForTool, validateMcpHttpHeadersAndMeta, };
8
9
  function sha256Digest(content) {
@@ -123,6 +124,24 @@ Call \`get_profile\` and \`get_organization\` to verify your workspace connectio
123
124
  const setupName = setupFm.name || "setup";
124
125
  const setupDesc = setupFm.description ||
125
126
  "Guided onboarding skill for setting up the Muxo plugin in OpenAI ChatGPT and Codex.";
127
+ const catalogBundles = buildMuxoMcpSkillBundles().map((bundle) => {
128
+ const fileEntries = bundle.files.map((f) => ({
129
+ path: f.path,
130
+ uri: f.uri,
131
+ size: Buffer.byteLength(f.content, "utf8"),
132
+ digest: sha256Digest(f.content),
133
+ mimeType: f.mimeType,
134
+ content: f.content,
135
+ }));
136
+ return {
137
+ name: bundle.name,
138
+ description: bundle.description,
139
+ uri: bundle.uri,
140
+ version: fileEntries[0].digest,
141
+ frontmatter: bundle.frontmatter,
142
+ files: fileEntries,
143
+ };
144
+ });
126
145
  return [
127
146
  {
128
147
  name: muxoName,
@@ -146,6 +165,7 @@ Call \`get_profile\` and \`get_organization\` to verify your workspace connectio
146
165
  },
147
166
  files: setupFiles,
148
167
  },
168
+ ...catalogBundles,
149
169
  ];
150
170
  }
151
171
  export async function dispatchMcpToolCall(engine, ctx, toolName, args = {}) {
@@ -257,9 +277,15 @@ export async function dispatchMcpToolCall(engine, ctx, toolName, args = {}) {
257
277
  if (action === "playbooks") {
258
278
  return {
259
279
  ok: true,
260
- playbooks: engine.listCommercialPlaybooks(),
280
+ playbooks: engine.listCommercialPlaybooks(ctx),
261
281
  };
262
282
  }
283
+ if (action === "create_playbook") {
284
+ return engine.createCustomPlaybook(ctx, {
285
+ prompt: prompt || query || String(args.slug || ""),
286
+ input: (args.input || args.arguments) || {},
287
+ });
288
+ }
263
289
  if (action === "run_playbook") {
264
290
  const slug = String(args.slug ||
265
291
  args.playbook ||
@@ -271,6 +297,49 @@ export async function dispatchMcpToolCall(engine, ctx, toolName, args = {}) {
271
297
  input: (args.input || args.arguments) || {},
272
298
  });
273
299
  }
300
+ if (action === "rollback_workflow") {
301
+ const wfId = String(args.workflow_id || args.workflowId || args.slug || query || "latest").trim();
302
+ const rolledBack = engine.rollbackDurableWorkflow(ctx, wfId, {
303
+ reason: prompt || query || undefined,
304
+ });
305
+ return {
306
+ ok: true,
307
+ action: "rollback_workflow",
308
+ workflow: rolledBack,
309
+ };
310
+ }
311
+ if (action === "signal_workflow") {
312
+ const wfId = String(args.workflow_id || args.workflowId || args.slug || "latest").trim();
313
+ const signalName = String(args.signal_name ||
314
+ args.signalName ||
315
+ query ||
316
+ "human.approval.granted").trim();
317
+ const signaled = engine.signalDurableWorkflow(ctx, wfId, {
318
+ signalName,
319
+ payload: (args.input || args.arguments) || {},
320
+ });
321
+ return {
322
+ ok: true,
323
+ action: "signal_workflow",
324
+ workflow: signaled,
325
+ };
326
+ }
327
+ if (action === "workflow_history") {
328
+ const wfId = String(args.workflow_id || args.workflowId || args.slug || query || "latest").trim();
329
+ return {
330
+ ok: true,
331
+ action: "workflow_history",
332
+ workflow: engine.getDurableWorkflow(ctx, wfId),
333
+ history: engine.getDurableWorkflowHistory(ctx, wfId),
334
+ };
335
+ }
336
+ if (action === "configure_harness" || action === "harness_presets") {
337
+ return engine.configureHarness(ctx, {
338
+ preset: args.preset ? String(args.preset) : query || null,
339
+ harness: args.harness ? String(args.harness) : null,
340
+ prompt: prompt || null,
341
+ });
342
+ }
274
343
  if (action === "governance_status") {
275
344
  return engine.getGovernanceOverview(ctx);
276
345
  }
@@ -383,8 +452,12 @@ export async function dispatchMcpToolCall(engine, ctx, toolName, args = {}) {
383
452
  explanation: overview.explanation,
384
453
  };
385
454
  }
386
- if (prompt && !action) {
387
- return engine.doNaturalLanguage(ctx, { prompt });
455
+ if (prompt && (!action || action === "inspect")) {
456
+ return engine.doNaturalLanguage(ctx, {
457
+ prompt,
458
+ input: (args.input || args.arguments) ||
459
+ undefined,
460
+ });
388
461
  }
389
462
  const runCtx = await engine.getRunContext(ctx, query);
390
463
  if (args.include_graph === true) {
@@ -733,6 +806,35 @@ export async function handleJsonRpcMcpRequest(engine, ctx, rpc) {
733
806
  description: "Load the structured LLM Policy & Governance Brief (riskLaneMatrix, conditional parameterRules with compliance guidance, budget caps, kill switch status, and control-plane commands).",
734
807
  arguments: [],
735
808
  },
809
+ {
810
+ name: "harness_setup",
811
+ title: "Turnkey Agent Harness Configuration & Natural-Language Cheatsheet",
812
+ description: "Generate ready-to-paste MCP configuration snippets, system prompt directives, turnkey governance presets (startup-builder, strict-production, read-only-auditor, finops-byok-zero-cost), and natural-language cheatsheets for Claude Code, Cursor, Codex, ChatGPT, Claude Desktop, and Factory Droid.",
813
+ arguments: [
814
+ {
815
+ name: "preset",
816
+ description: "Optional preset slug ('startup-builder', 'strict-production', 'read-only-auditor', 'finops-byok-zero-cost')",
817
+ required: false,
818
+ },
819
+ {
820
+ name: "harness",
821
+ description: "Optional target harness ('claude-code', 'cursor', 'codex', 'chatgpt', 'claude-desktop', 'factory-droid')",
822
+ required: false,
823
+ },
824
+ ],
825
+ },
826
+ {
827
+ name: "commercial_playbook",
828
+ title: "Multi-Step Temporal Saga Playbook Runner & Author",
829
+ description: "List, create, or execute multi-step Temporal-compatible Saga playbooks with automatic LIFO rollback compensations.",
830
+ arguments: [
831
+ {
832
+ name: "playbook",
833
+ description: "Playbook slug or plain-English description (e.g. 'fullstack-cloud-bootstrap', 'competitor-seo-growth-brief', 'incident-containment-audit', 'customer-release-readiness')",
834
+ required: false,
835
+ },
836
+ ],
837
+ },
736
838
  ],
737
839
  },
738
840
  };
@@ -841,6 +943,59 @@ export async function handleJsonRpcMcpRequest(engine, ctx, rpc) {
841
943
  },
842
944
  };
843
945
  }
946
+ if (promptName === "harness_setup") {
947
+ const bundle = await engine.configureHarness(ctx, {
948
+ preset: promptArgs.preset ? String(promptArgs.preset) : null,
949
+ harness: promptArgs.harness ? String(promptArgs.harness) : null,
950
+ });
951
+ return {
952
+ jsonrpc: "2.0",
953
+ id,
954
+ result: {
955
+ resultType: "complete",
956
+ description: "Turnkey Agent Harness Configuration, Presets, and Natural-Language Cheatsheet",
957
+ messages: [
958
+ {
959
+ role: "user",
960
+ content: {
961
+ type: "text",
962
+ text: [
963
+ bundle.systemPromptDirective,
964
+ `### Harness Configuration Bundle (JSON)\n\`\`\`json\n${JSON.stringify(bundle, null, 2)}\n\`\`\``,
965
+ ].join("\n\n"),
966
+ },
967
+ },
968
+ ],
969
+ },
970
+ };
971
+ }
972
+ if (promptName === "commercial_playbook") {
973
+ const playbooks = engine.listCommercialPlaybooks(ctx);
974
+ const requested = promptArgs.playbook ? String(promptArgs.playbook) : "";
975
+ return {
976
+ jsonrpc: "2.0",
977
+ id,
978
+ result: {
979
+ resultType: "complete",
980
+ description: "Multi-Step Temporal Saga Playbook Runner & Author",
981
+ messages: [
982
+ {
983
+ role: "user",
984
+ content: {
985
+ type: "text",
986
+ text: [
987
+ `# Muxo Multi-Step Temporal Saga Playbooks`,
988
+ requested
989
+ ? `Requested Playbook: **${requested}** — call \`get_run_context({ prompt: "Run the ${requested} playbook" })\` or \`get_run_context({ action: "run_playbook", slug: "${requested}" })\`.`
990
+ : `Call \`get_run_context({ prompt: "Run the fullstack cloud bootstrap playbook" })\` or create a custom playbook in plain English with \`get_run_context({ prompt: "Create playbook daily-seo-slack that runs instant.seo.audit and app.slack.send_message" })\`.`,
991
+ `### Available Playbooks (${playbooks.length})\n\`\`\`json\n${JSON.stringify(playbooks, null, 2)}\n\`\`\``,
992
+ ].join("\n\n"),
993
+ },
994
+ },
995
+ ],
996
+ },
997
+ };
998
+ }
844
999
  return {
845
1000
  jsonrpc: "2.0",
846
1001
  id,
@@ -1027,6 +1182,24 @@ export async function handleJsonRpcMcpRequest(engine, ctx, rpc) {
1027
1182
  description: "Tamper-evident SHA-256 + portable Ed25519 AgenticReceipt chain verification report.",
1028
1183
  mimeType: "application/json",
1029
1184
  },
1185
+ {
1186
+ uri: "muxo://harness/config",
1187
+ name: "Turnkey Agent Harness Configuration & Presets",
1188
+ description: "Ready-to-paste MCP config snippets, system prompt directives, turnkey governance presets, and natural-language cheatsheet for Claude Code, Cursor, Codex, ChatGPT, Claude Desktop, and Factory Droid.",
1189
+ mimeType: "application/json",
1190
+ },
1191
+ {
1192
+ uri: "muxo://playbooks",
1193
+ name: "Multi-Step Temporal Saga Playbooks",
1194
+ description: "Turnkey and custom workspace Temporal-compatible Saga playbooks with LIFO rollback compensation actions.",
1195
+ mimeType: "application/json",
1196
+ },
1197
+ {
1198
+ uri: "muxo://skills",
1199
+ name: "Muxo Governed Domain & Workflow Skills Catalog",
1200
+ description: "Catalog of transpiled domain automation, zero-OAuth cloud infrastructure (Stripe Projects), and multi-app workflow skills with pitfalls and tool sequences.",
1201
+ mimeType: "application/json",
1202
+ },
1030
1203
  ];
1031
1204
  return {
1032
1205
  jsonrpc: "2.0",
@@ -1218,6 +1391,94 @@ export async function handleJsonRpcMcpRequest(engine, ctx, rpc) {
1218
1391
  },
1219
1392
  };
1220
1393
  }
1394
+ if (uri === "muxo://harness/config") {
1395
+ const bundle = await engine.configureHarness(ctx);
1396
+ return {
1397
+ jsonrpc: "2.0",
1398
+ id,
1399
+ result: {
1400
+ resultType: "complete",
1401
+ ttlMs: 60_000,
1402
+ cacheScope: "private",
1403
+ contents: [
1404
+ {
1405
+ uri,
1406
+ mimeType: "application/json",
1407
+ text: JSON.stringify(bundle, null, 2),
1408
+ },
1409
+ ],
1410
+ },
1411
+ };
1412
+ }
1413
+ if (uri === "muxo://playbooks") {
1414
+ const playbooks = engine.listCommercialPlaybooks(ctx);
1415
+ return {
1416
+ jsonrpc: "2.0",
1417
+ id,
1418
+ result: {
1419
+ resultType: "complete",
1420
+ ttlMs: 60_000,
1421
+ cacheScope: "private",
1422
+ contents: [
1423
+ {
1424
+ uri,
1425
+ mimeType: "application/json",
1426
+ text: JSON.stringify({ ok: true, playbooks }, null, 2),
1427
+ },
1428
+ ],
1429
+ },
1430
+ };
1431
+ }
1432
+ if (uri === "muxo://skills") {
1433
+ const skills = listMuxoSkills();
1434
+ return {
1435
+ jsonrpc: "2.0",
1436
+ id,
1437
+ result: {
1438
+ resultType: "complete",
1439
+ ttlMs: 60_000,
1440
+ cacheScope: "private",
1441
+ contents: [
1442
+ {
1443
+ uri,
1444
+ mimeType: "application/json",
1445
+ text: JSON.stringify({ ok: true, count: skills.length, skills }, null, 2),
1446
+ },
1447
+ ],
1448
+ },
1449
+ };
1450
+ }
1451
+ if (uri.startsWith("muxo://skills/")) {
1452
+ const skillSlug = decodeURIComponent(uri.slice("muxo://skills/".length)).trim();
1453
+ const skillDef = getMuxoSkill(skillSlug);
1454
+ const markdown = renderMuxoSkillMarkdown(skillSlug);
1455
+ if (!skillDef || !markdown) {
1456
+ return {
1457
+ jsonrpc: "2.0",
1458
+ id,
1459
+ error: {
1460
+ code: -32602,
1461
+ message: `Resource not found: ${uri}`,
1462
+ },
1463
+ };
1464
+ }
1465
+ return {
1466
+ jsonrpc: "2.0",
1467
+ id,
1468
+ result: {
1469
+ resultType: "complete",
1470
+ ttlMs: 300_000,
1471
+ cacheScope: "public",
1472
+ contents: [
1473
+ {
1474
+ uri,
1475
+ mimeType: "application/json",
1476
+ text: JSON.stringify({ ok: true, skill: skillDef, markdown }, null, 2),
1477
+ },
1478
+ ],
1479
+ },
1480
+ };
1481
+ }
1221
1482
  if (uri.startsWith("muxo://tools/")) {
1222
1483
  const slug = decodeURIComponent(uri.slice("muxo://tools/".length)).trim();
1223
1484
  try {