@anychat-ai/mcp 0.50.0 → 0.52.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 +10 -3
- package/dist/tools/channels.js +47 -1
- package/dist/tools/channels.js.map +1 -1
- package/dist/tools/emulator.d.ts +1 -0
- package/dist/tools/emulator.js +94 -0
- package/dist/tools/emulator.js.map +1 -0
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.js +3 -1
- package/dist/tools/index.js.map +1 -1
- package/package.json +1 -1
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
|
+
195 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 → Campaigns → Tests → Testers → 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 195 tools.
|
|
61
|
+
- **`core`** — 74 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; outreach config; Things (read); Facts (read / replace); business info (read / replace); channels (list / get / request / bind, early access, launch); people (list / get / update, send outreach, list segments); testers (list); 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
|
|
|
@@ -175,6 +175,9 @@ Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })`
|
|
|
175
175
|
| `update_channel` | write | `agents:write` | full | Update a channel binding |
|
|
176
176
|
| `disable_channel` | write | `agents:write` | full | Disable a channel binding |
|
|
177
177
|
| `enable_channel` | write | `agents:write` | full | Enable a channel binding |
|
|
178
|
+
| `get_channel_early_access` | read | `agents:read` | core | Get a channel's launch state and early-access list |
|
|
179
|
+
| `set_channel_early_access` | write | `agents:write` | core | Replace a channel's early-access list |
|
|
180
|
+
| `launch_channel` | destructive | `agents:write` | core | Launch a channel (open it to everyone) |
|
|
178
181
|
| `delete_channel` | destructive | `agents:write` | full | Delete a channel binding |
|
|
179
182
|
| `list_people` | read | `people:read` | core | List people |
|
|
180
183
|
| `get_person` | read | `people:read` | core | Get a person |
|
|
@@ -238,6 +241,10 @@ Pick one with `--profile core` on the CLI or `createServer({ profile: 'core' })`
|
|
|
238
241
|
| `set_tester_disabled` | write | `agents:write` | full | Disable or enable tester |
|
|
239
242
|
| `regenerate_tester_link` | destructive | `agents:write` | full | Regenerate tester sign-in link |
|
|
240
243
|
| `remove_tester` | destructive | `agents:write` | full | Remove tester |
|
|
244
|
+
| `list_emulator_links` | read | `agents:read` | core | List standalone emulator links |
|
|
245
|
+
| `create_emulator_link` | destructive | `agents:write` | core | Create a standalone emulator link |
|
|
246
|
+
| `revoke_emulator_link` | destructive | `agents:write` | full | Revoke a standalone emulator link |
|
|
247
|
+
| `create_emulator_grant` | destructive | `agents:read` | full | Open the emulator now (short-lived grant) |
|
|
241
248
|
| `list_messages` | read | `messages:read` | core | List messages |
|
|
242
249
|
| `list_sessions` | read | `messages:read` | core | List sessions |
|
|
243
250
|
| `list_users` | read | `messages:read` | full | List users |
|
package/dist/tools/channels.js
CHANGED
|
@@ -18,6 +18,11 @@ const tool_1 = require("../tool");
|
|
|
18
18
|
* the binding itself
|
|
19
19
|
* (`status`, `statusDetail`, `events`) — there is no separate provisioning
|
|
20
20
|
* route.
|
|
21
|
+
*
|
|
22
|
+
* A channel is **connected, then launched**: until `launched` is true only
|
|
23
|
+
* the phone numbers on its early-access list reach the agent there (inbound
|
|
24
|
+
* from anyone else is dropped, on every provider). Launching is one-way and
|
|
25
|
+
* opens the channel to everyone.
|
|
21
26
|
*/
|
|
22
27
|
const CHANNEL_NAMES = [
|
|
23
28
|
'rcs',
|
|
@@ -75,7 +80,7 @@ exports.channelTools = [
|
|
|
75
80
|
(0, tool_1.defineTool)({
|
|
76
81
|
name: 'list_channels',
|
|
77
82
|
title: 'List channel bindings',
|
|
78
|
-
description: 'List the channel bindings of an agent — one per connected channel (rcs, appleMessages, whatsapp, sms …) with mode (managed = Anychat provisions; unmanaged = operator-supplied provider account), status (Requested | Provisioning | ActionRequired | Active | Failed | Disabled), statusDetail, lifecycle events, delivery/compliance settings. Credentials are never returned. Maps to GET /v1/orgs/{org}/agents/{agent}/channels.',
|
|
83
|
+
description: 'List the channel bindings of an agent — one per connected channel (rcs, appleMessages, whatsapp, sms …) with mode (managed = Anychat provisions; unmanaged = operator-supplied provider account), status (Requested | Provisioning | ActionRequired | Active | Failed | Disabled), statusDetail, lifecycle events, delivery/compliance settings, launched (false = only the earlyAccess numbers get through) and earlyAccess. Credentials are never returned. Maps to GET /v1/orgs/{org}/agents/{agent}/channels.',
|
|
79
84
|
kind: 'read',
|
|
80
85
|
scope: 'agents:read',
|
|
81
86
|
roleFloor: 'viewer',
|
|
@@ -188,6 +193,47 @@ exports.channelTools = [
|
|
|
188
193
|
input: { agentId: agentIdField, bindingId: bindingIdField },
|
|
189
194
|
run: async ({ client }, { agentId, bindingId }) => client.post(`${await client.orgPath(bindingPath(agentId, bindingId))}/_enable`),
|
|
190
195
|
}),
|
|
196
|
+
(0, tool_1.defineTool)({
|
|
197
|
+
name: 'get_channel_early_access',
|
|
198
|
+
title: "Get a channel's launch state and early-access list",
|
|
199
|
+
description: "Read whether a channel binding is launched and the early-access list (E.164 phone numbers that can reach the agent on this channel before launch). For RCS served by Google it also returns each number's carrier invite status (PENDING until the person accepts Google's RBM invitation on their phone). Maps to GET /v1/orgs/{org}/agents/{agent}/channels/{bindingId}/early-access.",
|
|
200
|
+
kind: 'read',
|
|
201
|
+
scope: 'agents:read',
|
|
202
|
+
roleFloor: 'viewer',
|
|
203
|
+
profile: 'core',
|
|
204
|
+
input: { agentId: agentIdField, bindingId: bindingIdField },
|
|
205
|
+
run: async ({ client }, { agentId, bindingId }) => client.get(`${await client.orgPath(bindingPath(agentId, bindingId))}/early-access`),
|
|
206
|
+
}),
|
|
207
|
+
(0, tool_1.defineTool)({
|
|
208
|
+
name: 'set_channel_early_access',
|
|
209
|
+
title: "Replace a channel's early-access list",
|
|
210
|
+
description: "Replace the FULL early-access list of an unlaunched channel binding: the phone numbers (E.164, e.g. +15551234567; normalized and de-duplicated) that may message the agent on this channel before launch — staff and acceptance testers on their own phones. Read the current list first (get_channel_early_access) and send the whole new list; an omitted number is removed. On Google-served RCS the numbers are also invited through Google's tester program (20 invites/day, 200 total → 429). 409 once the channel is launched; 422 names an unparseable number. Maps to PUT /v1/orgs/{org}/agents/{agent}/channels/{bindingId}/early-access.",
|
|
211
|
+
kind: 'write',
|
|
212
|
+
scope: 'agents:write',
|
|
213
|
+
roleFloor: 'editor',
|
|
214
|
+
profile: 'core',
|
|
215
|
+
input: {
|
|
216
|
+
agentId: agentIdField,
|
|
217
|
+
bindingId: bindingIdField,
|
|
218
|
+
earlyAccess: zod_1.z
|
|
219
|
+
.array(zod_1.z.string())
|
|
220
|
+
.describe('The complete list of E.164 phone numbers; [] clears it'),
|
|
221
|
+
},
|
|
222
|
+
run: async ({ client }, { agentId, bindingId, earlyAccess }) => client.put(`${await client.orgPath(bindingPath(agentId, bindingId))}/early-access`, {
|
|
223
|
+
earlyAccess,
|
|
224
|
+
}),
|
|
225
|
+
}),
|
|
226
|
+
(0, tool_1.defineTool)({
|
|
227
|
+
name: 'launch_channel',
|
|
228
|
+
title: 'Launch a channel (open it to everyone)',
|
|
229
|
+
description: 'Launch a connected channel binding: from now on ANYONE can reach the agent on this channel, not only the early-access list. One-way — there is no un-launch; use disable_channel to take the channel offline later. Confirm with the operator before calling. Maps to POST /v1/orgs/{org}/agents/{agent}/channels/{bindingId}/_launch.',
|
|
230
|
+
kind: 'destructive',
|
|
231
|
+
scope: 'agents:write',
|
|
232
|
+
roleFloor: 'editor',
|
|
233
|
+
profile: 'core',
|
|
234
|
+
input: { agentId: agentIdField, bindingId: bindingIdField },
|
|
235
|
+
run: async ({ client }, { agentId, bindingId }) => client.post(`${await client.orgPath(bindingPath(agentId, bindingId))}/_launch`),
|
|
236
|
+
}),
|
|
191
237
|
(0, tool_1.defineTool)({
|
|
192
238
|
name: 'delete_channel',
|
|
193
239
|
title: 'Delete a channel binding',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/tools/channels.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAAqC;AAErC
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/tools/channels.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAAqC;AAErC;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,aAAa,GAAG;IACpB,KAAK;IACL,eAAe;IACf,UAAU;IACV,KAAK;IACL,OAAO;IACP,OAAO;IACP,KAAK;CACG,CAAC;AAEX,MAAM,SAAS,GAAG;IAChB,WAAW;IACX,UAAU;IACV,WAAW;IACX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SAAS,CAAC,CAAC,UAAU,CAAC;KAClF,CAAC;IAEF,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,0BAA0B;QACjC,WAAW,EACT,mVAAmV;QACrV,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE;QAC3D,GAAG,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE;YAChD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,MAAM,CACjC,MAAM,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CACtD,CAAC;YACF,OAAO,OAAO,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;QACrD,CAAC;KACF,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const emulatorTools: import("../tool").AnyTool[];
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emulatorTools = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const tool_1 = require("../tool");
|
|
6
|
+
/**
|
|
7
|
+
* Emulator group — the sandbox emulator outside the console: standalone
|
|
8
|
+
* emulator links (share with a colleague who has no console account;
|
|
9
|
+
* revocable) and short-lived session grants (open the emulator page for
|
|
10
|
+
* an agent right now). Mirrors the "Emulator links" section of the API
|
|
11
|
+
* reference. Everything here is Sandbox: nothing done through a link or
|
|
12
|
+
* grant reaches a real customer.
|
|
13
|
+
*
|
|
14
|
+
* The create responses carry the link `url` exactly once. It is a
|
|
15
|
+
* credential for talking to the agent, so the tools that mint one are
|
|
16
|
+
* `destructive` (hosts prompt) and tell the model to hand it to the
|
|
17
|
+
* operator rather than paste it around.
|
|
18
|
+
*/
|
|
19
|
+
const URL_HANDLING = 'The response includes the url exactly once (a list never repeats it): give it to the operator to share — do not paste it anywhere else unprompted.';
|
|
20
|
+
const agentIdField = zod_1.z.string();
|
|
21
|
+
const linkIdField = zod_1.z.string().min(1).describe('Link id from list_emulator_links');
|
|
22
|
+
function emulatorPath(agentId, resource, suffix = '') {
|
|
23
|
+
return `/agents/${encodeURIComponent(agentId)}/${resource}${suffix}`;
|
|
24
|
+
}
|
|
25
|
+
exports.emulatorTools = [
|
|
26
|
+
(0, tool_1.defineTool)({
|
|
27
|
+
name: 'list_emulator_links',
|
|
28
|
+
title: 'List standalone emulator links',
|
|
29
|
+
description: 'List the active standalone emulator links of an agent: id, label, expiresAt, createdAt, createdBy. A link lets someone without a console account talk to the agent in the sandbox emulator (RCS, Apple Messages, WhatsApp or SMS look) — nothing they do reaches a real customer. Expired and revoked links are not listed; the link url is never included (it is returned once, on create). Maps to GET /v1/orgs/{org}/agents/{agent}/emulator-links.',
|
|
30
|
+
kind: 'read',
|
|
31
|
+
scope: 'agents:read',
|
|
32
|
+
roleFloor: 'viewer',
|
|
33
|
+
profile: 'core',
|
|
34
|
+
input: { agentId: agentIdField },
|
|
35
|
+
run: async ({ client }, { agentId }) => client.get(await client.orgPath(emulatorPath(agentId, 'emulator-links'))),
|
|
36
|
+
}),
|
|
37
|
+
(0, tool_1.defineTool)({
|
|
38
|
+
name: 'create_emulator_link',
|
|
39
|
+
title: 'Create a standalone emulator link',
|
|
40
|
+
description: `Create a shareable sandbox emulator link for an agent — for a colleague, client or reviewer who works with the team but not in the console. It opens the emulator page for this one agent with no sign-in; conversations are sandbox conversations (kept beside the real ones, never counted, no real effects). ttlDays 1–90 (default 14); label is an optional note. ${URL_HANDLING} Revoke it any time with revoke_emulator_link. Maps to POST /v1/orgs/{org}/agents/{agent}/emulator-links.`,
|
|
41
|
+
kind: 'destructive',
|
|
42
|
+
scope: 'agents:write',
|
|
43
|
+
roleFloor: 'editor',
|
|
44
|
+
profile: 'core',
|
|
45
|
+
input: {
|
|
46
|
+
agentId: agentIdField,
|
|
47
|
+
ttlDays: zod_1.z
|
|
48
|
+
.number()
|
|
49
|
+
.int()
|
|
50
|
+
.min(1)
|
|
51
|
+
.max(90)
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Days until the link expires (default 14)'),
|
|
54
|
+
label: zod_1.z.string().max(200).optional().describe('Note, e.g. "Marketing review"'),
|
|
55
|
+
},
|
|
56
|
+
run: async ({ client }, { agentId, ttlDays, label }) => client.post(await client.orgPath(emulatorPath(agentId, 'emulator-links')), {
|
|
57
|
+
...(ttlDays !== undefined ? { ttlDays } : {}),
|
|
58
|
+
...(label !== undefined ? { label } : {}),
|
|
59
|
+
}),
|
|
60
|
+
}),
|
|
61
|
+
(0, tool_1.defineTool)({
|
|
62
|
+
name: 'revoke_emulator_link',
|
|
63
|
+
title: 'Revoke a standalone emulator link',
|
|
64
|
+
description: 'Revoke a standalone emulator link: its url stops working immediately for everyone who has it. Irreversible — create a new link instead. 404 agent.emulator_link.not_found if the id is not a link of this agent. Maps to DELETE /v1/orgs/{org}/agents/{agent}/emulator-links/{id}.',
|
|
65
|
+
kind: 'destructive',
|
|
66
|
+
scope: 'agents:write',
|
|
67
|
+
roleFloor: 'editor',
|
|
68
|
+
input: { agentId: agentIdField, linkId: linkIdField },
|
|
69
|
+
run: async ({ client }, { agentId, linkId }) => {
|
|
70
|
+
const removed = await client.delete(await client.orgPath(emulatorPath(agentId, 'emulator-links', `/${encodeURIComponent(linkId)}`)));
|
|
71
|
+
return removed ?? { ok: true, revoked: linkId };
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
(0, tool_1.defineTool)({
|
|
75
|
+
name: 'create_emulator_grant',
|
|
76
|
+
title: 'Open the emulator now (short-lived grant)',
|
|
77
|
+
description: `Mint a short-lived session grant for an agent's sandbox emulator and get the page url to open it right now — for the operator themselves, not for sharing (share with create_emulator_link instead). ttlSec 60–3600 (default 1800); the grant cannot be revoked and is not listed anywhere. Returns { grant, expiresAt, url }. ${URL_HANDLING} Maps to POST /v1/orgs/{org}/agents/{agent}/emulator-grants.`,
|
|
78
|
+
kind: 'destructive',
|
|
79
|
+
scope: 'agents:read',
|
|
80
|
+
roleFloor: 'viewer',
|
|
81
|
+
input: {
|
|
82
|
+
agentId: agentIdField,
|
|
83
|
+
ttlSec: zod_1.z
|
|
84
|
+
.number()
|
|
85
|
+
.int()
|
|
86
|
+
.min(60)
|
|
87
|
+
.max(3600)
|
|
88
|
+
.optional()
|
|
89
|
+
.describe('Seconds until the grant expires (default 1800)'),
|
|
90
|
+
},
|
|
91
|
+
run: async ({ client }, { agentId, ttlSec }) => client.post(await client.orgPath(emulatorPath(agentId, 'emulator-grants')), ttlSec !== undefined ? { ttlSec } : {}),
|
|
92
|
+
}),
|
|
93
|
+
];
|
|
94
|
+
//# sourceMappingURL=emulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emulator.js","sourceRoot":"","sources":["../../src/tools/emulator.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAAqC;AAErC;;;;;;;;;;;;GAYG;AAEH,MAAM,YAAY,GAChB,oJAAoJ,CAAC;AAEvJ,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC;AAChC,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kCAAkC,CAAC,CAAC;AAEnF,SAAS,YAAY,CAAC,OAAe,EAAE,QAAgB,EAAE,MAAM,GAAG,EAAE;IAClE,OAAO,WAAW,kBAAkB,CAAC,OAAO,CAAC,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;AACvE,CAAC;AAEY,QAAA,aAAa,GAAG;IAC3B,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE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EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAC7C,MAAM,CAAC,IAAI,CACT,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,EAC9D,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CACvC;KACJ,CAAC;CACH,CAAC"}
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AnyTool, ToolProfile } from '../tool';
|
|
|
2
2
|
/**
|
|
3
3
|
* The tool table, in the order hosts list them. Grouped as the API reference
|
|
4
4
|
* is: orient → Definition → Capabilities → Channels → People → Campaigns →
|
|
5
|
-
* Tests → Testers → Activity → Org → Docs. Names must be unique (enforced by test/tools.spec.ts).
|
|
5
|
+
* Tests → Testers → Emulator → Activity → Org → Docs. Names must be unique (enforced by test/tools.spec.ts).
|
|
6
6
|
*/
|
|
7
7
|
export declare const allTools: AnyTool[];
|
|
8
8
|
export declare const toolsByName: ReadonlyMap<string, AnyTool>;
|
package/dist/tools/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const capabilities_1 = require("./capabilities");
|
|
|
9
9
|
const channels_1 = require("./channels");
|
|
10
10
|
const definition_1 = require("./definition");
|
|
11
11
|
const docs_1 = require("./docs");
|
|
12
|
+
const emulator_1 = require("./emulator");
|
|
12
13
|
const tests_1 = require("./tests");
|
|
13
14
|
const goals_1 = require("./goals");
|
|
14
15
|
const media_1 = require("./media");
|
|
@@ -19,7 +20,7 @@ const testers_1 = require("./testers");
|
|
|
19
20
|
/**
|
|
20
21
|
* The tool table, in the order hosts list them. Grouped as the API reference
|
|
21
22
|
* is: orient → Definition → Capabilities → Channels → People → Campaigns →
|
|
22
|
-
* Tests → Testers → Activity → Org → Docs. Names must be unique (enforced by test/tools.spec.ts).
|
|
23
|
+
* Tests → Testers → Emulator → Activity → Org → Docs. Names must be unique (enforced by test/tools.spec.ts).
|
|
23
24
|
*/
|
|
24
25
|
exports.allTools = [
|
|
25
26
|
...me_1.meTools,
|
|
@@ -33,6 +34,7 @@ exports.allTools = [
|
|
|
33
34
|
...campaigns_1.campaignTools,
|
|
34
35
|
...tests_1.testTools,
|
|
35
36
|
...testers_1.testerTools,
|
|
37
|
+
...emulator_1.emulatorTools,
|
|
36
38
|
...activity_1.activityTools,
|
|
37
39
|
...org_1.orgTools,
|
|
38
40
|
...docs_1.docsTools,
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;AAgDA,0CAKC;AApDD,yCAA2C;AAC3C,qCAAsC;AACtC,2CAA4C;AAC5C,iDAAiD;AACjD,yCAA0C;AAC1C,6CAA+C;AAC/C,iCAAmC;AACnC,yCAA2C;AAC3C,mCAAoC;AACpC,mCAAoC;AACpC,mCAAqC;AACrC,6BAA+B;AAC/B,+BAAiC;AACjC,qCAAuC;AACvC,uCAAwC;AAExC;;;;GAIG;AACU,QAAA,QAAQ,GAAc;IACjC,GAAG,YAAO;IACV,GAAG,mBAAU;IACb,GAAG,4BAAe;IAClB,GAAG,iBAAS;IACZ,GAAG,kBAAU;IACb,GAAG,8BAAe;IAClB,GAAG,uBAAY;IACf,GAAG,oBAAW;IACd,GAAG,yBAAa;IAChB,GAAG,iBAAS;IACZ,GAAG,qBAAW;IACd,GAAG,wBAAa;IAChB,GAAG,wBAAa;IAChB,GAAG,cAAQ;IACX,GAAG,gBAAS;CACb,CAAC;AAEW,QAAA,WAAW,GAAiC,IAAI,GAAG,CAC9D,gBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAC/B,CAAC;AAEF;;;GAGG;AACH,SAAgB,eAAe,CAC7B,OAAoB,EACpB,QAA4B,gBAAQ;IAEpC,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC;AACnF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anychat-ai/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "Anychat MCP server — drive your Anychat workspace (agents, playbooks, channels, people, outreach) from Claude Code, Claude Desktop, Cursor, or any MCP host.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anychat",
|