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.
@@ -4,11 +4,11 @@ var L = (e, n, r) => at(e, typeof n != "symbol" ? n + "" : n, r);
4
4
  import { jsxs as q, Fragment as de, jsx as g } from "react/jsx-runtime";
5
5
  import { EffectComposer as it, Bloom as ct, Vignette as lt } from "@react-three/postprocessing";
6
6
  import * as t from "three";
7
- import { T as We, h as X, K as ft, o as je, w as N, a as ce, x as ut, C as dt, L as ye, G as pt, t as ht, m as tt, c as qe, d as mt, D as Ye, R as vt, u as gt, v as bt, e as wt, s as yt, f as Ve, n as St } from "./KitScene-C_6JIRsN.js";
7
+ import { T as We, h as X, K as ft, o as je, w as N, a as ce, y as ut, D as dt, L as ye, G as pt, t as ht, m as tt, c as qe, d as mt, E as Ye, R as vt, u as gt, v as bt, x as wt, e as yt, s as St, f as Ve, n as Mt } from "./KitScene-DbBTTc3H.js";
8
8
  import { useThree as Re, useFrame as se } from "@react-three/fiber";
9
- import { useMemo as P, useRef as T, useEffect as Mt } from "react";
9
+ import { useMemo as P, useRef as T, useEffect as xt } from "react";
10
10
  var et;
11
- const Q = typeof window < "u" && !!((et = window.matchMedia) != null && et.call(window, "(prefers-reduced-motion: reduce)").matches), Z = (e) => e < 0 ? 0 : e > 1 ? 1 : e, we = (e) => 1 - Math.pow(1 - Z(e), 3), Ae = (e) => (e = Z(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2), K = new t.Color(1, 1, 1), Ce = new t.Color("#cfe0ff"), ke = new t.Color("#fbbf24"), xt = new t.Color("#ff3b4e"), Oe = Object.fromEntries(Object.entries(We).map(([e, n]) => [e, new t.Color(n).lerp(Ce, 0.45)]));
11
+ const Q = typeof window < "u" && !!((et = window.matchMedia) != null && et.call(window, "(prefers-reduced-motion: reduce)").matches), Z = (e) => e < 0 ? 0 : e > 1 ? 1 : e, we = (e) => 1 - Math.pow(1 - Z(e), 3), Ae = (e) => (e = Z(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2), K = new t.Color(1, 1, 1), Ce = new t.Color("#cfe0ff"), ke = new t.Color("#fbbf24"), At = new t.Color("#ff3b4e"), Oe = Object.fromEntries(Object.entries(We).map(([e, n]) => [e, new t.Color(n).lerp(Ce, 0.45)]));
12
12
  Object.fromEntries(Object.entries(We).map(([e, n]) => [e, new t.Color(n)]));
13
13
  function Ke(e, n) {
14
14
  const r = document.createElement("canvas");
@@ -16,16 +16,16 @@ function Ke(e, n) {
16
16
  const o = new t.CanvasTexture(r);
17
17
  return o.colorSpace = t.SRGBColorSpace, o;
18
18
  }
19
- let At = null;
19
+ let Ct = null;
20
20
  function Pe() {
21
- return At ?? (At = Ke(128, (e, n) => {
21
+ return Ct ?? (Ct = Ke(128, (e, n) => {
22
22
  const r = e.createRadialGradient(n / 2, n / 2, 0, n / 2, n / 2, n / 2);
23
23
  r.addColorStop(0, "rgba(255,255,255,1)"), r.addColorStop(0.12, "rgba(255,255,255,0.65)"), r.addColorStop(0.4, "rgba(255,255,255,0.13)"), r.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = r, e.fillRect(0, 0, n, n);
24
24
  }));
25
25
  }
26
- let Ct = null;
27
- function Pt() {
28
- return Ct ?? (Ct = Ke(256, (e, n) => {
26
+ let Pt = null;
27
+ function zt() {
28
+ return Pt ?? (Pt = Ke(256, (e, n) => {
29
29
  const r = n / 2, o = (h, p, y, A) => {
30
30
  e.save(), e.translate(r, r), e.rotate(h);
31
31
  const z = e.createLinearGradient(-p, 0, p, 0);
@@ -36,9 +36,9 @@ function Pt() {
36
36
  c.addColorStop(0, "rgba(255,255,255,1)"), c.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = c, e.fillRect(0, 0, n, n);
37
37
  }));
38
38
  }
39
- let zt = null;
39
+ let Rt = null;
40
40
  function ot() {
41
- return zt ?? (zt = Ke(256, (e, n) => {
41
+ return Rt ?? (Rt = Ke(256, (e, n) => {
42
42
  const r = n / 2, o = e.createRadialGradient(r, r, r * 0.78, r, r, r * 0.98);
43
43
  o.addColorStop(0, "rgba(255,255,255,0)"), o.addColorStop(0.55, "rgba(255,255,255,0.9)"), o.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = o, e.fillRect(0, 0, n, n);
44
44
  }));
@@ -46,7 +46,7 @@ function ot() {
46
46
  function le(e, n = "#fff") {
47
47
  return new t.SpriteMaterial({ map: e, color: n, blending: t.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
48
48
  }
49
- const nt = () => new t.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), Xe = new t.SphereGeometry(1, 32, 24), Rt = new t.ConeGeometry(1, 1, 3).translate(0, 0.5, 0), $e = new t.TorusGeometry(1, 0.012, 6, 96);
49
+ const nt = () => new t.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), Xe = new t.SphereGeometry(1, 32, 24), Bt = new t.ConeGeometry(1, 1, 3).translate(0, 0.5, 0), $e = new t.TorusGeometry(1, 0.012, 6, 96);
50
50
  function fe(e, n, r, o, c) {
51
51
  const h = 1 - o;
52
52
  return c.set(h * h * e.x + 2 * h * o * n.x + o * o * r.x, h * h * e.y + 2 * h * o * n.y + o * o * r.y, h * h * e.z + 2 * h * o * n.z + o * o * r.z);
@@ -63,7 +63,7 @@ const Ge = class Ge {
63
63
  L(this, "o", new t.Object3D());
64
64
  L(this, "a", new t.Vector3());
65
65
  L(this, "b", new t.Vector3());
66
- this.max = n, this.colors = new Float32Array(n * 3), this.mesh = new t.InstancedMesh(Rt, new t.MeshBasicMaterial({ blending: t.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 }), n), this.mesh.instanceColor = new t.InstancedBufferAttribute(this.colors, 3), this.mesh.frustumCulled = !1, this.mesh.count = 0;
66
+ this.max = n, this.colors = new Float32Array(n * 3), this.mesh = new t.InstancedMesh(Bt, new t.MeshBasicMaterial({ blending: t.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 }), n), this.mesh.instanceColor = new t.InstancedBufferAttribute(this.colors, 3), this.mesh.frustumCulled = !1, this.mesh.count = 0;
67
67
  }
68
68
  begin() {
69
69
  this.n = 0;
@@ -114,12 +114,12 @@ class De {
114
114
  this.geo.setDrawRange(0, this.n * this.seg * 2), this.P.needsUpdate = !0, this.C.needsUpdate = !0;
115
115
  }
116
116
  }
117
- const _e = 15, Be = 7.5, Bt = (
117
+ const _e = 15, Be = 7.5, Tt = (
118
118
  /* glsl */
119
119
  `
120
120
  attribute float aSize; attribute vec3 aColor; uniform float uScale; varying vec3 vC;
121
121
  void main(){ vec4 mv = modelViewMatrix * vec4(position, 1.0); vC = aColor; gl_PointSize = aSize * uScale / -mv.z; gl_Position = projectionMatrix * mv; }`
122
- ), Tt = (
122
+ ), Vt = (
123
123
  /* glsl */
124
124
  `
125
125
  varying vec3 vC;
@@ -130,7 +130,7 @@ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
130
130
  class Fe {
131
131
  constructor(n) {
132
132
  L(this, "geo", new t.BufferGeometry());
133
- L(this, "mat", new t.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: Bt, fragmentShader: Tt, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending }));
133
+ L(this, "mat", new t.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: Tt, fragmentShader: Vt, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending }));
134
134
  L(this, "obj");
135
135
  L(this, "P");
136
136
  L(this, "S");
@@ -151,10 +151,10 @@ class Fe {
151
151
  this.geo.setDrawRange(0, this.n), this.P.needsUpdate = !0, this.S.needsUpdate = !0, this.C.needsUpdate = !0;
152
152
  }
153
153
  }
154
- const Vt = 260, Ee = 40, Ie = 8, Te = 4, _t = new t.Color("#9db4ff"), jt = (
154
+ const _t = 260, Ee = 40, Ie = 8, Te = 4, jt = new t.Color("#9db4ff"), Ot = (
155
155
  /* glsl */
156
156
  "varying vec2 vUv; void main(){ vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }"
157
- ), Ot = (
157
+ ), Gt = (
158
158
  /* glsl */
159
159
  `
160
160
  uniform float uTime; uniform float uAct; varying vec2 vUv;
@@ -184,12 +184,12 @@ void main(){
184
184
  vec3 c = col * dens * (2.0 + uAct * 0.9) + vec3(0.55, 0.6, 0.95) * core * 0.5;
185
185
  gl_FragColor = vec4(c, 1.0);
186
186
  }`
187
- ), Gt = (
187
+ ), Ft = (
188
188
  /* glsl */
189
189
  `
190
190
  attribute float aSize; attribute vec3 aColor; uniform float uScale; varying vec3 vC;
191
191
  void main(){ vec4 mv = modelViewMatrix * vec4(position, 1.0); vC = aColor; gl_PointSize = aSize * uScale / -mv.z; gl_Position = projectionMatrix * mv; }`
192
- ), Ft = (
192
+ ), Et = (
193
193
  /* glsl */
194
194
  `
195
195
  varying vec3 vC;
@@ -197,8 +197,8 @@ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
197
197
  float core = smoothstep(0.4, 0.0, r); float halo = pow(1.0 - r, 2.4);
198
198
  gl_FragColor = vec4(vC * (core * 1.25 + halo * 0.4), 1.0); }`
199
199
  );
200
- function Et({ galaxy: e }) {
201
- const n = P(() => ({ nodes: e.nodes.slice(0, Vt), links: e.links }), [e]), r = n.nodes.length, { size: o, gl: c, camera: h } = Re(), p = T([]), y = T([]), A = T(Array(Te).fill("")), z = T([]), M = P(() => {
200
+ function It({ galaxy: e }) {
201
+ const n = P(() => ({ nodes: e.nodes.slice(0, _t), links: e.links }), [e]), r = n.nodes.length, { size: o, gl: c, camera: h } = Re(), p = T([]), y = T([]), A = T(Array(Te).fill("")), z = T([]), M = P(() => {
202
202
  const s = new Float32Array(r * 3), f = -0.18, m = Math.cos(f), w = Math.sin(f);
203
203
  n.nodes.forEach((R, j) => {
204
204
  const I = X(R.id, 1);
@@ -212,7 +212,7 @@ function Et({ galaxy: e }) {
212
212
  }
213
213
  s.set([H * m - O * w, H * w + O * m, (X(R.id, 4) - 0.5) * 4], j * 3);
214
214
  });
215
- const B = n.nodes.map((R) => new t.Color(ft[R.kind] ?? "#94a3b8").lerp(_t, 0.45).multiplyScalar(1)), U = n.nodes.map((R) => 0.42 + Math.pow(X(R.id, 5), 4) * 0.55), V = new t.BufferGeometry();
215
+ const B = n.nodes.map((R) => new t.Color(ft[R.kind] ?? "#94a3b8").lerp(jt, 0.45).multiplyScalar(1)), U = n.nodes.map((R) => 0.42 + Math.pow(X(R.id, 5), 4) * 0.55), V = new t.BufferGeometry();
216
216
  V.setAttribute("position", new t.BufferAttribute(s, 3)), V.setAttribute("aSize", new t.BufferAttribute(new Float32Array(r), 1)), V.setAttribute("aColor", new t.BufferAttribute(new Float32Array(r * 3), 3));
217
217
  const k = new Map(n.nodes.map((R, j) => [R.id, j])), E = [], F = new t.Vector3(), G = new t.Vector3();
218
218
  for (const R of n.links) {
@@ -225,8 +225,8 @@ function Et({ galaxy: e }) {
225
225
  return D.setAttribute("position", new t.BufferAttribute(_, 3)), D.setAttribute("color", new t.BufferAttribute(new Float32Array(E.length * 3), 3)), { pos: s, base: B, baseSize: U, ngeo: V, lgeo: D, owner: Int32Array.from(E), fire: new Float32Array(r), white: new Float32Array(r), fireC: Array.from({ length: r }, () => new t.Color()), phase: n.nodes.map((R) => X(R.id, 6) * 6.283) };
226
226
  }, [n, r]), b = P(
227
227
  () => ({
228
- gas: new t.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uAct: { value: 0 } }, vertexShader: jt, fragmentShader: Ot, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending }),
229
- nodes: new t.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: Gt, fragmentShader: Ft, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending }),
228
+ gas: new t.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uAct: { value: 0 } }, vertexShader: Ot, fragmentShader: Gt, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending }),
229
+ nodes: new t.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: Ft, fragmentShader: Et, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending }),
230
230
  fil: new t.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
231
231
  ripples: Array.from({ length: Ie }, () => le(ot(), "#000"))
232
232
  }),
@@ -309,7 +309,7 @@ function Et({ galaxy: e }) {
309
309
  /* @__PURE__ */ g(pt, { position: [0, Be * 1.15, 0], suffix: " · nebula", color: "#8b9cff", letterSpacing: 0.04, size: 0.28, opacity: 0.85, pxRange: [8, 12] })
310
310
  ] });
311
311
  }
312
- const It = (
312
+ const Lt = (
313
313
  /* glsl */
314
314
  `
315
315
  varying vec3 vN; varying vec3 vV; varying vec3 vObj;
@@ -317,7 +317,7 @@ void main(){
317
317
  vec4 wp = modelMatrix * vec4(position, 1.0);
318
318
  vN = normalize(mat3(modelMatrix) * normal); vV = normalize(cameraPosition - wp.xyz); vObj = position;
319
319
  gl_Position = projectionMatrix * viewMatrix * wp; }`
320
- ), Lt = (
320
+ ), Nt = (
321
321
  /* glsl */
322
322
  `
323
323
  uniform vec3 uCol; uniform vec3 uAtmo; uniform float uAct; uniform float uBands; uniform float uSeed; uniform float uGlow;
@@ -342,12 +342,12 @@ void main(){
342
342
  function rt(e, n, r, o) {
343
343
  return new t.ShaderMaterial({
344
344
  uniforms: { uCol: { value: e.clone() }, uAtmo: { value: n.clone() }, uAct: { value: 0 }, uBands: { value: r }, uSeed: { value: o }, uGlow: { value: 0 } },
345
- vertexShader: It,
346
- fragmentShader: Lt
345
+ vertexShader: Lt,
346
+ fragmentShader: Nt
347
347
  });
348
348
  }
349
- const Ze = new t.Color("#8792b5"), Le = 32, Nt = 0.42, Se = new t.Vector3();
350
- function kt({ mcp: e, backend: n }) {
349
+ const Ze = new t.Color("#8792b5"), Le = 32, kt = 0.42, Se = new t.Vector3();
350
+ function Ut({ mcp: e, backend: n }) {
351
351
  const r = e.srv, o = n.res, c = P(() => new t.Color(r.color), [r.color]), h = P(() => rt(Ze, new t.Color(r.color).lerp(K, 0.3), 0, X(o.name, 6)), [r.color, o.name]), p = P(() => le(Pe(), "#000"), []), y = P(() => new t.LineBasicMaterial({ color: "#000", transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), []), A = P(() => {
352
352
  const x = new t.BufferGeometry().setAttribute("position", new t.BufferAttribute(new Float32Array((Le + 1) * 3), 3));
353
353
  return x.boundingSphere = new t.Sphere(new t.Vector3(), 1e4), x;
@@ -358,7 +358,7 @@ function kt({ mcp: e, backend: n }) {
358
358
  (k = b.current) == null || k.position.copy(n.pos), u.current && !Q && (u.current.rotation.y = x.elapsedTime * 0.3 * M), Se.subVectors(n.pos, e.pos);
359
359
  const s = Math.hypot(Se.x, Se.y), f = Math.atan2(Se.y, Se.x), m = A.getAttribute("position");
360
360
  for (let F = 0; F <= Le; F++) {
361
- const G = f + (F / Le - 0.5) * 2 * Nt;
361
+ const G = f + (F / Le - 0.5) * 2 * kt;
362
362
  m.setXYZ(F, e.pos.x + Math.cos(G) * s, e.pos.y + Math.sin(G) * s, n.pos.z);
363
363
  }
364
364
  m.needsUpdate = !0;
@@ -382,7 +382,7 @@ function kt({ mcp: e, backend: n }) {
382
382
  ] })
383
383
  ] });
384
384
  }
385
- function Ut({ mcp: e }) {
385
+ function Wt({ mcp: e }) {
386
386
  const n = e.srv, r = P(() => new t.Color(n.color), [n.color]), o = P(() => X(n.name, 7), [n.name]), c = 0.72 + o * 0.28, h = X(n.name, 8) > 0.45, p = P(
387
387
  () => ({
388
388
  body: rt(r.clone().lerp(new t.Color("#8090c0"), 0.35).multiplyScalar(0.45), r.clone().lerp(K, 0.25).multiplyScalar(0.7), 1, o),
@@ -406,7 +406,7 @@ function Ut({ mcp: e }) {
406
406
  ] });
407
407
  }
408
408
  const Ne = 48;
409
- function Wt() {
409
+ function Kt() {
410
410
  const { size: e, gl: n, camera: r } = Re(), o = P(() => new De(Ne, 36), []), c = P(() => new ze(Ne), []), h = P(() => new Fe(Ne), []), p = P(() => ({ a: new t.Vector3(), b: new t.Vector3(), c: new t.Vector3(), h: new t.Vector3(), col: new t.Color() }), []);
411
411
  return se(({ clock: y }) => {
412
412
  const A = performance.now(), z = Q ? 0 : y.elapsedTime;
@@ -417,7 +417,7 @@ function Wt() {
417
417
  if (!i || !d || !x) continue;
418
418
  b.copy(x), M.copy(i), be(M, b, 1.5, 1.2, u);
419
419
  const s = mt(l, A);
420
- a.set(d.color).lerp(ke, Z(s / 1.2)), s > 1.2 && a.lerp(xt, Z((s - 1.2) / 1));
420
+ a.set(d.color).lerp(ke, Z(s / 1.2)), s > 1.2 && a.lerp(At, Z((s - 1.2) / 1));
421
421
  const f = (0.2 + Math.min(0.35, s * 0.15)) * we(s / 0.3), m = 0.06 + 0.86 * we(s / 0.45);
422
422
  if (o.add(M, u, b, a, f, 0.06, m, 0.9, 1, z, s < 0.45 ? m : -1, 1.2), s > 0.45 && c.add(M, u, b, 0.9, 1, 0.42, a, 0.6 + f), l.resource) {
423
423
  const w = Ye(l.server, l.resource);
@@ -449,7 +449,7 @@ function Wt() {
449
449
  /* @__PURE__ */ g("primitive", { object: h.obj })
450
450
  ] });
451
451
  }
452
- function Kt({ run: e }) {
452
+ function Xt({ run: e }) {
453
453
  const n = P(() => new t.Color(e.color), [e.color]), r = P(() => le(Pe(), "#000"), []), o = T(null), c = T(null);
454
454
  return se(({ clock: h }) => {
455
455
  var S;
@@ -459,17 +459,17 @@ function Kt({ run: e }) {
459
459
  o.current && (o.current.position.set(e.origin.x, e.origin.y, -3), o.current.scale.set(b * 2.8 + 6, u * 2.8 + 5, 1)), (S = c.current) == null || S.position.set(e.origin.x, e.origin.y + u + 0.7, 0);
460
460
  }), /* @__PURE__ */ q(de, { children: [
461
461
  /* @__PURE__ */ g("sprite", { ref: o, material: r }),
462
- /* @__PURE__ */ g("group", { ref: c, children: e.run && /* @__PURE__ */ g(Xt, { run: e.run }) })
462
+ /* @__PURE__ */ g("group", { ref: c, children: e.run && /* @__PURE__ */ g(Dt, { run: e.run }) })
463
463
  ] });
464
464
  }
465
- function Xt({ run: e }) {
465
+ function Dt({ run: e }) {
466
466
  gt();
467
- const n = e.status !== "started";
467
+ const n = e.status !== "started" || bt(e);
468
468
  return /* @__PURE__ */ g(
469
469
  ye,
470
470
  {
471
471
  text: e.topic,
472
- secondary: bt(e, { base: "#94a3c8", current: "#fde68a", done: "#cbd5e1" }, ["running…", "run complete"]),
472
+ secondary: wt(e, { base: "#94a3c8", current: "#fde68a", done: "#cbd5e1" }, ["running…", "run complete"]),
473
473
  color: e.color,
474
474
  textColor: "#e6ecff",
475
475
  plate: "none",
@@ -485,8 +485,8 @@ function Xt({ run: e }) {
485
485
  }
486
486
  );
487
487
  }
488
- const ve = 6, Me = 6, ge = 28, xe = 3, Dt = 2.2;
489
- function qt() {
488
+ const ve = 6, Me = 6, ge = 28, xe = 3, qt = 2.2;
489
+ function Yt() {
490
490
  const { size: e, gl: n, camera: r } = Re(), o = T(/* @__PURE__ */ new Set()), c = T([]), h = T([]), p = T([]), y = T([]), A = P(() => {
491
491
  const u = new t.BufferGeometry();
492
492
  return u.setAttribute("position", new t.BufferAttribute(new Float32Array(ve * xe * ge * 6), 3)), u.setAttribute("color", new t.BufferAttribute(new Float32Array(ve * xe * ge * 6), 3)), u.boundingSphere = new t.Sphere(new t.Vector3(), 1e4), u;
@@ -517,7 +517,7 @@ function qt() {
517
517
  }
518
518
  const w = (u - s.start) / 1e3;
519
519
  f && m && (m.position.copy(s.from).add(x.set(0, -2.3, 0)), y.current[d] !== s.run + s.start && (y.current[d] = s.run + s.start, f.setText(`final answer - ${s.text.length > 64 ? s.text.slice(0, 62) + "…" : s.text}`)), f.setOpacity(Z(w / 0.3) * Z((5.2 - w) / 1.2)));
520
- const B = w / Dt;
520
+ const B = w / qt;
521
521
  if (B >= 1.25) continue;
522
522
  const U = s.travel * (Q ? 0.6 : 1), V = U * we(Math.min(1, B)), k = Math.min(7.5, U * 0.4) * Math.min(1, B * 3) * (B > 1 ? Math.max(0, 1 - (B - 1) / 0.25) : 1), E = B > 1 ? Math.max(0, 1 - (B - 1) / 0.25) : 1, F = -s.dir.y, G = s.dir.x;
523
523
  for (let _ = 0; _ < xe; _++)
@@ -543,12 +543,12 @@ function qt() {
543
543
  Array.from({ length: ve }, (u, S) => /* @__PURE__ */ g("group", { ref: (a) => void (p.current[S] = a), children: /* @__PURE__ */ g(ye, { ref: (a) => void (h.current[S] = a), text: "", color: "#e0e7ff", size: 0.26, maxWidth: 11, opacity: 0, pxRange: [8, 12], renderOrder: 24 }) }, S))
544
544
  ] });
545
545
  }
546
- const Yt = (
546
+ const $t = (
547
547
  /* glsl */
548
548
  `
549
549
  varying vec3 vDir;
550
550
  void main(){ vDir = normalize(position); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`
551
- ), $t = (
551
+ ), Zt = (
552
552
  /* glsl */
553
553
  `
554
554
  varying vec3 vDir;
@@ -573,7 +573,7 @@ void main(){
573
573
  col += band * max(vec3(0.0), vec3(0.010, 0.012, 0.03) * (0.3 + dust * dust * 1.4) - vec3(0.006, 0.007, 0.014) * lanes);
574
574
  gl_FragColor = vec4(col, 1.0);
575
575
  }`
576
- ), Zt = (
576
+ ), Ht = (
577
577
  /* glsl */
578
578
  `
579
579
  attribute float aSize; attribute float aPhase; attribute vec3 aColor;
@@ -585,7 +585,7 @@ void main(){
585
585
  gl_PointSize = max(1.0, aSize * uScale / -mv.z);
586
586
  gl_Position = projectionMatrix * mv;
587
587
  }`
588
- ), Ht = (
588
+ ), Jt = (
589
589
  /* glsl */
590
590
  `
591
591
  varying vec3 vC;
@@ -593,7 +593,7 @@ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
593
593
  float core = smoothstep(0.5, 0.0, r); float halo = pow(1.0 - r, 3.0);
594
594
  gl_FragColor = vec4(vC * (core + halo * 0.35), 1.0); }`
595
595
  ), He = ["#ffffff", "#dbe7ff", "#b9cdff", "#9fb8ff", "#fff3dd", "#ffe2bf"].map((e) => new t.Color(e));
596
- function Jt() {
596
+ function Qt() {
597
597
  const { size: e, gl: n, camera: r } = Re(), o = P(() => {
598
598
  const p = Q ? 1600 : 3200, y = new Float32Array(p * 3), A = new Float32Array(p), z = new Float32Array(p), M = new Float32Array(p * 3), b = new t.Vector3(0.42, 0.9, -0.12).normalize(), u = new t.Vector3();
599
599
  let S = 1234567;
@@ -613,8 +613,8 @@ function Jt() {
613
613
  return l.setAttribute("position", new t.BufferAttribute(y, 3)), l.setAttribute("aSize", new t.BufferAttribute(A, 1)), l.setAttribute("aPhase", new t.BufferAttribute(z, 1)), l.setAttribute("aColor", new t.BufferAttribute(M, 3)), l;
614
614
  }, []), c = P(
615
615
  () => ({
616
- dome: new t.ShaderMaterial({ vertexShader: Yt, fragmentShader: $t, side: t.BackSide, depthWrite: !1 }),
617
- stars: new t.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uScale: { value: 400 } }, vertexShader: Zt, fragmentShader: Ht, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending })
616
+ dome: new t.ShaderMaterial({ vertexShader: $t, fragmentShader: Zt, side: t.BackSide, depthWrite: !1 }),
617
+ stars: new t.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uScale: { value: 400 } }, vertexShader: Ht, fragmentShader: Jt, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending })
618
618
  }),
619
619
  []
620
620
  ), h = T(null);
@@ -626,12 +626,12 @@ function Jt() {
626
626
  /* @__PURE__ */ g("points", { geometry: o, material: c.stars, frustumCulled: !1, renderOrder: -9 })
627
627
  ] });
628
628
  }
629
- const Qt = new t.Color("#6f7fb8"), eo = new t.Color("#ff6b7a"), Ue = 0.95, to = new t.MeshBasicMaterial({ colorWrite: !1, depthWrite: !1, transparent: !0, opacity: 0 });
630
- function oo({ agent: e, selected: n, onSelect: r }) {
629
+ const eo = new t.Color("#6f7fb8"), to = new t.Color("#ff6b7a"), Ue = 0.95, oo = new t.MeshBasicMaterial({ colorWrite: !1, depthWrite: !1, transparent: !0, opacity: 0 });
630
+ function no({ agent: e, selected: n, onSelect: r }) {
631
631
  const o = e.inst, c = T(null), h = T(null), p = T(null), y = T(null), A = T(null), z = T(null), M = T(null), b = T(null), u = T(null), S = P(() => [...o.id].reduce((s, f) => (s * 31 + f.charCodeAt(0)) % 9973, 7) / 9973, [o.id]), a = Oe[o.type], l = P(
632
632
  () => ({
633
633
  halo: le(Pe(), a),
634
- spikes: le(Pt(), a),
634
+ spikes: le(zt(), a),
635
635
  core: le(Pe(), "#fff"),
636
636
  flare: le(ot(), a),
637
637
  corona: new t.MeshBasicMaterial({ color: ke, blending: t.AdditiveBlending, transparent: !0, depthWrite: !1, toneMapped: !1 }),
@@ -643,7 +643,7 @@ function oo({ agent: e, selected: n, onSelect: r }) {
643
643
  // eslint-disable-next-line react-hooks/exhaustive-deps
644
644
  []
645
645
  );
646
- Mt(() => {
646
+ xt(() => {
647
647
  l.spikes.rotation = (S - 0.5) * 0.5;
648
648
  }, [l, S]), se(({ clock: s }) => {
649
649
  var he, J;
@@ -653,11 +653,11 @@ function oo({ agent: e, selected: n, onSelect: r }) {
653
653
  c.current && (c.current.position.copy(e.live), c.current.scale.setScalar(Math.max(1e-4, B))), (he = b.current) == null || he.position.set(e.live.x, e.live.y - 0.95 * B - 0.35, e.live.z);
654
654
  const U = (f - o.bornAt) / 1e3, V = o.parent && N.instances.has(o.parent) ? Ue * 0.85 : 0.05, k = Z((U - V) / 0.55), E = we(k), F = k > 0 ? Math.exp(-(U - V) * 3.2) : 0, G = o.exitAt ? (f - o.exitAt) / 1e3 : -1, _ = G >= 0 ? Ae(G / 0.7) : 0, D = G >= 0 ? Z((G - 0.7) / 1.7) : 0, R = G < 0;
655
655
  o.llmCalls !== i.calls && (i.calls = o.llmCalls, i.flareAt = f, i.flareK = o.pulse);
656
- const j = (f - i.flareAt) / 1e3, I = wt(o, f);
656
+ const j = (f - i.flareAt) / 1e3, I = yt(o, f);
657
657
  let H = !1;
658
658
  for (const v of N.mcpPending.values()) v.instance === o.id && (H = !0);
659
659
  const O = R && (o.status === "thinking" || o.status === "spawning"), Y = Q ? 0 : 1, $ = 1 + (O ? 0.16 : 0.05) * Math.sin(m * 3.3 + S * 40) * Math.sin(m * 1.9 + S * 17) * Y, ae = (O ? 1 : 0.62) * $ + I * 0.25 + F * 1.2;
660
- i.c.copy(a), R || i.c.lerp(o.status === "failed" ? eo : Qt, _);
660
+ i.c.copy(a), R || i.c.lerp(o.status === "failed" ? to : eo, _);
661
661
  const te = (1 - _ * 0.8) * (1 - D), pe = E * (1 - _ * 0.62);
662
662
  if (y.current && (y.current.scale.setScalar(Math.max(1e-4, pe * (0.95 + I * 0.12))), l.core.color.copy(K).lerp(i.c, _).multiplyScalar(Math.min(1.6, ae) * te)), h.current && (h.current.scale.setScalar(Math.max(1e-4, pe * (O ? 3.4 : 2.7) * (1 + I * 0.18))), l.halo.color.copy(i.c).multiplyScalar(0.42 * ae * te)), p.current) {
663
663
  const v = j < 1.2 ? Math.exp(-j * 2.6) * i.flareK * 0.5 : 0, C = (O ? 1 : 0.55) * (1 - _);
@@ -675,14 +675,14 @@ function oo({ agent: e, selected: n, onSelect: r }) {
675
675
  const v = 0.75 + 0.25 * Math.sin(m * 2.4) * Y;
676
676
  z.current.scale.setScalar(0.95 + 0.06 * v), z.current.rotation.z = m * 0.6 * Y, l.corona.color.copy(ke).multiplyScalar(1.4 * i.coronaK * v);
677
677
  }
678
- i.selK += ((n ? 1 : 0) - i.selK) * 0.12, M.current && (M.current.visible = i.selK > 0.02, M.current.scale.setScalar(1.1 + (1 - i.selK) * 0.5), l.sel.color.setScalar(0.9 * i.selK * te)), (J = u.current) == null || J.setOpacity(yt(o.id) ? E * (R ? 0.95 : 0.6 * (1 - D)) : 0);
678
+ i.selK += ((n ? 1 : 0) - i.selK) * 0.12, M.current && (M.current.visible = i.selK > 0.02, M.current.scale.setScalar(1.1 + (1 - i.selK) * 0.5), l.sel.color.setScalar(0.9 * i.selK * te)), (J = u.current) == null || J.setOpacity(St(o.id) ? E * (R ? 0.95 : 0.6 * (1 - D)) : 0);
679
679
  });
680
680
  const x = (s) => {
681
681
  s.stopPropagation(), r(o.id);
682
682
  }, d = o.id.split(":")[2];
683
683
  return /* @__PURE__ */ q(de, { children: [
684
684
  /* @__PURE__ */ q("group", { ref: c, scale: 1e-4, children: [
685
- /* @__PURE__ */ g("mesh", { geometry: Xe, material: to, scale: 0.75, onClick: x, onPointerOver: () => document.body.style.cursor = "pointer", onPointerOut: () => document.body.style.cursor = "" }),
685
+ /* @__PURE__ */ g("mesh", { geometry: Xe, material: oo, scale: 0.75, onClick: x, onPointerOver: () => document.body.style.cursor = "pointer", onPointerOut: () => document.body.style.cursor = "" }),
686
686
  /* @__PURE__ */ g("sprite", { ref: h, material: l.halo, scale: 1e-4 }),
687
687
  /* @__PURE__ */ g("sprite", { ref: p, material: l.spikes, scale: 1e-4 }),
688
688
  /* @__PURE__ */ g("sprite", { ref: y, material: l.core, scale: 1e-4 }),
@@ -706,7 +706,7 @@ function oo({ agent: e, selected: n, onSelect: r }) {
706
706
  ] });
707
707
  }
708
708
  const Je = 96, Qe = 32;
709
- function no() {
709
+ function ro() {
710
710
  const { size: e, gl: n, camera: r } = Re(), o = P(() => new De(Je + Qe, 28), []), c = P(() => new ze(Je), []), h = P(() => new Fe(Qe), []), p = P(() => /* @__PURE__ */ new Map(), []), y = P(() => ({ ctrl: new t.Vector3(), h: new t.Vector3(), col: new t.Color(), a: new t.Vector3(), b: new t.Vector3() }), []);
711
711
  return se(({ clock: A }) => {
712
712
  const z = performance.now(), M = Q ? 0 : A.elapsedTime;
@@ -747,46 +747,46 @@ function no() {
747
747
  /* @__PURE__ */ g("primitive", { object: h.obj })
748
748
  ] });
749
749
  }
750
- const ro = {
750
+ const so = {
751
751
  minPolarAngle: Math.PI * 0.22,
752
752
  maxPolarAngle: Math.PI * 0.78,
753
753
  minAzimuthAngle: -Math.PI * 0.35,
754
754
  maxAzimuthAngle: Math.PI * 0.35
755
755
  };
756
- function uo() {
756
+ function po() {
757
757
  return /* @__PURE__ */ q(
758
- St,
758
+ Mt,
759
759
  {
760
760
  title: "constellation · night sky",
761
761
  subtitle: "Agents are stars (brighter = parent) · delegation draws constellation lines · stars flare on LLM calls · ◉ MCP planets with backend moons · the graph nebula lights on reads/writes · ✦ final answer = shooting star",
762
762
  preset: "radial",
763
763
  plane: "xy",
764
764
  camera: { position: [0, 0, 34], fov: 46, far: 1200 },
765
- controls: ro,
765
+ controls: so,
766
766
  bg: "#040618",
767
767
  gl: { antialias: !0 },
768
768
  fit: { nRef: 4, min: 0.62, max: 1.6, minRadius: 5.5 },
769
769
  agentRadius: 1.3,
770
770
  graph: { natural: _e * 1.1, radius: 3.6 },
771
- Background: /* @__PURE__ */ g(Jt, {}),
772
- Agent: oo,
773
- RunMarker: Kt,
774
- McpServer: Ut,
775
- Backend: kt,
776
- GraphResource: Et,
771
+ Background: /* @__PURE__ */ g(Qt, {}),
772
+ Agent: no,
773
+ RunMarker: Xt,
774
+ McpServer: Wt,
775
+ Backend: Ut,
776
+ GraphResource: It,
777
777
  cluster: { radius: 1.5, variant: "stars", glowGain: 0.9 },
778
778
  PostFX: /* @__PURE__ */ q(it, { multisampling: 0, children: [
779
779
  /* @__PURE__ */ g(ct, { mipmapBlur: !0, intensity: 0.95, luminanceThreshold: 0.22, luminanceSmoothing: 0.35, radius: 0.7 }),
780
780
  /* @__PURE__ */ g(lt, { eskil: !1, offset: 0.25, darkness: 0.75 })
781
781
  ] }),
782
782
  children: [
783
- /* @__PURE__ */ g(no, {}),
784
- /* @__PURE__ */ g(Wt, {}),
785
- /* @__PURE__ */ g(qt, {})
783
+ /* @__PURE__ */ g(ro, {}),
784
+ /* @__PURE__ */ g(Kt, {}),
785
+ /* @__PURE__ */ g(Yt, {})
786
786
  ]
787
787
  }
788
788
  );
789
789
  }
790
790
  export {
791
- uo as default
791
+ po as default
792
792
  };
@@ -4,7 +4,7 @@ import { EffectComposer as Ke, Bloom as Qe, Vignette as Je, Noise as et } from "
4
4
  import { useFrame as N } from "@react-three/fiber";
5
5
  import { useRef as A, useMemo as R, useEffect as tt, useState as De } from "react";
6
6
  import * as e from "three";
7
- import { h as oe, i as nt, T as le, f as ot, a as Z, p as rt, e as st, l as at, s as ct, L as ue, w as T, K as it, G as lt, m as Fe, b as Q, c as Re, d as ut, g as Me, S as ye, R as pt, j as ft, u as dt, k as mt, n as ht } from "./KitScene-C_6JIRsN.js";
7
+ import { h as oe, i as nt, T as le, f as ot, a as Z, p as rt, e as st, l as at, s as ct, L as ue, w as T, K as it, G as lt, m as Fe, b as Q, c as Re, d as ut, g as Me, S as ye, R as pt, j as ft, u as dt, k as mt, n as ht } from "./KitScene-DbBTTc3H.js";
8
8
  var Ye;
9
9
  const F = typeof window < "u" && !!((Ye = window.matchMedia) != null && Ye.call(window, "(prefers-reduced-motion: reduce)").matches), _e = Math.PI * 2, Ge = [Math.PI * 0.5, Math.PI * 0.5 + _e / 3, Math.PI * 0.5 + _e * 2 / 3], Ve = nt, yt = (t) => (oe(t, 11) - 0.5) * 2.4, V = {
10
10
  /** the galaxy's inner (tilted) group; its matrixWorld includes the kit's side placement + scale */