rtistree 0.5.0 → 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 +20 -0
- package/CONTRIBUTING.md +47 -0
- package/README.md +38 -22
- package/SECURITY.md +20 -0
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/art-direction.js +1 -1
- package/dist/cli.js +55 -32
- 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/starter.d.ts +7 -0
- package/dist/starter.js +38 -0
- package/dist/starter.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 +12 -2
- package/docs/agent-setup.md +12 -7
- package/docs/atelier.md +15 -4
- package/docs/cli-reference.md +89 -26
- 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 +84 -53
- package/docs/next-milestone.md +9 -9
- package/docs/production.md +22 -16
- package/docs/releasing.md +99 -43
- package/docs/scene-format.md +45 -8
- package/docs/sprites.md +166 -0
- package/docs/studio.md +27 -12
- package/examples/hello/README.md +24 -8
- package/examples/hello/render.mjs +2 -1
- package/package.json +10 -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
|
@@ -12,4 +12,4 @@ Workers provide cancellation and V8 heap limits; helper allocations and output d
|
|
|
12
12
|
|
|
13
13
|
Dense region editing uses existing promoted raster regions, extended with explicit `replace` and `over` semantics. Exact-size PNGs carry dense data instead of JSON pixel arrays. Transactions check stale scene hashes and edit locality. Attached patches follow object transforms. The trial found a near-zero pressure gradient failure; a minimum subpixel dab radius fixes it. Region testing also corrected final print-region copy bounds to use the transformed frame.
|
|
14
14
|
|
|
15
|
-
The artistic evaluation is kept separate from mechanical verification. The wheel trial reproduces its pixels without external image inputs, but still reads as a synthetic illustration. Successful software tests and deterministic replay are not evidence of human-level artistic skill or photographic realism. See [the studio guide](../studio.md) and [trial](
|
|
15
|
+
The artistic evaluation is kept separate from mechanical verification. The wheel trial reproduces its pixels without external image inputs, but still reads as a synthetic illustration. Successful software tests and deterministic replay are not evidence of human-level artistic skill or photographic realism. See [the studio guide](../studio.md) and [trial](https://github.com/Coly010/rtistree/blob/main/examples/manual-wheel-trial/README.md).
|
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,57 +1,52 @@
|
|
|
1
1
|
# Make your first image
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
|
|
6
|
+
Create a small artwork, render it, change one part, and undo that change.
|
|
7
|
+
You need **Node.js 22 or newer** and npm. No GPU or model API key is required.
|
|
8
|
+
|
|
9
|
+
## Create your project
|
|
5
10
|
|
|
6
11
|
```sh
|
|
7
|
-
|
|
12
|
+
npx rtistree@latest init my-art
|
|
8
13
|
cd my-art
|
|
9
|
-
npm
|
|
10
|
-
npm
|
|
14
|
+
npm install
|
|
15
|
+
npm run render
|
|
11
16
|
```
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
If npm asks to install Rtistree for the first command, accept. `init` creates a new
|
|
19
|
+
`my-art` directory with a starter scene and a package.json that pins the Rtistree version.
|
|
20
|
+
It refuses existing paths, so choose a different name if `my-art` already exists.
|
|
15
21
|
|
|
16
|
-
|
|
22
|
+
Open **hello.png** in the new directory. You should see a green disc and the text
|
|
23
|
+
“Hello, Rtistree.” on a dark background. Rendering also writes `hello.png.evidence.json`.
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
The commands below run from inside `my-art` and use the locally installed package.
|
|
26
|
+
The executable is `rtistree`; older installations used `graphics`, which remains an alias.
|
|
19
27
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"bounds": [360, 60, 200, 200],
|
|
29
|
-
"shape": { "type": "ellipse", "fill": "#95b85c" }
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"id": "title",
|
|
33
|
-
"type": "text",
|
|
34
|
-
"bounds": [48, 275, 544, 80],
|
|
35
|
-
"content": "Hello, Rtistree.",
|
|
36
|
-
"style": { "font": "inter", "size": 44, "weight": "bold", "colour": "#edf3e8" }
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
```
|
|
28
|
+
## Understand the starter
|
|
29
|
+
|
|
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 |
|
|
41
36
|
|
|
42
|
-
|
|
37
|
+
`npm run render` runs `rtistree render scene.json -o hello.png`.
|
|
38
|
+
To inspect the scene's layers and bounds:
|
|
43
39
|
|
|
44
40
|
```sh
|
|
45
|
-
npx
|
|
46
|
-
npx graphics inspect scene.json
|
|
41
|
+
npx rtistree inspect scene.json
|
|
47
42
|
```
|
|
48
43
|
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
The starter is deliberately small so you can see what each edit does. Once comfortable,
|
|
45
|
+
use the [scene format](scene-format.md) to add shapes, text, images and masks.
|
|
51
46
|
|
|
52
|
-
##
|
|
47
|
+
## Make a focused edit
|
|
53
48
|
|
|
54
|
-
|
|
49
|
+
The supplied `refine.json` applies a brightness operation to the disc:
|
|
55
50
|
|
|
56
51
|
```json
|
|
57
52
|
{
|
|
@@ -66,29 +61,60 @@ Save this as `refine.json`:
|
|
|
66
61
|
}
|
|
67
62
|
```
|
|
68
63
|
|
|
64
|
+
Apply it and save a second image:
|
|
65
|
+
|
|
69
66
|
```sh
|
|
70
|
-
npx
|
|
71
|
-
npx
|
|
72
|
-
npx graphics undo scene.json
|
|
73
|
-
npx graphics render scene.json -o restored.png
|
|
67
|
+
npx rtistree apply scene.json refine.json
|
|
68
|
+
npx rtistree render scene.json -o brighter.png
|
|
74
69
|
```
|
|
75
70
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
Compare **hello.png** and **brighter.png**. Only the disc becomes brighter; the title and
|
|
72
|
+
background stay the same. The reason and edit are recorded in `history/`. The authoring
|
|
73
|
+
JSON remains intact; the rendered state includes the journaled edits.
|
|
79
74
|
|
|
80
|
-
##
|
|
75
|
+
## Undo and export
|
|
81
76
|
|
|
82
77
|
```sh
|
|
83
|
-
npx
|
|
84
|
-
npx
|
|
78
|
+
npx rtistree undo scene.json
|
|
79
|
+
npx rtistree render scene.json -o restored.png
|
|
85
80
|
```
|
|
86
81
|
|
|
87
|
-
|
|
82
|
+
**restored.png** should match **hello.png** byte for byte on the same runtime and platform.
|
|
83
|
+
Use `npx rtistree redo scene.json` if you want to restore the edit again.
|
|
84
|
+
|
|
85
|
+
Export the current state as a portable project:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
npx rtistree export scene.json -o portable/scene.json
|
|
89
|
+
npx rtistree render portable/scene.json -o portable.png
|
|
90
|
+
```
|
|
91
|
+
|
|
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.
|
|
95
|
+
|
|
96
|
+
## Use an agent
|
|
97
|
+
|
|
98
|
+
Read the built-in art-direction guidance, then follow [agent setup](agent-setup.md)
|
|
99
|
+
to connect an MCP client or your own agent host:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
npx rtistree art-guide
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
A useful first task is: “Inspect this scene, render it, and change the disc while preserving
|
|
106
|
+
the title and background.” For art creation, ask the agent to inspect silhouettes, values
|
|
107
|
+
and intended display size. Technical verification does not establish artistic quality.
|
|
88
108
|
|
|
89
109
|
## Use the SDK
|
|
90
110
|
|
|
91
|
-
|
|
111
|
+
The starter includes `render.mjs`. Run it with:
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
npm run render:sdk
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Its core is:
|
|
92
118
|
|
|
93
119
|
```js
|
|
94
120
|
import { Project } from 'rtistree';
|
|
@@ -99,9 +125,14 @@ const result = await project.render();
|
|
|
99
125
|
await writeFile('sdk-output.png', result.png);
|
|
100
126
|
```
|
|
101
127
|
|
|
102
|
-
|
|
128
|
+
The SDK and CLI use the same engine. For an existing Node project, install with
|
|
129
|
+
`npm install rtistree` and import from `rtistree` directly.
|
|
103
130
|
|
|
104
|
-
##
|
|
131
|
+
## Where next?
|
|
105
132
|
|
|
106
|
-
|
|
107
|
-
|
|
133
|
+
- [CLI reference](cli-reference.md) — inspect, edit, render and export commands.
|
|
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.
|
|
137
|
+
- [Studio](studio.md) — trusted JavaScript painting programs and replayable recipes.
|
|
138
|
+
- [Staged production](atelier.md) — compare candidates and record visual review.
|
package/docs/next-milestone.md
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
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
|
|
|
5
5
|
## Recommended order
|
|
6
6
|
|
|
7
|
-
1. Introduce a project manifest, physical document model, and `
|
|
7
|
+
1. Introduce a project manifest, physical document model, and `rtistree project new` together.
|
|
8
8
|
2. Add JPEG, TIFF and physically sized PDF exports, with colour management and output validation.
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
rtistree project new alpine --size A3 --orientation landscape --ppi 300 --bleed 3mm --output-dir output
|
|
20
|
+
rtistree render alpine --preset screen
|
|
21
|
+
rtistree export alpine --preset print
|
|
22
|
+
rtistree preflight alpine --preset print
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
Create a project manifest describing the scene entry point, output directory and export presets; a scene referencing layer fragments; `assets/`, `fonts/`, `profiles/`, `layers/`, `history/`, and the designated output directory. Include a useful starter scene, schema references, a short project README, and ignore rules for generated artifacts. Relative paths resolve consistently from the project root. Creating a project must not overwrite an existing one. Existing scene-file commands remain usable.
|
|
@@ -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
|
|