@adcp/sdk 16.0.0-beta.3 → 16.0.0-beta.5

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 (185) hide show
  1. package/dist/lib/auth/oauth/diagnose.js +3 -11
  2. package/dist/lib/auth/oauth/diagnose.mjs +4 -12
  3. package/dist/lib/auth/oauth/diagnostics.d.mts +2 -1
  4. package/dist/lib/auth/oauth/diagnostics.d.ts +2 -1
  5. package/dist/lib/auth/oauth/diagnostics.js +8 -10
  6. package/dist/lib/auth/oauth/diagnostics.mjs +7 -10
  7. package/dist/lib/index.d.mts +1 -1
  8. package/dist/lib/index.d.ts +1 -1
  9. package/dist/lib/index.js +2 -0
  10. package/dist/lib/index.mjs +7 -1
  11. package/dist/lib/reporting/consumer-runtime.js +2 -1
  12. package/dist/lib/reporting/consumer-runtime.mjs +2 -1
  13. package/dist/lib/reporting/ledger/handler.js +50 -11
  14. package/dist/lib/reporting/ledger/handler.mjs +50 -12
  15. package/dist/lib/reporting/ledger/index.d.mts +17 -14
  16. package/dist/lib/reporting/ledger/index.d.ts +17 -14
  17. package/dist/lib/reporting/ledger/index.js +32 -20
  18. package/dist/lib/reporting/ledger/index.mjs +21 -10
  19. package/dist/lib/reporting/ledger/offering-validation.d.mts +9 -0
  20. package/dist/lib/reporting/ledger/offering-validation.d.ts +9 -0
  21. package/dist/lib/reporting/{gcs/bucket-policy.js → ledger/offering-validation.js} +9 -8
  22. package/dist/lib/reporting/ledger/offering-validation.mjs +8 -0
  23. package/dist/lib/reporting/ledger/receipts.d.mts +48 -0
  24. package/dist/lib/reporting/ledger/receipts.d.ts +48 -0
  25. package/dist/lib/reporting/ledger/receipts.js +186 -0
  26. package/dist/lib/reporting/ledger/receipts.mjs +161 -0
  27. package/dist/lib/reporting/ledger/status-ingest.js +3 -3
  28. package/dist/lib/reporting/ledger/status-ingest.mjs +4 -5
  29. package/dist/lib/reporting/ledger/types.d.mts +43 -0
  30. package/dist/lib/reporting/ledger/types.d.ts +43 -0
  31. package/dist/lib/reporting/ledger/types.js +31 -2
  32. package/dist/lib/reporting/ledger/types.mjs +26 -1
  33. package/dist/lib/reporting/pagination.d.mts +6 -0
  34. package/dist/lib/reporting/pagination.d.ts +6 -0
  35. package/dist/lib/reporting/{gcs/errors.js → pagination.js} +12 -17
  36. package/dist/lib/reporting/pagination.mjs +12 -0
  37. package/dist/lib/reporting/reconciliation.d.mts +1 -0
  38. package/dist/lib/reporting/reconciliation.d.ts +1 -0
  39. package/dist/lib/reporting/reconciliation.js +3 -2
  40. package/dist/lib/reporting/reconciliation.mjs +3 -2
  41. package/dist/lib/reporting/service/index.d.mts +79 -153
  42. package/dist/lib/reporting/service/index.d.ts +79 -153
  43. package/dist/lib/reporting/service/index.js +34 -491
  44. package/dist/lib/reporting/service/index.mjs +36 -510
  45. package/dist/lib/reporting/service/scheduler-support.d.mts +43 -0
  46. package/dist/lib/reporting/service/scheduler-support.d.ts +43 -0
  47. package/dist/lib/reporting/service/scheduler-support.js +125 -0
  48. package/dist/lib/reporting/service/scheduler-support.mjs +96 -0
  49. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  50. package/dist/lib/signing/canonicalize.d.mts +4 -0
  51. package/dist/lib/signing/canonicalize.d.ts +4 -0
  52. package/dist/lib/signing/canonicalize.js +14 -8
  53. package/dist/lib/signing/canonicalize.mjs +14 -8
  54. package/dist/lib/signing/content-digest.d.mts +8 -0
  55. package/dist/lib/signing/content-digest.d.ts +8 -0
  56. package/dist/lib/signing/content-digest.js +11 -5
  57. package/dist/lib/signing/content-digest.mjs +10 -5
  58. package/dist/lib/signing/signer.js +9 -6
  59. package/dist/lib/signing/signer.mjs +10 -7
  60. package/dist/lib/signing/web-bot-auth.js +103 -37
  61. package/dist/lib/signing/web-bot-auth.mjs +108 -37
  62. package/dist/lib/testing/storyboard/junit.js +16 -3
  63. package/dist/lib/testing/storyboard/junit.mjs +16 -3
  64. package/dist/lib/testing/storyboard/request-signing/builder.js +10 -9
  65. package/dist/lib/testing/storyboard/request-signing/builder.mjs +10 -9
  66. package/dist/lib/testing/storyboard/runner.js +94 -25
  67. package/dist/lib/testing/storyboard/runner.mjs +94 -25
  68. package/dist/lib/testing/storyboard/types.d.mts +6 -0
  69. package/dist/lib/testing/storyboard/types.d.ts +6 -0
  70. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  71. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  72. package/dist/lib/types/schemas.generated.d.ts +907 -60
  73. package/dist/lib/types/schemas.generated.js +7 -7
  74. package/dist/lib/types/schemas.generated.mjs +7 -7
  75. package/dist/lib/version.d.mts +3 -3
  76. package/dist/lib/version.d.ts +3 -3
  77. package/dist/lib/version.js +3 -3
  78. package/dist/lib/version.mjs +3 -3
  79. package/docs/TYPE-SUMMARY.md +23 -5
  80. package/docs/guides/REPORTING-GCS-FENCE.md +3 -3
  81. package/docs/guides/REPORTING-GCS-MANAGED.md +4 -4
  82. package/docs/guides/REPORTING-LEDGER-CUTOVER.md +7 -7
  83. package/docs/guides/REPORTING-LEDGER.md +107 -51
  84. package/docs/guides/REPORTING-OPERATIONS.md +66 -5
  85. package/docs/guides/REPORTING-STABILITY.md +36 -32
  86. package/docs/llms.txt +4 -3
  87. package/docs/migration-14.x-rc-worksheet.md +4 -7
  88. package/docs/migration-reporting-storage-package.md +186 -0
  89. package/examples/README.md +1 -1
  90. package/package.json +13 -78
  91. package/dist/lib/reporting/azure/index.d.mts +0 -31
  92. package/dist/lib/reporting/azure/index.d.ts +0 -31
  93. package/dist/lib/reporting/azure/index.js +0 -266
  94. package/dist/lib/reporting/azure/index.mjs +0 -249
  95. package/dist/lib/reporting/bigquery/index.d.mts +0 -246
  96. package/dist/lib/reporting/bigquery/index.d.ts +0 -246
  97. package/dist/lib/reporting/bigquery/index.js +0 -633
  98. package/dist/lib/reporting/bigquery/index.mjs +0 -594
  99. package/dist/lib/reporting/gcs/adapter.d.mts +0 -38
  100. package/dist/lib/reporting/gcs/adapter.d.ts +0 -38
  101. package/dist/lib/reporting/gcs/adapter.js +0 -342
  102. package/dist/lib/reporting/gcs/adapter.mjs +0 -325
  103. package/dist/lib/reporting/gcs/bucket-policy.d.mts +0 -3
  104. package/dist/lib/reporting/gcs/bucket-policy.d.ts +0 -3
  105. package/dist/lib/reporting/gcs/bucket-policy.mjs +0 -7
  106. package/dist/lib/reporting/gcs/errors.d.mts +0 -11
  107. package/dist/lib/reporting/gcs/errors.d.ts +0 -11
  108. package/dist/lib/reporting/gcs/errors.mjs +0 -16
  109. package/dist/lib/reporting/gcs/fence.d.mts +0 -41
  110. package/dist/lib/reporting/gcs/fence.d.ts +0 -41
  111. package/dist/lib/reporting/gcs/fence.js +0 -250
  112. package/dist/lib/reporting/gcs/fence.mjs +0 -230
  113. package/dist/lib/reporting/gcs/index.d.mts +0 -18
  114. package/dist/lib/reporting/gcs/index.d.ts +0 -18
  115. package/dist/lib/reporting/gcs/index.js +0 -44
  116. package/dist/lib/reporting/gcs/index.mjs +0 -14
  117. package/dist/lib/reporting/gcs/io.d.mts +0 -7
  118. package/dist/lib/reporting/gcs/io.d.ts +0 -7
  119. package/dist/lib/reporting/gcs/io.js +0 -95
  120. package/dist/lib/reporting/gcs/io.mjs +0 -69
  121. package/dist/lib/reporting/gcs/reader.d.mts +0 -67
  122. package/dist/lib/reporting/gcs/reader.d.ts +0 -67
  123. package/dist/lib/reporting/gcs/reader.js +0 -193
  124. package/dist/lib/reporting/gcs/reader.mjs +0 -169
  125. package/dist/lib/reporting/gcs/row-provider.d.mts +0 -39
  126. package/dist/lib/reporting/gcs/row-provider.d.ts +0 -39
  127. package/dist/lib/reporting/gcs/row-provider.js +0 -225
  128. package/dist/lib/reporting/gcs/row-provider.mjs +0 -208
  129. package/dist/lib/reporting/gcs/validation.d.mts +0 -5
  130. package/dist/lib/reporting/gcs/validation.d.ts +0 -5
  131. package/dist/lib/reporting/gcs/validation.js +0 -49
  132. package/dist/lib/reporting/gcs/validation.mjs +0 -25
  133. package/dist/lib/reporting/ledger/change-feed.d.mts +0 -69
  134. package/dist/lib/reporting/ledger/change-feed.d.ts +0 -69
  135. package/dist/lib/reporting/ledger/change-feed.js +0 -107
  136. package/dist/lib/reporting/ledger/change-feed.mjs +0 -80
  137. package/dist/lib/reporting/ledger/managed-postgres.d.mts +0 -293
  138. package/dist/lib/reporting/ledger/managed-postgres.d.ts +0 -293
  139. package/dist/lib/reporting/ledger/managed-postgres.js +0 -2346
  140. package/dist/lib/reporting/ledger/managed-postgres.mjs +0 -2332
  141. package/dist/lib/reporting/ledger/managed-router.d.mts +0 -148
  142. package/dist/lib/reporting/ledger/managed-router.d.ts +0 -148
  143. package/dist/lib/reporting/ledger/managed-router.js +0 -280
  144. package/dist/lib/reporting/ledger/managed-router.mjs +0 -258
  145. package/dist/lib/reporting/ledger/managed.d.mts +0 -535
  146. package/dist/lib/reporting/ledger/managed.d.ts +0 -535
  147. package/dist/lib/reporting/ledger/managed.js +0 -761
  148. package/dist/lib/reporting/ledger/managed.mjs +0 -729
  149. package/dist/lib/reporting/ledger/notification-activity.d.mts +0 -332
  150. package/dist/lib/reporting/ledger/notification-activity.d.ts +0 -332
  151. package/dist/lib/reporting/ledger/notification-activity.js +0 -1366
  152. package/dist/lib/reporting/ledger/notification-activity.mjs +0 -1337
  153. package/dist/lib/reporting/ledger/object-writes.d.mts +0 -128
  154. package/dist/lib/reporting/ledger/object-writes.d.ts +0 -128
  155. package/dist/lib/reporting/ledger/object-writes.js +0 -147
  156. package/dist/lib/reporting/ledger/object-writes.mjs +0 -114
  157. package/dist/lib/reporting/ledger/postgres.d.mts +0 -689
  158. package/dist/lib/reporting/ledger/postgres.d.ts +0 -689
  159. package/dist/lib/reporting/ledger/postgres.js +0 -4462
  160. package/dist/lib/reporting/ledger/postgres.mjs +0 -4462
  161. package/dist/lib/reporting/ledger/row-storage-migration.d.mts +0 -59
  162. package/dist/lib/reporting/ledger/row-storage-migration.d.ts +0 -59
  163. package/dist/lib/reporting/ledger/row-storage-migration.js +0 -365
  164. package/dist/lib/reporting/ledger/row-storage-migration.mjs +0 -339
  165. package/dist/lib/reporting/ledger/row-storage-object.d.mts +0 -203
  166. package/dist/lib/reporting/ledger/row-storage-object.d.ts +0 -203
  167. package/dist/lib/reporting/ledger/row-storage-object.js +0 -379
  168. package/dist/lib/reporting/ledger/row-storage-object.mjs +0 -335
  169. package/dist/lib/reporting/ledger/row-storage-provider-io.d.mts +0 -44
  170. package/dist/lib/reporting/ledger/row-storage-provider-io.d.ts +0 -44
  171. package/dist/lib/reporting/ledger/row-storage-provider-io.js +0 -142
  172. package/dist/lib/reporting/ledger/row-storage-provider-io.mjs +0 -111
  173. package/dist/lib/reporting/ledger/row-storage.d.mts +0 -316
  174. package/dist/lib/reporting/ledger/row-storage.d.ts +0 -316
  175. package/dist/lib/reporting/ledger/row-storage.js +0 -812
  176. package/dist/lib/reporting/ledger/row-storage.mjs +0 -802
  177. package/dist/lib/reporting/s3/index.d.mts +0 -34
  178. package/dist/lib/reporting/s3/index.d.ts +0 -34
  179. package/dist/lib/reporting/s3/index.js +0 -347
  180. package/dist/lib/reporting/s3/index.mjs +0 -340
  181. package/dist/lib/reporting/service/maintenance.d.mts +0 -148
  182. package/dist/lib/reporting/service/maintenance.d.ts +0 -148
  183. package/dist/lib/reporting/service/maintenance.js +0 -185
  184. package/dist/lib/reporting/service/maintenance.mjs +0 -159
  185. package/examples/reliable-reporting-service/README.md +0 -169
@@ -1,22 +1,24 @@
1
1
  /**
2
- * Reliable Reporting service wiring, conformance runner and ledger maintenance.
2
+ * Reliable Reporting service wiring and conformance runner.
3
3
  *
4
- * Only the retention, compaction and change-feed maintenance exports (`./maintenance`) are `@experimental`.
5
- * The service factories and conformance runner follow normal semver.
4
+ * `createReliableReportingService` takes any `ReportingLedgerStore`. The PostgreSQL store, the production
5
+ * composition (`createPostgresReliableReportingProductionService`) and ledger maintenance
6
+ * (`reportingLedgerMaintenance`) live in `@adcp/reporting-storage`.
7
+ *
8
+ * The scheduler primitives (`reportingSchedulerDelay`, `rotateReportingRoster`, ...) and
9
+ * `REPORTING_MANAGED_DELIVERY_COMPOSITION_V1` are storage-facing building blocks for compositions such as
10
+ * `@adcp/reporting-storage/service`, covered by the experimental policy below; applications should not use them.
6
11
  *
7
12
  * Stability policy: https://github.com/adcontextprotocol/adcp-client/blob/main/docs/guides/REPORTING-STABILITY.md
8
13
  *
9
14
  * @packageDocumentation
10
15
  */
11
- import type { Account, ResolveContext } from '../../server/decisioning/account.mjs';
16
+ import type { Account } from '../../server/decisioning/account.mjs';
12
17
  import type { RequestContext } from '../../server/decisioning/context.mjs';
13
18
  import type { DecisioningPlatform } from '../../server/decisioning/platform.mjs';
14
19
  import type { ReliableReportingPlatform } from '../../server/decisioning/specialisms/reporting.mjs';
15
20
  import type { ReportingDeliveryCapabilities, ReportingDeliveryOffering } from '../../types/tools.generated.mjs';
16
- import { type CreatePostgresPersistentNotificationRuntimeOptions, type PostgresPersistentNotificationRuntime } from '../../server/notification-subscriptions/index.mjs';
17
- import { REPORTING_LEDGER_MIGRATION, PostgresReportingLedgerStore, PostgresReportingManagedDeliveryStore, type CreateReportingProducerOptionsV1, type ReportingConsumerMismatchEscalationV1, type ReportingLedgerConfigurationV1, type ReportingLedgerStore, type ReportingLegacyRevisionReaderV1, type ReportingProducerContactV1, type ReportingProducerV1, type ReportingManagedDeliveryAdapterV1, type ReportingManagedDeliveryRuntimeV1, type PostgresReportingManagedDeliveryStoreOptions, type PostgresReportingNotificationActivityOptions, type PostgresReportingNotificationActivityRuntime, type ReportingPgPool, type ReportingRowStorageOptionsV1, type ReportingSourceWithReaderV1 } from '../ledger/index.mjs';
18
- import { type PostgresReportingWebhookActivityV1 } from '../webhook-activity.mjs';
19
- import { type ReportingChangeFeedMaintenanceOptionsV1, type ReportingLedgerMaintenanceTaskResultV1, type ReportingCompactionOptionsV1, type ReportingRetentionOptionsV1 } from './maintenance.mjs';
21
+ import { type CreateReportingProducerOptionsV1, type ReportingConsumerMismatchEscalationV1, type ReportingLedgerConfigurationV1, type ReportingLedgerStore, type ReportingLegacyRevisionReaderV1, type ReportingProducerContactV1, type ReportingProducerV1, type ReportingSourceWithReaderV1 } from '../ledger/index.mjs';
20
22
  import type { InlineReportingReplayRetentionV1 } from '../source/index.mjs';
21
23
  import { type InlineReportingDeliveryFetchV1, type ReportingSourceOfferingV1 } from '../source/index.mjs';
22
24
  /** The intentionally small provider boundary: one bounded slice fetch plus immutable metadata. */
@@ -161,20 +163,18 @@ export interface CreateReliableReportingServiceOptionsV1<TCtxMeta = Record<strin
161
163
  statusRetentionDays: number;
162
164
  subscribers?: CreateReportingProducerOptionsV1['subscribers'];
163
165
  /**
164
- * Opt in to scheduled ledger maintenance for a Core-only deployment on a
165
- * `PostgresReportingLedgerStore`. `start()` runs it at most once per
166
- * `intervalMilliseconds`; `runMaintenance()` runs it on demand for a host
167
- * with its own scheduler. The production service does this itself and does
168
- * not take this option.
166
+ * Opt in to scheduled ledger maintenance (retention, compaction, change-feed pruning, abandoned-upload
167
+ * sweeps) for a Core-only deployment. `start()` runs it at most once per `intervalMilliseconds`;
168
+ * `runMaintenance()` runs it on demand for a host with its own scheduler.
169
169
  *
170
- * Always swept: expired cursor snapshots and checkpoints, and abandoned row
171
- * uploads. `retention` and `changeFeed` have the same shape and meaning as
172
- * on `createPostgresReliableReportingProductionService`. Retention uses
173
- * this service's `statusRetentionDays`, so it can never retire a period
174
- * earlier than the retention advertised to buyers. `changeFeed` requires the
175
- * store to be built with `changeFeed: true`.
170
+ * The SDK does not know what maintenance a store needs: the option takes a factory, called once at
171
+ * construction with the store and the retention and recovery-window commitments this service advertises
172
+ * to buyers, so maintenance can never retire a period earlier than that retention. For the PostgreSQL
173
+ * store, pass `reportingLedgerMaintenance({ ... })` from `@adcp/reporting-storage`. A factory that
174
+ * throws fails service construction, not the first scheduled pass. The production service in
175
+ * `@adcp/reporting-storage/service` runs maintenance itself and does not take this option.
176
176
  */
177
- maintenance?: ReliableReportingMaintenanceOptionsV1;
177
+ maintenance?: ReliableReportingMaintenanceFactoryV1;
178
178
  /**
179
179
  * Serve exact revision reads (`get_media_buy_delivery`) for revisions this
180
180
  * ledger does not hold, such as a seller's pre-cutover ledger tables. The
@@ -192,19 +192,66 @@ export interface CreateReliableReportingServiceOptionsV1<TCtxMeta = Record<strin
192
192
  */
193
193
  legacyRevisionReader?: ReportingLegacyRevisionReaderV1;
194
194
  }
195
- export interface ReliableReportingMaintenanceOptionsV1 {
196
- /** Minimum time between scheduled maintenance passes. Defaults to 300000 (5 minutes). */
197
- intervalMilliseconds?: number;
198
- /** Period-aligned retention; see the production service's `retention`. */
199
- retention?: ReportingRetentionOptionsV1;
200
- /** Opt-in snapshot compaction; see the production service's `compaction`. */
201
- compaction?: ReportingCompactionOptionsV1;
202
- /** Change-feed pruning and consumer hold; see the production service's `changeFeed`. */
203
- changeFeed?: ReportingChangeFeedMaintenanceOptionsV1;
195
+ /**
196
+ * Outcome of one maintenance task. A task that resolved but could not process some items is `completed`
197
+ * with `partialFailure` set; the pass resumes those items next time.
198
+ */
199
+ export type ReliableReportingMaintenanceTaskResultV1 = {
200
+ readonly task: string;
201
+ readonly status: 'completed';
202
+ readonly result: unknown;
203
+ readonly partialFailure?: Error;
204
+ } | {
205
+ readonly task: string;
206
+ readonly status: 'failed';
207
+ readonly error: unknown;
208
+ };
209
+ /** One scheduled maintenance pass, as built by a {@link ReliableReportingMaintenanceFactoryV1}. */
210
+ export interface ReliableReportingMaintenanceV1 {
211
+ /** Minimum time between scheduled passes. A positive safe integer. */
212
+ readonly intervalMilliseconds: number;
213
+ /**
214
+ * Run one pass. Tasks are isolated: a task failure is reported in its result, never thrown. `report`
215
+ * is awaited, in task order, for every task that rejected or partially failed, unless `signal` has
216
+ * aborted (an abort is shutdown, not a fault).
217
+ */
218
+ run(input: {
219
+ signal?: AbortSignal | undefined;
220
+ report?: (error: unknown) => Promise<void>;
221
+ }): Promise<readonly ReliableReportingMaintenanceTaskResultV1[]>;
222
+ }
223
+ /** What the service tells a maintenance factory about the store it will maintain. */
224
+ export interface ReliableReportingMaintenanceContextV1 {
225
+ readonly store: ReportingLedgerStore;
226
+ /** The `statusRetentionDays` this service advertises. */
227
+ readonly statusRetentionDays: number;
228
+ /** The `automatedRecoveryWindowSeconds` this service advertises. */
229
+ readonly automatedRecoveryWindowSeconds: number;
204
230
  }
231
+ /**
232
+ * Builds the maintenance for one service. Throw from it to refuse a configuration the store cannot
233
+ * serve; the service lets the error reach the caller of `createReliableReportingService`.
234
+ */
235
+ export type ReliableReportingMaintenanceFactoryV1 = (context: ReliableReportingMaintenanceContextV1) => ReliableReportingMaintenanceV1;
236
+ /**
237
+ * Composition token, for packages that compose this service with a managed-delivery runtime (such as
238
+ * `createPostgresReliableReportingProductionService` in `@adcp/reporting-storage/service`). Such a
239
+ * composition passes `{ [REPORTING_MANAGED_DELIVERY_COMPOSITION_V1]: store }`, naming the very `store` it passes
240
+ * as `store`, so the Core service accepts the managed-delivery and reconciled-billing offerings that only that
241
+ * composition can serve. A plain Core service refuses them.
242
+ *
243
+ * It is an assertion by the composer, not an authentication boundary: it keeps a Core-only service from
244
+ * advertising capabilities it has no runtime for by accident (the value must be the store itself, so a copied
245
+ * `true` does nothing). It is a `Symbol.for` key so it holds across duplicate copies of the SDK. Applications
246
+ * should not use it.
247
+ *
248
+ * @experimental Storage-facing building block: breaking changes may ship in minor releases. See https://github.com/adcontextprotocol/adcp-client/blob/main/docs/guides/REPORTING-STABILITY.md
249
+ */
250
+ export declare const REPORTING_MANAGED_DELIVERY_COMPOSITION_V1: unique symbol;
205
251
  export interface ReliableReportingSetupV1 {
206
252
  readonly component: 'reliable-reporting-core';
207
- readonly migrations: readonly [typeof REPORTING_LEDGER_MIGRATION];
253
+ /** The store's own `migrations`: what to apply before first use. Empty for a store that needs none. */
254
+ readonly migrations: readonly string[];
208
255
  readonly requiresIsolatedLedgerDatabaseAcknowledgement: true;
209
256
  }
210
257
  export interface ReliableReportingServiceV1<TCtxMeta = Record<string, unknown>> {
@@ -238,7 +285,7 @@ export interface ReliableReportingServiceV1<TCtxMeta = Record<string, unknown>>
238
285
  */
239
286
  runMaintenance(options?: {
240
287
  signal?: AbortSignal;
241
- }): Promise<ReportingLedgerMaintenanceTaskResultV1[]>;
288
+ }): Promise<readonly ReliableReportingMaintenanceTaskResultV1[]>;
242
289
  start(options: ReliableReportingSchedulerOptionsV1): void;
243
290
  stop(): Promise<void>;
244
291
  }
@@ -247,126 +294,5 @@ export interface ReliableReportingServiceV1<TCtxMeta = Record<string, unknown>>
247
294
  * and scheduler into one Reliable Reporting Core lifecycle owner.
248
295
  */
249
296
  export declare function createReliableReportingService<TCtxMeta = Record<string, unknown>>(options: CreateReliableReportingServiceOptionsV1<TCtxMeta>): ReliableReportingServiceV1<TCtxMeta>;
250
- type ProductionNotificationOptions = Omit<CreatePostgresPersistentNotificationRuntimeOptions, 'db' | 'publisherScope' | 'checkpointDeliveryAttempt' | 'supportedAccountEventTypes'>;
251
- export type CreatePostgresReliableReportingProductionServiceOptionsV1<TCtxMeta = Record<string, unknown>> = Omit<CreateReliableReportingServiceOptionsV1<TCtxMeta>, 'store' | 'subscribers' | 'maintenance'> & {
252
- db: ReportingPgPool;
253
- /** Stable, non-secret deployment namespace shared by reporting workers. */
254
- namespace: string;
255
- /** Stable webhook publisher identity; credentials must never be used here. */
256
- publisherScope: string;
257
- /** Explicit acknowledgement required by the authoritative Core store. */
258
- acknowledgeIsolatedDatabase: true;
259
- /**
260
- * Store new revision rows as verified canonical JSONL chunks. Adds
261
- * `REPORTING_ROW_STORAGE_MIGRATION` (PostgreSQL 13+) to `setup.migrations`
262
- * and probes it before publishing capabilities.
263
- */
264
- rowStorage?: boolean | ReportingRowStorageOptionsV1;
265
- /**
266
- * Opt in to period-aligned retention. Each scheduler pass retires whole
267
- * periods once `max(statusRetentionDays, recordRetentionDays)` has elapsed
268
- * since both the period end and its latest publication, deleting their
269
- * rows and ledger records and leaving a tombstone. Abandoned row uploads
270
- * and expired cursor snapshots are always swept. With `changeFeed`, a
271
- * period is also held until every live registered feed consumer (updated
272
- * within `changeFeed.maxFeedHoldDays`, default 7) has read its changes.
273
- */
274
- retention?: ReportingRetentionOptionsV1;
275
- /**
276
- * Opt in to compacting superseded snapshot revisions to metadata only, as
277
- * adcontextprotocol/adcp#8100 permits. Off by default. Each scheduler pass
278
- * drops the row content of snapshots that are superseded, past their
279
- * recovery grace and not owed to any caller (receipts, current
280
- * `received` / `unreadable` / `content_mismatch` statements), while every
281
- * revision's metadata stays. Official revisions are never compacted. Uses
282
- * this service's `statusRetentionDays` and `automatedRecoveryWindowSeconds`.
283
- * The protocol takes compaction into effect only in the next eligible minor
284
- * after November 20, 2026: do not enable this in production before then.
285
- */
286
- compaction?: ReportingCompactionOptionsV1;
287
- /**
288
- * Maintain the host change feed (`changesAfter`, `getCurrentRevision`,
289
- * `listCurrentRevisions` on `stores.core`). Adds
290
- * `REPORTING_LEDGER_CHANGES_MIGRATION` (PostgreSQL 13+); the scheduler prunes
291
- * changes older than `changeRetentionDays` (default 30) unless a registered
292
- * consumer updated within `maxFeedHoldDays` (default 7) still needs them.
293
- */
294
- changeFeed?: ReportingChangeFeedMaintenanceOptionsV1;
295
- notifications: ProductionNotificationOptions;
296
- managedDelivery: {
297
- adapter: ReportingManagedDeliveryAdapterV1;
298
- resourceRetentionDays: number;
299
- authorizationRevocationSeconds: number;
300
- store?: Omit<PostgresReportingManagedDeliveryStoreOptions, 'notificationActivityPort'>;
301
- };
302
- activity: Omit<PostgresReportingNotificationActivityOptions, 'db' | 'notifications' | 'namespace' | 'attemptCheckpoint' | 'tenantScopeForAccount'> & {
303
- tenantScopeForAccount(accountId: string): string;
304
- };
305
- webhookActivity?: {
306
- tableName?: string;
307
- retentionDays?: number;
308
- };
309
- /** Resolve activity visibility from verified auth/registry state, never request fields. */
310
- resolveWebhookActivityScope(context: ResolveContext): {
311
- tenantId: string;
312
- principalId: string;
313
- } | Promise<{
314
- tenantId: string;
315
- principalId: string;
316
- }>;
317
- /** Trusted complete roster of consumers that owe receipts for an obligation. */
318
- obligatedConsumers?: (input: {
319
- reporting_obligation_id: string;
320
- account_id: string;
321
- }) => Promise<{
322
- ids: readonly string[];
323
- complete: boolean;
324
- version?: string;
325
- }>;
326
- /** Optional migration-system bridge. Called before any capability probe. */
327
- applyMigrations?: (migrations: readonly string[]) => Promise<void>;
328
- };
329
- export interface PostgresReliableReportingProductionServiceV1<TCtxMeta = Record<string, unknown>> {
330
- readonly setup: {
331
- readonly component: 'reliable-reporting-production';
332
- readonly migrations: readonly string[];
333
- };
334
- readonly capabilities: ReportingDeliveryCapabilities;
335
- readonly platform: ReliableReportingPlatform<TCtxMeta>;
336
- readonly core: ReliableReportingServiceV1<TCtxMeta>;
337
- readonly managed: ReportingManagedDeliveryRuntimeV1<RequestContext<Account<TCtxMeta>>>;
338
- readonly notifications: PostgresPersistentNotificationRuntime;
339
- readonly notificationActivity: PostgresReportingNotificationActivityRuntime;
340
- readonly webhookActivity: PostgresReportingWebhookActivityV1;
341
- readonly stores: {
342
- core: PostgresReportingLedgerStore;
343
- managed: PostgresReportingManagedDeliveryStore;
344
- };
345
- readonly running: boolean;
346
- installConfiguration: ReliableReportingServiceV1<TCtxMeta>['installConfiguration'];
347
- install<TPlatform extends DecisioningPlatform<unknown, TCtxMeta>>(platform: TPlatform): TPlatform & {
348
- reporting: ReliableReportingPlatform<TCtxMeta>;
349
- };
350
- runCycle(options: ReliableReportingCycleOptionsV1): Promise<{
351
- core: Awaited<ReturnType<ReliableReportingServiceV1<TCtxMeta>['runCycle']>>;
352
- managed: Awaited<ReturnType<ReportingManagedDeliveryRuntimeV1['runWorker']>>;
353
- }>;
354
- recoverOnce(options: {
355
- deploymentWide: true;
356
- }): Promise<{
357
- activity: Awaited<ReturnType<PostgresReportingNotificationActivityRuntime['recoverOnce']>>;
358
- webhookOutbox: Awaited<ReturnType<PostgresPersistentNotificationRuntime['recoverOnce']>>;
359
- }>;
360
- start(options: ReliableReportingSchedulerOptionsV1 & {
361
- deploymentWide: true;
362
- }): void;
363
- stop(): Promise<void>;
364
- }
365
- /**
366
- * Assemble and probe the complete seller-side Reliable Reporting production
367
- * chain. Capability publication happens only after every durable component is
368
- * present and the managed policy has been adopted.
369
- */
370
- export declare function createPostgresReliableReportingProductionService<TCtxMeta = Record<string, unknown>>(options: CreatePostgresReliableReportingProductionServiceOptionsV1<TCtxMeta>): Promise<PostgresReliableReportingProductionServiceV1<TCtxMeta>>;
371
297
  export * from './conformance.mjs';
372
- export { ReportingMaintenancePartialFailureError, type ReportingChangeFeedMaintenanceOptionsV1, type ReportingCompactionOptionsV1, type ReportingLedgerMaintenanceStoreV1, type ReportingLedgerMaintenanceTaskNameV1, type ReportingLedgerMaintenanceTaskResultV1, type ReportingRetentionOptionsV1, } from './maintenance.mjs';
298
+ export * from './scheduler-support.mjs';
@@ -1,22 +1,24 @@
1
1
  /**
2
- * Reliable Reporting service wiring, conformance runner and ledger maintenance.
2
+ * Reliable Reporting service wiring and conformance runner.
3
3
  *
4
- * Only the retention, compaction and change-feed maintenance exports (`./maintenance`) are `@experimental`.
5
- * The service factories and conformance runner follow normal semver.
4
+ * `createReliableReportingService` takes any `ReportingLedgerStore`. The PostgreSQL store, the production
5
+ * composition (`createPostgresReliableReportingProductionService`) and ledger maintenance
6
+ * (`reportingLedgerMaintenance`) live in `@adcp/reporting-storage`.
7
+ *
8
+ * The scheduler primitives (`reportingSchedulerDelay`, `rotateReportingRoster`, ...) and
9
+ * `REPORTING_MANAGED_DELIVERY_COMPOSITION_V1` are storage-facing building blocks for compositions such as
10
+ * `@adcp/reporting-storage/service`, covered by the experimental policy below; applications should not use them.
6
11
  *
7
12
  * Stability policy: https://github.com/adcontextprotocol/adcp-client/blob/main/docs/guides/REPORTING-STABILITY.md
8
13
  *
9
14
  * @packageDocumentation
10
15
  */
11
- import type { Account, ResolveContext } from '../../server/decisioning/account';
16
+ import type { Account } from '../../server/decisioning/account';
12
17
  import type { RequestContext } from '../../server/decisioning/context';
13
18
  import type { DecisioningPlatform } from '../../server/decisioning/platform';
14
19
  import type { ReliableReportingPlatform } from '../../server/decisioning/specialisms/reporting';
15
20
  import type { ReportingDeliveryCapabilities, ReportingDeliveryOffering } from '../../types/tools.generated';
16
- import { type CreatePostgresPersistentNotificationRuntimeOptions, type PostgresPersistentNotificationRuntime } from '../../server/notification-subscriptions';
17
- import { REPORTING_LEDGER_MIGRATION, PostgresReportingLedgerStore, PostgresReportingManagedDeliveryStore, type CreateReportingProducerOptionsV1, type ReportingConsumerMismatchEscalationV1, type ReportingLedgerConfigurationV1, type ReportingLedgerStore, type ReportingLegacyRevisionReaderV1, type ReportingProducerContactV1, type ReportingProducerV1, type ReportingManagedDeliveryAdapterV1, type ReportingManagedDeliveryRuntimeV1, type PostgresReportingManagedDeliveryStoreOptions, type PostgresReportingNotificationActivityOptions, type PostgresReportingNotificationActivityRuntime, type ReportingPgPool, type ReportingRowStorageOptionsV1, type ReportingSourceWithReaderV1 } from '../ledger';
18
- import { type PostgresReportingWebhookActivityV1 } from '../webhook-activity';
19
- import { type ReportingChangeFeedMaintenanceOptionsV1, type ReportingLedgerMaintenanceTaskResultV1, type ReportingCompactionOptionsV1, type ReportingRetentionOptionsV1 } from './maintenance';
21
+ import { type CreateReportingProducerOptionsV1, type ReportingConsumerMismatchEscalationV1, type ReportingLedgerConfigurationV1, type ReportingLedgerStore, type ReportingLegacyRevisionReaderV1, type ReportingProducerContactV1, type ReportingProducerV1, type ReportingSourceWithReaderV1 } from '../ledger';
20
22
  import type { InlineReportingReplayRetentionV1 } from '../source';
21
23
  import { type InlineReportingDeliveryFetchV1, type ReportingSourceOfferingV1 } from '../source';
22
24
  /** The intentionally small provider boundary: one bounded slice fetch plus immutable metadata. */
@@ -161,20 +163,18 @@ export interface CreateReliableReportingServiceOptionsV1<TCtxMeta = Record<strin
161
163
  statusRetentionDays: number;
162
164
  subscribers?: CreateReportingProducerOptionsV1['subscribers'];
163
165
  /**
164
- * Opt in to scheduled ledger maintenance for a Core-only deployment on a
165
- * `PostgresReportingLedgerStore`. `start()` runs it at most once per
166
- * `intervalMilliseconds`; `runMaintenance()` runs it on demand for a host
167
- * with its own scheduler. The production service does this itself and does
168
- * not take this option.
166
+ * Opt in to scheduled ledger maintenance (retention, compaction, change-feed pruning, abandoned-upload
167
+ * sweeps) for a Core-only deployment. `start()` runs it at most once per `intervalMilliseconds`;
168
+ * `runMaintenance()` runs it on demand for a host with its own scheduler.
169
169
  *
170
- * Always swept: expired cursor snapshots and checkpoints, and abandoned row
171
- * uploads. `retention` and `changeFeed` have the same shape and meaning as
172
- * on `createPostgresReliableReportingProductionService`. Retention uses
173
- * this service's `statusRetentionDays`, so it can never retire a period
174
- * earlier than the retention advertised to buyers. `changeFeed` requires the
175
- * store to be built with `changeFeed: true`.
170
+ * The SDK does not know what maintenance a store needs: the option takes a factory, called once at
171
+ * construction with the store and the retention and recovery-window commitments this service advertises
172
+ * to buyers, so maintenance can never retire a period earlier than that retention. For the PostgreSQL
173
+ * store, pass `reportingLedgerMaintenance({ ... })` from `@adcp/reporting-storage`. A factory that
174
+ * throws fails service construction, not the first scheduled pass. The production service in
175
+ * `@adcp/reporting-storage/service` runs maintenance itself and does not take this option.
176
176
  */
177
- maintenance?: ReliableReportingMaintenanceOptionsV1;
177
+ maintenance?: ReliableReportingMaintenanceFactoryV1;
178
178
  /**
179
179
  * Serve exact revision reads (`get_media_buy_delivery`) for revisions this
180
180
  * ledger does not hold, such as a seller's pre-cutover ledger tables. The
@@ -192,19 +192,66 @@ export interface CreateReliableReportingServiceOptionsV1<TCtxMeta = Record<strin
192
192
  */
193
193
  legacyRevisionReader?: ReportingLegacyRevisionReaderV1;
194
194
  }
195
- export interface ReliableReportingMaintenanceOptionsV1 {
196
- /** Minimum time between scheduled maintenance passes. Defaults to 300000 (5 minutes). */
197
- intervalMilliseconds?: number;
198
- /** Period-aligned retention; see the production service's `retention`. */
199
- retention?: ReportingRetentionOptionsV1;
200
- /** Opt-in snapshot compaction; see the production service's `compaction`. */
201
- compaction?: ReportingCompactionOptionsV1;
202
- /** Change-feed pruning and consumer hold; see the production service's `changeFeed`. */
203
- changeFeed?: ReportingChangeFeedMaintenanceOptionsV1;
195
+ /**
196
+ * Outcome of one maintenance task. A task that resolved but could not process some items is `completed`
197
+ * with `partialFailure` set; the pass resumes those items next time.
198
+ */
199
+ export type ReliableReportingMaintenanceTaskResultV1 = {
200
+ readonly task: string;
201
+ readonly status: 'completed';
202
+ readonly result: unknown;
203
+ readonly partialFailure?: Error;
204
+ } | {
205
+ readonly task: string;
206
+ readonly status: 'failed';
207
+ readonly error: unknown;
208
+ };
209
+ /** One scheduled maintenance pass, as built by a {@link ReliableReportingMaintenanceFactoryV1}. */
210
+ export interface ReliableReportingMaintenanceV1 {
211
+ /** Minimum time between scheduled passes. A positive safe integer. */
212
+ readonly intervalMilliseconds: number;
213
+ /**
214
+ * Run one pass. Tasks are isolated: a task failure is reported in its result, never thrown. `report`
215
+ * is awaited, in task order, for every task that rejected or partially failed, unless `signal` has
216
+ * aborted (an abort is shutdown, not a fault).
217
+ */
218
+ run(input: {
219
+ signal?: AbortSignal | undefined;
220
+ report?: (error: unknown) => Promise<void>;
221
+ }): Promise<readonly ReliableReportingMaintenanceTaskResultV1[]>;
222
+ }
223
+ /** What the service tells a maintenance factory about the store it will maintain. */
224
+ export interface ReliableReportingMaintenanceContextV1 {
225
+ readonly store: ReportingLedgerStore;
226
+ /** The `statusRetentionDays` this service advertises. */
227
+ readonly statusRetentionDays: number;
228
+ /** The `automatedRecoveryWindowSeconds` this service advertises. */
229
+ readonly automatedRecoveryWindowSeconds: number;
204
230
  }
231
+ /**
232
+ * Builds the maintenance for one service. Throw from it to refuse a configuration the store cannot
233
+ * serve; the service lets the error reach the caller of `createReliableReportingService`.
234
+ */
235
+ export type ReliableReportingMaintenanceFactoryV1 = (context: ReliableReportingMaintenanceContextV1) => ReliableReportingMaintenanceV1;
236
+ /**
237
+ * Composition token, for packages that compose this service with a managed-delivery runtime (such as
238
+ * `createPostgresReliableReportingProductionService` in `@adcp/reporting-storage/service`). Such a
239
+ * composition passes `{ [REPORTING_MANAGED_DELIVERY_COMPOSITION_V1]: store }`, naming the very `store` it passes
240
+ * as `store`, so the Core service accepts the managed-delivery and reconciled-billing offerings that only that
241
+ * composition can serve. A plain Core service refuses them.
242
+ *
243
+ * It is an assertion by the composer, not an authentication boundary: it keeps a Core-only service from
244
+ * advertising capabilities it has no runtime for by accident (the value must be the store itself, so a copied
245
+ * `true` does nothing). It is a `Symbol.for` key so it holds across duplicate copies of the SDK. Applications
246
+ * should not use it.
247
+ *
248
+ * @experimental Storage-facing building block: breaking changes may ship in minor releases. See https://github.com/adcontextprotocol/adcp-client/blob/main/docs/guides/REPORTING-STABILITY.md
249
+ */
250
+ export declare const REPORTING_MANAGED_DELIVERY_COMPOSITION_V1: unique symbol;
205
251
  export interface ReliableReportingSetupV1 {
206
252
  readonly component: 'reliable-reporting-core';
207
- readonly migrations: readonly [typeof REPORTING_LEDGER_MIGRATION];
253
+ /** The store's own `migrations`: what to apply before first use. Empty for a store that needs none. */
254
+ readonly migrations: readonly string[];
208
255
  readonly requiresIsolatedLedgerDatabaseAcknowledgement: true;
209
256
  }
210
257
  export interface ReliableReportingServiceV1<TCtxMeta = Record<string, unknown>> {
@@ -238,7 +285,7 @@ export interface ReliableReportingServiceV1<TCtxMeta = Record<string, unknown>>
238
285
  */
239
286
  runMaintenance(options?: {
240
287
  signal?: AbortSignal;
241
- }): Promise<ReportingLedgerMaintenanceTaskResultV1[]>;
288
+ }): Promise<readonly ReliableReportingMaintenanceTaskResultV1[]>;
242
289
  start(options: ReliableReportingSchedulerOptionsV1): void;
243
290
  stop(): Promise<void>;
244
291
  }
@@ -247,126 +294,5 @@ export interface ReliableReportingServiceV1<TCtxMeta = Record<string, unknown>>
247
294
  * and scheduler into one Reliable Reporting Core lifecycle owner.
248
295
  */
249
296
  export declare function createReliableReportingService<TCtxMeta = Record<string, unknown>>(options: CreateReliableReportingServiceOptionsV1<TCtxMeta>): ReliableReportingServiceV1<TCtxMeta>;
250
- type ProductionNotificationOptions = Omit<CreatePostgresPersistentNotificationRuntimeOptions, 'db' | 'publisherScope' | 'checkpointDeliveryAttempt' | 'supportedAccountEventTypes'>;
251
- export type CreatePostgresReliableReportingProductionServiceOptionsV1<TCtxMeta = Record<string, unknown>> = Omit<CreateReliableReportingServiceOptionsV1<TCtxMeta>, 'store' | 'subscribers' | 'maintenance'> & {
252
- db: ReportingPgPool;
253
- /** Stable, non-secret deployment namespace shared by reporting workers. */
254
- namespace: string;
255
- /** Stable webhook publisher identity; credentials must never be used here. */
256
- publisherScope: string;
257
- /** Explicit acknowledgement required by the authoritative Core store. */
258
- acknowledgeIsolatedDatabase: true;
259
- /**
260
- * Store new revision rows as verified canonical JSONL chunks. Adds
261
- * `REPORTING_ROW_STORAGE_MIGRATION` (PostgreSQL 13+) to `setup.migrations`
262
- * and probes it before publishing capabilities.
263
- */
264
- rowStorage?: boolean | ReportingRowStorageOptionsV1;
265
- /**
266
- * Opt in to period-aligned retention. Each scheduler pass retires whole
267
- * periods once `max(statusRetentionDays, recordRetentionDays)` has elapsed
268
- * since both the period end and its latest publication, deleting their
269
- * rows and ledger records and leaving a tombstone. Abandoned row uploads
270
- * and expired cursor snapshots are always swept. With `changeFeed`, a
271
- * period is also held until every live registered feed consumer (updated
272
- * within `changeFeed.maxFeedHoldDays`, default 7) has read its changes.
273
- */
274
- retention?: ReportingRetentionOptionsV1;
275
- /**
276
- * Opt in to compacting superseded snapshot revisions to metadata only, as
277
- * adcontextprotocol/adcp#8100 permits. Off by default. Each scheduler pass
278
- * drops the row content of snapshots that are superseded, past their
279
- * recovery grace and not owed to any caller (receipts, current
280
- * `received` / `unreadable` / `content_mismatch` statements), while every
281
- * revision's metadata stays. Official revisions are never compacted. Uses
282
- * this service's `statusRetentionDays` and `automatedRecoveryWindowSeconds`.
283
- * The protocol takes compaction into effect only in the next eligible minor
284
- * after November 20, 2026: do not enable this in production before then.
285
- */
286
- compaction?: ReportingCompactionOptionsV1;
287
- /**
288
- * Maintain the host change feed (`changesAfter`, `getCurrentRevision`,
289
- * `listCurrentRevisions` on `stores.core`). Adds
290
- * `REPORTING_LEDGER_CHANGES_MIGRATION` (PostgreSQL 13+); the scheduler prunes
291
- * changes older than `changeRetentionDays` (default 30) unless a registered
292
- * consumer updated within `maxFeedHoldDays` (default 7) still needs them.
293
- */
294
- changeFeed?: ReportingChangeFeedMaintenanceOptionsV1;
295
- notifications: ProductionNotificationOptions;
296
- managedDelivery: {
297
- adapter: ReportingManagedDeliveryAdapterV1;
298
- resourceRetentionDays: number;
299
- authorizationRevocationSeconds: number;
300
- store?: Omit<PostgresReportingManagedDeliveryStoreOptions, 'notificationActivityPort'>;
301
- };
302
- activity: Omit<PostgresReportingNotificationActivityOptions, 'db' | 'notifications' | 'namespace' | 'attemptCheckpoint' | 'tenantScopeForAccount'> & {
303
- tenantScopeForAccount(accountId: string): string;
304
- };
305
- webhookActivity?: {
306
- tableName?: string;
307
- retentionDays?: number;
308
- };
309
- /** Resolve activity visibility from verified auth/registry state, never request fields. */
310
- resolveWebhookActivityScope(context: ResolveContext): {
311
- tenantId: string;
312
- principalId: string;
313
- } | Promise<{
314
- tenantId: string;
315
- principalId: string;
316
- }>;
317
- /** Trusted complete roster of consumers that owe receipts for an obligation. */
318
- obligatedConsumers?: (input: {
319
- reporting_obligation_id: string;
320
- account_id: string;
321
- }) => Promise<{
322
- ids: readonly string[];
323
- complete: boolean;
324
- version?: string;
325
- }>;
326
- /** Optional migration-system bridge. Called before any capability probe. */
327
- applyMigrations?: (migrations: readonly string[]) => Promise<void>;
328
- };
329
- export interface PostgresReliableReportingProductionServiceV1<TCtxMeta = Record<string, unknown>> {
330
- readonly setup: {
331
- readonly component: 'reliable-reporting-production';
332
- readonly migrations: readonly string[];
333
- };
334
- readonly capabilities: ReportingDeliveryCapabilities;
335
- readonly platform: ReliableReportingPlatform<TCtxMeta>;
336
- readonly core: ReliableReportingServiceV1<TCtxMeta>;
337
- readonly managed: ReportingManagedDeliveryRuntimeV1<RequestContext<Account<TCtxMeta>>>;
338
- readonly notifications: PostgresPersistentNotificationRuntime;
339
- readonly notificationActivity: PostgresReportingNotificationActivityRuntime;
340
- readonly webhookActivity: PostgresReportingWebhookActivityV1;
341
- readonly stores: {
342
- core: PostgresReportingLedgerStore;
343
- managed: PostgresReportingManagedDeliveryStore;
344
- };
345
- readonly running: boolean;
346
- installConfiguration: ReliableReportingServiceV1<TCtxMeta>['installConfiguration'];
347
- install<TPlatform extends DecisioningPlatform<unknown, TCtxMeta>>(platform: TPlatform): TPlatform & {
348
- reporting: ReliableReportingPlatform<TCtxMeta>;
349
- };
350
- runCycle(options: ReliableReportingCycleOptionsV1): Promise<{
351
- core: Awaited<ReturnType<ReliableReportingServiceV1<TCtxMeta>['runCycle']>>;
352
- managed: Awaited<ReturnType<ReportingManagedDeliveryRuntimeV1['runWorker']>>;
353
- }>;
354
- recoverOnce(options: {
355
- deploymentWide: true;
356
- }): Promise<{
357
- activity: Awaited<ReturnType<PostgresReportingNotificationActivityRuntime['recoverOnce']>>;
358
- webhookOutbox: Awaited<ReturnType<PostgresPersistentNotificationRuntime['recoverOnce']>>;
359
- }>;
360
- start(options: ReliableReportingSchedulerOptionsV1 & {
361
- deploymentWide: true;
362
- }): void;
363
- stop(): Promise<void>;
364
- }
365
- /**
366
- * Assemble and probe the complete seller-side Reliable Reporting production
367
- * chain. Capability publication happens only after every durable component is
368
- * present and the managed policy has been adopted.
369
- */
370
- export declare function createPostgresReliableReportingProductionService<TCtxMeta = Record<string, unknown>>(options: CreatePostgresReliableReportingProductionServiceOptionsV1<TCtxMeta>): Promise<PostgresReliableReportingProductionServiceV1<TCtxMeta>>;
371
297
  export * from './conformance';
372
- export { ReportingMaintenancePartialFailureError, type ReportingChangeFeedMaintenanceOptionsV1, type ReportingCompactionOptionsV1, type ReportingLedgerMaintenanceStoreV1, type ReportingLedgerMaintenanceTaskNameV1, type ReportingLedgerMaintenanceTaskResultV1, type ReportingRetentionOptionsV1, } from './maintenance';
298
+ export * from './scheduler-support';