agentglow 0.2.10 → 0.2.11

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.
Files changed (28) hide show
  1. package/dist/chunks/{KitScene-Bm1I35Zc.js → KitScene-DG_pcnWW.js} +1273 -1195
  2. package/dist/chunks/{index-COLbf8XM.js → index-Agh7jdYu.js} +182 -182
  3. package/dist/chunks/{index-CGTp73GN.js → index-B2EHxcBQ.js} +400 -400
  4. package/dist/chunks/{index-D-r9aJ4u.js → index-B4Cqo621.js} +33 -33
  5. package/dist/chunks/index-BfQsJ0TH.js +751 -0
  6. package/dist/chunks/index-BmBGYhJS.js +891 -0
  7. package/dist/chunks/index-Bnn-x-aE.js +767 -0
  8. package/dist/chunks/{index-BWsSd_Wm.js → index-CTQTtm9q.js} +212 -212
  9. package/dist/chunks/{index-_IwfbZy7.js → index-CTZbUTDY.js} +62 -62
  10. package/dist/chunks/{index-cRPj-lzn.js → index-CdKvybsL.js} +284 -284
  11. package/dist/chunks/index-CeiIEWek.js +818 -0
  12. package/dist/chunks/{index-D4Wlmsay.js → index-Ci8tSMhc.js} +15 -15
  13. package/dist/chunks/{index-C2vLpNCb.js → index-Cls_VZdb.js} +100 -100
  14. package/dist/chunks/index-DFFRhihO.js +892 -0
  15. package/dist/chunks/index-DMCETM4H.js +605 -0
  16. package/dist/chunks/{index-AugvjZJN.js → index-URn4zDHp.js} +223 -223
  17. package/dist/chunks/index-u4rYZ1UO.js +495 -0
  18. package/dist/index.js +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/types/world.d.ts +30 -5
  21. package/package.json +1 -1
  22. package/dist/chunks/index-BAQDf-0T.js +0 -492
  23. package/dist/chunks/index-BRnLrSfZ.js +0 -605
  24. package/dist/chunks/index-CKyn9lcT.js +0 -753
  25. package/dist/chunks/index-CnoB0ZDk.js +0 -889
  26. package/dist/chunks/index-KmczAvvY.js +0 -818
  27. package/dist/chunks/index-Z4vdWCok.js +0 -763
  28. package/dist/chunks/index-uZGu9jzU.js +0 -887
@@ -3,22 +3,22 @@ var Pt = (e, r, a) => r in e ? At(e, r, { enumerable: !0, configurable: !0, writ
3
3
  var Z = (e, r, a) => Pt(e, typeof r != "symbol" ? r + "" : r, a);
4
4
  import { jsxs as Y, Fragment as de, jsx as d } from "react/jsx-runtime";
5
5
  import { EffectComposer as Vt, Bloom as zt, Vignette as Gt } from "@react-three/postprocessing";
6
- import { useRef as B, useMemo as E, useEffect as Et, useState as Ft } from "react";
6
+ import { useRef as B, useMemo as z, useEffect as Et, useState as Ft } from "react";
7
7
  import * as t from "three";
8
8
  import { useFrame as he } from "@react-three/fiber";
9
- import { T as Mt, w as K, L as Ie, d as Bt, a as xe, c as ft, h as Ae, l as Rt, H as It, p as Ot, e as Tt, f as be, s as Lt, S as Le, q as _t, R as Nt, k as Me, u as Ut, A as Xt, o as Ht, K as Kt, m as jt, G as Yt, n as qt, j as Wt } from "./KitScene-Bm1I35Zc.js";
9
+ import { T as Mt, w as K, L as Ie, d as Bt, a as xe, c as ft, h as Ae, l as Rt, O as It, p as Ot, e as Tt, f as be, s as Lt, S as We, v as _t, R as Nt, j as Ut, n as Me, u as Xt, D as Ht, t as Kt, K as jt, o as Yt, G as qt, q as Dt, m as Wt } from "./KitScene-DG_pcnWW.js";
10
10
  var bt;
11
- const j = typeof window < "u" && !!((bt = window.matchMedia) != null && bt.call(window, "(prefers-reduced-motion: reduce)").matches), pt = new t.Color("#3db8ff"), Se = new t.Color("#9fdcff"), He = new t.Color("#ff4fa8"), mt = new t.Color("#ff9ccf"), oe = new t.Color(1, 1, 1), Fe = new t.Color("#ffc24a"), $t = new t.Color("#ff2d55"), Dt = new t.Color("#3a4560"), lt = Object.fromEntries(Object.entries(Mt).map(([e, r]) => [e, new t.Color(r)])), q = (e) => e < 0 ? 0 : e > 1 ? 1 : e, je = (e) => 1 - Math.pow(1 - q(e), 3), Re = (e) => (e = q(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2);
12
- let _e = null;
13
- function Zt() {
14
- if (_e) return _e;
11
+ const j = typeof window < "u" && !!((bt = window.matchMedia) != null && bt.call(window, "(prefers-reduced-motion: reduce)").matches), pt = new t.Color("#3db8ff"), Se = new t.Color("#9fdcff"), Xe = new t.Color("#ff4fa8"), mt = new t.Color("#ff9ccf"), oe = new t.Color(1, 1, 1), Fe = new t.Color("#ffc24a"), $t = new t.Color("#ff2d55"), Zt = new t.Color("#3a4560"), lt = Object.fromEntries(Object.entries(Mt).map(([e, r]) => [e, new t.Color(r)])), q = (e) => e < 0 ? 0 : e > 1 ? 1 : e, Ke = (e) => 1 - Math.pow(1 - q(e), 3), Re = (e) => (e = q(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2);
12
+ let Le = null;
13
+ function kt() {
14
+ if (Le) return Le;
15
15
  const e = document.createElement("canvas");
16
16
  e.width = e.height = 128;
17
17
  const r = e.getContext("2d"), a = r.createRadialGradient(64, 64, 0, 64, 64, 64);
18
- return a.addColorStop(0, "rgba(255,255,255,1)"), a.addColorStop(0.12, "rgba(255,255,255,0.7)"), a.addColorStop(0.4, "rgba(255,255,255,0.15)"), a.addColorStop(1, "rgba(255,255,255,0)"), r.fillStyle = a, r.fillRect(0, 0, 128, 128), _e = new t.CanvasTexture(e), _e;
18
+ return a.addColorStop(0, "rgba(255,255,255,1)"), a.addColorStop(0.12, "rgba(255,255,255,0.7)"), a.addColorStop(0.4, "rgba(255,255,255,0.15)"), a.addColorStop(1, "rgba(255,255,255,0)"), r.fillStyle = a, r.fillRect(0, 0, 128, 128), Le = new t.CanvasTexture(e), Le;
19
19
  }
20
- function $(e = "#fff") {
21
- return new t.SpriteMaterial({ map: Zt(), color: e, blending: t.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
20
+ function W(e = "#fff") {
21
+ return new t.SpriteMaterial({ map: kt(), color: e, blending: t.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
22
22
  }
23
23
  function le(e = "#fff") {
24
24
  return new t.MeshBasicMaterial({ color: e, blending: t.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
@@ -26,8 +26,8 @@ function le(e = "#fff") {
26
26
  function ue(e = "#fff", r = !1) {
27
27
  return new t.LineBasicMaterial({ color: e, vertexColors: r, transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 });
28
28
  }
29
- const De = new t.SphereGeometry(1, 24, 18), ut = new t.ConeGeometry(1, 1, 12).translate(0, 0.5, 0), dt = new t.TorusGeometry(1, 0.03, 6, 72);
30
- function kt(e = 48, r = 6) {
29
+ const $e = new t.SphereGeometry(1, 24, 18), ut = new t.ConeGeometry(1, 1, 12).translate(0, 0.5, 0), dt = new t.TorusGeometry(1, 0.03, 6, 72);
30
+ function Jt(e = 48, r = 6) {
31
31
  const a = [], o = [];
32
32
  for (let n = 0; n <= e; n++)
33
33
  for (let i = 0; i < r; i++) {
@@ -42,7 +42,7 @@ function kt(e = 48, r = 6) {
42
42
  const u = new t.BufferGeometry();
43
43
  return u.setAttribute("position", new t.Float32BufferAttribute(a, 3)), u.setIndex(o), u.boundingSphere = new t.Sphere(new t.Vector3(), 1e4), u;
44
44
  }
45
- const St = kt();
45
+ const St = Jt();
46
46
  function xt(e, r = 0.04) {
47
47
  return new t.ShaderMaterial({
48
48
  uniforms: {
@@ -100,12 +100,12 @@ function ie(e, r, a, o, u) {
100
100
  const n = 1 - o;
101
101
  return u.set(n * n * e.x + 2 * n * o * r.x + o * o * a.x, n * n * e.y + 2 * n * o * r.y + o * o * a.y, n * n * e.z + 2 * n * o * r.z + o * o * a.z);
102
102
  }
103
- function Ye(e, r, a, o) {
103
+ function je(e, r, a, o) {
104
104
  o.copy(e).add(r).multiplyScalar(0.5);
105
105
  const u = o.length() || 1;
106
106
  return o.multiplyScalar(1 + a / u), o.z += a * 0.4, o;
107
107
  }
108
- const We = class We {
108
+ const qe = class qe {
109
109
  constructor(r) {
110
110
  Z(this, "mesh");
111
111
  Z(this, "colors");
@@ -119,14 +119,14 @@ const We = class We {
119
119
  this.n = 0;
120
120
  }
121
121
  add(r, a, o, u, n, i, c, p = 1) {
122
- this.n >= this.max || p <= 0.01 || (ie(r, a, o, u, this.a), ie(r, a, o, q(u + 0.02 * n), this.b), this.b.sub(this.a), !(this.b.lengthSq() < 1e-8) && (this.o.position.copy(this.a), this.o.quaternion.setFromUnitVectors(We.UP, this.b.normalize()), this.o.scale.set(i * 0.38, i, i * 0.38), this.o.updateMatrix(), this.mesh.setMatrixAt(this.n, this.o.matrix), this.colors[this.n * 3] = c.r * p, this.colors[this.n * 3 + 1] = c.g * p, this.colors[this.n * 3 + 2] = c.b * p, this.n++));
122
+ this.n >= this.max || p <= 0.01 || (ie(r, a, o, u, this.a), ie(r, a, o, q(u + 0.02 * n), this.b), this.b.sub(this.a), !(this.b.lengthSq() < 1e-8) && (this.o.position.copy(this.a), this.o.quaternion.setFromUnitVectors(qe.UP, this.b.normalize()), this.o.scale.set(i * 0.38, i, i * 0.38), this.o.updateMatrix(), this.mesh.setMatrixAt(this.n, this.o.matrix), this.colors[this.n * 3] = c.r * p, this.colors[this.n * 3 + 1] = c.g * p, this.colors[this.n * 3 + 2] = c.b * p, this.n++));
123
123
  }
124
124
  end() {
125
125
  this.mesh.count = this.n, this.mesh.instanceMatrix.needsUpdate = !0, this.mesh.instanceColor.needsUpdate = !0;
126
126
  }
127
127
  };
128
- Z(We, "UP", new t.Vector3(0, 1, 0));
129
- let qe = We;
128
+ Z(qe, "UP", new t.Vector3(0, 1, 0));
129
+ let Ye = qe;
130
130
  class Ct {
131
131
  constructor(r, a) {
132
132
  Z(this, "geo", new t.BufferGeometry());
@@ -146,12 +146,12 @@ class Ct {
146
146
  this.geo.setDrawRange(0, this.n * this.seg * 2), this.P.needsUpdate = !0, this.C.needsUpdate = !0;
147
147
  }
148
148
  }
149
- const ce = 2.4, Pe = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Map();
150
- function Jt(e, r, a) {
149
+ const ce = 2.4, Pe = /* @__PURE__ */ new Map(), He = /* @__PURE__ */ new Map();
150
+ function Qt(e, r, a) {
151
151
  return e.r += r.r * a, e.g += r.g * a, e.b += r.b * a, e;
152
152
  }
153
- const Qt = new t.Vector3(), eo = new t.Vector3(0, 1, 0);
154
- function to() {
153
+ const eo = new t.Vector3(), to = new t.Vector3(0, 1, 0);
154
+ function oo() {
155
155
  const e = [], r = (n, i) => e.push(...n, ...i), o = (n, i, c = 48) => {
156
156
  for (let p = 0; p < c; p++) {
157
157
  const b = p / c * Math.PI * 2, h = (p + 1) / c * Math.PI * 2;
@@ -170,7 +170,7 @@ function to() {
170
170
  const u = new t.BufferGeometry();
171
171
  return u.setAttribute("position", new t.Float32BufferAttribute(e, 3)), u;
172
172
  }
173
- const oo = to(), no = new t.CylinderGeometry(1, 1, 1.4, 32, 1, !0).rotateX(Math.PI / 2), ye = (e, r, a) => ({ geo: e, edges: new t.EdgesGeometry(e, 25), pos: r, rot: a }), Ne = {
173
+ const no = oo(), ro = new t.CylinderGeometry(1, 1, 1.4, 32, 1, !0).rotateX(Math.PI / 2), ye = (e, r, a) => ({ geo: e, edges: new t.EdgesGeometry(e, 25), pos: r, rot: a }), _e = {
174
174
  db: () => [ye(new t.CylinderGeometry(0.4, 0.4, 0.66, 24)), ye(new t.TorusGeometry(0.4, 0.01, 4, 40), [0, 0.11, 0], [Math.PI / 2, 0, 0])],
175
175
  warehouse: () => [-0.28, 0, 0.28].map((e) => ye(new t.BoxGeometry(0.9, 0.18, 0.55), [0, e, 0])),
176
176
  spark: () => [ye(new t.IcosahedronGeometry(0.42, 0))],
@@ -178,19 +178,19 @@ const oo = to(), no = new t.CylinderGeometry(1, 1, 1.4, 32, 1, !0).rotateX(Math.
178
178
  storage: () => [ye(new t.BoxGeometry(0.66, 0.66, 0.66), void 0, [0.4, 0.6, 0])],
179
179
  queue: () => [ye(new t.CapsuleGeometry(0.18, 0.7, 4, 12), void 0, [0, 0, Math.PI / 2])]
180
180
  };
181
- function ro({ mcp: e, backend: r }) {
182
- const a = e.srv, o = r.res, u = B(null), n = E(() => {
181
+ function so({ mcp: e, backend: r }) {
182
+ const a = e.srv, o = r.res, u = B(null), n = z(() => {
183
183
  var v;
184
- return ((v = Ne[o.kind]) == null ? void 0 : v.call(Ne)) ?? Ne.api();
185
- }, [o.kind]), i = E(() => new t.Color(a.color).lerp(oe, 0.3), [a.color]), c = E(() => ({ edge: xt(a.color, 0.03), fill: le(i), line: ue(i), halo: $(i), arrow: le(i) }), [a.color, i]), p = B(null), b = B(null), h = B(null), z = B(null), A = B("");
184
+ return ((v = _e[o.kind]) == null ? void 0 : v.call(_e)) ?? _e.api();
185
+ }, [o.kind]), i = z(() => new t.Color(a.color).lerp(oe, 0.3), [a.color]), c = z(() => ({ edge: xt(a.color, 0.03), fill: le(i), line: ue(i), halo: W(i), arrow: le(i) }), [a.color, i]), p = B(null), b = B(null), h = B(null), G = B(null), E = B("");
186
186
  return he(({ clock: v }) => {
187
- var w, V;
188
- const x = performance.now(), G = v.elapsedTime;
187
+ var w, P;
188
+ const x = performance.now(), V = v.elapsedTime;
189
189
  (w = u.current) == null || w.position.copy(r.pos);
190
190
  const l = c.edge.uniforms;
191
191
  l.uP0.value.copy(e.pos), l.uP2.value.copy(r.pos), l.uP1.value.copy(e.pos).add(r.pos).multiplyScalar(0.5);
192
- const f = o.inflight > 0, g = Math.exp(-((x - o.activeAt) / 1e3) * 1.5), P = f && !j ? 0.5 + 0.5 * Math.sin(G * 5) : f ? 0.5 : 0, s = f ? 1.5 + P * 0.8 : 0.14 + g * 0.9;
193
- c.fill.color.copy(i).multiplyScalar(s * 0.22), c.line.color.copy(i).multiplyScalar(s * 1.3), c.halo.color.copy(i).multiplyScalar(f ? 0.4 + P * 0.2 : 0.02 + g * 0.22), (V = b.current) == null || V.scale.setScalar(f ? 3.6 + P * 0.6 : 2.2 + g), p.current && (p.current.scale.setScalar(f ? 1.18 + P * 0.06 : 1 + g * 0.08), p.current.rotation.y = j ? 0.4 : G * (f ? 0.7 : 0.12));
192
+ const f = o.inflight > 0, g = Math.exp(-((x - o.activeAt) / 1e3) * 1.5), A = f && !j ? 0.5 + 0.5 * Math.sin(V * 5) : f ? 0.5 : 0, s = f ? 1.5 + A * 0.8 : 0.14 + g * 0.9;
193
+ c.fill.color.copy(i).multiplyScalar(s * 0.22), c.line.color.copy(i).multiplyScalar(s * 1.3), c.halo.color.copy(i).multiplyScalar(f ? 0.4 + A * 0.2 : 0.02 + g * 0.22), (P = b.current) == null || P.scale.setScalar(f ? 3.6 + A * 0.6 : 2.2 + g), p.current && (p.current.scale.setScalar(f ? 1.18 + A * 0.06 : 1 + g * 0.08), p.current.rotation.y = j ? 0.4 : V * (f ? 0.7 : 0.12));
194
194
  let C = null;
195
195
  for (const R of K.mcpCalls) R.server === a.name && R.resource === o.name && (!C || R.start > C.start) && (C = R);
196
196
  let L = o.name;
@@ -199,9 +199,9 @@ function ro({ mcp: e, backend: r }) {
199
199
  for (const _ of K.mcpPending.values()) _.server === a.name && _.resource === o.name && (R = _.tool);
200
200
  L = `${o.name} ▸ ${R || "query"}()`;
201
201
  } else C && C.phase === "result" && x - C.start < 1800 && (L = `${o.name} ✓ returned`);
202
- z.current && (L !== A.current && (z.current.setText(L), A.current = L), z.current.setOpacity(f ? 1 : 0.5 + g * 0.5));
202
+ G.current && (L !== E.current && (G.current.setText(L), E.current = L), G.current.setOpacity(f ? 1 : 0.5 + g * 0.5));
203
203
  const y = c.edge.uniforms;
204
- y.uTime.value = j ? 0 : G;
204
+ y.uTime.value = j ? 0 : V;
205
205
  const I = C && C.phase === "result" ? (x - C.start) / C.dur : 9, T = h.current;
206
206
  I < 1 ? (y.uRadius.value = 0.055, y.uOpacity.value = 0.8 * (1 - I * 0.6), y.uFlow.value = 0, y.uHead.value = 1 - Re(I), y.uHeadColor.value.copy(i).multiplyScalar(3), T && (T.visible = !0, ht(T, y.uP0.value, y.uP1.value, y.uP2.value, 0.14, -1, 0.5), c.arrow.color.copy(i).multiplyScalar(2 * (1 - I * 0.7)))) : f ? (y.uRadius.value = 0.03, y.uOpacity.value = 0.5, y.uFlow.value = 1, y.uHead.value = -1, T && (T.visible = !0, ht(T, y.uP0.value, y.uP1.value, y.uP2.value, 0.82, 1, 0.4), c.arrow.color.copy(i).multiplyScalar(1.2))) : (y.uRadius.value = 0.025, y.uOpacity.value = 0.14 + g * 0.4, y.uFlow.value = 0, y.uHead.value = -1, T && (T.visible = !1));
207
207
  }), /* @__PURE__ */ Y(de, { children: [
@@ -213,30 +213,30 @@ function ro({ mcp: e, backend: r }) {
213
213
  /* @__PURE__ */ d("mesh", { geometry: v.geo, material: c.fill }),
214
214
  /* @__PURE__ */ d("lineSegments", { geometry: v.edges, material: c.line })
215
215
  ] }, x)) }),
216
- /* @__PURE__ */ d(Ie, { ref: z, position: [0, -0.9, 0], text: o.name, font: "mono", color: a.color, size: 0.2, opacity: 0.5, pxRange: [7.5, 11] })
216
+ /* @__PURE__ */ d(Ie, { ref: G, position: [0, -0.9, 0], text: o.name, font: "mono", color: a.color, size: 0.2, opacity: 0.5, pxRange: [7.5, 11] })
217
217
  ] })
218
218
  ] });
219
219
  }
220
- const Ze = new t.Vector3(), Ue = new t.Vector3();
220
+ const Ze = new t.Vector3(), Ne = new t.Vector3();
221
221
  function ht(e, r, a, o, u, n, i) {
222
- ie(r, a, o, u, Ze), ie(r, a, o, q(u + 0.02 * n), Ue), e.position.copy(Ze), Ue.sub(Ze), Ue.lengthSq() > 1e-8 && e.quaternion.setFromUnitVectors(eo, Ue.normalize()), e.scale.set(i * 0.38, i, i * 0.38);
222
+ ie(r, a, o, u, Ze), ie(r, a, o, q(u + 0.02 * n), Ne), e.position.copy(Ze), Ne.sub(Ze), Ne.lengthSq() > 1e-8 && e.quaternion.setFromUnitVectors(to, Ne.normalize()), e.scale.set(i * 0.38, i, i * 0.38);
223
223
  }
224
- function so({ mcp: e }) {
225
- const r = e.srv, a = B(null), o = E(() => new t.Color(r.color), [r.color]), u = E(() => ({ line: ue(o), fill: le(o), core: $("#fff"), halo: $(o), hit: $("#fff") }), [o]), n = B(null), i = B(null), c = B(null), p = B(null), b = B(r.calls), h = B(-1e9);
226
- return he(({ clock: z }) => {
227
- var f, g, P;
224
+ function ao({ mcp: e }) {
225
+ const r = e.srv, a = B(null), o = z(() => new t.Color(r.color), [r.color]), u = z(() => ({ line: ue(o), fill: le(o), core: W("#fff"), halo: W(o), hit: W("#fff") }), [o]), n = B(null), i = B(null), c = B(null), p = B(null), b = B(r.calls), h = B(-1e9);
226
+ return he(({ clock: G }) => {
227
+ var f, g, A;
228
228
  (f = a.current) == null || f.position.copy(e.pos);
229
- const A = performance.now();
230
- r.calls !== b.current && (b.current = r.calls, h.current = A), (g = n.current) == null || g.lookAt(Qt);
231
- const v = r.inflight > 0, x = Math.exp(-((A - r.activeAt) / 1e3) * 1.4), G = (v ? 0.8 : 0.32) + x * 0.5;
232
- u.line.color.copy(o).multiplyScalar(G * 1.4), u.fill.color.copy(o).multiplyScalar(G * 0.05), u.core.color.setScalar(v ? 0.7 : 0.18), u.halo.color.copy(o).multiplyScalar(v ? 0.24 : 0.06 + x * 0.12), (P = c.current) == null || P.scale.setScalar(5 + (v ? 0.8 : 0)), i.current && (i.current.rotation.z = j ? 0 : z.elapsedTime * (v ? 0.55 : 0.08));
233
- const l = (A - h.current) / 700;
229
+ const E = performance.now();
230
+ r.calls !== b.current && (b.current = r.calls, h.current = E), (g = n.current) == null || g.lookAt(eo);
231
+ const v = r.inflight > 0, x = Math.exp(-((E - r.activeAt) / 1e3) * 1.4), V = (v ? 0.8 : 0.32) + x * 0.5;
232
+ u.line.color.copy(o).multiplyScalar(V * 1.4), u.fill.color.copy(o).multiplyScalar(V * 0.05), u.core.color.setScalar(v ? 0.7 : 0.18), u.halo.color.copy(o).multiplyScalar(v ? 0.24 : 0.06 + x * 0.12), (A = c.current) == null || A.scale.setScalar(5 + (v ? 0.8 : 0)), i.current && (i.current.rotation.z = j ? 0 : G.elapsedTime * (v ? 0.55 : 0.08));
233
+ const l = (E - h.current) / 700;
234
234
  p.current && (p.current.visible = l < 1, p.current.scale.setScalar(1 + l * 4), u.hit.color.copy(o).lerp(oe, 0.5).multiplyScalar((1 - l) * (1 - l) * 1.2));
235
235
  }), /* @__PURE__ */ d(de, { children: /* @__PURE__ */ Y("group", { ref: a, children: [
236
236
  /* @__PURE__ */ d("sprite", { ref: c, material: u.halo }),
237
237
  /* @__PURE__ */ d("group", { ref: n, children: /* @__PURE__ */ Y("group", { ref: i, children: [
238
- /* @__PURE__ */ d("lineSegments", { geometry: oo, material: u.line }),
239
- /* @__PURE__ */ d("mesh", { geometry: no, material: u.fill })
238
+ /* @__PURE__ */ d("lineSegments", { geometry: no, material: u.line }),
239
+ /* @__PURE__ */ d("mesh", { geometry: ro, material: u.fill })
240
240
  ] }) }),
241
241
  /* @__PURE__ */ d("sprite", { material: u.core, scale: 0.9 }),
242
242
  /* @__PURE__ */ d("sprite", { ref: p, material: u.hit, visible: !1 }),
@@ -244,40 +244,40 @@ function so({ mcp: e }) {
244
244
  ] }) });
245
245
  }
246
246
  const vt = 28, ke = 40, Je = 24;
247
- function ao() {
248
- const e = E(() => new Ct(vt * 2, ke), []), r = E(() => ue("#fff", !0), []), a = E(() => new qe(vt), []), o = E(() => Array.from({ length: Je }, () => $("#fff")), []), u = B([]), n = E(() => ({ a: new t.Vector3(), b: new t.Vector3(), c: new t.Vector3(), p: new t.Vector3(), col: new t.Color(), k: new t.Color() }), []);
247
+ function io() {
248
+ const e = z(() => new Ct(vt * 2, ke), []), r = z(() => ue("#fff", !0), []), a = z(() => new Ye(vt), []), o = z(() => Array.from({ length: Je }, () => W("#fff")), []), u = B([]), n = z(() => ({ a: new t.Vector3(), b: new t.Vector3(), c: new t.Vector3(), p: new t.Vector3(), col: new t.Color(), k: new t.Color() }), []);
249
249
  return he(({ clock: i }) => {
250
250
  const c = performance.now(), p = j ? 0 : i.elapsedTime;
251
251
  e.begin(), a.begin();
252
- const { a: b, b: h, c: z, p: A, col: v, k: x } = n, G = (f, g, P, s) => {
252
+ const { a: b, b: h, c: G, p: E, col: v, k: x } = n, V = (f, g, A, s) => {
253
253
  const C = xe(f), L = K.mcpServers.get(g), y = ft(g);
254
254
  if (!C || !L || !y) return;
255
- b.copy(C), h.copy(y), Ye(b, h, 1.2, z), v.set(L.color);
255
+ b.copy(C), h.copy(y), je(b, h, 1.2, G), v.set(L.color);
256
256
  let I;
257
- P === 0 ? (v.lerp(Fe, q(s / 1.2)), s > 1.2 && v.lerp($t, q((s - 1.2) / 1)), I = (0.25 + Math.min(0.6, s * 0.25)) * je(s / 0.3)) : (v.lerp(oe, 0.35), I = 1.2 * (s < 0.75 ? 1 : 1 - (s - 0.75) / 0.25));
257
+ A === 0 ? (v.lerp(Fe, q(s / 1.2)), s > 1.2 && v.lerp($t, q((s - 1.2) / 1)), I = (0.25 + Math.min(0.6, s * 0.25)) * Ke(s / 0.3)) : (v.lerp(oe, 0.35), I = 1.2 * (s < 0.75 ? 1 : 1 - (s - 0.75) / 0.25));
258
258
  const T = 1 - Re(s / 0.75);
259
259
  for (let w = 0; w < 2; w++) {
260
- const V = e.next();
261
- if (V < 0) return;
260
+ const P = e.next();
261
+ if (P < 0) return;
262
262
  const R = w ? 0.045 : 0;
263
263
  for (let _ = 0; _ < ke; _++)
264
264
  for (let U = 0; U < 2; U++) {
265
265
  const m = (_ + U) / ke;
266
- ie(b, z, h, m, A), e.P.setXYZ(V + _ * 2 + U, A.x + R, A.y + R, A.z);
266
+ ie(b, G, h, m, E), e.P.setXYZ(P + _ * 2 + U, E.x + R, E.y + R, E.z);
267
267
  let M;
268
- P === 0 ? M = I * (0.22 + Math.pow(Math.max(0, Math.sin(m * 26 - p * 3)), 10) * 1.8) * (w ? 0.3 : 1) : M = I * (0.18 + Math.exp(-(((m - T) / 0.05) ** 2)) * 3.4 * (s < 0.8 ? 1 : 0)) * (w ? 0.5 : 1), e.C.setXYZ(V + _ * 2 + U, v.r * M, v.g * M, v.b * M);
268
+ A === 0 ? M = I * (0.22 + Math.pow(Math.max(0, Math.sin(m * 26 - p * 3)), 10) * 1.8) * (w ? 0.3 : 1) : M = I * (0.18 + Math.exp(-(((m - T) / 0.05) ** 2)) * 3.4 * (s < 0.8 ? 1 : 0)) * (w ? 0.5 : 1), e.C.setXYZ(P + _ * 2 + U, v.r * M, v.g * M, v.b * M);
269
269
  }
270
270
  }
271
- x.copy(v), P === 0 ? a.add(b, z, h, 0.93, 1, 0.45, x, 0.5 + I * 1.3) : a.add(b, z, h, 0.07, -1, 0.6, x, I * 1.5);
271
+ x.copy(v), A === 0 ? a.add(b, G, h, 0.93, 1, 0.45, x, 0.5 + I * 1.3) : a.add(b, G, h, 0.07, -1, 0.6, x, I * 1.5);
272
272
  };
273
- for (const f of K.mcpPending.values()) G(f.instance, f.server, 0, Bt(f, c));
274
- for (const f of K.mcpCalls) f.phase === "result" && G(f.instance, f.server, 1, q((c - f.start) / f.dur));
273
+ for (const f of K.mcpPending.values()) V(f.instance, f.server, 0, Bt(f, c));
274
+ for (const f of K.mcpCalls) f.phase === "result" && V(f.instance, f.server, 1, q((c - f.start) / f.dur));
275
275
  e.end(), a.end();
276
276
  let l = 0;
277
277
  for (const f of K.mcpCalls) {
278
278
  if (f.phase !== "call" || l >= Je) continue;
279
- const g = xe(f.instance), P = K.mcpServers.get(f.server), s = ft(f.server), C = u.current[l], L = q((c - f.start) / f.dur);
280
- !g || !P || !s || !C || L >= 1 || (b.copy(g), h.copy(s), Ye(b, h, 1.2, z), ie(b, z, h, Re(L), A), C.visible = !0, C.position.copy(A), C.scale.setScalar(0.85), o[l].color.set(P.color).lerp(oe, 0.4).multiplyScalar(1.5), l++);
279
+ const g = xe(f.instance), A = K.mcpServers.get(f.server), s = ft(f.server), C = u.current[l], L = q((c - f.start) / f.dur);
280
+ !g || !A || !s || !C || L >= 1 || (b.copy(g), h.copy(s), je(b, h, 1.2, G), ie(b, G, h, Re(L), E), C.visible = !0, C.position.copy(E), C.scale.setScalar(0.85), o[l].color.set(A.color).lerp(oe, 0.4).multiplyScalar(1.5), l++);
281
281
  }
282
282
  for (let f = l; f < Je; f++) u.current[f] && (u.current[f].visible = !1);
283
283
  }), /* @__PURE__ */ Y(de, { children: [
@@ -286,7 +286,7 @@ function ao() {
286
286
  o.map((i, c) => /* @__PURE__ */ d("sprite", { ref: (p) => void (u.current[c] = p), material: i, visible: !1 }, c))
287
287
  ] });
288
288
  }
289
- const Ge = 40, Qe = 160, io = new t.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1, colorWrite: !1 }), co = new t.Vector3(0, 1, 0), lo = new t.Vector3(0, 0, 1), et = new t.Vector3(), gt = new t.Vector3(), Ee = new t.Vector3(), uo = (() => {
289
+ const Ge = 40, Qe = 160, co = new t.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1, colorWrite: !1 }), lo = new t.Vector3(0, 1, 0), uo = new t.Vector3(0, 0, 1), et = new t.Vector3(), gt = new t.Vector3(), Ee = new t.Vector3(), fo = (() => {
290
290
  const e = new Float32Array((Qe + 1) * 3);
291
291
  for (let a = 0; a <= Qe; a++) {
292
292
  const o = a / Qe * Math.PI * 2;
@@ -296,29 +296,29 @@ const Ge = 40, Qe = 160, io = new t.MeshBasicMaterial({ transparent: !0, opacity
296
296
  return r.setAttribute("position", new t.BufferAttribute(e, 3)), r.boundingSphere = new t.Sphere(new t.Vector3(), 1e4), r;
297
297
  })(), Be = 40, ct = Array.from({ length: Be }, () => ({ on: !1, start: 0, size: 1, o: new t.Vector3(), dir: new t.Vector3(), perp: new t.Vector3(), c: new t.Color() }));
298
298
  let tt = 0;
299
- function fo(e, r, a, o, u) {
299
+ function po(e, r, a, o, u) {
300
300
  const n = ct[tt];
301
301
  tt = (tt + 1) % Be, n.on = !0, n.start = performance.now(), n.size = a, n.o.copy(e), n.dir.copy(e).sub(r), n.dir.lengthSq() < 1e-4 && n.dir.set(0, 1, 0), n.dir.normalize(), n.dir.x += Math.sin(u * 12.9) * 0.6, n.dir.y += Math.cos(u * 7.3) * 0.6, n.dir.z += 0.35, n.dir.normalize(), n.perp.set(0, 0, 1).cross(n.dir).normalize(), n.perp.lengthSq() < 0.5 && n.perp.set(1, 0, 0), n.c.copy(o).lerp(oe, 0.35);
302
302
  }
303
- function po({ agent: e, selected: r, onSelect: a }) {
304
- const o = e.inst, u = B(null), n = B(null), i = B(null), c = B(null), p = B(null), b = B(null), h = B(null), z = B(null), A = B(null), v = B(null), x = lt[o.type], G = !!o.subagent, l = E(
303
+ function mo({ agent: e, selected: r, onSelect: a }) {
304
+ const o = e.inst, u = B(null), n = B(null), i = B(null), c = B(null), p = B(null), b = B(null), h = B(null), G = B(null), E = B(null), v = B(null), x = lt[o.type], V = !!o.subagent, l = z(
305
305
  () => ({
306
306
  core: le("#fff"),
307
307
  shell: le(x),
308
- halo: $(x),
308
+ halo: W(x),
309
309
  ring: le(Fe),
310
310
  sel: le(Se),
311
- flash: $("#fff"),
311
+ flash: W("#fff"),
312
312
  arrow: le(x),
313
- field: xt(x, G ? 0.028 : 0.04),
313
+ field: xt(x, V ? 0.028 : 0.04),
314
314
  trail: ue("#fff", !0),
315
315
  orbit: ue(x)
316
316
  }),
317
- [x, G]
318
- ), f = E(() => {
317
+ [x, V]
318
+ ), f = z(() => {
319
319
  const y = new t.BufferGeometry();
320
320
  return y.setAttribute("position", new t.BufferAttribute(new Float32Array(Ge * 3), 3)), y.setAttribute("color", new t.BufferAttribute(new Float32Array(Ge * 3), 3)), y.boundingSphere = new t.Sphere(new t.Vector3(), 1e4), y;
321
- }, []), g = E(() => Object.assign(new t.Line(f, l.trail), { frustumCulled: !1 }), [f, l.trail]), P = E(() => Object.assign(new t.Line(uo, l.orbit), { frustumCulled: !1, matrixAutoUpdate: !1, visible: !1 }), [l.orbit]), s = E(
321
+ }, []), g = z(() => Object.assign(new t.Line(f, l.trail), { frustumCulled: !1 }), [f, l.trail]), A = z(() => Object.assign(new t.Line(fo, l.orbit), { frustumCulled: !1, matrixAutoUpdate: !1, visible: !1 }), [l.orbit]), s = z(
322
322
  () => ({
323
323
  p: new t.Vector3(),
324
324
  ctrl: new t.Vector3(),
@@ -343,80 +343,80 @@ function po({ agent: e, selected: r, onSelect: a }) {
343
343
  ), C = (y, I) => I.copy(s.n).addScaledVector(s.a, Math.cos(y)).addScaledVector(s.b, Math.sin(y));
344
344
  he(({ clock: y, camera: I }) => {
345
345
  var pe, te, ae, Te, me;
346
- const T = performance.now(), w = y.elapsedTime, V = o.exitAt ? (T - o.exitAt) / 1e3 / (Rt(o) / It) : -1, R = V >= 0 ? q(V / 0.8) : 0, _ = V > 0 ? V : 0;
347
- if (G) {
346
+ const T = performance.now(), w = y.elapsedTime, P = o.exitAt ? (T - o.exitAt) / 1e3 / (Rt(o) / It) : -1, R = P >= 0 ? q(P / 0.8) : 0, _ = P > 0 ? P : 0;
347
+ if (V) {
348
348
  const F = 0.32 * be.spread;
349
349
  s.n.copy(e.pos), s.a.set(F, 0, 0), s.b.set(0, F * 0.45, F * 0.6);
350
350
  } else {
351
351
  const F = Pe.get(e.run.id) ?? e.run.origin;
352
352
  s.n.copy(F), s.a.copy(e.pos).sub(F);
353
- let W = s.a.length();
354
- W < 0.5 && (s.a.set(0, 0.5, 0), W = 0.5), s.b.set(-s.a.y, s.a.x, 0).normalize().multiplyScalar(W * s.tilt * s.dir).addScaledVector(lo, W * s.lean);
353
+ let D = s.a.length();
354
+ D < 0.5 && (s.a.set(0, 0.5, 0), D = 0.5), s.b.set(-s.a.y, s.a.x, 0).normalize().multiplyScalar(D * s.tilt * s.dir).addScaledVector(uo, D * s.lean);
355
355
  }
356
- let m = G ? w * (G ? j ? 0 : 0.9 : 0) * s.dir + s.seed * 6.28 : j ? 0 : Math.sin(w * 0.6 + s.seed * 9) * 0.06;
356
+ let m = V ? w * (V ? j ? 0 : 0.9 : 0) * s.dir + s.seed * 6.28 : j ? 0 : Math.sin(w * 0.6 + s.seed * 9) * 0.06;
357
357
  m += s.dir * _ * 0.9;
358
358
  const M = 1 + _ * _ * 0.07;
359
359
  C(m, e.live), M !== 1 && e.live.sub(s.n).multiplyScalar(M).add(s.n);
360
- const N = je((T - o.bornAt) / 1100);
360
+ const N = Ke((T - o.bornAt) / 1100);
361
361
  if (N < 1) {
362
362
  const F = o.parent ? xe(o.parent) : void 0;
363
- F ? (s.from.copy(F), s.fromSet = !0) : s.fromSet || (s.from.copy(s.n), s.fromSet = !0), e.live.lerpVectors(s.from, e.live, G ? N : 0.3 + 0.7 * N);
363
+ F ? (s.from.copy(F), s.fromSet = !0) : s.fromSet || (s.from.copy(s.n), s.fromSet = !0), e.live.lerpVectors(s.from, e.live, V ? N : 0.3 + 0.7 * N);
364
364
  }
365
365
  const X = e.live;
366
366
  (pe = u.current) == null || pe.position.copy(X);
367
- const ve = Ot(o, T), k = V < 0 && (o.status === "thinking" || o.status === "spawning"), ne = Tt(o, T);
367
+ const ve = Ot(o, T), k = P < 0 && (o.status === "thinking" || o.status === "spawning"), ne = Tt(o, T);
368
368
  let Ve = !1;
369
369
  for (const F of K.mcpPending.values()) F.instance === o.id && (Ve = !0);
370
370
  const Oe = j ? 0.5 : 0.5 + 0.5 * Math.sin(w * (k ? 6 : 1.6) + s.seed * 30);
371
- o.llmCalls !== s.llm && (s.llm = o.llmCalls, V < 0 && fo(X, Pe.get(e.run.id) ?? e.run.origin, o.pulse, x, s.seed + o.llmCalls * 0.37));
372
- const re = e.scale, fe = je((T - o.bornAt) / 700), $e = 0.3 * re * fe * (1 - R * 0.9) * (1 + ne * 0.12);
373
- if ((te = n.current) == null || te.scale.setScalar(Math.max(1e-4, $e)), s.c.copy(x).multiplyScalar((k ? 1 + Oe * 0.4 : 0.55 + Oe * 0.15) + ne * 0.5), V >= 0 && s.c.lerp(Dt, R), l.shell.color.copy(s.c), l.core.color.setScalar((k ? 0.9 : 0.45) * (1 - R) + ne * 0.4), i.current && (i.current.scale.setScalar(Math.max(1e-4, (k ? 2.4 : 1.7) * re * fe * (1 - R * 0.7) + ne * 0.9 * be.scale)), l.halo.color.copy(x).multiplyScalar(((k ? 0.32 : 0.16) + ne * 0.25) * ve)), b.current) {
374
- const F = V >= 0 && V < 0.9 ? 1 - V / 0.9 : 0;
371
+ o.llmCalls !== s.llm && (s.llm = o.llmCalls, P < 0 && po(X, Pe.get(e.run.id) ?? e.run.origin, o.pulse, x, s.seed + o.llmCalls * 0.37));
372
+ const re = e.scale, fe = Ke((T - o.bornAt) / 700), De = 0.3 * re * fe * (1 - R * 0.9) * (1 + ne * 0.12);
373
+ if ((te = n.current) == null || te.scale.setScalar(Math.max(1e-4, De)), s.c.copy(x).multiplyScalar((k ? 1 + Oe * 0.4 : 0.55 + Oe * 0.15) + ne * 0.5), P >= 0 && s.c.lerp(Zt, R), l.shell.color.copy(s.c), l.core.color.setScalar((k ? 0.9 : 0.45) * (1 - R) + ne * 0.4), i.current && (i.current.scale.setScalar(Math.max(1e-4, (k ? 2.4 : 1.7) * re * fe * (1 - R * 0.7) + ne * 0.9 * be.scale)), l.halo.color.copy(x).multiplyScalar(((k ? 0.32 : 0.16) + ne * 0.25) * ve)), b.current) {
374
+ const F = P >= 0 && P < 0.9 ? 1 - P / 0.9 : 0;
375
375
  b.current.visible = F > 0, b.current.scale.setScalar(Math.max(1e-4, re * (1.2 + (1 - F) * 3.5))), l.flash.color.copy(o.status === "failed" ? Fe : oe).multiplyScalar(F * F * 0.9);
376
376
  }
377
- if (s.ringK += ((Ve && V < 0 ? 1 : 0) - s.ringK) * 0.1, c.current && (c.current.visible = s.ringK > 0.02, c.current.rotation.set(1.2 + Math.sin(w * 0.8) * 0.3, w * 1.4, 0), c.current.scale.setScalar(Math.max(1e-4, 0.62 * re * s.ringK)), l.ring.color.copy(Fe).multiplyScalar(1.1 * s.ringK * (0.7 + Oe * 0.3))), p.current && (p.current.visible = r, p.current.quaternion.copy(I.quaternion), p.current.scale.setScalar(0.8 * re + (j ? 0 : Math.sin(w * 3) * 0.04))), (ae = z.current) == null || ae.scale.setScalar(Math.max(0.55, 0.62 * re)), G ? (Te = v.current) == null || Te.position.set(0.3 * re + 0.15, 0, 0) : (me = v.current) == null || me.position.set(0, (s.a.y > 0.2 ? 1 : -1) * (0.42 * re + 0.28), 0), A.current && (s.labelK += ((Lt(o.id) ? 1 : 0) - s.labelK) * 0.12, A.current.setOpacity(q((T - o.bornAt) / 600) * (1 - q(V / 1.2)) * 0.95 * s.labelK)), !G) {
377
+ if (s.ringK += ((Ve && P < 0 ? 1 : 0) - s.ringK) * 0.1, c.current && (c.current.visible = s.ringK > 0.02, c.current.rotation.set(1.2 + Math.sin(w * 0.8) * 0.3, w * 1.4, 0), c.current.scale.setScalar(Math.max(1e-4, 0.62 * re * s.ringK)), l.ring.color.copy(Fe).multiplyScalar(1.1 * s.ringK * (0.7 + Oe * 0.3))), p.current && (p.current.visible = r, p.current.quaternion.copy(I.quaternion), p.current.scale.setScalar(0.8 * re + (j ? 0 : Math.sin(w * 3) * 0.04))), (ae = G.current) == null || ae.scale.setScalar(Math.max(0.55, 0.62 * re)), V ? (Te = v.current) == null || Te.position.set(0.3 * re + 0.15, 0, 0) : (me = v.current) == null || me.position.set(0, (s.a.y > 0.2 ? 1 : -1) * (0.42 * re + 0.28), 0), E.current && (s.labelK += ((Lt(o.id) ? 1 : 0) - s.labelK) * 0.12, E.current.setOpacity(q((T - o.bornAt) / 600) * (1 - q(P / 1.2)) * 0.95 * s.labelK)), !V) {
378
378
  const F = s.a.length();
379
- P.visible = F > 0.6 && ve > 0.02, P.visible && (Ee.crossVectors(s.a, s.b).normalize(), P.matrix.makeBasis(s.a, s.b, Ee).setPosition(s.n), P.matrixWorldNeedsUpdate = !0, l.orbit.color.copy(x).multiplyScalar((k ? 0.32 : 0.2) * fe * (1 - R) * ve));
379
+ A.visible = F > 0.6 && ve > 0.02, A.visible && (Ee.crossVectors(s.a, s.b).normalize(), A.matrix.makeBasis(s.a, s.b, Ee).setPosition(s.n), A.matrixWorldNeedsUpdate = !0, l.orbit.color.copy(x).multiplyScalar((k ? 0.32 : 0.2) * fe * (1 - R) * ve));
380
380
  }
381
- const D = f.getAttribute("position"), S = f.getAttribute("color"), O = G ? 2.4 : 1.5, H = (k ? 0.75 : 0.45) * fe * (V >= 0 ? (1 - q((V - 0.4) / 2)) * 1.6 : 1);
381
+ const $ = f.getAttribute("position"), S = f.getAttribute("color"), O = V ? 2.4 : 1.5, H = (k ? 0.75 : 0.45) * fe * (P >= 0 ? (1 - q((P - 0.4) / 2)) * 1.6 : 1);
382
382
  for (let F = 0; F < Ge; F++) {
383
- const W = m - s.dir * (F / (Ge - 1)) * O;
384
- C(W, s.p), M !== 1 && s.p.sub(s.n).multiplyScalar(M).add(s.n), N < 1 && s.p.lerpVectors(s.from, s.p, G ? N : 0.3 + 0.7 * N), D.setXYZ(F, s.p.x, s.p.y, s.p.z);
383
+ const D = m - s.dir * (F / (Ge - 1)) * O;
384
+ C(D, s.p), M !== 1 && s.p.sub(s.n).multiplyScalar(M).add(s.n), N < 1 && s.p.lerpVectors(s.from, s.p, V ? N : 0.3 + 0.7 * N), $.setXYZ(F, s.p.x, s.p.y, s.p.z);
385
385
  const ze = Math.pow(1 - F / (Ge - 1), 1.8) * H;
386
- S.setXYZ(F, (V >= 0 ? Se.r : x.r) * ze, (V >= 0 ? Se.g : x.g) * ze, (V >= 0 ? Se.b : x.b) * ze);
386
+ S.setXYZ(F, (P >= 0 ? Se.r : x.r) * ze, (P >= 0 ? Se.g : x.g) * ze, (P >= 0 ? Se.b : x.b) * ze);
387
387
  }
388
- D.needsUpdate = !0, S.needsUpdate = !0;
388
+ $.needsUpdate = !0, S.needsUpdate = !0;
389
389
  const J = o.parent ? xe(o.parent) : void 0, Q = o.parent ? K.instances.get(o.parent) : void 0, se = !!J && !!Q && !Q.exitAt && !o.exitAt;
390
390
  s.linkK += ((se ? 1 : 0) - s.linkK) * (se ? 0.06 : 0.05), J && s.par.copy(J);
391
391
  const ee = l.field.uniforms;
392
- ee.uP0.value.copy(s.par), ee.uP2.value.copy(X), G ? s.ctrl.copy(s.par).addScaledVector(e.run.axis, 1.2 * be.spread) : Ye(s.par, X, 1.4, s.ctrl), ee.uP1.value.copy(s.ctrl);
392
+ ee.uP0.value.copy(s.par), ee.uP2.value.copy(X), V ? s.ctrl.copy(s.par).addScaledVector(e.run.axis, 1.2 * be.spread) : je(s.par, X, 1.4, s.ctrl), ee.uP1.value.copy(s.ctrl);
393
393
  const ge = Re((T - o.bornAt) / 900);
394
394
  if (ee.uGrow.value = o.parent && s.linkK > 0.01 ? ge : 0, ee.uOpacity.value = (k ? 0.7 : 0.45) * s.linkK, ee.uFlow.value = s.linkK, ee.uTime.value = j ? 0 : w, ee.uHead.value = ge < 1 ? ge : -1, h.current) {
395
395
  const F = o.parent && s.linkK > 0.05 && ge >= 1;
396
396
  if (h.current.visible = !!F, F) {
397
- ie(s.par, s.ctrl, X, 0.74, et), ie(s.par, s.ctrl, X, 0.8, gt), h.current.position.copy(et), Ee.subVectors(gt, et), Ee.lengthSq() > 1e-8 && h.current.quaternion.setFromUnitVectors(co, Ee.normalize());
398
- const W = (G ? 0.11 : 0.15) * Math.min(1.3, be.scale);
399
- h.current.scale.set(W, W * 2.6, W), l.arrow.color.copy(x).multiplyScalar(1.5 * s.linkK);
397
+ ie(s.par, s.ctrl, X, 0.74, et), ie(s.par, s.ctrl, X, 0.8, gt), h.current.position.copy(et), Ee.subVectors(gt, et), Ee.lengthSq() > 1e-8 && h.current.quaternion.setFromUnitVectors(lo, Ee.normalize());
398
+ const D = (V ? 0.11 : 0.15) * Math.min(1.3, be.scale);
399
+ h.current.scale.set(D, D * 2.6, D), l.arrow.color.copy(x).multiplyScalar(1.5 * s.linkK);
400
400
  }
401
401
  }
402
402
  });
403
403
  const L = o.id.split(":")[2];
404
404
  return /* @__PURE__ */ Y(de, { children: [
405
- /* @__PURE__ */ d("primitive", { object: P }),
405
+ /* @__PURE__ */ d("primitive", { object: A }),
406
406
  /* @__PURE__ */ d("mesh", { geometry: St, material: l.field, frustumCulled: !1 }),
407
407
  /* @__PURE__ */ d("mesh", { ref: h, geometry: ut, material: l.arrow, visible: !1 }),
408
408
  /* @__PURE__ */ d("primitive", { object: g }),
409
409
  /* @__PURE__ */ Y("group", { ref: u, position: e.pos, children: [
410
410
  /* @__PURE__ */ Y("group", { ref: n, scale: 1e-4, children: [
411
- /* @__PURE__ */ d("mesh", { geometry: De, material: l.shell }),
412
- /* @__PURE__ */ d("mesh", { geometry: De, material: l.core, scale: 0.55 })
411
+ /* @__PURE__ */ d("mesh", { geometry: $e, material: l.shell }),
412
+ /* @__PURE__ */ d("mesh", { geometry: $e, material: l.core, scale: 0.55 })
413
413
  ] }),
414
414
  /* @__PURE__ */ d(
415
415
  "mesh",
416
416
  {
417
- ref: z,
418
- geometry: De,
419
- material: io,
417
+ ref: G,
418
+ geometry: $e,
419
+ material: co,
420
420
  onClick: (y) => {
421
421
  y.stopPropagation(), a(o.id);
422
422
  },
@@ -431,45 +431,45 @@ function po({ agent: e, selected: r, onSelect: a }) {
431
431
  /* @__PURE__ */ d("group", { ref: v, children: /* @__PURE__ */ d(
432
432
  Ie,
433
433
  {
434
- ref: A,
435
- anchorX: G ? "left" : "center",
434
+ ref: E,
435
+ anchorX: V ? "left" : "center",
436
436
  text: `${o.name}${L !== void 0 ? ` ${Number(L) + 1}` : ""}`,
437
437
  color: Mt[o.type],
438
- size: G ? 0.22 : 0.28,
438
+ size: V ? 0.22 : 0.28,
439
439
  opacity: 0,
440
440
  fit: !0,
441
- pxRange: G ? [8, 11.5] : [9, 13]
441
+ pxRange: V ? [8, 11.5] : [9, 13]
442
442
  }
443
443
  ) })
444
444
  ] })
445
445
  ] });
446
446
  }
447
447
  const Ce = 36, yt = 1.5;
448
- function mo() {
449
- const e = E(() => {
448
+ function ho() {
449
+ const e = z(() => {
450
450
  const n = new t.BufferGeometry();
451
451
  return n.setAttribute("position", new t.BufferAttribute(new Float32Array(Be * Ce * 6), 3)), n.setAttribute("color", new t.BufferAttribute(new Float32Array(Be * Ce * 6), 3)), n.boundingSphere = new t.Sphere(new t.Vector3(), 1e4), n;
452
- }, []), r = E(() => ue("#fff", !0), []), a = E(() => ct.map(() => $("#fff")), []), o = B([]), u = E(() => new t.Vector3(), []);
452
+ }, []), r = z(() => ue("#fff", !0), []), a = z(() => ct.map(() => W("#fff")), []), o = B([]), u = z(() => new t.Vector3(), []);
453
453
  return he(() => {
454
454
  const n = performance.now(), i = e.getAttribute("position"), c = e.getAttribute("color");
455
455
  let p = 0;
456
456
  for (let b = 0; b < Be; b++) {
457
- const h = ct[b], z = o.current[b], A = (n - h.start) / 1e3;
458
- if (!h.on || A > yt) {
459
- h.on = !1, z && (z.visible = !1);
457
+ const h = ct[b], G = o.current[b], E = (n - h.start) / 1e3;
458
+ if (!h.on || E > yt) {
459
+ h.on = !1, G && (G.visible = !1);
460
460
  continue;
461
461
  }
462
- if (z) {
463
- const g = Math.max(0, 1 - A / 0.55);
464
- z.visible = g > 0, z.position.copy(h.o), z.scale.setScalar(Math.max(1e-4, (0.8 + h.size * 1.5) * (0.6 + (1 - g) * 0.8))), a[b].color.copy(h.c).multiplyScalar(g * g * 1.1);
462
+ if (G) {
463
+ const g = Math.max(0, 1 - E / 0.55);
464
+ G.visible = g > 0, G.position.copy(h.o), G.scale.setScalar(Math.max(1e-4, (0.8 + h.size * 1.5) * (0.6 + (1 - g) * 0.8))), a[b].color.copy(h.c).multiplyScalar(g * g * 1.1);
465
465
  }
466
- const v = 1 - A / yt, x = 0.4 + A * 7.5, G = 1.2 + h.size * 1.1, l = 0.1 + h.size * 0.07, f = p * Ce * 2;
466
+ const v = 1 - E / yt, x = 0.4 + E * 7.5, V = 1.2 + h.size * 1.1, l = 0.1 + h.size * 0.07, f = p * Ce * 2;
467
467
  for (let g = 0; g < Ce; g++)
468
- for (let P = 0; P < 2; P++) {
469
- const s = (g + P) / Ce, C = Math.max(0, x - G * (1 - s)), L = Math.sin(Math.PI * s), y = Math.sin(s * Math.PI * 2 * (3 + h.size)) * l * L;
470
- u.copy(h.o).addScaledVector(h.dir, C).addScaledVector(h.perp, y), i.setXYZ(f + g * 2 + P, u.x, u.y, u.z);
468
+ for (let A = 0; A < 2; A++) {
469
+ const s = (g + A) / Ce, C = Math.max(0, x - V * (1 - s)), L = Math.sin(Math.PI * s), y = Math.sin(s * Math.PI * 2 * (3 + h.size)) * l * L;
470
+ u.copy(h.o).addScaledVector(h.dir, C).addScaledVector(h.perp, y), i.setXYZ(f + g * 2 + A, u.x, u.y, u.z);
471
471
  const I = L * v * 1.4;
472
- c.setXYZ(f + g * 2 + P, h.c.r * I, h.c.g * I, h.c.b * I);
472
+ c.setXYZ(f + g * 2 + A, h.c.r * I, h.c.g * I, h.c.b * I);
473
473
  }
474
474
  p++;
475
475
  }
@@ -480,8 +480,8 @@ function mo() {
480
480
  ] });
481
481
  }
482
482
  const ot = 24;
483
- function ho() {
484
- const e = E(() => Array.from({ length: ot }, () => $("#fff")), []), r = B([]), a = E(() => ({ c: new t.Vector3(), h: new t.Vector3() }), []);
483
+ function vo() {
484
+ const e = z(() => Array.from({ length: ot }, () => W("#fff")), []), r = B([]), a = z(() => ({ c: new t.Vector3(), h: new t.Vector3() }), []);
485
485
  return he(() => {
486
486
  const o = performance.now();
487
487
  let u = 0;
@@ -491,14 +491,14 @@ function ho() {
491
491
  if (!i || !c || !p) continue;
492
492
  const b = q((o - n.start) / n.dur);
493
493
  if (b >= 1) continue;
494
- Ye(i, c, 1, a.c), ie(i, a.c, c, Re(b), a.h), p.visible = !0, p.position.copy(a.h), p.scale.setScalar(0.9);
494
+ je(i, c, 1, a.c), ie(i, a.c, c, Re(b), a.h), p.visible = !0, p.position.copy(a.h), p.scale.setScalar(0.9);
495
495
  const h = K.instances.get(n.from);
496
496
  e[u].color.copy(h ? lt[h.type] : Se).lerp(oe, 0.4).multiplyScalar(1.4 * Math.sin(Math.PI * b) + 0.2), u++;
497
497
  }
498
498
  for (let n = u; n < ot; n++) r.current[n] && (r.current[n].visible = !1);
499
499
  }), /* @__PURE__ */ d(de, { children: e.map((o, u) => /* @__PURE__ */ d("sprite", { ref: (n) => void (r.current[u] = n), material: o, visible: !1 }, u)) });
500
500
  }
501
- const we = 14, vo = 0.2, go = new t.OctahedronGeometry(0.13, 0), yo = (
501
+ const we = 14, go = 0.2, yo = new t.OctahedronGeometry(0.13, 0), wo = (
502
502
  /* glsl */
503
503
  `
504
504
  attribute vec3 aCol;
@@ -509,7 +509,7 @@ void main(){
509
509
  vV = normalize(-mv.xyz); vC = aCol;
510
510
  gl_Position = projectionMatrix * mv;
511
511
  }`
512
- ), wo = (
512
+ ), bo = (
513
513
  /* glsl */
514
514
  `
515
515
  uniform float uGain;
@@ -524,7 +524,7 @@ void main(){
524
524
  gl_FragColor = vec4(col * uGain, 1.0);
525
525
  }`
526
526
  ), nt = new t.Vector3();
527
- function bo(e, r) {
527
+ function Mo(e, r) {
528
528
  let a = 0, o = 0, u = 0, n = 1 / 0;
529
529
  for (const p of Me.agents.values())
530
530
  p.run === e && (p.depth === 0 ? (a++, o += p.eu, u += p.ev) : n = Math.min(n, p.ev));
@@ -538,51 +538,51 @@ function bo(e, r) {
538
538
  r.v = n < 1 / 0 ? (c + n) / 2 : c - i;
539
539
  }
540
540
  const rt = { u: 0, v: 0 };
541
- function Mo({ run: e }) {
542
- const r = E(() => new t.Vector3(), []), a = E(() => new t.Vector3(), []), o = E(() => ({ init: !1, c: new t.Color(), topY: 0, topSet: !1 }), []);
543
- Et(() => (Pe.set(e.id, r), Ke.set(e.id, a), () => {
544
- Pe.get(e.id) === r && Pe.delete(e.id), Ke.get(e.id) === a && Ke.delete(e.id);
541
+ function So({ run: e }) {
542
+ const r = z(() => new t.Vector3(), []), a = z(() => new t.Vector3(), []), o = z(() => ({ init: !1, c: new t.Color(), topY: 0, topSet: !1 }), []);
543
+ Et(() => (Pe.set(e.id, r), He.set(e.id, a), () => {
544
+ Pe.get(e.id) === r && Pe.delete(e.id), He.get(e.id) === a && He.delete(e.id);
545
545
  }), [e.id, r, a]);
546
- const u = E(() => {
547
- const h = new t.SphereGeometry(1, 16, 12), z = new t.InstancedBufferAttribute(new Float32Array(we * 3), 3);
548
- h.setAttribute("aCol", z);
549
- const A = new t.ShaderMaterial({ uniforms: { uGain: { value: 1 } }, vertexShader: yo, fragmentShader: wo }), v = new t.InstancedMesh(h, A, we);
546
+ const u = z(() => {
547
+ const h = new t.SphereGeometry(1, 16, 12), G = new t.InstancedBufferAttribute(new Float32Array(we * 3), 3);
548
+ h.setAttribute("aCol", G);
549
+ const E = new t.ShaderMaterial({ uniforms: { uGain: { value: 1 } }, vertexShader: wo, fragmentShader: bo }), v = new t.InstancedMesh(h, E, we);
550
550
  v.frustumCulled = !1;
551
- const x = new Float32Array(we * 3), G = Math.PI * (3 - Math.sqrt(5));
551
+ const x = new Float32Array(we * 3), V = Math.PI * (3 - Math.sqrt(5));
552
552
  for (let l = 0; l < we; l++) {
553
- const f = 0.36 * Math.cbrt(1 - l / we), g = 1 - 2 * (l + 0.5) / we, P = Math.sqrt(1 - g * g);
554
- x.set([Math.cos(l * G) * P * f, g * f, Math.sin(l * G) * P * f], l * 3);
555
- const s = (Ae(e.id, 40 + l) < 0.5 ? He : pt).clone().lerp(oe, 0.08 + Ae(e.id, 80 + l) * 0.12).multiplyScalar(0.9);
556
- z.setXYZ(l, s.r, s.g, s.b);
553
+ const f = 0.36 * Math.cbrt(1 - l / we), g = 1 - 2 * (l + 0.5) / we, A = Math.sqrt(1 - g * g);
554
+ x.set([Math.cos(l * V) * A * f, g * f, Math.sin(l * V) * A * f], l * 3);
555
+ const s = (Ae(e.id, 40 + l) < 0.5 ? Xe : pt).clone().lerp(oe, 0.08 + Ae(e.id, 80 + l) * 0.12).multiplyScalar(0.9);
556
+ G.setXYZ(l, s.r, s.g, s.b);
557
557
  }
558
- return { mesh: v, mat: A, pos: x, o: new t.Object3D() };
559
- }, [e.id]), n = E(() => new t.Color(e.color).lerp(e.index % 2 ? He : pt, 0.45), [e.color, e.index]), i = E(
558
+ return { mesh: v, mat: E, pos: x, o: new t.Object3D() };
559
+ }, [e.id]), n = z(() => new t.Color(e.color).lerp(e.index % 2 ? Xe : pt, 0.45), [e.color, e.index]), i = z(
560
560
  () => ({
561
- core: $(new t.Color("#7a5cff").multiplyScalar(0.35)),
562
- cloud: $("#000"),
563
- beads: Le.map(() => le("#fff"))
561
+ core: W(new t.Color("#7a5cff").multiplyScalar(0.35)),
562
+ cloud: W("#000"),
563
+ beads: We.map(() => le("#fff"))
564
564
  }),
565
565
  []
566
566
  ), c = B(null), p = B([]), b = B(null);
567
567
  return he(({ clock: h }) => {
568
568
  var T;
569
- const z = performance.now(), A = h.elapsedTime, v = e.run ?? K.runs.get(e.id);
570
- bo(e, rt), _t(e, rt.u, rt.v, nt), o.init ? r.lerp(nt, 0.12) : (r.copy(nt), o.init = !0);
571
- const x = Math.max(0.6, be.scale), G = v ? je((z - v.startedAt) / 1200) : 1, l = v != null && v.endedAt ? q(1 - (z - v.endedAt - (Nt - 2600)) / 2600) : 1, f = (v == null ? void 0 : v.status) === "started" ? 1 : 0.6;
572
- c.current && (c.current.position.copy(r), c.current.scale.setScalar(Math.max(1e-4, x * (0.4 + 0.6 * G) * (0.6 + 0.4 * l))));
573
- const { mesh: g, mat: P, pos: s, o: C } = u, L = j ? 0 : 0.02;
569
+ const G = performance.now(), E = h.elapsedTime, v = e.run ?? K.runs.get(e.id);
570
+ Mo(e, rt), _t(e, rt.u, rt.v, nt), o.init ? r.lerp(nt, 0.12) : (r.copy(nt), o.init = !0);
571
+ const x = Math.max(0.6, be.scale), V = v ? Ke((G - v.startedAt) / 1200) : 1, l = v != null && v.endedAt ? q(1 - (G - v.endedAt - (Nt - 2600)) / 2600) : 1, f = (v == null ? void 0 : v.status) === "started" ? 1 : 0.6;
572
+ c.current && (c.current.position.copy(r), c.current.scale.setScalar(Math.max(1e-4, x * (0.4 + 0.6 * V) * (0.6 + 0.4 * l))));
573
+ const { mesh: g, mat: A, pos: s, o: C } = u, L = j ? 0 : 0.02;
574
574
  for (let w = 0; w < we; w++)
575
- C.position.set(s[w * 3] + Math.sin(A * 2.1 + w * 1.7) * L, s[w * 3 + 1] + Math.cos(A * 1.8 + w * 2.3) * L, s[w * 3 + 2] + Math.sin(A * 1.6 + w) * L), C.scale.setScalar(vo), C.updateMatrix(), g.setMatrixAt(w, C.matrix);
575
+ C.position.set(s[w * 3] + Math.sin(E * 2.1 + w * 1.7) * L, s[w * 3 + 1] + Math.cos(E * 1.8 + w * 2.3) * L, s[w * 3 + 2] + Math.sin(E * 1.6 + w) * L), C.scale.setScalar(go), C.updateMatrix(), g.setMatrixAt(w, C.matrix);
576
576
  g.instanceMatrix.needsUpdate = !0;
577
- const y = j ? 1 : 0.88 + 0.12 * Math.sin(A * 0.7 + e.index);
578
- P.uniforms.uGain.value = (0.55 + 0.45 * f) * l * (0.7 + 0.3 * G), i.cloud.color.copy(n).multiplyScalar(0.22 * l * f * y * G);
579
- for (let w = 0; w < Le.length; w++) {
580
- const V = p.current[w];
581
- if (!V || (V.visible = !!(v != null && v.hasSteps), !(v != null && v.hasSteps))) continue;
582
- const R = v.steps[Le[w]], _ = w / 3 * Math.PI * 2 + (j ? 0 : A * 0.35);
583
- V.position.set(Math.cos(_) * 0.72, Math.sin(_) * 0.72 * 0.42, Math.sin(_) * 0.3);
584
- const U = 0.5 + 0.5 * Math.sin(A * 4);
585
- V.scale.setScalar(R === "running" ? 1.25 + U * 0.3 : 1), V.rotation.y = j ? 0 : A * 0.8, i.beads[w].color.copy(R === "running" ? Fe : R === "done" ? Se : R === "failed" ? He : n).multiplyScalar((R === "queued" ? 0.35 : R === "running" ? 1.2 + U * 0.6 : 0.9) * l);
577
+ const y = j ? 1 : 0.88 + 0.12 * Math.sin(E * 0.7 + e.index);
578
+ A.uniforms.uGain.value = (0.55 + 0.45 * f) * l * (0.7 + 0.3 * V), i.cloud.color.copy(n).multiplyScalar(0.22 * l * f * y * V);
579
+ for (let w = 0; w < We.length; w++) {
580
+ const P = p.current[w];
581
+ if (!P || (P.visible = !!(v != null && v.hasSteps), !(v != null && v.hasSteps))) continue;
582
+ const R = Ut(v, w), _ = w / 3 * Math.PI * 2 + (j ? 0 : E * 0.35);
583
+ P.position.set(Math.cos(_) * 0.72, Math.sin(_) * 0.72 * 0.42, Math.sin(_) * 0.3);
584
+ const U = 0.5 + 0.5 * Math.sin(E * 4);
585
+ P.scale.setScalar(R === "running" ? 1.25 + U * 0.3 : 1), P.rotation.y = j ? 0 : E * 0.8, i.beads[w].color.copy(R === "running" ? Fe : R === "done" ? Se : R === "failed" ? Xe : n).multiplyScalar((R === "queued" ? 0.35 : R === "running" ? 1.2 + U * 0.6 : 0.9) * l);
586
586
  }
587
587
  let I = r.y + 0.95 * x;
588
588
  for (const w of Me.agents.values()) w.run === e && w.live.y + 0.95 * w.scale + 0.45 > I && (I = w.live.y + 0.95 * w.scale + 0.45);
@@ -592,20 +592,20 @@ function Mo({ run: e }) {
592
592
  /* @__PURE__ */ d("sprite", { material: i.cloud, scale: 4.2, position: [0, 0, -0.6] }),
593
593
  /* @__PURE__ */ d("sprite", { material: i.core, scale: 1.8 }),
594
594
  /* @__PURE__ */ d("primitive", { object: u.mesh }),
595
- Le.map((h, z) => /* @__PURE__ */ d("mesh", { ref: (A) => void (p.current[z] = A), geometry: go, material: i.beads[z], visible: !1 }, h))
595
+ We.map((h) => /* @__PURE__ */ d("mesh", { ref: (G) => void (p.current[h] = G), geometry: yo, material: i.beads[h], visible: !1 }, h))
596
596
  ] }),
597
- /* @__PURE__ */ d("group", { ref: b, children: e.run && /* @__PURE__ */ d(So, { run: e.run, color: `#${n.getHexString()}` }) })
597
+ /* @__PURE__ */ d("group", { ref: b, children: e.run && /* @__PURE__ */ d(xo, { run: e.run, color: `#${n.getHexString()}` }) })
598
598
  ] });
599
599
  }
600
- function So({ run: e, color: r }) {
601
- Ut();
600
+ function xo({ run: e, color: r }) {
601
+ Xt();
602
602
  const a = e.status !== "started";
603
603
  let o = 0;
604
- for (const n of K.instances.values()) n.run === e.id && Xt(n) && o++;
605
- const u = e.hasSteps ? [...Ht(e, { base: "#9fb3d1", current: "#ffc24a", done: "#cfe9ff" })] : [{ text: "nucleus", color: "#9fb3d1" }];
604
+ for (const n of K.instances.values()) n.run === e.id && Ht(n) && o++;
605
+ const u = e.hasSteps ? [...Kt(e, { base: "#9fb3d1", current: "#ffc24a", done: "#cfe9ff" })] : [{ text: "nucleus", color: "#9fb3d1" }];
606
606
  return u.push({ text: a ? " · complete" : ` · ${o} e-`, color: "#9fb3d1" }), /* @__PURE__ */ d(Ie, { text: e.topic, secondary: u, color: r, size: 0.32, secondarySize: 0.25, maxWidth: 10, opacity: a ? 0.5 : 0.95, fadeMs: 400, anchorY: "bottom", pxRange: [10, 14] });
607
607
  }
608
- const xo = 140, st = 0.17, wt = 40, at = 18, it = 5, Xe = 4, Co = (
608
+ const Co = 140, st = 0.17, wt = 40, at = 18, it = 5, Ue = 4, Ao = (
609
609
  /* glsl */
610
610
  `
611
611
  attribute vec3 aCol; attribute float aFire;
@@ -616,7 +616,7 @@ void main(){
616
616
  vV = normalize(-mv.xyz); vC = aCol; vF = aFire;
617
617
  gl_Position = projectionMatrix * mv;
618
618
  }`
619
- ), Ao = (
619
+ ), Po = (
620
620
  /* glsl */
621
621
  `
622
622
  varying vec3 vN; varying vec3 vV; varying vec3 vC; varying float vF;
@@ -630,7 +630,7 @@ void main(){
630
630
  col += vC * vF * 1.8 + vec3(1.0) * vF * vF * 0.9;
631
631
  gl_FragColor = vec4(col, 1.0);
632
632
  }`
633
- ), Po = () => new t.ShaderMaterial({
633
+ ), Vo = () => new t.ShaderMaterial({
634
634
  uniforms: { uColor: { value: new t.Color() } },
635
635
  vertexShader: (
636
636
  /* glsl */
@@ -645,23 +645,23 @@ void main(){
645
645
  transparent: !0,
646
646
  depthWrite: !1,
647
647
  blending: t.AdditiveBlending
648
- }), Vo = new t.SphereGeometry(1, 48, 32);
649
- function zo({ galaxy: e }) {
650
- const r = E(() => {
651
- const l = e.nodes.slice(0, xo), f = new Set(l.map((g) => g.id));
648
+ }), zo = new t.SphereGeometry(1, 48, 32);
649
+ function Go({ galaxy: e }) {
650
+ const r = z(() => {
651
+ const l = e.nodes.slice(0, Co), f = new Set(l.map((g) => g.id));
652
652
  return { nodes: l, links: e.links.filter((g) => f.has(g.source) && f.has(g.target)) };
653
- }, [e]), a = r.nodes.length, o = E(() => {
653
+ }, [e]), a = r.nodes.length, o = z(() => {
654
654
  const l = new Float32Array(a * 3), f = Math.PI * (3 - Math.sqrt(5));
655
655
  for (let m = 0; m < a; m++) {
656
656
  const M = (ce - st) * (0.3 + 0.7 * Math.cbrt(1 - m / a)), N = 1 - 2 * (m + 0.5) / a, X = Math.sqrt(1 - N * N);
657
657
  l.set([Math.cos(m * f) * X * M, N * M, Math.sin(m * f) * X * M], m * 3);
658
658
  }
659
- const g = r.nodes.map((m, M) => new t.Color(Kt[m.kind] ?? "#94a3b8").lerp(oe, 0.08 + M * 37 % 10 / 70).multiplyScalar(0.8)), P = new Map(r.nodes.map((m, M) => [m.id, M])), s = [], C = /* @__PURE__ */ new Set(), L = (m, M) => (l[m * 3] - l[M * 3]) ** 2 + (l[m * 3 + 1] - l[M * 3 + 1]) ** 2 + (l[m * 3 + 2] - l[M * 3 + 2]) ** 2, y = (m, M) => {
659
+ const g = r.nodes.map((m, M) => new t.Color(jt[m.kind] ?? "#94a3b8").lerp(oe, 0.08 + M * 37 % 10 / 70).multiplyScalar(0.8)), A = new Map(r.nodes.map((m, M) => [m.id, M])), s = [], C = /* @__PURE__ */ new Set(), L = (m, M) => (l[m * 3] - l[M * 3]) ** 2 + (l[m * 3 + 1] - l[M * 3 + 1]) ** 2 + (l[m * 3 + 2] - l[M * 3 + 2]) ** 2, y = (m, M) => {
660
660
  const N = m < M ? m * 4096 + M : M * 4096 + m;
661
661
  m === M || C.has(N) || (C.add(N), s.push(m, M));
662
662
  };
663
663
  for (const m of r.links) {
664
- const M = P.get(m.source), N = P.get(m.target);
664
+ const M = A.get(m.source), N = A.get(m.target);
665
665
  M !== void 0 && N !== void 0 && L(M, N) < (ce * 0.9) ** 2 && y(M, N);
666
666
  }
667
667
  for (let m = 0; m < a; m++) {
@@ -673,45 +673,45 @@ function zo({ galaxy: e }) {
673
673
  s.forEach((m, M) => I.set([l[m * 3], l[m * 3 + 1], l[m * 3 + 2]], M * 3));
674
674
  const T = new t.BufferGeometry();
675
675
  T.setAttribute("position", new t.BufferAttribute(I, 3)), T.setAttribute("color", new t.BufferAttribute(new Float32Array(s.length * 3), 3)), T.boundingSphere = new t.Sphere(new t.Vector3(), ce * 2);
676
- const w = new t.SphereGeometry(1, 20, 14), V = new t.InstancedBufferAttribute(new Float32Array(a * 3), 3), R = new t.InstancedBufferAttribute(new Float32Array(a), 1);
677
- w.setAttribute("aCol", V), w.setAttribute("aFire", R);
678
- const _ = new t.InstancedMesh(w, new t.ShaderMaterial({ vertexShader: Co, fragmentShader: Ao }), a);
676
+ const w = new t.SphereGeometry(1, 20, 14), P = new t.InstancedBufferAttribute(new Float32Array(a * 3), 3), R = new t.InstancedBufferAttribute(new Float32Array(a), 1);
677
+ w.setAttribute("aCol", P), w.setAttribute("aFire", R);
678
+ const _ = new t.InstancedMesh(w, new t.ShaderMaterial({ vertexShader: Ao, fragmentShader: Po }), a);
679
679
  _.frustumCulled = !1;
680
680
  const U = new t.Object3D();
681
681
  for (let m = 0; m < a; m++)
682
- U.position.set(l[m * 3], l[m * 3 + 1], l[m * 3 + 2]), U.scale.setScalar(st), U.updateMatrix(), _.setMatrixAt(m, U.matrix), V.setXYZ(m, g[m].r, g[m].g, g[m].b);
683
- return { pos: l, base: g, mesh: _, aCol: V, aFire: R, o: U, bgeo: T, owner: Int32Array.from(s), fire: new Float32Array(a), fireC: Array.from({ length: a }, () => new t.Color()) };
684
- }, [r, a]), u = E(
682
+ U.position.set(l[m * 3], l[m * 3 + 1], l[m * 3 + 2]), U.scale.setScalar(st), U.updateMatrix(), _.setMatrixAt(m, U.matrix), P.setXYZ(m, g[m].r, g[m].g, g[m].b);
683
+ return { pos: l, base: g, mesh: _, aCol: P, aFire: R, o: U, bgeo: T, owner: Int32Array.from(s), fire: new Float32Array(a), fireC: Array.from({ length: a }, () => new t.Color()) };
684
+ }, [r, a]), u = z(
685
685
  () => ({
686
686
  beam: ue("#fff", !0),
687
687
  bond: ue("#fff", !0),
688
- core: $(new t.Color("#7a5cff").multiplyScalar(0.35)),
689
- cloud: $(new t.Color("#1d4ed8").multiplyScalar(0.22)),
690
- waves: Array.from({ length: it }, Po)
688
+ core: W(new t.Color("#7a5cff").multiplyScalar(0.35)),
689
+ cloud: W(new t.Color("#1d4ed8").multiplyScalar(0.22)),
690
+ waves: Array.from({ length: it }, Vo)
691
691
  }),
692
692
  []
693
- ), n = E(() => new Ct(wt, at), []), i = E(() => new qe(wt), []), c = B([]), p = B([]), b = B([]), h = B(Array(Xe).fill("")), [z, A] = Ft("left"), v = E(() => /* @__PURE__ */ new Map(), [r]), x = E(() => ({ v: new t.Vector3(), mid: new t.Vector3(), p: new t.Vector3(), c: new t.Color(), c2: new t.Color(), sp: new t.Vector3() }), []), G = (l) => {
693
+ ), n = z(() => new Ct(wt, at), []), i = z(() => new Ye(wt), []), c = B([]), p = B([]), b = B([]), h = B(Array(Ue).fill("")), [G, E] = Ft("left"), v = z(() => /* @__PURE__ */ new Map(), [r]), x = z(() => ({ v: new t.Vector3(), mid: new t.Vector3(), p: new t.Vector3(), c: new t.Color(), c2: new t.Color(), sp: new t.Vector3() }), []), V = (l) => {
694
694
  let f = v.get(l);
695
- return f === void 0 && v.set(l, f = qt(e, l) % a), f;
695
+ return f === void 0 && v.set(l, f = Dt(e, l) % a), f;
696
696
  };
697
697
  return he(({ clock: l, camera: f, size: g }) => {
698
698
  if (!a) return;
699
- const P = performance.now(), s = l.elapsedTime, { pos: C, base: L, fire: y, fireC: I, mesh: T, aCol: w, aFire: V, o: R } = o;
699
+ const A = performance.now(), s = l.elapsedTime, { pos: C, base: L, fire: y, fireC: I, mesh: T, aCol: w, aFire: P, o: R } = o;
700
700
  y.fill(0);
701
701
  const { v: _, mid: U, p: m, c: M, c2: N } = x;
702
702
  n.begin(), i.begin();
703
703
  let X = 0;
704
704
  for (const S of K.flares) {
705
- const O = G(S.node), H = (P - S.start) / 1e3, J = K.instances.get(S.instance), Q = S.op === "write", se = Q ? mt : J ? lt[J.type] : Se, ee = H < 0.3 ? H / 0.3 : Math.exp(-(H - 0.3) * 1.3);
705
+ const O = V(S.node), H = (A - S.start) / 1e3, J = K.instances.get(S.instance), Q = S.op === "write", se = Q ? mt : J ? lt[J.type] : Se, ee = H < 0.3 ? H / 0.3 : Math.exp(-(H - 0.3) * 1.3);
706
706
  if (ee > y[O] && (y[O] = ee, I[O].copy(Q ? oe : se)), Q && H < 1.6 && X < it) {
707
707
  const te = c.current[X];
708
708
  if (te) {
709
709
  const ae = H / 1.6;
710
- te.visible = !0, te.scale.setScalar(ce * (1.05 + ae * 1.9)), te.material.uniforms.uColor.value.copy(He).lerp(oe, 0.3).multiplyScalar(0.9 * (1 - ae) * (1 - ae));
710
+ te.visible = !0, te.scale.setScalar(ce * (1.05 + ae * 1.9)), te.material.uniforms.uColor.value.copy(Xe).lerp(oe, 0.3).multiplyScalar(0.9 * (1 - ae) * (1 - ae));
711
711
  }
712
712
  X++;
713
713
  }
714
- const ge = xe(S.instance), pe = ge ? jt(ge, x.sp) : void 0;
714
+ const ge = xe(S.instance), pe = ge ? Yt(ge, x.sp) : void 0;
715
715
  if (pe && H < 2) {
716
716
  const te = n.next();
717
717
  if (te < 0) continue;
@@ -719,9 +719,9 @@ function zo({ galaxy: e }) {
719
719
  const ae = Math.min(1, H / 0.2) * Math.pow(1 - H / 2, 1.6), Te = Q ? Math.min(1, H * 1.1) : 1 - Math.min(1, H * 1.1);
720
720
  for (let me = 0; me < at; me++)
721
721
  for (let F = 0; F < 2; F++) {
722
- const W = (me + F) / at;
723
- ie(pe, U, _, W, m), n.P.setXYZ(te + me * 2 + F, m.x, m.y, m.z);
724
- const ze = Math.exp(-(((W - Te) / 0.07) ** 2)) * 2.2;
722
+ const D = (me + F) / at;
723
+ ie(pe, U, _, D, m), n.P.setXYZ(te + me * 2 + F, m.x, m.y, m.z);
724
+ const ze = Math.exp(-(((D - Te) / 0.07) ** 2)) * 2.2;
725
725
  N.copy(se).multiplyScalar(ae * (0.18 + ze) * 0.8), n.C.setXYZ(te + me * 2 + F, N.r, N.g, N.b);
726
726
  }
727
727
  Q ? i.add(pe, U, _, 0.86, 1, 0.38, mt, ae * 1.4) : i.add(pe, U, _, 0.12, -1, 0.38, se, ae * 1.4);
@@ -732,29 +732,29 @@ function zo({ galaxy: e }) {
732
732
  const ve = j ? 0 : 0.025;
733
733
  for (let S = 0; S < a; S++) {
734
734
  const O = y[S];
735
- M.copy(L[S]), O > 0.01 && Jt(M.multiplyScalar(1 - O * 0.5), I[S], O * 0.9), w.setXYZ(S, M.r, M.g, M.b), V.setX(S, O), R.position.set(C[S * 3] + Math.sin(s * 2.1 + S * 1.7) * ve, C[S * 3 + 1] + Math.cos(s * 1.8 + S * 2.3) * ve, C[S * 3 + 2] + Math.sin(s * 1.6 + S) * ve), R.scale.setScalar(st * (1 + O * 0.35)), R.updateMatrix(), T.setMatrixAt(S, R.matrix);
735
+ M.copy(L[S]), O > 0.01 && Qt(M.multiplyScalar(1 - O * 0.5), I[S], O * 0.9), w.setXYZ(S, M.r, M.g, M.b), P.setX(S, O), R.position.set(C[S * 3] + Math.sin(s * 2.1 + S * 1.7) * ve, C[S * 3 + 1] + Math.cos(s * 1.8 + S * 2.3) * ve, C[S * 3 + 2] + Math.sin(s * 1.6 + S) * ve), R.scale.setScalar(st * (1 + O * 0.35)), R.updateMatrix(), T.setMatrixAt(S, R.matrix);
736
736
  }
737
- T.instanceMatrix.needsUpdate = !0, w.needsUpdate = !0, V.needsUpdate = !0;
737
+ T.instanceMatrix.needsUpdate = !0, w.needsUpdate = !0, P.needsUpdate = !0;
738
738
  const k = o.bgeo.getAttribute("color"), ne = o.owner;
739
739
  for (let S = 0; S < ne.length; S++) {
740
740
  const O = Math.max(y[ne[S]], y[ne[S ^ 1]]), H = L[ne[S]];
741
741
  k.setXYZ(S, H.r * 0.22 + O * 0.5, H.g * 0.22 + O * 0.5, H.b * 0.22 + O * 0.55);
742
742
  }
743
743
  k.needsUpdate = !0;
744
- const Ve = f, re = 30 * Math.max(1, Ve.position.distanceTo(Me.graph.pos)) * Math.tan(Ve.fov * Math.PI / 360) / Math.max(1, g.height) / Math.max(0.05, Me.graph.scale), fe = Me.graph.out.x < -0.5 ? "right" : Me.graph.out.x > 0.5 ? "left" : z;
745
- fe !== z && A(fe);
746
- const $e = (fe === "right" ? -1 : 1) * (ce + 0.3);
747
- let D = 0;
748
- for (let S = K.flares.length - 1; S >= 0 && D < Xe; S--) {
744
+ const Ve = f, re = 30 * Math.max(1, Ve.position.distanceTo(Me.graph.pos)) * Math.tan(Ve.fov * Math.PI / 360) / Math.max(1, g.height) / Math.max(0.05, Me.graph.scale), fe = Me.graph.out.x < -0.5 ? "right" : Me.graph.out.x > 0.5 ? "left" : G;
745
+ fe !== G && E(fe);
746
+ const De = (fe === "right" ? -1 : 1) * (ce + 0.3);
747
+ let $ = 0;
748
+ for (let S = K.flares.length - 1; S >= 0 && $ < Ue; S--) {
749
749
  const O = K.flares[S];
750
- if (P - O.start > 2200) break;
750
+ if (A - O.start > 2200) break;
751
751
  let H = !1;
752
- for (let se = 0; se < D; se++) h.current[se] === O.node && (H = !0);
752
+ for (let se = 0; se < $; se++) h.current[se] === O.node && (H = !0);
753
753
  if (H) continue;
754
- const J = p.current[D], Q = b.current[D];
755
- J && Q && (Q.position.set($e, (1.5 - D) * re, 0.5), h.current[D] !== O.node && (J.setText(`${O.op === "write" ? "wrote" : "read"} · ${O.node}`), J.setColor(O.op === "write" ? "#ff9ccf" : "#7dd3fc")), J.setOpacity(1)), h.current[D] = O.node, D++;
754
+ const J = p.current[$], Q = b.current[$];
755
+ J && Q && (Q.position.set(De, (1.5 - $) * re, 0.5), h.current[$] !== O.node && (J.setText(`${O.op === "write" ? "wrote" : "read"} · ${O.node}`), J.setColor(O.op === "write" ? "#ff9ccf" : "#7dd3fc")), J.setOpacity(1)), h.current[$] = O.node, $++;
756
756
  }
757
- for (let S = D; S < Xe; S++) {
757
+ for (let S = $; S < Ue; S++) {
758
758
  const O = p.current[S];
759
759
  O == null || O.setOpacity(0), h.current[S] = "";
760
760
  }
@@ -763,15 +763,15 @@ function zo({ galaxy: e }) {
763
763
  /* @__PURE__ */ d("sprite", { material: u.core, scale: ce * 1.6 }),
764
764
  /* @__PURE__ */ d("lineSegments", { geometry: o.bgeo, material: u.bond, frustumCulled: !1 }),
765
765
  /* @__PURE__ */ d("primitive", { object: o.mesh }),
766
- u.waves.map((l, f) => /* @__PURE__ */ d("mesh", { ref: (g) => void (c.current[f] = g), geometry: Vo, material: l, visible: !1 }, f)),
766
+ u.waves.map((l, f) => /* @__PURE__ */ d("mesh", { ref: (g) => void (c.current[f] = g), geometry: zo, material: l, visible: !1 }, f)),
767
767
  /* @__PURE__ */ d("lineSegments", { geometry: n.geo, material: u.beam, frustumCulled: !1 }),
768
768
  /* @__PURE__ */ d("primitive", { object: i.mesh }),
769
- Array.from({ length: Xe }, (l, f) => /* @__PURE__ */ d("group", { ref: (g) => void (b.current[f] = g), children: /* @__PURE__ */ d(Ie, { ref: (g) => void (p.current[f] = g), text: "", font: "mono", anchorX: z, size: 0.24, opacity: 0, fadeMs: 250, pxRange: [8, 11.5] }) }, f)),
770
- /* @__PURE__ */ d(Yt, { position: [0, -ce - 0.85, 0], prefix: "molecule · ", font: "mono", color: "#ff4fa8", letterSpacing: 0.04, size: 0.26, opacity: 0.75, pxRange: [8.5, 12] })
769
+ Array.from({ length: Ue }, (l, f) => /* @__PURE__ */ d("group", { ref: (g) => void (b.current[f] = g), children: /* @__PURE__ */ d(Ie, { ref: (g) => void (p.current[f] = g), text: "", font: "mono", anchorX: G, size: 0.24, opacity: 0, fadeMs: 250, pxRange: [8, 11.5] }) }, f)),
770
+ /* @__PURE__ */ d(qt, { position: [0, -ce - 0.85, 0], prefix: "molecule · ", font: "mono", color: "#ff4fa8", letterSpacing: 0.04, size: 0.26, opacity: 0.75, pxRange: [8.5, 12] })
771
771
  ] });
772
772
  }
773
- function Go() {
774
- const e = E(() => {
773
+ function Eo() {
774
+ const e = z(() => {
775
775
  const a = [], o = (n, i) => a.push(...n, ...i);
776
776
  for (const n of [4, 8, 12, 16, 20, 24])
777
777
  for (let c = 0; c < 160; c++) {
@@ -785,19 +785,19 @@ function Go() {
785
785
  }
786
786
  const u = new t.BufferGeometry();
787
787
  return u.setAttribute("position", new t.Float32BufferAttribute(a, 3)), u;
788
- }, []), r = E(() => ue(new t.Color("#3db8ff").multiplyScalar(0.075)), []);
788
+ }, []), r = z(() => ue(new t.Color("#3db8ff").multiplyScalar(0.075)), []);
789
789
  return /* @__PURE__ */ d("lineSegments", { geometry: e, material: r, position: [0, 0, -9] });
790
790
  }
791
- const Eo = new t.Vector3();
792
- function Fo(e) {
791
+ const Fo = new t.Vector3();
792
+ function Bo(e) {
793
793
  for (const r of Me.runs.values()) {
794
794
  const a = Pe.get(r.id);
795
795
  a && e(a, 0.8 * Math.max(0.6, be.scale));
796
- const o = Ke.get(r.id);
797
- o && e(Eo.set(o.x, o.y + 0.5, o.z), 1.2);
796
+ const o = He.get(r.id);
797
+ o && e(Fo.set(o.x, o.y + 0.5, o.z), 1.2);
798
798
  }
799
799
  }
800
- function _o() {
800
+ function No() {
801
801
  return /* @__PURE__ */ Y(
802
802
  Wt,
803
803
  {
@@ -813,26 +813,26 @@ function _o() {
813
813
  agentRadius: 0.75,
814
814
  graph: { natural: ce * 1.15, radius: 2.3 },
815
815
  peripheryGap: 3.8,
816
- Background: /* @__PURE__ */ d(Go, {}),
817
- Agent: po,
818
- RunMarker: Mo,
819
- McpServer: so,
820
- Backend: ro,
821
- GraphResource: zo,
816
+ Background: /* @__PURE__ */ d(Eo, {}),
817
+ Agent: mo,
818
+ RunMarker: So,
819
+ McpServer: ao,
820
+ Backend: so,
821
+ GraphResource: Go,
822
822
  cluster: { radius: 1.3, variant: "orb" },
823
- extents: Fo,
823
+ extents: Bo,
824
824
  PostFX: /* @__PURE__ */ Y(Vt, { multisampling: 0, children: [
825
825
  /* @__PURE__ */ d(zt, { mipmapBlur: !0, intensity: 1.05, luminanceThreshold: 0.22, luminanceSmoothing: 0.25, radius: 0.7 }),
826
826
  /* @__PURE__ */ d(Gt, { eskil: !1, offset: 0.25, darkness: 0.85 })
827
827
  ] }),
828
828
  children: [
829
- /* @__PURE__ */ d(mo, {}),
830
829
  /* @__PURE__ */ d(ho, {}),
831
- /* @__PURE__ */ d(ao, {})
830
+ /* @__PURE__ */ d(vo, {}),
831
+ /* @__PURE__ */ d(io, {})
832
832
  ]
833
833
  }
834
834
  );
835
835
  }
836
836
  export {
837
- _o as default
837
+ No as default
838
838
  };