@rendobar/sdk 5.2.0 → 5.4.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/README.md CHANGED
@@ -28,6 +28,16 @@
28
28
 
29
29
  `@rendobar/sdk` is the official TypeScript client for [Rendobar](https://rendobar.com), a serverless media processing API. You submit a job, the SDK polls it to completion, and you get back a hosted URL. It ships ESM and CJS builds with full types, retries 429 and 5xx automatically, auto-paginates, and accepts an `AbortSignal` on every method.
30
30
 
31
+ ## Let your AI assistant do it
32
+
33
+ Paste this one line into Claude, ChatGPT, or Cursor and the assistant reads the
34
+ full integration playbook, detects your stack, and wires Rendobar into your
35
+ codebase. Your API key stays in your env file, never in the chat.
36
+
37
+ ```text
38
+ Add Rendobar to my app: read and follow https://rendobar.com/prompts/integrate.md
39
+ ```
40
+
31
41
  ## Requirements
32
42
 
33
43
  Node 18 or later. Works in any runtime with `fetch`, including Cloudflare Workers, Deno, and Bun.
package/dist/index.cjs CHANGED
@@ -417,9 +417,9 @@ function attemptTimeoutMs(sizeBytes, attempt) {
417
417
  6e4
418
418
  ];
419
419
  const RATE_BPS = [
420
- 500 * 1024,
421
- 100 * 1024,
422
- 50 * 1024
420
+ 512e3,
421
+ 102400,
422
+ 51200
423
423
  ];
424
424
  const i = Math.min(attempt, GRACE_MS.length - 1);
425
425
  return GRACE_MS[i] + Math.ceil(sizeBytes / RATE_BPS[i] * 1e3);
@@ -798,6 +798,7 @@ const KNOWN_EVENT_TYPES = /* @__PURE__ */ new Set([
798
798
  "job.resources",
799
799
  "job.metrics",
800
800
  "job.context",
801
+ "job.preview",
801
802
  "job.region_failover",
802
803
  "balance.updated",
803
804
  "subscription.updated",
@@ -897,6 +898,7 @@ function dispatchJobEvent(event, options) {
897
898
  case "job.context":
898
899
  options.onContext?.(event);
899
900
  break;
901
+ case "job.preview": options.onPreview?.(event);
900
902
  }
901
903
  }
902
904
  //#endregion
package/dist/index.d.cts CHANGED
@@ -2370,6 +2370,13 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
2370
2370
  status: ZodLiteral<"dispatched">;
2371
2371
  progress: ZodOptional<ZodNullable<ZodNumber>>;
2372
2372
  eta: ZodOptional<ZodNullable<ZodNumber>>;
2373
+ bootState: ZodOptional<ZodNullable<ZodObject<{
2374
+ phase: ZodString;
2375
+ detail: ZodString;
2376
+ elapsedMs: ZodNumber;
2377
+ typicalMs: ZodNullable<ZodNumber>;
2378
+ etaMs: ZodNullable<ZodNumber>;
2379
+ }, $strip>>>;
2373
2380
  }, $strip>, ZodObject<{
2374
2381
  id: ZodString;
2375
2382
  orgId: ZodString;
@@ -3013,6 +3020,9 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
3013
3020
  status: ZodString;
3014
3021
  cancelAtPeriodEnd: ZodOptional<ZodBoolean>;
3015
3022
  timestamp: ZodOptional<ZodNumber>;
3023
+ }, $strip>, ZodObject<{
3024
+ type: ZodLiteral<"apikeys.updated">;
3025
+ timestamp: ZodOptional<ZodNumber>;
3016
3026
  }, $strip>, ZodObject<{
3017
3027
  type: ZodLiteral<"notification">;
3018
3028
  severity: ZodEnum<{
@@ -3032,8 +3042,8 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
3032
3042
  jobId: ZodString;
3033
3043
  timestamp: ZodNumber;
3034
3044
  machine: ZodString;
3035
- cpu: ZodNumber;
3036
- memory: ZodNumber;
3045
+ cpu: ZodOptional<ZodNumber>;
3046
+ memory: ZodOptional<ZodNumber>;
3037
3047
  region: ZodOptional<ZodString>;
3038
3048
  }, $strip>, ZodObject<{
3039
3049
  type: ZodLiteral<"job.progress">;
@@ -3051,38 +3061,38 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
3051
3061
  metrics: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodNumber, ZodString]>>>;
3052
3062
  }, $strip>, ZodObject<{
3053
3063
  timestamp: ZodNumber;
3054
- cpuPct: ZodNumber;
3064
+ cpuPct: ZodDefault<ZodNullable<ZodNumber>>;
3055
3065
  cpuCores: ZodNumber;
3056
- allocatedCores: ZodOptional<ZodNumber>;
3066
+ allocatedCores: ZodDefault<ZodNullable<ZodNumber>>;
3057
3067
  memUsedMB: ZodNumber;
3058
- memLimitMB: ZodNumber;
3059
- diskRMBps: ZodOptional<ZodNumber>;
3060
- diskWMBps: ZodOptional<ZodNumber>;
3061
- netRxMBps: ZodOptional<ZodNumber>;
3062
- netTxMBps: ZodOptional<ZodNumber>;
3063
- gpuPct: ZodOptional<ZodNumber>;
3064
- gpuMemUsedMB: ZodOptional<ZodNumber>;
3065
- gpuMemTotalMB: ZodOptional<ZodNumber>;
3066
- gpuTempC: ZodOptional<ZodNumber>;
3067
- gpuPowerW: ZodOptional<ZodNumber>;
3068
+ memLimitMB: ZodDefault<ZodNullable<ZodNumber>>;
3069
+ diskRMBps: ZodDefault<ZodNullable<ZodNumber>>;
3070
+ diskWMBps: ZodDefault<ZodNullable<ZodNumber>>;
3071
+ netRxMBps: ZodDefault<ZodNullable<ZodNumber>>;
3072
+ netTxMBps: ZodDefault<ZodNullable<ZodNumber>>;
3073
+ gpuPct: ZodDefault<ZodNullable<ZodNumber>>;
3074
+ gpuMemUsedMB: ZodDefault<ZodNullable<ZodNumber>>;
3075
+ gpuMemTotalMB: ZodDefault<ZodNullable<ZodNumber>>;
3076
+ gpuTempC: ZodDefault<ZodNullable<ZodNumber>>;
3077
+ gpuPowerW: ZodDefault<ZodNullable<ZodNumber>>;
3068
3078
  type: ZodLiteral<"job.resources">;
3069
3079
  jobId: ZodString;
3070
3080
  }, $strip>, ZodObject<{
3071
3081
  timestamp: ZodNumber;
3072
- cpuPct: ZodNumber;
3082
+ cpuPct: ZodDefault<ZodNullable<ZodNumber>>;
3073
3083
  cpuCores: ZodNumber;
3074
- allocatedCores: ZodOptional<ZodNumber>;
3084
+ allocatedCores: ZodDefault<ZodNullable<ZodNumber>>;
3075
3085
  memUsedMB: ZodNumber;
3076
- memLimitMB: ZodNumber;
3077
- diskRMBps: ZodOptional<ZodNumber>;
3078
- diskWMBps: ZodOptional<ZodNumber>;
3079
- netRxMBps: ZodOptional<ZodNumber>;
3080
- netTxMBps: ZodOptional<ZodNumber>;
3081
- gpuPct: ZodOptional<ZodNumber>;
3082
- gpuMemUsedMB: ZodOptional<ZodNumber>;
3083
- gpuMemTotalMB: ZodOptional<ZodNumber>;
3084
- gpuTempC: ZodOptional<ZodNumber>;
3085
- gpuPowerW: ZodOptional<ZodNumber>;
3086
+ memLimitMB: ZodDefault<ZodNullable<ZodNumber>>;
3087
+ diskRMBps: ZodDefault<ZodNullable<ZodNumber>>;
3088
+ diskWMBps: ZodDefault<ZodNullable<ZodNumber>>;
3089
+ netRxMBps: ZodDefault<ZodNullable<ZodNumber>>;
3090
+ netTxMBps: ZodDefault<ZodNullable<ZodNumber>>;
3091
+ gpuPct: ZodDefault<ZodNullable<ZodNumber>>;
3092
+ gpuMemUsedMB: ZodDefault<ZodNullable<ZodNumber>>;
3093
+ gpuMemTotalMB: ZodDefault<ZodNullable<ZodNumber>>;
3094
+ gpuTempC: ZodDefault<ZodNullable<ZodNumber>>;
3095
+ gpuPowerW: ZodDefault<ZodNullable<ZodNumber>>;
3086
3096
  type: ZodLiteral<"job.metrics">;
3087
3097
  jobId: ZodString;
3088
3098
  }, $strip>, ZodObject<{
@@ -3110,6 +3120,15 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
3110
3120
  event: ZodOptional<ZodString>;
3111
3121
  durationMs: ZodOptional<ZodNumber>;
3112
3122
  meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
3123
+ }, $strip>, ZodObject<{
3124
+ type: ZodLiteral<"job.preview">;
3125
+ jobId: ZodString;
3126
+ timestamp: ZodNumber;
3127
+ seq: ZodNumber;
3128
+ progress: ZodNullable<ZodNumber>;
3129
+ width: ZodNumber;
3130
+ height: ZodNumber;
3131
+ data: ZodString;
3113
3132
  }, $strip>, ZodObject<{
3114
3133
  type: ZodLiteral<"replay.done">;
3115
3134
  }, $strip>, ZodObject<{
@@ -3659,6 +3678,14 @@ interface JobSubscribeOptions {
3659
3678
  onMetrics?: (event: Extract<OrgEvent, {
3660
3679
  type: "job.resources";
3661
3680
  }>) => void;
3681
+ /**
3682
+ * Progressive preview frame of an image mid-generation. Ephemeral: 0..N per
3683
+ * job, never replayed on reconnect — only the latest frame is available to
3684
+ * late subscribers.
3685
+ */
3686
+ onPreview?: (event: Extract<OrgEvent, {
3687
+ type: "job.preview";
3688
+ }>) => void;
3662
3689
  onContext?: (event: Extract<OrgEvent, {
3663
3690
  type: "job.context";
3664
3691
  }>) => void;
package/dist/index.d.mts CHANGED
@@ -2370,6 +2370,13 @@ declare const jobResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
2370
2370
  status: ZodLiteral<"dispatched">;
2371
2371
  progress: ZodOptional<ZodNullable<ZodNumber>>;
2372
2372
  eta: ZodOptional<ZodNullable<ZodNumber>>;
2373
+ bootState: ZodOptional<ZodNullable<ZodObject<{
2374
+ phase: ZodString;
2375
+ detail: ZodString;
2376
+ elapsedMs: ZodNumber;
2377
+ typicalMs: ZodNullable<ZodNumber>;
2378
+ etaMs: ZodNullable<ZodNumber>;
2379
+ }, $strip>>>;
2373
2380
  }, $strip>, ZodObject<{
2374
2381
  id: ZodString;
2375
2382
  orgId: ZodString;
@@ -3013,6 +3020,9 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
3013
3020
  status: ZodString;
3014
3021
  cancelAtPeriodEnd: ZodOptional<ZodBoolean>;
3015
3022
  timestamp: ZodOptional<ZodNumber>;
3023
+ }, $strip>, ZodObject<{
3024
+ type: ZodLiteral<"apikeys.updated">;
3025
+ timestamp: ZodOptional<ZodNumber>;
3016
3026
  }, $strip>, ZodObject<{
3017
3027
  type: ZodLiteral<"notification">;
3018
3028
  severity: ZodEnum<{
@@ -3032,8 +3042,8 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
3032
3042
  jobId: ZodString;
3033
3043
  timestamp: ZodNumber;
3034
3044
  machine: ZodString;
3035
- cpu: ZodNumber;
3036
- memory: ZodNumber;
3045
+ cpu: ZodOptional<ZodNumber>;
3046
+ memory: ZodOptional<ZodNumber>;
3037
3047
  region: ZodOptional<ZodString>;
3038
3048
  }, $strip>, ZodObject<{
3039
3049
  type: ZodLiteral<"job.progress">;
@@ -3051,38 +3061,38 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
3051
3061
  metrics: ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodNumber, ZodString]>>>;
3052
3062
  }, $strip>, ZodObject<{
3053
3063
  timestamp: ZodNumber;
3054
- cpuPct: ZodNumber;
3064
+ cpuPct: ZodDefault<ZodNullable<ZodNumber>>;
3055
3065
  cpuCores: ZodNumber;
3056
- allocatedCores: ZodOptional<ZodNumber>;
3066
+ allocatedCores: ZodDefault<ZodNullable<ZodNumber>>;
3057
3067
  memUsedMB: ZodNumber;
3058
- memLimitMB: ZodNumber;
3059
- diskRMBps: ZodOptional<ZodNumber>;
3060
- diskWMBps: ZodOptional<ZodNumber>;
3061
- netRxMBps: ZodOptional<ZodNumber>;
3062
- netTxMBps: ZodOptional<ZodNumber>;
3063
- gpuPct: ZodOptional<ZodNumber>;
3064
- gpuMemUsedMB: ZodOptional<ZodNumber>;
3065
- gpuMemTotalMB: ZodOptional<ZodNumber>;
3066
- gpuTempC: ZodOptional<ZodNumber>;
3067
- gpuPowerW: ZodOptional<ZodNumber>;
3068
+ memLimitMB: ZodDefault<ZodNullable<ZodNumber>>;
3069
+ diskRMBps: ZodDefault<ZodNullable<ZodNumber>>;
3070
+ diskWMBps: ZodDefault<ZodNullable<ZodNumber>>;
3071
+ netRxMBps: ZodDefault<ZodNullable<ZodNumber>>;
3072
+ netTxMBps: ZodDefault<ZodNullable<ZodNumber>>;
3073
+ gpuPct: ZodDefault<ZodNullable<ZodNumber>>;
3074
+ gpuMemUsedMB: ZodDefault<ZodNullable<ZodNumber>>;
3075
+ gpuMemTotalMB: ZodDefault<ZodNullable<ZodNumber>>;
3076
+ gpuTempC: ZodDefault<ZodNullable<ZodNumber>>;
3077
+ gpuPowerW: ZodDefault<ZodNullable<ZodNumber>>;
3068
3078
  type: ZodLiteral<"job.resources">;
3069
3079
  jobId: ZodString;
3070
3080
  }, $strip>, ZodObject<{
3071
3081
  timestamp: ZodNumber;
3072
- cpuPct: ZodNumber;
3082
+ cpuPct: ZodDefault<ZodNullable<ZodNumber>>;
3073
3083
  cpuCores: ZodNumber;
3074
- allocatedCores: ZodOptional<ZodNumber>;
3084
+ allocatedCores: ZodDefault<ZodNullable<ZodNumber>>;
3075
3085
  memUsedMB: ZodNumber;
3076
- memLimitMB: ZodNumber;
3077
- diskRMBps: ZodOptional<ZodNumber>;
3078
- diskWMBps: ZodOptional<ZodNumber>;
3079
- netRxMBps: ZodOptional<ZodNumber>;
3080
- netTxMBps: ZodOptional<ZodNumber>;
3081
- gpuPct: ZodOptional<ZodNumber>;
3082
- gpuMemUsedMB: ZodOptional<ZodNumber>;
3083
- gpuMemTotalMB: ZodOptional<ZodNumber>;
3084
- gpuTempC: ZodOptional<ZodNumber>;
3085
- gpuPowerW: ZodOptional<ZodNumber>;
3086
+ memLimitMB: ZodDefault<ZodNullable<ZodNumber>>;
3087
+ diskRMBps: ZodDefault<ZodNullable<ZodNumber>>;
3088
+ diskWMBps: ZodDefault<ZodNullable<ZodNumber>>;
3089
+ netRxMBps: ZodDefault<ZodNullable<ZodNumber>>;
3090
+ netTxMBps: ZodDefault<ZodNullable<ZodNumber>>;
3091
+ gpuPct: ZodDefault<ZodNullable<ZodNumber>>;
3092
+ gpuMemUsedMB: ZodDefault<ZodNullable<ZodNumber>>;
3093
+ gpuMemTotalMB: ZodDefault<ZodNullable<ZodNumber>>;
3094
+ gpuTempC: ZodDefault<ZodNullable<ZodNumber>>;
3095
+ gpuPowerW: ZodDefault<ZodNullable<ZodNumber>>;
3086
3096
  type: ZodLiteral<"job.metrics">;
3087
3097
  jobId: ZodString;
3088
3098
  }, $strip>, ZodObject<{
@@ -3110,6 +3120,15 @@ declare const orgEventSchema: ZodDiscriminatedUnion<[ZodObject<{
3110
3120
  event: ZodOptional<ZodString>;
3111
3121
  durationMs: ZodOptional<ZodNumber>;
3112
3122
  meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
3123
+ }, $strip>, ZodObject<{
3124
+ type: ZodLiteral<"job.preview">;
3125
+ jobId: ZodString;
3126
+ timestamp: ZodNumber;
3127
+ seq: ZodNumber;
3128
+ progress: ZodNullable<ZodNumber>;
3129
+ width: ZodNumber;
3130
+ height: ZodNumber;
3131
+ data: ZodString;
3113
3132
  }, $strip>, ZodObject<{
3114
3133
  type: ZodLiteral<"replay.done">;
3115
3134
  }, $strip>, ZodObject<{
@@ -3659,6 +3678,14 @@ interface JobSubscribeOptions {
3659
3678
  onMetrics?: (event: Extract<OrgEvent, {
3660
3679
  type: "job.resources";
3661
3680
  }>) => void;
3681
+ /**
3682
+ * Progressive preview frame of an image mid-generation. Ephemeral: 0..N per
3683
+ * job, never replayed on reconnect — only the latest frame is available to
3684
+ * late subscribers.
3685
+ */
3686
+ onPreview?: (event: Extract<OrgEvent, {
3687
+ type: "job.preview";
3688
+ }>) => void;
3662
3689
  onContext?: (event: Extract<OrgEvent, {
3663
3690
  type: "job.context";
3664
3691
  }>) => void;
package/dist/index.mjs CHANGED
@@ -416,9 +416,9 @@ function attemptTimeoutMs(sizeBytes, attempt) {
416
416
  6e4
417
417
  ];
418
418
  const RATE_BPS = [
419
- 500 * 1024,
420
- 100 * 1024,
421
- 50 * 1024
419
+ 512e3,
420
+ 102400,
421
+ 51200
422
422
  ];
423
423
  const i = Math.min(attempt, GRACE_MS.length - 1);
424
424
  return GRACE_MS[i] + Math.ceil(sizeBytes / RATE_BPS[i] * 1e3);
@@ -797,6 +797,7 @@ const KNOWN_EVENT_TYPES = /* @__PURE__ */ new Set([
797
797
  "job.resources",
798
798
  "job.metrics",
799
799
  "job.context",
800
+ "job.preview",
800
801
  "job.region_failover",
801
802
  "balance.updated",
802
803
  "subscription.updated",
@@ -896,6 +897,7 @@ function dispatchJobEvent(event, options) {
896
897
  case "job.context":
897
898
  options.onContext?.(event);
898
899
  break;
900
+ case "job.preview": options.onPreview?.(event);
899
901
  }
900
902
  }
901
903
  //#endregion
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@rendobar/sdk",
3
- "version": "5.2.0",
3
+ "version": "5.4.0",
4
4
  "type": "module",
5
- "description": "TypeScript client for the Rendobar media processing API",
5
+ "description": "Rendobar SDK: TypeScript client for the media processing and AI generation API.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://rendobar.com/docs/sdk",
8
8
  "repository": {