agentglow 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,936 @@
1
+ var vt = Object.defineProperty;
2
+ var wt = (e, t, r) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var G = (e, t, r) => wt(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import { jsx as m, jsxs as W, Fragment as oe } from "react/jsx-runtime";
5
+ import { OrbitControls as bt } from "@react-three/drei";
6
+ import { useThree as Te, useFrame as Z, Canvas as yt } from "@react-three/fiber";
7
+ import { EffectComposer as St, Bloom as Mt, Vignette as xt } from "@react-three/postprocessing";
8
+ import { useMemo as C, useRef as B, useState as Re, useEffect as qe } from "react";
9
+ import { T as et, l as he, j as ut, m as dt, w as T, h as _, d as tt, C as At, K as Ct, L as Se, G as zt, n as Pt, c as Tt, R as Rt, u as Bt, k as Vt, i as kt, r as _t, b as Et, e as Ot, s as jt, f as Ft, H as Gt, t as Lt, g as Nt } from "./ClusterBall-CPsd6JvJ.js";
10
+ import * as o from "three";
11
+ var ft;
12
+ const ee = typeof window < "u" && !!((ft = window.matchMedia) != null && ft.call(window, "(prefers-reduced-motion: reduce)").matches), Y = (e) => e < 0 ? 0 : e > 1 ? 1 : e, ye = (e) => 1 - Math.pow(1 - Y(e), 3), Ae = (e) => (e = Y(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2), X = new o.Color(1, 1, 1), Ce = new o.Color("#cfe0ff"), Ye = new o.Color("#fbbf24"), It = new o.Color("#ff3b4e"), je = Object.fromEntries(Object.entries(et).map(([e, t]) => [e, new o.Color(t).lerp(Ce, 0.45)]));
13
+ Object.fromEntries(Object.entries(et).map(([e, t]) => [e, new o.Color(t)]));
14
+ function ot(e, t) {
15
+ const r = document.createElement("canvas");
16
+ r.width = r.height = e, t(r.getContext("2d"), e);
17
+ const n = new o.CanvasTexture(r);
18
+ return n.colorSpace = o.SRGBColorSpace, n;
19
+ }
20
+ let Ut = null;
21
+ function ze() {
22
+ return Ut ?? (Ut = ot(128, (e, t) => {
23
+ const r = e.createRadialGradient(t / 2, t / 2, 0, t / 2, t / 2, t / 2);
24
+ 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, t, t);
25
+ }));
26
+ }
27
+ let Wt = null;
28
+ function Dt() {
29
+ return Wt ?? (Wt = ot(256, (e, t) => {
30
+ const r = t / 2, n = (i, h, g, M) => {
31
+ e.save(), e.translate(r, r), e.rotate(i);
32
+ const z = e.createLinearGradient(-h, 0, h, 0);
33
+ z.addColorStop(0, "rgba(255,255,255,0)"), z.addColorStop(0.5, `rgba(255,255,255,${M})`), z.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = z, e.beginPath(), e.moveTo(-h, 0), e.lineTo(0, -g), e.lineTo(h, 0), e.lineTo(0, g), e.closePath(), e.fill(), e.restore();
34
+ };
35
+ n(0, r, 2.4, 1), n(Math.PI / 2, r, 2.4, 1), n(Math.PI / 4, r * 0.45, 1.3, 0.35), n(-Math.PI / 4, r * 0.45, 1.3, 0.35);
36
+ const s = e.createRadialGradient(r, r, 0, r, r, r * 0.18);
37
+ s.addColorStop(0, "rgba(255,255,255,1)"), s.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = s, e.fillRect(0, 0, t, t);
38
+ }));
39
+ }
40
+ let Kt = null;
41
+ function pt() {
42
+ return Kt ?? (Kt = ot(256, (e, t) => {
43
+ const r = t / 2, n = e.createRadialGradient(r, r, r * 0.78, r, r, r * 0.98);
44
+ n.addColorStop(0, "rgba(255,255,255,0)"), n.addColorStop(0.55, "rgba(255,255,255,0.9)"), n.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = n, e.fillRect(0, 0, t, t);
45
+ }));
46
+ }
47
+ function ue(e, t = "#fff") {
48
+ return new o.SpriteMaterial({ map: e, color: t, blending: o.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
49
+ }
50
+ const ht = () => new o.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), nt = new o.SphereGeometry(1, 32, 24), Xt = new o.ConeGeometry(1, 1, 3).translate(0, 0.5, 0), at = new o.TorusGeometry(1, 0.012, 6, 96);
51
+ function de(e, t, r, n, s) {
52
+ const i = 1 - n;
53
+ return s.set(i * i * e.x + 2 * i * n * t.x + n * n * r.x, i * i * e.y + 2 * i * n * t.y + n * n * r.y, i * i * e.z + 2 * i * n * t.z + n * n * r.z);
54
+ }
55
+ function be(e, t, r, n, s) {
56
+ const i = t.x - e.x, h = t.y - e.y, g = Math.hypot(i, h) || 1;
57
+ return s.copy(e).add(t).multiplyScalar(0.5), s.x += -h / g * r, s.y += i / g * r, s.z += n, s;
58
+ }
59
+ const Ge = class Ge {
60
+ constructor(t) {
61
+ G(this, "mesh");
62
+ G(this, "colors");
63
+ G(this, "n", 0);
64
+ G(this, "o", new o.Object3D());
65
+ G(this, "a", new o.Vector3());
66
+ G(this, "b", new o.Vector3());
67
+ this.max = t, this.colors = new Float32Array(t * 3), this.mesh = new o.InstancedMesh(Xt, new o.MeshBasicMaterial({ blending: o.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 }), t), this.mesh.instanceColor = new o.InstancedBufferAttribute(this.colors, 3), this.mesh.frustumCulled = !1, this.mesh.count = 0;
68
+ }
69
+ begin() {
70
+ this.n = 0;
71
+ }
72
+ add(t, r, n, s, i, h, g, M) {
73
+ this.n >= this.max || M < 0.01 || (de(t, r, n, s, this.a), de(t, r, n, Y(s + 0.02 * i), this.b), this.b.sub(this.a), !(this.b.lengthSq() < 1e-9) && (this.o.position.copy(this.a), this.o.quaternion.setFromUnitVectors(Ge.UP, this.b.normalize()), this.o.scale.set(h * 0.32, h, h * 0.32), this.o.updateMatrix(), this.mesh.setMatrixAt(this.n, this.o.matrix), this.colors[this.n * 3] = g.r * M, this.colors[this.n * 3 + 1] = g.g * M, this.colors[this.n * 3 + 2] = g.b * M, this.n++));
74
+ }
75
+ end() {
76
+ this.mesh.count = this.n, this.mesh.instanceMatrix.needsUpdate = !0, this.mesh.instanceColor.needsUpdate = !0;
77
+ }
78
+ };
79
+ G(Ge, "UP", new o.Vector3(0, 1, 0));
80
+ let Pe = Ge;
81
+ class rt {
82
+ constructor(t, r = 32) {
83
+ G(this, "geo", new o.BufferGeometry());
84
+ G(this, "obj");
85
+ G(this, "P");
86
+ G(this, "C");
87
+ G(this, "n", 0);
88
+ G(this, "p", new o.Vector3());
89
+ this.max = t, this.seg = r, this.P = new o.BufferAttribute(new Float32Array(t * r * 6), 3), this.C = new o.BufferAttribute(new Float32Array(t * r * 6), 3), this.geo.setAttribute("position", this.P), this.geo.setAttribute("color", this.C), this.geo.boundingSphere = new o.Sphere(new o.Vector3(), 1e4), this.obj = new o.LineSegments(this.geo, ht()), this.obj.frustumCulled = !1;
90
+ }
91
+ begin() {
92
+ this.n = 0;
93
+ }
94
+ /**
95
+ * @param base steady brightness
96
+ * @param t0,t1 visible span of the curve (trim near stars, progressive drawing)
97
+ * @param dash flowing dash strength; dashDir +1 flows toward b
98
+ * @param head travelling bright head position (-1 = none); headK its strength
99
+ */
100
+ add(t, r, n, s, i, h, g, M, z, S, d, p) {
101
+ if (this.n >= this.max || g <= h) return;
102
+ const c = this.seg, l = this.P, v = this.C;
103
+ for (let b = 0; b < c; b++)
104
+ for (let w = 0; w < 2; w++) {
105
+ const u = h + (g - h) * (b + w) / c;
106
+ de(t, r, n, u, this.p);
107
+ const a = (this.n * c + b) * 2 + w;
108
+ l.setXYZ(a, this.p.x, this.p.y, this.p.z);
109
+ let f = i;
110
+ M > 0 && (f += M * Math.pow(Math.max(0, Math.sin((u * 9 - S * 0.9 * z) * Math.PI)), 8)), f *= 0.2 + 0.8 * Y(Math.min((u - h) / 0.06, (g - u) / 0.04)), d >= 0 && (f += p * Math.exp(-(((u - d) / 0.045) ** 2))), v.setXYZ(a, s.r * f, s.g * f, s.b * f);
111
+ }
112
+ this.n++;
113
+ }
114
+ end() {
115
+ this.geo.setDrawRange(0, this.n * this.seg * 2), this.P.needsUpdate = !0, this.C.needsUpdate = !0;
116
+ }
117
+ }
118
+ const Ne = [
119
+ [-13.5, 2],
120
+ [10.5, 2.6],
121
+ [-11.5, -4.8],
122
+ [10, -5.4],
123
+ [-3.5, 3.6],
124
+ [2.5, -6.8]
125
+ ];
126
+ function Ze(e, t, r) {
127
+ const n = Ne[e % Ne.length], s = Math.floor(e / Ne.length);
128
+ return r.set(n[0] + (_(t, 11) - 0.5) * 2.6, n[1] + (_(t, 12) - 0.5) * 1.8, -s * 4 + (_(t, 13) - 0.5) * 1.5);
129
+ }
130
+ function Fe(e, t) {
131
+ if (he.grouped) {
132
+ const n = ut(e);
133
+ return Ze(dt(e), e, t), t.y += Oe(n) * 4.6, t.z -= n * 1.2, t;
134
+ }
135
+ const r = T.runs.get(e);
136
+ return Ze(r ? r.slot : 0, e, t);
137
+ }
138
+ function $t(e) {
139
+ var t;
140
+ return he.grouped ? 1e3 + dt(e) * 64 + ut(e) : ((t = T.runs.get(e)) == null ? void 0 : t.slot) ?? 0;
141
+ }
142
+ const ge = /* @__PURE__ */ new Map(), Ie = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map(), Oe = (e) => e === 0 ? 0 : e % 2 ? (e + 1) / 2 : -e / 2;
143
+ function qt(e) {
144
+ const t = Ee.get(e.id);
145
+ if (t !== void 0) return t;
146
+ const r = /* @__PURE__ */ new Set();
147
+ for (const s of T.instances.values()) {
148
+ if (s.id === e.id || s.run !== e.run || s.parent !== e.parent) continue;
149
+ const i = Ee.get(s.id);
150
+ i !== void 0 && !s.exitAt && r.add(i);
151
+ }
152
+ let n = 0;
153
+ for (; r.has(n); ) n++;
154
+ return Ee.set(e.id, n), n;
155
+ }
156
+ const Ue = new o.Vector3();
157
+ function mt(e) {
158
+ const t = ge.get(e.id), r = $t(e.run);
159
+ if (t && Ie.get(e.id) === r) return t;
160
+ if (ge.size > 400)
161
+ for (const g of ge.keys()) T.instances.has(g) || (ge.delete(g), Ee.delete(g), Ie.delete(g));
162
+ const n = t ?? new o.Vector3(), s = e.parent ? T.instances.get(e.parent) ?? T.archive.get(e.parent) : void 0, i = qt(e), h = (g) => _(e.id, g) - 0.5;
163
+ if (!s || s.run !== e.run) {
164
+ if (Fe(e.run, n), i) {
165
+ const g = _(e.run, 14) * Math.PI;
166
+ n.x += Math.cos(g) * Oe(i) * 4.2, n.y += Math.sin(g) * Oe(i) * 3;
167
+ }
168
+ } else {
169
+ const g = mt(s), M = s.parent ? ge.get(s.parent) : void 0;
170
+ let z;
171
+ if (M)
172
+ z = Math.atan2(g.y - M.y, g.x - M.x) + Oe(i) * 0.78;
173
+ else {
174
+ let d = (-0.5 - g.x) * 0.06, p = (-0.8 - g.y) * 0.09;
175
+ for (const c of T.runs.values()) {
176
+ if (c.id === e.run || c.status !== "started" || !tt(c.id)) continue;
177
+ Fe(c.id, Ue);
178
+ const l = g.x - Ue.x, v = g.y - Ue.y, b = Math.max(4, l * l + v * v);
179
+ d += l / b * 6, p += v / b * 6;
180
+ }
181
+ z = Math.atan2(p, d) + (_(e.run, 15) - 0.5) * 1 + i * 2.39996;
182
+ }
183
+ z += h(16) * 0.35;
184
+ const S = (e.subagent ? 2.6 : 3.3) * (0.9 + 0.25 * _(e.id, 17)) * (M ? 0.9 + 0.45 * (i % 2) : 1);
185
+ n.set(g.x + Math.cos(z) * S, g.y + Math.sin(z) * S * 0.82, g.z + h(18) * 2.2);
186
+ }
187
+ return n.x += h(19) * 0.5, n.y += h(20) * 0.5, ge.set(e.id, n), Ie.set(e.id, r), n;
188
+ }
189
+ const J = /* @__PURE__ */ new Map(), We = [
190
+ [-24, 6, -9],
191
+ [17, -10.6, -4],
192
+ [-25, -0.5, -8],
193
+ [26, -2.5, -8],
194
+ [-3.5, -12.2, -5],
195
+ [5.5, 11.5, -10]
196
+ ];
197
+ function He(e, t) {
198
+ const r = We[e % We.length], n = Math.floor(e / We.length);
199
+ return t.set(r[0] * (1 + n * 0.12), r[1] * (1 + n * 0.12), r[2] - n * 4);
200
+ }
201
+ const Qe = /* @__PURE__ */ new Map(), le = new o.Vector3(1.5, 0.8, -15), Be = 15, Ve = 7.5, Yt = (
202
+ /* glsl */
203
+ `
204
+ attribute float aSize; attribute vec3 aColor; uniform float uScale; varying vec3 vC;
205
+ void main(){ vec4 mv = modelViewMatrix * vec4(position, 1.0); vC = aColor; gl_PointSize = aSize * uScale / -mv.z; gl_Position = projectionMatrix * mv; }`
206
+ ), Zt = (
207
+ /* glsl */
208
+ `
209
+ varying vec3 vC;
210
+ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
211
+ float core = smoothstep(0.35, 0.0, r); float halo = pow(1.0 - r, 2.6);
212
+ gl_FragColor = vec4(vC * (core * 1.4 + halo * 0.5), 1.0); }`
213
+ );
214
+ class Le {
215
+ constructor(t) {
216
+ G(this, "geo", new o.BufferGeometry());
217
+ G(this, "mat", new o.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: Yt, fragmentShader: Zt, transparent: !0, depthWrite: !1, blending: o.AdditiveBlending }));
218
+ G(this, "obj");
219
+ G(this, "P");
220
+ G(this, "S");
221
+ G(this, "C");
222
+ G(this, "n", 0);
223
+ this.max = t, this.P = new o.BufferAttribute(new Float32Array(t * 3), 3), this.S = new o.BufferAttribute(new Float32Array(t), 1), this.C = new o.BufferAttribute(new Float32Array(t * 3), 3), this.geo.setAttribute("position", this.P), this.geo.setAttribute("aSize", this.S), this.geo.setAttribute("aColor", this.C), this.geo.boundingSphere = new o.Sphere(new o.Vector3(), 1e4), this.obj = new o.Points(this.geo, this.mat), this.obj.frustumCulled = !1;
224
+ }
225
+ setScale(t, r, n) {
226
+ this.mat.uniforms.uScale.value = t * r / (2 * Math.tan(n * Math.PI / 360));
227
+ }
228
+ begin() {
229
+ this.n = 0;
230
+ }
231
+ add(t, r, n, s) {
232
+ this.n >= this.max || (this.P.setXYZ(this.n, t.x, t.y, t.z), this.S.setX(this.n, r), this.C.setXYZ(this.n, n.r * s, n.g * s, n.b * s), this.n++);
233
+ }
234
+ end() {
235
+ this.geo.setDrawRange(0, this.n), this.P.needsUpdate = !0, this.S.needsUpdate = !0, this.C.needsUpdate = !0;
236
+ }
237
+ }
238
+ const Ht = [
239
+ [-19, 5.5, -1],
240
+ [5.5, 8.4, -1],
241
+ [-18.5, -3.2, -1],
242
+ [6.5, -1.2, -1],
243
+ [-5, 8.6, -1],
244
+ [-3, -9.2, -1]
245
+ ];
246
+ function Qt(e, t) {
247
+ return he.laneExpanded[e] ? t.fromArray(Ht[e]) : (Ze(e, "", t).setZ(-1), t);
248
+ }
249
+ function Jt() {
250
+ return /* @__PURE__ */ m(At, { place: Qt, radius: 1.5, variant: "stars", glowGain: 0.9 });
251
+ }
252
+ const eo = 260, De = 40, Ke = 8, ke = 4, to = new o.Color("#9db4ff"), oo = (
253
+ /* glsl */
254
+ "varying vec2 vUv; void main(){ vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }"
255
+ ), no = (
256
+ /* glsl */
257
+ `
258
+ uniform float uTime; uniform float uAct; varying vec2 vUv;
259
+ float h(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
260
+ float n(vec2 p){ vec2 i = floor(p); vec2 f = fract(p); f = f*f*(3.0-2.0*f);
261
+ return mix(mix(h(i), h(i+vec2(1,0)), f.x), mix(h(i+vec2(0,1)), h(i+vec2(1,1)), f.x), f.y); }
262
+ float fbm(vec2 p){ float s = 0.0, a = 0.5; for (int i = 0; i < 6; i++){ s += a*n(p); p = p*2.02 + 3.1; a *= 0.5; } return s; }
263
+ void main(){
264
+ vec2 p = (vUv - 0.5) * 2.0;
265
+ float r = length(p);
266
+ float ang = atan(p.y, p.x);
267
+ // spiral-swirl the noise domain
268
+ float sw = ang + r * 2.6 - uTime * 0.012;
269
+ vec2 q = vec2(cos(sw), sin(sw)) * r * 2.4;
270
+ float f = fbm(q + fbm(q * 1.3 + 4.0) * 1.2);
271
+ float arms = 0.55 + 0.45 * cos(2.0 * (ang - r * 3.2 + uTime * 0.006));
272
+ float mask = smoothstep(1.0, 0.15, r);
273
+ float core = exp(-r * r * 9.0);
274
+ vec3 deep = vec3(0.10, 0.06, 0.32);
275
+ vec3 blue = vec3(0.07, 0.18, 0.45);
276
+ vec3 teal = vec3(0.05, 0.30, 0.42);
277
+ vec3 rose = vec3(0.35, 0.10, 0.36);
278
+ vec3 col = mix(deep, blue, smoothstep(0.35, 0.75, f));
279
+ col = mix(col, teal, smoothstep(0.62, 0.9, fbm(q * 0.7 + 9.0)) * 0.6);
280
+ col = mix(col, rose, smoothstep(0.55, 0.85, fbm(q * 0.9 - 5.0)) * 0.35);
281
+ float dens = pow(f, 1.6) * arms * mask;
282
+ vec3 c = col * dens * (0.75 + uAct * 0.35) + vec3(0.55, 0.6, 0.95) * core * 0.16;
283
+ gl_FragColor = vec4(c, 1.0);
284
+ }`
285
+ ), ro = (
286
+ /* glsl */
287
+ `
288
+ attribute float aSize; attribute vec3 aColor; uniform float uScale; varying vec3 vC;
289
+ void main(){ vec4 mv = modelViewMatrix * vec4(position, 1.0); vC = aColor; gl_PointSize = aSize * uScale / -mv.z; gl_Position = projectionMatrix * mv; }`
290
+ ), ao = (
291
+ /* glsl */
292
+ `
293
+ varying vec3 vC;
294
+ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
295
+ float core = smoothstep(0.4, 0.0, r); float halo = pow(1.0 - r, 2.4);
296
+ gl_FragColor = vec4(vC * (core * 1.25 + halo * 0.4), 1.0); }`
297
+ );
298
+ function so({ galaxy: e }) {
299
+ const t = C(() => ({ nodes: e.nodes.slice(0, eo), links: e.links }), [e]), r = t.nodes.length, { size: n, gl: s, camera: i } = Te(), h = B([]), g = B([]), M = B(Array(ke).fill("")), z = B([]), S = C(() => {
300
+ const a = new Float32Array(r * 3), f = -0.18, y = Math.cos(f), R = Math.sin(f);
301
+ t.nodes.forEach((P, I) => {
302
+ const k = _(P.id, 1);
303
+ let K, $;
304
+ if (k < 0.22) {
305
+ const ne = 0.22 * Math.sqrt(-2 * Math.log(1 - _(P.id, 2) * 0.95)) * 0.6, q = _(P.id, 3) * Math.PI * 2;
306
+ K = Math.cos(q) * ne * Be, $ = Math.sin(q) * ne * Ve;
307
+ } else {
308
+ const ne = k < 0.61 ? 0 : Math.PI, q = 0.12 + 0.88 * Math.sqrt(_(P.id, 2)), ie = ne + q * 3.1 + (_(P.id, 3) - 0.5) * (0.6 + q * 0.7), ce = 1 + (_(P.id, 7) - 0.5) * 0.35;
309
+ K = Math.cos(ie) * q * Be * 0.95 * ce, $ = Math.sin(ie) * q * Ve * 0.95 * ce;
310
+ }
311
+ a.set([le.x + K * y - $ * R, le.y + K * R + $ * y, le.z + (_(P.id, 4) - 0.5) * 4], I * 3);
312
+ });
313
+ const E = t.nodes.map((P) => new o.Color(Ct[P.kind] ?? "#94a3b8").lerp(to, 0.55).multiplyScalar(0.5)), L = t.nodes.map((P) => 0.32 + Math.pow(_(P.id, 5), 4) * 0.5), N = new o.BufferGeometry();
314
+ N.setAttribute("position", new o.BufferAttribute(a, 3)), N.setAttribute("aSize", new o.BufferAttribute(new Float32Array(r), 1)), N.setAttribute("aColor", new o.BufferAttribute(new Float32Array(r * 3), 3));
315
+ const U = new Map(t.nodes.map((P, I) => [P.id, I])), V = [], D = new o.Vector3(), H = new o.Vector3();
316
+ for (const P of t.links) {
317
+ const I = U.get(P.source), k = U.get(P.target);
318
+ I === void 0 || k === void 0 || I === k || (D.fromArray(a, I * 3), H.fromArray(a, k * 3), D.distanceTo(H) < 3.2 && V.push(I, k));
319
+ }
320
+ const O = new Float32Array(V.length * 3);
321
+ V.forEach((P, I) => O.set([a[P * 3], a[P * 3 + 1], a[P * 3 + 2]], I * 3));
322
+ const j = new o.BufferGeometry();
323
+ return j.setAttribute("position", new o.BufferAttribute(O, 3)), j.setAttribute("color", new o.BufferAttribute(new Float32Array(V.length * 3), 3)), { pos: a, base: E, baseSize: L, ngeo: N, lgeo: j, owner: Int32Array.from(V), fire: new Float32Array(r), white: new Float32Array(r), fireC: Array.from({ length: r }, () => new o.Color()), phase: t.nodes.map((P) => _(P.id, 6) * 6.283) };
324
+ }, [t, r]), d = C(
325
+ () => ({
326
+ gas: new o.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uAct: { value: 0 } }, vertexShader: oo, fragmentShader: no, transparent: !0, depthWrite: !1, blending: o.AdditiveBlending }),
327
+ nodes: new o.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: ro, fragmentShader: ao, transparent: !0, depthWrite: !1, blending: o.AdditiveBlending }),
328
+ fil: new o.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
329
+ ripples: Array.from({ length: Ke }, () => ue(pt(), "#000"))
330
+ }),
331
+ []
332
+ ), p = C(() => new rt(De, 24), []), c = C(() => new Pe(De), []), l = C(() => new Le(De), []), v = C(() => /* @__PURE__ */ new Map(), [t]), b = C(() => ({ v: new o.Vector3(), ctrl: new o.Vector3(), h: new o.Vector3(), c: new o.Color(), act: 0 }), []), w = (a) => {
333
+ let f = v.get(a);
334
+ return f === void 0 && v.set(a, f = Pt(t, a)), f;
335
+ };
336
+ return Z(({ clock: a }) => {
337
+ const f = performance.now(), y = ee ? 0 : a.elapsedTime, R = i.fov, E = s.getPixelRatio();
338
+ d.nodes.uniforms.uScale.value = n.height * E / (2 * Math.tan(R * Math.PI / 360)), l.setScale(n.height, E, R);
339
+ const { pos: L, base: N, baseSize: U, fire: V, white: D, fireC: H, phase: O } = S, { v: j, ctrl: P, h: I, c: k } = b;
340
+ V.fill(0), D.fill(0), p.begin(), c.begin(), l.begin();
341
+ let K = 0, $ = 0;
342
+ for (const A of T.flares) {
343
+ const x = w(A.node), F = (f - A.start) / 1e3, me = T.instances.get(A.instance), pe = me ? je[me.type] : Ce, re = A.op === "write", te = F < 0.3 ? F / 0.3 : Math.exp(-(F - 0.3) * 1.1);
344
+ if ($ = Math.max($, te), te > V[x] && (V[x] = te, H[x].copy(re ? X : pe), D[x] = re ? 1 : 0), j.fromArray(L, x * 3), re && F < 1.6 && K < Ke) {
345
+ const se = z.current[K];
346
+ if (se) {
347
+ const fe = F / 1.6;
348
+ se.visible = !0, se.position.copy(j), se.scale.setScalar(0.4 + fe * 3.2), d.ripples[K].color.setScalar((1 - fe) * (1 - fe) * 0.9);
349
+ }
350
+ K++;
351
+ }
352
+ const ae = J.get(A.instance);
353
+ if (ae && F < 2) {
354
+ be(ae, j, 1.2, 2.5, P);
355
+ const se = Math.min(1, F / 0.25) * Math.pow(1 - F / 2, 1.5), fe = re ? Math.min(1, F * 0.9) : 1 - Math.min(1, F * 0.9);
356
+ k.copy(re ? X : pe).lerp(X, 0.2), p.add(ae, P, j, k, (re ? 0.26 : 0.1) * se, 0.04, 0.99, 0, 1, y, fe, 1.1 * se), fe > 0.02 && fe < 0.98 && (de(ae, P, j, fe, I), l.add(I, 0.5, k, 1.1 * se)), re ? c.add(ae, P, j, 0.95, 1, 0.34, X, se * 0.9) : c.add(ae, P, j, 0.07, -1, 0.34, k, se * 1.1);
357
+ }
358
+ }
359
+ for (let A = K; A < Ke; A++) {
360
+ const x = z.current[A];
361
+ x && (x.visible = !1);
362
+ }
363
+ p.end(), c.end(), l.end(), b.act += ($ - b.act) * 0.05, d.gas.uniforms.uTime.value = y, d.gas.uniforms.uAct.value = b.act;
364
+ const ne = S.ngeo.getAttribute("aSize"), q = S.ngeo.getAttribute("aColor");
365
+ for (let A = 0; A < r; A++) {
366
+ const x = V[A], F = ee ? 1 : 0.85 + 0.15 * Math.sin(y * 0.9 + O[A]);
367
+ ne.setX(A, U[A] + x * (0.9 + D[A] * 0.5)), k.copy(N[A]).multiplyScalar(F), x > 0.01 && (k.r += H[A].r * x * 1.5 + x * (0.25 + D[A]), k.g += H[A].g * x * 1.5 + x * (0.25 + D[A]), k.b += H[A].b * x * 1.5 + x * (0.25 + D[A])), q.setXYZ(A, k.r, k.g, k.b);
368
+ }
369
+ ne.needsUpdate = !0, q.needsUpdate = !0;
370
+ const ie = S.lgeo.getAttribute("color"), ce = S.owner;
371
+ for (let A = 0; A < ce.length; A++) {
372
+ const x = Math.max(V[ce[A]], V[ce[A ^ 1]]);
373
+ ie.setXYZ(A, 0.05 + x * 0.35, 0.06 + x * 0.38, 0.13 + x * 0.5);
374
+ }
375
+ ie.needsUpdate = !0;
376
+ let Q = 0;
377
+ for (let A = T.flares.length - 1; A >= 0 && Q < ke; A--) {
378
+ const x = T.flares[A];
379
+ if (f - x.start > 2200) break;
380
+ let F = !1;
381
+ for (let te = 0; te < Q; te++) M.current[te] === x.node && (F = !0);
382
+ if (F) continue;
383
+ const me = w(x.node);
384
+ for (let te = 0; te < Q; te++) {
385
+ const ae = g.current[te];
386
+ ae && Math.abs(ae.position.y - L[me * 3 + 1]) < 0.9 && Math.abs(ae.position.x - L[me * 3]) < 4.5 && (F = !0);
387
+ }
388
+ if (F) continue;
389
+ const pe = h.current[Q], re = g.current[Q];
390
+ pe && re && (re.position.fromArray(L, me * 3), M.current[Q] !== x.node && (pe.setText(`${x.op === "write" ? "wrote" : "read"} · ${x.node}`), pe.setColor(x.op === "write" ? "#ffffff" : "#9db4ff")), pe.setOpacity(Y(1.4 - (f - x.start) / 1600))), M.current[Q] = x.node, Q++;
391
+ }
392
+ for (let A = Q; A < ke; A++) {
393
+ const x = h.current[A];
394
+ x == null || x.setOpacity(0), M.current[A] = "";
395
+ }
396
+ }), /* @__PURE__ */ W(oe, { children: [
397
+ /* @__PURE__ */ m("mesh", { material: d.gas, position: [le.x, le.y, le.z - 1], rotation: [0, 0, -0.18], renderOrder: -5, children: /* @__PURE__ */ m("planeGeometry", { args: [Be * 2.6, Ve * 2.9] }) }),
398
+ /* @__PURE__ */ m("lineSegments", { geometry: S.lgeo, material: d.fil, frustumCulled: !1 }),
399
+ /* @__PURE__ */ m("points", { geometry: S.ngeo, material: d.nodes, frustumCulled: !1 }),
400
+ d.ripples.map((a, f) => /* @__PURE__ */ m("sprite", { ref: (y) => void (z.current[f] = y), material: a, visible: !1 }, f)),
401
+ /* @__PURE__ */ m("primitive", { object: p.obj }),
402
+ /* @__PURE__ */ m("primitive", { object: c.mesh }),
403
+ /* @__PURE__ */ m("primitive", { object: l.obj }),
404
+ Array.from({ length: ke }, (a, f) => /* @__PURE__ */ m("group", { ref: (y) => void (g.current[f] = y), children: /* @__PURE__ */ m(Se, { ref: (y) => void (h.current[f] = y), text: "", offset: [0, 0.4], size: 0.24, opacity: 0, fadeMs: 250, pxRange: [8, 12] }) }, f)),
405
+ /* @__PURE__ */ m(zt, { position: [le.x - Be * 0.95, le.y + Ve * 0.45, le.z], suffix: " · nebula", color: "#8b9cff", letterSpacing: 0.04, size: 0.28, opacity: 0.6, pxRange: [8, 12] })
406
+ ] });
407
+ }
408
+ const io = (
409
+ /* glsl */
410
+ `
411
+ varying vec3 vN; varying vec3 vV; varying vec3 vObj;
412
+ void main(){
413
+ vec4 wp = modelMatrix * vec4(position, 1.0);
414
+ vN = normalize(mat3(modelMatrix) * normal); vV = normalize(cameraPosition - wp.xyz); vObj = position;
415
+ gl_Position = projectionMatrix * viewMatrix * wp; }`
416
+ ), co = (
417
+ /* glsl */
418
+ `
419
+ uniform vec3 uCol; uniform vec3 uAtmo; uniform float uAct; uniform float uBands; uniform float uSeed; uniform float uGlow;
420
+ varying vec3 vN; varying vec3 vV; varying vec3 vObj;
421
+ void main(){
422
+ vec3 N = normalize(vN); vec3 V = normalize(vV);
423
+ vec3 L = normalize(vec3(-0.55, 0.45, 0.7));
424
+ float lam = dot(N, L);
425
+ float day = smoothstep(-0.15, 0.6, lam);
426
+ float y = vObj.y;
427
+ float b = sin(y * 13.0 + sin(vObj.x * 3.0 + uSeed * 6.0) * 0.8 + uSeed * 20.0) * 0.5 + 0.5;
428
+ float b2 = sin(y * 31.0 + uSeed * 9.0) * 0.5 + 0.5;
429
+ vec3 surf = uCol * mix(1.0, 0.7 + 0.35 * b + 0.12 * b2, uBands);
430
+ vec3 col = surf * (0.05 + 0.85 * day);
431
+ float f = 1.0 - max(dot(N, V), 0.0);
432
+ float rim = pow(f, 3.0);
433
+ col += uAtmo * rim * (0.35 + 0.9 * day + uAct * 0.9);
434
+ col += uAtmo * uGlow * (0.25 + 0.75 * (1.0 - f));
435
+ gl_FragColor = vec4(col, 1.0);
436
+ }`
437
+ );
438
+ function gt(e, t, r, n) {
439
+ return new o.ShaderMaterial({
440
+ uniforms: { uCol: { value: e.clone() }, uAtmo: { value: t.clone() }, uAct: { value: 0 }, uBands: { value: r }, uSeed: { value: n }, uGlow: { value: 0 } },
441
+ vertexShader: io,
442
+ fragmentShader: co
443
+ });
444
+ }
445
+ const st = new o.Color("#8792b5"), Xe = 96;
446
+ function lo(e, t, r) {
447
+ return { tilt: new o.Quaternion().setFromEuler(new o.Euler(1.15 + (_(t.name, 1) - 0.5) * 0.5, (_(t.name, 2) - 0.5) * 0.6, (_(e.name, 3) - 0.5) * 0.5 + r * 0.25)), r: 2.3 + r * 0.85, phase: _(t.name, 4) * Math.PI * 2, speed: 0.09 / (1 + r * 0.5) * (_(t.name, 5) < 0.5 ? 1 : -1) };
448
+ }
449
+ function fo({ srv: e, res: t, k: r, center: n }) {
450
+ const s = `${e.name}|${t.name}`, i = C(() => lo(e, t, r), [e, t, r]), h = C(() => new o.Color(e.color), [e.color]), g = C(() => gt(st, new o.Color(e.color).lerp(X, 0.3), 0, _(t.name, 6)), [e.color, t.name]), M = C(() => ue(ze(), "#000"), []), z = C(() => new o.LineBasicMaterial({ color: "#000", transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), []), S = C(() => {
451
+ const w = new Float32Array((Xe + 1) * 3), u = new o.Vector3();
452
+ for (let a = 0; a <= Xe; a++) {
453
+ const f = a / Xe * Math.PI * 2;
454
+ u.set(Math.cos(f) * i.r, Math.sin(f) * i.r, 0).applyQuaternion(i.tilt), w.set([u.x, u.y, u.z], a * 3);
455
+ }
456
+ return new o.BufferGeometry().setAttribute("position", new o.BufferAttribute(w, 3));
457
+ }, [i]), d = C(() => new o.Vector3(), []), p = B(null), c = B(null), l = B(null), v = B("");
458
+ C(() => Qe.set(s, d), [s, d]), Z(({ clock: w }) => {
459
+ var L, N;
460
+ const u = performance.now(), a = i.phase + (ee ? 0 : w.elapsedTime * i.speed);
461
+ d.set(Math.cos(a) * i.r, Math.sin(a) * i.r, 0).applyQuaternion(i.tilt).add(n), (L = p.current) == null || L.position.copy(d);
462
+ const f = t.inflight > 0, y = Math.exp(-((u - t.activeAt) / 1e3) * 1.4), R = f ? 0.5 + 0.5 * Math.sin(w.elapsedTime * 5) : 0;
463
+ g.uniforms.uAct.value = f ? 1 : y, g.uniforms.uGlow.value = f ? 0.8 + R * 0.5 : y * 0.6, g.uniforms.uCol.value.copy(st).lerp(h, f ? 0.6 : y * 0.5), M.color.copy(h).lerp(X, 0.3).multiplyScalar(f ? 0.55 + R * 0.25 : y * 0.35), (N = c.current) == null || N.scale.setScalar(f ? 2.6 + R * 0.4 : 1.6 + y), z.color.copy(h).lerp(X, 0.3).multiplyScalar(0.12 + (f ? 0.2 : y * 0.12));
464
+ let E = t.name;
465
+ if (f) {
466
+ let U = "";
467
+ for (const V of T.mcpPending.values()) V.server === e.name && V.resource === t.name && (U = V.tool);
468
+ E = `${t.name} ▶ ${U || "query"}()`;
469
+ } else y > 0.25 && t.calls > 0 && (E = `${t.name} ✓`);
470
+ l.current && (E !== v.current && l.current.setText(v.current = E), l.current.setOpacity(f ? 1 : 0.5 + y * 0.5), l.current.setEmphasis(f));
471
+ });
472
+ const b = t.kind === "warehouse" || t.kind === "spark" ? 0.36 : 0.3;
473
+ return /* @__PURE__ */ W(oe, { children: [
474
+ /* @__PURE__ */ m("lineLoop", { geometry: S, material: z, position: n }),
475
+ /* @__PURE__ */ W("group", { ref: p, children: [
476
+ /* @__PURE__ */ m("sprite", { ref: c, material: M }),
477
+ /* @__PURE__ */ m("mesh", { geometry: nt, material: g, scale: b }),
478
+ /* @__PURE__ */ m(Se, { ref: l, position: [0, -0.62, 0], text: t.name, color: e.color, size: 0.2, opacity: 0.5, pxRange: [7.5, 11.5] })
479
+ ] })
480
+ ] });
481
+ }
482
+ function uo({ srv: e }) {
483
+ const t = C(() => He(e.slot, new o.Vector3()), [e.slot]), r = C(() => new o.Color(e.color), [e.color]), n = C(() => _(e.name, 7), [e.name]), s = 1 + n * 0.4, i = _(e.name, 8) > 0.45, h = C(
484
+ () => ({
485
+ body: gt(r.clone().lerp(new o.Color("#8090c0"), 0.35).multiplyScalar(0.45), r.clone().lerp(X, 0.25).multiplyScalar(0.7), 1, n),
486
+ halo: ue(ze(), "#000"),
487
+ ring: new o.MeshBasicMaterial({ color: r.clone().lerp(X, 0.4).multiplyScalar(0.22), side: o.DoubleSide, transparent: !0, blending: o.AdditiveBlending, depthWrite: !1, toneMapped: !1 })
488
+ }),
489
+ [r, n]
490
+ ), g = C(() => new o.RingGeometry(s * 1.45, s * 2.05, 96, 1), [s]), M = B(null), z = B(null), [S, d] = Re([]), p = B(0);
491
+ return Z(({ clock: c }) => {
492
+ var w;
493
+ e.resources.size !== p.current && (p.current = e.resources.size, d([...e.resources.values()]));
494
+ const l = performance.now(), v = e.inflight > 0, b = Math.exp(-((l - e.activeAt) / 1e3) * 1.4);
495
+ h.body.uniforms.uAct.value = v ? 1 : b, h.halo.color.copy(r).multiplyScalar(v ? 0.28 : 0.07 + b * 0.18), (w = z.current) == null || w.scale.setScalar(s * (5 + (v ? 0.6 : 0))), M.current && !ee && (M.current.rotation.y = c.elapsedTime * 0.05);
496
+ }), /* @__PURE__ */ W(oe, { children: [
497
+ /* @__PURE__ */ W("group", { position: t, children: [
498
+ /* @__PURE__ */ m("sprite", { ref: z, material: h.halo }),
499
+ /* @__PURE__ */ W("group", { rotation: [0.25, 0, -0.32 + n * 0.3], children: [
500
+ /* @__PURE__ */ m("mesh", { ref: M, geometry: nt, material: h.body, scale: s }),
501
+ i && /* @__PURE__ */ m("mesh", { geometry: g, material: h.ring, rotation: [Math.PI / 2 - 0.25, 0, 0] })
502
+ ] }),
503
+ /* @__PURE__ */ m(Se, { position: [0, s + 0.75, 0], text: `MCP · ${e.name}`, color: e.color, size: 0.28, pxRange: [9, 13] })
504
+ ] }),
505
+ S.map((c, l) => /* @__PURE__ */ m(fo, { srv: e, res: c, k: l, center: t }, c.name))
506
+ ] });
507
+ }
508
+ const $e = 48;
509
+ function po() {
510
+ const { size: e, gl: t, camera: r } = Te(), n = C(() => new rt($e, 36), []), s = C(() => new Pe($e), []), i = C(() => new Le($e), []), h = C(() => ({ a: new o.Vector3(), b: new o.Vector3(), c: new o.Vector3(), h: new o.Vector3(), col: new o.Color() }), []);
511
+ return Z(({ clock: g }) => {
512
+ const M = performance.now(), z = ee ? 0 : g.elapsedTime;
513
+ i.setScale(e.height, t.getPixelRatio(), r.fov), n.begin(), s.begin(), i.begin();
514
+ const { a: S, b: d, c: p, h: c, col: l } = h;
515
+ for (const v of T.mcpPending.values()) {
516
+ const b = J.get(v.instance), w = T.mcpServers.get(v.server);
517
+ if (!b || !w) continue;
518
+ He(w.slot, d), S.copy(b), be(S, d, 1.5, 1.2, p);
519
+ const u = Tt(v, M);
520
+ l.set(w.color).lerp(Ye, Y(u / 1.2)), u > 1.2 && l.lerp(It, Y((u - 1.2) / 1));
521
+ const a = (0.2 + Math.min(0.35, u * 0.15)) * ye(u / 0.3), f = 0.06 + 0.86 * ye(u / 0.45);
522
+ if (n.add(S, p, d, l, a, 0.06, f, 0.9, 1, z, u < 0.45 ? f : -1, 1.2), u > 0.45 && s.add(S, p, d, 0.9, 1, 0.42, l, 0.6 + a), v.resource) {
523
+ const y = Qe.get(`${v.server}|${v.resource}`);
524
+ y && (be(d, y, 0.3, 0.2, p), n.add(d, p, y, l, a * 0.9, 0.12, 0.88, 0.9, 1, z, -1, 0), s.add(d, p, y, 0.8, 1, 0.3, l, 0.5 + a));
525
+ }
526
+ }
527
+ for (const v of T.mcpCalls) {
528
+ if (v.phase !== "result") continue;
529
+ const b = Y((M - v.start) / v.dur);
530
+ if (b >= 1) continue;
531
+ const w = J.get(v.instance), u = T.mcpServers.get(v.server);
532
+ if (!w || !u) continue;
533
+ He(u.slot, d), l.set(u.color).lerp(X, 0.4);
534
+ const a = v.resource ? Qe.get(`${v.server}|${v.resource}`) : void 0, f = a ? 0.3 : 0;
535
+ if (a && b < f) {
536
+ const y = Ae(b / f);
537
+ be(d, a, 0.3, 0.2, p), n.add(d, p, a, l, 0.15, 0.12, 0.88, 0, 1, z, 1 - y, 1.4), de(d, p, a, 1 - y, c), i.add(c, 0.6, l, 1.5);
538
+ } else {
539
+ const y = Ae((b - f) / (1 - f));
540
+ S.copy(w), be(S, d, 1.5, 1.2, p);
541
+ const R = 1 - Math.max(0, (y - 0.85) / 0.15);
542
+ n.add(S, p, d, l, 0.22 * R, 0.06, 0.94, 0, 1, z, 1 - y, 1.6 * R), de(S, p, d, 1 - y, c), i.add(c, 0.75, l, 1.6 * R), s.add(S, p, d, 0.08, -1, 0.45, l, 1.3 * R);
543
+ }
544
+ }
545
+ n.end(), s.end(), i.end();
546
+ }), /* @__PURE__ */ W(oe, { children: [
547
+ /* @__PURE__ */ m("primitive", { object: n.obj }),
548
+ /* @__PURE__ */ m("primitive", { object: s.mesh }),
549
+ /* @__PURE__ */ m("primitive", { object: i.obj })
550
+ ] });
551
+ }
552
+ function ho() {
553
+ const [e, t] = Re([]), r = B(-1);
554
+ return Z(() => {
555
+ T.mcpServers.size !== r.current && (r.current = T.mcpServers.size, t([...T.mcpServers.values()]));
556
+ }), /* @__PURE__ */ W(oe, { children: [
557
+ e.map((n) => /* @__PURE__ */ m(uo, { srv: n }, n.name)),
558
+ /* @__PURE__ */ m(po, {})
559
+ ] });
560
+ }
561
+ const _e = /* @__PURE__ */ new Map();
562
+ function mo({ run: e }) {
563
+ const t = C(() => new o.Color(e.color), [e.color]), r = C(() => ue(ze(), "#000"), []), n = C(() => {
564
+ const h = Fe(e.id, new o.Vector3());
565
+ return { aura: h.clone().setZ(-3), label: h.clone().add(new o.Vector3(0, 2.6, 0)), want: new o.Vector3(), init: !1 };
566
+ }, [e.slot, e.id]), s = B(null), i = B(null);
567
+ return qe(() => () => void _e.delete(e.id), [e.id]), Z(({ clock: h }) => {
568
+ var b, w, u;
569
+ const g = performance.now(), M = ye((g - e.startedAt) / 1500), z = e.endedAt ? Y(1 - (g - e.endedAt - (Rt - 2500)) / 2500) : 1, S = ee ? 1 : 0.9 + 0.1 * Math.sin(h.elapsedTime * 0.5 + e.slot);
570
+ r.color.copy(t).multiplyScalar(0.075 * M * z * S);
571
+ let d = 0, p = 0, c = 0, l = -1e9;
572
+ for (const a of T.instances.values()) {
573
+ if (a.run !== e.id) continue;
574
+ const f = J.get(a.id);
575
+ f && (d++, p += f.x, c += f.y, f.y > l && (l = f.y));
576
+ }
577
+ if (d) {
578
+ n.want.set(p / d, Math.min(l + 1.7, 8.4), 0);
579
+ for (const [a, f] of _e)
580
+ a !== e.id && f.startedAt < e.startedAt && Math.abs(f.p.x - n.want.x) < 8.5 && Math.abs(f.p.y - n.want.y) < 1.4 && (n.want.y = f.p.y + 1.45);
581
+ n.init ? n.label.lerp(n.want, 0.04) : (n.label.copy(n.want), n.init = !0), n.aura.x += (p / d - n.aura.x) * 0.03, n.aura.y += (c / d - n.aura.y) * 0.03;
582
+ }
583
+ (b = i.current) == null || b.position.copy(n.label);
584
+ let v = _e.get(e.id);
585
+ v || _e.set(e.id, v = { p: new o.Vector3(), startedAt: e.startedAt }), v.p.copy(n.label), (w = s.current) == null || w.position.copy(n.aura), (u = s.current) == null || u.scale.set(15, 11, 1);
586
+ }), /* @__PURE__ */ W(oe, { children: [
587
+ /* @__PURE__ */ m("sprite", { ref: s, material: r }),
588
+ /* @__PURE__ */ m("group", { ref: i, children: /* @__PURE__ */ m(go, { run: e }) })
589
+ ] });
590
+ }
591
+ function go({ run: e }) {
592
+ Bt();
593
+ const t = e.status !== "started";
594
+ return /* @__PURE__ */ m(
595
+ Se,
596
+ {
597
+ text: e.topic,
598
+ secondary: Vt(e, { base: "#94a3c8", current: "#fde68a", done: "#cbd5e1" }, ["running…", "run complete"]),
599
+ color: e.color,
600
+ textColor: "#e6ecff",
601
+ plate: "none",
602
+ uppercase: !0,
603
+ letterSpacing: 0.12,
604
+ size: 0.34,
605
+ maxWidth: 14,
606
+ opacity: t ? 0.5 : 0.92,
607
+ fadeMs: 600,
608
+ pxRange: [10, 14],
609
+ glow: 1.1
610
+ }
611
+ );
612
+ }
613
+ const ve = 6, Me = 6, we = 28, xe = 3, vo = 2.2;
614
+ function wo() {
615
+ const { size: e, gl: t, camera: r } = Te(), n = B(/* @__PURE__ */ new Set()), s = B([]), i = B([]), h = B([]), g = B([]), M = C(() => {
616
+ const p = new o.BufferGeometry();
617
+ return p.setAttribute("position", new o.BufferAttribute(new Float32Array(ve * xe * we * 6), 3)), p.setAttribute("color", new o.BufferAttribute(new Float32Array(ve * xe * we * 6), 3)), p.boundingSphere = new o.Sphere(new o.Vector3(), 1e4), p;
618
+ }, []), z = C(() => ht(), []), S = C(() => new Le(ve * (2 + Me)), []), d = C(() => ({ h: new o.Vector3(), p: new o.Vector3() }), []);
619
+ return Z(() => {
620
+ const p = performance.now();
621
+ for (const u of T.runs.values()) {
622
+ if (!u.final || n.current.has(u.id) || (n.current.add(u.id), !tt(u.id))) continue;
623
+ let a;
624
+ for (const L of T.instances.values()) L.run === u.id && !L.parent && (a = J.get(L.id));
625
+ const f = a ? a.clone() : Fe(u.id, new o.Vector3()), y = (f.x < 0 ? 1 : -1) * (10 + _(u.id, 21) * 6), R = Math.max(-5, Math.min(4, f.y)) - 2.5 - _(u.id, 22) * 2, E = new o.Vector3(y - f.x, R - f.y, 1.5).normalize();
626
+ s.current.push({ run: u.id, start: p, from: f, dir: E, color: new o.Color(u.color).lerp(X, 0.7), text: u.final }), s.current.length > ve && s.current.shift();
627
+ }
628
+ if (n.current.size > 200)
629
+ for (const u of n.current) T.runs.has(u) || n.current.delete(u);
630
+ s.current = s.current.filter((u) => p - u.start < 5200), S.setScale(e.height, t.getPixelRatio(), r.fov), S.begin();
631
+ const c = M.getAttribute("position"), l = M.getAttribute("color");
632
+ let v = 0;
633
+ const { h: b, p: w } = d;
634
+ for (let u = 0; u < ve; u++) {
635
+ const a = s.current[u], f = i.current[u], y = h.current[u];
636
+ if (!a) {
637
+ f == null || f.setOpacity(0);
638
+ continue;
639
+ }
640
+ const R = (p - a.start) / 1e3;
641
+ f && y && (y.position.copy(a.from).add(w.set(0, -2.3, 0)), g.current[u] !== a.run + a.start && (g.current[u] = a.run + a.start, f.setText(`final answer - ${a.text.length > 64 ? a.text.slice(0, 62) + "…" : a.text}`)), f.setOpacity(Y(R / 0.3) * Y((5.2 - R) / 1.2)));
642
+ const E = R / vo;
643
+ if (E >= 1.25) continue;
644
+ const N = 24 * (ee ? 0.6 : 1) * ye(Math.min(1, E)), U = 7.5 * Math.min(1, E * 3) * (E > 1 ? Math.max(0, 1 - (E - 1) / 0.25) : 1), V = E > 1 ? Math.max(0, 1 - (E - 1) / 0.25) : 1, D = -a.dir.y, H = a.dir.x;
645
+ for (let O = 0; O < xe; O++)
646
+ for (let j = 0; j < we; j++)
647
+ for (let P = 0; P < 2; P++) {
648
+ const I = (j + P) / we, k = (O - 1) * 0.05 * (1 - I);
649
+ w.copy(a.from).addScaledVector(a.dir, N - U * (1 - I));
650
+ const K = ((v * xe + O) * we + j) * 2 + P;
651
+ c.setXYZ(K, w.x + D * k, w.y + H * k, w.z);
652
+ const $ = Math.pow(I, 2) * (O === 1 ? 2.6 : 1.2) * V;
653
+ l.setXYZ(K, a.color.r * $, a.color.g * $, a.color.b * $);
654
+ }
655
+ v++, b.copy(a.from).addScaledVector(a.dir, N), S.add(b, 1.3, X, 1.6 * V), S.add(b, 3.2, Ce, 0.35 * V);
656
+ for (let O = 1; O <= Me; O++) {
657
+ const j = O / Me * U;
658
+ w.copy(a.from).addScaledVector(a.dir, N - j), w.y += Math.sin(O * 2.3 + a.start) * 0.08, S.add(w, 0.5 * (1 - O / (Me + 1)), a.color, 0.9 * V * (1 - O / (Me + 1)));
659
+ }
660
+ }
661
+ M.setDrawRange(0, v * xe * we * 2), c.needsUpdate = !0, l.needsUpdate = !0, S.end();
662
+ }), /* @__PURE__ */ W(oe, { children: [
663
+ /* @__PURE__ */ m("lineSegments", { geometry: M, material: z, frustumCulled: !1 }),
664
+ /* @__PURE__ */ m("primitive", { object: S.obj }),
665
+ Array.from({ length: ve }, (p, c) => /* @__PURE__ */ m("group", { ref: (l) => void (h.current[c] = l), children: /* @__PURE__ */ m(Se, { ref: (l) => void (i.current[c] = l), text: "", color: "#e0e7ff", size: 0.26, maxWidth: 11, opacity: 0, pxRange: [8, 12], renderOrder: 24 }) }, c))
666
+ ] });
667
+ }
668
+ function bo() {
669
+ const [e, t] = Re([]), r = B(/* @__PURE__ */ new Set()), n = B(-1);
670
+ return Z(() => {
671
+ const s = T.runs;
672
+ let i = s.size !== r.current.size || n.current !== he.version;
673
+ if (!i)
674
+ for (const h of s.keys()) r.current.has(h) || (i = !0);
675
+ i && (r.current = new Set(s.keys()), n.current = he.version, t([...s.values()].filter((h) => tt(h.id))));
676
+ }), /* @__PURE__ */ W(oe, { children: [
677
+ e.map((s) => /* @__PURE__ */ m(mo, { run: s }, s.id)),
678
+ /* @__PURE__ */ m(wo, {})
679
+ ] });
680
+ }
681
+ const yo = (
682
+ /* glsl */
683
+ `
684
+ varying vec3 vDir;
685
+ void main(){ vDir = normalize(position); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`
686
+ ), So = (
687
+ /* glsl */
688
+ `
689
+ varying vec3 vDir;
690
+ float h(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
691
+ float n(vec2 p){ vec2 i = floor(p); vec2 f = fract(p); f = f*f*(3.0-2.0*f);
692
+ return mix(mix(h(i), h(i+vec2(1,0)), f.x), mix(h(i+vec2(0,1)), h(i+vec2(1,1)), f.x), f.y); }
693
+ float fbm(vec2 p){ float s = 0.0, a = 0.5; for (int i = 0; i < 5; i++){ s += a*n(p); p *= 2.03; a *= 0.5; } return s; }
694
+ void main(){
695
+ vec3 d = normalize(vDir);
696
+ // zenith indigo → horizon deep navy
697
+ vec3 top = vec3(0.007, 0.009, 0.042);
698
+ vec3 mid = vec3(0.0035, 0.0045, 0.02);
699
+ vec3 low = vec3(0.0012, 0.0016, 0.007);
700
+ float y = d.y;
701
+ vec3 col = y > 0.0 ? mix(mid, top, smoothstep(0.0, 0.85, y)) : mix(mid, low, smoothstep(0.0, -0.7, y));
702
+ // Milky Way: a soft dusty band tilted across the sky
703
+ vec3 bn = normalize(vec3(0.42, 0.9, -0.12));
704
+ float band = exp(-pow(dot(d, bn) / 0.2, 2.0));
705
+ vec2 uv = vec2(atan(d.x, -d.z), dot(d, bn)) * vec2(3.0, 9.0);
706
+ float dust = fbm(uv * 1.3);
707
+ float lanes = smoothstep(0.45, 0.75, fbm(uv * 2.4 + 7.0));
708
+ 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);
709
+ gl_FragColor = vec4(col, 1.0);
710
+ }`
711
+ ), Mo = (
712
+ /* glsl */
713
+ `
714
+ attribute float aSize; attribute float aPhase; attribute vec3 aColor;
715
+ uniform float uTime; uniform float uScale; varying vec3 vC;
716
+ void main(){
717
+ vec4 mv = modelViewMatrix * vec4(position, 1.0);
718
+ float tw = 0.78 + 0.22 * sin(uTime * (0.6 + fract(aPhase * 7.3) * 1.6) + aPhase * 6.2831);
719
+ vC = aColor * tw;
720
+ gl_PointSize = max(1.0, aSize * uScale / -mv.z);
721
+ gl_Position = projectionMatrix * mv;
722
+ }`
723
+ ), xo = (
724
+ /* glsl */
725
+ `
726
+ varying vec3 vC;
727
+ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
728
+ float core = smoothstep(0.5, 0.0, r); float halo = pow(1.0 - r, 3.0);
729
+ gl_FragColor = vec4(vC * (core + halo * 0.35), 1.0); }`
730
+ ), it = ["#ffffff", "#dbe7ff", "#b9cdff", "#9fb8ff", "#fff3dd", "#ffe2bf"].map((e) => new o.Color(e));
731
+ function Ao() {
732
+ const { size: e, gl: t, camera: r } = Te(), n = C(() => {
733
+ const i = ee ? 1600 : 3200, h = new Float32Array(i * 3), g = new Float32Array(i), M = new Float32Array(i), z = new Float32Array(i * 3), S = new o.Vector3(0.42, 0.9, -0.12).normalize(), d = new o.Vector3();
734
+ let p = 1234567;
735
+ const c = () => (p = p * 16807 % 2147483647) / 2147483647;
736
+ for (let v = 0; v < i; v++) {
737
+ for (let f = 0; f < 8 && (d.set(c() * 2 - 1, c() * 2 - 1, c() * 2 - 1), !(!(d.lengthSq() > 1 || d.lengthSq() < 0.01) && (d.normalize(), !(v % 5 < 2 && Math.abs(d.dot(S)) > 0.22)))); f++)
738
+ ;
739
+ d.z > 0.3 && (d.z *= -1);
740
+ const b = 110 + c() * 60;
741
+ h.set([d.x * b, d.y * b, d.z * b], v * 3);
742
+ const w = Math.pow(c(), 3.2);
743
+ g[v] = 0.55 + w * 2.6, M[v] = c();
744
+ const u = it[Math.floor(c() * it.length)], a = 0.22 + w * 0.75;
745
+ z.set([u.r * a, u.g * a, u.b * a], v * 3);
746
+ }
747
+ const l = new o.BufferGeometry();
748
+ return l.setAttribute("position", new o.BufferAttribute(h, 3)), l.setAttribute("aSize", new o.BufferAttribute(g, 1)), l.setAttribute("aPhase", new o.BufferAttribute(M, 1)), l.setAttribute("aColor", new o.BufferAttribute(z, 3)), l;
749
+ }, []), s = C(
750
+ () => ({
751
+ dome: new o.ShaderMaterial({ vertexShader: yo, fragmentShader: So, side: o.BackSide, depthWrite: !1 }),
752
+ stars: new o.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uScale: { value: 400 } }, vertexShader: Mo, fragmentShader: xo, transparent: !0, depthWrite: !1, blending: o.AdditiveBlending })
753
+ }),
754
+ []
755
+ );
756
+ return Z(({ clock: i }) => {
757
+ s.stars.uniforms.uTime.value = ee ? 0 : i.elapsedTime, s.stars.uniforms.uScale.value = e.height * t.getPixelRatio() / (2 * Math.tan(r.fov * Math.PI / 360)) * 0.22;
758
+ }), /* @__PURE__ */ W(oe, { children: [
759
+ /* @__PURE__ */ m("mesh", { material: s.dome, renderOrder: -10, frustumCulled: !1, children: /* @__PURE__ */ m("sphereGeometry", { args: [400, 48, 32] }) }),
760
+ /* @__PURE__ */ m("points", { geometry: n, material: s.stars, frustumCulled: !1, renderOrder: -9 })
761
+ ] });
762
+ }
763
+ const Co = new o.Color("#6f7fb8"), zo = new o.Color("#ff6b7a"), Je = 0.95, Po = new o.MeshBasicMaterial({ colorWrite: !1, depthWrite: !1, transparent: !0, opacity: 0 });
764
+ function To({ inst: e, onSelect: t }) {
765
+ const r = B(null), n = B(null), s = B(null), i = B(null), h = B(null), g = B(null), M = B(null), z = B(null), S = C(() => [...e.id].reduce((w, u) => (w * 31 + u.charCodeAt(0)) % 9973, 7) / 9973, [e.id]), d = je[e.type], p = C(
766
+ () => ({
767
+ halo: ue(ze(), d),
768
+ spikes: ue(Dt(), d),
769
+ core: ue(ze(), "#fff"),
770
+ flare: ue(pt(), d),
771
+ corona: new o.MeshBasicMaterial({ color: Ye, blending: o.AdditiveBlending, transparent: !0, depthWrite: !1, toneMapped: !1 }),
772
+ sel: new o.MeshBasicMaterial({ color: "#dbe7ff", blending: o.AdditiveBlending, transparent: !0, depthWrite: !1, toneMapped: !1 })
773
+ }),
774
+ [d]
775
+ ), c = C(
776
+ () => ({ pos: new o.Vector3(), live: new o.Vector3(), init: !1, calls: e.llmCalls, flareAt: -1e9, flareK: 1, coronaK: 0, selK: 0, c: new o.Color() }),
777
+ // eslint-disable-next-line react-hooks/exhaustive-deps
778
+ []
779
+ ), l = _t(e);
780
+ qe(() => (J.set(e.id, c.live), () => {
781
+ J.get(e.id) === c.live && J.delete(e.id);
782
+ }), [e.id, c]), qe(() => {
783
+ p.spikes.rotation = (S - 0.5) * 0.5;
784
+ }, [p, S]), Z(({ clock: w }) => {
785
+ var ce, Q, A;
786
+ const u = performance.now(), a = w.elapsedTime, f = mt(e);
787
+ c.init ? c.pos.lerp(f, 0.05) : (c.pos.copy(f), c.init = !0);
788
+ const y = ee ? 0 : 0.05;
789
+ c.live.set(c.pos.x + Math.sin(a * 0.21 + S * 20) * y, c.pos.y + Math.cos(a * 0.17 + S * 13) * y, c.pos.z), (ce = r.current) == null || ce.position.copy(c.live), (Q = r.current) == null || Q.scale.setScalar(Et());
790
+ const R = (u - e.bornAt) / 1e3, E = e.parent && T.instances.has(e.parent) ? Je * 0.85 : 0.05, L = Y((R - E) / 0.55), N = ye(L), U = L > 0 ? Math.exp(-(R - E) * 3.2) : 0, V = e.exitAt ? (u - e.exitAt) / 1e3 : -1, D = V >= 0 ? Ae(V / 0.7) : 0, H = V >= 0 ? Y((V - 0.7) / 1.7) : 0, O = V < 0;
791
+ e.llmCalls !== c.calls && (c.calls = e.llmCalls, c.flareAt = u, c.flareK = e.pulse);
792
+ const j = (u - c.flareAt) / 1e3, P = Ot(e, u);
793
+ let I = !1;
794
+ for (const x of T.mcpPending.values()) x.instance === e.id && (I = !0);
795
+ const k = O && (e.status === "thinking" || e.status === "spawning"), K = ee ? 0 : 1, $ = 1 + (k ? 0.16 : 0.05) * Math.sin(a * 3.3 + S * 40) * Math.sin(a * 1.9 + S * 17) * K, ne = (k ? 1 : 0.62) * $ + P * 0.25 + U * 1.2;
796
+ c.c.copy(d), O || c.c.lerp(e.status === "failed" ? zo : Co, D);
797
+ const q = (1 - D * 0.8) * (1 - H), ie = l * N * (1 - D * 0.62);
798
+ if (i.current && (i.current.scale.setScalar(Math.max(1e-4, ie * (0.95 + P * 0.12))), p.core.color.copy(X).lerp(c.c, D).multiplyScalar(Math.min(1.6, ne) * q)), n.current && (n.current.scale.setScalar(Math.max(1e-4, ie * (k ? 3.4 : 2.7) * (1 + P * 0.18))), p.halo.color.copy(c.c).multiplyScalar(0.42 * ne * q)), s.current) {
799
+ const x = j < 1.2 ? Math.exp(-j * 2.6) * c.flareK * 0.5 : 0, F = (k ? 1 : 0.55) * (1 - D);
800
+ s.current.scale.setScalar(Math.max(1e-4, ie * (3 + P * 1.2 + x * 4 + U * 3))), p.spikes.color.copy(c.c).lerp(X, 0.3).multiplyScalar((0.55 * F * $ + P * 0.25 + x * 0.6 + U) * q);
801
+ }
802
+ if (h.current) {
803
+ const x = j < 1.1 && O;
804
+ if (h.current.visible = x, x) {
805
+ const F = ye(j / 1.1);
806
+ h.current.scale.setScalar(l * (0.8 + F * (1.6 + c.flareK * 1.4))), p.flare.color.copy(c.c).lerp(X, 0.4).multiplyScalar((1 - F) * (1 - F) * (0.35 + c.flareK * 0.3));
807
+ }
808
+ }
809
+ if (c.coronaK += ((I && O ? 1 : 0) - c.coronaK) * 0.08, g.current) {
810
+ g.current.visible = c.coronaK > 0.02;
811
+ const x = 0.75 + 0.25 * Math.sin(a * 2.4) * K;
812
+ g.current.scale.setScalar(l * (0.95 + 0.06 * x)), g.current.rotation.z = a * 0.6 * K, p.corona.color.copy(Ye).multiplyScalar(1.4 * c.coronaK * x);
813
+ }
814
+ c.selK += ((T.selected === e.id ? 1 : 0) - c.selK) * 0.12, M.current && (M.current.visible = c.selK > 0.02, M.current.scale.setScalar(l * (1.1 + (1 - c.selK) * 0.5)), p.sel.color.setScalar(0.9 * c.selK * q)), (A = z.current) == null || A.setOpacity(jt(e.id) ? N * (O ? 0.95 : 0.6 * (1 - H)) : 0);
815
+ });
816
+ const v = (w) => {
817
+ w.stopPropagation(), t(e.id);
818
+ }, b = e.id.split(":")[2];
819
+ return /* @__PURE__ */ W("group", { ref: r, children: [
820
+ /* @__PURE__ */ m("mesh", { geometry: nt, material: Po, scale: 0.75 * l, onClick: v, onPointerOver: () => document.body.style.cursor = "pointer", onPointerOut: () => document.body.style.cursor = "" }),
821
+ /* @__PURE__ */ m("sprite", { ref: n, material: p.halo, scale: 1e-4 }),
822
+ /* @__PURE__ */ m("sprite", { ref: s, material: p.spikes, scale: 1e-4 }),
823
+ /* @__PURE__ */ m("sprite", { ref: i, material: p.core, scale: 1e-4 }),
824
+ /* @__PURE__ */ m("sprite", { ref: h, material: p.flare, visible: !1 }),
825
+ /* @__PURE__ */ m("mesh", { ref: g, geometry: at, material: p.corona, visible: !1 }),
826
+ /* @__PURE__ */ m("mesh", { ref: M, geometry: at, material: p.sel, visible: !1 }),
827
+ /* @__PURE__ */ m(
828
+ Se,
829
+ {
830
+ ref: z,
831
+ position: [0, -0.95 * l - 0.35, 0],
832
+ text: `${e.name}${b !== void 0 ? ` ${Number(b) + 1}` : ""}`,
833
+ color: et[e.type],
834
+ size: e.subagent ? 0.22 : 0.28,
835
+ letterSpacing: 0.02,
836
+ opacity: 0,
837
+ pxRange: e.subagent ? [8, 11.5] : [9, 13.5]
838
+ }
839
+ )
840
+ ] });
841
+ }
842
+ function Ro({ onSelect: e }) {
843
+ const [t, r] = Re([]), n = B(/* @__PURE__ */ new Set()), s = B(-1);
844
+ return Z(() => {
845
+ const i = T.instances;
846
+ let h = i.size !== n.current.size || s.current !== he.version;
847
+ if (!h)
848
+ for (const g of i.keys()) n.current.has(g) || (h = !0);
849
+ h && (n.current = new Set(i.keys()), s.current = he.version, r([...i.values()].filter(kt)));
850
+ }), /* @__PURE__ */ m(oe, { children: t.map((i) => /* @__PURE__ */ m(To, { inst: i, onSelect: e }, i.id)) });
851
+ }
852
+ const ct = 96, lt = 32;
853
+ function Bo() {
854
+ const { size: e, gl: t, camera: r } = Te(), n = C(() => new rt(ct + lt, 28), []), s = C(() => new Pe(ct), []), i = C(() => new Le(lt), []), h = C(() => /* @__PURE__ */ new Map(), []), g = C(() => ({ ctrl: new o.Vector3(), h: new o.Vector3(), col: new o.Color(), a: new o.Vector3(), b: new o.Vector3() }), []);
855
+ return Z(({ clock: M }) => {
856
+ const z = performance.now(), S = ee ? 0 : M.elapsedTime;
857
+ i.setScale(e.height, t.getPixelRatio(), r.fov), n.begin(), s.begin(), i.begin();
858
+ const { ctrl: d, col: p, h: c } = g;
859
+ for (const l of h.keys()) T.instances.has(l) || h.delete(l);
860
+ for (const l of T.instances.values()) {
861
+ if (!l.parent) continue;
862
+ const v = J.get(l.parent), b = J.get(l.id), w = T.instances.get(l.parent);
863
+ if (!v || !b) continue;
864
+ const u = w && !w.exitAt && !l.exitAt ? 1 : 0;
865
+ let a = h.get(l.id) ?? 0;
866
+ const f = (z - l.bornAt) / 1e3;
867
+ if (u && f < Je && (a = 1), a += (u - a) * (u ? 0.08 : 0.03), h.set(l.id, a), a < 0.01) continue;
868
+ const y = v.distanceTo(b) || 1, R = Math.min(0.3, 0.55 * (w ? 1.35 : 1) / y), E = Math.min(0.3, 0.5 / y), L = Ae(f / Je);
869
+ d.copy(v).add(b).multiplyScalar(0.5);
870
+ const N = R + (1 - E - R) * L;
871
+ p.copy(je[l.type]).lerp(Ce, 0.5);
872
+ const U = L < 1;
873
+ n.add(v, d, b, p, (U ? 0.8 : 0.62) * a, R, N, U ? 0 : 0.55 * a, 1, S, U ? N : -1, 2.2), U ? (de(v, d, b, N, c), i.add(c, 0.55, X, 1.3)) : s.add(v, d, b, 1 - E - 0.04, 1, l.subagent ? 0.32 : 0.4, p, 0.95 * a);
874
+ }
875
+ for (const l of T.comets) {
876
+ const v = J.get(l.from), b = J.get(l.to);
877
+ if (!v || !b) continue;
878
+ const w = Y((z - l.start) / l.dur);
879
+ if (w >= 1) continue;
880
+ const u = T.instances.get(l.from), a = T.instances.get(l.to);
881
+ (a == null ? void 0 : a.parent) === l.from || (u == null ? void 0 : u.parent) === l.to ? d.copy(v).add(b).multiplyScalar(0.5) : be(v, b, 1.4, 0.8, d);
882
+ const y = Ae(w);
883
+ p.copy(u ? je[u.type] : Ce).lerp(X, 0.45);
884
+ const R = Math.min(1, w / 0.1) * Math.min(1, (1 - w) / 0.15);
885
+ n.add(v, d, b, p, 0.9 * R, Math.max(0, y - 0.2), y, 0, 1, S, y, 1.6 * R), de(v, d, b, y, c), i.add(c, 0.8, p, 1.4 * R);
886
+ }
887
+ n.end(), s.end(), i.end();
888
+ }), /* @__PURE__ */ W(oe, { children: [
889
+ /* @__PURE__ */ m("primitive", { object: n.obj }),
890
+ /* @__PURE__ */ m("primitive", { object: s.mesh }),
891
+ /* @__PURE__ */ m("primitive", { object: i.obj })
892
+ ] });
893
+ }
894
+ function Vo() {
895
+ return Z(() => {
896
+ Lt(), Nt();
897
+ }), null;
898
+ }
899
+ function ko({ children: e }) {
900
+ return /* @__PURE__ */ m("group", { position: [-1.6, 0, 0], children: e });
901
+ }
902
+ function No() {
903
+ const e = Ft(), [t, r] = Re(null);
904
+ return /* @__PURE__ */ W("div", { className: "scene-root", style: { background: "#040618" }, children: [
905
+ /* @__PURE__ */ W(yt, { camera: { position: [0, 0, 34], fov: 46, far: 1200 }, dpr: [1, 2], gl: { antialias: !0, powerPreference: "high-performance" }, onPointerMissed: () => r(null), children: [
906
+ /* @__PURE__ */ m("color", { attach: "background", args: ["#040618"] }),
907
+ /* @__PURE__ */ m(Vo, {}),
908
+ /* @__PURE__ */ m(Ao, {}),
909
+ /* @__PURE__ */ W(ko, { children: [
910
+ /* @__PURE__ */ m(so, { galaxy: e }),
911
+ /* @__PURE__ */ m(bo, {}),
912
+ /* @__PURE__ */ m(ho, {}),
913
+ /* @__PURE__ */ m(Bo, {}),
914
+ /* @__PURE__ */ m(Ro, { onSelect: r }),
915
+ /* @__PURE__ */ m(Jt, {})
916
+ ] }),
917
+ /* @__PURE__ */ m(bt, { makeDefault: !0, enablePan: !1, enableDamping: !0, dampingFactor: 0.06, minDistance: 14, maxDistance: 52, minPolarAngle: Math.PI * 0.22, maxPolarAngle: Math.PI * 0.78, minAzimuthAngle: -Math.PI * 0.35, maxAzimuthAngle: Math.PI * 0.35 }),
918
+ /* @__PURE__ */ W(St, { multisampling: 0, children: [
919
+ /* @__PURE__ */ m(Mt, { mipmapBlur: !0, intensity: 0.95, luminanceThreshold: 0.22, luminanceSmoothing: 0.35, radius: 0.7 }),
920
+ /* @__PURE__ */ m(xt, { eskil: !1, offset: 0.25, darkness: 0.75 })
921
+ ] })
922
+ ] }),
923
+ /* @__PURE__ */ m(
924
+ Gt,
925
+ {
926
+ title: "constellation · night sky",
927
+ 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",
928
+ selected: t,
929
+ onClose: () => r(null)
930
+ }
931
+ )
932
+ ] });
933
+ }
934
+ export {
935
+ No as default
936
+ };