agentglow 0.3.0 → 0.3.2

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.
@@ -5,16 +5,16 @@ import { jsxs as Y, Fragment as de, jsx as u } from "react/jsx-runtime";
5
5
  import { Stars as at } from "@react-three/drei";
6
6
  import { EffectComposer as st, Bloom as it, Vignette as ct } from "@react-three/postprocessing";
7
7
  import { useFrame as re, useThree as lt } from "@react-three/fiber";
8
- import { useRef as z, useMemo as P, useEffect as ut, useState as $e } from "react";
8
+ import { useRef as z, useMemo as V, useEffect as ut, useState as $e } from "react";
9
9
  import * as o from "three";
10
- import { T as Xe, w as L, a as ge, f as Ee, p as pt, e as ft, s as dt, r as fe, L as be, l as mt, g as ht, b as We, K as gt, o as vt, q as wt, G as yt, t as bt, R as Mt, u as St, v as Ct, m as De, c as Ye, d as At, n as xt } from "./KitScene-C_6JIRsN.js";
11
- const ee = (e) => e < 0 ? 0 : e > 1 ? 1 : e, Ie = (e) => 1 - Math.pow(1 - ee(e), 3), Me = (e) => (e = ee(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2), Rt = (e) => {
10
+ import { T as Xe, w as L, a as ge, p as pt, e as ft, s as dt, r as fe, f as Ue, L as be, l as mt, g as ht, b as We, K as gt, o as vt, q as wt, G as yt, t as bt, R as Mt, u as St, v as Ct, x as At, m as De, c as Ye, d as xt, n as Rt } from "./KitScene-DbBTTc3H.js";
11
+ const ee = (e) => e < 0 ? 0 : e > 1 ? 1 : e, ke = (e) => 1 - Math.pow(1 - ee(e), 3), Me = (e) => (e = ee(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2), Tt = (e) => {
12
12
  e = ee(e);
13
13
  const r = 2.2;
14
14
  return 1 + (r + 1) * Math.pow(e - 1, 3) + r * Math.pow(e - 1, 2);
15
- }, Pe = Object.fromEntries(Object.entries(Xe).map(([e, r]) => [e, new o.Color(r)])), Fe = (e) => e === "graph_scout" || e === "records_scout" || e === "data_scout";
15
+ }, Ve = Object.fromEntries(Object.entries(Xe).map(([e, r]) => [e, new o.Color(r)])), Ee = (e) => e === "graph_scout" || e === "records_scout" || e === "data_scout";
16
16
  let Ae = null;
17
- function Tt() {
17
+ function Pt() {
18
18
  if (Ae) return Ae;
19
19
  const e = document.createElement("canvas");
20
20
  e.width = e.height = 128;
@@ -22,7 +22,7 @@ function Tt() {
22
22
  return t.addColorStop(0, "rgba(255,255,255,1)"), t.addColorStop(0.15, "rgba(255,255,255,0.6)"), t.addColorStop(0.45, "rgba(255,255,255,0.14)"), t.addColorStop(1, "rgba(255,255,255,0)"), r.fillStyle = t, r.fillRect(0, 0, 128, 128), Ae = new o.CanvasTexture(e), Ae;
23
23
  }
24
24
  function le(e = "#fff") {
25
- return new o.SpriteMaterial({ map: Tt(), color: e, blending: o.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
25
+ return new o.SpriteMaterial({ map: Pt(), color: e, blending: o.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
26
26
  }
27
27
  function se(e = "#fff") {
28
28
  return new o.MeshBasicMaterial({ color: e, blending: o.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
@@ -47,7 +47,7 @@ function Vt(e = 64, r = 7) {
47
47
  const Ze = Vt(), Ge = new o.SphereGeometry(1, 32, 24);
48
48
  new o.SphereGeometry(1, 40, 28);
49
49
  new o.IcosahedronGeometry(1, 1);
50
- const Ke = new o.ConeGeometry(1, 1, 14).translate(0, 0.5, 0), Pt = new o.ConeGeometry(1, 1, 6, 1, !0).translate(0, 0.5, 0), Gt = (
50
+ const Ie = new o.ConeGeometry(1, 1, 14).translate(0, 0.5, 0), Gt = new o.ConeGeometry(1, 1, 6, 1, !0).translate(0, 0.5, 0), zt = (
51
51
  /* glsl */
52
52
  `
53
53
  uniform vec3 uP0; uniform vec3 uP1; uniform vec3 uP2; uniform float uRadius; uniform float uTaper;
@@ -66,7 +66,7 @@ void main(){
66
66
  vT = t;
67
67
  gl_Position = projectionMatrix * mv;
68
68
  }`
69
- ), zt = (
69
+ ), Bt = (
70
70
  /* glsl */
71
71
  `
72
72
  uniform vec3 uColor; uniform float uOpacity; uniform float uGrow; uniform float uTime; uniform float uSpark; uniform float uFlow;
@@ -106,8 +106,8 @@ function Qe(e = "#fff", r = 0.06, t = 0.4) {
106
106
  uTail: { value: 0.12 },
107
107
  uHeadColor: { value: new o.Color(4, 4, 4) }
108
108
  },
109
- vertexShader: Gt,
110
- fragmentShader: zt,
109
+ vertexShader: zt,
110
+ fragmentShader: Bt,
111
111
  transparent: !0,
112
112
  depthWrite: !1,
113
113
  blending: o.AdditiveBlending
@@ -135,7 +135,7 @@ const Be = class Be {
135
135
  te(this, "a", new o.Vector3());
136
136
  te(this, "b", new o.Vector3());
137
137
  te(this, "d", new o.Vector3());
138
- this.max = r, this.colors = new Float32Array(r * 3), this.mesh = new o.InstancedMesh(Ke, new o.MeshBasicMaterial({ blending: o.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 }), r), this.mesh.instanceColor = new o.InstancedBufferAttribute(this.colors, 3), this.mesh.frustumCulled = !1, this.mesh.count = 0;
138
+ this.max = r, this.colors = new Float32Array(r * 3), this.mesh = new o.InstancedMesh(Ie, new o.MeshBasicMaterial({ blending: o.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 }), r), this.mesh.instanceColor = new o.InstancedBufferAttribute(this.colors, 3), this.mesh.frustumCulled = !1, this.mesh.count = 0;
139
139
  }
140
140
  begin() {
141
141
  this.n = 0;
@@ -150,12 +150,12 @@ const Be = class Be {
150
150
  };
151
151
  te(Be, "UP", new o.Vector3(0, 1, 0));
152
152
  let ze = Be;
153
- const _e = new o.Vector3(), xe = new o.Vector3(), Bt = new o.Vector3(0, 1, 0);
153
+ const Fe = new o.Vector3(), xe = new o.Vector3(), Ot = new o.Vector3(0, 1, 0);
154
154
  function He(e, r, t, n, s, a, i) {
155
- ne(r, t, n, s, _e), ne(r, t, n, Math.min(1, Math.max(0, s + 0.02 * a)), xe), e.position.copy(_e), xe.sub(_e), xe.lengthSq() > 1e-8 && e.quaternion.setFromUnitVectors(Bt, xe.normalize()), e.scale.set(i * 0.4, i, i * 0.4);
155
+ ne(r, t, n, s, Fe), ne(r, t, n, Math.min(1, Math.max(0, s + 0.02 * a)), xe), e.position.copy(Fe), xe.sub(Fe), xe.lengthSq() > 1e-8 && e.quaternion.setFromUnitVectors(Ot, xe.normalize()), e.scale.set(i * 0.4, i, i * 0.4);
156
156
  }
157
- const Ot = new o.Color("#4b4a63"), Le = new o.Color("#fbbf24"), ye = /* @__PURE__ */ new Map();
158
- function Et(e) {
157
+ const Et = new o.Color("#4b4a63"), Le = new o.Color("#fbbf24"), ye = /* @__PURE__ */ new Map();
158
+ function Ft(e) {
159
159
  const r = [], t = new o.Vector3(0, 1, 0), n = 10;
160
160
  for (let s = 0; s < n; s++) {
161
161
  const a = 1 - 2 * (s + 0.5) / n, i = Math.sqrt(1 - a * a), p = s * 2.39996 + e * 6.28;
@@ -163,39 +163,39 @@ function Et(e) {
163
163
  }
164
164
  return r;
165
165
  }
166
- const Ft = new o.TorusGeometry(1.25, 0.05, 8, 64);
167
- function _t({ agent: e, onSelect: r }) {
168
- const t = e.inst, n = z(null), s = z(null), a = z(null), i = z(null), p = z(null), h = z(null), m = z(null), M = z(null), S = P(() => [...t.id].reduce((B, x) => (B * 31 + x.charCodeAt(0)) % 9973, 7) / 9973, [t.id]), F = P(() => Et(S), [S]), C = Pe[t.type], g = P(
166
+ const _t = new o.TorusGeometry(1.25, 0.05, 8, 64);
167
+ function kt({ agent: e, onSelect: r }) {
168
+ const t = e.inst, n = z(null), s = z(null), a = z(null), i = z(null), p = z(null), h = z(null), m = z(null), M = z(null), S = V(() => [...t.id].reduce((B, x) => (B * 31 + x.charCodeAt(0)) % 9973, 7) / 9973, [t.id]), F = V(() => Ft(S), [S]), C = Ve[t.type], g = V(
169
169
  () => ({
170
170
  core: se(C),
171
171
  hot: se("#ffffff"),
172
172
  spike: se(C),
173
173
  ring: se(Le),
174
174
  halo: le(C),
175
- syn: Qe(C, Fe(t.type) ? 0.08 : 0.11, 0.8),
175
+ syn: Qe(C, Ee(t.type) ? 0.08 : 0.11, 0.8),
176
176
  arrow: se(C)
177
177
  }),
178
178
  [C, t.type]
179
- ), c = P(() => ({ p0: new o.Vector3(), p1: new o.Vector3(), seedP: new o.Vector3(), p0set: !1, labelK: 1, spik: 0, ringK: 0, parentK: 1, c: new o.Color() }), []);
179
+ ), c = V(() => ({ p0: new o.Vector3(), p1: new o.Vector3(), seedP: new o.Vector3(), p0set: !1, labelK: 1, spik: 0, ringK: 0, parentK: 1, c: new o.Color() }), []);
180
180
  ut(() => (ye.set(t.id, c.p1), () => {
181
181
  ye.get(t.id) === c.p1 && ye.delete(t.id);
182
182
  }), [t.id, c]), re(({ clock: B }) => {
183
183
  var D, ie, Q;
184
- const x = performance.now(), _ = B.elapsedTime, k = fe ? 0 : 0.08 * Ee.spread;
184
+ const x = performance.now(), _ = B.elapsedTime, k = fe ? 0 : 0.08 * Ue.spread;
185
185
  e.live.set(e.pos.x + Math.sin(_ * 0.35 + S * 20) * k, e.pos.y + Math.cos(_ * 0.3 + S * 13) * k, e.pos.z);
186
186
  const G = e.live, f = t.parent ? L.instances.get(t.parent) : void 0, T = t.parent ? ge(t.parent) : void 0;
187
- T ? (c.p0.copy(T), c.p0set = !0) : c.p0set || (c.p0.copy(G), c.p0set = !0), Fe(t.type) || t.subagent ? c.p1.copy(c.p0).addScaledVector(e.run.axis, 1.7 * Ee.spread) : Oe(c.p0, G, 0.6, c.p1);
188
- const W = (x - t.bornAt) / 1e3, I = t.parent ? Ie(W / 0.9) : 1, V = Rt((W - (t.parent ? 0.85 : 0.1)) / 0.7), j = t.exitAt ? (x - t.exitAt) / 1e3 : -1, N = mt(t) / 1e3, w = j >= 0 ? ee(j / (N * 0.92)) : 0, $ = pt(t, x);
187
+ T ? (c.p0.copy(T), c.p0set = !0) : c.p0set || (c.p0.copy(G), c.p0set = !0), Oe(c.p0, G, Ee(t.type) || t.subagent ? 0.25 : 0.6, c.p1);
188
+ const W = (x - t.bornAt) / 1e3, I = t.parent ? ke(W / 0.9) : 1, P = Tt((W - (t.parent ? 0.85 : 0.1)) / 0.7), j = t.exitAt ? (x - t.exitAt) / 1e3 : -1, N = mt(t) / 1e3, w = j >= 0 ? ee(j / (N * 0.92)) : 0, $ = pt(t, x);
189
189
  let X = !1;
190
190
  for (const H of L.mcpPending.values()) H.instance === t.id && (X = !0);
191
191
  const d = j < 0 && (t.status === "thinking" || t.status === "spawning"), b = ft(t, x), O = fe ? 0 : 1, K = 0.5 + 0.5 * Math.sin(_ * 2 + S * 9) * O, Z = 0.5 + 0.5 * Math.sin(_ * 1 + S * 5) * O;
192
192
  c.spik += ((d ? 1 : 0) - c.spik) * 0.06, c.ringK += ((X && j < 0 ? 1 : 0) - c.ringK) * 0.08, n.current && (I < 1 ? n.current.position.copy(ne(c.p0, c.p1, G, I, c.seedP)) : n.current.position.copy(G));
193
- const U = I < 1 ? 0.18 : 0, l = Math.max(U, 0.18 + 0.82 * V) * (1 - w * w * 0.95) * e.scale;
193
+ const U = I < 1 ? 0.18 : 0, l = Math.max(U, 0.18 + 0.82 * P) * (1 - w * w * 0.95) * e.scale;
194
194
  (D = s.current) == null || D.scale.setScalar(Math.max(1e-4, l * (0.55 + b * 0.06 + (d ? K * 0.05 : Z * 0.04)))), (ie = a.current) == null || ie.scale.setScalar(Math.max(1e-4, c.spik * (0.85 + K * 0.15)));
195
195
  const v = d ? 0.75 + K * 0.35 : 0.3 + Z * 0.15;
196
- if (c.c.copy(C).multiplyScalar(v + b * 0.35), j >= 0 && c.c.lerp(Ot, w).multiplyScalar(1 - w * 0.75), g.core.color.copy(c.c), g.spike.color.copy(c.c).multiplyScalar(0.9), g.hot.color.setScalar((d ? 0.35 + K * 0.25 : 0.08) * (1 - w) + b * 0.2), i.current && (i.current.visible = c.ringK > 0.02, i.current.rotation.z = _ * 0.9, i.current.rotation.x = 1.1 + Math.sin(_ * 0.5) * 0.2, i.current.scale.setScalar(Math.max(1e-4, l * 0.55 * c.ringK)), g.ring.color.copy(Le).multiplyScalar(0.9 * c.ringK * (0.75 + Z * 0.25))), h.current && (h.current.scale.setScalar(Math.max(1e-4, l * (d ? 2.3 + K * 0.3 : 1.6) + b * 0.35)), g.halo.color.copy(C).multiplyScalar((d ? 0.22 : 0.09) * (1 - w) + b * 0.06)), (Q = M.current) == null || Q.position.set(0, -0.78 * e.scale - 0.25, 0), m.current) {
196
+ if (c.c.copy(C).multiplyScalar(v + b * 0.35), j >= 0 && c.c.lerp(Et, w).multiplyScalar(1 - w * 0.75), g.core.color.copy(c.c), g.spike.color.copy(c.c).multiplyScalar(0.9), g.hot.color.setScalar((d ? 0.35 + K * 0.25 : 0.08) * (1 - w) + b * 0.2), i.current && (i.current.visible = c.ringK > 0.02, i.current.rotation.z = _ * 0.9, i.current.rotation.x = 1.1 + Math.sin(_ * 0.5) * 0.2, i.current.scale.setScalar(Math.max(1e-4, l * 0.55 * c.ringK)), g.ring.color.copy(Le).multiplyScalar(0.9 * c.ringK * (0.75 + Z * 0.25))), h.current && (h.current.scale.setScalar(Math.max(1e-4, l * (d ? 2.3 + K * 0.3 : 1.6) + b * 0.35)), g.halo.color.copy(C).multiplyScalar((d ? 0.22 : 0.09) * (1 - w) + b * 0.06)), (Q = M.current) == null || Q.position.set(0, -0.78 * e.scale - 0.25, 0), m.current) {
197
197
  const H = dt(t.id);
198
- c.labelK += ((H ? 1 : 0) - c.labelK) * 0.12, m.current.setOpacity(ee(V) * (1 - w) * 0.95 * c.labelK);
198
+ c.labelK += ((H ? 1 : 0) - c.labelK) * 0.12, m.current.setOpacity(ee(P) * (1 - w) * 0.95 * c.labelK);
199
199
  }
200
200
  const E = !!f && !f.exitAt;
201
201
  c.parentK += ((t.parent && !t.exitAt && E ? 1 : 0) - c.parentK) * (E ? 0.05 : 0.035);
@@ -205,8 +205,8 @@ function _t({ agent: e, onSelect: r }) {
205
205
  if (R.uGrow.value = t.parent ? I * (1 - q) : 0, R.uSpark.value = 0, R.uHead.value = I < 1 ? I : -1, R.uTail.value = 0.1, R.uHeadColor.value.copy(C).multiplyScalar(1.5), R.uOpacity.value = (d ? 1.1 : 0.75) * Math.max(0, Math.min(c.parentK, $ > 0 ? 1 : 0)) + (I < 1 ? 0.4 : 0), R.uTime.value = fe ? 0 : _, R.uFlow.value = I >= 1 ? c.parentK : 0, p.current) {
206
206
  const H = t.parent && I >= 1 && c.parentK > 0.05 && R.uGrow.value > 0.9;
207
207
  if (p.current.visible = !!H, H) {
208
- ne(c.p0, c.p1, G, 0.8, ke), ne(c.p0, c.p1, G, 0.86, qe), p.current.position.copy(ke), Ne.subVectors(qe, ke).normalize(), p.current.quaternion.setFromUnitVectors(kt, Ne);
209
- const ue = (Fe(t.type) ? 0.75 : 1) * Math.min(1.3, Ee.scale);
208
+ ne(c.p0, c.p1, G, 0.8, _e), ne(c.p0, c.p1, G, 0.86, qe), p.current.position.copy(_e), Ne.subVectors(qe, _e).normalize(), p.current.quaternion.setFromUnitVectors(It, Ne);
209
+ const ue = (Ee(t.type) ? 0.75 : 1) * Math.min(1.3, Ue.scale);
210
210
  p.current.scale.set(0.16 * ue, 0.42 * ue, 0.16 * ue), g.arrow.color.copy(C).multiplyScalar(1.6 * c.parentK);
211
211
  }
212
212
  }
@@ -216,14 +216,14 @@ function _t({ agent: e, onSelect: r }) {
216
216
  }, y = t.id.split(":")[2];
217
217
  return /* @__PURE__ */ Y(de, { children: [
218
218
  /* @__PURE__ */ u("mesh", { geometry: Ze, material: g.syn, frustumCulled: !1 }),
219
- /* @__PURE__ */ u("mesh", { ref: p, geometry: Ke, material: g.arrow, visible: !1 }),
219
+ /* @__PURE__ */ u("mesh", { ref: p, geometry: Ie, material: g.arrow, visible: !1 }),
220
220
  /* @__PURE__ */ Y("group", { ref: n, children: [
221
221
  /* @__PURE__ */ Y("group", { ref: s, scale: 1e-4, children: [
222
222
  /* @__PURE__ */ u("mesh", { geometry: Ge, material: g.core, onClick: A, onPointerOver: () => document.body.style.cursor = "pointer", onPointerOut: () => document.body.style.cursor = "" }),
223
223
  /* @__PURE__ */ u("mesh", { geometry: Ge, material: g.hot, scale: 0.5 }),
224
- /* @__PURE__ */ u("group", { ref: a, scale: 1e-4, children: F.map((B, x) => /* @__PURE__ */ u("mesh", { geometry: Pt, material: g.spike, quaternion: B, scale: [0.2, 1.9, 0.2] }, x)) })
224
+ /* @__PURE__ */ u("group", { ref: a, scale: 1e-4, children: F.map((B, x) => /* @__PURE__ */ u("mesh", { geometry: Gt, material: g.spike, quaternion: B, scale: [0.2, 1.9, 0.2] }, x)) })
225
225
  ] }),
226
- /* @__PURE__ */ u("mesh", { ref: i, geometry: Ft, material: g.ring, visible: !1 }),
226
+ /* @__PURE__ */ u("mesh", { ref: i, geometry: _t, material: g.ring, visible: !1 }),
227
227
  /* @__PURE__ */ u("sprite", { ref: h, material: g.halo }),
228
228
  /* @__PURE__ */ u("group", { ref: M, children: /* @__PURE__ */ u(
229
229
  be,
@@ -240,9 +240,9 @@ function _t({ agent: e, onSelect: r }) {
240
240
  ] })
241
241
  ] });
242
242
  }
243
- const ke = new o.Vector3(), qe = new o.Vector3(), Ne = new o.Vector3(), kt = new o.Vector3(0, 1, 0);
244
- function It({ comet: e }) {
245
- const r = z(null), t = L.instances.get(e.from), n = t ? Pe[t.type] : Pe.planner, s = P(() => le(new o.Color(n).multiplyScalar(1.8).addScalar(0.3)), [n]), a = P(() => ({ a: new o.Vector3(), b: new o.Vector3(), c: new o.Vector3(), h: new o.Vector3() }), []);
243
+ const _e = new o.Vector3(), qe = new o.Vector3(), Ne = new o.Vector3(), It = new o.Vector3(0, 1, 0);
244
+ function Kt({ comet: e }) {
245
+ const r = z(null), t = L.instances.get(e.from), n = t ? Ve[t.type] : Ve.planner, s = V(() => le(new o.Color(n).multiplyScalar(1.8).addScalar(0.3)), [n]), a = V(() => ({ a: new o.Vector3(), b: new o.Vector3(), c: new o.Vector3(), h: new o.Vector3() }), []);
246
246
  return re(() => {
247
247
  const i = ge(e.from), p = ge(e.to);
248
248
  if (!i || !p || !r.current) {
@@ -255,19 +255,19 @@ function It({ comet: e }) {
255
255
  ne(a.a, a.c, a.b, Me(M), a.h), r.current.visible = M < 1, r.current.position.copy(a.h), r.current.scale.setScalar(1.1);
256
256
  }), /* @__PURE__ */ u("sprite", { ref: r, material: s, visible: !1 });
257
257
  }
258
- function Kt() {
258
+ function Ut() {
259
259
  const [e, r] = $e([]), t = z({ n: -1, last: -1, first: -1 });
260
260
  return re(() => {
261
261
  const n = L.comets, s = t.current, a = n.length ? n[0].id : -1, i = n.length ? n[n.length - 1].id : -1;
262
262
  (n.length !== s.n || a !== s.first || i !== s.last) && (s.n = n.length, s.first = a, s.last = i, r(ht.grouped ? n.filter((p) => We(p.from) && We(p.to)) : n.slice()));
263
- }), /* @__PURE__ */ u(de, { children: e.map((n) => /* @__PURE__ */ u(It, { comet: n }, n.id)) });
263
+ }), /* @__PURE__ */ u(de, { children: e.map((n) => /* @__PURE__ */ u(Kt, { comet: n }, n.id)) });
264
264
  }
265
- const oe = 3.3, Ut = 200, ce = 14, Re = 48, me = 16, pe = 8, Te = 4, ve = new o.Color(1, 1, 1), Wt = new o.Color("#a78bfa");
266
- function jt(e, r = Ut) {
265
+ const oe = 3.3, Wt = 200, ce = 14, Re = 48, me = 16, pe = 8, Te = 4, ve = new o.Color(1, 1, 1), jt = new o.Color("#a78bfa");
266
+ function Ht(e, r = Wt) {
267
267
  const t = e.nodes.slice(0, r), n = new Set(t.map((s) => s.id));
268
268
  return { nodes: t, links: e.links.filter((s) => n.has(s.source) && n.has(s.target)) };
269
269
  }
270
- const Ht = (
270
+ const Lt = (
271
271
  /* glsl */
272
272
  `
273
273
  attribute float aSize; attribute vec3 aColor; varying vec3 vC; varying float vFacing; uniform float uScale;
@@ -276,20 +276,20 @@ void main(){
276
276
  vec3 n = normalize(normalMatrix * normalize(position));
277
277
  vFacing = 0.35 + 0.65 * smoothstep(-0.4, 0.5, dot(n, normalize(-mv.xyz))); // back side dimmer → depth
278
278
  gl_PointSize = aSize * uScale / -mv.z; vC = aColor; gl_Position = projectionMatrix * mv; }`
279
- ), Lt = (
279
+ ), qt = (
280
280
  /* glsl */
281
281
  `
282
282
  varying vec3 vC; varying float vFacing;
283
283
  void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
284
284
  float core = smoothstep(0.45, 0.0, r); float halo = pow(1.0 - r, 2.2);
285
285
  gl_FragColor = vec4(vC * vFacing * (core * 1.2 + halo * 0.45), 1.0); }`
286
- ), qt = (
286
+ ), Nt = (
287
287
  /* glsl */
288
288
  `
289
289
  varying vec3 vN; varying vec3 vV; varying vec3 vObj;
290
290
  void main(){ vec4 mv = modelViewMatrix * vec4(position, 1.0); vN = normalize(normalMatrix * normal); vV = normalize(-mv.xyz); vObj = normalize(position);
291
291
  gl_Position = projectionMatrix * mv; }`
292
- ), Nt = (
292
+ ), $t = (
293
293
  /* glsl */
294
294
  `
295
295
  uniform vec3 uRim; uniform vec3 uInner; uniform float uTime;
@@ -313,14 +313,14 @@ void main(){
313
313
  gl_FragColor = vec4(col, 1.0);
314
314
  }`
315
315
  );
316
- function $t({ galaxy: e }) {
317
- const r = P(() => jt(e), [e]), t = r.nodes.length, { size: n, gl: s, camera: a } = lt(), i = z([]), p = z([]), h = z(Array(Te).fill("")), m = P(() => {
316
+ function Xt({ galaxy: e }) {
317
+ const r = V(() => Ht(e), [e]), t = r.nodes.length, { size: n, gl: s, camera: a } = lt(), i = z([]), p = z([]), h = z(Array(Te).fill("")), m = V(() => {
318
318
  const c = new Float32Array(t * 3), A = [], y = Math.PI * (3 - Math.sqrt(5));
319
319
  for (let d = 0; d < t; d++) {
320
320
  const b = 1 - 2 * (d + 0.5) / t, O = Math.sqrt(1 - b * b), K = new o.Vector3(Math.cos(d * y) * O, b, Math.sin(d * y) * O);
321
321
  A.push(K), c.set([K.x * oe, K.y * oe, K.z * oe], d * 3);
322
322
  }
323
- const B = r.nodes.map((d) => new o.Color(gt[d.kind] ?? "#94a3b8").lerp(Wt, 0.2).multiplyScalar(0.62)), x = new Float32Array(t), _ = new Float32Array(t * 3), k = new o.BufferGeometry();
323
+ const B = r.nodes.map((d) => new o.Color(gt[d.kind] ?? "#94a3b8").lerp(jt, 0.2).multiplyScalar(0.62)), x = new Float32Array(t), _ = new Float32Array(t * 3), k = new o.BufferGeometry();
324
324
  k.setAttribute("position", new o.BufferAttribute(c, 3)), k.setAttribute("aSize", new o.BufferAttribute(x, 1)), k.setAttribute("aColor", new o.BufferAttribute(_, 3));
325
325
  const G = new Map(r.nodes.map((d, b) => [d.id, b])), f = [], T = [];
326
326
  for (const d of r.links) {
@@ -336,7 +336,7 @@ function $t({ galaxy: e }) {
336
336
  }
337
337
  b > d && (f.push([d, b]), T.push(0)), O > d && (f.push([d, O]), T.push(0));
338
338
  }
339
- const W = new Float32Array(f.length * ce * 2 * 3), I = new Float32Array(f.length * ce * 2 * 3), V = new Int32Array(f.length * ce * 2 * 2), j = new Uint8Array(f.length * ce * 2), N = new o.Quaternion(), w = new o.Vector3();
339
+ const W = new Float32Array(f.length * ce * 2 * 3), I = new Float32Array(f.length * ce * 2 * 3), P = new Int32Array(f.length * ce * 2 * 2), j = new Uint8Array(f.length * ce * 2), N = new o.Quaternion(), w = new o.Vector3();
340
340
  f.forEach(([d, b], O) => {
341
341
  const K = A[d], Z = A[b], U = K.angleTo(Z), l = new o.Vector3().crossVectors(K, Z);
342
342
  l.lengthSq() < 1e-6 && l.set(0, 1, 0), l.normalize();
@@ -345,16 +345,16 @@ function $t({ galaxy: e }) {
345
345
  const R = (v + E) / ce;
346
346
  N.setFromAxisAngle(l, U * R), w.copy(K).applyQuaternion(N).multiplyScalar(oe * (1 + 0.06 * Math.sin(Math.PI * R) * Math.min(1, U)));
347
347
  const q = (O * ce + v) * 2 + E;
348
- W.set([w.x, w.y, w.z], q * 3), V[q * 2] = d, V[q * 2 + 1] = b, j[q] = T[O];
348
+ W.set([w.x, w.y, w.z], q * 3), P[q * 2] = d, P[q * 2 + 1] = b, j[q] = T[O];
349
349
  }
350
350
  });
351
351
  const $ = new o.BufferGeometry();
352
352
  $.setAttribute("position", new o.BufferAttribute(W, 3)), $.setAttribute("color", new o.BufferAttribute(I, 3));
353
353
  const X = new o.BufferGeometry();
354
- return X.setAttribute("position", new o.BufferAttribute(new Float32Array(Re * me * 2 * 3), 3)), X.setAttribute("color", new o.BufferAttribute(new Float32Array(Re * me * 2 * 3), 3)), X.boundingSphere = new o.Sphere(new o.Vector3(), 1e4), { pos: c, unit: A, base: B, ngeo: k, ageo: $, owner: V, kindOf: j, nArcV: f.length * ce * 2, bgeo: X, fire: new Float32Array(t), white: new Float32Array(t), fireC: Array.from({ length: t }, () => new o.Color()) };
355
- }, [r, t]), M = P(
354
+ return X.setAttribute("position", new o.BufferAttribute(new Float32Array(Re * me * 2 * 3), 3)), X.setAttribute("color", new o.BufferAttribute(new Float32Array(Re * me * 2 * 3), 3)), X.boundingSphere = new o.Sphere(new o.Vector3(), 1e4), { pos: c, unit: A, base: B, ngeo: k, ageo: $, owner: P, kindOf: j, nArcV: f.length * ce * 2, bgeo: X, fire: new Float32Array(t), white: new Float32Array(t), fireC: Array.from({ length: t }, () => new o.Color()) };
355
+ }, [r, t]), M = V(
356
356
  () => ({
357
- nodes: new o.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: Ht, fragmentShader: Lt, transparent: !0, depthWrite: !1, blending: o.AdditiveBlending }),
357
+ nodes: new o.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: Lt, fragmentShader: qt, transparent: !0, depthWrite: !1, blending: o.AdditiveBlending }),
358
358
  arcs: new o.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
359
359
  beam: new o.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
360
360
  orb: new o.ShaderMaterial({
@@ -365,8 +365,8 @@ function $t({ galaxy: e }) {
365
365
  uRipC: { value: Array.from({ length: pe }, () => new o.Vector3(0, 1, 0)) },
366
366
  uRipA: { value: new Array(pe).fill(-1) }
367
367
  },
368
- vertexShader: qt,
369
- fragmentShader: Nt,
368
+ vertexShader: Nt,
369
+ fragmentShader: $t,
370
370
  transparent: !0,
371
371
  depthWrite: !1,
372
372
  blending: o.AdditiveBlending
@@ -375,19 +375,19 @@ function $t({ galaxy: e }) {
375
375
  aura: le(new o.Color("#4c1d95").multiplyScalar(0.28))
376
376
  }),
377
377
  []
378
- ), S = P(() => /* @__PURE__ */ new Map(), []), F = P(() => new ze(Re), []), C = P(() => ({ v: new o.Vector3(), v2: new o.Vector3(), mid: new o.Vector3(), sp: new o.Vector3(), c: new o.Color(), c2: new o.Color() }), []), g = (c) => {
378
+ ), S = V(() => /* @__PURE__ */ new Map(), []), F = V(() => new ze(Re), []), C = V(() => ({ v: new o.Vector3(), v2: new o.Vector3(), mid: new o.Vector3(), sp: new o.Vector3(), c: new o.Color(), c2: new o.Color() }), []), g = (c) => {
379
379
  let A = S.get(c);
380
380
  return A === void 0 && S.set(c, A = bt(r, c)), A;
381
381
  };
382
382
  return re(({ clock: c }) => {
383
383
  const A = performance.now(), { pos: y, base: B, fire: x, white: _, fireC: k, unit: G } = m;
384
384
  M.nodes.uniforms.uScale.value = n.height * s.getPixelRatio() / (2 * Math.tan(a.fov * Math.PI / 360)) * vt.graph.scale, M.orb.uniforms.uTime.value = fe ? 0 : c.elapsedTime, x.fill(0), _.fill(0);
385
- const { v: f, v2: T, mid: W, c: I, c2: V } = C, j = m.bgeo.getAttribute("position"), N = m.bgeo.getAttribute("color"), w = M.orb.uniforms.uRipC.value, $ = M.orb.uniforms.uRipA.value;
385
+ const { v: f, v2: T, mid: W, c: I, c2: P } = C, j = m.bgeo.getAttribute("position"), N = m.bgeo.getAttribute("color"), w = M.orb.uniforms.uRipC.value, $ = M.orb.uniforms.uRipA.value;
386
386
  let X = 0;
387
387
  F.begin();
388
388
  let d = 0;
389
389
  for (const l of L.flares) {
390
- const v = g(l.node), E = (A - l.start) / 1e3, R = L.instances.get(l.instance), q = R ? Pe[R.type] : ve, D = l.op === "write", ie = E < 0.35 ? E / 0.35 : Math.exp(-(E - 0.35) * 1.2);
390
+ const v = g(l.node), E = (A - l.start) / 1e3, R = L.instances.get(l.instance), q = R ? Ve[R.type] : ve, D = l.op === "write", ie = E < 0.35 ? E / 0.35 : Math.exp(-(E - 0.35) * 1.2);
391
391
  ie > x[v] && (x[v] = ie, k[v].copy(D ? ve : q), _[v] = D ? 1 : 0), D && E < 1.8 && d < pe && (w[d].copy(G[v]), $[d] = E / 1.8, d++);
392
392
  const Q = ge(l.instance), H = Q ? wt(Q, C.sp) : void 0;
393
393
  if (H && E < 2.2 && X < Re) {
@@ -397,10 +397,10 @@ function $t({ galaxy: e }) {
397
397
  for (let Ce = 0; Ce < 2; Ce++) {
398
398
  const J = (Se + Ce) / me, ae = 1 - J;
399
399
  T.set(ae * ae * H.x + 2 * ae * J * W.x + J * J * f.x, ae * ae * H.y + 2 * ae * J * W.y + J * J * f.y, ae * ae * H.z + 2 * ae * J * W.z + J * J * f.z);
400
- const Ue = (X * me + Se) * 2 + Ce;
401
- j.setXYZ(Ue, T.x, T.y, T.z);
400
+ const Ke = (X * me + Se) * 2 + Ce;
401
+ j.setXYZ(Ke, T.x, T.y, T.z);
402
402
  const ot = Math.exp(-(((J - tt) / 0.1) ** 2)) * 1.3;
403
- V.copy(D ? ve : q).multiplyScalar(ue * ((D ? 0.5 : 0.2) + ot) * 0.75), N.setXYZ(Ue, V.r, V.g, V.b);
403
+ P.copy(D ? ve : q).multiplyScalar(ue * ((D ? 0.5 : 0.2) + ot) * 0.75), N.setXYZ(Ke, P.r, P.g, P.b);
404
404
  }
405
405
  D ? F.add(H, W, f, 0.9, 1, 0.42, ve, ue * 1.1) : F.add(H, W, f, 0.1, -1, 0.42, q, ue * 1.3), X++;
406
406
  }
@@ -454,27 +454,27 @@ function $t({ galaxy: e }) {
454
454
  /* @__PURE__ */ u(yt, { position: [0, -oe - 0.9, 0], color: "#a78bfa", size: 0.28, opacity: 0.7, pxRange: [8, 12] })
455
455
  ] });
456
456
  }
457
- function Xt({ run: e }) {
458
- const r = P(() => new o.Color(e.color), [e.color]), t = P(() => le("#000"), []), n = z(null), s = z(null);
457
+ function Dt({ run: e }) {
458
+ const r = V(() => new o.Color(e.color), [e.color]), t = V(() => le("#000"), []), n = z(null), s = z(null);
459
459
  return re(({ clock: a }) => {
460
460
  var C;
461
- const i = performance.now(), p = e.run ?? L.runs.get(e.id), h = p ? Ie((i - p.startedAt) / 1200) : 1, m = p != null && p.endedAt ? ee(1 - (i - p.endedAt - (Mt - 2500)) / 2500) : 1, M = 0.9 + 0.1 * Math.sin(a.elapsedTime * 0.6 + e.index);
461
+ const i = performance.now(), p = e.run ?? L.runs.get(e.id), h = p ? ke((i - p.startedAt) / 1200) : 1, m = p != null && p.endedAt ? ee(1 - (i - p.endedAt - (Mt - 2500)) / 2500) : 1, M = 0.9 + 0.1 * Math.sin(a.elapsedTime * 0.6 + e.index);
462
462
  t.color.copy(r).multiplyScalar(0.16 * h * m * M);
463
463
  const S = Math.abs(e.side.x) * e.hu + Math.abs(e.axis.x) * e.hv, F = Math.abs(e.side.y) * e.hu + Math.abs(e.axis.y) * e.hv;
464
464
  n.current && (n.current.position.set(e.origin.x, e.origin.y, -1.5), n.current.scale.set(S * 2.6 + 3, F * 2.6 + 3, 1)), (C = s.current) == null || C.position.set(e.origin.x, e.origin.y + F + 0.6, 0.5);
465
465
  }), /* @__PURE__ */ Y(de, { children: [
466
466
  /* @__PURE__ */ u("sprite", { ref: n, material: t }),
467
- /* @__PURE__ */ u("group", { ref: s, children: e.run && /* @__PURE__ */ u(Dt, { run: e.run }) })
467
+ /* @__PURE__ */ u("group", { ref: s, children: e.run && /* @__PURE__ */ u(Yt, { run: e.run }) })
468
468
  ] });
469
469
  }
470
- function Dt({ run: e }) {
470
+ function Yt({ run: e }) {
471
471
  St();
472
- const r = e.status !== "started";
472
+ const r = e.status !== "started" || Ct(e);
473
473
  return /* @__PURE__ */ u(
474
474
  be,
475
475
  {
476
476
  text: e.topic,
477
- secondary: Ct(e, { base: "#94a3b8", current: "#fde68a", done: "#cbd5e1" }, ["running…", "run complete"]),
477
+ secondary: At(e, { base: "#94a3b8", current: "#fde68a", done: "#cbd5e1" }, ["running…", "run complete"]),
478
478
  color: e.color,
479
479
  size: 0.34,
480
480
  maxWidth: 10,
@@ -485,8 +485,8 @@ function Dt({ run: e }) {
485
485
  }
486
486
  );
487
487
  }
488
- const Yt = new o.Color("#fbbf24"), Zt = new o.Color("#ff2d3d"), Je = new o.Color(1, 1, 1), et = new o.OctahedronGeometry(0.8, 0), Qt = new o.EdgesGeometry(et);
489
- function Jt(e) {
488
+ const Zt = new o.Color("#fbbf24"), Qt = new o.Color("#ff2d3d"), Je = new o.Color(1, 1, 1), et = new o.OctahedronGeometry(0.8, 0), Jt = new o.EdgesGeometry(et);
489
+ function eo(e) {
490
490
  const r = (t, n, s) => ({ geo: t, edges: new o.EdgesGeometry(t, 25), pos: n, rot: s });
491
491
  switch (e) {
492
492
  case "db":
@@ -509,11 +509,11 @@ function Jt(e) {
509
509
  return [r(new o.CapsuleGeometry(0.2, 0.75, 6, 16), void 0, [0, 0, Math.PI / 2])];
510
510
  }
511
511
  }
512
- function eo({ mcp: e, backend: r }) {
513
- const t = e.srv, n = r.res, s = P(() => Jt(n.kind), [n.kind]), a = P(() => new o.Color(t.color).lerp(Je, 0.35), [t.color]), i = P(
512
+ function to({ mcp: e, backend: r }) {
513
+ const t = e.srv, n = r.res, s = V(() => eo(n.kind), [n.kind]), a = V(() => new o.Color(t.color).lerp(Je, 0.35), [t.color]), i = V(
514
514
  () => ({ edge: Qe(t.color, 0.035, 1), arrow: se(a), fill: se(a), line: new o.LineBasicMaterial({ color: a, transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), halo: le(a) }),
515
515
  [t.color, a]
516
- ), p = z(null), h = z(null), m = z(null), M = z(null), S = P(() => new o.Color(t.color), [t.color]), F = z(null), C = z("");
516
+ ), p = z(null), h = z(null), m = z(null), M = z(null), S = V(() => new o.Color(t.color), [t.color]), F = z(null), C = z("");
517
517
  return re(({ clock: g }) => {
518
518
  var j, N;
519
519
  const c = i.edge.uniforms;
@@ -532,14 +532,14 @@ function eo({ mcp: e, backend: r }) {
532
532
  f.uTime.value = fe ? 0 : g.elapsedTime;
533
533
  let T = null;
534
534
  for (const w of L.mcpCalls) w.server === t.name && w.resource === n.name && (!T || w.start > T.start) && (T = w);
535
- const W = T && T.phase === "result" ? (A - T.start) / T.dur : 9, I = W < 1, V = M.current;
535
+ const W = T && T.phase === "result" ? (A - T.start) / T.dur : 9, I = W < 1, P = M.current;
536
536
  if (I) {
537
537
  const w = Me(W);
538
- f.uRadius.value = 0.06, f.uOpacity.value = 0.9 * (1 - W * 0.6), f.uFlow.value = 0, f.uHead.value = 1 - w, f.uTail.value = 0.2, f.uHeadColor.value.copy(a).multiplyScalar(3), V && (V.visible = !0, He(V, f.uP0.value, f.uP1.value, f.uP2.value, 0.12, -1, 0.55), i.arrow.color.copy(a).multiplyScalar(2 * (1 - W * 0.7)));
539
- } else y ? (f.uRadius.value = 0.03, f.uOpacity.value = 0.45, f.uFlow.value = 1, f.uHead.value = -1, V && (V.visible = !0, He(V, f.uP0.value, f.uP1.value, f.uP2.value, 0.84, 1, 0.42), i.arrow.color.copy(S).multiplyScalar(1.1))) : (f.uRadius.value = 0.03, f.uOpacity.value = 0.15 + B * 0.4, f.uFlow.value = 0, f.uHead.value = -1, V && (V.visible = !1));
538
+ f.uRadius.value = 0.06, f.uOpacity.value = 0.9 * (1 - W * 0.6), f.uFlow.value = 0, f.uHead.value = 1 - w, f.uTail.value = 0.2, f.uHeadColor.value.copy(a).multiplyScalar(3), P && (P.visible = !0, He(P, f.uP0.value, f.uP1.value, f.uP2.value, 0.12, -1, 0.55), i.arrow.color.copy(a).multiplyScalar(2 * (1 - W * 0.7)));
539
+ } else y ? (f.uRadius.value = 0.03, f.uOpacity.value = 0.45, f.uFlow.value = 1, f.uHead.value = -1, P && (P.visible = !0, He(P, f.uP0.value, f.uP1.value, f.uP2.value, 0.84, 1, 0.42), i.arrow.color.copy(S).multiplyScalar(1.1))) : (f.uRadius.value = 0.03, f.uOpacity.value = 0.15 + B * 0.4, f.uFlow.value = 0, f.uHead.value = -1, P && (P.visible = !1));
540
540
  }), /* @__PURE__ */ Y(de, { children: [
541
541
  /* @__PURE__ */ u("mesh", { geometry: Ze, material: i.edge, frustumCulled: !1 }),
542
- /* @__PURE__ */ u("mesh", { ref: M, geometry: Ke, material: i.arrow, visible: !1 }),
542
+ /* @__PURE__ */ u("mesh", { ref: M, geometry: Ie, material: i.arrow, visible: !1 }),
543
543
  /* @__PURE__ */ Y("group", { ref: p, children: [
544
544
  /* @__PURE__ */ u("sprite", { ref: m, material: i.halo }),
545
545
  /* @__PURE__ */ u("group", { ref: h, children: s.map((g, c) => /* @__PURE__ */ Y("group", { position: g.pos, rotation: g.rot, children: [
@@ -550,8 +550,8 @@ function eo({ mcp: e, backend: r }) {
550
550
  ] })
551
551
  ] });
552
552
  }
553
- function to({ mcp: e }) {
554
- const r = e.srv, t = P(() => new o.Color(r.color), [r.color]), n = P(
553
+ function oo({ mcp: e }) {
554
+ const r = e.srv, t = V(() => new o.Color(r.color), [r.color]), n = V(
555
555
  () => ({ fill: se(t), line: new o.LineBasicMaterial({ color: t, transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), halo: le(t), core: se("#fff") }),
556
556
  [t]
557
557
  ), s = z(null), a = z(null), i = z(null);
@@ -564,14 +564,14 @@ function to({ mcp: e }) {
564
564
  /* @__PURE__ */ u("sprite", { ref: i, material: n.halo }),
565
565
  /* @__PURE__ */ Y("group", { ref: a, children: [
566
566
  /* @__PURE__ */ u("mesh", { geometry: et, material: n.fill }),
567
- /* @__PURE__ */ u("lineSegments", { geometry: Qt, material: n.line }),
567
+ /* @__PURE__ */ u("lineSegments", { geometry: Jt, material: n.line }),
568
568
  /* @__PURE__ */ u("mesh", { geometry: Ge, material: n.core, scale: 0.18 })
569
569
  ] }),
570
570
  /* @__PURE__ */ u(be, { position: [0, 1.35, 0], text: `MCP · ${r.name}`, color: r.color, size: 0.28, pxRange: [9, 13] })
571
571
  ] });
572
572
  }
573
- function oo({ call: e }) {
574
- const r = L.mcpServers.get(e.server), t = P(() => new o.Color((r == null ? void 0 : r.color) ?? "#fff"), [r]), n = P(() => le(t.clone().multiplyScalar(1.8).addScalar(0.3)), [t]), s = z(null), a = P(() => ({ a: new o.Vector3(), b: new o.Vector3(), c: new o.Vector3(), h: new o.Vector3() }), []);
573
+ function no({ call: e }) {
574
+ const r = L.mcpServers.get(e.server), t = V(() => new o.Color((r == null ? void 0 : r.color) ?? "#fff"), [r]), n = V(() => le(t.clone().multiplyScalar(1.8).addScalar(0.3)), [t]), s = z(null), a = V(() => ({ a: new o.Vector3(), b: new o.Vector3(), c: new o.Vector3(), h: new o.Vector3() }), []);
575
575
  return re(() => {
576
576
  const i = ge(e.instance), p = Ye(e.server);
577
577
  if (!s.current) return;
@@ -584,46 +584,46 @@ function oo({ call: e }) {
584
584
  ne(a.a, a.c, a.b, e.phase === "call" ? m : 1 - m, a.h), s.current.visible = h < 1, s.current.position.copy(a.h), s.current.scale.setScalar(1);
585
585
  }), /* @__PURE__ */ u("sprite", { ref: s, material: n, visible: !1 });
586
586
  }
587
- const Ve = 24, he = 40, we = 3;
588
- function no() {
589
- const e = P(() => {
587
+ const Pe = 24, he = 40, we = 3;
588
+ function ro() {
589
+ const e = V(() => {
590
590
  const s = new o.BufferGeometry();
591
- return s.setAttribute("position", new o.BufferAttribute(new Float32Array(Ve * we * he * 2 * 3), 3)), s.setAttribute("color", new o.BufferAttribute(new Float32Array(Ve * we * he * 2 * 3), 3)), s.boundingSphere = new o.Sphere(new o.Vector3(), 1e4), s;
592
- }, []), r = P(() => new o.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), []), t = P(() => new ze(Ve), []), n = P(() => ({ a: new o.Vector3(), b: new o.Vector3(), c: new o.Vector3(), p: new o.Vector3(), col: new o.Color(), k: new o.Color() }), []);
591
+ return s.setAttribute("position", new o.BufferAttribute(new Float32Array(Pe * we * he * 2 * 3), 3)), s.setAttribute("color", new o.BufferAttribute(new Float32Array(Pe * we * he * 2 * 3), 3)), s.boundingSphere = new o.Sphere(new o.Vector3(), 1e4), s;
592
+ }, []), r = V(() => new o.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), []), t = V(() => new ze(Pe), []), n = V(() => ({ a: new o.Vector3(), b: new o.Vector3(), c: new o.Vector3(), p: new o.Vector3(), col: new o.Color(), k: new o.Color() }), []);
593
593
  return re(({ clock: s }) => {
594
594
  const a = performance.now(), i = fe ? 0 : s.elapsedTime, p = e.getAttribute("position"), h = e.getAttribute("color");
595
595
  let m = 0;
596
596
  t.begin();
597
597
  const M = (S, F, C, g) => {
598
- if (m >= Ve) return;
598
+ if (m >= Pe) return;
599
599
  const c = ge(S), A = L.mcpServers.get(F), y = Ye(F);
600
600
  if (!c || !A || !y) return;
601
601
  const { a: B, b: x, c: _, p: k, col: G, k: f } = n;
602
602
  B.copy(c), x.copy(y), Oe(B, x, 1, _), G.set(A.color);
603
603
  let T;
604
- C === 0 ? (G.lerp(Yt, ee(g / 1.2)), g > 1.2 && G.lerp(Zt, ee((g - 1.2) / 1)), T = (0.22 + Math.min(0.6, g * 0.25)) * Ie(g / 0.3)) : (f.copy(G).lerp(Je, 0.35), T = 1.3 * (g < 0.75 ? 1 : 1 - (g - 0.75) / 0.25));
604
+ C === 0 ? (G.lerp(Zt, ee(g / 1.2)), g > 1.2 && G.lerp(Qt, ee((g - 1.2) / 1)), T = (0.22 + Math.min(0.6, g * 0.25)) * ke(g / 0.3)) : (f.copy(G).lerp(Je, 0.35), T = 1.3 * (g < 0.75 ? 1 : 1 - (g - 0.75) / 0.25));
605
605
  const W = 1 - Me(g / 0.75), I = C === 0 ? 0.025 : 0.07;
606
- for (let V = 0; V < we; V++) {
607
- const j = (V - 1) * I;
606
+ for (let P = 0; P < we; P++) {
607
+ const j = (P - 1) * I;
608
608
  for (let N = 0; N < he; N++)
609
609
  for (let w = 0; w < 2; w++) {
610
610
  const $ = (N + w) / he;
611
611
  ne(B, _, x, $, k);
612
- const X = ((m * we + V) * he + N) * 2 + w;
612
+ const X = ((m * we + P) * he + N) * 2 + w;
613
613
  p.setXYZ(X, k.x + j, k.y - j, k.z + j * 0.5);
614
614
  let d;
615
615
  if (C === 0) {
616
616
  const O = Math.pow(Math.max(0, Math.sin($ * 20 - i * 2.2)), 8);
617
- d = T * (0.3 + O * 1.5) * (V === 1 ? 1 : 0.25);
617
+ d = T * (0.3 + O * 1.5) * (P === 1 ? 1 : 0.25);
618
618
  } else
619
- d = T * (0.3 + Math.exp(-((($ - W) / 0.07) ** 2)) * 3.2 * (g < 0.8 ? 1 : 0)) * (V === 1 ? 1 : 0.65);
619
+ d = T * (0.3 + Math.exp(-((($ - W) / 0.07) ** 2)) * 3.2 * (g < 0.8 ? 1 : 0)) * (P === 1 ? 1 : 0.65);
620
620
  const b = C === 0 ? G : f;
621
621
  h.setXYZ(X, b.r * d, b.g * d, b.b * d);
622
622
  }
623
623
  }
624
624
  C === 0 ? t.add(B, _, x, 0.92, 1, 0.48, G, 0.4 + T * 1.4) : t.add(B, _, x, 0.08, -1, 0.66, f, T * 1.6), m++;
625
625
  };
626
- for (const S of L.mcpPending.values()) M(S.instance, S.server, 0, At(S, a));
626
+ for (const S of L.mcpPending.values()) M(S.instance, S.server, 0, xt(S, a));
627
627
  for (const S of L.mcpCalls) S.phase === "result" && M(S.instance, S.server, 1, ee((a - S.start) / S.dur));
628
628
  e.setDrawRange(0, m * we * he * 2), p.needsUpdate = !0, h.needsUpdate = !0, t.end();
629
629
  }), /* @__PURE__ */ Y(de, { children: [
@@ -631,19 +631,19 @@ function no() {
631
631
  /* @__PURE__ */ u("primitive", { object: t.mesh })
632
632
  ] });
633
633
  }
634
- function ro() {
634
+ function ao() {
635
635
  const [e, r] = $e([]), t = z({ n: -1, first: -1, last: -1 });
636
636
  return re(() => {
637
637
  const n = t.current, s = L.mcpCalls, a = s.length ? s[0].id : -1, i = s.length ? s[s.length - 1].id : -1;
638
638
  (s.length !== n.n || a !== n.first || i !== n.last) && (n.n = s.length, n.first = a, n.last = i, r(s.slice()));
639
639
  }), /* @__PURE__ */ Y(de, { children: [
640
- e.map((n) => /* @__PURE__ */ u(oo, { call: n }, n.id)),
641
- /* @__PURE__ */ u(no, {})
640
+ e.map((n) => /* @__PURE__ */ u(no, { call: n }, n.id)),
641
+ /* @__PURE__ */ u(ro, {})
642
642
  ] });
643
643
  }
644
- function fo() {
644
+ function mo() {
645
645
  return /* @__PURE__ */ Y(
646
- xt,
646
+ Rt,
647
647
  {
648
648
  title: "neural · living brain",
649
649
  subtitle: "Agents are neurons (spiky = thinking, smooth = waiting, amber ring = waiting on MCP) · ⬢ MCP servers wire to their backends · graph memory lights up on reads/writes",
@@ -655,23 +655,23 @@ function fo() {
655
655
  agentRadius: 1.25,
656
656
  graph: { natural: oe * 1.08, radius: 2.1 },
657
657
  Background: /* @__PURE__ */ u(at, { radius: 80, depth: 40, count: fe ? 1200 : 3500, factor: 2.6, saturation: 0.6, fade: !0, speed: 0.4 }),
658
- Agent: _t,
659
- RunMarker: Xt,
660
- McpServer: to,
661
- Backend: eo,
662
- GraphResource: $t,
658
+ Agent: kt,
659
+ RunMarker: Dt,
660
+ McpServer: oo,
661
+ Backend: to,
662
+ GraphResource: Xt,
663
663
  cluster: { radius: 1.45, variant: "orb" },
664
664
  PostFX: /* @__PURE__ */ Y(st, { multisampling: 0, children: [
665
665
  /* @__PURE__ */ u(it, { mipmapBlur: !0, intensity: 1.1, luminanceThreshold: 0.2, luminanceSmoothing: 0.3, radius: 0.75 }),
666
666
  /* @__PURE__ */ u(ct, { eskil: !1, offset: 0.22, darkness: 0.9 })
667
667
  ] }),
668
668
  children: [
669
- /* @__PURE__ */ u(Kt, {}),
670
- /* @__PURE__ */ u(ro, {})
669
+ /* @__PURE__ */ u(Ut, {}),
670
+ /* @__PURE__ */ u(ao, {})
671
671
  ]
672
672
  }
673
673
  );
674
674
  }
675
675
  export {
676
- fo as default
676
+ mo as default
677
677
  };
@@ -23,11 +23,11 @@ const L = ["neural", "constellation", "orbit", "atom", "flow"], T = {
23
23
  constellation: { name: "Constellation", tagline: "A night sky: agents are stars linked into constellations as they delegate." },
24
24
  atom: { name: "Atom", tagline: "An atom: agents are electrons in shells, subagents jump orbits, LLM calls flash photons." }
25
25
  }, M = {
26
- orbit: () => import("./index-CqpUvfPA.js"),
27
- neural: () => import("./index-C8H7LPMJ.js"),
28
- flow: () => import("./index-TlqkewVz.js"),
29
- constellation: () => import("./index-CXqvoWvI.js"),
30
- atom: () => import("./index-CDuUwfpS.js")
26
+ orbit: () => import("./index-D-egBmZU.js"),
27
+ neural: () => import("./index-DZvO9oiI.js"),
28
+ flow: () => import("./index-B2VQ34Za.js"),
29
+ constellation: () => import("./index-CpXj5lT0.js"),
30
+ atom: () => import("./index-CHJsMIrM.js")
31
31
  }, g = /* @__PURE__ */ new Map();
32
32
  function x(e) {
33
33
  let n = g.get(e);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import "./style.css";
3
- import { A as E, T as s, a as T } from "./chunks/index-Bp54n3io.js";
3
+ import { A as E, T as s, a as T } from "./chunks/index-OgLlwjoE.js";
4
4
  export {
5
5
  E as AgentScene,
6
6
  s as THEMES,