@koda-sl/baker-cli 0.128.0-dev.70bf43ce4 → 0.131.0-dev.597b50181

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;
@@ -128,6 +164,16 @@ declare const CanvasSchema: z.ZodObject<{
128
164
  node: z.ZodString;
129
165
  span_s: z.ZodNumber;
130
166
  }, z.core.$strip>>>;
167
+ graph_stats: z.ZodOptional<z.ZodObject<{
168
+ nodes_total: z.ZodNumber;
169
+ nodes_billable: z.ZodNumber;
170
+ node_types: z.ZodRecord<z.ZodString, z.ZodNumber>;
171
+ scene_routes: z.ZodArray<z.ZodObject<{
172
+ scene: z.ZodNumber;
173
+ route: z.ZodString;
174
+ window_s: z.ZodNumber;
175
+ }, z.core.$strip>>;
176
+ }, z.core.$strict>>;
131
177
  }, z.core.$strict>>;
132
178
  }, z.core.$strict>>;
133
179
  nodes: z.ZodArray<z.ZodObject<{
@@ -337,6 +383,12 @@ type NodeDefinition<I = unknown, P = unknown, O = unknown> = {
337
383
  outputs: z.ZodType<O>;
338
384
  /** "local" runs in-process; "remote" delegates to Convex via ctx.client */
339
385
  location: "local" | "remote";
386
+ /**
387
+ * Local node that only forwards asset refs and never reads their bytes
388
+ * (e.g. `collect`). Exempts its upstream producers from the forced R2→disk
389
+ * download local consumers otherwise trigger.
390
+ */
391
+ passthroughRefs?: true;
340
392
  cost?: CostFn<P>;
341
393
  validateExtra?: ValidateExtraFn;
342
394
  cacheKeyExtras?: CacheKeyExtrasFn;
@@ -403,8 +455,16 @@ type RunOptions = {
403
455
  signal?: AbortSignal;
404
456
  run_id?: string;
405
457
  cache_policy?: "read_write" | "bypass" | "read_only";
406
- /** Max nodes of one layer in flight at once; invalid or missing → 5. */
458
+ /** Max nodes of one layer in flight at once; invalid or missing → 8 (DEFAULT_CONCURRENCY). */
407
459
  concurrency?: number;
460
+ /**
461
+ * Credit ceiling (`--max-credits`). Enforced pre-flight against the deep
462
+ * validator's estimate (nothing billed) and at layer boundaries against
463
+ * actual spend — a boundary is the only point with no async job in flight,
464
+ * so aborting there strands nothing. Cached nodes cost 0, so a capped run
465
+ * retried with a higher cap loses no completed work.
466
+ */
467
+ max_credits?: number;
408
468
  /**
409
469
  * Node ids to force fresh for THIS run only (the `--regenerate` flag). Folds
410
470
  * 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-4QK7JC6O.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.131.0-dev.597b50181",
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",