rtistree 0.5.1 → 0.6.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/CHANGELOG.md +14 -0
- package/CONTRIBUTING.md +47 -0
- package/README.md +14 -5
- package/SECURITY.md +20 -0
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/cli.js +17 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands.d.ts +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +18 -2
- package/dist/mcp.js.map +1 -1
- package/dist/print-scene.d.ts +6 -0
- package/dist/program.js +3 -1
- package/dist/program.js.map +1 -1
- package/dist/project-config.js +2 -1
- package/dist/project-config.js.map +1 -1
- package/dist/render.js +21 -1
- package/dist/render.js.map +1 -1
- package/dist/schema.d.ts +46 -0
- package/dist/schema.js +107 -0
- package/dist/schema.js.map +1 -1
- package/dist/sprites.d.ts +31 -0
- package/dist/sprites.js +142 -0
- package/dist/sprites.js.map +1 -0
- package/dist/studio-reference.js +1 -1
- package/dist/studio-reference.js.map +1 -1
- package/docs/agent-art-workflow.md +10 -0
- package/docs/agent-setup.md +8 -3
- package/docs/atelier.md +12 -1
- package/docs/cli-reference.md +76 -25
- package/docs/core-concepts.md +95 -0
- package/docs/decisions/004-print-production-and-projects.md +1 -1
- package/docs/decisions/005-programmable-digital-art.md +1 -1
- package/docs/engine-overview.md +121 -165
- package/docs/evolution.md +12 -9
- package/docs/getting-started.md +15 -8
- package/docs/next-milestone.md +4 -4
- package/docs/production.md +22 -16
- package/docs/releasing.md +99 -43
- package/docs/scene-format.md +44 -7
- package/docs/sprites.md +166 -0
- package/docs/studio.md +25 -10
- package/examples/hello/README.md +4 -0
- package/package.json +8 -5
- package/schemas/authoring.schema.json +359 -229
- package/schemas/command.schema.json +462 -332
- package/schemas/patch.schema.json +462 -332
- package/schemas/scene.schema.json +347 -217
- package/schemas/sprites.schema.json +41 -0
package/docs/engine-overview.md
CHANGED
|
@@ -1,174 +1,130 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
width: 1024
|
|
64
|
-
height: 1024
|
|
65
|
-
background: '#102c31'
|
|
66
|
-
include:
|
|
67
|
-
- layers/background.yaml
|
|
68
|
-
- layers/product.yaml
|
|
69
|
-
- layers/typography.yaml
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Each fragment contains `layers`, optional `assets`, and optional nested `include` paths. Paths resolve relative to the declaring file and must stay inside the project. Layer and asset IDs share a project namespace. Included layers compose in declaration order, followed by local layers; sibling `z` values determine paint order. Groups preserve hierarchy.
|
|
73
|
-
|
|
74
|
-
The [poster example](../examples/poster/scene.yaml) uses this format. [Scene format documentation](scene-format.md) describes coordinates, layout, operations, and validation.
|
|
1
|
+
# Engine overview
|
|
2
|
+
|
|
3
|
+
Rtistree is a local TypeScript/Node.js graphics engine with a CLI, SDK and stdio MCP
|
|
4
|
+
server. Native CPU Skia renders the scene; Sharp and PDFKit handle artwork exports.
|
|
5
|
+
The renderer needs no browser, GPU, model API key or external service. An agent host
|
|
6
|
+
supplies its own model, image inspection and visual judgment.
|
|
7
|
+
|
|
8
|
+
Start with [getting started](getting-started.md) for an installed npm package.
|
|
9
|
+
The commands in the development section below require a repository checkout.
|
|
10
|
+
|
|
11
|
+
## Scene and authoring model
|
|
12
|
+
|
|
13
|
+
JSON/YAML source scenes can include fragments and parameterized components. The loader
|
|
14
|
+
expands them into one validated layer tree. Layers support groups, paths, text,
|
|
15
|
+
local image assets, procedural fills, layouts, transforms, masks and adjustments.
|
|
16
|
+
Raster operations, sparse palette tiles and promoted regions add focused pixel edits.
|
|
17
|
+
See [scene format](scene-format.md) and [editing workflows](evolution.md).
|
|
18
|
+
|
|
19
|
+
Pixel-art scenes can opt into explicit integer, palette and nearest-neighbour
|
|
20
|
+
guardrails. Sprite manifests describe frame rectangles, pivots, durations, tags and
|
|
21
|
+
animation ordering; the sprite exporter packs them into a deterministic atlas without
|
|
22
|
+
making Rtistree responsible for a game engine's runtime. See [pixel art, sprites and
|
|
23
|
+
spritesheets](sprites.md).
|
|
24
|
+
|
|
25
|
+
Layer IDs are unique throughout the tree. Assets, fonts and components each have their
|
|
26
|
+
own ID map; they do not share the layer-ID namespace. Relative include and asset paths
|
|
27
|
+
resolve from the declaring source file and must remain inside the root scene directory.
|
|
28
|
+
|
|
29
|
+
For painting, trusted JavaScript programs use Canvas, seeded brushes, fields and pixels.
|
|
30
|
+
Programs bake to ordinary image assets and pin source, parameters and inputs in recipes.
|
|
31
|
+
[Explicit pipelines](atelier.md) rebuild changed dependencies with caching. Rendering and
|
|
32
|
+
opening a scene do not execute those programs. The VM is not a security sandbox.
|
|
33
|
+
|
|
34
|
+
Physical document dimensions and print sampling resolution are separate from design pixels.
|
|
35
|
+
[Print production](production.md) covers PNG/JPEG/TIFF/PDF/SVG exports, profiles,
|
|
36
|
+
physical page boxes, preflight and soft proofs. The working renderer is 8-bit sRGB;
|
|
37
|
+
PDF/X certification, spot colours and overprint are not implemented.
|
|
38
|
+
|
|
39
|
+
## Editing and persistence
|
|
40
|
+
|
|
41
|
+
`Project.open(path)` accepts a scene file, `rtistree.yaml` or a configured project directory.
|
|
42
|
+
`project.scene()` returns the current resolved state. `project.render()` returns PNG bytes,
|
|
43
|
+
pixels and evidence; `project.inspect()` and `project.inspectLayer(id)` return structure.
|
|
44
|
+
`project.apply({reason, expected_hash, commands})` validates and commits a typed transaction.
|
|
45
|
+
The SDK exports `Project`, `SkiaRenderer`, schemas, command helpers, render/verification
|
|
46
|
+
functions, `runProgram`, `buildPipeline`, `exportSpriteSheet`, `production` and the
|
|
47
|
+
art-direction guide.
|
|
48
|
+
|
|
49
|
+
Authoring files remain the baseline. Mutations append to
|
|
50
|
+
`history/<scene-filename>.operations.jsonl`; journal records include state snapshots,
|
|
51
|
+
commands, hashes, timestamps and measured locality. Failed transactions leave the working
|
|
52
|
+
scene unchanged. Scoped raster edits compare the final composite before and after and
|
|
53
|
+
reject pixels changed outside the allowed area. Structural edits have no general locality promise.
|
|
54
|
+
|
|
55
|
+
Undo and redo append records. After manual source changes, `rebase` merges disjoint edits
|
|
56
|
+
against the retained baseline and reports conflicts without committing. `compact` compresses
|
|
57
|
+
journal records while retaining undo/redo; replay still reads the full history. Remove a stale
|
|
58
|
+
lock only after confirming its recorded writer is no longer active.
|
|
59
|
+
|
|
60
|
+
Portable export creates a new baseline with referenced assets, custom fonts, recipes and
|
|
61
|
+
configured print profiles. It preserves the current artwork and inline pipeline graph,
|
|
62
|
+
but does not copy edit history, critiques or production-session reviews and candidates.
|
|
75
63
|
|
|
76
64
|
## Agent interface
|
|
77
65
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
A failed batch leaves the scene unchanged. A project lock prevents concurrent writers; an expected scene hash handles stale agents. Incomplete or altered journal records are rejected. If a writer crashes, inspect the PID in the `.lock` file before removing the stale lock. After manual source edits, run `graphics rebase scene.yaml` to merge nonconflicting changes into the working state. Conflicts report exact paths without committing. `graphics compact scene.yaml` compresses history while retaining every undo/redo state. New histories retain their source baseline; legacy histories require restoring/exporting the original source before rebasing. Changed raster asset bytes are also rejected after history exists.
|
|
126
|
-
|
|
127
|
-
Exports copy raster assets and custom fonts into content-addressed files and pin their hashes. Every PNG has a `.evidence.json` sidecar recording renderer/backend/runtime versions, scene hash, asset hashes, bundled font hashes, dimensions, quality, and PNG hash. Byte identity is tested on the same pinned runtime and platform. Cross-platform Skia byte identity is **not** promised.
|
|
128
|
-
|
|
129
|
-
## Implemented scope
|
|
130
|
-
|
|
131
|
-
- JSON/YAML scenes and recursive multi-file composition; strict validation and JSON Schema generation.
|
|
132
|
-
- Groups, semantic roles, shapes and SVG-style paths, text wrapping, local PNG/JPEG/WebP assets, gradients, seeded noise, transforms, row/column layouts, anchors, percentages, opacity, and nine blend modes.
|
|
133
|
-
- Rectangle, ellipse, polygon and semantic-alpha masks; feathering, layer blur, and adjustment layers.
|
|
134
|
-
- Scoped fill, paint/erase strokes, blur, brightness, contrast, saturation, hue shifts, noise, colour replacement, direct pixels, and palette tiles. Binary rasters remain external assets.
|
|
135
|
-
- Exact region crops, structural/color inspection, append-only transactions, undo/redo, self-contained export, CLI, and MCP.
|
|
136
|
-
- Text overflow, declared contrast, safe-area, overlap, copy/role and region-luma rules, issue heatmaps, measured edit locality, and bounded agent iterations.
|
|
137
|
-
|
|
138
|
-
The remaining extensions are automatic quadtree subdivision, a general dirty-tile compositor, advanced SVG import, mesh warp/smudge, general segmentation, provider-specific model integrations, learned asset generation, and animation. Draft still downsamples after rendering. Safe pointwise region scenes use smaller viewport surfaces; antialias-sensitive scenes fall back to a full composite and exact crop.
|
|
139
|
-
|
|
140
|
-
## Next-stage examples and agent trials
|
|
141
|
-
|
|
142
|
-
See [the new API and workflows](evolution.md) and [ADR 003](decisions/003-editing-refinement-and-agent-validation.md). New features include mutable effects/operations, object-relative paint, promoted patches at 1–4× resolution, layer caching, rendered contrast/visibility rules, hash-bound visual critiques, component instances, custom fonts, source rebasing and compressed history.
|
|
143
|
-
|
|
144
|
-
Three interactive trials are recorded in [agent-trials/results.json](../examples/agent-trials/results.json), with before/after images, briefs, complete audit snapshots and portable final scenes. Corrections were selected after inspecting the images. The visual scores are same-agent judgments; these are not independent quality evaluations, and token usage was unavailable. All three final scenes passed their configured checks and reproduced after export. The pear trial preserved every checked nonfruit pixel.
|
|
145
|
-
|
|
146
|
-
```sh
|
|
147
|
-
node dist/cli.js render examples/agent-trials/reading-club/final/scene.json -o /tmp/reading-club.png
|
|
148
|
-
node dist/cli.js render examples/agent-trials/pear/final/scene.json -o /tmp/pear.png
|
|
149
|
-
npm run performance
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
The performance probe records cache counters and local timings in `docs/previews/performance.json`. Its 16-layer edit reuses 15 surfaces and rasterizes one, while matching an uncached render exactly.
|
|
153
|
-
|
|
154
|
-
See [architecture decisions](decisions/001-runtime-and-renderer.md), [multi-file persistence decision](decisions/002-composable-scenes-and-history.md), and the original [architecture proposal](../agentic-raster-graphics-architecture.md).
|
|
155
|
-
|
|
156
|
-
## Development
|
|
66
|
+
The [agent setup guide](agent-setup.md) explains CLI, MCP and SDK integration.
|
|
67
|
+
MCP tools are:
|
|
68
|
+
|
|
69
|
+
- Inspection and images: `inspectScene`, `inspectLayer`, `inspectRegion`, `render`, `renderRegion`.
|
|
70
|
+
- Editing and history: `apply`, `undo`, `redo`, `history`, `rebase`, `compactHistory`.
|
|
71
|
+
- Verification and review: `verify`, `recordCritique`, `readCritique`.
|
|
72
|
+
- Painting: `studioHelp`, `runProgram`, `replayProgram`, `readRasterRegion`, `writeRasterRegion`.
|
|
73
|
+
- Staged work: `buildPipeline`, `production`.
|
|
74
|
+
- Artwork export: `exportArtwork`, `exportSprites`, `preflight`, `softProof`.
|
|
75
|
+
|
|
76
|
+
MCP rendering/crop tools return PNG image content. Production capture and comparison return
|
|
77
|
+
artifact paths in JSON; the host needs a way to open those images. The MCP server operates
|
|
78
|
+
on the project passed to `serve`; project creation, SVG import, portable scene export and
|
|
79
|
+
interactive benchmarks are available through the CLI/SDK, not separate MCP tools.
|
|
80
|
+
|
|
81
|
+
The exported `runIterations(project, editingAgent, options)` supports bounded edit loops.
|
|
82
|
+
The injected agent receives the scene, PNG and verifier report and returns a patch or `null`.
|
|
83
|
+
An optional `critic` callback supplies visual feedback. `requireCritique: true` requires a
|
|
84
|
+
current critique before passing, and unresolved medium/high findings prevent success.
|
|
85
|
+
There is no built-in model client or automatic visual critic.
|
|
86
|
+
|
|
87
|
+
## Evidence and limits
|
|
88
|
+
|
|
89
|
+
The [art-direction guide](agent-art-workflow.md) separates technical correctness, functional
|
|
90
|
+
behaviour and observed visual quality. Production gates enforce declared criteria and hashes;
|
|
91
|
+
they cannot authenticate reviewers, judge taste or prove that images were inspected.
|
|
92
|
+
|
|
93
|
+
PNG writes through the CLI/artifact helper include an evidence sidecar. SDK `render()` returns
|
|
94
|
+
evidence in memory; use `writeRender()` to write both files. Same-runtime/platform replay,
|
|
95
|
+
undo and portable export are tested. Cross-platform or cross-version byte identity is not promised.
|
|
96
|
+
|
|
97
|
+
A bounded layer cache reuses unchanged surfaces. Simple pointwise region scenes use a smaller
|
|
98
|
+
viewport; antialias-sensitive cases use a full render and exact crop. `cache: false` and
|
|
99
|
+
`regionMode: 'full'` request reference paths. Draft downsamples after rendering. A general
|
|
100
|
+
dirty-tile compositor, automatic quadtree refinement, a native animation timeline, mesh warp,
|
|
101
|
+
smudge and general segmentation remain unimplemented. Sprite manifests and atlas export
|
|
102
|
+
package authored frames but do not provide inverse kinematics, retargeting or automatic
|
|
103
|
+
visual approval. Procedural programs can still author individual animation frames, as the
|
|
104
|
+
[asset trial](https://github.com/Coly010/rtistree/tree/main/examples/warden-asset-trial) demonstrates.
|
|
105
|
+
|
|
106
|
+
The [poster benchmark](previews/benchmark.json) records 4,704 changed pixels inside a
|
|
107
|
+
56 × 84 region and zero outside, with successful replay/undo/export checks. It is recorded
|
|
108
|
+
mechanical evidence, not a visual-quality benchmark. The [performance probe](previews/performance.json)
|
|
109
|
+
records local timings and cache reuse; it is not a portable speed guarantee.
|
|
110
|
+
|
|
111
|
+
## Repository development
|
|
157
112
|
|
|
158
113
|
```sh
|
|
114
|
+
git clone https://github.com/Coly010/rtistree.git
|
|
115
|
+
cd rtistree
|
|
116
|
+
npm ci
|
|
159
117
|
npm run check
|
|
160
|
-
npm run
|
|
161
|
-
npm run
|
|
118
|
+
npm run demo
|
|
119
|
+
npm run docs:check
|
|
120
|
+
npm run package:check
|
|
162
121
|
```
|
|
163
122
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
## Staged 2D art production
|
|
169
|
-
|
|
170
|
-
Dependency-aware painting pipelines, immutable candidate comparisons, hash-bound visual reviews and gated production stages are available through the CLI, SDK and MCP. Seeded oil/filbert/scumble/ink brushes complement native Canvas paths and raw pixels. See [the atelier workflow](atelier.md) and the hand-authored dragon trial in `examples/dragon-oil-trial`. No image-generation or 3D dependency is used.
|
|
171
|
-
|
|
172
|
-
Read [Art direction for agents](agent-art-workflow.md) before making art. The foundation-first protocol, named 2D construction guides, explicit blocking issues and parent-linked revisions are also discoverable through `graphics studio-help`. The [grayscale dragon study](../examples/dragon-foundation/README.md) demonstrates the process and records its unresolved artistic failures.
|
|
123
|
+
`npm run rtistree -- ...` runs the CLI from source. `npm run schema` regenerates the
|
|
124
|
+
schemas. `npm run performance` reruns the cache/timing probe. The demo uses a temporary
|
|
125
|
+
working project and writes preview images/evidence without editing the example source scenes.
|
|
173
126
|
|
|
174
|
-
The [
|
|
127
|
+
The [architecture decisions](decisions/001-runtime-and-renderer.md) retain historical
|
|
128
|
+
context. The [original proposal](https://github.com/Coly010/rtistree/blob/main/agentic-raster-graphics-architecture.md)
|
|
129
|
+
is not an API reference. See [contributing](https://github.com/Coly010/rtistree/blob/main/CONTRIBUTING.md)
|
|
130
|
+
for development setup and [releasing](releasing.md) for maintainer release instructions.
|
package/docs/evolution.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Editing and agent workflows
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Core edit commands
|
|
4
4
|
|
|
5
5
|
`apply` is still a transaction containing `reason`, optional `expected_hash` and `commands`. The generated [command schema](../schemas/command.schema.json) is authoritative.
|
|
6
|
+
The table covers core edits; [print production and editing](production.md) lists the
|
|
7
|
+
additional document, path, crop, text and adjustment commands.
|
|
6
8
|
|
|
7
9
|
| Area | Commands |
|
|
8
10
|
| ---------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -110,7 +112,7 @@ For visual critique, render and inspect the PNG, then submit:
|
|
|
110
112
|
}
|
|
111
113
|
```
|
|
112
114
|
|
|
113
|
-
`
|
|
115
|
+
`rtistree critique scene.yaml critique.json` or the MCP `recordCritique` tool stores it. Stale scene/PNG hashes are rejected. `readCritique` returns only the current critique. A callback of type `VisualCritic` can perform this review in `runIterations`; use `requireCritique: true` to require it for success. Visual and rule scores inform stall detection; unresolved medium/high visual findings prevent a pass. The adapter is provider-neutral and requires the caller to supply the actual vision-capable reviewer. No synthetic review is substituted when one is absent.
|
|
114
116
|
|
|
115
117
|
## Components and fonts
|
|
116
118
|
|
|
@@ -142,7 +144,7 @@ Components can live in included fragments. Instance children become `new-badge-p
|
|
|
142
144
|
fonts:
|
|
143
145
|
brand-display:
|
|
144
146
|
source: fonts/BrandDisplay.otf
|
|
145
|
-
hash: sha256
|
|
147
|
+
# Optional hash: sha256: followed by the font file’s 64 hex digest characters
|
|
146
148
|
```
|
|
147
149
|
|
|
148
150
|
Choose `style.font: brand-display`. Fonts are registered under content-based aliases; changing a font file without updating its expected hash fails. History checks custom-font provenance, and exports copy font files. A custom file supplies one face; register a separate ID for another weight. Bundled names are reserved.
|
|
@@ -154,13 +156,13 @@ Layout supports `aspect_ratio`, positive `grow` weights and `layout.justify: sta
|
|
|
154
156
|
After changing a source fragment or a component definition:
|
|
155
157
|
|
|
156
158
|
```sh
|
|
157
|
-
|
|
159
|
+
npx rtistree rebase scene.yaml
|
|
158
160
|
```
|
|
159
161
|
|
|
160
162
|
This merges disjoint source and agent changes using the retained authoring baseline. Conflicts report paths such as `/layers/headline/style/colour` and leave history untouched. Resolve the conflicting source fields and retry, or export the working scene into a new project. Rebase is audited and undoable. Histories created before baseline retention require their original source to be restored and exported first.
|
|
161
163
|
|
|
162
164
|
```sh
|
|
163
|
-
|
|
165
|
+
npx rtistree compact scene.yaml
|
|
164
166
|
```
|
|
165
167
|
|
|
166
168
|
Compaction compresses full records into an immutable gzip archive with a content-hashed pointer, then starts an empty active log. Every undo/redo state remains accessible. It reduces storage; replay still reads all records. Missing/tampered archives fail closed. Do not delete archives referenced by the pointer.
|
|
@@ -170,10 +172,11 @@ Compaction compresses full records into an immutable gzip archive with a content
|
|
|
170
172
|
`BenchmarkSession` requires visual review before each checkpoint. Briefs describe the objective and optional allowed region; the driver does not contain a solution or choose an edit.
|
|
171
173
|
|
|
172
174
|
```sh
|
|
173
|
-
|
|
175
|
+
# Render and record a current critique before the first checkpoint.
|
|
176
|
+
npx rtistree benchmark scene.yaml brief.json before
|
|
174
177
|
# Inspect, critique, apply edits, then inspect and critique again.
|
|
175
|
-
|
|
176
|
-
|
|
178
|
+
npx rtistree benchmark scene.yaml brief.json after
|
|
179
|
+
npx rtistree benchmark scene.yaml brief.json finish
|
|
177
180
|
```
|
|
178
181
|
|
|
179
|
-
The report records actual edit/command counts, rule results, visual scores, locality, uncached equality and self-contained export equality. Token counts are nullable rather than guessed. The [recorded trials](
|
|
182
|
+
The report records actual edit/command counts, rule results, visual scores, locality, uncached equality and self-contained export equality. Token counts are nullable rather than guessed. The [recorded trials](https://github.com/Coly010/rtistree/blob/main/examples/agent-trials/results.json) were performed interactively by the assistant in this task, with self-authored briefs and same-agent visual critique. They establish a usable end-to-end workflow; broader held-out evaluation and independent human review remain future evidence to collect.
|
package/docs/getting-started.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Make your first image
|
|
2
2
|
|
|
3
|
+
New to Rtistree? Read [Core concepts: an agent is the interface](core-concepts.md)
|
|
4
|
+
for how you, your agent and the engine work together.
|
|
5
|
+
|
|
3
6
|
Create a small artwork, render it, change one part, and undo that change.
|
|
4
7
|
You need **Node.js 22 or newer** and npm. No GPU or model API key is required.
|
|
5
8
|
|
|
@@ -17,19 +20,19 @@ If npm asks to install Rtistree for the first command, accept. `init` creates a
|
|
|
17
20
|
It refuses existing paths, so choose a different name if `my-art` already exists.
|
|
18
21
|
|
|
19
22
|
Open **hello.png** in the new directory. You should see a green disc and the text
|
|
20
|
-
“Hello, Rtistree.” on a dark background. Rendering also writes
|
|
23
|
+
“Hello, Rtistree.” on a dark background. Rendering also writes `hello.png.evidence.json`.
|
|
21
24
|
|
|
22
25
|
The commands below run from inside `my-art` and use the locally installed package.
|
|
23
26
|
The executable is `rtistree`; older installations used `graphics`, which remains an alias.
|
|
24
27
|
|
|
25
28
|
## Understand the starter
|
|
26
29
|
|
|
27
|
-
| File | Purpose
|
|
28
|
-
| -------------- |
|
|
29
|
-
| `scene.json` | Canvas
|
|
30
|
-
| `refine.json` | A sample patch that brightens only the disc
|
|
31
|
-
| `render.mjs` | The same rendering workflow through the JavaScript SDK
|
|
32
|
-
| `package.json` | Pinned dependency and the `npm run render` script
|
|
30
|
+
| File | Purpose |
|
|
31
|
+
| -------------- | ------------------------------------------------------- |
|
|
32
|
+
| `scene.json` | Canvas settings and disc/title layers with editable IDs |
|
|
33
|
+
| `refine.json` | A sample patch that brightens only the disc |
|
|
34
|
+
| `render.mjs` | The same rendering workflow through the JavaScript SDK |
|
|
35
|
+
| `package.json` | Pinned dependency and the `npm run render` script |
|
|
33
36
|
|
|
34
37
|
`npm run render` runs `rtistree render scene.json -o hello.png`.
|
|
35
38
|
To inspect the scene's layers and bounds:
|
|
@@ -86,7 +89,9 @@ npx rtistree export scene.json -o portable/scene.json
|
|
|
86
89
|
npx rtistree render portable/scene.json -o portable.png
|
|
87
90
|
```
|
|
88
91
|
|
|
89
|
-
The export includes referenced assets
|
|
92
|
+
The export includes the current resolved scene, referenced assets, fonts and any baked
|
|
93
|
+
program recipes. It starts a new baseline: edit history, critiques and production-session
|
|
94
|
+
reviews are not copied. Keep the exported directory together.
|
|
90
95
|
|
|
91
96
|
## Use an agent
|
|
92
97
|
|
|
@@ -127,5 +132,7 @@ The SDK and CLI use the same engine. For an existing Node project, install with
|
|
|
127
132
|
|
|
128
133
|
- [CLI reference](cli-reference.md) — inspect, edit, render and export commands.
|
|
129
134
|
- [Scene format](scene-format.md) — layers, coordinates, assets and effects.
|
|
135
|
+
- [Pixel art, sprites and spritesheets](sprites.md) — indexed tiles, frame metadata,
|
|
136
|
+
deterministic atlases and animation review.
|
|
130
137
|
- [Studio](studio.md) — trusted JavaScript painting programs and replayable recipes.
|
|
131
138
|
- [Staged production](atelier.md) — compare candidates and record visual review.
|
package/docs/next-milestone.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Historical proposal: print documents and coherent projects
|
|
2
2
|
|
|
3
3
|
Status: delivered as the v0.3 milestone. This document retains the original proposal; see [the production guide](production.md) and [ADR 004](decisions/004-print-production-and-projects.md) for the implemented scope, selected backends and explicit limits.
|
|
4
4
|
|
|
@@ -9,11 +9,11 @@ Status: delivered as the v0.3 milestone. This document retains the original prop
|
|
|
9
9
|
3. Preserve text and vector geometry in PDF; add practical compositing, selection and path tools.
|
|
10
10
|
4. Run a more demanding generated-asset integration trial, including subject extraction or seamless extension, and print the result through the new export pipeline.
|
|
11
11
|
|
|
12
|
-
The first generated-asset fitting trial is already recorded in [the example](
|
|
12
|
+
The first generated-asset fitting trial is already recorded in [the example](https://github.com/Coly010/rtistree/blob/main/examples/generated-asset-trial/README.md). It uses one built-in image-generation call followed by deterministic Rtistree composition. It establishes asset ingestion, aspect-preserving placement, editable surrounding content and exact preservation of the placed photograph. It does not establish seamless photographic outpainting, segmentation or print readiness.
|
|
13
13
|
|
|
14
14
|
## Project creation
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Syntax proposed at the time (now implemented; use the current production guide):
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
19
|
rtistree project new alpine --size A3 --orientation landscape --ppi 300 --bleed 3mm --output-dir output
|
|
@@ -32,7 +32,7 @@ Keep physical trim dimensions authoritative, independently of pixel dimensions.
|
|
|
32
32
|
|
|
33
33
|
Record the PDF MediaBox, TrimBox and BleedBox correctly; actually render artwork into the bleed. Offer crop marks as an explicit option outside trim. Report effective ppi of placed source images and whether the requested output resamples them. The file can encode exact size, but downstream printer/viewer scaling remains outside the engine's control.
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
At the time of this proposal, the schema capped canvas dimensions at 4,096 pixels and the renderer held full-canvas layer surfaces. A3 at 300 ppi is about 4,961 by 3,508 pixels before bleed. Print therefore needs a bounded-memory strategy and expanded dimension support, not merely a new encoder or a higher schema limit. Tiled rendering must retain context for filters and match reference crops.
|
|
36
36
|
|
|
37
37
|
## Colour and formats
|
|
38
38
|
|
package/docs/production.md
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
# Projects, print production and editing
|
|
1
|
+
# Projects, print production and editing
|
|
2
2
|
|
|
3
3
|
## Start a project
|
|
4
4
|
|
|
5
|
+
Run these commands from a directory where `npm install rtistree` has completed.
|
|
6
|
+
`project new` creates the artwork files and presets, not a Node package or dependency installation.
|
|
7
|
+
|
|
5
8
|
```sh
|
|
6
|
-
rtistree project new alpine --size A3 --orientation landscape --ppi 300 --bleed 3mm --output-dir output
|
|
7
|
-
rtistree render alpine --preset screen
|
|
8
|
-
rtistree preflight alpine --preset
|
|
9
|
+
npx rtistree project new alpine --size A3 --orientation landscape --ppi 300 --bleed 3mm --output-dir output
|
|
10
|
+
npx rtistree render alpine --preset screen
|
|
11
|
+
npx rtistree preflight alpine --preset screen
|
|
9
12
|
```
|
|
10
13
|
|
|
11
14
|
`project new` accepts A3, A4, A5, Letter, or a custom pair such as `160x100` (mm) or `8.5inx11in`. It creates `rtistree.yaml`, a scene with layer fragments, assets/fonts/profiles/history directories, local JSON Schemas, a README and a designated output directory. The destination must be new. Existing scene-file commands remain available; opening a configured entry-point scene also discovers its project settings.
|
|
12
15
|
|
|
13
|
-
Generated projects start with an sRGB screen preset and a CMYK print preset. Before using the print preset, copy your printer/paper ICC file into `profiles/` and set `presets.print.profile`. Set `profile_hash` to its
|
|
16
|
+
Generated projects start with an sRGB screen preset and a CMYK print preset. Before using the print preset, copy your printer/paper ICC file into `profiles/` and set `presets.print.profile`. Set `profile_hash` to `sha256:` followed by its 64-character hexadecimal digest to pin it. CMYK export rejects missing, invalid, changed or non-CMYK profiles. The demo profile is for exercising the pipeline, not a recommendation for a printing process.
|
|
17
|
+
An unconfigured print preset fails preflight with exit code 2; the first example deliberately
|
|
18
|
+
uses the screen preset. After configuring a real profile, run `npx rtistree preflight alpine --preset print`
|
|
19
|
+
before the CMYK export and proof commands below.
|
|
14
20
|
|
|
15
21
|
Project paths are local to the project root. CLI/MCP renders and artwork exports use `output_dir`; CLI verification and preflight reports use it too. History and critique records remain persistent project state. Explicit CLI `--output` paths override artifact destinations.
|
|
16
22
|
|
|
@@ -37,12 +43,12 @@ The renderer accepts edges up to 8,192 pixels. Print preflight also enforces a 3
|
|
|
37
43
|
## Formats and colour
|
|
38
44
|
|
|
39
45
|
```sh
|
|
40
|
-
rtistree export alpine --preset print --format pdf
|
|
41
|
-
rtistree export alpine --preset print --format tiff
|
|
42
|
-
rtistree export alpine --preset screen --format jpeg
|
|
43
|
-
rtistree export alpine --format svg -o alpine/output/artwork.svg
|
|
44
|
-
rtistree proof alpine --preset print
|
|
45
|
-
rtistree export alpine --format project -o /tmp/alpine-copy/scene.json
|
|
46
|
+
npx rtistree export alpine --preset print --format pdf
|
|
47
|
+
npx rtistree export alpine --preset print --format tiff
|
|
48
|
+
npx rtistree export alpine --preset screen --format jpeg
|
|
49
|
+
npx rtistree export alpine --format svg -o alpine/output/artwork.svg
|
|
50
|
+
npx rtistree proof alpine --preset print
|
|
51
|
+
npx rtistree export alpine --format project -o /tmp/alpine-copy/scene.json
|
|
46
52
|
```
|
|
47
53
|
|
|
48
54
|
Known artwork extensions are inferred for `export` and full `render`. Region renders remain PNG. A filename extension must agree with the actual format. Portable scene export keeps its original meaning with `--format project` or a JSON/YAML destination, and copies configured print profiles/presets when exporting a project.
|
|
@@ -71,7 +77,7 @@ Preflight checks physical geometry, render capacity, output profiles, font glyph
|
|
|
71
77
|
|
|
72
78
|
Each artwork export has a `.evidence.json` containing the scene hash, output hash, resolved settings, ICC hash, backend versions and inspection of the actual encoded bytes. Raster inspection reads format, dimensions, channels, profile and density. PDF inspection reads page boxes, image colour-space declarations, embedded font descriptors and profile streams. This complements visual proof inspection; it does not replace press validation.
|
|
73
79
|
|
|
74
|
-
##
|
|
80
|
+
## Editing operations
|
|
75
81
|
|
|
76
82
|
Commands are available through `apply` in the CLI, SDK and MCP. See generated command/patch schemas for complete inputs.
|
|
77
83
|
|
|
@@ -93,15 +99,15 @@ Shapes support stroke caps, joins, dash arrays and dash offsets. Text styles sup
|
|
|
93
99
|
|
|
94
100
|
Masks now support editable SVG-style paths, image alpha/luminance/colour-range selections, and union/intersection/subtraction/XOR. Combined masks use one coordinate space; children inherit the outer space and reference size. The processing order is selection/algebra, inversion, grow/shrink, then feathering. Image masks reference an asset directly, making external segmentation masks usable without a visible mask layer.
|
|
95
101
|
|
|
96
|
-
|
|
102
|
+
Additional scoped operations are levels, piecewise-linear RGB/channel curves, white balance, clone and heal. Cloning samples a frozen copy of the target using `source_offset`. Healing adds a local mean-colour correction to that cloned texture; this is a deterministic colour-matched clone, not a Poisson or learned healing algorithm. All operate non-destructively through the existing history and scoped-pixel checks.
|
|
97
103
|
|
|
98
104
|
## SVG interchange and trial
|
|
99
105
|
|
|
100
106
|
```sh
|
|
101
|
-
rtistree import-svg drawing.svg -o drawing.scene.json
|
|
102
|
-
rtistree export drawing.scene.json --format svg -o drawing.svg
|
|
107
|
+
npx rtistree import-svg drawing.svg -o drawing.scene.json
|
|
108
|
+
npx rtistree export drawing.scene.json --format svg -o drawing.svg
|
|
103
109
|
```
|
|
104
110
|
|
|
105
111
|
The importer supports static paths, rectangles, circles, ellipses, lines, polygons, polylines, groups, transforms and basic stroke/fill styling. Unsupported elements/attributes, remote resources, scripts and entities are rejected rather than silently dropped. Text, filters and arbitrary CSS are not imported. Exported text is outlined; complex export fallbacks are embedded images. Full round-trip equivalence for arbitrary SVG is not promised.
|
|
106
112
|
|
|
107
|
-
The [print trial](
|
|
113
|
+
The [print trial](https://github.com/Coly010/rtistree/blob/main/examples/print-trial/README.md) used an external image-generation tool to create a ceramic vase/leaf photograph. Rtistree then extracted its silhouette with masks, added a contact shadow and colour adjustment, adapted it to two aspect ratios, and exported CMYK PDF/TIFF/JPEG. The source, exact prompt, edits, critiques, final scenes and output evidence are retained.
|