agentglow 0.2.11 → 0.2.12
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/README.md +3 -16
- package/cli/agentglow.mjs +22 -3
- package/cli/lib/server.mjs +44 -13
- package/cli/lib/settings.mjs +3 -3
- package/dist/chunks/KitScene-Cug87OSc.js +3121 -0
- package/dist/chunks/index-B0urBeRS.js +48 -0
- package/dist/chunks/{index-u4rYZ1UO.js → index-BM4W1tNM.js} +135 -135
- package/dist/chunks/{index-B4Cqo621.js → index-BTFr1mn1.js} +155 -155
- package/dist/chunks/index-Cj5cs1rS.js +948 -0
- package/dist/chunks/{index-CTZbUTDY.js → index-iZBODPwI.js} +136 -136
- package/dist/chunks/{index-URn4zDHp.js → index-ueGnGU_X.js} +297 -297
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/themes.d.ts +1 -1
- package/dist/types/world.d.ts +42 -2
- package/package.json +1 -1
- package/dist/chunks/KitScene-DG_pcnWW.js +0 -3119
- package/dist/chunks/index-Agh7jdYu.js +0 -1086
- package/dist/chunks/index-B2EHxcBQ.js +0 -1010
- package/dist/chunks/index-BfQsJ0TH.js +0 -751
- package/dist/chunks/index-BmBGYhJS.js +0 -891
- package/dist/chunks/index-Bnn-x-aE.js +0 -767
- package/dist/chunks/index-CTQTtm9q.js +0 -784
- package/dist/chunks/index-CdKvybsL.js +0 -1143
- package/dist/chunks/index-CeiIEWek.js +0 -818
- package/dist/chunks/index-Ci8tSMhc.js +0 -68
- package/dist/chunks/index-Cls_VZdb.js +0 -980
- package/dist/chunks/index-DFFRhihO.js +0 -892
- package/dist/chunks/index-DMCETM4H.js +0 -605
|
@@ -1,1143 +0,0 @@
|
|
|
1
|
-
var Xt = Object.defineProperty;
|
|
2
|
-
var jt = (e, o, t) => o in e ? Xt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
-
var ae = (e, o, t) => jt(e, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
-
import { jsxs as H, Fragment as ce, jsx as c } from "react/jsx-runtime";
|
|
5
|
-
import { EffectComposer as Kt, Bloom as Ht, Vignette as $t } from "@react-three/postprocessing";
|
|
6
|
-
import * as n from "three";
|
|
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
|
-
import { useFrame as Z, useThree as rt } from "@react-three/fiber";
|
|
9
|
-
import { useMemo as S, useRef as _, useState as et } from "react";
|
|
10
|
-
import { Stars as mo } from "@react-three/drei";
|
|
11
|
-
var Bt;
|
|
12
|
-
const I = typeof window < "u" && !!((Bt = window.matchMedia) != null && Bt.call(window, "(prefers-reduced-motion: reduce)").matches), he = {
|
|
13
|
-
bg: "#02080b",
|
|
14
|
-
fog: "#071c20",
|
|
15
|
-
ground: "#041214",
|
|
16
|
-
moon: "#dff7ef",
|
|
17
|
-
teal: "#5eead4",
|
|
18
|
-
mint: "#86efac",
|
|
19
|
-
amber: "#fbbf24",
|
|
20
|
-
red: "#ff3d4a"
|
|
21
|
-
}, te = new n.Color(he.teal);
|
|
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), 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
|
-
e = le(e);
|
|
25
|
-
const o = 1.9;
|
|
26
|
-
return 1 + (o + 1) * Math.pow(e - 1, 3) + o * Math.pow(e - 1, 2);
|
|
27
|
-
};
|
|
28
|
-
let Xe = null;
|
|
29
|
-
function vt() {
|
|
30
|
-
if (Xe) return Xe;
|
|
31
|
-
const e = document.createElement("canvas");
|
|
32
|
-
e.width = e.height = 128;
|
|
33
|
-
const o = e.getContext("2d"), t = o.createRadialGradient(64, 64, 0, 64, 64, 64);
|
|
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
|
-
}
|
|
36
|
-
let je = null;
|
|
37
|
-
function vo() {
|
|
38
|
-
if (je) return je;
|
|
39
|
-
const e = document.createElement("canvas");
|
|
40
|
-
e.width = 256, e.height = 128;
|
|
41
|
-
const o = e.getContext("2d");
|
|
42
|
-
let t = 7;
|
|
43
|
-
const r = () => (t = t * 16807 % 2147483647) / 2147483647;
|
|
44
|
-
for (let s = 0; s < 14; s++) {
|
|
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
|
-
}
|
|
48
|
-
return je = new n.CanvasTexture(e), je;
|
|
49
|
-
}
|
|
50
|
-
function Ae(e = "#fff") {
|
|
51
|
-
return new n.SpriteMaterial({ map: vt(), color: e, blending: n.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1, fog: !1 });
|
|
52
|
-
}
|
|
53
|
-
function de(e = "#fff", o = n.FrontSide) {
|
|
54
|
-
return new n.MeshBasicMaterial({ color: e, blending: n.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1, side: o, fog: !1 });
|
|
55
|
-
}
|
|
56
|
-
function wo(e = "#fff") {
|
|
57
|
-
return new n.LineBasicMaterial({ color: e, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, toneMapped: !1, fog: !1 });
|
|
58
|
-
}
|
|
59
|
-
function Ue(e = "#fff") {
|
|
60
|
-
return new n.MeshBasicMaterial({ map: vt(), color: e, blending: n.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1, fog: !1 });
|
|
61
|
-
}
|
|
62
|
-
new n.SphereGeometry(1, 24, 16);
|
|
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 yo(e = 48, o = 6) {
|
|
65
|
-
const t = [], r = [];
|
|
66
|
-
for (let i = 0; i <= e; i++) {
|
|
67
|
-
const a = i / e;
|
|
68
|
-
for (let l = 0; l < o; l++) {
|
|
69
|
-
const v = l / o * Math.PI * 2;
|
|
70
|
-
t.push(a, Math.cos(v), Math.sin(v));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
for (let i = 0; i < e; i++)
|
|
74
|
-
for (let a = 0; a < o; a++) {
|
|
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
|
-
}
|
|
78
|
-
const s = new n.BufferGeometry();
|
|
79
|
-
return s.setAttribute("position", new n.Float32BufferAttribute(t, 3)), s.setIndex(r), s.boundingSphere = new n.Sphere(new n.Vector3(), 1e4), s;
|
|
80
|
-
}
|
|
81
|
-
const Dt = yo(), Mo = (
|
|
82
|
-
/* glsl */
|
|
83
|
-
`
|
|
84
|
-
uniform vec3 uP0; uniform vec3 uP1; uniform vec3 uP2; uniform float uRadius; uniform float uTaper;
|
|
85
|
-
varying float vT; varying float vRim;
|
|
86
|
-
void main(){
|
|
87
|
-
float t = position.x; float a = 1.0 - t;
|
|
88
|
-
vec3 p = a*a*uP0 + 2.0*a*t*uP1 + t*t*uP2;
|
|
89
|
-
vec3 tg = 2.0*a*(uP1-uP0) + 2.0*t*(uP2-uP1);
|
|
90
|
-
tg = length(tg) > 1e-5 ? normalize(tg) : vec3(1.0,0.0,0.0);
|
|
91
|
-
vec3 up = abs(tg.y) > 0.92 ? vec3(1.0,0.0,0.0) : vec3(0.0,1.0,0.0);
|
|
92
|
-
vec3 n = normalize(cross(tg, up)); vec3 b = cross(tg, n);
|
|
93
|
-
vec3 off = n*position.y + b*position.z;
|
|
94
|
-
vec4 mv = modelViewMatrix * vec4(p + off * uRadius * mix(1.0, uTaper, t), 1.0);
|
|
95
|
-
vRim = abs(dot(normalize(normalMatrix * off), normalize(-mv.xyz)));
|
|
96
|
-
vT = t;
|
|
97
|
-
gl_Position = projectionMatrix * mv;
|
|
98
|
-
}`
|
|
99
|
-
), bo = (
|
|
100
|
-
/* glsl */
|
|
101
|
-
`
|
|
102
|
-
uniform vec3 uColor; uniform float uOpacity; uniform float uGrow; uniform float uTime; uniform float uFlow; uniform float uFlowDir;
|
|
103
|
-
uniform float uHead; uniform float uTail; uniform vec3 uHeadColor;
|
|
104
|
-
varying float vT; varying float vRim;
|
|
105
|
-
void main(){
|
|
106
|
-
if (vT > uGrow) discard;
|
|
107
|
-
float core = 0.3 + 0.7 * vRim * vRim;
|
|
108
|
-
float tip = smoothstep(uGrow - 0.08, uGrow, vT) * step(uGrow, 0.995);
|
|
109
|
-
float head = 0.0;
|
|
110
|
-
if (uHead >= 0.0) { float d = vT - uHead; head = d > 0.0 ? exp(-d * d / 0.0008) : exp(d / max(uTail, 0.001)); }
|
|
111
|
-
// directional flow: soft beads travelling start (t=0) → end (t=1) (or reversed with uFlowDir = -1)
|
|
112
|
-
float flow = uFlow * pow(max(0.0, sin((vT * 9.0 - uTime * 0.9 * uFlowDir) * 3.14159)), 6.0);
|
|
113
|
-
vec3 col = uColor * uOpacity * (core + tip * 3.0 + flow * 2.4) + uHeadColor * head * (0.6 + vRim);
|
|
114
|
-
gl_FragColor = vec4(col, 1.0);
|
|
115
|
-
}`
|
|
116
|
-
);
|
|
117
|
-
function Et(e = "#fff", o = 0.06, t = 0.4) {
|
|
118
|
-
return new n.ShaderMaterial({
|
|
119
|
-
uniforms: {
|
|
120
|
-
uP0: { value: new n.Vector3() },
|
|
121
|
-
uP1: { value: new n.Vector3() },
|
|
122
|
-
uP2: { value: new n.Vector3() },
|
|
123
|
-
uRadius: { value: o },
|
|
124
|
-
uTaper: { value: t },
|
|
125
|
-
uColor: { value: new n.Color(e) },
|
|
126
|
-
uOpacity: { value: 1 },
|
|
127
|
-
uGrow: { value: 1 },
|
|
128
|
-
uTime: { value: 0 },
|
|
129
|
-
uFlow: { value: 0 },
|
|
130
|
-
uFlowDir: { value: 1 },
|
|
131
|
-
uHead: { value: -1 },
|
|
132
|
-
uTail: { value: 0.12 },
|
|
133
|
-
uHeadColor: { value: new n.Color(4, 4, 4) }
|
|
134
|
-
},
|
|
135
|
-
vertexShader: Mo,
|
|
136
|
-
fragmentShader: bo,
|
|
137
|
-
transparent: !0,
|
|
138
|
-
depthWrite: !1,
|
|
139
|
-
blending: n.AdditiveBlending
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
function xe(e, o, t, r, s) {
|
|
143
|
-
const i = 1 - r;
|
|
144
|
-
return s.set(i * i * e.x + 2 * i * r * o.x + r * r * t.x, i * i * e.y + 2 * i * r * o.y + r * r * t.y, i * i * e.z + 2 * i * r * o.z + r * r * t.z);
|
|
145
|
-
}
|
|
146
|
-
function yt(e, o, t, r, s) {
|
|
147
|
-
s.copy(e).add(o).multiplyScalar(0.5);
|
|
148
|
-
const i = o.x - e.x, a = o.z - e.z, l = Math.hypot(i, a) || 1;
|
|
149
|
-
return s.x += -a / l * t * l, s.z += i / l * t * l, s.y = r, s;
|
|
150
|
-
}
|
|
151
|
-
function Ut(e, o, t, r) {
|
|
152
|
-
return r.copy(e).add(o).multiplyScalar(0.5), r.y = Math.max(e.y, o.y) + t, r;
|
|
153
|
-
}
|
|
154
|
-
function Pt(e, o, t) {
|
|
155
|
-
return e.r += o.r * t, e.g += o.g * t, e.b += o.b * t, e;
|
|
156
|
-
}
|
|
157
|
-
const nt = class nt {
|
|
158
|
-
constructor(o) {
|
|
159
|
-
ae(this, "mesh");
|
|
160
|
-
ae(this, "colors");
|
|
161
|
-
ae(this, "n", 0);
|
|
162
|
-
ae(this, "max");
|
|
163
|
-
ae(this, "o", new n.Object3D());
|
|
164
|
-
ae(this, "a", new n.Vector3());
|
|
165
|
-
ae(this, "b", new n.Vector3());
|
|
166
|
-
ae(this, "d", new n.Vector3());
|
|
167
|
-
this.max = o, this.colors = new Float32Array(o * 3), this.mesh = new n.InstancedMesh(wt, new n.MeshBasicMaterial({ blending: n.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1, fog: !1 }), o), this.mesh.instanceColor = new n.InstancedBufferAttribute(this.colors, 3), this.mesh.frustumCulled = !1, this.mesh.count = 0;
|
|
168
|
-
}
|
|
169
|
-
begin() {
|
|
170
|
-
this.n = 0;
|
|
171
|
-
}
|
|
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
|
-
}
|
|
175
|
-
end() {
|
|
176
|
-
this.mesh.count = this.n, this.mesh.instanceMatrix.needsUpdate = !0, this.mesh.instanceColor && (this.mesh.instanceColor.needsUpdate = !0);
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
ae(nt, "UP", new n.Vector3(0, 1, 0));
|
|
180
|
-
let ot = nt;
|
|
181
|
-
const ct = new n.Vector3(), Ke = new n.Vector3(), So = new n.Vector3(0, 1, 0);
|
|
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(So, Ke.normalize()), e.scale.set(a * 0.42, a, a * 0.42);
|
|
184
|
-
}
|
|
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
|
-
function pt(e, o) {
|
|
187
|
-
const t = me.agents.get(e);
|
|
188
|
-
if (t)
|
|
189
|
-
return o.set(t.live.x, t.live.y + Mt(t.inst) * 0.62 * bt(t), t.live.z);
|
|
190
|
-
}
|
|
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
|
-
function Lt(e, o) {
|
|
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
|
-
}
|
|
195
|
-
const mt = (e) => e.target.z < -0.5 ? -1 : 1;
|
|
196
|
-
function Ot(e, o, t = mt(e)) {
|
|
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
|
-
}
|
|
199
|
-
const ut = { w: 0, d: 0 };
|
|
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
|
-
const j = mt(e);
|
|
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
|
-
var V;
|
|
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
|
-
});
|
|
215
|
-
}), /* @__PURE__ */ H(ce, { children: [
|
|
216
|
-
/* @__PURE__ */ c("mesh", { ref: s, geometry: Le, material: t }),
|
|
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
|
-
] });
|
|
223
|
-
}
|
|
224
|
-
function Ro({ run: e, anchorY: o }) {
|
|
225
|
-
eo();
|
|
226
|
-
const t = e.status !== "started";
|
|
227
|
-
return /* @__PURE__ */ c(
|
|
228
|
-
Ee,
|
|
229
|
-
{
|
|
230
|
-
text: e.topic,
|
|
231
|
-
secondary: to(e, { base: "#94a3b8", current: "#fde68a", done: "#cbd5e1" }, ["growing…", "grove at rest"]),
|
|
232
|
-
color: e.color,
|
|
233
|
-
size: 0.36,
|
|
234
|
-
maxWidth: 10,
|
|
235
|
-
opacity: t ? 0.5 : 1,
|
|
236
|
-
fadeMs: 400,
|
|
237
|
-
anchorY: o,
|
|
238
|
-
pxRange: [10, 15]
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
const oe = 1400, w = {
|
|
243
|
-
pos: new Float32Array(oe * 3),
|
|
244
|
-
vel: new Float32Array(oe * 3),
|
|
245
|
-
col: new Float32Array(oe * 3),
|
|
246
|
-
size: new Float32Array(oe),
|
|
247
|
-
life: new Float32Array(oe),
|
|
248
|
-
// seconds left (≤0 = dead)
|
|
249
|
-
max: new Float32Array(oe),
|
|
250
|
-
seed: new Float32Array(oe),
|
|
251
|
-
kind: new Uint8Array(oe),
|
|
252
|
-
// 0 = firefly (wanders), 1 = trail (still, quick fade)
|
|
253
|
-
next: 0
|
|
254
|
-
};
|
|
255
|
-
function kt() {
|
|
256
|
-
for (let o = 0; o < 24; o++) {
|
|
257
|
-
const t = (w.next + o) % oe;
|
|
258
|
-
if (w.life[t] <= 0)
|
|
259
|
-
return w.next = (t + 1) % oe, t;
|
|
260
|
-
}
|
|
261
|
-
const e = w.next;
|
|
262
|
-
return w.next = (w.next + 1) % oe, e;
|
|
263
|
-
}
|
|
264
|
-
function Fo(e, o, t, r, s) {
|
|
265
|
-
I && (o = Math.ceil(o * 0.4));
|
|
266
|
-
for (let i = 0; i < o; i++) {
|
|
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
|
-
const h = 0.9 + Math.random() * 1.6;
|
|
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
|
-
const f = Math.random() * 0.35;
|
|
272
|
-
w.col[a * 3] = t.r * (1 - f) + f * 1, w.col[a * 3 + 1] = t.g * (1 - f) + f * 1, w.col[a * 3 + 2] = t.b * (1 - f) + f * 0.6, w.size[a] = r * (0.6 + Math.random() * 0.8), w.max[a] = w.life[a] = 1.8 + Math.random() * 2.2, w.seed[a] = Math.random() * 100, w.kind[a] = 0;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
function It(e, o, t, r = 0.55) {
|
|
276
|
-
const s = kt();
|
|
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
|
-
}
|
|
279
|
-
const Bo = (
|
|
280
|
-
/* glsl */
|
|
281
|
-
`
|
|
282
|
-
attribute float aSize; attribute vec3 aColor; attribute float aAlpha; attribute float aSeed;
|
|
283
|
-
uniform float uScale; uniform float uTime; varying vec3 vC;
|
|
284
|
-
void main(){
|
|
285
|
-
vec4 mv = modelViewMatrix * vec4(position, 1.0);
|
|
286
|
-
float flick = 0.65 + 0.35 * sin(uTime * (5.0 + fract(aSeed) * 6.0) + aSeed * 7.0);
|
|
287
|
-
vC = aColor * aAlpha * flick;
|
|
288
|
-
gl_PointSize = aSize * uScale / -mv.z;
|
|
289
|
-
gl_Position = projectionMatrix * mv;
|
|
290
|
-
}`
|
|
291
|
-
), _o = (
|
|
292
|
-
/* glsl */
|
|
293
|
-
`
|
|
294
|
-
varying vec3 vC;
|
|
295
|
-
void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
|
|
296
|
-
float core = smoothstep(0.35, 0.0, r); float halo = pow(1.0 - r, 2.6);
|
|
297
|
-
gl_FragColor = vec4(vC * (core * 1.6 + halo * 0.55), 1.0); }`
|
|
298
|
-
);
|
|
299
|
-
function St(e, o, t) {
|
|
300
|
-
return e.height * o.getPixelRatio() / (2 * Math.tan((t.fov ?? 50) * Math.PI / 360));
|
|
301
|
-
}
|
|
302
|
-
function Go() {
|
|
303
|
-
const { size: e, gl: o, camera: t } = rt(), { geo: r, mat: s } = S(() => {
|
|
304
|
-
const i = new n.BufferGeometry();
|
|
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: Bo, fragmentShader: _o, transparent: !0, depthWrite: !1, blending: n.AdditiveBlending });
|
|
307
|
-
return { geo: i, mat: a };
|
|
308
|
-
}, []);
|
|
309
|
-
return Z(({ clock: i }, a) => {
|
|
310
|
-
a = Math.min(a, 0.05);
|
|
311
|
-
const l = i.elapsedTime;
|
|
312
|
-
s.uniforms.uScale.value = St(e, o, t), s.uniforms.uTime.value = I ? 0 : l;
|
|
313
|
-
const v = r.getAttribute("aAlpha"), h = v.array, f = Math.exp(-a * 1.6);
|
|
314
|
-
for (let m = 0; m < oe; m++) {
|
|
315
|
-
if (w.life[m] <= 0) {
|
|
316
|
-
h[m] = 0;
|
|
317
|
-
continue;
|
|
318
|
-
}
|
|
319
|
-
w.life[m] -= a;
|
|
320
|
-
const p = 1 - w.life[m] / w.max[m];
|
|
321
|
-
if (w.kind[m] === 0) {
|
|
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
|
-
} else h[m] = (1 - p) * (1 - p);
|
|
325
|
-
}
|
|
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
|
-
}), /* @__PURE__ */ c("points", { geometry: r, material: s, frustumCulled: !1 });
|
|
328
|
-
}
|
|
329
|
-
const se = 700, P = {
|
|
330
|
-
pos: new Float32Array(se * 3),
|
|
331
|
-
vel: new Float32Array(se * 3),
|
|
332
|
-
col: new Float32Array(se * 3),
|
|
333
|
-
size: new Float32Array(se),
|
|
334
|
-
life: new Float32Array(se),
|
|
335
|
-
max: new Float32Array(se),
|
|
336
|
-
seed: new Float32Array(se),
|
|
337
|
-
next: 0
|
|
338
|
-
};
|
|
339
|
-
function Vo(e, o, t, r, s) {
|
|
340
|
-
I && (o = Math.ceil(o * 0.5));
|
|
341
|
-
for (let i = 0; i < o; i++) {
|
|
342
|
-
const a = P.next;
|
|
343
|
-
P.next = (P.next + 1) % se;
|
|
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
|
-
const h = 0.55 + Math.random() * 0.45;
|
|
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
|
-
}
|
|
349
|
-
}
|
|
350
|
-
const Do = (
|
|
351
|
-
/* glsl */
|
|
352
|
-
`
|
|
353
|
-
attribute float aSize; attribute vec3 aColor; attribute float aAlpha; attribute float aSeed;
|
|
354
|
-
uniform float uScale; uniform float uTime; varying vec3 vC; varying float vRot;
|
|
355
|
-
void main(){
|
|
356
|
-
vec4 mv = modelViewMatrix * vec4(position, 1.0);
|
|
357
|
-
vC = aColor * aAlpha;
|
|
358
|
-
vRot = aSeed * 3.0 + uTime * (1.2 + fract(aSeed) * 2.0);
|
|
359
|
-
gl_PointSize = aSize * uScale / -mv.z;
|
|
360
|
-
gl_Position = projectionMatrix * mv;
|
|
361
|
-
}`
|
|
362
|
-
), Eo = (
|
|
363
|
-
/* glsl */
|
|
364
|
-
`
|
|
365
|
-
varying vec3 vC; varying float vRot;
|
|
366
|
-
void main(){
|
|
367
|
-
vec2 p = gl_PointCoord - 0.5;
|
|
368
|
-
float c = cos(vRot), s = sin(vRot);
|
|
369
|
-
p = vec2(c * p.x - s * p.y, s * p.x + c * p.y);
|
|
370
|
-
// almond leaf with a slightly flipped (tumbling) width
|
|
371
|
-
float w = 0.18 + 0.1 * abs(sin(vRot * 0.7));
|
|
372
|
-
float d = (p.x * p.x) / (w * w) + (p.y * p.y) / 0.2;
|
|
373
|
-
if (d > 1.0) discard;
|
|
374
|
-
float vein = 1.0 - smoothstep(0.0, 0.03, abs(p.x));
|
|
375
|
-
gl_FragColor = vec4(vC * (0.8 + vein * 0.6) * (1.0 - d * 0.5), 1.0);
|
|
376
|
-
}`
|
|
377
|
-
);
|
|
378
|
-
function Uo() {
|
|
379
|
-
const { size: e, gl: o, camera: t } = rt(), { geo: r, mat: s } = S(() => {
|
|
380
|
-
const i = new n.BufferGeometry();
|
|
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: Do, fragmentShader: Eo, transparent: !0, depthWrite: !1, blending: n.AdditiveBlending });
|
|
383
|
-
return { geo: i, mat: a };
|
|
384
|
-
}, []);
|
|
385
|
-
return Z(({ clock: i }, a) => {
|
|
386
|
-
a = Math.min(a, 0.05);
|
|
387
|
-
const l = i.elapsedTime;
|
|
388
|
-
s.uniforms.uScale.value = St(e, o, t), s.uniforms.uTime.value = I ? 0 : l;
|
|
389
|
-
const v = r.getAttribute("aAlpha"), h = v.array;
|
|
390
|
-
for (let f = 0; f < se; f++) {
|
|
391
|
-
if (P.life[f] <= 0) {
|
|
392
|
-
h[f] = 0;
|
|
393
|
-
continue;
|
|
394
|
-
}
|
|
395
|
-
P.life[f] -= a;
|
|
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
|
-
}
|
|
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
|
-
}), /* @__PURE__ */ c("points", { geometry: r, material: s, frustumCulled: !1 });
|
|
401
|
-
}
|
|
402
|
-
const Lo = (
|
|
403
|
-
/* glsl */
|
|
404
|
-
`
|
|
405
|
-
attribute float aSeed; uniform float uScale; uniform float uTime; varying float vA;
|
|
406
|
-
void main(){
|
|
407
|
-
float s = aSeed;
|
|
408
|
-
vec3 p = position + vec3(sin(uTime * 0.21 + s) * 1.6, sin(uTime * 0.33 + s * 2.1) * 0.5, cos(uTime * 0.17 + s * 1.3) * 1.6);
|
|
409
|
-
vec4 mv = modelViewMatrix * vec4(p, 1.0);
|
|
410
|
-
float blink = pow(max(0.0, sin(uTime * (0.5 + fract(s) * 0.7) + s * 9.0)), 6.0);
|
|
411
|
-
vA = 0.08 + blink * 0.9;
|
|
412
|
-
gl_PointSize = (0.22 + blink * 0.18) * uScale / -mv.z;
|
|
413
|
-
gl_Position = projectionMatrix * mv;
|
|
414
|
-
}`
|
|
415
|
-
), Oo = (
|
|
416
|
-
/* glsl */
|
|
417
|
-
`
|
|
418
|
-
uniform vec3 uColor; varying float vA;
|
|
419
|
-
void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
|
|
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
|
-
);
|
|
422
|
-
function ko({ count: e = 170 }) {
|
|
423
|
-
const { size: o, gl: t, camera: r } = rt(), { geo: s, mat: i } = S(() => {
|
|
424
|
-
const a = new Float32Array(e * 3), l = new Float32Array(e);
|
|
425
|
-
let v = 11;
|
|
426
|
-
const h = () => (v = v * 16807 % 2147483647) / 2147483647;
|
|
427
|
-
for (let p = 0; p < e; p++) {
|
|
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
|
-
}
|
|
431
|
-
const f = new n.BufferGeometry();
|
|
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
|
-
const m = new n.ShaderMaterial({
|
|
434
|
-
uniforms: { uScale: { value: 400 }, uTime: { value: 0 }, uColor: { value: new n.Color("#c8ff9e") } },
|
|
435
|
-
vertexShader: Lo,
|
|
436
|
-
fragmentShader: Oo,
|
|
437
|
-
transparent: !0,
|
|
438
|
-
depthWrite: !1,
|
|
439
|
-
blending: n.AdditiveBlending
|
|
440
|
-
});
|
|
441
|
-
return { geo: f, mat: m };
|
|
442
|
-
}, [e]);
|
|
443
|
-
return Z(({ clock: a }) => {
|
|
444
|
-
i.uniforms.uScale.value = St(o, t, r), i.uniforms.uTime.value = I ? 20 : a.elapsedTime;
|
|
445
|
-
}), /* @__PURE__ */ c("points", { geometry: s, material: i, frustumCulled: !1 });
|
|
446
|
-
}
|
|
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
|
-
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: 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
|
-
}
|
|
451
|
-
function Xo(e) {
|
|
452
|
-
const o = [];
|
|
453
|
-
switch (e) {
|
|
454
|
-
case "db":
|
|
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
|
-
break;
|
|
457
|
-
case "warehouse":
|
|
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: 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
|
-
break;
|
|
461
|
-
case "spark":
|
|
462
|
-
for (let t = 0; t < 6; t++) {
|
|
463
|
-
const r = t / 6 * Math.PI * 2;
|
|
464
|
-
be(Math.cos(r) * 0.45, Math.sin(r) * 0.45, 0.35 + t % 3 * 0.18, 0.2 + t % 2 * 0.06, o);
|
|
465
|
-
}
|
|
466
|
-
be(0, 0, 0.75, 0.32, o);
|
|
467
|
-
break;
|
|
468
|
-
case "api":
|
|
469
|
-
for (let t = 0; t < 7; t++) {
|
|
470
|
-
const r = t / 7 * Math.PI * 2;
|
|
471
|
-
be(Math.cos(r) * 0.7, Math.sin(r) * 0.7, 0.3 + t % 2 * 0.12, 0.17, o);
|
|
472
|
-
}
|
|
473
|
-
break;
|
|
474
|
-
case "storage":
|
|
475
|
-
o.push({ geo: Tt, cap: !0, pos: [0, 0.42, 0], scale: [0.5, 0.42, 0.5] }), o.push({ geo: Tt, cap: !0, pos: [0.55, 0.24, 0.2], scale: [0.28, 0.24, 0.28] });
|
|
476
|
-
break;
|
|
477
|
-
case "queue":
|
|
478
|
-
for (let t = 0; t < 3; t++) be((t - 1) * 0.55, 0, 0.35 + t * 0.2, 0.22 + t * 0.05, o);
|
|
479
|
-
break;
|
|
480
|
-
}
|
|
481
|
-
return o;
|
|
482
|
-
}
|
|
483
|
-
const jo = (() => {
|
|
484
|
-
const e = [];
|
|
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
|
-
})();
|
|
487
|
-
function Nt({ parts: e, cap: o, stem: t }) {
|
|
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
|
-
}
|
|
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
|
-
() => ({ edge: Et(a, 0.04, 1), arrow: de(a), cap: de(a), stem: de(a), halo: Ae(a), pool: Ue(a) }),
|
|
493
|
-
[a]
|
|
494
|
-
), v = _(null), h = _(null), f = _(null), m = _(null), p = _(null), C = _("");
|
|
495
|
-
return Z(({ clock: T }) => {
|
|
496
|
-
var G, V;
|
|
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), (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
|
-
if (u) {
|
|
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
|
-
}), /* @__PURE__ */ H(ce, { children: [
|
|
514
|
-
/* @__PURE__ */ c("mesh", { geometry: Dt, material: l.edge, frustumCulled: !1 }),
|
|
515
|
-
/* @__PURE__ */ c("mesh", { ref: m, geometry: wt, material: l.arrow, visible: !1 }),
|
|
516
|
-
/* @__PURE__ */ H("group", { ref: v, children: [
|
|
517
|
-
/* @__PURE__ */ c("mesh", { geometry: Le, material: l.pool, position: [0, 0.02, 0], scale: 3.2 }),
|
|
518
|
-
/* @__PURE__ */ c("sprite", { ref: f, material: l.halo, position: [0, 0.8, 0] }),
|
|
519
|
-
/* @__PURE__ */ c("group", { ref: h, children: /* @__PURE__ */ c(Nt, { parts: i, cap: l.cap, stem: l.stem }) }),
|
|
520
|
-
/* @__PURE__ */ c(Ee, { ref: p, position: [0, -0.35, 0], offset: [0, -0.32], text: r.name, color: t.color, size: 0.22, opacity: 0.55, pxRange: [7.5, 11.5] })
|
|
521
|
-
] })
|
|
522
|
-
] });
|
|
523
|
-
}
|
|
524
|
-
function Ho({ mcp: e }) {
|
|
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
|
-
return Z(({ clock: l }) => {
|
|
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
|
-
}), /* @__PURE__ */ H("group", { ref: a, children: [
|
|
532
|
-
/* @__PURE__ */ c("mesh", { geometry: Le, material: r.pool, position: [0, 0.02, 0], scale: 6 }),
|
|
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: jo, cap: r.cap, stem: r.stem }) }),
|
|
535
|
-
/* @__PURE__ */ c(Ee, { position: [0, 2.95, 0], text: `MCP · ${o.name}`, color: o.color, size: 0.3, pxRange: [9, 13] })
|
|
536
|
-
] });
|
|
537
|
-
}
|
|
538
|
-
const He = 28, Pe = 44, Ve = 3;
|
|
539
|
-
function $o() {
|
|
540
|
-
const e = S(() => {
|
|
541
|
-
const s = new n.BufferGeometry();
|
|
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
|
-
}, []), 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
|
-
return Z(({ clock: s }) => {
|
|
545
|
-
const i = performance.now(), a = I ? 0 : s.elapsedTime, l = e.getAttribute("position"), v = e.getAttribute("color");
|
|
546
|
-
let h = 0;
|
|
547
|
-
t.begin();
|
|
548
|
-
const f = (p, C, T, M, y) => {
|
|
549
|
-
if (h >= He) return;
|
|
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
|
-
for (let F = 0; F < Ve; F++)
|
|
558
|
-
for (let K = 0; K < Pe; K++)
|
|
559
|
-
for (let W = 0; W < 2; W++) {
|
|
560
|
-
const O = (K + W) / Pe;
|
|
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
|
-
let z;
|
|
565
|
-
if (T === 0) {
|
|
566
|
-
const $ = Math.pow(Math.max(0, Math.sin(O * 22 - a * 2.4)), 8);
|
|
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
|
-
}
|
|
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
|
-
};
|
|
574
|
-
let m = 0;
|
|
575
|
-
for (const p of J.mcpPending.values()) f(p.instance, p.server, 0, oo(p, i), m++);
|
|
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, v.needsUpdate = !0, t.end();
|
|
578
|
-
}), /* @__PURE__ */ H(ce, { children: [
|
|
579
|
-
/* @__PURE__ */ c("lineSegments", { geometry: e, material: o, frustumCulled: !1 }),
|
|
580
|
-
/* @__PURE__ */ c("primitive", { object: t.mesh })
|
|
581
|
-
] });
|
|
582
|
-
}
|
|
583
|
-
const Yo = (
|
|
584
|
-
/* glsl */
|
|
585
|
-
`
|
|
586
|
-
attribute float aPhase; uniform float uTime; varying float vK; varying float vD;
|
|
587
|
-
void main(){
|
|
588
|
-
vec4 mv = modelViewMatrix * vec4(position, 1.0);
|
|
589
|
-
vK = pow(max(0.0, sin(aPhase * 0.9 - uTime * 0.8)), 12.0);
|
|
590
|
-
vD = -mv.z;
|
|
591
|
-
gl_Position = projectionMatrix * mv;
|
|
592
|
-
}`
|
|
593
|
-
), Zo = (
|
|
594
|
-
/* glsl */
|
|
595
|
-
`
|
|
596
|
-
uniform vec3 uColor; varying float vK; varying float vD;
|
|
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
|
-
);
|
|
599
|
-
function Jo() {
|
|
600
|
-
const { geo: e, mat: o } = S(() => {
|
|
601
|
-
let t = 3;
|
|
602
|
-
const r = () => (t = t * 16807 % 2147483647) / 2147483647, s = [], i = [], a = (h, f, m, p, C, T) => {
|
|
603
|
-
let M = C;
|
|
604
|
-
for (let y = 0; y < p; y++) {
|
|
605
|
-
m += (r() - 0.5) * 0.7;
|
|
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
|
-
}
|
|
609
|
-
};
|
|
610
|
-
for (let h = 0; h < 30; h++) {
|
|
611
|
-
const f = r() * Math.PI * 2, m = 1.5 + r() * 21;
|
|
612
|
-
a(Math.cos(f) * m, Math.sin(f) * m, r() * Math.PI * 2, 18 + Math.floor(r() * 22), r() * 20, 0);
|
|
613
|
-
}
|
|
614
|
-
const l = new n.BufferGeometry();
|
|
615
|
-
l.setAttribute("position", new n.Float32BufferAttribute(s, 3)), l.setAttribute("aPhase", new n.Float32BufferAttribute(i, 1));
|
|
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
|
-
}, []);
|
|
619
|
-
return Z(({ clock: t }) => {
|
|
620
|
-
o.uniforms.uTime.value = I ? 0 : t.elapsedTime;
|
|
621
|
-
}), /* @__PURE__ */ c("lineSegments", { geometry: e, material: o });
|
|
622
|
-
}
|
|
623
|
-
function Qo() {
|
|
624
|
-
return /* @__PURE__ */ H(ce, { children: [
|
|
625
|
-
/* @__PURE__ */ c(Jo, {}),
|
|
626
|
-
/* @__PURE__ */ c($o, {})
|
|
627
|
-
] });
|
|
628
|
-
}
|
|
629
|
-
const ze = 4.4, ht = ze + 1.35, en = ht + 0.9;
|
|
630
|
-
function tn(e, o, t) {
|
|
631
|
-
const r = ze * 0.9 * Math.sqrt((e + 0.6) / o), s = e * 2.39996323;
|
|
632
|
-
return t.set(Math.cos(s) * r, 0.08, Math.sin(s) * r);
|
|
633
|
-
}
|
|
634
|
-
const on = 64, nn = 180, $e = 40, Te = 18, Se = 12, Ye = 3, Me = 11, rn = (
|
|
635
|
-
/* glsl */
|
|
636
|
-
`
|
|
637
|
-
varying vec2 vP;
|
|
638
|
-
// pond-local ground coords: the disc is rotated -90deg about X, local (x, y) -> (x, 0, -y)
|
|
639
|
-
void main(){ vP = vec2(position.x, -position.y); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`
|
|
640
|
-
), an = (
|
|
641
|
-
/* glsl */
|
|
642
|
-
`
|
|
643
|
-
uniform float uTime; uniform float uR;
|
|
644
|
-
uniform vec4 uRip[${Se}]; uniform vec3 uRipC[${Se}];
|
|
645
|
-
varying vec2 vP;
|
|
646
|
-
void main(){
|
|
647
|
-
float r = length(vP) / uR;
|
|
648
|
-
vec3 deep = vec3(0.004, 0.026, 0.032);
|
|
649
|
-
vec3 shallow = vec3(0.01, 0.055, 0.062);
|
|
650
|
-
vec3 col = mix(deep, shallow, smoothstep(0.35, 1.0, r));
|
|
651
|
-
// gentle swell bands
|
|
652
|
-
float sw = sin(vP.x * 1.7 + uTime * 0.5) * sin(vP.y * 1.3 - uTime * 0.4);
|
|
653
|
-
col += vec3(0.015, 0.045, 0.045) * sw * 0.4;
|
|
654
|
-
// broken moon path on the water (toward the camera)
|
|
655
|
-
float lane = exp(-pow((vP.x + 1.1 + sin(vP.y * 3.0 + uTime) * 0.12) / 0.55, 2.0));
|
|
656
|
-
float glint = pow(max(0.0, sin(vP.y * 9.0 + uTime * 1.3 + sin(vP.x * 4.0) * 1.5)), 6.0);
|
|
657
|
-
col += vec3(0.55, 0.85, 0.8) * lane * (0.05 + glint * 0.32) * smoothstep(-0.2, 1.0, vP.y / uR + 0.4);
|
|
658
|
-
// luminous shore
|
|
659
|
-
col += vec3(0.25, 0.85, 0.75) * smoothstep(0.88, 1.0, r) * 0.22;
|
|
660
|
-
// ripples
|
|
661
|
-
for (int i = 0; i < ${Se}; i++) {
|
|
662
|
-
vec4 q = uRip[i];
|
|
663
|
-
if (q.z < 0.0 || q.z > 1.0) continue;
|
|
664
|
-
float d = length(vP - q.xy);
|
|
665
|
-
float ring = q.z * (1.2 + q.w * 2.2);
|
|
666
|
-
float k = exp(-pow((d - ring) / (0.07 + q.z * 0.08), 2.0)) * (1.0 - q.z) * (1.0 - q.z);
|
|
667
|
-
col += uRipC[i] * k * (1.0 + q.w * 1.2);
|
|
668
|
-
}
|
|
669
|
-
float edge = 1.0 - smoothstep(0.985, 1.0, r);
|
|
670
|
-
gl_FragColor = vec4(col, edge);
|
|
671
|
-
}`
|
|
672
|
-
), sn = (
|
|
673
|
-
/* glsl */
|
|
674
|
-
`
|
|
675
|
-
attribute float aSize; attribute vec3 aColor; uniform float uScale; uniform float uTime; varying vec3 vC;
|
|
676
|
-
void main(){
|
|
677
|
-
vec3 p = position; p.y += sin(uTime * 0.9 + position.x * 2.1 + position.z * 1.7) * 0.03;
|
|
678
|
-
vec4 mv = modelViewMatrix * vec4(p, 1.0);
|
|
679
|
-
gl_PointSize = aSize * uScale / -mv.z; vC = aColor; gl_Position = projectionMatrix * mv; }`
|
|
680
|
-
), ln = (
|
|
681
|
-
/* glsl */
|
|
682
|
-
`
|
|
683
|
-
varying vec3 vC;
|
|
684
|
-
void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
|
|
685
|
-
float core = smoothstep(0.45, 0.0, r); float halo = pow(1.0 - r, 2.2);
|
|
686
|
-
gl_FragColor = vec4(vC * (core * 1.25 + halo * 0.45), 1.0); }`
|
|
687
|
-
);
|
|
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
|
-
}
|
|
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
|
-
}
|
|
704
|
-
const K = D.length, W = new Float32Array(K * 2 * 3);
|
|
705
|
-
for (let x = 0; x < K; x++)
|
|
706
|
-
for (let z = 0; z < 2; z++) {
|
|
707
|
-
const U = V[x * 2 + z];
|
|
708
|
-
W.set([d[U * 3], 0.05, d[U * 3 + 2]], (x * 2 + z) * 3);
|
|
709
|
-
}
|
|
710
|
-
const O = new n.BufferGeometry();
|
|
711
|
-
O.setAttribute("position", new n.BufferAttribute(W, 3)), O.setAttribute("color", new n.BufferAttribute(new Float32Array(K * 2 * 3), 3));
|
|
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: 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
|
-
}
|
|
720
|
-
return d;
|
|
721
|
-
}, []), T = S(() => new Float32Array(Me), []), M = S(() => new n.DodecahedronGeometry(1, 0), []), y = S(
|
|
722
|
-
() => ({
|
|
723
|
-
water: new n.ShaderMaterial({
|
|
724
|
-
uniforms: {
|
|
725
|
-
uTime: { value: 0 },
|
|
726
|
-
uR: { value: ze },
|
|
727
|
-
uRip: { value: Array.from({ length: Se }, () => new n.Vector4(0, 0, -1, 0)) },
|
|
728
|
-
uRipC: { value: Array.from({ length: Se }, () => new n.Color()) }
|
|
729
|
-
},
|
|
730
|
-
vertexShader: rn,
|
|
731
|
-
fragmentShader: an,
|
|
732
|
-
transparent: !0,
|
|
733
|
-
depthWrite: !1
|
|
734
|
-
}),
|
|
735
|
-
nodes: new n.ShaderMaterial({ uniforms: { uScale: { value: 400 }, uTime: { value: 0 } }, vertexShader: sn, fragmentShader: ln, transparent: !0, depthWrite: !1, blending: n.AdditiveBlending }),
|
|
736
|
-
threads: new n.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
|
|
737
|
-
beam: new n.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
|
|
738
|
-
stone: new n.MeshStandardMaterial({ color: "#1a2c2c", roughness: 0.92, metalness: 0, flatShading: !0 }),
|
|
739
|
-
rune: Ae(te)
|
|
740
|
-
}),
|
|
741
|
-
[]
|
|
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
|
-
};
|
|
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
|
-
let ge = 0, ue = 0;
|
|
754
|
-
N.begin();
|
|
755
|
-
const Ce = J.flares;
|
|
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
|
-
re > F[Y] && (F[Y] = re, W[Y].copy(ee ? ie : fe), K[Y] = ee ? 1 : 0);
|
|
759
|
-
const ve = V[Y * 3], st = V[Y * 3 + 2], At = X / (ee ? 2.2 : 1.4);
|
|
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
|
-
let ye = Math.atan2(st, ve) - 0.2;
|
|
762
|
-
ye < 0 && (ye += Math.PI * 2);
|
|
763
|
-
const Ne = Math.round(ye / (Math.PI * 2) * Me) % Me;
|
|
764
|
-
T[Ne] = Math.min(1.6, T[Ne] + (ee ? 0.9 : 0.5));
|
|
765
|
-
}
|
|
766
|
-
const it = pt(B.instance, j.sp), we = it ? ao(it, it) : void 0;
|
|
767
|
-
if (we && X < 2.2 && ge < $e) {
|
|
768
|
-
q.set(ve, 0.1, st), Ut(we, q, 1.6 / O, z);
|
|
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
|
-
for (let We = 0; We < Te; We++)
|
|
771
|
-
for (let qe = 0; qe < 2; qe++) {
|
|
772
|
-
const ne = (We + qe) / Te, pe = 1 - ne;
|
|
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
|
-
const xt = (ge * Te + We) * 2 + qe;
|
|
775
|
-
Fe.setXYZ(xt, x.x, x.y, x.z);
|
|
776
|
-
const qt = Math.exp(-(((ne - Ne) / 0.09) ** 2)) * 1.4;
|
|
777
|
-
$.copy(ee ? ie : fe).multiplyScalar(ye * ((ee ? 0.4 : 0.16) + qt) * 0.8), Be.setXYZ(xt, $.r, $.g, $.b);
|
|
778
|
-
}
|
|
779
|
-
ee ? N.add(we, z, q, 0.9, 1, 0.4, ie, ye * 1.1) : N.add(we, z, q, 0.1, -1, 0.4 / O, fe, ye * 1.3), ge++;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
for (let b = ue; b < Se; b++) Oe[b].z = -1;
|
|
783
|
-
p.bgeo.setDrawRange(0, ge * Te * 2), Fe.needsUpdate = !0, Be.needsUpdate = !0, N.end();
|
|
784
|
-
const Q = p.ngeo.getAttribute("aSize"), Ie = p.ngeo.getAttribute("aColor");
|
|
785
|
-
for (let b = 0; b < s; b++) {
|
|
786
|
-
const B = F[b];
|
|
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
|
-
}
|
|
789
|
-
Q.needsUpdate = !0, Ie.needsUpdate = !0;
|
|
790
|
-
const _e = p.lgeo.getAttribute("color");
|
|
791
|
-
for (let b = 0; b < p.np; b++) {
|
|
792
|
-
const B = Math.max(F[p.pairs[b * 2]], F[p.pairs[b * 2 + 1]]), Y = p.strong[b] ? 0.13 : 0.06;
|
|
793
|
-
for (let X = 0; X < 2; X++) _e.setXYZ(b * 2 + X, 0.3 * Y + B * 0.25, 0.85 * Y + B * 0.4, 0.75 * Y + B * 0.38);
|
|
794
|
-
}
|
|
795
|
-
_e.needsUpdate = !0;
|
|
796
|
-
for (let b = 0; b < Me; b++) {
|
|
797
|
-
const B = m.current[b], Y = T[b];
|
|
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
|
-
}
|
|
800
|
-
let k = 0;
|
|
801
|
-
for (let b = J.flares.length - 1; b >= 0 && k < Ye; b--) {
|
|
802
|
-
const B = J.flares[b];
|
|
803
|
-
if (R - B.start > 2200) break;
|
|
804
|
-
let Y = !1;
|
|
805
|
-
for (let re = 0; re < k; re++) f.current[re] === B.node && (Y = !0);
|
|
806
|
-
if (Y) continue;
|
|
807
|
-
const X = E(B.node);
|
|
808
|
-
let Ge = !1;
|
|
809
|
-
for (let re = 0; re < k; re++) {
|
|
810
|
-
const ve = h.current[re];
|
|
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
|
-
}
|
|
813
|
-
if (Ge) continue;
|
|
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
|
-
}
|
|
817
|
-
for (let b = k; b < Ye; b++) {
|
|
818
|
-
const B = v.current[b];
|
|
819
|
-
B == null || B.setOpacity(0), f.current[b] = "";
|
|
820
|
-
}
|
|
821
|
-
}), /* @__PURE__ */ H(ce, { children: [
|
|
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
|
-
/* @__PURE__ */ c("lineSegments", { geometry: p.lgeo, material: y.threads, frustumCulled: !1 }),
|
|
824
|
-
/* @__PURE__ */ c("points", { geometry: p.ngeo, material: y.nodes, frustumCulled: !1 }),
|
|
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
|
-
/* @__PURE__ */ c("lineSegments", { geometry: p.bgeo, material: y.beam, frustumCulled: !1 }),
|
|
830
|
-
/* @__PURE__ */ c("primitive", { object: N.mesh }),
|
|
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
|
-
] });
|
|
834
|
-
}
|
|
835
|
-
const un = 26, zt = () => Math.max(1, (me.core.r + 9) / un), fn = (
|
|
836
|
-
/* glsl */
|
|
837
|
-
`
|
|
838
|
-
varying vec3 vDir;
|
|
839
|
-
void main(){ vDir = normalize(position); vec4 p = projectionMatrix * modelViewMatrix * vec4(position, 1.0); gl_Position = p.xyww; }`
|
|
840
|
-
), pn = (
|
|
841
|
-
/* glsl */
|
|
842
|
-
`
|
|
843
|
-
uniform vec3 uMoonDir; varying vec3 vDir;
|
|
844
|
-
void main(){
|
|
845
|
-
float h = clamp(vDir.y, -0.2, 1.0);
|
|
846
|
-
vec3 horizon = vec3(0.035, 0.11, 0.115);
|
|
847
|
-
vec3 mid = vec3(0.012, 0.045, 0.055);
|
|
848
|
-
vec3 zenith = vec3(0.004, 0.012, 0.02);
|
|
849
|
-
vec3 col = mix(horizon, mid, smoothstep(0.0, 0.18, h));
|
|
850
|
-
col = mix(col, zenith, smoothstep(0.18, 0.75, h));
|
|
851
|
-
float m = max(0.0, dot(normalize(vDir), uMoonDir));
|
|
852
|
-
col += vec3(0.35, 0.6, 0.58) * pow(m, 40.0) * 0.35 + vec3(0.1, 0.25, 0.24) * pow(m, 6.0) * 0.12;
|
|
853
|
-
gl_FragColor = vec4(col, 1.0);
|
|
854
|
-
}`
|
|
855
|
-
), Rt = new n.Vector3(-0.42, 0.42, -0.8).normalize();
|
|
856
|
-
let Ze = null;
|
|
857
|
-
function mn() {
|
|
858
|
-
if (Ze) return Ze;
|
|
859
|
-
const e = document.createElement("canvas");
|
|
860
|
-
e.width = e.height = 256;
|
|
861
|
-
const o = e.getContext("2d"), t = o.createRadialGradient(118, 116, 10, 128, 128, 96);
|
|
862
|
-
t.addColorStop(0, "rgba(250,255,250,1)"), t.addColorStop(0.85, "rgba(214,240,232,1)"), t.addColorStop(1, "rgba(190,225,216,1)"), o.fillStyle = t, o.beginPath(), o.arc(128, 128, 96, 0, Math.PI * 2), o.fill(), o.fillStyle = "rgba(150,190,182,0.22)";
|
|
863
|
-
for (const [r, s, i] of [[100, 105, 26], [150, 140, 20], [120, 160, 14], [160, 100, 11]])
|
|
864
|
-
o.beginPath(), o.arc(r, s, i, 0, Math.PI * 2), o.fill();
|
|
865
|
-
return Ze = new n.CanvasTexture(e), Ze;
|
|
866
|
-
}
|
|
867
|
-
function dn() {
|
|
868
|
-
const e = S(() => {
|
|
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
|
-
let i = 5;
|
|
871
|
-
const a = () => (i = i * 16807 % 2147483647) / 2147483647;
|
|
872
|
-
let l = 0;
|
|
873
|
-
for (let v = 0; v < t; v++) {
|
|
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
|
-
if (p > 18 && Math.abs(m) < 26) continue;
|
|
876
|
-
const C = 5 + a() * 7, T = C * (0.22 + a() * 0.06);
|
|
877
|
-
for (let M = 0; M < 3; 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
|
-
}
|
|
880
|
-
return r.count = l, r.instanceMatrix.needsUpdate = !0, r;
|
|
881
|
-
}, []);
|
|
882
|
-
return /* @__PURE__ */ c("primitive", { object: e });
|
|
883
|
-
}
|
|
884
|
-
function hn() {
|
|
885
|
-
const e = S(() => {
|
|
886
|
-
let r = 17;
|
|
887
|
-
const s = () => (r = r * 16807 % 2147483647) / 2147483647;
|
|
888
|
-
return Array.from({ length: 16 }, () => {
|
|
889
|
-
const i = s() * Math.PI * 2, a = 6 + s() * 22;
|
|
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
|
-
});
|
|
892
|
-
}, []), o = S(
|
|
893
|
-
() => new n.SpriteMaterial({ map: vo(), color: new n.Color("#7fd6c6").multiplyScalar(0.55), transparent: !0, opacity: 0.1, depthWrite: !1, fog: !1 }),
|
|
894
|
-
[]
|
|
895
|
-
), t = _([]);
|
|
896
|
-
return Z(({ clock: r }) => {
|
|
897
|
-
if (I) return;
|
|
898
|
-
const s = r.elapsedTime;
|
|
899
|
-
e.forEach((i, a) => {
|
|
900
|
-
const l = t.current[a];
|
|
901
|
-
l && l.position.set(i.x + Math.sin(s * 0.05 * i.sp * 6 + i.ph) * 3, i.y, i.z + Math.cos(s * 0.04 + i.ph) * 1.5);
|
|
902
|
-
});
|
|
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
|
-
}
|
|
905
|
-
function gn() {
|
|
906
|
-
const e = _(null);
|
|
907
|
-
return Z(() => {
|
|
908
|
-
var o;
|
|
909
|
-
(o = e.current) == null || o.scale.set(zt(), 1, zt());
|
|
910
|
-
}), /* @__PURE__ */ H("group", { ref: e, children: [
|
|
911
|
-
/* @__PURE__ */ c(dn, {}),
|
|
912
|
-
/* @__PURE__ */ c(hn, {})
|
|
913
|
-
] });
|
|
914
|
-
}
|
|
915
|
-
function vn() {
|
|
916
|
-
const e = S(() => Ue(new n.Color(he.moon).lerp(new n.Color("#5eead4"), 0.4).multiplyScalar(0.075)), []), o = _(null);
|
|
917
|
-
return Z(() => {
|
|
918
|
-
var r;
|
|
919
|
-
const t = me.core;
|
|
920
|
-
(r = o.current) == null || r.scale.set(t.hw * 2.6 + 9, 1, t.hh * 2.6 + 9);
|
|
921
|
-
}), /* @__PURE__ */ c("mesh", { ref: o, geometry: Le, material: e, position: [0, 0.01, 0] });
|
|
922
|
-
}
|
|
923
|
-
function wn() {
|
|
924
|
-
return Z(({ scene: e, camera: o }) => {
|
|
925
|
-
const t = e.fog;
|
|
926
|
-
if (!t || !("density" in t)) return;
|
|
927
|
-
const r = Qe.cam.dist || o.position.length();
|
|
928
|
-
t.density = 0.016 * Math.min(1, 36 / Math.max(1, r));
|
|
929
|
-
}), null;
|
|
930
|
-
}
|
|
931
|
-
function yn() {
|
|
932
|
-
const e = S(
|
|
933
|
-
() => new n.ShaderMaterial({ uniforms: { uMoonDir: { value: Rt } }, vertexShader: fn, fragmentShader: pn, side: n.BackSide, depthWrite: !1, fog: !1 }),
|
|
934
|
-
[]
|
|
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
|
-
return /* @__PURE__ */ H(ce, { children: [
|
|
937
|
-
/* @__PURE__ */ c("mesh", { material: e, renderOrder: -10, frustumCulled: !1, children: /* @__PURE__ */ c("sphereGeometry", { args: [180, 32, 16] }) }),
|
|
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
|
-
/* @__PURE__ */ c("sprite", { material: t, position: r, scale: 70 }),
|
|
940
|
-
/* @__PURE__ */ c("sprite", { material: o, position: r, scale: 11 }),
|
|
941
|
-
/* @__PURE__ */ c("hemisphereLight", { args: ["#2a6b66", "#020807", 0.55] }),
|
|
942
|
-
/* @__PURE__ */ c("directionalLight", { position: [-30, 40, -60], intensity: 0.9, color: "#a8f0e2" }),
|
|
943
|
-
/* @__PURE__ */ c("ambientLight", { intensity: 0.08, color: "#5eead4" }),
|
|
944
|
-
/* @__PURE__ */ c("fogExp2", { attach: "fog", args: [he.fog, 0.016] }),
|
|
945
|
-
/* @__PURE__ */ c(wn, {}),
|
|
946
|
-
/* @__PURE__ */ H("mesh", { rotation: [-Math.PI / 2, 0, 0], receiveShadow: !0, children: [
|
|
947
|
-
/* @__PURE__ */ c("circleGeometry", { args: [170, 64] }),
|
|
948
|
-
/* @__PURE__ */ c("meshStandardMaterial", { color: he.ground, roughness: 1, metalness: 0 })
|
|
949
|
-
] }),
|
|
950
|
-
/* @__PURE__ */ c(vn, {}),
|
|
951
|
-
/* @__PURE__ */ c(gn, {})
|
|
952
|
-
] });
|
|
953
|
-
}
|
|
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
|
-
const r = e.subagent ? 2 : 3, s = [];
|
|
957
|
-
for (let i = 0; i < r; i++) {
|
|
958
|
-
const a = r === 2 ? i * 1.4 : i;
|
|
959
|
-
s.push({ y: o * (0.3 + a * 0.19), r: t * (1 - a * 0.27), h: o * (0.46 - a * 0.04), rot: Re(e.id, 20 + i) * 6.28 });
|
|
960
|
-
}
|
|
961
|
-
return s;
|
|
962
|
-
}
|
|
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
|
-
() => ({
|
|
966
|
-
fill: de(m),
|
|
967
|
-
line: wo(m),
|
|
968
|
-
trunk: new n.MeshBasicMaterial({ color: Sn }),
|
|
969
|
-
halo: Ae(m),
|
|
970
|
-
pool: Ue(m),
|
|
971
|
-
ring: de(tt),
|
|
972
|
-
sel: de(ie),
|
|
973
|
-
root: Et(m.clone().lerp(te, 0.3), t.subagent ? 0.055 : 0.08, 0.55),
|
|
974
|
-
arrow: de(m)
|
|
975
|
-
}),
|
|
976
|
-
[m, t.subagent]
|
|
977
|
-
), u = S(
|
|
978
|
-
() => ({
|
|
979
|
-
base: new n.Vector3(),
|
|
980
|
-
crown: new n.Vector3(),
|
|
981
|
-
top: new n.Vector3(),
|
|
982
|
-
p0: new n.Vector3(),
|
|
983
|
-
p1: new n.Vector3(),
|
|
984
|
-
p2: new n.Vector3(),
|
|
985
|
-
p0set: !1,
|
|
986
|
-
parentK: 0,
|
|
987
|
-
ringK: 0,
|
|
988
|
-
llm: t.llmCalls,
|
|
989
|
-
tok: t.tokens,
|
|
990
|
-
shed: !1,
|
|
991
|
-
c: new n.Color(),
|
|
992
|
-
c2: new n.Color()
|
|
993
|
-
}),
|
|
994
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
995
|
-
[]
|
|
996
|
-
);
|
|
997
|
-
Z(({ clock: d }) => {
|
|
998
|
-
var _e;
|
|
999
|
-
const g = performance.now(), A = d.elapsedTime;
|
|
1000
|
-
u.base.copy(e.live);
|
|
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
|
-
let Be = !1;
|
|
1005
|
-
for (const k of J.mcpPending.values()) k.instance === t.id && (Be = !0);
|
|
1006
|
-
if (u.ringK += ((Be && W < 0 ? 1 : 0) - u.ringK) * 0.08, t.llmCalls > u.llm) {
|
|
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), Fo(u.top, b, u.c2, 0.3 + Math.min(0.55, k / 4500), C * 0.9 * R);
|
|
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), 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
|
-
const k = Math.max(1e-4, K * (1 - O * 0.2));
|
|
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
|
-
}
|
|
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
|
-
const ke = J.selected === t.id;
|
|
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
|
-
const ge = t.parent ? J.instances.get(t.parent) : void 0, ue = t.parent ? Gt(t.parent) : void 0;
|
|
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
|
-
const Ce = !!ge && !ge.exitAt;
|
|
1021
|
-
u.parentK += ((D && !t.exitAt && Ce ? 1 : 0) - u.parentK) * (Ce ? 0.05 : 0.035);
|
|
1022
|
-
const Q = y.root.uniforms;
|
|
1023
|
-
Q.uP0.value.copy(u.p0), Q.uP1.value.copy(u.p1), Q.uP2.value.copy(u.p2);
|
|
1024
|
-
const Ie = W >= 0 ? at(W / 1.6) : 0;
|
|
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
|
-
}
|
|
1029
|
-
});
|
|
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
|
-
return /* @__PURE__ */ H(ce, { children: [
|
|
1034
|
-
/* @__PURE__ */ c("mesh", { geometry: Dt, material: y.root, frustumCulled: !1 }),
|
|
1035
|
-
/* @__PURE__ */ c("mesh", { ref: h, geometry: wt, material: y.arrow, visible: !1 }),
|
|
1036
|
-
/* @__PURE__ */ H("group", { ref: r, children: [
|
|
1037
|
-
/* @__PURE__ */ c("mesh", { ref: a, geometry: Le, material: y.pool, position: [0, 0.02, 0], scale: 1e-4 }),
|
|
1038
|
-
/* @__PURE__ */ c("mesh", { ref: l, geometry: Ft, material: y.ring, position: [0, 0.06, 0], visible: !1 }),
|
|
1039
|
-
/* @__PURE__ */ c("mesh", { ref: v, geometry: Ft, material: y.sel, position: [0, 0.05, 0], visible: !1 }),
|
|
1040
|
-
/* @__PURE__ */ H("group", { ref: s, scale: 1e-4, children: [
|
|
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
|
-
/* @__PURE__ */ c("sprite", { ref: i, material: y.halo })
|
|
1047
|
-
] }),
|
|
1048
|
-
/* @__PURE__ */ c(
|
|
1049
|
-
Ee,
|
|
1050
|
-
{
|
|
1051
|
-
ref: f,
|
|
1052
|
-
fit: !0,
|
|
1053
|
-
position: [0, p * 1.1 + (t.subagent ? 0.15 : 0.45), 0],
|
|
1054
|
-
text: `${t.name}${E !== void 0 && !Number.isNaN(Number(E)) ? ` ${Number(E) + 1}` : ""}`,
|
|
1055
|
-
color: _t[t.type],
|
|
1056
|
-
size: t.subagent ? 0.24 : 0.3,
|
|
1057
|
-
opacity: 0,
|
|
1058
|
-
pxRange: t.subagent ? [8, 11.5] : [9, 13.5]
|
|
1059
|
-
}
|
|
1060
|
-
)
|
|
1061
|
-
] })
|
|
1062
|
-
] });
|
|
1063
|
-
}
|
|
1064
|
-
function Cn({ comet: e }) {
|
|
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
|
-
return Z(() => {
|
|
1067
|
-
const a = pt(e.from, i.a), l = pt(e.to, i.b);
|
|
1068
|
-
if (!o.current) return;
|
|
1069
|
-
if (!a || !l) {
|
|
1070
|
-
o.current.visible = !1;
|
|
1071
|
-
return;
|
|
1072
|
-
}
|
|
1073
|
-
Ut(a, l, 2.6, i.c);
|
|
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
|
-
}), /* @__PURE__ */ c("sprite", { ref: o, material: s, visible: !1 });
|
|
1077
|
-
}
|
|
1078
|
-
function Pn() {
|
|
1079
|
-
const [e, o] = et([]), t = _({ n: -1, last: -1, first: -1 });
|
|
1080
|
-
return Z(() => {
|
|
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(zn(r)));
|
|
1083
|
-
}), /* @__PURE__ */ c(ce, { children: e.map((r) => /* @__PURE__ */ c(Cn, { comet: r }, r.id)) });
|
|
1084
|
-
}
|
|
1085
|
-
const Tn = 40;
|
|
1086
|
-
function zn(e) {
|
|
1087
|
-
const o = [];
|
|
1088
|
-
for (let t = e.length - 1; t >= 0 && o.length < Tn; t--) {
|
|
1089
|
-
const r = e[t];
|
|
1090
|
-
(!fo.grouped || Ct(r.from) && Ct(r.to)) && o.push(r);
|
|
1091
|
-
}
|
|
1092
|
-
return o.reverse();
|
|
1093
|
-
}
|
|
1094
|
-
const Je = new n.Vector3();
|
|
1095
|
-
function Rn(e) {
|
|
1096
|
-
for (const o of me.agents.values()) {
|
|
1097
|
-
const t = bt(o);
|
|
1098
|
-
Je.copy(o.target), Je.y = Mt(o.inst) * 1.12 * t + 0.45, e(Je, 0.9);
|
|
1099
|
-
}
|
|
1100
|
-
for (const o of me.runs.values()) e(Ot(o, Je), 1.6);
|
|
1101
|
-
}
|
|
1102
|
-
function Un() {
|
|
1103
|
-
return /* @__PURE__ */ H(
|
|
1104
|
-
po,
|
|
1105
|
-
{
|
|
1106
|
-
title: "forest · night grove",
|
|
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",
|
|
1108
|
-
preset: "radial",
|
|
1109
|
-
plane: "xz",
|
|
1110
|
-
camera: { position: [0, 17.5, 31], fov: 46 },
|
|
1111
|
-
target: [0, 2.4, 0],
|
|
1112
|
-
controls: { maxPolarAngle: 1.42 },
|
|
1113
|
-
bg: he.bg,
|
|
1114
|
-
fit: { nRef: 4, min: 0.62, max: 1.5, minRadius: 4.5 },
|
|
1115
|
-
agentRadius: 1.1,
|
|
1116
|
-
graph: { natural: en, radius: 3 },
|
|
1117
|
-
peripheryGap: 4,
|
|
1118
|
-
Background: /* @__PURE__ */ c(yn, {}),
|
|
1119
|
-
Agent: xn,
|
|
1120
|
-
RunMarker: zo,
|
|
1121
|
-
McpServer: Ho,
|
|
1122
|
-
Backend: Ko,
|
|
1123
|
-
GraphResource: cn,
|
|
1124
|
-
cluster: { radius: 1.35, variant: "swarm", color: "#b6f36a", pointSize: 0.85 },
|
|
1125
|
-
clusterOffset: [0, 3.2, 0],
|
|
1126
|
-
extents: Rn,
|
|
1127
|
-
PostFX: /* @__PURE__ */ H(Kt, { multisampling: 0, children: [
|
|
1128
|
-
/* @__PURE__ */ c(Ht, { mipmapBlur: !0, intensity: 1, luminanceThreshold: 0.22, luminanceSmoothing: 0.3, radius: 0.72 }),
|
|
1129
|
-
/* @__PURE__ */ c($t, { eskil: !1, offset: 0.24, darkness: 0.85 })
|
|
1130
|
-
] }),
|
|
1131
|
-
children: [
|
|
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
|
-
]
|
|
1138
|
-
}
|
|
1139
|
-
);
|
|
1140
|
-
}
|
|
1141
|
-
export {
|
|
1142
|
-
Un as default
|
|
1143
|
-
};
|