@agentwonderland/mcp 0.1.57 → 0.1.58

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.
@@ -61,46 +61,6 @@ describe("api-client headers", () => {
61
61
  }),
62
62
  }));
63
63
  });
64
- it("labels playbook API calls with MCP surface, version, tool, and action headers", async () => {
65
- const fetchMock = vi.fn(async () => new Response(JSON.stringify({ ok: true }), {
66
- status: 200,
67
- headers: { "content-type": "application/json" },
68
- }));
69
- vi.stubGlobal("fetch", fetchMock);
70
- const { apiGet, apiPost } = await import("../api-client.js");
71
- await apiGet("/playbooks?limit=1");
72
- await apiGet("/playbooks/competitor-ads");
73
- await apiGet("/playbooks/competitor-ads/versions");
74
- await apiGet("/playbooks/competitor-ads/versions/1");
75
- await apiPost("/playbooks/competitor-ads/favorite", {});
76
- await apiPost("/playbooks/competitor-ads/feedback", { rating: 5 });
77
- await apiPost("/playbook-quotes", { slug: "competitor-ads", budget: 5 });
78
- await apiPost("/playbook-runs", { slug: "competitor-ads", budget: 5 });
79
- await apiGet("/playbook-runs/run-1");
80
- await apiPost("/playbook-runs/run-1/steps/ads", { status: "running" });
81
- const calls = fetchMock.mock.calls.map(([url, init]) => ({
82
- url: String(url).replace("https://api.agentwonderland.test", ""),
83
- headers: init.headers,
84
- }));
85
- for (const call of calls) {
86
- expect(call.headers).toMatchObject({
87
- "Content-Type": "application/json",
88
- Accept: "application/json",
89
- "X-AW-Surface": "mcp",
90
- "X-AW-MCP-Version": MCP_PACKAGE_VERSION,
91
- });
92
- }
93
- expect(calls[0]).toMatchObject({ url: "/playbooks?limit=1", headers: { "X-AW-MCP-Tool": "search_playbooks", "X-AW-MCP-Action": "search" } });
94
- expect(calls[1]).toMatchObject({ url: "/playbooks/competitor-ads", headers: { "X-AW-MCP-Tool": "get_playbook", "X-AW-MCP-Action": "view" } });
95
- expect(calls[2]).toMatchObject({ url: "/playbooks/competitor-ads/versions", headers: { "X-AW-MCP-Tool": "get_playbook", "X-AW-MCP-Action": "view" } });
96
- expect(calls[3]).toMatchObject({ url: "/playbooks/competitor-ads/versions/1", headers: { "X-AW-MCP-Tool": "get_playbook", "X-AW-MCP-Action": "view" } });
97
- expect(calls[4]).toMatchObject({ url: "/playbooks/competitor-ads/favorite", headers: { "X-AW-MCP-Tool": "favorite_playbook", "X-AW-MCP-Action": "favorite" } });
98
- expect(calls[5]).toMatchObject({ url: "/playbooks/competitor-ads/feedback", headers: { "X-AW-MCP-Tool": "rate_playbook", "X-AW-MCP-Action": "feedback" } });
99
- expect(calls[6]).toMatchObject({ url: "/playbook-quotes", headers: { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "quote" } });
100
- expect(calls[7]).toMatchObject({ url: "/playbook-runs", headers: { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "execute" } });
101
- expect(calls[8]).toMatchObject({ url: "/playbook-runs/run-1", headers: { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "poll" } });
102
- expect(calls[9]).toMatchObject({ url: "/playbook-runs/run-1/steps/ads", headers: { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "execute" } });
103
- });
104
64
  it("uses Link MPP pay with run-agent headers for an approved spend request", async () => {
105
65
  const { apiPostWithApprovedLinkSpendRequest } = await import("../api-client.js");
106
66
  await apiPostWithApprovedLinkSpendRequest("/agents/agent-1/run", { input: { text: "hello" } }, "lsrq_test_123");
@@ -26,24 +26,6 @@ function inferToolHeaders(path, method) {
26
26
  if (path.startsWith("/agents?") || path === "/agents" || path === "/agents/search") {
27
27
  return { "X-AW-MCP-Tool": "search_agents", "X-AW-MCP-Action": "search" };
28
28
  }
29
- if (path.startsWith("/playbooks?") || path === "/playbooks") {
30
- return { "X-AW-MCP-Tool": "search_playbooks", "X-AW-MCP-Action": "search" };
31
- }
32
- if (/^\/playbooks\/[^/]+(?:\/versions(?:\/[^/]+)?)?$/.test(path)) {
33
- return { "X-AW-MCP-Tool": "get_playbook", "X-AW-MCP-Action": "view" };
34
- }
35
- if (/^\/playbooks\/[^/]+\/favorite$/.test(path)) {
36
- return { "X-AW-MCP-Tool": "favorite_playbook", "X-AW-MCP-Action": "favorite" };
37
- }
38
- if (/^\/playbooks\/[^/]+\/feedback$/.test(path)) {
39
- return { "X-AW-MCP-Tool": "rate_playbook", "X-AW-MCP-Action": "feedback" };
40
- }
41
- if (path === "/playbook-quotes") {
42
- return { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "quote" };
43
- }
44
- if (path === "/playbook-runs" || path.startsWith("/playbook-runs/")) {
45
- return { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": method === "GET" ? "poll" : "execute" };
46
- }
47
29
  if (/^\/agents\/[^/]+$/.test(path)) {
48
30
  return { "X-AW-MCP-Tool": "get_agent", "X-AW-MCP-Action": "view" };
49
31
  }
@@ -1 +1 @@
1
- export declare const MCP_PACKAGE_VERSION = "0.1.57";
1
+ export declare const MCP_PACKAGE_VERSION = "0.1.58";
@@ -1 +1 @@
1
- export const MCP_PACKAGE_VERSION = "0.1.57";
1
+ export const MCP_PACKAGE_VERSION = "0.1.58";
package/dist/index.js CHANGED
@@ -16,7 +16,6 @@ import { registerRebateTools } from "./tools/rebates.js";
16
16
  import { registerUploadTools } from "./tools/upload.js";
17
17
  import { registerProbeTools } from "./tools/probe.js";
18
18
  import { registerProviderTools } from "./tools/providers.js";
19
- import { registerPlaybookTools } from "./tools/playbooks.js";
20
19
  // ── Resources ────────────────────────────────────────────────────
21
20
  import { registerAgentResources } from "./resources/agents.js";
22
21
  import { registerWalletResources } from "./resources/wallet.js";
@@ -42,10 +41,8 @@ export async function startMcpServer() {
42
41
  "WORKFLOW:",
43
42
  "1. solve(intent, input, budget) — one call: find best agent + pay + run. Use when the task is clear.",
44
43
  " OR: search_agents() → get_agent() to inspect schema → run_agent() with required fields.",
45
- " For multi-agent workflows, use search_playbooks() → get_playbook() → run_playbook().",
46
44
  "2. If the agent returns status 'processing', poll with get_job(). Async runs resolve automatically.",
47
45
  "3. After a successful agent run, rate_agent() and optionally tip_agent() if the result was useful.",
48
- " Playbooks return one run-level receipt; do not ask users to rate or tip individual child-agent steps.",
49
46
  "4. Use list_jobs() to recover state across sessions (it checks every configured wallet).",
50
47
  "",
51
48
  "PAYMENT:",
@@ -88,7 +85,6 @@ export async function startMcpServer() {
88
85
  registerUploadTools(server);
89
86
  registerProbeTools(server);
90
87
  registerProviderTools(server);
91
- registerPlaybookTools(server);
92
88
  // Register resources
93
89
  registerAgentResources(server);
94
90
  registerWalletResources(server);
@@ -12,4 +12,3 @@ export { registerRebateTools } from "./rebates.js";
12
12
  export { registerUploadTools } from "./upload.js";
13
13
  export { registerProbeTools } from "./probe.js";
14
14
  export { registerProviderTools } from "./providers.js";
15
- export { registerPlaybookTools } from "./playbooks.js";
@@ -12,4 +12,3 @@ export { registerRebateTools } from "./rebates.js";
12
12
  export { registerUploadTools } from "./upload.js";
13
13
  export { registerProbeTools } from "./probe.js";
14
14
  export { registerProviderTools } from "./providers.js";
15
- export { registerPlaybookTools } from "./playbooks.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentwonderland/mcp",
3
- "version": "0.1.57",
3
+ "version": "0.1.58",
4
4
  "type": "module",
5
5
  "description": "MCP server for the Agent Wonderland AI agent marketplace",
6
6
  "bin": {
@@ -94,50 +94,6 @@ describe("api-client headers", () => {
94
94
  );
95
95
  });
96
96
 
97
- it("labels playbook API calls with MCP surface, version, tool, and action headers", async () => {
98
- const fetchMock = vi.fn(async () => new Response(JSON.stringify({ ok: true }), {
99
- status: 200,
100
- headers: { "content-type": "application/json" },
101
- }));
102
- vi.stubGlobal("fetch", fetchMock);
103
- const { apiGet, apiPost } = await import("../api-client.js");
104
-
105
- await apiGet("/playbooks?limit=1");
106
- await apiGet("/playbooks/competitor-ads");
107
- await apiGet("/playbooks/competitor-ads/versions");
108
- await apiGet("/playbooks/competitor-ads/versions/1");
109
- await apiPost("/playbooks/competitor-ads/favorite", {});
110
- await apiPost("/playbooks/competitor-ads/feedback", { rating: 5 });
111
- await apiPost("/playbook-quotes", { slug: "competitor-ads", budget: 5 });
112
- await apiPost("/playbook-runs", { slug: "competitor-ads", budget: 5 });
113
- await apiGet("/playbook-runs/run-1");
114
- await apiPost("/playbook-runs/run-1/steps/ads", { status: "running" });
115
-
116
- const calls = (fetchMock.mock.calls as unknown as Array<[unknown, { headers?: unknown }]>).map(([url, init]) => ({
117
- url: String(url).replace("https://api.agentwonderland.test", ""),
118
- headers: init.headers as Record<string, string>,
119
- }));
120
-
121
- for (const call of calls) {
122
- expect(call.headers).toMatchObject({
123
- "Content-Type": "application/json",
124
- Accept: "application/json",
125
- "X-AW-Surface": "mcp",
126
- "X-AW-MCP-Version": MCP_PACKAGE_VERSION,
127
- });
128
- }
129
- expect(calls[0]).toMatchObject({ url: "/playbooks?limit=1", headers: { "X-AW-MCP-Tool": "search_playbooks", "X-AW-MCP-Action": "search" } });
130
- expect(calls[1]).toMatchObject({ url: "/playbooks/competitor-ads", headers: { "X-AW-MCP-Tool": "get_playbook", "X-AW-MCP-Action": "view" } });
131
- expect(calls[2]).toMatchObject({ url: "/playbooks/competitor-ads/versions", headers: { "X-AW-MCP-Tool": "get_playbook", "X-AW-MCP-Action": "view" } });
132
- expect(calls[3]).toMatchObject({ url: "/playbooks/competitor-ads/versions/1", headers: { "X-AW-MCP-Tool": "get_playbook", "X-AW-MCP-Action": "view" } });
133
- expect(calls[4]).toMatchObject({ url: "/playbooks/competitor-ads/favorite", headers: { "X-AW-MCP-Tool": "favorite_playbook", "X-AW-MCP-Action": "favorite" } });
134
- expect(calls[5]).toMatchObject({ url: "/playbooks/competitor-ads/feedback", headers: { "X-AW-MCP-Tool": "rate_playbook", "X-AW-MCP-Action": "feedback" } });
135
- expect(calls[6]).toMatchObject({ url: "/playbook-quotes", headers: { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "quote" } });
136
- expect(calls[7]).toMatchObject({ url: "/playbook-runs", headers: { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "execute" } });
137
- expect(calls[8]).toMatchObject({ url: "/playbook-runs/run-1", headers: { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "poll" } });
138
- expect(calls[9]).toMatchObject({ url: "/playbook-runs/run-1/steps/ads", headers: { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "execute" } });
139
- });
140
-
141
97
  it("uses Link MPP pay with run-agent headers for an approved spend request", async () => {
142
98
  const { apiPostWithApprovedLinkSpendRequest } = await import("../api-client.js");
143
99
 
@@ -42,24 +42,6 @@ function inferToolHeaders(path: string, method: string): Record<string, string>
42
42
  if (path.startsWith("/agents?") || path === "/agents" || path === "/agents/search") {
43
43
  return { "X-AW-MCP-Tool": "search_agents", "X-AW-MCP-Action": "search" };
44
44
  }
45
- if (path.startsWith("/playbooks?") || path === "/playbooks") {
46
- return { "X-AW-MCP-Tool": "search_playbooks", "X-AW-MCP-Action": "search" };
47
- }
48
- if (/^\/playbooks\/[^/]+(?:\/versions(?:\/[^/]+)?)?$/.test(path)) {
49
- return { "X-AW-MCP-Tool": "get_playbook", "X-AW-MCP-Action": "view" };
50
- }
51
- if (/^\/playbooks\/[^/]+\/favorite$/.test(path)) {
52
- return { "X-AW-MCP-Tool": "favorite_playbook", "X-AW-MCP-Action": "favorite" };
53
- }
54
- if (/^\/playbooks\/[^/]+\/feedback$/.test(path)) {
55
- return { "X-AW-MCP-Tool": "rate_playbook", "X-AW-MCP-Action": "feedback" };
56
- }
57
- if (path === "/playbook-quotes") {
58
- return { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": "quote" };
59
- }
60
- if (path === "/playbook-runs" || path.startsWith("/playbook-runs/")) {
61
- return { "X-AW-MCP-Tool": "run_playbook", "X-AW-MCP-Action": method === "GET" ? "poll" : "execute" };
62
- }
63
45
  if (/^\/agents\/[^/]+$/.test(path)) {
64
46
  return { "X-AW-MCP-Tool": "get_agent", "X-AW-MCP-Action": "view" };
65
47
  }
@@ -1 +1 @@
1
- export const MCP_PACKAGE_VERSION = "0.1.57";
1
+ export const MCP_PACKAGE_VERSION = "0.1.58";
package/src/index.ts CHANGED
@@ -18,7 +18,6 @@ import { registerRebateTools } from "./tools/rebates.js";
18
18
  import { registerUploadTools } from "./tools/upload.js";
19
19
  import { registerProbeTools } from "./tools/probe.js";
20
20
  import { registerProviderTools } from "./tools/providers.js";
21
- import { registerPlaybookTools } from "./tools/playbooks.js";
22
21
 
23
22
  // ── Resources ────────────────────────────────────────────────────
24
23
  import { registerAgentResources } from "./resources/agents.js";
@@ -49,10 +48,8 @@ export async function startMcpServer(): Promise<void> {
49
48
  "WORKFLOW:",
50
49
  "1. solve(intent, input, budget) — one call: find best agent + pay + run. Use when the task is clear.",
51
50
  " OR: search_agents() → get_agent() to inspect schema → run_agent() with required fields.",
52
- " For multi-agent workflows, use search_playbooks() → get_playbook() → run_playbook().",
53
51
  "2. If the agent returns status 'processing', poll with get_job(). Async runs resolve automatically.",
54
52
  "3. After a successful agent run, rate_agent() and optionally tip_agent() if the result was useful.",
55
- " Playbooks return one run-level receipt; do not ask users to rate or tip individual child-agent steps.",
56
53
  "4. Use list_jobs() to recover state across sessions (it checks every configured wallet).",
57
54
  "",
58
55
  "PAYMENT:",
@@ -97,7 +94,6 @@ export async function startMcpServer(): Promise<void> {
97
94
  registerUploadTools(server);
98
95
  registerProbeTools(server);
99
96
  registerProviderTools(server);
100
- registerPlaybookTools(server);
101
97
 
102
98
  // Register resources
103
99
  registerAgentResources(server);
@@ -12,4 +12,3 @@ export { registerRebateTools } from "./rebates.js";
12
12
  export { registerUploadTools } from "./upload.js";
13
13
  export { registerProbeTools } from "./probe.js";
14
14
  export { registerProviderTools } from "./providers.js";
15
- export { registerPlaybookTools } from "./playbooks.js";
@@ -1 +0,0 @@
1
- export {};
@@ -1,67 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { buildExplicitPlaybookStepInput, playbookRunBlocker } from "../playbook-adapters.js";
3
- describe("playbook step adapters", () => {
4
- it("maps ipo-brief child steps to their live input schemas", () => {
5
- expect(buildExplicitPlaybookStepInput("ipo-brief", { ticker: "CRCL" }, {
6
- id: "s1",
7
- agent_slug: "ipo-s-1-analysis",
8
- })).toMatchObject({ status: "ready", input: { ticker: "CRCL" } });
9
- expect(buildExplicitPlaybookStepInput("ipo-brief", { ticker: "CRCL" }, {
10
- id: "insiders",
11
- agent_slug: "insider-trading-tracker",
12
- })).toMatchObject({ status: "ready", input: { ticker: "CRCL", days_back: 365 } });
13
- expect(buildExplicitPlaybookStepInput("ipo-brief", { ticker: "CRCL", peer_tickers: ["COIN", "HOOD"] }, {
14
- id: "comps",
15
- agent_slug: "stock-comparison",
16
- })).toMatchObject({ status: "ready", input: { tickers: ["CRCL", "COIN", "HOOD"] } });
17
- });
18
- it("maps launch-landing council, writer, and publisher steps explicitly", () => {
19
- const council = buildExplicitPlaybookStepInput("launch-landing", {
20
- brief: "Agent marketplace for builders",
21
- product_slug: "agent-wonderland",
22
- }, {
23
- id: "council",
24
- agent_slug: "marketing-copy-council",
25
- });
26
- expect(council).toMatchObject({ status: "ready", input: { brief: "Agent marketplace for builders" } });
27
- const writer = buildExplicitPlaybookStepInput("launch-landing", {
28
- brief: "Agent marketplace for builders",
29
- product_slug: "agent-wonderland",
30
- previous_outputs: [{ step: "council", output: { headline: "Hire agents on demand" } }],
31
- }, {
32
- id: "structure",
33
- agent_slug: "write-landing-page-copy",
34
- });
35
- expect(writer).toMatchObject({
36
- status: "ready",
37
- input: {
38
- product: "agent-wonderland",
39
- audience: "builders and operators",
40
- },
41
- });
42
- expect(writer.input.context).toContain("Hire agents on demand");
43
- const publisher = buildExplicitPlaybookStepInput("launch-landing", {
44
- brief: "Agent marketplace for builders",
45
- product_slug: "agent-wonderland",
46
- previous_outputs: [{ step: "structure", output: { html: "<html><body>Ship</body></html>" } }],
47
- }, {
48
- id: "publish",
49
- agent_slug: "publish-html-to-a-public-url",
50
- });
51
- expect(publisher).toMatchObject({
52
- status: "ready",
53
- input: {
54
- html: "<html><body>Ship</body></html>",
55
- slug: "agent-wonderland",
56
- },
57
- });
58
- });
59
- it("blocks known broken fanout playbooks before paid child execution", () => {
60
- expect(playbookRunBlocker("icp-hunter")).toContain("prospect-search schema");
61
- expect(playbookRunBlocker("no-web-leads")).toContain("no-web/place/phone schemas");
62
- expect(buildExplicitPlaybookStepInput("icp-hunter", { icp: "VP Eng" }, {
63
- id: "prospects",
64
- agent_slug: "find-prospects",
65
- })).toMatchObject({ status: "blocked", code: "PLAYBOOK_NOT_CERTIFIED" });
66
- });
67
- });
@@ -1 +0,0 @@
1
- export {};