@adcp/client 4.18.2 → 4.19.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 (53) hide show
  1. package/dist/lib/adapters/governance-adapter.d.ts.map +1 -1
  2. package/dist/lib/adapters/governance-adapter.js +0 -1
  3. package/dist/lib/adapters/governance-adapter.js.map +1 -1
  4. package/dist/lib/core/GovernanceMiddleware.d.ts.map +1 -1
  5. package/dist/lib/core/GovernanceMiddleware.js +0 -2
  6. package/dist/lib/core/GovernanceMiddleware.js.map +1 -1
  7. package/dist/lib/core/GovernanceTypes.d.ts +1 -3
  8. package/dist/lib/core/GovernanceTypes.d.ts.map +1 -1
  9. package/dist/lib/core/GovernanceTypes.js +0 -10
  10. package/dist/lib/core/GovernanceTypes.js.map +1 -1
  11. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  12. package/dist/lib/core/TaskExecutor.js +2 -3
  13. package/dist/lib/core/TaskExecutor.js.map +1 -1
  14. package/dist/lib/index.d.ts +1 -1
  15. package/dist/lib/index.d.ts.map +1 -1
  16. package/dist/lib/index.js.map +1 -1
  17. package/dist/lib/testing/agent-tester.d.ts +1 -1
  18. package/dist/lib/testing/agent-tester.d.ts.map +1 -1
  19. package/dist/lib/testing/agent-tester.js +8 -2
  20. package/dist/lib/testing/agent-tester.js.map +1 -1
  21. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  22. package/dist/lib/testing/compliance/comply.js +1 -3
  23. package/dist/lib/testing/compliance/comply.js.map +1 -1
  24. package/dist/lib/testing/index.d.ts +1 -1
  25. package/dist/lib/testing/index.d.ts.map +1 -1
  26. package/dist/lib/testing/index.js +3 -2
  27. package/dist/lib/testing/index.js.map +1 -1
  28. package/dist/lib/testing/orchestrator.d.ts.map +1 -1
  29. package/dist/lib/testing/orchestrator.js +1 -0
  30. package/dist/lib/testing/orchestrator.js.map +1 -1
  31. package/dist/lib/testing/scenarios/index.d.ts +1 -1
  32. package/dist/lib/testing/scenarios/index.d.ts.map +1 -1
  33. package/dist/lib/testing/scenarios/index.js +3 -2
  34. package/dist/lib/testing/scenarios/index.js.map +1 -1
  35. package/dist/lib/testing/scenarios/media-buy.d.ts +16 -0
  36. package/dist/lib/testing/scenarios/media-buy.d.ts.map +1 -1
  37. package/dist/lib/testing/scenarios/media-buy.js +183 -0
  38. package/dist/lib/testing/scenarios/media-buy.js.map +1 -1
  39. package/dist/lib/testing/stubs/governance-agent-stub.d.ts.map +1 -1
  40. package/dist/lib/testing/stubs/governance-agent-stub.js +0 -2
  41. package/dist/lib/testing/stubs/governance-agent-stub.js.map +1 -1
  42. package/dist/lib/testing/types.d.ts +1 -1
  43. package/dist/lib/testing/types.d.ts.map +1 -1
  44. package/dist/lib/types/core.generated.d.ts +7 -7
  45. package/dist/lib/types/core.generated.d.ts.map +1 -1
  46. package/dist/lib/types/core.generated.js +1 -1
  47. package/dist/lib/types/schemas.generated.d.ts +42 -35
  48. package/dist/lib/types/schemas.generated.d.ts.map +1 -1
  49. package/dist/lib/types/schemas.generated.js +20 -22
  50. package/dist/lib/types/schemas.generated.js.map +1 -1
  51. package/dist/lib/types/tools.generated.d.ts +55 -55
  52. package/dist/lib/types/tools.generated.d.ts.map +1 -1
  53. package/package.json +1 -1
@@ -133,6 +133,10 @@ export type SignalID = {
133
133
  */
134
134
  id: string;
135
135
  };
136
+ /**
137
+ * Postal code system (e.g., 'us_zip', 'gb_outward')
138
+ */
139
+ export type PostalCodeSystem = 'us_zip' | 'us_zip_plus_four' | 'gb_outward' | 'gb_full' | 'ca_fsa' | 'ca_full' | 'de_plz' | 'fr_code_postal' | 'au_postcode' | 'ch_plz' | 'at_plz';
136
140
  /**
137
141
  * Request parameters for discovering or refining advertising products. buying_mode declares the buyer's intent: 'brief' for curated discovery, 'wholesale' for raw catalog access, or 'refine' to iterate on known products and proposals.
138
142
  */
@@ -439,6 +443,35 @@ export interface ProductFilters {
439
443
  * Filter to products supporting specific signals from data provider catalogs. Products must have the requested signals in their data_provider_signals and signal_targeting_allowed must be true (or all signals requested).
440
444
  */
441
445
  signal_targeting?: SignalTargeting[];
446
+ /**
447
+ * Filter by postal area coverage for locally-bound inventory (direct mail, DOOH, local campaigns). Use when products have postal-area-specific coverage. For digital inventory where products have broad coverage, use required_geo_targeting instead to filter by seller capability.
448
+ */
449
+ postal_areas?: {
450
+ system: PostalCodeSystem;
451
+ /**
452
+ * Postal codes within the system (e.g., ['10001', '10002'] for us_zip)
453
+ */
454
+ values: string[];
455
+ }[];
456
+ /**
457
+ * Filter by proximity to geographic points. Returns products with inventory coverage near these locations. Follows the same format as the targeting overlay — each entry uses exactly one method: travel_time + transport_mode, radius, or geometry. For locally-bound inventory (DOOH, radio), filters to products with coverage in the area. For digital inventory, filters to products from sellers supporting geo_proximity targeting.
458
+ */
459
+ geo_proximity?: {
460
+ [k: string]: unknown | undefined;
461
+ }[];
462
+ /**
463
+ * Filter by keyword relevance for search and retail media platforms. Returns products that support keyword targeting for these terms. Allows the sell-side agent to assess keyword availability and recommend appropriate products. Use match_type to indicate the desired precision.
464
+ */
465
+ keywords?: {
466
+ /**
467
+ * The keyword to target
468
+ */
469
+ keyword: string;
470
+ /**
471
+ * Desired match type: broad matches related queries, phrase matches queries containing the keyword phrase, exact matches the query exactly. Defaults to broad.
472
+ */
473
+ match_type?: 'broad' | 'phrase' | 'exact';
474
+ }[];
442
475
  }
443
476
  /**
444
477
  * Structured format identifier with agent URL and format name. Can reference: (1) a concrete format with fixed dimensions (id only), (2) a template format without parameters (id only), or (3) a template format with parameters (id + dimensions/duration). Template formats accept parameters in format_id while concrete formats have fixed dimensions in their definition. Parameterized format IDs create unique, specific format variants.
@@ -603,9 +636,9 @@ export type PriceAdjustmentKind = 'fee' | 'discount' | 'commission' | 'settlemen
603
636
  */
604
637
  export type DemographicSystem = 'nielsen' | 'barb' | 'agf' | 'oztam' | 'mediametrie' | 'custom';
605
638
  /**
606
- * How to interpret the points array. 'spend' (default when omitted): points at ascending budget levels. 'reach_freq': points at ascending reach/frequency targets. 'weekly'/'daily': metrics are per-period values. 'clicks'/'conversions': points at ascending outcome targets.
639
+ * How to interpret the points array. 'spend' (default when omitted): points at ascending budget levels. 'availability': total available inventory, budget omitted. 'reach_freq': points at ascending reach/frequency targets. 'weekly'/'daily': metrics are per-period values. 'clicks'/'conversions': points at ascending outcome targets.
607
640
  */
608
- export type ForecastRangeUnit = 'spend' | 'reach_freq' | 'weekly' | 'daily' | 'clicks' | 'conversions';
641
+ export type ForecastRangeUnit = 'spend' | 'availability' | 'reach_freq' | 'weekly' | 'daily' | 'clicks' | 'conversions';
609
642
  /**
610
643
  * Method used to produce this forecast
611
644
  */
@@ -1504,7 +1537,7 @@ export interface TimeBasedPricingOption {
1504
1537
  */
1505
1538
  export interface DeliveryForecast {
1506
1539
  /**
1507
- * Forecasted delivery at one or more budget levels. A single point is a standard forecast; multiple points ordered by ascending budget form a curve showing how metrics scale with spend. Each point pairs a budget with metric ranges.
1540
+ * Forecasted delivery data points. For spend curves (default), points at ascending budget levels show how metrics scale with spend. For availability forecasts, points represent total available inventory independent of budget. See forecast_range_unit for interpretation.
1508
1541
  */
1509
1542
  points: ForecastPoint[];
1510
1543
  forecast_range_unit?: ForecastRangeUnit;
@@ -1530,15 +1563,15 @@ export interface DeliveryForecast {
1530
1563
  ext?: ExtensionObject;
1531
1564
  }
1532
1565
  /**
1533
- * A forecast at a specific budget level. A single point represents a standard forecast; multiple points ordered by ascending budget form a curve showing how delivery metrics scale with spend.
1566
+ * A forecast data point. When budget is present, the point pairs a spend level with expected delivery — multiple points at ascending budgets form a curve. When budget is omitted, the point represents total available inventory for the requested targeting and dates, independent of spend.
1534
1567
  */
1535
1568
  export interface ForecastPoint {
1536
1569
  /**
1537
- * Budget amount for this forecast point. For allocation-level forecasts, this is the absolute budget for that allocation (not the percentage). For proposal-level forecasts, this is the total proposal budget.
1570
+ * Budget amount for this forecast point. Required for spend curves; omit for availability forecasts where the metrics represent total available inventory. For allocation-level forecasts, this is the absolute budget for that allocation (not the percentage). For proposal-level forecasts, this is the total proposal budget. When omitted, use metrics.spend to express the estimated cost of the available inventory.
1538
1571
  */
1539
- budget: number;
1572
+ budget?: number;
1540
1573
  /**
1541
- * Forecasted metric values at this budget level. Keys are forecastable-metric enum values for delivery/engagement or event-type enum values for outcomes. Values are ForecastRange objects (low/mid/high). Use { "mid": value } for point estimates. Include spend when the platform predicts it will differ from budget. Additional keys beyond the documented properties are allowed for event-type values (purchase, lead, app_install, etc.).
1574
+ * Forecasted metric values. Keys are forecastable-metric enum values for delivery/engagement or event-type enum values for outcomes. Values are ForecastRange objects (low/mid/high). Use { "mid": value } for point estimates. When budget is present, these are the expected metrics at that spend level. When budget is omitted, these represent total available inventory — use spend to express the estimated cost. Additional keys beyond the documented properties are allowed for event-type values (purchase, lead, app_install, etc.).
1542
1575
  */
1543
1576
  metrics: {
1544
1577
  audience_size?: ForecastRange;
@@ -2578,10 +2611,6 @@ export type OptimizationGoal = {
2578
2611
  */
2579
2612
  priority?: number;
2580
2613
  };
2581
- /**
2582
- * Postal code system (e.g., 'us_zip', 'gb_outward'). System name encodes country and precision.
2583
- */
2584
- export type PostalCodeSystem = 'us_zip' | 'us_zip_plus_four' | 'gb_outward' | 'gb_full' | 'ca_fsa' | 'ca_full' | 'de_plz' | 'fr_code_postal' | 'au_postcode' | 'ch_plz' | 'at_plz';
2585
2614
  /**
2586
2615
  * Frequency capping settings for package-level application. Two types of frequency control can be used independently or together: suppress enforces a cooldown between consecutive exposures; max_impressions + per + window caps total exposures per entity in a time window. When both suppress and max_impressions are set, an impression is delivered only if both constraints permit it (AND semantics). At least one of suppress, suppress_minutes, or max_impressions must be set.
2587
2616
  */
@@ -9213,10 +9242,6 @@ export type RestrictedAttribute = 'racial_ethnic_origin' | 'political_opinions'
9213
9242
  * Authority level granted to this agent.
9214
9243
  */
9215
9244
  export type DelegationAuthority = 'full' | 'execute_only' | 'propose_only';
9216
- /**
9217
- * Governance enforcement mode for this plan. 'enforce': denied actions are blocked. 'advisory': denied actions proceed with findings logged. 'audit': all actions proceed, findings logged. Defaults to 'enforce' if omitted.
9218
- */
9219
- export type GovernanceMode = 'audit' | 'advisory' | 'enforce';
9220
9245
  /**
9221
9246
  * Push campaign plans to the governance agent. A plan defines the authorized parameters for a campaign -- budget limits, channels, flight dates, and authorized markets.
9222
9247
  */
@@ -9377,7 +9402,6 @@ export interface SyncPlansRequest {
9377
9402
  */
9378
9403
  shared_exclusions?: string[];
9379
9404
  };
9380
- mode?: GovernanceMode;
9381
9405
  ext?: ExtensionObject;
9382
9406
  }[];
9383
9407
  }
@@ -9696,7 +9720,10 @@ export interface GetPlanAuditLogsResponse {
9696
9720
  approved?: number;
9697
9721
  denied?: number;
9698
9722
  conditions?: number;
9699
- escalated?: number;
9723
+ /**
9724
+ * Supplementary count of checks that went through internal human review. These checks are also counted in approved or denied.
9725
+ */
9726
+ human_reviewed?: number;
9700
9727
  };
9701
9728
  /**
9702
9729
  * Total findings across all checks and outcomes.
@@ -9801,11 +9828,11 @@ export interface GetPlanAuditLogsResponse {
9801
9828
  /**
9802
9829
  * Governance check status (present for check entries).
9803
9830
  */
9804
- status?: 'approved' | 'denied' | 'conditions' | 'escalated';
9831
+ status?: 'approved' | 'denied' | 'conditions';
9805
9832
  /**
9806
- * Whether the check was proposed or committed (present for check entries).
9833
+ * Whether the check was an intent check (orchestrator) or execution check (seller). Inferred from the fields present on the original check request. Present for check entries.
9807
9834
  */
9808
- binding?: 'proposed' | 'committed';
9835
+ check_type?: 'intent' | 'execution';
9809
9836
  /**
9810
9837
  * Human-readable explanation of the governance decision (present for check entries).
9811
9838
  */
@@ -9870,7 +9897,7 @@ export interface GetPlanAuditLogsResponse {
9870
9897
  */
9871
9898
  export type GovernancePhase = 'purchase' | 'modification' | 'delivery';
9872
9899
  /**
9873
- * Universal governance check for campaign actions. Called by the orchestrator before sending to a seller (proposed) or by the seller before executing (committed). The governance agent evaluates the action against the campaign plan and returns a status.
9900
+ * Universal governance check for campaign actions. The governance agent infers the check type from the fields present: tool+payload (intent check, orchestrator) or media_buy_id+planned_delivery (execution check, seller).
9874
9901
  */
9875
9902
  export interface CheckGovernanceRequest {
9876
9903
  /**
@@ -9878,19 +9905,15 @@ export interface CheckGovernanceRequest {
9878
9905
  */
9879
9906
  plan_id: string;
9880
9907
  /**
9881
- * Whether this is an advisory check or a binding commitment. 'proposed': the orchestrator is checking before sending to a seller — no budget is committed. 'committed': the seller is about to execute — the governance agent validates the planned delivery against the plan. Budget is committed later via report_plan_outcome, not on approval.
9882
- */
9883
- binding: 'proposed' | 'committed';
9884
- /**
9885
- * URL of the agent making the request (orchestrator for proposed, seller for committed).
9908
+ * URL of the agent making the request.
9886
9909
  */
9887
9910
  caller: string;
9888
9911
  /**
9889
- * The AdCP tool being checked (e.g., 'create_media_buy', 'get_products'). Expected for proposed checks. The governance agent uses this to apply tool-specific validation rules.
9912
+ * The AdCP tool being checked (e.g., 'create_media_buy', 'get_products'). Present on intent checks (orchestrator). The governance agent uses the presence of tool+payload to identify an intent check.
9890
9913
  */
9891
9914
  tool?: string;
9892
9915
  /**
9893
- * The full tool arguments as they would be sent to the seller. Expected for proposed checks. The governance agent can inspect any field to validate against the plan.
9916
+ * The full tool arguments as they would be sent to the seller. Present on intent checks. The governance agent can inspect any field to validate against the plan.
9894
9917
  */
9895
9918
  payload?: {};
9896
9919
  /**
@@ -9898,7 +9921,7 @@ export interface CheckGovernanceRequest {
9898
9921
  */
9899
9922
  governance_context?: string;
9900
9923
  /**
9901
- * The seller's identifier for the media buy. Expected for committed checks.
9924
+ * The seller's identifier for the media buy. Present on execution checks (seller). The governance agent uses the presence of media_buy_id+planned_delivery to identify an execution check.
9902
9925
  */
9903
9926
  media_buy_id?: string;
9904
9927
  phase?: GovernancePhase;
@@ -9987,13 +10010,9 @@ export interface CheckGovernanceResponse {
9987
10010
  */
9988
10011
  check_id: string;
9989
10012
  /**
9990
- * Governance decision. 'approved': proceed as planned. 'denied': do not proceed. 'conditions': approved if the caller accepts the listed conditions, then re-calls check_governance with the adjusted parameters. 'escalated': halted pending human review.
9991
- */
9992
- status: 'approved' | 'denied' | 'conditions' | 'escalated';
9993
- /**
9994
- * Echoed from request. Lets the caller confirm the governance agent understood the commitment level.
10013
+ * Governance decision. 'approved': proceed as planned. 'denied': do not proceed. 'conditions': approved if the caller accepts the listed conditions, then re-calls check_governance with the adjusted parameters.
9995
10014
  */
9996
- binding: 'proposed' | 'committed';
10015
+ status: 'approved' | 'denied' | 'conditions';
9997
10016
  /**
9998
10017
  * Echoed from request.
9999
10018
  */
@@ -10002,9 +10021,8 @@ export interface CheckGovernanceResponse {
10002
10021
  * Human-readable explanation of the governance decision.
10003
10022
  */
10004
10023
  explanation: string;
10005
- mode?: GovernanceMode;
10006
10024
  /**
10007
- * Specific issues found during the governance check. Present when status is 'denied', 'conditions', or 'escalated'. MAY also be present on 'approved' for advisory findings (e.g., budget approaching limit).
10025
+ * Specific issues found during the governance check. Present when status is 'denied' or 'conditions'. MAY also be present on 'approved' for informational findings (e.g., budget approaching limit).
10008
10026
  */
10009
10027
  findings?: {
10010
10028
  /**
@@ -10052,24 +10070,6 @@ export interface CheckGovernanceResponse {
10052
10070
  */
10053
10071
  reason: string;
10054
10072
  }[];
10055
- /**
10056
- * Present when status is 'escalated'. The action is halted pending human review.
10057
- */
10058
- escalation?: {
10059
- /**
10060
- * Human-readable explanation of why the action was escalated.
10061
- */
10062
- reason: string;
10063
- severity: EscalationSeverity;
10064
- /**
10065
- * Whether human approval is required before proceeding.
10066
- */
10067
- requires_human: boolean;
10068
- /**
10069
- * Organizational role or tier required to resolve this escalation. The value is organization-defined; the governance agent infers the tier from the escalation context. Common values include 'manager', 'director', 'legal', 'cfo'. Enables programmatic routing of escalations to the right person.
10070
- */
10071
- approval_tier?: string;
10072
- };
10073
10073
  /**
10074
10074
  * When this approval expires. Present when status is 'approved' or 'conditions'. The caller must act before this time or re-call check_governance. A lapsed approval is no approval.
10075
10075
  */