@gui-chat-plugin/avatar 0.0.3 → 0.0.4

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,3 +1,4 @@
1
+ [![npm version](https://badge.fury.io/js/%40gui-chat-plugin%2Favatar.svg)](https://badge.fury.io/js/%40gui-chat-plugin%2Favatar)
1
2
  # @gui-chat-plugin/avatar
2
3
 
3
4
  [![npm version](https://badge.fury.io/js/@gui-chat-plugin%2Favatar.svg)](https://www.npmjs.com/package/@gui-chat-plugin/avatar)
@@ -95,4 +96,4 @@ Try these prompts to test the plugin:
95
96
 
96
97
  ## License
97
98
 
98
- MIT
99
+ MIT
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n="receptron_avatar",o={type:"function",name:n,description:"Display and control a 3D avatar that speaks and reacts during conversation. The avatar automatically lip-syncs when you speak. Call this tool to change the avatar's emotion or trigger actions/gestures. Example: When the user says something funny, call with emotion='happy'. When agreeing, call with action='nod'. When greeting, call with action='wave'.",parameters:{type:"object",properties:{avatarUrl:{type:"string",description:"URL to a VRM avatar file. If not provided, a default avatar will be used. Only needed on first call."},emotion:{type:"string",enum:["neutral","happy","sad","angry","surprised"],description:"The emotion to display. Use 'happy' when pleased or joking, 'sad' when sympathizing, 'angry' when frustrated, 'surprised' when amazed. Defaults to neutral."},action:{type:"string",enum:["none","nod","shake","wave","think","bow"],description:"Trigger a gesture. 'nod' for agreement, 'shake' for disagreement, 'wave' for greeting/goodbye, 'think' when pondering, 'bow' for formal greeting."}},required:[]}},r=[{name:"Default Avatar",args:{}},{name:"Happy Avatar",args:{emotion:"happy"}},{name:"Sad Avatar",args:{emotion:"sad"}}],c="https://pixiv.github.io/three-vrm/packages/three-vrm/examples/models/VRM1_Constraint_Twist_Sample.vrm",i=async(d,s)=>{const{avatarUrl:l,emotion:t="neutral",action:e="none"}=s,g={avatarUrl:l||c,emotion:t,action:e,actionTimestamp:e!=="none"?Date.now():void 0},a=[];t!=="neutral"&&a.push(`emotion: ${t}`),e!=="none"&&a.push(`action: ${e}`);const p=a.length>0?`Avatar updated (${a.join(", ")})`:"Avatar displayed";return{toolName:n,message:p,data:g,updating:!0,instructions:"The avatar is reacting. Continue the conversation naturally. You can call this tool again anytime to change emotion or trigger gestures."}},u={toolDefinition:o,execute:i,generatingMessage:"Loading avatar...",isEnabled:()=>!0,samples:r};exports.SAMPLES=r;exports.TOOL_DEFINITION=o;exports.TOOL_NAME=n;exports.executeAvatar=i;exports.pluginCore=u;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./plugin-DbprBh0b.cjs`);exports.SAMPLES=e.r,exports.TOOL_DEFINITION=e.i,exports.TOOL_NAME=e.a,exports.executeAvatar=e.t,exports.pluginCore=e.n;
package/dist/core.js CHANGED
@@ -1,72 +1,2 @@
1
- const n = "receptron_avatar", l = {
2
- type: "function",
3
- name: n,
4
- description: "Display and control a 3D avatar that speaks and reacts during conversation. The avatar automatically lip-syncs when you speak. Call this tool to change the avatar's emotion or trigger actions/gestures. Example: When the user says something funny, call with emotion='happy'. When agreeing, call with action='nod'. When greeting, call with action='wave'.",
5
- parameters: {
6
- type: "object",
7
- properties: {
8
- avatarUrl: {
9
- type: "string",
10
- description: "URL to a VRM avatar file. If not provided, a default avatar will be used. Only needed on first call."
11
- },
12
- emotion: {
13
- type: "string",
14
- enum: ["neutral", "happy", "sad", "angry", "surprised"],
15
- description: "The emotion to display. Use 'happy' when pleased or joking, 'sad' when sympathizing, 'angry' when frustrated, 'surprised' when amazed. Defaults to neutral."
16
- },
17
- action: {
18
- type: "string",
19
- enum: ["none", "nod", "shake", "wave", "think", "bow"],
20
- description: "Trigger a gesture. 'nod' for agreement, 'shake' for disagreement, 'wave' for greeting/goodbye, 'think' when pondering, 'bow' for formal greeting."
21
- }
22
- },
23
- required: []
24
- }
25
- }, p = [
26
- {
27
- name: "Default Avatar",
28
- args: {}
29
- },
30
- {
31
- name: "Happy Avatar",
32
- args: {
33
- emotion: "happy"
34
- }
35
- },
36
- {
37
- name: "Sad Avatar",
38
- args: {
39
- emotion: "sad"
40
- }
41
- }
42
- ], g = "https://pixiv.github.io/three-vrm/packages/three-vrm/examples/models/VRM1_Constraint_Twist_Sample.vrm", c = async (h, o) => {
43
- const { avatarUrl: r, emotion: t = "neutral", action: a = "none" } = o, i = {
44
- avatarUrl: r || g,
45
- emotion: t,
46
- action: a,
47
- actionTimestamp: a !== "none" ? Date.now() : void 0
48
- }, e = [];
49
- t !== "neutral" && e.push(`emotion: ${t}`), a !== "none" && e.push(`action: ${a}`);
50
- const s = e.length > 0 ? `Avatar updated (${e.join(", ")})` : "Avatar displayed";
51
- return {
52
- toolName: n,
53
- message: s,
54
- data: i,
55
- updating: !0,
56
- // Update existing avatar instead of creating new
57
- instructions: "The avatar is reacting. Continue the conversation naturally. You can call this tool again anytime to change emotion or trigger gestures."
58
- };
59
- }, d = {
60
- toolDefinition: l,
61
- execute: c,
62
- generatingMessage: "Loading avatar...",
63
- isEnabled: () => !0,
64
- samples: p
65
- };
66
- export {
67
- p as SAMPLES,
68
- l as TOOL_DEFINITION,
69
- n as TOOL_NAME,
70
- c as executeAvatar,
71
- d as pluginCore
72
- };
1
+ import { a as e, i as t, n, r, t as i } from "./plugin-Cezk5ZnX.js";
2
+ export { r as SAMPLES, t as TOOL_DEFINITION, e as TOOL_NAME, i as executeAvatar, n as pluginCore };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./core.cjs");exports.SAMPLES=e.SAMPLES;exports.TOOL_DEFINITION=e.TOOL_DEFINITION;exports.TOOL_NAME=e.TOOL_NAME;exports.default=e.pluginCore;exports.executeAvatar=e.executeAvatar;exports.pluginCore=e.pluginCore;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./plugin-DbprBh0b.cjs`);require(`./core.cjs`),exports.SAMPLES=e.r,exports.TOOL_DEFINITION=e.i,exports.TOOL_NAME=e.a,exports.default=e.n,exports.pluginCore=e.n,exports.executeAvatar=e.t;
package/dist/index.d.ts CHANGED
@@ -15,5 +15,5 @@
15
15
  * import "@mulmochat-plugin/quiz/style.css";
16
16
  * ```
17
17
  */
18
- export * from "./core";
19
- export { pluginCore as default } from "./core";
18
+ export * from "./core/index";
19
+ export { pluginCore as default } from "./core/index";
package/dist/index.js CHANGED
@@ -1,9 +1,3 @@
1
- import { SAMPLES as O, TOOL_DEFINITION as a, TOOL_NAME as o, pluginCore as t, executeAvatar as u, pluginCore as l } from "./core.js";
2
- export {
3
- O as SAMPLES,
4
- a as TOOL_DEFINITION,
5
- o as TOOL_NAME,
6
- t as default,
7
- u as executeAvatar,
8
- l as pluginCore
9
- };
1
+ import { a as e, i as t, n, r, t as i } from "./plugin-Cezk5ZnX.js";
2
+ import "./core.js";
3
+ export { r as SAMPLES, t as TOOL_DEFINITION, e as TOOL_NAME, n as default, n as pluginCore, i as executeAvatar };
@@ -0,0 +1,74 @@
1
+ //#region src/core/definition.ts
2
+ var e = "receptron_avatar", t = {
3
+ type: "function",
4
+ name: e,
5
+ description: "Display and control a 3D avatar that speaks and reacts during conversation. The avatar automatically lip-syncs when you speak. Call this tool to change the avatar's emotion or trigger actions/gestures. Example: When the user says something funny, call with emotion='happy'. When agreeing, call with action='nod'. When greeting, call with action='wave'.",
6
+ parameters: {
7
+ type: "object",
8
+ properties: {
9
+ avatarUrl: {
10
+ type: "string",
11
+ description: "URL to a VRM avatar file. If not provided, a default avatar will be used. Only needed on first call."
12
+ },
13
+ emotion: {
14
+ type: "string",
15
+ enum: [
16
+ "neutral",
17
+ "happy",
18
+ "sad",
19
+ "angry",
20
+ "surprised"
21
+ ],
22
+ description: "The emotion to display. Use 'happy' when pleased or joking, 'sad' when sympathizing, 'angry' when frustrated, 'surprised' when amazed. Defaults to neutral."
23
+ },
24
+ action: {
25
+ type: "string",
26
+ enum: [
27
+ "none",
28
+ "nod",
29
+ "shake",
30
+ "wave",
31
+ "think",
32
+ "bow"
33
+ ],
34
+ description: "Trigger a gesture. 'nod' for agreement, 'shake' for disagreement, 'wave' for greeting/goodbye, 'think' when pondering, 'bow' for formal greeting."
35
+ }
36
+ },
37
+ required: []
38
+ }
39
+ }, n = [
40
+ {
41
+ name: "Default Avatar",
42
+ args: {}
43
+ },
44
+ {
45
+ name: "Happy Avatar",
46
+ args: { emotion: "happy" }
47
+ },
48
+ {
49
+ name: "Sad Avatar",
50
+ args: { emotion: "sad" }
51
+ }
52
+ ], r = "https://pixiv.github.io/three-vrm/packages/three-vrm/examples/models/VRM1_Constraint_Twist_Sample.vrm", i = async (t, n) => {
53
+ let { avatarUrl: i, emotion: a = "neutral", action: o = "none" } = n, s = {
54
+ avatarUrl: i || r,
55
+ emotion: a,
56
+ action: o,
57
+ actionTimestamp: o === "none" ? void 0 : Date.now()
58
+ }, c = [];
59
+ return a !== "neutral" && c.push(`emotion: ${a}`), o !== "none" && c.push(`action: ${o}`), {
60
+ toolName: e,
61
+ message: c.length > 0 ? `Avatar updated (${c.join(", ")})` : "Avatar displayed",
62
+ data: s,
63
+ updating: !0,
64
+ instructions: "The avatar is reacting. Continue the conversation naturally. You can call this tool again anytime to change emotion or trigger gestures."
65
+ };
66
+ }, a = {
67
+ toolDefinition: t,
68
+ execute: i,
69
+ generatingMessage: "Loading avatar...",
70
+ isEnabled: () => !0,
71
+ samples: n
72
+ };
73
+ //#endregion
74
+ export { e as a, t as i, a as n, n as r, i as t };
@@ -0,0 +1 @@
1
+ var e=`receptron_avatar`,t={type:`function`,name:e,description:`Display and control a 3D avatar that speaks and reacts during conversation. The avatar automatically lip-syncs when you speak. Call this tool to change the avatar's emotion or trigger actions/gestures. Example: When the user says something funny, call with emotion='happy'. When agreeing, call with action='nod'. When greeting, call with action='wave'.`,parameters:{type:`object`,properties:{avatarUrl:{type:`string`,description:`URL to a VRM avatar file. If not provided, a default avatar will be used. Only needed on first call.`},emotion:{type:`string`,enum:[`neutral`,`happy`,`sad`,`angry`,`surprised`],description:`The emotion to display. Use 'happy' when pleased or joking, 'sad' when sympathizing, 'angry' when frustrated, 'surprised' when amazed. Defaults to neutral.`},action:{type:`string`,enum:[`none`,`nod`,`shake`,`wave`,`think`,`bow`],description:`Trigger a gesture. 'nod' for agreement, 'shake' for disagreement, 'wave' for greeting/goodbye, 'think' when pondering, 'bow' for formal greeting.`}},required:[]}},n=[{name:`Default Avatar`,args:{}},{name:`Happy Avatar`,args:{emotion:`happy`}},{name:`Sad Avatar`,args:{emotion:`sad`}}],r=`https://pixiv.github.io/three-vrm/packages/three-vrm/examples/models/VRM1_Constraint_Twist_Sample.vrm`,i=async(t,n)=>{let{avatarUrl:i,emotion:a=`neutral`,action:o=`none`}=n,s={avatarUrl:i||r,emotion:a,action:o,actionTimestamp:o===`none`?void 0:Date.now()},c=[];return a!==`neutral`&&c.push(`emotion: ${a}`),o!==`none`&&c.push(`action: ${o}`),{toolName:e,message:c.length>0?`Avatar updated (${c.join(`, `)})`:`Avatar displayed`,data:s,updating:!0,instructions:`The avatar is reacting. Continue the conversation naturally. You can call this tool again anytime to change emotion or trigger gestures.`}},a={toolDefinition:t,execute:i,generatingMessage:`Loading avatar...`,isEnabled:()=>!0,samples:n};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
package/dist/react.cjs CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=require("./three-vrm.module-FTOSkzpf.cjs"),B=require("./core.cjs"),a=require("react");var X={exports:{}},Y={};var K;function ie(){if(K)return Y;K=1;var d=Symbol.for("react.transitional.element"),R=Symbol.for("react.fragment");function l(P,u,g){var S=null;if(g!==void 0&&(S=""+g),u.key!==void 0&&(S=""+u.key),"key"in u){g={};for(var E in u)E!=="key"&&(g[E]=u[E])}else g=u;return u=g.ref,{$$typeof:d,type:P,key:S,ref:u!==void 0?u:null,props:g}}return Y.Fragment=R,Y.jsx=l,Y.jsxs=l,Y}var $={};var ee;function se(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&(function(){function d(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case y:return"Fragment";case q:return"Profiler";case U:return"StrictMode";case h:return"Suspense";case C:return"SuspenseList";case o:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case W:return"Portal";case c:return e.displayName||"Context";case G:return(e._context.displayName||"Context")+".Consumer";case m:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case t:return r=e.displayName||null,r!==null?r:d(e.type)||"Memo";case j:r=e._payload,e=e._init;try{return d(e(r))}catch{}}return null}function R(e){return""+e}function l(e){try{R(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,i=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",i),R(e)}}function P(e){if(e===y)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===j)return"<...>";try{var r=d(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=M.A;return e===null?null:e.getOwner()}function g(){return Error("react-stack-top-frame")}function S(e){if(b.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function E(e,r){function n(){N||(N=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function x(){var e=d(this.type);return _[e]||(_[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function f(e,r,n,i,J,H){var s=n.ref;return e={$$typeof:I,type:e,key:r,props:n,_owner:i},(s!==void 0?s:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:x}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function A(e,r,n,i,J,H){var s=r.children;if(s!==void 0)if(i)if(L(s)){for(i=0;i<s.length;i++)V(s[i]);Object.freeze&&Object.freeze(s)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else V(s);if(b.call(r,"key")){s=d(e);var D=Object.keys(r).filter(function(ae){return ae!=="key"});i=0<D.length?"{key: someKey, "+D.join(": ..., ")+": ...}":"{key: someKey}",F[s+i]||(D=0<D.length?"{"+D.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const l=require(`./plugin-DbprBh0b.cjs`),u=require(`./three-vrm.module-FrURzSOB.cjs`);let d=require(`react`);d=c(d);var f=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),p=o((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===O?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case E:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===E)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=k.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(A.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){N||(N=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,`key`,{get:n,configurable:!0})}function l(){var e=t(this.type);return P[e]||(P[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:h,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,`ref`,{enumerable:!1,value:null}):Object.defineProperty(e,`ref`,{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,`validated`,{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,`_debugInfo`,{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,`_debugStack`,{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,`_debugTask`,{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function d(e,n,i,o,l,d){var p=n.children;if(p!==void 0)if(o)if(j(p)){for(o=0;o<p.length;o++)f(p[o]);Object.freeze&&Object.freeze(p)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else f(p);if(A.call(n,`key`)){p=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,L[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,i,s,D,s),F[s+i]=!0)}if(s=null,n!==void 0&&(l(n),s=""+n),S(r)&&(l(r.key),s=""+r.key),"key"in r){n={};for(var Z in r)Z!=="key"&&(n[Z]=r[Z])}else n=r;return s&&E(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),f(e,s,n,u(),J,H)}function V(e){z(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===j&&(e._payload.status==="fulfilled"?z(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function z(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}var O=a,I=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),c=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),t=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),o=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),M=O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,b=Object.prototype.hasOwnProperty,L=Array.isArray,k=console.createTask?console.createTask:function(){return null};O={react_stack_bottom_frame:function(e){return e()}};var N,_={},w=O.react_stack_bottom_frame.bind(O,g)(),T=k(P(g)),F={};$.Fragment=y,$.jsx=function(e,r,n){var i=1e4>M.recentlyCreatedOwnerStacks++;return A(e,r,n,!1,i?Error("react-stack-top-frame"):w,i?k(P(e)):T)},$.jsxs=function(e,r,n){var i=1e4>M.recentlyCreatedOwnerStacks++;return A(e,r,n,!0,i?Error("react-stack-top-frame"):w,i?k(P(e)):T)}})()),$}var re;function le(){return re||(re=1,process.env.NODE_ENV==="production"?X.exports=ie():X.exports=se()),X.exports}var p=le();function te({selectedResult:d,isAudioPlaying:R}){const l=a.useRef(null),[P,u]=a.useState(!1),[g,S]=a.useState(null),E=a.useRef(null),x=a.useRef(null),f=a.useRef(null),A=a.useRef(null),V=a.useRef(null),z=a.useRef(null),O=a.useRef(0),I=a.useRef(R);a.useEffect(()=>{I.current=R},[R]);const W=a.useCallback(()=>{if(!l.current)return;const c=l.current,m=c.clientWidth,h=c.clientHeight;E.current=new v.Scene,x.current=new v.PerspectiveCamera(30,m/h,.1,100),x.current.position.set(0,1.3,1.5),x.current.lookAt(0,1.2,0),f.current=new v.WebGLRenderer({antialias:!0,alpha:!0}),f.current.setSize(m,h),f.current.setPixelRatio(window.devicePixelRatio),f.current.outputColorSpace=v.SRGBColorSpace,c.appendChild(f.current.domElement);const C=new v.AmbientLight(16777215,.6);E.current.add(C);const t=new v.DirectionalLight(16777215,.8);t.position.set(1,1,1),E.current.add(t),V.current=new v.Clock},[]),y=a.useCallback(()=>{if(!l.current||!x.current||!f.current)return;const c=l.current.clientWidth,m=l.current.clientHeight;x.current.aspect=c/m,x.current.updateProjectionMatrix(),f.current.setSize(c,m)},[]),U=a.useCallback(()=>{z.current=requestAnimationFrame(U);const c=V.current,m=f.current,h=E.current,C=x.current,t=A.current;if(!c||!m||!h||!C)return;const j=c.getDelta(),o=c.getElapsedTime();if(t){if(t.update(j),I.current){O.current+=j*10;const M=(Math.sin(O.current)+1)*.3;t.expressionManager?.setValue(v.VRMExpressionPresetName.Aa,M);const b=t.humanoid?.getNormalizedBoneNode("head"),L=t.humanoid?.getNormalizedBoneNode("neck"),k=t.humanoid?.getNormalizedBoneNode("spine");b&&(b.rotation.x=Math.sin(o*2)*.08,b.rotation.z=Math.sin(o*1.5)*.05),L&&(L.rotation.y=Math.sin(o*.8)*.05),k&&(k.rotation.z=Math.sin(o*.5)*.03);const N=t.humanoid?.getNormalizedBoneNode("leftShoulder"),_=t.humanoid?.getNormalizedBoneNode("rightShoulder"),w=t.humanoid?.getNormalizedBoneNode("leftUpperArm"),T=t.humanoid?.getNormalizedBoneNode("rightUpperArm"),F=t.humanoid?.getNormalizedBoneNode("leftLowerArm"),e=t.humanoid?.getNormalizedBoneNode("rightLowerArm");N&&(N.rotation.z=.1),_&&(_.rotation.z=-.1),w&&(w.rotation.z=-.8+Math.sin(o*1.2)*.1,w.rotation.x=.4+Math.sin(o*.9)*.15,w.rotation.y=Math.sin(o*.7)*.1),T&&(T.rotation.z=.8+Math.sin(o*1.3)*.1,T.rotation.x=.4+Math.sin(o*1)*.15,T.rotation.y=Math.sin(o*.8)*.1),F&&(F.rotation.y=-1-Math.sin(o*1.5)*.2,F.rotation.z=Math.sin(o*1.1)*.1),e&&(e.rotation.y=1+Math.sin(o*1.4)*.2,e.rotation.z=Math.sin(o*1.2)*.1)}else{O.current=0,t.expressionManager?.setValue(v.VRMExpressionPresetName.Aa,0);const M=t.humanoid?.getNormalizedBoneNode("spine"),b=t.humanoid?.getNormalizedBoneNode("head");M&&(M.rotation.x=Math.sin(o*.8)*.02),b&&(b.rotation.x=Math.sin(o*.3)*.03,b.rotation.z=Math.sin(o*.2)*.02);const L=t.humanoid?.getNormalizedBoneNode("leftShoulder"),k=t.humanoid?.getNormalizedBoneNode("rightShoulder"),N=t.humanoid?.getNormalizedBoneNode("leftUpperArm"),_=t.humanoid?.getNormalizedBoneNode("rightUpperArm"),w=t.humanoid?.getNormalizedBoneNode("leftLowerArm"),T=t.humanoid?.getNormalizedBoneNode("rightLowerArm");L&&(L.rotation.z=.1),k&&(k.rotation.z=-.1),N&&(N.rotation.z=-.9,N.rotation.x=.2,N.rotation.y=0),_&&(_.rotation.z=.9,_.rotation.x=.2,_.rotation.y=0),w&&(w.rotation.y=-.8),T&&(T.rotation.y=.8)}o%4<.1?t.expressionManager?.setValue(v.VRMExpressionPresetName.Blink,1):t.expressionManager?.setValue(v.VRMExpressionPresetName.Blink,0)}m.render(h,C)},[]),q=a.useCallback(async c=>{const m=E.current;if(m){u(!0),S(null),A.current&&(m.remove(A.current.scene),A.current=null);try{const h=new v.GLTFLoader;h.register(j=>new v.VRMLoaderPlugin(j));const t=(await h.loadAsync(c)).userData.vrm;if(!t)throw new Error("Failed to load VRM data");m.add(t.scene),A.current=t,u(!1)}catch(h){console.error("Failed to load VRM:",h),S(`Failed to load avatar: ${h instanceof Error?h.message:"Unknown error"}`),u(!1)}}},[]),G=a.useCallback(()=>{z.current!==null&&(cancelAnimationFrame(z.current),z.current=null),window.removeEventListener("resize",y),f.current&&l.current&&(l.current.removeChild(f.current.domElement),f.current.dispose(),f.current=null),A.current=null,E.current=null,x.current=null,V.current=null},[y]);return a.useEffect(()=>(W(),window.addEventListener("resize",y),U(),()=>{G()}),[W,y,U,G]),a.useEffect(()=>{if(d?.toolName===B.TOOL_NAME&&d.data){const c=d.data;c.avatarUrl&&q(c.avatarUrl)}},[d,q]),p.jsxs("div",{className:"w-full h-full bg-gradient-to-b from-slate-800 to-slate-900 relative",children:[p.jsx("div",{ref:l,className:"w-full h-full"}),P&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-900/80",children:p.jsx("div",{className:"text-white text-lg",children:"Loading Avatar..."})}),g&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-slate-900/80",children:p.jsx("div",{className:"text-red-400 text-lg text-center p-4",children:g})}),R&&p.jsx("div",{className:"absolute top-4 right-4 px-3 py-1 bg-green-600 text-white text-sm rounded-full",children:"Speaking..."})]})}function ne({result:d}){const l=d.data?.emotion||"neutral";return p.jsx("div",{className:"p-3 bg-gradient-to-br from-slate-700 to-slate-800 rounded-md",children:p.jsxs("div",{className:"flex flex-col items-center gap-2",children:[p.jsx("div",{className:"w-12 h-12 bg-slate-600 rounded-full flex items-center justify-center",children:p.jsx("svg",{className:"w-8 h-8 text-slate-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:p.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}),p.jsx("div",{className:"text-sm font-semibold text-white text-center",children:"3D Avatar"}),l!=="neutral"&&p.jsx("div",{className:"text-xs px-2 py-0.5 bg-blue-500 text-white rounded-full",children:l})]})})}const oe={...B.pluginCore,ViewComponent:te,PreviewComponent:ne},ce={plugin:oe};exports.SAMPLES=B.SAMPLES;exports.TOOL_DEFINITION=B.TOOL_DEFINITION;exports.TOOL_NAME=B.TOOL_NAME;exports.executeAvatar=B.executeAvatar;exports.pluginCore=B.pluginCore;exports.Preview=ne;exports.View=te;exports.default=ce;exports.plugin=oe;
6
+ <%s key={someKey} {...props} />`,o,p,m,p),L[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===E&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=require(`react`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.client.reference`),k=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=Object.prototype.hasOwnProperty,j=Array.isArray,M=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var N,P={},F=m.react_stack_bottom_frame.bind(m,o)(),I=M(i(o)),L={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return d(e,t,n,!1,r?Error(`react-stack-top-frame`):F,r?M(i(e)):I)},e.jsxs=function(e,t,n){var r=1e4>k.recentlyCreatedOwnerStacks++;return d(e,t,n,!0,r?Error(`react-stack-top-frame`):F,r?M(i(e)):I)}})()})),m=o(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=f():t.exports=p()}))();function h({selectedResult:e,isAudioPlaying:t}){let n=(0,d.useRef)(null),[r,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(null),s=(0,d.useRef)(null),c=(0,d.useRef)(null),l=(0,d.useRef)(null),f=(0,d.useRef)(null),p=(0,d.useRef)(null),h=(0,d.useRef)(null),g=(0,d.useRef)(0),_=(0,d.useRef)(t);(0,d.useEffect)(()=>{_.current=t},[t]);let v=(0,d.useCallback)(()=>{if(!n.current)return;let e=n.current,t=e.clientWidth,r=e.clientHeight;s.current=new u.u,c.current=new u.c(30,t/r,.1,100),c.current.position.set(0,1.3,1.5),c.current.lookAt(0,1.2,0),l.current=new u.i({antialias:!0,alpha:!0}),l.current.setSize(t,r),l.current.setPixelRatio(window.devicePixelRatio),l.current.outputColorSpace=u.l,e.appendChild(l.current.domElement);let i=new u.a(16777215,.6);s.current.add(i);let a=new u.s(16777215,.8);a.position.set(1,1,1),s.current.add(a),p.current=new u.o},[]),y=(0,d.useCallback)(()=>{if(!n.current||!c.current||!l.current)return;let e=n.current.clientWidth,t=n.current.clientHeight;c.current.aspect=e/t,c.current.updateProjectionMatrix(),l.current.setSize(e,t)},[]),b=(0,d.useCallback)(()=>{h.current=requestAnimationFrame(b);let e=p.current,t=l.current,n=s.current,r=c.current,i=f.current;if(!e||!t||!n||!r)return;let a=e.getDelta(),o=e.getElapsedTime();if(i){if(i.update(a),_.current){g.current+=a*10;let e=(Math.sin(g.current)+1)*.3;i.expressionManager?.setValue(u.t.Aa,e);let t=i.humanoid?.getNormalizedBoneNode(`head`),n=i.humanoid?.getNormalizedBoneNode(`neck`),r=i.humanoid?.getNormalizedBoneNode(`spine`);t&&(t.rotation.x=Math.sin(o*2)*.08,t.rotation.z=Math.sin(o*1.5)*.05),n&&(n.rotation.y=Math.sin(o*.8)*.05),r&&(r.rotation.z=Math.sin(o*.5)*.03);let s=i.humanoid?.getNormalizedBoneNode(`leftShoulder`),c=i.humanoid?.getNormalizedBoneNode(`rightShoulder`),l=i.humanoid?.getNormalizedBoneNode(`leftUpperArm`),d=i.humanoid?.getNormalizedBoneNode(`rightUpperArm`),f=i.humanoid?.getNormalizedBoneNode(`leftLowerArm`),p=i.humanoid?.getNormalizedBoneNode(`rightLowerArm`);s&&(s.rotation.z=.1),c&&(c.rotation.z=-.1),l&&(l.rotation.z=-.8+Math.sin(o*1.2)*.1,l.rotation.x=.4+Math.sin(o*.9)*.15,l.rotation.y=Math.sin(o*.7)*.1),d&&(d.rotation.z=.8+Math.sin(o*1.3)*.1,d.rotation.x=.4+Math.sin(o*1)*.15,d.rotation.y=Math.sin(o*.8)*.1),f&&(f.rotation.y=-1-Math.sin(o*1.5)*.2,f.rotation.z=Math.sin(o*1.1)*.1),p&&(p.rotation.y=1+Math.sin(o*1.4)*.2,p.rotation.z=Math.sin(o*1.2)*.1)}else{g.current=0,i.expressionManager?.setValue(u.t.Aa,0);let e=i.humanoid?.getNormalizedBoneNode(`spine`),t=i.humanoid?.getNormalizedBoneNode(`head`);e&&(e.rotation.x=Math.sin(o*.8)*.02),t&&(t.rotation.x=Math.sin(o*.3)*.03,t.rotation.z=Math.sin(o*.2)*.02);let n=i.humanoid?.getNormalizedBoneNode(`leftShoulder`),r=i.humanoid?.getNormalizedBoneNode(`rightShoulder`),a=i.humanoid?.getNormalizedBoneNode(`leftUpperArm`),s=i.humanoid?.getNormalizedBoneNode(`rightUpperArm`),c=i.humanoid?.getNormalizedBoneNode(`leftLowerArm`),l=i.humanoid?.getNormalizedBoneNode(`rightLowerArm`);n&&(n.rotation.z=.1),r&&(r.rotation.z=-.1),a&&(a.rotation.z=-.9,a.rotation.x=.2,a.rotation.y=0),s&&(s.rotation.z=.9,s.rotation.x=.2,s.rotation.y=0),c&&(c.rotation.y=-.8),l&&(l.rotation.y=.8)}o%4<.1?i.expressionManager?.setValue(u.t.Blink,1):i.expressionManager?.setValue(u.t.Blink,0)}t.render(n,r)},[]),x=(0,d.useCallback)(async e=>{let t=s.current;if(t){i(!0),o(null),f.current&&=(t.remove(f.current.scene),null);try{let n=new u.r;n.register(e=>new u.n(e));let r=(await n.loadAsync(e)).userData.vrm;if(!r)throw Error(`Failed to load VRM data`);t.add(r.scene),f.current=r,i(!1)}catch(e){console.error(`Failed to load VRM:`,e),o(`Failed to load avatar: ${e instanceof Error?e.message:`Unknown error`}`),i(!1)}}},[]),S=(0,d.useCallback)(()=>{h.current!==null&&(cancelAnimationFrame(h.current),h.current=null),window.removeEventListener(`resize`,y),l.current&&n.current&&(n.current.removeChild(l.current.domElement),l.current.dispose(),l.current=null),f.current=null,s.current=null,c.current=null,p.current=null},[y]);return(0,d.useEffect)(()=>(v(),window.addEventListener(`resize`,y),b(),()=>{S()}),[v,y,b,S]),(0,d.useEffect)(()=>{if(e?.toolName===`receptron_avatar`&&e.data){let t=e.data;t.avatarUrl&&x(t.avatarUrl)}},[e,x]),(0,m.jsxs)(`div`,{className:`w-full h-full bg-gradient-to-b from-slate-800 to-slate-900 relative`,children:[(0,m.jsx)(`div`,{ref:n,className:`w-full h-full`}),r&&(0,m.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-slate-900/80`,children:(0,m.jsx)(`div`,{className:`text-white text-lg`,children:`Loading Avatar...`})}),a&&(0,m.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-slate-900/80`,children:(0,m.jsx)(`div`,{className:`text-red-400 text-lg text-center p-4`,children:a})}),t&&(0,m.jsx)(`div`,{className:`absolute top-4 right-4 px-3 py-1 bg-green-600 text-white text-sm rounded-full`,children:`Speaking...`})]})}function g({result:e}){let t=e.data?.emotion||`neutral`;return(0,m.jsx)(`div`,{className:`p-3 bg-gradient-to-br from-slate-700 to-slate-800 rounded-md`,children:(0,m.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,m.jsx)(`div`,{className:`w-12 h-12 bg-slate-600 rounded-full flex items-center justify-center`,children:(0,m.jsx)(`svg`,{className:`w-8 h-8 text-slate-300`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`,children:(0,m.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})})}),(0,m.jsx)(`div`,{className:`text-sm font-semibold text-white text-center`,children:`3D Avatar`}),t&&t!==`neutral`&&(0,m.jsx)(`div`,{className:`text-xs px-2 py-0.5 bg-blue-500 text-white rounded-full`,children:t})]})})}var _={...l.n,ViewComponent:h,PreviewComponent:g},v={plugin:_};exports.Preview=g,exports.SAMPLES=l.r,exports.TOOL_DEFINITION=l.i,exports.TOOL_NAME=l.a,exports.View=h,exports.default=v,exports.executeAvatar=l.t,exports.plugin=_,exports.pluginCore=l.n,exports.t=c;