@mulmoclaude/shapescript-plugin 2.7.1 → 3.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.
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/publish.d.ts +23 -8
- package/dist/core/publish.d.ts.map +1 -1
- package/dist/{core-Bt3MvxL7.js → core-7JKG8RwN.js} +44 -36
- package/dist/core-Z6twLrfC.cjs +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/lang/de.d.ts.map +1 -1
- package/dist/lang/en.d.ts.map +1 -1
- package/dist/lang/es.d.ts.map +1 -1
- package/dist/lang/fr.d.ts.map +1 -1
- package/dist/lang/ja.d.ts.map +1 -1
- package/dist/lang/ko.d.ts.map +1 -1
- package/dist/lang/messages.d.ts +4 -0
- package/dist/lang/messages.d.ts.map +1 -1
- package/dist/lang/ptBR.d.ts.map +1 -1
- package/dist/lang/zh.d.ts.map +1 -1
- package/dist/render/index.d.ts +1 -1
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/tool.d.ts +6 -0
- package/dist/render/tool.d.ts.map +1 -1
- package/dist/render.cjs +5 -5
- package/dist/render.js +23 -23
- package/dist/style.css +1 -1
- package/dist/vue/View.vue.d.ts.map +1 -1
- package/dist/vue.cjs +3 -3
- package/dist/vue.js +369 -338
- package/package.json +3 -3
- package/dist/core-B3GMdzSM.cjs +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mulmoclaude/shapescript-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "presentShapeScript — 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",
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"three-mesh-bvh": "0.9.15"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@mulmoclaude/core": "^4.9.
|
|
50
|
+
"@mulmoclaude/core": "^4.9.3",
|
|
51
51
|
"gui-chat-protocol": "^2.0.0",
|
|
52
52
|
"puppeteer": "^25.0.0",
|
|
53
53
|
"vue": "^3.5.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@eslint/js": "^10.0.1",
|
|
57
|
-
"@mulmoclaude/core": "^4.9.
|
|
57
|
+
"@mulmoclaude/core": "^4.9.3",
|
|
58
58
|
"@tailwindcss/vite": "^4.3.3",
|
|
59
59
|
"@types/node": "^26.4.1",
|
|
60
60
|
"@types/three": "^0.186.0",
|
package/dist/core-B3GMdzSM.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./samples-BO-oAFPZ.cjs"),t=require("./toThreeJS-CDRtoJt7.cjs");var n=`exportShapeScriptUsdz`,r=t.t+3e4,i="Export a ShapeScript model to a USDZ file (Apple's AR / 3D format, openable with AR Quick Look on iPhone, iPad and Mac) and save it under artifacts/shapes/. Returns the saved path. Takes the same source as presentShapeScript: inline `script`, or `path` to a saved .shape file. USDZ units are metres, so a `size 1` cube becomes a one-metre object in AR — scale the model in the script if that is not what the user wants.",a=`Use exportShapeScriptUsdz when the user wants to take a 3D model out of the chat — to view it in AR, open it in a 3D app, or share the file. It saves a .usdz next to the model's .shape file and returns the path; tell the user where it is. The user can also press "Download USDZ" in the model's view themselves.`,o={type:`object`,properties:{script:{type:`string`,description:"ShapeScript source to export. Provide either this or `path`, not both."},path:{type:`string`,description:`Path to an existing .shape file to export (e.g. one presentShapeScript saved under artifacts/shapes/).`},title:{type:`string`,description:"Name for the exported file; it is slugified into the filename. Defaults to the .shape file's own name when `path` is given."}},required:[]};function s(e){return typeof e==`string`&&e.trim()!==``?e:void 0}function c(e){return(e.split(/[\\/]/).pop()??e).replace(/\.shape$/i,``)}async function l(t,n){let r=s(n.script),i=s(n.path),a=s(n.title);if(r&&i)throw Error("Provide either `script` or `path`, not both");if(r)return{script:r,title:a};if(!i)throw Error("Provide either `script` (inline source) or `path` (an existing .shape file)");let o=e.u(t,i);if(!o)throw Error("`path` must name a .shape file, without `.` / `..` segments");if(!await o.files.exists(o.rel))throw Error(`No ShapeScript exists at ${i}`);return{script:await o.files.read(o.rel),title:a??c(i)}}async function u(t,n){let{script:r,title:i}=await l(t,n),a=await e.a(r),{relPath:o,filePath:s}=e._(i);return await t.files.artifacts.write(o,a),{message:`Saved USDZ to ${s} (${a.byteLength} bytes). Open it with AR Quick Look or any USD viewer.`,filePath:s,bytes:a.byteLength}}var d=`publishShapeScript`,f=`https://server.mulmocast.com`,p={titleMax:120,descriptionMax:2e3,scriptMax:1e5,promptMax:4e3,authorNameMax:80,keywordsMax:10,keywordMax:30},m="Publish a ShapeScript model to the public gallery at server.mulmocast.com/shapes, where anyone can view it in 3D, read the source, download the USDZ and fork it. Takes the same source as presentShapeScript: inline `script`, or `path` to a saved .shape file. Posts under the user's own Google account — the app must be connected to Remote Host (signed in) first — and returns the model's URL. A thumbnail is rendered and attached when the host can rasterise; the post still lands without one.",h="Use publishShapeScript ONLY when the user asks to publish, post or share a model to the gallery — never on your own initiative, since it makes the model public under their name. Before calling it, make sure the model previews correctly (presentShapeScript / renderShapeScript) and give it a short title, a sentence of description and a few lowercase keywords someone would search for. Pass the user's original request as `prompt` so the post records how the model was made. If the tool answers that Remote Host is not connected, tell the user to connect it (the Remote Host control in the app, Google sign-in) and offer to try again.",g={type:`object`,properties:{title:{type:`string`,description:`The model's title (1–${p.titleMax} characters).`},script:{type:`string`,description:"ShapeScript source to publish. Provide either this or `path`, not both."},path:{type:`string`,description:"Path to an existing .shape file — an `artifacts/shapes/...` path presentShapeScript saved, or any .shape the host can read. Provide either this or `script`, not both."},description:{type:`string`,description:`What the model is, for the gallery page (up to ${p.descriptionMax} characters). Optional.`},keywords:{type:`array`,items:{type:`string`},description:`Up to ${p.keywordsMax} short lowercase tags someone would search for. Optional.`},prompt:{type:`string`,description:`The request the model was made from, recorded as its provenance (up to ${p.promptMax} characters). Optional.`},published:{type:`boolean`,description:`false saves a draft only the user can see in the gallery's My models. Default true.`}},required:[`title`]},_=[`uid`,`authorName`,`title`,`description`,`script`,`source`,`prompt`,`photoIds`,`thumbnailId`,`forkedFrom`,`keywords`,`published`],v=`Not connected to the gallery: publishing posts under the user's Google account, which needs the app's Remote Host connected (sign in with Google in the Remote Host control), then try again.`,y=e=>typeof e==`string`&&e.trim()!==``?e:void 0,b=e=>typeof e==`string`?e.trim().toLowerCase().slice(0,p.keywordMax):``;function x(e){let t=(Array.isArray(e)?e:typeof e==`string`?e.split(`,`):[]).map(b).filter(e=>e!==``);return[...new Set(t)].slice(0,p.keywordsMax)}function S(e,t,n,r=0){if(t.length<r)throw Error(`\`${e}\` is required`);if(t.length>n)throw Error(`\`${e}\` is too long (${t.length} characters; the gallery allows ${n})`);return t}function C(e,t){return{uid:e.uid,authorName:e.authorName.slice(0,p.authorNameMax),title:S(`title`,t.title.trim(),p.titleMax,1),description:S(`description`,t.description??``,p.descriptionMax),script:S(`script`,t.script,p.scriptMax,1),source:`prompt`,prompt:S(`prompt`,t.prompt??``,p.promptMax),photoIds:[],thumbnailId:t.thumbnailId??``,forkedFrom:null,keywords:x(t.keywords),published:t.published!==!1}}function w(e,t=f){return`${t.endsWith(`/`)?t.slice(0,-1):t}/shapes/${e}`}function T(e){t.a(t.r(t.s(e)))}var E=e=>e instanceof Error?e.message:String(e);async function D(e,t,n,r){try{let i=await e.renderThumbnail(r);return i?await t.uploadThumbnail(n,i):``}catch(t){return e.onWarning?.(`thumbnail skipped: ${E(t)}`),``}}async function O(e,t,n,r){try{await t.createPost(n,r)}catch(i){throw r.thumbnailId&&await t.deleteObject(n,r.thumbnailId).catch(t=>e.onWarning?.(`orphaned thumbnail ${r.thumbnailId}: ${E(t)}`)),i}}var k=()=>globalThis.crypto.randomUUID();async function A(e,t){let n=e.gallery;if(!n)throw Error(v);let r=y(t.title);if(!r)throw Error("`title` is required");let{script:i}=await l(e,t);T(i);let a=C(n,{title:r,script:i,description:y(t.description),prompt:y(t.prompt),keywords:t.keywords,published:t.published!==!1}),o=k(),s=await D(e,n,o,i),c={...a,thumbnailId:s};await O(e,n,o,c);let u=w(o,n.siteUrl),d=c.published?`Published`:`Saved as a draft (only the user can see it, under My models)`,f=s?``:` No thumbnail could be attached; the gallery shows a placeholder until the user edits the post.`;return{message:`${d}: "${c.title}" is at ${u}.${f}`,id:o,url:u,thumbnail:s!==``}}Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return l}});
|