@roomle/web-sdk 7.0.0-alpha.7 → 7.0.0-alpha.8
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/THIRD-PARTY-NOTICES.txt +2 -2
- package/lib/ConfiguratorKernel.js +8 -8
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/RoomleCore.js +12 -12
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{api-BngprCu5.mjs → api-B7RzBhz4.mjs} +2 -2
- package/lib/{api-BngprCu5.mjs.map → api-B7RzBhz4.mjs.map} +1 -1
- package/lib/asset-loader.worker-Bdvb-pt7.mjs.map +1 -1
- package/lib/assistant.d.ts +4 -2
- package/lib/assistant.js +2 -2
- package/lib/budgeteer.sw-ByZxiRBr.mjs.map +1 -1
- package/lib/{chat-recovery-Dg1pjw1I.mjs → chat-recovery-DbB-u6R_.mjs} +2 -2
- package/lib/{chat-recovery-Dg1pjw1I.mjs.map → chat-recovery-DbB-u6R_.mjs.map} +1 -1
- package/lib/{configuration-operations-CbqNZZmc.mjs → configuration-operations-CzSBK1f0.mjs} +3 -3
- package/lib/{configuration-operations-CbqNZZmc.mjs.map → configuration-operations-CzSBK1f0.mjs.map} +1 -1
- package/lib/configurator-DvBdnLQf.mjs +3 -0
- package/lib/configurator-capabilities-C7oVM9Ol.mjs +3 -0
- package/lib/{configurator-capabilities-70kymvOa.mjs → configurator-capabilities-DAXIjc-x.mjs} +2 -2
- package/lib/{configurator-capabilities-70kymvOa.mjs.map → configurator-capabilities-DAXIjc-x.mjs.map} +1 -1
- package/lib/{configurator-jkfY1b5y.mjs → configurator-hxG1dk93.mjs} +3 -3
- package/lib/{configurator-jkfY1b5y.mjs.map → configurator-hxG1dk93.mjs.map} +1 -1
- package/lib/{construction-assistant-uz0GwOXI.mjs → construction-assistant-B5KYz2u1.mjs} +3 -3
- package/lib/{construction-assistant-uz0GwOXI.mjs.map → construction-assistant-B5KYz2u1.mjs.map} +1 -1
- package/lib/glb-viewer-DHllBSkw.mjs +3 -0
- package/lib/{glb-viewer-DoM6-7Kf.mjs → glb-viewer-FPGAHfwj.mjs} +3 -3
- package/lib/{glb-viewer-DoM6-7Kf.mjs.map → glb-viewer-FPGAHfwj.mjs.map} +1 -1
- package/lib/{homag-intelligence-BvEIC4Sg.mjs → homag-intelligence-DUxhYyh-.mjs} +3 -3
- package/lib/{homag-intelligence-BvEIC4Sg.mjs.map → homag-intelligence-DUxhYyh-.mjs.map} +1 -1
- package/lib/{material-viewer-B1Qh9EMt.mjs → material-viewer-BcoauhFx.mjs} +3 -3
- package/lib/{material-viewer-B1Qh9EMt.mjs.map → material-viewer-BcoauhFx.mjs.map} +1 -1
- package/lib/{mcp-tools-2kiMy-k9.mjs → mcp-tools-BEI_MJyM.mjs} +12 -12
- package/lib/mcp-tools-BEI_MJyM.mjs.map +1 -0
- package/lib/{packages-CaHy27Po.mjs → packages-1b5pvI1y.mjs} +5 -5
- package/lib/{packages-CaHy27Po.mjs.map → packages-1b5pvI1y.mjs.map} +1 -1
- package/lib/planner-ClEWwUQL.mjs +3 -0
- package/lib/{planner-BB1NDAKt.mjs → planner-CuFtqh53.mjs} +3 -3
- package/lib/{planner-BB1NDAKt.mjs.map → planner-CuFtqh53.mjs.map} +1 -1
- package/lib/roomle-headless.d.ts +3 -3
- package/lib/roomle-headless.js +7 -7
- package/lib/{roomle-sdk-DfS6QwCf.mjs → roomle-sdk-CMP8F6qv.mjs} +18 -18
- package/lib/roomle-sdk-CMP8F6qv.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +3 -3
- package/lib/roomle-sdk.js +6 -6
- package/lib/{runtime-D5zrHj-e.mjs → runtime-B2VYNoKL.mjs} +3 -3
- package/lib/{runtime-D5zrHj-e.mjs.map → runtime-B2VYNoKL.mjs.map} +1 -1
- package/lib/{script-loader-BBj6hFD3.mjs → script-loader-ga4xdHLM.mjs} +2 -2
- package/lib/{script-loader-BBj6hFD3.mjs.map → script-loader-ga4xdHLM.mjs.map} +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCore.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +0 -2
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/coreModule.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/embindEnum.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCore.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreCallback.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/toolsCore.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/toolsCoreInterface.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurableObject.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationGeometryConstructor.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationLoader.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/configurationManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/loaderUtility.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/logger.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/planElementManager.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/loader/rapiAccess.js.map +1 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.js +8 -8
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.js +12 -12
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{tools-core-BUWB0g7Y.mjs → tools-core-Ur7lWfW8.mjs} +3 -3
- package/lib/{tools-core-BUWB0g7Y.mjs.map → tools-core-Ur7lWfW8.mjs.map} +1 -1
- package/package.json +2 -2
- package/sbom.cdx.json +5 -5
- package/lib/configurator-DX-SJ2DK.mjs +0 -3
- package/lib/configurator-capabilities-Wcmqit2B.mjs +0 -3
- package/lib/glb-viewer-B9-VYIi2.mjs +0 -3
- package/lib/mcp-tools-2kiMy-k9.mjs.map +0 -1
- package/lib/planner-B4_PoCyq.mjs +0 -3
- package/lib/roomle-sdk-DfS6QwCf.mjs.map +0 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/coreModue.d.ts +0 -4
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/coreModue.js +0 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/coreModue.js.map +0 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/serviceCore.d.ts +0 -20
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/serviceCore.js +0 -54
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/serviceCore.js.map +0 -1
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/serviceCoreInterface.d.ts +0 -13
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/serviceCoreInterface.js +0 -3
- package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/serviceCoreInterface.js.map +0 -1
package/THIRD-PARTY-NOTICES.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Third-party software notices for @roomle/web-sdk
|
|
2
|
-
Generated 2026-11-
|
|
1
|
+
Third-party software notices for @roomle/web-sdk 2b456661c14c386d6a8799e19550dbc2fd730faf
|
|
2
|
+
Generated 2026-11-16
|
|
3
3
|
|
|
4
4
|
This product includes the following third-party components.
|
|
5
5
|
|
|
@@ -37,16 +37,16 @@ var jb,T,Xb,Yb,Zb,va,oa,hb,$b={H:()=>ua(""),W:a=>{var b=Ga[a];delete Ga[a];var c
|
|
|
37
37
|
var v=c();for(q in h)h[q].write(v,r[q]);null!==k&&k.push(d,v);return v},pa:H,la:d}]})},B:(a,b,c,d,e)=>{b=M(b);d=0n===d;let g=f=>f;if(d){const f=8*c;g=h=>BigInt.asUintN(f,h);e=g(e)}K(a,{name:b,ha:g,ka:(f,h)=>{"number"==typeof h&&(h=BigInt(h));return h},pa:Na(b,c,!d),la:null})},S:(a,b,c,d)=>{b=M(b);K(a,{name:b,ha:function(e){return!!e},ka:function(e,g){return g?c:d},pa:function(e){return this.ha(C[e])},la:null})},w:(a,b,c,d,e,g,f,h,l,n,k,r,q)=>{k=M(k);g=S(e,g);h&&=S(f,h);n&&=S(l,n);q=S(r,q);var v=Wa(k);
|
|
38
38
|
P(v,function(){lb(`Cannot construct ${k} due to unbound types`,[d])});L([a,b,c],d?[d]:[],y=>{y=y[0];if(d){var B=y.ga;var F=B.ua}else F=Sa.prototype;y=Ta(k,function(...Ka){if(Object.getPrototypeOf(this)!==V)throw new N(`Use 'new' to construct ${k}`);if(void 0===A.ta)throw new N(`${k} has no accessible constructor`);var ub=A.ta[Ka.length];if(void 0===ub)throw new N(`Tried to invoke ctor of ${k} with invalid number of parameters (${Ka.length}) - expected (${Object.keys(A.ta).toString()}) parameters instead!`);
|
|
39
39
|
return ub.apply(this,Ka)});var V=Object.create(F,{constructor:{value:y}});y.prototype=V;var A=new Xa(k,y,V,q,B,g,h,n);if(A.oa){var W;(W=A.oa).Da??(W.Da=[]);A.oa.Da.push(A)}B=new R(k,A,!0,!1,!1);W=new R(k+"*",A,!1,!1,!1);F=new R(k+" const*",A,!1,!0,!1);Ua[a]={pointerType:W,Ka:F};gb(v,y);return[B,W,F]})},v:(a,b,c,d,e,g)=>{var f=mb(b,c);e=S(d,e);L([],[a],h=>{h=h[0];var l=`constructor ${h.name}`;void 0===h.ga.ta&&(h.ga.ta=[]);if(void 0!==h.ga.ta[b-1])throw new N(`Cannot register multiple constructors with identical number of parameters (${b-
|
|
40
|
-
1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);h.ga.ta[b-1]=()=>{lb(`Cannot construct ${h.name} due to unbound types`,f)};L([],f,n=>{n.splice(1,0,null);h.ga.ta[b-1]=ob(l,n,null,e,g);return[]});return[]})},
|
|
41
|
-
var v=k.ga.ua,y=v[b];void 0===y||void 0===y.ma&&y.className!==k.name&&y.sa===c-2?(r.sa=c-2,r.className=k.name,v[b]=r):(Va(v,b,q),v[b].ma[c-2]=r);L([],n,B=>{B=ob(q,B,k,g,f,l);void 0===v[b].ma?(B.sa=c-2,v[b]=B):v[b].ma[c-2]=B;return[]});return[]})},Q:a=>K(a,tb),
|
|
42
|
-
P(b,f);break;case "number":var g={};K(a,{name:b,Ba:g,valueType:e,ha:h=>h,ka:(h,l)=>l,pa:vb(b,c,d),la:null});P(b,g);delete m[b].sa;break;case "string":g={},K(a,{name:b,Ja:{},Ia:{},Ba:g,valueType:e,ha:function(h){return this.Ia[h]},ka:function(h,l){return this.Ja[l]},pa:vb(b,c,d),la:null}),P(b,g),delete m[b].sa}},
|
|
43
|
-
a.values[c]=d;a[b]=d;break;case "number":d.Ba[b]=c;break;case "string":d.Ja[b]=c,d.Ia[c]=b,d.Ba[b]=b}},A:(a,b,c)=>{b=M(b);K(a,{name:b,ha:d=>d,ka:(d,e)=>e,pa:xb(b,c),la:null})},
|
|
44
|
-
c,0!==d),la:null})},
|
|
40
|
+
1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);h.ga.ta[b-1]=()=>{lb(`Cannot construct ${h.name} due to unbound types`,f)};L([],f,n=>{n.splice(1,0,null);h.ga.ta[b-1]=ob(l,n,null,e,g);return[]});return[]})},g:(a,b,c,d,e,g,f,h,l)=>{var n=mb(c,d);b=M(b);b=pb(b);g=S(e,g);L([],[a],k=>{function r(){lb(`Cannot call ${q} due to unbound types`,n)}k=k[0];var q=`${k.name}.${b}`;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);h&&k.ga.Ua.push(b);
|
|
41
|
+
var v=k.ga.ua,y=v[b];void 0===y||void 0===y.ma&&y.className!==k.name&&y.sa===c-2?(r.sa=c-2,r.className=k.name,v[b]=r):(Va(v,b,q),v[b].ma[c-2]=r);L([],n,B=>{B=ob(q,B,k,g,f,l);void 0===v[b].ma?(B.sa=c-2,v[b]=B):v[b].ma[c-2]=B;return[]});return[]})},Q:a=>K(a,tb),l:(a,b,c,d,e)=>{b=M(b);e=0===e?"object":1===e?"number":"string";switch(e){case "object":function f(){}f.values={};K(a,{name:b,constructor:f,valueType:e,ha:function(h){return this.constructor.values[h]},ka:(h,l)=>l.value,pa:vb(b,c,d),la:null});
|
|
42
|
+
P(b,f);break;case "number":var g={};K(a,{name:b,Ba:g,valueType:e,ha:h=>h,ka:(h,l)=>l,pa:vb(b,c,d),la:null});P(b,g);delete m[b].sa;break;case "string":g={},K(a,{name:b,Ja:{},Ia:{},Ba:g,valueType:e,ha:function(h){return this.Ia[h]},ka:function(h,l){return this.Ja[l]},pa:vb(b,c,d),la:null}),P(b,g),delete m[b].sa}},f:(a,b,c)=>{var d=wb(a,"enum");b=M(b);switch(d.valueType){case "object":a=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:Ta(`${d.name}_${b}`,function(){})}});
|
|
43
|
+
a.values[c]=d;a[b]=d;break;case "number":d.Ba[b]=c;break;case "string":d.Ja[b]=c,d.Ia[c]=b,d.Ba[b]=b}},A:(a,b,c)=>{b=M(b);K(a,{name:b,ha:d=>d,ka:(d,e)=>e,pa:xb(b,c),la:null})},p:(a,b,c,d,e,g,f)=>{var h=mb(b,c);a=M(a);a=pb(a);e=S(d,e);P(a,function(){lb(`Cannot call ${a} due to unbound types`,h)},b-1);L([],h,l=>{l=[l[0],null].concat(l.slice(1));gb(a,ob(a,l,null,e,g,f),b-1);return[]})},n:(a,b,c,d,e)=>{b=M(b);let g=h=>h;if(0===d){var f=32-8*c;g=h=>h<<f>>>f;e=g(e)}K(a,{name:b,ha:g,ka:(h,l)=>l,pa:Na(b,
|
|
44
|
+
c,0!==d),la:null})},k:(a,b,c)=>{function d(g){return new e(pa.buffer,G[g+4>>2],G[g>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];c=M(c);K(a,{name:c,ha:d,pa:d},{Sa:!0})},x:a=>{K(a,yb)},u:(a,b,c,d,e,g,f,h,l,n,k,r)=>{c=M(c);g=S(e,g);h=S(f,h);n=S(l,n);r=S(k,r);L([a],[b],q=>{q=q[0];return[new R(c,q.ga,!1,!1,!0,q,d,g,h,n,r)]})},R:(a,b)=>{b=M(b);K(a,{name:b,ha(c){var d=(d=c+4)?Ab.decode(C.subarray(d,Bb(C,d,G[c>>2],
|
|
45
45
|
!0))):"";T(c);return d},ka(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new N("Cannot pass non-string to std::string");var g=e?zb(d):d.length;var f=Xb(4+g+1),h=f+4;G[f>>2]=g;e?Y(d,h,g+1):C.set(d,h);null!==c&&c.push(T,f);return f},pa:H,la(c){T(c)}})},r:(a,b,c)=>{c=M(c);if(2===b){var d=Db;var e=Eb;var g=Fb}else d=Gb,e=Hb,g=Ib;K(a,{name:c,ha:f=>{var h=d(f+4,G[f>>2]*b,!0);T(f);return h},ka:(f,h)=>{if("string"!=
|
|
46
|
-
typeof h)throw new N(`Cannot pass non-string to C++ string type ${c}`);var l=g(h),n=Xb(4+l+b);G[n>>2]=l/b;e(h,n+4,l+b);null!==f&&f.push(T,n);return n},pa:H,la(f){T(f)}})},
|
|
46
|
+
typeof h)throw new N(`Cannot pass non-string to C++ string type ${c}`);var l=g(h),n=Xb(4+l+b);G[n>>2]=l/b;e(h,n+4,l+b);null!==f&&f.push(T,n);return n},pa:H,la(f){T(f)}})},j:(a,b,c,d,e,g)=>{Ga[a]={name:M(b),Ca:S(c,d),ra:S(e,g),Fa:[]}},e:(a,b,c,d,e,g,f,h,l,n)=>{Ga[a].Fa.push({Ma:M(b),Ra:c,Pa:S(d,e),Qa:g,Xa:f,Wa:S(h,l),Ya:n})},T:(a,b)=>{b=M(b);K(a,{Ga:!0,name:b,ha:()=>{},ka:()=>{}})},F:()=>{Fa=!1;Jb=0},C:(a,b)=>{a=X(a);b=X(b);a.set(b)},d:(a,b,c)=>{var [d,...e]=Mb(a,b);b=d.ka.bind(d);var g=e.map(l=>l.pa.bind(l));
|
|
47
47
|
a--;var f={toValue:X};a=g.map((l,n)=>{var k=`argFromPtr${n}`;f[k]=l;return`${k}(args${n?"+"+8*n:""})`});switch(c){case 0:var h="toValue(handle)";break;case 2:h="new (toValue(handle))";break;case 3:h="";break;case 1:f.getStringOrSymbol=Pb,h="toValue(handle)[getStringOrSymbol(methodName)]"}h+=`(${a})`;d.Ga||(f.toReturnWire=b,f.emval_returnValue=Nb,h=`return emval_returnValue(toReturnWire, destructorsRef, ${h})`);h=`return function (handle, methodName, destructorsRef, args) {\n${h}\n}`;c=(new Function(Object.keys(f),
|
|
48
|
-
h))(...Object.values(f));h=`methodCaller<(${e.map(l=>l.name)}) => ${d.name}>`;return Lb(Ta(h,c))},V:sb,q:a=>{if(!a)return Q(globalThis);a=Pb(a);return Q(globalThis[a])},
|
|
49
|
-
Q({}),D:a=>{var b=X(a);Ha(b);sb(a)},
|
|
48
|
+
h))(...Object.values(f));h=`methodCaller<(${e.map(l=>l.name)}) => ${d.name}>`;return Lb(Ta(h,c))},V:sb,q:a=>{if(!a)return Q(globalThis);a=Pb(a);return Q(globalThis[a])},m:(a,b)=>{a=X(a);b=X(b);return Q(a[b])},z:a=>{9<a&&(U[a+1]+=1)},U:(a,b)=>{a=X(a);b=X(b);return a instanceof b},c:(a,b,c,d,e)=>Kb[a](b,c,d,e),o:a=>{a=X(a);return"number"==typeof a},s:a=>{a=X(a);return"string"==typeof a},i:()=>Q([]),y:a=>{a=X(a);for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=a[c];return Q(b)},a:a=>Q(Pb(a)),h:()=>
|
|
49
|
+
Q({}),D:a=>{var b=X(a);Ha(b);sb(a)},b:(a,b,c)=>{a=X(a);b=X(b);c=X(c);a[b]=c},X:(a,b)=>{a=X(a);b=X(b);return a===b},t:a=>{a=X(a);return Q(typeof a)},G:(a,b)=>{Z[a]&&(clearTimeout(Z[a].id),delete Z[a]);if(!b)return 0;var c=setTimeout(()=>{delete Z[a];Sb(()=>Zb(a,performance.now()))},b);Z[a]={id:c,$a:b};return 0},I:(a,b,c,d)=>{var e=(new Date).getFullYear(),g=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();G[a>>2]=60*Math.max(g,e);E[b>>2]=Number(g!=e);b=f=>{var h=Math.abs(f);
|
|
50
50
|
return`UTC${0<=f?"-":"+"}${String(Math.floor(h/60)).padStart(2,"0")}${String(h%60).padStart(2,"0")}`};a=b(g);b=b(e);e<g?(Y(a,c,17),Y(b,d,17)):(Y(a,d,17),Y(b,c,17))},J:a=>{var b=C.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/65536))-oa.buffer.byteLength+65535)/65536|0;try{oa.grow(d);na();var e=1;break a}catch(g){}e=void 0}if(e)return!0}return!1},L:(a,b)=>{var c=0,d=0,e;for(e of Vb()){var g=
|
|
51
51
|
b+c;G[a+d>>2]=g;c+=Y(e,g,Infinity)+1;d+=4}return 0},M:(a,b)=>{var c=Vb();G[a>>2]=c.length;a=0;for(var d of c)a+=zb(d)+1;G[b>>2]=a;return 0},N:()=>52,P:()=>52,K:function(){return 70},O:(a,b,c,d)=>{for(var e=0,g=0;g<c;g++){var f=G[b>>2],h=G[b+4>>2];b+=8;for(var l=0;l<h;l++){var n=a,k=C[f+l],r=Wb[n];0===k||10===k?(n=1===n?ja:t,k=Bb(r,0),k=Ab.decode(r.buffer?r.subarray(0,k):new Uint8Array(r.slice(0,k))),n(k),r.length=0):r.push(k)}e+=h}G[d>>2]=e;return 0},E:Rb},ac;
|
|
52
52
|
ac=await (async function(){function a(c){c=ac=c.exports;jb=c._;T=c.$;Xb=c.aa;Yb=m._main=c.ba;Zb=c.da;va=c.ea;oa=m.wasmMemory=c.Y;hb=c.ca;na();return ac}var b={a:$b};if(m.instantiateWasm)return new Promise(c=>{m.instantiateWasm(b,(d,e)=>{c(a(d,e))})});wa??=m.locateFile?m.locateFile("ConfiguratorKernel.wasm",p):p+"ConfiguratorKernel.wasm";return a((await za(b)).instance)}());
|
|
Binary file
|
package/lib/RoomleCore.js
CHANGED
|
@@ -35,22 +35,22 @@ const b=Symbol.dispose;b&&(a[b]=a["delete"])})();
|
|
|
35
35
|
Object.assign(S.prototype,{Sa(a){this.La&&(a=this.La(a));return a},Ia(a){this.va?.(a)},ta:G,la:function(a){function b(){return this.Ea?gb(this.ka.xa,{na:this.Xa,ma:c,ua:this,ra:a}):gb(this.ka.xa,{na:this,ma:a})}var c=this.Sa(a);if(!c)return this.Ia(a),null;var d=fb(this.ka,c);if(void 0!==d){if(0===d.ja.count.value)return d.ja.ma=c,d.ja.ra=a,d.clone();d=d.clone();this.Ia(a);return d}d=this.ka.Ra(c);d=Va[d];if(!d)return b.call(this);d=this.Da?d.Oa:d.pointerType;var e=db(c,this.ka,d.ka);return null===
|
|
36
36
|
e?b.call(this):this.Ea?gb(d.ka.xa,{na:d,ma:e,ua:this,ra:a}):gb(d.ka.xa,{na:d,ma:e})}});n.noExitRuntime&&(Ha=n.noExitRuntime);n.print&&(ja=n.print);n.printErr&&(v=n.printErr);n.wasmBinary&&(w=n.wasmBinary);n.thisProgram&&(da=n.thisProgram);if(n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.shift()();
|
|
37
37
|
var kb,U,Yb,Zb,$b,xa,qa,ib,ac={I:()=>wa(""),_:a=>{var b=Ia[a];delete Ia[a];var c=b.Ha,d=b.va,e=b.Ja,g=e.map(f=>f.Va).concat(e.map(f=>f.ab));M([a],g,f=>{var h={},k,m;for([k,m]of e.entries()){const l=f[k],p=m.Ta,q=m.Ua,t=f[k+e.length],u=m.$a,z=m.bb;h[m.Qa]={read:F=>l.la(p(q,F)),write:(F,I)=>{var A=[];u(z,F,t.oa(A,I));E(A)},optional:l.optional}}return[{name:b.name,la:l=>{var p={},q;for(q in h)p[q]=h[q].read(l);d(l);return p},oa:(l,p)=>{for(var q in h)if(!(q in p||h[q].optional))throw new TypeError(`Missing field: "${q}"`);
|
|
38
|
-
var t=c();for(q in h)h[q].write(t,p[q]);null!==l&&l.push(d,t);return t},ta:G,qa:d}]})},E:(a,b,c,d,e)=>{b=N(b);d=0n===d;let g=f=>f;if(d){const f=8*c;g=h=>BigInt.asUintN(f,h);e=g(e)}L(a,{name:b,la:g,oa:(f,h)=>{"number"==typeof h&&(h=BigInt(h));return h},ta:Oa(b,c,!d),qa:null})},W:(a,b,c,d)=>{b=N(b);L(a,{name:b,la:function(e){return!!e},oa:function(e,g){return g?c:d},ta:function(e){return this.la(y[e])},qa:null})},
|
|
38
|
+
var t=c();for(q in h)h[q].write(t,p[q]);null!==l&&l.push(d,t);return t},ta:G,qa:d}]})},E:(a,b,c,d,e)=>{b=N(b);d=0n===d;let g=f=>f;if(d){const f=8*c;g=h=>BigInt.asUintN(f,h);e=g(e)}L(a,{name:b,la:g,oa:(f,h)=>{"number"==typeof h&&(h=BigInt(h));return h},ta:Oa(b,c,!d),qa:null})},W:(a,b,c,d)=>{b=N(b);L(a,{name:b,la:function(e){return!!e},oa:function(e,g){return g?c:d},ta:function(e){return this.la(y[e])},qa:null})},o:(a,b,c,d,e,g,f,h,k,m,l,p,q)=>{l=N(l);g=T(e,g);h&&=T(f,h);m&&=T(k,m);q=T(p,q);var t=Xa(l);
|
|
39
39
|
Q(t,function(){V(`Cannot construct ${l} due to unbound types`,[d])});M([a,b,c],d?[d]:[],u=>{u=u[0];if(d){var z=u.ka;var F=z.xa}else F=Ta.prototype;u=Ua(l,function(...Na){if(Object.getPrototypeOf(this)!==I)throw new O(`Use 'new' to construct ${l}`);if(void 0===A.ya)throw new O(`${l} has no accessible constructor`);var vb=A.ya[Na.length];if(void 0===vb)throw new O(`Tried to invoke ctor of ${l} with invalid number of parameters (${Na.length}) - expected (${Object.keys(A.ya).toString()}) parameters instead!`);
|
|
40
|
-
return vb.apply(this,Na)});var I=Object.create(F,{constructor:{value:u}});u.prototype=I;var A=new Ya(l,u,I,q,z,g,h,m);if(A.sa){var K;(K=A.sa).Ca??(K.Ca=[]);A.sa.Ca.push(A)}z=new S(l,A,!0,!1,!1);K=new S(l+"*",A,!1,!1,!1);F=new S(l+" const*",A,!1,!0,!1);Va[a]={pointerType:K,Oa:F};hb(t,u);return[z,K,F]})},
|
|
40
|
+
return vb.apply(this,Na)});var I=Object.create(F,{constructor:{value:u}});u.prototype=I;var A=new Ya(l,u,I,q,z,g,h,m);if(A.sa){var K;(K=A.sa).Ca??(K.Ca=[]);A.sa.Ca.push(A)}z=new S(l,A,!0,!1,!1);K=new S(l+"*",A,!1,!1,!1);F=new S(l+" const*",A,!1,!0,!1);Va[a]={pointerType:K,Oa:F};hb(t,u);return[z,K,F]})},m:(a,b,c,d,e,g,f,h)=>{var k=ob(c,d);b=N(b);b=pb(b);g=T(e,g);M([],[a],m=>{function l(){V(`Cannot call ${p} due to unbound types`,k)}m=m[0];var p=`${m.name}.${b}`;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);
|
|
41
41
|
var q=m.ka.constructor;void 0===q[b]?(l.wa=c-1,q[b]=l):(Wa(q,b,p),q[b].pa[c-1]=l);M([],k,t=>{t=[t[0],null].concat(t.slice(1));t=nb(p,t,null,g,f,h);void 0===q[b].pa?(t.wa=c-1,q[b]=t):q[b].pa[c-1]=t;if(m.ka.Ca)for(const u of m.ka.Ca)u.constructor.hasOwnProperty(b)||(u.constructor[b]=t);return[]});return[]})},S:(a,b,c,d,e,g,f,h)=>{b=N(b);g=T(e,g);M([],[a],k=>{k=k[0];var m=`${k.name}.${b}`,l={get(){V(`Cannot access ${m} due to unbound types`,[c])},enumerable:!0,configurable:!0};l.set=h?()=>{V(`Cannot access ${m} due to unbound types`,
|
|
42
|
-
[c])}:()=>{throw new O(`${m} is a read-only property`);};Object.defineProperty(k.ka.constructor,b,l);M([],[c],p=>{p=p[0];var q={get(){return p.la(g(d))},enumerable:!0};h&&(h=T(f,h),q.set=t=>{var u=[];h(d,p.oa(u,t));E(u)});Object.defineProperty(k.ka.constructor,b,q);return[]});return[]})},
|
|
43
|
-
1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);h.ka.ya[b-1]=()=>{V(`Cannot construct ${h.name} due to unbound types`,f)};M([],f,m=>{m.splice(1,0,null);h.ka.ya[b-1]=nb(k,m,null,e,g);return[]});return[]})},
|
|
44
|
-
var t=l.ka.xa,u=t[b];void 0===u||void 0===u.pa&&u.className!==l.name&&u.wa===c-2?(p.wa=c-2,p.className=l.name,t[b]=p):(Wa(t,b,q),t[b].pa[c-2]=p);M([],m,z=>{z=nb(q,z,l,g,f,k);void 0===t[b].pa?(z.wa=c-2,t[b]=z):t[b].pa[c-2]=z;return[]});return[]})},
|
|
45
|
-
" is a read-only property");};Object.defineProperty(l.ka.xa,b,q);M([],k?[c,f]:[c],t=>{var u=t[0],z={get(){var I=qb(this,l,p+" getter");return u.la(e(g,I))},enumerable:!0};if(k){k=T(h,k);var F=t[1];z.set=function(I){var A=qb(this,l,p+" setter"),K=[];k(m,A,F.oa(K,I));E(K)}}Object.defineProperty(l.ka.xa,b,z);return[]});return[]})},U:a=>L(a,ub),
|
|
46
|
-
oa:(h,k)=>k.value,ta:wb(b,c,d),qa:null});Q(b,f);break;case "number":var g={};L(a,{name:b,Ga:g,valueType:e,la:h=>h,oa:(h,k)=>k,ta:wb(b,c,d),qa:null});Q(b,g);delete n[b].wa;break;case "string":g={},L(a,{name:b,Na:{},Ma:{},Ga:g,valueType:e,la:function(h){return this.Ma[h]},oa:function(h,k){return this.Na[k]},ta:wb(b,c,d),qa:null}),Q(b,g),delete n[b].wa}},
|
|
47
|
-
function(){})}});a.values[c]=d;a[b]=d;break;case "number":d.Ga[b]=c;break;case "string":d.Na[b]=c,d.Ma[c]=b,d.Ga[b]=b}},D:(a,b,c)=>{b=N(b);L(a,{name:b,la:d=>d,oa:(d,e)=>e,ta:yb(b,c),qa:null})},
|
|
48
|
-
k)=>k,ta:Oa(b,c,0!==d),qa:null})},
|
|
42
|
+
[c])}:()=>{throw new O(`${m} is a read-only property`);};Object.defineProperty(k.ka.constructor,b,l);M([],[c],p=>{p=p[0];var q={get(){return p.la(g(d))},enumerable:!0};h&&(h=T(f,h),q.set=t=>{var u=[];h(d,p.oa(u,t));E(u)});Object.defineProperty(k.ka.constructor,b,q);return[]});return[]})},s:(a,b,c,d,e,g)=>{var f=ob(b,c);e=T(d,e);M([],[a],h=>{h=h[0];var k=`constructor ${h.name}`;void 0===h.ka.ya&&(h.ka.ya=[]);if(void 0!==h.ka.ya[b-1])throw new O(`Cannot register multiple constructors with identical number of parameters (${b-
|
|
43
|
+
1}) for class '${h.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);h.ka.ya[b-1]=()=>{V(`Cannot construct ${h.name} due to unbound types`,f)};M([],f,m=>{m.splice(1,0,null);h.ka.ya[b-1]=nb(k,m,null,e,g);return[]});return[]})},c:(a,b,c,d,e,g,f,h,k)=>{var m=ob(c,d);b=N(b);b=pb(b);g=T(e,g);M([],[a],l=>{function p(){V(`Cannot call ${q} due to unbound types`,m)}l=l[0];var q=`${l.name}.${b}`;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);h&&l.ka.Ya.push(b);
|
|
44
|
+
var t=l.ka.xa,u=t[b];void 0===u||void 0===u.pa&&u.className!==l.name&&u.wa===c-2?(p.wa=c-2,p.className=l.name,t[b]=p):(Wa(t,b,q),t[b].pa[c-2]=p);M([],m,z=>{z=nb(q,z,l,g,f,k);void 0===t[b].pa?(z.wa=c-2,t[b]=z):t[b].pa[c-2]=z;return[]});return[]})},i:(a,b,c,d,e,g,f,h,k,m)=>{b=N(b);e=T(d,e);M([],[a],l=>{l=l[0];var p=`${l.name}.${b}`,q={get(){V(`Cannot access ${p} due to unbound types`,[c,f])},enumerable:!0,configurable:!0};q.set=k?()=>V(`Cannot access ${p} due to unbound types`,[c,f]):()=>{throw new O(p+
|
|
45
|
+
" is a read-only property");};Object.defineProperty(l.ka.xa,b,q);M([],k?[c,f]:[c],t=>{var u=t[0],z={get(){var I=qb(this,l,p+" getter");return u.la(e(g,I))},enumerable:!0};if(k){k=T(h,k);var F=t[1];z.set=function(I){var A=qb(this,l,p+" setter"),K=[];k(m,A,F.oa(K,I));E(K)}}Object.defineProperty(l.ka.xa,b,z);return[]});return[]})},U:a=>L(a,ub),l:(a,b,c,d,e)=>{b=N(b);e=0===e?"object":1===e?"number":"string";switch(e){case "object":function f(){}f.values={};L(a,{name:b,constructor:f,valueType:e,la:function(h){return this.constructor.values[h]},
|
|
46
|
+
oa:(h,k)=>k.value,ta:wb(b,c,d),qa:null});Q(b,f);break;case "number":var g={};L(a,{name:b,Ga:g,valueType:e,la:h=>h,oa:(h,k)=>k,ta:wb(b,c,d),qa:null});Q(b,g);delete n[b].wa;break;case "string":g={},L(a,{name:b,Na:{},Ma:{},Ga:g,valueType:e,la:function(h){return this.Ma[h]},oa:function(h,k){return this.Na[k]},ta:wb(b,c,d),qa:null}),Q(b,g),delete n[b].wa}},d:(a,b,c)=>{var d=xb(a,"enum");b=N(b);switch(d.valueType){case "object":a=d.constructor;d=Object.create(d.constructor.prototype,{value:{value:c},constructor:{value:Ua(`${d.name}_${b}`,
|
|
47
|
+
function(){})}});a.values[c]=d;a[b]=d;break;case "number":d.Ga[b]=c;break;case "string":d.Na[b]=c,d.Ma[c]=b,d.Ga[b]=b}},D:(a,b,c)=>{b=N(b);L(a,{name:b,la:d=>d,oa:(d,e)=>e,ta:yb(b,c),qa:null})},q:(a,b,c,d,e,g,f)=>{var h=ob(b,c);a=N(a);a=pb(a);e=T(d,e);Q(a,function(){V(`Cannot call ${a} due to unbound types`,h)},b-1);M([],h,k=>{k=[k[0],null].concat(k.slice(1));hb(a,nb(a,k,null,e,g,f),b-1);return[]})},t:(a,b,c,d,e)=>{b=N(b);let g=h=>h;if(0===d){var f=32-8*c;g=h=>h<<f>>>f;e=g(e)}L(a,{name:b,la:g,oa:(h,
|
|
48
|
+
k)=>k,ta:Oa(b,c,0!==d),qa:null})},p:(a,b,c)=>{function d(g){return new e(ra.buffer,D[g+4>>2],D[g>>2])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];c=N(c);L(a,{name:c,la:d,ta:d},{Wa:!0})},A:a=>{L(a,zb)},n:(a,b,c,d,e,g,f,h,k,m,l,p)=>{c=N(c);g=T(e,g);h=T(f,h);m=T(k,m);p=T(l,p);M([a],[b],q=>{q=q[0];return[new S(c,q.ka,!1,!1,!0,q,d,g,h,m,p)]})},V:(a,b)=>{b=N(b);L(a,{name:b,la(c){var d=(d=c+4)?Bb.decode(y.subarray(d,
|
|
49
49
|
Cb(y,d,D[c>>2],!0))):"";U(c);return d},oa(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new O("Cannot pass non-string to std::string");var g=e?Ab(d):d.length;var f=Yb(4+g+1),h=f+4;D[f>>2]=g;e?Y(d,h,g+1):y.set(d,h);null!==c&&c.push(U,f);return f},ta:G,qa(c){U(c)}})},B:(a,b,c)=>{c=N(c);if(2===b){var d=Eb;var e=Fb;var g=Gb}else d=Hb,e=Ib,g=Jb;L(a,{name:c,la:f=>{var h=d(f+4,D[f>>2]*b,!0);U(f);return h},oa:(f,
|
|
50
|
-
h)=>{if("string"!=typeof h)throw new O(`Cannot pass non-string to C++ string type ${c}`);var k=g(h),m=Yb(4+k+b);D[m>>2]=k/b;e(h,m+4,k+b);null!==f&&f.push(U,m);return m},ta:G,qa(f){U(f)}})},
|
|
50
|
+
h)=>{if("string"!=typeof h)throw new O(`Cannot pass non-string to C++ string type ${c}`);var k=g(h),m=Yb(4+k+b);D[m>>2]=k/b;e(h,m+4,k+b);null!==f&&f.push(U,m);return m},ta:G,qa(f){U(f)}})},k:(a,b,c,d,e,g)=>{Ia[a]={name:N(b),Ha:T(c,d),va:T(e,g),Ja:[]}},e:(a,b,c,d,e,g,f,h,k,m)=>{Ia[a].Ja.push({Qa:N(b),Va:c,Ta:T(d,e),Ua:g,ab:f,$a:T(h,k),bb:m})},X:(a,b)=>{b=N(b);L(a,{Ka:!0,name:b,la:()=>{},oa:()=>{}})},G:()=>{Ha=!1;Kb=0},y:(a,b)=>{a=X(a);b=X(b);a.set(b)},h:(a,b,c)=>{var [d,...e]=Nb(a,b);b=d.oa.bind(d);
|
|
51
51
|
var g=e.map(k=>k.ta.bind(k));a--;var f={toValue:X};a=g.map((k,m)=>{var l=`argFromPtr${m}`;f[l]=k;return`${l}(args${m?"+"+8*m:""})`});switch(c){case 0:var h="toValue(handle)";break;case 2:h="new (toValue(handle))";break;case 3:h="";break;case 1:f.getStringOrSymbol=Qb,h="toValue(handle)[getStringOrSymbol(methodName)]"}h+=`(${a})`;d.Ka||(f.toReturnWire=b,f.emval_returnValue=Ob,h=`return emval_returnValue(toReturnWire, destructorsRef, ${h})`);h=`return function (handle, methodName, destructorsRef, args) {\n${h}\n}`;
|
|
52
|
-
c=(new Function(Object.keys(f),h))(...Object.values(f));h=`methodCaller<(${e.map(k=>k.name)}) => ${d.name}>`;return Mb(Ua(h,c))},Z:tb,x:a=>{if(!a)return R(globalThis);a=Qb(a);return R(globalThis[a])},
|
|
53
|
-
|
|
52
|
+
c=(new Function(Object.keys(f),h))(...Object.values(f));h=`methodCaller<(${e.map(k=>k.name)}) => ${d.name}>`;return Mb(Ua(h,c))},Z:tb,x:a=>{if(!a)return R(globalThis);a=Qb(a);return R(globalThis[a])},r:(a,b)=>{a=X(a);b=X(b);return R(a[b])},C:a=>{9<a&&(W[a+1]+=1)},Y:(a,b)=>{a=X(a);b=X(b);return a instanceof b},g:(a,b,c,d,e)=>Lb[a](b,c,d,e),u:a=>{a=X(a);return"number"==typeof a},v:a=>{a=X(a);return"string"==typeof a},j:()=>R([]),w:a=>{a=X(a);for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=a[c];return R(b)},
|
|
53
|
+
a:a=>R(Qb(a)),f:()=>R({}),T:a=>R(a?Bb.decode(y.subarray(a,Cb(y,a))):""),J:a=>{var b=X(a);E(b);tb(a)},b:(a,b,c)=>{a=X(a);b=X(b);c=X(c);a[b]=c},$:(a,b)=>{a=X(a);b=X(b);return a===b},z:a=>{a=X(a);return R(typeof a)},H:(a,b)=>{Z[a]&&(clearTimeout(Z[a].id),delete Z[a]);if(!b)return 0;var c=setTimeout(()=>{delete Z[a];Tb(()=>$b(a,performance.now()))},b);Z[a]={id:c,eb:b};return 0},K:(a,b,c,d)=>{var e=(new Date).getFullYear(),g=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();
|
|
54
54
|
D[a>>2]=60*Math.max(g,e);C[b>>2]=Number(g!=e);b=f=>{var h=Math.abs(f);return`UTC${0<=f?"-":"+"}${String(Math.floor(h/60)).padStart(2,"0")}${String(h%60).padStart(2,"0")}`};a=b(g);b=b(e);e<g?(Y(a,c,17),Y(b,d,17)):(Y(a,d,17),Y(b,c,17))},L:a=>{var b=y.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/65536))-qa.buffer.byteLength+65535)/65536|0;try{qa.grow(d);pa();var e=1;break a}catch(g){}e=
|
|
55
55
|
void 0}if(e)return!0}return!1},N:(a,b)=>{var c=0,d=0,e;for(e of Wb()){var g=b+c;D[a+d>>2]=g;c+=Y(e,g,Infinity)+1;d+=4}return 0},O:(a,b)=>{var c=Wb();D[a>>2]=c.length;a=0;for(var d of c)a+=Ab(d)+1;D[b>>2]=a;return 0},P:()=>52,R:()=>52,M:function(){return 70},Q:(a,b,c,d)=>{for(var e=0,g=0;g<c;g++){var f=D[b>>2],h=D[b+4>>2];b+=8;for(var k=0;k<h;k++){var m=a,l=y[f+k],p=Xb[m];0===l||10===l?(m=1===m?ja:v,l=Cb(p,0),l=Bb.decode(p.buffer?p.subarray(0,l):new Uint8Array(p.slice(0,l))),m(l),p.length=0):p.push(l)}e+=
|
|
56
56
|
h}D[d>>2]=e;return 0},F:Sb},bc;bc=await (async function(){function a(c){c=bc=c.exports;kb=c.ca;U=c.da;Yb=c.ea;Zb=n._main=c.fa;$b=c.ha;xa=c.ia;qa=n.wasmMemory=c.aa;ib=c.ga;pa();return bc}var b={a:ac};if(n.instantiateWasm)return new Promise(c=>{n.instantiateWasm(b,(d,e)=>{c(a(d,e))})});ya??=n.locateFile?n.locateFile("RoomleCore.wasm",r):r+"RoomleCore.wasm";return a((await Ba(b)).instance)}());
|
package/lib/RoomleCore.wasm
CHANGED
|
Binary file
|
package/lib/RoomleToolsCore.wasm
CHANGED
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { h as e, m as t } from "./roomle-sdk-
|
|
2
|
+
import { h as e, m as t } from "./roomle-sdk-CMP8F6qv.mjs";
|
|
3
3
|
//#region packages/homag-intelligence/src/api.ts
|
|
4
4
|
var n = {
|
|
5
5
|
27: "ElectricPlug",
|
|
@@ -89,4 +89,4 @@ var n = {
|
|
|
89
89
|
//#endregion
|
|
90
90
|
export { i as t };
|
|
91
91
|
|
|
92
|
-
//# sourceMappingURL=api-
|
|
92
|
+
//# sourceMappingURL=api-B7RzBhz4.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-
|
|
1
|
+
{"version":3,"file":"api-B7RzBhz4.mjs","names":[],"sources":["../../packages/homag-intelligence/src/api.ts"],"sourcesContent":["import type { RoomDesignerRequests } from './glue-logic';\nimport type { MasterData, PosGroup } from './model/oc-scripts-domain.model';\nimport type {\n ExternalPlanInstallationElement,\n ExternalPlanInstallationElementType,\n ExternalPlanObstacles,\n PlanRoomGeometryMode,\n} from './external-object-api';\nimport { PLAN_ROOM_GEOMETRY_MODE } from './external-object-api';\nimport type { RoomlePlannerType } from '../../typings/external-objects';\nimport {\n HI_CONTEXT_ACTION,\n type LoadExternalObjectOptions,\n} from './external-object-api';\n\n// The kernel levels that classify a plan object as an installation element.\n// Exact levels only: 43, 47, 52 and 55 do not classify.\nconst PLAN_INSTALLATION_ELEMENT_LEVELS: Record<\n number,\n ExternalPlanInstallationElementType\n> = {\n 27: 'ElectricPlug',\n 28: 'WaterConnection',\n};\n\n// + 0 turns IEEE -0 into +0 so serialized values never show -0\nconst round2 = (value: number): number => Math.round(value * 100) / 100 + 0;\n\n// The parts of a kernel plan object the installation-element gathering\n// reads; getPlanObjects is typed any, so the shape is named here.\ninterface PlanObjectInfo {\n level: number;\n hidden: boolean;\n getId(): number;\n getCenter(): { x: number; y: number; z: number };\n}\n\nexport interface ExternalObjectModuleIdMap {\n originalModuleId: string;\n newModuleId: string;\n}\n\nexport class RoomDesignerApi implements RoomDesignerRequests {\n private _roomlePlanner: RoomlePlannerType;\n\n constructor(roomlePlanner: RoomlePlannerType) {\n this._roomlePlanner = roomlePlanner;\n }\n\n public loadMasterData(masterData: MasterData) {\n this._roomlePlanner.loadExternalObjectMasterData(masterData);\n }\n\n public async loadPosGroups(\n posDataJson: PosGroup | PosGroup[],\n options: LoadExternalObjectOptions,\n ): Promise<void> {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.loadExternalObjectGroups(posDataArray, options);\n }\n\n completelyLoaded(): void {\n this._roomlePlanner.externalObjectsCompletelyLoaded();\n }\n\n public async selectGroup(groupId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n groupId,\n null,\n HI_CONTEXT_ACTION.ROOM,\n );\n }\n\n public async selectRoot(rootModuleId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n null,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public async selectModule(\n rootModuleId: string,\n subModuleId: string,\n ): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n subModuleId,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public openCloseGroup(\n groupOrRootModuleId: string,\n subModuleId: string | null,\n open: boolean,\n animate: boolean,\n ) {\n return Promise.resolve(\n this._roomlePlanner.openOrCloseGeometryOfExternalObject(\n groupOrRootModuleId,\n subModuleId ?? null,\n open,\n animate,\n ),\n );\n }\n\n public deleteGroup(groupId: string): Promise<void> {\n return this._roomlePlanner.removeExternalObject(groupId);\n }\n\n public deleteRootModule(rootModuleId: string): Promise<void> {\n return this._roomlePlanner.removeExternalObject(rootModuleId);\n }\n\n public mergeGroups(groupIds: string[]): Promise<void> {\n return this._roomlePlanner._mergeExternalObjects(groupIds);\n }\n\n public async getPosDataOfAllGroups() {\n const groups =\n (await this._roomlePlanner.getExternalObjectGroups()) as PosGroup[];\n return groups;\n }\n\n public async getRoomInformation(mode?: PlanRoomGeometryMode) {\n const rooms = await this._roomlePlanner.getExternalRoomInformation(\n mode ?? PLAN_ROOM_GEOMETRY_MODE.FLOOR,\n );\n return rooms;\n }\n\n public async getPlanObstacles(): Promise<ExternalPlanObstacles> {\n const obstacles = await this._roomlePlanner._getExternalPlanObstacles();\n const installationElements = await this._gatherInstallationElements();\n return { ...obstacles, installationElements };\n }\n\n // Installation elements are gathered from the live plan objects,\n // independently of the obstacle segments: an element is not lost merely\n // because no usable outline was exported. One entry per placed supply\n // assembly (children included); hidden owners are omitted.\n private async _gatherInstallationElements(): Promise<\n ExternalPlanInstallationElement[]\n > {\n const planInteractionManager =\n await this._roomlePlanner.getPlanInteractionManager();\n const planModelViewHelper =\n await this._roomlePlanner.getPlanModelViewHelper();\n const plan = planInteractionManager.getPlan();\n const planObjects = plan.getPlanObjects() as PlanObjectInfo[];\n const planObjectsById = new Map(\n planObjects.map((planObject) => [planObject.getId(), planObject]),\n );\n const installationElements: ExternalPlanInstallationElement[] = [];\n const typesByOwner = new Map<number, ExternalPlanInstallationElementType>();\n for (const planObject of planObjects) {\n const type = PLAN_INSTALLATION_ELEMENT_LEVELS[planObject.level];\n if (!type) {\n continue;\n }\n const ownerId = planModelViewHelper.getRootPlanObjectId(\n plan,\n planObject.getId(),\n );\n if (typesByOwner.has(ownerId)) {\n // one entry per placed supply assembly, children included\n continue;\n }\n // the owner is the assembly root, itself a plan object; getPlanObject\n // would return its data DTO, which has no getCenter method\n const owner = planObjectsById.get(ownerId) ?? planObject;\n if (owner.hidden) {\n continue;\n }\n typesByOwner.set(ownerId, type);\n const center = owner.getCenter();\n installationElements.push({\n runtimeId: ownerId,\n type,\n position: [round2(center.x), round2(center.z), round2(-center.y)],\n });\n }\n return installationElements;\n }\n\n public async saveExternalObjectSnapshot() {\n return this._roomlePlanner.saveExternalObjectSnapshot();\n }\n\n public async saveCurrentPlanSnapshot() {\n return this._roomlePlanner.saveCurrentPlanSnapshot();\n }\n\n public async renderPosDataImage(posDataJson: object) {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.renderImagesOfExternalObjectGroup(posDataArray);\n }\n}\n"],"mappings":";;;AAiBA,IAAM,IAGF;CACF,IAAI;CACJ,IAAI;CACL,EAGK,KAAU,MAA0B,KAAK,MAAM,IAAQ,IAAI,GAAG,MAAM,GAgB7D,IAAb,MAA6D;CAG3D,YAAY,GAAkC;AAC5C,OAAK,iBAAiB;;CAGxB,eAAsB,GAAwB;AAC5C,OAAK,eAAe,6BAA6B,EAAW;;CAG9D,MAAa,cACX,GACA,GACe;EACf,IAAM,IAAe,MAAM,QAAQ,EAAY,GAC3C,IACA,CAAC,EAAY;AACjB,QAAM,KAAK,eAAe,yBAAyB,GAAc,EAAQ;;CAG3E,mBAAyB;AACvB,OAAK,eAAe,iCAAiC;;CAGvD,MAAa,YAAY,GAAgC;AACvD,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,KACnB;;CAGH,MAAa,WAAW,GAAqC;AAC3D,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,UACnB;;CAGH,MAAa,aACX,GACA,GACe;AACf,QAAM,KAAK,eAAe,qBACxB,GACA,GACA,EAAkB,UACnB;;CAGH,eACE,GACA,GACA,GACA,GACA;AACA,SAAO,QAAQ,QACb,KAAK,eAAe,oCAClB,GACA,KAAe,MACf,GACA,EACD,CACF;;CAGH,YAAmB,GAAgC;AACjD,SAAO,KAAK,eAAe,qBAAqB,EAAQ;;CAG1D,iBAAwB,GAAqC;AAC3D,SAAO,KAAK,eAAe,qBAAqB,EAAa;;CAG/D,YAAmB,GAAmC;AACpD,SAAO,KAAK,eAAe,sBAAsB,EAAS;;CAG5D,MAAa,wBAAwB;AAGnC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AK,eAAe,kCAAkC,EAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-loader.worker-Bdvb-pt7.mjs","names":[],"sources":["../../packages/workers/generated/asset-loader.worker.js?no-inline?url"],"sourcesContent":["export default \"
|
|
1
|
+
{"version":3,"file":"asset-loader.worker-Bdvb-pt7.mjs","names":[],"sources":["../../packages/workers/generated/asset-loader.worker.js?no-inline?url"],"sourcesContent":["export default \"__VITE_ASSET__dJ$ULFcuzX43djbIEsCZPw__\""],"mappings":";;AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,0BAAA,OAAA,KAAA,IAAA,CAAA"}
|
package/lib/assistant.d.ts
CHANGED
|
@@ -108,7 +108,7 @@ export declare const createChatRecovery: (tools: AgentMcpTools, domain?: {
|
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
/** The AI SDK language model of the config and the provider options `streamText` takes with it. */
|
|
111
|
-
export declare const loadChatModel: ({ provider, model, apiKey, baseUrl, headers, chatCompletions, responses, reasoningEffort, }: PlanningAssistantConfig, observeRequest?: (body: string) => Promise<void>) => Promise<{
|
|
111
|
+
export declare const loadChatModel: ({ provider, model, apiKey, baseUrl, headers, chatCompletions, responses, storedResponses, reasoningEffort, }: PlanningAssistantConfig, observeRequest?: (body: string) => Promise<void>) => Promise<{
|
|
112
112
|
languageModel: LanguageModelV4;
|
|
113
113
|
providerOptions?: SharedV4ProviderOptions;
|
|
114
114
|
}>;
|
|
@@ -148,8 +148,10 @@ export declare interface PlanningAssistantConfig {
|
|
|
148
148
|
headers?: Record<string, string>;
|
|
149
149
|
/** `azure` only: call the deployment through the Chat Completions API instead of the Responses API. */
|
|
150
150
|
chatCompletions?: boolean;
|
|
151
|
-
/** `openai-compatible` only: call `<baseUrl>/responses` instead of `<baseUrl>/chat/completions`, stateless (`store: false`, the whole history in every request, the reasoning carried encrypted)
|
|
151
|
+
/** `openai-compatible` only: call `<baseUrl>/responses` instead of `<baseUrl>/chat/completions`, defaulting to stateless (`store: false`, the whole history in every request, the reasoning carried encrypted) unless `storedResponses` is true. */
|
|
152
152
|
responses?: boolean;
|
|
153
|
+
/** `openai-compatible` with `responses` only: store responses on the server (`store: true`) so supported runtimes can continue steps and follow-up turns by `previousResponseId`. */
|
|
154
|
+
storedResponses?: boolean;
|
|
153
155
|
/** `azure` only: the reasoning effort of the deployment; its default when unset. */
|
|
154
156
|
reasoningEffort?: string;
|
|
155
157
|
/** Azure Responses only: mark the library prefix for caching on a deployment verified to support explicit breakpoints. */
|
package/lib/assistant.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Third-party licenses: THIRD-PARTY-NOTICES.txt and sbom.cdx.json in the root of this package */
|
|
2
|
-
import { n as e, r as t, t as n } from "./mcp-tools-
|
|
3
|
-
import { n as r, t as i } from "./chat-recovery-
|
|
2
|
+
import { n as e, r as t, t as n } from "./mcp-tools-BEI_MJyM.mjs";
|
|
3
|
+
import { n as r, t as i } from "./chat-recovery-DbB-u6R_.mjs";
|
|
4
4
|
export { n as createAgentMcpTools, r as createAssistant, i as createChatRecovery, t as loadChatModel, e as mcpToModelOutput };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"budgeteer.sw-ByZxiRBr.mjs","names":[],"sources":["../../packages/workers/generated/budgeteer.sw.js?no-inline?url"],"sourcesContent":["export default \"
|
|
1
|
+
{"version":3,"file":"budgeteer.sw-ByZxiRBr.mjs","names":[],"sources":["../../packages/workers/generated/budgeteer.sw.js?no-inline?url"],"sourcesContent":["export default \"__VITE_ASSET__BjjUHagISQHtPWYmu3KuwQ__\""],"mappings":";;AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,mBAAA,OAAA,KAAA,IAAA,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { r as e } from "./mcp-tools-
|
|
2
|
+
import { r as e } from "./mcp-tools-BEI_MJyM.mjs";
|
|
3
3
|
import { Wt as t } from "./dist-XtmHz7tB.mjs";
|
|
4
4
|
//#region packages/common-core/src/planning-assistant/runtime.ts
|
|
5
5
|
var n = (e = {}) => ({
|
|
@@ -179,4 +179,4 @@ var n = (e = {}) => ({
|
|
|
179
179
|
//#endregion
|
|
180
180
|
export { i as n, u as t };
|
|
181
181
|
|
|
182
|
-
//# sourceMappingURL=chat-recovery-
|
|
182
|
+
//# sourceMappingURL=chat-recovery-DbB-u6R_.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-recovery-Dg1pjw1I.mjs","names":[],"sources":["../../packages/common-core/src/planning-assistant/runtime.ts","../../packages/common-core/src/planning-assistant/chat-recovery.ts"],"sourcesContent":["import { APICallError, type ModelMessage } from 'ai';\nimport type {\n PlanningAssistantOutput,\n PlanningAssistantPrompt,\n} from '../planning-assistant';\nimport { loadChatModel, type PlanningAssistantConfig } from './chat-model';\nimport type { AgentMcpTools } from './mcp-tools';\n\nconst tokenCounts = (\n usage: {\n inputTokens?: number;\n outputTokens?: number;\n totalTokens?: number;\n } = {},\n) => ({\n inputTokens: usage.inputTokens ?? null,\n outputTokens: usage.outputTokens ?? null,\n totalTokens:\n usage.totalTokens ??\n (usage.inputTokens !== undefined && usage.outputTokens !== undefined\n ? usage.inputTokens + usage.outputTokens\n : null),\n});\n\nconst sumCounts = (counts: Array<number | null>) =>\n counts.some((count) => count !== null)\n ? counts.reduce<number>((sum, count) => sum + (count ?? 0), 0)\n : null;\n\n/** Runs a browser agent with the tools and prompts supplied by its SDK domain. */\nexport const createAssistant = async (\n config: PlanningAssistantConfig,\n signal: AbortSignal,\n output: (part: PlanningAssistantOutput) => unknown,\n setupDomain: () => Promise<{\n prompts: { systemPrompt: string; imagePrompt: string };\n tools: AgentMcpTools;\n }>,\n turnPolicy?: {\n timeoutMs: number;\n recovery: (tools: AgentMcpTools) => {\n tools: AgentMcpTools;\n summary(): string;\n };\n },\n): Promise<(prompt: PlanningAssistantPrompt) => Promise<void>> => {\n const setup = await Promise.all([\n import('ai'),\n loadChatModel(config),\n setupDomain(),\n ]);\n signal.throwIfAborted();\n const [{ streamText, stepCountIs }, model, { prompts, tools }] = setup;\n const messages: ModelMessage[] = [];\n return async ({ text, images }) => {\n const steps: Array<ReturnType<typeof tokenCounts>> = [];\n let finalUsage: ReturnType<typeof tokenCounts> | undefined;\n let aborted = false;\n const userMessage: ModelMessage = {\n role: 'user',\n content: [\n { type: 'text', text: text || prompts.imagePrompt },\n ...images.map((data) => ({\n type: 'file' as const,\n data,\n mediaType: 'image/jpeg',\n })),\n ],\n };\n const recovery = turnPolicy?.recovery(tools);\n const abort = new AbortController();\n const onAbort = () => abort.abort(signal.reason);\n signal.addEventListener('abort', onAbort, { once: true });\n if (signal.aborted) {\n onAbort();\n }\n const deadline = turnPolicy\n ? setTimeout(\n () =>\n abort.abort(new Error('The assistant turn exceeded five minutes.')),\n turnPolicy.timeoutMs,\n )\n : undefined;\n try {\n const result = streamText({\n model: model.languageModel,\n providerOptions: model.providerOptions,\n instructions: prompts.systemPrompt,\n messages: [...messages, userMessage],\n tools: recovery?.tools ?? tools,\n stopWhen: stepCountIs(16),\n abortSignal: turnPolicy ? abort.signal : signal,\n prepareStep: ({ stepNumber }: { stepNumber: number }) =>\n stepNumber === 15 ? { toolChoice: 'none' } : undefined,\n });\n for await (const part of result.stream) {\n if (part.type === 'text-delta') {\n output({ type: 'text', text: part.text });\n } else if (part.type === 'tool-call') {\n output({ type: 'activity', text: part.toolName });\n } else if (part.type === 'error') {\n throw part.error;\n } else if (part.type === 'finish-step') {\n steps.push(tokenCounts(part.usage));\n } else if (part.type === 'finish') {\n finalUsage = tokenCounts(part.totalUsage);\n } else if (part.type === 'abort') {\n aborted = true;\n if (turnPolicy) {\n throw abort.signal.reason ?? new Error('Turn aborted');\n }\n }\n }\n if (turnPolicy && abort.signal.aborted) {\n throw abort.signal.reason;\n }\n messages.push(userMessage, ...(await result.responseMessages));\n output({ type: 'done' });\n } catch (error) {\n const summary = recovery?.summary();\n if (summary) {\n messages.push(userMessage, { role: 'assistant', content: summary });\n }\n output({\n type: 'error',\n ...(APICallError.isInstance(error) && { statusCode: error.statusCode }),\n text: `The planning assistant failed: ${error instanceof Error ? error.message : String(error)}${summary ? `\\n\\n${summary}` : ''}`,\n });\n } finally {\n clearTimeout(deadline);\n signal.removeEventListener('abort', onAbort);\n const usage = {\n inputTokens:\n finalUsage?.inputTokens ??\n sumCounts(steps.map((step) => step.inputTokens)),\n outputTokens:\n finalUsage?.outputTokens ??\n sumCounts(steps.map((step) => step.outputTokens)),\n totalTokens:\n finalUsage?.totalTokens ??\n sumCounts(steps.map((step) => step.totalTokens)),\n };\n const measured = Object.values(usage).some((count) => count !== null);\n const complete =\n finalUsage &&\n !aborted &&\n !abort.signal.aborted &&\n Object.values(usage).every((count) => count !== null) &&\n steps.every((step) =>\n Object.values(step).every((count) => count !== null),\n );\n console.log(\n `[planning-assistant] usage ${JSON.stringify({\n provider: config.provider,\n model: config.model,\n status: measured\n ? complete\n ? 'complete'\n : 'partial'\n : 'unavailable',\n ...usage,\n })}`,\n );\n }\n };\n};\n","import type { AgentMcpTools } from './mcp-tools';\n\nconst TOOL_LABELS: Record<string, string> = {\n undo: 'Undo',\n redo: 'Redo',\n 'change-component-parameter': 'Component parameter change',\n 'change-global-parameter': 'Global parameter change',\n 'dock-component': 'Component dock',\n 'drag-component': 'Component drag',\n 'delete-component': 'Component deletion',\n 'load-configuration': 'Configuration load',\n 'get-configurator-capabilities': 'Capabilities read',\n 'get-configuration': 'Configuration read',\n 'get-component-parameters': 'Component parameters read',\n 'get-global-parameters': 'Global parameters read',\n 'get-possible-children': 'Possible children read',\n 'get-docking-positions': 'Docking positions read',\n 'get-component-docking-positions': 'Component docking positions read',\n 'get-delete-impact': 'Delete impact read',\n};\n\n// The read-only tools: a failed or pending read never changed the configuration.\nconst READ_TOOLS: ReadonlySet<string> = new Set(\n Object.keys(TOOL_LABELS).filter((key) => key.startsWith('get-')),\n);\n\ninterface Outcome {\n toolName: string;\n status: 'pending' | 'returned' | 'threw';\n result?: any;\n error?: unknown;\n}\n\nconst textOf = (value: unknown): string => {\n if (value instanceof Error) {\n return value.message;\n }\n try {\n return typeof value === 'string'\n ? value\n : JSON.stringify(value) ?? String(value);\n } catch {\n return Object.prototype.toString.call(value);\n }\n};\n\nconst resultData = (result: any): any => {\n if (result?.structuredContent !== undefined) {\n return result.structuredContent;\n }\n const text = result?.content\n ?.filter((part: any) => part.type === 'text')\n .map((part: any) => part.text)\n .join('\\n');\n if (text === undefined) {\n return result;\n }\n try {\n return JSON.parse(text);\n } catch {\n return text;\n }\n};\n\nconst resultDetails = (data: any): string[] => {\n if (!data || typeof data !== 'object') {\n return data == null ? [] : [textOf(data)];\n }\n const details: string[] = [];\n for (const key of [\n 'applied',\n 'undone',\n 'redone',\n 'confirmed',\n 'canUndo',\n 'canRedo',\n ]) {\n if (data[key] !== undefined) {\n details.push(`${key}: ${textOf(data[key])}`);\n }\n }\n if (data.hint) {\n details.push(textOf(data.hint));\n }\n return details;\n};\n\n/**\n * Records tool execution independently of whether the model finishes its\n * step, so an interrupted reply can say what the tools changed.\n */\nexport const createChatRecovery = (\n tools: AgentMcpTools,\n domain: { subject: string; readTools: ReadonlySet<string> } = {\n subject: 'configuration',\n readTools: READ_TOOLS,\n },\n) => {\n const outcomes: Outcome[] = [];\n const recordedTools: AgentMcpTools = Object.fromEntries(\n Object.entries(tools).map(([toolName, tool]) => {\n if (!tool.execute) {\n return [toolName, tool];\n }\n const execute = tool.execute.bind(tool);\n return [\n toolName,\n {\n ...tool,\n execute: async (input: unknown) => {\n const outcome: Outcome = { toolName, status: 'pending' };\n outcomes.push(outcome);\n try {\n const result = await execute(input);\n outcome.result = result;\n outcome.status = 'returned';\n return result;\n } catch (error) {\n outcome.error = error;\n outcome.status = 'threw';\n throw error;\n }\n },\n },\n ];\n }),\n );\n\n const summary = (): string => {\n const lines = [\n \"The assistant's reply was interrupted. Any text above is incomplete.\",\n ];\n if (!outcomes.length) {\n lines.push(`No tool ran, so the ${domain.subject} was not changed.`);\n return lines.join('\\n\\n');\n }\n for (const outcome of outcomes) {\n const label = TOOL_LABELS[outcome.toolName] ?? outcome.toolName;\n if (domain.readTools.has(outcome.toolName)) {\n const successful =\n outcome.status === 'returned' && !outcome.result?.isError;\n const data = successful ? resultData(outcome.result) : undefined;\n lines.push(\n successful\n ? `- Completed ${label}: ${data?.complete === false ? 'some requested information was unresolved' : 'information was returned'}. The read did not change the ${domain.subject}.`\n : `- Incomplete ${label}: ${outcome.status === 'pending' ? 'no result was received' : 'the read failed'}. The read did not change the ${domain.subject}.`,\n );\n continue;\n }\n if (outcome.status === 'returned' && !outcome.result?.isError) {\n const data = resultData(outcome.result);\n // A write the configurator did not confirm may have left the\n // configuration unchanged; the undo and redo results carry no\n // confirmed key and keep the wording below.\n if (data?.confirmed === false) {\n lines.push(\n `- Unconfirmed ${label}: ${data?.hint ?? data?.unresolved?.join(' ') ?? `the SDK did not confirm the ${domain.subject} change`}. Check the ${domain.subject} before trying this operation again.`,\n );\n continue;\n }\n const details = resultDetails(data);\n lines.push(\n `- Completed ${label}: ${details.length ? details.join('; ') : 'the tool returned successfully.'}`,\n );\n } else {\n const detail =\n outcome.status === 'threw'\n ? textOf(outcome.error)\n : outcome.status === 'returned'\n ? textOf(resultData(outcome.result))\n : 'no result was received';\n lines.push(\n `- Unconfirmed ${label}: ${detail}. Check the ${domain.subject} before trying this operation again.`,\n );\n }\n }\n lines.push(\n 'These are the recorded tool outcomes; no operation was repeated automatically.',\n );\n return lines.join('\\n\\n');\n };\n\n return { tools: recordedTools, summary };\n};\n"],"mappings":";;;;AAQA,IAAM,KACJ,IAII,EAAE,MACF;CACJ,aAAa,EAAM,eAAe;CAClC,cAAc,EAAM,gBAAgB;CACpC,aACE,EAAM,gBACL,EAAM,gBAAgB,KAAA,KAAa,EAAM,iBAAiB,KAAA,IACvD,EAAM,cAAc,EAAM,eAC1B;CACP,GAEK,KAAa,MACjB,EAAO,MAAM,MAAU,MAAU,KAAK,GAClC,EA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AAO,QAAQ,GAC1J;AACD;;AAEF,QAAI,EAAQ,WAAW,cAAc,CAAC,EAAQ,QAAQ,SAAS;KAC7D,IAAM,IAAO,EAAW,EAAQ,OAAO;AAIvC,SAAI,GAAM,cAAc,IAAO;AAC7B,QAAM,KACJ,iBAAiB,EAAM,IAAI,GAAM,QAAQ,GAAM,YAAY,KAAK,IAAI,IAAI,+BAA+B,EAAO,QAAQ,SAAS,cAAc,EAAO,QAAQ,sCAC7J;AACD;;KAEF,IAAM,IAAU,EAAc,EAAK;AACnC,OAAM,KACJ,eAAe,EAAM,IAAI,EAAQ,SAAS,EAAQ,KAAK,KAAK,GAAG,oCAChE;WACI;KACL,IAAM,IACJ,EAAQ,WAAW,UACf,EAAO,EAAQ,MAAM,GACrB,EAAQ,WAAW,aACjB,EAAO,EAAW,EAAQ,OAAO,CAAC,GAClC;AACR,OAAM,KACJ,iBAAiB,EAAM,IAAI,EAAO,cAAc,EAAO,QAAQ,sCAChE;;;AAML,UAHA,EAAM,KACJ,iFACD,EACM,EAAM,KAAK,OAAO;;EAGa"}
|
|
1
|
+
{"version":3,"file":"chat-recovery-DbB-u6R_.mjs","names":[],"sources":["../../packages/common-core/src/planning-assistant/runtime.ts","../../packages/common-core/src/planning-assistant/chat-recovery.ts"],"sourcesContent":["import { APICallError, type ModelMessage } from 'ai';\nimport type {\n PlanningAssistantOutput,\n PlanningAssistantPrompt,\n} from '../planning-assistant';\nimport { loadChatModel, type PlanningAssistantConfig } from './chat-model';\nimport type { AgentMcpTools } from './mcp-tools';\n\nconst tokenCounts = (\n usage: {\n inputTokens?: number;\n outputTokens?: number;\n totalTokens?: number;\n } = {},\n) => ({\n inputTokens: usage.inputTokens ?? null,\n outputTokens: usage.outputTokens ?? null,\n totalTokens:\n usage.totalTokens ??\n (usage.inputTokens !== undefined && usage.outputTokens !== undefined\n ? usage.inputTokens + usage.outputTokens\n : null),\n});\n\nconst sumCounts = (counts: Array<number | null>) =>\n counts.some((count) => count !== null)\n ? counts.reduce<number>((sum, count) => sum + (count ?? 0), 0)\n : null;\n\n/** Runs a browser agent with the tools and prompts supplied by its SDK domain. */\nexport const createAssistant = async (\n config: PlanningAssistantConfig,\n signal: AbortSignal,\n output: (part: PlanningAssistantOutput) => unknown,\n setupDomain: () => Promise<{\n prompts: { systemPrompt: string; imagePrompt: string };\n tools: AgentMcpTools;\n }>,\n turnPolicy?: {\n timeoutMs: number;\n recovery: (tools: AgentMcpTools) => {\n tools: AgentMcpTools;\n summary(): string;\n };\n },\n): Promise<(prompt: PlanningAssistantPrompt) => Promise<void>> => {\n const setup = await Promise.all([\n import('ai'),\n loadChatModel(config),\n setupDomain(),\n ]);\n signal.throwIfAborted();\n const [{ streamText, stepCountIs }, model, { prompts, tools }] = setup;\n const messages: ModelMessage[] = [];\n return async ({ text, images }) => {\n const steps: Array<ReturnType<typeof tokenCounts>> = [];\n let finalUsage: ReturnType<typeof tokenCounts> | undefined;\n let aborted = false;\n const userMessage: ModelMessage = {\n role: 'user',\n content: [\n { type: 'text', text: text || prompts.imagePrompt },\n ...images.map((data) => ({\n type: 'file' as const,\n data,\n mediaType: 'image/jpeg',\n })),\n ],\n };\n const recovery = turnPolicy?.recovery(tools);\n const abort = new AbortController();\n const onAbort = () => abort.abort(signal.reason);\n signal.addEventListener('abort', onAbort, { once: true });\n if (signal.aborted) {\n onAbort();\n }\n const deadline = turnPolicy\n ? setTimeout(\n () =>\n abort.abort(new Error('The assistant turn exceeded five minutes.')),\n turnPolicy.timeoutMs,\n )\n : undefined;\n try {\n const result = streamText({\n model: model.languageModel,\n providerOptions: model.providerOptions,\n instructions: prompts.systemPrompt,\n messages: [...messages, userMessage],\n tools: recovery?.tools ?? tools,\n stopWhen: stepCountIs(16),\n abortSignal: turnPolicy ? abort.signal : signal,\n prepareStep: ({ stepNumber }: { stepNumber: number }) =>\n stepNumber === 15 ? { toolChoice: 'none' } : undefined,\n });\n for await (const part of result.stream) {\n if (part.type === 'text-delta') {\n output({ type: 'text', text: part.text });\n } else if (part.type === 'tool-call') {\n output({ type: 'activity', text: part.toolName });\n } else if (part.type === 'error') {\n throw part.error;\n } else if (part.type === 'finish-step') {\n steps.push(tokenCounts(part.usage));\n } else if (part.type === 'finish') {\n finalUsage = tokenCounts(part.totalUsage);\n } else if (part.type === 'abort') {\n aborted = true;\n if (turnPolicy) {\n throw abort.signal.reason ?? new Error('Turn aborted');\n }\n }\n }\n if (turnPolicy && abort.signal.aborted) {\n throw abort.signal.reason;\n }\n messages.push(userMessage, ...(await result.responseMessages));\n output({ type: 'done' });\n } catch (error) {\n const summary = recovery?.summary();\n if (summary) {\n messages.push(userMessage, { role: 'assistant', content: summary });\n }\n output({\n type: 'error',\n ...(APICallError.isInstance(error) && { statusCode: error.statusCode }),\n text: `The planning assistant failed: ${error instanceof Error ? error.message : String(error)}${summary ? `\\n\\n${summary}` : ''}`,\n });\n } finally {\n clearTimeout(deadline);\n signal.removeEventListener('abort', onAbort);\n const usage = {\n inputTokens:\n finalUsage?.inputTokens ??\n sumCounts(steps.map((step) => step.inputTokens)),\n outputTokens:\n finalUsage?.outputTokens ??\n sumCounts(steps.map((step) => step.outputTokens)),\n totalTokens:\n finalUsage?.totalTokens ??\n sumCounts(steps.map((step) => step.totalTokens)),\n };\n const measured = Object.values(usage).some((count) => count !== null);\n const complete =\n finalUsage &&\n !aborted &&\n !abort.signal.aborted &&\n Object.values(usage).every((count) => count !== null) &&\n steps.every((step) =>\n Object.values(step).every((count) => count !== null),\n );\n console.log(\n `[planning-assistant] usage ${JSON.stringify({\n provider: config.provider,\n model: config.model,\n status: measured\n ? complete\n ? 'complete'\n : 'partial'\n : 'unavailable',\n ...usage,\n })}`,\n );\n }\n };\n};\n","import type { AgentMcpTools } from './mcp-tools';\n\nconst TOOL_LABELS: Record<string, string> = {\n undo: 'Undo',\n redo: 'Redo',\n 'change-component-parameter': 'Component parameter change',\n 'change-global-parameter': 'Global parameter change',\n 'dock-component': 'Component dock',\n 'drag-component': 'Component drag',\n 'delete-component': 'Component deletion',\n 'load-configuration': 'Configuration load',\n 'get-configurator-capabilities': 'Capabilities read',\n 'get-configuration': 'Configuration read',\n 'get-component-parameters': 'Component parameters read',\n 'get-global-parameters': 'Global parameters read',\n 'get-possible-children': 'Possible children read',\n 'get-docking-positions': 'Docking positions read',\n 'get-component-docking-positions': 'Component docking positions read',\n 'get-delete-impact': 'Delete impact read',\n};\n\n// The read-only tools: a failed or pending read never changed the configuration.\nconst READ_TOOLS: ReadonlySet<string> = new Set(\n Object.keys(TOOL_LABELS).filter((key) => key.startsWith('get-')),\n);\n\ninterface Outcome {\n toolName: string;\n status: 'pending' | 'returned' | 'threw';\n result?: any;\n error?: unknown;\n}\n\nconst textOf = (value: unknown): string => {\n if (value instanceof Error) {\n return value.message;\n }\n try {\n return typeof value === 'string'\n ? value\n : JSON.stringify(value) ?? String(value);\n } catch {\n return Object.prototype.toString.call(value);\n }\n};\n\nconst resultData = (result: any): any => {\n if (result?.structuredContent !== undefined) {\n return result.structuredContent;\n }\n const text = result?.content\n ?.filter((part: any) => part.type === 'text')\n .map((part: any) => part.text)\n .join('\\n');\n if (text === undefined) {\n return result;\n }\n try {\n return JSON.parse(text);\n } catch {\n return text;\n }\n};\n\nconst resultDetails = (data: any): string[] => {\n if (!data || typeof data !== 'object') {\n return data == null ? [] : [textOf(data)];\n }\n const details: string[] = [];\n for (const key of [\n 'applied',\n 'undone',\n 'redone',\n 'confirmed',\n 'canUndo',\n 'canRedo',\n ]) {\n if (data[key] !== undefined) {\n details.push(`${key}: ${textOf(data[key])}`);\n }\n }\n if (data.hint) {\n details.push(textOf(data.hint));\n }\n return details;\n};\n\n/**\n * Records tool execution independently of whether the model finishes its\n * step, so an interrupted reply can say what the tools changed.\n */\nexport const createChatRecovery = (\n tools: AgentMcpTools,\n domain: { subject: string; readTools: ReadonlySet<string> } = {\n subject: 'configuration',\n readTools: READ_TOOLS,\n },\n) => {\n const outcomes: Outcome[] = [];\n const recordedTools: AgentMcpTools = Object.fromEntries(\n Object.entries(tools).map(([toolName, tool]) => {\n if (!tool.execute) {\n return [toolName, tool];\n }\n const execute = tool.execute.bind(tool);\n return [\n toolName,\n {\n ...tool,\n execute: async (input: unknown) => {\n const outcome: Outcome = { toolName, status: 'pending' };\n outcomes.push(outcome);\n try {\n const result = await execute(input);\n outcome.result = result;\n outcome.status = 'returned';\n return result;\n } catch (error) {\n outcome.error = error;\n outcome.status = 'threw';\n throw error;\n }\n },\n },\n ];\n }),\n );\n\n const summary = (): string => {\n const lines = [\n \"The assistant's reply was interrupted. Any text above is incomplete.\",\n ];\n if (!outcomes.length) {\n lines.push(`No tool ran, so the ${domain.subject} was not changed.`);\n return lines.join('\\n\\n');\n }\n for (const outcome of outcomes) {\n const label = TOOL_LABELS[outcome.toolName] ?? outcome.toolName;\n if (domain.readTools.has(outcome.toolName)) {\n const successful =\n outcome.status === 'returned' && !outcome.result?.isError;\n const data = successful ? resultData(outcome.result) : undefined;\n lines.push(\n successful\n ? `- Completed ${label}: ${data?.complete === false ? 'some requested information was unresolved' : 'information was returned'}. The read did not change the ${domain.subject}.`\n : `- Incomplete ${label}: ${outcome.status === 'pending' ? 'no result was received' : 'the read failed'}. The read did not change the ${domain.subject}.`,\n );\n continue;\n }\n if (outcome.status === 'returned' && !outcome.result?.isError) {\n const data = resultData(outcome.result);\n // A write the configurator did not confirm may have left the\n // configuration unchanged; the undo and redo results carry no\n // confirmed key and keep the wording below.\n if (data?.confirmed === false) {\n lines.push(\n `- Unconfirmed ${label}: ${data?.hint ?? data?.unresolved?.join(' ') ?? `the SDK did not confirm the ${domain.subject} change`}. Check the ${domain.subject} before trying this operation again.`,\n );\n continue;\n }\n const details = resultDetails(data);\n lines.push(\n `- Completed ${label}: ${details.length ? details.join('; ') : 'the tool returned successfully.'}`,\n );\n } else {\n const detail =\n outcome.status === 'threw'\n ? textOf(outcome.error)\n : outcome.status === 'returned'\n ? textOf(resultData(outcome.result))\n : 'no result was received';\n lines.push(\n `- Unconfirmed ${label}: ${detail}. Check the ${domain.subject} before trying this operation again.`,\n );\n }\n }\n lines.push(\n 'These are the recorded tool outcomes; no operation was repeated automatically.',\n );\n return lines.join('\\n\\n');\n };\n\n return { tools: recordedTools, summary };\n};\n"],"mappings":";;;;AAQA,IAAM,KACJ,IAII,EAAE,MACF;CACJ,aAAa,EAAM,eAAe;CAClC,cAAc,EAAM,gBAAgB;CACpC,aACE,EAAM,gBACL,EAAM,gBAAgB,KAAA,KAAa,EAAM,iBAAiB,KAAA,IACvD,EAAM,cAAc,EAAM,eAC1B;CACP,GAEK,KAAa,MACjB,EAAO,MAAM,MAAU,MAAU,KAAK,GAClC,EAAO,QAAgB,GAAK,MAAU,KAAO,KAAS,IAAI,EAAE,GAC5D,MAGO,IAAkB,OAC7B,GACA,GACA,GACA,GAIA,MAOgE;CAChE,IAAM,IAAQ,MAAM,QAAQ,IAAI;EAC9B,OAAO;EACP,EAAc,EAAO;EACrB,GAAa;EACd,CAAC;AACF,GAAO,gBAAgB;CACvB,IAAM,CAAC,EAAE,eAAY,kBAAe,GAAO,EAAE,YAAS,cAAW,GAC3D,IAA2B,EAAE;AACnC,QAAO,OAAO,EAAE,SAAM,gBAAa;EACjC,IAAM,IAA+C,EAAE,EACnD,GACA,IAAU,IACR,IAA4B;GAChC,MAAM;GACN,SAAS,CACP;IAAE,MAAM;IAAQ,MAAM,KAAQ,EAAQ;IAAa,EACnD,GAAG,EAAO,KAAK,OAAU;IACvB,MAAM;IACN;IACA,WAAW;IACZ,EAAE,CACJ;GACF,EACK,IAAW,GAAY,SAAS,EAAM,EACtC,IAAQ,IAAI,iBAAiB,EAC7B,UAAgB,EAAM,MAAM,EAAO,OAAO;AAEhD,EADA,EAAO,iBAAiB,SAAS,GAAS,EAAE,MAAM,IAAM,CAAC,EACrD,EAAO,WACT,GAAS;EAEX,IAAM,IAAW,IACb,iBAEI,EAAM,MAAM,gBAAI,MAAM,4CAA4C,CAAC,EACrE,EAAW,UACZ,GACD,KAAA;AACJ,MAAI;GACF,IAAM,IAAS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js";
|
|
4
|
-
import { a as i, c as a, i as o, n as s, o as c, r as l, s as u, t as d } from "./configurator-capabilities-
|
|
4
|
+
import { a as i, c as a, i as o, n as s, o as c, r as l, s as u, t as d } from "./configurator-capabilities-DAXIjc-x.mjs";
|
|
5
5
|
//#region packages/common-core/src/mcp-api/configuration-operations.ts
|
|
6
6
|
var f = Object.keys(n), p = Object.keys(r), m = (e) => JSON.parse(JSON.stringify(e)), h = (e) => e.map((e) => m({
|
|
7
7
|
...e,
|
|
@@ -382,4 +382,4 @@ var f = Object.keys(n), p = Object.keys(r), m = (e) => JSON.parse(JSON.stringify
|
|
|
382
382
|
//#endregion
|
|
383
383
|
export { P as executeConfigurationOperation, N as queryConfigurationOperation };
|
|
384
384
|
|
|
385
|
-
//# sourceMappingURL=configuration-operations-
|
|
385
|
+
//# sourceMappingURL=configuration-operations-CzSBK1f0.mjs.map
|
package/lib/{configuration-operations-CbqNZZmc.mjs.map → configuration-operations-CzSBK1f0.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration-operations-CbqNZZmc.mjs","names":[],"sources":["../../packages/common-core/src/mcp-api/configuration-operations.ts"],"sourcesContent":["import type { z } from 'zod';\nimport {\n configurationOperationSchemas,\n configurationQuerySchemas,\n type ValidatedOperation,\n type ValidatedQuery,\n} from './configuration-operation-schemas';\nimport type ConfiguratorKernelAccess from '../configurator-kernel-access';\nimport type ConfiguratorContext from '../webgl/configurator-context';\nimport type { RapiAccess } from '../rapi-access';\nimport { BASE_CONTEXT } from '../main';\nimport type {\n ConfiguratorKernelClass,\n KernelComponent,\n KernelDockPairQuerySource,\n KernelParameter,\n KernelParameterGroup,\n PossibleChildPreviewElement,\n} from '../../../typings/kernel';\nimport { ANIMATION_PARAMETER_PREFIX } from '../../../configurator-core/src/utils/animation/animation-value-map';\nimport { collectConfiguratorCapabilities } from './configurator-capabilities';\nimport {\n configurationComponentIds,\n fetchComponentLlmData,\n readComponentLlmData,\n withParameterLlmData,\n} from './component-llm-data';\nimport {\n collectProductFamily,\n productContextOf,\n readComponentDefinition,\n} from './component-models';\nimport type {\n CapabilityJsonObject,\n ConfiguratorCapabilityContext,\n} from './configurator-capabilities-types';\nimport type {\n ConfigurationOperationHistoryState,\n ConfigurationOperationDockingChild,\n ConfigurationOperationExecutePayload,\n ConfigurationOperationHost,\n ConfigurationOperationName,\n ConfigurationOperationQueryPayload,\n ConfigurationOperationQueryResult,\n ConfigurationOperationQueryType,\n ConfigurationOperationResult,\n} from './configuration-operations-types';\n\nconst QUERY_TYPES = Object.keys(configurationQuerySchemas);\nconst EXECUTE_TYPES = Object.keys(configurationOperationSchemas);\n\ntype OperationKind = 'query' | 'operation';\ntype OperationKindLabel = 'Query' | 'Operation';\n\nconst detach = <T>(value: T): T => JSON.parse(JSON.stringify(value));\nconst detachParameters = (parameters: KernelParameter[]): KernelParameter[] =>\n parameters.map((parameter) =>\n detach({\n ...parameter,\n ...(parameter.viewType\n ? { viewType: { value: parameter.viewType.value } }\n : {}),\n }),\n );\n\nconst invalidPayload = (\n kind: OperationKind,\n name: string,\n reason: string,\n): Error => new Error(`Invalid payload for ${kind} '${name}': ${reason}`);\n\nconst parsePayload = <Schema extends z.ZodType>(\n schema: Schema,\n kind: OperationKind,\n name: string,\n payload: unknown,\n): z.output<Schema> => {\n const parsed = schema.safeParse(payload ?? {});\n if (!parsed.success) {\n throw invalidPayload(kind, name, parsed.error.issues[0].message);\n }\n return parsed.data;\n};\n\ninterface OperationSession {\n context: ConfiguratorContext;\n access: ConfiguratorKernelAccess;\n rapi: RapiAccess;\n host: ConfigurationOperationHost;\n kernel: ConfiguratorKernelClass;\n captured: ConfiguratorCapabilityContext;\n assertFresh: () => void;\n}\n\nconst parseConfigurationJson = (value: string): CapabilityJsonObject => {\n try {\n const parsed: unknown = JSON.parse(value);\n if (\n parsed !== null &&\n typeof parsed === 'object' &&\n !Array.isArray(parsed)\n ) {\n return parsed as CapabilityJsonObject;\n }\n } catch {\n /* falls through to the actionable error below */\n }\n throw new Error('Missing or invalid configuration JSON');\n};\n\nconst rootComponentIdOf = (configuration: string): string | undefined => {\n const parsed = parseConfigurationJson(configuration);\n return typeof parsed['componentId'] === 'string' && parsed['componentId']\n ? (parsed['componentId'] as string)\n : undefined;\n};\n\nconst preloadAssemblyRootDefinition = async (\n session: OperationSession,\n kind: OperationKind,\n name: string,\n configuration: string,\n): Promise<void> => {\n const rootComponentId = rootComponentIdOf(configuration);\n if (!rootComponentId) {\n return;\n }\n const record = await session.rapi.getComponent(rootComponentId);\n if (!record.configuration) {\n throw invalidPayload(\n kind,\n name,\n `the definition of root component '${rootComponentId}' has no configuration`,\n );\n }\n session.access.loadComponentIntoKernel(record.configuration, rootComponentId);\n};\n\nconst requireActiveComponent = (\n session: OperationSession,\n kind: OperationKindLabel,\n name: string,\n runtimeId: number,\n): KernelComponent => {\n let component: KernelComponent | undefined;\n try {\n component = session.kernel.getComponent(runtimeId);\n } catch {\n component = undefined;\n }\n if (!component) {\n throw new Error(\n `${kind} '${name}': no component with runtime id ${runtimeId} in the active configuration`,\n );\n }\n if (component.objectId !== session.captured.configurationRuntimeId) {\n throw new Error(\n `${kind} '${name}': component with runtime id ${runtimeId} is not part of the active configuration`,\n );\n }\n return component;\n};\n\nconst resolveDockingChildSource = async (\n session: OperationSession,\n kind: OperationKind,\n name: string,\n child: ConfigurationOperationDockingChild,\n): Promise<Exclude<KernelDockPairQuerySource, { runtimeId: number }>> => {\n if ('componentId' in child) {\n const record = await session.rapi.getComponent(child.componentId);\n if (!record.configuration) {\n throw invalidPayload(\n kind,\n name,\n `component '${child.componentId}' has no configuration`,\n );\n }\n return {\n componentId: child.componentId,\n configuration: record.configuration,\n };\n }\n if ('itemId' in child) {\n const item = await session.rapi.getItem(child.itemId);\n if (!item.configuration) {\n throw invalidPayload(\n kind,\n name,\n `item '${child.itemId}' has no configuration`,\n );\n }\n await preloadAssemblyRootDefinition(\n session,\n kind,\n name,\n item.configuration,\n );\n return { configuration: item.configuration };\n }\n await preloadAssemblyRootDefinition(session, kind, name, child.configuration);\n return { configuration: child.configuration };\n};\n\nconst previewElementOf = (\n child: ConfigurationOperationDockingChild,\n configuration: string,\n): PossibleChildPreviewElement => {\n if ('componentId' in child) {\n return {\n id: child.componentId,\n configuration,\n isComponent: true,\n isItem: false,\n };\n }\n return {\n id:\n 'itemId' in child ? child.itemId : rootComponentIdOf(configuration) ?? '',\n configuration,\n isComponent: false,\n isItem: true,\n };\n};\n\nconst runQuery = async (\n session: OperationSession,\n query: ValidatedQuery,\n): Promise<ConfigurationOperationQueryResult> => {\n const { captured, assertFresh } = session;\n switch (query.type) {\n case 'capabilities': {\n const capabilities = await collectConfiguratorCapabilities(\n session.context,\n session.access,\n session.rapi,\n query.include,\n );\n return {\n type: query.type,\n context: capabilities.context,\n capabilities,\n };\n }\n case 'configuration': {\n const configuration = parseConfigurationJson(\n session.access.getSerializedConfiguration(\n captured.configurationRuntimeId,\n ),\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n configuration: detach(configuration),\n configurationHash: captured.configurationHash,\n };\n }\n case 'componentParameters': {\n const component = requireActiveComponent(\n session,\n 'Query',\n query.type,\n query.runtimeId,\n );\n const componentId = session.kernel.getComponentId(query.runtimeId);\n const groups = detach(component.parameterGroups);\n const [kernelParameters, llmData] = await Promise.all([\n session.access.getComponentParameters(query.runtimeId),\n readComponentLlmData(session.rapi, componentId),\n ]);\n const parameters = withParameterLlmData(\n detachParameters(kernelParameters),\n [llmData],\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n runtimeId: query.runtimeId,\n componentId,\n groups,\n parameters,\n };\n }\n case 'globalParameters': {\n const rootAsGlobal = session.context.rootComponentParametersAsGlobal;\n const globalDefinition = rootAsGlobal\n ? session.kernel.getComponent(captured.rootRuntimeId)\n : session.kernel.getPlanObject(captured.configurationRuntimeId);\n const groups = detach(\n (globalDefinition.parameterGroups ?? []) as KernelParameterGroup[],\n );\n const componentIds = configurationComponentIds(\n parseConfigurationJson(\n session.access.getSerializedConfiguration(\n captured.configurationRuntimeId,\n ),\n ),\n );\n const [kernelParameters, llmData] = await Promise.all([\n session.access.getGlobalParameters(\n captured.configurationRuntimeId,\n rootAsGlobal,\n ),\n Promise.all(\n componentIds.map((id) => readComponentLlmData(session.rapi, id)),\n ),\n ]);\n const parameters = withParameterLlmData(\n detachParameters(kernelParameters),\n llmData,\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n scope: rootAsGlobal ? 'rootComponent' : 'planObject',\n groups,\n parameters,\n };\n }\n case 'possibleChildren': {\n const runtimeId = query.runtimeId ?? captured.configurationRuntimeId;\n if (query.runtimeId !== undefined) {\n requireActiveComponent(session, 'Query', query.type, query.runtimeId);\n }\n const children =\n query.runtimeId !== undefined\n ? await session.host.getChildrenOfPlanComponent(\n query.runtimeId,\n true,\n true,\n )\n : await session.host.getChildrenOfPlanObject(true, true);\n if (!children) {\n throw new Error(\n 'Configuration or selection changed while reading capabilities; read again',\n );\n }\n assertFresh();\n return {\n type: query.type,\n context: captured,\n runtimeId,\n tags: detach(children.tags),\n defaultChild: children.defaultChild\n ? detach(children.defaultChild)\n : undefined,\n };\n }\n case 'dockingPositions': {\n const source = await resolveDockingChildSource(\n session,\n 'query',\n query.type,\n query.child,\n );\n const dockPairs = session.access.getDockPairs(\n captured.configurationRuntimeId,\n source,\n query.allowInsertInBetween,\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n allowInsertInBetween: query.allowInsertInBetween,\n dockPairs: detach(dockPairs),\n };\n }\n case 'componentDockingPositions': {\n requireActiveComponent(session, 'Query', query.type, query.runtimeId);\n const dockPairs = session.access.getDockPairs(\n captured.configurationRuntimeId,\n { runtimeId: query.runtimeId },\n query.allowInsertInBetween,\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n runtimeId: query.runtimeId,\n allowInsertInBetween: query.allowInsertInBetween,\n dockPairs: detach(dockPairs),\n };\n }\n case 'deleteImpact': {\n const deletable = session.access.isComponentDeletable(\n query.runtimeId,\n query.redockChildrenToParent,\n );\n const componentsDeleted =\n session.access.determineComponentsThatWillBeDeleted(\n query.runtimeId,\n query.redockChildrenToParent,\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n runtimeId: query.runtimeId,\n redockChildrenToParent: query.redockChildrenToParent,\n deletable,\n componentsDeleted: detach(componentsDeleted),\n };\n }\n case 'componentSkill': {\n const { skills } = await fetchComponentLlmData(\n session.rapi,\n query.componentId,\n );\n const skill = skills.find(({ name }) => name === query.name);\n if (!skill) {\n const available = skills.length\n ? `its skills are ${skills.map(({ name }) => name).join(', ')}`\n : 'it has no skills';\n throw new Error(\n `Query 'componentSkill': component '${query.componentId}' has no skill '${query.name}'; ${available}`,\n );\n }\n assertFresh();\n return {\n type: query.type,\n context: captured,\n componentId: query.componentId,\n ...skill,\n };\n }\n case 'productContext': {\n const configuration = parseConfigurationJson(\n session.access.getSerializedConfiguration(\n captured.configurationRuntimeId,\n ),\n );\n const unresolved: Array<{\n resourceType: 'component' | 'item';\n id: string;\n reason: string;\n }> = [];\n const family = await collectProductFamily(\n session.rapi,\n configuration,\n (resourceType, id, error) =>\n unresolved.push({\n resourceType,\n id,\n reason: error instanceof Error ? error.message : String(error),\n }),\n [],\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n product: productContextOf(family, captured.rootComponentId),\n unresolved,\n };\n }\n case 'componentDefinition': {\n let component;\n try {\n component = await readComponentDefinition(\n session.rapi,\n query.componentId,\n );\n } catch (error) {\n throw new Error(\n `Query 'componentDefinition': component '${query.componentId}' could not be read: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n assertFresh();\n return { type: query.type, context: captured, component };\n }\n }\n};\n\nconst runOperation = async (\n session: OperationSession,\n operation: ValidatedOperation,\n) => {\n const { captured, assertFresh } = session;\n const resultHash = (): string =>\n session.access.getCurrentConfigurationHash(\n session.context.configurationRuntimeId,\n );\n switch (operation.type) {\n case 'changeComponentParameter': {\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.runtimeId,\n );\n if (operation.key.startsWith(ANIMATION_PARAMETER_PREFIX)) {\n throw new Error(\n `Operation 'changeComponentParameter': parameter keys starting with '${ANIMATION_PARAMETER_PREFIX}' are reserved for the animation system`,\n );\n }\n const parameters = await session.access.getComponentParameters(\n operation.runtimeId,\n );\n const parameter = parameters.find((entry) => entry.key === operation.key);\n if (!parameter) {\n throw new Error(\n `Operation 'changeComponentParameter': the component with runtime id ${operation.runtimeId} has no parameter '${operation.key}'`,\n );\n }\n if (!parameter.enabled) {\n throw new Error(\n `Operation 'changeComponentParameter': the parameter '${operation.key}' of the component with runtime id ${operation.runtimeId} is disabled`,\n );\n }\n assertFresh();\n session.access.setComponentParameter(\n operation.runtimeId,\n operation.key,\n operation.value,\n );\n session.access.updateSelectedComponentDependencies(\n captured.configurationRuntimeId,\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId: operation.runtimeId,\n key: operation.key,\n value: operation.value,\n };\n }\n case 'changeGlobalParameter': {\n const rootAsGlobal = session.context.rootComponentParametersAsGlobal;\n const parameters = await session.access.getGlobalParameters(\n captured.configurationRuntimeId,\n rootAsGlobal,\n );\n const parameter = parameters.find((entry) => entry.key === operation.key);\n if (!parameter) {\n throw new Error(\n `Operation 'changeGlobalParameter': the active configuration has no global parameter '${operation.key}'`,\n );\n }\n if (!parameter.enabled) {\n throw new Error(\n `Operation 'changeGlobalParameter': the global parameter '${operation.key}' is disabled`,\n );\n }\n assertFresh();\n if (rootAsGlobal) {\n session.access.setComponentParameter(\n captured.rootRuntimeId,\n operation.key,\n operation.value,\n );\n } else {\n session.access.setPlanObjectParameter(\n captured.configurationRuntimeId,\n operation.key,\n operation.value,\n );\n }\n session.access.updateSelectedComponentDependencies(\n captured.configurationRuntimeId,\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n scope: rootAsGlobal ? 'rootComponent' : 'planObject',\n key: operation.key,\n value: operation.value,\n };\n }\n case 'previewDockings': {\n const source = await resolveDockingChildSource(\n session,\n 'operation',\n operation.type,\n operation.child,\n );\n assertFresh();\n const dockPairs = session.access.getDockPairs(\n captured.configurationRuntimeId,\n source,\n session.access.allowInsertingBetweenWhenDocking,\n );\n session.host\n .getSceneManager()\n .requestDockingsPreview(\n true,\n previewElementOf(operation.child, source.configuration),\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n dockPairCount: dockPairs.length,\n };\n }\n case 'dockComponent': {\n const source = await resolveDockingChildSource(\n session,\n 'operation',\n operation.type,\n operation.child,\n );\n assertFresh();\n const runtimeId = session.access.dockNewComponent(\n captured.configurationRuntimeId,\n source,\n {\n parentId: operation.parentId,\n parentDockId: operation.parentDockId,\n position: operation.position,\n insertInBetween: operation.insertInBetween,\n },\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId,\n };\n }\n case 'dragComponent': {\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.runtimeId,\n );\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.parentId,\n );\n assertFresh();\n session.access.moveComponent(\n captured.configurationRuntimeId,\n operation.runtimeId,\n {\n parentId: operation.parentId,\n parentDockId: operation.parentDockId,\n childDockId: operation.childDockId,\n position: operation.position,\n insertInBetween: operation.insertInBetween,\n },\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId: operation.runtimeId,\n };\n }\n case 'deleteComponent': {\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.runtimeId,\n );\n if (\n !session.access.isComponentDeletable(\n operation.runtimeId,\n operation.redockChildrenToParent,\n )\n ) {\n throw new Error(\n `Operation 'deleteComponent': the component with runtime id ${operation.runtimeId} is not deletable with redockChildrenToParent ${operation.redockChildrenToParent}`,\n );\n }\n const componentsDeleted =\n session.access.determineComponentsThatWillBeDeleted(\n operation.runtimeId,\n operation.redockChildrenToParent,\n );\n assertFresh();\n session.access.deleteComponent(\n operation.runtimeId,\n operation.redockChildrenToParent,\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId: operation.runtimeId,\n redockChildrenToParent: operation.redockChildrenToParent,\n componentsDeleted: detach(componentsDeleted),\n };\n }\n case 'replaceComponent': {\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.runtimeId,\n );\n const source = await resolveDockingChildSource(\n session,\n 'operation',\n operation.type,\n operation.child,\n );\n assertFresh();\n const replaced = session.access.replaceComponent(\n captured.configurationRuntimeId,\n operation.runtimeId,\n source,\n );\n if (!replaced) {\n throw new Error(\n `Operation 'replaceComponent': the configurator did not put the child in the place of the component with runtime id ${operation.runtimeId}; the configuration is unchanged. Read the configuration again before the next operation: its runtime ids can have changed`,\n );\n }\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId: replaced.runtimeId,\n componentsDeleted: detach(replaced.componentsDeleted),\n };\n }\n case 'swapComponents': {\n const [firstRuntimeId, secondRuntimeId] = operation.runtimeIds;\n for (const runtimeId of [firstRuntimeId, secondRuntimeId]) {\n requireActiveComponent(session, 'Operation', operation.type, runtimeId);\n }\n assertFresh();\n session.access.swapComponents(\n captured.configurationRuntimeId,\n firstRuntimeId,\n secondRuntimeId,\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeIds: [firstRuntimeId, secondRuntimeId],\n };\n }\n case 'loadConfiguration': {\n await session.host\n .getSceneManager()\n .reloadConfiguration(operation.configuration);\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n };\n }\n case 'undo': {\n await session.host.undo();\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n };\n }\n case 'redo': {\n await session.host.redo();\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n };\n }\n }\n};\n\nconst STALE_QUERY_MESSAGE =\n 'Configuration or selection changed while reading capabilities; read again';\nconst STALE_OPERATION_MESSAGE =\n 'Configuration or selection changed while executing the operation; the operation was not applied';\n\ninterface QueuedConfiguration {\n pending: number;\n configurationRuntimeId: number;\n}\n\nlet operationChain: Promise<unknown> = Promise.resolve();\nconst queuedConfigurations = new WeakMap<\n ConfiguratorContext,\n QueuedConfiguration\n>();\n\nconst enqueue = <T>(\n context: ConfiguratorContext,\n staleMessage: string,\n work: (queued: QueuedConfiguration) => Promise<T>,\n): Promise<T> => {\n const current = queuedConfigurations.get(context);\n const queued = current?.pending\n ? current\n : { pending: 0, configurationRuntimeId: context.configurationRuntimeId };\n queuedConfigurations.set(context, queued);\n queued.pending += 1;\n const run = operationChain.then(() => {\n if (context.configurationRuntimeId !== queued.configurationRuntimeId) {\n throw new Error(staleMessage);\n }\n return work(queued);\n });\n operationChain = run\n .finally(() => {\n queued.pending -= 1;\n })\n .catch(() => undefined);\n return run;\n};\n\nconst captureContext = (\n context: ConfiguratorContext,\n kernel: ConfiguratorKernelClass,\n access: ConfiguratorKernelAccess,\n): ConfiguratorCapabilityContext => {\n if (\n context.baseContext !== BASE_CONTEXT.CONFIGURATOR ||\n !context.configurationRuntimeId\n ) {\n throw new Error(\n 'Load a configuration or enter planner isolation before reading configurator capabilities',\n );\n }\n if (kernel.isExternalPlanObject(context.configurationRuntimeId)) {\n throw new Error(\n 'Use the HI external-object API to read capabilities of an external configuration',\n );\n }\n const rootRuntimeId = kernel.getRootPlanComponentIdFromObjectId(\n context.configurationRuntimeId,\n );\n if (!rootRuntimeId) {\n throw new Error(\n 'No active root component; load a configuration before reading capabilities',\n );\n }\n return {\n configurationRuntimeId: context.configurationRuntimeId,\n rootRuntimeId,\n rootComponentId: kernel.getComponentId(rootRuntimeId),\n selectedRuntimeIds: [...context.selectedRuntimeComponentIds],\n configurationHash: access.getCurrentConfigurationHash(\n context.configurationRuntimeId,\n ),\n };\n};\n\nconst createAssertFresh = (\n context: ConfiguratorContext,\n kernel: ConfiguratorKernelClass,\n access: ConfiguratorKernelAccess,\n captured: ConfiguratorCapabilityContext,\n staleMessage: string,\n): (() => void) => {\n const rootAsGlobal = context.rootComponentParametersAsGlobal;\n const contextRootId = context.rootComponentId;\n return () => {\n try {\n if (\n JSON.stringify(captureContext(context, kernel, access)) ===\n JSON.stringify(captured) &&\n rootAsGlobal === context.rootComponentParametersAsGlobal &&\n contextRootId === context.rootComponentId\n ) {\n return;\n }\n } catch {\n /* A target that disappeared also invalidates the captured read. */\n }\n throw new Error(staleMessage);\n };\n};\n\nexport const queryConfigurationOperation = (\n context: ConfiguratorContext,\n access: ConfiguratorKernelAccess,\n rapi: RapiAccess,\n host: ConfigurationOperationHost,\n type: ConfigurationOperationQueryType,\n payload?: ConfigurationOperationQueryPayload,\n): Promise<ConfigurationOperationQueryResult> =>\n enqueue(context, STALE_QUERY_MESSAGE, async () => {\n if (!QUERY_TYPES.includes(type)) {\n throw new Error(\n `Unknown configuration operation query type '${String(type)}'; expected one of: ${QUERY_TYPES.join(', ')}`,\n );\n }\n const query = {\n ...parsePayload(configurationQuerySchemas[type], 'query', type, payload),\n type,\n } as ValidatedQuery;\n const kernel = access.kernelInstance;\n const captured = captureContext(context, kernel, access);\n const assertFresh = createAssertFresh(\n context,\n kernel,\n access,\n captured,\n STALE_QUERY_MESSAGE,\n );\n return runQuery(\n {\n context,\n access,\n rapi,\n host,\n kernel,\n captured,\n assertFresh,\n },\n query,\n );\n });\n\nexport const executeConfigurationOperation = (\n context: ConfiguratorContext,\n access: ConfiguratorKernelAccess,\n rapi: RapiAccess,\n host: ConfigurationOperationHost,\n readHistory: () => ConfigurationOperationHistoryState,\n name: ConfigurationOperationName,\n payload?: ConfigurationOperationExecutePayload,\n): Promise<ConfigurationOperationResult> =>\n enqueue(context, STALE_OPERATION_MESSAGE, async (queued) => {\n if (!EXECUTE_TYPES.includes(name)) {\n throw new Error(\n `Unknown configuration operation '${String(name)}'; expected one of: ${EXECUTE_TYPES.join(', ')}`,\n );\n }\n const operation = {\n ...parsePayload(\n configurationOperationSchemas[name],\n 'operation',\n name,\n payload,\n ),\n type: name,\n } as ValidatedOperation;\n const kernel = access.kernelInstance;\n const captured = captureContext(context, kernel, access);\n const assertFresh = createAssertFresh(\n context,\n kernel,\n access,\n captured,\n STALE_OPERATION_MESSAGE,\n );\n const before = readHistory();\n const result = await runOperation(\n {\n context,\n access,\n rapi,\n host,\n kernel,\n captured,\n assertFresh,\n },\n operation,\n );\n queued.configurationRuntimeId = context.configurationRuntimeId;\n const after = readHistory();\n return {\n ...result,\n history: {\n changed:\n before.configurationHash !== after.configurationHash &&\n after.configurationHash === result.configurationHash,\n canUndo: after.canUndo,\n canRedo: after.canRedo,\n },\n } as ConfigurationOperationResult;\n });\n"],"mappings":";;;;;AAgDA,IAAM,IAAc,OAAO,KAAK,EAA0B,EACpD,IAAgB,OAAO,KAAK,EAA8B,EAK1D,KAAa,MAAgB,KAAK,MAAM,KAAK,UAAU,EAAM,CAAC,EAC9D,KAAoB,MACxB,EAAW,KAAK,MACd,EAAO;CACL,GAAG;CACH,GAAI,EAAU,WACV,EAAE,UAAU,EAAE,OAAO,EAAU,SAAS,OAAO,EAAE,GACjD,EAAE;CACP,CAAC,CACH,EAEG,KACJ,GACA,GACA,MACU,gBAAI,MAAM,uBAAuB,EAAK,IAAI,EAAK,KAAK,IAAS,EAEnE,KACJ,GACA,GACA,GACA,MACqB;CACrB,IAAM,IAAS,EAAO,UAAU,KAAW,EAAE,CAAC;AAC9C,KAAI,CAAC,EAAO,QACV,OAAM,EAAe,GAAM,GAAM,EAAO,MAAM,OAAO,GAAG,QAAQ;AAElE,QAAO,EAAO;GAaV,KAA0B,MAAwC;AACtE,KAAI;EACF,IAAM,IAAkB,KAAK,MAAM,EAAM;AACzC,MAEE,OAAO,KAAW,YADlB,KAEA,CAAC,MAAM,QAAQ,EAAO,CAEtB,QAAO;SAEH;AAGR,OAAU,MAAM,wCAAwC;GAGpD,KAAqB,MAA8C;CACvE,IAAM,IAAS,EAAuB,EAAc;AACpD,QAAO,OAAO,EAAO,eAAmB,YAAY,EAAO,cACtD,EAAO,cACR,KAAA;GAGA,IAAgC,OACpC,GACA,GACA,GACA,MACk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C1B,MAAiB,EAAQ,mCACzB,MAAkB,EAAQ,gBAE1B;UAEI;AAGR,QAAU,MAAM,EAAa;;GAIpB,KACX,GACA,GACA,GACA,GACA,GACA,MAEA,EAAQ,GAAS,GAAqB,YAAY;AAChD,KAAI,CAAC,EAAY,SAAS,EAAK,CAC7B,OAAU,MACR,+CAA+C,OAAO,EAAK,CAAC,sBAAsB,EAAY,KAAK,KAAK,GACzG;CAEH,IAAM,IAAQ;EACZ,GAAG,EAAa,EAA0B,IAAO,SAAS,GAAM,EAAQ;EACxE;EACD,EACK,IAAS,EAAO,gBAChB,IAAW,EAAe,GAAS,GAAQ,EAAO;AAQxD,QAAO,EACL;EACE;EACA;EACA;EACA;EACA;EACA;EACA,aAfgB,EAClB,GACA,GACA,GACA,GACA,EACD;EAUE,EACD,EACD;EACD,EAES,KACX,GACA,GACA,GACA,GACA,GACA,GACA,MAEA,EAAQ,GAAS,GAAyB,OAAO,MAAW;AAC1D,KAAI,CAAC,EAAc,SAAS,EAAK,CAC/B,OAAU,MACR,oCAAoC,OAAO,EAAK,CAAC,sBAAsB,EAAc,KAAK,KAAK,GAChG;CAEH,IAAM,IAAY;EAChB,GAAG,EACD,EAA8B,IAC9B,aACA,GACA,EACD;EACD,MAAM;EACP,EACK,IAAS,EAAO,gBAChB,IAAW,EAAe,GAAS,GAAQ,EAAO,EAClD,IAAc,EAClB,GACA,GACA,GACA,GACA,EACD,EACK,IAAS,GAAa,EACtB,IAAS,MAAM,EACnB;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,EACD,EACD;AACD,GAAO,yBAAyB,EAAQ;CACxC,IAAM,IAAQ,GAAa;AAC3B,QAAO;EACL,GAAG;EACH,SAAS;GACP,SACE,EAAO,sBAAsB,EAAM,qBACnC,EAAM,sBAAsB,EAAO;GACrC,SAAS,EAAM;GACf,SAAS,EAAM;GAChB;EACF;EACD"}
|
|
1
|
+
{"version":3,"file":"configuration-operations-CzSBK1f0.mjs","names":[],"sources":["../../packages/common-core/src/mcp-api/configuration-operations.ts"],"sourcesContent":["import type { z } from 'zod';\nimport {\n configurationOperationSchemas,\n configurationQuerySchemas,\n type ValidatedOperation,\n type ValidatedQuery,\n} from './configuration-operation-schemas';\nimport type ConfiguratorKernelAccess from '../configurator-kernel-access';\nimport type ConfiguratorContext from '../webgl/configurator-context';\nimport type { RapiAccess } from '../rapi-access';\nimport { BASE_CONTEXT } from '../main';\nimport type {\n ConfiguratorKernelClass,\n KernelComponent,\n KernelDockPairQuerySource,\n KernelParameter,\n KernelParameterGroup,\n PossibleChildPreviewElement,\n} from '../../../typings/kernel';\nimport { ANIMATION_PARAMETER_PREFIX } from '../../../configurator-core/src/utils/animation/animation-value-map';\nimport { collectConfiguratorCapabilities } from './configurator-capabilities';\nimport {\n configurationComponentIds,\n fetchComponentLlmData,\n readComponentLlmData,\n withParameterLlmData,\n} from './component-llm-data';\nimport {\n collectProductFamily,\n productContextOf,\n readComponentDefinition,\n} from './component-models';\nimport type {\n CapabilityJsonObject,\n ConfiguratorCapabilityContext,\n} from './configurator-capabilities-types';\nimport type {\n ConfigurationOperationHistoryState,\n ConfigurationOperationDockingChild,\n ConfigurationOperationExecutePayload,\n ConfigurationOperationHost,\n ConfigurationOperationName,\n ConfigurationOperationQueryPayload,\n ConfigurationOperationQueryResult,\n ConfigurationOperationQueryType,\n ConfigurationOperationResult,\n} from './configuration-operations-types';\n\nconst QUERY_TYPES = Object.keys(configurationQuerySchemas);\nconst EXECUTE_TYPES = Object.keys(configurationOperationSchemas);\n\ntype OperationKind = 'query' | 'operation';\ntype OperationKindLabel = 'Query' | 'Operation';\n\nconst detach = <T>(value: T): T => JSON.parse(JSON.stringify(value));\nconst detachParameters = (parameters: KernelParameter[]): KernelParameter[] =>\n parameters.map((parameter) =>\n detach({\n ...parameter,\n ...(parameter.viewType\n ? { viewType: { value: parameter.viewType.value } }\n : {}),\n }),\n );\n\nconst invalidPayload = (\n kind: OperationKind,\n name: string,\n reason: string,\n): Error => new Error(`Invalid payload for ${kind} '${name}': ${reason}`);\n\nconst parsePayload = <Schema extends z.ZodType>(\n schema: Schema,\n kind: OperationKind,\n name: string,\n payload: unknown,\n): z.output<Schema> => {\n const parsed = schema.safeParse(payload ?? {});\n if (!parsed.success) {\n throw invalidPayload(kind, name, parsed.error.issues[0].message);\n }\n return parsed.data;\n};\n\ninterface OperationSession {\n context: ConfiguratorContext;\n access: ConfiguratorKernelAccess;\n rapi: RapiAccess;\n host: ConfigurationOperationHost;\n kernel: ConfiguratorKernelClass;\n captured: ConfiguratorCapabilityContext;\n assertFresh: () => void;\n}\n\nconst parseConfigurationJson = (value: string): CapabilityJsonObject => {\n try {\n const parsed: unknown = JSON.parse(value);\n if (\n parsed !== null &&\n typeof parsed === 'object' &&\n !Array.isArray(parsed)\n ) {\n return parsed as CapabilityJsonObject;\n }\n } catch {\n /* falls through to the actionable error below */\n }\n throw new Error('Missing or invalid configuration JSON');\n};\n\nconst rootComponentIdOf = (configuration: string): string | undefined => {\n const parsed = parseConfigurationJson(configuration);\n return typeof parsed['componentId'] === 'string' && parsed['componentId']\n ? (parsed['componentId'] as string)\n : undefined;\n};\n\nconst preloadAssemblyRootDefinition = async (\n session: OperationSession,\n kind: OperationKind,\n name: string,\n configuration: string,\n): Promise<void> => {\n const rootComponentId = rootComponentIdOf(configuration);\n if (!rootComponentId) {\n return;\n }\n const record = await session.rapi.getComponent(rootComponentId);\n if (!record.configuration) {\n throw invalidPayload(\n kind,\n name,\n `the definition of root component '${rootComponentId}' has no configuration`,\n );\n }\n session.access.loadComponentIntoKernel(record.configuration, rootComponentId);\n};\n\nconst requireActiveComponent = (\n session: OperationSession,\n kind: OperationKindLabel,\n name: string,\n runtimeId: number,\n): KernelComponent => {\n let component: KernelComponent | undefined;\n try {\n component = session.kernel.getComponent(runtimeId);\n } catch {\n component = undefined;\n }\n if (!component) {\n throw new Error(\n `${kind} '${name}': no component with runtime id ${runtimeId} in the active configuration`,\n );\n }\n if (component.objectId !== session.captured.configurationRuntimeId) {\n throw new Error(\n `${kind} '${name}': component with runtime id ${runtimeId} is not part of the active configuration`,\n );\n }\n return component;\n};\n\nconst resolveDockingChildSource = async (\n session: OperationSession,\n kind: OperationKind,\n name: string,\n child: ConfigurationOperationDockingChild,\n): Promise<Exclude<KernelDockPairQuerySource, { runtimeId: number }>> => {\n if ('componentId' in child) {\n const record = await session.rapi.getComponent(child.componentId);\n if (!record.configuration) {\n throw invalidPayload(\n kind,\n name,\n `component '${child.componentId}' has no configuration`,\n );\n }\n return {\n componentId: child.componentId,\n configuration: record.configuration,\n };\n }\n if ('itemId' in child) {\n const item = await session.rapi.getItem(child.itemId);\n if (!item.configuration) {\n throw invalidPayload(\n kind,\n name,\n `item '${child.itemId}' has no configuration`,\n );\n }\n await preloadAssemblyRootDefinition(\n session,\n kind,\n name,\n item.configuration,\n );\n return { configuration: item.configuration };\n }\n await preloadAssemblyRootDefinition(session, kind, name, child.configuration);\n return { configuration: child.configuration };\n};\n\nconst previewElementOf = (\n child: ConfigurationOperationDockingChild,\n configuration: string,\n): PossibleChildPreviewElement => {\n if ('componentId' in child) {\n return {\n id: child.componentId,\n configuration,\n isComponent: true,\n isItem: false,\n };\n }\n return {\n id:\n 'itemId' in child ? child.itemId : rootComponentIdOf(configuration) ?? '',\n configuration,\n isComponent: false,\n isItem: true,\n };\n};\n\nconst runQuery = async (\n session: OperationSession,\n query: ValidatedQuery,\n): Promise<ConfigurationOperationQueryResult> => {\n const { captured, assertFresh } = session;\n switch (query.type) {\n case 'capabilities': {\n const capabilities = await collectConfiguratorCapabilities(\n session.context,\n session.access,\n session.rapi,\n query.include,\n );\n return {\n type: query.type,\n context: capabilities.context,\n capabilities,\n };\n }\n case 'configuration': {\n const configuration = parseConfigurationJson(\n session.access.getSerializedConfiguration(\n captured.configurationRuntimeId,\n ),\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n configuration: detach(configuration),\n configurationHash: captured.configurationHash,\n };\n }\n case 'componentParameters': {\n const component = requireActiveComponent(\n session,\n 'Query',\n query.type,\n query.runtimeId,\n );\n const componentId = session.kernel.getComponentId(query.runtimeId);\n const groups = detach(component.parameterGroups);\n const [kernelParameters, llmData] = await Promise.all([\n session.access.getComponentParameters(query.runtimeId),\n readComponentLlmData(session.rapi, componentId),\n ]);\n const parameters = withParameterLlmData(\n detachParameters(kernelParameters),\n [llmData],\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n runtimeId: query.runtimeId,\n componentId,\n groups,\n parameters,\n };\n }\n case 'globalParameters': {\n const rootAsGlobal = session.context.rootComponentParametersAsGlobal;\n const globalDefinition = rootAsGlobal\n ? session.kernel.getComponent(captured.rootRuntimeId)\n : session.kernel.getPlanObject(captured.configurationRuntimeId);\n const groups = detach(\n (globalDefinition.parameterGroups ?? []) as KernelParameterGroup[],\n );\n const componentIds = configurationComponentIds(\n parseConfigurationJson(\n session.access.getSerializedConfiguration(\n captured.configurationRuntimeId,\n ),\n ),\n );\n const [kernelParameters, llmData] = await Promise.all([\n session.access.getGlobalParameters(\n captured.configurationRuntimeId,\n rootAsGlobal,\n ),\n Promise.all(\n componentIds.map((id) => readComponentLlmData(session.rapi, id)),\n ),\n ]);\n const parameters = withParameterLlmData(\n detachParameters(kernelParameters),\n llmData,\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n scope: rootAsGlobal ? 'rootComponent' : 'planObject',\n groups,\n parameters,\n };\n }\n case 'possibleChildren': {\n const runtimeId = query.runtimeId ?? captured.configurationRuntimeId;\n if (query.runtimeId !== undefined) {\n requireActiveComponent(session, 'Query', query.type, query.runtimeId);\n }\n const children =\n query.runtimeId !== undefined\n ? await session.host.getChildrenOfPlanComponent(\n query.runtimeId,\n true,\n true,\n )\n : await session.host.getChildrenOfPlanObject(true, true);\n if (!children) {\n throw new Error(\n 'Configuration or selection changed while reading capabilities; read again',\n );\n }\n assertFresh();\n return {\n type: query.type,\n context: captured,\n runtimeId,\n tags: detach(children.tags),\n defaultChild: children.defaultChild\n ? detach(children.defaultChild)\n : undefined,\n };\n }\n case 'dockingPositions': {\n const source = await resolveDockingChildSource(\n session,\n 'query',\n query.type,\n query.child,\n );\n const dockPairs = session.access.getDockPairs(\n captured.configurationRuntimeId,\n source,\n query.allowInsertInBetween,\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n allowInsertInBetween: query.allowInsertInBetween,\n dockPairs: detach(dockPairs),\n };\n }\n case 'componentDockingPositions': {\n requireActiveComponent(session, 'Query', query.type, query.runtimeId);\n const dockPairs = session.access.getDockPairs(\n captured.configurationRuntimeId,\n { runtimeId: query.runtimeId },\n query.allowInsertInBetween,\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n runtimeId: query.runtimeId,\n allowInsertInBetween: query.allowInsertInBetween,\n dockPairs: detach(dockPairs),\n };\n }\n case 'deleteImpact': {\n const deletable = session.access.isComponentDeletable(\n query.runtimeId,\n query.redockChildrenToParent,\n );\n const componentsDeleted =\n session.access.determineComponentsThatWillBeDeleted(\n query.runtimeId,\n query.redockChildrenToParent,\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n runtimeId: query.runtimeId,\n redockChildrenToParent: query.redockChildrenToParent,\n deletable,\n componentsDeleted: detach(componentsDeleted),\n };\n }\n case 'componentSkill': {\n const { skills } = await fetchComponentLlmData(\n session.rapi,\n query.componentId,\n );\n const skill = skills.find(({ name }) => name === query.name);\n if (!skill) {\n const available = skills.length\n ? `its skills are ${skills.map(({ name }) => name).join(', ')}`\n : 'it has no skills';\n throw new Error(\n `Query 'componentSkill': component '${query.componentId}' has no skill '${query.name}'; ${available}`,\n );\n }\n assertFresh();\n return {\n type: query.type,\n context: captured,\n componentId: query.componentId,\n ...skill,\n };\n }\n case 'productContext': {\n const configuration = parseConfigurationJson(\n session.access.getSerializedConfiguration(\n captured.configurationRuntimeId,\n ),\n );\n const unresolved: Array<{\n resourceType: 'component' | 'item';\n id: string;\n reason: string;\n }> = [];\n const family = await collectProductFamily(\n session.rapi,\n configuration,\n (resourceType, id, error) =>\n unresolved.push({\n resourceType,\n id,\n reason: error instanceof Error ? error.message : String(error),\n }),\n [],\n );\n assertFresh();\n return {\n type: query.type,\n context: captured,\n product: productContextOf(family, captured.rootComponentId),\n unresolved,\n };\n }\n case 'componentDefinition': {\n let component;\n try {\n component = await readComponentDefinition(\n session.rapi,\n query.componentId,\n );\n } catch (error) {\n throw new Error(\n `Query 'componentDefinition': component '${query.componentId}' could not be read: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n assertFresh();\n return { type: query.type, context: captured, component };\n }\n }\n};\n\nconst runOperation = async (\n session: OperationSession,\n operation: ValidatedOperation,\n) => {\n const { captured, assertFresh } = session;\n const resultHash = (): string =>\n session.access.getCurrentConfigurationHash(\n session.context.configurationRuntimeId,\n );\n switch (operation.type) {\n case 'changeComponentParameter': {\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.runtimeId,\n );\n if (operation.key.startsWith(ANIMATION_PARAMETER_PREFIX)) {\n throw new Error(\n `Operation 'changeComponentParameter': parameter keys starting with '${ANIMATION_PARAMETER_PREFIX}' are reserved for the animation system`,\n );\n }\n const parameters = await session.access.getComponentParameters(\n operation.runtimeId,\n );\n const parameter = parameters.find((entry) => entry.key === operation.key);\n if (!parameter) {\n throw new Error(\n `Operation 'changeComponentParameter': the component with runtime id ${operation.runtimeId} has no parameter '${operation.key}'`,\n );\n }\n if (!parameter.enabled) {\n throw new Error(\n `Operation 'changeComponentParameter': the parameter '${operation.key}' of the component with runtime id ${operation.runtimeId} is disabled`,\n );\n }\n assertFresh();\n session.access.setComponentParameter(\n operation.runtimeId,\n operation.key,\n operation.value,\n );\n session.access.updateSelectedComponentDependencies(\n captured.configurationRuntimeId,\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId: operation.runtimeId,\n key: operation.key,\n value: operation.value,\n };\n }\n case 'changeGlobalParameter': {\n const rootAsGlobal = session.context.rootComponentParametersAsGlobal;\n const parameters = await session.access.getGlobalParameters(\n captured.configurationRuntimeId,\n rootAsGlobal,\n );\n const parameter = parameters.find((entry) => entry.key === operation.key);\n if (!parameter) {\n throw new Error(\n `Operation 'changeGlobalParameter': the active configuration has no global parameter '${operation.key}'`,\n );\n }\n if (!parameter.enabled) {\n throw new Error(\n `Operation 'changeGlobalParameter': the global parameter '${operation.key}' is disabled`,\n );\n }\n assertFresh();\n if (rootAsGlobal) {\n session.access.setComponentParameter(\n captured.rootRuntimeId,\n operation.key,\n operation.value,\n );\n } else {\n session.access.setPlanObjectParameter(\n captured.configurationRuntimeId,\n operation.key,\n operation.value,\n );\n }\n session.access.updateSelectedComponentDependencies(\n captured.configurationRuntimeId,\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n scope: rootAsGlobal ? 'rootComponent' : 'planObject',\n key: operation.key,\n value: operation.value,\n };\n }\n case 'previewDockings': {\n const source = await resolveDockingChildSource(\n session,\n 'operation',\n operation.type,\n operation.child,\n );\n assertFresh();\n const dockPairs = session.access.getDockPairs(\n captured.configurationRuntimeId,\n source,\n session.access.allowInsertingBetweenWhenDocking,\n );\n session.host\n .getSceneManager()\n .requestDockingsPreview(\n true,\n previewElementOf(operation.child, source.configuration),\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n dockPairCount: dockPairs.length,\n };\n }\n case 'dockComponent': {\n const source = await resolveDockingChildSource(\n session,\n 'operation',\n operation.type,\n operation.child,\n );\n assertFresh();\n const runtimeId = session.access.dockNewComponent(\n captured.configurationRuntimeId,\n source,\n {\n parentId: operation.parentId,\n parentDockId: operation.parentDockId,\n position: operation.position,\n insertInBetween: operation.insertInBetween,\n },\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId,\n };\n }\n case 'dragComponent': {\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.runtimeId,\n );\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.parentId,\n );\n assertFresh();\n session.access.moveComponent(\n captured.configurationRuntimeId,\n operation.runtimeId,\n {\n parentId: operation.parentId,\n parentDockId: operation.parentDockId,\n childDockId: operation.childDockId,\n position: operation.position,\n insertInBetween: operation.insertInBetween,\n },\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId: operation.runtimeId,\n };\n }\n case 'deleteComponent': {\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.runtimeId,\n );\n if (\n !session.access.isComponentDeletable(\n operation.runtimeId,\n operation.redockChildrenToParent,\n )\n ) {\n throw new Error(\n `Operation 'deleteComponent': the component with runtime id ${operation.runtimeId} is not deletable with redockChildrenToParent ${operation.redockChildrenToParent}`,\n );\n }\n const componentsDeleted =\n session.access.determineComponentsThatWillBeDeleted(\n operation.runtimeId,\n operation.redockChildrenToParent,\n );\n assertFresh();\n session.access.deleteComponent(\n operation.runtimeId,\n operation.redockChildrenToParent,\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId: operation.runtimeId,\n redockChildrenToParent: operation.redockChildrenToParent,\n componentsDeleted: detach(componentsDeleted),\n };\n }\n case 'replaceComponent': {\n requireActiveComponent(\n session,\n 'Operation',\n operation.type,\n operation.runtimeId,\n );\n const source = await resolveDockingChildSource(\n session,\n 'operation',\n operation.type,\n operation.child,\n );\n assertFresh();\n const replaced = session.access.replaceComponent(\n captured.configurationRuntimeId,\n operation.runtimeId,\n source,\n );\n if (!replaced) {\n throw new Error(\n `Operation 'replaceComponent': the configurator did not put the child in the place of the component with runtime id ${operation.runtimeId}; the configuration is unchanged. Read the configuration again before the next operation: its runtime ids can have changed`,\n );\n }\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeId: replaced.runtimeId,\n componentsDeleted: detach(replaced.componentsDeleted),\n };\n }\n case 'swapComponents': {\n const [firstRuntimeId, secondRuntimeId] = operation.runtimeIds;\n for (const runtimeId of [firstRuntimeId, secondRuntimeId]) {\n requireActiveComponent(session, 'Operation', operation.type, runtimeId);\n }\n assertFresh();\n session.access.swapComponents(\n captured.configurationRuntimeId,\n firstRuntimeId,\n secondRuntimeId,\n );\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n runtimeIds: [firstRuntimeId, secondRuntimeId],\n };\n }\n case 'loadConfiguration': {\n await session.host\n .getSceneManager()\n .reloadConfiguration(operation.configuration);\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n };\n }\n case 'undo': {\n await session.host.undo();\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n };\n }\n case 'redo': {\n await session.host.redo();\n return {\n type: operation.type,\n context: captured,\n configurationHash: resultHash(),\n };\n }\n }\n};\n\nconst STALE_QUERY_MESSAGE =\n 'Configuration or selection changed while reading capabilities; read again';\nconst STALE_OPERATION_MESSAGE =\n 'Configuration or selection changed while executing the operation; the operation was not applied';\n\ninterface QueuedConfiguration {\n pending: number;\n configurationRuntimeId: number;\n}\n\nlet operationChain: Promise<unknown> = Promise.resolve();\nconst queuedConfigurations = new WeakMap<\n ConfiguratorContext,\n QueuedConfiguration\n>();\n\nconst enqueue = <T>(\n context: ConfiguratorContext,\n staleMessage: string,\n work: (queued: QueuedConfiguration) => Promise<T>,\n): Promise<T> => {\n const current = queuedConfigurations.get(context);\n const queued = current?.pending\n ? current\n : { pending: 0, configurationRuntimeId: context.configurationRuntimeId };\n queuedConfigurations.set(context, queued);\n queued.pending += 1;\n const run = operationChain.then(() => {\n if (context.configurationRuntimeId !== queued.configurationRuntimeId) {\n throw new Error(staleMessage);\n }\n return work(queued);\n });\n operationChain = run\n .finally(() => {\n queued.pending -= 1;\n })\n .catch(() => undefined);\n return run;\n};\n\nconst captureContext = (\n context: ConfiguratorContext,\n kernel: ConfiguratorKernelClass,\n access: ConfiguratorKernelAccess,\n): ConfiguratorCapabilityContext => {\n if (\n context.baseContext !== BASE_CONTEXT.CONFIGURATOR ||\n !context.configurationRuntimeId\n ) {\n throw new Error(\n 'Load a configuration or enter planner isolation before reading configurator capabilities',\n );\n }\n if (kernel.isExternalPlanObject(context.configurationRuntimeId)) {\n throw new Error(\n 'Use the HI external-object API to read capabilities of an external configuration',\n );\n }\n const rootRuntimeId = kernel.getRootPlanComponentIdFromObjectId(\n context.configurationRuntimeId,\n );\n if (!rootRuntimeId) {\n throw new Error(\n 'No active root component; load a configuration before reading capabilities',\n );\n }\n return {\n configurationRuntimeId: context.configurationRuntimeId,\n rootRuntimeId,\n rootComponentId: kernel.getComponentId(rootRuntimeId),\n selectedRuntimeIds: [...context.selectedRuntimeComponentIds],\n configurationHash: access.getCurrentConfigurationHash(\n context.configurationRuntimeId,\n ),\n };\n};\n\nconst createAssertFresh = (\n context: ConfiguratorContext,\n kernel: ConfiguratorKernelClass,\n access: ConfiguratorKernelAccess,\n captured: ConfiguratorCapabilityContext,\n staleMessage: string,\n): (() => void) => {\n const rootAsGlobal = context.rootComponentParametersAsGlobal;\n const contextRootId = context.rootComponentId;\n return () => {\n try {\n if (\n JSON.stringify(captureContext(context, kernel, access)) ===\n JSON.stringify(captured) &&\n rootAsGlobal === context.rootComponentParametersAsGlobal &&\n contextRootId === context.rootComponentId\n ) {\n return;\n }\n } catch {\n /* A target that disappeared also invalidates the captured read. */\n }\n throw new Error(staleMessage);\n };\n};\n\nexport const queryConfigurationOperation = (\n context: ConfiguratorContext,\n access: ConfiguratorKernelAccess,\n rapi: RapiAccess,\n host: ConfigurationOperationHost,\n type: ConfigurationOperationQueryType,\n payload?: ConfigurationOperationQueryPayload,\n): Promise<ConfigurationOperationQueryResult> =>\n enqueue(context, STALE_QUERY_MESSAGE, async () => {\n if (!QUERY_TYPES.includes(type)) {\n throw new Error(\n `Unknown configuration operation query type '${String(type)}'; expected one of: ${QUERY_TYPES.join(', ')}`,\n );\n }\n const query = {\n ...parsePayload(configurationQuerySchemas[type], 'query', type, payload),\n type,\n } as ValidatedQuery;\n const kernel = access.kernelInstance;\n const captured = captureContext(context, kernel, access);\n const assertFresh = createAssertFresh(\n context,\n kernel,\n access,\n captured,\n STALE_QUERY_MESSAGE,\n );\n return runQuery(\n {\n context,\n access,\n rapi,\n host,\n kernel,\n captured,\n assertFresh,\n },\n query,\n );\n });\n\nexport const executeConfigurationOperation = (\n context: ConfiguratorContext,\n access: ConfiguratorKernelAccess,\n rapi: RapiAccess,\n host: ConfigurationOperationHost,\n readHistory: () => ConfigurationOperationHistoryState,\n name: ConfigurationOperationName,\n payload?: ConfigurationOperationExecutePayload,\n): Promise<ConfigurationOperationResult> =>\n enqueue(context, STALE_OPERATION_MESSAGE, async (queued) => {\n if (!EXECUTE_TYPES.includes(name)) {\n throw new Error(\n `Unknown configuration operation '${String(name)}'; expected one of: ${EXECUTE_TYPES.join(', ')}`,\n );\n }\n const operation = {\n ...parsePayload(\n configurationOperationSchemas[name],\n 'operation',\n name,\n payload,\n ),\n type: name,\n } as ValidatedOperation;\n const kernel = access.kernelInstance;\n const captured = captureContext(context, kernel, access);\n const assertFresh = createAssertFresh(\n context,\n kernel,\n access,\n captured,\n STALE_OPERATION_MESSAGE,\n );\n const before = readHistory();\n const result = await runOperation(\n {\n context,\n access,\n rapi,\n host,\n kernel,\n captured,\n assertFresh,\n },\n operation,\n );\n queued.configurationRuntimeId = context.configurationRuntimeId;\n const after = readHistory();\n return {\n ...result,\n history: {\n changed:\n before.configurationHash !== after.configurationHash &&\n after.configurationHash === result.configurationHash,\n canUndo: after.canUndo,\n canRedo: after.canRedo,\n },\n } as ConfigurationOperationResult;\n });\n"],"mappings":";;;;;AAgDA,IAAM,IAAc,OAAO,KAAK,EAA0B,EACpD,IAAgB,OAAO,KAAK,EAA8B,EAK1D,KAAa,MAAgB,KAAK,MAAM,KAAK,UAAU,EAAM,CAAC,EAC9D,KAAoB,MACxB,EAAW,KAAK,MACd,EAAO;CACL,GAAG;CACH,GAAI,EAAU,WACV,EAAE,UAAU,EAAE,OAAO,EAAU,SAAS,OAAO,EAAE,GACjD,EAAE;CACP,CAAC,CACH,EAEG,KACJ,GACA,GACA,MACU,gBAAI,MAAM,uBAAuB,EAAK,IAAI,EAAK,KAAK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AM,IAAY;EAChB,GAAG,EACD,EAA8B,IAC9B,aACA,GACA,EACD;EACD,MAAM;EACP,EACK,IAAS,EAAO,gBAChB,IAAW,EAAe,GAAS,GAAQ,EAAO,EAClD,IAAc,EAClB,GACA,GACA,GACA,GACA,EACD,EACK,IAAS,GAAa,EACtB,IAAS,MAAM,EACnB;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACD,EACD,EACD;AACD,GAAO,yBAAyB,EAAQ;CACxC,IAAM,IAAQ,GAAa;AAC3B,QAAO;EACL,GAAG;EACH,SAAS;GACP,SACE,EAAO,sBAAsB,EAAM,qBACnC,EAAM,sBAAsB,EAAO;GACrC,SAAS,EAAM;GACf,SAAS,EAAM;GAChB;EACF;EACD"}
|
package/lib/{configurator-capabilities-70kymvOa.mjs → configurator-capabilities-DAXIjc-x.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { U as e, j as t } from "./roomle-sdk-
|
|
2
|
+
import { U as e, j as t } from "./roomle-sdk-CMP8F6qv.mjs";
|
|
3
3
|
import { n, t as r } from "./configuration-operation-schemas-Q4gAd-KO.mjs";
|
|
4
4
|
//#region packages/common-core/src/mcp-api/component-llm-data.ts
|
|
5
5
|
var i = new Set([e.DECIMAL, e.INTEGER]), a = (e) => typeof e == "string" && e.trim() ? e : void 0, o = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0, s = (e) => Array.isArray(e) ? e.map(o).filter((e) => !!e) : [], c = (e) => {
|
|
@@ -437,4 +437,4 @@ var i = new Set([e.DECIMAL, e.INTEGER]), a = (e) => typeof e == "string" && e.tr
|
|
|
437
437
|
//#endregion
|
|
438
438
|
export { h as a, m as c, A as i, O as n, u as o, k as r, d as s, V as t };
|
|
439
439
|
|
|
440
|
-
//# sourceMappingURL=configurator-capabilities-
|
|
440
|
+
//# sourceMappingURL=configurator-capabilities-DAXIjc-x.mjs.map
|