@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,298 @@
1
+ /**
2
+ * The Advertising.chat Flow Creative JSON Schema (spec v1).
3
+ *
4
+ * Source of truth: infrastructure/docs/design/flow-creative-spec.md §2.1.
5
+ * A flow is a small, bounded, advertiser-authored conversation graph:
6
+ * message nodes, tappable choices, NLU intent edges, and action nodes.
7
+ *
8
+ * CONVERGENCE CONTRACT: this file is maintained byte-for-byte identical in
9
+ * two repos — ads/src/ads/services/flowSchema.ts (server-side authoring
10
+ * validation) and adkit/packages/mcp/src/flow/flowSchema.ts
11
+ * (client-side pre-POST validation). The server MUST accept exactly what
12
+ * the client accepts; edit both copies together and treat the design doc
13
+ * §2.1 as the authority when they disagree.
14
+ */
15
+ export declare const FLOW_SCHEMA_ID = "https://docs.advertising.chat/schemas/flow-creative-1.json";
16
+ export declare const flowSchema: {
17
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
18
+ readonly $id: "https://docs.advertising.chat/schemas/flow-creative-1.json";
19
+ readonly title: "Advertising.chat Flow Creative";
20
+ readonly type: "object";
21
+ readonly required: readonly ["specVersion", "entryNodeId", "metadata", "nodes"];
22
+ readonly additionalProperties: false;
23
+ readonly properties: {
24
+ readonly specVersion: {
25
+ readonly type: "string";
26
+ readonly pattern: "^1(\\.[0-9]+)?$";
27
+ readonly description: string;
28
+ };
29
+ readonly entryNodeId: {
30
+ readonly type: "string";
31
+ readonly description: "id of the node where execution starts. Must reference a message node.";
32
+ };
33
+ readonly metadata: {
34
+ readonly type: "object";
35
+ readonly required: readonly ["advertiserName", "disclosureText"];
36
+ readonly additionalProperties: false;
37
+ readonly properties: {
38
+ readonly advertiserName: {
39
+ readonly type: "string";
40
+ readonly minLength: 1;
41
+ readonly maxLength: 80;
42
+ };
43
+ readonly disclosureText: {
44
+ readonly type: "string";
45
+ readonly minLength: 1;
46
+ readonly maxLength: 100;
47
+ readonly description: string;
48
+ };
49
+ readonly brandLogoUrl: {
50
+ readonly type: "string";
51
+ readonly format: "uri";
52
+ };
53
+ readonly teaser: {
54
+ readonly type: "string";
55
+ readonly maxLength: 120;
56
+ readonly description: string;
57
+ };
58
+ readonly language: {
59
+ readonly type: "string";
60
+ readonly default: "en";
61
+ };
62
+ };
63
+ };
64
+ readonly nodes: {
65
+ readonly type: "array";
66
+ readonly minItems: 1;
67
+ readonly maxItems: 12;
68
+ readonly items: {
69
+ readonly $ref: "#/$defs/node";
70
+ };
71
+ };
72
+ };
73
+ readonly $defs: {
74
+ readonly node: {
75
+ readonly oneOf: readonly [{
76
+ readonly $ref: "#/$defs/messageNode";
77
+ }, {
78
+ readonly $ref: "#/$defs/choiceSetNode";
79
+ }, {
80
+ readonly $ref: "#/$defs/actionNode";
81
+ }];
82
+ };
83
+ readonly nodeId: {
84
+ readonly type: "string";
85
+ readonly pattern: "^[a-z0-9][a-z0-9_-]{0,31}$";
86
+ };
87
+ readonly messageNode: {
88
+ readonly type: "object";
89
+ readonly required: readonly ["id", "type", "text"];
90
+ readonly additionalProperties: false;
91
+ readonly properties: {
92
+ readonly id: {
93
+ readonly $ref: "#/$defs/nodeId";
94
+ };
95
+ readonly type: {
96
+ readonly const: "message";
97
+ };
98
+ readonly text: {
99
+ readonly type: "string";
100
+ readonly minLength: 1;
101
+ readonly maxLength: 640;
102
+ readonly description: "Advertiser-authored copy. Executors MUST render verbatim.";
103
+ };
104
+ readonly smsText: {
105
+ readonly type: "string";
106
+ readonly maxLength: 320;
107
+ readonly description: "Optional SMS-length variant. If absent, SMS uses `text`.";
108
+ };
109
+ readonly imageUrl: {
110
+ readonly type: "string";
111
+ readonly format: "uri";
112
+ };
113
+ readonly imageAltText: {
114
+ readonly type: "string";
115
+ readonly maxLength: 200;
116
+ };
117
+ readonly next: {
118
+ readonly $ref: "#/$defs/nodeId";
119
+ readonly description: string;
120
+ };
121
+ };
122
+ };
123
+ readonly choiceSetNode: {
124
+ readonly type: "object";
125
+ readonly required: readonly ["id", "type", "prompt", "choices"];
126
+ readonly additionalProperties: false;
127
+ readonly properties: {
128
+ readonly id: {
129
+ readonly $ref: "#/$defs/nodeId";
130
+ };
131
+ readonly type: {
132
+ readonly const: "choice-set";
133
+ };
134
+ readonly prompt: {
135
+ readonly type: "string";
136
+ readonly minLength: 1;
137
+ readonly maxLength: 640;
138
+ };
139
+ readonly smsPrompt: {
140
+ readonly type: "string";
141
+ readonly maxLength: 320;
142
+ };
143
+ readonly choices: {
144
+ readonly type: "array";
145
+ readonly minItems: 1;
146
+ readonly maxItems: 4;
147
+ readonly items: {
148
+ readonly type: "object";
149
+ readonly required: readonly ["id", "label", "target"];
150
+ readonly additionalProperties: false;
151
+ readonly properties: {
152
+ readonly id: {
153
+ readonly $ref: "#/$defs/nodeId";
154
+ };
155
+ readonly label: {
156
+ readonly type: "string";
157
+ readonly minLength: 1;
158
+ readonly maxLength: 25;
159
+ };
160
+ readonly target: {
161
+ readonly $ref: "#/$defs/nodeId";
162
+ };
163
+ };
164
+ };
165
+ };
166
+ readonly intents: {
167
+ readonly type: "array";
168
+ readonly maxItems: 4;
169
+ readonly description: string;
170
+ readonly items: {
171
+ readonly type: "object";
172
+ readonly required: readonly ["intent", "description", "examples", "target"];
173
+ readonly additionalProperties: false;
174
+ readonly properties: {
175
+ readonly intent: {
176
+ readonly type: "string";
177
+ readonly pattern: "^[a-z0-9_]{1,32}$";
178
+ };
179
+ readonly description: {
180
+ readonly type: "string";
181
+ readonly minLength: 1;
182
+ readonly maxLength: 200;
183
+ readonly description: string;
184
+ };
185
+ readonly examples: {
186
+ readonly type: "array";
187
+ readonly minItems: 1;
188
+ readonly maxItems: 5;
189
+ readonly items: {
190
+ readonly type: "string";
191
+ readonly maxLength: 100;
192
+ };
193
+ };
194
+ readonly target: {
195
+ readonly $ref: "#/$defs/nodeId";
196
+ };
197
+ };
198
+ };
199
+ };
200
+ readonly noMatchTarget: {
201
+ readonly $ref: "#/$defs/nodeId";
202
+ readonly description: string;
203
+ };
204
+ };
205
+ };
206
+ readonly actionNode: {
207
+ readonly type: "object";
208
+ readonly required: readonly ["id", "type", "action"];
209
+ readonly additionalProperties: false;
210
+ readonly properties: {
211
+ readonly id: {
212
+ readonly $ref: "#/$defs/nodeId";
213
+ };
214
+ readonly type: {
215
+ readonly const: "action";
216
+ };
217
+ readonly text: {
218
+ readonly type: "string";
219
+ readonly maxLength: 640;
220
+ readonly description: "Optional closing copy rendered with the action.";
221
+ };
222
+ readonly action: {
223
+ readonly oneOf: readonly [{
224
+ readonly type: "object";
225
+ readonly required: readonly ["kind", "url", "label"];
226
+ readonly additionalProperties: false;
227
+ readonly properties: {
228
+ readonly kind: {
229
+ readonly const: "link_out";
230
+ };
231
+ readonly url: {
232
+ readonly type: "string";
233
+ readonly format: "uri";
234
+ };
235
+ readonly label: {
236
+ readonly type: "string";
237
+ readonly minLength: 1;
238
+ readonly maxLength: 25;
239
+ };
240
+ };
241
+ }, {
242
+ readonly type: "object";
243
+ readonly required: readonly ["kind", "conversionName"];
244
+ readonly additionalProperties: false;
245
+ readonly properties: {
246
+ readonly kind: {
247
+ readonly const: "conversion";
248
+ };
249
+ readonly conversionName: {
250
+ readonly type: "string";
251
+ readonly maxLength: 64;
252
+ };
253
+ readonly value: {
254
+ readonly type: "number";
255
+ };
256
+ readonly cur: {
257
+ readonly type: "string";
258
+ readonly maxLength: 3;
259
+ };
260
+ };
261
+ }, {
262
+ readonly type: "object";
263
+ readonly required: readonly ["kind", "url", "label"];
264
+ readonly additionalProperties: false;
265
+ readonly properties: {
266
+ readonly kind: {
267
+ readonly const: "handoff";
268
+ };
269
+ readonly url: {
270
+ readonly type: "string";
271
+ readonly format: "uri";
272
+ readonly description: string;
273
+ };
274
+ readonly label: {
275
+ readonly type: "string";
276
+ readonly minLength: 1;
277
+ readonly maxLength: 25;
278
+ };
279
+ };
280
+ }, {
281
+ readonly type: "object";
282
+ readonly required: readonly ["kind"];
283
+ readonly additionalProperties: false;
284
+ readonly properties: {
285
+ readonly kind: {
286
+ readonly const: "end";
287
+ };
288
+ };
289
+ }];
290
+ };
291
+ readonly next: {
292
+ readonly $ref: "#/$defs/nodeId";
293
+ readonly description: string;
294
+ };
295
+ };
296
+ };
297
+ };
298
+ };
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flowSchema = exports.FLOW_SCHEMA_ID = void 0;
4
+ /**
5
+ * The Advertising.chat Flow Creative JSON Schema (spec v1).
6
+ *
7
+ * Source of truth: infrastructure/docs/design/flow-creative-spec.md §2.1.
8
+ * A flow is a small, bounded, advertiser-authored conversation graph:
9
+ * message nodes, tappable choices, NLU intent edges, and action nodes.
10
+ *
11
+ * CONVERGENCE CONTRACT: this file is maintained byte-for-byte identical in
12
+ * two repos — ads/src/ads/services/flowSchema.ts (server-side authoring
13
+ * validation) and adkit/packages/mcp/src/flow/flowSchema.ts
14
+ * (client-side pre-POST validation). The server MUST accept exactly what
15
+ * the client accepts; edit both copies together and treat the design doc
16
+ * §2.1 as the authority when they disagree.
17
+ */
18
+ exports.FLOW_SCHEMA_ID = 'https://docs.advertising.chat/schemas/flow-creative-1.json';
19
+ exports.flowSchema = {
20
+ $schema: 'https://json-schema.org/draft/2020-12/schema',
21
+ $id: exports.FLOW_SCHEMA_ID,
22
+ title: 'Advertising.chat Flow Creative',
23
+ type: 'object',
24
+ required: ['specVersion', 'entryNodeId', 'metadata', 'nodes'],
25
+ additionalProperties: false,
26
+ properties: {
27
+ specVersion: {
28
+ type: 'string',
29
+ pattern: '^1(\\.[0-9]+)?$',
30
+ description: 'Spec major.minor. v1 executors MUST reject an unknown major and ' +
31
+ 'MUST ignore unknown fields introduced by minors.',
32
+ },
33
+ entryNodeId: {
34
+ type: 'string',
35
+ description: 'id of the node where execution starts. Must reference a message node.',
36
+ },
37
+ metadata: {
38
+ type: 'object',
39
+ required: ['advertiserName', 'disclosureText'],
40
+ additionalProperties: false,
41
+ properties: {
42
+ advertiserName: { type: 'string', minLength: 1, maxLength: 80 },
43
+ disclosureText: {
44
+ type: 'string',
45
+ minLength: 1,
46
+ maxLength: 100,
47
+ description: 'REQUIRED. Shown/spoken before or with the entry node on every ' +
48
+ "surface (e.g. 'Sponsored · Acme Coffee'). Executors MUST NOT " +
49
+ 'suppress it.',
50
+ },
51
+ brandLogoUrl: { type: 'string', format: 'uri' },
52
+ teaser: {
53
+ type: 'string',
54
+ maxLength: 120,
55
+ description: "One-line invitation used by the web embed's collapsed state " +
56
+ "and as optional SMS lead-in. Defaults to the entry node's " +
57
+ 'text truncated.',
58
+ },
59
+ language: { type: 'string', default: 'en' },
60
+ },
61
+ },
62
+ nodes: {
63
+ type: 'array',
64
+ minItems: 1,
65
+ maxItems: 12,
66
+ items: { $ref: '#/$defs/node' },
67
+ },
68
+ },
69
+ $defs: {
70
+ node: {
71
+ oneOf: [
72
+ { $ref: '#/$defs/messageNode' },
73
+ { $ref: '#/$defs/choiceSetNode' },
74
+ { $ref: '#/$defs/actionNode' },
75
+ ],
76
+ },
77
+ nodeId: { type: 'string', pattern: '^[a-z0-9][a-z0-9_-]{0,31}$' },
78
+ messageNode: {
79
+ type: 'object',
80
+ required: ['id', 'type', 'text'],
81
+ additionalProperties: false,
82
+ properties: {
83
+ id: { $ref: '#/$defs/nodeId' },
84
+ type: { const: 'message' },
85
+ text: {
86
+ type: 'string',
87
+ minLength: 1,
88
+ maxLength: 640,
89
+ description: 'Advertiser-authored copy. Executors MUST render verbatim.',
90
+ },
91
+ smsText: {
92
+ type: 'string',
93
+ maxLength: 320,
94
+ description: 'Optional SMS-length variant. If absent, SMS uses `text`.',
95
+ },
96
+ imageUrl: { type: 'string', format: 'uri' },
97
+ imageAltText: { type: 'string', maxLength: 200 },
98
+ next: {
99
+ $ref: '#/$defs/nodeId',
100
+ description: 'Unconditional edge. Required unless this node is followed by ' +
101
+ 'nothing (invalid — message nodes must lead somewhere; ' +
102
+ 'terminals are action nodes).',
103
+ },
104
+ },
105
+ },
106
+ choiceSetNode: {
107
+ type: 'object',
108
+ required: ['id', 'type', 'prompt', 'choices'],
109
+ additionalProperties: false,
110
+ properties: {
111
+ id: { $ref: '#/$defs/nodeId' },
112
+ type: { const: 'choice-set' },
113
+ prompt: { type: 'string', minLength: 1, maxLength: 640 },
114
+ smsPrompt: { type: 'string', maxLength: 320 },
115
+ choices: {
116
+ type: 'array',
117
+ minItems: 1,
118
+ maxItems: 4,
119
+ items: {
120
+ type: 'object',
121
+ required: ['id', 'label', 'target'],
122
+ additionalProperties: false,
123
+ properties: {
124
+ id: { $ref: '#/$defs/nodeId' },
125
+ label: { type: 'string', minLength: 1, maxLength: 25 },
126
+ target: { $ref: '#/$defs/nodeId' },
127
+ },
128
+ },
129
+ },
130
+ intents: {
131
+ type: 'array',
132
+ maxItems: 4,
133
+ description: "NLU edges, executed by the publisher's LLM (AdKit) or by " +
134
+ 'keyword match on dumb channels. Advisory on SMS.',
135
+ items: {
136
+ type: 'object',
137
+ required: ['intent', 'description', 'examples', 'target'],
138
+ additionalProperties: false,
139
+ properties: {
140
+ intent: { type: 'string', pattern: '^[a-z0-9_]{1,32}$' },
141
+ description: {
142
+ type: 'string',
143
+ minLength: 1,
144
+ maxLength: 200,
145
+ description: 'Natural-language definition of when this edge fires, ' +
146
+ "written for an LLM. e.g. 'The user asks about price, " +
147
+ "cost, or discounts.'",
148
+ },
149
+ examples: {
150
+ type: 'array',
151
+ minItems: 1,
152
+ maxItems: 5,
153
+ items: { type: 'string', maxLength: 100 },
154
+ },
155
+ target: { $ref: '#/$defs/nodeId' },
156
+ },
157
+ },
158
+ },
159
+ noMatchTarget: {
160
+ $ref: '#/$defs/nodeId',
161
+ description: 'Edge taken when free text matches no intent. If absent, ' +
162
+ 'executors re-present the choices once, then treat a second ' +
163
+ "miss as flow_abandon(reason:'no_match').",
164
+ },
165
+ },
166
+ },
167
+ actionNode: {
168
+ type: 'object',
169
+ required: ['id', 'type', 'action'],
170
+ additionalProperties: false,
171
+ properties: {
172
+ id: { $ref: '#/$defs/nodeId' },
173
+ type: { const: 'action' },
174
+ text: {
175
+ type: 'string',
176
+ maxLength: 640,
177
+ description: 'Optional closing copy rendered with the action.',
178
+ },
179
+ action: {
180
+ oneOf: [
181
+ {
182
+ type: 'object',
183
+ required: ['kind', 'url', 'label'],
184
+ additionalProperties: false,
185
+ properties: {
186
+ kind: { const: 'link_out' },
187
+ url: { type: 'string', format: 'uri' },
188
+ label: { type: 'string', minLength: 1, maxLength: 25 },
189
+ },
190
+ },
191
+ {
192
+ type: 'object',
193
+ required: ['kind', 'conversionName'],
194
+ additionalProperties: false,
195
+ properties: {
196
+ kind: { const: 'conversion' },
197
+ conversionName: { type: 'string', maxLength: 64 },
198
+ value: { type: 'number' },
199
+ cur: { type: 'string', maxLength: 3 },
200
+ },
201
+ },
202
+ {
203
+ type: 'object',
204
+ required: ['kind', 'url', 'label'],
205
+ additionalProperties: false,
206
+ properties: {
207
+ kind: { const: 'handoff' },
208
+ url: {
209
+ type: 'string',
210
+ format: 'uri',
211
+ description: "Deep link to the advertiser's own conversation surface " +
212
+ '(their bot, WhatsApp, an AnyChat agent, ...).',
213
+ },
214
+ label: { type: 'string', minLength: 1, maxLength: 25 },
215
+ },
216
+ },
217
+ {
218
+ type: 'object',
219
+ required: ['kind'],
220
+ additionalProperties: false,
221
+ properties: { kind: { const: 'end' } },
222
+ },
223
+ ],
224
+ },
225
+ next: {
226
+ $ref: '#/$defs/nodeId',
227
+ description: 'Optional continuation after a conversion action. link_out / ' +
228
+ 'handoff / end are terminal; `next` is invalid on them.',
229
+ },
230
+ },
231
+ },
232
+ },
233
+ };
234
+ //# sourceMappingURL=flowSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowSchema.js","sourceRoot":"","sources":["../../src/flow/flowSchema.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;GAaG;AACU,QAAA,cAAc,GACzB,4DAA4D,CAAC;AAElD,QAAA,UAAU,GAAG;IACxB,OAAO,EAAE,8CAA8C;IACvD,GAAG,EAAE,sBAAc;IACnB,KAAK,EAAE,gCAAgC;IACvC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC;IAC7D,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,WAAW,EAAE;YAC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SAAS,EAAE,CAAC,EAAE;6BACtC;yBACF;wBACD;4BACE,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC;4BAClC,oBAAoB,EAAE,KAAK;4BAC3B,UAAU,EAAE;gCACV,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;gCAC1B,GAAG,EAAE;oCACH,IAAI,EAAE,QAAQ;oCACd,MAAM,EAAE,KAAK;oCACb,WAAW,EACT,yDAAyD;wCACzD,+CAA+C;iCAClD;gCACD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;6BACvD;yBACF;wBACD;4BACE,IAAI,EAAE,QAAQ;4BACd,QAAQ,EAAE,CAAC,MAAM,CAAC;4BAClB,oBAAoB,EAAE,KAAK;4BAC3B,UAAU,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;yBACvC;qBACF;iBACF;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,gBAAgB;oBACtB,WAAW,EACT,8DAA8D;wBAC9D,wDAAwD;iBAC3D;aACF;SACF;KACF;CACO,CAAC"}
@@ -0,0 +1,15 @@
1
+ export interface FlowValidationResult {
2
+ valid: boolean;
3
+ errors: string[];
4
+ }
5
+ /**
6
+ * Validate a flow payload against the v1 spec: JSON Schema shape first,
7
+ * then the graph invariants. Returns human/LLM-readable error strings.
8
+ */
9
+ export declare function validateFlowPayload(flow: unknown): FlowValidationResult;
10
+ /**
11
+ * An ajv instance path (JSON Pointer, `/nodes/0/text`) in the dotted style
12
+ * the graph checks use (`.nodes[0].text`), so every error names its property
13
+ * one way, as the ads service's validator does.
14
+ */
15
+ export declare function propertyPath(pointer: string): string;