@koda-sl/baker-cli 0.124.0-dev.8e4328629 → 0.124.0-dev.efe965ce2

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.
@@ -411,6 +442,14 @@ type RunOptions = {
411
442
  cache_policy?: "read_write" | "bypass" | "read_only";
412
443
  /** Max nodes of one layer in flight at once; invalid or missing → 5. */
413
444
  concurrency?: number;
445
+ /**
446
+ * Credit ceiling (`--max-credits`). Enforced pre-flight against the deep
447
+ * validator's estimate (nothing billed) and at layer boundaries against
448
+ * actual spend — a boundary is the only point with no async job in flight,
449
+ * so aborting there strands nothing. Cached nodes cost 0, so a capped run
450
+ * retried with a higher cap loses no completed work.
451
+ */
452
+ max_credits?: number;
414
453
  /**
415
454
  * Node ids to force fresh for THIS run only (the `--regenerate` flag). Folds
416
455
  * 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-Q3K5TXC6.js";
11
+ } from "../chunk-TKL2CJ6G.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.124.0-dev.8e4328629",
3
+ "version": "0.124.0-dev.efe965ce2",
4
4
  "description": "AI-agent-first CLI for interacting with Baker, including the Baker creative canvas.",
5
5
  "type": "module",
6
6
  "bin": {