@launchpath-ai/mcp-server 1.0.11 → 1.0.13
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/build/index.js +16 -10
- package/build/index.js.map +1 -1
- package/build/tools/campaigns.d.ts +1 -1
- package/build/tools/campaigns.js +100 -30
- package/build/tools/campaigns.js.map +1 -1
- package/build/tools/channels.d.ts +4 -2
- package/build/tools/channels.js +168 -199
- package/build/tools/channels.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -43,12 +43,13 @@ const SERVER_INSTRUCTIONS = `LaunchPath is an AI agent deployment platform. You
|
|
|
43
43
|
2. **Train** it: use discover_pages to find all pages on a site, scrape_website to add content, generate_faqs to auto-create Q&A pairs, and add_faq for manual Q&A pairs
|
|
44
44
|
3. **Add integrations**: browse_integrations to find apps, then add_agent_tool to add tools to the agent
|
|
45
45
|
4. **Test** (only when the user asks): use chat_with_agent to send test messages — this works without deploying. Each message costs credits, so ALWAYS ask the user before testing. Never test automatically after creating or updating an agent.
|
|
46
|
-
5. **Deploy** (only when the user asks):
|
|
46
|
+
5. **Deploy** (only when the user asks): create a client, then create a campaign to deploy as a website widget or WhatsApp
|
|
47
47
|
6. **Manage clients**: use create_client + create_campaign to assign agents to client businesses
|
|
48
48
|
|
|
49
49
|
## Key Rules
|
|
50
50
|
- Always call list_agents first if you need an agent_id
|
|
51
51
|
- Always call list_clients first if you need a client_id
|
|
52
|
+
- Always call list_campaigns first if you need a campaign_id
|
|
52
53
|
- Use get_agent to read current config before calling update_agent
|
|
53
54
|
- Do NOT use chat_with_agent unless the user explicitly asks to test. Testing costs credits.
|
|
54
55
|
- Use discover_pages before scrape_website for full-site coverage
|
|
@@ -56,22 +57,27 @@ const SERVER_INSTRUCTIONS = `LaunchPath is an AI agent deployment platform. You
|
|
|
56
57
|
- Do NOT deploy unless the user explicitly asks.
|
|
57
58
|
- Do NOT test (chat_with_agent) unless the user explicitly asks. Each test message uses credits.
|
|
58
59
|
|
|
59
|
-
## Deploying
|
|
60
|
+
## Deploying for Clients
|
|
60
61
|
Only deploy when the user requests it.
|
|
61
62
|
|
|
62
63
|
### Website Widget
|
|
63
|
-
1.
|
|
64
|
-
2.
|
|
65
|
-
3.
|
|
64
|
+
1. create_client (if needed) — create the client business first
|
|
65
|
+
2. create_campaign(name, agent_id, client_id, channel_type: "widget") — creates the campaign with a widget deployment
|
|
66
|
+
3. configure_widget(campaign_id) — customize colors, theme, position, avatar, welcome message, conversation starters, pre-chat form
|
|
67
|
+
4. update_campaign(campaign_id, status: "active") — activate the campaign (this enables the widget)
|
|
68
|
+
5. get_embed_code(campaign_id) — get the HTML snippet to paste on a website
|
|
66
69
|
|
|
67
70
|
### WhatsApp
|
|
68
71
|
WhatsApp requires Meta Business credentials that must be entered in the LaunchPath dashboard (not via terminal).
|
|
69
|
-
1.
|
|
70
|
-
2.
|
|
71
|
-
3.
|
|
72
|
+
1. create_client (if needed) — create the client business first
|
|
73
|
+
2. create_campaign(name, agent_id, client_id, channel_type: "whatsapp") — creates the campaign with a WhatsApp deployment
|
|
74
|
+
3. Tell the user: "Enter your Meta credentials (Phone Number ID, Access Token, Business Account ID, App Secret) at ${BASE_URL}/dashboard/campaigns/<campaign_id>"
|
|
75
|
+
4. update_campaign(campaign_id, status: "active") — activate once credentials are saved
|
|
76
|
+
5. Use WhatsApp tools: create_wa_template → import_wa_contacts → send_wa_broadcast
|
|
72
77
|
|
|
73
|
-
### API Channel
|
|
74
|
-
|
|
78
|
+
### Standalone API Channel
|
|
79
|
+
For developer integrations that don't need a client or campaign:
|
|
80
|
+
1. create_api_channel(agent_id) — creates an API endpoint with a bearer token
|
|
75
81
|
2. The response includes the public chat endpoint URL and authentication details
|
|
76
82
|
3. Use this to build custom chat UIs, integrate with other apps, or connect to any platform
|
|
77
83
|
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"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,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,wCAAwC,CAAC,CAAC;AAC1D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,GAAG,CAAC,CAAC;IAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Campaigns toolset
|
|
2
|
+
* Campaigns toolset — list, get, create, update campaigns
|
|
3
3
|
*/
|
|
4
4
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
import type { LaunchPathClient } from "../client.js";
|
package/build/tools/campaigns.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Campaigns toolset
|
|
2
|
+
* Campaigns toolset — list, get, create, update campaigns
|
|
3
3
|
*/
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { formatError } from "../client.js";
|
|
@@ -7,7 +7,7 @@ export function registerCampaignTools(server, client) {
|
|
|
7
7
|
// --- list_campaigns ---
|
|
8
8
|
server.registerTool("list_campaigns", {
|
|
9
9
|
title: "List Campaigns",
|
|
10
|
-
description: "List all campaigns. A campaign
|
|
10
|
+
description: "List all campaigns. A campaign deploys an agent for a client (website widget or WhatsApp). Optionally filter by client.",
|
|
11
11
|
inputSchema: {
|
|
12
12
|
client_id: z
|
|
13
13
|
.string()
|
|
@@ -34,7 +34,7 @@ export function registerCampaignTools(server, client) {
|
|
|
34
34
|
// --- get_campaign ---
|
|
35
35
|
server.registerTool("get_campaign", {
|
|
36
36
|
title: "Get Campaign",
|
|
37
|
-
description: "Get full details for a specific campaign.",
|
|
37
|
+
description: "Get full details for a specific campaign including its deployment configuration.",
|
|
38
38
|
inputSchema: {
|
|
39
39
|
campaign_id: z.string().describe("The campaign's UUID"),
|
|
40
40
|
},
|
|
@@ -62,15 +62,17 @@ export function registerCampaignTools(server, client) {
|
|
|
62
62
|
// --- create_campaign ---
|
|
63
63
|
server.registerTool("create_campaign", {
|
|
64
64
|
title: "Create Campaign",
|
|
65
|
-
description: "Create a campaign
|
|
65
|
+
description: "Create a campaign that deploys an agent for a client. Automatically creates the widget or WhatsApp deployment. Use list_clients to find the client_id.",
|
|
66
66
|
inputSchema: {
|
|
67
67
|
name: z.string().describe("Campaign name"),
|
|
68
|
-
agent_id: z.string().describe("The agent's UUID to
|
|
69
|
-
client_id: z
|
|
68
|
+
agent_id: z.string().describe("The agent's UUID to deploy"),
|
|
69
|
+
client_id: z
|
|
70
|
+
.string()
|
|
71
|
+
.describe("The client's UUID to deploy for"),
|
|
70
72
|
channel_type: z
|
|
71
73
|
.enum(["widget", "whatsapp"])
|
|
72
74
|
.optional()
|
|
73
|
-
.describe('
|
|
75
|
+
.describe('Deployment type: "widget" for website chat (default), "whatsapp" for WhatsApp Business'),
|
|
74
76
|
},
|
|
75
77
|
annotations: {
|
|
76
78
|
destructiveHint: false,
|
|
@@ -92,34 +94,42 @@ export function registerCampaignTools(server, client) {
|
|
|
92
94
|
],
|
|
93
95
|
};
|
|
94
96
|
}
|
|
95
|
-
|
|
97
|
+
// Extract campaign ID from response
|
|
96
98
|
const campaignData = res.data;
|
|
97
99
|
const nested = campaignData?.campaign;
|
|
98
|
-
const campaignId =
|
|
100
|
+
const campaignId = (nested?.id ?? campaignData?.id);
|
|
101
|
+
// Follow-up GET to fetch the auto-created channel info
|
|
102
|
+
let fullData = res.data;
|
|
103
|
+
if (campaignId) {
|
|
104
|
+
const detailRes = await client.get(`/api/campaigns/${campaignId}`);
|
|
105
|
+
if (!detailRes.error && detailRes.data) {
|
|
106
|
+
fullData = detailRes.data;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
let text = `Campaign created successfully.\n\n${JSON.stringify(fullData, null, 2)}`;
|
|
99
110
|
if (channel_type === "whatsapp") {
|
|
100
111
|
text += `\n\n## WhatsApp Setup Required`;
|
|
101
|
-
text += `\nThe WhatsApp
|
|
112
|
+
text += `\nThe WhatsApp deployment has been created but is disabled until Meta credentials are configured.`;
|
|
102
113
|
text += `\nThe user must enter their Meta credentials (Phone Number ID, Access Token, Business Account ID, App Secret) at:`;
|
|
103
114
|
text += `\n${client.dashboardUrl}/dashboard/campaigns/${campaignId ?? "<campaign_id>"}`;
|
|
104
|
-
text += `\n\nOnce credentials are saved
|
|
115
|
+
text += `\n\nOnce credentials are saved:`;
|
|
116
|
+
text += `\n1. update_campaign(campaign_id: "${campaignId}", status: "active") to activate`;
|
|
117
|
+
text += `\n2. Use WhatsApp tools: create_wa_template → import_wa_contacts → send_wa_broadcast`;
|
|
105
118
|
}
|
|
106
119
|
else {
|
|
107
120
|
text += `\n\n## Next Steps`;
|
|
108
|
-
text += `\
|
|
121
|
+
text += `\n1. configure_widget(campaign_id: "${campaignId}") — customize colors, welcome message, conversation starters`;
|
|
122
|
+
text += `\n2. update_campaign(campaign_id: "${campaignId}", status: "active") — activate the campaign`;
|
|
123
|
+
text += `\n3. get_embed_code(campaign_id: "${campaignId}") — get the HTML snippet to paste on a website`;
|
|
109
124
|
}
|
|
110
125
|
return {
|
|
111
|
-
content: [
|
|
112
|
-
{
|
|
113
|
-
type: "text",
|
|
114
|
-
text,
|
|
115
|
-
},
|
|
116
|
-
],
|
|
126
|
+
content: [{ type: "text", text }],
|
|
117
127
|
};
|
|
118
128
|
});
|
|
119
129
|
// --- update_campaign ---
|
|
120
130
|
server.registerTool("update_campaign", {
|
|
121
131
|
title: "Update Campaign",
|
|
122
|
-
description:
|
|
132
|
+
description: 'Update a campaign\'s name, status, or deployment settings. Setting status to "active" enables the deployment; "paused" disables it.',
|
|
123
133
|
inputSchema: {
|
|
124
134
|
campaign_id: z.string().describe("The campaign's UUID"),
|
|
125
135
|
name: z.string().optional().describe("New campaign name"),
|
|
@@ -127,29 +137,89 @@ export function registerCampaignTools(server, client) {
|
|
|
127
137
|
.enum(["active", "paused", "completed"])
|
|
128
138
|
.optional()
|
|
129
139
|
.describe("Campaign status"),
|
|
140
|
+
allowed_origins: z
|
|
141
|
+
.array(z.string())
|
|
142
|
+
.optional()
|
|
143
|
+
.describe('Allowed websites for the widget (e.g., ["https://example.com"]). Leave empty to allow any website.'),
|
|
144
|
+
rate_limit_rpm: z
|
|
145
|
+
.number()
|
|
146
|
+
.optional()
|
|
147
|
+
.describe("Rate limit in requests per minute for this deployment"),
|
|
130
148
|
},
|
|
131
149
|
annotations: {
|
|
132
150
|
destructiveHint: false,
|
|
133
151
|
idempotentHint: true,
|
|
134
152
|
},
|
|
135
|
-
}, async ({ campaign_id, name, status }) => {
|
|
136
|
-
|
|
153
|
+
}, async ({ campaign_id, name, status, allowed_origins, rate_limit_rpm }) => {
|
|
154
|
+
// Patch the campaign itself (name, status)
|
|
155
|
+
const campaignBody = {};
|
|
137
156
|
if (name !== undefined)
|
|
138
|
-
|
|
157
|
+
campaignBody.name = name;
|
|
139
158
|
if (status !== undefined)
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
159
|
+
campaignBody.status = status;
|
|
160
|
+
let campaignResult = null;
|
|
161
|
+
if (Object.keys(campaignBody).length > 0) {
|
|
162
|
+
const res = await client.patch(`/api/campaigns/${campaign_id}`, campaignBody);
|
|
163
|
+
if (res.error) {
|
|
164
|
+
return {
|
|
165
|
+
isError: true,
|
|
166
|
+
content: [
|
|
167
|
+
{
|
|
168
|
+
type: "text",
|
|
169
|
+
text: formatError(res.error, res.status),
|
|
170
|
+
},
|
|
171
|
+
],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
campaignResult = res.data;
|
|
175
|
+
}
|
|
176
|
+
// If channel-level fields were provided, resolve and patch the channel
|
|
177
|
+
if (allowed_origins !== undefined || rate_limit_rpm !== undefined) {
|
|
178
|
+
// Fetch campaign to find the channel
|
|
179
|
+
const detailRes = await client.get(`/api/campaigns/${campaign_id}`);
|
|
180
|
+
if (detailRes.error) {
|
|
181
|
+
return {
|
|
182
|
+
isError: true,
|
|
183
|
+
content: [
|
|
184
|
+
{
|
|
185
|
+
type: "text",
|
|
186
|
+
text: formatError(detailRes.error, detailRes.status),
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
const data = detailRes.data;
|
|
192
|
+
const campaign = (data?.campaign ?? data);
|
|
193
|
+
const channels = (data?.channels ?? []);
|
|
194
|
+
if (channels.length > 0) {
|
|
195
|
+
const channel = channels[0];
|
|
196
|
+
const channelBody = {};
|
|
197
|
+
if (allowed_origins !== undefined)
|
|
198
|
+
channelBody.allowed_origins = allowed_origins;
|
|
199
|
+
if (rate_limit_rpm !== undefined)
|
|
200
|
+
channelBody.rate_limit_rpm = rate_limit_rpm;
|
|
201
|
+
const channelRes = await client.patch(`/api/agents/${campaign.agent_id}/channels/${channel.id}`, channelBody);
|
|
202
|
+
if (channelRes.error) {
|
|
203
|
+
return {
|
|
204
|
+
isError: true,
|
|
205
|
+
content: [
|
|
206
|
+
{
|
|
207
|
+
type: "text",
|
|
208
|
+
text: `Campaign updated but deployment settings failed: ${formatError(channelRes.error, channelRes.status)}`,
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
147
214
|
}
|
|
215
|
+
// Fetch final state
|
|
216
|
+
const finalRes = await client.get(`/api/campaigns/${campaign_id}`);
|
|
217
|
+
const finalData = finalRes.error ? campaignResult : finalRes.data;
|
|
148
218
|
return {
|
|
149
219
|
content: [
|
|
150
220
|
{
|
|
151
221
|
type: "text",
|
|
152
|
-
text: `Campaign updated successfully.\n\n${JSON.stringify(
|
|
222
|
+
text: `Campaign updated successfully.\n\n${JSON.stringify(finalData, null, 2)}`,
|
|
153
223
|
},
|
|
154
224
|
],
|
|
155
225
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"campaigns.js","sourceRoot":"","sources":["../../src/tools/campaigns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,UAAU,qBAAqB,CACnC,MAAiB,EACjB,MAAwB;IAExB,yBAAyB;IACzB,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"campaigns.js","sourceRoot":"","sources":["../../src/tools/campaigns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,UAAU,qBAAqB,CACnC,MAAiB,EACjB,MAAwB;IAExB,yBAAyB;IACzB,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,yHAAyH;QAC3H,WAAW,EAAE;YACX,SAAS,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,+BAA+B,CAAC;SAC7C;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;QACtB,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,MAAM,EAAE,CAAC,CAAC;QACxD,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;YACd,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,CAAC,EAAE,IAAI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,QAAQ,aAAa,OAAO,CAAC,EAAE,EAAE,EACzD,WAAW,CACZ,CAAC;gBACF,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC;oBACrB,OAAO;wBACL,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE;4BACP;gCACE,IAAI,EAAE,MAAe;gCACrB,IAAI,EAAE,oDAAoD,WAAW,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE;6BAC7G;yBACF;qBACF,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QAED,oBAAoB;QACpB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,kBAAkB,WAAW,EAAE,CAAC,CAAC;QACnE,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QAElE,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,qCAAqC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;iBAChF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Deployment
|
|
3
|
-
*
|
|
2
|
+
* Deployment tools — configure_widget, get_embed_code, create_api_channel
|
|
3
|
+
*
|
|
4
|
+
* Campaign-centric: users work with campaign_id, never channel_id.
|
|
5
|
+
* Channels are resolved internally via GET /api/campaigns/{id}.
|
|
4
6
|
*/
|
|
5
7
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
8
|
import type { LaunchPathClient } from "../client.js";
|
package/build/tools/channels.js
CHANGED
|
@@ -1,190 +1,86 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Deployment
|
|
3
|
-
*
|
|
2
|
+
* Deployment tools — configure_widget, get_embed_code, create_api_channel
|
|
3
|
+
*
|
|
4
|
+
* Campaign-centric: users work with campaign_id, never channel_id.
|
|
5
|
+
* Channels are resolved internally via GET /api/campaigns/{id}.
|
|
4
6
|
*/
|
|
5
7
|
import { z } from "zod";
|
|
6
8
|
import { formatError } from "../client.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
annotations: {
|
|
16
|
-
readOnlyHint: true,
|
|
17
|
-
openWorldHint: false,
|
|
18
|
-
},
|
|
19
|
-
}, async ({ agent_id }) => {
|
|
20
|
-
const res = await client.get(`/api/agents/${agent_id}/channels`);
|
|
21
|
-
if (res.error) {
|
|
22
|
-
return {
|
|
23
|
-
isError: true,
|
|
24
|
-
content: [{ type: "text", text: formatError(res.error, res.status) }],
|
|
25
|
-
};
|
|
26
|
-
}
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a channel from a campaign_id.
|
|
11
|
+
* Calls GET /api/campaigns/{campaign_id} which returns { campaign, channels: [] }.
|
|
12
|
+
*/
|
|
13
|
+
async function resolveChannelFromCampaign(client, campaign_id, channel_type) {
|
|
14
|
+
const res = await client.get(`/api/campaigns/${campaign_id}`);
|
|
15
|
+
if (res.error) {
|
|
27
16
|
return {
|
|
28
|
-
|
|
17
|
+
error: formatError(res.error, res.status, "Use list_campaigns to find valid campaign IDs."),
|
|
29
18
|
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
inputSchema: {
|
|
36
|
-
agent_id: z.string().describe("The agent's UUID"),
|
|
37
|
-
channel_type: z
|
|
38
|
-
.enum(["widget", "api", "whatsapp"])
|
|
39
|
-
.describe('Channel type: "widget" for website chat, "api" for API access, "whatsapp" for WhatsApp Business'),
|
|
40
|
-
name: z.string().optional().describe("Channel display name"),
|
|
41
|
-
allowed_origins: z
|
|
42
|
-
.array(z.string())
|
|
43
|
-
.optional()
|
|
44
|
-
.describe('Allowed CORS origins for widget (e.g., ["https://example.com"])'),
|
|
45
|
-
rate_limit_rpm: z
|
|
46
|
-
.number()
|
|
47
|
-
.optional()
|
|
48
|
-
.describe("Rate limit in requests per minute"),
|
|
49
|
-
},
|
|
50
|
-
annotations: {
|
|
51
|
-
destructiveHint: false,
|
|
52
|
-
idempotentHint: false,
|
|
53
|
-
},
|
|
54
|
-
}, async ({ agent_id, channel_type, name, allowed_origins, rate_limit_rpm }) => {
|
|
55
|
-
const body = { channel_type };
|
|
56
|
-
if (name)
|
|
57
|
-
body.name = name;
|
|
58
|
-
if (allowed_origins)
|
|
59
|
-
body.allowed_origins = allowed_origins;
|
|
60
|
-
if (rate_limit_rpm)
|
|
61
|
-
body.rate_limit_rpm = rate_limit_rpm;
|
|
62
|
-
const res = await client.post(`/api/agents/${agent_id}/channels`, body);
|
|
63
|
-
if (res.error) {
|
|
64
|
-
return {
|
|
65
|
-
isError: true,
|
|
66
|
-
content: [{ type: "text", text: formatError(res.error, res.status) }],
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
let text = `Channel deployed successfully.\n\n${JSON.stringify(res.data, null, 2)}`;
|
|
70
|
-
if (channel_type === "widget") {
|
|
71
|
-
text += `\n\n## Next Steps for Widget`;
|
|
72
|
-
text += `\n1. Use get_embed_code to get the HTML snippet to paste on a website`;
|
|
73
|
-
text += `\n2. Use set_widget_appearance to customize colors, theme, and position`;
|
|
74
|
-
text += `\n3. Use set_widget_content to set the welcome message and conversation starters`;
|
|
75
|
-
text += `\n4. Use chat_with_agent to test the agent before going live`;
|
|
76
|
-
}
|
|
77
|
-
else if (channel_type === "whatsapp") {
|
|
78
|
-
text += `\n\n## Next Steps for WhatsApp`;
|
|
79
|
-
text += `\n1. Enable the WhatsApp toolset: enable_toolset("whatsapp")`;
|
|
80
|
-
text += `\n2. Create message templates with create_wa_template (Meta approval required)`;
|
|
81
|
-
text += `\n3. Import contacts with import_wa_contacts`;
|
|
82
|
-
text += `\n4. Send broadcasts with send_wa_broadcast`;
|
|
83
|
-
}
|
|
84
|
-
else if (channel_type === "api") {
|
|
85
|
-
text += `\n\n## API Channel Details`;
|
|
86
|
-
text += `\nPublic chat endpoint: POST ${client.dashboardUrl}/api/channels/${agent_id}/chat`;
|
|
87
|
-
text += `\nAuthorization: Bearer <token from response above>`;
|
|
88
|
-
text += `\nBody: { "message": "...", "session_id": "unique-user-id" }`;
|
|
89
|
-
text += `\n\nUse this endpoint to build custom chat UIs, integrate with other apps, or connect to any platform.`;
|
|
90
|
-
}
|
|
91
|
-
text += `\n\nManage this channel in the dashboard: ${client.dashboardUrl}/dashboard/agents/${agent_id}`;
|
|
19
|
+
}
|
|
20
|
+
const data = res.data;
|
|
21
|
+
const campaign = (data?.campaign ?? data);
|
|
22
|
+
const channels = (data?.channels ?? []);
|
|
23
|
+
if (channels.length === 0) {
|
|
92
24
|
return {
|
|
93
|
-
|
|
25
|
+
error: "No channels found for this campaign. The campaign may still be initializing.",
|
|
94
26
|
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
is_enabled: z.boolean().optional().describe("Enable or disable the channel"),
|
|
104
|
-
allowed_origins: z
|
|
105
|
-
.array(z.string())
|
|
106
|
-
.optional()
|
|
107
|
-
.describe("Updated allowed CORS origins"),
|
|
108
|
-
rate_limit_rpm: z
|
|
109
|
-
.number()
|
|
110
|
-
.optional()
|
|
111
|
-
.describe("Updated rate limit in requests per minute"),
|
|
112
|
-
},
|
|
113
|
-
annotations: {
|
|
114
|
-
destructiveHint: false,
|
|
115
|
-
idempotentHint: true,
|
|
116
|
-
},
|
|
117
|
-
}, async ({ agent_id, channel_id, is_enabled, allowed_origins, rate_limit_rpm }) => {
|
|
118
|
-
const body = {};
|
|
119
|
-
if (is_enabled !== undefined)
|
|
120
|
-
body.is_enabled = is_enabled;
|
|
121
|
-
if (allowed_origins)
|
|
122
|
-
body.allowed_origins = allowed_origins;
|
|
123
|
-
if (rate_limit_rpm !== undefined)
|
|
124
|
-
body.rate_limit_rpm = rate_limit_rpm;
|
|
125
|
-
const res = await client.patch(`/api/agents/${agent_id}/channels/${channel_id}`, body);
|
|
126
|
-
if (res.error) {
|
|
27
|
+
}
|
|
28
|
+
let channel;
|
|
29
|
+
if (channel_type) {
|
|
30
|
+
channel = channels.find((c) => c.channel_type === channel_type);
|
|
31
|
+
if (!channel) {
|
|
32
|
+
const available = channels
|
|
33
|
+
.map((c) => c.channel_type)
|
|
34
|
+
.join(", ");
|
|
127
35
|
return {
|
|
128
|
-
|
|
129
|
-
content: [{ type: "text", text: formatError(res.error, res.status) }],
|
|
36
|
+
error: `No ${channel_type} channel found for this campaign. Available types: ${available}`,
|
|
130
37
|
};
|
|
131
38
|
}
|
|
39
|
+
}
|
|
40
|
+
else if (channels.length === 1) {
|
|
41
|
+
channel = channels[0];
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const available = channels
|
|
45
|
+
.map((c) => c.channel_type)
|
|
46
|
+
.join(", ");
|
|
132
47
|
return {
|
|
133
|
-
|
|
134
|
-
{
|
|
135
|
-
type: "text",
|
|
136
|
-
text: `Channel updated successfully.\n\n${JSON.stringify(res.data, null, 2)}`,
|
|
137
|
-
},
|
|
138
|
-
],
|
|
48
|
+
error: `Multiple channels found (${available}). Please specify which type.`,
|
|
139
49
|
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
inputSchema: {
|
|
146
|
-
agent_id: z.string().describe("The agent's UUID"),
|
|
147
|
-
channel_id: z.string().describe("The channel's UUID"),
|
|
148
|
-
},
|
|
149
|
-
annotations: {
|
|
150
|
-
destructiveHint: true,
|
|
151
|
-
idempotentHint: true,
|
|
152
|
-
},
|
|
153
|
-
}, async ({ agent_id, channel_id }) => {
|
|
154
|
-
const res = await client.del(`/api/agents/${agent_id}/channels/${channel_id}`);
|
|
155
|
-
if (res.error) {
|
|
156
|
-
return {
|
|
157
|
-
isError: true,
|
|
158
|
-
content: [
|
|
159
|
-
{
|
|
160
|
-
type: "text",
|
|
161
|
-
text: formatError(res.error, res.status, "Use list_channels to verify the channel_id."),
|
|
162
|
-
},
|
|
163
|
-
],
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
return {
|
|
167
|
-
content: [
|
|
168
|
-
{ type: "text", text: `Channel ${channel_id} deleted successfully.` },
|
|
169
|
-
],
|
|
170
|
-
};
|
|
171
|
-
});
|
|
50
|
+
}
|
|
51
|
+
return { campaign, channel };
|
|
52
|
+
}
|
|
53
|
+
// ─── Tool registrations ─────────────────────────────────────────────────────
|
|
54
|
+
export function registerDeploymentTools(server, client) {
|
|
172
55
|
// --- configure_widget ---
|
|
173
56
|
server.registerTool("configure_widget", {
|
|
174
57
|
title: "Configure Widget",
|
|
175
|
-
description: "Configure a
|
|
58
|
+
description: "Configure a campaign's widget appearance and content: colors, theme, position, avatar, welcome message, conversation starters, pre-chat form, and file upload. All fields are optional — only set what you want to change.",
|
|
176
59
|
inputSchema: {
|
|
177
|
-
|
|
178
|
-
|
|
60
|
+
campaign_id: z
|
|
61
|
+
.string()
|
|
62
|
+
.describe("The campaign's UUID. Use list_campaigns to find it."),
|
|
179
63
|
// Appearance
|
|
180
|
-
primary_color: z
|
|
181
|
-
|
|
64
|
+
primary_color: z
|
|
65
|
+
.string()
|
|
66
|
+
.optional()
|
|
67
|
+
.describe("Hex color for the widget (e.g., '#FF8C00')"),
|
|
68
|
+
theme: z
|
|
69
|
+
.enum(["light", "dark"])
|
|
70
|
+
.optional()
|
|
71
|
+
.describe("Widget color theme"),
|
|
182
72
|
border_radius: z
|
|
183
73
|
.enum(["rounded", "square"])
|
|
184
74
|
.optional()
|
|
185
75
|
.describe("Widget corner style"),
|
|
186
|
-
show_branding: z
|
|
187
|
-
|
|
76
|
+
show_branding: z
|
|
77
|
+
.boolean()
|
|
78
|
+
.optional()
|
|
79
|
+
.describe("Show 'Powered by LaunchPath' badge"),
|
|
80
|
+
position: z
|
|
81
|
+
.enum(["right", "left"])
|
|
82
|
+
.optional()
|
|
83
|
+
.describe("Widget position on the page"),
|
|
188
84
|
widget_size: z
|
|
189
85
|
.enum(["default", "compact", "large"])
|
|
190
86
|
.optional()
|
|
@@ -192,23 +88,36 @@ export function registerDeploymentTools(server, client) {
|
|
|
192
88
|
agent_avatar: z
|
|
193
89
|
.string()
|
|
194
90
|
.optional()
|
|
195
|
-
.describe("Avatar emoji or image URL for the widget header (e.g., '
|
|
91
|
+
.describe("Avatar emoji or image URL for the widget header (e.g., '\uD83E\uDD16')"),
|
|
196
92
|
greeting_delay: z
|
|
197
93
|
.number()
|
|
198
94
|
.optional()
|
|
199
95
|
.describe("Seconds before the greeting bubble appears (default: 3)"),
|
|
200
96
|
// Content
|
|
201
|
-
agent_name: z
|
|
202
|
-
|
|
203
|
-
|
|
97
|
+
agent_name: z
|
|
98
|
+
.string()
|
|
99
|
+
.optional()
|
|
100
|
+
.describe("Display name shown in the widget header"),
|
|
101
|
+
welcome_message: z
|
|
102
|
+
.string()
|
|
103
|
+
.optional()
|
|
104
|
+
.describe("Welcome message shown when widget opens"),
|
|
105
|
+
greeting_message: z
|
|
106
|
+
.string()
|
|
107
|
+
.optional()
|
|
108
|
+
.describe("Greeting text in the chat bubble before opening"),
|
|
204
109
|
conversation_starters: z
|
|
205
110
|
.array(z.string())
|
|
206
111
|
.optional()
|
|
207
112
|
.describe("Up to 4 clickable starter messages (e.g., ['What services do you offer?', 'Book an appointment'])"),
|
|
208
113
|
pre_chat_form: z
|
|
209
114
|
.object({
|
|
210
|
-
enabled: z
|
|
211
|
-
|
|
115
|
+
enabled: z
|
|
116
|
+
.boolean()
|
|
117
|
+
.describe("Enable or disable the pre-chat form"),
|
|
118
|
+
fields: z
|
|
119
|
+
.array(z.enum(["name", "email"]))
|
|
120
|
+
.describe('Fields to collect (e.g., ["name", "email"])'),
|
|
212
121
|
})
|
|
213
122
|
.optional()
|
|
214
123
|
.describe("Collect user info (name, email) before chat starts"),
|
|
@@ -221,9 +130,21 @@ export function registerDeploymentTools(server, client) {
|
|
|
221
130
|
destructiveHint: false,
|
|
222
131
|
idempotentHint: true,
|
|
223
132
|
},
|
|
224
|
-
}, async ({
|
|
133
|
+
}, async ({ campaign_id, primary_color, theme, border_radius, show_branding, position, widget_size, agent_avatar, greeting_delay, agent_name, welcome_message, greeting_message, conversation_starters, pre_chat_form, file_upload, }) => {
|
|
134
|
+
// Resolve channel from campaign
|
|
135
|
+
const resolved = await resolveChannelFromCampaign(client, campaign_id, "widget");
|
|
136
|
+
if (resolved.error) {
|
|
137
|
+
return {
|
|
138
|
+
isError: true,
|
|
139
|
+
content: [{ type: "text", text: resolved.error }],
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
const campaign = resolved.campaign;
|
|
143
|
+
const channel = resolved.channel;
|
|
144
|
+
const agent_id = campaign.agent_id;
|
|
145
|
+
const channel_id = channel.id;
|
|
146
|
+
// Build widget config
|
|
225
147
|
const widget_config = {};
|
|
226
|
-
// Appearance
|
|
227
148
|
if (primary_color !== undefined)
|
|
228
149
|
widget_config.primaryColor = primary_color;
|
|
229
150
|
if (theme !== undefined)
|
|
@@ -240,7 +161,6 @@ export function registerDeploymentTools(server, client) {
|
|
|
240
161
|
widget_config.agentAvatar = agent_avatar;
|
|
241
162
|
if (greeting_delay !== undefined)
|
|
242
163
|
widget_config.greetingDelay = greeting_delay;
|
|
243
|
-
// Content
|
|
244
164
|
if (agent_name !== undefined)
|
|
245
165
|
widget_config.agentName = agent_name;
|
|
246
166
|
if (welcome_message !== undefined)
|
|
@@ -257,52 +177,48 @@ export function registerDeploymentTools(server, client) {
|
|
|
257
177
|
if (res.error) {
|
|
258
178
|
return {
|
|
259
179
|
isError: true,
|
|
260
|
-
content: [
|
|
180
|
+
content: [
|
|
181
|
+
{
|
|
182
|
+
type: "text",
|
|
183
|
+
text: formatError(res.error, res.status),
|
|
184
|
+
},
|
|
185
|
+
],
|
|
261
186
|
};
|
|
262
187
|
}
|
|
263
188
|
return {
|
|
264
189
|
content: [
|
|
265
|
-
{
|
|
190
|
+
{
|
|
191
|
+
type: "text",
|
|
192
|
+
text: `Widget configured successfully.\n\n${JSON.stringify(res.data, null, 2)}`,
|
|
193
|
+
},
|
|
266
194
|
],
|
|
267
195
|
};
|
|
268
196
|
});
|
|
269
197
|
// --- get_embed_code ---
|
|
270
198
|
server.registerTool("get_embed_code", {
|
|
271
199
|
title: "Get Embed Code",
|
|
272
|
-
description: "Get a ready-to-paste embed snippet for a widget
|
|
200
|
+
description: "Get a ready-to-paste embed snippet for a campaign's widget. Returns HTML script tag that can be added to any website.",
|
|
273
201
|
inputSchema: {
|
|
274
|
-
|
|
275
|
-
|
|
202
|
+
campaign_id: z
|
|
203
|
+
.string()
|
|
204
|
+
.describe("The campaign's UUID. Use list_campaigns to find it."),
|
|
276
205
|
},
|
|
277
206
|
annotations: {
|
|
278
207
|
readOnlyHint: true,
|
|
279
208
|
openWorldHint: false,
|
|
280
209
|
},
|
|
281
|
-
}, async ({
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
if (res.error) {
|
|
210
|
+
}, async ({ campaign_id }) => {
|
|
211
|
+
const resolved = await resolveChannelFromCampaign(client, campaign_id, "widget");
|
|
212
|
+
if (resolved.error) {
|
|
285
213
|
return {
|
|
286
214
|
isError: true,
|
|
287
|
-
content: [{ type: "text", text:
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
const channels = res.data?.channels ?? (Array.isArray(res.data) ? res.data : []);
|
|
291
|
-
const channel = channels.find((c) => c.id === channel_id);
|
|
292
|
-
if (!channel) {
|
|
293
|
-
return {
|
|
294
|
-
isError: true,
|
|
295
|
-
content: [
|
|
296
|
-
{
|
|
297
|
-
type: "text",
|
|
298
|
-
text: `Channel ${channel_id} not found. Use list_channels to see available channels for this agent.`,
|
|
299
|
-
},
|
|
300
|
-
],
|
|
215
|
+
content: [{ type: "text", text: resolved.error }],
|
|
301
216
|
};
|
|
302
217
|
}
|
|
218
|
+
const channel = resolved.channel;
|
|
303
219
|
const embedCode = `<script
|
|
304
|
-
src="
|
|
305
|
-
data-channel-id="${
|
|
220
|
+
src="${client.dashboardUrl}/widget.js"
|
|
221
|
+
data-channel-id="${channel.id}"
|
|
306
222
|
data-token="${channel.token}"
|
|
307
223
|
async
|
|
308
224
|
></script>`;
|
|
@@ -315,5 +231,58 @@ export function registerDeploymentTools(server, client) {
|
|
|
315
231
|
],
|
|
316
232
|
};
|
|
317
233
|
});
|
|
234
|
+
// --- create_api_channel ---
|
|
235
|
+
server.registerTool("create_api_channel", {
|
|
236
|
+
title: "Create API Channel",
|
|
237
|
+
description: "Create a standalone API channel for an agent. Returns an API endpoint URL and bearer token for custom integrations. For website widgets or WhatsApp, use create_campaign instead.",
|
|
238
|
+
inputSchema: {
|
|
239
|
+
agent_id: z.string().describe("The agent's UUID"),
|
|
240
|
+
name: z
|
|
241
|
+
.string()
|
|
242
|
+
.optional()
|
|
243
|
+
.describe("Channel display name"),
|
|
244
|
+
allowed_origins: z
|
|
245
|
+
.array(z.string())
|
|
246
|
+
.optional()
|
|
247
|
+
.describe('Allowed CORS origins (e.g., ["https://example.com"])'),
|
|
248
|
+
rate_limit_rpm: z
|
|
249
|
+
.number()
|
|
250
|
+
.optional()
|
|
251
|
+
.describe("Rate limit in requests per minute"),
|
|
252
|
+
},
|
|
253
|
+
annotations: {
|
|
254
|
+
destructiveHint: false,
|
|
255
|
+
idempotentHint: false,
|
|
256
|
+
},
|
|
257
|
+
}, async ({ agent_id, name, allowed_origins, rate_limit_rpm }) => {
|
|
258
|
+
const body = { channel_type: "api" };
|
|
259
|
+
if (name)
|
|
260
|
+
body.name = name;
|
|
261
|
+
if (allowed_origins)
|
|
262
|
+
body.allowed_origins = allowed_origins;
|
|
263
|
+
if (rate_limit_rpm)
|
|
264
|
+
body.rate_limit_rpm = rate_limit_rpm;
|
|
265
|
+
const res = await client.post(`/api/agents/${agent_id}/channels`, body);
|
|
266
|
+
if (res.error) {
|
|
267
|
+
return {
|
|
268
|
+
isError: true,
|
|
269
|
+
content: [
|
|
270
|
+
{
|
|
271
|
+
type: "text",
|
|
272
|
+
text: formatError(res.error, res.status),
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
let text = `API channel created successfully.\n\n${JSON.stringify(res.data, null, 2)}`;
|
|
278
|
+
text += `\n\n## API Channel Details`;
|
|
279
|
+
text += `\nPublic chat endpoint: POST ${client.dashboardUrl}/api/channels/${agent_id}/chat`;
|
|
280
|
+
text += `\nAuthorization: Bearer <token from response above>`;
|
|
281
|
+
text += `\nBody: { "message": "...", "session_id": "unique-user-id" }`;
|
|
282
|
+
text += `\n\nUse this endpoint to build custom chat UIs, integrate with other apps, or connect to any platform.`;
|
|
283
|
+
return {
|
|
284
|
+
content: [{ type: "text", text }],
|
|
285
|
+
};
|
|
286
|
+
});
|
|
318
287
|
}
|
|
319
288
|
//# sourceMappingURL=channels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/tools/channels.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/tools/channels.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAmB3C;;;GAGG;AACH,KAAK,UAAU,0BAA0B,CACvC,MAAwB,EACxB,WAAmB,EACnB,YAA4C;IAK5C,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,GAAG,CAGzB,kBAAkB,WAAW,EAAE,CAAC,CAAC;IAEpC,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;QACd,OAAO;YACL,KAAK,EAAE,WAAW,CAChB,GAAG,CAAC,KAAK,EACT,GAAG,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