@koda-sl/baker-cli 0.123.0-dev.8e4328629 → 0.123.0-dev.b74ab562
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 +76 -71
- package/dist/{chunk-43KBQLP5.js → chunk-MWFJ5NOP.js} +104 -476
- package/dist/chunk-MWFJ5NOP.js.map +1 -0
- package/dist/cli.js +2169 -2387
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.d.ts +0 -91
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-43KBQLP5.js.map +0 -1
package/dist/engine/index.d.ts
CHANGED
|
@@ -15,10 +15,6 @@ type ExecRequest = {
|
|
|
15
15
|
/** Run-scoped dedupe key: the backend replays the stored response for a
|
|
16
16
|
* repeated key instead of re-dispatching to the provider (and re-charging). */
|
|
17
17
|
idempotency_key?: string;
|
|
18
|
-
/** Run + node identity, so a completed async job can be mapped back to its
|
|
19
|
-
* frozen run's node by the backend stale-run reconciliation sweep. */
|
|
20
|
-
canvas_run_id?: string;
|
|
21
|
-
node_id?: string;
|
|
22
18
|
};
|
|
23
19
|
type ExecResponse = {
|
|
24
20
|
outputs: Record<string, RawAssetOutput | RawAssetOutput[] | unknown>;
|
|
@@ -51,19 +47,6 @@ declare class BackendClient$1 {
|
|
|
51
47
|
putUrl: string;
|
|
52
48
|
publicUrl: string;
|
|
53
49
|
}>;
|
|
54
|
-
/** Remote cache lookup. A miss (404) — or an old backend without the route — returns null. */
|
|
55
|
-
getCacheEntry<T>(cacheKey: string, signal?: AbortSignal): Promise<T | null>;
|
|
56
|
-
putCacheEntry(entry: {
|
|
57
|
-
cacheKey: string;
|
|
58
|
-
}, signal?: AbortSignal): Promise<void>;
|
|
59
|
-
/** Durable run-history record — POST /api/canvas/runs (idempotent server-side on runId). */
|
|
60
|
-
recordRun(payload: unknown, signal?: AbortSignal): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Chat-scoped blueprint sync — POST /api/creatives/definition. Lets the
|
|
63
|
-
* dashboard draw a scaffolded creative's workflow graph BEFORE the first run.
|
|
64
|
-
* Additive on the backend (never archives siblings, never sets definitionPath).
|
|
65
|
-
*/
|
|
66
|
-
syncCreativeDefinition(payload: unknown, signal?: AbortSignal): Promise<void>;
|
|
67
50
|
getArtifact(kind: string, name: string, version?: string, signal?: AbortSignal): Promise<ArtifactResponse>;
|
|
68
51
|
}
|
|
69
52
|
|
|
@@ -137,7 +120,6 @@ declare const CanvasSchema: z.ZodObject<{
|
|
|
137
120
|
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
138
121
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
139
122
|
when: z.ZodOptional<z.ZodUnknown>;
|
|
140
|
-
regenerate: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
141
123
|
}, z.core.$strict>>;
|
|
142
124
|
output: z.ZodOptional<z.ZodObject<{
|
|
143
125
|
node: z.ZodString;
|
|
@@ -267,14 +249,6 @@ type ExecCtx = {
|
|
|
267
249
|
/** Content-addressed cache key for this node execution. Remote delegation
|
|
268
250
|
* derives its idempotency key from it so backend retries never double-charge. */
|
|
269
251
|
cacheKey?: string;
|
|
270
|
-
/**
|
|
271
|
-
* Whether this node's outputs must be downloaded to the local content store.
|
|
272
|
-
* False when NO downstream consumer is a local (ffmpeg/magick) node — the
|
|
273
|
-
* backend already persisted the bytes to R2 with a durable sha256 URL, so the
|
|
274
|
-
* redundant R2→sandbox transfer is skipped and the ref is kept URL-only.
|
|
275
|
-
* Absent/true means download (the safe default for older call sites).
|
|
276
|
-
*/
|
|
277
|
-
downloadOutputs?: boolean;
|
|
278
252
|
client: BackendClient$1;
|
|
279
253
|
assets: AssetStore;
|
|
280
254
|
log: LogFn;
|
|
@@ -365,39 +339,6 @@ type RunResult = {
|
|
|
365
339
|
duration_ms: number;
|
|
366
340
|
};
|
|
367
341
|
outputs_dir: string;
|
|
368
|
-
node_runs: NodeRunRecord[];
|
|
369
|
-
};
|
|
370
|
-
type NodeRunRecord = {
|
|
371
|
-
node_id: string;
|
|
372
|
-
node_type: string;
|
|
373
|
-
cached: boolean;
|
|
374
|
-
duration_ms: number;
|
|
375
|
-
credits: number;
|
|
376
|
-
};
|
|
377
|
-
/**
|
|
378
|
-
* Live run telemetry: the plan (post-prune node list + dependency edges) fires
|
|
379
|
-
* once before any node executes, then start/settled/failed per node. Consumers
|
|
380
|
-
* stream these into run-history progress snapshots; a throwing consumer is
|
|
381
|
-
* swallowed — telemetry must never fail a paid run.
|
|
382
|
-
*/
|
|
383
|
-
type RunProgressEvent = {
|
|
384
|
-
kind: "plan";
|
|
385
|
-
nodes: Array<{
|
|
386
|
-
node_id: string;
|
|
387
|
-
node_type: string;
|
|
388
|
-
deps: string[];
|
|
389
|
-
params: unknown;
|
|
390
|
-
}>;
|
|
391
|
-
} | {
|
|
392
|
-
kind: "node_start";
|
|
393
|
-
node_id: string;
|
|
394
|
-
} | {
|
|
395
|
-
kind: "node_settled";
|
|
396
|
-
run: NodeRunRecord;
|
|
397
|
-
outputs: Record<string, unknown>;
|
|
398
|
-
} | {
|
|
399
|
-
kind: "node_failed";
|
|
400
|
-
node_id: string;
|
|
401
342
|
};
|
|
402
343
|
type RunOptions = {
|
|
403
344
|
signal?: AbortSignal;
|
|
@@ -405,14 +346,6 @@ type RunOptions = {
|
|
|
405
346
|
cache_policy?: "read_write" | "bypass" | "read_only";
|
|
406
347
|
/** Max nodes of one layer in flight at once; invalid or missing → 5. */
|
|
407
348
|
concurrency?: number;
|
|
408
|
-
/**
|
|
409
|
-
* Node ids to force fresh for THIS run only (the `--regenerate` flag). Folds
|
|
410
|
-
* the run id into each named node's cache key so it re-renders regardless of
|
|
411
|
-
* the content cache, without editing the canvas. Persistent regeneration uses
|
|
412
|
-
* the per-node `regenerate` field instead.
|
|
413
|
-
*/
|
|
414
|
-
regenerate?: ReadonlySet<string>;
|
|
415
|
-
onProgress?: (event: RunProgressEvent) => void;
|
|
416
349
|
};
|
|
417
350
|
type EngineOptions = {
|
|
418
351
|
registry: NodeRegistry;
|
|
@@ -421,13 +354,6 @@ type EngineOptions = {
|
|
|
421
354
|
cache: CacheStore;
|
|
422
355
|
outputsDir: string;
|
|
423
356
|
log?: LogFn;
|
|
424
|
-
/**
|
|
425
|
-
* Stamp durable canvas-assets URLs onto fresh node outputs before they are
|
|
426
|
-
* cached — the precondition for remote cache portability and run-history
|
|
427
|
-
* records. Best-effort: a failed upload logs a warning and keeps the entry
|
|
428
|
-
* local-only, never fails the node.
|
|
429
|
-
*/
|
|
430
|
-
persistAssets?: boolean;
|
|
431
357
|
};
|
|
432
358
|
declare class Engine$1 {
|
|
433
359
|
private readonly registry;
|
|
@@ -436,7 +362,6 @@ declare class Engine$1 {
|
|
|
436
362
|
private readonly cache;
|
|
437
363
|
private readonly outputsDir;
|
|
438
364
|
private readonly log;
|
|
439
|
-
private readonly persistAssets;
|
|
440
365
|
constructor(opts: EngineOptions);
|
|
441
366
|
validate(canvas: unknown): {
|
|
442
367
|
ok: true;
|
|
@@ -465,8 +390,6 @@ declare class Engine$1 {
|
|
|
465
390
|
}>;
|
|
466
391
|
run(input: unknown, opts?: RunOptions): Promise<RunResult>;
|
|
467
392
|
private runLayers;
|
|
468
|
-
/** Progress consumers are observers only — an exception there must never fail the run. */
|
|
469
|
-
private emitProgress;
|
|
470
393
|
/**
|
|
471
394
|
* Dead-node elimination: when the canvas declares an `output`, execute only the
|
|
472
395
|
* nodes that output transitively depends on. Orphaned nodes (left by an edit or
|
|
@@ -477,13 +400,6 @@ declare class Engine$1 {
|
|
|
477
400
|
private writeFinal;
|
|
478
401
|
private executeOne;
|
|
479
402
|
private materializeNodeOutputs;
|
|
480
|
-
/**
|
|
481
|
-
* Download any URL-only asset ref reachable in a local node's inputs so the
|
|
482
|
-
* bytes are on disk before the local runner stages them. Returns a copy —
|
|
483
|
-
* refs are replaced, never mutated in place, so the producer's cached output
|
|
484
|
-
* (shared object) keeps its URL-only shape.
|
|
485
|
-
*/
|
|
486
|
-
private materializeLocalInputs;
|
|
487
403
|
}
|
|
488
404
|
|
|
489
405
|
type ValidationResult = {
|
|
@@ -551,13 +467,6 @@ declare function createEngineFromEnv(opts?: {
|
|
|
551
467
|
cacheDir?: string;
|
|
552
468
|
outputsDir?: string;
|
|
553
469
|
log?: (line: string) => void;
|
|
554
|
-
/**
|
|
555
|
-
* Layer the company-scoped remote cache over the local one (and stamp
|
|
556
|
-
* durable asset URLs onto fresh outputs) so a fresh sandbox re-runs an
|
|
557
|
-
* already-computed canvas at zero credits. Defaults to on; disable with
|
|
558
|
-
* `remoteCache: false` or env BAKER_CANVAS_REMOTE_CACHE=off.
|
|
559
|
-
*/
|
|
560
|
-
remoteCache?: boolean;
|
|
561
470
|
}): Engine$1;
|
|
562
471
|
|
|
563
472
|
export { BackendClient, Engine, LocalAssetStore, LocalCacheStore, ValidationError, createEngineFromEnv, defaultRegistry, generateCatalog, validateCanvasDeep };
|
package/dist/engine/index.js
CHANGED
package/package.json
CHANGED