@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
|
Binary file
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
// Agent Visualization for 3D Mind Map Canvas
|
|
2
|
+
// Visualizes the agent execution flow.
|
|
3
|
+
|
|
4
|
+
(function () {
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
// Agent state colors
|
|
8
|
+
const AgentStateColors = {
|
|
9
|
+
Idle: '#888888',
|
|
10
|
+
Thinking: '#FFD700', // Gold - thinking
|
|
11
|
+
Acting: '#00FF88', // Green - acting
|
|
12
|
+
Waiting: '#FF6B6B', // Red - waiting for approval
|
|
13
|
+
Completed: '#4CAF50', // Completed
|
|
14
|
+
Failed: '#F44336' // Failed
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// Agent visualization class
|
|
18
|
+
class AgentVisualization {
|
|
19
|
+
constructor(mindMapInstance) {
|
|
20
|
+
this.mindMap = mindMapInstance;
|
|
21
|
+
this.agentNodes = new Map(); // stepId -> nodeId
|
|
22
|
+
this.connectionLines = [];
|
|
23
|
+
this.currentAgentId = null;
|
|
24
|
+
this.animationFrameId = null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Create the root node when an agent starts
|
|
28
|
+
createAgentRootNode(agent) {
|
|
29
|
+
this.currentAgentId = agent.id;
|
|
30
|
+
|
|
31
|
+
const nodeData = {
|
|
32
|
+
id: `agent_${agent.id}`,
|
|
33
|
+
prompt: `🤖 Agent: ${agent.name}`,
|
|
34
|
+
response: `Goal: ${agent.goal}`,
|
|
35
|
+
x: 0,
|
|
36
|
+
y: 0,
|
|
37
|
+
width: 350,
|
|
38
|
+
height: 150,
|
|
39
|
+
isAiEnabled: false,
|
|
40
|
+
nodeType: 'agent_root',
|
|
41
|
+
metadata: {
|
|
42
|
+
agentId: agent.id,
|
|
43
|
+
state: agent.state
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
if (this.mindMap && this.mindMap.addNodes) {
|
|
48
|
+
this.mindMap.addNodes([nodeData]);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return nodeData.id;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Create a step node
|
|
55
|
+
createStepNode(agent, step, parentNodeId) {
|
|
56
|
+
const stepNodeId = `agent_${agent.id}_step_${step.stepNumber}`;
|
|
57
|
+
|
|
58
|
+
// Layout (place under the parent node)
|
|
59
|
+
const xOffset = (step.stepNumber % 2 === 0 ? 1 : -1) * 200;
|
|
60
|
+
const yOffset = step.stepNumber * 180;
|
|
61
|
+
|
|
62
|
+
const nodeData = {
|
|
63
|
+
id: stepNodeId,
|
|
64
|
+
prompt: `Step ${step.stepNumber}: ${step.displayToolName || step.toolName || 'Thinking'}`,
|
|
65
|
+
response: step.thought || '',
|
|
66
|
+
x: xOffset,
|
|
67
|
+
y: yOffset,
|
|
68
|
+
width: 300,
|
|
69
|
+
height: 120,
|
|
70
|
+
isAiEnabled: false,
|
|
71
|
+
nodeType: 'agent_step',
|
|
72
|
+
metadata: {
|
|
73
|
+
agentId: agent.id,
|
|
74
|
+
stepNumber: step.stepNumber,
|
|
75
|
+
toolName: step.toolName,
|
|
76
|
+
displayToolName: step.displayToolName || step.toolName || 'Thinking',
|
|
77
|
+
state: 'executing'
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
if (this.mindMap && this.mindMap.addNodes) {
|
|
82
|
+
this.mindMap.addNodes([nodeData]);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
this.agentNodes.set(step.stepNumber, stepNodeId);
|
|
86
|
+
|
|
87
|
+
// Create a link
|
|
88
|
+
this.createConnection(parentNodeId, stepNodeId);
|
|
89
|
+
|
|
90
|
+
return stepNodeId;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Update when a step completes
|
|
94
|
+
updateStepNode(step) {
|
|
95
|
+
const nodeId = this.agentNodes.get(step.stepNumber);
|
|
96
|
+
if (!nodeId) return;
|
|
97
|
+
|
|
98
|
+
const observation = step.observation || '';
|
|
99
|
+
const truncatedObs = observation.length > 200
|
|
100
|
+
? observation.substring(0, 200) + '...'
|
|
101
|
+
: observation;
|
|
102
|
+
|
|
103
|
+
// Update node content
|
|
104
|
+
if (this.mindMap && this.mindMap.updateNodeContent) {
|
|
105
|
+
this.mindMap.updateNodeContent(nodeId, {
|
|
106
|
+
response: `${step.thought}\n\n📝 Result:\n${truncatedObs}`
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Change color by state
|
|
111
|
+
this.updateNodeState(nodeId, step.requiresApproval ? 'Waiting' : 'Completed');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Update node state (color/animation)
|
|
115
|
+
updateNodeState(nodeId, state) {
|
|
116
|
+
const color = AgentStateColors[state] || AgentStateColors.Idle;
|
|
117
|
+
|
|
118
|
+
if (this.mindMap && this.mindMap.setNodeGlowColor) {
|
|
119
|
+
this.mindMap.setNodeGlowColor(nodeId, color);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Pulse while running
|
|
123
|
+
if (state === 'Thinking' || state === 'Acting') {
|
|
124
|
+
this.startPulseAnimation(nodeId);
|
|
125
|
+
} else {
|
|
126
|
+
this.stopPulseAnimation(nodeId);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Start pulse animation
|
|
131
|
+
startPulseAnimation(nodeId) {
|
|
132
|
+
if (this.animationFrameId) return;
|
|
133
|
+
|
|
134
|
+
let scale = 1;
|
|
135
|
+
let growing = true;
|
|
136
|
+
|
|
137
|
+
const animate = () => {
|
|
138
|
+
if (growing) {
|
|
139
|
+
scale += 0.005;
|
|
140
|
+
if (scale >= 1.05) growing = false;
|
|
141
|
+
} else {
|
|
142
|
+
scale -= 0.005;
|
|
143
|
+
if (scale <= 1) growing = true;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (this.mindMap && this.mindMap.setNodeScale) {
|
|
147
|
+
this.mindMap.setNodeScale(nodeId, scale);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
this.animationFrameId = requestAnimationFrame(animate);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
animate();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Stop pulse animation
|
|
157
|
+
stopPulseAnimation(nodeId) {
|
|
158
|
+
if (this.animationFrameId) {
|
|
159
|
+
cancelAnimationFrame(this.animationFrameId);
|
|
160
|
+
this.animationFrameId = null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (this.mindMap && this.mindMap.setNodeScale) {
|
|
164
|
+
this.mindMap.setNodeScale(nodeId, 1);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Create a link
|
|
169
|
+
createConnection(fromNodeId, toNodeId) {
|
|
170
|
+
if (this.mindMap && this.mindMap.createLink) {
|
|
171
|
+
this.mindMap.createLink(fromNodeId, toNodeId);
|
|
172
|
+
this.connectionLines.push({ from: fromNodeId, to: toNodeId });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Show approval UI
|
|
177
|
+
showApprovalDialog(step, onApprove, onReject) {
|
|
178
|
+
const dialog = document.createElement('div');
|
|
179
|
+
dialog.className = 'agent-approval-dialog';
|
|
180
|
+
dialog.innerHTML = `
|
|
181
|
+
<div class="approval-content">
|
|
182
|
+
<h3>⚠️ Action Requires Approval</h3>
|
|
183
|
+
<p><strong>Tool:</strong> ${step.displayToolName || step.toolName || 'Thinking'}</p>
|
|
184
|
+
<p><strong>Thought:</strong> ${step.thought}</p>
|
|
185
|
+
<div class="approval-args">
|
|
186
|
+
<strong>Arguments:</strong>
|
|
187
|
+
<pre>${JSON.stringify(step.toolArguments, null, 2)}</pre>
|
|
188
|
+
</div>
|
|
189
|
+
<div class="approval-buttons">
|
|
190
|
+
<button class="approve-btn">✅ Approve</button>
|
|
191
|
+
<button class="reject-btn">❌ Reject</button>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
`;
|
|
195
|
+
|
|
196
|
+
dialog.querySelector('.approve-btn').onclick = () => {
|
|
197
|
+
dialog.remove();
|
|
198
|
+
onApprove();
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
dialog.querySelector('.reject-btn').onclick = () => {
|
|
202
|
+
dialog.remove();
|
|
203
|
+
onReject();
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
document.body.appendChild(dialog);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// When the agent finishes
|
|
210
|
+
onAgentCompleted(agent) {
|
|
211
|
+
const rootNodeId = `agent_${agent.id}`;
|
|
212
|
+
this.updateNodeState(rootNodeId, 'Completed');
|
|
213
|
+
|
|
214
|
+
// Add a final result node
|
|
215
|
+
const lastStep = agent.steps[agent.steps.length - 1];
|
|
216
|
+
if (lastStep && lastStep.observation) {
|
|
217
|
+
this.createResultNode(agent, lastStep.observation);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Create the final result node
|
|
222
|
+
createResultNode(agent, result) {
|
|
223
|
+
const nodeData = {
|
|
224
|
+
id: `agent_${agent.id}_result`,
|
|
225
|
+
prompt: '✅ Final Result',
|
|
226
|
+
response: result,
|
|
227
|
+
x: 0,
|
|
228
|
+
y: (agent.steps.length + 1) * 180,
|
|
229
|
+
width: 400,
|
|
230
|
+
height: 200,
|
|
231
|
+
isAiEnabled: false,
|
|
232
|
+
nodeType: 'agent_result',
|
|
233
|
+
metadata: {
|
|
234
|
+
agentId: agent.id,
|
|
235
|
+
isResult: true
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
if (this.mindMap && this.mindMap.addNodes) {
|
|
240
|
+
this.mindMap.addNodes([nodeData]);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const lastStepNodeId = this.agentNodes.get(agent.steps.length);
|
|
244
|
+
if (lastStepNodeId) {
|
|
245
|
+
this.createConnection(lastStepNodeId, nodeData.id);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Cleanup
|
|
250
|
+
cleanup() {
|
|
251
|
+
this.stopPulseAnimation();
|
|
252
|
+
this.agentNodes.clear();
|
|
253
|
+
this.connectionLines = [];
|
|
254
|
+
this.currentAgentId = null;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Inject CSS
|
|
259
|
+
function injectStyles() {
|
|
260
|
+
if (document.getElementById('agent-visualization-styles')) return;
|
|
261
|
+
|
|
262
|
+
const style = document.createElement('style');
|
|
263
|
+
style.id = 'agent-visualization-styles';
|
|
264
|
+
style.textContent = `
|
|
265
|
+
.agent-approval-dialog {
|
|
266
|
+
position: fixed;
|
|
267
|
+
top: 50%;
|
|
268
|
+
left: 50%;
|
|
269
|
+
transform: translate(-50%, -50%);
|
|
270
|
+
background: rgba(30, 30, 40, 0.95);
|
|
271
|
+
border: 2px solid #FFD700;
|
|
272
|
+
border-radius: 12px;
|
|
273
|
+
padding: 24px;
|
|
274
|
+
z-index: 10000;
|
|
275
|
+
max-width: 500px;
|
|
276
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
|
|
277
|
+
backdrop-filter: blur(10px);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.agent-approval-dialog h3 {
|
|
281
|
+
color: #FFD700;
|
|
282
|
+
margin: 0 0 16px 0;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.agent-approval-dialog p {
|
|
286
|
+
color: #eee;
|
|
287
|
+
margin: 8px 0;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.approval-args {
|
|
291
|
+
background: rgba(0, 0, 0, 0.3);
|
|
292
|
+
padding: 12px;
|
|
293
|
+
border-radius: 8px;
|
|
294
|
+
margin: 12px 0;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.approval-args pre {
|
|
298
|
+
color: #88ff88;
|
|
299
|
+
font-size: 12px;
|
|
300
|
+
overflow-x: auto;
|
|
301
|
+
max-height: 150px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.approval-buttons {
|
|
305
|
+
display: flex;
|
|
306
|
+
gap: 12px;
|
|
307
|
+
margin-top: 20px;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.approval-buttons button {
|
|
311
|
+
flex: 1;
|
|
312
|
+
padding: 12px 24px;
|
|
313
|
+
border: none;
|
|
314
|
+
border-radius: 8px;
|
|
315
|
+
font-size: 16px;
|
|
316
|
+
cursor: pointer;
|
|
317
|
+
transition: transform 0.2s;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.approval-buttons button:hover {
|
|
321
|
+
transform: scale(1.05);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.approve-btn {
|
|
325
|
+
background: #4CAF50;
|
|
326
|
+
color: white;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.reject-btn {
|
|
330
|
+
background: #F44336;
|
|
331
|
+
color: white;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/* Agent node styling */
|
|
335
|
+
.agent-node-thinking {
|
|
336
|
+
animation: agent-pulse 1s ease-in-out infinite;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
@keyframes agent-pulse {
|
|
340
|
+
0%, 100% { box-shadow: 0 0 10px #FFD700; }
|
|
341
|
+
50% { box-shadow: 0 0 30px #FFD700; }
|
|
342
|
+
}
|
|
343
|
+
`;
|
|
344
|
+
document.head.appendChild(style);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// Init
|
|
348
|
+
injectStyles();
|
|
349
|
+
|
|
350
|
+
// Export
|
|
351
|
+
window.AgentVisualization = AgentVisualization;
|
|
352
|
+
window.AgentStateColors = AgentStateColors;
|
|
353
|
+
window.agentVisualization = window.agentVisualization || {
|
|
354
|
+
onAgentStart() { },
|
|
355
|
+
handleEvent() { }
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
console.log('[AgentVisualization] Module loaded');
|
|
359
|
+
})();
|