@mindexec/cli 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +275 -0
- package/codex-runtime.js +960 -0
- package/launch-bridge.cjs +162 -0
- package/package.json +61 -0
- package/port-guard.cjs +232 -0
- package/scripts/setup-tree-sitter-grammars.mjs +59 -0
- package/server.js +8422 -0
- package/start-bridge.bat +32 -0
- package/start-bridge.sh +81 -0
- package/tree-sitter-grammars/README.md +18 -0
- package/tree-sitter-grammars/tree-sitter-c_sharp.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-go.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-java.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-javascript.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-python.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-rust.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-tsx.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-typescript.wasm +0 -0
- package/wwwroot/MindExecution.Web.styles.css +3 -0
- package/wwwroot/_content/MindExecution.Plugins.Admin/css/admin-dashboard.css +546 -0
- package/wwwroot/_content/MindExecution.Plugins.Directory/MindExecution.Plugins.Directory.u7utcng611.bundle.scp.css +7 -0
- package/wwwroot/_content/MindExecution.Plugins.Directory/background.png +0 -0
- package/wwwroot/_content/MindExecution.Plugins.Directory/directory-manager.js +202 -0
- package/wwwroot/_content/MindExecution.Plugins.Directory/exampleJsInterop.js +6 -0
- package/wwwroot/_content/MindExecution.Plugins.YouTube/css/youtube-search.css +251 -0
- package/wwwroot/_content/MindExecution.Shared/MindExecution.Shared.wsano1j4wp.bundle.scp.css +4 -0
- package/wwwroot/_content/MindExecution.Shared/css/admin-dashboard.css +559 -0
- package/wwwroot/_content/MindExecution.Shared/css/app.css +1 -0
- package/wwwroot/_content/MindExecution.Shared/css/mind-map-overrides.css +2936 -0
- package/wwwroot/_content/MindExecution.Shared/fonts/NotoSansKR-Bold.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/fonts/NotoSansKR-Regular.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/js/agent-visualization.js +359 -0
- package/wwwroot/_content/MindExecution.Shared/js/background-themes.js +1721 -0
- package/wwwroot/_content/MindExecution.Shared/js/code-master.js +8316 -0
- package/wwwroot/_content/MindExecution.Shared/js/file-system-helper.js +639 -0
- package/wwwroot/_content/MindExecution.Shared/js/helpers/InfiniteGridHelper.js +109 -0
- package/wwwroot/_content/MindExecution.Shared/js/marked.min.js +69 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-core.js +7982 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-core.js.backup +1059 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-css3d-manager.js +15803 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-dev-guards.js +325 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-dnd.js +1430 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-dnd.js.bak +434 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-glow-shader.js +260 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-interactions.js +7640 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-plan-worker.js +160 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-renderer.js +9923 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-logic-workers.js +977 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-menu-manager.js +1431 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-multi-select.js +1716 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-node-search-worker.js +553 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-nodes.js +4541 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-object-manager.js +489 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-object-manager.js.backup +372 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-pipeline.js +2075 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-text-lod-system.js +646 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-text-overlay-v2.js +4323 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-texture-factory.js +2260 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-texture-factory.js.backup +1258 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-visibility-worker.js +890 -0
- package/wwwroot/_content/MindExecution.Shared/js/mindmap-toolbar.js +594 -0
- package/wwwroot/_content/MindExecution.Shared/js/native-drop-handler.js +170 -0
- package/wwwroot/_content/MindExecution.Shared/js/plan-master.js +788 -0
- package/wwwroot/_content/MindExecution.Shared/js/renderers/CSS3DRenderer.js +50 -0
- package/wwwroot/_content/MindExecution.Shared/js/texture-worker-manager.js +188 -0
- package/wwwroot/_content/MindExecution.Shared/js/texture-worker.js +208 -0
- package/wwwroot/_content/MindExecution.Shared/js/three.min.js +6 -0
- package/wwwroot/_content/MindExecution.Shared/js/titlebar-handler.js +191 -0
- package/wwwroot/_content/MindExecution.Shared/js/token-manager.js +37 -0
- package/wwwroot/_content/MindExecution.Shared/js/token-worker.js +28 -0
- package/wwwroot/_content/MindExecution.Shared/js/troika-bundle.js +5626 -0
- package/wwwroot/_content/MindExecution.Shared/js/troika-bundle.js.map +7 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/css/all.min.css +9 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-brands-400.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-brands-400.woff2 +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-regular-400.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-regular-400.woff2 +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-solid-900.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-solid-900.woff2 +0 -0
- package/wwwroot/_content/MindExecution.Shared/models/all-MiniLM-L6-v2-quantized.onnx +0 -0
- package/wwwroot/_content/MindExecution.Shared/models/vocab.txt +30522 -0
- package/wwwroot/_framework/Google.Protobuf.9h59ukbel7.dll +0 -0
- package/wwwroot/_framework/Markdig.d1j7v41cl1.dll +0 -0
- package/wwwroot/_framework/MessagePack.Annotations.l6qv48kgpt.dll +0 -0
- package/wwwroot/_framework/MessagePack.eqoptzx9d5.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Authorization.k7dsih5y5g.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Components.6nyje9sa0g.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Components.Authorization.iycd6unprw.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Components.Web.487u3twia4.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Components.WebAssembly.d0gcnmlxxz.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Metadata.h4yevl9adi.dll +0 -0
- package/wwwroot/_framework/Microsoft.CSharp.qrvp77qmhs.dll +0 -0
- package/wwwroot/_framework/Microsoft.Data.Sqlite.jdlxgv2jtg.dll +0 -0
- package/wwwroot/_framework/Microsoft.EntityFrameworkCore.4gjazp7kjf.dll +0 -0
- package/wwwroot/_framework/Microsoft.EntityFrameworkCore.Abstractions.gocudnvz7b.dll +0 -0
- package/wwwroot/_framework/Microsoft.EntityFrameworkCore.Relational.lt4rsvinuo.dll +0 -0
- package/wwwroot/_framework/Microsoft.EntityFrameworkCore.Sqlite.69luj0fa9r.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Caching.Abstractions.364t4jh3zz.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Caching.Memory.izlxhpzosu.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Configuration.8zq7hh41o7.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Configuration.Abstractions.8if74zs6ea.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Configuration.Json.duvlngw8i0.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.t2hh9kvx0o.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.DependencyInjection.n4tg99oy8l.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.DependencyModel.h0d06ixk3e.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Logging.Abstractions.rl32bkx2sd.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Logging.dlht1xei0t.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Options.qeunebioml.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Primitives.18cr6vnuuz.dll +0 -0
- package/wwwroot/_framework/Microsoft.IO.RecyclableMemoryStream.r915vovvw4.dll +0 -0
- package/wwwroot/_framework/Microsoft.IdentityModel.Abstractions.1ejljk3erv.dll +0 -0
- package/wwwroot/_framework/Microsoft.IdentityModel.JsonWebTokens.1596zr8gne.dll +0 -0
- package/wwwroot/_framework/Microsoft.IdentityModel.Logging.229uyvpgio.dll +0 -0
- package/wwwroot/_framework/Microsoft.IdentityModel.Tokens.9sibtajc9f.dll +0 -0
- package/wwwroot/_framework/Microsoft.JSInterop.17lq4j1j7g.dll +0 -0
- package/wwwroot/_framework/Microsoft.JSInterop.WebAssembly.ryia5gxiad.dll +0 -0
- package/wwwroot/_framework/Microsoft.ML.OnnxRuntime.w9deo1m5ss.dll +0 -0
- package/wwwroot/_framework/Microsoft.ML.Tokenizers.cm2vuv2z61.dll +0 -0
- package/wwwroot/_framework/Microsoft.NET.StringTools.3qbrf4v2ki.dll +0 -0
- package/wwwroot/_framework/MimeMapping.og9ys58ylm.dll +0 -0
- package/wwwroot/_framework/MindExecution.Core.1q1trifbuu.dll +0 -0
- package/wwwroot/_framework/MindExecution.Kernel.gwwc40sc45.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.Admin.0jgrn1sckv.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.Business.13mme2qcag.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.Concept.dfp2mdt45q.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.Directory.3w4t6n3se0.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.PlanMaster.s0qpntz420.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.YouTube.iu11fq8d16.dll +0 -0
- package/wwwroot/_framework/MindExecution.Shared.7j27dcqnrc.dll +0 -0
- package/wwwroot/_framework/MindExecution.Web.pq1ty8ov2v.dll +0 -0
- package/wwwroot/_framework/Newtonsoft.Json.a56zs13vug.dll +0 -0
- package/wwwroot/_framework/SQLitePCLRaw.batteries_v2.rrd1nzawpp.dll +0 -0
- package/wwwroot/_framework/SQLitePCLRaw.core.1dxloztpfz.dll +0 -0
- package/wwwroot/_framework/SQLitePCLRaw.provider.e_sqlite3.oekyzl53i1.dll +0 -0
- package/wwwroot/_framework/Supabase.Core.s1pkj4aj0l.dll +0 -0
- package/wwwroot/_framework/Supabase.Functions.qz4nu782sg.dll +0 -0
- package/wwwroot/_framework/Supabase.Gotrue.twah27pkik.dll +0 -0
- package/wwwroot/_framework/Supabase.Postgrest.gmuuv369ih.dll +0 -0
- package/wwwroot/_framework/Supabase.Realtime.ox3kchdy3w.dll +0 -0
- package/wwwroot/_framework/Supabase.Storage.fnjnepaowr.dll +0 -0
- package/wwwroot/_framework/Supabase.azmaw5pgcz.dll +0 -0
- package/wwwroot/_framework/System.Collections.Concurrent.y1zmvuyipi.dll +0 -0
- package/wwwroot/_framework/System.Collections.Immutable.ug3j698qms.dll +0 -0
- package/wwwroot/_framework/System.Collections.NonGeneric.h66hj3863h.dll +0 -0
- package/wwwroot/_framework/System.Collections.Specialized.umr3y27ntj.dll +0 -0
- package/wwwroot/_framework/System.Collections.x53e19vfsj.dll +0 -0
- package/wwwroot/_framework/System.ComponentModel.Annotations.tz6gnt4ebt.dll +0 -0
- package/wwwroot/_framework/System.ComponentModel.Primitives.j7tiphu4rg.dll +0 -0
- package/wwwroot/_framework/System.ComponentModel.TypeConverter.ujlztox1gx.dll +0 -0
- package/wwwroot/_framework/System.ComponentModel.x9xz0ojfb6.dll +0 -0
- package/wwwroot/_framework/System.Console.ijzpqmj7ne.dll +0 -0
- package/wwwroot/_framework/System.Data.Common.1r0sqffq1p.dll +0 -0
- package/wwwroot/_framework/System.Diagnostics.DiagnosticSource.9upoqwq09o.dll +0 -0
- package/wwwroot/_framework/System.Diagnostics.Process.m99azzntjm.dll +0 -0
- package/wwwroot/_framework/System.Diagnostics.TraceSource.pl7wv26myr.dll +0 -0
- package/wwwroot/_framework/System.Diagnostics.Tracing.crlhfx6tut.dll +0 -0
- package/wwwroot/_framework/System.Drawing.Primitives.22e4y9ikq9.dll +0 -0
- package/wwwroot/_framework/System.Drawing.mi7d8hwowb.dll +0 -0
- package/wwwroot/_framework/System.Formats.Asn1.jx23sjiqnn.dll +0 -0
- package/wwwroot/_framework/System.IO.Compression.6fyoii3uej.dll +0 -0
- package/wwwroot/_framework/System.IO.Pipelines.vg77t4cd4d.dll +0 -0
- package/wwwroot/_framework/System.IdentityModel.Tokens.Jwt.t67es60z5b.dll +0 -0
- package/wwwroot/_framework/System.Linq.1bkoxlqgmq.dll +0 -0
- package/wwwroot/_framework/System.Linq.Expressions.24xqiypwdt.dll +0 -0
- package/wwwroot/_framework/System.Linq.Queryable.hvd01d6rsa.dll +0 -0
- package/wwwroot/_framework/System.Memory.8dx3lwgym4.dll +0 -0
- package/wwwroot/_framework/System.Net.Http.Json.3mhdm9l1rf.dll +0 -0
- package/wwwroot/_framework/System.Net.Http.eitrz660my.dll +0 -0
- package/wwwroot/_framework/System.Net.NetworkInformation.3pkuofcv9r.dll +0 -0
- package/wwwroot/_framework/System.Net.Ping.8clj5pklrp.dll +0 -0
- package/wwwroot/_framework/System.Net.Primitives.qrp4wcjz1p.dll +0 -0
- package/wwwroot/_framework/System.Net.WebSockets.Client.2u6pv01g69.dll +0 -0
- package/wwwroot/_framework/System.Net.WebSockets.qp6u31zvm5.dll +0 -0
- package/wwwroot/_framework/System.Numerics.Tensors.0c7z4mt3on.dll +0 -0
- package/wwwroot/_framework/System.Numerics.Vectors.kc7ufp2j4l.dll +0 -0
- package/wwwroot/_framework/System.ObjectModel.qv82fot1ib.dll +0 -0
- package/wwwroot/_framework/System.Private.CoreLib.rkafq04oma.dll +0 -0
- package/wwwroot/_framework/System.Private.Uri.t9542hmr6j.dll +0 -0
- package/wwwroot/_framework/System.Private.Xml.Linq.n8n3ptrbwu.dll +0 -0
- package/wwwroot/_framework/System.Private.Xml.rxd3tytisn.dll +0 -0
- package/wwwroot/_framework/System.Reactive.t3fuon548l.dll +0 -0
- package/wwwroot/_framework/System.Reflection.Emit.9tjhp6y0j3.dll +0 -0
- package/wwwroot/_framework/System.Reflection.Emit.ILGeneration.stxyk8zoo1.dll +0 -0
- package/wwwroot/_framework/System.Reflection.Emit.Lightweight.6xrd5v8vg0.dll +0 -0
- package/wwwroot/_framework/System.Reflection.Primitives.wgn8fpwwvv.dll +0 -0
- package/wwwroot/_framework/System.Runtime.InteropServices.JavaScript.sliym526xh.dll +0 -0
- package/wwwroot/_framework/System.Runtime.InteropServices.RuntimeInformation.oji7zut14z.dll +0 -0
- package/wwwroot/_framework/System.Runtime.InteropServices.te07xr2we9.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Intrinsics.507y4h8nzq.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Loader.v7gk4bse0k.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Numerics.eqy5xjv3nd.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Serialization.Formatters.zpkrub8lab.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Serialization.Primitives.vhkpnbxjip.dll +0 -0
- package/wwwroot/_framework/System.Runtime.jn319d5nyg.dll +0 -0
- package/wwwroot/_framework/System.Security.Claims.0ztig1q9vo.dll +0 -0
- package/wwwroot/_framework/System.Security.Cryptography.vttizqc9ho.dll +0 -0
- package/wwwroot/_framework/System.Text.Encoding.Extensions.utdd47ny8f.dll +0 -0
- package/wwwroot/_framework/System.Text.Encodings.Web.wah8r1zoe0.dll +0 -0
- package/wwwroot/_framework/System.Text.Json.kxlfxj0wrs.dll +0 -0
- package/wwwroot/_framework/System.Text.RegularExpressions.dbqn58klox.dll +0 -0
- package/wwwroot/_framework/System.Threading.42ao9vi047.dll +0 -0
- package/wwwroot/_framework/System.Threading.Channels.hfa7j0uv2w.dll +0 -0
- package/wwwroot/_framework/System.Threading.Thread.caul0pdqul.dll +0 -0
- package/wwwroot/_framework/System.Transactions.Local.fimi2hamzo.dll +0 -0
- package/wwwroot/_framework/System.Web.HttpUtility.gq8yz50p2e.dll +0 -0
- package/wwwroot/_framework/System.Xml.Linq.kitin4zjoj.dll +0 -0
- package/wwwroot/_framework/System.Xml.ReaderWriter.kzvw3qgxb0.dll +0 -0
- package/wwwroot/_framework/System.Xml.XDocument.c539ki6cuq.dll +0 -0
- package/wwwroot/_framework/System.m05i39uvk9.dll +0 -0
- package/wwwroot/_framework/Websocket.Client.vapounvmnl.dll +0 -0
- package/wwwroot/_framework/blazor.boot.json +305 -0
- package/wwwroot/_framework/blazor.webassembly.js +1 -0
- package/wwwroot/_framework/dotnet.js +4 -0
- package/wwwroot/_framework/dotnet.native.vz0adxojrz.wasm +0 -0
- package/wwwroot/_framework/dotnet.native.xsn1d6x2kd.js +16 -0
- package/wwwroot/_framework/dotnet.runtime.dstopyvqzi.js +4 -0
- package/wwwroot/_framework/icudt_CJK.tjcz0u77k5.dat +0 -0
- package/wwwroot/_framework/icudt_EFIGS.tptq2av103.dat +0 -0
- package/wwwroot/_framework/icudt_no_CJK.lfu7j35m59.dat +0 -0
- package/wwwroot/_framework/netstandard.0xet7jg7ky.dll +0 -0
- package/wwwroot/_headers +40 -0
- package/wwwroot/_redirects +1 -0
- package/wwwroot/appsettings.json +71 -0
- package/wwwroot/icon-192.png +0 -0
- package/wwwroot/icon-512.png +0 -0
- package/wwwroot/index.html +710 -0
- package/wwwroot/js/marketing-tool.js +180 -0
- package/wwwroot/manifest.webmanifest +22 -0
- package/wwwroot/robots.txt +4 -0
- package/wwwroot/service-worker-assets.js +857 -0
- package/wwwroot/service-worker.js +33 -0
- package/wwwroot/sitemap.xml +27 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Minimal CSS3DRenderer setup adapted for direct script include (non-module)
|
|
2
|
+
(function(){
|
|
3
|
+
if (window.CSS3DRenderer) return;
|
|
4
|
+
|
|
5
|
+
function epsilon(value){return Math.abs(value) < 1e-10 ? 0 : value;}
|
|
6
|
+
|
|
7
|
+
class CSS3DObject extends THREE.Object3D {
|
|
8
|
+
constructor(element){
|
|
9
|
+
super();
|
|
10
|
+
this.element = element || document.createElement('div');
|
|
11
|
+
this.element.style.position = 'absolute';
|
|
12
|
+
this.element.style.pointerEvents = 'auto';
|
|
13
|
+
// Flags used by renderer checks
|
|
14
|
+
this.isCSS3DObject = true;
|
|
15
|
+
|
|
16
|
+
this.addEventListener('removed', function(){
|
|
17
|
+
this.traverse(function(object){
|
|
18
|
+
if (object.element instanceof Element && object.element.parentNode !== null){
|
|
19
|
+
object.element.parentNode.removeChild(object.element);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class CSS3DSprite extends CSS3DObject {
|
|
27
|
+
constructor(element){
|
|
28
|
+
super(element);
|
|
29
|
+
this.isCSS3DSprite = true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function CSS3DRenderer(){
|
|
34
|
+
var _width, _height; var _widthHalf, _heightHalf; var cache = { camera:{ fov:0, style:'' }, objects: new WeakMap() };
|
|
35
|
+
var domElement = document.createElement('div'); domElement.style.overflow = 'hidden'; this.domElement = domElement;
|
|
36
|
+
var cameraElement = document.createElement('div'); cameraElement.style.webkitTransformStyle = cameraElement.style.transformStyle = 'preserve-3d'; cameraElement.style.pointerEvents = 'none'; domElement.appendChild(cameraElement);
|
|
37
|
+
|
|
38
|
+
this.getSize = function(){ return { width:_width, height:_height }; };
|
|
39
|
+
this.getCameraElement = function(){ return cameraElement; };
|
|
40
|
+
this.setSize = function(width, height){ _width=width; _height=height; _widthHalf=_width/2; _heightHalf=_height/2; domElement.style.width=width+'px'; domElement.style.height=height+'px'; cameraElement.style.width=width+'px'; cameraElement.style.height=height+'px'; };
|
|
41
|
+
function getCameraCSSMatrix(matrix){ var e=matrix.elements; return 'matrix3d('+epsilon(e[0])+','+epsilon(-e[1])+','+epsilon(e[2])+','+epsilon(e[3])+','+epsilon(e[4])+','+epsilon(-e[5])+','+epsilon(e[6])+','+epsilon(e[7])+','+epsilon(e[8])+','+epsilon(-e[9])+','+epsilon(e[10])+','+epsilon(e[11])+','+epsilon(e[12])+','+epsilon(-e[13])+','+epsilon(e[14])+','+epsilon(e[15])+')'; }
|
|
42
|
+
function getObjectCSSMatrix(matrix){ var e=matrix.elements; var m='matrix3d('+epsilon(e[0])+','+epsilon(e[1])+','+epsilon(e[2])+','+epsilon(e[3])+','+epsilon(-e[4])+','+epsilon(-e[5])+','+epsilon(-e[6])+','+epsilon(-e[7])+','+epsilon(e[8])+','+epsilon(e[9])+','+epsilon(e[10])+','+epsilon(e[11])+','+epsilon(e[12])+','+epsilon(e[13])+','+epsilon(e[14])+','+epsilon(e[15])+')'; return m; }
|
|
43
|
+
function renderObject(object, scene, camera, cameraCSSMatrix){ if (object.isCSS3DObject){ var style=getObjectCSSMatrix(object.matrixWorld); var element=object.element; var cached=cache.objects.get(object); if (cached===undefined || cached.style!==style){ element.style.webkitTransform=element.style.transform=style; cache.objects.set(object, { style }); } element.style.display = object.visible ? '' : 'none'; if (element.parentNode !== cameraElement){ cameraElement.appendChild(element); } } for (var i=0,l=object.children.length;i<l;i++){ renderObject(object.children[i], scene, camera, cameraCSSMatrix); } }
|
|
44
|
+
function renderCameraOnly(renderer, camera){ var fov=camera.projectionMatrix.elements[5]*_heightHalf; if (cache.camera.fov!==fov){ renderer.domElement.style.webkitPerspective=renderer.domElement.style.perspective=fov+'px'; cache.camera.fov=fov; } if (camera.parent===null) camera.updateMatrixWorld(); var cameraCSSMatrix='translateZ('+fov+'px)'+getCameraCSSMatrix(camera.matrixWorldInverse); var style=cameraCSSMatrix+'translate('+_widthHalf+'px,'+_heightHalf+'px)'; if (cache.camera.style!==style){ cameraElement.style.webkitTransform=cameraElement.style.transform=style; cache.camera.style=style; } return cameraCSSMatrix; }
|
|
45
|
+
this.renderCamera = function(camera){ renderCameraOnly(this, camera); };
|
|
46
|
+
this.render = function(scene, camera){ if (scene.autoUpdate===true) scene.updateMatrixWorld(); var cameraCSSMatrix=renderCameraOnly(this, camera); renderObject(scene, scene, camera, cameraCSSMatrix); };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
window.CSS3DObject = CSS3DObject; window.CSS3DSprite = CSS3DSprite; window.CSS3DRenderer = CSS3DRenderer;
|
|
50
|
+
})();
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
// texture-worker-manager.js
|
|
2
|
+
// [NEW] Worker 풀 관리 + 텍스처 생성 API
|
|
3
|
+
(function () {
|
|
4
|
+
'use strict';
|
|
5
|
+
|
|
6
|
+
const WORKER_COUNT = 2; // Worker 수 (CPU 코어에 따라 조절)
|
|
7
|
+
const workers = [];
|
|
8
|
+
const pendingRequests = new Map();
|
|
9
|
+
let nextRequestId = 0;
|
|
10
|
+
let currentWorkerIndex = 0;
|
|
11
|
+
let isInitialized = false;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Worker 풀 초기화
|
|
15
|
+
*/
|
|
16
|
+
function init() {
|
|
17
|
+
if (isInitialized) return Promise.resolve();
|
|
18
|
+
|
|
19
|
+
// OffscreenCanvas 지원 확인
|
|
20
|
+
if (typeof OffscreenCanvas === 'undefined') {
|
|
21
|
+
console.warn('[TextureWorker] OffscreenCanvas not supported, using fallback');
|
|
22
|
+
return Promise.resolve();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return new Promise((resolve) => {
|
|
26
|
+
let readyCount = 0;
|
|
27
|
+
|
|
28
|
+
for (let i = 0; i < WORKER_COUNT; i++) {
|
|
29
|
+
try {
|
|
30
|
+
const worker = new Worker('_content/MindExecution.Shared/js/texture-worker.js');
|
|
31
|
+
|
|
32
|
+
worker.onmessage = (e) => {
|
|
33
|
+
const { type, requestId, bitmap, error } = e.data;
|
|
34
|
+
|
|
35
|
+
if (type === 'ready') {
|
|
36
|
+
readyCount++;
|
|
37
|
+
console.log(`[TextureWorker] Worker ${i} ready (${readyCount}/${WORKER_COUNT})`);
|
|
38
|
+
if (readyCount === WORKER_COUNT) {
|
|
39
|
+
isInitialized = true;
|
|
40
|
+
console.log('[TextureWorker] All workers ready');
|
|
41
|
+
resolve();
|
|
42
|
+
}
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const pending = pendingRequests.get(requestId);
|
|
47
|
+
if (!pending) return;
|
|
48
|
+
|
|
49
|
+
pendingRequests.delete(requestId);
|
|
50
|
+
|
|
51
|
+
if (type === 'error') {
|
|
52
|
+
pending.reject(new Error(error));
|
|
53
|
+
} else if (type === 'textureReady') {
|
|
54
|
+
pending.resolve(bitmap);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
worker.onerror = (e) => {
|
|
59
|
+
console.error(`[TextureWorker] Worker ${i} error:`, e);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
workers.push(worker);
|
|
63
|
+
} catch (e) {
|
|
64
|
+
console.error(`[TextureWorker] Failed to create worker ${i}:`, e);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 타임아웃 (5초 후 강제 resolve)
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
if (!isInitialized) {
|
|
71
|
+
console.warn('[TextureWorker] Init timeout, some workers may not be ready');
|
|
72
|
+
isInitialized = workers.length > 0;
|
|
73
|
+
resolve();
|
|
74
|
+
}
|
|
75
|
+
}, 5000);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Worker 지원 여부
|
|
81
|
+
*/
|
|
82
|
+
function isSupported() {
|
|
83
|
+
return typeof OffscreenCanvas !== 'undefined' && workers.length > 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Worker를 사용해 텍스처 생성 요청
|
|
88
|
+
* @returns {Promise<ImageBitmap>}
|
|
89
|
+
*/
|
|
90
|
+
async function renderTexture(nodeData, width, height, qualityScale = 1.0) {
|
|
91
|
+
if (!isInitialized) {
|
|
92
|
+
await init();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return new Promise((resolve, reject) => {
|
|
96
|
+
if (!isSupported()) {
|
|
97
|
+
reject(new Error('Worker not supported'));
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const requestId = nextRequestId++;
|
|
102
|
+
const worker = workers[currentWorkerIndex];
|
|
103
|
+
currentWorkerIndex = (currentWorkerIndex + 1) % workers.length;
|
|
104
|
+
|
|
105
|
+
pendingRequests.set(requestId, { resolve, reject });
|
|
106
|
+
|
|
107
|
+
// 5초 타임아웃
|
|
108
|
+
const timeout = setTimeout(() => {
|
|
109
|
+
if (pendingRequests.has(requestId)) {
|
|
110
|
+
pendingRequests.delete(requestId);
|
|
111
|
+
reject(new Error('Worker timeout'));
|
|
112
|
+
}
|
|
113
|
+
}, 5000);
|
|
114
|
+
|
|
115
|
+
// 원래 resolve/reject에 타임아웃 클리어 추가
|
|
116
|
+
const originalResolve = resolve;
|
|
117
|
+
const originalReject = reject;
|
|
118
|
+
|
|
119
|
+
pendingRequests.set(requestId, {
|
|
120
|
+
resolve: (result) => {
|
|
121
|
+
clearTimeout(timeout);
|
|
122
|
+
originalResolve(result);
|
|
123
|
+
},
|
|
124
|
+
reject: (error) => {
|
|
125
|
+
clearTimeout(timeout);
|
|
126
|
+
originalReject(error);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
// Worker에 요청 전송
|
|
131
|
+
worker.postMessage({
|
|
132
|
+
type: 'renderTexture',
|
|
133
|
+
requestId: requestId,
|
|
134
|
+
nodeData: {
|
|
135
|
+
id: nodeData.id,
|
|
136
|
+
contentType: nodeData.contentType,
|
|
137
|
+
response: nodeData.response,
|
|
138
|
+
prompt: nodeData.prompt
|
|
139
|
+
},
|
|
140
|
+
width: Math.round(width),
|
|
141
|
+
height: Math.round(height),
|
|
142
|
+
qualityScale: qualityScale
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* ImageBitmap을 THREE.CanvasTexture로 변환
|
|
149
|
+
*/
|
|
150
|
+
function bitmapToTexture(bitmap, THREE) {
|
|
151
|
+
// ImageBitmap을 Canvas에 그리기
|
|
152
|
+
const canvas = document.createElement('canvas');
|
|
153
|
+
canvas.width = bitmap.width;
|
|
154
|
+
canvas.height = bitmap.height;
|
|
155
|
+
const ctx = canvas.getContext('2d');
|
|
156
|
+
ctx.drawImage(bitmap, 0, 0);
|
|
157
|
+
bitmap.close(); // 메모리 해제
|
|
158
|
+
|
|
159
|
+
// THREE.CanvasTexture 생성
|
|
160
|
+
const texture = new THREE.CanvasTexture(canvas);
|
|
161
|
+
texture.colorSpace = THREE.SRGBColorSpace;
|
|
162
|
+
texture.generateMipmaps = true;
|
|
163
|
+
texture.minFilter = THREE.LinearMipmapLinearFilter;
|
|
164
|
+
texture.magFilter = THREE.LinearFilter;
|
|
165
|
+
|
|
166
|
+
return texture;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Worker 종료
|
|
171
|
+
*/
|
|
172
|
+
function terminate() {
|
|
173
|
+
workers.forEach(w => w.terminate());
|
|
174
|
+
workers.length = 0;
|
|
175
|
+
pendingRequests.clear();
|
|
176
|
+
isInitialized = false;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// 전역 노출
|
|
180
|
+
window.TextureWorkerManager = {
|
|
181
|
+
init,
|
|
182
|
+
isSupported,
|
|
183
|
+
renderTexture,
|
|
184
|
+
bitmapToTexture,
|
|
185
|
+
terminate
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
})();
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
// texture-worker.js
|
|
2
|
+
// [NEW] Web Worker for off-thread texture rendering
|
|
3
|
+
// 메인 스레드 블로킹 없이 텍스처 생성
|
|
4
|
+
|
|
5
|
+
// Worker 내에서 marked.js 로드
|
|
6
|
+
importScripts('marked.min.js');
|
|
7
|
+
|
|
8
|
+
// marked 설정
|
|
9
|
+
if (typeof marked !== 'undefined') {
|
|
10
|
+
marked.setOptions({
|
|
11
|
+
breaks: true,
|
|
12
|
+
gfm: true
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* 마크다운을 플레인 텍스트로 변환 (간단 버전)
|
|
18
|
+
*/
|
|
19
|
+
function markdownToPlainText(markdown) {
|
|
20
|
+
if (!markdown) return '';
|
|
21
|
+
|
|
22
|
+
// HTML로 변환 후 태그 제거
|
|
23
|
+
let html = '';
|
|
24
|
+
try {
|
|
25
|
+
html = marked.parse(markdown);
|
|
26
|
+
} catch {
|
|
27
|
+
return markdown;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// HTML 태그 제거
|
|
31
|
+
let text = html
|
|
32
|
+
.replace(/<br\s*\/?>/gi, '\n')
|
|
33
|
+
.replace(/<\/p>/gi, '\n\n')
|
|
34
|
+
.replace(/<\/li>/gi, '\n')
|
|
35
|
+
.replace(/<[^>]+>/g, '')
|
|
36
|
+
.replace(/ /g, ' ')
|
|
37
|
+
.replace(/&/g, '&')
|
|
38
|
+
.replace(/</g, '<')
|
|
39
|
+
.replace(/>/g, '>')
|
|
40
|
+
.replace(/"/g, '"')
|
|
41
|
+
.replace(/'/g, "'")
|
|
42
|
+
.replace(/\n{3,}/g, '\n\n')
|
|
43
|
+
.trim();
|
|
44
|
+
|
|
45
|
+
return text;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 텍스트를 줄 단위로 분할 (word wrap)
|
|
50
|
+
*/
|
|
51
|
+
function wrapText(ctx, text, maxWidth) {
|
|
52
|
+
const lines = [];
|
|
53
|
+
const paragraphs = text.split('\n');
|
|
54
|
+
|
|
55
|
+
for (const paragraph of paragraphs) {
|
|
56
|
+
if (paragraph.trim() === '') {
|
|
57
|
+
lines.push('');
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const words = paragraph.split(' ');
|
|
62
|
+
let currentLine = '';
|
|
63
|
+
|
|
64
|
+
for (const word of words) {
|
|
65
|
+
const testLine = currentLine ? `${currentLine} ${word}` : word;
|
|
66
|
+
const metrics = ctx.measureText(testLine);
|
|
67
|
+
|
|
68
|
+
if (metrics.width > maxWidth && currentLine) {
|
|
69
|
+
lines.push(currentLine);
|
|
70
|
+
currentLine = word;
|
|
71
|
+
} else {
|
|
72
|
+
currentLine = testLine;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (currentLine) {
|
|
77
|
+
lines.push(currentLine);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return lines;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 노드 배경 그리기
|
|
86
|
+
*/
|
|
87
|
+
function drawBackground(ctx, width, height, isSelected) {
|
|
88
|
+
const radius = 20;
|
|
89
|
+
const borderWidth = isSelected ? 4 : 2;
|
|
90
|
+
const borderColor = isSelected ? '#2563eb' : '#d1d5db';
|
|
91
|
+
const bgColor = '#ffffff';
|
|
92
|
+
|
|
93
|
+
// 배경
|
|
94
|
+
ctx.fillStyle = bgColor;
|
|
95
|
+
ctx.beginPath();
|
|
96
|
+
ctx.roundRect(borderWidth, borderWidth, width - borderWidth * 2, height - borderWidth * 2, radius);
|
|
97
|
+
ctx.fill();
|
|
98
|
+
|
|
99
|
+
// 테두리
|
|
100
|
+
ctx.strokeStyle = borderColor;
|
|
101
|
+
ctx.lineWidth = borderWidth;
|
|
102
|
+
ctx.stroke();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 텍스트 노드 렌더링
|
|
107
|
+
*/
|
|
108
|
+
function renderTextNode(canvas, nodeData, qualityScale) {
|
|
109
|
+
const ctx = canvas.getContext('2d');
|
|
110
|
+
|
|
111
|
+
// ★ 핵심: ctx.scale로 좌표계 축소 (기존 메인 스레드 방식과 동일)
|
|
112
|
+
// 캔버스는 작지만 원본 좌표로 그리면 알아서 축소됨
|
|
113
|
+
ctx.scale(qualityScale, qualityScale);
|
|
114
|
+
|
|
115
|
+
// 원본 크기 기준으로 계산 (scale 적용되어 실제론 작아짐)
|
|
116
|
+
const width = canvas.width / qualityScale;
|
|
117
|
+
const height = canvas.height / qualityScale;
|
|
118
|
+
|
|
119
|
+
// 배경 그리기 (원본 크기 좌표)
|
|
120
|
+
ctx.fillStyle = '#ffffff';
|
|
121
|
+
ctx.fillRect(0, 0, width, height);
|
|
122
|
+
drawBackground(ctx, width, height, false);
|
|
123
|
+
|
|
124
|
+
// 텍스트 설정 (원본 크기)
|
|
125
|
+
const zoomLevel = 2;
|
|
126
|
+
const fontSize = 14 * zoomLevel;
|
|
127
|
+
const lineHeight = fontSize * 1.5;
|
|
128
|
+
const padding = 16 * zoomLevel;
|
|
129
|
+
const textColor = '#1f2937';
|
|
130
|
+
|
|
131
|
+
ctx.font = `${fontSize}px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`;
|
|
132
|
+
ctx.fillStyle = textColor;
|
|
133
|
+
ctx.textBaseline = 'top';
|
|
134
|
+
|
|
135
|
+
// 마크다운 → 플레인 텍스트
|
|
136
|
+
const content = nodeData.response || nodeData.prompt || '';
|
|
137
|
+
const plainText = markdownToPlainText(content);
|
|
138
|
+
|
|
139
|
+
// 줄 바꿈 처리
|
|
140
|
+
const maxTextWidth = width - padding * 2;
|
|
141
|
+
const lines = wrapText(ctx, plainText, maxTextWidth);
|
|
142
|
+
|
|
143
|
+
// 텍스트 그리기
|
|
144
|
+
let y = padding;
|
|
145
|
+
const maxY = height - padding;
|
|
146
|
+
|
|
147
|
+
for (const line of lines) {
|
|
148
|
+
if (y + lineHeight > maxY) {
|
|
149
|
+
// 하단 페이드아웃
|
|
150
|
+
const gradient = ctx.createLinearGradient(0, height - 50, 0, height);
|
|
151
|
+
gradient.addColorStop(0, 'rgba(255,255,255,0)');
|
|
152
|
+
gradient.addColorStop(1, 'rgba(255,255,255,1)');
|
|
153
|
+
ctx.fillStyle = gradient;
|
|
154
|
+
ctx.fillRect(0, height - 50, width, 50);
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
ctx.fillStyle = textColor;
|
|
159
|
+
ctx.fillText(line, padding, y);
|
|
160
|
+
y += lineHeight;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* 메시지 핸들러
|
|
166
|
+
*/
|
|
167
|
+
self.onmessage = async function (e) {
|
|
168
|
+
const { type, nodeData, width, height, qualityScale, requestId } = e.data;
|
|
169
|
+
|
|
170
|
+
if (type !== 'renderTexture') {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
// ★ qualityScale 적용하여 작은 캔버스 생성 (메모리 절약)
|
|
176
|
+
// width, height: 원본 크기 (styleW, styleH)
|
|
177
|
+
// 실제 캔버스: width * qualityScale, height * qualityScale
|
|
178
|
+
const renderWidth = Math.round(width * qualityScale);
|
|
179
|
+
const renderHeight = Math.round(height * qualityScale);
|
|
180
|
+
|
|
181
|
+
const canvas = new OffscreenCanvas(renderWidth, renderHeight);
|
|
182
|
+
|
|
183
|
+
// renderTextNode는 캔버스 크기 기준으로 렌더링
|
|
184
|
+
renderTextNode(canvas, nodeData, qualityScale);
|
|
185
|
+
|
|
186
|
+
// ImageBitmap으로 변환 (복사 없이 전달)
|
|
187
|
+
const bitmap = canvas.transferToImageBitmap();
|
|
188
|
+
|
|
189
|
+
// 결과 전송
|
|
190
|
+
self.postMessage({
|
|
191
|
+
type: 'textureReady',
|
|
192
|
+
requestId: requestId,
|
|
193
|
+
bitmap: bitmap,
|
|
194
|
+
width: width,
|
|
195
|
+
height: height
|
|
196
|
+
}, [bitmap]); // Transferable로 전달
|
|
197
|
+
|
|
198
|
+
} catch (error) {
|
|
199
|
+
self.postMessage({
|
|
200
|
+
type: 'error',
|
|
201
|
+
requestId: requestId,
|
|
202
|
+
error: error.message
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// Worker 준비 완료 알림
|
|
208
|
+
self.postMessage({ type: 'ready' });
|