@nodaro/sdk 1.26.0 → 1.27.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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -317,6 +317,29 @@ declare class ProjectsResource {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
type JobStatus = "pending" | "queued" | "processing" | "completed" | "failed" | "cancelled";
|
|
320
|
+
/**
|
|
321
|
+
* A job's `jobs.error_hint` (migration 376) — a user-safe, machine-readable
|
|
322
|
+
* failure verdict the worker writes on a FINAL provider content-policy
|
|
323
|
+
* block, so a caller can act on it without parsing `error_message` prose.
|
|
324
|
+
* `class` distinguishes a deterministic block (copyright/likeness — retrying
|
|
325
|
+
* the same request never helps) from `safety`, whose filter is known to be
|
|
326
|
+
* non-deterministic for some models: `retried` says whether the worker
|
|
327
|
+
* already spent its one extra attempt, and `suggestedProvider` — present
|
|
328
|
+
* only when the catalog declares a fallback for the model that failed — is a
|
|
329
|
+
* real model id the SAME prompt/references can be retried on.
|
|
330
|
+
*/
|
|
331
|
+
interface JobErrorHint {
|
|
332
|
+
kind: "safety-block";
|
|
333
|
+
class: "copyright" | "likeness" | "safety";
|
|
334
|
+
retried: boolean;
|
|
335
|
+
suggestedProvider?: string;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* The billing lifecycle of a job's credit reservation — `usage_logs.status`
|
|
339
|
+
* for the job's `usage_log_id`. `null` when the job has no usage log (e.g. a
|
|
340
|
+
* free run) or hasn't reserved credits yet.
|
|
341
|
+
*/
|
|
342
|
+
type CreditStatus = "reserved" | "committed" | "refunded";
|
|
320
343
|
/**
|
|
321
344
|
* Job record returned to non-admin SDK consumers. Field names are snake_case
|
|
322
345
|
* to match the wire format (per the OpenAPI fix in Phase 1).
|
|
@@ -335,6 +358,13 @@ interface Job {
|
|
|
335
358
|
input_data: unknown;
|
|
336
359
|
output_data: unknown;
|
|
337
360
|
error_message: string | null;
|
|
361
|
+
/** PR9: present on a failed job the worker classified as a content-policy
|
|
362
|
+
* block; absent/null otherwise. User-safe by construction. */
|
|
363
|
+
error_hint?: JobErrorHint | null;
|
|
364
|
+
/** PR9: the job's credit reservation lifecycle, derived server-side from
|
|
365
|
+
* `usage_logs.status`. `null` when there is no usage log to report. Never
|
|
366
|
+
* changes the meaning of `credits` (the reserved amount) below. */
|
|
367
|
+
credit_status?: CreditStatus | null;
|
|
338
368
|
credits: number | null;
|
|
339
369
|
job_type: string | null;
|
|
340
370
|
created_at: string;
|
|
@@ -382,6 +412,10 @@ interface JobStatusResult {
|
|
|
382
412
|
progress?: number;
|
|
383
413
|
output_data?: unknown;
|
|
384
414
|
error_message?: string | null;
|
|
415
|
+
/** PR9: see {@link Job.error_hint}. */
|
|
416
|
+
error_hint?: JobErrorHint | null;
|
|
417
|
+
/** PR9: see {@link Job.credit_status}. */
|
|
418
|
+
credit_status?: CreditStatus | null;
|
|
385
419
|
}
|
|
386
420
|
declare class JobsResource {
|
|
387
421
|
private client;
|
package/dist/index.d.ts
CHANGED
|
@@ -317,6 +317,29 @@ declare class ProjectsResource {
|
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
type JobStatus = "pending" | "queued" | "processing" | "completed" | "failed" | "cancelled";
|
|
320
|
+
/**
|
|
321
|
+
* A job's `jobs.error_hint` (migration 376) — a user-safe, machine-readable
|
|
322
|
+
* failure verdict the worker writes on a FINAL provider content-policy
|
|
323
|
+
* block, so a caller can act on it without parsing `error_message` prose.
|
|
324
|
+
* `class` distinguishes a deterministic block (copyright/likeness — retrying
|
|
325
|
+
* the same request never helps) from `safety`, whose filter is known to be
|
|
326
|
+
* non-deterministic for some models: `retried` says whether the worker
|
|
327
|
+
* already spent its one extra attempt, and `suggestedProvider` — present
|
|
328
|
+
* only when the catalog declares a fallback for the model that failed — is a
|
|
329
|
+
* real model id the SAME prompt/references can be retried on.
|
|
330
|
+
*/
|
|
331
|
+
interface JobErrorHint {
|
|
332
|
+
kind: "safety-block";
|
|
333
|
+
class: "copyright" | "likeness" | "safety";
|
|
334
|
+
retried: boolean;
|
|
335
|
+
suggestedProvider?: string;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* The billing lifecycle of a job's credit reservation — `usage_logs.status`
|
|
339
|
+
* for the job's `usage_log_id`. `null` when the job has no usage log (e.g. a
|
|
340
|
+
* free run) or hasn't reserved credits yet.
|
|
341
|
+
*/
|
|
342
|
+
type CreditStatus = "reserved" | "committed" | "refunded";
|
|
320
343
|
/**
|
|
321
344
|
* Job record returned to non-admin SDK consumers. Field names are snake_case
|
|
322
345
|
* to match the wire format (per the OpenAPI fix in Phase 1).
|
|
@@ -335,6 +358,13 @@ interface Job {
|
|
|
335
358
|
input_data: unknown;
|
|
336
359
|
output_data: unknown;
|
|
337
360
|
error_message: string | null;
|
|
361
|
+
/** PR9: present on a failed job the worker classified as a content-policy
|
|
362
|
+
* block; absent/null otherwise. User-safe by construction. */
|
|
363
|
+
error_hint?: JobErrorHint | null;
|
|
364
|
+
/** PR9: the job's credit reservation lifecycle, derived server-side from
|
|
365
|
+
* `usage_logs.status`. `null` when there is no usage log to report. Never
|
|
366
|
+
* changes the meaning of `credits` (the reserved amount) below. */
|
|
367
|
+
credit_status?: CreditStatus | null;
|
|
338
368
|
credits: number | null;
|
|
339
369
|
job_type: string | null;
|
|
340
370
|
created_at: string;
|
|
@@ -382,6 +412,10 @@ interface JobStatusResult {
|
|
|
382
412
|
progress?: number;
|
|
383
413
|
output_data?: unknown;
|
|
384
414
|
error_message?: string | null;
|
|
415
|
+
/** PR9: see {@link Job.error_hint}. */
|
|
416
|
+
error_hint?: JobErrorHint | null;
|
|
417
|
+
/** PR9: see {@link Job.credit_status}. */
|
|
418
|
+
credit_status?: CreditStatus | null;
|
|
385
419
|
}
|
|
386
420
|
declare class JobsResource {
|
|
387
421
|
private client;
|
package/dist/index.js
CHANGED
|
@@ -2718,7 +2718,7 @@ var WorkspacesResource = class {
|
|
|
2718
2718
|
return this.client.requestText("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts, format: "csv" } });
|
|
2719
2719
|
}
|
|
2720
2720
|
};
|
|
2721
|
-
var SDK_VERSION = "1.
|
|
2721
|
+
var SDK_VERSION = "1.27.0" ;
|
|
2722
2722
|
var CLIENT_HEADER = "X-Nodaro-Client";
|
|
2723
2723
|
var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
2724
2724
|
var NodaroClient = class _NodaroClient {
|