@anychat-ai/mcp 0.60.1 → 0.62.0
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/README.md +5 -12
- package/dist/tools/campaigns.d.ts +4 -2
- package/dist/tools/campaigns.js +10 -28
- package/dist/tools/campaigns.js.map +1 -1
- package/dist/tools/capabilities.js +77 -135
- package/dist/tools/capabilities.js.map +1 -1
- package/dist/tools/definition.js +7 -33
- package/dist/tools/definition.js.map +1 -1
- package/dist/tools/outreach.js +9 -9
- package/dist/tools/outreach.js.map +1 -1
- package/dist/tools/people.js +4 -78
- package/dist/tools/people.js.map +1 -1
- package/dist/tools/personas.js +1 -1
- package/dist/tools/personas.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ Flags: `--profile core|full` picks the tool set (default `full`, see [Profiles](
|
|
|
49
49
|
|
|
50
50
|
## Tools
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
205 tools, a 1:1 projection of the [Agent API](https://docs.anychat.ai/reference/agent-api/) grouped as the reference is (orient → Definition → Capabilities → Channels → People → Outreach → Campaigns → Tests → Personas → Emulator → Activity → Org → Docs). `npx -y @anychat-ai/mcp tools` prints the live table.
|
|
53
53
|
|
|
54
54
|
Every tool carries MCP annotations: `read` tools are `readOnlyHint`; `write` tools change configuration; `destructive` tools (deletes, outreach sends to real people, provisioning requests, imports over an existing agent, secret rotation) are `destructiveHint` so your host asks before running them.
|
|
55
55
|
|
|
@@ -57,8 +57,8 @@ Every tool carries MCP annotations: `read` tools are `readOnlyHint`; `write` too
|
|
|
57
57
|
|
|
58
58
|
Every tool definition (name, description, input schema) is sent to the model on every call, so a big table has a real per-turn cost. Two profiles trade breadth for weight:
|
|
59
59
|
|
|
60
|
-
- **`full`** (default) — all
|
|
61
|
-
- **`core`** —
|
|
60
|
+
- **`full`** (default) — all 205 tools.
|
|
61
|
+
- **`core`** — 83 tools, the everyday set: `whoami`; agents (list / get / create / update / export / import, apply template, catalogs); the whole Definition (identity, personality, standing instructions, guardrails, rules, goals, playbooks, message templates, `lint_agent`); the media library (list / add / update / delete); tool bindings (list / upsert); scheduling config; People field definitions; Things (read); Facts (read / replace); business info (read / replace); channels (list / get / request / bind, early access, launch); people (list / get / update, list segments); Outreach (list / get / create / update, preview an opener, send it to one person) and sending settings; personas (list / create / reset, send a sandbox turn); emulator links (list / create); conversations / messages / logs / activity; org; docs. About half the tokens of `full`.
|
|
62
62
|
|
|
63
63
|
Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })` in code; the `Profile` column below shows which set each tool belongs to, and `npx -y @anychat-ai/mcp tools --profile core` lists just that set. Nothing else changes: `full` stays the default, and the `core` set only ever grows — a tool leaves it only when the route behind it is retired.
|
|
64
64
|
|
|
@@ -136,11 +136,6 @@ Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })`
|
|
|
136
136
|
| `replace_notifications_config` | write | `agents:write` | core | Replace notifications config |
|
|
137
137
|
| `get_people_fields` | read | `agents:read` | core | Get people field definitions |
|
|
138
138
|
| `replace_people_fields` | write | `agents:write` | core | Replace people field definitions |
|
|
139
|
-
| `get_outreach_config` | read | `agents:read` | core | Get outreach config |
|
|
140
|
-
| `replace_outreach_config` | write | `agents:write` | core | Replace outreach config |
|
|
141
|
-
| `get_outreach_programs` | read | `agents:read` | full | Get outreach programs |
|
|
142
|
-
| `replace_outreach_programs` | write | `agents:write` | full | Replace outreach programs |
|
|
143
|
-
| `preview_outreach` | read | `agents:read` | full | Preview outreach greeting |
|
|
144
139
|
| `list_outreach_links` | read | `agents:read` | full | List test links |
|
|
145
140
|
| `create_outreach_link` | write | `agents:write` | full | Create a test link |
|
|
146
141
|
| `update_outreach_link` | write | `agents:write` | full | Pause or resume a test link |
|
|
@@ -187,11 +182,9 @@ Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })`
|
|
|
187
182
|
| `merge_people` | write | `people:write` | full | Merge two people |
|
|
188
183
|
| `export_people` | read | `people:export` | full | Export people (bulk) |
|
|
189
184
|
| `import_people` | write | `people:write` | full | Import people |
|
|
190
|
-
| `send_outreach` | destructive | `people:write` | core | Send outreach to a person |
|
|
191
185
|
| `send_outreach_follow_up` | destructive | `people:write` | full | Send an outreach follow-up to a person |
|
|
192
186
|
| `list_outreach_sends` | read | `people:read` | full | List outreach sends |
|
|
193
187
|
| `get_outreach_send` | read | `people:read` | full | Get one outreach send |
|
|
194
|
-
| `trigger_outreach` | destructive | `people:write` | full | Trigger an outreach program |
|
|
195
188
|
| `list_person_appointments` | read | `people:read` | full | List a person's appointments |
|
|
196
189
|
| `list_appointments` | read | `people:read` | full | List appointments (all people) |
|
|
197
190
|
| `list_segments` | read | `people:read` | core | List people segments |
|
|
@@ -204,8 +197,8 @@ Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })`
|
|
|
204
197
|
| `get_outreach` | read | `agents:read` | core | Get an Outreach |
|
|
205
198
|
| `update_outreach` | write | `agents:write` | core | Update an Outreach |
|
|
206
199
|
| `delete_outreach` | destructive | `agents:write` | full | Delete an Outreach |
|
|
207
|
-
| `
|
|
208
|
-
| `
|
|
200
|
+
| `preview_outreach` | read | `agents:read` | core | Preview an Outreach's opener |
|
|
201
|
+
| `send_outreach` | destructive | `people:write` | core | Send an Outreach to one person |
|
|
209
202
|
| `cancel_outreach_send` | write | `people:write` | full | Cancel a queued outreach send |
|
|
210
203
|
| `get_sending_settings` | read | `agents:read` | core | Get sending settings |
|
|
211
204
|
| `update_sending_settings` | write | `agents:write` | core | Update sending settings |
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Outreach Campaigns
|
|
3
|
-
*
|
|
2
|
+
* Outreach Campaigns — one Outreach × a snapshotted slice of People. The
|
|
3
|
+
* Campaign carries nothing authored: the opener, Playbook, Goal, class and
|
|
4
|
+
* follow-up all come from the Outreach it names, and each recipient is an
|
|
5
|
+
* ordinary send (`origin: campaign`) listed by `list_outreach_sends`.
|
|
4
6
|
*/
|
|
5
7
|
export declare const campaignTools: import("../tool").AnyTool[];
|
package/dist/tools/campaigns.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.campaignTools = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const tool_1 = require("../tool");
|
|
6
|
-
const goals_1 = require("./goals");
|
|
7
6
|
const campaignPath = (agentId, sub = '') => `/agents/${encodeURIComponent(agentId)}/campaigns${sub}`;
|
|
8
7
|
const audienceSchema = zod_1.z
|
|
9
8
|
.object({
|
|
@@ -18,14 +17,16 @@ const audienceSchema = zod_1.z
|
|
|
18
17
|
})
|
|
19
18
|
.describe('Exactly ONE of segmentId | filter | importBatchId | personIds | personaIds. Snapshotted at stage time — a campaign never sends against a live query.');
|
|
20
19
|
/**
|
|
21
|
-
* Outreach Campaigns
|
|
22
|
-
*
|
|
20
|
+
* Outreach Campaigns — one Outreach × a snapshotted slice of People. The
|
|
21
|
+
* Campaign carries nothing authored: the opener, Playbook, Goal, class and
|
|
22
|
+
* follow-up all come from the Outreach it names, and each recipient is an
|
|
23
|
+
* ordinary send (`origin: campaign`) listed by `list_outreach_sends`.
|
|
23
24
|
*/
|
|
24
25
|
exports.campaignTools = [
|
|
25
26
|
(0, tool_1.defineTool)({
|
|
26
27
|
name: 'create_campaign',
|
|
27
28
|
title: 'Create campaign',
|
|
28
|
-
description:
|
|
29
|
+
description: "Create a DRAFT outreach campaign: a staged bulk send of ONE Outreach to a slice of People. outreachId is required — the opener, Playbook, Goal, class and follow-up all come from that Outreach (see list_outreach), and the campaign authors none of them. The opening is the Outreach's opener Message Template rendered per recipient; the agent never composes a campaign opening freehand. Staging (stage_campaign) validates everything and sends nothing. Maps to POST /v1/orgs/{org}/agents/{agent}/campaigns.",
|
|
29
30
|
kind: 'write',
|
|
30
31
|
scope: 'agents:write',
|
|
31
32
|
roleFloor: 'editor',
|
|
@@ -34,17 +35,9 @@ exports.campaignTools = [
|
|
|
34
35
|
name: zod_1.z.string().min(1).max(120),
|
|
35
36
|
outreachId: zod_1.z
|
|
36
37
|
.string()
|
|
37
|
-
.
|
|
38
|
-
.describe('The Outreach this campaign sends
|
|
39
|
-
playbookId: zod_1.z
|
|
40
|
-
.string()
|
|
41
|
-
.optional()
|
|
42
|
-
.describe('Legacy: Playbook for resulting conversations (outreach-eligible). Superseded by outreachId; retiring in 0.61.'),
|
|
38
|
+
.min(1)
|
|
39
|
+
.describe('The Outreach this campaign sends; must be enabled (422 agent.outreach.not_found). Required.'),
|
|
43
40
|
audience: audienceSchema,
|
|
44
|
-
openingTemplateId: zod_1.z
|
|
45
|
-
.string()
|
|
46
|
-
.optional()
|
|
47
|
-
.describe('Per-campaign opening override (else playbook opening)'),
|
|
48
41
|
includePreviouslyContacted: zod_1.z
|
|
49
42
|
.boolean()
|
|
50
43
|
.optional()
|
|
@@ -56,9 +49,6 @@ exports.campaignTools = [
|
|
|
56
49
|
timeZone: zod_1.z.string(),
|
|
57
50
|
})
|
|
58
51
|
.optional(),
|
|
59
|
-
goal: goals_1.goalAssignment
|
|
60
|
-
.optional()
|
|
61
|
-
.describe("This Campaign's Goal assignment — beats the agent default, loses to the Playbook's own goal, for conversations this Campaign opens."),
|
|
62
52
|
},
|
|
63
53
|
run: async ({ client }, { agentId, ...body }) => client.post(await client.orgPath(campaignPath(agentId)), body),
|
|
64
54
|
}),
|
|
@@ -85,7 +75,7 @@ exports.campaignTools = [
|
|
|
85
75
|
(0, tool_1.defineTool)({
|
|
86
76
|
name: 'update_campaign',
|
|
87
77
|
title: 'Update campaign',
|
|
88
|
-
description: 'Edit a draft or staged campaign (same fields as create_campaign
|
|
78
|
+
description: 'Edit a draft or staged campaign (same fields as create_campaign; any edit returns it to draft and drops the snapshot — re-stage after). Maps to PATCH /v1/orgs/{org}/agents/{agent}/campaigns/{id}.',
|
|
89
79
|
kind: 'write',
|
|
90
80
|
scope: 'agents:write',
|
|
91
81
|
roleFloor: 'editor',
|
|
@@ -95,14 +85,10 @@ exports.campaignTools = [
|
|
|
95
85
|
name: zod_1.z.string().min(1).max(120).optional(),
|
|
96
86
|
outreachId: zod_1.z
|
|
97
87
|
.string()
|
|
88
|
+
.min(1)
|
|
98
89
|
.optional()
|
|
99
|
-
.describe('
|
|
100
|
-
playbookId: zod_1.z
|
|
101
|
-
.string()
|
|
102
|
-
.optional()
|
|
103
|
-
.describe('Legacy; superseded by outreachId, retiring in 0.61.'),
|
|
90
|
+
.describe('Re-point the campaign at another enabled Outreach.'),
|
|
104
91
|
audience: audienceSchema.optional(),
|
|
105
|
-
openingTemplateId: zod_1.z.string().nullable().optional(),
|
|
106
92
|
includePreviouslyContacted: zod_1.z.boolean().nullable().optional(),
|
|
107
93
|
sendWindow: zod_1.z
|
|
108
94
|
.object({
|
|
@@ -112,10 +98,6 @@ exports.campaignTools = [
|
|
|
112
98
|
})
|
|
113
99
|
.nullable()
|
|
114
100
|
.optional(),
|
|
115
|
-
goal: goals_1.goalAssignment
|
|
116
|
-
.nullable()
|
|
117
|
-
.optional()
|
|
118
|
-
.describe("This Campaign's Goal assignment — beats the agent default, loses to the Playbook's own goal, for conversations this Campaign opens. null clears it."),
|
|
119
101
|
},
|
|
120
102
|
run: async ({ client }, { agentId, campaignId, ...body }) => client.patch(await client.orgPath(campaignPath(agentId, `/${encodeURIComponent(campaignId)}`)), body),
|
|
121
103
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"campaigns.js","sourceRoot":"","sources":["../../src/tools/campaigns.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAAqC;
|
|
1
|
+
{"version":3,"file":"campaigns.js","sourceRoot":"","sources":["../../src/tools/campaigns.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAAqC;AAErC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,GAAG,GAAG,EAAE,EAAU,EAAE,CACzD,WAAW,kBAAkB,CAAC,OAAO,CAAC,aAAa,GAAG,EAAE,CA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,SAAS,CAAC,CACnE,CACF;KACJ,CAAC;IAEF,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,0BAA0B;QAChC,KAAK,EAAE,0BAA0B;QACjC,WAAW,EACT,6JAA6J;QAC/J,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE;YACL,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;YACnB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;YACtB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;SACrB;QACD,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,CAC3D,MAAM,CAAC,GAAG,CACR,MAAM,MAAM,CAAC,OAAO,CAClB,YAAY,CAAC,OAAO,EAAE,IAAI,kBAAkB,CAAC,UAAU,CAAC,UAAU,CAAC,CACpE,EACD,EAAE,QAAQ,EAAE,CACb;KACJ,CAAC;CACH,CAAC"}
|
|
@@ -34,15 +34,15 @@ const tool_1 = require("../tool");
|
|
|
34
34
|
* Deliberately NOT here:
|
|
35
35
|
* - `POST …/connections/{provider}/_start` — the grant completes in the
|
|
36
36
|
* operator's browser; hosts can't drive that flow from a tool.
|
|
37
|
-
* -
|
|
38
|
-
* (`
|
|
37
|
+
* - Outreach itself (Outreaches, their sends and Settings → Sending) —
|
|
38
|
+
* its own group (`list_outreach` … `send_outreach`); the manual nudge
|
|
39
|
+
* stays in People (`send_outreach_follow_up`).
|
|
39
40
|
* - Human escalation — no dedicated route; it's the identity contact
|
|
40
41
|
* fields (`contactEmail`, `contactPhone`, `websiteUrl`,
|
|
41
42
|
* `contactAvailability`), edited via the identity tools.
|
|
42
43
|
*/
|
|
43
44
|
const agentId = zod_1.z.string();
|
|
44
45
|
const connectionId = zod_1.z.string().describe('Connection id from list_connections');
|
|
45
|
-
const outreachPath = (agent) => `/agents/${encodeURIComponent(agent)}/outreach`;
|
|
46
46
|
const outreachLinksPath = (agent) => `/agents/${encodeURIComponent(agent)}/outreach-links`;
|
|
47
47
|
const knowledgeSourcesPath = (agent) => `/agents/${encodeURIComponent(agent)}/knowledge/sources`;
|
|
48
48
|
const schedulingPath = (agent) => `/agents/${encodeURIComponent(agent)}/scheduling`;
|
|
@@ -53,20 +53,14 @@ const factsPath = (agent) => `/agents/${encodeURIComponent(agent)}/knowledge/fac
|
|
|
53
53
|
const businessInfoPath = (agent) => `/agents/${encodeURIComponent(agent)}/business-info`;
|
|
54
54
|
const notificationsPath = (agent) => `/agents/${encodeURIComponent(agent)}/notifications`;
|
|
55
55
|
const integrationsPath = (agent, id) => `/agents/${encodeURIComponent(agent)}/integrations${id === undefined ? '' : `/${encodeURIComponent(id)}`}`;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
unit: zod_1.z.enum(['hours', 'days']),
|
|
65
|
-
})
|
|
66
|
-
.describe('Wait after the initial outreach'),
|
|
67
|
-
messageTemplateId: zod_1.z.string().min(1).describe('Existing message template id'),
|
|
68
|
-
})
|
|
69
|
-
.describe('The single automatic follow-up step');
|
|
56
|
+
// Automated Outreach is a named collection: one rule per sheet tab the
|
|
57
|
+
// agent watches (agent-api 24.1.0).
|
|
58
|
+
const automatedOutreachPath = (agent, id) => `/agents/${encodeURIComponent(agent)}/automated-outreaches${id === undefined ? '' : `/${encodeURIComponent(id)}`}`;
|
|
59
|
+
const automatedOutreachRunsPath = (agent, id) => `${automatedOutreachPath(agent, id)}/runs`;
|
|
60
|
+
/** Addresses one Automated Outreach rule within the agent. */
|
|
61
|
+
const automatedOutreachId = zod_1.z
|
|
62
|
+
.string()
|
|
63
|
+
.describe('Automated Outreach rule id, from list_automated_outreaches');
|
|
70
64
|
// ── Capability-config shapes (mirror the API's sanitizers) ─────────────
|
|
71
65
|
const timeHHMM = zod_1.z.string().describe('"HH:MM" 24h');
|
|
72
66
|
const schedulingWindow = zod_1.z.object({
|
|
@@ -501,108 +495,6 @@ exports.capabilityTools = [
|
|
|
501
495
|
input: { agentId, fields: zod_1.z.array(personFieldDef) },
|
|
502
496
|
run: async ({ client }, { agentId, fields }) => client.put(await client.orgPath(peopleFieldsPath(agentId)), { fields }),
|
|
503
497
|
}),
|
|
504
|
-
// ── Outreach config ──────────────────────────────────────────────────
|
|
505
|
-
(0, tool_1.defineTool)({
|
|
506
|
-
name: 'get_outreach_config',
|
|
507
|
-
title: 'Get outreach config',
|
|
508
|
-
description: 'Read the agent\'s outreach config: greetingTemplateId (first message when the agent initiates), followUps (single automatic nudge for non-responders: enabled, steps[1], quietHours; every sent nudge is recorded in the conversation history) and minTouchIntervalHours (marketing frequency cap — minimum hours between two marketing messages to the same person; unset = platform default 48, 0 = off; playbooks with outreach.kind "service" are never capped). {} when unset (LLM-composed opener). Superseded by `get_sending_settings`; retiring in 0.61 — the frequency cap and quiet hours now live in Settings → Sending, and GET .../outreach is now the Outreach list (list_outreach). Maps to GET /v1/orgs/{org}/agents/{agent}/outreach.',
|
|
509
|
-
kind: 'read',
|
|
510
|
-
scope: 'agents:read',
|
|
511
|
-
roleFloor: 'viewer',
|
|
512
|
-
profile: 'core',
|
|
513
|
-
input: { agentId },
|
|
514
|
-
run: async ({ client }, { agentId }) => client.get(await client.orgPath(outreachPath(agentId))),
|
|
515
|
-
}),
|
|
516
|
-
(0, tool_1.defineTool)({
|
|
517
|
-
name: 'replace_outreach_config',
|
|
518
|
-
title: 'Replace outreach config',
|
|
519
|
-
description: 'Replace the whole outreach config (omitted fields are cleared — read first with get_outreach_config). greetingTemplateId must exist (404); followUps.steps holds exactly one step (422); minTouchIntervalHours must be a number >= 0 (422) and omitting it resets the marketing frequency cap to the 48h platform default; {} clears everything. Enabling follow-ups only enrolls people contacted afterwards. Superseded by `update_sending_settings` (the cap and quiet hours) and `create_outreach` (the opener and follow-up); retiring in 0.61. Maps to PUT /v1/orgs/{org}/agents/{agent}/outreach.',
|
|
520
|
-
kind: 'write',
|
|
521
|
-
scope: 'agents:write',
|
|
522
|
-
roleFloor: 'editor',
|
|
523
|
-
profile: 'core',
|
|
524
|
-
input: {
|
|
525
|
-
agentId,
|
|
526
|
-
greetingTemplateId: zod_1.z
|
|
527
|
-
.string()
|
|
528
|
-
.optional()
|
|
529
|
-
.describe('Message template id for the greeting; omit for an LLM-composed opener'),
|
|
530
|
-
followUps: zod_1.z
|
|
531
|
-
.object({
|
|
532
|
-
enabled: zod_1.z.boolean(),
|
|
533
|
-
steps: zod_1.z.array(followUpStep).max(1),
|
|
534
|
-
quietHours: zod_1.z
|
|
535
|
-
.object({
|
|
536
|
-
startHour: zod_1.z.number().int().min(0).max(23),
|
|
537
|
-
endHour: zod_1.z
|
|
538
|
-
.number()
|
|
539
|
-
.int()
|
|
540
|
-
.min(0)
|
|
541
|
-
.max(23)
|
|
542
|
-
.describe('Exclusive; may wrap midnight'),
|
|
543
|
-
timezone: zod_1.z.string().min(1).describe('IANA zone'),
|
|
544
|
-
})
|
|
545
|
-
.optional()
|
|
546
|
-
.describe('Suppress sends during these local hours'),
|
|
547
|
-
})
|
|
548
|
-
.optional()
|
|
549
|
-
.describe('Automatic follow-up config; omit to clear'),
|
|
550
|
-
minTouchIntervalHours: zod_1.z
|
|
551
|
-
.number()
|
|
552
|
-
.min(0)
|
|
553
|
-
.optional()
|
|
554
|
-
.describe('Marketing frequency cap: minimum hours between two marketing messages to the same person across manual sends, Automated Outreach and campaigns. Omit = platform default 48; 0 = off. Follow-ups are exempt but count as a message; playbooks with outreach.kind "service" are never capped.'),
|
|
555
|
-
},
|
|
556
|
-
run: async ({ client }, { agentId, greetingTemplateId, followUps, minTouchIntervalHours }) => client.put(await client.orgPath(outreachPath(agentId)), {
|
|
557
|
-
...(greetingTemplateId !== undefined ? { greetingTemplateId } : {}),
|
|
558
|
-
...(followUps !== undefined ? { followUps } : {}),
|
|
559
|
-
...(minTouchIntervalHours !== undefined ? { minTouchIntervalHours } : {}),
|
|
560
|
-
}),
|
|
561
|
-
}),
|
|
562
|
-
(0, tool_1.defineTool)({
|
|
563
|
-
name: 'get_outreach_programs',
|
|
564
|
-
title: 'Get outreach programs',
|
|
565
|
-
description: "The agent's triggered-outreach programs: the named, allowlisted openings an external system may fire, each resolving to a playbook + opening template. A program is what trigger_outreach names; an external system can reach nothing else. Returns { data: [{ key, name, playbookId, openingTemplateId?, kind?, requiredFields?, enabled? }] }. Superseded by `list_outreach`; retiring in 0.61. Maps to GET /v1/orgs/{org}/agents/{agent}/outreach/programs.",
|
|
566
|
-
kind: 'read',
|
|
567
|
-
scope: 'agents:read',
|
|
568
|
-
roleFloor: 'viewer',
|
|
569
|
-
input: { agentId },
|
|
570
|
-
run: async ({ client }, { agentId }) => client.get(await client.orgPath(`${outreachPath(agentId)}/programs`)),
|
|
571
|
-
}),
|
|
572
|
-
(0, tool_1.defineTool)({
|
|
573
|
-
name: 'replace_outreach_programs',
|
|
574
|
-
title: 'Replace outreach programs',
|
|
575
|
-
description: "Replace the whole programs list (send the full set; omitted programs are removed). Each needs key (lower-case slug, unique) + name + playbookId (must exist on the agent); optional openingTemplateId (must be one of the agent's message templates; falls back to the playbook's), kind (marketing | service; falls back to the playbook's), requiredFields (custom People field keys a send needs before it is attempted), enabled (false parks a program without deleting it). 422 request.invalid names the offending programs[i].field. Superseded by `create_outreach` / `update_outreach`; retiring in 0.61. Maps to PUT /v1/orgs/{org}/agents/{agent}/outreach/programs.",
|
|
576
|
-
kind: 'write',
|
|
577
|
-
scope: 'agents:write',
|
|
578
|
-
roleFloor: 'editor',
|
|
579
|
-
input: {
|
|
580
|
-
agentId,
|
|
581
|
-
programs: zod_1.z.array(zod_1.z.object({
|
|
582
|
-
key: zod_1.z.string().min(1).max(40),
|
|
583
|
-
name: zod_1.z.string().min(1),
|
|
584
|
-
playbookId: zod_1.z.string().min(1),
|
|
585
|
-
openingTemplateId: zod_1.z.string().min(1).optional(),
|
|
586
|
-
kind: zod_1.z.enum(['marketing', 'service']).optional(),
|
|
587
|
-
requiredFields: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
588
|
-
enabled: zod_1.z.boolean().optional(),
|
|
589
|
-
})),
|
|
590
|
-
},
|
|
591
|
-
run: async ({ client }, { agentId, programs }) => client.put(await client.orgPath(`${outreachPath(agentId)}/programs`), { programs }),
|
|
592
|
-
}),
|
|
593
|
-
(0, tool_1.defineTool)({
|
|
594
|
-
name: 'preview_outreach',
|
|
595
|
-
title: 'Preview outreach greeting',
|
|
596
|
-
description: 'Render the configured outreach greeting for a person: { greeting: { renderedText, missingSlots[], blocked } }. Sends nothing; 404 when no greeting template is configured. Superseded by `preview_outreach_opener`, which renders the opener of one Outreach with the inputs a send would carry; retiring in 0.61. Maps to GET /v1/orgs/{org}/agents/{agent}/outreach/preview?personId=….',
|
|
597
|
-
kind: 'read',
|
|
598
|
-
scope: 'agents:read',
|
|
599
|
-
roleFloor: 'viewer',
|
|
600
|
-
input: {
|
|
601
|
-
agentId,
|
|
602
|
-
personId: zod_1.z.string(),
|
|
603
|
-
},
|
|
604
|
-
run: async ({ client }, { agentId, personId }) => client.get(await client.orgPath(`${outreachPath(agentId)}/preview`), { personId }),
|
|
605
|
-
}),
|
|
606
498
|
// ── Test links ───────────────────────────────────────────────────
|
|
607
499
|
(0, tool_1.defineTool)({
|
|
608
500
|
name: 'list_outreach_links',
|
|
@@ -913,9 +805,9 @@ exports.capabilityTools = [
|
|
|
913
805
|
}),
|
|
914
806
|
// ── Automated Outreach (Google Sheets lead intake) ──────────────────
|
|
915
807
|
(0, tool_1.defineTool)({
|
|
916
|
-
name: '
|
|
917
|
-
title: '
|
|
918
|
-
description: "
|
|
808
|
+
name: 'list_automated_outreaches',
|
|
809
|
+
title: 'List Automated Outreach rules',
|
|
810
|
+
description: "The agent's Automated Outreach rules, one per Google Sheet tab it watches: id, name, which tab, column mapping, qualified-row filter, consent bucketing, required fields, the Outreach every send delivers (`outreachId`), an in-service `shadowOutreachId` cut-over run if set, send window, and sheet write-back. An agent keeps one rule per lead source, each with its own filter, consent column and Outreach. Returns { automatedOutreaches: [...] }. Maps to GET /v1/orgs/{org}/agents/{agent}/automated-outreaches.",
|
|
919
811
|
kind: 'read',
|
|
920
812
|
scope: 'agents:read',
|
|
921
813
|
roleFloor: 'viewer',
|
|
@@ -923,14 +815,29 @@ exports.capabilityTools = [
|
|
|
923
815
|
run: async ({ client }, { agentId }) => client.get(await client.orgPath(automatedOutreachPath(agentId))),
|
|
924
816
|
}),
|
|
925
817
|
(0, tool_1.defineTool)({
|
|
926
|
-
name: '
|
|
927
|
-
title: '
|
|
928
|
-
description: '
|
|
818
|
+
name: 'get_automated_outreach',
|
|
819
|
+
title: 'Get one Automated Outreach rule',
|
|
820
|
+
description: 'One Automated Outreach rule by id, in the same shape list_automated_outreaches returns. 404 when the agent does not have it. Maps to GET /v1/orgs/{org}/agents/{agent}/automated-outreaches/{id}.',
|
|
821
|
+
kind: 'read',
|
|
822
|
+
scope: 'agents:read',
|
|
823
|
+
roleFloor: 'viewer',
|
|
824
|
+
input: { agentId, automatedOutreachId },
|
|
825
|
+
run: async ({ client }, { agentId, automatedOutreachId }) => client.get(await client.orgPath(automatedOutreachPath(agentId, automatedOutreachId))),
|
|
826
|
+
}),
|
|
827
|
+
(0, tool_1.defineTool)({
|
|
828
|
+
name: 'update_automated_outreach',
|
|
829
|
+
title: 'Update an Automated Outreach rule',
|
|
830
|
+
description: 'Change one Automated Outreach rule. A PATCH: keys the body omits are left as they are. The spreadsheet must be shared with the platform sheets service account (Viewer; Editor when writeBack is on). Rows whose consent cell is blank or unrecognized are flagged, never auto-sent. `outreachId` must name an enabled Outreach on the agent (422 agent.outreach.not_found when it does not). `shadowOutreachId` runs an in-service shadow: while set (and `outreachId` unset) the sweep keeps sending the old way but also decides each row under that Outreach, reporting agreement on each run — nothing extra is sent. Maps to PATCH /v1/orgs/{org}/agents/{agent}/automated-outreaches/{id}.',
|
|
929
831
|
kind: 'write',
|
|
930
832
|
scope: 'agents:write',
|
|
931
833
|
roleFloor: 'editor',
|
|
932
834
|
input: {
|
|
933
835
|
agentId,
|
|
836
|
+
automatedOutreachId,
|
|
837
|
+
name: zod_1.z
|
|
838
|
+
.string()
|
|
839
|
+
.optional()
|
|
840
|
+
.describe('What this lead source is called, e.g. "Paid social leads"'),
|
|
934
841
|
enabled: zod_1.z
|
|
935
842
|
.boolean()
|
|
936
843
|
.optional()
|
|
@@ -979,14 +886,10 @@ exports.capabilityTools = [
|
|
|
979
886
|
.array(zod_1.z.string())
|
|
980
887
|
.optional()
|
|
981
888
|
.describe('Person fields that must be non-empty before auto-send'),
|
|
982
|
-
playbookId: zod_1.z
|
|
983
|
-
.string()
|
|
984
|
-
.optional()
|
|
985
|
-
.describe('Deprecated — use outreachId. Outreach-eligible playbook every automated send uses when outreachId is unset'),
|
|
986
889
|
outreachId: zod_1.z
|
|
987
890
|
.string()
|
|
988
891
|
.optional()
|
|
989
|
-
.describe('The Outreach every qualifying row is sent; must name an enabled Outreach on the agent
|
|
892
|
+
.describe('The Outreach every qualifying row is sent; must name an enabled Outreach on the agent'),
|
|
990
893
|
shadowOutreachId: zod_1.z
|
|
991
894
|
.string()
|
|
992
895
|
.optional()
|
|
@@ -1018,36 +921,75 @@ exports.capabilityTools = [
|
|
|
1018
921
|
.optional()
|
|
1019
922
|
.describe('Write per-row results back to the sheet (empty cells only)'),
|
|
1020
923
|
},
|
|
1021
|
-
run: async ({ client }, { agentId, ...config }) => client.
|
|
924
|
+
run: async ({ client }, { agentId, automatedOutreachId, ...config }) => client.patch(await client.orgPath(automatedOutreachPath(agentId, automatedOutreachId)), stripUndefined(config)),
|
|
925
|
+
}),
|
|
926
|
+
(0, tool_1.defineTool)({
|
|
927
|
+
name: 'create_automated_outreach',
|
|
928
|
+
title: 'Create an Automated Outreach rule',
|
|
929
|
+
description: 'Add an Automated Outreach rule: one Google Sheet tab the agent watches, with its own filter, consent column and Outreach. `name` is required and the id is slugified from it unless you supply one. Keep one rule per lead source rather than merging sources into a single sheet. The spreadsheet must be shared with the platform sheets service account (Viewer; Editor when writeBack is on). `outreachId` must name an enabled Outreach on the agent (422 agent.outreach.not_found when it does not). Maps to POST /v1/orgs/{org}/agents/{agent}/automated-outreaches.',
|
|
930
|
+
kind: 'write',
|
|
931
|
+
scope: 'agents:write',
|
|
932
|
+
roleFloor: 'editor',
|
|
933
|
+
input: {
|
|
934
|
+
agentId,
|
|
935
|
+
name: zod_1.z
|
|
936
|
+
.string()
|
|
937
|
+
.describe('What this lead source is called, e.g. "Paid social leads"'),
|
|
938
|
+
id: zod_1.z.string().optional().describe('Explicit id; slugified from name when omitted'),
|
|
939
|
+
enabled: zod_1.z.boolean().optional(),
|
|
940
|
+
outreachId: zod_1.z
|
|
941
|
+
.string()
|
|
942
|
+
.optional()
|
|
943
|
+
.describe('The Outreach every qualifying row is sent'),
|
|
944
|
+
source: zod_1.z
|
|
945
|
+
.object({
|
|
946
|
+
spreadsheetId: zod_1.z.string().optional(),
|
|
947
|
+
sheetName: zod_1.z.string().optional().describe('Tab title'),
|
|
948
|
+
})
|
|
949
|
+
.optional(),
|
|
950
|
+
},
|
|
951
|
+
run: async ({ client }, { agentId, ...body }) => client.post(await client.orgPath(automatedOutreachPath(agentId)), stripUndefined(body)),
|
|
952
|
+
}),
|
|
953
|
+
(0, tool_1.defineTool)({
|
|
954
|
+
name: 'delete_automated_outreach',
|
|
955
|
+
title: 'Delete an Automated Outreach rule',
|
|
956
|
+
description: 'Remove one Automated Outreach rule. The agent stops watching that sheet tab. Run history is kept, and nobody already reached is un-reached. Maps to DELETE /v1/orgs/{org}/agents/{agent}/automated-outreaches/{id}.',
|
|
957
|
+
kind: 'destructive',
|
|
958
|
+
scope: 'agents:write',
|
|
959
|
+
roleFloor: 'editor',
|
|
960
|
+
input: { agentId, automatedOutreachId },
|
|
961
|
+
run: async ({ client }, { agentId, automatedOutreachId }) => client.delete(await client.orgPath(automatedOutreachPath(agentId, automatedOutreachId))),
|
|
1022
962
|
}),
|
|
1023
963
|
(0, tool_1.defineTool)({
|
|
1024
964
|
name: 'list_automated_outreach_runs',
|
|
1025
965
|
title: 'List Automated Outreach runs',
|
|
1026
|
-
description: 'Run history, newest first: per-run counts (rows, imported, sent, skipped, failed, already contacted) and per-row outcomes with skip/failure reasons (skipped rows carry a machine reason, e.g. no-consent, consent-denied, frequency-gated — a marketing send held back because the person was messaged within minTouchIntervalHours — or missing-inputs, when the configured Outreach declares an input the row cannot fill). A failed run carries the operator-readable error (e.g. sheet not shared); a completed run may carry warnings[] when part of the config could not be honored (e.g. a send window with an invalid time zone is ignored). When the config carries shadowOutreachId, a run also carries shadow: { outreachId, rows, agree, disagree[] } — disagree lists every row the legacy engine and the named Outreach engine decided differently ({ rowNumber, personId?, legacy: {action, reason?}, outreach: {action, reason?} }); a clean run (disagree empty) over a full pass licenses flipping the config to outreachId. Maps to GET /v1/orgs/{org}/agents/{agent}/automated-
|
|
966
|
+
description: 'Run history, newest first: per-run counts (rows, imported, sent, skipped, failed, already contacted) and per-row outcomes with skip/failure reasons (skipped rows carry a machine reason, e.g. no-consent, consent-denied, frequency-gated — a marketing send held back because the person was messaged within minTouchIntervalHours — or missing-inputs, when the configured Outreach declares an input the row cannot fill). A failed run carries the operator-readable error (e.g. sheet not shared); a completed run may carry warnings[] when part of the config could not be honored (e.g. a send window with an invalid time zone is ignored). When the config carries shadowOutreachId, a run also carries shadow: { outreachId, rows, agree, disagree[] } — disagree lists every row the legacy engine and the named Outreach engine decided differently ({ rowNumber, personId?, legacy: {action, reason?}, outreach: {action, reason?} }); a clean run (disagree empty) over a full pass licenses flipping the config to outreachId. Maps to GET /v1/orgs/{org}/agents/{agent}/automated-outreaches/{id}/runs.',
|
|
1027
967
|
kind: 'read',
|
|
1028
968
|
scope: 'agents:read',
|
|
1029
969
|
roleFloor: 'viewer',
|
|
1030
970
|
input: {
|
|
1031
971
|
agentId,
|
|
972
|
+
automatedOutreachId,
|
|
1032
973
|
limit: zod_1.z.number().int().min(1).max(100).optional().describe('Default 20'),
|
|
1033
974
|
},
|
|
1034
|
-
run: async ({ client }, { agentId, limit }) => client.get(await client.orgPath(automatedOutreachRunsPath(agentId)), stripUndefined({ limit })),
|
|
975
|
+
run: async ({ client }, { agentId, automatedOutreachId, limit }) => client.get(await client.orgPath(automatedOutreachRunsPath(agentId, automatedOutreachId)), stripUndefined({ limit })),
|
|
1035
976
|
}),
|
|
1036
977
|
(0, tool_1.defineTool)({
|
|
1037
978
|
name: 'start_automated_outreach_run',
|
|
1038
979
|
title: 'Run Automated Outreach now',
|
|
1039
|
-
description: 'Kick off an Automated Outreach run immediately instead of waiting for the sheet to be picked up automatically. Imports new qualified leads from the sheet and SENDS REAL OUTREACH MESSAGES to consented candidates; responds 202 and the run record appears in list_automated_outreach_runs when it finishes (can take minutes). With dryRun: true nothing is written or sent — every row is classified exactly like a real run (would-send rows) and the completed run record comes back synchronously; prefer a dry run before the first real one. When the config carries dryRun: true (dry-run-mode latch), every run simulates regardless of this parameter. Maps to POST /v1/orgs/{org}/agents/{agent}/automated-
|
|
980
|
+
description: 'Kick off an Automated Outreach run immediately instead of waiting for the sheet to be picked up automatically. Imports new qualified leads from the sheet and SENDS REAL OUTREACH MESSAGES to consented candidates; responds 202 and the run record appears in list_automated_outreach_runs when it finishes (can take minutes). With dryRun: true nothing is written or sent — every row is classified exactly like a real run (would-send rows) and the completed run record comes back synchronously; prefer a dry run before the first real one. When the config carries dryRun: true (dry-run-mode latch), every run simulates regardless of this parameter. Maps to POST /v1/orgs/{org}/agents/{agent}/automated-outreaches/{id}/runs.',
|
|
1040
981
|
kind: 'destructive',
|
|
1041
982
|
scope: 'agents:write',
|
|
1042
983
|
roleFloor: 'editor',
|
|
1043
984
|
input: {
|
|
1044
985
|
agentId,
|
|
986
|
+
automatedOutreachId,
|
|
1045
987
|
dryRun: zod_1.z
|
|
1046
988
|
.boolean()
|
|
1047
989
|
.optional()
|
|
1048
990
|
.describe('true = classify only, send nothing, synchronous result'),
|
|
1049
991
|
},
|
|
1050
|
-
run: async ({ client }, { agentId, dryRun }) => client.post(await client.orgPath(automatedOutreachRunsPath(agentId)), dryRun ? { dryRun: true } : {}),
|
|
992
|
+
run: async ({ client }, { agentId, automatedOutreachId, dryRun }) => client.post(await client.orgPath(automatedOutreachRunsPath(agentId, automatedOutreachId)), dryRun ? { dryRun: true } : {}),
|
|
1051
993
|
}),
|
|
1052
994
|
];
|
|
1053
995
|
//# sourceMappingURL=capabilities.js.map
|