@koda-sl/baker-cli 0.404.0 → 0.406.0-dev.e84bc866b

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.
@@ -544,14 +544,6 @@ type RunOptions = {
544
544
  cache_policy?: "read_write" | "bypass" | "read_only";
545
545
  /** Max nodes of one layer in flight at once; invalid or missing → 8 (DEFAULT_CONCURRENCY). */
546
546
  concurrency?: number;
547
- /**
548
- * Credit ceiling (`--max-credits`). Enforced pre-flight against the deep
549
- * validator's estimate (nothing billed) and at layer boundaries against
550
- * actual spend — a boundary is the only point with no async job in flight,
551
- * so aborting there strands nothing. Cached nodes cost 0, so a capped run
552
- * retried with a higher cap loses no completed work.
553
- */
554
- max_credits?: number;
555
547
  /**
556
548
  * Node ids to force fresh for THIS run only (the `--regenerate` flag). Folds
557
549
  * the run id into each named node's cache key so it re-renders regardless of
@@ -567,11 +559,18 @@ type RunOptions = {
567
559
  * them. This is what lets someone see those first: the run settles everything cheap and
568
560
  * stops on the doorstep of the expensive half.
569
561
  *
570
- * Deliberately the same shape as the cost cap: it raises `RunAbortedError`, the completed
562
+ * It raises `RunAbortedError`, the completed
571
563
  * nodes are already cached, and continuing is re-running the same `--run-id`, which pays
572
564
  * for none of them twice.
573
565
  */
574
566
  stop_before_kinds?: ReadonlySet<string>;
567
+ /**
568
+ * Run only what is already paid for: before a layer dispatches, a billed node (one with a
569
+ * credit estimate) that would miss the cache stops the run, so nothing in that layer is
570
+ * billed. Raises `RunAbortedError("cache_only")`; the cached nodes before it stay done.
571
+ * A static ad whose pictures are spent re-draws its copy this way (render-budget.ts).
572
+ */
573
+ billed_from_cache_only?: boolean;
575
574
  onProgress?: (event: RunProgressEvent) => void;
576
575
  };
577
576
  type EngineOptions = {
@@ -632,6 +631,22 @@ declare class Engine$1 {
632
631
  private pruneToOutput;
633
632
  private writeFinal;
634
633
  private executeOne;
634
+ /**
635
+ * Every reason a layer must not dispatch, checked before any of its nodes starts, so a stop
636
+ * never leaves a layer half billed: a signal, the cost cap, a checkpoint, and a billed node
637
+ * the cache cannot serve when the run is cache-only.
638
+ */
639
+ private assertLayerMayRun;
640
+ /**
641
+ * The billed nodes of a layer that would miss the cache, found before any of them runs:
642
+ * each is prepared exactly as `executeOne` would (same inputs, params and cache key).
643
+ *
644
+ * `executeOne` prepares each node again when it runs, so a cache-only layer hydrates its
645
+ * text slots and hashes its `cacheKeyExtras` twice. Deliberate: a re-draw's layers are
646
+ * small, and threading this preparation into `executeOne` would couple the check to the
647
+ * run path, where a stale preparation would bill the wrong key.
648
+ */
649
+ private billedMisses;
635
650
  /** A cache hit replayed as this node's result: its outputs written, and free. */
636
651
  private replayCached;
637
652
  /** Best-effort: a failed upload keeps the outputs local-only, never fails the node. */
@@ -8,7 +8,7 @@ import {
8
8
  defaultRegistry,
9
9
  generateCatalog,
10
10
  validateCanvasDeep
11
- } from "../chunk-KE6GXLDE.js";
11
+ } from "../chunk-WTCR7RAD.js";
12
12
  import "../chunk-5X5LUMVV.js";
13
13
  import "../chunk-N72QYDJY.js";
14
14
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koda-sl/baker-cli",
3
- "version": "0.404.0",
3
+ "version": "0.406.0-dev.e84bc866b",
4
4
  "description": "AI-agent-first CLI for interacting with Baker, including the Baker creative canvas.",
5
5
  "type": "module",
6
6
  "bin": {