@mulmoclaude/shapescript-plugin 1.4.0 → 2.0.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.
@@ -3,7 +3,7 @@ import type { ToolPlugin } from "gui-chat-protocol/vue";
3
3
  import type { PresentShapeScriptData, PresentShapeScriptArgs } from "../core/types";
4
4
  import View from "./View.vue";
5
5
  import Preview from "./Preview.vue";
6
- export declare const SYSTEM_PROMPT = "Use the presentShapeScript tool to create interactive 3D visualizations when the user requests:\n- 3D models or shapes\n- Mathematical visualizations (surfaces, functions, geometric patterns)\n- Molecular or atomic structures\n- Data visualization in 3D (scatter plots, surface plots)\n- Architectural layouts\n- Game boards or 3D game states\n- Any spatial or geometric concepts\n\n## Supported ShapeScript Features:\n\n### Variables & Expressions:\n- Define variables: define radius 2, define spacing 1.5\n- Use expressions: position (i * 2) 0 0, size (radius * 1.5)\n- Math operators: +, -, *, /, % with proper precedence\n- Parentheses for grouping: (2 + 3) * 4\n\n### Control Flow:\n\nFor loops with variables (use loop variable in calculations):\nfor i in 1 to 5 {\n cube { position (i * 2 - 6) 0 0 size 1 }\n}\n\nFor loops with step:\nfor i in 0 to 10 step 2 {\n sphere { position 0 i 0 }\n}\n\nIf/else conditionals:\nif x > 0 {\n sphere\n} else {\n cube\n}\n\nSwitch statements for multiple cases\n\n### Built-in Functions:\n- Math: round, floor, ceil, abs, sign, sqrt, pow, min, max\n- Trig: sin, cos, tan, asin, acos, atan, atan2 (radians!)\n- Vector: dot, cross, length, normalize, sum\n\nCRITICAL: Function calls require NO space between name and (\n- sin(x) \u2713 correct\n- sin (x) \u2717 wrong - this is NOT a function call!\n\n### Best Practices:\n1. Use variables for repeated values\n2. Use loop variables (i) for positioning and calculations\n3. Use trig functions for circular/spiral patterns\n4. Use conditionals for parametric designs\n5. Keep code readable with meaningful variable names\n\n### Common Patterns:\n\nLinear arrangement:\nfor i in 1 to 5 {\n cube { position (i * 2) 0 0 }\n}\n\nCircular pattern:\ndefine count 12\nfor i in 1 to count {\n define angle ((i / count) * 6.283)\n cube { position (cos(angle) * 3) 0 (sin(angle) * 3) }\n}\n\nParametric surface:\nfor x in -5 to 5 {\n for z in -5 to 5 {\n define y (sin(x * 0.5) * cos(z * 0.5))\n cube { position (x * 0.3) y (z * 0.3) size 0.2 }\n }\n}\n\n### Primitives & CSG:\nShapes: cube, sphere, cylinder, cone, torus\nCSG: union, difference, intersection, xor, stencil\nProperties: position, rotation, size, color, opacity\n\nBuilders: extrude, fill, lathe, loft, hull. Example: loft { square translate 0 0 2 circle }.\nStencil preserves the first shape's volume and paints the intersecting surface.\nConstants: pi, tau, true, false. Tuple/string access: values[0], vector.x, value.count.\nPolygon supports sides (3\u2013256). String literals and join/trim are supported.\nUse the tool schema for exact syntax and builder limits. This is a modeling subset of upstream ShapeScript;\nimports, textures, text/fonts and general user-defined functions are not supported.\nIf presentShapeScript returns an error diagnostic, correct the script and retry; no visualization was created.\n\nKeep visualizations clear, well-organized, and use expressions and control flow.";
6
+ export declare const SYSTEM_PROMPT = "Use the presentShapeScript tool to create interactive 3D visualizations when the user requests:\n- 3D models or shapes\n- Mathematical visualizations (surfaces, functions, geometric patterns)\n- Molecular or atomic structures\n- Data visualization in 3D (scatter plots, surface plots)\n- Architectural layouts\n- Game boards or 3D game states\n- Any spatial or geometric concepts\n\n## Supported ShapeScript Features:\n\n### Variables & Expressions:\n- Define variables: define radius 2, define spacing 1.5\n- Use expressions: position (i * 2) 0 0, size (radius * 1.5)\n- Math operators: +, -, *, /, % with proper precedence\n- Parentheses for grouping: (2 + 3) * 4\n\n### Control Flow:\n\nFor loops with variables (use loop variable in calculations):\nfor i in 1 to 5 {\n cube {\n position (i * 2 - 6) 0 0\n size 1\n }\n}\n\nFor loops with step:\nfor i in 0 to 10 step 2 {\n sphere { position 0 i 0 }\n}\n\nIf/else conditionals:\nif x > 0 {\n sphere\n} else {\n cube\n}\n\nSwitch statements for multiple cases\n\n### Built-in Functions:\n- Math: round, floor, ceil, abs, sign, sqrt, pow, min, max\n- Trig: sin, cos, tan, asin, acos, atan, atan2 (radians!)\n- Vector: dot, cross, length, normalize, sum\n\nCRITICAL: Function calls require NO space between name and (\n- sin(x) \u2713 correct\n- sin (x) \u2717 wrong - this is NOT a function call!\nSeparate arguments with spaces, upstream style: max(0 (j - 1)). Commas work here but not in the upstream app.\nOne statement per line; the upstream app rejects two statements on one line.\n\n### Best Practices:\n1. Use variables for repeated values\n2. Use loop variables (i) for positioning and calculations\n3. Use trig functions for circular/spiral patterns\n4. Use conditionals for parametric designs\n5. Keep code readable with meaningful variable names\n\n### Common Patterns:\n\nLinear arrangement:\nfor i in 1 to 5 {\n cube { position (i * 2) 0 0 }\n}\n\nCircular pattern:\ndefine count 12\nfor i in 1 to count {\n define angle ((i / count) * 6.283)\n cube { position (cos(angle) * 3) 0 (sin(angle) * 3) }\n}\n\nParametric surface:\nfor x in -5 to 5 {\n for z in -5 to 5 {\n define y (sin(x * 0.5) * cos(z * 0.5))\n cube {\n position (x * 0.3) y (z * 0.3)\n size 0.2\n }\n }\n}\n\n### Primitives & CSG:\nShapes: cube, sphere, cylinder, cone, torus\nCSG: union, difference, intersection, xor, stencil\nProperties: position, orientation (alias rotation), size, color, opacity\n\n### Units (upstream ShapeScript conventions):\n- size = DIAMETER for sphere/cylinder/cone/circle/polygon/torus, edge length for cube/square. A bare sphere fits the unit cube.\n- orientation / rotate = HALF-TURNS as roll yaw pitch (Z, Y, X): 0.5 = 90\u00B0. A lone value is a roll. Trig functions still use radians.\n- Path point/curve coordinates are absolute; curve is a B\u00E9zier control point; rotate/translate/scale inside a path move the frame.\n- A path can carry its own position/orientation/size; give loft/extrude path children (not fill{}), as the upstream app requires.\n\nBuilders: extrude, fill, lathe, loft, hull. Example:\nloft {\n square\n translate 0 0 2\n circle\n}\nStencil preserves the first shape's volume and paints the intersecting surface.\nConstants: pi, true, false (avoid tau, upstream lacks it; write 2 * pi). Tuple/string access: values[0], vector.x, value.count.\nPolygon supports sides (3\u2013256). String literals and join/trim are supported.\nUse the tool schema for exact syntax and builder limits. This is a modeling subset of upstream ShapeScript;\nimports, textures, text/fonts and general user-defined functions are not supported.\nIf presentShapeScript returns an error diagnostic, correct the script and retry; no visualization was created.\n\nKeep visualizations clear, well-organized, and use expressions and control flow.";
7
7
  export declare const plugin: ToolPlugin<PresentShapeScriptData, unknown, PresentShapeScriptArgs>;
8
8
  export type { PresentShapeScriptData, PresentShapeScriptArgs, PresentShapeScriptResult, PresentShapeScriptRenderedResult, PresentShapeScriptErrorResult, PresentShapeScriptExecutionResult, ShapeScriptDiagnostic, } from "../core/types";
9
9
  export { TOOL_NAME, TOOL_DEFINITION } from "../core/definition";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIpF,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,eAAO,MAAM,aAAa,i7FAyFuD,CAAC;AAElF,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,sBAAsB,EAAE,OAAO,EAAE,sBAAsB,CAMtF,CAAC;AAEF,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvG,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAGzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;;;;AAEtD,wBAA0B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIpF,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,eAAO,MAAM,aAAa,8zHA4GuD,CAAC;AAElF,eAAO,MAAM,MAAM,EAAE,UAAU,CAAC,sBAAsB,EAAE,OAAO,EAAE,sBAAsB,CAMtF,CAAC;AAEF,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,gCAAgC,EAChC,6BAA6B,EAC7B,iCAAiC,EACjC,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvG,YAAY,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAGzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;;;;AAEtD,wBAA0B"}
package/dist/vue.cjs CHANGED
@@ -1,4 +1,4 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./samples-DZNAeuSZ.cjs"),t=require("./toThreeJS-XGDoVISb.cjs");let n=require("vue"),r=require("gui-chat-protocol/vue");function i(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&e!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e!==null&&e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function a(e){let t=new WeakMap;function n(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function r(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],r=a[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,a[t]=r)}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}function i(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)}function a(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))}function o(e,i){if(e.isInterleavedBufferAttribute&&(e=e.data),e.isGLBufferAttribute){let n=t.get(e);(!n||n.version<e.version)&&t.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version});return}let a=t.get(e);if(a===void 0)t.set(e,n(e,i));else if(a.version<e.version){if(a.size!==e.array.byteLength)throw Error(`THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.`);r(a.buffer,e,i),a.version=e.version}}return{get:i,remove:a,update:o}}var o={alphahash_fragment:`#ifdef USE_ALPHAHASH
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./samples-DGD0Kjwg.cjs"),t=require("./toThreeJS-MvllBF9e.cjs");let n=require("vue"),r=require("gui-chat-protocol/vue");function i(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){t!==!0&&n!==null&&e!==null&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e!==null&&e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function a(e){let t=new WeakMap;function n(t,n){let r=t.array,i=t.usage,a=r.byteLength,o=e.createBuffer();e.bindBuffer(n,o),e.bufferData(n,r,i),t.onUploadCallback();let s;if(r instanceof Float32Array)s=e.FLOAT;else if(typeof Float16Array<`u`&&r instanceof Float16Array)s=e.HALF_FLOAT;else if(r instanceof Uint16Array)s=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)s=e.SHORT;else if(r instanceof Uint32Array)s=e.UNSIGNED_INT;else if(r instanceof Int32Array)s=e.INT;else if(r instanceof Int8Array)s=e.BYTE;else if(r instanceof Uint8Array)s=e.UNSIGNED_BYTE;else if(r instanceof Uint8ClampedArray)s=e.UNSIGNED_BYTE;else throw Error(`THREE.WebGLAttributes: Unsupported buffer data format: `+r);return{buffer:o,type:s,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:a}}function r(t,n,r){let i=n.array,a=n.updateRanges;if(e.bindBuffer(r,t),a.length===0)e.bufferSubData(r,0,i);else{a.sort((e,t)=>e.start-t.start);let t=0;for(let e=1;e<a.length;e++){let n=a[t],r=a[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,a[t]=r)}a.length=t+1;for(let t=0,n=a.length;t<n;t++){let n=a[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}function i(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)}function a(n){n.isInterleavedBufferAttribute&&(n=n.data);let r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))}function o(e,i){if(e.isInterleavedBufferAttribute&&(e=e.data),e.isGLBufferAttribute){let n=t.get(e);(!n||n.version<e.version)&&t.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version});return}let a=t.get(e);if(a===void 0)t.set(e,n(e,i));else if(a.version<e.version){if(a.size!==e.array.byteLength)throw Error(`THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.`);r(a.buffer,e,i),a.version=e.version}}return{get:i,remove:a,update:o}}var o={alphahash_fragment:`#ifdef USE_ALPHAHASH
2
2
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
3
3
  #endif`,alphahash_pars_fragment:`#ifdef USE_ALPHAHASH
4
4
  const float ALPHA_HASH_SCALE = 0.05;
@@ -4122,7 +4122,10 @@ void main() {
4122
4122
 
4123
4123
  For loops with variables (use loop variable in calculations):
4124
4124
  for i in 1 to 5 {
4125
- cube { position (i * 2 - 6) 0 0 size 1 }
4125
+ cube {
4126
+ position (i * 2 - 6) 0 0
4127
+ size 1
4128
+ }
4126
4129
  }
4127
4130
 
4128
4131
  For loops with step:
@@ -4147,6 +4150,8 @@ Switch statements for multiple cases
4147
4150
  CRITICAL: Function calls require NO space between name and (
4148
4151
  - sin(x) ✓ correct
4149
4152
  - sin (x) ✗ wrong - this is NOT a function call!
4153
+ Separate arguments with spaces, upstream style: max(0 (j - 1)). Commas work here but not in the upstream app.
4154
+ One statement per line; the upstream app rejects two statements on one line.
4150
4155
 
4151
4156
  ### Best Practices:
4152
4157
  1. Use variables for repeated values
@@ -4173,18 +4178,32 @@ Parametric surface:
4173
4178
  for x in -5 to 5 {
4174
4179
  for z in -5 to 5 {
4175
4180
  define y (sin(x * 0.5) * cos(z * 0.5))
4176
- cube { position (x * 0.3) y (z * 0.3) size 0.2 }
4181
+ cube {
4182
+ position (x * 0.3) y (z * 0.3)
4183
+ size 0.2
4184
+ }
4177
4185
  }
4178
4186
  }
4179
4187
 
4180
4188
  ### Primitives & CSG:
4181
4189
  Shapes: cube, sphere, cylinder, cone, torus
4182
4190
  CSG: union, difference, intersection, xor, stencil
4183
- Properties: position, rotation, size, color, opacity
4184
-
4185
- Builders: extrude, fill, lathe, loft, hull. Example: loft { square translate 0 0 2 circle }.
4191
+ Properties: position, orientation (alias rotation), size, color, opacity
4192
+
4193
+ ### Units (upstream ShapeScript conventions):
4194
+ - size = DIAMETER for sphere/cylinder/cone/circle/polygon/torus, edge length for cube/square. A bare sphere fits the unit cube.
4195
+ - orientation / rotate = HALF-TURNS as roll yaw pitch (Z, Y, X): 0.5 = 90°. A lone value is a roll. Trig functions still use radians.
4196
+ - Path point/curve coordinates are absolute; curve is a Bézier control point; rotate/translate/scale inside a path move the frame.
4197
+ - A path can carry its own position/orientation/size; give loft/extrude path children (not fill{}), as the upstream app requires.
4198
+
4199
+ Builders: extrude, fill, lathe, loft, hull. Example:
4200
+ loft {
4201
+ square
4202
+ translate 0 0 2
4203
+ circle
4204
+ }
4186
4205
  Stencil preserves the first shape's volume and paints the intersecting surface.
4187
- Constants: pi, tau, true, false. Tuple/string access: values[0], vector.x, value.count.
4206
+ Constants: pi, true, false (avoid tau, upstream lacks it; write 2 * pi). Tuple/string access: values[0], vector.x, value.count.
4188
4207
  Polygon supports sides (3–256). String literals and join/trim are supported.
4189
4208
  Use the tool schema for exact syntax and builder limits. This is a modeling subset of upstream ShapeScript;
4190
4209
  imports, textures, text/fonts and general user-defined functions are not supported.
package/dist/vue.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as e, h as t, n, o as r, r as i, s as a, t as o, v as s, y as c } from "./samples-DPOGWslc.js";
2
- import { $ as l, A as u, An as d, B as f, Bn as p, C as m, Cn as h, D as g, Dn as _, E as v, En as y, Fn as b, G as x, Gt as S, H as C, Ht as w, I as T, In as E, J as D, Jt as O, K as k, L as A, Mn as j, N as M, Nn as ee, O as te, On as N, P as ne, Pn as P, Q as re, R as ie, S as ae, Sn as oe, T as F, Tn as se, U as ce, Ut as I, V as L, Vn as le, W as R, Wt as ue, X as de, Y as z, Yt as fe, Z as B, _ as pe, _n as me, a as he, an as ge, at as _e, b as ve, bn as V, c as ye, cn as be, d as xe, dn as Se, dt as Ce, en as we, et as Te, ft as Ee, g as De, gn as Oe, h as H, hn as ke, i as Ae, j as je, jn as Me, k as Ne, kn as Pe, l as U, ln as Fe, m as W, nn as Ie, nt as Le, on as G, p as Re, pn as ze, q as K, qt as Be, r as q, rn as Ve, rt as He, s as Ue, sn as We, st as Ge, tn as Ke, tt as qe, u as Je, un as Ye, v as Xe, vn as Ze, w as Qe, wn as $e, x as et, xn as tt, y as nt, yn as J, z as rt, zn as it } from "./toThreeJS-BX_aeGdA.js";
1
+ import { a as e, h as t, n, o as r, r as i, s as a, t as o, v as s, y as c } from "./samples-CXhuDdDd.js";
2
+ import { $ as l, A as u, An as d, B as f, Bn as p, C as m, Cn as h, D as g, Dn as _, E as v, En as y, Fn as b, G as x, Gt as S, H as C, Ht as w, I as T, In as E, J as D, Jt as O, K as k, L as A, Mn as j, N as M, Nn as ee, O as te, On as N, P as ne, Pn as P, Q as re, R as ie, S as ae, Sn as oe, T as F, Tn as se, U as ce, Ut as I, V as L, Vn as le, W as R, Wt as ue, X as de, Y as z, Yt as fe, Z as B, _ as pe, _n as me, a as he, an as ge, at as _e, b as ve, bn as V, c as ye, cn as be, d as xe, dn as Se, dt as Ce, en as we, et as Te, ft as Ee, g as De, gn as Oe, h as H, hn as ke, i as Ae, j as je, jn as Me, k as Ne, kn as Pe, l as U, ln as Fe, m as W, nn as Ie, nt as Le, on as G, p as Re, pn as ze, q as K, qt as Be, r as q, rn as Ve, rt as He, s as Ue, sn as We, st as Ge, tn as Ke, tt as qe, u as Je, un as Ye, v as Xe, vn as Ze, w as Qe, wn as $e, x as et, xn as tt, y as nt, yn as J, z as rt, zn as it } from "./toThreeJS-FsP-Na75.js";
3
3
  import { computed as at, createCommentVNode as Y, createElementBlock as ot, createElementVNode as X, createTextVNode as st, defineComponent as ct, nextTick as lt, onMounted as ut, onUnmounted as dt, openBlock as ft, ref as pt, toDisplayString as mt, unref as ht, vModelText as gt, watch as _t, withDirectives as vt } from "vue";
4
4
  import { createUseT as yt, useRuntime as bt } from "gui-chat-protocol/vue";
5
5
  //#region ../../../node_modules/three/build/three.module.js
@@ -6769,7 +6769,10 @@ var oa = yt({
6769
6769
 
6770
6770
  For loops with variables (use loop variable in calculations):
6771
6771
  for i in 1 to 5 {
6772
- cube { position (i * 2 - 6) 0 0 size 1 }
6772
+ cube {
6773
+ position (i * 2 - 6) 0 0
6774
+ size 1
6775
+ }
6773
6776
  }
6774
6777
 
6775
6778
  For loops with step:
@@ -6794,6 +6797,8 @@ Switch statements for multiple cases
6794
6797
  CRITICAL: Function calls require NO space between name and (
6795
6798
  - sin(x) ✓ correct
6796
6799
  - sin (x) ✗ wrong - this is NOT a function call!
6800
+ Separate arguments with spaces, upstream style: max(0 (j - 1)). Commas work here but not in the upstream app.
6801
+ One statement per line; the upstream app rejects two statements on one line.
6797
6802
 
6798
6803
  ### Best Practices:
6799
6804
  1. Use variables for repeated values
@@ -6820,18 +6825,32 @@ Parametric surface:
6820
6825
  for x in -5 to 5 {
6821
6826
  for z in -5 to 5 {
6822
6827
  define y (sin(x * 0.5) * cos(z * 0.5))
6823
- cube { position (x * 0.3) y (z * 0.3) size 0.2 }
6828
+ cube {
6829
+ position (x * 0.3) y (z * 0.3)
6830
+ size 0.2
6831
+ }
6824
6832
  }
6825
6833
  }
6826
6834
 
6827
6835
  ### Primitives & CSG:
6828
6836
  Shapes: cube, sphere, cylinder, cone, torus
6829
6837
  CSG: union, difference, intersection, xor, stencil
6830
- Properties: position, rotation, size, color, opacity
6838
+ Properties: position, orientation (alias rotation), size, color, opacity
6839
+
6840
+ ### Units (upstream ShapeScript conventions):
6841
+ - size = DIAMETER for sphere/cylinder/cone/circle/polygon/torus, edge length for cube/square. A bare sphere fits the unit cube.
6842
+ - orientation / rotate = HALF-TURNS as roll yaw pitch (Z, Y, X): 0.5 = 90°. A lone value is a roll. Trig functions still use radians.
6843
+ - Path point/curve coordinates are absolute; curve is a Bézier control point; rotate/translate/scale inside a path move the frame.
6844
+ - A path can carry its own position/orientation/size; give loft/extrude path children (not fill{}), as the upstream app requires.
6831
6845
 
6832
- Builders: extrude, fill, lathe, loft, hull. Example: loft { square translate 0 0 2 circle }.
6846
+ Builders: extrude, fill, lathe, loft, hull. Example:
6847
+ loft {
6848
+ square
6849
+ translate 0 0 2
6850
+ circle
6851
+ }
6833
6852
  Stencil preserves the first shape's volume and paints the intersecting surface.
6834
- Constants: pi, tau, true, false. Tuple/string access: values[0], vector.x, value.count.
6853
+ Constants: pi, true, false (avoid tau, upstream lacks it; write 2 * pi). Tuple/string access: values[0], vector.x, value.count.
6835
6854
  Polygon supports sides (3–256). String literals and join/trim are supported.
6836
6855
  Use the tool schema for exact syntax and builder limits. This is a modeling subset of upstream ShapeScript;
6837
6856
  imports, textures, text/fonts and general user-defined functions are not supported.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulmoclaude/shapescript-plugin",
3
- "version": "1.4.0",
3
+ "version": "2.0.0",
4
4
  "description": "presentShapeScript \u2014 interactive 3D visualizations authored in the ShapeScript language (parser + Three.js renderer). Core (tool definition + execute) on `.`, Vue View/Preview on `./vue`.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",