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.
Files changed (51) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/CONTRIBUTING.md +47 -0
  3. package/README.md +14 -5
  4. package/SECURITY.md +20 -0
  5. package/THIRD_PARTY_NOTICES.md +1 -1
  6. package/dist/cli.js +17 -3
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands.d.ts +12 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.js +1 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/mcp.js +18 -2
  13. package/dist/mcp.js.map +1 -1
  14. package/dist/print-scene.d.ts +6 -0
  15. package/dist/program.js +3 -1
  16. package/dist/program.js.map +1 -1
  17. package/dist/project-config.js +2 -1
  18. package/dist/project-config.js.map +1 -1
  19. package/dist/render.js +21 -1
  20. package/dist/render.js.map +1 -1
  21. package/dist/schema.d.ts +46 -0
  22. package/dist/schema.js +107 -0
  23. package/dist/schema.js.map +1 -1
  24. package/dist/sprites.d.ts +31 -0
  25. package/dist/sprites.js +142 -0
  26. package/dist/sprites.js.map +1 -0
  27. package/dist/studio-reference.js +1 -1
  28. package/dist/studio-reference.js.map +1 -1
  29. package/docs/agent-art-workflow.md +10 -0
  30. package/docs/agent-setup.md +8 -3
  31. package/docs/atelier.md +12 -1
  32. package/docs/cli-reference.md +76 -25
  33. package/docs/core-concepts.md +95 -0
  34. package/docs/decisions/004-print-production-and-projects.md +1 -1
  35. package/docs/decisions/005-programmable-digital-art.md +1 -1
  36. package/docs/engine-overview.md +121 -165
  37. package/docs/evolution.md +12 -9
  38. package/docs/getting-started.md +15 -8
  39. package/docs/next-milestone.md +4 -4
  40. package/docs/production.md +22 -16
  41. package/docs/releasing.md +99 -43
  42. package/docs/scene-format.md +44 -7
  43. package/docs/sprites.md +166 -0
  44. package/docs/studio.md +25 -10
  45. package/examples/hello/README.md +4 -0
  46. package/package.json +8 -5
  47. package/schemas/authoring.schema.json +359 -229
  48. package/schemas/command.schema.json +462 -332
  49. package/schemas/patch.schema.json +462 -332
  50. package/schemas/scene.schema.json +347 -217
  51. package/schemas/sprites.schema.json +41 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sprites.js","sourceRoot":"","sources":["../src/sprites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAkC,MAAM,aAAa,CAAC;AAGhF,wEAAwE;AACxE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,YAAY,CAAC;IACrD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAChD,KAAK,EAAE,iBAAiB,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC;AAKH,SAAS,cAAc,CAAC,KAAa;IACnC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,OAAO,MAAM,GAAG,KAAK;QAAE,MAAM,IAAI,CAAC,CAAC;IACnC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,UAAU,CAAC,OAAgB,EAAE,KAAkB;IACtD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;SAC1C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAA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AAK,CAAC;YAC5B,eAAe,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ;YAChD,cAAc,EAAE,OAAO;SACxB;KACF,CAAC;IACJ,MAAM,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAChC,MAAM,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACxE,OAAO;QACL,KAAK;QACL,QAAQ;QACR,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM;QACnC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM;QAClD,QAAQ,EAAE,QAAQ,CAAC,QAAQ;KAC5B,CAAC;AACJ,CAAC"}
@@ -34,6 +34,6 @@ export const studioReference = {
34
34
  lighting: 'art.normal(heightFn,x,y,strength=1,step=1) → surface normal from central differences. art.light(normal,[r,g,b,a],{light:[x,y,z]?,ambient?,diffuse?,specular?,shininess?}) → RGBA using Lambert diffuse and Blinn–Phong specular, viewer along +Z. Artistic 2.5D shading, not ray tracing.',
35
35
  },
36
36
  example: 'return art.raster((x,y) => { const n=art.fbm(x/35,y/35); return [35+n*40,40+n*35,45+n*30,255]; });',
37
- edits: 'readRasterRegion reads exact canvas-space PNG pixels and a scene hash. writeRasterRegion consumes an exact-size project-local PNG and that expected_hash, with replace/over semantics and canvas/layer coordinates. Layer-space patches capture reference dimensions and follow transforms. Layer effects/masks can change patch appearance; locality guards reject outward leakage.',
37
+ edits: 'readRasterRegion reads exact canvas-space PNG pixels and a scene hash. writeRasterRegion consumes an exact-size project-local PNG and that expected_hash, with replace/over semantics and canvas/layer coordinates. Layer-space patches capture reference dimensions and follow transforms. Patches follow target effects/operations and precede its mask/opacity; ancestor effects can change appearance; locality guards reject outward leakage.',
38
38
  };
39
39
  //# sourceMappingURL=studio-reference.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"studio-reference.js","sourceRoot":"","sources":["../src/studio-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,mBAAmB;IAC5B,UAAU,EAAE,gBAAgB;IAC5B,aAAa,EAAE,iBAAiB;IAChC,UAAU,EACR,8YAA8Y;IAChZ,QAAQ,EACN,sWAAsW;IACxW,SAAS,EACP,wPAAwP;IAC1P,MAAM,EAAE;QACN,iBAAiB,EAAE,EAAE;QACrB,MAAM,EAAE,EAAE;QACV,4BAA4B,EAAE,EAAE;QAChC,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,GAAG;QACf,cAAc,EAAE,EAAE;QAClB,UAAU,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC;QACvB,WAAW,EAAE,GAAG;KACjB;IACD,GAAG,EAAE;QACH,MAAM,EACJ,gbAAgb;QAClb,MAAM,EACJ,uRAAuR;QACzR,MAAM,EACJ,iJAAiJ;QACnJ,MAAM,EACJ,sLAAsL;QACxL,KAAK,EACH,oGAAoG;QACtG,KAAK,EACH,0OAA0O;QAC5O,KAAK,EACH,qKAAqK;QACvK,WAAW,EACT,+IAA+I;QACjJ,MAAM,EACJ,qIAAqI;QACvI,IAAI,EAAE,kKAAkK;QACxK,QAAQ,EACN,0HAA0H;QAC5H,IAAI,EAAE,2EAA2E;QACjF,QAAQ,EACN,2RAA2R;KAC9R;IACD,OAAO,EACL,oGAAoG;IACtG,KAAK,EACH,sXAAsX;CACzX,CAAC"}
1
+ {"version":3,"file":"studio-reference.js","sourceRoot":"","sources":["../src/studio-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,mBAAmB;IAC5B,UAAU,EAAE,gBAAgB;IAC5B,aAAa,EAAE,iBAAiB;IAChC,UAAU,EACR,8YAA8Y;IAChZ,QAAQ,EACN,sWAAsW;IACxW,SAAS,EACP,wPAAwP;IAC1P,MAAM,EAAE;QACN,iBAAiB,EAAE,EAAE;QACrB,MAAM,EAAE,EAAE;QACV,4BAA4B,EAAE,EAAE;QAChC,IAAI,EAAE,IAAI;QACV,UAAU,EAAE,GAAG;QACf,cAAc,EAAE,EAAE;QAClB,UAAU,EAAE,CAAC,EAAE,EAAE,KAAK,CAAC;QACvB,WAAW,EAAE,GAAG;KACjB;IACD,GAAG,EAAE;QACH,MAAM,EACJ,gbAAgb;QAClb,MAAM,EACJ,uRAAuR;QACzR,MAAM,EACJ,iJAAiJ;QACnJ,MAAM,EACJ,sLAAsL;QACxL,KAAK,EACH,oGAAoG;QACtG,KAAK,EACH,0OAA0O;QAC5O,KAAK,EACH,qKAAqK;QACvK,WAAW,EACT,+IAA+I;QACjJ,MAAM,EACJ,qIAAqI;QACvI,IAAI,EAAE,kKAAkK;QACxK,QAAQ,EACN,0HAA0H;QAC5H,IAAI,EAAE,2EAA2E;QACjF,QAAQ,EACN,2RAA2R;KAC9R;IACD,OAAO,EACL,oGAAoG;IACtG,KAAK,EACH,obAAob;CACvb,CAAC"}
@@ -59,6 +59,16 @@ hidden backs of its hoops over the near lid, where they looked like handles.
59
59
  Both shared geometry and correct occlusion matter. Distinct shaded faces and a
60
60
  common palette are insufficient evidence of sound construction.
61
61
 
62
+ **Pixel art:** declare the intended display size, palette and transparency policy.
63
+ Keep coordinates, frame dimensions and pivots on integer pixels, use
64
+ nearest-neighbour scaling, and inspect at the actual game size. A declared
65
+ pixel-art contract can catch palette overruns, invalid tile geometry and
66
+ disallowed transforms or blur; the sprite exporter preserves exact RGBA frame
67
+ pixels. It cannot decide whether a one-pixel choice is artistically good.
68
+ Use palette tiles for compact indexed marks and seeded studio programs for dense
69
+ or generated frames. Pack a set only after the individual frames and their
70
+ contact sheet have been inspected.
71
+
62
72
  **Animation:** declare facing, travel direction, ground plane, stride distance,
63
73
  cycle duration and contact/recovery phases. Play a full loop against ground
64
74
  markers and inspect contact, passing and recovery frames at the intended size.
@@ -1,5 +1,8 @@
1
1
  # Connect an agent
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
  Rtistree provides a CLI, an MCP server and a TypeScript SDK. The engine renders locally;
4
7
  your host supplies the model and any vision capability.
5
8
 
@@ -41,9 +44,11 @@ Example task:
41
44
  > visual findings separately. Revise failed criteria before exporting.
42
45
 
43
46
  The server exposes inspection, rendering, crop inspection, typed edits, undo/redo, verification,
44
- critiques, program execution, pipelines and staged production. Rendering tools return PNG image
45
- content; use a vision-capable agent to judge appearance. Structured inspection alone cannot
46
- establish that an image looks good.
47
+ critiques, program execution, pipelines, sprite-atlas export and staged production. The
48
+ `exportSprites` tool writes an engine-neutral PNG atlas plus JSON frame/animation metadata for
49
+ a scene with a `sprites` manifest. Rendering tools return PNG image content; use a
50
+ vision-capable agent to judge appearance. Structured inspection alone cannot establish that an
51
+ image looks good.
47
52
 
48
53
  ## CLI agents
49
54
 
package/docs/atelier.md CHANGED
@@ -17,6 +17,13 @@ CLI actions also have SDK equivalents (`buildPipeline`, `production`) and MCP to
17
17
 
18
18
  ## Editable dependency graph
19
19
 
20
+ These examples assume an installed package and an existing scene project; see
21
+ [the first painting](studio.md#first-painting). Save the graph as `pipeline.json`,
22
+ create `programs/ground.js` inside the artwork project, and make that program return
23
+ a Canvas of the requested dimensions. For a minimal ground program, use
24
+ `return art.raster(() => [38, 62, 69, 255]);`. Source paths inside the graph resolve
25
+ from the artwork project root; the CLI request filename resolves from your shell directory.
26
+
20
27
  ```json
21
28
  {
22
29
  "version": 1,
@@ -46,9 +53,13 @@ CLI actions also have SDK equivalents (`buildPipeline`, `production`) and MCP to
46
53
 
47
54
  `rtistree pipeline my-project pipeline.json` reports `built` or `cached` for each node. An input can instead use `{ "asset": "registered-asset-id" }`. Source and inline code are mutually exclusive. Only subscribed shared parameters enter a node's key. Per-node parameters override nothing implicitly: an explicit binding takes precedence over a parameter of the same name. A changed node whose PNG is identical need not rebuild its dependants. Node array order defines auto-created layer order; dependency order defines execution order. Existing layer geometry is preserved. Changing output resolution changes cache keys. Removing a node does not remove previously authored layers or assets; use normal scene commands for removal.
48
55
 
49
- All node artifacts are baked before one scene transaction. A failed build can leave unused immutable files in the cache, but never a partially updated scene. Identical builds add no history. Use `expected_hash` with the SDK/MCP to reject a scene changed since inspection.
56
+ All node artifacts are baked before one scene transaction. The CLI takes the graph
57
+ as the request file directly. To pass a previously inspected `expected_hash`, use
58
+ the SDK third argument or MCP’s separate `expected_hash` field. A failed build can leave unused immutable files in the cache, but never a partially updated scene. Identical builds add no history. Use `expected_hash` with the SDK/MCP to reject a scene changed since inspection.
50
59
 
51
60
  The exact executed graph, including inline source, is stored under `scene.metadata.pipeline_<id>`. After restoring a candidate, use that graph to resume its settings; a working `pipeline.json` file is deliberately not overwritten by selection. Portable export includes the selected graph and registered input assets, so it can rebuild without the original source files.
61
+ It does not copy production sessions, rejected candidates, reviews or edit history; retain
62
+ the original project if you need those records.
52
63
 
53
64
  ## Production requests
54
65
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Installing Rtistree exposes `rtistree` and the compatibility alias `graphics`. In a local npm project, use `npx rtistree`.
4
4
  Run `rtistree --help` for the complete installed-version reference. Structured results go to
5
- stdout as JSON; errors go to stderr. Verification failure exits 2; other errors exit 1.
5
+ stdout as JSON; errors go to stderr. Failed verification/preflight and non-identical recipe replay exit 2; input/runtime errors exit 1.
6
6
 
7
7
  ## Create a starter
8
8
 
@@ -14,33 +14,41 @@ npm run render
14
14
  ```
15
15
 
16
16
  The destination must be a new directory. The starter includes a scene, sample patch, SDK example
17
- and npm render scripts. No packages are installed and no code is executed by `init` itself.
17
+ and npm render scripts. `init` writes starter files without installing dependencies or executing painting programs.
18
18
 
19
19
  ## Inspect and edit
20
20
 
21
21
  ```sh
22
- rtistree inspect scene.json
23
- rtistree inspect scene.json --layer title
24
- rtistree inspect-region scene.json 0 0 100 100
25
- rtistree render scene.json -o image.png
26
- rtistree render-region scene.json 0 0 100 100 -o crop.png
27
- rtistree apply scene.json patch.json
28
- rtistree undo scene.json
29
- rtistree redo scene.json
30
- rtistree history scene.json
22
+ npx rtistree inspect scene.json
23
+ npx rtistree inspect scene.json --layer title
24
+ npx rtistree inspect-region scene.json 0 0 100 100
25
+ npx rtistree render scene.json -o image.png
26
+ npx rtistree render-region scene.json 0 0 100 100 -o crop.png
27
+ npx rtistree sprites scene.json -o output/sprites.png --manifest output/sprites.json
28
+ npx rtistree apply scene.json patch.json
29
+ npx rtistree undo scene.json
30
+ npx rtistree redo scene.json
31
+ npx rtistree history scene.json
31
32
  ```
32
33
 
33
34
  Coordinates are `x y width height` in canvas pixels. A patch contains a reason and a typed
34
35
  commands array. Supply the current `expected_hash` when coordinating concurrent edits.
35
36
  See [scene format](scene-format.md) for command shapes and coordinate rules.
36
37
 
38
+ `sprites` reads a scene or configured project with a sprite manifest and writes a
39
+ deterministically packed atlas plus frame/animation metadata. The atlas output
40
+ must end in `.png`; the optional `--manifest` path must end in `.json`. Pixel-art
41
+ projects can opt into integer, palette and nearest-neighbour guardrails. Use
42
+ `npx rtistree sprites --help` for the exact options supported by the installed
43
+ version.
44
+
37
45
  ## Verify, review and export
38
46
 
39
47
  ```sh
40
- rtistree verify scene.json -o report.json --heatmap heatmap.png
41
- rtistree critique scene.json critique.json
42
- rtistree export scene.json -o portable/scene.json
43
- rtistree export scene.json --format png -o image.png
48
+ npx rtistree verify scene.json -o report.json --heatmap heatmap.png
49
+ npx rtistree critique scene.json critique.json
50
+ npx rtistree export scene.json -o portable/scene.json
51
+ npx rtistree export scene.json --format png -o image.png
44
52
  ```
45
53
 
46
54
  Verification measures configured technical constraints. Critiques are authored after inspecting
@@ -50,12 +58,12 @@ described in [print production](production.md).
50
58
  ## Studio and production
51
59
 
52
60
  ```sh
53
- rtistree art-guide
54
- rtistree studio-help
55
- rtistree program scene.json program.json
56
- rtistree program-replay scene.json asset-id
57
- rtistree pipeline scene.json pipeline.json
58
- rtistree production scene.json request.json
61
+ npx rtistree art-guide
62
+ npx rtistree studio-help
63
+ npx rtistree program scene.json program.json
64
+ npx rtistree program-replay scene.json asset-id
65
+ npx rtistree pipeline scene.json pipeline.json
66
+ npx rtistree production scene.json request.json
59
67
  ```
60
68
 
61
69
  Read [studio](studio.md) for program requests and [staged production](atelier.md) for plans,
@@ -64,10 +72,53 @@ candidate captures, reviews and selection. Program execution is for trusted code
64
72
  ## Project creation and integration
65
73
 
66
74
  ```sh
67
- rtistree project new artwork --size A3 --orientation landscape --ppi 300 --bleed 3mm
68
- rtistree schema --kind scene
69
- rtistree schema --kind command
70
- rtistree serve /absolute/path/to/scene.json
75
+ npx rtistree project new artwork --size A3 --orientation landscape --ppi 300 --bleed 3mm
76
+ npx rtistree schema --kind scene
77
+ npx rtistree schema --kind command
78
+ npx rtistree serve /absolute/path/to/scene.json
71
79
  ```
72
80
 
73
81
  The MCP server uses stdio. See [agent setup](agent-setup.md).
82
+
83
+ ## Additional commands
84
+
85
+ | Command | Purpose |
86
+ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------- |
87
+ | `npx rtistree rebase scene.json` | Merge manual source changes into journaled state; conflicts fail without committing |
88
+ | `npx rtistree compact scene.json` | Compress history while retaining undo and redo |
89
+ | `npx rtistree raster-read scene.json read.json` | Write an exact crop plus evidence and return an asset descriptor |
90
+ | `npx rtistree raster-write scene.json write.json` | Commit an exact-size PNG patch with a required current hash |
91
+ | `npx rtistree sprites scene.json -o output/sprites.png` | Pack declared sprite frames into an atlas and write animation metadata |
92
+ | `npx rtistree import-svg drawing.svg -o drawing.scene.json` | Import the supported static SVG subset |
93
+ | `npx rtistree preflight artwork --preset screen` | Check physical document/export settings and save a report |
94
+ | `npx rtistree proof artwork --preset print -o proof.png` | Make a CMYK round-trip proof; requires a configured ICC profile |
95
+ | `npx rtistree benchmark scene.json brief.json before` | Capture a benchmark checkpoint after recording a current critique |
96
+ | `npx rtistree benchmark scene.json brief.json finish` | Finish after at least two inspected checkpoints |
97
+
98
+ Dense request shapes are in [studio](studio.md). Source rebasing, critiques and benchmark
99
+ requirements are in [editing workflows](evolution.md). Names such as `patch.json`, `read.json`
100
+ and `critique.json` are request files you author, not files created by `init`.
101
+
102
+ ## Options, paths and output
103
+
104
+ - `--output` / `-o` chooses an artifact path. Explicit paths and request filenames resolve
105
+ from the shell's working directory. Asset/program paths inside requests resolve from the
106
+ artwork project root. Without `-o`, configured projects use `output_dir`; bare scene files
107
+ use a `renders/` directory alongside the scene.
108
+ - `render --quality draft|preview|final` controls PNG rendering. Draft halves dimensions
109
+ after rendering; preview and final share the full-quality path. `--layer ID` renders an
110
+ isolated layer on a full-size transparent canvas. `render-region` requires an integer crop
111
+ entirely inside the canvas; default/final quality is an exact full-render crop.
112
+ - `inspect-region` also writes `inspection.png` and its evidence unless you supply `-o`.
113
+ - Artwork `export` and full `render` accept `--format`, `--preset` and `--ppi`. Known output
114
+ extensions are inferred. Print exports additionally accept `--profile` (project-relative
115
+ ICC file; implies CMYK), `--colour-space srgb|cmyk` and `--crop-marks`. Use `export` for
116
+ print options; a plain PNG `render` with only `--profile` does not select the export path.
117
+ - `schema --kind scene` describes a resolved scene. Source scenes with includes/components
118
+ use the packaged `authoring.schema.json`; a patch uses `patch.schema.json`.
119
+
120
+ JSON is the structured result format; help is plain text and `serve` writes MCP protocol
121
+ messages. The npm/npx launcher can print its own installation notices. `verify` and
122
+ `preflight` failures, and non-identical `program-replay` results, exit 2. Input/runtime/export
123
+ errors exit 1. Warnings alone do not make preflight fail. Program or pipeline build success
124
+ only means execution succeeded; it does not establish visual quality.
@@ -0,0 +1,95 @@
1
+ # Core concepts: an agent is the interface
2
+
3
+ Rtistree is designed to be operated through an agent. You describe what you want,
4
+ set constraints and give feedback. The agent uses Rtistree to construct artwork,
5
+ inspect renders and make focused revisions.
6
+
7
+ The CLI, MCP server and TypeScript SDK are the agent's controls. They are also
8
+ available for direct human use, but learning every command is not the intended
9
+ starting point for someone who wants to make art.
10
+
11
+ ## Three roles
12
+
13
+ | Role | Responsibility |
14
+ | --------- | -------------------------------------------------------------------------------------------------- |
15
+ | You | Set the brief, references, constraints and intended use; judge whether the result meets your needs |
16
+ | The agent | Plan the work, call tools, inspect images, identify defects and revise the artwork |
17
+ | Rtistree | Store the editable scene, render it, apply typed edits, track history and export files |
18
+
19
+ Rtistree does not contain a model. Your agent host supplies the model, its context,
20
+ image-viewing capability and tool access. An agent that cannot inspect images can
21
+ still operate the tools, but cannot credibly judge their visual quality.
22
+
23
+ You can connect an MCP-capable host, give an agent access to the CLI, or integrate
24
+ the SDK into your own application. [Agent setup](agent-setup.md) explains each path.
25
+ The host decides which tools require confirmation and what files the agent can access.
26
+
27
+ ## A conversation becomes an editable scene
28
+
29
+ A useful starting brief might be:
30
+
31
+ > Create a square event poster with a bold title, a quiet landscape and room for
32
+ > a date. Keep the title and illustration independently editable. Show me a
33
+ > composition before adding detail.
34
+
35
+ The agent creates a scene with named layers rather than treating the final PNG as
36
+ its only state. Text, geometry, image assets, masks and adjustments can retain
37
+ separate identities. For painted detail, trusted JavaScript programs can produce
38
+ baked raster assets with saved source, parameters and seeds.
39
+
40
+ After inspecting the render, you might say:
41
+
42
+ > The title works. Reduce the contrast behind it and move the sun farther right.
43
+
44
+ The agent can inspect the relevant layers, change those parts and render again.
45
+ It should preserve the parts you approved and check that the requested revision
46
+ actually helps. Scoped raster edits have an enforced pixel-locality check;
47
+ arbitrary structural edits do not automatically promise that every other pixel
48
+ will remain unchanged.
49
+
50
+ A painted image is only as editable as its construction. If an agent bakes every
51
+ part into one asset, Rtistree cannot recover meaningful objects from those pixels.
52
+ Ask for independent layers or program parameters for the parts you expect to revise.
53
+
54
+ ## The working loop
55
+
56
+ 1. **Direct:** establish the brief, references, intended size and acceptance criteria.
57
+ 2. **Construct:** make a representative composition or asset with useful editable structure.
58
+ 3. **Inspect:** open the actual render, including silhouettes, crops or animation frames as relevant.
59
+ 4. **Refine:** identify a specific defect, make a focused change and compare the result.
60
+ 5. **Deliver:** export the accepted state and keep the source needed for future edits.
61
+
62
+ This loop is deliberate. A successful command, valid file or reproducible image
63
+ is not proof that the artwork is good. The agent brings drawing and observation
64
+ skills; Rtistree provides tools and records. A stronger agent may use the same
65
+ toolkit better, but the toolkit does not guarantee artistic success.
66
+
67
+ ## Guidance travels with the tool
68
+
69
+ The package includes art-direction guidance based on recorded trials: connected
70
+ construction, coherent prop perspective, ground contact, representative samples,
71
+ and separate technical, functional and visual assessment.
72
+
73
+ - MCP supplies compact instructions during connection and exposes the full guide
74
+ through `studioHelp` and the `rtistree://guides/art-direction` resource.
75
+ - CLI agents can read it with `rtistree art-guide`.
76
+ - SDK hosts can provide `rtistreeAgentInstructions` and `artDirectionGuide` to their agent.
77
+
78
+ Availability is not automatic compliance: some hosts do not pass server instructions
79
+ to their model. Ask the agent to read the guide before authoring. The
80
+ [art-direction workflow](agent-art-workflow.md) explains the process and optional
81
+ production gates in detail.
82
+
83
+ ## Local work and explicit execution
84
+
85
+ Ordinary scene loading and rendering use local assets and do not execute painting
86
+ recipes. Program execution, pipeline builds and recipe replay are explicit actions
87
+ for trusted code; the JavaScript VM is not a security sandbox. The agent host's
88
+ model calls may use a remote service even though Rtistree renders locally.
89
+
90
+ Edits are journaled and can be undone. Portable export saves the current artwork,
91
+ assets and recipes as a new baseline; it does not copy the complete edit history
92
+ or production reviews. Keep the original project when those records matter.
93
+
94
+ Start by [connecting your agent](agent-setup.md). To understand the mechanics
95
+ first, [make your first image](getting-started.md) with the small CLI walkthrough.
@@ -16,4 +16,4 @@ Hybrid PDF preserves supported text, vectors, gradients and isolation-free group
16
16
 
17
17
  The print trial revealed two defects that were fixed during implementation: metadata configuration could overwrite the requested CMYK conversion, and mask inversion after erosion expanded the selected foreground instead of shrinking it. Actual-file tests and visual proof inspection cover these cases. The original engine regression suite remains in place, alongside production and editing tests.
18
18
 
19
- See [the production guide](../production.md) for capabilities and operational limits, [the A3 evidence](../previews/a3-production.json), and [the generated-asset print trial](../../examples/print-trial/README.md).
19
+ See [the production guide](../production.md) for capabilities and operational limits, [the A3 evidence](../previews/a3-production.json), and [the generated-asset print trial](https://github.com/Coly010/rtistree/blob/main/examples/print-trial/README.md).
@@ -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](../../examples/manual-wheel-trial/README.md).
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).