@anychat-ai/mcp 0.1.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/LICENSE +21 -0
- package/README.md +174 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +98 -0
- package/dist/bin.js.map +1 -0
- package/dist/client.d.ts +91 -0
- package/dist/client.js +154 -0
- package/dist/client.js.map +1 -0
- package/dist/docs.d.ts +60 -0
- package/dist/docs.js +238 -0
- package/dist/docs.js.map +1 -0
- package/dist/format.d.ts +19 -0
- package/dist/format.js +67 -0
- package/dist/format.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +26 -0
- package/dist/server.js +72 -0
- package/dist/server.js.map +1 -0
- package/dist/tool.d.ts +43 -0
- package/dist/tool.js +8 -0
- package/dist/tool.js.map +1 -0
- package/dist/tools/activity.d.ts +1 -0
- package/dist/tools/activity.js +153 -0
- package/dist/tools/activity.js.map +1 -0
- package/dist/tools/agents.d.ts +1 -0
- package/dist/tools/agents.js +309 -0
- package/dist/tools/agents.js.map +1 -0
- package/dist/tools/capabilities.d.ts +1 -0
- package/dist/tools/capabilities.js +325 -0
- package/dist/tools/capabilities.js.map +1 -0
- package/dist/tools/channels.d.ts +1 -0
- package/dist/tools/channels.js +208 -0
- package/dist/tools/channels.js.map +1 -0
- package/dist/tools/definition.d.ts +1 -0
- package/dist/tools/definition.js +531 -0
- package/dist/tools/definition.js.map +1 -0
- package/dist/tools/docs.d.ts +1 -0
- package/dist/tools/docs.js +67 -0
- package/dist/tools/docs.js.map +1 -0
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.js +30 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/me.d.ts +1 -0
- package/dist/tools/me.js +17 -0
- package/dist/tools/me.js.map +1 -0
- package/dist/tools/org.d.ts +1 -0
- package/dist/tools/org.js +178 -0
- package/dist/tools/org.js.map +1 -0
- package/dist/tools/people.d.ts +1 -0
- package/dist/tools/people.js +411 -0
- package/dist/tools/people.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.definitionTools = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const tool_1 = require("../tool");
|
|
6
|
+
/**
|
|
7
|
+
* Definition tools — the authored document of an agent: Identity,
|
|
8
|
+
* Personality, Objectives, Guardrails, Playbooks and Message templates.
|
|
9
|
+
* 1:1 projection of the "Definition" resources in the API reference
|
|
10
|
+
* (docs.anychat.ai/reference/agent-api). Skills are a retired resource
|
|
11
|
+
* (2026-08-09) — instruction blocks now live on each Playbook as
|
|
12
|
+
* `procedures[]`.
|
|
13
|
+
*/
|
|
14
|
+
const agentId = zod_1.z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1)
|
|
17
|
+
.describe('Agent id (the friendly agent id, e.g. "acme-sales-bot")');
|
|
18
|
+
const templateIdArg = (kind, example) => zod_1.z
|
|
19
|
+
.string()
|
|
20
|
+
.min(1)
|
|
21
|
+
.describe(`Catalog ${kind} template id, e.g. "${example}". Discover ids with the catalog tools.`);
|
|
22
|
+
const derivedFrom = zod_1.z
|
|
23
|
+
.object({
|
|
24
|
+
templateId: zod_1.z.string().describe('Catalog template id this content was imported from'),
|
|
25
|
+
version: zod_1.z.string().describe('Template version at import time'),
|
|
26
|
+
})
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('Provenance pointer for template-derived content (normally left to the API)');
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// Identity
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
const identityFields = {
|
|
33
|
+
smallLogoUrl: zod_1.z.string().nullable().optional().describe('URL of the small/square logo'),
|
|
34
|
+
largeBannerUrl: zod_1.z
|
|
35
|
+
.string()
|
|
36
|
+
.nullable()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe('URL of the wide banner image'),
|
|
39
|
+
brandColor: zod_1.z
|
|
40
|
+
.string()
|
|
41
|
+
.nullable()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Brand color as hex, e.g. "#1a73e8"'),
|
|
44
|
+
contactEmail: zod_1.z.string().nullable().optional().describe('Business contact email'),
|
|
45
|
+
contactPhone: zod_1.z
|
|
46
|
+
.string()
|
|
47
|
+
.nullable()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Business contact phone (E.164)'),
|
|
50
|
+
websiteUrl: zod_1.z.string().nullable().optional().describe('Business website URL'),
|
|
51
|
+
privacyPolicyUrl: zod_1.z.string().nullable().optional().describe('Privacy policy URL'),
|
|
52
|
+
termsOfServiceUrl: zod_1.z.string().nullable().optional().describe('Terms of service URL'),
|
|
53
|
+
contactAvailability: zod_1.z
|
|
54
|
+
.string()
|
|
55
|
+
.nullable()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Shown verbatim when escalating to a human, e.g. "Mon–Fri 9–5 PT"'),
|
|
58
|
+
identityPreamble: zod_1.z
|
|
59
|
+
.string()
|
|
60
|
+
.nullable()
|
|
61
|
+
.optional()
|
|
62
|
+
.describe('Short agent-level "who is talking" line composed into every system prompt, e.g. "You are Acme Corp\'s sales development agent." Behavior lives in the Default Playbook, not here.'),
|
|
63
|
+
};
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// Objectives
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
const objectiveItem = zod_1.z
|
|
68
|
+
.object({
|
|
69
|
+
id: zod_1.z.string().describe('Short slug, unique within the agent, e.g. "qualify-lead"'),
|
|
70
|
+
name: zod_1.z.string().describe('Display name'),
|
|
71
|
+
description: zod_1.z
|
|
72
|
+
.string()
|
|
73
|
+
.optional()
|
|
74
|
+
.describe('Human-readable summary (operator-facing)'),
|
|
75
|
+
body: zod_1.z.string().describe('The prompt fragment the agent uses (LLM-facing)'),
|
|
76
|
+
priority: zod_1.z.number().describe('Rank; lower wins when objectives compete on a turn'),
|
|
77
|
+
derivedFrom,
|
|
78
|
+
})
|
|
79
|
+
.passthrough();
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
// Guardrails
|
|
82
|
+
// ---------------------------------------------------------------------------
|
|
83
|
+
const guardrailListOp = zod_1.z
|
|
84
|
+
.object({
|
|
85
|
+
add: zod_1.z
|
|
86
|
+
.array(zod_1.z.string())
|
|
87
|
+
.optional()
|
|
88
|
+
.describe('Strings to append (deduplicated against the current list)'),
|
|
89
|
+
remove: zod_1.z
|
|
90
|
+
.array(zod_1.z.string())
|
|
91
|
+
.optional()
|
|
92
|
+
.describe('Strings to remove (case-sensitive exact match)'),
|
|
93
|
+
})
|
|
94
|
+
.optional();
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// Playbooks
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
const playbookOutreach = zod_1.z
|
|
99
|
+
.object({
|
|
100
|
+
eligible: zod_1.z
|
|
101
|
+
.boolean()
|
|
102
|
+
.optional()
|
|
103
|
+
.describe('Offer this Playbook in the outreach send dialog (isOutbound: true implies eligibility)'),
|
|
104
|
+
openingTemplateId: zod_1.z
|
|
105
|
+
.string()
|
|
106
|
+
.optional()
|
|
107
|
+
.describe("Id of one of the agent's message templates sent as the deterministic opening when an outreach send selects this Playbook. Must reference an existing message template."),
|
|
108
|
+
exclusive: zod_1.z
|
|
109
|
+
.boolean()
|
|
110
|
+
.optional()
|
|
111
|
+
.describe('Outreach-only: the runtime never offers it as a switch_playbook target; a conversation enters it only via an outreach send. Cannot be combined with isDefault.'),
|
|
112
|
+
})
|
|
113
|
+
.describe('Playbook-first outreach binding');
|
|
114
|
+
const playbookExamples = zod_1.z
|
|
115
|
+
.array(zod_1.z.array(zod_1.z.object({
|
|
116
|
+
role: zod_1.z.enum(['user', 'agent']).describe('Who is speaking'),
|
|
117
|
+
content: zod_1.z.string().describe('Message text'),
|
|
118
|
+
})))
|
|
119
|
+
.optional()
|
|
120
|
+
.describe('Example exchanges — an array of conversations, each an array of turns');
|
|
121
|
+
const playbookProcedure = zod_1.z
|
|
122
|
+
.object({
|
|
123
|
+
id: zod_1.z.string().describe('Short slug, unique within the Playbook'),
|
|
124
|
+
name: zod_1.z.string().describe('Display name'),
|
|
125
|
+
description: zod_1.z.string().optional().describe('Operator-facing summary'),
|
|
126
|
+
body: zod_1.z.string().describe('LLM-facing instruction block'),
|
|
127
|
+
requiredTools: zod_1.z
|
|
128
|
+
.array(zod_1.z.string())
|
|
129
|
+
.optional()
|
|
130
|
+
.describe('Capability actions (catalog tool ids) the procedure uses'),
|
|
131
|
+
config: zod_1.z
|
|
132
|
+
.record(zod_1.z.string(), zod_1.z.any())
|
|
133
|
+
.optional()
|
|
134
|
+
.describe('Procedure-specific configuration'),
|
|
135
|
+
derivedFrom,
|
|
136
|
+
})
|
|
137
|
+
.passthrough();
|
|
138
|
+
const playbookContentFields = {
|
|
139
|
+
description: zod_1.z.string().optional().describe('Operator-facing description'),
|
|
140
|
+
whenToUse: zod_1.z
|
|
141
|
+
.string()
|
|
142
|
+
.optional()
|
|
143
|
+
.describe('LLM-facing activation context — when the runtime should switch into this Playbook'),
|
|
144
|
+
examples: playbookExamples,
|
|
145
|
+
toolRefs: zod_1.z
|
|
146
|
+
.array(zod_1.z.string())
|
|
147
|
+
.optional()
|
|
148
|
+
.describe('Catalog tool ids this Playbook may invoke'),
|
|
149
|
+
messageTemplateRefs: zod_1.z
|
|
150
|
+
.array(zod_1.z.string())
|
|
151
|
+
.optional()
|
|
152
|
+
.describe('Ids of message templates this Playbook may deploy'),
|
|
153
|
+
isDefault: zod_1.z
|
|
154
|
+
.boolean()
|
|
155
|
+
.optional()
|
|
156
|
+
.describe('Make this the Default Playbook (exactly one per agent — setting true clears the previous default). Prefer set_default_playbook.'),
|
|
157
|
+
isOutbound: zod_1.z
|
|
158
|
+
.boolean()
|
|
159
|
+
.optional()
|
|
160
|
+
.describe('Make this the outreach default (at most one per agent — setting true clears the previous one)'),
|
|
161
|
+
};
|
|
162
|
+
// ---------------------------------------------------------------------------
|
|
163
|
+
// Message templates
|
|
164
|
+
// ---------------------------------------------------------------------------
|
|
165
|
+
const messageTemplateFields = {
|
|
166
|
+
name: zod_1.z.string().min(1).describe('Display name'),
|
|
167
|
+
description: zod_1.z.string().optional().describe('Operator-facing description'),
|
|
168
|
+
body: zod_1.z
|
|
169
|
+
.string()
|
|
170
|
+
.describe('Message text with {slot} placeholders, e.g. "Hi {person.firstName | \\"there\\"} — thanks for stopping by {agent.companyName}." Slots read from person.* (firstName, lastName, fullName, email, phone, company, title, productInterest, source, customFields.<key>) and agent.* (name, companyName, companyDescription, contactEmail, contactPhone, websiteUrl). Inline fallback after a pipe: a quoted literal, or omit-sentence / omit-message / block-send. Bodies with unknown slots are rejected.'),
|
|
171
|
+
defaultOnMissingSlot: zod_1.z
|
|
172
|
+
.enum(['omit-sentence', 'omit-message', 'block-send'])
|
|
173
|
+
.optional()
|
|
174
|
+
.describe('Policy for slots that are missing and have no inline fallback'),
|
|
175
|
+
};
|
|
176
|
+
exports.definitionTools = [
|
|
177
|
+
// ---- Identity -----------------------------------------------------------
|
|
178
|
+
(0, tool_1.defineTool)({
|
|
179
|
+
name: 'get_identity',
|
|
180
|
+
title: 'Get agent identity',
|
|
181
|
+
description: "Read the agent's Identity — logos, brand color, contact email/phone, website, policy URLs, contact availability and the identityPreamble. This is the single source of truth for brand contact info and seeds new channel bindings. Maps to GET /v1/orgs/{org}/agents/{agent}/identity.",
|
|
182
|
+
kind: 'read',
|
|
183
|
+
scope: 'agents:read',
|
|
184
|
+
roleFloor: 'viewer',
|
|
185
|
+
input: { agentId },
|
|
186
|
+
run: async ({ client }, { agentId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/identity`)),
|
|
187
|
+
}),
|
|
188
|
+
(0, tool_1.defineTool)({
|
|
189
|
+
name: 'update_identity',
|
|
190
|
+
title: 'Update agent identity',
|
|
191
|
+
description: 'Update only the Identity fields you send (others are left as-is; send null to clear a field). Returns the full identity. Edits do not propagate to existing channel bindings. Maps to PATCH /v1/orgs/{org}/agents/{agent}/identity.',
|
|
192
|
+
kind: 'write',
|
|
193
|
+
scope: 'agents:write',
|
|
194
|
+
roleFloor: 'editor',
|
|
195
|
+
input: { agentId, ...identityFields },
|
|
196
|
+
run: async ({ client }, { agentId, ...body }) => client.patch(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/identity`), body),
|
|
197
|
+
}),
|
|
198
|
+
// ---- Personality --------------------------------------------------------
|
|
199
|
+
(0, tool_1.defineTool)({
|
|
200
|
+
name: 'get_personality',
|
|
201
|
+
title: 'Get agent personality',
|
|
202
|
+
description: "Read the agent's Personality: { description?, text, derivedFrom? } — the voice/tone prompt fragment. Maps to GET /v1/orgs/{org}/agents/{agent}/personality.",
|
|
203
|
+
kind: 'read',
|
|
204
|
+
scope: 'agents:read',
|
|
205
|
+
roleFloor: 'viewer',
|
|
206
|
+
input: { agentId },
|
|
207
|
+
run: async ({ client }, { agentId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/personality`)),
|
|
208
|
+
}),
|
|
209
|
+
(0, tool_1.defineTool)({
|
|
210
|
+
name: 'set_personality',
|
|
211
|
+
title: 'Set agent personality',
|
|
212
|
+
description: "Replace the agent's Personality wholesale (`text` is required; omitted fields are dropped). Read it first with get_personality if you only want to tweak wording. Returns the saved personality. Maps to PUT /v1/orgs/{org}/agents/{agent}/personality.",
|
|
213
|
+
kind: 'write',
|
|
214
|
+
scope: 'agents:write',
|
|
215
|
+
roleFloor: 'editor',
|
|
216
|
+
input: {
|
|
217
|
+
agentId,
|
|
218
|
+
text: zod_1.z.string().describe('The prompt fragment the agent uses (voice and tone)'),
|
|
219
|
+
description: zod_1.z.string().optional().describe('Human-readable summary'),
|
|
220
|
+
derivedFrom,
|
|
221
|
+
},
|
|
222
|
+
run: async ({ client }, { agentId, ...body }) => client.put(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/personality`), body),
|
|
223
|
+
}),
|
|
224
|
+
(0, tool_1.defineTool)({
|
|
225
|
+
name: 'import_personality_template',
|
|
226
|
+
title: 'Import personality template',
|
|
227
|
+
description: 'Copy a system Personality Template from the catalog onto the agent, replacing the current personality and stamping derivedFrom (edit freely afterward). Returns the imported personality. Maps to POST /v1/orgs/{org}/agents/{agent}/personality/import.',
|
|
228
|
+
kind: 'write',
|
|
229
|
+
scope: 'templates:apply',
|
|
230
|
+
roleFloor: 'editor',
|
|
231
|
+
input: {
|
|
232
|
+
agentId,
|
|
233
|
+
templateId: templateIdArg('personality', '@anychat/personality-template.professional'),
|
|
234
|
+
},
|
|
235
|
+
run: async ({ client }, { agentId, templateId }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/personality/import`), { templateId }),
|
|
236
|
+
}),
|
|
237
|
+
// ---- Objectives ---------------------------------------------------------
|
|
238
|
+
(0, tool_1.defineTool)({
|
|
239
|
+
name: 'get_objectives',
|
|
240
|
+
title: 'Get agent objectives',
|
|
241
|
+
description: "List the agent's Objectives — ranked SMART-style goals ({ id, name, description?, body, priority, derivedFrom? }; lower priority wins). Returns { data: AgentObjective[] }. Maps to GET /v1/orgs/{org}/agents/{agent}/objectives.",
|
|
242
|
+
kind: 'read',
|
|
243
|
+
scope: 'agents:read',
|
|
244
|
+
roleFloor: 'viewer',
|
|
245
|
+
input: { agentId },
|
|
246
|
+
run: async ({ client }, { agentId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/objectives`)),
|
|
247
|
+
}),
|
|
248
|
+
(0, tool_1.defineTool)({
|
|
249
|
+
name: 'set_objectives',
|
|
250
|
+
title: 'Set agent objectives',
|
|
251
|
+
description: 'Replace the full Objectives list — send every objective you want to keep (read with get_objectives first; anything omitted is removed). Use this to add, edit, reorder or delete objectives. Returns { data: AgentObjective[] }. Maps to PUT /v1/orgs/{org}/agents/{agent}/objectives.',
|
|
252
|
+
kind: 'write',
|
|
253
|
+
scope: 'agents:write',
|
|
254
|
+
roleFloor: 'editor',
|
|
255
|
+
input: {
|
|
256
|
+
agentId,
|
|
257
|
+
objectives: zod_1.z
|
|
258
|
+
.array(objectiveItem)
|
|
259
|
+
.describe('The complete ordered list of objectives for the agent'),
|
|
260
|
+
},
|
|
261
|
+
run: async ({ client }, { agentId, objectives }) => client.put(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/objectives`), { objectives }),
|
|
262
|
+
}),
|
|
263
|
+
(0, tool_1.defineTool)({
|
|
264
|
+
name: 'import_objective_template',
|
|
265
|
+
title: 'Import objective template',
|
|
266
|
+
description: 'Append one objective derived from a system Objective Template in the catalog (re-importing the same template replaces that objective in place). `priority` defaults to end of list + 1. Returns { data: AgentObjective[] }. Maps to POST /v1/orgs/{org}/agents/{agent}/objectives/import.',
|
|
267
|
+
kind: 'write',
|
|
268
|
+
scope: 'templates:apply',
|
|
269
|
+
roleFloor: 'editor',
|
|
270
|
+
input: {
|
|
271
|
+
agentId,
|
|
272
|
+
templateId: templateIdArg('objective', '@anychat/objective-template.qualify-lead'),
|
|
273
|
+
priority: zod_1.z
|
|
274
|
+
.number()
|
|
275
|
+
.optional()
|
|
276
|
+
.describe('Priority for the imported objective (lower wins); default end of list + 1'),
|
|
277
|
+
},
|
|
278
|
+
run: async ({ client }, { agentId, templateId, priority }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/objectives/import`), priority === undefined ? { templateId } : { templateId, priority }),
|
|
279
|
+
}),
|
|
280
|
+
// ---- Guardrails ---------------------------------------------------------
|
|
281
|
+
(0, tool_1.defineTool)({
|
|
282
|
+
name: 'get_guardrails',
|
|
283
|
+
title: 'Get agent guardrails',
|
|
284
|
+
description: "Read the agent's Guardrails: { topicsToAvoid[], claimsNotToMake[], requiredDisclaimers[], additionalRules?, derivedFromTemplates[] }. Maps to GET /v1/orgs/{org}/agents/{agent}/guardrails.",
|
|
285
|
+
kind: 'read',
|
|
286
|
+
scope: 'agents:read',
|
|
287
|
+
roleFloor: 'viewer',
|
|
288
|
+
input: { agentId },
|
|
289
|
+
run: async ({ client }, { agentId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/guardrails`)),
|
|
290
|
+
}),
|
|
291
|
+
(0, tool_1.defineTool)({
|
|
292
|
+
name: 'set_guardrails',
|
|
293
|
+
title: 'Set agent guardrails',
|
|
294
|
+
description: 'Replace the Guardrails block wholesale — send every list you want to keep (read with get_guardrails first; omitted lists are cleared). For incremental add/remove prefer update_guardrails. Returns the saved guardrails. Maps to PUT /v1/orgs/{org}/agents/{agent}/guardrails.',
|
|
295
|
+
kind: 'write',
|
|
296
|
+
scope: 'agents:write',
|
|
297
|
+
roleFloor: 'editor',
|
|
298
|
+
input: {
|
|
299
|
+
agentId,
|
|
300
|
+
topicsToAvoid: zod_1.z
|
|
301
|
+
.array(zod_1.z.string())
|
|
302
|
+
.optional()
|
|
303
|
+
.describe('Topics the agent must not discuss'),
|
|
304
|
+
claimsNotToMake: zod_1.z
|
|
305
|
+
.array(zod_1.z.string())
|
|
306
|
+
.optional()
|
|
307
|
+
.describe('Claims the agent must never make'),
|
|
308
|
+
requiredDisclaimers: zod_1.z
|
|
309
|
+
.array(zod_1.z.string())
|
|
310
|
+
.optional()
|
|
311
|
+
.describe('Disclaimers the agent must include where relevant'),
|
|
312
|
+
additionalRules: zod_1.z
|
|
313
|
+
.string()
|
|
314
|
+
.optional()
|
|
315
|
+
.describe('Free-form hard rules that do not fit the lists'),
|
|
316
|
+
derivedFromTemplates: zod_1.z
|
|
317
|
+
.array(zod_1.z.string())
|
|
318
|
+
.optional()
|
|
319
|
+
.describe('Back-links to imported guardrail template ids (normally managed by import)'),
|
|
320
|
+
},
|
|
321
|
+
run: async ({ client }, { agentId, ...body }) => client.put(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/guardrails`), body),
|
|
322
|
+
}),
|
|
323
|
+
(0, tool_1.defineTool)({
|
|
324
|
+
name: 'update_guardrails',
|
|
325
|
+
title: 'Update agent guardrails',
|
|
326
|
+
description: 'Incrementally edit Guardrails: per list send { add?: string[], remove?: string[] } (adds dedupe; removes are exact-match), and/or set `additionalRules` to a new string. Lists you omit are untouched. Returns the saved guardrails. Maps to PATCH /v1/orgs/{org}/agents/{agent}/guardrails.',
|
|
327
|
+
kind: 'write',
|
|
328
|
+
scope: 'agents:write',
|
|
329
|
+
roleFloor: 'editor',
|
|
330
|
+
input: {
|
|
331
|
+
agentId,
|
|
332
|
+
topicsToAvoid: guardrailListOp.describe('Add/remove operations for topicsToAvoid'),
|
|
333
|
+
claimsNotToMake: guardrailListOp.describe('Add/remove operations for claimsNotToMake'),
|
|
334
|
+
requiredDisclaimers: guardrailListOp.describe('Add/remove operations for requiredDisclaimers'),
|
|
335
|
+
additionalRules: zod_1.z
|
|
336
|
+
.string()
|
|
337
|
+
.optional()
|
|
338
|
+
.describe('New value for the free-form rules (replaces the whole string; "" clears)'),
|
|
339
|
+
},
|
|
340
|
+
run: async ({ client }, { agentId, ...body }) => client.patch(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/guardrails`), body),
|
|
341
|
+
}),
|
|
342
|
+
(0, tool_1.defineTool)({
|
|
343
|
+
name: 'import_guardrail_template',
|
|
344
|
+
title: 'Import guardrail template',
|
|
345
|
+
description: "Merge a system Guardrail Template from the catalog into the agent's existing lists (deduplicated, order preserved — import accumulates rather than replaces) and append the template id to derivedFromTemplates. Returns the saved guardrails. Maps to POST /v1/orgs/{org}/agents/{agent}/guardrails/import.",
|
|
346
|
+
kind: 'write',
|
|
347
|
+
scope: 'templates:apply',
|
|
348
|
+
roleFloor: 'editor',
|
|
349
|
+
input: {
|
|
350
|
+
agentId,
|
|
351
|
+
templateId: templateIdArg('guardrail', '@anychat/guardrail-template.healthcare-disclaimers'),
|
|
352
|
+
},
|
|
353
|
+
run: async ({ client }, { agentId, templateId }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/guardrails/import`), { templateId }),
|
|
354
|
+
}),
|
|
355
|
+
// ---- Playbooks ----------------------------------------------------------
|
|
356
|
+
(0, tool_1.defineTool)({
|
|
357
|
+
name: 'list_playbooks',
|
|
358
|
+
title: 'List playbooks',
|
|
359
|
+
description: "List all of the agent's Playbooks (named modes of operation) with full bodies, procedures, flags and outreach binding. Exactly one has isDefault: true and at most one isOutbound: true. Returns { data: AgentPlaybook[] }. Maps to GET /v1/orgs/{org}/agents/{agent}/playbooks.",
|
|
360
|
+
kind: 'read',
|
|
361
|
+
scope: 'agents:read',
|
|
362
|
+
roleFloor: 'viewer',
|
|
363
|
+
input: { agentId },
|
|
364
|
+
run: async ({ client }, { agentId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/playbooks`)),
|
|
365
|
+
}),
|
|
366
|
+
(0, tool_1.defineTool)({
|
|
367
|
+
name: 'get_playbook',
|
|
368
|
+
title: 'Get playbook',
|
|
369
|
+
description: 'Read one Playbook by id, including its body, whenToUse, examples, procedures[], toolRefs, messageTemplateRefs, isDefault/isOutbound and outreach binding. Maps to GET /v1/orgs/{org}/agents/{agent}/playbooks/{playbookId}.',
|
|
370
|
+
kind: 'read',
|
|
371
|
+
scope: 'agents:read',
|
|
372
|
+
roleFloor: 'viewer',
|
|
373
|
+
input: {
|
|
374
|
+
agentId,
|
|
375
|
+
playbookId: zod_1.z.string().min(1).describe('Playbook id (short slug)'),
|
|
376
|
+
},
|
|
377
|
+
run: async ({ client }, { agentId, playbookId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/playbooks/${encodeURIComponent(playbookId)}`)),
|
|
378
|
+
}),
|
|
379
|
+
(0, tool_1.defineTool)({
|
|
380
|
+
name: 'create_playbook',
|
|
381
|
+
title: 'Create playbook',
|
|
382
|
+
description: 'Create a new Playbook on the agent (id is slugified from name when omitted). Invariants are enforced on every write: exactly one Default Playbook, at most one outreach default (isOutbound); an outreach-exclusive Playbook cannot be the default. To add procedures[] use update_playbook after creating. Returns the created Playbook. Maps to POST /v1/orgs/{org}/agents/{agent}/playbooks.',
|
|
383
|
+
kind: 'write',
|
|
384
|
+
scope: 'agents:write',
|
|
385
|
+
roleFloor: 'editor',
|
|
386
|
+
input: {
|
|
387
|
+
agentId,
|
|
388
|
+
id: zod_1.z
|
|
389
|
+
.string()
|
|
390
|
+
.optional()
|
|
391
|
+
.describe('Short slug for the Playbook; slugified from name when omitted'),
|
|
392
|
+
name: zod_1.z.string().min(1).describe('Display name'),
|
|
393
|
+
body: zod_1.z.string().describe('LLM-facing instructional body'),
|
|
394
|
+
...playbookContentFields,
|
|
395
|
+
outreach: playbookOutreach.optional(),
|
|
396
|
+
},
|
|
397
|
+
run: async ({ client }, { agentId, ...body }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/playbooks`), body),
|
|
398
|
+
}),
|
|
399
|
+
(0, tool_1.defineTool)({
|
|
400
|
+
name: 'update_playbook',
|
|
401
|
+
title: 'Update playbook',
|
|
402
|
+
description: 'Update only the Playbook fields you send (PATCH semantics). Arrays (examples, procedures, toolRefs, messageTemplateRefs) are replaced whole when sent; `outreach` as an object replaces the binding, `outreach: null` clears it. Setting isDefault/isOutbound true moves that flag here (invariants enforced). Returns the updated Playbook. Maps to PATCH /v1/orgs/{org}/agents/{agent}/playbooks/{playbookId}.',
|
|
403
|
+
kind: 'write',
|
|
404
|
+
scope: 'agents:write',
|
|
405
|
+
roleFloor: 'editor',
|
|
406
|
+
input: {
|
|
407
|
+
agentId,
|
|
408
|
+
playbookId: zod_1.z.string().min(1).describe('Playbook id (short slug)'),
|
|
409
|
+
name: zod_1.z.string().min(1).optional().describe('Display name'),
|
|
410
|
+
body: zod_1.z.string().optional().describe('LLM-facing instructional body'),
|
|
411
|
+
...playbookContentFields,
|
|
412
|
+
procedures: zod_1.z
|
|
413
|
+
.array(playbookProcedure)
|
|
414
|
+
.optional()
|
|
415
|
+
.describe('Playbook-owned instruction blocks (replaces the whole list). Each needs id + name; body defaults to "".'),
|
|
416
|
+
outreach: playbookOutreach.nullable().optional(),
|
|
417
|
+
},
|
|
418
|
+
run: async ({ client }, { agentId, playbookId, ...body }) => client.patch(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/playbooks/${encodeURIComponent(playbookId)}`), body),
|
|
419
|
+
}),
|
|
420
|
+
(0, tool_1.defineTool)({
|
|
421
|
+
name: 'delete_playbook',
|
|
422
|
+
title: 'Delete playbook',
|
|
423
|
+
description: 'Delete a Playbook from the agent. Deleting the Default Playbook promotes the first remaining one to default; deleting the last one leaves the agent with no playbooks. Irreversible. Maps to DELETE /v1/orgs/{org}/agents/{agent}/playbooks/{playbookId}.',
|
|
424
|
+
kind: 'destructive',
|
|
425
|
+
scope: 'agents:write',
|
|
426
|
+
roleFloor: 'editor',
|
|
427
|
+
input: {
|
|
428
|
+
agentId,
|
|
429
|
+
playbookId: zod_1.z.string().min(1).describe('Playbook id (short slug)'),
|
|
430
|
+
},
|
|
431
|
+
run: async ({ client }, { agentId, playbookId }) => {
|
|
432
|
+
await client.delete(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/playbooks/${encodeURIComponent(playbookId)}`));
|
|
433
|
+
return { ok: true, deleted: playbookId };
|
|
434
|
+
},
|
|
435
|
+
}),
|
|
436
|
+
(0, tool_1.defineTool)({
|
|
437
|
+
name: 'set_default_playbook',
|
|
438
|
+
title: 'Set default playbook',
|
|
439
|
+
description: "Atomically make this Playbook the agent's Default Playbook (clears isDefault on the others). Rejected for outreach-exclusive Playbooks. Returns the updated Playbook. Maps to POST /v1/orgs/{org}/agents/{agent}/playbooks/{playbookId}/_setDefault.",
|
|
440
|
+
kind: 'write',
|
|
441
|
+
scope: 'agents:write',
|
|
442
|
+
roleFloor: 'editor',
|
|
443
|
+
input: {
|
|
444
|
+
agentId,
|
|
445
|
+
playbookId: zod_1.z.string().min(1).describe('Playbook id (short slug)'),
|
|
446
|
+
},
|
|
447
|
+
run: async ({ client }, { agentId, playbookId }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/playbooks/${encodeURIComponent(playbookId)}/_setDefault`)),
|
|
448
|
+
}),
|
|
449
|
+
(0, tool_1.defineTool)({
|
|
450
|
+
name: 'import_playbook_template',
|
|
451
|
+
title: 'Import playbook template',
|
|
452
|
+
description: 'Copy a catalog Playbook Template onto the agent (procedures materialized from the template, derivedFrom stamped; re-importing the same template replaces that Playbook in place, never as default). Returns the full { data: AgentPlaybook[] } list. Maps to POST /v1/orgs/{org}/agents/{agent}/playbooks/import.',
|
|
453
|
+
kind: 'write',
|
|
454
|
+
scope: 'templates:apply',
|
|
455
|
+
roleFloor: 'editor',
|
|
456
|
+
input: {
|
|
457
|
+
agentId,
|
|
458
|
+
templateId: templateIdArg('playbook', '@anychat/playbook-template.escalate-to-human'),
|
|
459
|
+
},
|
|
460
|
+
run: async ({ client }, { agentId, templateId }) => client.post(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/playbooks/import`), { templateId }),
|
|
461
|
+
}),
|
|
462
|
+
// ---- Message templates --------------------------------------------------
|
|
463
|
+
(0, tool_1.defineTool)({
|
|
464
|
+
name: 'list_message_templates',
|
|
465
|
+
title: 'List message templates',
|
|
466
|
+
description: "List the agent's Message templates — operator-authored canned messages with {slot} placeholders, used as outreach greetings and playbook openings. Returns { data: AgentMessageTemplate[] }. Maps to GET /v1/orgs/{org}/agents/{agent}/message-templates.",
|
|
467
|
+
kind: 'read',
|
|
468
|
+
scope: 'agents:read',
|
|
469
|
+
roleFloor: 'viewer',
|
|
470
|
+
input: { agentId },
|
|
471
|
+
run: async ({ client }, { agentId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/message-templates`)),
|
|
472
|
+
}),
|
|
473
|
+
(0, tool_1.defineTool)({
|
|
474
|
+
name: 'get_message_template',
|
|
475
|
+
title: 'Get message template',
|
|
476
|
+
description: 'Read one Message template by id ({ id, name, description?, body, defaultOnMissingSlot? }). Maps to GET /v1/orgs/{org}/agents/{agent}/message-templates/{templateId}.',
|
|
477
|
+
kind: 'read',
|
|
478
|
+
scope: 'agents:read',
|
|
479
|
+
roleFloor: 'viewer',
|
|
480
|
+
input: { agentId, templateId: zod_1.z.string().min(1).describe('Message template id') },
|
|
481
|
+
run: async ({ client }, { agentId, templateId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/message-templates/${encodeURIComponent(templateId)}`)),
|
|
482
|
+
}),
|
|
483
|
+
(0, tool_1.defineTool)({
|
|
484
|
+
name: 'upsert_message_template',
|
|
485
|
+
title: 'Create or replace message template',
|
|
486
|
+
description: "Create a Message template with a stable id you choose, or replace an existing one wholesale (name and body required; omitted optional fields are cleared). The body's slots are validated on write. Returns the saved template. Maps to PUT /v1/orgs/{org}/agents/{agent}/message-templates/{templateId}.",
|
|
487
|
+
kind: 'write',
|
|
488
|
+
scope: 'agents:write',
|
|
489
|
+
roleFloor: 'editor',
|
|
490
|
+
input: {
|
|
491
|
+
agentId,
|
|
492
|
+
templateId: zod_1.z
|
|
493
|
+
.string()
|
|
494
|
+
.min(1)
|
|
495
|
+
.describe('Message template id (short slug, e.g. "outreach-greeting")'),
|
|
496
|
+
...messageTemplateFields,
|
|
497
|
+
},
|
|
498
|
+
run: async ({ client }, { agentId, templateId, ...body }) => client.put(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/message-templates/${encodeURIComponent(templateId)}`), body),
|
|
499
|
+
}),
|
|
500
|
+
(0, tool_1.defineTool)({
|
|
501
|
+
name: 'delete_message_template',
|
|
502
|
+
title: 'Delete message template',
|
|
503
|
+
description: 'Delete a Message template from the agent. Playbooks or outreach config referencing it will no longer resolve their opening/greeting. Irreversible. Maps to DELETE /v1/orgs/{org}/agents/{agent}/message-templates/{templateId}.',
|
|
504
|
+
kind: 'destructive',
|
|
505
|
+
scope: 'agents:write',
|
|
506
|
+
roleFloor: 'editor',
|
|
507
|
+
input: { agentId, templateId: zod_1.z.string().min(1).describe('Message template id') },
|
|
508
|
+
run: async ({ client }, { agentId, templateId }) => {
|
|
509
|
+
await client.delete(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/message-templates/${encodeURIComponent(templateId)}`));
|
|
510
|
+
return { ok: true, deleted: templateId };
|
|
511
|
+
},
|
|
512
|
+
}),
|
|
513
|
+
(0, tool_1.defineTool)({
|
|
514
|
+
name: 'preview_message_template',
|
|
515
|
+
title: 'Preview message template',
|
|
516
|
+
description: 'Render a Message template against a real Person of this agent and return what would be sent: { renderedText (null when block-send fired), missingSlots[{ path, action }], blocked }. Sends nothing. Maps to GET /v1/orgs/{org}/agents/{agent}/message-templates/{templateId}/preview?personId=….',
|
|
517
|
+
kind: 'read',
|
|
518
|
+
scope: 'agents:read',
|
|
519
|
+
roleFloor: 'viewer',
|
|
520
|
+
input: {
|
|
521
|
+
agentId,
|
|
522
|
+
templateId: zod_1.z.string().min(1).describe('Message template id'),
|
|
523
|
+
personId: zod_1.z
|
|
524
|
+
.string()
|
|
525
|
+
.min(1)
|
|
526
|
+
.describe('Id of a Person belonging to this agent to render the slots from'),
|
|
527
|
+
},
|
|
528
|
+
run: async ({ client }, { agentId, templateId, personId }) => client.get(await client.orgPath(`/agents/${encodeURIComponent(agentId)}/message-templates/${encodeURIComponent(templateId)}/preview`), { personId }),
|
|
529
|
+
}),
|
|
530
|
+
];
|
|
531
|
+
//# sourceMappingURL=definition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/tools/definition.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAAqC;AAErC;;;;;;;GAOG;AAEH,MAAM,OAAO,GAAG,OAAC;KACd,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,CAAC,yDAAyD,CAAC,CAAC;AAEvE,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,OAAe,EAAE,EAAE,CACtD,OAAC;KACE,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ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MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;YACjD,MAAM,MAAM,CAAC,MAAM,CACjB,MAAM,MAAM,CAAC,OAAO,CAClB,WAAW,kBAAkB,CAAC,OAAO,CAAC,sBAAsB,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAC7F,CACF,CAAC;YACF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;QAC3C,CAAC;KACF,CAAC;IACF,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,0BAA0B;QAChC,KAAK,EAAE,0BAA0B;QACjC,WAAW,EACT,kSAAkS;QACpS,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,aAAa;QACpB,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE;YACL,OAAO;YACP,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;YAC7D,QAAQ,EAAE,OAAC;iBACR,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,iEAAiE,CAAC;SAC/E;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,WAAW,kBAAkB,CAAC,OAAO,CAAC,sBAAsB,kBAAkB,CAAC,UAAU,CAAC,UAAU,CACrG,EACD,EAAE,QAAQ,EAAE,CACb;KACJ,CAAC;CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const docsTools: import("../tool").AnyTool[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.docsTools = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const tool_1 = require("../tool");
|
|
6
|
+
exports.docsTools = [
|
|
7
|
+
(0, tool_1.defineTool)({
|
|
8
|
+
name: 'search_docs',
|
|
9
|
+
title: 'Search Anychat docs',
|
|
10
|
+
description: 'Keyword search over the Anychat product documentation (docs.anychat.ai): how features behave, console guides, channel setup, API reference. Returns the best-matching pages with url, summary and a snippet. Follow up with read_doc to read a page. Use this for product questions instead of answering from memory.',
|
|
11
|
+
kind: 'read',
|
|
12
|
+
scope: '(none — public docs)',
|
|
13
|
+
roleFloor: 'viewer',
|
|
14
|
+
input: {
|
|
15
|
+
query: zod_1.z
|
|
16
|
+
.string()
|
|
17
|
+
.min(2)
|
|
18
|
+
.describe('Keywords, e.g. "whatsapp templates opt-in" or "playbook outreach exclusive"'),
|
|
19
|
+
limit: zod_1.z
|
|
20
|
+
.number()
|
|
21
|
+
.int()
|
|
22
|
+
.min(1)
|
|
23
|
+
.max(20)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Max results (default 5)'),
|
|
26
|
+
},
|
|
27
|
+
run: async ({ docs }, { query, limit }) => {
|
|
28
|
+
const hits = await docs.search(query, limit ?? 5);
|
|
29
|
+
return hits.length
|
|
30
|
+
? hits
|
|
31
|
+
: { hits: [], note: 'No matching pages. Try different keywords or list_docs.' };
|
|
32
|
+
},
|
|
33
|
+
}),
|
|
34
|
+
(0, tool_1.defineTool)({
|
|
35
|
+
name: 'list_docs',
|
|
36
|
+
title: 'List Anychat docs pages',
|
|
37
|
+
description: 'The full index of documentation pages (title, url, one-line summary). Cheap; useful to orient before read_doc.',
|
|
38
|
+
kind: 'read',
|
|
39
|
+
scope: '(none — public docs)',
|
|
40
|
+
roleFloor: 'viewer',
|
|
41
|
+
input: {},
|
|
42
|
+
run: async ({ docs }) => docs.pages(),
|
|
43
|
+
}),
|
|
44
|
+
(0, tool_1.defineTool)({
|
|
45
|
+
name: 'read_doc',
|
|
46
|
+
title: 'Read an Anychat docs page',
|
|
47
|
+
description: 'Return the full markdown of one documentation page, by url (as returned by search_docs / list_docs) or by page title.',
|
|
48
|
+
kind: 'read',
|
|
49
|
+
scope: '(none — public docs)',
|
|
50
|
+
roleFloor: 'viewer',
|
|
51
|
+
input: {
|
|
52
|
+
page: zod_1.z
|
|
53
|
+
.string()
|
|
54
|
+
.min(1)
|
|
55
|
+
.describe('Page url or title, e.g. "https://docs.anychat.ai/platform/capabilities/index.md" or "Capabilities"'),
|
|
56
|
+
},
|
|
57
|
+
run: async ({ docs }, { page }) => {
|
|
58
|
+
const doc = await docs.read(page);
|
|
59
|
+
if (!doc)
|
|
60
|
+
return {
|
|
61
|
+
error: `No docs page matches "${page}". Use list_docs or search_docs to find the url.`,
|
|
62
|
+
};
|
|
63
|
+
return `# ${doc.title}\nSource: ${doc.url}\n\n${doc.body ?? '(page body unavailable)'}`;
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
66
|
+
];
|
|
67
|
+
//# sourceMappingURL=docs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/tools/docs.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,kCAAqC;AAExB,QAAA,SAAS,GAAG;IACvB,IAAA,iBAAU,EAAC;QACT,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACT,uTAAuT;QACzT,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,sBAAsB;QAC7B,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE;YACL,KAAK,EAAE,OAAC;iBACL,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CACP,6EAA6E,CAC9E;YACH,KAAK,EAAE,OAAC;iBACL,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,EAAE,CAAC;iBACP,QAAQ,EAAE;iBACV,QAAQ,CAAC,yBAAyB,CAAC;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