agentglow 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{KitScene-Bm1I35Zc.js → KitScene-DG_pcnWW.js} +1273 -1195
- package/dist/chunks/{index-COLbf8XM.js → index-Agh7jdYu.js} +182 -182
- package/dist/chunks/{index-CGTp73GN.js → index-B2EHxcBQ.js} +400 -400
- package/dist/chunks/{index-D-r9aJ4u.js → index-B4Cqo621.js} +33 -33
- package/dist/chunks/index-BfQsJ0TH.js +751 -0
- package/dist/chunks/index-BmBGYhJS.js +891 -0
- package/dist/chunks/index-Bnn-x-aE.js +767 -0
- package/dist/chunks/{index-BWsSd_Wm.js → index-CTQTtm9q.js} +212 -212
- package/dist/chunks/{index-_IwfbZy7.js → index-CTZbUTDY.js} +62 -62
- package/dist/chunks/{index-cRPj-lzn.js → index-CdKvybsL.js} +284 -284
- package/dist/chunks/index-CeiIEWek.js +818 -0
- package/dist/chunks/{index-D4Wlmsay.js → index-Ci8tSMhc.js} +15 -15
- package/dist/chunks/{index-C2vLpNCb.js → index-Cls_VZdb.js} +100 -100
- package/dist/chunks/index-DFFRhihO.js +892 -0
- package/dist/chunks/index-DMCETM4H.js +605 -0
- package/dist/chunks/{index-AugvjZJN.js → index-URn4zDHp.js} +223 -223
- package/dist/chunks/index-u4rYZ1UO.js +495 -0
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/world.d.ts +30 -5
- package/package.json +1 -1
- package/dist/chunks/index-BAQDf-0T.js +0 -492
- package/dist/chunks/index-BRnLrSfZ.js +0 -605
- package/dist/chunks/index-CKyn9lcT.js +0 -753
- package/dist/chunks/index-CnoB0ZDk.js +0 -889
- package/dist/chunks/index-KmczAvvY.js +0 -818
- package/dist/chunks/index-Z4vdWCok.js +0 -763
- package/dist/chunks/index-uZGu9jzU.js +0 -887
|
@@ -4,10 +4,10 @@ var ae = (e, o, t) => jt(e, typeof o != "symbol" ? o + "" : o, t);
|
|
|
4
4
|
import { jsxs as H, Fragment as ce, jsx as c } from "react/jsx-runtime";
|
|
5
5
|
import { EffectComposer as Kt, Bloom as Ht, Vignette as $t } from "@react-three/postprocessing";
|
|
6
6
|
import * as n from "three";
|
|
7
|
-
import {
|
|
7
|
+
import { I as Yt, h as Re, T as _t, n as me, S as lt, w as J, R as Zt, v as Jt, f as Qe, j as Qt, u as eo, L as Ee, t as to, d as oo, a as Gt, c as no, K as ro, o as ao, G as so, q as io, p as lo, e as co, s as uo, g as fo, b as Ct, m as po } from "./KitScene-DG_pcnWW.js";
|
|
8
8
|
import { useFrame as Z, useThree as rt } from "@react-three/fiber";
|
|
9
9
|
import { useMemo as S, useRef as _, useState as et } from "react";
|
|
10
|
-
import { Stars as
|
|
10
|
+
import { Stars as mo } from "@react-three/drei";
|
|
11
11
|
var Bt;
|
|
12
12
|
const I = typeof window < "u" && !!((Bt = window.matchMedia) != null && Bt.call(window, "(prefers-reduced-motion: reduce)").matches), he = {
|
|
13
13
|
bg: "#02080b",
|
|
@@ -20,7 +20,7 @@ const I = typeof window < "u" && !!((Bt = window.matchMedia) != null && Bt.call(
|
|
|
20
20
|
red: "#ff3d4a"
|
|
21
21
|
}, te = new n.Color(he.teal);
|
|
22
22
|
new n.Color(he.mint);
|
|
23
|
-
const tt = new n.Color(he.amber), Vt = new n.Color(he.red), ie = new n.Color(1, 1, 1),
|
|
23
|
+
const tt = new n.Color(he.amber), Vt = new n.Color(he.red), ie = new n.Color(1, 1, 1), ho = new n.Color("#3b4d52"), gt = Object.fromEntries(Object.entries(_t).map(([e, o]) => [e, new n.Color(o).lerp(te, 0.12)])), le = (e) => e < 0 ? 0 : e > 1 ? 1 : e, De = (e) => 1 - Math.pow(1 - le(e), 3), at = (e) => (e = le(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2), go = (e) => {
|
|
24
24
|
e = le(e);
|
|
25
25
|
const o = 1.9;
|
|
26
26
|
return 1 + (o + 1) * Math.pow(e - 1, 3) + o * Math.pow(e - 1, 2);
|
|
@@ -34,7 +34,7 @@ function vt() {
|
|
|
34
34
|
return t.addColorStop(0, "rgba(255,255,255,1)"), t.addColorStop(0.15, "rgba(255,255,255,0.6)"), t.addColorStop(0.45, "rgba(255,255,255,0.14)"), t.addColorStop(1, "rgba(255,255,255,0)"), o.fillStyle = t, o.fillRect(0, 0, 128, 128), Xe = new n.CanvasTexture(e), Xe;
|
|
35
35
|
}
|
|
36
36
|
let je = null;
|
|
37
|
-
function
|
|
37
|
+
function vo() {
|
|
38
38
|
if (je) return je;
|
|
39
39
|
const e = document.createElement("canvas");
|
|
40
40
|
e.width = 256, e.height = 128;
|
|
@@ -42,8 +42,8 @@ function go() {
|
|
|
42
42
|
let t = 7;
|
|
43
43
|
const r = () => (t = t * 16807 % 2147483647) / 2147483647;
|
|
44
44
|
for (let s = 0; s < 14; s++) {
|
|
45
|
-
const i = 50 + r() * 156, a = 50 + r() * 28, l = 26 + r() * 30,
|
|
46
|
-
|
|
45
|
+
const i = 50 + r() * 156, a = 50 + r() * 28, l = 26 + r() * 30, v = o.createRadialGradient(i, a, 0, i, a, l);
|
|
46
|
+
v.addColorStop(0, "rgba(255,255,255,0.22)"), v.addColorStop(1, "rgba(255,255,255,0)"), o.fillStyle = v, o.fillRect(0, 0, 256, 128);
|
|
47
47
|
}
|
|
48
48
|
return je = new n.CanvasTexture(e), je;
|
|
49
49
|
}
|
|
@@ -53,7 +53,7 @@ function Ae(e = "#fff") {
|
|
|
53
53
|
function de(e = "#fff", o = n.FrontSide) {
|
|
54
54
|
return new n.MeshBasicMaterial({ color: e, blending: n.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1, side: o, fog: !1 });
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function wo(e = "#fff") {
|
|
57
57
|
return new n.LineBasicMaterial({ color: e, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, toneMapped: !1, fog: !1 });
|
|
58
58
|
}
|
|
59
59
|
function Ue(e = "#fff") {
|
|
@@ -61,24 +61,24 @@ function Ue(e = "#fff") {
|
|
|
61
61
|
}
|
|
62
62
|
new n.SphereGeometry(1, 24, 16);
|
|
63
63
|
const Le = new n.PlaneGeometry(1, 1).rotateX(-Math.PI / 2), wt = new n.ConeGeometry(1, 1, 12).translate(0, 0.5, 0);
|
|
64
|
-
function
|
|
64
|
+
function yo(e = 48, o = 6) {
|
|
65
65
|
const t = [], r = [];
|
|
66
66
|
for (let i = 0; i <= e; i++) {
|
|
67
67
|
const a = i / e;
|
|
68
68
|
for (let l = 0; l < o; l++) {
|
|
69
|
-
const
|
|
70
|
-
t.push(a, Math.cos(
|
|
69
|
+
const v = l / o * Math.PI * 2;
|
|
70
|
+
t.push(a, Math.cos(v), Math.sin(v));
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
for (let i = 0; i < e; i++)
|
|
74
74
|
for (let a = 0; a < o; a++) {
|
|
75
|
-
const l = i * o + a,
|
|
76
|
-
r.push(l, h,
|
|
75
|
+
const l = i * o + a, v = i * o + (a + 1) % o, h = (i + 1) * o + a, f = (i + 1) * o + (a + 1) % o;
|
|
76
|
+
r.push(l, h, v, v, h, f);
|
|
77
77
|
}
|
|
78
78
|
const s = new n.BufferGeometry();
|
|
79
79
|
return s.setAttribute("position", new n.Float32BufferAttribute(t, 3)), s.setIndex(r), s.boundingSphere = new n.Sphere(new n.Vector3(), 1e4), s;
|
|
80
80
|
}
|
|
81
|
-
const Dt =
|
|
81
|
+
const Dt = yo(), Mo = (
|
|
82
82
|
/* glsl */
|
|
83
83
|
`
|
|
84
84
|
uniform vec3 uP0; uniform vec3 uP1; uniform vec3 uP2; uniform float uRadius; uniform float uTaper;
|
|
@@ -96,7 +96,7 @@ void main(){
|
|
|
96
96
|
vT = t;
|
|
97
97
|
gl_Position = projectionMatrix * mv;
|
|
98
98
|
}`
|
|
99
|
-
),
|
|
99
|
+
), bo = (
|
|
100
100
|
/* glsl */
|
|
101
101
|
`
|
|
102
102
|
uniform vec3 uColor; uniform float uOpacity; uniform float uGrow; uniform float uTime; uniform float uFlow; uniform float uFlowDir;
|
|
@@ -132,8 +132,8 @@ function Et(e = "#fff", o = 0.06, t = 0.4) {
|
|
|
132
132
|
uTail: { value: 0.12 },
|
|
133
133
|
uHeadColor: { value: new n.Color(4, 4, 4) }
|
|
134
134
|
},
|
|
135
|
-
vertexShader:
|
|
136
|
-
fragmentShader:
|
|
135
|
+
vertexShader: Mo,
|
|
136
|
+
fragmentShader: bo,
|
|
137
137
|
transparent: !0,
|
|
138
138
|
depthWrite: !1,
|
|
139
139
|
blending: n.AdditiveBlending
|
|
@@ -169,8 +169,8 @@ const nt = class nt {
|
|
|
169
169
|
begin() {
|
|
170
170
|
this.n = 0;
|
|
171
171
|
}
|
|
172
|
-
add(o, t, r, s, i, a, l,
|
|
173
|
-
this.n >= this.max || (xe(o, t, r, s, this.a), xe(o, t, r, Math.min(1, Math.max(0, s + 0.02 * i)), this.b), this.d.subVectors(this.b, this.a), !(this.d.lengthSq() < 1e-8) && (this.o.position.copy(this.a), this.o.quaternion.setFromUnitVectors(nt.UP, this.d.normalize()), this.o.scale.set(a * 0.42, a, a * 0.42), this.o.updateMatrix(), this.mesh.setMatrixAt(this.n, this.o.matrix), this.colors[this.n * 3] = l.r *
|
|
172
|
+
add(o, t, r, s, i, a, l, v = 1) {
|
|
173
|
+
this.n >= this.max || (xe(o, t, r, s, this.a), xe(o, t, r, Math.min(1, Math.max(0, s + 0.02 * i)), this.b), this.d.subVectors(this.b, this.a), !(this.d.lengthSq() < 1e-8) && (this.o.position.copy(this.a), this.o.quaternion.setFromUnitVectors(nt.UP, this.d.normalize()), this.o.scale.set(a * 0.42, a, a * 0.42), this.o.updateMatrix(), this.mesh.setMatrixAt(this.n, this.o.matrix), this.colors[this.n * 3] = l.r * v, this.colors[this.n * 3 + 1] = l.g * v, this.colors[this.n * 3 + 2] = l.b * v, this.n++));
|
|
174
174
|
}
|
|
175
175
|
end() {
|
|
176
176
|
this.mesh.count = this.n, this.mesh.instanceMatrix.needsUpdate = !0, this.mesh.instanceColor && (this.mesh.instanceColor.needsUpdate = !0);
|
|
@@ -178,57 +178,57 @@ const nt = class nt {
|
|
|
178
178
|
};
|
|
179
179
|
ae(nt, "UP", new n.Vector3(0, 1, 0));
|
|
180
180
|
let ot = nt;
|
|
181
|
-
const ct = new n.Vector3(), Ke = new n.Vector3(),
|
|
181
|
+
const ct = new n.Vector3(), Ke = new n.Vector3(), So = new n.Vector3(0, 1, 0);
|
|
182
182
|
function ft(e, o, t, r, s, i, a) {
|
|
183
|
-
xe(o, t, r, s, ct), xe(o, t, r, Math.min(1, Math.max(0, s + 0.02 * i)), Ke), e.position.copy(ct), Ke.sub(ct), Ke.lengthSq() > 1e-8 && e.quaternion.setFromUnitVectors(
|
|
183
|
+
xe(o, t, r, s, ct), xe(o, t, r, Math.min(1, Math.max(0, s + 0.02 * i)), Ke), e.position.copy(ct), Ke.sub(ct), Ke.lengthSq() > 1e-8 && e.quaternion.setFromUnitVectors(So, Ke.normalize()), e.scale.set(a * 0.42, a, a * 0.42);
|
|
184
184
|
}
|
|
185
|
-
const Mt = (e) => (e.subagent ? 2.1 : 4.6) * (0.92 + 0.16 * Re(e.id, 11)),
|
|
185
|
+
const Mt = (e) => (e.subagent ? 2.1 : 4.6) * (0.92 + 0.16 * Re(e.id, 11)), Ao = (e) => e.subagent ? 0.72 : 1.45, bt = (e) => e.scale / Yt(e.inst);
|
|
186
186
|
function pt(e, o) {
|
|
187
187
|
const t = me.agents.get(e);
|
|
188
188
|
if (t)
|
|
189
189
|
return o.set(t.live.x, t.live.y + Mt(t.inst) * 0.62 * bt(t), t.live.z);
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const xo = new n.DodecahedronGeometry(0.32, 0), Co = new n.MeshStandardMaterial({ color: "#1b2e2d", roughness: 0.9, flatShading: !0 }), Po = -2.3, To = 5.6;
|
|
192
192
|
function Lt(e, o) {
|
|
193
193
|
return o.w = Math.abs(e.side.x) * e.hu + Math.abs(e.axis.x) * e.hv, o.d = Math.abs(e.side.z) * e.hu + Math.abs(e.axis.z) * e.hv, o;
|
|
194
194
|
}
|
|
195
195
|
const mt = (e) => e.target.z < -0.5 ? -1 : 1;
|
|
196
196
|
function Ot(e, o, t = mt(e)) {
|
|
197
|
-
return Lt(e, ut), t < 0 ? o.set(e.origin.x,
|
|
197
|
+
return Lt(e, ut), t < 0 ? o.set(e.origin.x, To * Math.min(1.4, Math.max(0.75, Qe.scale)), e.origin.z - ut.d - 0.4) : o.set(e.origin.x, 0.3, e.origin.z + ut.d + 1.2);
|
|
198
198
|
}
|
|
199
199
|
const ut = { w: 0, d: 0 };
|
|
200
|
-
function
|
|
201
|
-
const o = S(() => new n.Color(e.color).lerp(te, 0.35), [e.color]), t = S(() => Ue("#000"), []), r = S(() => lt.map(() => Ae("#000")), []), s = _(null), i = _(null), a = _([]), l = _([]),
|
|
202
|
-
return Z(({ clock:
|
|
203
|
-
const M = performance.now(), y = e.run ?? J.runs.get(e.id), u = y ? De((M - y.startedAt) / 1200) : 1,
|
|
204
|
-
t.color.copy(o).multiplyScalar(0.085 * u *
|
|
200
|
+
function zo({ run: e }) {
|
|
201
|
+
const o = S(() => new n.Color(e.color).lerp(te, 0.35), [e.color]), t = S(() => Ue("#000"), []), r = S(() => lt.map(() => Ae("#000")), []), s = _(null), i = _(null), a = _([]), l = _([]), v = S(() => ({ w: 0, d: 0 }), []), h = e.run, [f, m] = et(!!(h != null && h.hasSteps)), [p, C] = et(() => mt(e));
|
|
202
|
+
return Z(({ clock: T }) => {
|
|
203
|
+
const M = performance.now(), y = e.run ?? J.runs.get(e.id), u = y ? De((M - y.startedAt) / 1200) : 1, L = y != null && y.endedAt ? le(1 - (M - y.endedAt - (Zt - 2500)) / 2500) : 1, N = I ? 1 : 0.9 + 0.1 * Math.sin(T.elapsedTime * 0.6 + e.index);
|
|
204
|
+
t.color.copy(o).multiplyScalar(0.085 * u * L * N), Lt(e, v), s.current && (s.current.position.set(e.origin.x, 0.015, e.origin.z), s.current.scale.set(v.w * 2.6 + 6, 1, v.d * 2.6 + 6));
|
|
205
205
|
const j = mt(e);
|
|
206
|
-
j !== p &&
|
|
207
|
-
const
|
|
208
|
-
|
|
206
|
+
j !== p && C(j), i.current && Ot(e, i.current.position, p);
|
|
207
|
+
const E = !!(y != null && y.hasSteps);
|
|
208
|
+
E !== f && m(E), y && E && lt.forEach((d) => {
|
|
209
209
|
var V;
|
|
210
|
-
const
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
|
|
210
|
+
const g = l.current[d];
|
|
211
|
+
g && Jt(e, e.cu + (d - 1) * 1.7 * Qe.spread, Po * Qe.spread, g.position).setY(0);
|
|
212
|
+
const A = Qt(y, d), R = I ? 1 : 0.8 + 0.2 * Math.sin(T.elapsedTime * 7 + d * 2) * Math.sin(T.elapsedTime * 3.1 + d), G = r[d];
|
|
213
|
+
A === "running" ? G.color.copy(tt).multiplyScalar(0.9 * R) : A === "done" ? G.color.copy(te).multiplyScalar(0.35) : A === "failed" ? G.color.copy(Vt).multiplyScalar(0.6) : G.color.setScalar(0.04), G.color.multiplyScalar(L), (V = a.current[d]) == null || V.scale.setScalar(A === "running" ? 1.9 : 1.2);
|
|
214
214
|
});
|
|
215
215
|
}), /* @__PURE__ */ H(ce, { children: [
|
|
216
216
|
/* @__PURE__ */ c("mesh", { ref: s, geometry: Le, material: t }),
|
|
217
|
-
f && lt.map((
|
|
218
|
-
/* @__PURE__ */ c("mesh", { geometry:
|
|
219
|
-
/* @__PURE__ */ c("sprite", { ref: (
|
|
220
|
-
] },
|
|
221
|
-
/* @__PURE__ */ c("group", { ref: i, children: h && /* @__PURE__ */ c(
|
|
217
|
+
f && lt.map((T) => /* @__PURE__ */ H("group", { ref: (M) => void (l.current[T] = M), children: [
|
|
218
|
+
/* @__PURE__ */ c("mesh", { geometry: xo, material: Co, position: [0, 0.22, 0], scale: [1, 0.8, 1] }),
|
|
219
|
+
/* @__PURE__ */ c("sprite", { ref: (M) => void (a.current[T] = M), material: r[T], position: [0, 0.62, 0] })
|
|
220
|
+
] }, T)),
|
|
221
|
+
/* @__PURE__ */ c("group", { ref: i, children: h && /* @__PURE__ */ c(Ro, { run: h, anchorY: p > 0 ? "top" : "middle" }) })
|
|
222
222
|
] });
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
|
|
224
|
+
function Ro({ run: e, anchorY: o }) {
|
|
225
|
+
eo();
|
|
226
226
|
const t = e.status !== "started";
|
|
227
227
|
return /* @__PURE__ */ c(
|
|
228
228
|
Ee,
|
|
229
229
|
{
|
|
230
230
|
text: e.topic,
|
|
231
|
-
secondary:
|
|
231
|
+
secondary: to(e, { base: "#94a3b8", current: "#fde68a", done: "#cbd5e1" }, ["growing…", "grove at rest"]),
|
|
232
232
|
color: e.color,
|
|
233
233
|
size: 0.36,
|
|
234
234
|
maxWidth: 10,
|
|
@@ -261,11 +261,11 @@ function kt() {
|
|
|
261
261
|
const e = w.next;
|
|
262
262
|
return w.next = (w.next + 1) % oe, e;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function Fo(e, o, t, r, s) {
|
|
265
265
|
I && (o = Math.ceil(o * 0.4));
|
|
266
266
|
for (let i = 0; i < o; i++) {
|
|
267
|
-
const a = kt(), l = Math.random() * Math.PI * 2,
|
|
268
|
-
w.pos[a * 3] = e.x + Math.cos(l) *
|
|
267
|
+
const a = kt(), l = Math.random() * Math.PI * 2, v = s * Math.sqrt(Math.random());
|
|
268
|
+
w.pos[a * 3] = e.x + Math.cos(l) * v, w.pos[a * 3 + 1] = e.y + (Math.random() - 0.3) * s * 0.9, w.pos[a * 3 + 2] = e.z + Math.sin(l) * v;
|
|
269
269
|
const h = 0.9 + Math.random() * 1.6;
|
|
270
270
|
w.vel[a * 3] = Math.cos(l) * h, w.vel[a * 3 + 1] = 0.9 + Math.random() * 1.8, w.vel[a * 3 + 2] = Math.sin(l) * h;
|
|
271
271
|
const f = Math.random() * 0.35;
|
|
@@ -276,7 +276,7 @@ function It(e, o, t, r = 0.55) {
|
|
|
276
276
|
const s = kt();
|
|
277
277
|
w.pos[s * 3] = e.x, w.pos[s * 3 + 1] = e.y, w.pos[s * 3 + 2] = e.z, w.vel[s * 3] = w.vel[s * 3 + 1] = w.vel[s * 3 + 2] = 0, w.col[s * 3] = o.r, w.col[s * 3 + 1] = o.g, w.col[s * 3 + 2] = o.b, w.size[s] = t, w.max[s] = w.life[s] = r, w.seed[s] = Math.random() * 100, w.kind[s] = 1;
|
|
278
278
|
}
|
|
279
|
-
const
|
|
279
|
+
const Bo = (
|
|
280
280
|
/* glsl */
|
|
281
281
|
`
|
|
282
282
|
attribute float aSize; attribute vec3 aColor; attribute float aAlpha; attribute float aSeed;
|
|
@@ -288,7 +288,7 @@ void main(){
|
|
|
288
288
|
gl_PointSize = aSize * uScale / -mv.z;
|
|
289
289
|
gl_Position = projectionMatrix * mv;
|
|
290
290
|
}`
|
|
291
|
-
),
|
|
291
|
+
), _o = (
|
|
292
292
|
/* glsl */
|
|
293
293
|
`
|
|
294
294
|
varying vec3 vC;
|
|
@@ -299,18 +299,18 @@ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
|
|
|
299
299
|
function St(e, o, t) {
|
|
300
300
|
return e.height * o.getPixelRatio() / (2 * Math.tan((t.fov ?? 50) * Math.PI / 360));
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function Go() {
|
|
303
303
|
const { size: e, gl: o, camera: t } = rt(), { geo: r, mat: s } = S(() => {
|
|
304
304
|
const i = new n.BufferGeometry();
|
|
305
305
|
i.setAttribute("position", new n.BufferAttribute(w.pos, 3).setUsage(n.DynamicDrawUsage)), i.setAttribute("aColor", new n.BufferAttribute(w.col, 3).setUsage(n.DynamicDrawUsage)), i.setAttribute("aSize", new n.BufferAttribute(w.size, 1).setUsage(n.DynamicDrawUsage)), i.setAttribute("aSeed", new n.BufferAttribute(w.seed, 1).setUsage(n.DynamicDrawUsage)), i.setAttribute("aAlpha", new n.BufferAttribute(new Float32Array(oe), 1).setUsage(n.DynamicDrawUsage)), i.boundingSphere = new n.Sphere(new n.Vector3(), 1e4);
|
|
306
|
-
const a = new n.ShaderMaterial({ uniforms: { uScale: { value: 400 }, uTime: { value: 0 } }, vertexShader:
|
|
306
|
+
const a = new n.ShaderMaterial({ uniforms: { uScale: { value: 400 }, uTime: { value: 0 } }, vertexShader: Bo, fragmentShader: _o, transparent: !0, depthWrite: !1, blending: n.AdditiveBlending });
|
|
307
307
|
return { geo: i, mat: a };
|
|
308
308
|
}, []);
|
|
309
309
|
return Z(({ clock: i }, a) => {
|
|
310
310
|
a = Math.min(a, 0.05);
|
|
311
311
|
const l = i.elapsedTime;
|
|
312
312
|
s.uniforms.uScale.value = St(e, o, t), s.uniforms.uTime.value = I ? 0 : l;
|
|
313
|
-
const
|
|
313
|
+
const v = r.getAttribute("aAlpha"), h = v.array, f = Math.exp(-a * 1.6);
|
|
314
314
|
for (let m = 0; m < oe; m++) {
|
|
315
315
|
if (w.life[m] <= 0) {
|
|
316
316
|
h[m] = 0;
|
|
@@ -319,11 +319,11 @@ function _o() {
|
|
|
319
319
|
w.life[m] -= a;
|
|
320
320
|
const p = 1 - w.life[m] / w.max[m];
|
|
321
321
|
if (w.kind[m] === 0) {
|
|
322
|
-
const
|
|
323
|
-
w.vel[m * 3] = w.vel[m * 3] * f + Math.sin(l * 1.7 +
|
|
322
|
+
const C = w.seed[m];
|
|
323
|
+
w.vel[m * 3] = w.vel[m * 3] * f + Math.sin(l * 1.7 + C) * 0.9 * a, w.vel[m * 3 + 1] = w.vel[m * 3 + 1] * f + (0.25 + Math.sin(l * 2.3 + C * 1.3) * 0.5) * a, w.vel[m * 3 + 2] = w.vel[m * 3 + 2] * f + Math.cos(l * 1.5 + C * 0.7) * 0.9 * a, w.pos[m * 3] += w.vel[m * 3] * a, w.pos[m * 3 + 1] += w.vel[m * 3 + 1] * a, w.pos[m * 3 + 2] += w.vel[m * 3 + 2] * a, h[m] = Math.min(1, p * 8) * (1 - p) * (1 - p) * 1.3;
|
|
324
324
|
} else h[m] = (1 - p) * (1 - p);
|
|
325
325
|
}
|
|
326
|
-
r.getAttribute("position").needsUpdate = !0, r.getAttribute("aColor").needsUpdate = !0, r.getAttribute("aSize").needsUpdate = !0, r.getAttribute("aSeed").needsUpdate = !0,
|
|
326
|
+
r.getAttribute("position").needsUpdate = !0, r.getAttribute("aColor").needsUpdate = !0, r.getAttribute("aSize").needsUpdate = !0, r.getAttribute("aSeed").needsUpdate = !0, v.needsUpdate = !0;
|
|
327
327
|
}), /* @__PURE__ */ c("points", { geometry: r, material: s, frustumCulled: !1 });
|
|
328
328
|
}
|
|
329
329
|
const se = 700, P = {
|
|
@@ -336,18 +336,18 @@ const se = 700, P = {
|
|
|
336
336
|
seed: new Float32Array(se),
|
|
337
337
|
next: 0
|
|
338
338
|
};
|
|
339
|
-
function
|
|
339
|
+
function Vo(e, o, t, r, s) {
|
|
340
340
|
I && (o = Math.ceil(o * 0.5));
|
|
341
341
|
for (let i = 0; i < o; i++) {
|
|
342
342
|
const a = P.next;
|
|
343
343
|
P.next = (P.next + 1) % se;
|
|
344
|
-
const l = Math.random() * Math.PI * 2,
|
|
345
|
-
P.pos[a * 3] = e.x + Math.cos(l) *
|
|
344
|
+
const l = Math.random() * Math.PI * 2, v = r * Math.sqrt(Math.random());
|
|
345
|
+
P.pos[a * 3] = e.x + Math.cos(l) * v, P.pos[a * 3 + 1] = e.y + (Math.random() - 0.5) * r * 1.4, P.pos[a * 3 + 2] = e.z + Math.sin(l) * v, P.vel[a * 3] = Math.cos(l) * 0.4, P.vel[a * 3 + 1] = -0.2 - Math.random() * 0.4, P.vel[a * 3 + 2] = Math.sin(l) * 0.4;
|
|
346
346
|
const h = 0.55 + Math.random() * 0.45;
|
|
347
347
|
P.col[a * 3] = t.r * h, P.col[a * 3 + 1] = t.g * h, P.col[a * 3 + 2] = t.b * h, P.size[a] = s * (0.7 + Math.random() * 0.6), P.max[a] = P.life[a] = 3 + Math.random() * 1.2, P.seed[a] = Math.random() * 100;
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
const
|
|
350
|
+
const Do = (
|
|
351
351
|
/* glsl */
|
|
352
352
|
`
|
|
353
353
|
attribute float aSize; attribute vec3 aColor; attribute float aAlpha; attribute float aSeed;
|
|
@@ -359,7 +359,7 @@ void main(){
|
|
|
359
359
|
gl_PointSize = aSize * uScale / -mv.z;
|
|
360
360
|
gl_Position = projectionMatrix * mv;
|
|
361
361
|
}`
|
|
362
|
-
),
|
|
362
|
+
), Eo = (
|
|
363
363
|
/* glsl */
|
|
364
364
|
`
|
|
365
365
|
varying vec3 vC; varying float vRot;
|
|
@@ -375,31 +375,31 @@ void main(){
|
|
|
375
375
|
gl_FragColor = vec4(vC * (0.8 + vein * 0.6) * (1.0 - d * 0.5), 1.0);
|
|
376
376
|
}`
|
|
377
377
|
);
|
|
378
|
-
function
|
|
378
|
+
function Uo() {
|
|
379
379
|
const { size: e, gl: o, camera: t } = rt(), { geo: r, mat: s } = S(() => {
|
|
380
380
|
const i = new n.BufferGeometry();
|
|
381
381
|
i.setAttribute("position", new n.BufferAttribute(P.pos, 3).setUsage(n.DynamicDrawUsage)), i.setAttribute("aColor", new n.BufferAttribute(P.col, 3).setUsage(n.DynamicDrawUsage)), i.setAttribute("aSize", new n.BufferAttribute(P.size, 1).setUsage(n.DynamicDrawUsage)), i.setAttribute("aSeed", new n.BufferAttribute(P.seed, 1).setUsage(n.DynamicDrawUsage)), i.setAttribute("aAlpha", new n.BufferAttribute(new Float32Array(se), 1).setUsage(n.DynamicDrawUsage)), i.boundingSphere = new n.Sphere(new n.Vector3(), 1e4);
|
|
382
|
-
const a = new n.ShaderMaterial({ uniforms: { uScale: { value: 400 }, uTime: { value: 0 } }, vertexShader:
|
|
382
|
+
const a = new n.ShaderMaterial({ uniforms: { uScale: { value: 400 }, uTime: { value: 0 } }, vertexShader: Do, fragmentShader: Eo, transparent: !0, depthWrite: !1, blending: n.AdditiveBlending });
|
|
383
383
|
return { geo: i, mat: a };
|
|
384
384
|
}, []);
|
|
385
385
|
return Z(({ clock: i }, a) => {
|
|
386
386
|
a = Math.min(a, 0.05);
|
|
387
387
|
const l = i.elapsedTime;
|
|
388
388
|
s.uniforms.uScale.value = St(e, o, t), s.uniforms.uTime.value = I ? 0 : l;
|
|
389
|
-
const
|
|
389
|
+
const v = r.getAttribute("aAlpha"), h = v.array;
|
|
390
390
|
for (let f = 0; f < se; f++) {
|
|
391
391
|
if (P.life[f] <= 0) {
|
|
392
392
|
h[f] = 0;
|
|
393
393
|
continue;
|
|
394
394
|
}
|
|
395
395
|
P.life[f] -= a;
|
|
396
|
-
const m = 1 - P.life[f] / P.max[f], p = P.seed[f],
|
|
397
|
-
|
|
396
|
+
const m = 1 - P.life[f] / P.max[f], p = P.seed[f], C = P.pos[f * 3 + 1];
|
|
397
|
+
C > 0.04 && (P.vel[f * 3] += Math.sin(l * 2.2 + p) * 1.6 * a - P.vel[f * 3] * 0.8 * a, P.vel[f * 3 + 2] += Math.cos(l * 1.9 + p * 1.7) * 1.6 * a - P.vel[f * 3 + 2] * 0.8 * a, P.vel[f * 3 + 1] += (-0.9 - P.vel[f * 3 + 1]) * 1.5 * a, P.pos[f * 3] += P.vel[f * 3] * a, P.pos[f * 3 + 1] = Math.max(0.04, C + P.vel[f * 3 + 1] * a), P.pos[f * 3 + 2] += P.vel[f * 3 + 2] * a), h[f] = Math.min(1, m * 10) * (1 - m * m) * 0.9;
|
|
398
398
|
}
|
|
399
|
-
r.getAttribute("position").needsUpdate = !0, r.getAttribute("aColor").needsUpdate = !0, r.getAttribute("aSize").needsUpdate = !0, r.getAttribute("aSeed").needsUpdate = !0,
|
|
399
|
+
r.getAttribute("position").needsUpdate = !0, r.getAttribute("aColor").needsUpdate = !0, r.getAttribute("aSize").needsUpdate = !0, r.getAttribute("aSeed").needsUpdate = !0, v.needsUpdate = !0;
|
|
400
400
|
}), /* @__PURE__ */ c("points", { geometry: r, material: s, frustumCulled: !1 });
|
|
401
401
|
}
|
|
402
|
-
const
|
|
402
|
+
const Lo = (
|
|
403
403
|
/* glsl */
|
|
404
404
|
`
|
|
405
405
|
attribute float aSeed; uniform float uScale; uniform float uTime; varying float vA;
|
|
@@ -412,28 +412,28 @@ void main(){
|
|
|
412
412
|
gl_PointSize = (0.22 + blink * 0.18) * uScale / -mv.z;
|
|
413
413
|
gl_Position = projectionMatrix * mv;
|
|
414
414
|
}`
|
|
415
|
-
),
|
|
415
|
+
), Oo = (
|
|
416
416
|
/* glsl */
|
|
417
417
|
`
|
|
418
418
|
uniform vec3 uColor; varying float vA;
|
|
419
419
|
void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
|
|
420
420
|
gl_FragColor = vec4(uColor * vA * (smoothstep(0.4, 0.0, r) * 1.4 + pow(1.0 - r, 2.5) * 0.5), 1.0); }`
|
|
421
421
|
);
|
|
422
|
-
function
|
|
422
|
+
function ko({ count: e = 170 }) {
|
|
423
423
|
const { size: o, gl: t, camera: r } = rt(), { geo: s, mat: i } = S(() => {
|
|
424
424
|
const a = new Float32Array(e * 3), l = new Float32Array(e);
|
|
425
|
-
let
|
|
426
|
-
const h = () => (
|
|
425
|
+
let v = 11;
|
|
426
|
+
const h = () => (v = v * 16807 % 2147483647) / 2147483647;
|
|
427
427
|
for (let p = 0; p < e; p++) {
|
|
428
|
-
const
|
|
429
|
-
a.set([Math.cos(
|
|
428
|
+
const C = h() * Math.PI * 2, T = 6 + Math.sqrt(h()) * 22;
|
|
429
|
+
a.set([Math.cos(C) * T, 0.6 + h() * 5.5, Math.sin(C) * T], p * 3), l[p] = h() * 100;
|
|
430
430
|
}
|
|
431
431
|
const f = new n.BufferGeometry();
|
|
432
432
|
f.setAttribute("position", new n.BufferAttribute(a, 3)), f.setAttribute("aSeed", new n.BufferAttribute(l, 1)), f.boundingSphere = new n.Sphere(new n.Vector3(), 1e4);
|
|
433
433
|
const m = new n.ShaderMaterial({
|
|
434
434
|
uniforms: { uScale: { value: 400 }, uTime: { value: 0 }, uColor: { value: new n.Color("#c8ff9e") } },
|
|
435
|
-
vertexShader:
|
|
436
|
-
fragmentShader:
|
|
435
|
+
vertexShader: Lo,
|
|
436
|
+
fragmentShader: Oo,
|
|
437
437
|
transparent: !0,
|
|
438
438
|
depthWrite: !1,
|
|
439
439
|
blending: n.AdditiveBlending
|
|
@@ -444,19 +444,19 @@ function Oo({ count: e = 170 }) {
|
|
|
444
444
|
i.uniforms.uScale.value = St(o, t, r), i.uniforms.uTime.value = I ? 20 : a.elapsedTime;
|
|
445
445
|
}), /* @__PURE__ */ c("points", { geometry: s, material: i, frustumCulled: !1 });
|
|
446
446
|
}
|
|
447
|
-
const dt = new n.CylinderGeometry(0.15, 0.24, 1, 10).translate(0, 0.5, 0),
|
|
447
|
+
const dt = new n.CylinderGeometry(0.15, 0.24, 1, 10).translate(0, 0.5, 0), Io = new n.SphereGeometry(1, 22, 10, 0, Math.PI * 2, 0, Math.PI / 2), No = new n.CircleGeometry(1, 22).rotateX(Math.PI / 2), Wo = new n.ConeGeometry(1, 1, 18, 1, !0).translate(0, 0.5, 0), qo = new n.CylinderGeometry(1, 1, 0.12, 20, 1, !1, 0, Math.PI), Tt = new n.SphereGeometry(1, 20, 14);
|
|
448
448
|
function be(e, o, t, r, s) {
|
|
449
|
-
s.push({ geo: dt, cap: !1, pos: [e, 0, o], scale: [r * 0.75, t, r * 0.75] }), s.push({ geo:
|
|
449
|
+
s.push({ geo: dt, cap: !1, pos: [e, 0, o], scale: [r * 0.75, t, r * 0.75] }), s.push({ geo: Io, cap: !0, pos: [e, t, o], scale: [r, r * 0.62, r] }), s.push({ geo: No, cap: !0, pos: [e, t + 0.01, o], scale: [r * 0.96, 1, r * 0.96] });
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function Xo(e) {
|
|
452
452
|
const o = [];
|
|
453
453
|
switch (e) {
|
|
454
454
|
case "db":
|
|
455
|
-
o.push({ geo: dt, cap: !1, pos: [0, 0, 0], scale: [0.5, 1, 0.5] }), o.push({ geo:
|
|
455
|
+
o.push({ geo: dt, cap: !1, pos: [0, 0, 0], scale: [0.5, 1, 0.5] }), o.push({ geo: Wo, cap: !0, pos: [0, 0.72, 0], scale: [0.44, 0.95, 0.44] });
|
|
456
456
|
break;
|
|
457
457
|
case "warehouse":
|
|
458
458
|
o.push({ geo: dt, cap: !1, pos: [0, 0, 0], scale: [1.6, 1.3, 1.6] });
|
|
459
|
-
for (let t = 0; t < 3; t++) o.push({ geo:
|
|
459
|
+
for (let t = 0; t < 3; t++) o.push({ geo: qo, cap: !0, pos: [0, 0.35 + t * 0.38, 0.12], scale: [0.85 - t * 0.15, 1, 0.65 - t * 0.1] });
|
|
460
460
|
break;
|
|
461
461
|
case "spark":
|
|
462
462
|
for (let t = 0; t < 6; t++) {
|
|
@@ -480,40 +480,40 @@ function qo(e) {
|
|
|
480
480
|
}
|
|
481
481
|
return o;
|
|
482
482
|
}
|
|
483
|
-
const
|
|
483
|
+
const jo = (() => {
|
|
484
484
|
const e = [];
|
|
485
485
|
return be(0, 0, 1.7, 1.2, e), be(0.95, 0.55, 0.7, 0.42, e), be(-0.8, 0.7, 0.5, 0.3, e), e;
|
|
486
486
|
})();
|
|
487
487
|
function Nt({ parts: e, cap: o, stem: t }) {
|
|
488
488
|
return /* @__PURE__ */ c(ce, { children: e.map((r, s) => /* @__PURE__ */ c("mesh", { geometry: r.geo, material: r.cap ? o : t, position: r.pos, scale: r.scale, rotation: r.rot }, s)) });
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
const t = e.srv, r = o.res, s = o.k, i = S(() =>
|
|
490
|
+
function Ko({ mcp: e, backend: o }) {
|
|
491
|
+
const t = e.srv, r = o.res, s = o.k, i = S(() => Xo(r.kind), [r.kind]), a = S(() => new n.Color(t.color).lerp(te, 0.25).lerp(ie, 0.15), [t.color]), l = S(
|
|
492
492
|
() => ({ edge: Et(a, 0.04, 1), arrow: de(a), cap: de(a), stem: de(a), halo: Ae(a), pool: Ue(a) }),
|
|
493
493
|
[a]
|
|
494
|
-
),
|
|
495
|
-
return Z(({ clock:
|
|
496
|
-
var
|
|
494
|
+
), v = _(null), h = _(null), f = _(null), m = _(null), p = _(null), C = _("");
|
|
495
|
+
return Z(({ clock: T }) => {
|
|
496
|
+
var G, V;
|
|
497
497
|
const M = l.edge.uniforms;
|
|
498
|
-
M.uP0.value.set(e.pos.x, 0.05, e.pos.z), M.uP2.value.set(o.pos.x, 0.05, o.pos.z), yt(M.uP0.value, M.uP2.value, 0.18 * (s % 2 ? 1 : -1), 0.05, M.uP1.value), (
|
|
499
|
-
const y = performance.now(), u = r.inflight > 0,
|
|
500
|
-
l.cap.color.copy(a).multiplyScalar(j * 0.5), l.stem.color.copy(a).multiplyScalar(j * 0.16), l.halo.color.copy(a).multiplyScalar(u ? 0.35 + N * 0.2 : 0.03 +
|
|
501
|
-
let
|
|
502
|
-
for (const
|
|
498
|
+
M.uP0.value.set(e.pos.x, 0.05, e.pos.z), M.uP2.value.set(o.pos.x, 0.05, o.pos.z), yt(M.uP0.value, M.uP2.value, 0.18 * (s % 2 ? 1 : -1), 0.05, M.uP1.value), (G = v.current) == null || G.position.copy(o.pos);
|
|
499
|
+
const y = performance.now(), u = r.inflight > 0, L = Math.exp(-((y - r.activeAt) / 1e3) * 1.5), N = u && !I ? 0.5 + 0.5 * Math.sin(T.elapsedTime * 5) : u ? 0.5 : 0, j = u ? 1.5 + N * 0.9 : 0.16 + L * 0.9;
|
|
500
|
+
l.cap.color.copy(a).multiplyScalar(j * 0.5), l.stem.color.copy(a).multiplyScalar(j * 0.16), l.halo.color.copy(a).multiplyScalar(u ? 0.35 + N * 0.2 : 0.03 + L * 0.2), l.pool.color.copy(a).multiplyScalar(u ? 0.32 : 0.06 + L * 0.2), (V = f.current) == null || V.scale.setScalar(u ? 3.6 + N * 0.6 : 2.2 + L), h.current && h.current.scale.setScalar(u ? 1.12 + N * 0.06 : 1 + L * 0.08);
|
|
501
|
+
let E = r.name, d = null;
|
|
502
|
+
for (const D of J.mcpCalls) D.server === t.name && D.resource === r.name && (!d || D.start > d.start) && (d = D);
|
|
503
503
|
if (u) {
|
|
504
|
-
let
|
|
505
|
-
for (const F of J.mcpPending.values()) F.server === t.name && F.resource === r.name && (
|
|
506
|
-
|
|
507
|
-
} else
|
|
508
|
-
p.current && (
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
const
|
|
512
|
-
|
|
504
|
+
let D = "";
|
|
505
|
+
for (const F of J.mcpPending.values()) F.server === t.name && F.resource === r.name && (D = F.tool);
|
|
506
|
+
E = `${r.name} ▶ ${D || "query"}()`;
|
|
507
|
+
} else d && d.phase === "result" && y - d.start < 1800 && (E = `${r.name} ✓ returned`);
|
|
508
|
+
p.current && (E !== C.current && (p.current.setText(E), C.current = E), p.current.setOpacity(u ? 1 : 0.55 + L * 0.45), p.current.setEmphasis(u));
|
|
509
|
+
const g = l.edge.uniforms;
|
|
510
|
+
g.uTime.value = I ? 0 : T.elapsedTime;
|
|
511
|
+
const A = d && d.phase === "result" ? (y - d.start) / d.dur : 9, R = m.current;
|
|
512
|
+
A < 1 ? (g.uRadius.value = 0.07, g.uOpacity.value = 0.9 * (1 - A * 0.6), g.uFlow.value = 0, g.uHead.value = 1 - at(A), g.uTail.value = 0.2, g.uHeadColor.value.copy(a).multiplyScalar(3), R && (R.visible = !0, ft(R, g.uP0.value, g.uP1.value, g.uP2.value, 0.14, -1, 0.5), l.arrow.color.copy(a).multiplyScalar(2 * (1 - A * 0.7)))) : u ? (g.uRadius.value = 0.04, g.uOpacity.value = 0.55, g.uFlow.value = 1, g.uHead.value = -1, R && (R.visible = !0, ft(R, g.uP0.value, g.uP1.value, g.uP2.value, 0.82, 1, 0.42), l.arrow.color.copy(a).multiplyScalar(1.2))) : (g.uRadius.value = 0.035, g.uOpacity.value = 0.14 + L * 0.4, g.uFlow.value = 0, g.uHead.value = -1, R && (R.visible = !1));
|
|
513
513
|
}), /* @__PURE__ */ H(ce, { children: [
|
|
514
514
|
/* @__PURE__ */ c("mesh", { geometry: Dt, material: l.edge, frustumCulled: !1 }),
|
|
515
515
|
/* @__PURE__ */ c("mesh", { ref: m, geometry: wt, material: l.arrow, visible: !1 }),
|
|
516
|
-
/* @__PURE__ */ H("group", { ref:
|
|
516
|
+
/* @__PURE__ */ H("group", { ref: v, children: [
|
|
517
517
|
/* @__PURE__ */ c("mesh", { geometry: Le, material: l.pool, position: [0, 0.02, 0], scale: 3.2 }),
|
|
518
518
|
/* @__PURE__ */ c("sprite", { ref: f, material: l.halo, position: [0, 0.8, 0] }),
|
|
519
519
|
/* @__PURE__ */ c("group", { ref: h, children: /* @__PURE__ */ c(Nt, { parts: i, cap: l.cap, stem: l.stem }) }),
|
|
@@ -521,66 +521,66 @@ function jo({ mcp: e, backend: o }) {
|
|
|
521
521
|
] })
|
|
522
522
|
] });
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function Ho({ mcp: e }) {
|
|
525
525
|
const o = e.srv, t = S(() => new n.Color(o.color).lerp(te, 0.2), [o.color]), r = S(() => ({ cap: de(t), stem: de(t), halo: Ae(t), pool: Ue(t) }), [t]), s = _(null), i = _(null), a = _(null);
|
|
526
526
|
return Z(({ clock: l }) => {
|
|
527
|
-
var
|
|
528
|
-
(
|
|
529
|
-
const
|
|
530
|
-
r.cap.color.copy(t).multiplyScalar(p * 0.55), r.stem.color.copy(t).multiplyScalar(p * 0.18), r.halo.color.copy(t).multiplyScalar(h ? 0.3 : 0.1 + f * 0.15), r.pool.color.copy(t).multiplyScalar(h ? 0.3 : 0.1 + f * 0.15), (
|
|
527
|
+
var C, T;
|
|
528
|
+
(C = a.current) == null || C.position.copy(e.pos);
|
|
529
|
+
const v = performance.now(), h = o.inflight > 0, f = Math.exp(-((v - o.activeAt) / 1e3) * 1.5), m = h && !I ? 0.5 + 0.5 * Math.sin(l.elapsedTime * 3) : 0, p = (h ? 0.8 + m * 0.3 : 0.3) + f * 0.45;
|
|
530
|
+
r.cap.color.copy(t).multiplyScalar(p * 0.55), r.stem.color.copy(t).multiplyScalar(p * 0.18), r.halo.color.copy(t).multiplyScalar(h ? 0.3 : 0.1 + f * 0.15), r.pool.color.copy(t).multiplyScalar(h ? 0.3 : 0.1 + f * 0.15), (T = s.current) == null || T.scale.setScalar(5.5 + (h ? m * 0.8 : 0)), i.current && i.current.scale.setScalar(1 + f * 0.05 + m * 0.03);
|
|
531
531
|
}), /* @__PURE__ */ H("group", { ref: a, children: [
|
|
532
532
|
/* @__PURE__ */ c("mesh", { geometry: Le, material: r.pool, position: [0, 0.02, 0], scale: 6 }),
|
|
533
533
|
/* @__PURE__ */ c("sprite", { ref: s, material: r.halo, position: [0, 1.6, 0] }),
|
|
534
|
-
/* @__PURE__ */ c("group", { ref: i, children: /* @__PURE__ */ c(Nt, { parts:
|
|
534
|
+
/* @__PURE__ */ c("group", { ref: i, children: /* @__PURE__ */ c(Nt, { parts: jo, cap: r.cap, stem: r.stem }) }),
|
|
535
535
|
/* @__PURE__ */ c(Ee, { position: [0, 2.95, 0], text: `MCP · ${o.name}`, color: o.color, size: 0.3, pxRange: [9, 13] })
|
|
536
536
|
] });
|
|
537
537
|
}
|
|
538
538
|
const He = 28, Pe = 44, Ve = 3;
|
|
539
|
-
function
|
|
539
|
+
function $o() {
|
|
540
540
|
const e = S(() => {
|
|
541
541
|
const s = new n.BufferGeometry();
|
|
542
542
|
return s.setAttribute("position", new n.BufferAttribute(new Float32Array(He * Ve * Pe * 2 * 3), 3)), s.setAttribute("color", new n.BufferAttribute(new Float32Array(He * Ve * Pe * 2 * 3), 3)), s.boundingSphere = new n.Sphere(new n.Vector3(), 1e4), s;
|
|
543
543
|
}, []), o = S(() => new n.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), []), t = S(() => new ot(He), []), r = S(() => ({ a: new n.Vector3(), b: new n.Vector3(), c: new n.Vector3(), p: new n.Vector3(), col: new n.Color(), k: new n.Color() }), []);
|
|
544
544
|
return Z(({ clock: s }) => {
|
|
545
|
-
const i = performance.now(), a = I ? 0 : s.elapsedTime, l = e.getAttribute("position"),
|
|
545
|
+
const i = performance.now(), a = I ? 0 : s.elapsedTime, l = e.getAttribute("position"), v = e.getAttribute("color");
|
|
546
546
|
let h = 0;
|
|
547
547
|
t.begin();
|
|
548
|
-
const f = (p,
|
|
548
|
+
const f = (p, C, T, M, y) => {
|
|
549
549
|
if (h >= He) return;
|
|
550
|
-
const u = Gt(p),
|
|
551
|
-
if (!u || !
|
|
552
|
-
const { a: j, b:
|
|
553
|
-
j.set(u.x, 0.07, u.z),
|
|
554
|
-
let
|
|
555
|
-
|
|
556
|
-
const
|
|
550
|
+
const u = Gt(p), L = J.mcpServers.get(C), N = no(C);
|
|
551
|
+
if (!u || !L || !N) return;
|
|
552
|
+
const { a: j, b: E, c: d, p: g, col: A, k: R } = r;
|
|
553
|
+
j.set(u.x, 0.07, u.z), E.set(N.x, 0.07, N.z), yt(j, E, 0.16 * (y % 2 ? 1 : -1), 0.07, d), A.set(L.color).lerp(te, 0.3);
|
|
554
|
+
let G;
|
|
555
|
+
T === 0 ? (A.lerp(tt, le(M / 1.2)), M > 1.2 && A.lerp(Vt, le((M - 1.2) / 1)), G = (0.3 + Math.min(0.6, M * 0.25)) * De(M / 0.3)) : (R.copy(A).lerp(ie, 0.35), G = 1.3 * (M < 0.75 ? 1 : 1 - (M - 0.75) / 0.25));
|
|
556
|
+
const V = 1 - at(M / 0.75), D = T === 0 ? De(M / 0.45) : 1;
|
|
557
557
|
for (let F = 0; F < Ve; F++)
|
|
558
558
|
for (let K = 0; K < Pe; K++)
|
|
559
559
|
for (let W = 0; W < 2; W++) {
|
|
560
560
|
const O = (K + W) / Pe;
|
|
561
|
-
xe(j,
|
|
562
|
-
const q = Math.sin(O * Math.PI) * (0.1 + F * 0.06) * Math.sin(O * (17 + F * 6) + F * 2.1 + y),
|
|
563
|
-
l.setXYZ(
|
|
561
|
+
xe(j, d, E, O, g);
|
|
562
|
+
const q = Math.sin(O * Math.PI) * (0.1 + F * 0.06) * Math.sin(O * (17 + F * 6) + F * 2.1 + y), x = ((h * Ve + F) * Pe + K) * 2 + W;
|
|
563
|
+
l.setXYZ(x, g.x + q, g.y + Math.abs(q) * 0.3, g.z - q);
|
|
564
564
|
let z;
|
|
565
|
-
if (
|
|
565
|
+
if (T === 0) {
|
|
566
566
|
const $ = Math.pow(Math.max(0, Math.sin(O * 22 - a * 2.4)), 8);
|
|
567
|
-
z = O >
|
|
568
|
-
} else z =
|
|
569
|
-
const
|
|
570
|
-
|
|
567
|
+
z = O > D ? 0 : G * (0.3 + $ * 1.5) * (F === 0 ? 1 : 0.35);
|
|
568
|
+
} else z = G * (0.25 + Math.exp(-(((O - V) / 0.07) ** 2)) * 3 * (M < 0.8 ? 1 : 0)) * (F === 0 ? 1 : 0.6);
|
|
569
|
+
const U = T === 0 ? A : R;
|
|
570
|
+
v.setXYZ(x, U.r * z, U.g * z, U.b * z);
|
|
571
571
|
}
|
|
572
|
-
|
|
572
|
+
T === 0 ? D > 0.9 && t.add(j, d, E, 0.9, 1, 0.5, A, 0.4 + G * 1.4) : (t.add(j, d, E, 0.08, -1, 0.66, R, G * 1.6), M < 0.75 && (xe(j, d, E, V, g), g.y += 0.12, It(g, R, 0.45, 0.4))), h++;
|
|
573
573
|
};
|
|
574
574
|
let m = 0;
|
|
575
|
-
for (const p of J.mcpPending.values()) f(p.instance, p.server, 0,
|
|
575
|
+
for (const p of J.mcpPending.values()) f(p.instance, p.server, 0, oo(p, i), m++);
|
|
576
576
|
for (const p of J.mcpCalls) p.phase === "result" && f(p.instance, p.server, 1, le((i - p.start) / p.dur), p.id);
|
|
577
|
-
e.setDrawRange(0, h * Ve * Pe * 2), l.needsUpdate = !0,
|
|
577
|
+
e.setDrawRange(0, h * Ve * Pe * 2), l.needsUpdate = !0, v.needsUpdate = !0, t.end();
|
|
578
578
|
}), /* @__PURE__ */ H(ce, { children: [
|
|
579
579
|
/* @__PURE__ */ c("lineSegments", { geometry: e, material: o, frustumCulled: !1 }),
|
|
580
580
|
/* @__PURE__ */ c("primitive", { object: t.mesh })
|
|
581
581
|
] });
|
|
582
582
|
}
|
|
583
|
-
const
|
|
583
|
+
const Yo = (
|
|
584
584
|
/* glsl */
|
|
585
585
|
`
|
|
586
586
|
attribute float aPhase; uniform float uTime; varying float vK; varying float vD;
|
|
@@ -590,21 +590,21 @@ void main(){
|
|
|
590
590
|
vD = -mv.z;
|
|
591
591
|
gl_Position = projectionMatrix * mv;
|
|
592
592
|
}`
|
|
593
|
-
),
|
|
593
|
+
), Zo = (
|
|
594
594
|
/* glsl */
|
|
595
595
|
`
|
|
596
596
|
uniform vec3 uColor; varying float vK; varying float vD;
|
|
597
597
|
void main(){ float fade = 1.0 - smoothstep(30.0, 60.0, vD); gl_FragColor = vec4(uColor * (0.07 + vK * 0.7) * fade, 1.0); }`
|
|
598
598
|
);
|
|
599
|
-
function
|
|
599
|
+
function Jo() {
|
|
600
600
|
const { geo: e, mat: o } = S(() => {
|
|
601
601
|
let t = 3;
|
|
602
|
-
const r = () => (t = t * 16807 % 2147483647) / 2147483647, s = [], i = [], a = (h, f, m, p,
|
|
603
|
-
let M =
|
|
602
|
+
const r = () => (t = t * 16807 % 2147483647) / 2147483647, s = [], i = [], a = (h, f, m, p, C, T) => {
|
|
603
|
+
let M = C;
|
|
604
604
|
for (let y = 0; y < p; y++) {
|
|
605
605
|
m += (r() - 0.5) * 0.7;
|
|
606
|
-
const u = h + Math.cos(m) * 0.55,
|
|
607
|
-
s.push(h, 0.035, f, u, 0.035,
|
|
606
|
+
const u = h + Math.cos(m) * 0.55, L = f + Math.sin(m) * 0.55;
|
|
607
|
+
s.push(h, 0.035, f, u, 0.035, L), i.push(M, M + 0.55), M += 0.55, h = u, f = L, T < 3 && r() < 0.09 && a(h, f, m + (r() < 0.5 ? 0.9 : -0.9), Math.floor(p * 0.5), M, T + 1);
|
|
608
608
|
}
|
|
609
609
|
};
|
|
610
610
|
for (let h = 0; h < 30; h++) {
|
|
@@ -613,31 +613,31 @@ function Zo() {
|
|
|
613
613
|
}
|
|
614
614
|
const l = new n.BufferGeometry();
|
|
615
615
|
l.setAttribute("position", new n.Float32BufferAttribute(s, 3)), l.setAttribute("aPhase", new n.Float32BufferAttribute(i, 1));
|
|
616
|
-
const
|
|
617
|
-
return { geo: l, mat:
|
|
616
|
+
const v = new n.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uColor: { value: te.clone().multiplyScalar(0.5) } }, vertexShader: Yo, fragmentShader: Zo, transparent: !0, depthWrite: !1, blending: n.AdditiveBlending });
|
|
617
|
+
return { geo: l, mat: v };
|
|
618
618
|
}, []);
|
|
619
619
|
return Z(({ clock: t }) => {
|
|
620
620
|
o.uniforms.uTime.value = I ? 0 : t.elapsedTime;
|
|
621
621
|
}), /* @__PURE__ */ c("lineSegments", { geometry: e, material: o });
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function Qo() {
|
|
624
624
|
return /* @__PURE__ */ H(ce, { children: [
|
|
625
|
-
/* @__PURE__ */ c(
|
|
626
|
-
/* @__PURE__ */ c(
|
|
625
|
+
/* @__PURE__ */ c(Jo, {}),
|
|
626
|
+
/* @__PURE__ */ c($o, {})
|
|
627
627
|
] });
|
|
628
628
|
}
|
|
629
|
-
const ze = 4.4, ht = ze + 1.35,
|
|
630
|
-
function
|
|
629
|
+
const ze = 4.4, ht = ze + 1.35, en = ht + 0.9;
|
|
630
|
+
function tn(e, o, t) {
|
|
631
631
|
const r = ze * 0.9 * Math.sqrt((e + 0.6) / o), s = e * 2.39996323;
|
|
632
632
|
return t.set(Math.cos(s) * r, 0.08, Math.sin(s) * r);
|
|
633
633
|
}
|
|
634
|
-
const
|
|
634
|
+
const on = 64, nn = 180, $e = 40, Te = 18, Se = 12, Ye = 3, Me = 11, rn = (
|
|
635
635
|
/* glsl */
|
|
636
636
|
`
|
|
637
637
|
varying vec2 vP;
|
|
638
638
|
// pond-local ground coords: the disc is rotated -90deg about X, local (x, y) -> (x, 0, -y)
|
|
639
639
|
void main(){ vP = vec2(position.x, -position.y); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`
|
|
640
|
-
),
|
|
640
|
+
), an = (
|
|
641
641
|
/* glsl */
|
|
642
642
|
`
|
|
643
643
|
uniform float uTime; uniform float uR;
|
|
@@ -669,7 +669,7 @@ void main(){
|
|
|
669
669
|
float edge = 1.0 - smoothstep(0.985, 1.0, r);
|
|
670
670
|
gl_FragColor = vec4(col, edge);
|
|
671
671
|
}`
|
|
672
|
-
),
|
|
672
|
+
), sn = (
|
|
673
673
|
/* glsl */
|
|
674
674
|
`
|
|
675
675
|
attribute float aSize; attribute vec3 aColor; uniform float uScale; uniform float uTime; varying vec3 vC;
|
|
@@ -677,7 +677,7 @@ void main(){
|
|
|
677
677
|
vec3 p = position; p.y += sin(uTime * 0.9 + position.x * 2.1 + position.z * 1.7) * 0.03;
|
|
678
678
|
vec4 mv = modelViewMatrix * vec4(p, 1.0);
|
|
679
679
|
gl_PointSize = aSize * uScale / -mv.z; vC = aColor; gl_Position = projectionMatrix * mv; }`
|
|
680
|
-
),
|
|
680
|
+
), ln = (
|
|
681
681
|
/* glsl */
|
|
682
682
|
`
|
|
683
683
|
varying vec3 vC;
|
|
@@ -685,40 +685,40 @@ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
|
|
|
685
685
|
float core = smoothstep(0.45, 0.0, r); float halo = pow(1.0 - r, 2.2);
|
|
686
686
|
gl_FragColor = vec4(vC * (core * 1.25 + halo * 0.45), 1.0); }`
|
|
687
687
|
);
|
|
688
|
-
function
|
|
689
|
-
const [o, t] = et("center"), r = S(() => ({ nodes: e.nodes.slice(0,
|
|
690
|
-
const
|
|
691
|
-
for (let
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
for (const
|
|
696
|
-
const z =
|
|
697
|
-
z !== void 0 &&
|
|
688
|
+
function cn({ galaxy: e }) {
|
|
689
|
+
const [o, t] = et("center"), r = S(() => ({ nodes: e.nodes.slice(0, nn), links: e.links }), [e]), s = r.nodes.length, { size: i, gl: a, camera: l } = rt(), v = _([]), h = _([]), f = _(Array(Ye).fill("")), m = _([]), p = S(() => {
|
|
690
|
+
const d = new Float32Array(s * 3), g = new n.Vector3();
|
|
691
|
+
for (let x = 0; x < s; x++) d.set(tn(x, s, g).toArray(), x * 3);
|
|
692
|
+
const A = r.nodes.map((x) => new n.Color(ro[x.kind] ?? "#94a3b8").lerp(te, 0.45).multiplyScalar(0.5)), R = new n.BufferGeometry();
|
|
693
|
+
R.setAttribute("position", new n.BufferAttribute(d, 3)), R.setAttribute("aSize", new n.BufferAttribute(new Float32Array(s), 1)), R.setAttribute("aColor", new n.BufferAttribute(new Float32Array(s * 3), 3)), R.boundingSphere = new n.Sphere(new n.Vector3(), 1e4);
|
|
694
|
+
const G = new Map(r.nodes.map((x, z) => [x.id, z])), V = [], D = [], F = (x, z) => (d[x * 3] - d[z * 3]) ** 2 + (d[x * 3 + 2] - d[z * 3 + 2]) ** 2;
|
|
695
|
+
for (const x of r.links) {
|
|
696
|
+
const z = G.get(x.source), U = G.get(x.target);
|
|
697
|
+
z !== void 0 && U !== void 0 && z !== U && F(z, U) < 4.5 && (V.push(z, U), D.push(1));
|
|
698
698
|
}
|
|
699
|
-
for (let
|
|
700
|
-
let z = -1,
|
|
701
|
-
for (let $ = 0; $ < s; $++) $ !==
|
|
702
|
-
z >
|
|
699
|
+
for (let x = 0; x < s; x++) {
|
|
700
|
+
let z = -1, U = 1e9;
|
|
701
|
+
for (let $ = 0; $ < s; $++) $ !== x && F(x, $) < U && (U = F(x, $), z = $);
|
|
702
|
+
z > x && (V.push(x, z), D.push(0));
|
|
703
703
|
}
|
|
704
|
-
const K =
|
|
705
|
-
for (let
|
|
704
|
+
const K = D.length, W = new Float32Array(K * 2 * 3);
|
|
705
|
+
for (let x = 0; x < K; x++)
|
|
706
706
|
for (let z = 0; z < 2; z++) {
|
|
707
|
-
const
|
|
708
|
-
W.set([
|
|
707
|
+
const U = V[x * 2 + z];
|
|
708
|
+
W.set([d[U * 3], 0.05, d[U * 3 + 2]], (x * 2 + z) * 3);
|
|
709
709
|
}
|
|
710
710
|
const O = new n.BufferGeometry();
|
|
711
711
|
O.setAttribute("position", new n.BufferAttribute(W, 3)), O.setAttribute("color", new n.BufferAttribute(new Float32Array(K * 2 * 3), 3));
|
|
712
712
|
const q = new n.BufferGeometry();
|
|
713
|
-
return q.setAttribute("position", new n.BufferAttribute(new Float32Array($e * Te * 2 * 3), 3)), q.setAttribute("color", new n.BufferAttribute(new Float32Array($e * Te * 2 * 3), 3)), q.boundingSphere = new n.Sphere(new n.Vector3(), 1e4), { pos:
|
|
714
|
-
}, [r, s]),
|
|
715
|
-
const
|
|
716
|
-
for (let
|
|
717
|
-
const
|
|
718
|
-
|
|
713
|
+
return q.setAttribute("position", new n.BufferAttribute(new Float32Array($e * Te * 2 * 3), 3)), q.setAttribute("color", new n.BufferAttribute(new Float32Array($e * Te * 2 * 3), 3)), q.boundingSphere = new n.Sphere(new n.Vector3(), 1e4), { pos: d, base: A, ngeo: R, lgeo: O, pairs: V, strong: D, np: K, bgeo: q, fire: new Float32Array(s), white: new Float32Array(s), fireC: Array.from({ length: s }, () => new n.Color()) };
|
|
714
|
+
}, [r, s]), C = S(() => {
|
|
715
|
+
const d = [];
|
|
716
|
+
for (let g = 0; g < Me; g++) {
|
|
717
|
+
const A = g / Me * Math.PI * 2 + 0.2;
|
|
718
|
+
d.push({ a: A, x: Math.cos(A) * ht, z: Math.sin(A) * ht, h: 0.7 + Re(`stone${g}`, 1) * 0.6, rot: Re(`stone${g}`, 2) * 3, tilt: (Re(`stone${g}`, 3) - 0.5) * 0.18 });
|
|
719
719
|
}
|
|
720
|
-
return
|
|
721
|
-
}, []),
|
|
720
|
+
return d;
|
|
721
|
+
}, []), T = S(() => new Float32Array(Me), []), M = S(() => new n.DodecahedronGeometry(1, 0), []), y = S(
|
|
722
722
|
() => ({
|
|
723
723
|
water: new n.ShaderMaterial({
|
|
724
724
|
uniforms: {
|
|
@@ -727,52 +727,52 @@ function ln({ galaxy: e }) {
|
|
|
727
727
|
uRip: { value: Array.from({ length: Se }, () => new n.Vector4(0, 0, -1, 0)) },
|
|
728
728
|
uRipC: { value: Array.from({ length: Se }, () => new n.Color()) }
|
|
729
729
|
},
|
|
730
|
-
vertexShader:
|
|
731
|
-
fragmentShader:
|
|
730
|
+
vertexShader: rn,
|
|
731
|
+
fragmentShader: an,
|
|
732
732
|
transparent: !0,
|
|
733
733
|
depthWrite: !1
|
|
734
734
|
}),
|
|
735
|
-
nodes: new n.ShaderMaterial({ uniforms: { uScale: { value: 400 }, uTime: { value: 0 } }, vertexShader:
|
|
735
|
+
nodes: new n.ShaderMaterial({ uniforms: { uScale: { value: 400 }, uTime: { value: 0 } }, vertexShader: sn, fragmentShader: ln, transparent: !0, depthWrite: !1, blending: n.AdditiveBlending }),
|
|
736
736
|
threads: new n.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
|
|
737
737
|
beam: new n.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
|
|
738
738
|
stone: new n.MeshStandardMaterial({ color: "#1a2c2c", roughness: 0.92, metalness: 0, flatShading: !0 }),
|
|
739
739
|
rune: Ae(te)
|
|
740
740
|
}),
|
|
741
741
|
[]
|
|
742
|
-
), u = S(() =>
|
|
743
|
-
let
|
|
744
|
-
return
|
|
742
|
+
), u = S(() => C.map(() => Ae(te)), [C]), L = S(() => /* @__PURE__ */ new Map(), []), N = S(() => new ot($e), []), j = S(() => ({ v: new n.Vector3(), v2: new n.Vector3(), mid: new n.Vector3(), sp: new n.Vector3(), c: new n.Color(), c2: new n.Color() }), []), E = (d) => {
|
|
743
|
+
let g = L.get(d);
|
|
744
|
+
return g === void 0 && L.set(d, g = io(r, d)), g;
|
|
745
745
|
};
|
|
746
|
-
return Z(({ clock:
|
|
747
|
-
const
|
|
748
|
-
|
|
749
|
-
const
|
|
750
|
-
y.nodes.uniforms.uScale.value = i.height * a.getPixelRatio() / (2 * Math.tan(l.fov * Math.PI / 360)) * O, y.nodes.uniforms.uTime.value =
|
|
751
|
-
for (let b = 0; b < Me; b++)
|
|
752
|
-
const { v: q, v2:
|
|
746
|
+
return Z(({ clock: d }, g) => {
|
|
747
|
+
const A = me.graph.out.x < -0.5 ? "left" : "center";
|
|
748
|
+
A !== o && t(A);
|
|
749
|
+
const R = performance.now(), G = I ? 0 : d.elapsedTime, { pos: V, base: D, fire: F, white: K, fireC: W } = p, O = Math.max(0.05, me.graph.scale);
|
|
750
|
+
y.nodes.uniforms.uScale.value = i.height * a.getPixelRatio() / (2 * Math.tan(l.fov * Math.PI / 360)) * O, y.nodes.uniforms.uTime.value = G, y.water.uniforms.uTime.value = G, F.fill(0), K.fill(0);
|
|
751
|
+
for (let b = 0; b < Me; b++) T[b] *= Math.exp(-g * 1.4);
|
|
752
|
+
const { v: q, v2: x, mid: z, c: U, c2: $ } = j, Fe = p.bgeo.getAttribute("position"), Be = p.bgeo.getAttribute("color"), Oe = y.water.uniforms.uRip.value, ke = y.water.uniforms.uRipC.value;
|
|
753
753
|
let ge = 0, ue = 0;
|
|
754
754
|
N.begin();
|
|
755
755
|
const Ce = J.flares;
|
|
756
|
-
for (let b = Math.max(0, Ce.length -
|
|
757
|
-
const B = Ce[b], Y =
|
|
756
|
+
for (let b = Math.max(0, Ce.length - on); b < Ce.length; b++) {
|
|
757
|
+
const B = Ce[b], Y = E(B.node), X = (R - B.start) / 1e3, Ge = J.instances.get(B.instance), fe = Ge ? gt[Ge.type] : te, ee = B.op === "write", re = X < 0.35 ? X / 0.35 : Math.exp(-(X - 0.35) * 1.2);
|
|
758
758
|
re > F[Y] && (F[Y] = re, W[Y].copy(ee ? ie : fe), K[Y] = ee ? 1 : 0);
|
|
759
|
-
const ve =
|
|
759
|
+
const ve = V[Y * 3], st = V[Y * 3 + 2], At = X / (ee ? 2.2 : 1.4);
|
|
760
760
|
if (At < 1 && ue < Se && (Oe[ue].set(ve, st, At, ee ? 1 : 0), ke[ue].copy(ee ? ie : fe).multiplyScalar(ee ? 0.7 : 0.5), ue++), X < 0.05) {
|
|
761
761
|
let ye = Math.atan2(st, ve) - 0.2;
|
|
762
762
|
ye < 0 && (ye += Math.PI * 2);
|
|
763
763
|
const Ne = Math.round(ye / (Math.PI * 2) * Me) % Me;
|
|
764
|
-
|
|
764
|
+
T[Ne] = Math.min(1.6, T[Ne] + (ee ? 0.9 : 0.5));
|
|
765
765
|
}
|
|
766
|
-
const it = pt(B.instance, j.sp), we = it ?
|
|
766
|
+
const it = pt(B.instance, j.sp), we = it ? ao(it, it) : void 0;
|
|
767
767
|
if (we && X < 2.2 && ge < $e) {
|
|
768
768
|
q.set(ve, 0.1, st), Ut(we, q, 1.6 / O, z);
|
|
769
769
|
const ye = Math.min(1, X / 0.3) * (1 - X / 2.2) ** 1.5, Ne = ee ? Math.min(1, X * 0.85) : 1 - Math.min(1, X * 0.85);
|
|
770
770
|
for (let We = 0; We < Te; We++)
|
|
771
771
|
for (let qe = 0; qe < 2; qe++) {
|
|
772
772
|
const ne = (We + qe) / Te, pe = 1 - ne;
|
|
773
|
-
|
|
773
|
+
x.set(pe * pe * we.x + 2 * pe * ne * z.x + ne * ne * q.x, pe * pe * we.y + 2 * pe * ne * z.y + ne * ne * q.y, pe * pe * we.z + 2 * pe * ne * z.z + ne * ne * q.z);
|
|
774
774
|
const xt = (ge * Te + We) * 2 + qe;
|
|
775
|
-
Fe.setXYZ(xt,
|
|
775
|
+
Fe.setXYZ(xt, x.x, x.y, x.z);
|
|
776
776
|
const qt = Math.exp(-(((ne - Ne) / 0.09) ** 2)) * 1.4;
|
|
777
777
|
$.copy(ee ? ie : fe).multiplyScalar(ye * ((ee ? 0.4 : 0.16) + qt) * 0.8), Be.setXYZ(xt, $.r, $.g, $.b);
|
|
778
778
|
}
|
|
@@ -784,7 +784,7 @@ function ln({ galaxy: e }) {
|
|
|
784
784
|
const Q = p.ngeo.getAttribute("aSize"), Ie = p.ngeo.getAttribute("aColor");
|
|
785
785
|
for (let b = 0; b < s; b++) {
|
|
786
786
|
const B = F[b];
|
|
787
|
-
Q.setX(b, 0.2 + B * (0.5 + K[b] * 0.25)),
|
|
787
|
+
Q.setX(b, 0.2 + B * (0.5 + K[b] * 0.25)), U.copy(D[b]), B > 0.01 && Pt(Pt(U, W[b], B * 1.6), ie, B * (0.3 + K[b] * 1.1)), Ie.setXYZ(b, U.r, U.g, U.b);
|
|
788
788
|
}
|
|
789
789
|
Q.needsUpdate = !0, Ie.needsUpdate = !0;
|
|
790
790
|
const _e = p.lgeo.getAttribute("color");
|
|
@@ -794,50 +794,50 @@ function ln({ galaxy: e }) {
|
|
|
794
794
|
}
|
|
795
795
|
_e.needsUpdate = !0;
|
|
796
796
|
for (let b = 0; b < Me; b++) {
|
|
797
|
-
const B = m.current[b], Y =
|
|
797
|
+
const B = m.current[b], Y = T[b];
|
|
798
798
|
u[b].color.copy(te).multiplyScalar(0.05 + Math.min(1, Y) * 0.6), B && B.scale.setScalar(0.5 + Math.min(1, Y) * 0.5);
|
|
799
799
|
}
|
|
800
800
|
let k = 0;
|
|
801
801
|
for (let b = J.flares.length - 1; b >= 0 && k < Ye; b--) {
|
|
802
802
|
const B = J.flares[b];
|
|
803
|
-
if (
|
|
803
|
+
if (R - B.start > 2200) break;
|
|
804
804
|
let Y = !1;
|
|
805
805
|
for (let re = 0; re < k; re++) f.current[re] === B.node && (Y = !0);
|
|
806
806
|
if (Y) continue;
|
|
807
|
-
const X =
|
|
807
|
+
const X = E(B.node);
|
|
808
808
|
let Ge = !1;
|
|
809
809
|
for (let re = 0; re < k; re++) {
|
|
810
810
|
const ve = h.current[re];
|
|
811
|
-
ve && Math.abs(ve.position.z -
|
|
811
|
+
ve && Math.abs(ve.position.z - V[X * 3 + 2]) * me.graph.scale < 1.1 && Math.abs(ve.position.x - V[X * 3]) * me.graph.scale < 4 && (Ge = !0);
|
|
812
812
|
}
|
|
813
813
|
if (Ge) continue;
|
|
814
|
-
const fe =
|
|
815
|
-
fe && ee && (ee.position.set(
|
|
814
|
+
const fe = v.current[k], ee = h.current[k];
|
|
815
|
+
fe && ee && (ee.position.set(V[X * 3], 0.5, V[X * 3 + 2]), f.current[k] !== B.node && (fe.setText(`${B.op === "write" ? "wrote" : "read"} · ${B.node}`), fe.setColor(B.op === "write" ? "#ffffff" : "#5eead4")), fe.setOpacity(1)), f.current[k] = B.node, k++;
|
|
816
816
|
}
|
|
817
817
|
for (let b = k; b < Ye; b++) {
|
|
818
|
-
const B =
|
|
818
|
+
const B = v.current[b];
|
|
819
819
|
B == null || B.setOpacity(0), f.current[b] = "";
|
|
820
820
|
}
|
|
821
821
|
}), /* @__PURE__ */ H(ce, { children: [
|
|
822
822
|
/* @__PURE__ */ c("mesh", { rotation: [-Math.PI / 2, 0, 0], position: [0, 0.03, 0], material: y.water, renderOrder: -1, children: /* @__PURE__ */ c("circleGeometry", { args: [ze, 96] }) }),
|
|
823
823
|
/* @__PURE__ */ c("lineSegments", { geometry: p.lgeo, material: y.threads, frustumCulled: !1 }),
|
|
824
824
|
/* @__PURE__ */ c("points", { geometry: p.ngeo, material: y.nodes, frustumCulled: !1 }),
|
|
825
|
-
|
|
826
|
-
/* @__PURE__ */ c("mesh", { geometry: M, material: y.stone, position: [0,
|
|
827
|
-
/* @__PURE__ */ c("sprite", { ref: (
|
|
828
|
-
] },
|
|
825
|
+
C.map((d, g) => /* @__PURE__ */ H("group", { position: [d.x, 0, d.z], rotation: [d.tilt, d.rot, d.tilt * 0.6], children: [
|
|
826
|
+
/* @__PURE__ */ c("mesh", { geometry: M, material: y.stone, position: [0, d.h * 0.5, 0], scale: [0.34, d.h * 0.6, 0.24] }),
|
|
827
|
+
/* @__PURE__ */ c("sprite", { ref: (A) => void (m.current[g] = A), material: u[g], position: [0, d.h * 0.62, 0], scale: 0.5 })
|
|
828
|
+
] }, g)),
|
|
829
829
|
/* @__PURE__ */ c("lineSegments", { geometry: p.bgeo, material: y.beam, frustumCulled: !1 }),
|
|
830
830
|
/* @__PURE__ */ c("primitive", { object: N.mesh }),
|
|
831
|
-
Array.from({ length: Ye }, (
|
|
832
|
-
/* @__PURE__ */ c(
|
|
831
|
+
Array.from({ length: Ye }, (d, g) => /* @__PURE__ */ c("group", { ref: (A) => void (h.current[g] = A), children: /* @__PURE__ */ c(Ee, { ref: (A) => void (v.current[g] = A), text: "", offset: [0, 0.36], anchorX: o, size: 0.24, opacity: 0, fadeMs: 250, pxRange: [8, 12] }) }, g)),
|
|
832
|
+
/* @__PURE__ */ c(so, { position: [o === "left" ? -ze : 0, 0.2, ze + 2.2], anchorX: o, suffix: " · pond", color: "#5eead4", size: 0.28, opacity: 0.75, pxRange: [8, 12] })
|
|
833
833
|
] });
|
|
834
834
|
}
|
|
835
|
-
const
|
|
835
|
+
const un = 26, zt = () => Math.max(1, (me.core.r + 9) / un), fn = (
|
|
836
836
|
/* glsl */
|
|
837
837
|
`
|
|
838
838
|
varying vec3 vDir;
|
|
839
839
|
void main(){ vDir = normalize(position); vec4 p = projectionMatrix * modelViewMatrix * vec4(position, 1.0); gl_Position = p.xyww; }`
|
|
840
|
-
),
|
|
840
|
+
), pn = (
|
|
841
841
|
/* glsl */
|
|
842
842
|
`
|
|
843
843
|
uniform vec3 uMoonDir; varying vec3 vDir;
|
|
@@ -854,7 +854,7 @@ void main(){
|
|
|
854
854
|
}`
|
|
855
855
|
), Rt = new n.Vector3(-0.42, 0.42, -0.8).normalize();
|
|
856
856
|
let Ze = null;
|
|
857
|
-
function
|
|
857
|
+
function mn() {
|
|
858
858
|
if (Ze) return Ze;
|
|
859
859
|
const e = document.createElement("canvas");
|
|
860
860
|
e.width = e.height = 256;
|
|
@@ -864,24 +864,24 @@ function pn() {
|
|
|
864
864
|
o.beginPath(), o.arc(r, s, i, 0, Math.PI * 2), o.fill();
|
|
865
865
|
return Ze = new n.CanvasTexture(e), Ze;
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function dn() {
|
|
868
868
|
const e = S(() => {
|
|
869
869
|
const o = new n.ConeGeometry(1, 1.6, 7).translate(0, 0.8, 0), t = 340, r = new n.InstancedMesh(o, new n.MeshStandardMaterial({ color: "#04110f", roughness: 1, flatShading: !0 }), t * 3), s = new n.Object3D();
|
|
870
870
|
let i = 5;
|
|
871
871
|
const a = () => (i = i * 16807 % 2147483647) / 2147483647;
|
|
872
872
|
let l = 0;
|
|
873
|
-
for (let
|
|
873
|
+
for (let v = 0; v < t; v++) {
|
|
874
874
|
const h = a() * Math.PI * 2, f = 30 + Math.pow(a(), 0.7) * 34, m = Math.cos(h) * f, p = Math.sin(h) * f;
|
|
875
875
|
if (p > 18 && Math.abs(m) < 26) continue;
|
|
876
|
-
const
|
|
876
|
+
const C = 5 + a() * 7, T = C * (0.22 + a() * 0.06);
|
|
877
877
|
for (let M = 0; M < 3; M++)
|
|
878
|
-
s.position.set(m,
|
|
878
|
+
s.position.set(m, C * (0.12 + M * 0.26), p), s.rotation.set(0, a() * 6, 0), s.scale.set(T * (1 - M * 0.25), C / 1.6 * 0.42, T * (1 - M * 0.25)), s.updateMatrix(), r.setMatrixAt(l++, s.matrix);
|
|
879
879
|
}
|
|
880
880
|
return r.count = l, r.instanceMatrix.needsUpdate = !0, r;
|
|
881
881
|
}, []);
|
|
882
882
|
return /* @__PURE__ */ c("primitive", { object: e });
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function hn() {
|
|
885
885
|
const e = S(() => {
|
|
886
886
|
let r = 17;
|
|
887
887
|
const s = () => (r = r * 16807 % 2147483647) / 2147483647;
|
|
@@ -890,7 +890,7 @@ function dn() {
|
|
|
890
890
|
return { x: Math.cos(i) * a, z: Math.sin(i) * a, y: 0.5 + s() * 1.4, w: 12 + s() * 12, sp: 0.1 + s() * 0.15, ph: s() * 6 };
|
|
891
891
|
});
|
|
892
892
|
}, []), o = S(
|
|
893
|
-
() => new n.SpriteMaterial({ map:
|
|
893
|
+
() => new n.SpriteMaterial({ map: vo(), color: new n.Color("#7fd6c6").multiplyScalar(0.55), transparent: !0, opacity: 0.1, depthWrite: !1, fog: !1 }),
|
|
894
894
|
[]
|
|
895
895
|
), t = _([]);
|
|
896
896
|
return Z(({ clock: r }) => {
|
|
@@ -902,17 +902,17 @@ function dn() {
|
|
|
902
902
|
});
|
|
903
903
|
}), /* @__PURE__ */ c(ce, { children: e.map((r, s) => /* @__PURE__ */ c("sprite", { ref: (i) => void (t.current[s] = i), material: o, position: [r.x, r.y, r.z], scale: [r.w, r.w * 0.32, 1] }, s)) });
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function gn() {
|
|
906
906
|
const e = _(null);
|
|
907
907
|
return Z(() => {
|
|
908
908
|
var o;
|
|
909
909
|
(o = e.current) == null || o.scale.set(zt(), 1, zt());
|
|
910
910
|
}), /* @__PURE__ */ H("group", { ref: e, children: [
|
|
911
|
-
/* @__PURE__ */ c(
|
|
912
|
-
/* @__PURE__ */ c(
|
|
911
|
+
/* @__PURE__ */ c(dn, {}),
|
|
912
|
+
/* @__PURE__ */ c(hn, {})
|
|
913
913
|
] });
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function vn() {
|
|
916
916
|
const e = S(() => Ue(new n.Color(he.moon).lerp(new n.Color("#5eead4"), 0.4).multiplyScalar(0.075)), []), o = _(null);
|
|
917
917
|
return Z(() => {
|
|
918
918
|
var r;
|
|
@@ -920,7 +920,7 @@ function gn() {
|
|
|
920
920
|
(r = o.current) == null || r.scale.set(t.hw * 2.6 + 9, 1, t.hh * 2.6 + 9);
|
|
921
921
|
}), /* @__PURE__ */ c("mesh", { ref: o, geometry: Le, material: e, position: [0, 0.01, 0] });
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function wn() {
|
|
924
924
|
return Z(({ scene: e, camera: o }) => {
|
|
925
925
|
const t = e.fog;
|
|
926
926
|
if (!t || !("density" in t)) return;
|
|
@@ -928,31 +928,31 @@ function vn() {
|
|
|
928
928
|
t.density = 0.016 * Math.min(1, 36 / Math.max(1, r));
|
|
929
929
|
}), null;
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function yn() {
|
|
932
932
|
const e = S(
|
|
933
|
-
() => new n.ShaderMaterial({ uniforms: { uMoonDir: { value: Rt } }, vertexShader:
|
|
933
|
+
() => new n.ShaderMaterial({ uniforms: { uMoonDir: { value: Rt } }, vertexShader: fn, fragmentShader: pn, side: n.BackSide, depthWrite: !1, fog: !1 }),
|
|
934
934
|
[]
|
|
935
|
-
), o = S(() => new n.SpriteMaterial({ map:
|
|
935
|
+
), o = S(() => new n.SpriteMaterial({ map: mn(), color: new n.Color(1.1, 1.15, 1.12), fog: !1, depthWrite: !1, transparent: !0, toneMapped: !1 }), []), t = S(() => new n.SpriteMaterial({ map: vt(), color: new n.Color(he.moon).multiplyScalar(0.22), fog: !1, blending: n.AdditiveBlending, depthWrite: !1, transparent: !0 }), []), r = S(() => Rt.clone().multiplyScalar(140), []);
|
|
936
936
|
return /* @__PURE__ */ H(ce, { children: [
|
|
937
937
|
/* @__PURE__ */ c("mesh", { material: e, renderOrder: -10, frustumCulled: !1, children: /* @__PURE__ */ c("sphereGeometry", { args: [180, 32, 16] }) }),
|
|
938
|
-
/* @__PURE__ */ c(
|
|
938
|
+
/* @__PURE__ */ c(mo, { radius: 150, depth: 20, count: I ? 700 : 1400, factor: 3.2, saturation: 0.1, fade: !0, speed: I ? 0 : 0.3 }),
|
|
939
939
|
/* @__PURE__ */ c("sprite", { material: t, position: r, scale: 70 }),
|
|
940
940
|
/* @__PURE__ */ c("sprite", { material: o, position: r, scale: 11 }),
|
|
941
941
|
/* @__PURE__ */ c("hemisphereLight", { args: ["#2a6b66", "#020807", 0.55] }),
|
|
942
942
|
/* @__PURE__ */ c("directionalLight", { position: [-30, 40, -60], intensity: 0.9, color: "#a8f0e2" }),
|
|
943
943
|
/* @__PURE__ */ c("ambientLight", { intensity: 0.08, color: "#5eead4" }),
|
|
944
944
|
/* @__PURE__ */ c("fogExp2", { attach: "fog", args: [he.fog, 0.016] }),
|
|
945
|
-
/* @__PURE__ */ c(
|
|
945
|
+
/* @__PURE__ */ c(wn, {}),
|
|
946
946
|
/* @__PURE__ */ H("mesh", { rotation: [-Math.PI / 2, 0, 0], receiveShadow: !0, children: [
|
|
947
947
|
/* @__PURE__ */ c("circleGeometry", { args: [170, 64] }),
|
|
948
948
|
/* @__PURE__ */ c("meshStandardMaterial", { color: he.ground, roughness: 1, metalness: 0 })
|
|
949
949
|
] }),
|
|
950
|
-
/* @__PURE__ */ c(
|
|
951
|
-
/* @__PURE__ */ c(
|
|
950
|
+
/* @__PURE__ */ c(vn, {}),
|
|
951
|
+
/* @__PURE__ */ c(gn, {})
|
|
952
952
|
] });
|
|
953
953
|
}
|
|
954
|
-
const Wt = new n.ConeGeometry(1, 1, 7, 1, !1).translate(0, 0.5, 0),
|
|
955
|
-
function
|
|
954
|
+
const Wt = new n.ConeGeometry(1, 1, 7, 1, !1).translate(0, 0.5, 0), Mn = new n.EdgesGeometry(Wt, 1), bn = new n.CylinderGeometry(0.05, 0.13, 1, 7).translate(0, 0.5, 0), Ft = new n.TorusGeometry(1, 0.035, 6, 72).rotateX(Math.PI / 2), Sn = new n.Color("#07130f");
|
|
955
|
+
function An(e, o, t) {
|
|
956
956
|
const r = e.subagent ? 2 : 3, s = [];
|
|
957
957
|
for (let i = 0; i < r; i++) {
|
|
958
958
|
const a = r === 2 ? i * 1.4 : i;
|
|
@@ -960,12 +960,12 @@ function Sn(e, o, t) {
|
|
|
960
960
|
}
|
|
961
961
|
return s;
|
|
962
962
|
}
|
|
963
|
-
function
|
|
964
|
-
const t = e.inst, r = _(null), s = _(null), i = _(null), a = _(null), l = _(null),
|
|
963
|
+
function xn({ agent: e, onSelect: o }) {
|
|
964
|
+
const t = e.inst, r = _(null), s = _(null), i = _(null), a = _(null), l = _(null), v = _(null), h = _(null), f = _(null), m = gt[t.type], p = S(() => Mt(t), [t]), C = Ao(t), T = S(() => An(t, p, C), [t, p, C]), M = S(() => Re(t.id, 9), [t.id]), y = S(
|
|
965
965
|
() => ({
|
|
966
966
|
fill: de(m),
|
|
967
|
-
line:
|
|
968
|
-
trunk: new n.MeshBasicMaterial({ color:
|
|
967
|
+
line: wo(m),
|
|
968
|
+
trunk: new n.MeshBasicMaterial({ color: Sn }),
|
|
969
969
|
halo: Ae(m),
|
|
970
970
|
pool: Ue(m),
|
|
971
971
|
ring: de(tt),
|
|
@@ -994,55 +994,55 @@ function An({ agent: e, onSelect: o }) {
|
|
|
994
994
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
995
995
|
[]
|
|
996
996
|
);
|
|
997
|
-
Z(({ clock:
|
|
997
|
+
Z(({ clock: d }) => {
|
|
998
998
|
var _e;
|
|
999
|
-
const
|
|
999
|
+
const g = performance.now(), A = d.elapsedTime;
|
|
1000
1000
|
u.base.copy(e.live);
|
|
1001
|
-
const
|
|
1002
|
-
u.crown.set(u.base.x + Math.sin(
|
|
1003
|
-
const
|
|
1001
|
+
const R = bt(e), G = I ? 0 : 0.05;
|
|
1002
|
+
u.crown.set(u.base.x + Math.sin(A * 0.6 + M * 20) * G * p * R, p * 0.62 * R, u.base.z + Math.cos(A * 0.5 + M * 13) * G * p * 0.6 * R), u.top.set(u.crown.x, p * R, u.crown.z);
|
|
1003
|
+
const V = (g - t.bornAt) / 1e3, D = !!t.parent, F = D ? De(V / 0.9) : 1, K = go((V - (D ? 0.7 : 0.05)) / 0.95), W = t.exitAt ? (g - t.exitAt) / 1e3 : -1, O = W >= 0 ? le(W / 2.3) : 0, q = lo(t, g), x = W < 0 && (t.status === "thinking" || t.status === "spawning"), z = co(t, g), U = I ? 0 : 1, $ = 0.5 + 0.5 * Math.sin(A * 2 + M * 9) * U, Fe = 0.5 + 0.5 * Math.sin(A * 0.9 + M * 5) * U;
|
|
1004
1004
|
let Be = !1;
|
|
1005
1005
|
for (const k of J.mcpPending.values()) k.instance === t.id && (Be = !0);
|
|
1006
1006
|
if (u.ringK += ((Be && W < 0 ? 1 : 0) - u.ringK) * 0.08, t.llmCalls > u.llm) {
|
|
1007
1007
|
const k = Math.max(0, t.tokens - u.tok), b = Math.round(Math.min(46, 7 + k / 160));
|
|
1008
|
-
u.c2.copy(m).lerp(ie, 0.35).multiplyScalar(1.4),
|
|
1008
|
+
u.c2.copy(m).lerp(ie, 0.35).multiplyScalar(1.4), Fo(u.top, b, u.c2, 0.3 + Math.min(0.55, k / 4500), C * 0.9 * R);
|
|
1009
1009
|
}
|
|
1010
|
-
if (u.llm = t.llmCalls, u.tok = t.tokens, W >= 0 && !u.shed && (u.shed = !0, u.c2.copy(m).multiplyScalar(0.6),
|
|
1010
|
+
if (u.llm = t.llmCalls, u.tok = t.tokens, W >= 0 && !u.shed && (u.shed = !0, u.c2.copy(m).multiplyScalar(0.6), Vo(u.crown, t.subagent ? 16 : 34, u.c2, C * 1.1 * R, t.subagent ? 0.2 : 0.27)), r.current && (r.current.position.copy(u.base), r.current.scale.setScalar(R)), s.current) {
|
|
1011
1011
|
const k = Math.max(1e-4, K * (1 - O * 0.2));
|
|
1012
|
-
s.current.scale.set(k, Math.max(1e-4, De((
|
|
1012
|
+
s.current.scale.set(k, Math.max(1e-4, De((V - (D ? 0.7 : 0.05)) / 0.8) * (1 - O * 0.12)), k), s.current.rotation.z = Math.sin(A * 0.6 + M * 20) * G * 0.5, s.current.rotation.x = Math.cos(A * 0.5 + M * 13) * G * 0.3;
|
|
1013
1013
|
}
|
|
1014
|
-
const Oe =
|
|
1015
|
-
u.c.copy(m).multiplyScalar(Oe + z * 0.45), W >= 0 && u.c.lerp(
|
|
1014
|
+
const Oe = x ? 0.7 + $ * 0.3 : 0.32 + Fe * 0.12;
|
|
1015
|
+
u.c.copy(m).multiplyScalar(Oe + z * 0.45), W >= 0 && u.c.lerp(ho, O).multiplyScalar(1 - O * 0.8), y.fill.color.copy(u.c).multiplyScalar(0.2), y.line.color.copy(u.c).multiplyScalar(1.15), i.current && (i.current.position.set(0, p * 0.55, 0), i.current.scale.setScalar(Math.max(1e-4, C * (x ? 3.4 + $ * 0.4 : 2.6) + z * 0.6)), y.halo.color.copy(m).multiplyScalar(((x ? 0.2 : 0.08) + z * 0.12) * (1 - O)));
|
|
1016
1016
|
const ke = J.selected === t.id;
|
|
1017
|
-
a.current && (a.current.scale.setScalar(Math.max(1e-4,
|
|
1017
|
+
a.current && (a.current.scale.setScalar(Math.max(1e-4, C * 4.2 * K)), y.pool.color.copy(m).multiplyScalar((0.12 + (x ? 0.08 : 0) + z * 0.08 + (ke ? 0.18 : 0)) * q)), l.current && (l.current.visible = u.ringK > 0.02, l.current.scale.setScalar(C * 0.95 * (1 + 0.04 * Math.sin(A * 3))), l.current.rotation.y = A * 0.4, y.ring.color.copy(tt).multiplyScalar(1.4 * u.ringK * (0.6 + Fe * 0.4))), v.current && (v.current.visible = ke, v.current.scale.setScalar(C * 1.3), y.sel.color.setScalar(0.5 + 0.2 * $)), (_e = f.current) == null || _e.setOpacity(uo(t.id) ? le(K) * (1 - O) * (t.subagent ? 0.85 : 0.95) : 0);
|
|
1018
1018
|
const ge = t.parent ? J.instances.get(t.parent) : void 0, ue = t.parent ? Gt(t.parent) : void 0;
|
|
1019
1019
|
ue ? (u.p0.set(ue.x, 0.06, ue.z), u.p0set = !0) : u.p0set || u.p0.set(u.base.x, 0.06, u.base.z), u.p2.set(u.base.x, 0.06, u.base.z), yt(u.p0, u.p2, (M - 0.5) * 0.5, 0.06, u.p1);
|
|
1020
1020
|
const Ce = !!ge && !ge.exitAt;
|
|
1021
|
-
u.parentK += ((
|
|
1021
|
+
u.parentK += ((D && !t.exitAt && Ce ? 1 : 0) - u.parentK) * (Ce ? 0.05 : 0.035);
|
|
1022
1022
|
const Q = y.root.uniforms;
|
|
1023
1023
|
Q.uP0.value.copy(u.p0), Q.uP1.value.copy(u.p1), Q.uP2.value.copy(u.p2);
|
|
1024
1024
|
const Ie = W >= 0 ? at(W / 1.6) : 0;
|
|
1025
|
-
if (Q.uGrow.value =
|
|
1026
|
-
const k =
|
|
1027
|
-
h.current.visible = k, k && (ft(h.current, u.p0, u.p1, u.p2, 0.78, 1, (t.subagent ? 0.42 : 0.55) * Math.min(1.3,
|
|
1025
|
+
if (Q.uGrow.value = D ? F * (1 - Ie) : 0, Q.uHead.value = F < 1 ? F : -1, Q.uTail.value = 0.12, Q.uHeadColor.value.copy(m).multiplyScalar(1.6), Q.uOpacity.value = (x ? 0.9 : 0.6) * Math.min(u.parentK, q > 0 ? 1 : 0) + (F < 1 ? 0.4 : 0), Q.uTime.value = I ? 0 : A, Q.uFlow.value = F >= 1 ? u.parentK : 0, h.current) {
|
|
1026
|
+
const k = D && F >= 1 && u.parentK > 0.05 && Q.uGrow.value > 0.9;
|
|
1027
|
+
h.current.visible = k, k && (ft(h.current, u.p0, u.p1, u.p2, 0.78, 1, (t.subagent ? 0.42 : 0.55) * Math.min(1.3, R)), y.arrow.color.copy(m).multiplyScalar(1.5 * u.parentK));
|
|
1028
1028
|
}
|
|
1029
1029
|
});
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
}, N = () => document.body.style.cursor = "pointer", j = () => document.body.style.cursor = "",
|
|
1030
|
+
const L = (d) => {
|
|
1031
|
+
d.stopPropagation(), o(t.id);
|
|
1032
|
+
}, N = () => document.body.style.cursor = "pointer", j = () => document.body.style.cursor = "", E = t.id.split(":")[2];
|
|
1033
1033
|
return /* @__PURE__ */ H(ce, { children: [
|
|
1034
1034
|
/* @__PURE__ */ c("mesh", { geometry: Dt, material: y.root, frustumCulled: !1 }),
|
|
1035
1035
|
/* @__PURE__ */ c("mesh", { ref: h, geometry: wt, material: y.arrow, visible: !1 }),
|
|
1036
1036
|
/* @__PURE__ */ H("group", { ref: r, children: [
|
|
1037
1037
|
/* @__PURE__ */ c("mesh", { ref: a, geometry: Le, material: y.pool, position: [0, 0.02, 0], scale: 1e-4 }),
|
|
1038
1038
|
/* @__PURE__ */ c("mesh", { ref: l, geometry: Ft, material: y.ring, position: [0, 0.06, 0], visible: !1 }),
|
|
1039
|
-
/* @__PURE__ */ c("mesh", { ref:
|
|
1039
|
+
/* @__PURE__ */ c("mesh", { ref: v, geometry: Ft, material: y.sel, position: [0, 0.05, 0], visible: !1 }),
|
|
1040
1040
|
/* @__PURE__ */ H("group", { ref: s, scale: 1e-4, children: [
|
|
1041
|
-
/* @__PURE__ */ c("mesh", { geometry:
|
|
1042
|
-
|
|
1043
|
-
/* @__PURE__ */ c("mesh", { geometry: Wt, material: y.fill, onClick:
|
|
1044
|
-
/* @__PURE__ */ c("lineSegments", { geometry:
|
|
1045
|
-
] },
|
|
1041
|
+
/* @__PURE__ */ c("mesh", { geometry: bn, material: y.trunk, scale: [t.subagent ? 0.7 : 1.2, p * 0.75, t.subagent ? 0.7 : 1.2], onClick: L, onPointerOver: N, onPointerOut: j }),
|
|
1042
|
+
T.map((d, g) => /* @__PURE__ */ H("group", { position: [0, d.y, 0], rotation: [0, d.rot, 0], scale: [d.r, d.h, d.r], children: [
|
|
1043
|
+
/* @__PURE__ */ c("mesh", { geometry: Wt, material: y.fill, onClick: L, onPointerOver: N, onPointerOut: j }),
|
|
1044
|
+
/* @__PURE__ */ c("lineSegments", { geometry: Mn, material: y.line })
|
|
1045
|
+
] }, g)),
|
|
1046
1046
|
/* @__PURE__ */ c("sprite", { ref: i, material: y.halo })
|
|
1047
1047
|
] }),
|
|
1048
1048
|
/* @__PURE__ */ c(
|
|
@@ -1051,7 +1051,7 @@ function An({ agent: e, onSelect: o }) {
|
|
|
1051
1051
|
ref: f,
|
|
1052
1052
|
fit: !0,
|
|
1053
1053
|
position: [0, p * 1.1 + (t.subagent ? 0.15 : 0.45), 0],
|
|
1054
|
-
text: `${t.name}${
|
|
1054
|
+
text: `${t.name}${E !== void 0 && !Number.isNaN(Number(E)) ? ` ${Number(E) + 1}` : ""}`,
|
|
1055
1055
|
color: _t[t.type],
|
|
1056
1056
|
size: t.subagent ? 0.24 : 0.3,
|
|
1057
1057
|
opacity: 0,
|
|
@@ -1061,7 +1061,7 @@ function An({ agent: e, onSelect: o }) {
|
|
|
1061
1061
|
] })
|
|
1062
1062
|
] });
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1064
|
+
function Cn({ comet: e }) {
|
|
1065
1065
|
const o = _(null), t = J.instances.get(e.from), r = S(() => (t ? gt[t.type] : te).clone().lerp(ie, 0.3), [t]), s = S(() => Ae(r.clone().multiplyScalar(1.6)), [r]), i = S(() => ({ a: new n.Vector3(), b: new n.Vector3(), c: new n.Vector3(), h: new n.Vector3(), tc: r.clone().multiplyScalar(0.9) }), [r]);
|
|
1066
1066
|
return Z(() => {
|
|
1067
1067
|
const a = pt(e.from, i.a), l = pt(e.to, i.b);
|
|
@@ -1071,37 +1071,37 @@ function xn({ comet: e }) {
|
|
|
1071
1071
|
return;
|
|
1072
1072
|
}
|
|
1073
1073
|
Ut(a, l, 2.6, i.c);
|
|
1074
|
-
const
|
|
1075
|
-
xe(a, i.c, l, at(
|
|
1074
|
+
const v = le((performance.now() - e.start) / e.dur);
|
|
1075
|
+
xe(a, i.c, l, at(v), i.h), o.current.visible = v < 1, o.current.position.copy(i.h), o.current.scale.setScalar(1.3), v < 1 && v > 0.02 && It(i.h, i.tc, 0.32, 0.6);
|
|
1076
1076
|
}), /* @__PURE__ */ c("sprite", { ref: o, material: s, visible: !1 });
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function Pn() {
|
|
1079
1079
|
const [e, o] = et([]), t = _({ n: -1, last: -1, first: -1 });
|
|
1080
1080
|
return Z(() => {
|
|
1081
1081
|
const r = J.comets, s = t.current, i = r.length ? r[0].id : -1, a = r.length ? r[r.length - 1].id : -1;
|
|
1082
|
-
(r.length !== s.n || i !== s.first || a !== s.last) && (s.n = r.length, s.first = i, s.last = a, o(
|
|
1083
|
-
}), /* @__PURE__ */ c(ce, { children: e.map((r) => /* @__PURE__ */ c(
|
|
1082
|
+
(r.length !== s.n || i !== s.first || a !== s.last) && (s.n = r.length, s.first = i, s.last = a, o(zn(r)));
|
|
1083
|
+
}), /* @__PURE__ */ c(ce, { children: e.map((r) => /* @__PURE__ */ c(Cn, { comet: r }, r.id)) });
|
|
1084
1084
|
}
|
|
1085
|
-
const
|
|
1086
|
-
function
|
|
1085
|
+
const Tn = 40;
|
|
1086
|
+
function zn(e) {
|
|
1087
1087
|
const o = [];
|
|
1088
|
-
for (let t = e.length - 1; t >= 0 && o.length <
|
|
1088
|
+
for (let t = e.length - 1; t >= 0 && o.length < Tn; t--) {
|
|
1089
1089
|
const r = e[t];
|
|
1090
|
-
(!
|
|
1090
|
+
(!fo.grouped || Ct(r.from) && Ct(r.to)) && o.push(r);
|
|
1091
1091
|
}
|
|
1092
1092
|
return o.reverse();
|
|
1093
1093
|
}
|
|
1094
1094
|
const Je = new n.Vector3();
|
|
1095
|
-
function
|
|
1095
|
+
function Rn(e) {
|
|
1096
1096
|
for (const o of me.agents.values()) {
|
|
1097
1097
|
const t = bt(o);
|
|
1098
1098
|
Je.copy(o.target), Je.y = Mt(o.inst) * 1.12 * t + 0.45, e(Je, 0.9);
|
|
1099
1099
|
}
|
|
1100
1100
|
for (const o of me.runs.values()) e(Ot(o, Je), 1.6);
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function Un() {
|
|
1103
1103
|
return /* @__PURE__ */ H(
|
|
1104
|
-
|
|
1104
|
+
po,
|
|
1105
1105
|
{
|
|
1106
1106
|
title: "forest · night grove",
|
|
1107
1107
|
subtitle: "Agents grow as glowing trees (saplings = subagents, roots point parent → child) · fireflies = LLM calls sized by tokens · mushrooms = MCP servers & backends on the mycelium · the pond is graph memory · exits shed their leaves",
|
|
@@ -1113,31 +1113,31 @@ function En() {
|
|
|
1113
1113
|
bg: he.bg,
|
|
1114
1114
|
fit: { nRef: 4, min: 0.62, max: 1.5, minRadius: 4.5 },
|
|
1115
1115
|
agentRadius: 1.1,
|
|
1116
|
-
graph: { natural:
|
|
1116
|
+
graph: { natural: en, radius: 3 },
|
|
1117
1117
|
peripheryGap: 4,
|
|
1118
|
-
Background: /* @__PURE__ */ c(
|
|
1119
|
-
Agent:
|
|
1120
|
-
RunMarker:
|
|
1121
|
-
McpServer:
|
|
1122
|
-
Backend:
|
|
1123
|
-
GraphResource:
|
|
1118
|
+
Background: /* @__PURE__ */ c(yn, {}),
|
|
1119
|
+
Agent: xn,
|
|
1120
|
+
RunMarker: zo,
|
|
1121
|
+
McpServer: Ho,
|
|
1122
|
+
Backend: Ko,
|
|
1123
|
+
GraphResource: cn,
|
|
1124
1124
|
cluster: { radius: 1.35, variant: "swarm", color: "#b6f36a", pointSize: 0.85 },
|
|
1125
1125
|
clusterOffset: [0, 3.2, 0],
|
|
1126
|
-
extents:
|
|
1126
|
+
extents: Rn,
|
|
1127
1127
|
PostFX: /* @__PURE__ */ H(Kt, { multisampling: 0, children: [
|
|
1128
1128
|
/* @__PURE__ */ c(Ht, { mipmapBlur: !0, intensity: 1, luminanceThreshold: 0.22, luminanceSmoothing: 0.3, radius: 0.72 }),
|
|
1129
1129
|
/* @__PURE__ */ c($t, { eskil: !1, offset: 0.24, darkness: 0.85 })
|
|
1130
1130
|
] }),
|
|
1131
1131
|
children: [
|
|
1132
|
-
/* @__PURE__ */ c(
|
|
1133
|
-
/* @__PURE__ */ c(
|
|
1134
|
-
/* @__PURE__ */ c(
|
|
1135
|
-
/* @__PURE__ */ c(
|
|
1136
|
-
/* @__PURE__ */ c(
|
|
1132
|
+
/* @__PURE__ */ c(Qo, {}),
|
|
1133
|
+
/* @__PURE__ */ c(Pn, {}),
|
|
1134
|
+
/* @__PURE__ */ c(ko, { count: I ? 70 : 170 }),
|
|
1135
|
+
/* @__PURE__ */ c(Go, {}),
|
|
1136
|
+
/* @__PURE__ */ c(Uo, {})
|
|
1137
1137
|
]
|
|
1138
1138
|
}
|
|
1139
1139
|
);
|
|
1140
1140
|
}
|
|
1141
1141
|
export {
|
|
1142
|
-
|
|
1142
|
+
Un as default
|
|
1143
1143
|
};
|