@koda-sl/baker-cli 0.128.0-dev.70bf43ce4 → 0.129.1-dev.972f3c9aa

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.
@@ -25,6 +25,23 @@ type ExecResponse = {
25
25
  credits_charged?: number;
26
26
  duration_ms?: number;
27
27
  };
28
+ /** A resumable run as reported by `GET /api/canvas/runs/active`. */
29
+ type ActiveRunInfo = {
30
+ runId: string;
31
+ status: "running" | "completed" | "failed";
32
+ interrupted?: boolean;
33
+ updatedAt?: number;
34
+ canvasSha?: string;
35
+ canvasSnapshotUrl?: string;
36
+ };
37
+ /** The newest snapshot-bearing run for a creative — `GET /api/canvas/runs/latest`. */
38
+ type SnapshotRunInfo = {
39
+ runId: string;
40
+ status: "running" | "completed" | "failed";
41
+ interrupted?: boolean;
42
+ canvasSha?: string;
43
+ canvasSnapshotUrl: string;
44
+ };
28
45
  type ArtifactResponse = {
29
46
  artifact: {
30
47
  kind: string;
@@ -47,7 +64,7 @@ declare class BackendClient$1 {
47
64
  });
48
65
  exec(req: ExecRequest, signal?: AbortSignal): Promise<ExecResponse>;
49
66
  private pollJob;
50
- presignAssetUpload(sha256: string, mime: string, signal?: AbortSignal): Promise<{
67
+ presignAssetUpload(sha256: string, mime: string, signal?: AbortSignal, purpose?: "output" | "source" | "blueprint"): Promise<{
51
68
  putUrl: string;
52
69
  publicUrl: string;
53
70
  }>;
@@ -58,6 +75,20 @@ declare class BackendClient$1 {
58
75
  }, signal?: AbortSignal): Promise<void>;
59
76
  /** Durable run-history record — POST /api/canvas/runs (idempotent server-side on runId). */
60
77
  recordRun(payload: unknown, signal?: AbortSignal): Promise<void>;
78
+ /**
79
+ * Resumable-run lookup — GET /api/canvas/runs/active. Returns the newest
80
+ * still-running/interrupted run for the creative (pinned to the exact canvas
81
+ * sha), so a fresh sandbox can adopt its run id and re-attach billed
82
+ * in-flight jobs. Null on no active run — or an older backend without the
83
+ * route (both 404).
84
+ */
85
+ getActiveRun(creativeSlug: string, canvasSha?: string, signal?: AbortSignal): Promise<ActiveRunInfo | null>;
86
+ /**
87
+ * Portable-rerun lookup — GET /api/canvas/runs/latest. The newest run for
88
+ * the creative that recorded a canvas snapshot manifest; null when none
89
+ * exists (or the backend predates the route — both 404).
90
+ */
91
+ getLatestSnapshotRun(creativeSlug: string, signal?: AbortSignal): Promise<SnapshotRunInfo | null>;
61
92
  /**
62
93
  * Chat-scoped blueprint sync — POST /api/creatives/definition. Lets the
63
94
  * dashboard draw a scaffolded creative's workflow graph BEFORE the first run.
@@ -95,6 +126,11 @@ declare const CanvasSchema: z.ZodObject<{
95
126
  todo: z.ZodOptional<z.ZodUnknown>;
96
127
  video: z.ZodOptional<z.ZodObject<{
97
128
  duration_s: z.ZodNumber;
129
+ timeline: z.ZodOptional<z.ZodObject<{
130
+ spine_node: z.ZodString;
131
+ expected_total_s: z.ZodNumber;
132
+ audio_mix_node: z.ZodOptional<z.ZodString>;
133
+ }, z.core.$strict>>;
98
134
  vo_segments: z.ZodDefault<z.ZodArray<z.ZodObject<{
99
135
  slot: z.ZodString;
100
136
  start_s: z.ZodNumber;
@@ -337,6 +373,12 @@ type NodeDefinition<I = unknown, P = unknown, O = unknown> = {
337
373
  outputs: z.ZodType<O>;
338
374
  /** "local" runs in-process; "remote" delegates to Convex via ctx.client */
339
375
  location: "local" | "remote";
376
+ /**
377
+ * Local node that only forwards asset refs and never reads their bytes
378
+ * (e.g. `collect`). Exempts its upstream producers from the forced R2→disk
379
+ * download local consumers otherwise trigger.
380
+ */
381
+ passthroughRefs?: true;
340
382
  cost?: CostFn<P>;
341
383
  validateExtra?: ValidateExtraFn;
342
384
  cacheKeyExtras?: CacheKeyExtrasFn;
@@ -403,8 +445,16 @@ type RunOptions = {
403
445
  signal?: AbortSignal;
404
446
  run_id?: string;
405
447
  cache_policy?: "read_write" | "bypass" | "read_only";
406
- /** Max nodes of one layer in flight at once; invalid or missing → 5. */
448
+ /** Max nodes of one layer in flight at once; invalid or missing → 8 (DEFAULT_CONCURRENCY). */
407
449
  concurrency?: number;
450
+ /**
451
+ * Credit ceiling (`--max-credits`). Enforced pre-flight against the deep
452
+ * validator's estimate (nothing billed) and at layer boundaries against
453
+ * actual spend — a boundary is the only point with no async job in flight,
454
+ * so aborting there strands nothing. Cached nodes cost 0, so a capped run
455
+ * retried with a higher cap loses no completed work.
456
+ */
457
+ max_credits?: number;
408
458
  /**
409
459
  * Node ids to force fresh for THIS run only (the `--regenerate` flag). Folds
410
460
  * the run id into each named node's cache key so it re-renders regardless of
@@ -1,5 +1,5 @@
1
1
  import {
2
- BackendClient,
2
+ BackendClient2 as BackendClient,
3
3
  Engine,
4
4
  LocalAssetStore,
5
5
  LocalCacheStore,
@@ -8,7 +8,7 @@ import {
8
8
  defaultRegistry,
9
9
  generateCatalog,
10
10
  validateCanvasDeep
11
- } from "../chunk-43KBQLP5.js";
11
+ } from "../chunk-J2LYFDVC.js";
12
12
  import "../chunk-5WRI5ZAA.js";
13
13
  export {
14
14
  BackendClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koda-sl/baker-cli",
3
- "version": "0.128.0-dev.70bf43ce4",
3
+ "version": "0.129.1-dev.972f3c9aa",
4
4
  "description": "AI-agent-first CLI for interacting with Baker, including the Baker creative canvas.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,7 +15,9 @@
15
15
  },
16
16
  "files": [
17
17
  "dist",
18
- "canvas"
18
+ "canvas",
19
+ "!canvas/.cache",
20
+ "!canvas/r_*"
19
21
  ],
20
22
  "scripts": {
21
23
  "build": "tsup",