agentglow 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +38 -3
  2. package/dist/chunks/KitScene-C3SZiKL5.js +2793 -0
  3. package/dist/chunks/index--dwzdFRh.js +753 -0
  4. package/dist/chunks/index-B2PGx_wt.js +1010 -0
  5. package/dist/chunks/index-BZOG_CQS.js +838 -0
  6. package/dist/chunks/index-BfGluv59.js +784 -0
  7. package/dist/chunks/index-Bm4te7Ug.js +980 -0
  8. package/dist/chunks/index-Bqv_wy49.js +889 -0
  9. package/dist/chunks/index-Bsmr7FwH.js +763 -0
  10. package/dist/chunks/index-Bw31uayO.js +792 -0
  11. package/dist/chunks/index-C4F16M9q.js +887 -0
  12. package/dist/chunks/index-CRRHsMqy.js +68 -0
  13. package/dist/chunks/index-CS8eZTr_.js +818 -0
  14. package/dist/chunks/index-CdzGoWrn.js +1086 -0
  15. package/dist/chunks/index-CvDEulcq.js +492 -0
  16. package/dist/chunks/index-DXBfdHew.js +1143 -0
  17. package/dist/chunks/index-DdCs_ye9.js +605 -0
  18. package/dist/chunks/index-_KrED-np.js +677 -0
  19. package/dist/index.js +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/types/AgentScene.d.ts +14 -1
  22. package/dist/types/world.d.ts +69 -0
  23. package/package.json +1 -1
  24. package/dist/chunks/ClusterBall-CPsd6JvJ.js +0 -1489
  25. package/dist/chunks/index-0Bqa57T_.js +0 -786
  26. package/dist/chunks/index-4JCQqMml.js +0 -831
  27. package/dist/chunks/index-55W5crSg.js +0 -63
  28. package/dist/chunks/index-78lWZCrQ.js +0 -984
  29. package/dist/chunks/index-Bv6_kdaq.js +0 -768
  30. package/dist/chunks/index-Cgb5ir1r.js +0 -688
  31. package/dist/chunks/index-CqVCWpP7.js +0 -796
  32. package/dist/chunks/index-D1O5v601.js +0 -1065
  33. package/dist/chunks/index-DOoA9htC.js +0 -1181
  34. package/dist/chunks/index-K__sPGRy.js +0 -1134
  35. package/dist/chunks/index-N0zWN8NS.js +0 -857
  36. package/dist/chunks/index-NiYqQci9.js +0 -936
  37. package/dist/chunks/index-PQRnbPiJ.js +0 -565
  38. package/dist/chunks/index-VOXn1m-Q.js +0 -848
  39. package/dist/chunks/index-o4vs5msj.js +0 -837
  40. package/dist/chunks/index-yos7IepY.js +0 -890
  41. package/dist/chunks/spread-CWdeDFd9.js +0 -35
@@ -0,0 +1,889 @@
1
+ var re = Object.defineProperty;
2
+ var ae = (u, e, a) => e in u ? re(u, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : u[e] = a;
3
+ var h = (u, e, a) => ae(u, typeof e != "symbol" ? e + "" : e, a);
4
+ import { jsxs as gt, jsx as P, Fragment as ce } from "react/jsx-runtime";
5
+ import { useFrame as ft, useThree as le } from "@react-three/fiber";
6
+ import { EffectComposer as he, Bloom as fe, Vignette as ue, Noise as de } from "@react-three/postprocessing";
7
+ import { useMemo as pe, useRef as $, useEffect as At } from "react";
8
+ import * as x from "three";
9
+ import { K as ge, v as me, f as nt, k as Z, w as q, q as ee, x as se, R as Me, d as $t, p as ye, e as be, S as st, c as Tt, T as ne, i as Ae, j as xe, G as we, L as xt, u as Re, t as Ge } from "./KitScene-C3SZiKL5.js";
10
+ var te;
11
+ const mt = typeof window < "u" && !!((te = window.matchMedia) != null && te.call(window, "(prefers-reduced-motion: reduce)").matches), it = mt ? 0.3 : 1, W = mt ? 9e3 : 24e3, ot = mt ? 3500 : 8e3, B = 12, J = mt ? 450 : 1100, kt = 9e3, Y = 64, Et = 31, Se = 4.6, rt = 28, _t = 64, St = 18, Lt = 16, ut = 8, X = Math.PI * 2, et = 200, Dt = 5.4, vt = 3.2, ze = ["planner", "researcher", "writer"], bt = Object.fromEntries(Object.entries(ne).map(([u, e]) => [u, new x.Color(e)])), ve = Ae, Ie = () => ({ used: !1, id: "", inst: null, seen: 0, x: 0, y: 0, z: 0, r: 1, g: 1, b: 1, omega: 0, bright: 0, swirl: 0, rscale: 1, tiltA: 0, tiltB: 0, count: 0, want: 0, rank: 0, ka: null, released: !1, p: 0, e: 0, waitMcp: 0 }), zt = et * 3, Ce = (u) => {
12
+ let e = 7;
13
+ for (let a = 0; a < u.length; a++) e = e * 31 + u.charCodeAt(a) >>> 0;
14
+ return e % 100003;
15
+ }, K = (u) => {
16
+ const e = Math.sin(u * 127.1 + 311.7) * 43758.5453;
17
+ return e - Math.floor(e);
18
+ };
19
+ function dt(u) {
20
+ const e = new x.BufferGeometry();
21
+ return e.setAttribute("position", new x.BufferAttribute(new Float32Array(u * 3), 3).setUsage(x.DynamicDrawUsage)), e.setAttribute("acol", new x.BufferAttribute(new Float32Array(u * 3), 3).setUsage(x.DynamicDrawUsage)), e.setAttribute("size", new x.BufferAttribute(new Float32Array(u), 1).setUsage(x.DynamicDrawUsage)), e;
22
+ }
23
+ const j = (u, e) => u.getAttribute(e).array, pt = (u) => {
24
+ u.getAttribute("position").needsUpdate = !0, u.getAttribute("acol").needsUpdate = !0, u.getAttribute("size").needsUpdate = !0;
25
+ };
26
+ function Jt() {
27
+ return new x.ShaderMaterial({
28
+ uniforms: { uScale: { value: 300 }, uPR: { value: 1 } },
29
+ vertexShader: (
30
+ /* glsl */
31
+ `
32
+ attribute vec3 acol;
33
+ attribute float size;
34
+ uniform float uScale;
35
+ uniform float uPR;
36
+ varying vec3 vC;
37
+ void main() {
38
+ vec4 mv = modelViewMatrix * vec4(position, 1.0);
39
+ gl_Position = projectionMatrix * mv;
40
+ gl_PointSize = min(96.0, size * uPR * uScale / max(0.5, -mv.z));
41
+ vC = acol;
42
+ if (size <= 0.0) gl_Position = vec4(2.0, 2.0, 2.0, 1.0);
43
+ }`
44
+ ),
45
+ fragmentShader: (
46
+ /* glsl */
47
+ `
48
+ varying vec3 vC;
49
+ void main() {
50
+ vec2 c = gl_PointCoord - 0.5;
51
+ float d = dot(c, c) * 4.0;
52
+ if (d > 1.0) discard;
53
+ float a = exp(-d * 3.2) - 0.04;
54
+ gl_FragColor = vec4(vC * max(a, 0.0), 1.0);
55
+ }`
56
+ ),
57
+ transparent: !0,
58
+ depthWrite: !1,
59
+ blending: x.AdditiveBlending
60
+ });
61
+ }
62
+ const R = new x.Vector3(), N = new x.Vector3(), T = new x.Vector3(), G = new x.Color(), Q = new x.Color(), tt = new x.Object3D(), V = new x.Color(1, 1, 1), Qt = new x.Color("#fbbf24"), Fe = new x.Color("#ef4444"), Pe = new x.Color("#ef4444");
63
+ class Be {
64
+ constructor() {
65
+ h(this, "material", Jt());
66
+ /** nebula points live in the (scaled) side graph group: their sprite size follows kit.graph.scale */
67
+ h(this, "nebMaterial", Jt());
68
+ h(this, "frame", 0);
69
+ h(this, "selectedId", null);
70
+ /** field radius (grows with the kit core so the murmuration always surrounds the agents + periphery) */
71
+ h(this, "fieldR", Et);
72
+ // ---- field
73
+ h(this, "fieldGeo", dt(W));
74
+ h(this, "fP", j(this.fieldGeo, "position"));
75
+ h(this, "fC", j(this.fieldGeo, "acol"));
76
+ h(this, "fS", j(this.fieldGeo, "size"));
77
+ h(this, "fYb", new Float32Array(W));
78
+ h(this, "fIvx", new Float32Array(W));
79
+ h(this, "fIvz", new Float32Array(W));
80
+ h(this, "fHeat", new Float32Array(W));
81
+ h(this, "fT", new Float32Array(W * 3));
82
+ h(this, "fOwner", new Int16Array(W).fill(-1));
83
+ h(this, "fAng", new Float32Array(W));
84
+ h(this, "fOrb", new Float32Array(W));
85
+ h(this, "fRnd", new Float32Array(W));
86
+ // ---- slots (agent eddies, one per drawn kit agent)
87
+ h(this, "slots", Array.from({ length: Y }, Ie));
88
+ h(this, "idToSlot", /* @__PURE__ */ new Map());
89
+ h(this, "pendingByInst", /* @__PURE__ */ new Map());
90
+ // ---- runs (pooled vortices, one per drawn kit run; a vortex fades out after its run leaves the kit)
91
+ h(this, "runRef", new Array(B).fill(null));
92
+ h(this, "runKit", new Array(B).fill(null));
93
+ h(this, "runId", new Array(B).fill(""));
94
+ h(this, "runPool", /* @__PURE__ */ new Map());
95
+ h(this, "rPresent", new Uint8Array(B));
96
+ h(this, "rSteps", new Uint8Array(B));
97
+ h(this, "rX", new Float32Array(B));
98
+ h(this, "rZ", new Float32Array(B));
99
+ /** vortex loop radius per run (around its agents) */
100
+ h(this, "rR", new Float32Array(B).fill(Se));
101
+ /** step attractors (x, z) per run: at the kit's role slots (plan | research | write) */
102
+ h(this, "rAt", new Float32Array(B * 6));
103
+ h(this, "rAlpha", new Float32Array(B));
104
+ h(this, "rCol", Array.from({ length: B }, () => new x.Color()));
105
+ h(this, "rColStr", new Array(B).fill(""));
106
+ h(this, "runGeo", dt(B * J));
107
+ h(this, "rTh", new Float32Array(B * J));
108
+ h(this, "rSp", new Float32Array(B * J));
109
+ h(this, "rRr", new Float32Array(B * J));
110
+ h(this, "rY", new Float32Array(B * J));
111
+ // ---- nebula (FalkorDB side current; local frame of the kit side graph)
112
+ h(this, "nebGeo", dt(ot));
113
+ h(this, "anchorGeo", dt(et));
114
+ h(this, "nA", new Uint16Array(ot));
115
+ h(this, "nO", new Float32Array(ot * 3));
116
+ h(this, "nSpin", new Float32Array(ot));
117
+ h(this, "nB", new Float32Array(ot));
118
+ h(this, "aLocal", new Float32Array(et * 3));
119
+ h(this, "aCol", new Float32Array(et * 3));
120
+ h(this, "aNamed", new Uint8Array(et));
121
+ h(this, "burst", new Float32Array(et));
122
+ h(this, "burstW", new Float32Array(et));
123
+ h(this, "flareCol", new Float32Array(et * 3));
124
+ h(this, "nameIdx", /* @__PURE__ */ new Map());
125
+ h(this, "nebAngle", 0.4);
126
+ h(this, "nAnchors", 0);
127
+ h(this, "edgeGeo", new x.BufferGeometry());
128
+ h(this, "edgeA", new Uint16Array(zt * 2));
129
+ h(this, "nEdge", 0);
130
+ h(this, "lastFlareId", 0);
131
+ h(this, "lastFlare", null);
132
+ // ---- streams + lines
133
+ h(this, "streamGeo", dt(kt));
134
+ h(this, "beamGeo");
135
+ h(this, "glowGeo", dt(Y + B * 3 + ut));
136
+ // ---- meshes
137
+ h(this, "cores");
138
+ h(this, "attractors");
139
+ h(this, "stepRings");
140
+ h(this, "rings");
141
+ h(this, "pulsars");
142
+ h(this, "pulsarBeams");
143
+ h(this, "selRing");
144
+ h(this, "ringStart", new Float32Array(rt).fill(-1e9));
145
+ h(this, "ringDur", new Float32Array(rt).fill(1));
146
+ h(this, "ringMax", new Float32Array(rt));
147
+ h(this, "ringPos", new Float32Array(rt * 3));
148
+ h(this, "ringCol", new Float32Array(rt * 3));
149
+ h(this, "ringNext", 0);
150
+ h(this, "mcpSpin", new Float32Array(ut));
151
+ // ------------------------------------------------------------------ frame
152
+ /** kit fit size multiplier for eddies, sampled once per frame */
153
+ h(this, "lodK", 1);
154
+ // active runs / swirls packed for the hot loop
155
+ h(this, "aX", new Float32Array(B));
156
+ h(this, "aZ", new Float32Array(B));
157
+ h(this, "aA", new Float32Array(B));
158
+ h(this, "aRR", new Float32Array(B));
159
+ h(this, "aR", new Float32Array(B * 3));
160
+ h(this, "sX", new Float32Array(Y));
161
+ h(this, "sZ", new Float32Array(Y));
162
+ h(this, "sS", new Float32Array(Y));
163
+ h(this, "stTh", new Float32Array(3));
164
+ h(this, "stB", new Float32Array(3));
165
+ for (let t = 0; t < W; t++) {
166
+ const s = Math.sqrt(Math.random()) * Et, m = Math.random() * X;
167
+ this.fP[t * 3] = Math.cos(m) * s, this.fP[t * 3 + 2] = Math.sin(m) * s, this.fYb[t] = (Math.random() - 0.5) * (0.6 + s * 0.05), this.fP[t * 3 + 1] = this.fYb[t], this.fRnd[t] = Math.random(), this.fOrb[t] = 0.16 + 1.35 * Math.pow(Math.random(), 1.5), this.fAng[t] = Math.random() * X;
168
+ }
169
+ for (let t = 0; t < B * J; t++) {
170
+ this.rTh[t] = Math.random() * X, this.rSp[t] = 0.2 + Math.random() * 0.14;
171
+ const s = (Math.random() + Math.random() + Math.random() - 1.5) * 0.55;
172
+ this.rRr[t] = s, this.rY[t] = (Math.random() - 0.5) * 0.35;
173
+ }
174
+ for (let t = 0; t < ot; t++) {
175
+ const s = 0.18 + 0.55 * Math.pow(Math.random(), 3), m = Math.random() * X, w = s * Math.sqrt(-2 * Math.log(1 - Math.random() * 0.98));
176
+ this.nO[t * 3] = Math.cos(m) * w, this.nO[t * 3 + 1] = (Math.random() - 0.5) * s * 0.8, this.nO[t * 3 + 2] = Math.sin(m) * w, this.nSpin[t] = (0.15 + Math.random() * 0.5) * (Math.random() < 0.5 ? 1 : 0.6), this.nB[t] = 0.5 + Math.random() * 0.7;
177
+ }
178
+ this.anchorGeo.setDrawRange(0, 0), this.edgeGeo.setAttribute("position", new x.BufferAttribute(new Float32Array(zt * 2 * 3), 3)), this.edgeGeo.setAttribute("color", new x.BufferAttribute(new Float32Array(zt * 2 * 3), 3).setUsage(x.DynamicDrawUsage)), this.edgeGeo.setDrawRange(0, 0), this.edgeGeo.boundingSphere = new x.Sphere(new x.Vector3(), 50);
179
+ const e = _t + Lt * St;
180
+ this.beamGeo = new x.BufferGeometry(), this.beamGeo.setAttribute("position", new x.BufferAttribute(new Float32Array(e * 6), 3).setUsage(x.DynamicDrawUsage)), this.beamGeo.setAttribute("color", new x.BufferAttribute(new Float32Array(e * 6), 3).setUsage(x.DynamicDrawUsage));
181
+ const a = new x.Sphere(new x.Vector3(), 400), o = new x.MeshBasicMaterial({ toneMapped: !1 });
182
+ this.cores = new x.InstancedMesh(new x.IcosahedronGeometry(0.26, 3), o, Y), this.attractors = new x.InstancedMesh(new x.IcosahedronGeometry(0.3, 3), new x.MeshBasicMaterial({ toneMapped: !1 }), B * 3);
183
+ const n = new x.RingGeometry(0.9, 1, 96);
184
+ n.rotateX(-Math.PI / 2);
185
+ const i = () => new x.MeshBasicMaterial({ toneMapped: !1, transparent: !0, blending: x.AdditiveBlending, depthWrite: !1, side: x.DoubleSide });
186
+ this.stepRings = new x.InstancedMesh(new x.RingGeometry(0.93, 1, 6, 1).rotateX(-Math.PI / 2), i(), B * 3), this.rings = new x.InstancedMesh(n, i(), rt), this.pulsars = new x.InstancedMesh(new x.OctahedronGeometry(0.42, 0), new x.MeshBasicMaterial({ toneMapped: !1 }), ut);
187
+ const l = new x.ConeGeometry(0.12, 3.2, 8, 1, !0);
188
+ l.translate(0, 1.6, 0);
189
+ const d = l.clone().rotateX(Math.PI), r = new x.BufferGeometry();
190
+ {
191
+ const t = l.getAttribute("position").array, s = d.getAttribute("position").array, m = l.getIndex().array, w = d.getIndex().array, S = new Float32Array(t.length + s.length);
192
+ S.set(t), S.set(s, t.length);
193
+ const z = [...m, ...Array.from(w, (v) => v + t.length / 3)];
194
+ r.setAttribute("position", new x.BufferAttribute(S, 3)), r.setIndex(z);
195
+ }
196
+ this.pulsarBeams = new x.InstancedMesh(r, i(), ut);
197
+ for (const t of [this.cores, this.attractors, this.stepRings, this.rings, this.pulsars, this.pulsarBeams]) {
198
+ t.boundingSphere = a, t.frustumCulled = !1, t.instanceMatrix.setUsage(x.DynamicDrawUsage), t.setColorAt(0, G.setRGB(0, 0, 0));
199
+ for (let s = 0; s < t.count; s++)
200
+ tt.position.set(0, -999, 0), tt.scale.setScalar(1e-4), tt.updateMatrix(), t.setMatrixAt(s, tt.matrix), t.setColorAt(s, G.setRGB(0, 0, 0));
201
+ }
202
+ this.selRing = new x.Mesh(new x.RingGeometry(1.25, 1.33, 64).rotateX(-Math.PI / 2), i()), this.selRing.visible = !1;
203
+ }
204
+ /**
205
+ * Swap in a new graph sample (the session's graph grows while it runs). Anchors are laid out per node id (stable:
206
+ * a node never moves when others arrive), new anchors take over a share of the nebula particles. No reset.
207
+ */
208
+ setGalaxy(e) {
209
+ const a = Math.min(et, e.nodes.length), o = this.nAnchors;
210
+ this.nAnchors = a, this.nameIdx.clear();
211
+ const n = /* @__PURE__ */ new Map();
212
+ for (let s = 0; s < a; s++) {
213
+ const m = e.nodes[s];
214
+ this.nameIdx.set(m.name.toLowerCase(), s), n.set(m.id, s);
215
+ const w = Ce(m.id), S = K(w), z = 0.5 + (Dt - 0.9) * Math.sqrt(S) + (K(w + 1) - 0.5) * 0.45, v = w % 3 / 3 * X + z * 1.15 + (K(w + 2) - 0.5) * 0.5;
216
+ this.aLocal[s * 3] = Math.cos(v) * z, this.aLocal[s * 3 + 1] = (K(w + 3) - 0.5) * 0.7 * (1.3 - S) + 0.4, this.aLocal[s * 3 + 2] = Math.sin(v) * z, G.set(ge[m.kind] ?? "#94a3b8"), this.aCol[s * 3] = G.r, this.aCol[s * 3 + 1] = G.g, this.aCol[s * 3 + 2] = G.b, this.aNamed[s] = s < 22 ? 1 : 0;
217
+ }
218
+ if (a > 0) {
219
+ const s = o > 0 && a > o ? (a - o) / a : o > 0 ? 0 : 1;
220
+ for (let m = 0; m < ot; m++)
221
+ this.nA[m] >= a ? this.nA[m] = Math.floor(Math.random() * a) : s > 0 && Math.random() < s && (this.nA[m] = o > 0 ? o + Math.floor(Math.random() * (a - o)) : Math.random() < 0.2 ? Math.floor(Math.random() * Math.min(22, a)) : Math.floor(Math.random() * a));
222
+ }
223
+ this.anchorGeo.setDrawRange(0, a);
224
+ const i = this.edgeA;
225
+ let l = 0;
226
+ const d = /* @__PURE__ */ new Set(), r = (s, m) => {
227
+ if (s === m || l >= zt) return;
228
+ const w = s < m ? s * 4096 + m : m * 4096 + s;
229
+ d.has(w) || (d.add(w), i[l * 2] = s, i[l * 2 + 1] = m, l++);
230
+ }, t = this.aLocal;
231
+ for (const s of e.links) {
232
+ const m = n.get(s.source), w = n.get(s.target);
233
+ if (m !== void 0 && w !== void 0) {
234
+ const S = t[m * 3] - t[w * 3], z = t[m * 3 + 2] - t[w * 3 + 2];
235
+ S * S + z * z < 9 && r(m, w);
236
+ }
237
+ }
238
+ for (let s = 0; s < a; s++) {
239
+ let m = -1, w = 1e9, S = -1, z = 1e9;
240
+ for (let v = 0; v < a; v++) {
241
+ if (v === s) continue;
242
+ const p = t[s * 3] - t[v * 3], y = t[s * 3 + 1] - t[v * 3 + 1], I = t[s * 3 + 2] - t[v * 3 + 2], c = p * p + y * y + I * I;
243
+ c < w ? (S = m, z = w, m = v, w = c) : c < z && (S = v, z = c);
244
+ }
245
+ m >= 0 && r(s, m), S >= 0 && s % 2 === 0 && r(s, S);
246
+ }
247
+ this.nEdge = l, this.edgeGeo.setDrawRange(0, l * 2);
248
+ }
249
+ dispose() {
250
+ for (const e of [this.edgeGeo, this.fieldGeo, this.runGeo, this.nebGeo, this.anchorGeo, this.streamGeo, this.beamGeo, this.glowGeo]) e.dispose();
251
+ for (const e of [this.cores, this.attractors, this.stepRings, this.rings, this.pulsars, this.pulsarBeams])
252
+ e.geometry.dispose(), e.material.dispose(), e.dispose();
253
+ this.material.dispose(), this.nebMaterial.dispose();
254
+ }
255
+ // ------------------------------------------------------------------ helpers
256
+ anchorIdx(e) {
257
+ const a = e.toLowerCase();
258
+ let o = this.nameIdx.get(a);
259
+ if (o === void 0) {
260
+ let n = 7;
261
+ for (let i = 0; i < a.length; i++) n = n * 31 + a.charCodeAt(i) >>> 0;
262
+ o = n % Math.max(1, this.nAnchors), this.nameIdx.set(a, o);
263
+ }
264
+ return o;
265
+ }
266
+ /** anchor in the nebula's local frame (rotated by the slow spin) */
267
+ anchorLocal(e, a) {
268
+ const o = Math.cos(this.nebAngle), n = Math.sin(this.nebAngle), i = this.aLocal[e * 3], l = this.aLocal[e * 3 + 2];
269
+ return a.set(i * o - l * n, this.aLocal[e * 3 + 1], i * n + l * o);
270
+ }
271
+ /** anchor on stage (the kit places + scales the side graph) */
272
+ anchorWorld(e, a) {
273
+ return me(this.anchorLocal(e, a), a);
274
+ }
275
+ slotOf(e) {
276
+ const a = this.idToSlot.get(e);
277
+ return a === void 0 ? null : this.slots[a];
278
+ }
279
+ /** stage position of a run's step attractor k (pool slot s) */
280
+ attractor(e, a, o) {
281
+ return o.set(this.rAt[e * 6 + a * 2], 0.35, this.rAt[e * 6 + a * 2 + 1]);
282
+ }
283
+ emitRing(e, a, o, n, i, l, d, r = 1) {
284
+ const t = this.ringNext++ % rt;
285
+ this.ringStart[t] = d, this.ringDur[t] = l, this.ringMax[t] = i, this.ringPos[t * 3] = e, this.ringPos[t * 3 + 1] = a, this.ringPos[t * 3 + 2] = o, this.ringCol[t * 3] = n.r * r, this.ringCol[t * 3 + 1] = n.g * r, this.ringCol[t * 3 + 2] = n.b * r;
286
+ }
287
+ alloc(e, a) {
288
+ const o = e.inst, n = this.slots.findIndex((r) => !r.used);
289
+ if (n < 0) return -1;
290
+ const i = this.slots[n], l = bt[o.type];
291
+ Object.assign(i, { used: !0, id: o.id, inst: o, ka: e, count: 0, released: !1, r: l.r, g: l.g, b: l.b, omega: 2, bright: 0.6, swirl: 0, p: 0, e: 0 }), i.tiltA = (K(n + a) - 0.5) * 0.7, i.tiltB = (K(n * 3.1 + a) - 0.5) * 0.7, i.rscale = ve(o.type) || e.depth > 0 ? 0.72 : 1, i.want = Math.round((i.rscale < 1 ? 380 : 620) * (mt ? 0.5 : 1));
292
+ const d = o.parent ? this.slotOf(o.parent) : null;
293
+ if (d ? (i.x = d.x, i.y = d.y, i.z = d.z) : (i.x = e.pos.x, i.y = 0.9, i.z = e.pos.z), this.idToSlot.set(o.id, n), this.emitRing(i.x, i.y, i.z, l, 2.4 * nt.scale, 0.9, a, 2.2), d) {
294
+ const r = this.idToSlot.get(o.parent);
295
+ let t = Math.floor(d.count * 0.28);
296
+ for (let s = 0; s < W && t > 0; s++)
297
+ this.fOwner[s] === r && s & 1 && (this.fOwner[s] = n, d.count--, i.count++, t--);
298
+ }
299
+ return n;
300
+ }
301
+ release(e, a) {
302
+ const o = this.slots[e], n = this.fP;
303
+ for (let i = 0; i < W; i++) {
304
+ if (this.fOwner[i] !== e) continue;
305
+ this.fOwner[i] = -1;
306
+ const l = n[i * 3] - o.x, d = n[i * 3 + 2] - o.z, r = Math.sqrt(l * l + d * d) + 1e-3, t = (2.4 + this.fRnd[i] * 3.6) * (mt ? 0.5 : 1);
307
+ this.fIvx[i] = l / r * t - d / r * o.omega * 0.5, this.fIvz[i] = d / r * t + l / r * o.omega * 0.5, this.fHeat[i] = 1, this.fT[i * 3] = o.r, this.fT[i * 3 + 1] = o.g, this.fT[i * 3 + 2] = o.b;
308
+ }
309
+ o.count = 0, G.setRGB(o.r, o.g, o.b).lerp(V, 0.5), this.emitRing(o.x, o.y, o.z, G, 3.2 * nt.scale, 1.1, a, 2.6);
310
+ }
311
+ /** Once per frame, after the kit's ticker (world tick -> lodTick -> kitTick). */
312
+ update(e, a, o) {
313
+ const n = Math.min(0.05, e);
314
+ this.lodK = nt.scale, this.frame++;
315
+ const i = Math.max(Et, Z.core.r + 20);
316
+ this.fieldR += (i - this.fieldR) * Math.min(1, n * 0.8), this.nebAngle += n * 0.04 * it, this.syncRuns(a, n), this.syncSlots(a, n, o), this.recruit(a), this.updateField(n, o), this.updateFlares(a), this.updateNebula(o), this.updateRunCurrents(a, o), this.updateStreams(a, o), this.updateMeshes(a, o, n);
317
+ }
318
+ syncRuns(e, a) {
319
+ var o;
320
+ this.rPresent.fill(0);
321
+ for (const n of Z.runs.values()) {
322
+ let i = this.runPool.get(n.id);
323
+ if (i === void 0) {
324
+ i = -1;
325
+ for (let l = 0; l < B; l++)
326
+ if (!this.runId[l] || this.rAlpha[l] < 0.01 && !this.runPool.has(this.runId[l])) {
327
+ i = l;
328
+ break;
329
+ }
330
+ if (i < 0)
331
+ for (let l = 0; l < B; l++) this.rAlpha[l] < 0.01 && !Z.runs.has(this.runId[l]) && (i = l, this.runPool.delete(this.runId[l]));
332
+ if (i < 0) continue;
333
+ this.runId[i] = n.id, this.runPool.set(n.id, i), this.rAlpha[i] = 0;
334
+ }
335
+ this.rPresent[i] = 1, this.runKit[i] = n, this.runRef[i] = n.run ?? q.runs.get(n.id) ?? null, this.rX[i] = n.origin.x, this.rZ[i] = n.origin.z, this.rR[i] = Math.max(2.6, Math.min(11, Math.hypot(n.hu, n.hv) * 0.92 + 0.6));
336
+ for (let l = 0; l < 3; l++)
337
+ ee(n, se(ze[l]), 0, R), this.rAt[i * 6 + l * 2] = R.x, this.rAt[i * 6 + l * 2 + 1] = R.z;
338
+ this.rSteps[i] = (o = this.runRef[i]) != null && o.hasSteps ? 1 : 0;
339
+ }
340
+ for (let n = 0; n < B; n++) {
341
+ this.rPresent[n] || this.runId[n] && this.rAlpha[n] < 0.01 && (this.runPool.get(this.runId[n]) === n && this.runPool.delete(this.runId[n]), this.runId[n] = "", this.runRef[n] = null, this.runKit[n] = null);
342
+ const i = this.runRef[n];
343
+ let l = 0;
344
+ i && this.rPresent[n] && (l = Math.min(1, (e - i.startedAt) / 1800), i.endedAt && (l *= Math.max(0, 1 - (e - i.endedAt - (Me - 3e3)) / 3e3))), i && i.color !== this.rColStr[n] && (this.rColStr[n] = i.color, this.rCol[n].set(i.color)), this.rAlpha[n] += (l - this.rAlpha[n]) * Math.min(1, a * 3);
345
+ }
346
+ }
347
+ syncSlots(e, a, o) {
348
+ const n = this.frame;
349
+ for (const d of Z.agents.values()) {
350
+ let r = this.idToSlot.get(d.id);
351
+ r !== void 0 && this.slots[r].ka !== d && (this.slots[r].ka = d), r === void 0 && (r = this.alloc(d, e)), !(r < 0) && (this.slots[r].seen = n, this.slots[r].inst = d.inst);
352
+ }
353
+ this.pendingByInst.clear();
354
+ for (const d of q.mcpPending.values()) this.pendingByInst.set(d.instance, Math.max(this.pendingByInst.get(d.instance) ?? 0, $t(d, e)));
355
+ const i = 1 - Math.exp(-a * 2.2), l = 1 - Math.exp(-a * 4);
356
+ for (let d = 0; d < Y; d++) {
357
+ const r = this.slots[d];
358
+ if (!r.used) continue;
359
+ const t = r.inst;
360
+ if (r.seen !== n) {
361
+ r.count > 0 && this.release(d, e), r.used = !1, r.inst = null, r.ka = null, this.idToSlot.delete(r.id);
362
+ continue;
363
+ }
364
+ const s = r.ka, m = s.pos.x, w = s.pos.z, S = 0.9 + Math.sin(o * 0.9 + d) * 0.18;
365
+ t.exitAt || (r.x += (m - r.x) * i, r.y += (S - r.y) * i, r.z += (w - r.z) * i), s.live.set(r.x, r.y, r.z), r.p = ye(t, e), r.e = be(t, e), r.waitMcp = this.pendingByInst.get(t.id) ?? -1;
366
+ const z = t.status === "thinking", v = t.status === "waiting";
367
+ let p = z ? 3.6 : v ? 0.7 : 2.2, y = z ? 1 : v ? 0.3 : 0.7;
368
+ r.waitMcp >= 0 && (p = 1, y = 0.45 + 0.3 * (0.5 + 0.5 * Math.sin(o * 3.2))), t.exitAt && (p = 0, y = 0), r.omega += (p * (1 + r.e * 0.7) * it - r.omega) * l, r.bright += (y + r.e * 1.2 - r.bright) * l, r.swirl = t.exitAt ? 0 : (z ? 1.6 : 0.6) * r.p * it, t.exitAt && !r.released && (r.released = !0, this.release(d, e));
369
+ }
370
+ }
371
+ recruit(e) {
372
+ const a = this.fP;
373
+ for (let o = 0; o < Y; o++) {
374
+ const n = this.slots[o];
375
+ if (!n.used || !n.inst || n.inst.exitAt) continue;
376
+ const i = (e - n.inst.bornAt) / 1e3, l = n.want * Math.min(1, i / 1.6);
377
+ for (let d = 0; d < 140 && n.count < l; d++) {
378
+ const r = Math.random() * W | 0;
379
+ if (this.fOwner[r] !== -1) continue;
380
+ const t = a[r * 3] - n.x, s = a[r * 3 + 2] - n.z;
381
+ t * t + s * s > 120 || (this.fOwner[r] = o, this.fAng[r] = Math.atan2(s, t), n.count++);
382
+ }
383
+ }
384
+ }
385
+ updateField(e, a) {
386
+ const o = this.fP, n = this.fC, i = this.fS, l = this.fOwner, d = this.slots, r = this.fRnd, t = e * it, s = a * it, m = 1 - Math.exp(-e * 2.8), w = Math.exp(-e * 0.5), S = Math.exp(-e * 1.3), z = 0.23 * s, v = 0.17 * s, p = 0.11 * s;
387
+ let y = 0;
388
+ for (let f = 0; f < B; f++)
389
+ this.rAlpha[f] < 0.01 || (this.aX[y] = this.rX[f], this.aZ[y] = this.rZ[f], this.aRR[y] = this.rR[f], this.aA[y] = this.rAlpha[f], this.aR[y * 3] = this.rCol[f].r, this.aR[y * 3 + 1] = this.rCol[f].g, this.aR[y * 3 + 2] = this.rCol[f].b, y++);
390
+ let I = 0;
391
+ for (const f of d)
392
+ !f.used || f.swirl <= 0.01 || (this.sX[I] = f.x, this.sZ[I] = f.z, this.sS[I] = f.swirl, I++);
393
+ const c = this.fieldR, b = c * c;
394
+ for (let f = 0; f < W; f++) {
395
+ const A = f * 3;
396
+ let M = o[A], g = o[A + 1], F = o[A + 2];
397
+ const _ = l[f];
398
+ if (_ >= 0) {
399
+ const O = d[_], k = this.fOrb[f] * O.rscale * (0.35 + 0.65 * O.p) * this.lodK, E = this.fAng[f] += O.omega * e / (0.3 + k), D = Math.cos(E), C = Math.sin(E), L = O.x + D * k, wt = O.z + C * k, It = O.y + (C * O.tiltA + D * O.tiltB) * k + (r[f] - 0.5) * 0.14;
400
+ M += (L - M) * m, g += (It - g) * m, F += (wt - F) * m;
401
+ const Mt = O.bright * (1.5 - k * 0.55) * (0.6 + 0.4 * r[f]);
402
+ n[A] = O.r * Mt + 0.05, n[A + 1] = O.g * Mt + 0.05, n[A + 2] = O.b * Mt + 0.05, i[f] = 0.5 + 0.35 * r[f];
403
+ } else {
404
+ const O = M * M + F * F, k = Math.sqrt(O) + 1e-4, E = k / 11, D = 1.25 * E / (1 + E * E);
405
+ let C = -F / k * D, L = M / k * D;
406
+ const wt = Math.sin(0.27 * M + z), It = Math.cos(0.27 * M + z), Mt = Math.sin(0.31 * F - v), jt = Math.cos(0.31 * F - v), Nt = 0.41 * F + 0.33 * M + p, ie = Math.sin(Nt), Wt = Math.cos(Nt);
407
+ C += (wt * -0.31 * Mt + 0.7 * 0.41 * Wt) * 3, L -= (0.27 * It * jt + 0.7 * 0.33 * Wt) * 3;
408
+ const Xt = wt * jt + 0.7 * ie + k * 0.09, Ct = 0.5 + 0.5 * Math.sin(Xt * 5.5), qt = Ct * Ct * Ct;
409
+ let Yt = 0, Kt = 0, Zt = 0;
410
+ for (let U = 0; U < y; U++) {
411
+ const H = M - this.aX[U], ct = F - this.aZ[U], yt = H * H + ct * ct, lt = this.aRR[U];
412
+ if (yt > lt * lt * 6.6) continue;
413
+ const Gt = Math.sqrt(yt) + 1e-4, Bt = Gt / lt, Ht = 2.6 * this.aA[U] * Bt * Math.exp(-Bt * Bt * 0.6);
414
+ C -= ct / Gt * Ht, L += H / Gt * Ht;
415
+ const Vt = Gt - lt, Ot = Math.exp(-Vt * Vt * 0.55) * this.aA[U];
416
+ Yt += this.aR[U * 3] * Ot, Kt += this.aR[U * 3 + 1] * Ot, Zt += this.aR[U * 3 + 2] * Ot;
417
+ }
418
+ for (let U = 0; U < I; U++) {
419
+ const H = M - this.sX[U], ct = F - this.sZ[U], yt = H * H + ct * ct;
420
+ if (yt > 16) continue;
421
+ const lt = this.sS[U] / (1 + yt * 0.9);
422
+ C -= ct * lt, L += H * lt;
423
+ }
424
+ C += this.fIvx[f], L += this.fIvz[f], this.fIvx[f] *= S, this.fIvz[f] *= S, M += C * t, F += L * t, g += (this.fYb[f] - g) * e * 1.2;
425
+ const Rt = this.fHeat[f] *= w, oe = C * C + L * L, Ft = (0.14 + qt * 2.8) * (0.6 + Math.min(1.2, oe * 0.3)) * (0.45 + 0.75 * r[f]), Pt = 0.5 + 0.5 * Math.sin(Xt * 1.3 + 1);
426
+ if (n[A] = (0.05 + 0.05 * Pt) * Ft + Yt * 0.42 + this.fT[A] * Rt * 1.8, n[A + 1] = (0.08 + 0.03 * Pt) * Ft + Kt * 0.42 + this.fT[A + 1] * Rt * 1.8, n[A + 2] = (0.2 - 0.04 * Pt) * Ft + Zt * 0.42 + this.fT[A + 2] * Rt * 1.8, i[f] = 0.26 + 0.2 * r[f] + qt * 0.12 + Rt * 0.35, O > b) {
427
+ const U = Math.sqrt(Math.random()) * c * 0.97, H = Math.random() * X;
428
+ M = Math.cos(H) * U, F = Math.sin(H) * U, this.fHeat[f] = 0, this.fIvx[f] = this.fIvz[f] = 0;
429
+ }
430
+ }
431
+ o[A] = M, o[A + 1] = g, o[A + 2] = F;
432
+ }
433
+ pt(this.fieldGeo);
434
+ }
435
+ updateFlares(e) {
436
+ if (this.burst.fill(0), this.burstW.fill(0), !this.nAnchors || !Z.graphWanted) return;
437
+ const a = Z.graph.scale;
438
+ for (const o of q.flares) {
439
+ const n = this.anchorIdx(o.node), i = (e - o.start) / 1e3, l = (1 - Math.exp(-i * 9)) * Math.exp(-i * 1.3);
440
+ if (o.id > this.lastFlareId) {
441
+ if (this.lastFlareId = o.id, this.anchorWorld(n, R), o.op === "write")
442
+ this.emitRing(R.x, R.y, R.z, V, 4.2 * a, 1.7, e, 2.4), this.emitRing(R.x, R.y, R.z, V, 2.2 * a, 1, e, 1.6);
443
+ else {
444
+ const d = q.instances.get(o.instance);
445
+ this.emitRing(R.x, R.y, R.z, d ? bt[d.type] : V, 1.1 * a, 0.7, e, 1.6);
446
+ }
447
+ this.lastFlare = { name: o.node, op: o.op, at: e, idx: n };
448
+ }
449
+ if (l > this.burst[n]) {
450
+ this.burst[n] = l;
451
+ const d = q.instances.get(o.instance), r = o.op === "write" ? V : d ? bt[d.type] : V;
452
+ this.flareCol[n * 3] = r.r, this.flareCol[n * 3 + 1] = r.g, this.flareCol[n * 3 + 2] = r.b, o.op === "write" && (this.burstW[n] = 1);
453
+ }
454
+ }
455
+ }
456
+ updateNebula(e) {
457
+ if (!this.nAnchors || !Z.graphWanted) return;
458
+ const a = j(this.nebGeo, "position"), o = j(this.nebGeo, "acol"), n = j(this.nebGeo, "size"), i = Math.cos(this.nebAngle), l = Math.sin(this.nebAngle), d = e * it, r = this.aLocal, t = this.aCol, s = this.flareCol;
459
+ for (let c = 0; c < ot; c++) {
460
+ const b = this.nA[c], f = this.burst[b], A = d * this.nSpin[c], M = Math.cos(A), g = Math.sin(A), F = this.nO[c * 3], _ = this.nO[c * 3 + 2], O = 1 + f * (2.2 + this.burstW[b] * 4.5), k = r[b * 3] + (F * M - _ * g) * O, E = r[b * 3 + 2] + (F * g + _ * M) * O, D = r[b * 3 + 1] + this.nO[c * 3 + 1] * O;
461
+ a[c * 3] = k * i - E * l, a[c * 3 + 1] = D, a[c * 3 + 2] = k * l + E * i;
462
+ const C = this.nB[c] * 0.3;
463
+ o[c * 3] = t[b * 3] * C + 0.05 + s[b * 3] * f * 2.4, o[c * 3 + 1] = t[b * 3 + 1] * C + 0.06 + s[b * 3 + 1] * f * 2.4, o[c * 3 + 2] = t[b * 3 + 2] * C + 0.12 + s[b * 3 + 2] * f * 2.4, n[c] = 0.3 + this.nB[c] * 0.2 + f * 0.5;
464
+ }
465
+ pt(this.nebGeo);
466
+ const m = j(this.anchorGeo, "position"), w = j(this.anchorGeo, "acol"), S = j(this.anchorGeo, "size"), z = this.nAnchors;
467
+ for (let c = 0; c < z; c++) {
468
+ const b = r[c * 3], f = r[c * 3 + 2];
469
+ m[c * 3] = b * i - f * l, m[c * 3 + 1] = r[c * 3 + 1], m[c * 3 + 2] = b * l + f * i;
470
+ const A = this.burst[c], M = this.aNamed[c] ? 2.2 : 1.1;
471
+ w[c * 3] = t[c * 3] * M + s[c * 3] * A * 7, w[c * 3 + 1] = t[c * 3 + 1] * M + s[c * 3 + 1] * A * 7, w[c * 3 + 2] = t[c * 3 + 2] * M + s[c * 3 + 2] * A * 7, S[c] = (this.aNamed[c] ? 1.25 : 0.75) * (1 + A * 3.5);
472
+ }
473
+ pt(this.anchorGeo);
474
+ const v = this.edgeGeo.getAttribute("position").array, p = this.edgeGeo.getAttribute("color").array, y = this.edgeA, I = this.nEdge * 2;
475
+ for (let c = 0; c < I; c++) {
476
+ const b = y[c], f = y[c ^ 1], A = r[b * 3], M = r[b * 3 + 2];
477
+ v[c * 3] = A * i - M * l, v[c * 3 + 1] = r[b * 3 + 1], v[c * 3 + 2] = A * l + M * i;
478
+ const g = Math.max(this.burst[b], this.burst[f] * 0.6);
479
+ p[c * 3] = t[b * 3] * 0.32 + 0.05 + s[b * 3] * g * 3, p[c * 3 + 1] = t[b * 3 + 1] * 0.32 + 0.06 + s[b * 3 + 1] * g * 3, p[c * 3 + 2] = t[b * 3 + 2] * 0.32 + 0.1 + s[b * 3 + 2] * g * 3;
480
+ }
481
+ this.edgeGeo.getAttribute("color").needsUpdate = !0, this.edgeGeo.getAttribute("position").needsUpdate = !0;
482
+ }
483
+ updateRunCurrents(e, a) {
484
+ const o = j(this.runGeo, "position"), n = j(this.runGeo, "acol"), i = j(this.runGeo, "size"), l = a * it, d = this.stTh, r = this.stB;
485
+ for (let t = 0; t < B; t++) {
486
+ const s = this.runRef[t], m = this.rAlpha[t], w = t * J;
487
+ if (!s || m < 0.01) {
488
+ for (let M = 0; M < J; M++) i[w + M] = 0;
489
+ continue;
490
+ }
491
+ const S = this.rX[t], z = this.rZ[t], v = this.rR[t];
492
+ for (let M = 0; M < 3; M++) {
493
+ const g = this.rAt[t * 6 + M * 2] - S, F = this.rAt[t * 6 + M * 2 + 1] - z;
494
+ d[M] = g * g + F * F < 0.6 ? -Math.PI / 2 : Math.atan2(F, g);
495
+ const _ = s.steps[st[M]];
496
+ r[M] = this.rSteps[t] ? _ === "running" ? 2.2 : _ === "done" ? 0.5 : 0 : 0;
497
+ }
498
+ const p = (e - s.handoffAt) / 1e3, y = this.rSteps[t] === 1 && s.handoffAt > 0 && p < 2.4, I = d[st.indexOf(s.handoffFrom)];
499
+ let c = (d[st.indexOf(s.handoffTo)] - I) % X;
500
+ c < 0 && (c += X);
501
+ const b = c * Math.min(1, 1 - Math.pow(1 - Math.min(1, p / 1.4), 3)), f = y ? 3.2 * (1 - p / 2.4) : 0, A = this.rCol[t];
502
+ for (let M = 0; M < J; M++) {
503
+ const g = w + M, F = this.rTh[g] + l * this.rSp[g], _ = v + this.rRr[g] + 0.16 * Math.sin(3 * F + l * 0.6 + g);
504
+ o[g * 3] = S + Math.cos(F) * _, o[g * 3 + 1] = 0.25 + this.rY[g], o[g * 3 + 2] = z + Math.sin(F) * _;
505
+ let O = 0;
506
+ for (let C = 0; C < 3; C++) {
507
+ if (r[C] === 0) continue;
508
+ let L = (F - d[C]) % X;
509
+ L < -Math.PI ? L += X : L > Math.PI && (L -= X), L > Math.PI && (L -= X), O += r[C] * Math.exp(-L * L * 2.2);
510
+ }
511
+ let k = 0;
512
+ if (y) {
513
+ let C = (F - I) % X;
514
+ if (C < 0 && (C += X), C <= b && C <= c + 0.1) {
515
+ const L = Math.exp(-(b - C) * 2.2);
516
+ O += f * (0.4 + L), k = 0.6 * L;
517
+ }
518
+ }
519
+ const E = Math.exp(-this.rRr[g] * this.rRr[g] * 4), D = m * (0.32 + 0.5 * E + O);
520
+ n[g * 3] = (A.r + (1 - A.r) * k) * D, n[g * 3 + 1] = (A.g + (1 - A.g) * k) * D, n[g * 3 + 2] = (A.b + (1 - A.b) * k) * D, i[g] = 0.36 + 0.28 * E + O * 0.12;
521
+ }
522
+ }
523
+ pt(this.runGeo);
524
+ }
525
+ updateStreams(e, a) {
526
+ const o = j(this.streamGeo, "position"), n = j(this.streamGeo, "acol"), i = j(this.streamGeo, "size");
527
+ let l = 0;
528
+ const d = (p, y, I, c, b, f, A) => {
529
+ l >= kt || (o[l * 3] = p, o[l * 3 + 1] = y, o[l * 3 + 2] = I, n[l * 3] = c, n[l * 3 + 1] = b, n[l * 3 + 2] = f, i[l] = A, l++);
530
+ }, r = (p, y, I, c, b) => {
531
+ const f = (p.x + y.x) / 2, A = (p.y + y.y) / 2 + I, M = (p.z + y.z) / 2, g = 1 - c;
532
+ return b.set(g * g * p.x + 2 * g * c * f + c * c * y.x, g * g * p.y + 2 * g * c * A + c * c * y.y, g * g * p.z + 2 * g * c * M + c * c * y.z);
533
+ };
534
+ for (let p = 0; p < B; p++) {
535
+ const y = this.runRef[p];
536
+ if (!y || !y.handoffAt) continue;
537
+ const I = (e - y.handoffAt) / 1e3;
538
+ if (I > 2.4 || !this.rSteps[p] || this.rAlpha[p] < 0.01) continue;
539
+ this.attractor(p, st.indexOf(y.handoffFrom), R), this.attractor(p, st.indexOf(y.handoffTo), N);
540
+ const c = this.rCol[p], b = 220;
541
+ for (let f = 0; f < b; f++) {
542
+ const A = (I - f / b * 1.4) / 0.9;
543
+ if (A < 0 || A > 1) continue;
544
+ r(R, N, 2.2, A, T);
545
+ const M = Math.sin(A * Math.PI) * 0.35, g = (1 - A * 0.4) * 2.4;
546
+ d(T.x + (K(f) - 0.5) * M, T.y + (K(f + 7) - 0.5) * M, T.z + (K(f + 13) - 0.5) * M, (c.r * 0.6 + 0.4) * g, (c.g * 0.6 + 0.4) * g, (c.b * 0.6 + 0.4) * g, 0.7 + (f % 9 === 0 ? 0.8 : 0));
547
+ }
548
+ }
549
+ for (const p of q.comets) {
550
+ const y = this.slotOf(p.from), I = this.slotOf(p.to);
551
+ if (!y || !I) continue;
552
+ const c = Math.min(1, (e - p.start) / p.dur), b = c < 0.5 ? 2 * c * c : 1 - Math.pow(-2 * c + 2, 2) / 2;
553
+ R.set(y.x, y.y, y.z), N.set(I.x, I.y, I.z);
554
+ const f = R.distanceTo(N), A = y.inst ? bt[y.inst.type] : V, M = c >= 1 ? Math.max(0, 1 - (e - p.start - p.dur) / 250) : 1;
555
+ for (let g = 0; g < 90; g++) {
556
+ const F = b - g * 55e-4;
557
+ if (F < 0) break;
558
+ r(R, N, 1.2 + f * 0.16, F, T);
559
+ const _ = g * 6e-3, O = (g === 0 ? 7 : 3.2 * Math.pow(1 - g / 90, 1.6)) * M;
560
+ d(T.x + (K(p.id + g) - 0.5) * _, T.y + (K(p.id * 3 + g) - 0.5) * _, T.z + (K(p.id * 7 + g) - 0.5) * _, (A.r * 0.7 + 0.3) * O, (A.g * 0.7 + 0.3) * O, (A.b * 0.7 + 0.3) * O, g === 0 ? 2.6 : 0.85 - g * 6e-3);
561
+ }
562
+ }
563
+ const t = this.beamGeo.getAttribute("position").array, s = this.beamGeo.getAttribute("color").array;
564
+ let m = 0;
565
+ const w = (p, y, I, c, b, f, A, M, g, F, _, O) => {
566
+ t.set([p, y, I, c, b, f], m * 6), s.set([A, M, g, F, _, O], m * 6), m++;
567
+ }, S = this.nAnchors > 0 && Z.graphWanted && Z.graph.mix > 0.05;
568
+ for (const p of q.flares) {
569
+ if (!S || m >= _t) break;
570
+ const y = this.slotOf(p.instance);
571
+ if (!y) continue;
572
+ const I = (e - p.start) / 2600;
573
+ if (I >= 1) continue;
574
+ this.anchorWorld(this.anchorIdx(p.node), N), R.set(y.x, y.y, y.z);
575
+ const c = p.op === "write", b = c ? V : y.inst ? bt[y.inst.type] : V, f = (1 - I) * (c ? 1.6 : 1);
576
+ w(R.x, R.y, R.z, N.x, N.y, N.z, b.r * f * 0.6, b.g * f * 0.6, b.b * f * 0.6, b.r * f * 1.4, b.g * f * 1.4, b.b * f * 1.4);
577
+ for (let A = 0; A < 22; A++) {
578
+ let M = ((e - p.start) / 1e3 * 0.75 + A / 22) % 1;
579
+ c || (M = 1 - M), r(R, N, 1.2, M, T);
580
+ const g = 2.4 * f * Math.sin(M * Math.PI);
581
+ d(T.x, T.y, T.z, b.r * g, b.g * g, b.b * g, 0.55);
582
+ }
583
+ }
584
+ for (const p of q.mcpCalls) {
585
+ const y = this.slotOf(p.instance), I = q.mcpServers.get(p.server), c = Tt(p.server);
586
+ if (!y || !I || !c) continue;
587
+ const b = (e - p.start) / p.dur;
588
+ if (b > 1) continue;
589
+ R.set(y.x, y.y, y.z), N.copy(c).setY(vt);
590
+ const f = p.phase === "call" ? R : N, A = p.phase === "call" ? N : R;
591
+ G.set(I.color);
592
+ const M = 1 - Math.pow(1 - b, 2);
593
+ for (let g = 0; g < 60; g++) {
594
+ const F = M - g * 8e-3;
595
+ if (F < 0) break;
596
+ r(f, A, 3, F, T);
597
+ const _ = (g === 0 ? 6 : 2.6 * (1 - g / 60)) * (p.phase === "result" ? 1.2 : 1);
598
+ d(T.x, T.y, T.z, (G.r * 0.75 + 0.25) * _, (G.g * 0.75 + 0.25) * _, (G.b * 0.75 + 0.25) * _, g === 0 ? 2.2 : 0.7);
599
+ }
600
+ }
601
+ let z = 0;
602
+ const v = (p, y, I, c) => {
603
+ if (z >= Lt) return;
604
+ const b = this.slotOf(p), f = q.mcpServers.get(y), A = Tt(y);
605
+ if (!b || !f || !A) return;
606
+ z++, R.set(b.x, b.y, b.z), N.copy(A).setY(vt), G.set(f.color), I < 2 ? G.lerp(Qt, Math.min(1, I / 2)) : G.copy(Qt).lerp(Fe, Math.min(1, I - 2));
607
+ const M = c >= 0 ? (1 - c) * 1.2 : 0.5 + Math.min(1.8, I * 0.6), g = a * 2.2;
608
+ let F = R.x, _ = R.y, O = R.z;
609
+ for (let k = 1; k <= St; k++) {
610
+ const E = k / St;
611
+ r(R, N, 3, E, T);
612
+ const D = 0.5 + 0.5 * Math.sin((E * 9 - g) * X * 0.5), C = M * (0.25 + 0.75 * D * D);
613
+ m < _t + Lt * St && w(F, _, O, T.x, T.y, T.z, G.r * C, G.g * C, G.b * C, G.r * C, G.g * C, G.b * C), F = T.x, _ = T.y, O = T.z;
614
+ }
615
+ if (c < 0) {
616
+ const k = 5 + Math.min(8, Math.floor(I * 3));
617
+ for (let E = 0; E < k; E++) {
618
+ const D = (a * (0.45 + I * 0.15) + E / k) % 1;
619
+ r(R, N, 3, D, T);
620
+ const C = M * 0.9;
621
+ d(T.x, T.y, T.z, G.r * C, G.g * C, G.b * C, 0.8);
622
+ }
623
+ } else {
624
+ const k = 1 - Math.min(1, c * 1.6);
625
+ for (let E = 0; E < 26; E++) {
626
+ const D = k + E * 0.012;
627
+ if (D > 1) break;
628
+ r(R, N, 3, D, T);
629
+ const C = (E === 0 ? 9 : 4 * (1 - E / 26)) * (1 - c * 0.5);
630
+ d(T.x, T.y, T.z, 0.6 * C + G.r * C * 0.4, 0.6 * C + G.g * C * 0.4, 0.6 * C + G.b * C * 0.4, E === 0 ? 2.8 : 0.9);
631
+ }
632
+ }
633
+ };
634
+ for (const p of q.mcpPending.values()) v(p.instance, p.server, $t(p, e), -1);
635
+ for (const p of q.mcpResolved) v(p.instance, p.server, (p.resolvedAt - p.since) / 1e3, Math.min(1, (e - p.resolvedAt) / 700));
636
+ for (let p = l; p < kt && i[p] !== 0; p++)
637
+ i[p] = 0;
638
+ this.streamGeo.setDrawRange(0, Math.max(l, 1)), pt(this.streamGeo), this.beamGeo.setDrawRange(0, m * 2), this.beamGeo.getAttribute("position").needsUpdate = !0, this.beamGeo.getAttribute("color").needsUpdate = !0;
639
+ }
640
+ setInst(e, a, o, n, i, l, d, r = 0, t = 0, s = 0) {
641
+ tt.position.set(o, n, i), tt.rotation.set(r, t, s), tt.scale.setScalar(Math.max(1e-4, l)), tt.updateMatrix(), e.setMatrixAt(a, tt.matrix), e.setColorAt(a, d);
642
+ }
643
+ updateMeshes(e, a, o) {
644
+ const n = j(this.glowGeo, "position"), i = j(this.glowGeo, "acol"), l = j(this.glowGeo, "size"), d = (t, s, m, w, S, z, v) => {
645
+ n[t * 3] = s, n[t * 3 + 1] = m, n[t * 3 + 2] = w, i[t * 3] = S.r * z, i[t * 3 + 1] = S.g * z, i[t * 3 + 2] = S.b * z, l[t] = v;
646
+ };
647
+ let r = null;
648
+ for (let t = 0; t < Y; t++) {
649
+ const s = this.slots[t];
650
+ if (!s.used || !s.inst) {
651
+ this.setInst(this.cores, t, 0, -999, 0, 0, G.setRGB(0, 0, 0)), l[t] = 0;
652
+ continue;
653
+ }
654
+ s.id === this.selectedId && (r = s);
655
+ const m = s.inst, w = (e - m.bornAt) / 1e3, S = Math.exp(-w * 3.5), z = m.exitAt ? (e - m.exitAt) / 1e3 : -1, v = z >= 0 ? Math.exp(-z * 5) : 0, y = m.status === "thinking" && !m.exitAt ? 0.1 * Math.sin(a * 9 + t) : 0, I = z >= 0 ? Math.pow(s.p, 1.6) : s.p, c = nt.scale, b = (I * (1 + s.e * 0.45 + y) + v * 0.9 + S * 0.6) * c;
656
+ G.setRGB(s.r, s.g, s.b).multiplyScalar(1.3 + s.bright * 1.5 + s.e * 1.1), G.lerp(Q.setRGB(4, 4, 4), Math.min(1, S + v)), this.setInst(this.cores, t, s.x, s.y, s.z, b, G, a * s.omega * 0.3, a * s.omega, 0), G.setRGB(s.r, s.g, s.b), d(t, s.x, s.y, s.z, G, (0.3 + s.bright * 0.4 + s.e * 0.5 + S * 2 + v * 2.5) * s.p + v, (5 + s.e * 4 + S * 10 + v * 14) * Math.max(s.p, v) * c);
657
+ }
658
+ r ? (this.selRing.visible = !0, this.selRing.position.set(r.x, r.y, r.z), this.selRing.rotation.y = a * 1.5, this.selRing.scale.setScalar(1 + 0.08 * Math.sin(a * 4)), this.selRing.material.color.setRGB(r.r * 3, r.g * 3, r.b * 3)) : this.selRing.visible = !1;
659
+ for (let t = 0; t < B; t++) {
660
+ const s = this.runRef[t], m = this.rAlpha[t];
661
+ for (let w = 0; w < 3; w++) {
662
+ const S = t * 3 + w, z = Y + S;
663
+ if (!s || m < 0.01 || !this.rSteps[t]) {
664
+ this.setInst(this.attractors, S, 0, -999, 0, 0, G.setRGB(0, 0, 0)), this.setInst(this.stepRings, S, 0, -999, 0, 0, G), l[z] = 0;
665
+ continue;
666
+ }
667
+ this.attractor(t, w, R);
668
+ const v = s.steps[st[w]], p = this.rCol[t];
669
+ let y = 0.6, I = 0.5, c = 0.25, b = 0.9, f = 0.12, A = 4;
670
+ if (G.copy(p), v === "running") {
671
+ const M = 0.5 + 0.5 * Math.sin(a * 5);
672
+ y = 1.15 + M * 0.2, G.lerp(V, 0.45), I = 3 + M * 1.5, c = 1.4 + M, b = 1.15 + M * 0.25, f = 1.1 + M * 0.6, A = 12;
673
+ } else v === "done" ? (y = 0.85, I = 1.8, c = 0.7, b = 0.95, f = 0.4, A = 6) : v === "failed" && G.copy(Pe);
674
+ if (s.handoffAt && st[w] === s.handoffTo) {
675
+ const M = (e - s.handoffAt) / 1e3 - 1.2;
676
+ if (M > 0 && M < 1) {
677
+ const g = Math.exp(-M * 4);
678
+ y += g * 0.8, f += g * 2, A += g * 10;
679
+ }
680
+ }
681
+ Q.copy(G).multiplyScalar(I * m), this.setInst(this.attractors, S, R.x, R.y, R.z, y, Q, 0, a * 0.6, 0), Q.copy(G).multiplyScalar(c * m), this.setInst(this.stepRings, S, R.x, R.y, R.z, b, Q, 0, v === "running" ? a * 1.6 : 0.3, 0), d(z, R.x, R.y, R.z, G, f * m, A);
682
+ }
683
+ }
684
+ for (let t = 0; t < ut; t++) {
685
+ const s = Y + B * 3 + t;
686
+ this.setInst(this.pulsars, t, 0, -999, 0, 0, G.setRGB(0, 0, 0)), this.setInst(this.pulsarBeams, t, 0, -999, 0, 0, G), l[s] = 0;
687
+ }
688
+ for (const t of q.mcpServers.values()) {
689
+ const s = t.slot % ut, m = Y + B * 3 + s, w = Tt(t.name);
690
+ if (!w) continue;
691
+ R.copy(w).setY(vt);
692
+ const S = Math.exp(-((e - t.activeAt) / 1e3) * 2.5), z = t.inflight > 0 ? 1 : 0;
693
+ this.mcpSpin[s] += o * (0.4 + z * 3.5) * it;
694
+ const v = 0.5 + 0.5 * Math.sin(a * (z ? 9 : 2.2) + s);
695
+ G.set(t.color), Q.copy(G).multiplyScalar(1.6 + z * 1.6 + S * 3 + v * 0.6), this.setInst(this.pulsars, s, R.x, R.y, R.z, 1 + S * 0.6 + z * 0.2 * v, Q, 0, this.mcpSpin[s], 0), Q.copy(G).multiplyScalar(0.25 + z * 0.9 * v + S * 0.8), this.setInst(this.pulsarBeams, s, R.x, R.y, R.z, 1 + z * 0.3, Q, 0.5 * Math.sin(this.mcpSpin[s] * 0.5), this.mcpSpin[s], 0.35 + 0.3 * Math.cos(this.mcpSpin[s])), d(m, R.x, R.y, R.z, G, 0.6 + z * 0.8 * v + S * 1.6, 9 + S * 12 + z * 4);
696
+ }
697
+ for (let t = 0; t < rt; t++) {
698
+ const s = (e - this.ringStart[t]) / (this.ringDur[t] * 1e3);
699
+ if (s < 0 || s >= 1) {
700
+ this.setInst(this.rings, t, 0, -999, 0, 0, G.setRGB(0, 0, 0));
701
+ continue;
702
+ }
703
+ const m = 1 - Math.pow(1 - s, 3), w = (1 - s) * (1 - s);
704
+ G.setRGB(this.ringCol[t * 3] * w, this.ringCol[t * 3 + 1] * w, this.ringCol[t * 3 + 2] * w), this.setInst(this.rings, t, this.ringPos[t * 3], this.ringPos[t * 3 + 1], this.ringPos[t * 3 + 2], 0.15 + this.ringMax[t] * m, G);
705
+ }
706
+ for (const t of [this.cores, this.attractors, this.stepRings, this.rings, this.pulsars, this.pulsarBeams])
707
+ t.instanceMatrix.needsUpdate = !0, t.instanceColor && (t.instanceColor.needsUpdate = !0);
708
+ pt(this.glowGeo);
709
+ }
710
+ }
711
+ const ht = new x.Vector3(), Oe = ["planner", "researcher", "writer"], at = { engine: null }, Ut = () => at.engine ?? (at.engine = new Be());
712
+ function Te() {
713
+ const u = Ut(), e = le((o) => o.gl), a = Ge();
714
+ return At(() => {
715
+ u.setGalaxy(a);
716
+ }, [u, a]), At(() => {
717
+ u.material.uniforms.uPR.value = e.getPixelRatio(), u.nebMaterial.uniforms.uPR.value = e.getPixelRatio();
718
+ }, [u, e]), At(
719
+ () => () => {
720
+ u.dispose(), at.engine === u && (at.engine = null);
721
+ },
722
+ [u]
723
+ ), ft((o, n) => {
724
+ u.update(n, performance.now(), o.clock.elapsedTime);
725
+ }), /* @__PURE__ */ gt("group", { children: [
726
+ /* @__PURE__ */ P("points", { geometry: u.fieldGeo, material: u.material, frustumCulled: !1 }),
727
+ /* @__PURE__ */ P("points", { geometry: u.runGeo, material: u.material, frustumCulled: !1 }),
728
+ /* @__PURE__ */ P("points", { geometry: u.streamGeo, material: u.material, frustumCulled: !1 }),
729
+ /* @__PURE__ */ P("points", { geometry: u.glowGeo, material: u.material, frustumCulled: !1 }),
730
+ /* @__PURE__ */ P("lineSegments", { geometry: u.beamGeo, frustumCulled: !1, children: /* @__PURE__ */ P("lineBasicMaterial", { vertexColors: !0, transparent: !0, blending: x.AdditiveBlending, depthWrite: !1, toneMapped: !1 }) }),
731
+ /* @__PURE__ */ P("primitive", { object: u.cores }),
732
+ /* @__PURE__ */ P("primitive", { object: u.attractors }),
733
+ /* @__PURE__ */ P("primitive", { object: u.stepRings }),
734
+ /* @__PURE__ */ P("primitive", { object: u.rings }),
735
+ /* @__PURE__ */ P("primitive", { object: u.pulsars }),
736
+ /* @__PURE__ */ P("primitive", { object: u.pulsarBeams }),
737
+ /* @__PURE__ */ P("primitive", { object: u.selRing })
738
+ ] });
739
+ }
740
+ function ke({ agent: u, selected: e, onSelect: a }) {
741
+ const o = $(null);
742
+ return At(() => {
743
+ const n = Ut();
744
+ e ? n.selectedId = u.id : n.selectedId === u.id && (n.selectedId = null);
745
+ }, [e, u.id]), At(
746
+ () => () => {
747
+ const n = at.engine;
748
+ n && n.selectedId === u.id && (n.selectedId = null);
749
+ },
750
+ [u.id]
751
+ ), ft(() => {
752
+ const n = o.current;
753
+ n && (n.position.copy(u.live), n.scale.setScalar(Math.max(0.6, nt.scale) * (u.depth ? 0.8 : 1)), n.visible = !u.inst.exitAt);
754
+ }), /* @__PURE__ */ gt(
755
+ "mesh",
756
+ {
757
+ ref: o,
758
+ onClick: (n) => (n.stopPropagation(), a(u.id)),
759
+ onPointerOver: () => document.body.style.cursor = "pointer",
760
+ onPointerOut: () => document.body.style.cursor = "",
761
+ children: [
762
+ /* @__PURE__ */ P("sphereGeometry", { args: [0.95, 10, 8] }),
763
+ /* @__PURE__ */ P("meshBasicMaterial", { transparent: !0, opacity: 0, depthWrite: !1, colorWrite: !1 })
764
+ ]
765
+ }
766
+ );
767
+ }
768
+ function Ee({ run: u }) {
769
+ Re();
770
+ const e = u.run ?? q.runs.get(u.id), a = $(null), o = $([]);
771
+ if (ft(() => {
772
+ var l;
773
+ (l = a.current) == null || l.position.set(u.origin.x, 0.6, u.origin.z - Math.min(11, Math.hypot(u.hu, u.hv) * 0.92 + 0.6) - 1.3);
774
+ for (let d = 0; d < 3; d++) {
775
+ const r = o.current[d];
776
+ r && (ee(u, se(Oe[d]), 0, ht), r.position.set(ht.x, 1.45 * Math.max(0.85, nt.scale), ht.z + 0.9 * nt.spread));
777
+ }
778
+ }), !e) return null;
779
+ const n = nt.w < 900, i = (l) => l === "running" ? e.color : l === "done" ? "#cbd5e1" : l === "failed" ? "#fecaca" : "#64748b";
780
+ return /* @__PURE__ */ gt(ce, { children: [
781
+ /* @__PURE__ */ P("group", { ref: a, children: /* @__PURE__ */ P(
782
+ xt,
783
+ {
784
+ text: `${e.hasSteps ? "hatchet · " : ""}${e.topic}`,
785
+ secondary: n ? void 0 : e.hasSteps ? st.map((l, d) => ({ text: `${d ? " " : ""}${l.toUpperCase()}`, color: i(e.steps[l]) })) : e.status === "started" ? "running…" : "run complete",
786
+ secondarySize: 0.24,
787
+ color: e.color,
788
+ size: 0.32,
789
+ maxWidth: n ? 5 : 7,
790
+ fadeMs: 300,
791
+ pxRange: [10, 14]
792
+ }
793
+ ) }),
794
+ e.hasSteps && !n && st.map((l, d) => /* @__PURE__ */ P("group", { ref: (r) => void (o.current[d] = r), children: /* @__PURE__ */ P(
795
+ xt,
796
+ {
797
+ text: l,
798
+ font: "mono",
799
+ plate: "none",
800
+ uppercase: !0,
801
+ letterSpacing: 0.08,
802
+ textColor: e.color,
803
+ size: 0.24,
804
+ opacity: e.steps[l] === "running" ? 1 : e.steps[l] === "done" ? 0.75 : 0.55,
805
+ fadeMs: 300,
806
+ pxRange: [7.5, 10.5]
807
+ }
808
+ ) }, l))
809
+ ] });
810
+ }
811
+ function _e({ mcp: u }) {
812
+ const e = $(null), a = u.target.x >= 0;
813
+ return ft(() => {
814
+ var o;
815
+ return (o = e.current) == null ? void 0 : o.position.set(u.pos.x + (a ? 0.9 : -0.9), vt, u.pos.z);
816
+ }), /* @__PURE__ */ P("group", { ref: e, children: /* @__PURE__ */ P(xt, { text: `mcp · ${u.name}`, anchorX: a ? "left" : "right", color: u.srv.color, size: 0.28, pxRange: [8.5, 12] }) });
817
+ }
818
+ function Le(u) {
819
+ const e = Ut();
820
+ return ft(() => {
821
+ e.nebMaterial.uniforms.uScale.value = e.material.uniforms.uScale.value * Z.graph.scale;
822
+ }), /* @__PURE__ */ gt("group", { children: [
823
+ /* @__PURE__ */ P("points", { geometry: e.nebGeo, material: e.nebMaterial, frustumCulled: !1 }),
824
+ /* @__PURE__ */ P("points", { geometry: e.anchorGeo, material: e.nebMaterial, frustumCulled: !1 }),
825
+ /* @__PURE__ */ P("lineSegments", { geometry: e.edgeGeo, frustumCulled: !1, children: /* @__PURE__ */ P("lineBasicMaterial", { vertexColors: !0, transparent: !0, blending: x.AdditiveBlending, depthWrite: !1, toneMapped: !1 }) }),
826
+ /* @__PURE__ */ P(we, { position: [0, -0.6, Dt + 0.9], color: "#a5b4fc", size: 0.34, pxRange: [9.5, 13] })
827
+ ] });
828
+ }
829
+ function De() {
830
+ const u = $(null), e = $(null), a = $("");
831
+ return ft(() => {
832
+ var r;
833
+ const o = at.engine;
834
+ if (!o) return;
835
+ const n = o.selectedId ?? q.focus, i = n ? o.slotOf(n) : null, l = !!i && !!i.inst && !i.inst.exitAt;
836
+ if ((r = e.current) == null || r.setOpacity(l ? 1 : 0), !i || !i.inst || !u.current || !e.current) return;
837
+ u.current.position.set(i.x, i.y + 1.25 * Math.max(0.85, nt.scale), i.z);
838
+ const d = i.inst.name + " · " + i.inst.status;
839
+ d !== a.current && (a.current = d, e.current.setText(d), e.current.setColor(ne[i.inst.type]));
840
+ }), /* @__PURE__ */ P("group", { ref: u, children: /* @__PURE__ */ P(xt, { ref: e, text: "", size: 0.3, opacity: 0, fadeMs: 300, pxRange: [9, 13], renderOrder: 24 }) });
841
+ }
842
+ function Ue() {
843
+ const u = $(null), e = $(null), a = $("");
844
+ return ft(() => {
845
+ const o = at.engine, n = o == null ? void 0 : o.lastFlare;
846
+ if (!o || !n || !u.current || !e.current) return;
847
+ const i = (performance.now() - n.at) / 1e3;
848
+ e.current.setOpacity(i < 2.2 && Z.graphWanted ? 1 : 0), o.anchorWorld(n.idx, ht), u.current.position.set(ht.x, ht.y + 0.9, ht.z), a.current !== n.name + n.op && (a.current = n.name + n.op, e.current.setText((n.op === "write" ? "wrote · " : "read · ") + n.name), e.current.setColor(n.op === "write" ? "#ffffff" : "#a5b4fc"));
849
+ }), /* @__PURE__ */ P("group", { ref: u, children: /* @__PURE__ */ P(xt, { ref: e, text: "", size: 0.28, opacity: 0, fadeMs: 400, pxRange: [8.5, 12], renderOrder: 24 }) });
850
+ }
851
+ function Ke() {
852
+ const u = pe(() => ({ nRef: 4, min: 0.62, max: 1.45, minRadius: 7 }), []);
853
+ return /* @__PURE__ */ gt(
854
+ xe,
855
+ {
856
+ title: "flow · murmuration",
857
+ subtitle: "agents are eddies condensing out of the current · hatchet runs are vortices · the knowledge graph is a nebula current on the side",
858
+ preset: "drift",
859
+ plane: "xz",
860
+ camera: { position: [0, 25, 28], fov: 50 },
861
+ controls: { maxPolarAngle: Math.PI * 0.47 },
862
+ bg: "#020309",
863
+ gl: { antialias: !1 },
864
+ fit: u,
865
+ agentRadius: 1.6,
866
+ graph: { natural: Dt, radius: 3.6 },
867
+ peripheryGap: 4.5,
868
+ Agent: ke,
869
+ RunMarker: Ee,
870
+ McpServer: _e,
871
+ GraphResource: Le,
872
+ cluster: { radius: 1.7, variant: "swarm", pointSize: 1.1 },
873
+ clusterOffset: [0, 1.8, 0],
874
+ PostFX: /* @__PURE__ */ gt(he, { multisampling: 0, children: [
875
+ /* @__PURE__ */ P(fe, { mipmapBlur: !0, intensity: 1.25, luminanceThreshold: 0.22, luminanceSmoothing: 0.25, radius: 0.78 }),
876
+ /* @__PURE__ */ P(ue, { eskil: !1, offset: 0.22, darkness: 0.85 }),
877
+ /* @__PURE__ */ P(de, { opacity: 0.03 })
878
+ ] }),
879
+ children: [
880
+ /* @__PURE__ */ P(Te, {}),
881
+ /* @__PURE__ */ P(De, {}),
882
+ /* @__PURE__ */ P(Ue, {})
883
+ ]
884
+ }
885
+ );
886
+ }
887
+ export {
888
+ Ke as default
889
+ };