@advertising-chat/mcp 0.2.1 → 0.17.3

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.
Files changed (85) hide show
  1. package/README.md +123 -18
  2. package/bin/auth.d.ts +46 -0
  3. package/bin/auth.js +186 -0
  4. package/bin/auth.js.map +1 -0
  5. package/bin/cli.js +79 -11
  6. package/bin/cli.js.map +1 -1
  7. package/bin/client.d.ts +70 -0
  8. package/bin/client.js +121 -0
  9. package/bin/client.js.map +1 -0
  10. package/bin/docs.d.ts +66 -0
  11. package/bin/docs.js +247 -0
  12. package/bin/docs.js.map +1 -0
  13. package/bin/flow/flowSchema.d.ts +298 -0
  14. package/bin/flow/flowSchema.js +234 -0
  15. package/bin/flow/flowSchema.js.map +1 -0
  16. package/bin/flow/flowValidator.d.ts +15 -0
  17. package/bin/flow/flowValidator.js +179 -0
  18. package/bin/flow/flowValidator.js.map +1 -0
  19. package/bin/flow/flowZod.d.ts +117 -0
  20. package/bin/flow/flowZod.js +130 -0
  21. package/bin/flow/flowZod.js.map +1 -0
  22. package/bin/format.d.ts +14 -0
  23. package/bin/format.js +50 -0
  24. package/bin/format.js.map +1 -0
  25. package/bin/index.d.ts +23 -1
  26. package/bin/index.js +65 -4
  27. package/bin/index.js.map +1 -1
  28. package/bin/routeInventory.d.ts +69 -0
  29. package/bin/routeInventory.js +201 -0
  30. package/bin/routeInventory.js.map +1 -0
  31. package/bin/serve.d.ts +24 -0
  32. package/bin/serve.js +196 -0
  33. package/bin/serve.js.map +1 -0
  34. package/bin/server.d.ts +24 -36
  35. package/bin/server.js +54 -182
  36. package/bin/server.js.map +1 -1
  37. package/bin/tool.d.ts +84 -0
  38. package/bin/tool.js +39 -0
  39. package/bin/tool.js.map +1 -0
  40. package/bin/tools/account.d.ts +2 -0
  41. package/bin/tools/account.js +47 -0
  42. package/bin/tools/account.js.map +1 -0
  43. package/bin/tools/attributes.d.ts +10 -0
  44. package/bin/tools/attributes.js +200 -0
  45. package/bin/tools/attributes.js.map +1 -0
  46. package/bin/tools/campaigns.d.ts +12 -0
  47. package/bin/tools/campaigns.js +230 -0
  48. package/bin/tools/campaigns.js.map +1 -0
  49. package/bin/tools/decisions.d.ts +14 -0
  50. package/bin/tools/decisions.js +309 -0
  51. package/bin/tools/decisions.js.map +1 -0
  52. package/bin/tools/docs.d.ts +3 -0
  53. package/bin/tools/docs.js +55 -0
  54. package/bin/tools/docs.js.map +1 -0
  55. package/bin/tools/index.d.ts +21 -0
  56. package/bin/tools/index.js +60 -0
  57. package/bin/tools/index.js.map +1 -0
  58. package/bin/tools/moments.d.ts +9 -0
  59. package/bin/tools/moments.js +143 -0
  60. package/bin/tools/moments.js.map +1 -0
  61. package/bin/tools/network.d.ts +5 -0
  62. package/bin/tools/network.js +99 -0
  63. package/bin/tools/network.js.map +1 -0
  64. package/bin/tools/offers.d.ts +11 -0
  65. package/bin/tools/offers.js +239 -0
  66. package/bin/tools/offers.js.map +1 -0
  67. package/bin/tools/results.d.ts +18 -0
  68. package/bin/tools/results.js +116 -0
  69. package/bin/tools/results.js.map +1 -0
  70. package/bin/tools/rules.d.ts +9 -0
  71. package/bin/tools/rules.js +318 -0
  72. package/bin/tools/rules.js.map +1 -0
  73. package/bin/tools/settings.d.ts +3 -0
  74. package/bin/tools/settings.js +54 -0
  75. package/bin/tools/settings.js.map +1 -0
  76. package/bin/tools/shared.d.ts +50 -0
  77. package/bin/tools/shared.js +171 -0
  78. package/bin/tools/shared.js.map +1 -0
  79. package/bin/tools/translation.d.ts +6 -0
  80. package/bin/tools/translation.js +139 -0
  81. package/bin/tools/translation.js.map +1 -0
  82. package/bin/version.d.ts +2 -0
  83. package/bin/version.js +6 -0
  84. package/bin/version.js.map +1 -0
  85. package/package.json +10 -7
@@ -0,0 +1,309 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decisionTools = exports.getStats = exports.findRequests = exports.explainDecision = exports.REASON_MEANINGS = exports.OUTCOME_MEANINGS = exports.STAGE_MEANINGS = void 0;
4
+ exports.explainTrace = explainTrace;
5
+ exports.journalRow = journalRow;
6
+ /**
7
+ * Decisions and results: why a request returned what it did, an agent's
8
+ * recent requests, and an entity's event counts.
9
+ *
10
+ * `explain_decision` calls the gateway's decision-trace route (ads reads the
11
+ * trace from BigQuery, filtered by the caller's org, so another org's message
12
+ * is a 404). The trace speaks the API's names (ad unit, line item, creative);
13
+ * the tool reshapes it into the console's (moment, audience, offer, customer details)
14
+ * and drops the scoring internals a model does not need to explain an
15
+ * outcome. `find_requests` reads the fetch journal (`/offer-manager/journal`:
16
+ * seven days, org scoped, newest first, at most 500 rows); every journaled
17
+ * request carries the message id `explain_decision` takes.
18
+ */
19
+ const zod_1 = require("zod");
20
+ const client_1 = require("../client");
21
+ const tool_1 = require("../tool");
22
+ const shared_1 = require("./shared");
23
+ /** Plain meanings of the pipeline stages, in pipeline order. */
24
+ exports.STAGE_MEANINGS = {
25
+ sourcing: "Collected the moment's offers that are on (their audiences) and its ads from the network",
26
+ eligibility: "Each audience's limit (maximum impressions or target fill rate)",
27
+ channel: "Each audience's channels against the request's channel (the channel parameter, or the format)",
28
+ schedule: "Each audience's schedule (dates, days, hours) in the org time zone",
29
+ ruleTargeting: "Each audience's Who sees it and Who doesn’t, per offer, against the attributes the agent sent and the customer's offer history",
30
+ formatEligibility: 'Whether the audience has an offer that can render in the requested format',
31
+ fallbackReflow: 'Fallback audiences considered because no other qualified',
32
+ frequencyCaps: "The workspace's offer limit (how many of the brand's offers one customer may see in a period; ads from the network are not limited), then each audience's How often (at most times serves per interval)",
33
+ semanticRelevance: 'Relevance of each offer to the conversation the agent sent',
34
+ appropriatenessGate: 'Whether any offer is appropriate in this moment of the conversation',
35
+ scoring: 'Priority, then a weighted draw within the top priority',
36
+ render: 'Rendering the chosen offer for the channel',
37
+ };
38
+ /** Plain meanings of the request outcomes (ads `ErrorResponse` reasons). */
39
+ exports.OUTCOME_MEANINGS = {
40
+ filled: 'An offer was returned.',
41
+ UnknownAdUnit: 'The moment code the agent sent does not exist.',
42
+ AdUnitDisabled: 'The moment is disabled.',
43
+ NoLineItemsConfigured: 'No offer that is on (published) is set to show at this moment, and ads from the network are off there.',
44
+ OfferLimitReached: "The customer had reached the workspace's offer limit, and no ad from the network qualified.",
45
+ NoEligibleLineItems: 'Nothing qualified: each audience was removed by a limit, its channels, its schedule, its audience or exclusions, or format.',
46
+ LineItemLimitExceeded: 'The customer had reached the How often cap of every qualifying audience.',
47
+ NoAdAvailable: 'The chosen audiences produced nothing to show: the network returned no ad, or no offer could render.',
48
+ 'appropriateness-gate': 'The conversation was judged a poor moment for any offer, so none was shown.',
49
+ UnsupportedFormat: 'The agent asked for a render format that is not supported.',
50
+ MissingRequiredParameter: 'The request was missing a required parameter.',
51
+ InvalidParameterValue: 'The request had an invalid parameter value.',
52
+ 'internal-error': 'The request failed with an internal error.',
53
+ };
54
+ const PRIORITY = {
55
+ 6: 'High',
56
+ 8: 'Default',
57
+ 10: 'Low',
58
+ 12: 'Network',
59
+ };
60
+ const STATUS = {
61
+ won: 'shown',
62
+ eliminated: 'removed',
63
+ 'lost-auction': 'chosen but could not serve an offer',
64
+ unused: 'qualified, another was chosen',
65
+ 'not-considered': 'fallback, not needed',
66
+ };
67
+ /** Plain meanings of the ads elimination reason codes. */
68
+ exports.REASON_MEANINGS = {
69
+ limit: "The audience's delivery limit",
70
+ channel: "The request's channel is not one of the audience's channels, or the request named none",
71
+ schedule: "Outside the audience's schedule",
72
+ audience: 'The customer does not match Who sees it',
73
+ exclusions: 'The customer matches Who doesn’t see it',
74
+ format: 'No offer of the audience can render in the requested format',
75
+ offer_limit: "The customer reached the workspace's offer limit (these are the brand's own offers)",
76
+ frequency: "The customer reached the audience's How often",
77
+ };
78
+ /** The trace record (ads `DecisionTraceRecord`) in Offer Manager terms. */
79
+ function explainTrace(record) {
80
+ const t = record.trace ?? {};
81
+ const req = t.request ?? {};
82
+ const attributes = {};
83
+ for (const kv of Array.isArray(req.targeting) ? req.targeting : []) {
84
+ if (kv && typeof kv.key === 'string')
85
+ attributes[kv.key] = kv.value;
86
+ }
87
+ const outcome = record.outcome ?? t.outcome ?? 'unknown';
88
+ const winner = t.winner ?? null;
89
+ const stages = Array.isArray(t.stages) ? t.stages : [];
90
+ return {
91
+ messageId: record.messageId,
92
+ at: record.timestamp ?? t.timestamp,
93
+ outcome,
94
+ meaning: exports.OUTCOME_MEANINGS[outcome] ?? 'No offer was returned.',
95
+ request: {
96
+ moment: {
97
+ code: req.adUnitCode ?? record.adUnitCode,
98
+ id: req.adUnit ?? record.adUnit,
99
+ },
100
+ agent: req.application ?? undefined,
101
+ subscriber: req.subscriber ?? record.subscriber ?? undefined,
102
+ format: req.format ?? record.requestFormat,
103
+ channel: req.channel
104
+ ? { channel: req.channel, from: req.channelSource }
105
+ : 'not known (no channel parameter, and the format names none)',
106
+ evaluatedAt: req.evaluatedAt ?? undefined,
107
+ timeZone: req.timeZone ?? undefined,
108
+ attributes,
109
+ conversationContext: t.context
110
+ ? {
111
+ sent: !!t.context.provided,
112
+ ignored: !!t.context.ignored || undefined,
113
+ truncated: !!t.context.truncated || undefined,
114
+ }
115
+ : undefined,
116
+ },
117
+ shown: winner
118
+ ? { audience: winner.lineItem, offer: winner.creatives?.[0] ?? null }
119
+ : null,
120
+ audiences: (Array.isArray(t.candidates) ? t.candidates : []).map((c) => ({
121
+ id: c.id,
122
+ name: c.name,
123
+ priority: PRIORITY[c.priority] ?? c.priority,
124
+ fallback: c.fallback || undefined,
125
+ result: STATUS[c.status] ?? c.status,
126
+ removedAt: c.eliminatedBy
127
+ ? `${c.eliminatedBy}: ${exports.STAGE_MEANINGS[c.eliminatedBy] ?? ''}`.trim()
128
+ : undefined,
129
+ reason: c.reason,
130
+ why: c.reasonCode
131
+ ? (exports.REASON_MEANINGS[c.reasonCode] ?? c.reasonCode)
132
+ : undefined,
133
+ decidingCondition: c.condition,
134
+ offersExcluded: Array.isArray(c.offersExcluded)
135
+ ? c.offersExcluded.map((o) => ({
136
+ offer: o.offer,
137
+ why: exports.REASON_MEANINGS[o.reasonCode] ?? o.reasonCode,
138
+ reason: o.reason,
139
+ }))
140
+ : undefined,
141
+ })),
142
+ stages: stages.map(s => ({
143
+ stage: s.name,
144
+ checks: exports.STAGE_MEANINGS[s.name],
145
+ status: s.status,
146
+ audiencesIn: s.candidatesIn,
147
+ audiencesOut: s.candidatesOut,
148
+ ...(s.name === 'appropriatenessGate' && s.detail
149
+ ? { detail: s.detail }
150
+ : {}),
151
+ })),
152
+ };
153
+ }
154
+ const NOT_FOUND_NOTE = 'No decision trace for this message in this org. Possible reasons: the id is mistyped or belongs to another org; the request was a test (test requests are not traced; their response lists the disqualifications instead); the request was made in the last minute and the trace has not arrived yet; or it is older than 90 days.';
155
+ exports.explainDecision = (0, tool_1.defineTool)({
156
+ name: 'explain_decision',
157
+ title: 'Explain a decision',
158
+ description: 'Why an offer request returned the offer it did, or none: the moment and attributes the agent sent, every audience considered (a rule; the console calls it the offer’s audience, or for an agent’s ads from the network its network setting) with whether it was shown or why it was removed, and the pipeline stages. Takes either the message id of one request (`messageId` in the fetch response, or the X-Adchat-Message-Id header of an empty one; starts with "direqt-"), which the agent logs, find_requests returns, and the request log on the agent’s Connect tab in the console shows; or a customer id (`subscriber`, the id the agent sends) for that customer’s latest requests, at most 10, newest first. Live requests only, kept 90 days. Maps to GET /system/offer-manager/decision-trace/{messageId} and GET /system/offer-manager/decision-trace?subscriber={subscriber}.',
159
+ kind: 'read',
160
+ roleFloor: 'viewer',
161
+ input: {
162
+ messageId: zod_1.z
163
+ .string()
164
+ .min(1)
165
+ .optional()
166
+ .describe('The fetch response messageId, for example "direqt-5f0c…"'),
167
+ subscriber: zod_1.z
168
+ .string()
169
+ .min(1)
170
+ .optional()
171
+ .describe('A customer id the agent sends, for that customer’s latest requests. Pass this or messageId.'),
172
+ },
173
+ async run({ client }, { messageId, subscriber }) {
174
+ const customer = subscriber?.trim();
175
+ if (!messageId?.trim() && customer) {
176
+ const { traces } = await client.get(`${shared_1.OM}/decision-trace?subscriber=${(0, shared_1.enc)(customer)}`);
177
+ const list = Array.isArray(traces) ? traces : [];
178
+ return list.length
179
+ ? { subscriber: customer, requests: list.map(explainTrace) }
180
+ : {
181
+ found: false,
182
+ subscriber: customer,
183
+ note: 'No decision traces for this customer in this org in the last 90 days. The id may be mistyped, the agent may send a different id for them, or their requests were tests (not traced).',
184
+ };
185
+ }
186
+ const id = messageId?.trim() ?? '';
187
+ if (!id.startsWith('direqt-'))
188
+ return {
189
+ found: false,
190
+ messageId: id,
191
+ note: 'A message id starts with "direqt-". Ask the user for the messageId from the fetch response or the request log, or for the customer id the agent sends.',
192
+ };
193
+ try {
194
+ const record = await client.get(`${shared_1.OM}/decision-trace/${(0, shared_1.enc)(id)}`);
195
+ return explainTrace(record);
196
+ }
197
+ catch (err) {
198
+ if (err instanceof client_1.ApiError && err.status === 404)
199
+ return { found: false, messageId: id, note: NOT_FOUND_NOTE };
200
+ throw err;
201
+ }
202
+ },
203
+ });
204
+ const HOUR_MS = 60 * 60 * 1000;
205
+ function journalRow(j) {
206
+ const attributes = {};
207
+ for (const kv of Array.isArray(j.requestTargeting)
208
+ ? j.requestTargeting
209
+ : []) {
210
+ if (kv && typeof kv.key === 'string')
211
+ attributes[kv.key] = kv.value;
212
+ }
213
+ const reason = j.errorResponse?.reason;
214
+ const offer = Array.isArray(j.creatives) ? j.creatives[0] : undefined;
215
+ return {
216
+ at: j.timestamp,
217
+ agent: typeof j.application === 'string' ? j.application : undefined,
218
+ moment: j.requestAdUnit,
219
+ subscriber: j.requestSubscriberId || undefined,
220
+ attributes,
221
+ result: reason
222
+ ? { offer: null, reason, meaning: exports.OUTCOME_MEANINGS[reason] }
223
+ : {
224
+ audience: j.lineItem?.name,
225
+ offer: offer?.name ?? null,
226
+ },
227
+ messageId: j.messageId || undefined,
228
+ };
229
+ }
230
+ exports.findRequests = (0, tool_1.defineTool)({
231
+ name: 'find_requests',
232
+ title: 'Find offer requests',
233
+ description: 'Recent live offer requests from the fetch journal (kept 7 days), newest first: when, the agent, the moment code, the subscriber id, the attributes the agent sent, the result (the audience and offer shown, or the reason none was), and the messageId to pass to explain_decision. Filter by `application` (agent), `subscriber` (the customer id the agent sends), and `moment` (a moment code from list_moments). Maps to GET /system/offer-manager/journal.',
234
+ kind: 'read',
235
+ roleFloor: 'viewer',
236
+ input: {
237
+ application: shared_1.application.optional(),
238
+ subscriber: zod_1.z
239
+ .string()
240
+ .optional()
241
+ .describe('Subscriber id the agent sends for the customer'),
242
+ moment: zod_1.z.string().optional().describe('Moment code, from list_moments'),
243
+ hours: zod_1.z
244
+ .number()
245
+ .int()
246
+ .min(1)
247
+ .max(168)
248
+ .optional()
249
+ .describe('How far back to look, in hours. Default 24, at most 168'),
250
+ limit: zod_1.z
251
+ .number()
252
+ .int()
253
+ .min(1)
254
+ .max(100)
255
+ .optional()
256
+ .describe('Most rows to return. Default 20'),
257
+ },
258
+ async run({ client }, { application, subscriber, moment, hours, limit }) {
259
+ const now = Date.now();
260
+ const body = await client.get(`${shared_1.OM}/journal`, {
261
+ applications: application,
262
+ start: now - (hours ?? 24) * HOUR_MS,
263
+ end: now + HOUR_MS,
264
+ operations: 'Fetch',
265
+ subscribers: subscriber?.trim() || undefined,
266
+ moments: moment?.trim() || undefined,
267
+ });
268
+ const rows = Array.isArray(body) ? body : [];
269
+ const max = limit ?? 20;
270
+ return {
271
+ requests: rows.slice(0, max).map(journalRow),
272
+ total: rows.length,
273
+ more: rows.length > max || undefined,
274
+ };
275
+ },
276
+ });
277
+ const ENTITY = {
278
+ moment: 'adUnit',
279
+ rule: 'lineItem',
280
+ offer: 'creative',
281
+ };
282
+ exports.getStats = (0, tool_1.defineTool)({
283
+ name: 'get_stats',
284
+ title: 'Event counts for a moment, rule, or offer',
285
+ description: "Event counts for one moment, rule, or offer. `stat: 'sum'` totals every event type (fetches, impressions, clicks, conversions, responses), all time or over the last `hours`; `stat: 'fetch'` is per-minute requests over the last hour, a quick check that the agent is sending them. Maps to GET /system/offer-manager/event-stats/sum/{entity}/{id} and GET /system/offer-manager/event-stats/fetch/{entity}/{id}.",
286
+ kind: 'read',
287
+ roleFloor: 'viewer',
288
+ input: {
289
+ entity: zod_1.z.enum(['moment', 'rule', 'offer']),
290
+ id: (0, shared_1.id)('moment, rule, or offer'),
291
+ stat: zod_1.z.enum(['sum', 'fetch']),
292
+ hours: zod_1.z
293
+ .number()
294
+ .int()
295
+ .min(1)
296
+ .max(2160)
297
+ .optional()
298
+ .describe("For stat 'sum': the last this many hours. Default all time."),
299
+ },
300
+ async run({ client }, args) {
301
+ return client.get(`${shared_1.OM}/event-stats/${args.stat}/${ENTITY[args.entity]}/${(0, shared_1.enc)(args.id)}`, {
302
+ period: args.stat === 'sum' && args.hours
303
+ ? `last${args.hours}hours`
304
+ : undefined,
305
+ });
306
+ },
307
+ });
308
+ exports.decisionTools = [exports.findRequests, exports.explainDecision, exports.getStats];
309
+ //# sourceMappingURL=decisions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decisions.js","sourceRoot":"","sources":["../../src/tools/decisions.ts"],"names":[],"mappings":";;;AAiGA,oCA4EC;AA6DD,gCAuBC;AAjQD;;;;;;;;;;;;GAYG;AACH,6BAAwB;AACxB,sCAAqC;AACrC,kCAAqC;AACrC,qCAAyD;AAEzD,gEAAgE;AACnD,QAAA,cAAc,GAA2B;IACpD,QAAQ,EACN,0FAA0F;IAC5F,WAAW,EACT,iEAAiE;IACnE,OAAO,EACL,+FAA+F;IACjG,QAAQ,EACN,oEAAoE;IACtE,aAAa,EACX,gIAAgI;IAClI,iBAAiB,EACf,2EAA2E;IAC7E,cAAc,EAAE,0DAA0D;IAC1E,aAAa,EACX,yMAAyM;IAC3M,iBAAiB,EACf,4DAA4D;IAC9D,mBAAmB,EACjB,qEAAqE;IACvE,OAAO,EAAE,wDAAwD;IACjE,MAAM,EAAE,4CAA4C;CACrD,CAAC;AAEF,4EAA4E;AAC/D,QAAA,gBAAgB,GA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B,KAAK,EAAE;QACL,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC3C,EAAE,EAAE,IAAA,WAAE,EAAC,wBAAwB,CAAC;QAChC,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC9B,KAAK,EAAE,OAAC;aACL,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,IAAI,CAAC;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,6DAA6D,CAAC;KAC3E;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI;QACxB,OAAO,MAAM,CAAC,GAAG,CACf,GAAG,WAAE,gBAAgB,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAA,YAAG,EAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EACvE;YACE,MAAM,EACJ,IAAI,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK;gBAC/B,CAAC,CAAC,OAAO,IAAI,CAAC,KAAK,OAAO;gBAC1B,CAAC,CAAC,SAAS;SAChB,CACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,CAAC,oBAAY,EAAE,uBAAe,EAAE,gBAAQ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const searchDocs: import("../tool").AnyTool;
2
+ export declare const readDoc: import("../tool").AnyTool;
3
+ export declare const docsTools: import("../tool").AnyTool[];
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.docsTools = exports.readDoc = exports.searchDocs = void 0;
4
+ /**
5
+ * Docs tools: `search_docs` and `read_doc` over the public docs
6
+ * (docs.advertising.chat), ported from AnyChat. They read public pages and
7
+ * make no management API call.
8
+ */
9
+ const zod_1 = require("zod");
10
+ const tool_1 = require("../tool");
11
+ exports.searchDocs = (0, tool_1.defineTool)({
12
+ name: 'search_docs',
13
+ title: 'Search the docs',
14
+ description: 'Keyword search over the Advertising.chat docs (docs.advertising.chat): how moments, offers, rules, conditions, How often and the offer limit, and fallback rules behave, console procedures, how agents request offers, and the API and rule reference. Returns matching pages with url, summary, and a snippet; follow up with read_doc. Use it for product questions instead of answering from memory.',
15
+ kind: 'read',
16
+ roleFloor: 'viewer',
17
+ input: {
18
+ query: zod_1.z
19
+ .string()
20
+ .min(2)
21
+ .describe('Keywords, for example "fallback rule offer limit"'),
22
+ limit: zod_1.z.number().int().min(1).max(20).optional().describe('Default 5'),
23
+ },
24
+ async run({ docs }, { query, limit }) {
25
+ const hits = await docs.search(query, limit ?? 5);
26
+ return hits.length
27
+ ? hits
28
+ : { hits: [], note: 'No matching pages. Try different keywords.' };
29
+ },
30
+ });
31
+ exports.readDoc = (0, tool_1.defineTool)({
32
+ name: 'read_doc',
33
+ title: 'Read a docs page',
34
+ description: 'The full markdown of one Advertising.chat docs page, by url (from search_docs) or by title, for example "Rule reference".',
35
+ kind: 'read',
36
+ roleFloor: 'viewer',
37
+ input: {
38
+ page: zod_1.z
39
+ .string()
40
+ .min(1)
41
+ .describe('Page url or title, for example "Moments, offers, and rules"'),
42
+ },
43
+ async run({ docs }, { page }) {
44
+ const doc = await docs.read(page);
45
+ if (!doc)
46
+ return {
47
+ error: `No docs page matches "${page}". Use search_docs to find the url.`,
48
+ };
49
+ // llms-full.txt bodies start with the page's own `# Title` line.
50
+ const body = doc.body?.replace(/^# [^\n]*\n+/, '');
51
+ return `# ${doc.title}\nSource: ${doc.url}\n\n${body ?? '(page body unavailable)'}`;
52
+ },
53
+ });
54
+ exports.docsTools = [exports.searchDocs, exports.readDoc];
55
+ //# sourceMappingURL=docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/tools/docs.ts"],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AAE;QAC1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,GAAG;YACN,OAAO;gBACL,KAAK,EAAE,yBAAyB,IAAI,qCAAqC;aAC1E,CAAC;QACJ,iEAAiE;QACjE,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;QACnD,OAAO,KAAK,GAAG,CAAC,KAAK,aAAa,GAAG,CAAC,GAAG,OAAO,IAAI,IAAI,yBAAyB,EAAE,CAAC;IACtF,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,SAAS,GAAG,CAAC,kBAAU,EAAE,eAAO,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The management tool table: every tool once, in a stable order (the
3
+ * order is the tool table hosts and the copilot send the model, so keep it
4
+ * stable for prompt caching).
5
+ */
6
+ import type { AnyTool } from '../tool';
7
+ export declare const allTools: AnyTool[];
8
+ export declare const toolsByName: ReadonlyMap<string, AnyTool>;
9
+ export * from './account';
10
+ export * from './attributes';
11
+ export * from './campaigns';
12
+ export * from './decisions';
13
+ export * from './docs';
14
+ export * from './moments';
15
+ export * from './network';
16
+ export * from './offers';
17
+ export * from './results';
18
+ export * from './rules';
19
+ export * from './settings';
20
+ export * from './translation';
21
+ export { ToolInputError } from './shared';
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ToolInputError = exports.toolsByName = exports.allTools = void 0;
18
+ const account_1 = require("./account");
19
+ const attributes_1 = require("./attributes");
20
+ const campaigns_1 = require("./campaigns");
21
+ const decisions_1 = require("./decisions");
22
+ const docs_1 = require("./docs");
23
+ const moments_1 = require("./moments");
24
+ const network_1 = require("./network");
25
+ const offers_1 = require("./offers");
26
+ const results_1 = require("./results");
27
+ const rules_1 = require("./rules");
28
+ const settings_1 = require("./settings");
29
+ const translation_1 = require("./translation");
30
+ exports.allTools = [
31
+ account_1.whoami,
32
+ account_1.listApplications,
33
+ ...moments_1.momentTools,
34
+ ...attributes_1.attributeTools,
35
+ ...translation_1.translationTools,
36
+ ...rules_1.ruleTools,
37
+ ...offers_1.offerTools,
38
+ ...results_1.resultsTools,
39
+ ...network_1.networkTools,
40
+ ...campaigns_1.campaignTools,
41
+ ...settings_1.settingsTools,
42
+ ...decisions_1.decisionTools,
43
+ ...docs_1.docsTools,
44
+ ];
45
+ exports.toolsByName = new Map(exports.allTools.map(t => [t.name, t]));
46
+ __exportStar(require("./account"), exports);
47
+ __exportStar(require("./attributes"), exports);
48
+ __exportStar(require("./campaigns"), exports);
49
+ __exportStar(require("./decisions"), exports);
50
+ __exportStar(require("./docs"), exports);
51
+ __exportStar(require("./moments"), exports);
52
+ __exportStar(require("./network"), exports);
53
+ __exportStar(require("./offers"), exports);
54
+ __exportStar(require("./results"), exports);
55
+ __exportStar(require("./rules"), exports);
56
+ __exportStar(require("./settings"), exports);
57
+ __exportStar(require("./translation"), exports);
58
+ var shared_1 = require("./shared");
59
+ Object.defineProperty(exports, "ToolInputError", { enumerable: true, get: function () { return shared_1.ToolInputError; } });
60
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMA,uCAAqD;AACrD,6CAA8C;AAC9C,2CAA4C;AAC5C,2CAA4C;AAC5C,iCAAmC;AACnC,uCAAwC;AACxC,uCAAyC;AACzC,qCAAsC;AACtC,uCAAyC;AACzC,mCAAoC;AACpC,yCAA2C;AAC3C,+CAAiD;AAEpC,QAAA,QAAQ,GAAc;IACjC,gBAAM;IACN,0BAAgB;IAChB,GAAG,qBAAW;IACd,GAAG,2BAAc;IACjB,GAAG,8BAAgB;IACnB,GAAG,iBAAS;IACZ,GAAG,mBAAU;IACb,GAAG,sBAAY;IACf,GAAG,sBAAY;IACf,GAAG,yBAAa;IAChB,GAAG,wBAAa;IAChB,GAAG,yBAAa;IAChB,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,4CAA0B;AAC1B,+CAA6B;AAC7B,8CAA4B;AAC5B,8CAA4B;AAC5B,yCAAuB;AACvB,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,6CAA2B;AAC3B,gDAA8B;AAC9B,mCAA0C;AAAjC,wGAAA,cAAc,OAAA"}
@@ -0,0 +1,9 @@
1
+ import { Doc } from './shared';
2
+ /** A moment as the list shows it. */
3
+ export declare function momentRow(m: Doc): Doc;
4
+ export declare const listMoments: import("../tool").AnyTool;
5
+ export declare const getMoment: import("../tool").AnyTool;
6
+ export declare const createMoment: import("../tool").AnyTool;
7
+ export declare const updateMoment: import("../tool").AnyTool;
8
+ export declare const deleteMoment: import("../tool").AnyTool;
9
+ export declare const momentTools: import("../tool").AnyTool[];
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.momentTools = exports.deleteMoment = exports.updateMoment = exports.createMoment = exports.getMoment = exports.listMoments = void 0;
4
+ exports.momentRow = momentRow;
5
+ /**
6
+ * Moments (the API's ad units): named points in an agent's conversation
7
+ * where an offer may appear. Each belongs to one agent.
8
+ */
9
+ const offer_rules_1 = require("@advertising-chat/offer-rules");
10
+ const zod_1 = require("zod");
11
+ const tool_1 = require("../tool");
12
+ const shared_1 = require("./shared");
13
+ const code = zod_1.z
14
+ .string()
15
+ .min(1)
16
+ .max(100)
17
+ .describe('What the agent sends on each request to name this moment, e.g. `billing-answered`. Unique within the agent.');
18
+ const description = zod_1.z
19
+ .string()
20
+ .max(1000)
21
+ .describe('What the moment means in the conversation, in a sentence. Rules and the Assistant rely on it.');
22
+ const source = zod_1.z
23
+ .enum(offer_rules_1.MOMENT_SOURCES)
24
+ .describe('Who reports the moment: `agent` (the default) or `context_layer`.');
25
+ /** The words for a moment's fields, for approval sentences. */
26
+ const MOMENT_WORDS = {
27
+ name: 'name',
28
+ code: 'code',
29
+ description: 'description',
30
+ source: 'source',
31
+ };
32
+ /** A moment as the list shows it. */
33
+ function momentRow(m) {
34
+ return {
35
+ id: (0, shared_1.str)(m._id) ?? (0, shared_1.str)(m.id),
36
+ code: (0, shared_1.str)(m.code),
37
+ name: m.name,
38
+ description: (0, shared_1.str)(m.description),
39
+ enabled: m.enabled,
40
+ application: (0, shared_1.refId)(m.application),
41
+ };
42
+ }
43
+ exports.listMoments = (0, tool_1.defineTool)({
44
+ name: 'list_moments',
45
+ title: 'List moments',
46
+ description: 'The org’s moments: the points in an agent’s conversation where an offer may appear (the API calls them ad units). Returns id, code (what the agent sends), name, description, enabled, and the agent (application) each belongs to. Every moment belongs to one agent, and codes are unique within an agent. Pass `application` to list one agent’s moments. Maps to GET /system/offer-manager/adunit.',
47
+ kind: 'read',
48
+ roleFloor: 'viewer',
49
+ input: {
50
+ application: shared_1.application.optional(),
51
+ ...shared_1.listShape,
52
+ },
53
+ async run({ client }, args) {
54
+ const body = await client.get(`${shared_1.OM}/adunit`, (0, shared_1.defined)(args));
55
+ return (0, shared_1.rows)(body).map(momentRow);
56
+ },
57
+ });
58
+ exports.getMoment = (0, tool_1.defineTool)({
59
+ name: 'get_moment',
60
+ title: 'Get a moment',
61
+ description: 'One moment with every field. Maps to GET /system/offer-manager/adunit/{id}.',
62
+ kind: 'read',
63
+ roleFloor: 'viewer',
64
+ input: { id: (0, shared_1.id)('moment') },
65
+ async run({ client }, { id: momentId }) {
66
+ return client.get(`${shared_1.OM}/adunit/${(0, shared_1.enc)(momentId)}`);
67
+ },
68
+ });
69
+ exports.createMoment = (0, tool_1.defineTool)({
70
+ name: 'create_moment',
71
+ title: 'Create a moment',
72
+ description: 'Create a moment for one agent. The agent must then send its `code` on requests at that point in the conversation; until it does, no offer appears there. A moment serves nothing until a rule or the agent’s network switch includes it. `application` is fixed once created. Maps to POST /system/offer-manager/adunit.',
73
+ kind: 'write',
74
+ roleFloor: 'editor',
75
+ input: {
76
+ application: shared_1.application,
77
+ name: zod_1.z.string().min(1).max(200).describe('Display name.'),
78
+ code,
79
+ description: description.optional(),
80
+ source: source.optional(),
81
+ enabled: zod_1.z.boolean().optional().describe('Default true.'),
82
+ },
83
+ approval: args => `Add the moment ${(0, shared_1.quoted)(args.name, '')} to this agent. The agent reports it by sending the code “${args.code}”; offers or ads from the network appear there only once an offer’s audience or the agent’s Ads from the network includes it.`,
84
+ async run({ client }, args) {
85
+ return client.post(`${shared_1.OM}/adunit`, (0, shared_1.defined)(args));
86
+ },
87
+ });
88
+ exports.updateMoment = (0, tool_1.defineTool)({
89
+ name: 'update_moment',
90
+ title: 'Update a moment',
91
+ description: 'Change a moment. Only the fields given change. Changing `code` breaks the agent’s requests until the agent sends the new code; disabling a moment stops every offer at it at once. Maps to PATCH /system/offer-manager/adunit/{id}.',
92
+ kind: 'write',
93
+ roleFloor: 'editor',
94
+ reader: 'get_moment',
95
+ input: {
96
+ id: (0, shared_1.id)('moment'),
97
+ application: shared_1.applicationOfUpdate,
98
+ name: zod_1.z.string().min(1).max(200).optional(),
99
+ code: code.optional(),
100
+ description: description.optional(),
101
+ source: source.optional(),
102
+ enabled: zod_1.z.boolean().optional(),
103
+ },
104
+ approval: (args, before) => {
105
+ const name = (0, shared_1.named)('moment', before?.name ?? args.name);
106
+ const rest = { ...args, enabled: undefined };
107
+ const what = (0, shared_1.changedWords)(rest, MOMENT_WORDS);
108
+ const parts = [];
109
+ if (args.enabled === false)
110
+ parts.push(`Turn off ${name}: no offer or network ad appears there until it is turned back on.`);
111
+ if (args.enabled === true)
112
+ parts.push(`Turn on ${name}.`);
113
+ if (what.length)
114
+ parts.push(`Change the ${(0, shared_1.listWords)(what)} of ${name}.${args.code !== undefined && args.code !== before?.code
115
+ ? ' The agent must send the new code, or no offer appears there.'
116
+ : ''}`);
117
+ return parts.join(' ') || `Change ${name}.`;
118
+ },
119
+ async run({ client }, args) {
120
+ return client.patch(`${shared_1.OM}/adunit/${(0, shared_1.enc)(args.id)}`, (0, shared_1.patchBody)(args, ['application']));
121
+ },
122
+ });
123
+ exports.deleteMoment = (0, tool_1.defineTool)({
124
+ name: 'delete_moment',
125
+ title: 'Delete a moment',
126
+ description: 'Permanently delete a moment. Refused (409) while a rule still includes it; the error names those rules. Requests the agent still sends with its code then get no offer. Maps to DELETE /system/offer-manager/adunit/{id}.',
127
+ kind: 'destructive',
128
+ roleFloor: 'editor',
129
+ reader: 'get_moment',
130
+ input: { id: (0, shared_1.id)('moment') },
131
+ approval: (_args, before) => `Delete ${(0, shared_1.named)('moment', before?.name)} for good. Requests the agent still sends for it get no offer.`,
132
+ async run({ client }, { id: momentId }) {
133
+ return client.delete(`${shared_1.OM}/adunit/${(0, shared_1.enc)(momentId)}`);
134
+ },
135
+ });
136
+ exports.momentTools = [
137
+ exports.listMoments,
138
+ exports.getMoment,
139
+ exports.createMoment,
140
+ exports.updateMoment,
141
+ exports.deleteMoment,
142
+ ];
143
+ //# sourceMappingURL=moments.js.map
@@ -0,0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