castle-web-cli 0.4.115 → 0.4.117

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 (55) hide show
  1. package/dist/agent-prompts.js +2 -2
  2. package/dist/agent.d.ts +9 -9
  3. package/dist/agent.js +590 -589
  4. package/dist/castleJson.d.ts +6 -0
  5. package/dist/castleJson.js +10 -0
  6. package/dist/editorConfig.js +27 -3
  7. package/dist/imports.d.ts +4 -0
  8. package/dist/imports.js +59 -10
  9. package/dist/init.d.ts +3 -0
  10. package/dist/init.js +103 -87
  11. package/dist/install.d.ts +1 -1
  12. package/dist/install.js +26 -24
  13. package/dist/shell/assets/{index-CUamb8rK.js → index-DiPlPGyg.js} +2 -2
  14. package/dist/shell/index.html +1 -1
  15. package/dist/vitePlugins.js +1 -1
  16. package/kits/physics-2d/CLAUDE.md +28 -16
  17. package/kits/physics-2d/behaviors/Joints.jsx +1 -1
  18. package/kits/physics-2d/behaviors/Sprite.jsx +17 -12
  19. package/kits/physics-2d/blueprints/ball.scene +1 -1
  20. package/kits/physics-2d/blueprints/block.scene +1 -1
  21. package/kits/physics-2d/blueprints/cauldron.scene +1 -1
  22. package/kits/physics-2d/blueprints/crate.scene +1 -1
  23. package/kits/physics-2d/castle.json +11 -3
  24. package/kits/physics-2d/docs/pxart-format.md +537 -51
  25. package/kits/physics-2d/editors/PxArtEditor.jsx +1794 -65
  26. package/kits/physics-2d/editors/brushFit.js +535 -0
  27. package/kits/physics-2d/editors/brushShapes.js +140 -0
  28. package/kits/physics-2d/editors/mediaFile.js +12 -1
  29. package/kits/physics-2d/editors/pathOverlay.js +340 -0
  30. package/kits/physics-2d/editors/pathTools.js +1906 -0
  31. package/kits/physics-2d/editors/pixelCanvas.js +13 -0
  32. package/kits/physics-2d/editors/pixelEditorChrome.jsx +2 -2
  33. package/kits/physics-2d/editors/pixelGeometry.js +4 -2
  34. package/kits/physics-2d/editors/pixelInspector.jsx +410 -37
  35. package/kits/physics-2d/editors/pxArtEditorModel.js +172 -16
  36. package/kits/physics-2d/editors/pxArtTimeline.jsx +163 -43
  37. package/kits/physics-2d/editors/pxArtTimeline.module.css +31 -5
  38. package/kits/physics-2d/engine/assets.js +1 -1
  39. package/kits/physics-2d/engine/blueprint.js +3 -3
  40. package/kits/physics-2d/engine/files.js +3 -1
  41. package/kits/physics-2d/engine/liveReload.js +1 -1
  42. package/kits/physics-2d/engine/physics/jointArt.js +3 -3
  43. package/kits/physics-2d/engine/pxart.js +153 -35
  44. package/kits/physics-2d/engine/pxartPath.js +1356 -0
  45. package/kits/physics-2d/engine/pxartSmooth.js +276 -125
  46. package/kits/physics-2d/engine/ui.jsx +22 -1
  47. package/kits/physics-2d/engine/ui.module.css +36 -12
  48. package/kits/physics-2d/package-lock.json +1 -1
  49. package/kits/physics-2d/scripts/draw.mjs +7 -7
  50. package/kits/physics-2d/scripts/import-svg.mjs +1231 -0
  51. package/kits/physics-2d/scripts/svg-emission-guide.md +92 -0
  52. package/package.json +1 -1
  53. /package/kits/physics-2d/drawings/{block.pxart → block.sprite} +0 -0
  54. /package/kits/physics-2d/drawings/{cauldron.pxart → cauldron.sprite} +0 -0
  55. /package/kits/physics-2d/drawings/{joint-rope.pxart → joint-rope.sprite} +0 -0
@@ -2,7 +2,7 @@
2
2
  //
3
3
  // Reads an <svg> with one <rect> per pixel from stdin (or `--from <file>`),
4
4
  // decodes + palette-quantizes it onto the agent 16-color subset, and writes a
5
- // single-frame `drawings/<name>.pxart` in the deck (the script's cwd).
5
+ // single-frame `drawings/<name>.sprite` in the deck (the script's cwd).
6
6
  //
7
7
  // This is a kit-layer concern: the `.pxart` format lives entirely in the kit
8
8
  // (engine/pxart.js); the harness has no knowledge of it.
@@ -31,19 +31,19 @@ function readStdin() {
31
31
  });
32
32
  }
33
33
 
34
- // Normalize a requested sprite name into a relative `drawings/<...>.pxart`
35
- // path. Tolerates a leading `drawings/` and/or a trailing `.pxart`/`.px.json`
36
- // so `draw ship`, `draw ship.pxart`, and `draw drawings/ship.pxart` all land in
34
+ // Normalize a requested sprite name into a relative `drawings/<...>.sprite`
35
+ // path. Tolerates a leading `drawings/` and/or a trailing `.sprite`/`.pxart`/`.px.json`
36
+ // so `draw ship`, `draw ship.sprite`, and `draw drawings/ship.pxart` all land in
37
37
  // the same place.
38
38
  function resolveSpritePath(dir, name) {
39
39
  let rel = name.trim().replace(/\\/g, '/');
40
40
  rel = rel.replace(/^\.?\/*/, '');
41
41
  if (rel.startsWith('drawings/')) rel = rel.slice('drawings/'.length);
42
- rel = rel.replace(/\.px\.json$/i, '').replace(/\.pxart$/i, '');
42
+ rel = rel.replace(/\.px\.json$/i, '').replace(/\.(?:pxart|sprite)$/i, '');
43
43
  if (!rel) return null;
44
44
 
45
45
  const drawingsDir = path.resolve(dir, 'drawings');
46
- const filepath = path.resolve(drawingsDir, `${rel}.pxart`);
46
+ const filepath = path.resolve(drawingsDir, `${rel}.sprite`);
47
47
  const within = path.relative(drawingsDir, filepath);
48
48
  if (within.startsWith('..') || path.isAbsolute(within)) return null;
49
49
  return filepath;
@@ -72,7 +72,7 @@ function positionals() {
72
72
  async function main() {
73
73
  const name = positionals()[0];
74
74
  if (!name) {
75
- console.error('Usage: npm run draw -- <name> [--from FILE] (svg-rect on stdin -> drawings/<name>.pxart)');
75
+ console.error('Usage: npm run draw -- <name> [--from FILE] (svg-rect on stdin -> drawings/<name>.sprite)');
76
76
  process.exit(1);
77
77
  }
78
78