@advertising-chat/mcp 0.17.3 → 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.
- package/README.md +24 -36
- package/bin/cli.js +1 -1
- package/bin/client.d.ts +5 -2
- package/bin/client.js.map +1 -1
- package/bin/index.d.ts +3 -4
- package/bin/index.js +3 -4
- package/bin/index.js.map +1 -1
- package/bin/routeInventory.d.ts +8 -19
- package/bin/routeInventory.js +2 -61
- package/bin/routeInventory.js.map +1 -1
- package/bin/serve.js +9 -9
- package/bin/serve.js.map +1 -1
- package/bin/server.d.ts +2 -2
- package/bin/server.js +8 -9
- package/bin/server.js.map +1 -1
- package/bin/tool.d.ts +8 -11
- package/bin/tool.js +0 -1
- package/bin/tool.js.map +1 -1
- package/bin/tools/account.js +2 -2
- package/bin/tools/account.js.map +1 -1
- package/bin/tools/decisions.d.ts +8 -1
- package/bin/tools/decisions.js +78 -57
- package/bin/tools/decisions.js.map +1 -1
- package/bin/tools/docs.js +4 -4
- package/bin/tools/docs.js.map +1 -1
- package/bin/tools/index.d.ts +1 -6
- package/bin/tools/index.js +0 -15
- package/bin/tools/index.js.map +1 -1
- package/bin/tools/moments.js +27 -25
- package/bin/tools/moments.js.map +1 -1
- package/bin/tools/network.js +8 -8
- package/bin/tools/network.js.map +1 -1
- package/bin/tools/results.d.ts +0 -1
- package/bin/tools/results.js +7 -23
- package/bin/tools/results.js.map +1 -1
- package/bin/tools/shared.d.ts +5 -7
- package/bin/tools/shared.js +9 -34
- package/bin/tools/shared.js.map +1 -1
- package/bin/version.d.ts +1 -1
- package/bin/version.js +1 -1
- package/package.json +36 -9
- package/bin/tools/attributes.d.ts +0 -10
- package/bin/tools/attributes.js +0 -200
- package/bin/tools/attributes.js.map +0 -1
- package/bin/tools/offers.d.ts +0 -11
- package/bin/tools/offers.js +0 -239
- package/bin/tools/offers.js.map +0 -1
- package/bin/tools/rules.d.ts +0 -9
- package/bin/tools/rules.js +0 -318
- package/bin/tools/rules.js.map +0 -1
- package/bin/tools/settings.d.ts +0 -3
- package/bin/tools/settings.js +0 -54
- package/bin/tools/settings.js.map +0 -1
- package/bin/tools/translation.d.ts +0 -6
- package/bin/tools/translation.js +0 -139
- package/bin/tools/translation.js.map +0 -1
package/bin/tools/rules.js
DELETED
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ruleTools = exports.deleteRule = exports.updateRule = exports.createRule = exports.getRule = exports.listRules = void 0;
|
|
4
|
-
exports.ruleRow = ruleRow;
|
|
5
|
-
/**
|
|
6
|
-
* Rules (the API's line items): which offers appear at which moments of
|
|
7
|
-
* one agent, for whom, where, when, and how often. Input schemas come from
|
|
8
|
-
* `@advertising-chat/offer-rules`, the package the server validates with,
|
|
9
|
-
* so a tool cannot drift from the rule model.
|
|
10
|
-
*/
|
|
11
|
-
const offer_rules_1 = require("@advertising-chat/offer-rules");
|
|
12
|
-
const zod_1 = require("zod");
|
|
13
|
-
const tool_1 = require("../tool");
|
|
14
|
-
const shared_1 = require("./shared");
|
|
15
|
-
const R = offer_rules_1.RuleInput.shape;
|
|
16
|
-
const GRAMMAR = 'A condition group is { all: [...] } or { any: [...] } with 1 to 20 items; an item is a condition or one nested group of conditions. ' +
|
|
17
|
-
"Attribute condition: { attribute, op, value? }, op one of equals, not_equals, in, not_in, gt, gte, lt, lte, between, contains, within_last, more_than_ago (days), exists, not_exists, true, false; e.g. { attribute: 'plan', op: 'equals', value: 'Unlimited' }. " +
|
|
18
|
-
'History condition: { event: shown | declined | accepted | converted, subject: this_offer | any_offer | offer:<id> | rule:<id>, within_days: 1 to 90, at_least?: 1 to 20 }. ' +
|
|
19
|
-
`Attributes must be in the agent's catalog (list_attributes), with an operator that fits their type. Grammar: ${shared_1.RULES_REFERENCE}`;
|
|
20
|
-
/** The rule fields, described for a model. Schemas are offer-rules'. */
|
|
21
|
-
const fields = {
|
|
22
|
-
name: R.name.describe('Display name, 1 to 200 characters.'),
|
|
23
|
-
adUnits: R.adUnits.describe('The moment ids the rule applies to, at least one, all of the rule’s agent.'),
|
|
24
|
-
creatives: R.creatives.describe('The offer ids the rule can show, in order. A house rule needs at least one; an exchange rule has none.'),
|
|
25
|
-
priority: R.priority.describe('Lower wins: 6 High, 8 Normal, 10 Low. Required on a house rule (create defaults to 8). An exchange rule is 12.'),
|
|
26
|
-
enabled: R.enabled.describe('Whether the rule serves.'),
|
|
27
|
-
audience: R.audience.describe(`Who sees the offers: customers the group matches. Absent means everyone. ${GRAMMAR}`),
|
|
28
|
-
exclusions: R.exclusions.describe("Who does not: customers the group matches are removed. Absent means no one. E.g. anyone who declined this offer in the last 30 days: { any: [{ event: 'declined', subject: 'this_offer', within_days: 30 }] }."),
|
|
29
|
-
channels: R.channels.describe(`Where: the channels the rule serves on, of ${offer_rules_1.CHANNELS.join(', ')}. Absent or empty means every channel; a restricted rule never matches a request that names no channel.`),
|
|
30
|
-
schedule: R.schedule.describe("When, in the org's time zone: start and end (YYYY-MM-DD, inclusive), daysOfWeek (mon to sun), hours { from, to } (to is exclusive; from > to runs overnight). At least one of them. Absent means always."),
|
|
31
|
-
frequency: R.frequency.describe('How often: at most `times` (1 to 20) showings of this rule to one customer per rolling `interval` of milliseconds (60000 to 7776000000). E.g. { times: 1, interval: 604800000 } is once a week. Absent means no cap.'),
|
|
32
|
-
limits: R.limits.describe('Caps on the whole rule: { limitType: impressions | percentage, value, enabled }.'),
|
|
33
|
-
fallback: R.fallback.describe('A fallback rule is considered only when no other rule qualifies.'),
|
|
34
|
-
testMode: R.testMode.describe("Marks the rule's responses isTest: true."),
|
|
35
|
-
creativeSelectionStrategy: R.creativeSelectionStrategy.describe('`sequential` shows the offers to each customer in order (needs a subscriber id); `default` picks among them.'),
|
|
36
|
-
dailyBudget: R.dailyBudget.describe('Paces the rule evenly across the UTC day. 0 or absent means unpaced.'),
|
|
37
|
-
orderType: R.orderType.describe('`house` (the default) shows the rule’s offers; `exchange` asks an ad network for one.'),
|
|
38
|
-
adNetworkCode: R.adNetworkCode.describe('Exchange rules only: the ad network asked to fill. Absent means the default network.'),
|
|
39
|
-
};
|
|
40
|
-
const instructions = offer_rules_1.RuleInstructions.optional().describe('The user’s words each policy field was written from, keyed by the field you set or clear (adUnits, creatives, priority, audience, exclusions, channels, schedule, frequency), e.g. { audience: "prepaid customers who hit their data limit twice in a row" }. Pass it whenever the change comes from what the user asked: the rule keeps it, and the console shows the field as written from those words. Use their request as they wrote it (with their answer to any question you asked), not your paraphrase. Not saved as part of the rule’s policy.');
|
|
41
|
-
/** Fields an update clears with `null`. */
|
|
42
|
-
const CLEARABLE = [
|
|
43
|
-
'audience',
|
|
44
|
-
'exclusions',
|
|
45
|
-
'channels',
|
|
46
|
-
'schedule',
|
|
47
|
-
'frequency',
|
|
48
|
-
'limits',
|
|
49
|
-
'dailyBudget',
|
|
50
|
-
'adNetworkCode',
|
|
51
|
-
];
|
|
52
|
-
/** The offer card's words for a rule's fields, for approval sentences. */
|
|
53
|
-
const RULE_WORDS = {
|
|
54
|
-
name: 'the name',
|
|
55
|
-
creatives: 'the offers',
|
|
56
|
-
audience: 'who sees it',
|
|
57
|
-
exclusions: 'who does not',
|
|
58
|
-
adUnits: 'when (the moments)',
|
|
59
|
-
channels: 'where (the channels)',
|
|
60
|
-
frequency: 'how often',
|
|
61
|
-
schedule: 'the schedule',
|
|
62
|
-
priority: 'the priority',
|
|
63
|
-
fallback: 'whether it is a fallback',
|
|
64
|
-
limits: 'the limits',
|
|
65
|
-
dailyBudget: 'the daily pacing',
|
|
66
|
-
testMode: 'test mode',
|
|
67
|
-
creativeSelectionStrategy: 'the order of its offers',
|
|
68
|
-
orderType: 'its kind',
|
|
69
|
-
adNetworkCode: 'the ad network',
|
|
70
|
-
};
|
|
71
|
-
const CHANNEL_NAMES = {
|
|
72
|
-
rcs: 'RCS',
|
|
73
|
-
sms: 'SMS',
|
|
74
|
-
webchat: 'web chat',
|
|
75
|
-
};
|
|
76
|
-
function countWords(n, one) {
|
|
77
|
-
return n === 1 ? `one ${one}` : `${n} ${one}s`;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* What one update field becomes, as a clause, where that is short and
|
|
81
|
-
* plain; undefined leaves the field to the "it also changes" list.
|
|
82
|
-
*/
|
|
83
|
-
function ruleValueWords(key, value, before) {
|
|
84
|
-
switch (key) {
|
|
85
|
-
case 'name':
|
|
86
|
-
return `its name becomes ${(0, shared_1.quoted)(value, '')}`;
|
|
87
|
-
case 'adUnits':
|
|
88
|
-
case 'creatives': {
|
|
89
|
-
if (!Array.isArray(value))
|
|
90
|
-
return undefined;
|
|
91
|
-
const one = key === 'adUnits' ? 'moment' : 'offer';
|
|
92
|
-
const was = before?.[key];
|
|
93
|
-
if (Array.isArray(was) && was.length === value.length)
|
|
94
|
-
return value.length === 1 ? `its ${one} changes` : `its ${one}s change`;
|
|
95
|
-
const at = key === 'adUnits' ? 'at ' : '';
|
|
96
|
-
const instead = Array.isArray(was) ? ` instead of ${was.length}` : '';
|
|
97
|
-
return `it shows ${at}${countWords(value.length, one)}${instead}`;
|
|
98
|
-
}
|
|
99
|
-
case 'channels':
|
|
100
|
-
return Array.isArray(value) && value.length
|
|
101
|
-
? `it shows only on ${(0, shared_1.listWords)(value.map(c => CHANNEL_NAMES[c] ?? String(c)))}`
|
|
102
|
-
: 'it shows on every channel';
|
|
103
|
-
case 'schedule': {
|
|
104
|
-
if (value === null)
|
|
105
|
-
return 'it runs at all times';
|
|
106
|
-
const text = (0, offer_rules_1.renderSchedule)(value).replace(/ \([^)]*\)$/, '');
|
|
107
|
-
return `it runs ${text.charAt(0).toLowerCase()}${text.slice(1)}`;
|
|
108
|
-
}
|
|
109
|
-
case 'frequency': {
|
|
110
|
-
if (value === null)
|
|
111
|
-
return 'it has no limit on how often it shows';
|
|
112
|
-
const words = (0, shared_1.frequencyWords)(value);
|
|
113
|
-
return words && `it shows ${words} to each customer`;
|
|
114
|
-
}
|
|
115
|
-
case 'priority': {
|
|
116
|
-
const label = offer_rules_1.PRIORITY_LABELS[value];
|
|
117
|
-
return label && `its priority becomes ${label}`;
|
|
118
|
-
}
|
|
119
|
-
case 'fallback':
|
|
120
|
-
return value ? 'it becomes a fallback' : 'it is no longer a fallback';
|
|
121
|
-
case 'testMode':
|
|
122
|
-
return value ? 'test mode turns on' : 'test mode turns off';
|
|
123
|
-
default:
|
|
124
|
-
return undefined;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* The change an update makes, field by field: what each becomes where
|
|
129
|
-
* that is short and plain, then the rest by name ("who sees it").
|
|
130
|
-
*/
|
|
131
|
-
function ruleChangeWords(args, before) {
|
|
132
|
-
const becomes = [];
|
|
133
|
-
const rest = [];
|
|
134
|
-
for (const [key, word] of Object.entries(RULE_WORDS)) {
|
|
135
|
-
if (args[key] === undefined)
|
|
136
|
-
continue;
|
|
137
|
-
const clause = ruleValueWords(key, args[key], before);
|
|
138
|
-
if (clause)
|
|
139
|
-
becomes.push(clause);
|
|
140
|
-
else if (!rest.includes(word))
|
|
141
|
-
rest.push(word);
|
|
142
|
-
}
|
|
143
|
-
if (!becomes.length)
|
|
144
|
-
return (0, shared_1.listWords)(rest);
|
|
145
|
-
return rest.length
|
|
146
|
-
? `${(0, shared_1.listWords)(becomes)}; it also changes ${(0, shared_1.listWords)(rest)}`
|
|
147
|
-
: (0, shared_1.listWords)(becomes);
|
|
148
|
-
}
|
|
149
|
-
/** A rule as the list shows it. */
|
|
150
|
-
function ruleRow(r) {
|
|
151
|
-
return {
|
|
152
|
-
id: (0, shared_1.str)(r._id) ?? (0, shared_1.str)(r.id),
|
|
153
|
-
name: r.name,
|
|
154
|
-
application: (0, shared_1.refId)(r.application),
|
|
155
|
-
enabled: r.enabled,
|
|
156
|
-
priority: r.priority,
|
|
157
|
-
fallback: r.fallback || undefined,
|
|
158
|
-
orderType: r.orderType === 'exchange' ? 'exchange' : undefined,
|
|
159
|
-
moments: Array.isArray(r.adUnits) ? r.adUnits.map(shared_1.ref) : undefined,
|
|
160
|
-
offers: Array.isArray(r.creatives) ? r.creatives.map(shared_1.ref) : undefined,
|
|
161
|
-
summary: (0, shared_1.str)(r._description?.summary),
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
/** What the console calls a rule: an offer's audience, or the agent's network setting. */
|
|
165
|
-
function ruleKind(rule) {
|
|
166
|
-
return rule?.orderType === 'exchange' ? 'network setting' : 'audience';
|
|
167
|
-
}
|
|
168
|
-
exports.listRules = (0, tool_1.defineTool)({
|
|
169
|
-
name: 'list_rules',
|
|
170
|
-
title: 'List rules',
|
|
171
|
-
description: 'The org’s rules (the API calls them line items): each places offers at moments of one agent. Returns id, name, agent (application), enabled, priority, fallback, moments, offers, and the generated summary when there is one. Pass `application` to list one agent’s rules; read one rule in full with get_rule. Maps to GET /system/offer-manager/lineItem.',
|
|
172
|
-
kind: 'read',
|
|
173
|
-
roleFloor: 'viewer',
|
|
174
|
-
capability: 'offer-manager',
|
|
175
|
-
input: {
|
|
176
|
-
application: shared_1.application.optional(),
|
|
177
|
-
enabled: zod_1.z.boolean().optional().describe('Only enabled, or only disabled.'),
|
|
178
|
-
...shared_1.listShape,
|
|
179
|
-
},
|
|
180
|
-
async run({ client }, args) {
|
|
181
|
-
const body = await client.get(`${shared_1.OM}/lineItem`, (0, shared_1.defined)(args));
|
|
182
|
-
return (0, shared_1.rows)(body).map(ruleRow);
|
|
183
|
-
},
|
|
184
|
-
});
|
|
185
|
-
exports.getRule = (0, tool_1.defineTool)({
|
|
186
|
-
name: 'get_rule',
|
|
187
|
-
title: 'Get a rule',
|
|
188
|
-
description: `One rule with every field: audience, exclusions, channels, schedule, frequency, limits, priority, its moments and offers, and the generated summary (\`_description\`). Field reference: ${shared_1.RULES_REFERENCE} Maps to GET /system/offer-manager/lineItem/{id}.`,
|
|
189
|
-
kind: 'read',
|
|
190
|
-
roleFloor: 'viewer',
|
|
191
|
-
capability: 'offer-manager',
|
|
192
|
-
input: { id: (0, shared_1.id)('rule') },
|
|
193
|
-
async run({ client }, { id: ruleId }) {
|
|
194
|
-
return client.get(`${shared_1.OM}/lineItem/${(0, shared_1.enc)(ruleId)}`);
|
|
195
|
-
},
|
|
196
|
-
});
|
|
197
|
-
exports.createRule = (0, tool_1.defineTool)({
|
|
198
|
-
name: 'create_rule',
|
|
199
|
-
title: 'Create a rule',
|
|
200
|
-
description: 'Create a rule for one agent: it places offers at the agent’s moments for the customers and situations it describes. It is created disabled unless `enabled: true` is given, so nothing serves until someone turns it on; pass true only when the user asked to launch. `application` is fixed once created, and every moment must belong to it; offers are shared across the org. A house rule (the default) needs at least one offer and a priority (default 8, Normal). An exchange rule (`orderType: exchange`) has no offers, priority 12, and an optional adNetworkCode. The input is checked against the rule model before it is sent, and again by the server. Maps to POST /system/offer-manager/lineItem.',
|
|
201
|
-
kind: 'write',
|
|
202
|
-
roleFloor: 'editor',
|
|
203
|
-
capability: 'offer-manager',
|
|
204
|
-
input: {
|
|
205
|
-
application: shared_1.application,
|
|
206
|
-
...fields,
|
|
207
|
-
enabled: fields.enabled.optional().describe('Default false.'),
|
|
208
|
-
instructions,
|
|
209
|
-
},
|
|
210
|
-
approval: args => {
|
|
211
|
-
const name = (0, shared_1.quoted)(args.name, '');
|
|
212
|
-
const offers = Array.isArray(args.creatives) ? args.creatives.length : 0;
|
|
213
|
-
const shows = args.orderType === 'exchange'
|
|
214
|
-
? 'asks the network for an ad'
|
|
215
|
-
: `shows ${offers === 1 ? 'one offer' : `${offers} offers`}`;
|
|
216
|
-
const moments = args.adUnits.length;
|
|
217
|
-
const where = `at ${moments === 1 ? 'one moment' : `${moments} moments`}`;
|
|
218
|
-
const who = args.audience ? 'to the customers it describes' : 'to everyone';
|
|
219
|
-
const kind = ruleKind(args);
|
|
220
|
-
return args.enabled
|
|
221
|
-
? `Create the ${kind} ${name} and publish it now: it ${shows} ${where} ${who}, from the next request.`
|
|
222
|
-
: `Create the ${kind} ${name}, turned off: it ${shows} ${where} ${who} once it is published.`;
|
|
223
|
-
},
|
|
224
|
-
async run({ client }, args) {
|
|
225
|
-
const { instructions: words, ...rest } = (0, shared_1.defined)(args);
|
|
226
|
-
const body = { enabled: false, ...rest };
|
|
227
|
-
if (body.orderType !== 'exchange' && body.priority === undefined)
|
|
228
|
-
body.priority = 8;
|
|
229
|
-
const parsed = offer_rules_1.RuleInput.safeParse(body);
|
|
230
|
-
if (!parsed.success)
|
|
231
|
-
throw new shared_1.ToolInputError(`The rule is invalid; nothing was sent. Fix these and retry:\n${(0, shared_1.issues)(parsed.error)}`);
|
|
232
|
-
return client.post(`${shared_1.OM}/lineItem`, {
|
|
233
|
-
...parsed.data,
|
|
234
|
-
...(words && { instructions: words }),
|
|
235
|
-
});
|
|
236
|
-
},
|
|
237
|
-
});
|
|
238
|
-
const nullable = Object.fromEntries(CLEARABLE.map(k => [
|
|
239
|
-
k,
|
|
240
|
-
fields[k]
|
|
241
|
-
.unwrap()
|
|
242
|
-
.nullable()
|
|
243
|
-
.optional()
|
|
244
|
-
.describe(`${fields[k].description} Pass null to clear.`),
|
|
245
|
-
]));
|
|
246
|
-
exports.updateRule = (0, tool_1.defineTool)({
|
|
247
|
-
name: 'update_rule',
|
|
248
|
-
title: 'Update a rule',
|
|
249
|
-
description: `Change a rule. Only the fields given change; pass null to clear audience, exclusions, channels, schedule, frequency, limits, dailyBudget, or adNetworkCode. The change is live at once: enabling starts serving, and every field changes who sees what from the next request. The server checks the merged rule (a house rule keeps at least one offer and a priority of 6, 8, or 10). Use get_rule first so you change what is there. Reference: ${shared_1.RULES_REFERENCE} Maps to PATCH /system/offer-manager/lineItem/{id}.`,
|
|
250
|
-
kind: 'write',
|
|
251
|
-
roleFloor: 'editor',
|
|
252
|
-
reader: 'get_rule',
|
|
253
|
-
capability: 'offer-manager',
|
|
254
|
-
input: {
|
|
255
|
-
id: (0, shared_1.id)('rule'),
|
|
256
|
-
application: shared_1.applicationOfUpdate,
|
|
257
|
-
name: fields.name.optional(),
|
|
258
|
-
enabled: fields.enabled.optional(),
|
|
259
|
-
adUnits: fields.adUnits.optional(),
|
|
260
|
-
creatives: fields.creatives,
|
|
261
|
-
priority: fields.priority,
|
|
262
|
-
fallback: fields.fallback,
|
|
263
|
-
testMode: fields.testMode,
|
|
264
|
-
creativeSelectionStrategy: fields.creativeSelectionStrategy,
|
|
265
|
-
orderType: fields.orderType,
|
|
266
|
-
...nullable,
|
|
267
|
-
instructions,
|
|
268
|
-
},
|
|
269
|
-
approval: (args, before) => {
|
|
270
|
-
const name = (0, shared_1.named)(ruleKind(before ?? args), before?.name ?? args.name);
|
|
271
|
-
const what = (0, shared_1.changedWords)(args, RULE_WORDS);
|
|
272
|
-
const change = ruleChangeWords(args, before);
|
|
273
|
-
const parts = [];
|
|
274
|
-
if (args.enabled === true)
|
|
275
|
-
parts.push(`Publish ${name}: it starts showing its offers from the next request.`);
|
|
276
|
-
if (args.enabled === false)
|
|
277
|
-
parts.push(`Pause ${name}: it stops showing its offers at once.`);
|
|
278
|
-
if (what.length) {
|
|
279
|
-
const live = args.enabled === true ||
|
|
280
|
-
(args.enabled === undefined && before?.enabled);
|
|
281
|
-
parts.push(`Change ${name}: ${change}.${live ? ' The change is live at once.' : ''}`);
|
|
282
|
-
}
|
|
283
|
-
return parts.join(' ') || `Change ${name}.`;
|
|
284
|
-
},
|
|
285
|
-
async run({ client }, args) {
|
|
286
|
-
const body = (0, shared_1.patchBody)(args, ['application', 'instructions']);
|
|
287
|
-
const given = {};
|
|
288
|
-
for (const [k, v] of Object.entries(body))
|
|
289
|
-
if (v !== null && k !== 'instructions')
|
|
290
|
-
given[k] = v;
|
|
291
|
-
const parsed = offer_rules_1.RuleUpdate.safeParse(given);
|
|
292
|
-
if (!parsed.success)
|
|
293
|
-
throw new shared_1.ToolInputError(`The change is invalid; nothing was sent. Fix these and retry:\n${(0, shared_1.issues)(parsed.error)}`);
|
|
294
|
-
return client.patch(`${shared_1.OM}/lineItem/${(0, shared_1.enc)(args.id)}`, body);
|
|
295
|
-
},
|
|
296
|
-
});
|
|
297
|
-
exports.deleteRule = (0, tool_1.defineTool)({
|
|
298
|
-
name: 'delete_rule',
|
|
299
|
-
title: 'Delete a rule',
|
|
300
|
-
description: 'Permanently delete a rule; its offers stop appearing through it at once. To stop it for now, use update_rule with `enabled: false` instead. Maps to DELETE /system/offer-manager/lineItem/{id}.',
|
|
301
|
-
kind: 'destructive',
|
|
302
|
-
roleFloor: 'editor',
|
|
303
|
-
reader: 'get_rule',
|
|
304
|
-
capability: 'offer-manager',
|
|
305
|
-
input: { id: (0, shared_1.id)('rule') },
|
|
306
|
-
approval: (_args, before) => `Delete ${(0, shared_1.named)(ruleKind(before), before?.name)} for good: its offers stop appearing through it at once.`,
|
|
307
|
-
async run({ client }, { id: ruleId }) {
|
|
308
|
-
return client.delete(`${shared_1.OM}/lineItem/${(0, shared_1.enc)(ruleId)}`);
|
|
309
|
-
},
|
|
310
|
-
});
|
|
311
|
-
exports.ruleTools = [
|
|
312
|
-
exports.listRules,
|
|
313
|
-
exports.getRule,
|
|
314
|
-
exports.createRule,
|
|
315
|
-
exports.updateRule,
|
|
316
|
-
exports.deleteRule,
|
|
317
|
-
];
|
|
318
|
-
//# sourceMappingURL=rules.js.map
|
package/bin/tools/rules.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/tools/rules.ts"],"names":[],"mappings":";;;AAqNA,0BAaC;AAlOD;;;;;GAKG;AACH,+DAOuC;AACvC,6BAAwB;AACxB,kCAAqC;AACrC,qCAsBkB;AAElB,MAAM,CAAC,GAAG,uBAAS,CAAC,KAAK,CAAC;AAE1B,MAAM,OAAO,GACX,sIAAsI;IACtI,mQAAmQ;IACnQ,6KAA6K;IAC7K,gHAAgH,wBAAe,EAAE,CAAC;AAEpI,wEAAwE;AACxE,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC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AAM,CAAC,KAAK,CAAC,EAAE,CACzF,CAAC;QACJ,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,WAAE,aAAa,IAAA,YAAG,EAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,UAAU,GAAG,IAAA,iBAAU,EAAC;IACnC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,iMAAiM;IACnM,IAAI,EAAE,aAAa;IACnB,SAAS,EAAE,QAAQ;IACnB,MAAM,EAAE,UAAU;IAClB,UAAU,EAAE,eAAe;IAC3B,KAAK,EAAE,EAAE,EAAE,EAAE,IAAA,WAAE,EAAC,MAAM,CAAC,EAAE;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAC1B,UAAU,IAAA,cAAK,EAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,0DAA0D;IAC3G,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QAClC,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,WAAE,aAAa,IAAA,YAAG,EAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,SAAS,GAAG;IACvB,iBAAS;IACT,eAAO;IACP,kBAAU;IACV,kBAAU;IACV,kBAAU;CACX,CAAC"}
|
package/bin/tools/settings.d.ts
DELETED
package/bin/tools/settings.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.settingsTools = exports.setOfferLimit = exports.getOfferLimit = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* The workspace's Offer Manager settings: the offer limit, how many of the
|
|
6
|
-
* brand's offers one customer may see from each agent in a period, across
|
|
7
|
-
* that agent's moments and rules (customer ids are per agent). A rule's own How often is its `frequency`.
|
|
8
|
-
*/
|
|
9
|
-
const offer_rules_1 = require("@advertising-chat/offer-rules");
|
|
10
|
-
const tool_1 = require("../tool");
|
|
11
|
-
const shared_1 = require("./shared");
|
|
12
|
-
/** The rendered limit as a clause: `no customer sees more than …`. */
|
|
13
|
-
function clause(limit) {
|
|
14
|
-
const said = (0, offer_rules_1.renderOfferLimit)(limit);
|
|
15
|
-
return said.charAt(0).toLowerCase() + said.slice(1);
|
|
16
|
-
}
|
|
17
|
-
function withSentence(s) {
|
|
18
|
-
return { ...s, says: (0, offer_rules_1.renderOfferLimit)(s.offerLimit) };
|
|
19
|
-
}
|
|
20
|
-
exports.getOfferLimit = (0, tool_1.defineTool)({
|
|
21
|
-
name: 'get_offer_limit',
|
|
22
|
-
title: 'Get the offer limit',
|
|
23
|
-
description: 'The workspace’s offer limit: no customer sees more than `times` of the brand’s offers in any rolling `interval` (milliseconds), counted over every offer the customer was shown by the agent. `offerLimit` is null when there is no limit; `says` states it in a sentence. Ads from the network do not count and are not limited. A rule’s own How often is its `frequency`. Maps to GET /system/offer-manager/settings.',
|
|
24
|
-
kind: 'read',
|
|
25
|
-
roleFloor: 'viewer',
|
|
26
|
-
capability: 'offer-manager',
|
|
27
|
-
input: {},
|
|
28
|
-
async run({ client }) {
|
|
29
|
-
return withSentence(await client.get(`${shared_1.OM}/settings`));
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
exports.setOfferLimit = (0, tool_1.defineTool)({
|
|
33
|
-
name: 'set_offer_limit',
|
|
34
|
-
title: 'Set the offer limit',
|
|
35
|
-
description: 'Set or remove the workspace’s offer limit: no customer sees more than `times` of the brand’s offers in any rolling `interval`. It applies at once to every agent, counted per agent: a customer at the limit with one agent gets no further offer from that agent (ads from the network still may appear). Pass `offerLimit: null` to remove it. Use get_offer_limit first so you change what is there. Maps to PUT /system/offer-manager/settings.',
|
|
36
|
-
kind: 'write',
|
|
37
|
-
roleFloor: 'editor',
|
|
38
|
-
capability: 'offer-manager',
|
|
39
|
-
reader: 'get_offer_limit',
|
|
40
|
-
input: { offerLimit: shared_1.offerLimit.nullable() },
|
|
41
|
-
approval: ({ offerLimit: limit }, before) => {
|
|
42
|
-
const had = before?.offerLimit ? clause(before.offerLimit) : '';
|
|
43
|
-
if (!limit)
|
|
44
|
-
return had
|
|
45
|
-
? `Remove the offer limit (now ${had}): customers can see any number of offers, paced only by each rule's How often.`
|
|
46
|
-
: "Remove the offer limit: customers can see any number of offers, paced only by each rule's How often.";
|
|
47
|
-
return `Set the offer limit: ${clause(limit)}. It counts each agent separately and applies at once; ads from the network are not limited.`;
|
|
48
|
-
},
|
|
49
|
-
async run({ client }, { offerLimit: limit }) {
|
|
50
|
-
return withSentence(await client.put(`${shared_1.OM}/settings`, { offerLimit: limit }));
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
exports.settingsTools = [exports.getOfferLimit, exports.setOfferLimit];
|
|
54
|
-
//# sourceMappingURL=settings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/tools/settings.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,+DAAiE;AACjE,kCAAqC;AACrC,qCAA0C;AAM1C,sEAAsE;AACtE,SAAS,MAAM,CAAC,KAA6B;IAC3C,MAAM,IAAI,GAAG,IAAA,8BAAgB,EAAC,KAAK,CAAC,CAAC;IACrC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,YAAY,CAAC,CAAW;IAC/B,OAAO,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,IAAA,8BAAgB,EAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC;AACxD,CAAC;AAEY,QAAA,aAAa,GAAG,IAAA,iBAAU,EAAC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AC,CACpE,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,CAAC,qBAAa,EAAE,qBAAa,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** The offer card fields a translation can target (design §7.1). */
|
|
2
|
-
export declare const CARD_FIELDS: readonly ["offer", "whoSeesIt", "when", "where", "notShownTo", "howOften", "schedule", "priority"];
|
|
3
|
-
export declare const translateRuleText: import("../tool").AnyTool;
|
|
4
|
-
export declare const previewRuleImpact: import("../tool").AnyTool;
|
|
5
|
-
export declare const describeRule: import("../tool").AnyTool;
|
|
6
|
-
export declare const translationTools: import("../tool").AnyTool[];
|
package/bin/tools/translation.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.translationTools = exports.describeRule = exports.previewRuleImpact = exports.translateRuleText = exports.CARD_FIELDS = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Rules in plain language: an instruction translated into a change to one
|
|
6
|
-
* rule (`translate_rule_text`), a saved rule described as its offer card
|
|
7
|
-
* (`describe_rule`), and how much recent traffic a draft would match
|
|
8
|
-
* (`preview_rule_impact`). All three are reads: translation proposes a
|
|
9
|
-
* change and saves nothing; saving is `create_rule` or `update_rule`.
|
|
10
|
-
*/
|
|
11
|
-
const offer_rules_1 = require("@advertising-chat/offer-rules");
|
|
12
|
-
const zod_1 = require("zod");
|
|
13
|
-
const tool_1 = require("../tool");
|
|
14
|
-
const shared_1 = require("./shared");
|
|
15
|
-
const R = offer_rules_1.RuleInput.shape;
|
|
16
|
-
/** The offer card fields a translation can target (design §7.1). */
|
|
17
|
-
exports.CARD_FIELDS = [
|
|
18
|
-
'offer',
|
|
19
|
-
'whoSeesIt',
|
|
20
|
-
'when',
|
|
21
|
-
'where',
|
|
22
|
-
'notShownTo',
|
|
23
|
-
'howOften',
|
|
24
|
-
'schedule',
|
|
25
|
-
'priority',
|
|
26
|
-
];
|
|
27
|
-
exports.translateRuleText = (0, tool_1.defineTool)({
|
|
28
|
-
name: 'translate_rule_text',
|
|
29
|
-
title: 'Translate an instruction into a rule change',
|
|
30
|
-
description: 'Turn what the user wrote in plain language into a change to one rule, checked against the agent’s catalog, moments, and the org’s offers, and read back as the offer card. Give the agent, the card field being edited (target), the instruction in the user’s words, and the rule: ruleId for a saved rule, or rule for a draft with unsaved changes. Nothing is saved. The outcome is one of: ok, with policy (fields to set), clear (fields to remove), readBack (the card after the change and which fields changed), and warnings (data the agent does not send yet, has not documented, or sends rarely): show the user the read-back and the warnings, preview_rule_impact the result, and save with update_rule (clear fields as null) or create_rule once they agree, passing instructions with the user’s words for each field the change set or cleared. clarify, with a question (message) and choices: ask the user, then translate again with the same instruction and clarifications listing every question asked so far with its answer, in order; record the instruction as the user’s words with the answers in parentheses. needs_data, when the agent does not send what the rule needs: relay the message and the note drafted for the agent’s team; add_attribute or create_moment registers what it proposes, and a rule on it matches no one until the agent sends it. unsupported, when the rule model cannot express it: say so; offer the nearest rule only if one is given, and say how it differs. If the user takes it, save it with instructions null for the fields it changed: their words describe a rule it does not quite write. Each call counts toward the workspace’s daily Assistant usage. Maps to POST /system/copilot/translate.',
|
|
31
|
-
kind: 'read',
|
|
32
|
-
roleFloor: 'viewer',
|
|
33
|
-
capability: 'offer-manager',
|
|
34
|
-
input: {
|
|
35
|
-
application: shared_1.application,
|
|
36
|
-
target: zod_1.z
|
|
37
|
-
.enum([...exports.CARD_FIELDS, 'rule'])
|
|
38
|
-
.optional()
|
|
39
|
-
.describe('The card field the instruction is about: offer, whoSeesIt (audience), when (moments), where (channels), notShownTo (exclusions), howOften (frequency), schedule, or priority. A field’s translation changes only that field. Default rule: the whole rule.'),
|
|
40
|
-
instruction: zod_1.z
|
|
41
|
-
.string()
|
|
42
|
-
.trim()
|
|
43
|
-
.min(1)
|
|
44
|
-
.max(2000)
|
|
45
|
-
.describe('What the user wrote, in their words, e.g. "prepaid customers who hit their data limit twice in a row".'),
|
|
46
|
-
clarifications: zod_1.z
|
|
47
|
-
.array(zod_1.z.strictObject({
|
|
48
|
-
question: zod_1.z.string().trim().min(1).max(500),
|
|
49
|
-
answer: zod_1.z.string().trim().min(1).max(500),
|
|
50
|
-
}))
|
|
51
|
-
.min(1)
|
|
52
|
-
.max(5)
|
|
53
|
-
.optional()
|
|
54
|
-
.describe('After one or more clarify outcomes: each question asked (its message) and the user’s answer, a choice or their own words, in the order asked. Send the same instruction as before.'),
|
|
55
|
-
ruleId: (0, shared_1.id)('rule')
|
|
56
|
-
.optional()
|
|
57
|
-
.describe('A saved rule to change. Omit with rule, or for a new rule.'),
|
|
58
|
-
rule: zod_1.z
|
|
59
|
-
.record(zod_1.z.string(), zod_1.z.unknown())
|
|
60
|
-
.optional()
|
|
61
|
-
.describe('The draft as it stands, unsaved changes included, with the fields of create_rule. Takes precedence over ruleId.'),
|
|
62
|
-
},
|
|
63
|
-
async run({ client }, args) {
|
|
64
|
-
const { rule, ...rest } = (0, shared_1.defined)(args);
|
|
65
|
-
let draft;
|
|
66
|
-
if (rule) {
|
|
67
|
-
const parsed = offer_rules_1.RuleDraft.safeParse({
|
|
68
|
-
...rule,
|
|
69
|
-
application: rule.application ?? args.application,
|
|
70
|
-
});
|
|
71
|
-
if (!parsed.success) {
|
|
72
|
-
throw new shared_1.ToolInputError(`The draft is not valid:\n${(0, shared_1.issues)(parsed.error)}`);
|
|
73
|
-
}
|
|
74
|
-
if (parsed.data.application !== args.application) {
|
|
75
|
-
throw new shared_1.ToolInputError('The draft belongs to a different agent.');
|
|
76
|
-
}
|
|
77
|
-
draft = parsed.data;
|
|
78
|
-
}
|
|
79
|
-
const answer = await client.post('/copilot/translate', {
|
|
80
|
-
...rest,
|
|
81
|
-
...(draft !== undefined && { rule: draft }),
|
|
82
|
-
});
|
|
83
|
-
// Model, timing, and token counts are for the console; leave them out.
|
|
84
|
-
const { meta: _meta, ...outcome } = answer ?? {}; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
85
|
-
return outcome;
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
exports.previewRuleImpact = (0, tool_1.defineTool)({
|
|
89
|
-
name: 'preview_rule_impact',
|
|
90
|
-
title: 'Preview a rule’s reach',
|
|
91
|
-
description: 'Estimate how much recent traffic a draft rule would match, before saving it: the percentage of a sample of up to 5,000 requests per moment from the last 7 days, the estimated number of distinct customers, why the rest did not match, and flags with notes (small or empty sample, nothing or everything matched, approximations). Read the notes back to the user; "no one matched" or "everyone matched" usually means the instruction was misread or the data is missing. A sample_building flag means some moments had no sample yet and were left out while one is taken; say so, and preview again in about a minute for the full estimate. Send the draft as it stands; only the agent and moments are required. Maps to POST /system/offer-manager/preview.',
|
|
92
|
-
kind: 'read',
|
|
93
|
-
roleFloor: 'viewer',
|
|
94
|
-
capability: 'offer-manager',
|
|
95
|
-
input: {
|
|
96
|
-
application: shared_1.application,
|
|
97
|
-
adUnits: R.adUnits.describe('The moment ids the draft applies to.'),
|
|
98
|
-
creatives: R.creatives
|
|
99
|
-
.optional()
|
|
100
|
-
.describe('The offer ids, for conditions on this offer’s history.'),
|
|
101
|
-
audience: R.audience,
|
|
102
|
-
exclusions: R.exclusions,
|
|
103
|
-
channels: R.channels,
|
|
104
|
-
schedule: R.schedule,
|
|
105
|
-
frequency: R.frequency,
|
|
106
|
-
id: (0, shared_1.id)('rule')
|
|
107
|
-
.optional()
|
|
108
|
-
.describe('The saved rule, when previewing a change to one.'),
|
|
109
|
-
},
|
|
110
|
-
async run({ client }, args) {
|
|
111
|
-
const { id: ruleId, ...draft } = (0, shared_1.defined)(args);
|
|
112
|
-
const parsed = offer_rules_1.PreviewDraft.safeParse({
|
|
113
|
-
...draft,
|
|
114
|
-
...(ruleId && { _id: ruleId }),
|
|
115
|
-
});
|
|
116
|
-
if (!parsed.success) {
|
|
117
|
-
throw new shared_1.ToolInputError(`The draft is not valid:\n${(0, shared_1.issues)(parsed.error)}`);
|
|
118
|
-
}
|
|
119
|
-
return client.post(`${shared_1.OM}/preview`, { rule: parsed.data });
|
|
120
|
-
},
|
|
121
|
-
});
|
|
122
|
-
exports.describeRule = (0, tool_1.defineTool)({
|
|
123
|
-
name: 'describe_rule',
|
|
124
|
-
title: 'Describe a rule',
|
|
125
|
-
description: 'A saved rule in plain language: its offer card, one sentence per field (agent, offer, who sees it, when, where, not shown to, how often, schedule, priority, status), written from the rule itself with its agent, moment, offer, and attribute names, plus a policy hash that changes when what the rule does changes. Maps to GET /system/offer-manager/describe/{id}.',
|
|
126
|
-
kind: 'read',
|
|
127
|
-
roleFloor: 'viewer',
|
|
128
|
-
capability: 'offer-manager',
|
|
129
|
-
input: { id: (0, shared_1.id)('rule') },
|
|
130
|
-
async run({ client }, { id: ruleId }) {
|
|
131
|
-
return client.get(`${shared_1.OM}/describe/${(0, shared_1.enc)(ruleId)}`);
|
|
132
|
-
},
|
|
133
|
-
});
|
|
134
|
-
exports.translationTools = [
|
|
135
|
-
exports.translateRuleText,
|
|
136
|
-
exports.describeRule,
|
|
137
|
-
exports.previewRuleImpact,
|
|
138
|
-
];
|
|
139
|
-
//# sourceMappingURL=translation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../src/tools/translation.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,+DAIuC;AACvC,6BAAwB;AACxB,kCAAqC;AACrC,qCASkB;AAElB,MAAM,CAAC,GAAG,uBAAS,CAAC,KAAK,CAAC;AAE1B,oEAAoE;AACvD,QAAA,WAAW,GAAG;IACzB,OAAO;IACP,WAAW;IACX,MAAM;IACN,OAAO;IACP,YAAY;IACZ,UAAU;IACV,UAAU;IACV,UAAU;CACF,CAAC;AAEE,QAAA,iBAAiB,GAAG,IAAA,iBAAU,EAAC;IAC1C,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,6CAA6C;IACpD,WAAW,EACT,6qDAA6qD;IAC/qD,IAAI,EAAE,MAA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