@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.
- package/dist/lib/auth/oauth/diagnose.js +3 -11
- package/dist/lib/auth/oauth/diagnose.mjs +4 -12
- package/dist/lib/auth/oauth/diagnostics.d.mts +2 -1
- package/dist/lib/auth/oauth/diagnostics.d.ts +2 -1
- package/dist/lib/auth/oauth/diagnostics.js +8 -10
- package/dist/lib/auth/oauth/diagnostics.mjs +7 -10
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.mjs +7 -1
- package/dist/lib/reporting/consumer-runtime.js +2 -1
- package/dist/lib/reporting/consumer-runtime.mjs +2 -1
- package/dist/lib/reporting/ledger/handler.js +50 -11
- package/dist/lib/reporting/ledger/handler.mjs +50 -12
- package/dist/lib/reporting/ledger/index.d.mts +17 -14
- package/dist/lib/reporting/ledger/index.d.ts +17 -14
- package/dist/lib/reporting/ledger/index.js +32 -20
- package/dist/lib/reporting/ledger/index.mjs +21 -10
- package/dist/lib/reporting/ledger/offering-validation.d.mts +9 -0
- package/dist/lib/reporting/ledger/offering-validation.d.ts +9 -0
- package/dist/lib/reporting/{gcs/bucket-policy.js → ledger/offering-validation.js} +9 -8
- package/dist/lib/reporting/ledger/offering-validation.mjs +8 -0
- package/dist/lib/reporting/ledger/receipts.d.mts +48 -0
- package/dist/lib/reporting/ledger/receipts.d.ts +48 -0
- package/dist/lib/reporting/ledger/receipts.js +186 -0
- package/dist/lib/reporting/ledger/receipts.mjs +161 -0
- package/dist/lib/reporting/ledger/status-ingest.js +3 -3
- package/dist/lib/reporting/ledger/status-ingest.mjs +4 -5
- package/dist/lib/reporting/ledger/types.d.mts +43 -0
- package/dist/lib/reporting/ledger/types.d.ts +43 -0
- package/dist/lib/reporting/ledger/types.js +31 -2
- package/dist/lib/reporting/ledger/types.mjs +26 -1
- package/dist/lib/reporting/pagination.d.mts +6 -0
- package/dist/lib/reporting/pagination.d.ts +6 -0
- package/dist/lib/reporting/{gcs/errors.js → pagination.js} +12 -17
- package/dist/lib/reporting/pagination.mjs +12 -0
- package/dist/lib/reporting/reconciliation.d.mts +1 -0
- package/dist/lib/reporting/reconciliation.d.ts +1 -0
- package/dist/lib/reporting/reconciliation.js +3 -2
- package/dist/lib/reporting/reconciliation.mjs +3 -2
- package/dist/lib/reporting/service/index.d.mts +79 -153
- package/dist/lib/reporting/service/index.d.ts +79 -153
- package/dist/lib/reporting/service/index.js +34 -491
- package/dist/lib/reporting/service/index.mjs +36 -510
- package/dist/lib/reporting/service/scheduler-support.d.mts +43 -0
- package/dist/lib/reporting/service/scheduler-support.d.ts +43 -0
- package/dist/lib/reporting/service/scheduler-support.js +125 -0
- package/dist/lib/reporting/service/scheduler-support.mjs +96 -0
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/signing/canonicalize.d.mts +4 -0
- package/dist/lib/signing/canonicalize.d.ts +4 -0
- package/dist/lib/signing/canonicalize.js +14 -8
- package/dist/lib/signing/canonicalize.mjs +14 -8
- package/dist/lib/signing/content-digest.d.mts +8 -0
- package/dist/lib/signing/content-digest.d.ts +8 -0
- package/dist/lib/signing/content-digest.js +11 -5
- package/dist/lib/signing/content-digest.mjs +10 -5
- package/dist/lib/signing/signer.js +9 -6
- package/dist/lib/signing/signer.mjs +10 -7
- package/dist/lib/signing/web-bot-auth.js +103 -37
- package/dist/lib/signing/web-bot-auth.mjs +108 -37
- package/dist/lib/testing/storyboard/junit.js +16 -3
- package/dist/lib/testing/storyboard/junit.mjs +16 -3
- package/dist/lib/testing/storyboard/request-signing/builder.js +10 -9
- package/dist/lib/testing/storyboard/request-signing/builder.mjs +10 -9
- package/dist/lib/testing/storyboard/runner.js +94 -25
- package/dist/lib/testing/storyboard/runner.mjs +94 -25
- package/dist/lib/testing/storyboard/types.d.mts +6 -0
- package/dist/lib/testing/storyboard/types.d.ts +6 -0
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +23 -5
- package/docs/guides/REPORTING-GCS-FENCE.md +3 -3
- package/docs/guides/REPORTING-GCS-MANAGED.md +4 -4
- package/docs/guides/REPORTING-LEDGER-CUTOVER.md +7 -7
- package/docs/guides/REPORTING-LEDGER.md +107 -51
- package/docs/guides/REPORTING-OPERATIONS.md +66 -5
- package/docs/guides/REPORTING-STABILITY.md +36 -32
- package/docs/llms.txt +4 -3
- package/docs/migration-14.x-rc-worksheet.md +4 -7
- package/docs/migration-reporting-storage-package.md +186 -0
- package/examples/README.md +1 -1
- package/package.json +13 -78
- package/dist/lib/reporting/azure/index.d.mts +0 -31
- package/dist/lib/reporting/azure/index.d.ts +0 -31
- package/dist/lib/reporting/azure/index.js +0 -266
- package/dist/lib/reporting/azure/index.mjs +0 -249
- package/dist/lib/reporting/bigquery/index.d.mts +0 -246
- package/dist/lib/reporting/bigquery/index.d.ts +0 -246
- package/dist/lib/reporting/bigquery/index.js +0 -633
- package/dist/lib/reporting/bigquery/index.mjs +0 -594
- package/dist/lib/reporting/gcs/adapter.d.mts +0 -38
- package/dist/lib/reporting/gcs/adapter.d.ts +0 -38
- package/dist/lib/reporting/gcs/adapter.js +0 -342
- package/dist/lib/reporting/gcs/adapter.mjs +0 -325
- package/dist/lib/reporting/gcs/bucket-policy.d.mts +0 -3
- package/dist/lib/reporting/gcs/bucket-policy.d.ts +0 -3
- package/dist/lib/reporting/gcs/bucket-policy.mjs +0 -7
- package/dist/lib/reporting/gcs/errors.d.mts +0 -11
- package/dist/lib/reporting/gcs/errors.d.ts +0 -11
- package/dist/lib/reporting/gcs/errors.mjs +0 -16
- package/dist/lib/reporting/gcs/fence.d.mts +0 -41
- package/dist/lib/reporting/gcs/fence.d.ts +0 -41
- package/dist/lib/reporting/gcs/fence.js +0 -250
- package/dist/lib/reporting/gcs/fence.mjs +0 -230
- package/dist/lib/reporting/gcs/index.d.mts +0 -18
- package/dist/lib/reporting/gcs/index.d.ts +0 -18
- package/dist/lib/reporting/gcs/index.js +0 -44
- package/dist/lib/reporting/gcs/index.mjs +0 -14
- package/dist/lib/reporting/gcs/io.d.mts +0 -7
- package/dist/lib/reporting/gcs/io.d.ts +0 -7
- package/dist/lib/reporting/gcs/io.js +0 -95
- package/dist/lib/reporting/gcs/io.mjs +0 -69
- package/dist/lib/reporting/gcs/reader.d.mts +0 -67
- package/dist/lib/reporting/gcs/reader.d.ts +0 -67
- package/dist/lib/reporting/gcs/reader.js +0 -193
- package/dist/lib/reporting/gcs/reader.mjs +0 -169
- package/dist/lib/reporting/gcs/row-provider.d.mts +0 -39
- package/dist/lib/reporting/gcs/row-provider.d.ts +0 -39
- package/dist/lib/reporting/gcs/row-provider.js +0 -225
- package/dist/lib/reporting/gcs/row-provider.mjs +0 -208
- package/dist/lib/reporting/gcs/validation.d.mts +0 -5
- package/dist/lib/reporting/gcs/validation.d.ts +0 -5
- package/dist/lib/reporting/gcs/validation.js +0 -49
- package/dist/lib/reporting/gcs/validation.mjs +0 -25
- package/dist/lib/reporting/ledger/change-feed.d.mts +0 -69
- package/dist/lib/reporting/ledger/change-feed.d.ts +0 -69
- package/dist/lib/reporting/ledger/change-feed.js +0 -107
- package/dist/lib/reporting/ledger/change-feed.mjs +0 -80
- package/dist/lib/reporting/ledger/managed-postgres.d.mts +0 -293
- package/dist/lib/reporting/ledger/managed-postgres.d.ts +0 -293
- package/dist/lib/reporting/ledger/managed-postgres.js +0 -2346
- package/dist/lib/reporting/ledger/managed-postgres.mjs +0 -2332
- package/dist/lib/reporting/ledger/managed-router.d.mts +0 -148
- package/dist/lib/reporting/ledger/managed-router.d.ts +0 -148
- package/dist/lib/reporting/ledger/managed-router.js +0 -280
- package/dist/lib/reporting/ledger/managed-router.mjs +0 -258
- package/dist/lib/reporting/ledger/managed.d.mts +0 -535
- package/dist/lib/reporting/ledger/managed.d.ts +0 -535
- package/dist/lib/reporting/ledger/managed.js +0 -761
- package/dist/lib/reporting/ledger/managed.mjs +0 -729
- package/dist/lib/reporting/ledger/notification-activity.d.mts +0 -332
- package/dist/lib/reporting/ledger/notification-activity.d.ts +0 -332
- package/dist/lib/reporting/ledger/notification-activity.js +0 -1366
- package/dist/lib/reporting/ledger/notification-activity.mjs +0 -1337
- package/dist/lib/reporting/ledger/object-writes.d.mts +0 -128
- package/dist/lib/reporting/ledger/object-writes.d.ts +0 -128
- package/dist/lib/reporting/ledger/object-writes.js +0 -147
- package/dist/lib/reporting/ledger/object-writes.mjs +0 -114
- package/dist/lib/reporting/ledger/postgres.d.mts +0 -689
- package/dist/lib/reporting/ledger/postgres.d.ts +0 -689
- package/dist/lib/reporting/ledger/postgres.js +0 -4462
- package/dist/lib/reporting/ledger/postgres.mjs +0 -4462
- package/dist/lib/reporting/ledger/row-storage-migration.d.mts +0 -59
- package/dist/lib/reporting/ledger/row-storage-migration.d.ts +0 -59
- package/dist/lib/reporting/ledger/row-storage-migration.js +0 -365
- package/dist/lib/reporting/ledger/row-storage-migration.mjs +0 -339
- package/dist/lib/reporting/ledger/row-storage-object.d.mts +0 -203
- package/dist/lib/reporting/ledger/row-storage-object.d.ts +0 -203
- package/dist/lib/reporting/ledger/row-storage-object.js +0 -379
- package/dist/lib/reporting/ledger/row-storage-object.mjs +0 -335
- package/dist/lib/reporting/ledger/row-storage-provider-io.d.mts +0 -44
- package/dist/lib/reporting/ledger/row-storage-provider-io.d.ts +0 -44
- package/dist/lib/reporting/ledger/row-storage-provider-io.js +0 -142
- package/dist/lib/reporting/ledger/row-storage-provider-io.mjs +0 -111
- package/dist/lib/reporting/ledger/row-storage.d.mts +0 -316
- package/dist/lib/reporting/ledger/row-storage.d.ts +0 -316
- package/dist/lib/reporting/ledger/row-storage.js +0 -812
- package/dist/lib/reporting/ledger/row-storage.mjs +0 -802
- package/dist/lib/reporting/s3/index.d.mts +0 -34
- package/dist/lib/reporting/s3/index.d.ts +0 -34
- package/dist/lib/reporting/s3/index.js +0 -347
- package/dist/lib/reporting/s3/index.mjs +0 -340
- package/dist/lib/reporting/service/maintenance.d.mts +0 -148
- package/dist/lib/reporting/service/maintenance.d.ts +0 -148
- package/dist/lib/reporting/service/maintenance.js +0 -185
- package/dist/lib/reporting/service/maintenance.mjs +0 -159
- package/examples/reliable-reporting-service/README.md +0 -169
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import { type ReportingEncodedRowsV1, type ReportingRowChunkManifestV1 } from './row-encoding.mjs';
|
|
2
|
-
import { type ReportingRowObjectProviderV1 } from './row-storage-object.mjs';
|
|
3
|
-
/**
|
|
4
|
-
* Revision row storage (shared SDK persistence spec,
|
|
5
|
-
* adcontextprotocol/adcp#7996 §3). Revision headers stay in the ledger
|
|
6
|
-
* document; rows live as canonical JSONL chunks in a storage binding, and
|
|
7
|
-
* every read is verified against digests committed in PostgreSQL before rows
|
|
8
|
-
* are released.
|
|
9
|
-
*/
|
|
10
|
-
export { ReportingRowStoreError, isReportingRowStoreError } from './row-storage-errors.mjs';
|
|
11
|
-
export type { ReportingRowStoreErrorCode } from './row-storage-errors.mjs';
|
|
12
|
-
/**
|
|
13
|
-
* Rows stored as chunk bodies in the ledger's own PostgreSQL schema.
|
|
14
|
-
*
|
|
15
|
-
* @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
|
|
16
|
-
*/
|
|
17
|
-
export interface ReportingPostgresRowBindingV1 {
|
|
18
|
-
kind: 'postgres';
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Rows stored as one object per chunk through a registered provider. The
|
|
22
|
-
* definition lives in host code, which makes it the allowlist: a row set
|
|
23
|
-
* whose recorded binding identity differs from the configured definition is
|
|
24
|
-
* never read from or written to.
|
|
25
|
-
*
|
|
26
|
-
* @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
|
|
27
|
-
*/
|
|
28
|
-
export interface ReportingObjectRowBindingV1 {
|
|
29
|
-
kind: 'object';
|
|
30
|
-
/** Name of a provider registered in `ReportingRowStorageOptionsV1.providers`. */
|
|
31
|
-
provider: string;
|
|
32
|
-
/** Non-secret provider coordinates, validated by the provider's closed schema. */
|
|
33
|
-
location: Readonly<Record<string, string>>;
|
|
34
|
-
/** Owned key prefix. Sweeps and deletes never touch keys outside it. */
|
|
35
|
-
prefix: string;
|
|
36
|
-
/**
|
|
37
|
-
* Object key template; see `REPORTING_ROW_DEFAULT_KEY_TEMPLATE`. It must include `{revision_key}`, so every
|
|
38
|
-
* row set writes its own object keys (a read-only binding is exempt).
|
|
39
|
-
*/
|
|
40
|
-
keyTemplate?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Keep this binding configured only to read (and retire) row sets already written through it, for
|
|
43
|
-
* example under an older template without `{revision_key}`. A read-only binding is never selected for
|
|
44
|
-
* new writes and is exempt from the `{revision_key}` requirement; reads use each chunk's recorded
|
|
45
|
-
* `object_ref`, never a re-rendered key. Not part of the binding's identity.
|
|
46
|
-
*/
|
|
47
|
-
readOnly?: boolean;
|
|
48
|
-
/** Stored encoding; digests always cover uncompressed bytes. Default `gzip`. */
|
|
49
|
-
compression?: 'none' | 'gzip';
|
|
50
|
-
/** Host-mapped client reference passed to the provider; never a secret. */
|
|
51
|
-
credentialRef?: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @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
|
|
55
|
-
*/
|
|
56
|
-
export type ReportingRowBindingDefinitionV1 = ReportingPostgresRowBindingV1 | ReportingObjectRowBindingV1;
|
|
57
|
-
/**
|
|
58
|
-
* @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
|
|
59
|
-
*/
|
|
60
|
-
export interface ReportingRowBindingSelectionInputV1 {
|
|
61
|
-
account_id: string;
|
|
62
|
-
reporting_obligation_id: string;
|
|
63
|
-
row_set_kind: 'revision' | 'adjustment';
|
|
64
|
-
finality?: 'snapshot' | 'official';
|
|
65
|
-
row_count: number;
|
|
66
|
-
content_size_bytes: number;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* @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
|
|
70
|
-
*/
|
|
71
|
-
export interface ReportingRowStorageOptionsV1 {
|
|
72
|
-
/**
|
|
73
|
-
* Logical binding ID → immutable definition. Defaults to a single
|
|
74
|
-
* `postgres` binding. Changing a definition requires a new ID; keep retired
|
|
75
|
-
* definitions configured while revisions still reference them.
|
|
76
|
-
*/
|
|
77
|
-
bindings?: Readonly<Record<string, ReportingRowBindingDefinitionV1>>;
|
|
78
|
-
/** Object-storage providers by name. */
|
|
79
|
-
providers?: Readonly<Record<string, ReportingRowObjectProviderV1>>;
|
|
80
|
-
/** Picks the binding for each new row set. Defaults to the only binding, or `postgres`. */
|
|
81
|
-
selectRowBinding?(input: ReportingRowBindingSelectionInputV1): string | Promise<string>;
|
|
82
|
-
/**
|
|
83
|
-
* Stable deployment namespace, combined with the schema's installation
|
|
84
|
-
* identity into each binding's `namespace_key`. Defaults to `default`.
|
|
85
|
-
*/
|
|
86
|
-
deploymentNamespace?: string;
|
|
87
|
-
/** Deadline for one row set's uploads. Default 60 seconds. */
|
|
88
|
-
writeDeadlineMilliseconds?: number;
|
|
89
|
-
/** Deadline for one object read. Default 30 seconds. */
|
|
90
|
-
readDeadlineMilliseconds?: number;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* @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
|
|
94
|
-
*/
|
|
95
|
-
export interface ReportingRowSetPrepareInputV1 {
|
|
96
|
-
rowSetId: string;
|
|
97
|
-
rowSetKind: 'revision' | 'adjustment';
|
|
98
|
-
accountId: string;
|
|
99
|
-
obligationId: string;
|
|
100
|
-
rows: readonly Record<string, unknown>[];
|
|
101
|
-
finality?: 'snapshot' | 'official';
|
|
102
|
-
/** Reporting period start, used with `sourceTimezone` for `{period_date}` in object keys. */
|
|
103
|
-
periodStart?: string;
|
|
104
|
-
/** The period's `source_timezone` (required with `periodStart`): `{period_date}` is the local calendar date. */
|
|
105
|
-
sourceTimezone?: string;
|
|
106
|
-
/** Committed protocol binding the chunks must reproduce. */
|
|
107
|
-
binding: {
|
|
108
|
-
sha256: string;
|
|
109
|
-
byteCount: number;
|
|
110
|
-
rowCount: number;
|
|
111
|
-
};
|
|
112
|
-
/** Required for revisions (`revision_envelope_v1`); omitted for adjustments (`rows_v1`). */
|
|
113
|
-
controlTotals?: readonly unknown[];
|
|
114
|
-
/** Overrides `selectRowBinding` (for example, to migrate inline rows into a PostgreSQL binding). */
|
|
115
|
-
bindingId?: string;
|
|
116
|
-
}
|
|
117
|
-
interface PreparedObjectV1 {
|
|
118
|
-
readonly objectRef: string;
|
|
119
|
-
readonly physicalBytes: Buffer;
|
|
120
|
-
readonly physicalSha256: string;
|
|
121
|
-
readonly compression: 'none' | 'gzip';
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* @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
|
|
125
|
-
*/
|
|
126
|
-
export interface ReportingPreparedRowSetV1 {
|
|
127
|
-
readonly input: ReportingRowSetPrepareInputV1;
|
|
128
|
-
readonly encoded: ReportingEncodedRowsV1;
|
|
129
|
-
readonly bindingId: string;
|
|
130
|
-
readonly binding: ReportingRowBindingDefinitionV1;
|
|
131
|
-
readonly digestProfile: 'revision_envelope_v1' | 'rows_v1';
|
|
132
|
-
/** Object kind only: one planned object per chunk. */
|
|
133
|
-
readonly objects?: readonly PreparedObjectV1[];
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Where one chunk was stored; recorded in the chunk manifest.
|
|
137
|
-
*
|
|
138
|
-
* @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
|
|
139
|
-
*/
|
|
140
|
-
export interface ReportingRowChunkLocatorV1 {
|
|
141
|
-
/** AdCP `object_ref`: decoded, destination-relative, 1 to 1024 characters. */
|
|
142
|
-
objectRef: string;
|
|
143
|
-
/** AdCP `native_version_ref`: decoded provider-native immutable version, 1 to 1024 characters. */
|
|
144
|
-
nativeVersionRef: string;
|
|
145
|
-
compression: 'none' | 'gzip';
|
|
146
|
-
/** SHA-256 of the stored (possibly compressed) object bytes. */
|
|
147
|
-
physicalSha256: string;
|
|
148
|
-
/** AdCP `size_bytes`: the stored object's size, after any compression. */
|
|
149
|
-
sizeBytes: number;
|
|
150
|
-
/** Whether this upload created the object (as opposed to adopting identical bytes). */
|
|
151
|
-
created: boolean;
|
|
152
|
-
}
|
|
153
|
-
interface QueryableV1 {
|
|
154
|
-
query<Row extends Record<string, unknown> = Record<string, unknown>>(text: string, values?: unknown[]): Promise<{
|
|
155
|
-
rows: Row[];
|
|
156
|
-
rowCount?: number | null;
|
|
157
|
-
}>;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* A row set whose chunk manifest has been verified against its committed digest.
|
|
161
|
-
*
|
|
162
|
-
* @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
|
|
163
|
-
*/
|
|
164
|
-
export interface ReportingRowSetHandleV1 {
|
|
165
|
-
readonly rowSetId: string;
|
|
166
|
-
readonly rowSetKind: 'revision' | 'adjustment';
|
|
167
|
-
readonly accountId: string;
|
|
168
|
-
readonly obligationId: string;
|
|
169
|
-
readonly digestProfile: 'revision_envelope_v1' | 'rows_v1';
|
|
170
|
-
readonly contentSha256: string;
|
|
171
|
-
/**
|
|
172
|
-
* Byte count of the content `contentSha256` covers (the committed binding's `byteCount`): for a revision it includes
|
|
173
|
-
* the envelope, so it is not the sum of the chunks' `canonical_size_bytes`.
|
|
174
|
-
*/
|
|
175
|
-
readonly contentSizeBytes: number;
|
|
176
|
-
readonly rowCount: number;
|
|
177
|
-
readonly rowManifestSha256: string;
|
|
178
|
-
readonly bindingId: string;
|
|
179
|
-
readonly bindingIdentitySha256: string;
|
|
180
|
-
readonly kind: 'postgres' | 'object';
|
|
181
|
-
readonly manifests: readonly ReportingRowChunkManifestV1[];
|
|
182
|
-
/** Object kind only, by chunk index. */
|
|
183
|
-
readonly locators: readonly (Omit<ReportingRowChunkLocatorV1, 'created'> | undefined)[];
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Reads and writes revision row sets. PostgreSQL-kind reads are always
|
|
187
|
-
* available once the row-storage migration is applied; object-kind reads need
|
|
188
|
-
* the binding and its provider configured. Writes require an explicit opt-in
|
|
189
|
-
* on the owning store.
|
|
190
|
-
*
|
|
191
|
-
* @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
|
|
192
|
-
*/
|
|
193
|
-
export declare class ReportingRowStorageV1 {
|
|
194
|
-
private readonly pool;
|
|
195
|
-
private readonly options;
|
|
196
|
-
private readonly bindings;
|
|
197
|
-
private readonly providers;
|
|
198
|
-
private readonly deploymentNamespace;
|
|
199
|
-
private readonly writeDeadline;
|
|
200
|
-
private readonly readDeadline;
|
|
201
|
-
private readied?;
|
|
202
|
-
private installation?;
|
|
203
|
-
constructor(pool: QueryableV1, options?: ReportingRowStorageOptionsV1);
|
|
204
|
-
/** Deadline budget a writer must still hold on its lease before uploading. */
|
|
205
|
-
get writeDeadlineMilliseconds(): number;
|
|
206
|
-
/** Every writable object binding's key template must include `{revision_key}`; throws `INVALID_INPUT`. */
|
|
207
|
-
private assertBindingKeyTemplates;
|
|
208
|
-
/**
|
|
209
|
-
* Refuse a configuration in which compaction could delete an object a concurrent commit is
|
|
210
|
-
* adopting. An object binding whose key template omits `{revision_key}` can map two revisions
|
|
211
|
-
* with identical chunk content to one object key, and a create-only write adopts an existing
|
|
212
|
-
* object with identical bytes. Compaction deleting that object at the same moment would leave
|
|
213
|
-
* the newer revision without its rows. Every writable binding is already required to include
|
|
214
|
-
* `{revision_key}`, so this cannot fail for a validated configuration. A `readOnly` binding is
|
|
215
|
-
* skipped: it never takes commits, so nothing can adopt through it, and every delete is
|
|
216
|
-
* reference-checked.
|
|
217
|
-
*
|
|
218
|
-
* Since the reference-checked, per-object-locked delete this is no longer the only guard: every
|
|
219
|
-
* delete path now skips an object another row set still references. It is kept as defense in
|
|
220
|
-
* depth for compaction, the one path that deletes content while the obligation stays live.
|
|
221
|
-
*/
|
|
222
|
-
assertCompactionSafeKeyTemplates(): void;
|
|
223
|
-
/** IDs of the object bindings this host configures, the only ones it can delete objects through. */
|
|
224
|
-
objectBindingIds(): string[];
|
|
225
|
-
/** Probe the schema and every provider, and register (or verify) every configured binding. Idempotent. */
|
|
226
|
-
ready(): Promise<void>;
|
|
227
|
-
/** Encode rows, prove the chunks reproduce the committed binding, select a binding and plan objects. */
|
|
228
|
-
prepare(input: ReportingRowSetPrepareInputV1): Promise<ReportingPreparedRowSetV1>;
|
|
229
|
-
/**
|
|
230
|
-
* Upload a prepared object-kind row set, create-only. An object already at a
|
|
231
|
-
* planned key is adopted only when its bytes decode to the exact chunk;
|
|
232
|
-
* otherwise `CONTENT_CONFLICT`. `onCreated` is awaited for every object this
|
|
233
|
-
* call created, before the next upload, so the caller can record it in its
|
|
234
|
-
* write intent.
|
|
235
|
-
*/
|
|
236
|
-
upload(prepared: ReportingPreparedRowSetV1, intentId: string, onCreated: (object: {
|
|
237
|
-
objectRef: string;
|
|
238
|
-
nativeVersionRef: string;
|
|
239
|
-
}) => Promise<void>, signal?: AbortSignal): Promise<ReportingRowChunkLocatorV1[]>;
|
|
240
|
-
/**
|
|
241
|
-
* Persist a prepared row set inside the caller's ledger transaction:
|
|
242
|
-
* bodies for the `postgres` kind, or the uploaded locators for the object
|
|
243
|
-
* kind. Replays of an identical row set are no-ops; a conflicting row set
|
|
244
|
-
* under the same ID is refused.
|
|
245
|
-
*/
|
|
246
|
-
writeInTransaction(transaction: QueryableV1, prepared: ReportingPreparedRowSetV1, locators?: readonly ReportingRowChunkLocatorV1[], sharedFromRowSetId?: string): Promise<void>;
|
|
247
|
-
/**
|
|
248
|
-
* Load a row set and verify its chunk manifest against the committed digest.
|
|
249
|
-
* Returns `null` when no row set exists (legacy inline rows) or it belongs
|
|
250
|
-
* to another account. Throws `ROWS_EXPIRED` / `ROWS_UNAVAILABLE` when the
|
|
251
|
-
* rows were pruned or lost.
|
|
252
|
-
*/
|
|
253
|
-
find(rowSetId: string, accountId: string, queryable?: QueryableV1): Promise<ReportingRowSetHandleV1 | null>;
|
|
254
|
-
/** Verified rows `[offset, offset + limit)` in ordinal order. */
|
|
255
|
-
readPage(handle: ReportingRowSetHandleV1, offset: number, limit: number, signal?: AbortSignal): Promise<Record<string, unknown>[]>;
|
|
256
|
-
/**
|
|
257
|
-
* Every row, verified chunk by chunk and against the committed binding.
|
|
258
|
-
* `controlTotals` are required for revision row sets.
|
|
259
|
-
*/
|
|
260
|
-
readAll(handle: ReportingRowSetHandleV1, controlTotals?: readonly unknown[], options?: {
|
|
261
|
-
maxBytes?: number;
|
|
262
|
-
signal?: AbortSignal;
|
|
263
|
-
}): Promise<Record<string, unknown>[]>;
|
|
264
|
-
/**
|
|
265
|
-
* Delete exact object versions through the configured binding's provider.
|
|
266
|
-
* `absent` counts as success. Only object-kind bindings are accepted.
|
|
267
|
-
*/
|
|
268
|
-
deleteObjects(bindingId: string, objects: readonly {
|
|
269
|
-
objectRef: string;
|
|
270
|
-
nativeVersionRef: string;
|
|
271
|
-
}[], signal?: AbortSignal): Promise<void>;
|
|
272
|
-
/**
|
|
273
|
-
* Prove each object is still present at its recorded version with the recorded size.
|
|
274
|
-
* A commit that adopted an object another row set created calls this under the object's
|
|
275
|
-
* lock, so a concurrent delete either finished first (this throws, the commit fails and
|
|
276
|
-
* the writer re-uploads) or sees the commit's chunk reference and skips the delete.
|
|
277
|
-
*
|
|
278
|
-
* Native versions are write-unique (S3 VersionId, Azure versionId, GCS generation, filesystem
|
|
279
|
-
* `ino:birthtime:mtime:size`), so a version-pinned metadata check, "this exact version exists at the
|
|
280
|
-
* recorded size", proves the object unchanged without downloading it while the commit holds its
|
|
281
|
-
* locks. Bytes were verified when the object was uploaded or adopted. A custom provider without
|
|
282
|
-
* `stat` falls back to reading the whole object and comparing its physical digest.
|
|
283
|
-
*/
|
|
284
|
-
assertObjectsPresent(bindingId: string, objects: readonly {
|
|
285
|
-
objectRef: string;
|
|
286
|
-
nativeVersionRef: string;
|
|
287
|
-
physicalSha256: string;
|
|
288
|
-
sizeBytes: number;
|
|
289
|
-
}[], signal?: AbortSignal): Promise<void>;
|
|
290
|
-
/**
|
|
291
|
-
* A live row set in the same obligation and binding whose rows are
|
|
292
|
-
* byte-identical (same manifest digest), with its chunk locations. Sharing
|
|
293
|
-
* never crosses obligations, so it never crosses consumers.
|
|
294
|
-
*/
|
|
295
|
-
findShareable(queryable: QueryableV1, prepared: ReportingPreparedRowSetV1): Promise<{
|
|
296
|
-
rowSetId: string;
|
|
297
|
-
locators: ReportingRowChunkLocatorV1[];
|
|
298
|
-
} | undefined>;
|
|
299
|
-
/** Installation identity and namespace key; available after `ready()`. */
|
|
300
|
-
get installationIdentity(): {
|
|
301
|
-
installationId: string;
|
|
302
|
-
namespaceKey: string;
|
|
303
|
-
};
|
|
304
|
-
private readChunkRange;
|
|
305
|
-
private inflate;
|
|
306
|
-
private decode;
|
|
307
|
-
/** Collapse provider failures to stable, secret-free codes. */
|
|
308
|
-
private provider;
|
|
309
|
-
private register;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Fresh opaque intent identifier for one upload attempt.
|
|
313
|
-
*
|
|
314
|
-
* @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
|
|
315
|
-
*/
|
|
316
|
-
export declare function reportingRowWriteIntentIdV1(): string;
|
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
import { type ReportingEncodedRowsV1, type ReportingRowChunkManifestV1 } from './row-encoding';
|
|
2
|
-
import { type ReportingRowObjectProviderV1 } from './row-storage-object';
|
|
3
|
-
/**
|
|
4
|
-
* Revision row storage (shared SDK persistence spec,
|
|
5
|
-
* adcontextprotocol/adcp#7996 §3). Revision headers stay in the ledger
|
|
6
|
-
* document; rows live as canonical JSONL chunks in a storage binding, and
|
|
7
|
-
* every read is verified against digests committed in PostgreSQL before rows
|
|
8
|
-
* are released.
|
|
9
|
-
*/
|
|
10
|
-
export { ReportingRowStoreError, isReportingRowStoreError } from './row-storage-errors';
|
|
11
|
-
export type { ReportingRowStoreErrorCode } from './row-storage-errors';
|
|
12
|
-
/**
|
|
13
|
-
* Rows stored as chunk bodies in the ledger's own PostgreSQL schema.
|
|
14
|
-
*
|
|
15
|
-
* @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
|
|
16
|
-
*/
|
|
17
|
-
export interface ReportingPostgresRowBindingV1 {
|
|
18
|
-
kind: 'postgres';
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Rows stored as one object per chunk through a registered provider. The
|
|
22
|
-
* definition lives in host code, which makes it the allowlist: a row set
|
|
23
|
-
* whose recorded binding identity differs from the configured definition is
|
|
24
|
-
* never read from or written to.
|
|
25
|
-
*
|
|
26
|
-
* @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
|
|
27
|
-
*/
|
|
28
|
-
export interface ReportingObjectRowBindingV1 {
|
|
29
|
-
kind: 'object';
|
|
30
|
-
/** Name of a provider registered in `ReportingRowStorageOptionsV1.providers`. */
|
|
31
|
-
provider: string;
|
|
32
|
-
/** Non-secret provider coordinates, validated by the provider's closed schema. */
|
|
33
|
-
location: Readonly<Record<string, string>>;
|
|
34
|
-
/** Owned key prefix. Sweeps and deletes never touch keys outside it. */
|
|
35
|
-
prefix: string;
|
|
36
|
-
/**
|
|
37
|
-
* Object key template; see `REPORTING_ROW_DEFAULT_KEY_TEMPLATE`. It must include `{revision_key}`, so every
|
|
38
|
-
* row set writes its own object keys (a read-only binding is exempt).
|
|
39
|
-
*/
|
|
40
|
-
keyTemplate?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Keep this binding configured only to read (and retire) row sets already written through it, for
|
|
43
|
-
* example under an older template without `{revision_key}`. A read-only binding is never selected for
|
|
44
|
-
* new writes and is exempt from the `{revision_key}` requirement; reads use each chunk's recorded
|
|
45
|
-
* `object_ref`, never a re-rendered key. Not part of the binding's identity.
|
|
46
|
-
*/
|
|
47
|
-
readOnly?: boolean;
|
|
48
|
-
/** Stored encoding; digests always cover uncompressed bytes. Default `gzip`. */
|
|
49
|
-
compression?: 'none' | 'gzip';
|
|
50
|
-
/** Host-mapped client reference passed to the provider; never a secret. */
|
|
51
|
-
credentialRef?: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @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
|
|
55
|
-
*/
|
|
56
|
-
export type ReportingRowBindingDefinitionV1 = ReportingPostgresRowBindingV1 | ReportingObjectRowBindingV1;
|
|
57
|
-
/**
|
|
58
|
-
* @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
|
|
59
|
-
*/
|
|
60
|
-
export interface ReportingRowBindingSelectionInputV1 {
|
|
61
|
-
account_id: string;
|
|
62
|
-
reporting_obligation_id: string;
|
|
63
|
-
row_set_kind: 'revision' | 'adjustment';
|
|
64
|
-
finality?: 'snapshot' | 'official';
|
|
65
|
-
row_count: number;
|
|
66
|
-
content_size_bytes: number;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* @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
|
|
70
|
-
*/
|
|
71
|
-
export interface ReportingRowStorageOptionsV1 {
|
|
72
|
-
/**
|
|
73
|
-
* Logical binding ID → immutable definition. Defaults to a single
|
|
74
|
-
* `postgres` binding. Changing a definition requires a new ID; keep retired
|
|
75
|
-
* definitions configured while revisions still reference them.
|
|
76
|
-
*/
|
|
77
|
-
bindings?: Readonly<Record<string, ReportingRowBindingDefinitionV1>>;
|
|
78
|
-
/** Object-storage providers by name. */
|
|
79
|
-
providers?: Readonly<Record<string, ReportingRowObjectProviderV1>>;
|
|
80
|
-
/** Picks the binding for each new row set. Defaults to the only binding, or `postgres`. */
|
|
81
|
-
selectRowBinding?(input: ReportingRowBindingSelectionInputV1): string | Promise<string>;
|
|
82
|
-
/**
|
|
83
|
-
* Stable deployment namespace, combined with the schema's installation
|
|
84
|
-
* identity into each binding's `namespace_key`. Defaults to `default`.
|
|
85
|
-
*/
|
|
86
|
-
deploymentNamespace?: string;
|
|
87
|
-
/** Deadline for one row set's uploads. Default 60 seconds. */
|
|
88
|
-
writeDeadlineMilliseconds?: number;
|
|
89
|
-
/** Deadline for one object read. Default 30 seconds. */
|
|
90
|
-
readDeadlineMilliseconds?: number;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* @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
|
|
94
|
-
*/
|
|
95
|
-
export interface ReportingRowSetPrepareInputV1 {
|
|
96
|
-
rowSetId: string;
|
|
97
|
-
rowSetKind: 'revision' | 'adjustment';
|
|
98
|
-
accountId: string;
|
|
99
|
-
obligationId: string;
|
|
100
|
-
rows: readonly Record<string, unknown>[];
|
|
101
|
-
finality?: 'snapshot' | 'official';
|
|
102
|
-
/** Reporting period start, used with `sourceTimezone` for `{period_date}` in object keys. */
|
|
103
|
-
periodStart?: string;
|
|
104
|
-
/** The period's `source_timezone` (required with `periodStart`): `{period_date}` is the local calendar date. */
|
|
105
|
-
sourceTimezone?: string;
|
|
106
|
-
/** Committed protocol binding the chunks must reproduce. */
|
|
107
|
-
binding: {
|
|
108
|
-
sha256: string;
|
|
109
|
-
byteCount: number;
|
|
110
|
-
rowCount: number;
|
|
111
|
-
};
|
|
112
|
-
/** Required for revisions (`revision_envelope_v1`); omitted for adjustments (`rows_v1`). */
|
|
113
|
-
controlTotals?: readonly unknown[];
|
|
114
|
-
/** Overrides `selectRowBinding` (for example, to migrate inline rows into a PostgreSQL binding). */
|
|
115
|
-
bindingId?: string;
|
|
116
|
-
}
|
|
117
|
-
interface PreparedObjectV1 {
|
|
118
|
-
readonly objectRef: string;
|
|
119
|
-
readonly physicalBytes: Buffer;
|
|
120
|
-
readonly physicalSha256: string;
|
|
121
|
-
readonly compression: 'none' | 'gzip';
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* @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
|
|
125
|
-
*/
|
|
126
|
-
export interface ReportingPreparedRowSetV1 {
|
|
127
|
-
readonly input: ReportingRowSetPrepareInputV1;
|
|
128
|
-
readonly encoded: ReportingEncodedRowsV1;
|
|
129
|
-
readonly bindingId: string;
|
|
130
|
-
readonly binding: ReportingRowBindingDefinitionV1;
|
|
131
|
-
readonly digestProfile: 'revision_envelope_v1' | 'rows_v1';
|
|
132
|
-
/** Object kind only: one planned object per chunk. */
|
|
133
|
-
readonly objects?: readonly PreparedObjectV1[];
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Where one chunk was stored; recorded in the chunk manifest.
|
|
137
|
-
*
|
|
138
|
-
* @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
|
|
139
|
-
*/
|
|
140
|
-
export interface ReportingRowChunkLocatorV1 {
|
|
141
|
-
/** AdCP `object_ref`: decoded, destination-relative, 1 to 1024 characters. */
|
|
142
|
-
objectRef: string;
|
|
143
|
-
/** AdCP `native_version_ref`: decoded provider-native immutable version, 1 to 1024 characters. */
|
|
144
|
-
nativeVersionRef: string;
|
|
145
|
-
compression: 'none' | 'gzip';
|
|
146
|
-
/** SHA-256 of the stored (possibly compressed) object bytes. */
|
|
147
|
-
physicalSha256: string;
|
|
148
|
-
/** AdCP `size_bytes`: the stored object's size, after any compression. */
|
|
149
|
-
sizeBytes: number;
|
|
150
|
-
/** Whether this upload created the object (as opposed to adopting identical bytes). */
|
|
151
|
-
created: boolean;
|
|
152
|
-
}
|
|
153
|
-
interface QueryableV1 {
|
|
154
|
-
query<Row extends Record<string, unknown> = Record<string, unknown>>(text: string, values?: unknown[]): Promise<{
|
|
155
|
-
rows: Row[];
|
|
156
|
-
rowCount?: number | null;
|
|
157
|
-
}>;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* A row set whose chunk manifest has been verified against its committed digest.
|
|
161
|
-
*
|
|
162
|
-
* @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
|
|
163
|
-
*/
|
|
164
|
-
export interface ReportingRowSetHandleV1 {
|
|
165
|
-
readonly rowSetId: string;
|
|
166
|
-
readonly rowSetKind: 'revision' | 'adjustment';
|
|
167
|
-
readonly accountId: string;
|
|
168
|
-
readonly obligationId: string;
|
|
169
|
-
readonly digestProfile: 'revision_envelope_v1' | 'rows_v1';
|
|
170
|
-
readonly contentSha256: string;
|
|
171
|
-
/**
|
|
172
|
-
* Byte count of the content `contentSha256` covers (the committed binding's `byteCount`): for a revision it includes
|
|
173
|
-
* the envelope, so it is not the sum of the chunks' `canonical_size_bytes`.
|
|
174
|
-
*/
|
|
175
|
-
readonly contentSizeBytes: number;
|
|
176
|
-
readonly rowCount: number;
|
|
177
|
-
readonly rowManifestSha256: string;
|
|
178
|
-
readonly bindingId: string;
|
|
179
|
-
readonly bindingIdentitySha256: string;
|
|
180
|
-
readonly kind: 'postgres' | 'object';
|
|
181
|
-
readonly manifests: readonly ReportingRowChunkManifestV1[];
|
|
182
|
-
/** Object kind only, by chunk index. */
|
|
183
|
-
readonly locators: readonly (Omit<ReportingRowChunkLocatorV1, 'created'> | undefined)[];
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Reads and writes revision row sets. PostgreSQL-kind reads are always
|
|
187
|
-
* available once the row-storage migration is applied; object-kind reads need
|
|
188
|
-
* the binding and its provider configured. Writes require an explicit opt-in
|
|
189
|
-
* on the owning store.
|
|
190
|
-
*
|
|
191
|
-
* @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
|
|
192
|
-
*/
|
|
193
|
-
export declare class ReportingRowStorageV1 {
|
|
194
|
-
private readonly pool;
|
|
195
|
-
private readonly options;
|
|
196
|
-
private readonly bindings;
|
|
197
|
-
private readonly providers;
|
|
198
|
-
private readonly deploymentNamespace;
|
|
199
|
-
private readonly writeDeadline;
|
|
200
|
-
private readonly readDeadline;
|
|
201
|
-
private readied?;
|
|
202
|
-
private installation?;
|
|
203
|
-
constructor(pool: QueryableV1, options?: ReportingRowStorageOptionsV1);
|
|
204
|
-
/** Deadline budget a writer must still hold on its lease before uploading. */
|
|
205
|
-
get writeDeadlineMilliseconds(): number;
|
|
206
|
-
/** Every writable object binding's key template must include `{revision_key}`; throws `INVALID_INPUT`. */
|
|
207
|
-
private assertBindingKeyTemplates;
|
|
208
|
-
/**
|
|
209
|
-
* Refuse a configuration in which compaction could delete an object a concurrent commit is
|
|
210
|
-
* adopting. An object binding whose key template omits `{revision_key}` can map two revisions
|
|
211
|
-
* with identical chunk content to one object key, and a create-only write adopts an existing
|
|
212
|
-
* object with identical bytes. Compaction deleting that object at the same moment would leave
|
|
213
|
-
* the newer revision without its rows. Every writable binding is already required to include
|
|
214
|
-
* `{revision_key}`, so this cannot fail for a validated configuration. A `readOnly` binding is
|
|
215
|
-
* skipped: it never takes commits, so nothing can adopt through it, and every delete is
|
|
216
|
-
* reference-checked.
|
|
217
|
-
*
|
|
218
|
-
* Since the reference-checked, per-object-locked delete this is no longer the only guard: every
|
|
219
|
-
* delete path now skips an object another row set still references. It is kept as defense in
|
|
220
|
-
* depth for compaction, the one path that deletes content while the obligation stays live.
|
|
221
|
-
*/
|
|
222
|
-
assertCompactionSafeKeyTemplates(): void;
|
|
223
|
-
/** IDs of the object bindings this host configures, the only ones it can delete objects through. */
|
|
224
|
-
objectBindingIds(): string[];
|
|
225
|
-
/** Probe the schema and every provider, and register (or verify) every configured binding. Idempotent. */
|
|
226
|
-
ready(): Promise<void>;
|
|
227
|
-
/** Encode rows, prove the chunks reproduce the committed binding, select a binding and plan objects. */
|
|
228
|
-
prepare(input: ReportingRowSetPrepareInputV1): Promise<ReportingPreparedRowSetV1>;
|
|
229
|
-
/**
|
|
230
|
-
* Upload a prepared object-kind row set, create-only. An object already at a
|
|
231
|
-
* planned key is adopted only when its bytes decode to the exact chunk;
|
|
232
|
-
* otherwise `CONTENT_CONFLICT`. `onCreated` is awaited for every object this
|
|
233
|
-
* call created, before the next upload, so the caller can record it in its
|
|
234
|
-
* write intent.
|
|
235
|
-
*/
|
|
236
|
-
upload(prepared: ReportingPreparedRowSetV1, intentId: string, onCreated: (object: {
|
|
237
|
-
objectRef: string;
|
|
238
|
-
nativeVersionRef: string;
|
|
239
|
-
}) => Promise<void>, signal?: AbortSignal): Promise<ReportingRowChunkLocatorV1[]>;
|
|
240
|
-
/**
|
|
241
|
-
* Persist a prepared row set inside the caller's ledger transaction:
|
|
242
|
-
* bodies for the `postgres` kind, or the uploaded locators for the object
|
|
243
|
-
* kind. Replays of an identical row set are no-ops; a conflicting row set
|
|
244
|
-
* under the same ID is refused.
|
|
245
|
-
*/
|
|
246
|
-
writeInTransaction(transaction: QueryableV1, prepared: ReportingPreparedRowSetV1, locators?: readonly ReportingRowChunkLocatorV1[], sharedFromRowSetId?: string): Promise<void>;
|
|
247
|
-
/**
|
|
248
|
-
* Load a row set and verify its chunk manifest against the committed digest.
|
|
249
|
-
* Returns `null` when no row set exists (legacy inline rows) or it belongs
|
|
250
|
-
* to another account. Throws `ROWS_EXPIRED` / `ROWS_UNAVAILABLE` when the
|
|
251
|
-
* rows were pruned or lost.
|
|
252
|
-
*/
|
|
253
|
-
find(rowSetId: string, accountId: string, queryable?: QueryableV1): Promise<ReportingRowSetHandleV1 | null>;
|
|
254
|
-
/** Verified rows `[offset, offset + limit)` in ordinal order. */
|
|
255
|
-
readPage(handle: ReportingRowSetHandleV1, offset: number, limit: number, signal?: AbortSignal): Promise<Record<string, unknown>[]>;
|
|
256
|
-
/**
|
|
257
|
-
* Every row, verified chunk by chunk and against the committed binding.
|
|
258
|
-
* `controlTotals` are required for revision row sets.
|
|
259
|
-
*/
|
|
260
|
-
readAll(handle: ReportingRowSetHandleV1, controlTotals?: readonly unknown[], options?: {
|
|
261
|
-
maxBytes?: number;
|
|
262
|
-
signal?: AbortSignal;
|
|
263
|
-
}): Promise<Record<string, unknown>[]>;
|
|
264
|
-
/**
|
|
265
|
-
* Delete exact object versions through the configured binding's provider.
|
|
266
|
-
* `absent` counts as success. Only object-kind bindings are accepted.
|
|
267
|
-
*/
|
|
268
|
-
deleteObjects(bindingId: string, objects: readonly {
|
|
269
|
-
objectRef: string;
|
|
270
|
-
nativeVersionRef: string;
|
|
271
|
-
}[], signal?: AbortSignal): Promise<void>;
|
|
272
|
-
/**
|
|
273
|
-
* Prove each object is still present at its recorded version with the recorded size.
|
|
274
|
-
* A commit that adopted an object another row set created calls this under the object's
|
|
275
|
-
* lock, so a concurrent delete either finished first (this throws, the commit fails and
|
|
276
|
-
* the writer re-uploads) or sees the commit's chunk reference and skips the delete.
|
|
277
|
-
*
|
|
278
|
-
* Native versions are write-unique (S3 VersionId, Azure versionId, GCS generation, filesystem
|
|
279
|
-
* `ino:birthtime:mtime:size`), so a version-pinned metadata check, "this exact version exists at the
|
|
280
|
-
* recorded size", proves the object unchanged without downloading it while the commit holds its
|
|
281
|
-
* locks. Bytes were verified when the object was uploaded or adopted. A custom provider without
|
|
282
|
-
* `stat` falls back to reading the whole object and comparing its physical digest.
|
|
283
|
-
*/
|
|
284
|
-
assertObjectsPresent(bindingId: string, objects: readonly {
|
|
285
|
-
objectRef: string;
|
|
286
|
-
nativeVersionRef: string;
|
|
287
|
-
physicalSha256: string;
|
|
288
|
-
sizeBytes: number;
|
|
289
|
-
}[], signal?: AbortSignal): Promise<void>;
|
|
290
|
-
/**
|
|
291
|
-
* A live row set in the same obligation and binding whose rows are
|
|
292
|
-
* byte-identical (same manifest digest), with its chunk locations. Sharing
|
|
293
|
-
* never crosses obligations, so it never crosses consumers.
|
|
294
|
-
*/
|
|
295
|
-
findShareable(queryable: QueryableV1, prepared: ReportingPreparedRowSetV1): Promise<{
|
|
296
|
-
rowSetId: string;
|
|
297
|
-
locators: ReportingRowChunkLocatorV1[];
|
|
298
|
-
} | undefined>;
|
|
299
|
-
/** Installation identity and namespace key; available after `ready()`. */
|
|
300
|
-
get installationIdentity(): {
|
|
301
|
-
installationId: string;
|
|
302
|
-
namespaceKey: string;
|
|
303
|
-
};
|
|
304
|
-
private readChunkRange;
|
|
305
|
-
private inflate;
|
|
306
|
-
private decode;
|
|
307
|
-
/** Collapse provider failures to stable, secret-free codes. */
|
|
308
|
-
private provider;
|
|
309
|
-
private register;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Fresh opaque intent identifier for one upload attempt.
|
|
313
|
-
*
|
|
314
|
-
* @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
|
|
315
|
-
*/
|
|
316
|
-
export declare function reportingRowWriteIntentIdV1(): string;
|