@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.
@@ -1,2 +0,0 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare function registerObservabilityTools(server: McpServer): void;
@@ -1,20 +0,0 @@
1
- import { apiPost } from "../core/api-client.js";
2
- function text(t) {
3
- return { content: [{ type: "text", text: t }] };
4
- }
5
- export function registerObservabilityTools(server) {
6
- server.tool("open_observability_dashboard", "Generate a secure one-click sign-in URL for the Agent Wonderland web observability dashboard. The dashboard shows your agent runs, spend, rebates, and recent activity.", {}, async () => {
7
- const result = await apiPost("/observability/link", {}, { ensureConsumerPrincipal: true });
8
- const lines = [
9
- "Your secure observability link is ready:",
10
- result.url,
11
- "",
12
- `Expires: ${result.expires_at}`,
13
- ];
14
- if (result.consumer_principal) {
15
- lines.push(`Consumer principal: ${result.consumer_principal}`);
16
- }
17
- lines.push("", "Open the link in your browser to view usage metrics, spend, rebates, and recent runs.");
18
- return text(lines.join("\n"));
19
- });
20
- }
@@ -1,19 +0,0 @@
1
- type StepLike = {
2
- id: string;
3
- agent_slug: string | null;
4
- default_input?: Record<string, unknown>;
5
- quantity?: number;
6
- iteration?: number;
7
- };
8
- export type PlaybookStepInputResult = {
9
- status: "ready";
10
- input: Record<string, unknown>;
11
- certification: "explicit";
12
- } | {
13
- status: "blocked";
14
- code: string;
15
- message: string;
16
- };
17
- export declare function playbookRunBlocker(slug: string): string | null;
18
- export declare function buildExplicitPlaybookStepInput(playbookSlug: string, baseInput: Record<string, unknown>, step: StepLike): PlaybookStepInputResult | null;
19
- export {};
@@ -1,164 +0,0 @@
1
- const BLOCKED_PLAYBOOKS = {
2
- "icp-hunter": "Blocked until the friendly ICP input is mapped to the live prospect-search schema and the prospect agent is verified to honor those filters.",
3
- "no-web-leads": "Blocked until zip/category inputs are mapped to the live no-web/place/phone schemas and the no-web agent is verified to honor the requested local filters.",
4
- };
5
- function asString(value) {
6
- return typeof value === "string" && value.trim() ? value.trim() : undefined;
7
- }
8
- function outputRecord(value) {
9
- return value && typeof value === "object" && !Array.isArray(value)
10
- ? value
11
- : undefined;
12
- }
13
- function previousOutputs(input) {
14
- return Array.isArray(input.previous_outputs)
15
- ? input.previous_outputs.map(outputRecord).filter((item) => Boolean(item))
16
- : [];
17
- }
18
- function stepOutput(entry) {
19
- return outputRecord(entry)?.output ?? entry;
20
- }
21
- function extractHtml(value) {
22
- if (typeof value === "string" && /<html|<!doctype|<body|<section|<main/i.test(value))
23
- return value;
24
- const record = outputRecord(value);
25
- if (!record)
26
- return undefined;
27
- const direct = record.html;
28
- if (typeof direct === "string" && direct.trim())
29
- return direct;
30
- const output = record.output;
31
- if (typeof output === "string" && /<html|<!doctype|<body|<section|<main/i.test(output))
32
- return output;
33
- const nested = outputRecord(output);
34
- return typeof nested?.html === "string" && nested.html.trim() ? nested.html : undefined;
35
- }
36
- function launchLandingInput(baseInput, step) {
37
- const brief = asString(baseInput.brief) ?? asString(baseInput.context) ?? asString(baseInput.product);
38
- if (!brief) {
39
- return {
40
- status: "blocked",
41
- code: "PLAYBOOK_INPUT_MISSING_BRIEF",
42
- message: "launch-landing requires a brief before any child agent is called.",
43
- };
44
- }
45
- if (step.agent_slug === "marketing-copy-council") {
46
- return {
47
- status: "ready",
48
- certification: "explicit",
49
- input: {
50
- brief,
51
- context: {
52
- product_slug: asString(baseInput.product_slug),
53
- },
54
- num_outputs: 1,
55
- },
56
- };
57
- }
58
- const outputs = previousOutputs(baseInput);
59
- if (step.agent_slug === "write-landing-page-copy") {
60
- const council = outputs.find((item) => item.step === "council" || item.step === "marketing-copy-council") ?? outputs.at(-1);
61
- const product = asString(baseInput.product)
62
- ?? asString(baseInput.product_name)
63
- ?? asString(baseInput.product_slug)
64
- ?? "Landing page";
65
- return {
66
- status: "ready",
67
- certification: "explicit",
68
- input: {
69
- product,
70
- audience: asString(baseInput.audience) ?? "builders and operators",
71
- tone: asString(baseInput.tone) ?? "confident and practical",
72
- context: JSON.stringify({
73
- brief,
74
- product_slug: asString(baseInput.product_slug),
75
- council_output: stepOutput(council),
76
- }),
77
- },
78
- };
79
- }
80
- if (step.agent_slug === "publish-html-to-a-public-url") {
81
- const writer = outputs.find((item) => item.step === "structure" || item.step === "write-landing-page-copy") ?? outputs.at(-1);
82
- const html = extractHtml(stepOutput(writer)) ?? extractHtml(writer);
83
- if (!html) {
84
- return {
85
- status: "blocked",
86
- code: "PLAYBOOK_INPUT_MISSING_HTML",
87
- message: "launch-landing publish step requires generated HTML from the writer step.",
88
- };
89
- }
90
- return {
91
- status: "ready",
92
- certification: "explicit",
93
- input: {
94
- html,
95
- slug: asString(baseInput.product_slug) ?? asString(baseInput.slug),
96
- title: asString(baseInput.title) ?? asString(baseInput.product) ?? asString(baseInput.product_slug),
97
- },
98
- };
99
- }
100
- return {
101
- status: "blocked",
102
- code: "PLAYBOOK_STEP_NOT_CERTIFIED",
103
- message: `launch-landing step ${step.id} (${step.agent_slug ?? "unknown"}) has no explicit adapter.`,
104
- };
105
- }
106
- function ipoBriefInput(baseInput, step) {
107
- const ticker = asString(baseInput.ticker) ?? asString(baseInput.symbol);
108
- if (!ticker) {
109
- return {
110
- status: "blocked",
111
- code: "PLAYBOOK_INPUT_MISSING_TICKER",
112
- message: "ipo-brief requires ticker before any child agent is called.",
113
- };
114
- }
115
- if (step.agent_slug === "ipo-s-1-analysis") {
116
- return {
117
- status: "ready",
118
- certification: "explicit",
119
- input: { ticker },
120
- };
121
- }
122
- if (step.agent_slug === "insider-trading-tracker") {
123
- return {
124
- status: "ready",
125
- certification: "explicit",
126
- input: {
127
- ticker,
128
- days_back: Number(baseInput.days_back ?? 365),
129
- },
130
- };
131
- }
132
- if (step.agent_slug === "stock-comparison") {
133
- const peers = Array.isArray(baseInput.peer_tickers) ? baseInput.peer_tickers : [];
134
- const tickers = [ticker, ...peers].filter((item) => typeof item === "string" && Boolean(item.trim())).slice(0, 5);
135
- return {
136
- status: "ready",
137
- certification: "explicit",
138
- input: { tickers },
139
- };
140
- }
141
- return {
142
- status: "blocked",
143
- code: "PLAYBOOK_STEP_NOT_CERTIFIED",
144
- message: `ipo-brief step ${step.id} (${step.agent_slug ?? "unknown"}) has no explicit adapter.`,
145
- };
146
- }
147
- export function playbookRunBlocker(slug) {
148
- return BLOCKED_PLAYBOOKS[slug] ?? null;
149
- }
150
- export function buildExplicitPlaybookStepInput(playbookSlug, baseInput, step) {
151
- const blocker = playbookRunBlocker(playbookSlug);
152
- if (blocker) {
153
- return {
154
- status: "blocked",
155
- code: "PLAYBOOK_NOT_CERTIFIED",
156
- message: blocker,
157
- };
158
- }
159
- if (playbookSlug === "launch-landing")
160
- return launchLandingInput(baseInput, step);
161
- if (playbookSlug === "ipo-brief")
162
- return ipoBriefInput(baseInput, step);
163
- return null;
164
- }
@@ -1,2 +0,0 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare function registerPlaybookTools(server: McpServer): void;