@advertising-chat/mcp 0.17.4 → 0.18.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.
Files changed (56) hide show
  1. package/README.md +24 -36
  2. package/bin/cli.js +1 -1
  3. package/bin/client.d.ts +5 -2
  4. package/bin/client.js.map +1 -1
  5. package/bin/index.d.ts +3 -4
  6. package/bin/index.js +3 -4
  7. package/bin/index.js.map +1 -1
  8. package/bin/routeInventory.d.ts +8 -19
  9. package/bin/routeInventory.js +2 -61
  10. package/bin/routeInventory.js.map +1 -1
  11. package/bin/serve.js +9 -9
  12. package/bin/serve.js.map +1 -1
  13. package/bin/server.d.ts +2 -2
  14. package/bin/server.js +8 -9
  15. package/bin/server.js.map +1 -1
  16. package/bin/tool.d.ts +8 -11
  17. package/bin/tool.js +0 -1
  18. package/bin/tool.js.map +1 -1
  19. package/bin/tools/account.js +2 -2
  20. package/bin/tools/account.js.map +1 -1
  21. package/bin/tools/decisions.d.ts +8 -1
  22. package/bin/tools/decisions.js +78 -57
  23. package/bin/tools/decisions.js.map +1 -1
  24. package/bin/tools/docs.js +4 -4
  25. package/bin/tools/docs.js.map +1 -1
  26. package/bin/tools/index.d.ts +1 -6
  27. package/bin/tools/index.js +0 -15
  28. package/bin/tools/index.js.map +1 -1
  29. package/bin/tools/moments.js +27 -25
  30. package/bin/tools/moments.js.map +1 -1
  31. package/bin/tools/network.js +8 -8
  32. package/bin/tools/network.js.map +1 -1
  33. package/bin/tools/results.d.ts +0 -1
  34. package/bin/tools/results.js +7 -23
  35. package/bin/tools/results.js.map +1 -1
  36. package/bin/tools/shared.d.ts +5 -7
  37. package/bin/tools/shared.js +9 -34
  38. package/bin/tools/shared.js.map +1 -1
  39. package/bin/version.d.ts +1 -1
  40. package/bin/version.js +1 -1
  41. package/package.json +9 -10
  42. package/bin/tools/attributes.d.ts +0 -10
  43. package/bin/tools/attributes.js +0 -200
  44. package/bin/tools/attributes.js.map +0 -1
  45. package/bin/tools/offers.d.ts +0 -11
  46. package/bin/tools/offers.js +0 -239
  47. package/bin/tools/offers.js.map +0 -1
  48. package/bin/tools/rules.d.ts +0 -9
  49. package/bin/tools/rules.js +0 -318
  50. package/bin/tools/rules.js.map +0 -1
  51. package/bin/tools/settings.d.ts +0 -3
  52. package/bin/tools/settings.js +0 -54
  53. package/bin/tools/settings.js.map +0 -1
  54. package/bin/tools/translation.d.ts +0 -6
  55. package/bin/tools/translation.js +0 -139
  56. package/bin/tools/translation.js.map +0 -1
@@ -5,7 +5,14 @@ export declare const STAGE_MEANINGS: Record<string, string>;
5
5
  export declare const OUTCOME_MEANINGS: Record<string, string>;
6
6
  /** Plain meanings of the ads elimination reason codes. */
7
7
  export declare const REASON_MEANINGS: Record<string, string>;
8
- /** The trace record (ads `DecisionTraceRecord`) in Offer Manager terms. */
8
+ /**
9
+ * Whether the trace's winner came from the network: `source: 'network'` is
10
+ * its new wire name, `orderType: 'exchange'` the one ads emits today (D-51).
11
+ */
12
+ export declare function fromNetwork(winner: Doc | null | undefined): boolean;
13
+ /** Fetch ids start `direqt-` today and `ad-` after ads switches (D-42). */
14
+ export declare function isMessageId(id: string): boolean;
15
+ /** The trace record (ads `DecisionTraceRecord`) in the console's terms. */
9
16
  export declare function explainTrace(record: Doc): Doc;
10
17
  export declare const explainDecision: import("../tool").AnyTool;
11
18
  export declare function journalRow(j: Doc): Doc;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.decisionTools = exports.getStats = exports.findRequests = exports.explainDecision = exports.REASON_MEANINGS = exports.OUTCOME_MEANINGS = exports.STAGE_MEANINGS = void 0;
4
+ exports.fromNetwork = fromNetwork;
5
+ exports.isMessageId = isMessageId;
4
6
  exports.explainTrace = explainTrace;
5
7
  exports.journalRow = journalRow;
6
8
  /**
@@ -10,7 +12,7 @@ exports.journalRow = journalRow;
10
12
  * `explain_decision` calls the gateway's decision-trace route (ads reads the
11
13
  * trace from BigQuery, filtered by the caller's org, so another org's message
12
14
  * 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)
15
+ * the tool reshapes it into the console's (placement, candidate, ad)
14
16
  * and drops the scoring internals a model does not need to explain an
15
17
  * outcome. `find_requests` reads the fetch journal (`/offer-manager/journal`:
16
18
  * seven days, org scoped, newest first, at most 500 rows); every journaled
@@ -22,30 +24,32 @@ const tool_1 = require("../tool");
22
24
  const shared_1 = require("./shared");
23
25
  /** Plain meanings of the pipeline stages, in pipeline order. */
24
26
  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',
27
+ sourcing: "Collected the ads from the network that may appear at the placement (the agent's network setting)",
28
+ eligibility: "Each candidate's delivery limit (maximum impressions or target fill rate)",
29
+ channel: "Each candidate's channels against the request's channel (the channel parameter, or the format)",
30
+ schedule: "Each candidate's schedule (dates, days, hours) in the org time zone",
31
+ ruleTargeting: "Each candidate's targeting and exclusions, per ad, against the attributes the agent sent and the person's history",
32
+ formatEligibility: 'Whether the candidate has an ad that can render in the requested format',
33
+ fallbackReflow: 'Fallback candidates considered because no other qualified',
34
+ frequencyCaps: "Each candidate's frequency cap (at most so many serves to one person per interval)",
35
+ semanticRelevance: 'Relevance of each ad to the conversation the agent sent',
36
+ appropriatenessGate: 'Whether any ad is appropriate at this point in the conversation',
35
37
  scoring: 'Priority, then a weighted draw within the top priority',
36
- render: 'Rendering the chosen offer for the channel',
38
+ render: 'Rendering the chosen ad for the channel',
37
39
  };
38
40
  /** Plain meanings of the request outcomes (ads `ErrorResponse` reasons). */
39
41
  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.',
42
+ filled: 'An ad was returned.',
43
+ UnknownAdUnit: 'The placement code the agent sent does not exist.',
44
+ AdUnitDisabled: 'The placement is disabled.',
45
+ NoLineItemsConfigured: 'Ads from the network are off at this placement.',
46
+ // Retired (D-51): its per-workspace limit left Advertising.chat and
47
+ // nothing returns it; kept so older traces still read.
48
+ OfferLimitReached: 'A retired outcome: the person had reached a per-workspace limit that no longer exists, and no ad from the network qualified.',
49
+ NoEligibleLineItems: 'Nothing qualified: each candidate was removed by a limit, its channels, its schedule, its targeting or exclusions, or format.',
50
+ LineItemLimitExceeded: 'The person had reached the frequency cap of every qualifying candidate.',
51
+ NoAdAvailable: 'The candidates produced nothing to show: the network returned no ad, or no ad could render.',
52
+ 'appropriateness-gate': 'The conversation was judged a poor point for an ad, so none was shown.',
49
53
  UnsupportedFormat: 'The agent asked for a render format that is not supported.',
50
54
  MissingRequiredParameter: 'The request was missing a required parameter.',
51
55
  InvalidParameterValue: 'The request had an invalid parameter value.',
@@ -60,22 +64,34 @@ const PRIORITY = {
60
64
  const STATUS = {
61
65
  won: 'shown',
62
66
  eliminated: 'removed',
63
- 'lost-auction': 'chosen but could not serve an offer',
67
+ 'lost-auction': 'chosen but could not serve an ad',
64
68
  unused: 'qualified, another was chosen',
65
69
  'not-considered': 'fallback, not needed',
66
70
  };
67
71
  /** Plain meanings of the ads elimination reason codes. */
68
72
  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",
73
+ limit: "The candidate's delivery limit",
74
+ channel: "The request's channel is not one of the candidate's channels, or the request named none",
75
+ schedule: "Outside the candidate's schedule",
76
+ audience: "The person does not match the candidate's targeting",
77
+ exclusions: "The person matches one of the candidate's exclusions",
78
+ format: 'No ad of the candidate can render in the requested format',
79
+ offer_limit: 'A retired per-workspace limit (no request is removed by it any more)',
80
+ frequency: "The person reached the candidate's frequency cap",
77
81
  };
78
- /** The trace record (ads `DecisionTraceRecord`) in Offer Manager terms. */
82
+ /**
83
+ * Whether the trace's winner came from the network: `source: 'network'` is
84
+ * its new wire name, `orderType: 'exchange'` the one ads emits today (D-51).
85
+ */
86
+ function fromNetwork(winner) {
87
+ const source = winner?.source ?? winner?.orderType;
88
+ return source === 'network' || source === 'exchange';
89
+ }
90
+ /** Fetch ids start `direqt-` today and `ad-` after ads switches (D-42). */
91
+ function isMessageId(id) {
92
+ return /^(?:direqt|ad)-./.test(id);
93
+ }
94
+ /** The trace record (ads `DecisionTraceRecord`) in the console's terms. */
79
95
  function explainTrace(record) {
80
96
  const t = record.trace ?? {};
81
97
  const req = t.request ?? {};
@@ -91,9 +107,9 @@ function explainTrace(record) {
91
107
  messageId: record.messageId,
92
108
  at: record.timestamp ?? t.timestamp,
93
109
  outcome,
94
- meaning: exports.OUTCOME_MEANINGS[outcome] ?? 'No offer was returned.',
110
+ meaning: exports.OUTCOME_MEANINGS[outcome] ?? 'No ad was returned.',
95
111
  request: {
96
- moment: {
112
+ placement: {
97
113
  code: req.adUnitCode ?? record.adUnitCode,
98
114
  id: req.adUnit ?? record.adUnit,
99
115
  },
@@ -115,9 +131,14 @@ function explainTrace(record) {
115
131
  : undefined,
116
132
  },
117
133
  shown: winner
118
- ? { audience: winner.lineItem, offer: winner.creatives?.[0] ?? null }
134
+ ? {
135
+ candidate: winner.lineItem,
136
+ ad: winner.creatives?.[0] ?? null,
137
+ campaign: winner.campaign ?? undefined,
138
+ fromNetwork: fromNetwork(winner),
139
+ }
119
140
  : null,
120
- audiences: (Array.isArray(t.candidates) ? t.candidates : []).map((c) => ({
141
+ candidates: (Array.isArray(t.candidates) ? t.candidates : []).map((c) => ({
121
142
  id: c.id,
122
143
  name: c.name,
123
144
  priority: PRIORITY[c.priority] ?? c.priority,
@@ -131,9 +152,9 @@ function explainTrace(record) {
131
152
  ? (exports.REASON_MEANINGS[c.reasonCode] ?? c.reasonCode)
132
153
  : undefined,
133
154
  decidingCondition: c.condition,
134
- offersExcluded: Array.isArray(c.offersExcluded)
155
+ adsExcluded: Array.isArray(c.offersExcluded)
135
156
  ? c.offersExcluded.map((o) => ({
136
- offer: o.offer,
157
+ ad: o.offer,
137
158
  why: exports.REASON_MEANINGS[o.reasonCode] ?? o.reasonCode,
138
159
  reason: o.reason,
139
160
  }))
@@ -143,8 +164,8 @@ function explainTrace(record) {
143
164
  stage: s.name,
144
165
  checks: exports.STAGE_MEANINGS[s.name],
145
166
  status: s.status,
146
- audiencesIn: s.candidatesIn,
147
- audiencesOut: s.candidatesOut,
167
+ candidatesIn: s.candidatesIn,
168
+ candidatesOut: s.candidatesOut,
148
169
  ...(s.name === 'appropriatenessGate' && s.detail
149
170
  ? { detail: s.detail }
150
171
  : {}),
@@ -155,7 +176,7 @@ const NOT_FOUND_NOTE = 'No decision trace for this message in this org. Possible
155
176
  exports.explainDecision = (0, tool_1.defineTool)({
156
177
  name: 'explain_decision',
157
178
  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}.',
179
+ description: 'Why an ad request returned the ad it did, or none: the placement and attributes the agent sent, every candidate considered (the agent’s network setting; the API calls it a line item) 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-" today, "ad-" later), which the agent logs, find_requests returns, and the request log on the agent’s Connect tab in the console shows; or a subscriber id (`subscriber`, the id the agent sends for the person) for that person’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
180
  kind: 'read',
160
181
  roleFloor: 'viewer',
161
182
  input: {
@@ -163,12 +184,12 @@ exports.explainDecision = (0, tool_1.defineTool)({
163
184
  .string()
164
185
  .min(1)
165
186
  .optional()
166
- .describe('The fetch response messageId, for example "direqt-5f0c…"'),
187
+ .describe('The fetch response messageId, for example "direqt-5f0c…" (or "ad-5f0c…")'),
167
188
  subscriber: zod_1.z
168
189
  .string()
169
190
  .min(1)
170
191
  .optional()
171
- .describe('A customer id the agent sends, for that customer’s latest requests. Pass this or messageId.'),
192
+ .describe('A subscriber id the agent sends, for that person’s latest requests. Pass this or messageId.'),
172
193
  },
173
194
  async run({ client }, { messageId, subscriber }) {
174
195
  const customer = subscriber?.trim();
@@ -180,15 +201,15 @@ exports.explainDecision = (0, tool_1.defineTool)({
180
201
  : {
181
202
  found: false,
182
203
  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).',
204
+ note: 'No decision traces for this subscriber 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
205
  };
185
206
  }
186
207
  const id = messageId?.trim() ?? '';
187
- if (!id.startsWith('direqt-'))
208
+ if (!isMessageId(id))
188
209
  return {
189
210
  found: false,
190
211
  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.',
212
+ note: 'A message id starts with "direqt-" (or "ad-"). Ask the user for the messageId from the fetch response or the request log, or for the subscriber id the agent sends.',
192
213
  };
193
214
  try {
194
215
  const record = await client.get(`${shared_1.OM}/decision-trace/${(0, shared_1.enc)(id)}`);
@@ -211,26 +232,26 @@ function journalRow(j) {
211
232
  attributes[kv.key] = kv.value;
212
233
  }
213
234
  const reason = j.errorResponse?.reason;
214
- const offer = Array.isArray(j.creatives) ? j.creatives[0] : undefined;
235
+ const ad = Array.isArray(j.creatives) ? j.creatives[0] : undefined;
215
236
  return {
216
237
  at: j.timestamp,
217
238
  agent: typeof j.application === 'string' ? j.application : undefined,
218
- moment: j.requestAdUnit,
239
+ placement: j.requestAdUnit,
219
240
  subscriber: j.requestSubscriberId || undefined,
220
241
  attributes,
221
242
  result: reason
222
- ? { offer: null, reason, meaning: exports.OUTCOME_MEANINGS[reason] }
243
+ ? { ad: null, reason, meaning: exports.OUTCOME_MEANINGS[reason] }
223
244
  : {
224
- audience: j.lineItem?.name,
225
- offer: offer?.name ?? null,
245
+ candidate: j.lineItem?.name,
246
+ ad: ad?.name ?? null,
226
247
  },
227
248
  messageId: j.messageId || undefined,
228
249
  };
229
250
  }
230
251
  exports.findRequests = (0, tool_1.defineTool)({
231
252
  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.',
253
+ title: 'Find ad requests',
254
+ description: 'Recent live ad requests from the fetch journal (kept 7 days), newest first: when, the agent, the placement code, the subscriber id, the attributes the agent sent, the result (the candidate and ad shown, or the reason none was), and the messageId to pass to explain_decision. Filter by `application` (agent), `subscriber` (the id the agent sends for the person), and `moment` (a placement code from list_moments). Maps to GET /system/offer-manager/journal.',
234
255
  kind: 'read',
235
256
  roleFloor: 'viewer',
236
257
  input: {
@@ -238,8 +259,8 @@ exports.findRequests = (0, tool_1.defineTool)({
238
259
  subscriber: zod_1.z
239
260
  .string()
240
261
  .optional()
241
- .describe('Subscriber id the agent sends for the customer'),
242
- moment: zod_1.z.string().optional().describe('Moment code, from list_moments'),
262
+ .describe('Subscriber id the agent sends for the person'),
263
+ moment: zod_1.z.string().optional().describe('Placement code, from list_moments'),
243
264
  hours: zod_1.z
244
265
  .number()
245
266
  .int()
@@ -281,13 +302,13 @@ const ENTITY = {
281
302
  };
282
303
  exports.getStats = (0, tool_1.defineTool)({
283
304
  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}.",
305
+ title: 'Event counts for a placement, line item, or ad',
306
+ description: "Event counts for one placement (`moment`), line item (`rule`: the agent's network setting), or ad (`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
307
  kind: 'read',
287
308
  roleFloor: 'viewer',
288
309
  input: {
289
310
  entity: zod_1.z.enum(['moment', 'rule', 'offer']),
290
- id: (0, shared_1.id)('moment, rule, or offer'),
311
+ id: (0, shared_1.id)('placement, line item, or ad'),
291
312
  stat: zod_1.z.enum(['sum', 'fetch']),
292
313
  hours: zod_1.z
293
314
  .number()
@@ -1 +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,GAA2B;IACtD,MAAM,EAAE,wBAAwB;IAChC,aAAa,EAAE,gDAAgD;IAC/D,cAAc,EAAE,yBAAyB;IACzC,qBAAqB,EACnB,wGAAwG;IAC1G,iBAAiB,EACf,6FAA6F;IAC/F,mBAAmB,EACjB,6HAA6H;IAC/H,qBAAqB,EACnB,0EAA0E;IAC5E,aAAa,EACX,sGAAsG;IACxG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AC,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"}
package/bin/tools/docs.js CHANGED
@@ -11,14 +11,14 @@ const tool_1 = require("../tool");
11
11
  exports.searchDocs = (0, tool_1.defineTool)({
12
12
  name: 'search_docs',
13
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.',
14
+ description: 'Keyword search over the Advertising.chat docs (docs.advertising.chat): campaigns and Conversation Ads, hosting ads from the network (the SDK, the MCP server, the Ad Skill, REST, the Web Embed), placements, frequency caps, console procedures, results, and the fetch, events, and management API 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
15
  kind: 'read',
16
16
  roleFloor: 'viewer',
17
17
  input: {
18
18
  query: zod_1.z
19
19
  .string()
20
20
  .min(2)
21
- .describe('Keywords, for example "fallback rule offer limit"'),
21
+ .describe('Keywords, for example "frequency cap sponsored label"'),
22
22
  limit: zod_1.z.number().int().min(1).max(20).optional().describe('Default 5'),
23
23
  },
24
24
  async run({ docs }, { query, limit }) {
@@ -31,14 +31,14 @@ exports.searchDocs = (0, tool_1.defineTool)({
31
31
  exports.readDoc = (0, tool_1.defineTool)({
32
32
  name: 'read_doc',
33
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".',
34
+ description: 'The full markdown of one Advertising.chat docs page, by url (from search_docs) or by title, for example "Fetch API".',
35
35
  kind: 'read',
36
36
  roleFloor: 'viewer',
37
37
  input: {
38
38
  page: zod_1.z
39
39
  .string()
40
40
  .min(1)
41
- .describe('Page url or title, for example "Moments, offers, and rules"'),
41
+ .describe('Page url or title, for example "Flow ads"'),
42
42
  },
43
43
  async run({ docs }, { page }) {
44
44
  const doc = await docs.read(page);
@@ -1 +1 @@
1
- {"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/tools/docs.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,6BAAwB;AACxB,kCAAqC;AAExB,QAAA,UAAU,GAAG,IAAA,iBAAU,EAAC;IACnC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,0YAA0Y;IAC5Y,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,QAAQ;IACnB,KAAK,EAAE;QACL,KAAK,EAAE,OAAC;aACL,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,mDAAmD,CAAC;QAChE,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;KACxE;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QAClC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC,MAAM;YAChB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,4CAA4C,EAAE,CAAC;IACvE,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,OAAO,GAAG,IAAA,iBAAU,EAAC;IAChC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,2HAA2H;IAC7H,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,QAAQ;IACnB,KAAK,EA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CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;QAClC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC,MAAM;YAChB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,4CAA4C,EAAE,CAAC;IACvE,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,OAAO,GAAG,IAAA,iBAAU,EAAC;IAChC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,sHAAsH;IACxH,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,QAAQ;IACnB,KAAK,EAAE;QACL,IAAI,EAAE,OAAC;aACJ,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,2CAA2C,CAAC;KACzD;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE;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"}
@@ -1,21 +1,16 @@
1
1
  /**
2
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
3
+ * order is the tool table hosts send the model, so keep it
4
4
  * stable for prompt caching).
5
5
  */
6
6
  import type { AnyTool } from '../tool';
7
7
  export declare const allTools: AnyTool[];
8
8
  export declare const toolsByName: ReadonlyMap<string, AnyTool>;
9
9
  export * from './account';
10
- export * from './attributes';
11
10
  export * from './campaigns';
12
11
  export * from './decisions';
13
12
  export * from './docs';
14
13
  export * from './moments';
15
14
  export * from './network';
16
- export * from './offers';
17
15
  export * from './results';
18
- export * from './rules';
19
- export * from './settings';
20
- export * from './translation';
21
16
  export { ToolInputError } from './shared';
@@ -16,45 +16,30 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.ToolInputError = exports.toolsByName = exports.allTools = void 0;
18
18
  const account_1 = require("./account");
19
- const attributes_1 = require("./attributes");
20
19
  const campaigns_1 = require("./campaigns");
21
20
  const decisions_1 = require("./decisions");
22
21
  const docs_1 = require("./docs");
23
22
  const moments_1 = require("./moments");
24
23
  const network_1 = require("./network");
25
- const offers_1 = require("./offers");
26
24
  const results_1 = require("./results");
27
- const rules_1 = require("./rules");
28
- const settings_1 = require("./settings");
29
- const translation_1 = require("./translation");
30
25
  exports.allTools = [
31
26
  account_1.whoami,
32
27
  account_1.listApplications,
33
28
  ...moments_1.momentTools,
34
- ...attributes_1.attributeTools,
35
- ...translation_1.translationTools,
36
- ...rules_1.ruleTools,
37
- ...offers_1.offerTools,
38
29
  ...results_1.resultsTools,
39
30
  ...network_1.networkTools,
40
31
  ...campaigns_1.campaignTools,
41
- ...settings_1.settingsTools,
42
32
  ...decisions_1.decisionTools,
43
33
  ...docs_1.docsTools,
44
34
  ];
45
35
  exports.toolsByName = new Map(exports.allTools.map(t => [t.name, t]));
46
36
  __exportStar(require("./account"), exports);
47
- __exportStar(require("./attributes"), exports);
48
37
  __exportStar(require("./campaigns"), exports);
49
38
  __exportStar(require("./decisions"), exports);
50
39
  __exportStar(require("./docs"), exports);
51
40
  __exportStar(require("./moments"), exports);
52
41
  __exportStar(require("./network"), exports);
53
- __exportStar(require("./offers"), exports);
54
42
  __exportStar(require("./results"), exports);
55
- __exportStar(require("./rules"), exports);
56
- __exportStar(require("./settings"), exports);
57
- __exportStar(require("./translation"), exports);
58
43
  var shared_1 = require("./shared");
59
44
  Object.defineProperty(exports, "ToolInputError", { enumerable: true, get: function () { return shared_1.ToolInputError; } });
60
45
  //# sourceMappingURL=index.js.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAMA,uCAAqD;AACrD,2CAA4C;AAC5C,2CAA4C;AAC5C,iCAAmC;AACnC,uCAAwC;AACxC,uCAAyC;AACzC,uCAAyC;AAE5B,QAAA,QAAQ,GAAc;IACjC,gBAAM;IACN,0BAAgB;IAChB,GAAG,qBAAW;IACd,GAAG,sBAAY;IACf,GAAG,sBAAY;IACf,GAAG,yBAAa;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,8CAA4B;AAC5B,8CAA4B;AAC5B,yCAAuB;AACvB,4CAA0B;AAC1B,4CAA0B;AAC1B,4CAA0B;AAC1B,mCAA0C;AAAjC,wGAAA,cAAc,OAAA"}
@@ -3,25 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.momentTools = exports.deleteMoment = exports.updateMoment = exports.createMoment = exports.getMoment = exports.listMoments = void 0;
4
4
  exports.momentRow = momentRow;
5
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.
6
+ * Placements (the API's ad units; moments in the tool names): named points
7
+ * in an agent's conversation where an ad from the network may appear, used
8
+ * as reporting labels. Each belongs to one agent.
8
9
  */
9
- const offer_rules_1 = require("@advertising-chat/offer-rules");
10
10
  const zod_1 = require("zod");
11
11
  const tool_1 = require("../tool");
12
12
  const shared_1 = require("./shared");
13
+ /** Who reports a moment: the agent itself, or a context layer in front of it. */
14
+ const MOMENT_SOURCES = ['agent', 'context_layer'];
13
15
  const code = zod_1.z
14
16
  .string()
15
17
  .min(1)
16
18
  .max(100)
17
- .describe('What the agent sends on each request to name this moment, e.g. `billing-answered`. Unique within the agent.');
19
+ .describe('What the agent sends on each request to name this placement, e.g. `trip-answered`. Unique within the agent.');
18
20
  const description = zod_1.z
19
21
  .string()
20
22
  .max(1000)
21
- .describe('What the moment means in the conversation, in a sentence. Rules and the Assistant rely on it.');
23
+ .describe('What the placement means in the conversation, in a sentence. Reports and our review team read it.');
22
24
  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
+ .enum(MOMENT_SOURCES)
26
+ .describe('Who reports the placement: `agent` (the default) or `context_layer`.');
25
27
  /** The words for a moment's fields, for approval sentences. */
26
28
  const MOMENT_WORDS = {
27
29
  name: 'name',
@@ -42,8 +44,8 @@ function momentRow(m) {
42
44
  }
43
45
  exports.listMoments = (0, tool_1.defineTool)({
44
46
  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
+ title: 'List placements',
48
+ description: 'The org’s placements (moments in these tool names; the API calls them ad units): the points in an agent’s conversation where an ad from the network may appear, used as reporting labels. Returns id, code (what the agent sends), name, description, enabled, and the agent (application) each belongs to. Every placement belongs to one agent, and codes are unique within an agent. Pass `application` to list one agent’s placements. Maps to GET /system/offer-manager/adunit.',
47
49
  kind: 'read',
48
50
  roleFloor: 'viewer',
49
51
  input: {
@@ -57,19 +59,19 @@ exports.listMoments = (0, tool_1.defineTool)({
57
59
  });
58
60
  exports.getMoment = (0, tool_1.defineTool)({
59
61
  name: 'get_moment',
60
- title: 'Get a moment',
61
- description: 'One moment with every field. Maps to GET /system/offer-manager/adunit/{id}.',
62
+ title: 'Get a placement',
63
+ description: 'One placement with every field. Maps to GET /system/offer-manager/adunit/{id}.',
62
64
  kind: 'read',
63
65
  roleFloor: 'viewer',
64
- input: { id: (0, shared_1.id)('moment') },
66
+ input: { id: (0, shared_1.id)('placement') },
65
67
  async run({ client }, { id: momentId }) {
66
68
  return client.get(`${shared_1.OM}/adunit/${(0, shared_1.enc)(momentId)}`);
67
69
  },
68
70
  });
69
71
  exports.createMoment = (0, tool_1.defineTool)({
70
72
  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
+ title: 'Create a placement',
74
+ description: 'Create a placement for one agent. The agent must then send its `code` on requests at that point in the conversation; until it does, no ad appears there. A placement serves nothing until the agent’s ads from the network include it (set_network_ads). `application` is fixed once created. Maps to POST /system/offer-manager/adunit.',
73
75
  kind: 'write',
74
76
  roleFloor: 'editor',
75
77
  input: {
@@ -80,20 +82,20 @@ exports.createMoment = (0, tool_1.defineTool)({
80
82
  source: source.optional(),
81
83
  enabled: zod_1.z.boolean().optional().describe('Default true.'),
82
84
  },
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.`,
85
+ approval: args => `Add the placement ${(0, shared_1.quoted)(args.name, '')} to this agent. The agent reports it by sending the code “${args.code}”; ads from the network appear there only once the agent’s Ads from the network includes it.`,
84
86
  async run({ client }, args) {
85
87
  return client.post(`${shared_1.OM}/adunit`, (0, shared_1.defined)(args));
86
88
  },
87
89
  });
88
90
  exports.updateMoment = (0, tool_1.defineTool)({
89
91
  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
+ title: 'Update a placement',
93
+ description: 'Change a placement. Only the fields given change. Changing `code` breaks the agent’s requests until the agent sends the new code; disabling a placement stops every ad at it at once. Maps to PATCH /system/offer-manager/adunit/{id}.',
92
94
  kind: 'write',
93
95
  roleFloor: 'editor',
94
96
  reader: 'get_moment',
95
97
  input: {
96
- id: (0, shared_1.id)('moment'),
98
+ id: (0, shared_1.id)('placement'),
97
99
  application: shared_1.applicationOfUpdate,
98
100
  name: zod_1.z.string().min(1).max(200).optional(),
99
101
  code: code.optional(),
@@ -102,17 +104,17 @@ exports.updateMoment = (0, tool_1.defineTool)({
102
104
  enabled: zod_1.z.boolean().optional(),
103
105
  },
104
106
  approval: (args, before) => {
105
- const name = (0, shared_1.named)('moment', before?.name ?? args.name);
107
+ const name = (0, shared_1.named)('placement', before?.name ?? args.name);
106
108
  const rest = { ...args, enabled: undefined };
107
109
  const what = (0, shared_1.changedWords)(rest, MOMENT_WORDS);
108
110
  const parts = [];
109
111
  if (args.enabled === false)
110
- parts.push(`Turn off ${name}: no offer or network ad appears there until it is turned back on.`);
112
+ parts.push(`Turn off ${name}: no ad from the network appears there until it is turned back on.`);
111
113
  if (args.enabled === true)
112
114
  parts.push(`Turn on ${name}.`);
113
115
  if (what.length)
114
116
  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.'
117
+ ? ' The agent must send the new code, or no ad appears there.'
116
118
  : ''}`);
117
119
  return parts.join(' ') || `Change ${name}.`;
118
120
  },
@@ -122,13 +124,13 @@ exports.updateMoment = (0, tool_1.defineTool)({
122
124
  });
123
125
  exports.deleteMoment = (0, tool_1.defineTool)({
124
126
  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
+ title: 'Delete a placement',
128
+ description: 'Permanently delete a placement. Refused (409) while the agent’s ads from the network still include it; turn it off there first (set_network_ads). Requests the agent still sends with its code then get no ad. Maps to DELETE /system/offer-manager/adunit/{id}.',
127
129
  kind: 'destructive',
128
130
  roleFloor: 'editor',
129
131
  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
+ input: { id: (0, shared_1.id)('placement') },
133
+ approval: (_args, before) => `Delete ${(0, shared_1.named)('placement', before?.name)} for good. Requests the agent still sends for it get no ad.`,
132
134
  async run({ client }, { id: momentId }) {
133
135
  return client.delete(`${shared_1.OM}/adunit/${(0, shared_1.enc)(momentId)}`);
134
136
  },