@adcp/sdk 14.0.0-beta.18 → 14.0.0-beta.19

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.
@@ -4,5 +4,5 @@
4
4
  "source_sha": "4e553ad955f83b49c7d221ab5c3ff78237ad02e3",
5
5
  "source_tarball_sha256": "580656d6466ef9f0d1119985e6726c2efea718dc671e2ad30957fcb2fd54af0f",
6
6
  "upstream_adcp_version": "2.5.3",
7
- "synced_at": "2026-08-30T04:04:07.159Z"
7
+ "synced_at": "2026-08-30T04:26:50.358Z"
8
8
  }
@@ -82,6 +82,23 @@ CREATE TABLE IF NOT EXISTS ${table} (
82
82
  CONSTRAINT ${table}_valid_payload CHECK (jsonb_typeof(payload) = 'object')
83
83
  );
84
84
 
85
+ -- Upgrade queues provisioned by an earlier SDK beta before creating indexes
86
+ -- or writing the acknowledged state. These operations are deliberately
87
+ -- idempotent so operators can rerun the generated migration safely.
88
+ ALTER TABLE ${table}
89
+ ADD COLUMN IF NOT EXISTS retain_until TIMESTAMPTZ;
90
+
91
+ ALTER TABLE ${table} DROP CONSTRAINT IF EXISTS ${table}_valid_state;
92
+ ALTER TABLE ${table}
93
+ ADD CONSTRAINT ${table}_valid_state CHECK (state IN ('pending', 'dead_letter', 'acknowledged'));
94
+
95
+ ALTER TABLE ${table} DROP CONSTRAINT IF EXISTS ${table}_valid_retention;
96
+ ALTER TABLE ${table}
97
+ ADD CONSTRAINT ${table}_valid_retention CHECK (
98
+ (state = 'acknowledged' AND retain_until IS NOT NULL) OR
99
+ (state <> 'acknowledged' AND retain_until IS NULL)
100
+ );
101
+
85
102
  CREATE INDEX IF NOT EXISTS idx_${table}_due
86
103
  ON ${table}(queue_namespace, next_attempt_at, lease_expires_at)
87
104
  WHERE state = 'pending';
@@ -129,57 +146,57 @@ function createPostgresTaskSettlementIntentQueue(options) {
129
146
  task_id = EXCLUDED.task_id,
130
147
  action = EXCLUDED.action,
131
148
  payload = CASE
132
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
149
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
133
150
  THEN EXCLUDED.payload
134
151
  ELSE ${table}.payload
135
152
  END,
136
153
  intent_fingerprint = EXCLUDED.intent_fingerprint,
137
154
  state = CASE
138
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
155
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
139
156
  THEN 'pending'
140
157
  ELSE ${table}.state
141
158
  END,
142
159
  attempt_count = CASE
143
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
160
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
144
161
  THEN 0
145
162
  ELSE ${table}.attempt_count
146
163
  END,
147
164
  next_attempt_at = CASE
148
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
149
- THEN clock_timestamp()
165
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
166
+ THEN statement_timestamp()
150
167
  ELSE ${table}.next_attempt_at
151
168
  END,
152
169
  lease_owner = CASE
153
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
170
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
154
171
  THEN NULL
155
172
  ELSE ${table}.lease_owner
156
173
  END,
157
174
  lease_claim_id = CASE
158
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
175
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
159
176
  THEN NULL
160
177
  ELSE ${table}.lease_claim_id
161
178
  END,
162
179
  lease_expires_at = CASE
163
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
180
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
164
181
  THEN NULL
165
182
  ELSE ${table}.lease_expires_at
166
183
  END,
167
184
  last_error = CASE
168
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
185
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
169
186
  THEN NULL
170
187
  ELSE ${table}.last_error
171
188
  END,
172
189
  retain_until = CASE
173
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
190
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
174
191
  THEN NULL
175
192
  ELSE ${table}.retain_until
176
193
  END,
177
194
  created_at = CASE
178
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
179
- THEN clock_timestamp()
195
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
196
+ THEN statement_timestamp()
180
197
  ELSE ${table}.created_at
181
198
  END,
182
- updated_at = clock_timestamp()
199
+ updated_at = statement_timestamp()
183
200
  WHERE (
184
201
  ${table}.registry_id = EXCLUDED.registry_id
185
202
  AND ${table}.account_id = EXCLUDED.account_id
@@ -189,7 +206,7 @@ function createPostgresTaskSettlementIntentQueue(options) {
189
206
  AND ${table}.intent_fingerprint = EXCLUDED.intent_fingerprint
190
207
  ) OR (
191
208
  ${table}.state = 'acknowledged'
192
- AND ${table}.retain_until <= clock_timestamp()
209
+ AND ${table}.retain_until <= statement_timestamp()
193
210
  )
194
211
  RETURNING task_id`,
195
212
  [
@@ -205,9 +222,7 @@ function createPostgresTaskSettlementIntentQueue(options) {
205
222
  ]
206
223
  );
207
224
  if (result.rowCount !== 1) {
208
- throw new TaskSettlementIntentConflictError(
209
- `Task ${ref.taskId} is already bound to a different settlement intent`
210
- );
225
+ throw new TaskSettlementIntentConflictError("Task is already bound to a different settlement intent");
211
226
  }
212
227
  return checkpointFor(namespace, ref, fingerprint);
213
228
  },
@@ -55,6 +55,23 @@ CREATE TABLE IF NOT EXISTS ${table} (
55
55
  CONSTRAINT ${table}_valid_payload CHECK (jsonb_typeof(payload) = 'object')
56
56
  );
57
57
 
58
+ -- Upgrade queues provisioned by an earlier SDK beta before creating indexes
59
+ -- or writing the acknowledged state. These operations are deliberately
60
+ -- idempotent so operators can rerun the generated migration safely.
61
+ ALTER TABLE ${table}
62
+ ADD COLUMN IF NOT EXISTS retain_until TIMESTAMPTZ;
63
+
64
+ ALTER TABLE ${table} DROP CONSTRAINT IF EXISTS ${table}_valid_state;
65
+ ALTER TABLE ${table}
66
+ ADD CONSTRAINT ${table}_valid_state CHECK (state IN ('pending', 'dead_letter', 'acknowledged'));
67
+
68
+ ALTER TABLE ${table} DROP CONSTRAINT IF EXISTS ${table}_valid_retention;
69
+ ALTER TABLE ${table}
70
+ ADD CONSTRAINT ${table}_valid_retention CHECK (
71
+ (state = 'acknowledged' AND retain_until IS NOT NULL) OR
72
+ (state <> 'acknowledged' AND retain_until IS NULL)
73
+ );
74
+
58
75
  CREATE INDEX IF NOT EXISTS idx_${table}_due
59
76
  ON ${table}(queue_namespace, next_attempt_at, lease_expires_at)
60
77
  WHERE state = 'pending';
@@ -102,57 +119,57 @@ function createPostgresTaskSettlementIntentQueue(options) {
102
119
  task_id = EXCLUDED.task_id,
103
120
  action = EXCLUDED.action,
104
121
  payload = CASE
105
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
122
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
106
123
  THEN EXCLUDED.payload
107
124
  ELSE ${table}.payload
108
125
  END,
109
126
  intent_fingerprint = EXCLUDED.intent_fingerprint,
110
127
  state = CASE
111
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
128
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
112
129
  THEN 'pending'
113
130
  ELSE ${table}.state
114
131
  END,
115
132
  attempt_count = CASE
116
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
133
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
117
134
  THEN 0
118
135
  ELSE ${table}.attempt_count
119
136
  END,
120
137
  next_attempt_at = CASE
121
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
122
- THEN clock_timestamp()
138
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
139
+ THEN statement_timestamp()
123
140
  ELSE ${table}.next_attempt_at
124
141
  END,
125
142
  lease_owner = CASE
126
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
143
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
127
144
  THEN NULL
128
145
  ELSE ${table}.lease_owner
129
146
  END,
130
147
  lease_claim_id = CASE
131
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
148
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
132
149
  THEN NULL
133
150
  ELSE ${table}.lease_claim_id
134
151
  END,
135
152
  lease_expires_at = CASE
136
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
153
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
137
154
  THEN NULL
138
155
  ELSE ${table}.lease_expires_at
139
156
  END,
140
157
  last_error = CASE
141
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
158
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
142
159
  THEN NULL
143
160
  ELSE ${table}.last_error
144
161
  END,
145
162
  retain_until = CASE
146
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
163
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
147
164
  THEN NULL
148
165
  ELSE ${table}.retain_until
149
166
  END,
150
167
  created_at = CASE
151
- WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= clock_timestamp()
152
- THEN clock_timestamp()
168
+ WHEN ${table}.state = 'acknowledged' AND ${table}.retain_until <= statement_timestamp()
169
+ THEN statement_timestamp()
153
170
  ELSE ${table}.created_at
154
171
  END,
155
- updated_at = clock_timestamp()
172
+ updated_at = statement_timestamp()
156
173
  WHERE (
157
174
  ${table}.registry_id = EXCLUDED.registry_id
158
175
  AND ${table}.account_id = EXCLUDED.account_id
@@ -162,7 +179,7 @@ function createPostgresTaskSettlementIntentQueue(options) {
162
179
  AND ${table}.intent_fingerprint = EXCLUDED.intent_fingerprint
163
180
  ) OR (
164
181
  ${table}.state = 'acknowledged'
165
- AND ${table}.retain_until <= clock_timestamp()
182
+ AND ${table}.retain_until <= statement_timestamp()
166
183
  )
167
184
  RETURNING task_id`,
168
185
  [
@@ -178,9 +195,7 @@ function createPostgresTaskSettlementIntentQueue(options) {
178
195
  ]
179
196
  );
180
197
  if (result.rowCount !== 1) {
181
- throw new TaskSettlementIntentConflictError(
182
- `Task ${ref.taskId} is already bound to a different settlement intent`
183
- );
198
+ throw new TaskSettlementIntentConflictError("Task is already bound to a different settlement intent");
184
199
  }
185
200
  return checkpointFor(namespace, ref, fingerprint);
186
201
  },
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
197
197
  */
198
198
  export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
199
199
  /** Capability semver emitted in run summaries and used for advisory expiry. */
200
- export declare const RUNNER_CAPABILITY_VERSION = "14.0.0-beta.18";
200
+ export declare const RUNNER_CAPABILITY_VERSION = "14.0.0-beta.19";
201
201
  /** True when a failed validation contributes to the owning step's grade. */
202
202
  export declare function validationFailsStep(result: ValidationResult): boolean;
203
203
  /**
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
197
197
  */
198
198
  export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
199
199
  /** Capability semver emitted in run summaries and used for advisory expiry. */
200
- export declare const RUNNER_CAPABILITY_VERSION = "14.0.0-beta.18";
200
+ export declare const RUNNER_CAPABILITY_VERSION = "14.0.0-beta.19";
201
201
  /** True when a failed validation contributes to the owning step's grade. */
202
202
  export declare function validationFailsStep(result: ValidationResult): boolean;
203
203
  /**
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AdCP SDK library version
3
3
  */
4
- export declare const LIBRARY_VERSION = "14.0.0-beta.18";
4
+ export declare const LIBRARY_VERSION = "14.0.0-beta.19";
5
5
  /**
6
6
  * AdCP specification version this library is built for
7
7
  */
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
33
33
  * Full version information
34
34
  */
35
35
  export declare const VERSION_INFO: {
36
- readonly library: "14.0.0-beta.18";
36
+ readonly library: "14.0.0-beta.19";
37
37
  readonly adcp: "3.2.0-beta.9";
38
38
  readonly compatibleVersions: readonly ["v2.5", "v2.6", "v3", "3.0.0-beta.1", "3.0-beta.1", "3.0-beta", "3.0.0-beta.3", "3.0-beta.3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.2.0-beta.9", "3.2-beta.9"];
39
- readonly generatedAt: "2026-08-29T22:10:59.071Z";
39
+ readonly generatedAt: "2026-08-30T04:12:52.476Z";
40
40
  };
41
41
  /**
42
42
  * Get the AdCP specification version this library is built for
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AdCP SDK library version
3
3
  */
4
- export declare const LIBRARY_VERSION = "14.0.0-beta.18";
4
+ export declare const LIBRARY_VERSION = "14.0.0-beta.19";
5
5
  /**
6
6
  * AdCP specification version this library is built for
7
7
  */
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
33
33
  * Full version information
34
34
  */
35
35
  export declare const VERSION_INFO: {
36
- readonly library: "14.0.0-beta.18";
36
+ readonly library: "14.0.0-beta.19";
37
37
  readonly adcp: "3.2.0-beta.9";
38
38
  readonly compatibleVersions: readonly ["v2.5", "v2.6", "v3", "3.0.0-beta.1", "3.0-beta.1", "3.0-beta", "3.0.0-beta.3", "3.0-beta.3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.2.0-beta.9", "3.2-beta.9"];
39
- readonly generatedAt: "2026-08-29T22:10:59.071Z";
39
+ readonly generatedAt: "2026-08-30T04:12:52.476Z";
40
40
  };
41
41
  /**
42
42
  * Get the AdCP specification version this library is built for
@@ -31,7 +31,7 @@ __export(version_exports, {
31
31
  toReleasePrecisionVersion: () => toReleasePrecisionVersion
32
32
  });
33
33
  module.exports = __toCommonJS(version_exports);
34
- const LIBRARY_VERSION = "14.0.0-beta.18";
34
+ const LIBRARY_VERSION = "14.0.0-beta.19";
35
35
  const ADCP_VERSION = "3.2.0-beta.9";
36
36
  const ADCP_MAJOR_VERSION = 3;
37
37
  const COMPATIBLE_ADCP_VERSIONS = [
@@ -94,10 +94,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
94
94
  "3.2-beta.9"
95
95
  ];
96
96
  const VERSION_INFO = {
97
- library: "14.0.0-beta.18",
97
+ library: "14.0.0-beta.19",
98
98
  adcp: "3.2.0-beta.9",
99
99
  compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
100
- generatedAt: "2026-08-29T22:10:59.071Z"
100
+ generatedAt: "2026-08-30T04:12:52.476Z"
101
101
  };
102
102
  function getAdcpVersion() {
103
103
  return ADCP_VERSION;
@@ -1,4 +1,4 @@
1
- const LIBRARY_VERSION = "14.0.0-beta.18";
1
+ const LIBRARY_VERSION = "14.0.0-beta.19";
2
2
  const ADCP_VERSION = "3.2.0-beta.9";
3
3
  const ADCP_MAJOR_VERSION = 3;
4
4
  const COMPATIBLE_ADCP_VERSIONS = [
@@ -61,10 +61,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
61
61
  "3.2-beta.9"
62
62
  ];
63
63
  const VERSION_INFO = {
64
- library: "14.0.0-beta.18",
64
+ library: "14.0.0-beta.19",
65
65
  adcp: "3.2.0-beta.9",
66
66
  compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
67
- generatedAt: "2026-08-29T22:10:59.071Z"
67
+ generatedAt: "2026-08-30T04:12:52.476Z"
68
68
  };
69
69
  function getAdcpVersion() {
70
70
  return ADCP_VERSION;
package/docs/llms.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  # Ad Context Protocol (AdCP)
2
2
 
3
- > Generated at: 2026-08-29
4
- > Library: @adcp/sdk v14.0.0-beta.18
3
+ > Generated at: 2026-08-30
4
+ > Library: @adcp/sdk v14.0.0-beta.19
5
5
  > AdCP major version: 3
6
6
  > Canonical URL: https://adcontextprotocol.github.io/adcp-client/llms.txt
7
7
  > Note: the `Library` stamp reflects the package.json version at doc-generation time. The narrative below describes the surface that lands on the next-published minor — including any 6.7 helpers documented here ahead of the release tag.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adcp/sdk",
3
- "version": "14.0.0-beta.18",
3
+ "version": "14.0.0-beta.19",
4
4
  "description": "AdCP SDK — client, server, and compliance harnesses for the AdContext Protocol (MCP + A2A)",
5
5
  "workspaces": [
6
6
  ".",