@rig-c/core 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="https://raw.githubusercontent.com/rig-c/core/main/assets/banner.svg" alt="rigc — AI-authored 2D rigging and animation, verified before it is written" width="100%" />
2
+ <img src="https://raw.githubusercontent.com/rig-c/core/main/assets/banner.svg" alt="@rig-c/core — AI-authored 2D rigging and animation, verified before it is written" width="100%" />
3
3
  </p>
4
4
 
5
5
  <p align="center">
@@ -8,6 +8,8 @@
8
8
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-38BDF8.svg?style=flat-square" alt="license" /></a>
9
9
  </p>
10
10
 
11
+ # @rig-c/core
12
+
11
13
  **AI-authored 2D rigging and animation, verified before it is written.** rigc is
12
14
  a rig compiler: a rig spec and a motion spec in, skeleton data out — in the Spine 4.3
13
15
  format, with rigc's own compiled model beside it —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rig-c/core",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "AI-authored 2D rigging and animation, verified before it is written. rigc compiles a rig spec into skeleton data in the Spine 4.3 format, gates it with named assertions held to a spine-core round trip's verdicts, and emits nothing that fails. Ships as an agent skill.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,7 @@ index within that same limit; only legacy uncoded library errors point at `§5.1
28
28
  ## Non-negotiables
29
29
 
30
30
  - **Validation is never bypassed.** `build` writes nothing on a red gate; there is
31
- no `--no-validate`, and none may be added — AUTHORING §0 says so in as many
31
+ no flag to skip it, and none may be added — AUTHORING §0 says so in as many
32
32
  words. Correctness is the whole of the reason: the assertions are what make the
33
33
  output trustworthy, and they are held to the official parser's verdicts in the
34
34
  repository's CI — all but the parse itself, which runs only where the runtime is
@@ -55,20 +55,23 @@ Codex, Gemini CLI and Antigravity read skills from `.agents/skills/` in the
55
55
  workspace and none of them reads `node_modules`; `rigc skills install` puts every
56
56
  skill the package ships there, and `rigc skills --help` says what it refuses.
57
57
 
58
- The package links no Spine runtime. `validate`, `preview` and `vote` below run
59
- through `@esotericsoftware/spine-core`: install it beside the package
60
- (`bun add -d @esotericsoftware/spine-core`) and the same `rigc` runs them, and
61
- `build` runs the round trip as well. Without it they are refused by name, and
62
- `build` writes the same files gated without the parse — `rigc --version` names the
63
- entry that ran. In the parse's place that `build` runs two rules of its own over
64
- rigc's model document, `A00_MODEL_READ` and `A00_MODEL_REGIONS_ON_PAGES`; they are
65
- not registry assertions, so its summary counts two more, and AUTHORING §5.2 has a
66
- row for each.
58
+ The package links no Spine runtime. `build` writes `skeleton.json`,
59
+ `skeleton.atlas` and `skeleton.model.json`. `preview`, `vote`, `bench` and `bonedist`
60
+ run through `@esotericsoftware/spine-core`: install it beside
61
+ the package (`bun add -d @esotericsoftware/spine-core`) and the same `rigc` runs
62
+ them, and `build` runs the round trip as well. Without it those commands are refused
63
+ by name, while `build`, `validate`, `explain`, `diff`, `render`, `check` and `inspect`
64
+ (`--poser core|spine`) run on rigc's own core over `skeleton.model.json` —
65
+ `rigc --version` names the entry that ran (AUTHORING §0). In the parse's place that
66
+ `build` runs two rules of its own over rigc's model document, `A00_MODEL_READ` and
67
+ `A00_MODEL_REGIONS_ON_PAGES`; they are not registry assertions, so its summary
68
+ counts two more, and AUTHORING §5.2 has a row for each.
67
69
 
68
70
  ## The loop
69
71
 
70
72
  1. `rigc build --rig <spec> --motion <spec> --images <dir> --out <dir>` compiles,
71
- gates, and writes only on green.
73
+ gates (under `--profile spine`, the default, or `--profile rig-play`), and writes
74
+ `skeleton.json`, `skeleton.atlas` and `skeleton.model.json` only on green.
72
75
  2. Read the report. Every red line names the file to change; fix the spec and
73
76
  build again.
74
77
  3. `rigc explain --rig <spec> --motion <spec> --out <dir>` when the red line is
@@ -85,11 +88,17 @@ row for each.
85
88
  cover a feature the art shows — and answer each with `render --hide <slot>` (or
86
89
  `--slot <slot,…>`), which draws the frame again without that part on the same
87
90
  grid, so the two frames say which part a pixel is. AUTHORING §0 holds the three.
88
- When the question is geometry — is this bone where the art is, which way does it
89
- squash, where in rig units is this point — `rigc inspect --candidate <out> --show
90
- art,bones,names --dim` draws the bones over the art and writes a legend beside the
91
- picture that puts every mark back in world units; AUTHORING §13 maps each
92
- question to its view.
91
+ For motion and dial readings, `render --pass-through <cloth>:<leg>` names the
92
+ frames where a cloth drawn over a leg passes through it (AUTHORING §8.5),
93
+ `render --angle-range <bone>:<relative-to>` prints how far a bone turns against
94
+ another (AUTHORING §8.7), `render --seam <slot>:<slot>` reads joint gaps,
95
+ visible ghosts and background exposure (AUTHORING §8.8), and
96
+ `render --parallax <dial>` reads a slider dial across its value grid
97
+ (AUTHORING §8.12). When the question is geometry — is this bone where the art is,
98
+ which way does it squash, where in rig units is this point —
99
+ `rigc inspect --candidate <out> --show art,bones,names --dim` draws the bones
100
+ over the art and writes a legend beside the picture that puts every mark back in
101
+ world units; AUTHORING §13 maps each question to its view.
93
102
  5. `rigc check --candidate <out> --frames <dir>` when you have reference pictures
94
103
  (`--out <dir>` writes the picture each of its numbers came from — open the worst).
95
104
  Read its output from the top: the framing block says whether the figures under
@@ -100,17 +109,21 @@ row for each.
100
109
  `rigc vote --candidate <a> --candidate <b>` when several candidates are green and
101
110
  only a person can choose between them.
102
111
  6. `rigc validate <out>` re-gates artifacts already on disk, and
103
- `rigc <command> --help` is each command's own flag table. `rigc repack <out>
104
- --out <dir>` packs a build again under `build --pack`'s packing flags when its
105
- parts were not kept, and writes only after every region and the skeleton are
106
- shown unchanged (`--accept-skeleton-differences` writes a rebuild whose skeleton
107
- differs, every difference printed; `--stage-box <slot>` reads a build's stage box)
108
- — AUTHORING §0.4. A mesh refused because its triangles are several pieces that
109
- share no vertex: `rigc split --rig … --motion … --slot <slot> --out <dir>` writes
110
- both specs back with one mesh per piece and every deform key renumbered — build
111
- that — AUTHORING §3.4.11.
112
- 7. Every finished unit ends with `rigc preview --candidate <out>`, and the report
113
- names the `.html` it wrote. The hand-off to a person is part of the work.
112
+ `rigc <command> --help` is each command's own flag table.
113
+ `rigc repack <out> --out <dir>` packs a build again under `build --pack`'s
114
+ packing flags when its parts were not kept, and writes only after every region and
115
+ the skeleton are shown unchanged (`--keep-pages` refreshes `skeleton.model.json`
116
+ over the existing atlas pages; `--accept-skeleton-differences` writes a rebuild
117
+ whose skeleton differs, every difference printed; `--stage-box <slot>` reads a
118
+ build's stage box) — AUTHORING §0.4. A mesh refused because its triangles are
119
+ several pieces that share no vertex: `rigc split --rig … --motion … --slot <slot> --out <dir>`
120
+ writes both specs back with one mesh per piece and every deform key renumbered —
121
+ build that — AUTHORING §3.4.11.
122
+ 7. Every finished unit ends with `rigc preview --candidate <out>` (or
123
+ `rigc review <out>` when `@rig-c/review` is installed beside the project and a
124
+ person reviews the build via its loopback URL, AUTHORING §0), and the report
125
+ names the `.html` or URL it produced. The hand-off to a person is part of the
126
+ work.
114
127
 
115
128
  The loop in full, with `pose` before it and `chainfit` after the first build:
116
129
  AUTHORING §0.
@@ -141,7 +154,7 @@ spec files field by field, the emission rules, the loop, and the failure map. Th
141
154
  | --- | --- | --- |
142
155
  | a **skeleton** — how many bones, where each pivot sits, what hangs off what | [RIGGING.md](https://github.com/rig-c/core/blob/main/docs/RIGGING.md) | `rigc-rigging` |
143
156
  | a **movement** — an idle, a loop, from this pose to that one | [MOTION.md](https://github.com/rig-c/core/blob/main/docs/MOTION.md) | `rigc-motion` |
144
- | a **face** — a blink, a gaze, a head turn a few degrees off axis | [FACE.md](https://github.com/rig-c/core/blob/main/docs/FACE.md) | `rigc-face` |
157
+ | a **face** — a blink, a gaze, a head turn or a value-driven face dial | [FACE.md](https://github.com/rig-c/core/blob/main/docs/FACE.md) | `rigc-face` |
145
158
  | a **skeleton.json somebody else authored** — read it, repair it, extend it | [INGEST.md](https://github.com/rig-c/core/blob/main/docs/INGEST.md) | `rigc-ingest` |
146
159
  | you are the **person operating** the agent rather than the agent | [PROMPTING.md](https://github.com/rig-c/core/blob/main/docs/PROMPTING.md) | — |
147
160
 
@@ -1,16 +1,17 @@
1
1
  ---
2
2
  name: rigc-face
3
- description: Author a face on plain Spine data with rigc — a blink, a gaze shift, a breathing portrait and a head turn a few degrees off axis, built from deform timelines and per-part parallax. Use when the request is a talking or living portrait, a standing character, an expression or a head turn, such as "rig this face", "make the portrait blink and look around" or "turn the head". Not for Live2D file conversion, cutting a face illustration into parts, or VTuber-style real-time face tracking.
3
+ description: Author a face on plain Spine data with rigc — a blink, a gaze shift, a breathing portrait, a head turn (from a flat sheet a few degrees off axis or a per-vertex depth map across its turn ceiling) and slider-driven face dials, built from closed-form deform transforms, derived group tracks, per-part parallax and socket alpha clipping. Use when the request is a talking or living portrait, a standing character, an expression, a head turn or a look dial, such as "rig this face", "make the portrait blink and look around" or "turn the head". Not for Live2D file conversion, cutting a face illustration into parts, or VTuber-style real-time face tracking.
4
4
  license: MIT
5
5
  compatibility: Requires Bun 1.4 or later and the npm package @rig-c/core (rig-c is the convenience name).
6
6
  ---
7
7
 
8
- # Face — a turn, a gaze and a blink
8
+ # Face — a turn, a gaze, a blink and a dial
9
9
 
10
10
  Load this when the request is a **head rather than a body**: a drawn face that
11
- breathes, blinks, moves its eyes and turns a few degrees off axis. Every rule below
12
- is owned by [FACE.md](https://github.com/rig-c/core/blob/main/docs/FACE.md); this file says when to open it and what
13
- it will not do for you.
11
+ breathes, blinks, moves its eyes, turns off axis (on a flat sheet or a per-vertex
12
+ `depth` map) or exposes its turn as a slider-driven dial. Every rule below is owned
13
+ by [FACE.md](https://github.com/rig-c/core/blob/main/docs/FACE.md); this file says when to open it and what it will
14
+ not do for you.
14
15
 
15
16
  📖 **A failure line ends with the command that prints its row of the guide** —
16
17
  ` (see rigc guide <RULE>)`. Run that command first, before reading anything else:
@@ -27,9 +28,22 @@ index within that same limit; only legacy uncoded library errors point at `§5.1
27
28
 
28
29
  - **Validation is never bypassed.** `build` writes nothing on a red gate, and there
29
30
  is no flag that changes that — AUTHORING §0.
30
- - **The compiler never invents a value.** A `deform` key states every vertex it
31
- moves; the geometry a turn implies is evaluated by you and written into the spec,
32
- never inferred by the compiler — AUTHORING §4 and FACE §1.
31
+ - **The compiler never invents a value.** A `deform` key states either explicit
32
+ vertex deltas or `transform` (`yaw`/`pitch` with `radius` and `degrees`, or over
33
+ the mesh's per-vertex `depth` sheet, AUTHORING §3.4.5 and FACE §2.1, §2.2), and a
34
+ bone group track states `derive` (`depth` per member, `carried` shared shift); the
35
+ compiler evaluates the closed form from the parameters you declare and never
36
+ guesses a radius, angle or depth — AUTHORING §4, §4.5.1, §4.11.1 and FACE §1,
37
+ §1.1, §3.1.
38
+ - **A face angle exposed as a dial is a slider constraint, not a playback time.**
39
+ Map a control bone across `[−1, +1]` onto the turn animation with a slider
40
+ (AUTHORING §3.5.2, FACE §8), bound its degrees by the turn ceiling `build` and
41
+ `explain` print for the depth sheet (FACE §2.2), set `additive: true` when yaw and
42
+ pitch dials share a target (`A40_SLIDERS_COMPOSE_ON_A_SHARED_TARGET`), keep driven
43
+ constraints after their driver (`A42_DRIVEN_CONSTRAINTS_UPDATE_AFTER_THEIR_DRIVER`),
44
+ read the dial across its value grid with `rigc render --candidate <out> --parallax <dial>`
45
+ (AUTHORING §8.12), and clip an iris or highlight to its painted socket with
46
+ `alphaClip` (AUTHORING §3.4, FACE §11).
33
47
  - **The validator's messages are the instructions.** Read each named failure as the
34
48
  pointer to the file that has to change — AUTHORING §5.
35
49
 
@@ -46,19 +60,23 @@ nothing about the fold, so author under `--profile rig-play`.
46
60
 
47
61
  What `A39` still cannot say is whether the projection was the right one —
48
62
  nothing measures whether 12° was the angle the shot wanted. FACE §9.2 is that
49
- demonstration, three builds with one of them refused, and §9.3 is the
50
- differential audit and the three limits it does not lift.
63
+ demonstration, three builds with one of them refused, and §9.3 is the differential
64
+ audit and the three limits it does not lift.
51
65
 
52
66
  ## Read, in this order
53
67
 
54
- 1. [AUTHORING.md](https://github.com/rig-c/core/blob/main/docs/AUTHORING.md) — the `deform` timeline field by field
55
- and what rigc refuses in it (§4), the failure map (§5–§6), the editor's
56
- conventions (§10).
68
+ 1. [AUTHORING.md](https://github.com/rig-c/core/blob/main/docs/AUTHORING.md) — `alphaClip` and per-vertex `depth` maps
69
+ (§3.4, §3.4.5), slider constraints (§3.5.2), the `deform` timeline, `derive` and
70
+ `transform` field by field (§4, §4.5.1, §4.11, §4.11.1), the failure map
71
+ (§5–§6), `render --parallax <dial>` (§8.12), and the editor's conventions (§10).
57
72
  2. [MOTION.md](https://github.com/rig-c/core/blob/main/docs/MOTION.md) — timing, easing and the offset table (§3),
58
73
  candidates and the ballot (§4–§5). A blink and a gaze are ordinary motion work.
59
- 3. [FACE.md](https://github.com/rig-c/core/blob/main/docs/FACE.md) — the face's own geometry: the closed form every
60
- number in a turn comes from (§1), the hierarchy underneath (§3), what
61
- foreshortens (§5), and the deform audit gap (§9).
74
+ 3. [FACE.md](https://github.com/rig-c/core/blob/main/docs/FACE.md) — the face's own geometry: the closed form and
75
+ `transform` (§1, §1.1), per-vertex depth sheets and turn ceilings (§2, §2.1,
76
+ §2.2), the shared-shift hierarchy and `derive` (§3, §3.1), the 3×5 mesh and its
77
+ silhouette cliff (§4), what foreshortens (§5), the blink and channel allocation
78
+ (§6–§7), the three cliffs and the turn as a slider-driven value (§8), the deform
79
+ audit gap (§9), and non-goals and `alphaClip` socket clipping (§11).
62
80
  4. Then [RIGGING.md](https://github.com/rig-c/core/blob/main/docs/RIGGING.md) for the hierarchy as a general rule
63
81
  rather than this closed form, and [INGEST.md](https://github.com/rig-c/core/blob/main/docs/INGEST.md) if the head
64
82
  arrived as a compiled skeleton.
@@ -36,17 +36,24 @@ index within that same limit; only legacy uncoded library errors point at `§5.1
36
36
  ## What this guide will not do
37
37
 
38
38
  Nothing grades a hierarchy. A rig with its head off its torso passes the gate, the
39
- pixels are nearly blind to structure, and the two instruments that see it at all
40
- are named in RIGGING §11 — neither as a pass bar.
39
+ pixels are nearly blind to structure, and the instruments that see it at all are
40
+ named in RIGGING §11 and §11.2 — none as a pass bar. `rigc pose` and `rigc chainfit`
41
+ read part placements and chain hinges from a key-pose picture inside the loop
42
+ (AUTHORING §11, RIGGING §9–§10); `rigc bonedist` measures per-frame bone
43
+ world-transform distance against the same rig's own `home` setup-pose animation
44
+ (RIGGING §7.3) or, at the finish line only, against another skeleton (RIGGING
45
+ §11.2, subject to the honesty rule in AUTHORING §9.1).
41
46
 
42
47
  ## Read, in this order
43
48
 
44
49
  1. [AUTHORING.md](https://github.com/rig-c/core/blob/main/docs/AUTHORING.md) — the rig spec field by field (§3),
45
- the failure map (§5–§6), reading a pose out of a picture (§8.1, §11, §12),
46
- and the editor's own conventions (§10).
50
+ the failure map (§5–§6), reading a pose out of a picture and diagnostic render
51
+ flags (§8.1, §8.5, §8.7, §8.8, §11, §12), the honesty rule (§9.1), and the
52
+ editor's own conventions (§10).
47
53
  2. [RIGGING.md](https://github.com/rig-c/core/blob/main/docs/RIGGING.md) — the structure itself: what identifies a
48
- pivot and what moving one costs (§2–§3), gauges (§4), what a chain can reach
49
- (§6), and the instruments that see structure (§11).
54
+ pivot and what moving one costs (§2–§3), gauges (§4), what a chain can reach and
55
+ `bonedist` against `home` (§6–§7, §7.3), and the instruments that see structure
56
+ (§11, §11.2).
50
57
  3. Then [MOTION.md](https://github.com/rig-c/core/blob/main/docs/MOTION.md) once the skeleton exists;
51
58
  [FACE.md](https://github.com/rig-c/core/blob/main/docs/FACE.md) if the figure is a head;
52
59
  [INGEST.md](https://github.com/rig-c/core/blob/main/docs/INGEST.md) if the skeleton was handed to you already