@koda-sl/baker-cli 0.405.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.
- package/README.md +0 -1
- package/dist/{chunk-DGZ5DLXK.js → chunk-WTCR7RAD.js} +12 -44
- package/dist/chunk-WTCR7RAD.js.map +1 -0
- package/dist/cli.js +170 -194
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.d.ts +1 -9
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-DGZ5DLXK.js.map +0 -1
package/README.md
CHANGED
|
@@ -5640,7 +5640,6 @@ A completed render the review calls ready (`verdict` `ready` or `ready_with_note
|
|
|
5640
5640
|
| `--cache-policy <policy>` | `read_write` | `read_write`, `bypass`, or `read_only`. |
|
|
5641
5641
|
| `--concurrency <n>` | `5` (or `BAKER_CANVAS_CONCURRENCY`) | Max nodes executing at once within a layer. |
|
|
5642
5642
|
| `--remote-cache <on\|off>` | `on` (or `BAKER_CANVAS_REMOTE_CACHE`) | Operator only. Company-scoped remote cache + durable asset persistence. |
|
|
5643
|
-
| `--max-credits <n>` | uncapped (or `BAKER_CANVAS_MAX_CREDITS`) | Credit ceiling: aborts before billing when the estimate exceeds it, and at layer boundaries once actual spend does. Completed nodes stay cached, so retrying with a higher cap loses nothing. |
|
|
5644
5643
|
| `--no-record` | records | Skip posting the durable run-history record (and its live progress). |
|
|
5645
5644
|
| `--until frames` | none | Stop before the clips with the frames settled; the run is recorded as `awaiting_approval` (not failed, not interrupted) and resumes with `--run-id`. |
|
|
5646
5645
|
| `--cache-dir <path>` | `<workspace root>/canvas/.cache` | Operator only. Where content-addressed bytes + cache index live. |
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
shouldEscalate
|
|
21
21
|
} from "./chunk-N72QYDJY.js";
|
|
22
22
|
|
|
23
|
-
//
|
|
23
|
+
// ../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/509a695c9237c6e3727f1f1f99169917f329e3ff3f7877be290b684e24bf153d/node_modules/safe-stable-stringify/index.js
|
|
24
24
|
var require_safe_stable_stringify = __commonJS({
|
|
25
|
-
"
|
|
25
|
+
"../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/509a695c9237c6e3727f1f1f99169917f329e3ff3f7877be290b684e24bf153d/node_modules/safe-stable-stringify/index.js"(exports, module) {
|
|
26
26
|
"use strict";
|
|
27
27
|
var { hasOwnProperty } = Object.prototype;
|
|
28
28
|
var stringify = configure2();
|
|
@@ -1144,7 +1144,7 @@ function resolveAdaptFormats(params) {
|
|
|
1144
1144
|
return params.formats ?? [];
|
|
1145
1145
|
}
|
|
1146
1146
|
|
|
1147
|
-
//
|
|
1147
|
+
// ../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/509a695c9237c6e3727f1f1f99169917f329e3ff3f7877be290b684e24bf153d/node_modules/safe-stable-stringify/esm/wrapper.js
|
|
1148
1148
|
var import__ = __toESM(require_safe_stable_stringify(), 1);
|
|
1149
1149
|
var configure = import__.default.configure;
|
|
1150
1150
|
var wrapper_default = import__.default;
|
|
@@ -3894,8 +3894,12 @@ function estimateNodeCredits2(def, params) {
|
|
|
3894
3894
|
if (!parsed.success) return 0;
|
|
3895
3895
|
return priceNode(def, parsed.data)?.credits ?? 0;
|
|
3896
3896
|
}
|
|
3897
|
-
function estimateCanvasCredits(canvas, registry
|
|
3898
|
-
return canvas.nodes.
|
|
3897
|
+
function estimateCanvasCredits(canvas, registry) {
|
|
3898
|
+
return canvas.nodes.map((n) => ({
|
|
3899
|
+
node_id: n.id,
|
|
3900
|
+
node_type: n.type,
|
|
3901
|
+
credits: estimateNodeCredits2(registry.get(n.type), n.params)
|
|
3902
|
+
}));
|
|
3899
3903
|
}
|
|
3900
3904
|
function sumCredits(perNode) {
|
|
3901
3905
|
return perNode.reduce((total, n) => total + n.credits, 0);
|
|
@@ -4270,16 +4274,6 @@ function dfsCycle(u, color, stack, reverseAdj) {
|
|
|
4270
4274
|
stack.pop();
|
|
4271
4275
|
return null;
|
|
4272
4276
|
}
|
|
4273
|
-
function nodesBeforeCheckpoint(graph, types, stopKinds) {
|
|
4274
|
-
const all = new Set(graph.keys());
|
|
4275
|
-
if (!stopKinds?.size) return all;
|
|
4276
|
-
const running = /* @__PURE__ */ new Set();
|
|
4277
|
-
for (const layer of topologicalLayers(graph)) {
|
|
4278
|
-
if (layer.some((id) => stopKinds.has(types.get(id) ?? ""))) return running;
|
|
4279
|
-
for (const id of layer) running.add(id);
|
|
4280
|
-
}
|
|
4281
|
-
return running;
|
|
4282
|
-
}
|
|
4283
4277
|
|
|
4284
4278
|
// src/engine/engine/validator.ts
|
|
4285
4279
|
import path5 from "path";
|
|
@@ -6153,12 +6147,6 @@ var Engine = class {
|
|
|
6153
6147
|
async run(input, opts = {}) {
|
|
6154
6148
|
const validation = await this.validateDeep(input);
|
|
6155
6149
|
if (!validation.ok) throw new ValidationError(validation.issues);
|
|
6156
|
-
if (!opts.stop_before_kinds?.size && opts.max_credits !== void 0 && validation.estimatedCredits > opts.max_credits) {
|
|
6157
|
-
throw new RunAbortedError(
|
|
6158
|
-
"cost_cap",
|
|
6159
|
-
`estimated ${validation.estimatedCredits} credits exceeds the ${opts.max_credits}-credit cap \u2014 nothing was billed; raise --max-credits or shrink the canvas`
|
|
6160
|
-
);
|
|
6161
|
-
}
|
|
6162
6150
|
const canvas = validation.canvas;
|
|
6163
6151
|
const runId = opts.run_id ?? `r_${ulid()}`;
|
|
6164
6152
|
const writer = new OutputWriter({ outputsDir: this.outputsDir, runId });
|
|
@@ -6172,20 +6160,6 @@ var Engine = class {
|
|
|
6172
6160
|
const counters = { cachedNodes: 0, totalCredits: 0 };
|
|
6173
6161
|
const nodeRuns = [];
|
|
6174
6162
|
const graph = this.pruneToOutput(canvas, buildDependencyGraph(canvas));
|
|
6175
|
-
if (opts.max_credits !== void 0 && opts.stop_before_kinds?.size) {
|
|
6176
|
-
const willRun = nodesBeforeCheckpoint(
|
|
6177
|
-
graph,
|
|
6178
|
-
new Map(canvas.nodes.map((n) => [n.id, n.type])),
|
|
6179
|
-
opts.stop_before_kinds
|
|
6180
|
-
);
|
|
6181
|
-
const estimate = sumCredits(estimateCanvasCredits(canvas, this.registry, willRun));
|
|
6182
|
-
if (estimate > opts.max_credits) {
|
|
6183
|
-
throw new RunAbortedError(
|
|
6184
|
-
"cost_cap",
|
|
6185
|
-
`estimated ${estimate} credits exceeds the ${opts.max_credits}-credit cap \u2014 nothing was billed; raise --max-credits or shrink the canvas`
|
|
6186
|
-
);
|
|
6187
|
-
}
|
|
6188
|
-
}
|
|
6189
6163
|
const needsBytes = computeNeedsLocalBytes(canvas, graph, this.registry);
|
|
6190
6164
|
this.emitProgress(opts, {
|
|
6191
6165
|
kind: "plan",
|
|
@@ -6223,7 +6197,7 @@ var Engine = class {
|
|
|
6223
6197
|
const layers = topologicalLayers(graph);
|
|
6224
6198
|
const limit = resolveConcurrency(opts.concurrency);
|
|
6225
6199
|
for (const layer of layers) {
|
|
6226
|
-
await this.assertLayerMayRun(canvas, layer, outputs, runId, opts
|
|
6200
|
+
await this.assertLayerMayRun(canvas, layer, outputs, runId, opts);
|
|
6227
6201
|
const settled = await mapWithConcurrency(layer, limit, (nodeId) => {
|
|
6228
6202
|
if (opts.signal?.aborted) {
|
|
6229
6203
|
return Promise.reject(new RunAbortedError("signal", "run aborted before node dispatch"));
|
|
@@ -6355,14 +6329,8 @@ var Engine = class {
|
|
|
6355
6329
|
* never leaves a layer half billed: a signal, the cost cap, a checkpoint, and a billed node
|
|
6356
6330
|
* the cache cannot serve when the run is cache-only.
|
|
6357
6331
|
*/
|
|
6358
|
-
async assertLayerMayRun(canvas, layer, outputs, runId, opts
|
|
6332
|
+
async assertLayerMayRun(canvas, layer, outputs, runId, opts) {
|
|
6359
6333
|
if (opts.signal?.aborted) throw new RunAbortedError("signal", "run aborted before layer dispatch");
|
|
6360
|
-
if (opts.max_credits !== void 0 && counters.totalCredits > opts.max_credits) {
|
|
6361
|
-
throw new RunAbortedError(
|
|
6362
|
-
"cost_cap",
|
|
6363
|
-
`spent ${counters.totalCredits} credits, over the ${opts.max_credits}-credit cap \u2014 completed nodes are cached; raise --max-credits to continue where this stopped`
|
|
6364
|
-
);
|
|
6365
|
-
}
|
|
6366
6334
|
const held = heldByCheckpoint(canvas, layer, opts.stop_before_kinds);
|
|
6367
6335
|
if (held.length > 0) {
|
|
6368
6336
|
throw new RunAbortedError(
|
|
@@ -11708,4 +11676,4 @@ export {
|
|
|
11708
11676
|
defaultRegistry,
|
|
11709
11677
|
createEngineFromEnv
|
|
11710
11678
|
};
|
|
11711
|
-
//# sourceMappingURL=chunk-
|
|
11679
|
+
//# sourceMappingURL=chunk-WTCR7RAD.js.map
|