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

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 (182) 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/version.d.mts +3 -3
  73. package/dist/lib/version.d.ts +3 -3
  74. package/dist/lib/version.js +3 -3
  75. package/dist/lib/version.mjs +3 -3
  76. package/docs/TYPE-SUMMARY.md +23 -5
  77. package/docs/guides/REPORTING-GCS-FENCE.md +3 -3
  78. package/docs/guides/REPORTING-GCS-MANAGED.md +4 -4
  79. package/docs/guides/REPORTING-LEDGER-CUTOVER.md +7 -7
  80. package/docs/guides/REPORTING-LEDGER.md +107 -51
  81. package/docs/guides/REPORTING-OPERATIONS.md +66 -5
  82. package/docs/guides/REPORTING-STABILITY.md +36 -32
  83. package/docs/llms.txt +4 -3
  84. package/docs/migration-14.x-rc-worksheet.md +4 -7
  85. package/docs/migration-reporting-storage-package.md +186 -0
  86. package/examples/README.md +1 -1
  87. package/package.json +13 -78
  88. package/dist/lib/reporting/azure/index.d.mts +0 -31
  89. package/dist/lib/reporting/azure/index.d.ts +0 -31
  90. package/dist/lib/reporting/azure/index.js +0 -266
  91. package/dist/lib/reporting/azure/index.mjs +0 -249
  92. package/dist/lib/reporting/bigquery/index.d.mts +0 -246
  93. package/dist/lib/reporting/bigquery/index.d.ts +0 -246
  94. package/dist/lib/reporting/bigquery/index.js +0 -633
  95. package/dist/lib/reporting/bigquery/index.mjs +0 -594
  96. package/dist/lib/reporting/gcs/adapter.d.mts +0 -38
  97. package/dist/lib/reporting/gcs/adapter.d.ts +0 -38
  98. package/dist/lib/reporting/gcs/adapter.js +0 -342
  99. package/dist/lib/reporting/gcs/adapter.mjs +0 -325
  100. package/dist/lib/reporting/gcs/bucket-policy.d.mts +0 -3
  101. package/dist/lib/reporting/gcs/bucket-policy.d.ts +0 -3
  102. package/dist/lib/reporting/gcs/bucket-policy.mjs +0 -7
  103. package/dist/lib/reporting/gcs/errors.d.mts +0 -11
  104. package/dist/lib/reporting/gcs/errors.d.ts +0 -11
  105. package/dist/lib/reporting/gcs/errors.mjs +0 -16
  106. package/dist/lib/reporting/gcs/fence.d.mts +0 -41
  107. package/dist/lib/reporting/gcs/fence.d.ts +0 -41
  108. package/dist/lib/reporting/gcs/fence.js +0 -250
  109. package/dist/lib/reporting/gcs/fence.mjs +0 -230
  110. package/dist/lib/reporting/gcs/index.d.mts +0 -18
  111. package/dist/lib/reporting/gcs/index.d.ts +0 -18
  112. package/dist/lib/reporting/gcs/index.js +0 -44
  113. package/dist/lib/reporting/gcs/index.mjs +0 -14
  114. package/dist/lib/reporting/gcs/io.d.mts +0 -7
  115. package/dist/lib/reporting/gcs/io.d.ts +0 -7
  116. package/dist/lib/reporting/gcs/io.js +0 -95
  117. package/dist/lib/reporting/gcs/io.mjs +0 -69
  118. package/dist/lib/reporting/gcs/reader.d.mts +0 -67
  119. package/dist/lib/reporting/gcs/reader.d.ts +0 -67
  120. package/dist/lib/reporting/gcs/reader.js +0 -193
  121. package/dist/lib/reporting/gcs/reader.mjs +0 -169
  122. package/dist/lib/reporting/gcs/row-provider.d.mts +0 -39
  123. package/dist/lib/reporting/gcs/row-provider.d.ts +0 -39
  124. package/dist/lib/reporting/gcs/row-provider.js +0 -225
  125. package/dist/lib/reporting/gcs/row-provider.mjs +0 -208
  126. package/dist/lib/reporting/gcs/validation.d.mts +0 -5
  127. package/dist/lib/reporting/gcs/validation.d.ts +0 -5
  128. package/dist/lib/reporting/gcs/validation.js +0 -49
  129. package/dist/lib/reporting/gcs/validation.mjs +0 -25
  130. package/dist/lib/reporting/ledger/change-feed.d.mts +0 -69
  131. package/dist/lib/reporting/ledger/change-feed.d.ts +0 -69
  132. package/dist/lib/reporting/ledger/change-feed.js +0 -107
  133. package/dist/lib/reporting/ledger/change-feed.mjs +0 -80
  134. package/dist/lib/reporting/ledger/managed-postgres.d.mts +0 -293
  135. package/dist/lib/reporting/ledger/managed-postgres.d.ts +0 -293
  136. package/dist/lib/reporting/ledger/managed-postgres.js +0 -2346
  137. package/dist/lib/reporting/ledger/managed-postgres.mjs +0 -2332
  138. package/dist/lib/reporting/ledger/managed-router.d.mts +0 -148
  139. package/dist/lib/reporting/ledger/managed-router.d.ts +0 -148
  140. package/dist/lib/reporting/ledger/managed-router.js +0 -280
  141. package/dist/lib/reporting/ledger/managed-router.mjs +0 -258
  142. package/dist/lib/reporting/ledger/managed.d.mts +0 -535
  143. package/dist/lib/reporting/ledger/managed.d.ts +0 -535
  144. package/dist/lib/reporting/ledger/managed.js +0 -761
  145. package/dist/lib/reporting/ledger/managed.mjs +0 -729
  146. package/dist/lib/reporting/ledger/notification-activity.d.mts +0 -332
  147. package/dist/lib/reporting/ledger/notification-activity.d.ts +0 -332
  148. package/dist/lib/reporting/ledger/notification-activity.js +0 -1366
  149. package/dist/lib/reporting/ledger/notification-activity.mjs +0 -1337
  150. package/dist/lib/reporting/ledger/object-writes.d.mts +0 -128
  151. package/dist/lib/reporting/ledger/object-writes.d.ts +0 -128
  152. package/dist/lib/reporting/ledger/object-writes.js +0 -147
  153. package/dist/lib/reporting/ledger/object-writes.mjs +0 -114
  154. package/dist/lib/reporting/ledger/postgres.d.mts +0 -689
  155. package/dist/lib/reporting/ledger/postgres.d.ts +0 -689
  156. package/dist/lib/reporting/ledger/postgres.js +0 -4462
  157. package/dist/lib/reporting/ledger/postgres.mjs +0 -4462
  158. package/dist/lib/reporting/ledger/row-storage-migration.d.mts +0 -59
  159. package/dist/lib/reporting/ledger/row-storage-migration.d.ts +0 -59
  160. package/dist/lib/reporting/ledger/row-storage-migration.js +0 -365
  161. package/dist/lib/reporting/ledger/row-storage-migration.mjs +0 -339
  162. package/dist/lib/reporting/ledger/row-storage-object.d.mts +0 -203
  163. package/dist/lib/reporting/ledger/row-storage-object.d.ts +0 -203
  164. package/dist/lib/reporting/ledger/row-storage-object.js +0 -379
  165. package/dist/lib/reporting/ledger/row-storage-object.mjs +0 -335
  166. package/dist/lib/reporting/ledger/row-storage-provider-io.d.mts +0 -44
  167. package/dist/lib/reporting/ledger/row-storage-provider-io.d.ts +0 -44
  168. package/dist/lib/reporting/ledger/row-storage-provider-io.js +0 -142
  169. package/dist/lib/reporting/ledger/row-storage-provider-io.mjs +0 -111
  170. package/dist/lib/reporting/ledger/row-storage.d.mts +0 -316
  171. package/dist/lib/reporting/ledger/row-storage.d.ts +0 -316
  172. package/dist/lib/reporting/ledger/row-storage.js +0 -812
  173. package/dist/lib/reporting/ledger/row-storage.mjs +0 -802
  174. package/dist/lib/reporting/s3/index.d.mts +0 -34
  175. package/dist/lib/reporting/s3/index.d.ts +0 -34
  176. package/dist/lib/reporting/s3/index.js +0 -347
  177. package/dist/lib/reporting/s3/index.mjs +0 -340
  178. package/dist/lib/reporting/service/maintenance.d.mts +0 -148
  179. package/dist/lib/reporting/service/maintenance.d.ts +0 -148
  180. package/dist/lib/reporting/service/maintenance.js +0 -185
  181. package/dist/lib/reporting/service/maintenance.mjs +0 -159
  182. package/examples/reliable-reporting-service/README.md +0 -169
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adcp/sdk",
3
- "version": "16.0.0-beta.3",
3
+ "version": "16.0.0-beta.4",
4
4
  "description": "AdCP SDK — client, server, and compliance harnesses for the AdContext Protocol (MCP + A2A)",
5
5
  "workspaces": [
6
6
  ".",
@@ -420,46 +420,6 @@
420
420
  "default": "./dist/lib/media-buy/actions.js"
421
421
  }
422
422
  },
423
- "./reporting/gcs": {
424
- "import": {
425
- "types": "./dist/lib/reporting/gcs/index.d.mts",
426
- "default": "./dist/lib/reporting/gcs/index.mjs"
427
- },
428
- "require": {
429
- "types": "./dist/lib/reporting/gcs/index.d.ts",
430
- "default": "./dist/lib/reporting/gcs/index.js"
431
- }
432
- },
433
- "./reporting/s3": {
434
- "import": {
435
- "types": "./dist/lib/reporting/s3/index.d.mts",
436
- "default": "./dist/lib/reporting/s3/index.mjs"
437
- },
438
- "require": {
439
- "types": "./dist/lib/reporting/s3/index.d.ts",
440
- "default": "./dist/lib/reporting/s3/index.js"
441
- }
442
- },
443
- "./reporting/azure": {
444
- "import": {
445
- "types": "./dist/lib/reporting/azure/index.d.mts",
446
- "default": "./dist/lib/reporting/azure/index.mjs"
447
- },
448
- "require": {
449
- "types": "./dist/lib/reporting/azure/index.d.ts",
450
- "default": "./dist/lib/reporting/azure/index.js"
451
- }
452
- },
453
- "./reporting/bigquery": {
454
- "import": {
455
- "types": "./dist/lib/reporting/bigquery/index.d.mts",
456
- "default": "./dist/lib/reporting/bigquery/index.mjs"
457
- },
458
- "require": {
459
- "types": "./dist/lib/reporting/bigquery/index.d.ts",
460
- "default": "./dist/lib/reporting/bigquery/index.js"
461
- }
462
- },
463
423
  "./identity-3.3": {
464
424
  "import": {
465
425
  "types": "./dist/lib/identity-3.3/index.d.mts",
@@ -593,18 +553,6 @@
593
553
  "media-buy/actions": [
594
554
  "dist/lib/media-buy/actions.d.ts"
595
555
  ],
596
- "reporting/gcs": [
597
- "dist/lib/reporting/gcs/index.d.ts"
598
- ],
599
- "reporting/s3": [
600
- "dist/lib/reporting/s3/index.d.ts"
601
- ],
602
- "reporting/azure": [
603
- "dist/lib/reporting/azure/index.d.ts"
604
- ],
605
- "reporting/bigquery": [
606
- "dist/lib/reporting/bigquery/index.d.ts"
607
- ],
608
556
  "identity-3.3": [
609
557
  "dist/lib/identity-3.3/index.d.ts"
610
558
  ]
@@ -642,7 +590,6 @@
642
590
  "examples/CONTRIBUTING.md",
643
591
  "examples/storyboards/account-sync-contract.yaml",
644
592
  "examples/adcp.config.json",
645
- "examples/reliable-reporting-service/README.md",
646
593
  "examples/reliable-reporting-buyer/**/*",
647
594
  "examples/seller-3.2-starter.ts",
648
595
  "examples/supply-path-verification.ts",
@@ -676,10 +623,10 @@
676
623
  "sync:agents": "node scripts/import-claude-agents.mjs",
677
624
  "prepublishOnly": "npm run clean && npm run sync-schemas:all && (test -f src/lib/types/tools.generated.ts || npm run generate-types) && npm run build:lib && npm run check:publish-protocol-artifacts && node --test-timeout=60000 --test-force-exit --test test/lib/adcp-client.test.js test/lib/validation.test.js test/lib/zod-schemas.test.js",
678
625
  "build": "npm run build:lib",
679
- "build:lib": "npm run sync-version && npm run schemas:ensure && tsx scripts/generate-wire-spec-fields.ts && tsup && node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc --project tsconfig.lib.json --emitDeclarationOnly && tsx scripts/copy-schemas-to-dist.ts && tsx scripts/copy-reporting-source-schemas.ts && tsx scripts/copy-reporting-consumer-status-fixtures.ts && tsx scripts/sync-canonical-storyboard-fixtures.ts --copy-dist && tsx scripts/copy-v2-projection-catalog.ts && tsx scripts/generate-per-tool-types.ts && tsx scripts/generate-dmts-declarations.ts",
626
+ "build:lib": "npm run sync-version && npm run schemas:ensure && tsx scripts/generate-wire-spec-fields.ts && tsup && node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc --project tsconfig.lib.json --emitDeclarationOnly && tsx scripts/copy-schemas-to-dist.ts && tsx scripts/copy-reporting-source-schemas.ts && tsx scripts/copy-reporting-consumer-status-fixtures.ts && tsx scripts/sync-canonical-storyboard-fixtures.ts --copy-dist && tsx scripts/copy-v2-projection-catalog.ts && tsx scripts/generate-per-tool-types.ts && tsx scripts/generate-dmts-declarations.ts && npm run build --workspace=@adcp/reporting-storage",
680
627
  "build:test-agents": "npm run build:lib && tsc -p test-agents/tsconfig.json --rootDir test-agents",
681
628
  "pretest": "npm run build:lib",
682
- "test": "npm run test:node && npm test --workspace=packages/eslint-plugin --if-present && npm test --workspace=@adcp/reference-renderers",
629
+ "test": "npm run test:node && npm test --workspace=packages/eslint-plugin --if-present && npm test --workspace=@adcp/reference-renderers && npm run test:reporting-storage",
683
630
  "test:node": "npm run test:node:fast && npm run test:node:slow",
684
631
  "test:node:fast": "node scripts/run-node-tests.mjs --group fast",
685
632
  "test:node:fast:shard": "node scripts/run-node-tests.mjs --group fast --shard-env",
@@ -727,21 +674,23 @@
727
674
  "compliance:fork-matrix": "node --test --test-timeout=300000 'test/examples/hello-*.test.js' test/examples/proxy-seller-snap.test.js",
728
675
  "typecheck:skill-examples": "tsx scripts/typecheck-skill-examples.ts",
729
676
  "check:skill-sync": "tsx scripts/check-skill-sync.ts",
730
- "check:package": "npm run check:runtime-compat && npm run check:packed-artifact && npm run check:publish-protocol-artifacts && npm run typecheck:examples && publint --strict && node --max-old-space-size=8192 ./node_modules/@arethetypeswrong/cli/dist/index.js --pack . --exclude-entrypoints compliance-fixtures/reporting-consumer-status-v1.json compliance-fixtures/principal.yaml compliance-fixtures/reporting-core.yaml compliance-fixtures/canonical-storyboards-provenance.json",
731
- "check:packed-artifact": "node scripts/check-packed-artifact.mjs && node scripts/check-reporting-consumer-package.mjs",
677
+ "check:package": "npm run check:runtime-compat && npm run check:packed-artifact && npm run check:publish-protocol-artifacts && npm run typecheck:examples && publint --strict && node --max-old-space-size=8192 ./node_modules/@arethetypeswrong/cli/dist/index.js --pack . --exclude-entrypoints compliance-fixtures/reporting-consumer-status-v1.json compliance-fixtures/principal.yaml compliance-fixtures/reporting-core.yaml compliance-fixtures/canonical-storyboards-provenance.json && npm run check --workspace=@adcp/reporting-storage && node --max-old-space-size=8192 ./node_modules/@arethetypeswrong/cli/dist/index.js --pack packages/reporting-storage",
678
+ "check:packed-artifact": "node scripts/check-packed-artifact.mjs && node scripts/check-reporting-consumer-package.mjs && node scripts/check-reporting-storage-package.mjs",
732
679
  "check:runtime-compat": "node scripts/check-runtime-compat.mjs",
733
- "check:package-size": "node scripts/check-package-size.mjs",
680
+ "check:package-size": "node scripts/check-package-size.mjs && node packages/reporting-storage/scripts/check-package.mjs --size",
734
681
  "check:publish-protocol-artifacts": "node scripts/check-publish-protocol-artifacts.mjs",
735
682
  "verify:package": "node scripts/verify-package.mjs",
736
- "validate:reporting-gcp": "node scripts/validate-reporting-gcp.mjs",
683
+ "validate:reporting-gcp": "node packages/reporting-storage/scripts/validate-reporting-gcp.mjs",
737
684
  "check:adopter-types": "tsx scripts/check-adopter-types.ts",
738
685
  "check:adopter-types-narrow": "tsx scripts/check-adopter-types-narrow.ts",
739
686
  "sync-version": "tsx scripts/sync-version.ts",
740
687
  "validate-schemas": "tsx scripts/validate-schemas.ts",
741
688
  "lint": "eslint 'src/lib/testing/**/*.ts'",
742
689
  "lint:fix": "eslint 'src/lib/testing/**/*.ts' --fix",
690
+ "lint:boundaries": "eslint --config eslint.boundaries.config.mjs 'src/**/*.{ts,tsx,js,mjs,cjs}' 'bin/**/*.js' 'examples/**/*.{ts,js,mjs}'",
743
691
  "lint:workflows": "node scripts/lint-workflows.js",
744
692
  "typecheck": "node --max-old-space-size=8192 ./node_modules/typescript/bin/tsc --noEmit",
693
+ "typecheck:reporting-storage": "npm run typecheck --workspace=@adcp/reporting-storage",
745
694
  "typecheck:examples": "tsc --noEmit --project tsconfig.examples.json",
746
695
  "clean": "rm -rf dist/",
747
696
  "docs": "typedoc",
@@ -749,7 +698,7 @@
749
698
  "docs:serve": "npx http-server docs -p 4000 -o",
750
699
  "docs:open": "open docs/api/index.html || xdg-open docs/api/index.html || start docs/api/index.html",
751
700
  "ci:validate": "node scripts/ci-validate.js",
752
- "ci:quick": "npm run format:check && npm run typecheck && npm run build:lib && npm test",
701
+ "ci:quick": "npm run format:check && npm run typecheck && npm run build:lib && npm run typecheck:reporting-storage && npm test",
753
702
  "test:zod-openapi-portability": "node --test test/lib/zod-openapi-portability.test.js",
754
703
  "test:schemas-browser": "node --test-timeout=60000 --test test/lib/schemas-browser.test.js",
755
704
  "ci:schema-check": "npm run sync-schemas && npm run generate-types && npm run generate-registry-types -- --sync && git diff --exit-code -I '// Generated at:' src/lib/types/ src/lib/agents/ src/lib/media-buy/action-metadata.generated.ts src/lib/media-buy/update-fields.generated.ts src/lib/registry/types.generated.ts schemas/registry/registry.yaml || (echo '⚠️ Generated files are out of sync. Run: npm run sync-schemas && npm run generate-types && npm run generate-registry-types -- --sync' && exit 1)",
@@ -766,7 +715,8 @@
766
715
  "registry:mcp": "tsx src/registry/mcp-server.ts",
767
716
  "format": "prettier --write \"./**/*.{css,html,js,ts,tsx,json}\"",
768
717
  "format:check": "prettier --check \"./**/*.{css,html,js,ts,tsx,json}\"",
769
- "review:codex": "bash scripts/codex-review.sh"
718
+ "review:codex": "bash scripts/codex-review.sh",
719
+ "test:reporting-storage": "npm test --workspace=@adcp/reporting-storage"
770
720
  },
771
721
  "keywords": [
772
722
  "adcp",
@@ -802,6 +752,7 @@
802
752
  "ajv": "^8.20.0",
803
753
  "ajv-formats": "^3.0.1",
804
754
  "fast-check": "^4.9.0",
755
+ "http-message-sig": "0.3.0",
805
756
  "jose": "^6.2.10",
806
757
  "pg": "^8.23.0",
807
758
  "secure-json-parse": "^4.1.0",
@@ -814,24 +765,12 @@
814
765
  },
815
766
  "peerDependencies": {
816
767
  "@a2a-js/sdk": "^1.0.1",
817
- "@aws-sdk/client-s3": "^3.700.0",
818
- "@azure/storage-blob": "^12.23.0",
819
- "@google-cloud/storage": "^7.22.0 || ^8.2.0",
820
768
  "@modelcontextprotocol/sdk": "^1.31.0",
821
769
  "@opentelemetry/api": "^1.0.0",
822
770
  "redis": "^4.6.0 || ^5.0.0 || ^6.0.0",
823
771
  "zod": "^4.1.5"
824
772
  },
825
773
  "peerDependenciesMeta": {
826
- "@aws-sdk/client-s3": {
827
- "optional": true
828
- },
829
- "@azure/storage-blob": {
830
- "optional": true
831
- },
832
- "@google-cloud/storage": {
833
- "optional": true
834
- },
835
774
  "@opentelemetry/api": {
836
775
  "optional": true
837
776
  },
@@ -843,12 +782,9 @@
843
782
  "@a2a-js/sdk": "^1.0.1",
844
783
  "@apidevtools/json-schema-ref-parser": "^15.5.2",
845
784
  "@arethetypeswrong/cli": "^0.18.5",
846
- "@aws-sdk/client-s3": "^3.1147.0",
847
- "@azure/storage-blob": "~12.32.0",
848
785
  "@changesets/cli": "^3.0.3",
849
786
  "@commitlint/cli": "^20.5.3",
850
787
  "@commitlint/config-conventional": "^20.5.3",
851
- "@google-cloud/storage": "^7.22.0",
852
788
  "@modelcontextprotocol/sdk": "^1.31.0",
853
789
  "@opentelemetry/api": "^1.9.1",
854
790
  "@types/express": "4.17.25",
@@ -859,7 +795,6 @@
859
795
  "esbuild": "^0.28.2",
860
796
  "esbuild-fix-imports-plugin": "^1.0.23",
861
797
  "eslint": "^10.9.1",
862
- "http-message-sig": "0.3.0",
863
798
  "json-schema-to-typescript": "^15.0.4",
864
799
  "json-schema-to-zod": "^2.8.1",
865
800
  "openapi-typescript": "^7.13.0",
@@ -1,31 +0,0 @@
1
- import type { BlobServiceClient } from '@azure/storage-blob';
2
- import type { ReportingRowObjectProviderV1 } from '../ledger/row-storage-object.mjs';
3
- /**
4
- * @experimental Reliable Reporting storage surface: breaking changes may ship in minor releases. See https://github.com/adcontextprotocol/adcp-client/blob/main/docs/guides/REPORTING-STABILITY.md
5
- */
6
- export interface CreateAzureBlobReportingRowObjectProviderOptionsV1 {
7
- /** Official client used by bindings without a `credentialRef`. */
8
- client?: BlobServiceClient;
9
- /**
10
- * Official clients keyed by `credentialRef`. This map is the closed set of
11
- * references a binding may name; an unknown reference fails `UNSAFE_BINDING`.
12
- * Endpoint and credentials come only from these clients.
13
- */
14
- clients?: Readonly<Record<string, BlobServiceClient>>;
15
- }
16
- /**
17
- * Azure Blob Storage row-object provider (`@adcp/sdk/reporting/azure`).
18
- *
19
- * Inject official `BlobServiceClient`s with host-owned credentials (managed
20
- * identity, workload identity). Bindings use `location: { account, container }`;
21
- * the selected client must belong to `account`. Writes are block-blob uploads
22
- * with `If-None-Match: *`. Blob versioning must be enabled on the storage account:
23
- * the recorded native version is the write-unique `versionId` and pins every read
24
- * and delete, so a delayed delete can never remove a later write that re-created
25
- * identical bytes at the same key (ETags are content-derived and cannot fence that).
26
- * The probe refuses accounts without versioning and proves create-only behaviour
27
- * empirically.
28
- *
29
- * @experimental Reliable Reporting storage surface: breaking changes may ship in minor releases. See https://github.com/adcontextprotocol/adcp-client/blob/main/docs/guides/REPORTING-STABILITY.md
30
- */
31
- export declare function createAzureBlobReportingRowObjectProviderV1(options: CreateAzureBlobReportingRowObjectProviderOptionsV1): ReportingRowObjectProviderV1;
@@ -1,31 +0,0 @@
1
- import type { BlobServiceClient } from '@azure/storage-blob';
2
- import type { ReportingRowObjectProviderV1 } from '../ledger/row-storage-object';
3
- /**
4
- * @experimental Reliable Reporting storage surface: breaking changes may ship in minor releases. See https://github.com/adcontextprotocol/adcp-client/blob/main/docs/guides/REPORTING-STABILITY.md
5
- */
6
- export interface CreateAzureBlobReportingRowObjectProviderOptionsV1 {
7
- /** Official client used by bindings without a `credentialRef`. */
8
- client?: BlobServiceClient;
9
- /**
10
- * Official clients keyed by `credentialRef`. This map is the closed set of
11
- * references a binding may name; an unknown reference fails `UNSAFE_BINDING`.
12
- * Endpoint and credentials come only from these clients.
13
- */
14
- clients?: Readonly<Record<string, BlobServiceClient>>;
15
- }
16
- /**
17
- * Azure Blob Storage row-object provider (`@adcp/sdk/reporting/azure`).
18
- *
19
- * Inject official `BlobServiceClient`s with host-owned credentials (managed
20
- * identity, workload identity). Bindings use `location: { account, container }`;
21
- * the selected client must belong to `account`. Writes are block-blob uploads
22
- * with `If-None-Match: *`. Blob versioning must be enabled on the storage account:
23
- * the recorded native version is the write-unique `versionId` and pins every read
24
- * and delete, so a delayed delete can never remove a later write that re-created
25
- * identical bytes at the same key (ETags are content-derived and cannot fence that).
26
- * The probe refuses accounts without versioning and proves create-only behaviour
27
- * empirically.
28
- *
29
- * @experimental Reliable Reporting storage surface: breaking changes may ship in minor releases. See https://github.com/adcontextprotocol/adcp-client/blob/main/docs/guides/REPORTING-STABILITY.md
30
- */
31
- export declare function createAzureBlobReportingRowObjectProviderV1(options: CreateAzureBlobReportingRowObjectProviderOptionsV1): ReportingRowObjectProviderV1;
@@ -1,266 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var azure_exports = {};
20
- __export(azure_exports, {
21
- createAzureBlobReportingRowObjectProviderV1: () => createAzureBlobReportingRowObjectProviderV1
22
- });
23
- module.exports = __toCommonJS(azure_exports);
24
- var import_node_crypto = require("node:crypto");
25
- var import_row_storage_errors = require('../ledger/row-storage-errors.js');
26
- var import_row_storage_provider_io = require('../ledger/row-storage-provider-io.js');
27
- const ACCOUNT = /^[a-z0-9]{3,24}$/;
28
- const CONTAINER = /^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){2,62}$/;
29
- const VERSION_ID = /^[0-9A-Za-z:.+-]{1,64}$/;
30
- function statusOf(error) {
31
- const status = Number(error?.statusCode);
32
- return Number.isInteger(status) ? status : void 0;
33
- }
34
- function codeOf(error) {
35
- const value = error?.code ?? error?.details?.errorCode;
36
- return typeof value === "string" ? value : "";
37
- }
38
- const isConflict = (error) => statusOf(error) === 409 || statusOf(error) === 412 || codeOf(error) === "BlobAlreadyExists";
39
- const isMissing = (error) => statusOf(error) === 404 || statusOf(error) === 412;
40
- const isForbidden = (error) => statusOf(error) === 401 || statusOf(error) === 403;
41
- function versionOf(response) {
42
- const id = response.versionId;
43
- if (typeof id !== "string" || !VERSION_ID.test(id)) {
44
- throw new import_row_storage_errors.ReportingRowStoreError(
45
- "UNSAFE_BINDING",
46
- "store returned no blob versionId; blob versioning must be enabled on the storage account so deletes are fenced to one write"
47
- );
48
- }
49
- return id;
50
- }
51
- function servedVersion(response, versionId) {
52
- return response.versionId === versionId;
53
- }
54
- function metadataOf(metadata) {
55
- const result = {};
56
- for (const [name, value] of Object.entries(metadata)) {
57
- const identifier = name.replace(/[^A-Za-z0-9_]/g, "_");
58
- result[/^[A-Za-z_]/.test(identifier) ? identifier : `_${identifier}`] = value;
59
- }
60
- return result;
61
- }
62
- function createAzureBlobReportingRowObjectProviderV1(options) {
63
- if (!options || typeof options !== "object") {
64
- throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", "Azure Blob row provider options are required");
65
- }
66
- const clients = (0, import_row_storage_provider_io.reportingRowClientMap)(options.clients);
67
- const isClient = (value) => !!value && typeof value === "object" && typeof value.getContainerClient === "function" && typeof value.accountName === "string";
68
- if (options.client !== void 0 && !isClient(options.client) || [...clients.values()].some((client) => !isClient(client)) || options.client === void 0 && clients.size === 0) {
69
- throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", "inject an official BlobServiceClient as client or clients");
70
- }
71
- const validateLocation = (location) => {
72
- (0, import_row_storage_provider_io.assertReportingRowLocationKeys)(location, ["account", "container"]);
73
- if (!ACCOUNT.test(location.account)) {
74
- throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", "Azure storage account name is invalid");
75
- }
76
- if (!CONTAINER.test(location.container)) {
77
- throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", "Azure container name is invalid");
78
- }
79
- };
80
- const containerFor = (input) => {
81
- validateLocation(input.location);
82
- const client = (0, import_row_storage_provider_io.selectReportingRowClient)(options.client, clients, input.credentialRef);
83
- if (client.accountName !== input.location.account) {
84
- throw new import_row_storage_errors.ReportingRowStoreError("UNSAFE_BINDING", "client does not belong to the binding account");
85
- }
86
- return client.getContainerClient(input.location.container);
87
- };
88
- const blobFor = (input) => {
89
- if (typeof input.objectRef !== "string" || input.objectRef.length === 0 || input.objectRef.length > 1024) {
90
- throw new import_row_storage_errors.ReportingRowStoreError("INVALID_INPUT", "object key is invalid");
91
- }
92
- return containerFor(input).getBlockBlobClient(input.objectRef);
93
- };
94
- const pinned = (blob, nativeVersionRef) => typeof nativeVersionRef === "string" && VERSION_ID.test(nativeVersionRef) ? { blob: blob.withVersion(nativeVersionRef), versionId: nativeVersionRef } : null;
95
- async function assertCreateOnlyEnforced(container, prefix, signal) {
96
- const blob = container.getBlockBlobClient(`${prefix}/.adcp-probe/${(0, import_node_crypto.randomUUID)()}`);
97
- const versionIds = [];
98
- let written = false;
99
- const upload = async (body) => {
100
- const bytes = Buffer.from(body);
101
- const response = await blob.upload(bytes, bytes.byteLength, {
102
- conditions: { ifNoneMatch: "*" },
103
- blobHTTPHeaders: { blobContentType: "application/x-ndjson", blobCacheControl: "no-store" },
104
- abortSignal: signal
105
- });
106
- written = true;
107
- if (response.versionId) versionIds.push(response.versionId);
108
- versionOf(response);
109
- };
110
- try {
111
- await upload('{"probe":1}\n');
112
- try {
113
- await upload('{"probe":2}\n');
114
- } catch (error) {
115
- if (isConflict(error)) return;
116
- throw error;
117
- }
118
- throw new import_row_storage_errors.ReportingRowStoreError("UNSAFE_BINDING", "store ignores If-None-Match and replaces blobs");
119
- } finally {
120
- if (written && !signal.aborted) {
121
- await blob.delete({ abortSignal: signal }).catch(() => void 0);
122
- for (const versionId of versionIds) {
123
- if (signal.aborted) break;
124
- await blob.withVersion(versionId).delete({ abortSignal: signal }).catch(() => void 0);
125
- }
126
- }
127
- }
128
- }
129
- return {
130
- name: "azure_blob",
131
- rangedReads: true,
132
- validateLocation,
133
- probe(input, context) {
134
- return (0, import_row_storage_provider_io.runReportingRowProviderOperation)(context.signal, async () => {
135
- const container = containerFor(input);
136
- let properties;
137
- try {
138
- properties = await container.getProperties({ abortSignal: context.signal });
139
- } catch (error) {
140
- if (statusOf(error) === 404) throw new import_row_storage_errors.ReportingRowStoreError("UNSAFE_BINDING", "container does not exist");
141
- if (isForbidden(error)) throw new import_row_storage_errors.ReportingRowStoreError("UNSAFE_BINDING", "container is not accessible");
142
- throw error;
143
- }
144
- if (properties.blobPublicAccess) {
145
- throw new import_row_storage_errors.ReportingRowStoreError("UNSAFE_BINDING", "container allows anonymous read access");
146
- }
147
- await assertCreateOnlyEnforced(container, input.prefix, context.signal);
148
- });
149
- },
150
- putIfAbsent(input, context) {
151
- return (0, import_row_storage_provider_io.runReportingRowProviderOperation)(context.signal, async () => {
152
- const blob = blobFor(input);
153
- const bytes = Buffer.from(input.bytes);
154
- try {
155
- const response = await blob.upload(bytes, bytes.byteLength, {
156
- conditions: { ifNoneMatch: "*" },
157
- blobHTTPHeaders: { blobContentType: input.contentType, blobCacheControl: "no-store" },
158
- metadata: metadataOf(input.metadata),
159
- abortSignal: context.signal
160
- });
161
- return { created: true, nativeVersionRef: versionOf(response) };
162
- } catch (error) {
163
- if (!isConflict(error)) throw error;
164
- }
165
- const existing = await blob.getProperties({ abortSignal: context.signal });
166
- return { created: false, nativeVersionRef: versionOf(existing) };
167
- });
168
- },
169
- get(input, context) {
170
- return (0, import_row_storage_provider_io.runReportingRowProviderOperation)(context.signal, async () => {
171
- const blob = blobFor(input);
172
- (0, import_row_storage_provider_io.assertReportingRowReadBounds)(input);
173
- const target = pinned(blob, input.nativeVersionRef);
174
- if (target === null) return null;
175
- try {
176
- if (input.range?.length === 0) {
177
- const properties = await target.blob.getProperties({ abortSignal: context.signal });
178
- if (!servedVersion(properties, target.versionId)) return null;
179
- if (input.range.offset > Number(properties.contentLength ?? 0)) {
180
- throw new import_row_storage_errors.ReportingRowStoreError("ROWS_INTEGRITY_FAILED", "requested range exceeds the stored object");
181
- }
182
- return Buffer.alloc(0);
183
- }
184
- const response = await target.blob.download(input.range?.offset ?? 0, input.range?.length, {
185
- abortSignal: context.signal
186
- });
187
- const body = response.readableStreamBody;
188
- if (!body || typeof body[Symbol.asyncIterator] !== "function") {
189
- throw new import_row_storage_errors.ReportingRowStoreError("PROVIDER_UNAVAILABLE", "blob body is not a stream");
190
- }
191
- if (!servedVersion(response, target.versionId)) {
192
- body.destroy?.();
193
- return null;
194
- }
195
- if (typeof response.contentLength === "number" && response.contentLength > input.maxBytes) {
196
- body.destroy?.();
197
- throw new import_row_storage_errors.ReportingRowStoreError("ROWS_INTEGRITY_FAILED", "stored object exceeds its recorded size");
198
- }
199
- return await (0, import_row_storage_provider_io.readReportingRowStream)(body, input.maxBytes, context.signal);
200
- } catch (error) {
201
- if (isMissing(error)) return null;
202
- if (statusOf(error) === 400) return null;
203
- if (statusOf(error) === 416 || codeOf(error) === "InvalidRange") {
204
- throw new import_row_storage_errors.ReportingRowStoreError("ROWS_INTEGRITY_FAILED", "requested range exceeds the stored object");
205
- }
206
- throw error;
207
- }
208
- });
209
- },
210
- stat(input, context) {
211
- return (0, import_row_storage_provider_io.runReportingRowProviderOperation)(context.signal, async () => {
212
- const blob = blobFor(input);
213
- const target = pinned(blob, input.nativeVersionRef);
214
- if (target === null) return null;
215
- try {
216
- const properties = await target.blob.getProperties({ abortSignal: context.signal });
217
- if (!servedVersion(properties, target.versionId)) return null;
218
- const size = properties.contentLength;
219
- if (typeof size !== "number" || !Number.isSafeInteger(size) || size < 0) {
220
- throw new import_row_storage_errors.ReportingRowStoreError("PROVIDER_UNAVAILABLE", "blob metadata is malformed");
221
- }
222
- return { nativeVersionRef: target.versionId, sizeBytes: size };
223
- } catch (error) {
224
- if (isMissing(error) || statusOf(error) === 400) return null;
225
- throw error;
226
- }
227
- });
228
- },
229
- delete(input, context) {
230
- return (0, import_row_storage_provider_io.runReportingRowProviderOperation)(context.signal, async () => {
231
- const blob = blobFor(input);
232
- const target = pinned(blob, input.nativeVersionRef);
233
- if (target === null) return "absent";
234
- const signal = context.signal;
235
- try {
236
- const recorded = await target.blob.getProperties({ abortSignal: signal });
237
- if (recorded.versionId !== target.versionId) return "absent";
238
- } catch (error) {
239
- if (isMissing(error) || statusOf(error) === 400) return "absent";
240
- throw error;
241
- }
242
- let deletedCurrent = false;
243
- try {
244
- const current = await blob.getProperties({ abortSignal: signal });
245
- if (current.versionId === target.versionId && current.etag) {
246
- await blob.delete({ conditions: { ifMatch: current.etag }, abortSignal: signal });
247
- deletedCurrent = true;
248
- }
249
- } catch (error) {
250
- if (!isMissing(error)) throw error;
251
- }
252
- try {
253
- await target.blob.delete({ abortSignal: signal });
254
- return "deleted";
255
- } catch (error) {
256
- if (isMissing(error) || statusOf(error) === 400) return deletedCurrent ? "deleted" : "absent";
257
- throw error;
258
- }
259
- });
260
- }
261
- };
262
- }
263
- // Annotate the CommonJS export names for ESM import in node:
264
- 0 && (module.exports = {
265
- createAzureBlobReportingRowObjectProviderV1
266
- });