spine-rigc 2.57.0 → 2.58.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spine-rigc",
3
- "version": "2.57.0",
3
+ "version": "2.58.0",
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": {
@@ -18,7 +18,9 @@ whole interface, and this skill only says which of them to open.
18
18
  ` (see rigc guide <RULE>)`. Run that command first, before reading anything else:
19
19
  it prints that rule's row of the shipped guide and nothing else, and `rigc guide §<n>`
20
20
  (and `§<n>.<m>`, `§<n>.<m>.<k>`)
21
- prints one section of `docs/AUTHORING.md` — a compile error points at `§5.1`.
21
+ prints one section of `docs/AUTHORING.md` — a compile error points at its stable `CE_` code row. `rigc guide §5.1.<k>`
22
+ prints a numbered compile-error group of at most 30,000 UTF-8 bytes; only legacy
23
+ uncoded library errors point at `§5.1`.
22
24
 
23
25
  ## Non-negotiables
24
26
 
@@ -16,7 +16,9 @@ it will not do for you.
16
16
  ` (see rigc guide <RULE>)`. Run that command first, before reading anything else:
17
17
  it prints that rule's row of the shipped guide and nothing else, and `rigc guide §<n>`
18
18
  (and `§<n>.<m>`, `§<n>.<m>.<k>`)
19
- prints one section of `docs/AUTHORING.md` — a compile error points at `§5.1`.
19
+ prints one section of `docs/AUTHORING.md` — a compile error points at its stable `CE_` code row. `rigc guide §5.1.<k>`
20
+ prints a numbered compile-error group of at most 30,000 UTF-8 bytes; only legacy
21
+ uncoded library errors point at `§5.1`.
20
22
 
21
23
  ## Non-negotiables
22
24
 
@@ -17,7 +17,9 @@ not do for you.
17
17
  ` (see rigc guide <RULE>)`. Run that command first, before reading anything else:
18
18
  it prints that rule's row of the shipped guide and nothing else, and `rigc guide §<n>`
19
19
  (and `§<n>.<m>`, `§<n>.<m>.<k>`)
20
- prints one section of `docs/AUTHORING.md` — a compile error points at `§5.1`.
20
+ prints one section of `docs/AUTHORING.md` — a compile error points at its stable `CE_` code row. `rigc guide §5.1.<k>`
21
+ prints a numbered compile-error group of at most 30,000 UTF-8 bytes; only legacy
22
+ uncoded library errors point at `§5.1`.
21
23
 
22
24
  ## Non-negotiables
23
25
 
@@ -17,7 +17,9 @@ not do for you.
17
17
  ` (see rigc guide <RULE>)`. Run that command first, before reading anything else:
18
18
  it prints that rule's row of the shipped guide and nothing else, and `rigc guide §<n>`
19
19
  (and `§<n>.<m>`, `§<n>.<m>.<k>`)
20
- prints one section of `docs/AUTHORING.md` — a compile error points at `§5.1`.
20
+ prints one section of `docs/AUTHORING.md` — a compile error points at its stable `CE_` code row. `rigc guide §5.1.<k>`
21
+ prints a numbered compile-error group of at most 30,000 UTF-8 bytes; only legacy
22
+ uncoded library errors point at `§5.1`.
21
23
 
22
24
  ## Non-negotiables
23
25
 
@@ -16,7 +16,9 @@ will not do for you.
16
16
  ` (see rigc guide <RULE>)`. Run that command first, before reading anything else:
17
17
  it prints that rule's row of the shipped guide and nothing else, and `rigc guide §<n>`
18
18
  (and `§<n>.<m>`, `§<n>.<m>.<k>`)
19
- prints one section of `docs/AUTHORING.md` — a compile error points at `§5.1`.
19
+ prints one section of `docs/AUTHORING.md` — a compile error points at its stable `CE_` code row. `rigc guide §5.1.<k>`
20
+ prints a numbered compile-error group of at most 30,000 UTF-8 bytes; only legacy
21
+ uncoded library errors point at `§5.1`.
20
22
 
21
23
  ## Non-negotiables
22
24
 
package/src/atlas.ts CHANGED
@@ -1998,7 +1998,7 @@ function packOnePageByFootprint(
1998
1998
  if (shapesMeet(shape, put.x, put.y, other.shape, other.x, other.y)) {
1999
1999
  throw new CompileError(
2000
2000
  `internal: the footprint pass placed a ${shape.width}x${shape.height} cell at ${put.x},${put.y} over ` +
2001
- `the footprint of the ${other.shape.width}x${other.shape.height} cell at ${other.x},${other.y}`,
2001
+ `the footprint of the ${other.shape.width}x${other.shape.height} cell at ${other.x},${other.y}`, 'CE_ATLAS_INTERNAL_FOOTPRINT_OVERLAP',
2002
2002
  );
2003
2003
  }
2004
2004
  }
@@ -2313,7 +2313,7 @@ function layoutPack(
2313
2313
  // Unreachable: every cell was proven to fit an empty page above. Kept as
2314
2314
  // a named stop rather than an infinite loop if that ever stops holding.
2315
2315
  throw new CompileError(
2316
- `packing stalled with ${remaining.length} region(s) left and an empty ${maxEdge}x${maxEdge} page`,
2316
+ `packing stalled with ${remaining.length} region(s) left and an empty ${maxEdge}x${maxEdge} page`, 'CE_ATLAS_PACKING_STALLED',
2317
2317
  );
2318
2318
  }
2319
2319
  // ⭐ Then the page is written at the smallest power-of-two pair that holds
@@ -2337,7 +2337,7 @@ function layoutPack(
2337
2337
  if (shrunk === null) {
2338
2338
  // Unreachable for the same reason as the stall above: these cells were
2339
2339
  // just placed on a maxEdge page.
2340
- throw new CompileError(`page ${pageIndex + 1} of the spill holds ${onPage.length} region(s) that no page fits`);
2340
+ throw new CompileError(`page ${pageIndex + 1} of the spill holds ${onPage.length} region(s) that no page fits`, 'CE_ATLAS_SPILL_UNPACKABLE');
2341
2341
  }
2342
2342
  const onThisPage: Placement[] = [];
2343
2343
  shrunk.rects.forEach((rect, i) => {
@@ -2460,19 +2460,19 @@ export function packAtlas(inputs: PackInput[], opts: PackOptions = {}): PackResu
2460
2460
  const stem = opts.pageStem ?? 'skeleton';
2461
2461
  const pageEdges = opts.pageEdges ?? DEFAULT_PAGE_EDGES;
2462
2462
  if (!PAGE_EDGES.includes(pageEdges)) {
2463
- throw new CompileError(`--page-edges ${JSON.stringify(String(opts.pageEdges))}; known values: ${PAGE_EDGES.join(', ')}`);
2463
+ throw new CompileError(`--page-edges ${JSON.stringify(String(opts.pageEdges))}; known values: ${PAGE_EDGES.join(', ')}`, 'CE_ATLAS_PAGE_EDGES_VALUE');
2464
2464
  }
2465
2465
  const shape = opts.shape ?? DEFAULT_PACK_SHAPE;
2466
2466
  if (!PACK_SHAPES.includes(shape)) {
2467
- throw new CompileError(`--pack-shape ${JSON.stringify(String(opts.shape))}; known values: ${PACK_SHAPES.join(', ')}`);
2467
+ throw new CompileError(`--pack-shape ${JSON.stringify(String(opts.shape))}; known values: ${PACK_SHAPES.join(', ')}`, 'CE_ATLAS_PACK_SHAPE_VALUE');
2468
2468
  }
2469
2469
  if (!Number.isInteger(pageSize) || pageSize < 1) {
2470
- throw new CompileError(`--page-size must be a positive integer, got ${String(opts.pageSize)}`);
2470
+ throw new CompileError(`--page-size must be a positive integer, got ${String(opts.pageSize)}`, 'CE_ATLAS_PAGE_SIZE_POSITIVE_INTEGER');
2471
2471
  }
2472
2472
  if (!Number.isInteger(padding) || padding < 0) {
2473
- throw new CompileError(`--padding must be a non-negative integer, got ${String(opts.padding)}`);
2473
+ throw new CompileError(`--padding must be a non-negative integer, got ${String(opts.padding)}`, 'CE_ATLAS_PADDING_NONNEGATIVE_INTEGER');
2474
2474
  }
2475
- if (inputs.length === 0) throw new CompileError('nothing to pack: this compile emitted no images');
2475
+ if (inputs.length === 0) throw new CompileError('nothing to pack: this compile emitted no images', 'CE_ATLAS_IMAGES_REQUIRED');
2476
2476
 
2477
2477
  const maxEdge = floorPowerOfTwo(pageSize);
2478
2478
 
@@ -2485,7 +2485,7 @@ export function packAtlas(inputs: PackInput[], opts: PackOptions = {}): PackResu
2485
2485
  `"${sorted[i].region}" is ${sorted[i].width}x${sorted[i].height} and with --padding ${padding} needs a ` +
2486
2486
  `${cells[i].w}x${cells[i].h} cell, which does not fit a ${maxEdge}x${maxEdge} page ` +
2487
2487
  `(${sorted[i].absPath}). Raise --page-size, lower --padding, or leave this build unpacked — a packer ` +
2488
- 'cannot split one drawing across two pages.',
2488
+ 'cannot split one drawing across two pages.', 'CE_ATLAS_REGION_EXCEEDS_PAGE',
2489
2489
  );
2490
2490
  }
2491
2491
 
@@ -2542,7 +2542,7 @@ export function packAtlas(inputs: PackInput[], opts: PackOptions = {}): PackResu
2542
2542
  // two reads, or one of the two readers is wrong about it.
2543
2543
  throw new CompileError(
2544
2544
  `"${place.region}" measured ${input.width}x${input.height} from its PNG header and decodes to ` +
2545
- `${source.width}x${source.height} (${input.absPath})`,
2545
+ `${source.width}x${source.height} (${input.absPath})`, 'CE_ATLAS_IMAGE_DIMENSIONS_CHANGED',
2546
2546
  );
2547
2547
  }
2548
2548
  extrudeCell(plate, source, place.x - padding, place.y - padding, padding);
package/src/cli/shared.ts CHANGED
@@ -2956,8 +2956,8 @@ function refuse(err: unknown, command: string | undefined, USAGE: string, entry:
2956
2956
  process.exit(2);
2957
2957
  }
2958
2958
  if (err instanceof CompileError) {
2959
- // Ends with ` (see rigc guide §5.1)` (issue #1397): a compile error names no rule, so it points at the section.
2960
- console.error(compileErrorLine(err.message));
2959
+ // The site's code points at its one AUTHORING row; uncoded library errors keep the legacy section.
2960
+ console.error(compileErrorLine(err.message, err.code));
2961
2961
  // The drops the compile recorded before it stopped, in the same line the
2962
2962
  // green build prints (issue #671). They were reported from the compile
2963
2963
  // RESULT alone, so the run that failed BECAUSE a file was missing was the