@acedatacloud/sdk 2026.718.1 → 2026.727.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * When the API returns `402 Payment Required`, the transport calls the
5
5
  * configured `PaymentHandler` to produce the extra headers (typically
6
- * `X-Payment`) to attach to the retry. This keeps the SDK free of any
6
+ * `PAYMENT-SIGNATURE`) to attach to the retry. This keeps the SDK free of any
7
7
  * chain-specific signing logic, and lets callers plug in a real x402
8
8
  * implementation such as `@acedatacloud/x402-client`.
9
9
  */
@@ -11,7 +11,9 @@
11
11
  interface PaymentRequirement {
12
12
  scheme: string;
13
13
  network: string;
14
- maxAmountRequired: string;
14
+ amount?: string;
15
+ /** @deprecated Legacy challenge field. */
16
+ maxAmountRequired?: string;
15
17
  maxTimeoutSeconds?: number;
16
18
  resource?: string;
17
19
  description?: string;
@@ -34,7 +36,7 @@ interface PaymentHandlerContext {
34
36
  }
35
37
  /** Result a payment handler must return. */
36
38
  interface PaymentHandlerResult {
37
- /** Extra headers to attach to the retry (must include `X-Payment`). */
39
+ /** Extra headers to attach to the retry (normally `PAYMENT-SIGNATURE`). */
38
40
  headers: Record<string, string>;
39
41
  }
40
42
  /** A callable that signs/settles a payment and returns retry headers. */
@@ -175,7 +177,18 @@ declare class Chat {
175
177
  constructor(transport: Transport);
176
178
  }
177
179
 
178
- /** Task polling abstraction. */
180
+ /**
181
+ * Task polling for long-running operations.
182
+ *
183
+ * A generation call always returns a handle, never sometimes a handle and
184
+ * sometimes a plain object — the caller decides whether to wait. When the server
185
+ * answers synchronously (some endpoints do for fast or cached results) the
186
+ * handle is born already complete, so `wait()` returns immediately rather than
187
+ * polling for something that has already arrived.
188
+ *
189
+ * Kept behaviourally identical to the Python and Go implementations; a
190
+ * divergence here is a cross-language bug that only shows up in production.
191
+ */
179
192
 
180
193
  interface TaskHandleOptions {
181
194
  pollInterval?: number;
@@ -186,7 +199,11 @@ declare class TaskHandle {
186
199
  private pollEndpoint;
187
200
  private transport;
188
201
  private _result;
189
- constructor(taskId: string, pollEndpoint: string, transport: Transport);
202
+ constructor(taskId: string, pollEndpoint: string, transport: Transport, submitted?: Record<string, unknown>);
203
+ get done(): boolean;
204
+ /** Artifact URLs, once completed. */
205
+ urls(): string[];
206
+ progress(): number | null;
190
207
  get(): Promise<Record<string, unknown>>;
191
208
  isCompleted(): Promise<boolean>;
192
209
  wait(opts?: TaskHandleOptions): Promise<Record<string, unknown>>;
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * When the API returns `402 Payment Required`, the transport calls the
5
5
  * configured `PaymentHandler` to produce the extra headers (typically
6
- * `X-Payment`) to attach to the retry. This keeps the SDK free of any
6
+ * `PAYMENT-SIGNATURE`) to attach to the retry. This keeps the SDK free of any
7
7
  * chain-specific signing logic, and lets callers plug in a real x402
8
8
  * implementation such as `@acedatacloud/x402-client`.
9
9
  */
@@ -11,7 +11,9 @@
11
11
  interface PaymentRequirement {
12
12
  scheme: string;
13
13
  network: string;
14
- maxAmountRequired: string;
14
+ amount?: string;
15
+ /** @deprecated Legacy challenge field. */
16
+ maxAmountRequired?: string;
15
17
  maxTimeoutSeconds?: number;
16
18
  resource?: string;
17
19
  description?: string;
@@ -34,7 +36,7 @@ interface PaymentHandlerContext {
34
36
  }
35
37
  /** Result a payment handler must return. */
36
38
  interface PaymentHandlerResult {
37
- /** Extra headers to attach to the retry (must include `X-Payment`). */
39
+ /** Extra headers to attach to the retry (normally `PAYMENT-SIGNATURE`). */
38
40
  headers: Record<string, string>;
39
41
  }
40
42
  /** A callable that signs/settles a payment and returns retry headers. */
@@ -175,7 +177,18 @@ declare class Chat {
175
177
  constructor(transport: Transport);
176
178
  }
177
179
 
178
- /** Task polling abstraction. */
180
+ /**
181
+ * Task polling for long-running operations.
182
+ *
183
+ * A generation call always returns a handle, never sometimes a handle and
184
+ * sometimes a plain object — the caller decides whether to wait. When the server
185
+ * answers synchronously (some endpoints do for fast or cached results) the
186
+ * handle is born already complete, so `wait()` returns immediately rather than
187
+ * polling for something that has already arrived.
188
+ *
189
+ * Kept behaviourally identical to the Python and Go implementations; a
190
+ * divergence here is a cross-language bug that only shows up in production.
191
+ */
179
192
 
180
193
  interface TaskHandleOptions {
181
194
  pollInterval?: number;
@@ -186,7 +199,11 @@ declare class TaskHandle {
186
199
  private pollEndpoint;
187
200
  private transport;
188
201
  private _result;
189
- constructor(taskId: string, pollEndpoint: string, transport: Transport);
202
+ constructor(taskId: string, pollEndpoint: string, transport: Transport, submitted?: Record<string, unknown>);
203
+ get done(): boolean;
204
+ /** Artifact URLs, once completed. */
205
+ urls(): string[];
206
+ progress(): number | null;
190
207
  get(): Promise<Record<string, unknown>>;
191
208
  isCompleted(): Promise<boolean>;
192
209
  wait(opts?: TaskHandleOptions): Promise<Record<string, unknown>>;