pixelkiln 0.34.1 → 0.36.0
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/CONTRIBUTING.md +12 -0
- package/README.md +9 -9
- package/dist/cli.d.ts +0 -103
- package/dist/cli.js +12213 -14427
- package/dist/cli.js.map +1 -1
- package/dist/client/gallery.css +322 -0
- package/dist/client/gallery.js +2118 -0
- package/dist/index.cjs +5242 -7486
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +251 -131
- package/dist/index.d.ts +251 -131
- package/dist/index.js +4847 -7104
- package/dist/index.js.map +1 -1
- package/docs/CLI.md +49 -0
- package/docs/LIBRARY.md +77 -28
- package/package.json +4 -2
package/CONTRIBUTING.md
CHANGED
|
@@ -19,8 +19,15 @@ npm run test:security
|
|
|
19
19
|
npm test
|
|
20
20
|
npm run build
|
|
21
21
|
npm run test:package
|
|
22
|
+
npm run test:gallery
|
|
22
23
|
```
|
|
23
24
|
|
|
25
|
+
`test:gallery` serves a gallery over `FakeProvider` and drives it in headless
|
|
26
|
+
Chrome: the Generate and Regenerate buttons, the busy badge while a job runs,
|
|
27
|
+
the previous generation kept and restored for free, and zero console errors.
|
|
28
|
+
It needs a Chrome or Chromium binary (`CHROME=/path/to/chrome` when it is not
|
|
29
|
+
in a usual place) and skips without one outside CI.
|
|
30
|
+
|
|
24
31
|
The Next.js marketing/documentation site is isolated in `website/`:
|
|
25
32
|
|
|
26
33
|
```bash
|
|
@@ -97,6 +104,11 @@ wire contracts.
|
|
|
97
104
|
especially dangerous when a command can spend provider quota.
|
|
98
105
|
- Never overwrite a generated file whose current bytes differ from its recorded
|
|
99
106
|
hash, and never make deletion an implicit side effect of recovery/triage.
|
|
107
|
+
- The CLI is a thin layer. `src/cli.ts` is the bin entry, `src/cli/main.ts`
|
|
108
|
+
maps command names to modules under `src/cli/commands/`, `src/cli/args.ts`
|
|
109
|
+
parses flags, and `src/cli/project.ts` opens a project the way every
|
|
110
|
+
command needs it. A command module should read and print; anything it
|
|
111
|
+
computes belongs in `src/pipeline/` where the library exports it.
|
|
100
112
|
|
|
101
113
|
## Pull requests
|
|
102
114
|
|
package/README.md
CHANGED
|
@@ -337,18 +337,18 @@ artifacts agree rather than regenerate them. See
|
|
|
337
337
|
## TypeScript library
|
|
338
338
|
|
|
339
339
|
```ts
|
|
340
|
-
import {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
resolveSpecs,
|
|
345
|
-
} from "pixelkiln"
|
|
346
|
-
const loaded = await loadManifest("pixelkiln.manifest.json")
|
|
347
|
-
const specs = await resolveSpecs(loaded)
|
|
348
|
-
const plan = await buildPlan(specs, await loadLock("pixelkiln.lock.json"))
|
|
340
|
+
import { openProject } from "pixelkiln"
|
|
341
|
+
|
|
342
|
+
const project = await openProject("pixelkiln.manifest.json")
|
|
343
|
+
const plan = await project.plan()
|
|
349
344
|
console.log(plan.groups, plan.actionable.length)
|
|
350
345
|
```
|
|
351
346
|
|
|
347
|
+
`openProject` reads the env files beside the manifest, loads it, resolves
|
|
348
|
+
every spec, and loads the lockfile with its paths canonicalised for this
|
|
349
|
+
checkout. `project.specs`, `project.lock`, and `project.lockPath` are what the
|
|
350
|
+
lower-level `submit`, `poll`, and `fetchAssets` calls take.
|
|
351
|
+
|
|
352
352
|
The package also exports audit and image-regression gates, quality-profile
|
|
353
353
|
inspection and refinement, revision-readiness checks, lock/output helpers, the
|
|
354
354
|
gallery snapshot and server, hand edits and the editor install, provider contracts,
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,104 +1 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
declare const GridConfidenceSchema: z.ZodEnum<["low", "medium", "high"]>;
|
|
5
|
-
type GridConfidence = z.infer<typeof GridConfidenceSchema>;
|
|
6
|
-
|
|
7
|
-
interface ReviewReadyInfo {
|
|
8
|
-
url: string;
|
|
9
|
-
keys: string[];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
type TilesetFormat = "generic" | "tiled" | "godot";
|
|
13
|
-
|
|
14
|
-
interface CliWritable {
|
|
15
|
-
isTTY?: boolean;
|
|
16
|
-
write(chunk: string): unknown;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Interactive readiness is progress, not command output. Keep it on stdout in
|
|
20
|
-
* a terminal, but use stderr when stdout is piped so consumers such as `tail`
|
|
21
|
-
* cannot hold the only copy of the live URL until the server exits.
|
|
22
|
-
*/
|
|
23
|
-
declare function announceReviewReady(info: ReviewReadyInfo, stdout?: CliWritable, stderr?: CliWritable): void;
|
|
24
|
-
/** Same stream rule as review readiness: the live URL must not wait behind a pipe. */
|
|
25
|
-
declare function announceGalleryReady(url: string, count: number, stdout?: CliWritable, stderr?: CliWritable, edit?: boolean, budget?: string | null): void;
|
|
26
|
-
interface Args {
|
|
27
|
-
command: string;
|
|
28
|
-
manifest: string;
|
|
29
|
-
lock: string;
|
|
30
|
-
styles: string[];
|
|
31
|
-
assets: string[];
|
|
32
|
-
force: boolean;
|
|
33
|
-
yes: boolean;
|
|
34
|
-
budget?: number;
|
|
35
|
-
/** Repeatable provider-keyed budgets used by a mixed-provider run. */
|
|
36
|
-
providerBudgets: Record<string, number>;
|
|
37
|
-
dryRun: boolean;
|
|
38
|
-
all: boolean;
|
|
39
|
-
json: boolean;
|
|
40
|
-
check: boolean;
|
|
41
|
-
noOpen: boolean;
|
|
42
|
-
tag: boolean;
|
|
43
|
-
/** gallery: allow the page to edit manifest intent (prompts, sizes, tags, new assets). */
|
|
44
|
-
edit: boolean;
|
|
45
|
-
/** gallery: do not offer the in-browser editor even with --edit. */
|
|
46
|
-
noEditor: boolean;
|
|
47
|
-
/** fetch: re-download downloaded outputs and replace files whose object changed upstream. */
|
|
48
|
-
refresh: boolean;
|
|
49
|
-
from?: string;
|
|
50
|
-
out?: string;
|
|
51
|
-
generator?: string;
|
|
52
|
-
exclude: string[];
|
|
53
|
-
name?: string;
|
|
54
|
-
writePrompts: boolean;
|
|
55
|
-
columns?: number;
|
|
56
|
-
port?: number;
|
|
57
|
-
inputs?: string;
|
|
58
|
-
claims: string[];
|
|
59
|
-
format?: TilesetFormat;
|
|
60
|
-
outputRoles: string[];
|
|
61
|
-
primaryOnly: boolean;
|
|
62
|
-
prune: boolean;
|
|
63
|
-
maxDistance?: number;
|
|
64
|
-
minTransparency?: number;
|
|
65
|
-
maxColors?: number;
|
|
66
|
-
sigma?: number;
|
|
67
|
-
palette: string[];
|
|
68
|
-
fixerPython?: string;
|
|
69
|
-
fixerRevision?: string;
|
|
70
|
-
minGridConfidence?: GridConfidence;
|
|
71
|
-
reviewer?: string;
|
|
72
|
-
note?: string;
|
|
73
|
-
/** ComfyUI `models` directory used for offline recipe model verification. */
|
|
74
|
-
modelRoot?: string;
|
|
75
|
-
/** restore: a previous generation to bring back — 1-based, newest first, or an output hash prefix. */
|
|
76
|
-
generation?: string;
|
|
77
|
-
/** Subcommand for `quality`, `recipe`, `refine`, or `workspace`. */
|
|
78
|
-
subcommand?: string;
|
|
79
|
-
/** Path to a workspace catalog. Defaults to `pixelkiln.workspace.json` in cwd. */
|
|
80
|
-
workspace?: string;
|
|
81
|
-
/** Positional target for recipe and workspace subcommands. */
|
|
82
|
-
target?: string;
|
|
83
|
-
/** Account provider selector; also the `workspace add` catalog provider hint. */
|
|
84
|
-
provider?: string;
|
|
85
|
-
/** `workspace add`: free-form account label, e.g. distinguishing sandboxes. */
|
|
86
|
-
account?: string;
|
|
87
|
-
/**
|
|
88
|
-
* Raw `--lock` value with no manifest-relative default applied. `workspace
|
|
89
|
-
* add` needs to know whether the user actually passed `--lock`, since the
|
|
90
|
-
* ambient default (beside `--manifest`, which usually names an unrelated
|
|
91
|
-
* project) is meaningless for the manifest being registered.
|
|
92
|
-
*/
|
|
93
|
-
explicitLock?: string;
|
|
94
|
-
}
|
|
95
|
-
declare const COMMANDS: readonly ["init", "plan", "doctor", "gen", "submit", "poll", "pick", "fetch", "restore", "adopt", "accept", "salvage", "purge", "prune", "audit", "cache", "pack", "mount", "export", "tag", "balance", "status", "gallery", "edit", "tools", "history", "quality", "refine", "recipe", "workspace", "help", "--help", "-h", "--version", "-v"];
|
|
96
|
-
/**
|
|
97
|
-
* Strict parsing. Unknown flags are a hard error rather than being ignored,
|
|
98
|
-
* because a silently-dropped filter is expensive here: `--styles neon` (plural,
|
|
99
|
-
* a typo) would otherwise fall through to "no filter" and generate the entire
|
|
100
|
-
* manifest instead of one style.
|
|
101
|
-
*/
|
|
102
|
-
declare function parseArgs(argv: string[]): Args;
|
|
103
|
-
|
|
104
|
-
export { COMMANDS, announceGalleryReady, announceReviewReady, parseArgs };
|