@sellable/mcp 0.1.793 → 0.1.794

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 (54) hide show
  1. package/dist/agent-tool-names.d.ts +2 -2
  2. package/dist/agent-tool-names.js +14 -0
  3. package/dist/scheduler-envelope.d.ts +190 -0
  4. package/dist/scheduler-envelope.js +412 -0
  5. package/dist/server.js +28 -2
  6. package/dist/tools/campaign-message-preparation.d.ts +25 -0
  7. package/dist/tools/campaign-message-preparation.js +37 -0
  8. package/dist/tools/campaign-processing.d.ts +74 -1
  9. package/dist/tools/campaign-processing.js +57 -1
  10. package/dist/tools/prompts.d.ts +15 -3
  11. package/dist/tools/prompts.js +25 -0
  12. package/dist/tools/refill-executors.d.ts +43 -70
  13. package/dist/tools/refill-executors.js +201 -273
  14. package/dist/tools/refill-sends.d.ts +3 -3
  15. package/dist/tools/refill-sends.js +1 -1
  16. package/dist/tools/refill-target-plan.js +1 -1
  17. package/dist/tools/refill-v3-advance-contract.d.ts +618 -0
  18. package/dist/tools/refill-v3-advance-contract.js +920 -0
  19. package/dist/tools/refill-v3-advance.d.ts +397 -0
  20. package/dist/tools/refill-v3-advance.js +75 -0
  21. package/dist/tools/refill-v3-attention-packet-contract.d.ts +608 -0
  22. package/dist/tools/refill-v3-attention-packet-contract.js +911 -0
  23. package/dist/tools/refill-v3-campaign-work.d.ts +324 -0
  24. package/dist/tools/refill-v3-campaign-work.js +1015 -0
  25. package/dist/tools/refill-v3-continue-contract.d.ts +433 -0
  26. package/dist/tools/refill-v3-continue-contract.js +112 -0
  27. package/dist/tools/refill-v3-continue.d.ts +501 -0
  28. package/dist/tools/refill-v3-continue.js +654 -0
  29. package/dist/tools/refill-v3-edit-selected-campaign-contract.d.ts +208 -0
  30. package/dist/tools/refill-v3-edit-selected-campaign-contract.js +351 -0
  31. package/dist/tools/refill-v3-edit-selected-campaign.d.ts +232 -0
  32. package/dist/tools/refill-v3-edit-selected-campaign.js +147 -0
  33. package/dist/tools/refill-v3-fill-ready-contract.d.ts +198 -0
  34. package/dist/tools/refill-v3-fill-ready-contract.js +324 -0
  35. package/dist/tools/refill-v3-fill-ready.d.ts +199 -0
  36. package/dist/tools/refill-v3-fill-ready.js +136 -0
  37. package/dist/tools/refill-v3-source-family-dispatch.d.ts +249 -0
  38. package/dist/tools/refill-v3-source-family-dispatch.js +514 -0
  39. package/dist/tools/refill-v3-waterfall-contract.d.ts +156 -0
  40. package/dist/tools/refill-v3-waterfall-contract.js +181 -0
  41. package/dist/tools/refill-v3-waterfall.d.ts +136 -0
  42. package/dist/tools/refill-v3-waterfall.js +161 -0
  43. package/dist/tools/refill-v3-world-state-contract.d.ts +666 -0
  44. package/dist/tools/refill-v3-world-state-contract.js +790 -0
  45. package/dist/tools/refill-v3-world-state.d.ts +592 -0
  46. package/dist/tools/refill-v3-world-state.js +137 -0
  47. package/dist/tools/registry.d.ts +1710 -3
  48. package/dist/tools/registry.js +19 -0
  49. package/package.json +1 -1
  50. package/skills/refill-sends/SKILL.md +89 -4
  51. package/skills/refill-sends-waterfall-order/SKILL.md +174 -0
  52. package/skills/refill-sends-work-campaign/SKILL.md +253 -0
  53. package/skills/refill-sends-workflow/SKILL.md +112 -5
  54. package/skills/refill-sends-workflow/core/flow.v3.json +209 -0
@@ -0,0 +1,666 @@
1
+ /**
2
+ * Refill V3 world-state PACKAGE seam.
3
+ *
4
+ * This module is the SOLE owner of the public result contract:
5
+ * - the canonical result/row/campaign/reason/effect types;
6
+ * - the finite output vocabularies and the forbidden-leak key list;
7
+ * - `REFILL_V3_WORLD_STATE_OUTPUT_SCHEMA`; and
8
+ * - `decodeRefillWorldStateResult`, the ONE unknown-value decoder.
9
+ *
10
+ * It lives inside `@sellable/mcp` so the public MCP tool can compile and ship
11
+ * the contract. The app seam `src/lib/refill-v3/world-state-contract.ts`
12
+ * imports FROM here and type-only re-exports these symbols; nothing here may
13
+ * import app `src/**`, and no consumer may copy the decoder.
14
+ *
15
+ * Decoding rules:
16
+ * - hand-rolled type guards plus as-const JSON-Schema literals (A02-NO-ZOD);
17
+ * - strict inbound, tolerant outbound, and lossless;
18
+ * - an unrecognized ENUM VALUE drops only the SMALLEST unit that carries it,
19
+ * so one new job kind can never blank a healthy workspace; and
20
+ * - only a malformed envelope, a missing required top-level key, or a policy
21
+ * leak key rejects the whole result.
22
+ */
23
+ import { type RefillV3ActiveJob, type RefillV3LeadSourceFamily, type RefillV3SchemaVersionUnsupported, type RefillV3SupplyCounts } from "./refill-v3-attention-packet-contract.js";
24
+ export type { RefillV3ActiveJob, RefillV3LeadSourceFamily, RefillV3SupplyCounts, };
25
+ export declare const REFILL_V3_WORLD_STATE_SCHEMA_NAMESPACE: "refill_v3_world_state";
26
+ export declare const REFILL_V3_WORLD_STATE_SCHEMA_MAJOR = 1;
27
+ export declare const REFILL_V3_WORLD_STATE_SCHEMA_VERSION: "refill_v3_world_state.v1.0";
28
+ /** The only two Refill V3 lanes in this version. There is no lane input. */
29
+ export declare const REFILL_V3_WORLD_STATE_LANES: readonly ["connection_invite", "paid_inmail"];
30
+ export type RefillWorldStateLane = (typeof REFILL_V3_WORLD_STATE_LANES)[number];
31
+ export declare const REFILL_V3_WORLD_STATE_REASON_KINDS: readonly ["unavailable", "retry_required", "invalid_campaign_configuration"];
32
+ export type RefillWorldStateReasonKind = (typeof REFILL_V3_WORLD_STATE_REASON_KINDS)[number];
33
+ /**
34
+ * Exactly three PUBLIC cooldown codes. Canonical `endpoint_cooldown` survives
35
+ * as the separate finite blocker `endpoint_temporarily_unavailable` with a
36
+ * `resumeAt`; it is deliberately not a fourth cooldown.
37
+ */
38
+ export declare const REFILL_V3_WORLD_STATE_COOLDOWN_CODES: readonly ["global_cooldown", "connection_cooldown", "paid_inmail_cooldown"];
39
+ export declare const REFILL_V3_WORLD_STATE_REASON_CODES: readonly ["global_cooldown", "connection_cooldown", "paid_inmail_cooldown", "endpoint_temporarily_unavailable", "date_in_past", "no_sending_hours", "sender_disconnected", "sender_limit_reached", "daily_target_met", "no_eligible_campaign", "no_ready_supply", "sales_nav_disconnected", "insufficient_paid_credits", "paid_inmail_connection_health_recheck_required", "paid_inmail_credit_refresh_failed", "invalid_paid_configuration", "campaign_table_missing", "campaign_sequence_invalid", "source_family_unresolved", "campaign_work_in_flight"];
40
+ export type RefillWorldStateReasonCode = (typeof REFILL_V3_WORLD_STATE_REASON_CODES)[number];
41
+ export declare const REFILL_V3_WORLD_STATE_CAMPAIGN_STATUSES: readonly ["ACTIVE", "PAUSED"];
42
+ export type RefillWorldStateCampaignStatus = (typeof REFILL_V3_WORLD_STATE_CAMPAIGN_STATUSES)[number];
43
+ export declare const REFILL_V3_WORLD_STATE_EFFECTIVENESS: readonly ["unknown", "low", "medium", "high"];
44
+ export type RefillWorldStateEffectiveness = (typeof REFILL_V3_WORLD_STATE_EFFECTIVENESS)[number];
45
+ export declare const REFILL_V3_WORLD_STATE_SUPPLY_HEALTH: readonly ["unknown", "healthy", "thin", "dry"];
46
+ export type RefillWorldStateSupplyHealth = (typeof REFILL_V3_WORLD_STATE_SUPPLY_HEALTH)[number];
47
+ /**
48
+ * The PUBLIC paid-credit cache outcome. Observation performs zero product
49
+ * mutations, and this is the one bookkeeping effect it is allowed to report,
50
+ * which is why the tool must never claim literal `readOnlyHint: true`.
51
+ *
52
+ * The app's internal `REFILL_V3_PAID_CREDIT_CACHE_EFFECTS` is the OBSERVER-side
53
+ * vocabulary. It is a retained predecessor authority owned by Plan 01, so the
54
+ * two are bound by an executable set-equality assertion in the app suite rather
55
+ * than by one of them silently forking.
56
+ */
57
+ export declare const REFILL_V3_WORLD_STATE_CACHE_OUTCOMES: readonly ["not_checked", "not_eligible", "fresh_cache_used", "refresh_started", "refreshed", "refresh_in_progress", "refresh_failed", "uncertain"];
58
+ export type RefillWorldStateCacheOutcome = (typeof REFILL_V3_WORLD_STATE_CACHE_OUTCOMES)[number];
59
+ export declare const REFILL_V3_WORLD_STATE_PRODUCT_EFFECT_KEYS: readonly ["scheduled", "placed", "sent", "campaignMutated", "approved", "enriched", "generated", "salesNavigatorActioned"];
60
+ export type RefillWorldStateProductEffectKey = (typeof REFILL_V3_WORLD_STATE_PRODUCT_EFFECT_KEYS)[number];
61
+ /**
62
+ * Policy and identity classes the public result must never carry. `leaves`,
63
+ * `campaignActionFacts`, and `possibleActions` are internal implementation
64
+ * terms; raw row/cell/table/action identities are fetched just in time by the
65
+ * diagnostic authority; and graph/rank/selection fields would move backend
66
+ * authority into the caller.
67
+ */
68
+ export declare const REFILL_V3_WORLD_STATE_FORBIDDEN_LEAK_KEYS: readonly ["campaignActionFacts", "leaves", "possibleActions", "boundedRowIds", "rowIds", "rowId", "cellId", "cellIds", "tableId", "actionId", "actionIds", "actionColumnId", "graph", "rank", "ranking", "selectedCampaign", "waterfall", "queryDebug"];
69
+ export type RefillWorldStateForbiddenLeakKey = (typeof REFILL_V3_WORLD_STATE_FORBIDDEN_LEAK_KEYS)[number];
70
+ export type RefillWorldStateSender = {
71
+ id: string;
72
+ name: string;
73
+ timezone: string;
74
+ };
75
+ export type RefillWorldStateReason = {
76
+ kind: RefillWorldStateReasonKind;
77
+ codes: RefillWorldStateReasonCode[];
78
+ message: string;
79
+ resumeAt?: string;
80
+ };
81
+ /**
82
+ * REAL engagement numbers behind the `effectiveness` band (146.5-12 §87,
83
+ * user directive): computed from the product's OWN engagement owner
84
+ * (`getBatchEngagementStats` over LinkedInOutreach) — `sends` is the owner's
85
+ * non-FAILED sent count, `acceptRate`/`replyRate` are the SAME integer
86
+ * percentages the campaigns surface shows (`Math.round(x/sends*100)`,
87
+ * 0 when sends is 0). ADDITIVE and OPTIONAL: an older backend omits it and
88
+ * the band stays the only signal; numbers are never fabricated. `sends` is
89
+ * the sample size — small N is visible by construction.
90
+ */
91
+ export type RefillWorldStateCampaignEngagement = {
92
+ sends: number;
93
+ accepted: number;
94
+ replied: number;
95
+ acceptRate: number;
96
+ replyRate: number;
97
+ };
98
+ export type RefillWorldStateCampaignEvidence = {
99
+ evergreen: boolean;
100
+ lastActualUseAt: string | null;
101
+ lastScheduledUseAt: string | null;
102
+ effectiveness: RefillWorldStateEffectiveness;
103
+ supplyHealth: RefillWorldStateSupplyHealth;
104
+ engagement?: RefillWorldStateCampaignEngagement;
105
+ };
106
+ /**
107
+ * The ONE canonical campaign entry. The app seam type-only re-exports this
108
+ * exact symbol; it declares no mirror and no widened variant.
109
+ */
110
+ export type CampaignOption = {
111
+ id: string;
112
+ name: string;
113
+ status: RefillWorldStateCampaignStatus;
114
+ lanes: RefillWorldStateLane[];
115
+ eligible: boolean;
116
+ reason: RefillWorldStateReason | null;
117
+ startEligible: boolean;
118
+ activeJob: RefillV3ActiveJob | null;
119
+ supply: RefillV3SupplyCounts;
120
+ leadSourceFamily: RefillV3LeadSourceFamily;
121
+ evidence: RefillWorldStateCampaignEvidence;
122
+ };
123
+ /**
124
+ * The account-level paid-credit numbers behind a paid row's credit gate
125
+ * (146.5-12 §84, additive): the operator-reviewable evidence — best-known
126
+ * available credits, the lowest column floor among the sender's paid
127
+ * campaigns, when the fact was last proven, and whether the canonical validity
128
+ * predicate accepted it. Carried on paid rows only.
129
+ *
130
+ * PUBLIC per the coordinator ruling (146.5-12 §84b, typed-honesty law): an
131
+ * agent session must be able to tell the operator WHY a paid lane is 0, and
132
+ * the production e2e adjudicates against these numbers. Additive optional —
133
+ * absent on invite rows and on older backends.
134
+ */
135
+ export type RefillWorldStatePaidCreditEvidence = {
136
+ availableCredits: number | null;
137
+ minimumRequired: number | null;
138
+ checkedAt: string | null;
139
+ fresh: boolean;
140
+ };
141
+ export type RefillWorldStateRow = {
142
+ date: string;
143
+ sender: RefillWorldStateSender;
144
+ lane: RefillWorldStateLane;
145
+ targetSlots: number;
146
+ takenSlots: number;
147
+ availableSlots: number;
148
+ reason: RefillWorldStateReason | null;
149
+ activeCampaigns: CampaignOption[];
150
+ inactiveCampaigns: CampaignOption[];
151
+ /** Present on paid rows once a credit observation ran; see the type doc. */
152
+ paidCreditEvidence?: RefillWorldStatePaidCreditEvidence | null;
153
+ };
154
+ export type RefillWorldStateObservationSideEffects = {
155
+ scheduled: false;
156
+ placed: false;
157
+ sent: false;
158
+ campaignMutated: false;
159
+ approved: false;
160
+ enriched: false;
161
+ generated: false;
162
+ salesNavigatorActioned: false;
163
+ paidCreditCache: RefillWorldStateCacheOutcome;
164
+ };
165
+ export type RefillWorldStateResult = {
166
+ rows: RefillWorldStateRow[];
167
+ durationMs: number;
168
+ observationSideEffects: RefillWorldStateObservationSideEffects;
169
+ };
170
+ /** Every product mutation boolean, reported explicitly rather than omitted. */
171
+ export declare const REFILL_V3_WORLD_STATE_ZERO_PRODUCT_EFFECTS: Readonly<{
172
+ readonly scheduled: false;
173
+ readonly placed: false;
174
+ readonly sent: false;
175
+ readonly campaignMutated: false;
176
+ readonly approved: false;
177
+ readonly enriched: false;
178
+ readonly generated: false;
179
+ readonly salesNavigatorActioned: false;
180
+ }>;
181
+ /**
182
+ * A TOP-LEVEL OBJECT, never an array: an MCP client validates
183
+ * `structuredContent` against this declaration, and a tool that declares an
184
+ * output schema and answers with a shape the client rejects has its ENTIRE
185
+ * response discarded.
186
+ */
187
+ export declare const REFILL_V3_WORLD_STATE_OUTPUT_SCHEMA: Readonly<{
188
+ readonly type: "object";
189
+ readonly additionalProperties: false;
190
+ readonly required: readonly ["rows", "durationMs", "observationSideEffects"];
191
+ readonly properties: {
192
+ readonly rows: {
193
+ readonly type: "array";
194
+ readonly items: {
195
+ readonly type: "object";
196
+ readonly additionalProperties: false;
197
+ readonly required: readonly ["date", "sender", "lane", "targetSlots", "takenSlots", "availableSlots", "reason", "activeCampaigns", "inactiveCampaigns"];
198
+ readonly properties: {
199
+ readonly date: {
200
+ readonly type: "string";
201
+ readonly pattern: "^\\d{4}-\\d{2}-\\d{2}$";
202
+ };
203
+ readonly sender: {
204
+ readonly type: "object";
205
+ readonly additionalProperties: false;
206
+ readonly required: readonly ["id", "name", "timezone"];
207
+ readonly properties: {
208
+ readonly id: {
209
+ readonly type: "string";
210
+ readonly minLength: 1;
211
+ };
212
+ readonly name: {
213
+ readonly type: "string";
214
+ };
215
+ readonly timezone: {
216
+ readonly type: "string";
217
+ readonly minLength: 1;
218
+ };
219
+ };
220
+ };
221
+ readonly lane: {
222
+ readonly type: "string";
223
+ readonly enum: readonly ["connection_invite", "paid_inmail"];
224
+ };
225
+ readonly targetSlots: {
226
+ readonly type: "integer";
227
+ readonly minimum: 0;
228
+ };
229
+ readonly takenSlots: {
230
+ readonly type: "integer";
231
+ readonly minimum: 0;
232
+ };
233
+ readonly availableSlots: {
234
+ readonly type: "integer";
235
+ readonly minimum: 0;
236
+ };
237
+ readonly reason: {
238
+ readonly type: readonly ["object", "null"];
239
+ readonly additionalProperties: false;
240
+ readonly required: readonly ["kind", "codes", "message"];
241
+ readonly properties: {
242
+ readonly kind: {
243
+ readonly type: "string";
244
+ readonly enum: readonly ["unavailable", "retry_required", "invalid_campaign_configuration"];
245
+ };
246
+ readonly codes: {
247
+ readonly type: "array";
248
+ readonly items: {
249
+ readonly type: "string";
250
+ readonly enum: readonly ["global_cooldown", "connection_cooldown", "paid_inmail_cooldown", "endpoint_temporarily_unavailable", "date_in_past", "no_sending_hours", "sender_disconnected", "sender_limit_reached", "daily_target_met", "no_eligible_campaign", "no_ready_supply", "sales_nav_disconnected", "insufficient_paid_credits", "paid_inmail_connection_health_recheck_required", "paid_inmail_credit_refresh_failed", "invalid_paid_configuration", "campaign_table_missing", "campaign_sequence_invalid", "source_family_unresolved", "campaign_work_in_flight"];
251
+ };
252
+ };
253
+ readonly message: {
254
+ readonly type: "string";
255
+ };
256
+ readonly resumeAt: {
257
+ readonly type: "string";
258
+ };
259
+ };
260
+ };
261
+ readonly activeCampaigns: {
262
+ readonly type: "array";
263
+ readonly items: {
264
+ readonly type: "object";
265
+ readonly additionalProperties: false;
266
+ readonly required: readonly ["id", "name", "status", "lanes", "eligible", "reason", "startEligible", "activeJob", "supply", "leadSourceFamily", "evidence"];
267
+ readonly properties: {
268
+ readonly id: {
269
+ readonly type: "string";
270
+ readonly minLength: 1;
271
+ };
272
+ readonly name: {
273
+ readonly type: "string";
274
+ };
275
+ readonly status: {
276
+ readonly type: "string";
277
+ readonly enum: readonly ["ACTIVE", "PAUSED"];
278
+ };
279
+ readonly lanes: {
280
+ readonly type: "array";
281
+ readonly minItems: 1;
282
+ readonly items: {
283
+ readonly type: "string";
284
+ readonly enum: readonly ["connection_invite", "paid_inmail"];
285
+ };
286
+ };
287
+ readonly eligible: {
288
+ readonly type: "boolean";
289
+ };
290
+ readonly reason: {
291
+ readonly type: readonly ["object", "null"];
292
+ readonly additionalProperties: false;
293
+ readonly required: readonly ["kind", "codes", "message"];
294
+ readonly properties: {
295
+ readonly kind: {
296
+ readonly type: "string";
297
+ readonly enum: readonly ["unavailable", "retry_required", "invalid_campaign_configuration"];
298
+ };
299
+ readonly codes: {
300
+ readonly type: "array";
301
+ readonly items: {
302
+ readonly type: "string";
303
+ readonly enum: readonly ["global_cooldown", "connection_cooldown", "paid_inmail_cooldown", "endpoint_temporarily_unavailable", "date_in_past", "no_sending_hours", "sender_disconnected", "sender_limit_reached", "daily_target_met", "no_eligible_campaign", "no_ready_supply", "sales_nav_disconnected", "insufficient_paid_credits", "paid_inmail_connection_health_recheck_required", "paid_inmail_credit_refresh_failed", "invalid_paid_configuration", "campaign_table_missing", "campaign_sequence_invalid", "source_family_unresolved", "campaign_work_in_flight"];
304
+ };
305
+ };
306
+ readonly message: {
307
+ readonly type: "string";
308
+ };
309
+ readonly resumeAt: {
310
+ readonly type: "string";
311
+ };
312
+ };
313
+ };
314
+ readonly startEligible: {
315
+ readonly type: "boolean";
316
+ };
317
+ readonly activeJob: {
318
+ readonly type: readonly ["object", "null"];
319
+ readonly additionalProperties: false;
320
+ readonly required: readonly ["id", "kind", "status"];
321
+ readonly properties: {
322
+ readonly id: {
323
+ readonly type: "string";
324
+ readonly minLength: 1;
325
+ };
326
+ readonly kind: {
327
+ readonly type: "string";
328
+ readonly enum: readonly ["enrichment", "message_generation", "source_expansion", "scheduling"];
329
+ };
330
+ readonly status: {
331
+ readonly type: "string";
332
+ readonly enum: readonly ["queued", "running"];
333
+ };
334
+ };
335
+ };
336
+ readonly supply: {
337
+ readonly type: "object";
338
+ readonly additionalProperties: false;
339
+ readonly required: readonly ["readyToSchedule", "readyForApproval", "readyForMessageGeneration", "needsEnrichment"];
340
+ readonly properties: {
341
+ readonly readyToSchedule: {
342
+ readonly type: "integer";
343
+ readonly minimum: 0;
344
+ };
345
+ readonly readyForApproval: {
346
+ readonly type: "integer";
347
+ readonly minimum: 0;
348
+ };
349
+ readonly readyForMessageGeneration: {
350
+ readonly type: "integer";
351
+ readonly minimum: 0;
352
+ };
353
+ readonly needsEnrichment: {
354
+ readonly type: "integer";
355
+ readonly minimum: 0;
356
+ };
357
+ };
358
+ };
359
+ readonly leadSourceFamily: {
360
+ readonly type: "string";
361
+ readonly enum: readonly ["post_engager", "signal_discovery", "cold"];
362
+ };
363
+ readonly evidence: {
364
+ readonly type: "object";
365
+ readonly additionalProperties: false;
366
+ readonly required: readonly ["evergreen", "lastActualUseAt", "lastScheduledUseAt", "effectiveness", "supplyHealth"];
367
+ readonly properties: {
368
+ readonly evergreen: {
369
+ readonly type: "boolean";
370
+ };
371
+ readonly lastActualUseAt: {
372
+ readonly type: readonly ["string", "null"];
373
+ };
374
+ readonly lastScheduledUseAt: {
375
+ readonly type: readonly ["string", "null"];
376
+ };
377
+ readonly effectiveness: {
378
+ readonly type: "string";
379
+ readonly enum: readonly ["unknown", "low", "medium", "high"];
380
+ };
381
+ readonly supplyHealth: {
382
+ readonly type: "string";
383
+ readonly enum: readonly ["unknown", "healthy", "thin", "dry"];
384
+ };
385
+ readonly engagement: {
386
+ readonly type: "object";
387
+ readonly additionalProperties: false;
388
+ readonly required: readonly ["sends", "accepted", "replied", "acceptRate", "replyRate"];
389
+ readonly properties: {
390
+ readonly sends: {
391
+ readonly type: "number";
392
+ readonly minimum: 0;
393
+ };
394
+ readonly accepted: {
395
+ readonly type: "number";
396
+ readonly minimum: 0;
397
+ };
398
+ readonly replied: {
399
+ readonly type: "number";
400
+ readonly minimum: 0;
401
+ };
402
+ readonly acceptRate: {
403
+ readonly type: "number";
404
+ readonly minimum: 0;
405
+ readonly maximum: 100;
406
+ };
407
+ readonly replyRate: {
408
+ readonly type: "number";
409
+ readonly minimum: 0;
410
+ readonly maximum: 100;
411
+ };
412
+ };
413
+ };
414
+ };
415
+ };
416
+ };
417
+ };
418
+ };
419
+ readonly inactiveCampaigns: {
420
+ readonly type: "array";
421
+ readonly items: {
422
+ readonly type: "object";
423
+ readonly additionalProperties: false;
424
+ readonly required: readonly ["id", "name", "status", "lanes", "eligible", "reason", "startEligible", "activeJob", "supply", "leadSourceFamily", "evidence"];
425
+ readonly properties: {
426
+ readonly id: {
427
+ readonly type: "string";
428
+ readonly minLength: 1;
429
+ };
430
+ readonly name: {
431
+ readonly type: "string";
432
+ };
433
+ readonly status: {
434
+ readonly type: "string";
435
+ readonly enum: readonly ["ACTIVE", "PAUSED"];
436
+ };
437
+ readonly lanes: {
438
+ readonly type: "array";
439
+ readonly minItems: 1;
440
+ readonly items: {
441
+ readonly type: "string";
442
+ readonly enum: readonly ["connection_invite", "paid_inmail"];
443
+ };
444
+ };
445
+ readonly eligible: {
446
+ readonly type: "boolean";
447
+ };
448
+ readonly reason: {
449
+ readonly type: readonly ["object", "null"];
450
+ readonly additionalProperties: false;
451
+ readonly required: readonly ["kind", "codes", "message"];
452
+ readonly properties: {
453
+ readonly kind: {
454
+ readonly type: "string";
455
+ readonly enum: readonly ["unavailable", "retry_required", "invalid_campaign_configuration"];
456
+ };
457
+ readonly codes: {
458
+ readonly type: "array";
459
+ readonly items: {
460
+ readonly type: "string";
461
+ readonly enum: readonly ["global_cooldown", "connection_cooldown", "paid_inmail_cooldown", "endpoint_temporarily_unavailable", "date_in_past", "no_sending_hours", "sender_disconnected", "sender_limit_reached", "daily_target_met", "no_eligible_campaign", "no_ready_supply", "sales_nav_disconnected", "insufficient_paid_credits", "paid_inmail_connection_health_recheck_required", "paid_inmail_credit_refresh_failed", "invalid_paid_configuration", "campaign_table_missing", "campaign_sequence_invalid", "source_family_unresolved", "campaign_work_in_flight"];
462
+ };
463
+ };
464
+ readonly message: {
465
+ readonly type: "string";
466
+ };
467
+ readonly resumeAt: {
468
+ readonly type: "string";
469
+ };
470
+ };
471
+ };
472
+ readonly startEligible: {
473
+ readonly type: "boolean";
474
+ };
475
+ readonly activeJob: {
476
+ readonly type: readonly ["object", "null"];
477
+ readonly additionalProperties: false;
478
+ readonly required: readonly ["id", "kind", "status"];
479
+ readonly properties: {
480
+ readonly id: {
481
+ readonly type: "string";
482
+ readonly minLength: 1;
483
+ };
484
+ readonly kind: {
485
+ readonly type: "string";
486
+ readonly enum: readonly ["enrichment", "message_generation", "source_expansion", "scheduling"];
487
+ };
488
+ readonly status: {
489
+ readonly type: "string";
490
+ readonly enum: readonly ["queued", "running"];
491
+ };
492
+ };
493
+ };
494
+ readonly supply: {
495
+ readonly type: "object";
496
+ readonly additionalProperties: false;
497
+ readonly required: readonly ["readyToSchedule", "readyForApproval", "readyForMessageGeneration", "needsEnrichment"];
498
+ readonly properties: {
499
+ readonly readyToSchedule: {
500
+ readonly type: "integer";
501
+ readonly minimum: 0;
502
+ };
503
+ readonly readyForApproval: {
504
+ readonly type: "integer";
505
+ readonly minimum: 0;
506
+ };
507
+ readonly readyForMessageGeneration: {
508
+ readonly type: "integer";
509
+ readonly minimum: 0;
510
+ };
511
+ readonly needsEnrichment: {
512
+ readonly type: "integer";
513
+ readonly minimum: 0;
514
+ };
515
+ };
516
+ };
517
+ readonly leadSourceFamily: {
518
+ readonly type: "string";
519
+ readonly enum: readonly ["post_engager", "signal_discovery", "cold"];
520
+ };
521
+ readonly evidence: {
522
+ readonly type: "object";
523
+ readonly additionalProperties: false;
524
+ readonly required: readonly ["evergreen", "lastActualUseAt", "lastScheduledUseAt", "effectiveness", "supplyHealth"];
525
+ readonly properties: {
526
+ readonly evergreen: {
527
+ readonly type: "boolean";
528
+ };
529
+ readonly lastActualUseAt: {
530
+ readonly type: readonly ["string", "null"];
531
+ };
532
+ readonly lastScheduledUseAt: {
533
+ readonly type: readonly ["string", "null"];
534
+ };
535
+ readonly effectiveness: {
536
+ readonly type: "string";
537
+ readonly enum: readonly ["unknown", "low", "medium", "high"];
538
+ };
539
+ readonly supplyHealth: {
540
+ readonly type: "string";
541
+ readonly enum: readonly ["unknown", "healthy", "thin", "dry"];
542
+ };
543
+ readonly engagement: {
544
+ readonly type: "object";
545
+ readonly additionalProperties: false;
546
+ readonly required: readonly ["sends", "accepted", "replied", "acceptRate", "replyRate"];
547
+ readonly properties: {
548
+ readonly sends: {
549
+ readonly type: "number";
550
+ readonly minimum: 0;
551
+ };
552
+ readonly accepted: {
553
+ readonly type: "number";
554
+ readonly minimum: 0;
555
+ };
556
+ readonly replied: {
557
+ readonly type: "number";
558
+ readonly minimum: 0;
559
+ };
560
+ readonly acceptRate: {
561
+ readonly type: "number";
562
+ readonly minimum: 0;
563
+ readonly maximum: 100;
564
+ };
565
+ readonly replyRate: {
566
+ readonly type: "number";
567
+ readonly minimum: 0;
568
+ readonly maximum: 100;
569
+ };
570
+ };
571
+ };
572
+ };
573
+ };
574
+ };
575
+ };
576
+ };
577
+ readonly paidCreditEvidence: {
578
+ readonly type: readonly ["object", "null"];
579
+ readonly additionalProperties: false;
580
+ readonly required: readonly ["availableCredits", "minimumRequired", "checkedAt", "fresh"];
581
+ readonly properties: {
582
+ readonly availableCredits: {
583
+ readonly type: readonly ["integer", "null"];
584
+ readonly minimum: 0;
585
+ };
586
+ readonly minimumRequired: {
587
+ readonly type: readonly ["integer", "null"];
588
+ readonly minimum: 0;
589
+ };
590
+ readonly checkedAt: {
591
+ readonly type: readonly ["string", "null"];
592
+ };
593
+ readonly fresh: {
594
+ readonly type: "boolean";
595
+ };
596
+ };
597
+ };
598
+ };
599
+ };
600
+ };
601
+ readonly durationMs: {
602
+ readonly type: "number";
603
+ readonly minimum: 0;
604
+ };
605
+ readonly observationSideEffects: {
606
+ readonly type: "object";
607
+ readonly additionalProperties: false;
608
+ readonly required: readonly ["scheduled", "placed", "sent", "campaignMutated", "approved", "enriched", "generated", "salesNavigatorActioned", "paidCreditCache"];
609
+ readonly properties: {
610
+ readonly scheduled: {
611
+ readonly type: "boolean";
612
+ readonly enum: readonly [false];
613
+ };
614
+ readonly placed: {
615
+ readonly type: "boolean";
616
+ readonly enum: readonly [false];
617
+ };
618
+ readonly sent: {
619
+ readonly type: "boolean";
620
+ readonly enum: readonly [false];
621
+ };
622
+ readonly campaignMutated: {
623
+ readonly type: "boolean";
624
+ readonly enum: readonly [false];
625
+ };
626
+ readonly approved: {
627
+ readonly type: "boolean";
628
+ readonly enum: readonly [false];
629
+ };
630
+ readonly enriched: {
631
+ readonly type: "boolean";
632
+ readonly enum: readonly [false];
633
+ };
634
+ readonly generated: {
635
+ readonly type: "boolean";
636
+ readonly enum: readonly [false];
637
+ };
638
+ readonly salesNavigatorActioned: {
639
+ readonly type: "boolean";
640
+ readonly enum: readonly [false];
641
+ };
642
+ readonly paidCreditCache: {
643
+ readonly type: "string";
644
+ readonly enum: readonly ["not_checked", "not_eligible", "fresh_cache_used", "refresh_started", "refreshed", "refresh_in_progress", "refresh_failed", "uncertain"];
645
+ };
646
+ };
647
+ };
648
+ };
649
+ }>;
650
+ /**
651
+ * Sole unknown-value decoder for the public result.
652
+ *
653
+ * Strict inbound, tolerant outbound, lossless. `null` means "not this
654
+ * contract"; the typed unsupported VALUE means "a major this build cannot
655
+ * speak". Collapsing the second into the first, or into business zero, is the
656
+ * defect this separation exists to prevent.
657
+ */
658
+ export declare function decodeRefillWorldStateResult(value: unknown): RefillWorldStateResult | RefillV3SchemaVersionUnsupported | null;
659
+ /**
660
+ * Wire form of a decoded result. `schemaVersion` is TRANSPORT, not business:
661
+ * the canonical result stays exactly `{rows, durationMs,
662
+ * observationSideEffects}`. Every locked field is projected explicitly, because
663
+ * a silently dropped property is what turns a round trip into a confident wrong
664
+ * success.
665
+ */
666
+ export declare function encodeRefillWorldStateResult(result: RefillWorldStateResult): Record<string, unknown>;