agentglow 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -11
- package/cli/agentglow.mjs +7 -6
- package/dist/chunks/KitScene-DQRuKA06.js +5933 -0
- package/dist/chunks/ResourceWire-BWuyirO3.js +36 -0
- package/dist/chunks/index-BMvsU_SR.js +678 -0
- package/dist/chunks/index-BdJCRn1T.js +1015 -0
- package/dist/chunks/index-BwhbmMX9.js +990 -0
- package/dist/chunks/index-CDUophR-.js +921 -0
- package/dist/chunks/{index-D-egBmZU.js → index-CW7wP0kH.js} +194 -194
- package/dist/chunks/index-CxdQEVoW.js +52 -0
- package/dist/chunks/{index-CHJsMIrM.js → index-DGesxtsp.js} +195 -194
- package/dist/chunks/{index-CpXj5lT0.js → index-DHQVfGjR.js} +151 -150
- package/dist/index.js +1 -1
- package/dist/node.js +193 -0
- package/dist/pulse.js +20 -0
- package/dist/style.css +1 -1
- package/dist/types/node.d.ts +45 -0
- package/dist/types/pulse.d.ts +37 -0
- package/dist/types/themes.d.ts +1 -1
- package/dist/types/world.d.ts +192 -8
- package/package.json +55 -6
- package/dist/chunks/KitScene-DbBTTc3H.js +0 -4605
- package/dist/chunks/index-B2VQ34Za.js +0 -948
- package/dist/chunks/index-DZvO9oiI.js +0 -677
- package/dist/chunks/index-OgLlwjoE.js +0 -48
|
@@ -4,11 +4,11 @@ var L = (e, n, r) => at(e, typeof n != "symbol" ? n + "" : n, r);
|
|
|
4
4
|
import { jsxs as q, Fragment as de, jsx as g } from "react/jsx-runtime";
|
|
5
5
|
import { EffectComposer as it, Bloom as ct, Vignette as lt } from "@react-three/postprocessing";
|
|
6
6
|
import * as t from "three";
|
|
7
|
-
import { T as We, h as X, K as ft,
|
|
7
|
+
import { T as We, h as X, K as ft, y as je, w as N, a as ce, D as ut, J as dt, L as ye, G as pt, A as ht, m as tt, c as qe, d as mt, M as Ye, R as vt, u as gt, B as bt, C as wt, e as yt, s as St, j as Mt, f as Ve, k as At, n as xt, v as Ct } from "./KitScene-DQRuKA06.js";
|
|
8
8
|
import { useThree as Re, useFrame as se } from "@react-three/fiber";
|
|
9
|
-
import { useMemo as P, useRef as T, useEffect as
|
|
9
|
+
import { useMemo as P, useRef as T, useEffect as Pt } from "react";
|
|
10
10
|
var et;
|
|
11
|
-
const Q = typeof window < "u" && !!((et = window.matchMedia) != null && et.call(window, "(prefers-reduced-motion: reduce)").matches),
|
|
11
|
+
const Q = typeof window < "u" && !!((et = window.matchMedia) != null && et.call(window, "(prefers-reduced-motion: reduce)").matches), H = (e) => e < 0 ? 0 : e > 1 ? 1 : e, we = (e) => 1 - Math.pow(1 - H(e), 3), xe = (e) => (e = H(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2), K = new t.Color(1, 1, 1), Ce = new t.Color("#cfe0ff"), ke = new t.Color("#fbbf24"), zt = new t.Color("#ff3b4e"), Oe = Object.fromEntries(Object.entries(We).map(([e, n]) => [e, new t.Color(n).lerp(Ce, 0.45)]));
|
|
12
12
|
Object.fromEntries(Object.entries(We).map(([e, n]) => [e, new t.Color(n)]));
|
|
13
13
|
function Ke(e, n) {
|
|
14
14
|
const r = document.createElement("canvas");
|
|
@@ -16,29 +16,29 @@ function Ke(e, n) {
|
|
|
16
16
|
const o = new t.CanvasTexture(r);
|
|
17
17
|
return o.colorSpace = t.SRGBColorSpace, o;
|
|
18
18
|
}
|
|
19
|
-
let
|
|
19
|
+
let Rt = null;
|
|
20
20
|
function Pe() {
|
|
21
|
-
return
|
|
21
|
+
return Rt ?? (Rt = Ke(128, (e, n) => {
|
|
22
22
|
const r = e.createRadialGradient(n / 2, n / 2, 0, n / 2, n / 2, n / 2);
|
|
23
23
|
r.addColorStop(0, "rgba(255,255,255,1)"), r.addColorStop(0.12, "rgba(255,255,255,0.65)"), r.addColorStop(0.4, "rgba(255,255,255,0.13)"), r.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = r, e.fillRect(0, 0, n, n);
|
|
24
24
|
}));
|
|
25
25
|
}
|
|
26
|
-
let
|
|
27
|
-
function
|
|
28
|
-
return
|
|
29
|
-
const r = n / 2, o = (h, p, y,
|
|
26
|
+
let Bt = null;
|
|
27
|
+
function Tt() {
|
|
28
|
+
return Bt ?? (Bt = Ke(256, (e, n) => {
|
|
29
|
+
const r = n / 2, o = (h, p, y, x) => {
|
|
30
30
|
e.save(), e.translate(r, r), e.rotate(h);
|
|
31
31
|
const z = e.createLinearGradient(-p, 0, p, 0);
|
|
32
|
-
z.addColorStop(0, "rgba(255,255,255,0)"), z.addColorStop(0.5, `rgba(255,255,255,${
|
|
32
|
+
z.addColorStop(0, "rgba(255,255,255,0)"), z.addColorStop(0.5, `rgba(255,255,255,${x})`), z.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = z, e.beginPath(), e.moveTo(-p, 0), e.lineTo(0, -y), e.lineTo(p, 0), e.lineTo(0, y), e.closePath(), e.fill(), e.restore();
|
|
33
33
|
};
|
|
34
34
|
o(0, r, 2.4, 1), o(Math.PI / 2, r, 2.4, 1), o(Math.PI / 4, r * 0.45, 1.3, 0.35), o(-Math.PI / 4, r * 0.45, 1.3, 0.35);
|
|
35
35
|
const c = e.createRadialGradient(r, r, 0, r, r, r * 0.18);
|
|
36
36
|
c.addColorStop(0, "rgba(255,255,255,1)"), c.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = c, e.fillRect(0, 0, n, n);
|
|
37
37
|
}));
|
|
38
38
|
}
|
|
39
|
-
let
|
|
39
|
+
let Vt = null;
|
|
40
40
|
function ot() {
|
|
41
|
-
return
|
|
41
|
+
return Vt ?? (Vt = Ke(256, (e, n) => {
|
|
42
42
|
const r = n / 2, o = e.createRadialGradient(r, r, r * 0.78, r, r, r * 0.98);
|
|
43
43
|
o.addColorStop(0, "rgba(255,255,255,0)"), o.addColorStop(0.55, "rgba(255,255,255,0.9)"), o.addColorStop(1, "rgba(255,255,255,0)"), e.fillStyle = o, e.fillRect(0, 0, n, n);
|
|
44
44
|
}));
|
|
@@ -46,7 +46,7 @@ function ot() {
|
|
|
46
46
|
function le(e, n = "#fff") {
|
|
47
47
|
return new t.SpriteMaterial({ map: e, color: n, blending: t.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 });
|
|
48
48
|
}
|
|
49
|
-
const nt = () => new t.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), Xe = new t.SphereGeometry(1, 32, 24),
|
|
49
|
+
const nt = () => new t.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), Xe = new t.SphereGeometry(1, 32, 24), _t = new t.ConeGeometry(1, 1, 3).translate(0, 0.5, 0), $e = new t.TorusGeometry(1, 0.012, 6, 96);
|
|
50
50
|
function fe(e, n, r, o, c) {
|
|
51
51
|
const h = 1 - o;
|
|
52
52
|
return c.set(h * h * e.x + 2 * h * o * n.x + o * o * r.x, h * h * e.y + 2 * h * o * n.y + o * o * r.y, h * h * e.z + 2 * h * o * n.z + o * o * r.z);
|
|
@@ -63,13 +63,13 @@ const Ge = class Ge {
|
|
|
63
63
|
L(this, "o", new t.Object3D());
|
|
64
64
|
L(this, "a", new t.Vector3());
|
|
65
65
|
L(this, "b", new t.Vector3());
|
|
66
|
-
this.max = n, this.colors = new Float32Array(n * 3), this.mesh = new t.InstancedMesh(
|
|
66
|
+
this.max = n, this.colors = new Float32Array(n * 3), this.mesh = new t.InstancedMesh(_t, new t.MeshBasicMaterial({ blending: t.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1 }), n), this.mesh.instanceColor = new t.InstancedBufferAttribute(this.colors, 3), this.mesh.frustumCulled = !1, this.mesh.count = 0;
|
|
67
67
|
}
|
|
68
68
|
begin() {
|
|
69
69
|
this.n = 0;
|
|
70
70
|
}
|
|
71
|
-
add(n, r, o, c, h, p, y,
|
|
72
|
-
this.n >= this.max ||
|
|
71
|
+
add(n, r, o, c, h, p, y, x) {
|
|
72
|
+
this.n >= this.max || x < 0.01 || (fe(n, r, o, c, this.a), fe(n, r, o, H(c + 0.02 * h), this.b), this.b.sub(this.a), !(this.b.lengthSq() < 1e-9) && (this.o.position.copy(this.a), this.o.quaternion.setFromUnitVectors(Ge.UP, this.b.normalize()), this.o.scale.set(p * 0.32, p, p * 0.32), this.o.updateMatrix(), this.mesh.setMatrixAt(this.n, this.o.matrix), this.colors[this.n * 3] = y.r * x, this.colors[this.n * 3 + 1] = y.g * x, this.colors[this.n * 3 + 2] = y.b * x, this.n++));
|
|
73
73
|
}
|
|
74
74
|
end() {
|
|
75
75
|
this.mesh.count = this.n, this.mesh.instanceMatrix.needsUpdate = !0, this.mesh.instanceColor.needsUpdate = !0;
|
|
@@ -96,17 +96,17 @@ class De {
|
|
|
96
96
|
* @param dash flowing dash strength; dashDir +1 flows toward b
|
|
97
97
|
* @param head travelling bright head position (-1 = none); headK its strength
|
|
98
98
|
*/
|
|
99
|
-
add(n, r, o, c, h, p, y,
|
|
99
|
+
add(n, r, o, c, h, p, y, x, z, M, b, u) {
|
|
100
100
|
if (this.n >= this.max || y <= p) return;
|
|
101
101
|
const S = this.seg, a = this.P, l = this.C;
|
|
102
102
|
for (let i = 0; i < S; i++)
|
|
103
|
-
for (let
|
|
104
|
-
const d = p + (y - p) * (i +
|
|
103
|
+
for (let A = 0; A < 2; A++) {
|
|
104
|
+
const d = p + (y - p) * (i + A) / S;
|
|
105
105
|
fe(n, r, o, d, this.p);
|
|
106
|
-
const s = (this.n * S + i) * 2 +
|
|
106
|
+
const s = (this.n * S + i) * 2 + A;
|
|
107
107
|
a.setXYZ(s, this.p.x, this.p.y, this.p.z);
|
|
108
108
|
let f = h;
|
|
109
|
-
|
|
109
|
+
x > 0 && (f += x * Math.pow(Math.max(0, Math.sin((d * 9 - M * 0.9 * z) * Math.PI)), 8)), f *= 0.2 + 0.8 * H(Math.min((d - p) / 0.06, (y - d) / 0.04)), b >= 0 && (f += u * Math.exp(-(((d - b) / 0.045) ** 2))), l.setXYZ(s, c.r * f, c.g * f, c.b * f);
|
|
110
110
|
}
|
|
111
111
|
this.n++;
|
|
112
112
|
}
|
|
@@ -114,12 +114,12 @@ class De {
|
|
|
114
114
|
this.geo.setDrawRange(0, this.n * this.seg * 2), this.P.needsUpdate = !0, this.C.needsUpdate = !0;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
const _e = 15, Be = 7.5,
|
|
117
|
+
const _e = 15, Be = 7.5, jt = (
|
|
118
118
|
/* glsl */
|
|
119
119
|
`
|
|
120
120
|
attribute float aSize; attribute vec3 aColor; uniform float uScale; varying vec3 vC;
|
|
121
121
|
void main(){ vec4 mv = modelViewMatrix * vec4(position, 1.0); vC = aColor; gl_PointSize = aSize * uScale / -mv.z; gl_Position = projectionMatrix * mv; }`
|
|
122
|
-
),
|
|
122
|
+
), Ot = (
|
|
123
123
|
/* glsl */
|
|
124
124
|
`
|
|
125
125
|
varying vec3 vC;
|
|
@@ -130,7 +130,7 @@ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
|
|
|
130
130
|
class Fe {
|
|
131
131
|
constructor(n) {
|
|
132
132
|
L(this, "geo", new t.BufferGeometry());
|
|
133
|
-
L(this, "mat", new t.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader:
|
|
133
|
+
L(this, "mat", new t.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: jt, fragmentShader: Ot, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending }));
|
|
134
134
|
L(this, "obj");
|
|
135
135
|
L(this, "P");
|
|
136
136
|
L(this, "S");
|
|
@@ -151,10 +151,10 @@ class Fe {
|
|
|
151
151
|
this.geo.setDrawRange(0, this.n), this.P.needsUpdate = !0, this.S.needsUpdate = !0, this.C.needsUpdate = !0;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
const
|
|
154
|
+
const Gt = 260, Ee = 40, Ie = 8, Te = 4, Ft = new t.Color("#9db4ff"), Et = (
|
|
155
155
|
/* glsl */
|
|
156
156
|
"varying vec2 vUv; void main(){ vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }"
|
|
157
|
-
),
|
|
157
|
+
), It = (
|
|
158
158
|
/* glsl */
|
|
159
159
|
`
|
|
160
160
|
uniform float uTime; uniform float uAct; varying vec2 vUv;
|
|
@@ -184,12 +184,12 @@ void main(){
|
|
|
184
184
|
vec3 c = col * dens * (2.0 + uAct * 0.9) + vec3(0.55, 0.6, 0.95) * core * 0.5;
|
|
185
185
|
gl_FragColor = vec4(c, 1.0);
|
|
186
186
|
}`
|
|
187
|
-
),
|
|
187
|
+
), Lt = (
|
|
188
188
|
/* glsl */
|
|
189
189
|
`
|
|
190
190
|
attribute float aSize; attribute vec3 aColor; uniform float uScale; varying vec3 vC;
|
|
191
191
|
void main(){ vec4 mv = modelViewMatrix * vec4(position, 1.0); vC = aColor; gl_PointSize = aSize * uScale / -mv.z; gl_Position = projectionMatrix * mv; }`
|
|
192
|
-
),
|
|
192
|
+
), Nt = (
|
|
193
193
|
/* glsl */
|
|
194
194
|
`
|
|
195
195
|
varying vec3 vC;
|
|
@@ -197,22 +197,22 @@ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
|
|
|
197
197
|
float core = smoothstep(0.4, 0.0, r); float halo = pow(1.0 - r, 2.4);
|
|
198
198
|
gl_FragColor = vec4(vC * (core * 1.25 + halo * 0.4), 1.0); }`
|
|
199
199
|
);
|
|
200
|
-
function
|
|
201
|
-
const n = P(() => ({ nodes: e.nodes.slice(0,
|
|
200
|
+
function kt({ galaxy: e }) {
|
|
201
|
+
const n = P(() => ({ nodes: e.nodes.slice(0, Gt), links: e.links }), [e]), r = n.nodes.length, { size: o, gl: c, camera: h } = Re(), p = T([]), y = T([]), x = T(Array(Te).fill("")), z = T([]), M = P(() => {
|
|
202
202
|
const s = new Float32Array(r * 3), f = -0.18, m = Math.cos(f), w = Math.sin(f);
|
|
203
203
|
n.nodes.forEach((R, j) => {
|
|
204
204
|
const I = X(R.id, 1);
|
|
205
|
-
let
|
|
205
|
+
let Z, O;
|
|
206
206
|
if (I < 0.22) {
|
|
207
207
|
const Y = 0.22 * Math.sqrt(-2 * Math.log(1 - X(R.id, 2) * 0.95)) * 0.6, $ = X(R.id, 3) * Math.PI * 2;
|
|
208
|
-
|
|
208
|
+
Z = Math.cos($) * Y * _e, O = Math.sin($) * Y * Be;
|
|
209
209
|
} else {
|
|
210
210
|
const Y = I < 0.61 ? 0 : Math.PI, $ = 0.12 + 0.88 * Math.sqrt(X(R.id, 2)), ae = Y + $ * 3.1 + (X(R.id, 3) - 0.5) * (0.6 + $ * 0.7), te = 1 + (X(R.id, 7) - 0.5) * 0.35;
|
|
211
|
-
|
|
211
|
+
Z = Math.cos(ae) * $ * _e * 0.95 * te, O = Math.sin(ae) * $ * Be * 0.95 * te;
|
|
212
212
|
}
|
|
213
|
-
s.set([
|
|
213
|
+
s.set([Z * m - O * w, Z * w + O * m, (X(R.id, 4) - 0.5) * 4], j * 3);
|
|
214
214
|
});
|
|
215
|
-
const B = n.nodes.map((R) => new t.Color(ft[R.kind] ?? "#94a3b8").lerp(
|
|
215
|
+
const B = n.nodes.map((R) => new t.Color(ft[R.kind] ?? "#94a3b8").lerp(Ft, 0.45).multiplyScalar(1)), U = n.nodes.map((R) => 0.42 + Math.pow(X(R.id, 5), 4) * 0.55), V = new t.BufferGeometry();
|
|
216
216
|
V.setAttribute("position", new t.BufferAttribute(s, 3)), V.setAttribute("aSize", new t.BufferAttribute(new Float32Array(r), 1)), V.setAttribute("aColor", new t.BufferAttribute(new Float32Array(r * 3), 3));
|
|
217
217
|
const k = new Map(n.nodes.map((R, j) => [R.id, j])), E = [], F = new t.Vector3(), G = new t.Vector3();
|
|
218
218
|
for (const R of n.links) {
|
|
@@ -225,24 +225,24 @@ function It({ galaxy: e }) {
|
|
|
225
225
|
return D.setAttribute("position", new t.BufferAttribute(_, 3)), D.setAttribute("color", new t.BufferAttribute(new Float32Array(E.length * 3), 3)), { pos: s, base: B, baseSize: U, ngeo: V, lgeo: D, owner: Int32Array.from(E), fire: new Float32Array(r), white: new Float32Array(r), fireC: Array.from({ length: r }, () => new t.Color()), phase: n.nodes.map((R) => X(R.id, 6) * 6.283) };
|
|
226
226
|
}, [n, r]), b = P(
|
|
227
227
|
() => ({
|
|
228
|
-
gas: new t.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uAct: { value: 0 } }, vertexShader:
|
|
229
|
-
nodes: new t.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader:
|
|
228
|
+
gas: new t.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uAct: { value: 0 } }, vertexShader: Et, fragmentShader: It, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending }),
|
|
229
|
+
nodes: new t.ShaderMaterial({ uniforms: { uScale: { value: 400 } }, vertexShader: Lt, fragmentShader: Nt, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending }),
|
|
230
230
|
fil: new t.LineBasicMaterial({ vertexColors: !0, transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
|
|
231
231
|
ripples: Array.from({ length: Ie }, () => le(ot(), "#000"))
|
|
232
232
|
}),
|
|
233
233
|
[]
|
|
234
|
-
), u = P(() => new De(Ee, 24), []), S = P(() => new ze(Ee), []), a = P(() => new Fe(Ee), []), l = P(() => /* @__PURE__ */ new Map(), [n]), i = P(() => ({ v: new t.Vector3(), w: new t.Vector3(), ctrl: new t.Vector3(), h: new t.Vector3(), c: new t.Color(), act: 0 }), []),
|
|
234
|
+
), u = P(() => new De(Ee, 24), []), S = P(() => new ze(Ee), []), a = P(() => new Fe(Ee), []), l = P(() => /* @__PURE__ */ new Map(), [n]), i = P(() => ({ v: new t.Vector3(), w: new t.Vector3(), ctrl: new t.Vector3(), h: new t.Vector3(), c: new t.Color(), act: 0 }), []), A = (s) => {
|
|
235
235
|
let f = l.get(s);
|
|
236
236
|
return f === void 0 && l.set(s, f = ht(n, s)), f;
|
|
237
237
|
};
|
|
238
238
|
return se(({ clock: s }) => {
|
|
239
239
|
const f = performance.now(), m = Math.max(1e-4, je.graph.scale), w = Q ? 0 : s.elapsedTime, B = h.fov, U = c.getPixelRatio();
|
|
240
240
|
b.nodes.uniforms.uScale.value = o.height * U / (2 * Math.tan(B * Math.PI / 360)) * je.graph.scale * 2.1, a.setScale(o.height, U, B);
|
|
241
|
-
const { pos: V, base: k, baseSize: E, fire: F, white: G, fireC: _, phase: D } = M, { v: R, w: j, ctrl: I, h:
|
|
241
|
+
const { pos: V, base: k, baseSize: E, fire: F, white: G, fireC: _, phase: D } = M, { v: R, w: j, ctrl: I, h: Z, c: O } = i;
|
|
242
242
|
F.fill(0), G.fill(0), u.begin(), S.begin(), a.begin();
|
|
243
243
|
let Y = 0, $ = 0;
|
|
244
244
|
for (const v of N.flares) {
|
|
245
|
-
const C =
|
|
245
|
+
const C = A(v.node), W = (f - v.start) / 1e3, me = N.instances.get(v.instance), ue = me ? Oe[me.type] : Ce, oe = v.op === "write", ee = W < 0.3 ? W / 0.3 : Math.exp(-(W - 0.3) * 1.1);
|
|
246
246
|
if ($ = Math.max($, ee), ee > F[C] && (F[C] = ee, _[C].copy(oe ? K : ue), G[C] = oe ? 1 : 0), R.fromArray(V, C * 3), oe && W < 1.6 && Y < Ie) {
|
|
247
247
|
const re = z.current[Y];
|
|
248
248
|
if (re) {
|
|
@@ -255,7 +255,7 @@ function It({ galaxy: e }) {
|
|
|
255
255
|
if (ne && W < 2) {
|
|
256
256
|
ut(R, j), be(ne, j, 1.2, 2.5, I);
|
|
257
257
|
const re = Math.min(1, W / 0.25) * Math.pow(1 - W / 2, 1.5), ie = oe ? Math.min(1, W * 0.9) : 1 - Math.min(1, W * 0.9);
|
|
258
|
-
O.copy(oe ? K : ue).lerp(K, 0.2), u.add(ne, I, j, O, (oe ? 0.55 : 0.4) * re, 0.04, 0.99, 0, 1, w, ie, 1.9 * re), ie > 0.02 && ie < 0.98 && (fe(ne, I, j, ie,
|
|
258
|
+
O.copy(oe ? K : ue).lerp(K, 0.2), u.add(ne, I, j, O, (oe ? 0.55 : 0.4) * re, 0.04, 0.99, 0, 1, w, ie, 1.9 * re), ie > 0.02 && ie < 0.98 && (fe(ne, I, j, ie, Z), a.add(Z, 0.7, O, 1.6 * re)), oe ? S.add(ne, I, j, 0.95, 1, 0.4, K, re * 1.2) : S.add(ne, I, j, 0.07, -1, 0.4, O, re * 1.5);
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
for (let v = Y; v < Ie; v++) {
|
|
@@ -280,20 +280,20 @@ function It({ galaxy: e }) {
|
|
|
280
280
|
const C = N.flares[v];
|
|
281
281
|
if (f - C.start > 2200) break;
|
|
282
282
|
let W = !1;
|
|
283
|
-
for (let ee = 0; ee < J; ee++)
|
|
283
|
+
for (let ee = 0; ee < J; ee++) x.current[ee] === C.node && (W = !0);
|
|
284
284
|
if (W) continue;
|
|
285
|
-
const me =
|
|
285
|
+
const me = A(C.node);
|
|
286
286
|
for (let ee = 0; ee < J; ee++) {
|
|
287
287
|
const ne = y.current[ee];
|
|
288
288
|
ne && Math.abs(ne.position.y - V[me * 3 + 1]) < 0.9 / m && Math.abs(ne.position.x - V[me * 3]) < 4.5 / m && (W = !0);
|
|
289
289
|
}
|
|
290
290
|
if (W) continue;
|
|
291
291
|
const ue = p.current[J], oe = y.current[J];
|
|
292
|
-
ue && oe && (oe.position.fromArray(V, me * 3),
|
|
292
|
+
ue && oe && (oe.position.fromArray(V, me * 3), x.current[J] !== C.node && (ue.setText(`${C.op === "write" ? "wrote" : "read"} · ${C.node}`), ue.setColor(C.op === "write" ? "#ffffff" : "#9db4ff")), ue.setOpacity(H(1.4 - (f - C.start) / 1600))), x.current[J] = C.node, J++;
|
|
293
293
|
}
|
|
294
294
|
for (let v = J; v < Te; v++) {
|
|
295
295
|
const C = p.current[v];
|
|
296
|
-
C == null || C.setOpacity(0),
|
|
296
|
+
C == null || C.setOpacity(0), x.current[v] = "";
|
|
297
297
|
}
|
|
298
298
|
}), /* @__PURE__ */ q(de, { children: [
|
|
299
299
|
/* @__PURE__ */ g("mesh", { material: b.gas, position: [0, 0, -1], rotation: [0, 0, -0.18], renderOrder: -5, children: /* @__PURE__ */ g("planeGeometry", { args: [_e * 2.6, Be * 2.9] }) }),
|
|
@@ -309,7 +309,7 @@ function It({ galaxy: e }) {
|
|
|
309
309
|
/* @__PURE__ */ g(pt, { position: [0, Be * 1.15, 0], suffix: " · nebula", color: "#8b9cff", letterSpacing: 0.04, size: 0.28, opacity: 0.85, pxRange: [8, 12] })
|
|
310
310
|
] });
|
|
311
311
|
}
|
|
312
|
-
const
|
|
312
|
+
const Ut = (
|
|
313
313
|
/* glsl */
|
|
314
314
|
`
|
|
315
315
|
varying vec3 vN; varying vec3 vV; varying vec3 vObj;
|
|
@@ -317,7 +317,7 @@ void main(){
|
|
|
317
317
|
vec4 wp = modelMatrix * vec4(position, 1.0);
|
|
318
318
|
vN = normalize(mat3(modelMatrix) * normal); vV = normalize(cameraPosition - wp.xyz); vObj = position;
|
|
319
319
|
gl_Position = projectionMatrix * viewMatrix * wp; }`
|
|
320
|
-
),
|
|
320
|
+
), Wt = (
|
|
321
321
|
/* glsl */
|
|
322
322
|
`
|
|
323
323
|
uniform vec3 uCol; uniform vec3 uAtmo; uniform float uAct; uniform float uBands; uniform float uSeed; uniform float uGlow;
|
|
@@ -342,27 +342,27 @@ void main(){
|
|
|
342
342
|
function rt(e, n, r, o) {
|
|
343
343
|
return new t.ShaderMaterial({
|
|
344
344
|
uniforms: { uCol: { value: e.clone() }, uAtmo: { value: n.clone() }, uAct: { value: 0 }, uBands: { value: r }, uSeed: { value: o }, uGlow: { value: 0 } },
|
|
345
|
-
vertexShader:
|
|
346
|
-
fragmentShader:
|
|
345
|
+
vertexShader: Ut,
|
|
346
|
+
fragmentShader: Wt
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
|
-
const Ze = new t.Color("#8792b5"), Le = 32,
|
|
350
|
-
function
|
|
351
|
-
const r = e.srv, o = n.res, c = P(() => new t.Color(r.color), [r.color]), h = P(() => rt(Ze, new t.Color(r.color).lerp(K, 0.3), 0, X(o.name, 6)), [r.color, o.name]), p = P(() => le(Pe(), "#000"), []), y = P(() => new t.LineBasicMaterial({ color: "#000", transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), []),
|
|
352
|
-
const
|
|
353
|
-
return
|
|
354
|
-
}, []), z = P(() => Object.assign(new t.Line(
|
|
355
|
-
se(({ clock:
|
|
349
|
+
const Ze = new t.Color("#8792b5"), Le = 32, Kt = 0.42, Se = new t.Vector3();
|
|
350
|
+
function Xt({ mcp: e, backend: n }) {
|
|
351
|
+
const r = e.srv, o = n.res, c = P(() => new t.Color(r.color), [r.color]), h = P(() => rt(Ze, new t.Color(r.color).lerp(K, 0.3), 0, X(o.name, 6)), [r.color, o.name]), p = P(() => le(Pe(), "#000"), []), y = P(() => new t.LineBasicMaterial({ color: "#000", transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 }), []), x = P(() => {
|
|
352
|
+
const A = new t.BufferGeometry().setAttribute("position", new t.BufferAttribute(new Float32Array((Le + 1) * 3), 3));
|
|
353
|
+
return A.boundingSphere = new t.Sphere(new t.Vector3(), 1e4), A;
|
|
354
|
+
}, []), z = P(() => Object.assign(new t.Line(x, y), { frustumCulled: !1 }), [x, y]), M = P(() => X(o.name, 5) < 0.5 ? 1 : -1, [o.name]), b = T(null), u = T(null), S = T(null), a = T(null), l = T("");
|
|
355
|
+
se(({ clock: A }) => {
|
|
356
356
|
var k, E;
|
|
357
357
|
const d = performance.now();
|
|
358
|
-
(k = b.current) == null || k.position.copy(n.pos), u.current && !Q && (u.current.rotation.y =
|
|
359
|
-
const s = Math.hypot(Se.x, Se.y), f = Math.atan2(Se.y, Se.x), m =
|
|
358
|
+
(k = b.current) == null || k.position.copy(n.pos), u.current && !Q && (u.current.rotation.y = A.elapsedTime * 0.3 * M), Se.subVectors(n.pos, e.pos);
|
|
359
|
+
const s = Math.hypot(Se.x, Se.y), f = Math.atan2(Se.y, Se.x), m = x.getAttribute("position");
|
|
360
360
|
for (let F = 0; F <= Le; F++) {
|
|
361
|
-
const G = f + (F / Le - 0.5) * 2 *
|
|
361
|
+
const G = f + (F / Le - 0.5) * 2 * Kt;
|
|
362
362
|
m.setXYZ(F, e.pos.x + Math.cos(G) * s, e.pos.y + Math.sin(G) * s, n.pos.z);
|
|
363
363
|
}
|
|
364
364
|
m.needsUpdate = !0;
|
|
365
|
-
const w = o.inflight > 0, B = tt(o.activeAt, d, 1.4), U = w ? 0.5 + 0.5 * Math.sin(
|
|
365
|
+
const w = o.inflight > 0, B = tt(o.activeAt, d, 1.4), U = w ? 0.5 + 0.5 * Math.sin(A.elapsedTime * 5) : 0;
|
|
366
366
|
h.uniforms.uAct.value = w ? 1 : B, h.uniforms.uGlow.value = w ? 0.8 + U * 0.5 : B * 0.6, h.uniforms.uCol.value.copy(Ze).lerp(c, w ? 0.6 : B * 0.5), p.color.copy(c).lerp(K, 0.3).multiplyScalar(w ? 0.55 + U * 0.25 : B * 0.35), (E = S.current) == null || E.scale.setScalar(w ? 2.6 + U * 0.4 : 1.6 + B), y.color.copy(c).lerp(K, 0.3).multiplyScalar(0.16 + (w ? 0.2 : B * 0.12));
|
|
367
367
|
let V = o.name;
|
|
368
368
|
if (w) {
|
|
@@ -382,7 +382,7 @@ function Ut({ mcp: e, backend: n }) {
|
|
|
382
382
|
] })
|
|
383
383
|
] });
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Dt({ mcp: e }) {
|
|
386
386
|
const n = e.srv, r = P(() => new t.Color(n.color), [n.color]), o = P(() => X(n.name, 7), [n.name]), c = 0.72 + o * 0.28, h = X(n.name, 8) > 0.45, p = P(
|
|
387
387
|
() => ({
|
|
388
388
|
body: rt(r.clone().lerp(new t.Color("#8090c0"), 0.35).multiplyScalar(0.45), r.clone().lerp(K, 0.25).multiplyScalar(0.7), 1, o),
|
|
@@ -390,13 +390,13 @@ function Wt({ mcp: e }) {
|
|
|
390
390
|
ring: new t.MeshBasicMaterial({ color: r.clone().lerp(K, 0.4).multiplyScalar(0.22), side: t.DoubleSide, transparent: !0, blending: t.AdditiveBlending, depthWrite: !1, toneMapped: !1 })
|
|
391
391
|
}),
|
|
392
392
|
[r, o]
|
|
393
|
-
), y = P(() => new t.RingGeometry(c * 1.4, c * 1.9, 96, 1), [c]),
|
|
393
|
+
), y = P(() => new t.RingGeometry(c * 1.4, c * 1.9, 96, 1), [c]), x = T(null), z = T(null), M = T(null);
|
|
394
394
|
return se(({ clock: b }) => {
|
|
395
395
|
var l, i;
|
|
396
|
-
(l =
|
|
396
|
+
(l = x.current) == null || l.position.copy(e.pos);
|
|
397
397
|
const u = performance.now(), S = n.inflight > 0, a = tt(n.activeAt, u, 1.4);
|
|
398
398
|
p.body.uniforms.uAct.value = S ? 1 : a, p.halo.color.copy(r).multiplyScalar(S ? 0.28 : 0.07 + a * 0.18), (i = M.current) == null || i.scale.setScalar(c * (5 + (S ? 0.6 : 0))), z.current && !Q && (z.current.rotation.y = b.elapsedTime * 0.05);
|
|
399
|
-
}), /* @__PURE__ */ q("group", { ref:
|
|
399
|
+
}), /* @__PURE__ */ q("group", { ref: x, children: [
|
|
400
400
|
/* @__PURE__ */ g("sprite", { ref: M, material: p.halo }),
|
|
401
401
|
/* @__PURE__ */ q("group", { rotation: [0.25, 0, -0.32 + o * 0.3], children: [
|
|
402
402
|
/* @__PURE__ */ g("mesh", { ref: z, geometry: Xe, material: p.body, scale: c }),
|
|
@@ -406,18 +406,18 @@ function Wt({ mcp: e }) {
|
|
|
406
406
|
] });
|
|
407
407
|
}
|
|
408
408
|
const Ne = 48;
|
|
409
|
-
function
|
|
409
|
+
function qt() {
|
|
410
410
|
const { size: e, gl: n, camera: r } = Re(), o = P(() => new De(Ne, 36), []), c = P(() => new ze(Ne), []), h = P(() => new Fe(Ne), []), p = P(() => ({ a: new t.Vector3(), b: new t.Vector3(), c: new t.Vector3(), h: new t.Vector3(), col: new t.Color() }), []);
|
|
411
411
|
return se(({ clock: y }) => {
|
|
412
|
-
const
|
|
412
|
+
const x = performance.now(), z = Q ? 0 : y.elapsedTime;
|
|
413
413
|
h.setScale(e.height, n.getPixelRatio(), r.fov), o.begin(), c.begin(), h.begin();
|
|
414
414
|
const { a: M, b, c: u, h: S, col: a } = p;
|
|
415
415
|
for (const l of N.mcpPending.values()) {
|
|
416
|
-
const i = ce(l.instance),
|
|
417
|
-
if (!i || !d || !
|
|
418
|
-
b.copy(
|
|
419
|
-
const s = mt(l,
|
|
420
|
-
a.set(d.color).lerp(ke,
|
|
416
|
+
const i = ce(l.instance), A = qe(l.server), d = N.mcpServers.get(l.server);
|
|
417
|
+
if (!i || !d || !A) continue;
|
|
418
|
+
b.copy(A), M.copy(i), be(M, b, 1.5, 1.2, u);
|
|
419
|
+
const s = mt(l, x);
|
|
420
|
+
a.set(d.color).lerp(ke, H(s / 1.2)), s > 1.2 && a.lerp(zt, H((s - 1.2) / 1));
|
|
421
421
|
const f = (0.2 + Math.min(0.35, s * 0.15)) * we(s / 0.3), m = 0.06 + 0.86 * we(s / 0.45);
|
|
422
422
|
if (o.add(M, u, b, a, f, 0.06, m, 0.9, 1, z, s < 0.45 ? m : -1, 1.2), s > 0.45 && c.add(M, u, b, 0.9, 1, 0.42, a, 0.6 + f), l.resource) {
|
|
423
423
|
const w = Ye(l.server, l.resource);
|
|
@@ -426,18 +426,18 @@ function Kt() {
|
|
|
426
426
|
}
|
|
427
427
|
for (const l of N.mcpCalls) {
|
|
428
428
|
if (l.phase !== "result") continue;
|
|
429
|
-
const i =
|
|
429
|
+
const i = H((x - l.start) / l.dur);
|
|
430
430
|
if (i >= 1) continue;
|
|
431
|
-
const
|
|
432
|
-
if (!
|
|
431
|
+
const A = ce(l.instance), d = qe(l.server), s = N.mcpServers.get(l.server);
|
|
432
|
+
if (!A || !s || !d) continue;
|
|
433
433
|
b.copy(d), a.set(s.color).lerp(K, 0.4);
|
|
434
434
|
const f = l.resource ? Ye(l.server, l.resource) : void 0, m = f ? 0.3 : 0;
|
|
435
435
|
if (f && i < m) {
|
|
436
|
-
const w =
|
|
436
|
+
const w = xe(i / m);
|
|
437
437
|
be(b, f, 0.3, 0.2, u), o.add(b, u, f, a, 0.15, 0.12, 0.88, 0, 1, z, 1 - w, 1.4), fe(b, u, f, 1 - w, S), h.add(S, 0.6, a, 1.5);
|
|
438
438
|
} else {
|
|
439
|
-
const w =
|
|
440
|
-
M.copy(
|
|
439
|
+
const w = xe((i - m) / (1 - m));
|
|
440
|
+
M.copy(A), be(M, b, 1.5, 1.2, u);
|
|
441
441
|
const B = 1 - Math.max(0, (w - 0.85) / 0.15);
|
|
442
442
|
o.add(M, u, b, a, 0.22 * B, 0.06, 0.94, 0, 1, z, 1 - w, 1.6 * B), fe(M, u, b, 1 - w, S), h.add(S, 0.75, a, 1.6 * B), c.add(M, u, b, 0.08, -1, 0.45, a, 1.3 * B);
|
|
443
443
|
}
|
|
@@ -449,20 +449,20 @@ function Kt() {
|
|
|
449
449
|
/* @__PURE__ */ g("primitive", { object: h.obj })
|
|
450
450
|
] });
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function Yt({ run: e }) {
|
|
453
453
|
const n = P(() => new t.Color(e.color), [e.color]), r = P(() => le(Pe(), "#000"), []), o = T(null), c = T(null);
|
|
454
454
|
return se(({ clock: h }) => {
|
|
455
455
|
var S;
|
|
456
|
-
const p = performance.now(), y = e.run ?? N.runs.get(e.id),
|
|
457
|
-
r.color.copy(n).multiplyScalar(0.075 *
|
|
456
|
+
const p = performance.now(), y = e.run ?? N.runs.get(e.id), x = y ? we((p - y.startedAt) / 1500) : 1, z = y != null && y.endedAt ? H(1 - (p - y.endedAt - (vt - 2500)) / 2500) : 1, M = Q ? 1 : 0.9 + 0.1 * Math.sin(h.elapsedTime * 0.5 + e.index);
|
|
457
|
+
r.color.copy(n).multiplyScalar(0.075 * x * z * M);
|
|
458
458
|
const b = Math.abs(e.side.x) * e.hu + Math.abs(e.axis.x) * e.hv, u = Math.abs(e.side.y) * e.hu + Math.abs(e.axis.y) * e.hv;
|
|
459
459
|
o.current && (o.current.position.set(e.origin.x, e.origin.y, -3), o.current.scale.set(b * 2.8 + 6, u * 2.8 + 5, 1)), (S = c.current) == null || S.position.set(e.origin.x, e.origin.y + u + 0.7, 0);
|
|
460
460
|
}), /* @__PURE__ */ q(de, { children: [
|
|
461
461
|
/* @__PURE__ */ g("sprite", { ref: o, material: r }),
|
|
462
|
-
/* @__PURE__ */ g("group", { ref: c, children: e.run && /* @__PURE__ */ g(
|
|
462
|
+
/* @__PURE__ */ g("group", { ref: c, children: e.run && /* @__PURE__ */ g($t, { run: e.run }) })
|
|
463
463
|
] });
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function $t({ run: e }) {
|
|
466
466
|
gt();
|
|
467
467
|
const n = e.status !== "started" || bt(e);
|
|
468
468
|
return /* @__PURE__ */ g(
|
|
@@ -485,11 +485,11 @@ function Dt({ run: e }) {
|
|
|
485
485
|
}
|
|
486
486
|
);
|
|
487
487
|
}
|
|
488
|
-
const ve = 6, Me = 6, ge = 28,
|
|
489
|
-
function
|
|
490
|
-
const { size: e, gl: n, camera: r } = Re(), o = T(/* @__PURE__ */ new Set()), c = T([]), h = T([]), p = T([]), y = T([]),
|
|
488
|
+
const ve = 6, Me = 6, ge = 28, Ae = 3, Zt = 2.2;
|
|
489
|
+
function Ht() {
|
|
490
|
+
const { size: e, gl: n, camera: r } = Re(), o = T(/* @__PURE__ */ new Set()), c = T([]), h = T([]), p = T([]), y = T([]), x = P(() => {
|
|
491
491
|
const u = new t.BufferGeometry();
|
|
492
|
-
return u.setAttribute("position", new t.BufferAttribute(new Float32Array(ve *
|
|
492
|
+
return u.setAttribute("position", new t.BufferAttribute(new Float32Array(ve * Ae * ge * 6), 3)), u.setAttribute("color", new t.BufferAttribute(new Float32Array(ve * Ae * ge * 6), 3)), u.boundingSphere = new t.Sphere(new t.Vector3(), 1e4), u;
|
|
493
493
|
}, []), z = P(() => nt(), []), M = P(() => new Fe(ve * (2 + Me)), []), b = P(() => ({ h: new t.Vector3(), p: new t.Vector3() }), []);
|
|
494
494
|
return se(() => {
|
|
495
495
|
const u = performance.now();
|
|
@@ -506,9 +506,9 @@ function Yt() {
|
|
|
506
506
|
if (o.current.size > 200)
|
|
507
507
|
for (const d of o.current) N.runs.has(d) || o.current.delete(d);
|
|
508
508
|
c.current = c.current.filter((d) => u - d.start < 5200), M.setScale(e.height, n.getPixelRatio(), r.fov), M.begin();
|
|
509
|
-
const S =
|
|
509
|
+
const S = x.getAttribute("position"), a = x.getAttribute("color");
|
|
510
510
|
let l = 0;
|
|
511
|
-
const { h: i, p:
|
|
511
|
+
const { h: i, p: A } = b;
|
|
512
512
|
for (let d = 0; d < ve; d++) {
|
|
513
513
|
const s = c.current[d], f = h.current[d], m = p.current[d];
|
|
514
514
|
if (!s) {
|
|
@@ -516,39 +516,39 @@ function Yt() {
|
|
|
516
516
|
continue;
|
|
517
517
|
}
|
|
518
518
|
const w = (u - s.start) / 1e3;
|
|
519
|
-
f && m && (m.position.copy(s.from).add(
|
|
520
|
-
const B = w /
|
|
519
|
+
f && m && (m.position.copy(s.from).add(A.set(0, -2.3, 0)), y.current[d] !== s.run + s.start && (y.current[d] = s.run + s.start, f.setText(`final answer - ${s.text.length > 64 ? s.text.slice(0, 62) + "…" : s.text}`)), f.setOpacity(H(w / 0.3) * H((5.2 - w) / 1.2)));
|
|
520
|
+
const B = w / Zt;
|
|
521
521
|
if (B >= 1.25) continue;
|
|
522
522
|
const U = s.travel * (Q ? 0.6 : 1), V = U * we(Math.min(1, B)), k = Math.min(7.5, U * 0.4) * Math.min(1, B * 3) * (B > 1 ? Math.max(0, 1 - (B - 1) / 0.25) : 1), E = B > 1 ? Math.max(0, 1 - (B - 1) / 0.25) : 1, F = -s.dir.y, G = s.dir.x;
|
|
523
|
-
for (let _ = 0; _ <
|
|
523
|
+
for (let _ = 0; _ < Ae; _++)
|
|
524
524
|
for (let D = 0; D < ge; D++)
|
|
525
525
|
for (let R = 0; R < 2; R++) {
|
|
526
526
|
const j = (D + R) / ge, I = (_ - 1) * 0.05 * (1 - j);
|
|
527
|
-
|
|
528
|
-
const
|
|
529
|
-
S.setXYZ(
|
|
527
|
+
A.copy(s.from).addScaledVector(s.dir, V - k * (1 - j));
|
|
528
|
+
const Z = ((l * Ae + _) * ge + D) * 2 + R;
|
|
529
|
+
S.setXYZ(Z, A.x + F * I, A.y + G * I, A.z);
|
|
530
530
|
const O = Math.pow(j, 2) * (_ === 1 ? 2.6 : 1.2) * E;
|
|
531
|
-
a.setXYZ(
|
|
531
|
+
a.setXYZ(Z, s.color.r * O, s.color.g * O, s.color.b * O);
|
|
532
532
|
}
|
|
533
533
|
l++, i.copy(s.from).addScaledVector(s.dir, V), M.add(i, 1.3, K, 1.6 * E), M.add(i, 3.2, Ce, 0.35 * E);
|
|
534
534
|
for (let _ = 1; _ <= Me; _++) {
|
|
535
535
|
const D = _ / Me * k;
|
|
536
|
-
|
|
536
|
+
A.copy(s.from).addScaledVector(s.dir, V - D), A.y += Math.sin(_ * 2.3 + s.start) * 0.08, M.add(A, 0.5 * (1 - _ / (Me + 1)), s.color, 0.9 * E * (1 - _ / (Me + 1)));
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
|
|
539
|
+
x.setDrawRange(0, l * Ae * ge * 2), S.needsUpdate = !0, a.needsUpdate = !0, M.end();
|
|
540
540
|
}), /* @__PURE__ */ q(de, { children: [
|
|
541
|
-
/* @__PURE__ */ g("lineSegments", { geometry:
|
|
541
|
+
/* @__PURE__ */ g("lineSegments", { geometry: x, material: z, frustumCulled: !1 }),
|
|
542
542
|
/* @__PURE__ */ g("primitive", { object: M.obj }),
|
|
543
543
|
Array.from({ length: ve }, (u, S) => /* @__PURE__ */ g("group", { ref: (a) => void (p.current[S] = a), children: /* @__PURE__ */ g(ye, { ref: (a) => void (h.current[S] = a), text: "", color: "#e0e7ff", size: 0.26, maxWidth: 11, opacity: 0, pxRange: [8, 12], renderOrder: 24 }) }, S))
|
|
544
544
|
] });
|
|
545
545
|
}
|
|
546
|
-
const
|
|
546
|
+
const Jt = (
|
|
547
547
|
/* glsl */
|
|
548
548
|
`
|
|
549
549
|
varying vec3 vDir;
|
|
550
550
|
void main(){ vDir = normalize(position); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`
|
|
551
|
-
),
|
|
551
|
+
), Qt = (
|
|
552
552
|
/* glsl */
|
|
553
553
|
`
|
|
554
554
|
varying vec3 vDir;
|
|
@@ -573,7 +573,7 @@ void main(){
|
|
|
573
573
|
col += band * max(vec3(0.0), vec3(0.010, 0.012, 0.03) * (0.3 + dust * dust * 1.4) - vec3(0.006, 0.007, 0.014) * lanes);
|
|
574
574
|
gl_FragColor = vec4(col, 1.0);
|
|
575
575
|
}`
|
|
576
|
-
),
|
|
576
|
+
), eo = (
|
|
577
577
|
/* glsl */
|
|
578
578
|
`
|
|
579
579
|
attribute float aSize; attribute float aPhase; attribute vec3 aColor;
|
|
@@ -585,7 +585,7 @@ void main(){
|
|
|
585
585
|
gl_PointSize = max(1.0, aSize * uScale / -mv.z);
|
|
586
586
|
gl_Position = projectionMatrix * mv;
|
|
587
587
|
}`
|
|
588
|
-
),
|
|
588
|
+
), to = (
|
|
589
589
|
/* glsl */
|
|
590
590
|
`
|
|
591
591
|
varying vec3 vC;
|
|
@@ -593,28 +593,28 @@ void main(){ float r = length(gl_PointCoord - 0.5) * 2.0; if (r > 1.0) discard;
|
|
|
593
593
|
float core = smoothstep(0.5, 0.0, r); float halo = pow(1.0 - r, 3.0);
|
|
594
594
|
gl_FragColor = vec4(vC * (core + halo * 0.35), 1.0); }`
|
|
595
595
|
), He = ["#ffffff", "#dbe7ff", "#b9cdff", "#9fb8ff", "#fff3dd", "#ffe2bf"].map((e) => new t.Color(e));
|
|
596
|
-
function
|
|
596
|
+
function oo() {
|
|
597
597
|
const { size: e, gl: n, camera: r } = Re(), o = P(() => {
|
|
598
|
-
const p = Q ? 1600 : 3200, y = new Float32Array(p * 3),
|
|
598
|
+
const p = Q ? 1600 : 3200, y = new Float32Array(p * 3), x = new Float32Array(p), z = new Float32Array(p), M = new Float32Array(p * 3), b = new t.Vector3(0.42, 0.9, -0.12).normalize(), u = new t.Vector3();
|
|
599
599
|
let S = 1234567;
|
|
600
600
|
const a = () => (S = S * 16807 % 2147483647) / 2147483647;
|
|
601
601
|
for (let i = 0; i < p; i++) {
|
|
602
602
|
for (let m = 0; m < 8 && (u.set(a() * 2 - 1, a() * 2 - 1, a() * 2 - 1), !(!(u.lengthSq() > 1 || u.lengthSq() < 0.01) && (u.normalize(), !(i % 5 < 2 && Math.abs(u.dot(b)) > 0.22)))); m++)
|
|
603
603
|
;
|
|
604
604
|
u.z > 0.3 && (u.z *= -1);
|
|
605
|
-
const
|
|
606
|
-
y.set([u.x *
|
|
605
|
+
const A = 110 + a() * 60;
|
|
606
|
+
y.set([u.x * A, u.y * A, u.z * A], i * 3);
|
|
607
607
|
const d = Math.pow(a(), 3.2);
|
|
608
|
-
|
|
608
|
+
x[i] = 0.55 + d * 2.6, z[i] = a();
|
|
609
609
|
const s = He[Math.floor(a() * He.length)], f = 0.22 + d * 0.75;
|
|
610
610
|
M.set([s.r * f, s.g * f, s.b * f], i * 3);
|
|
611
611
|
}
|
|
612
612
|
const l = new t.BufferGeometry();
|
|
613
|
-
return l.setAttribute("position", new t.BufferAttribute(y, 3)), l.setAttribute("aSize", new t.BufferAttribute(
|
|
613
|
+
return l.setAttribute("position", new t.BufferAttribute(y, 3)), l.setAttribute("aSize", new t.BufferAttribute(x, 1)), l.setAttribute("aPhase", new t.BufferAttribute(z, 1)), l.setAttribute("aColor", new t.BufferAttribute(M, 3)), l;
|
|
614
614
|
}, []), c = P(
|
|
615
615
|
() => ({
|
|
616
|
-
dome: new t.ShaderMaterial({ vertexShader:
|
|
617
|
-
stars: new t.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uScale: { value: 400 } }, vertexShader:
|
|
616
|
+
dome: new t.ShaderMaterial({ vertexShader: Jt, fragmentShader: Qt, side: t.BackSide, depthWrite: !1 }),
|
|
617
|
+
stars: new t.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uScale: { value: 400 } }, vertexShader: eo, fragmentShader: to, transparent: !0, depthWrite: !1, blending: t.AdditiveBlending })
|
|
618
618
|
}),
|
|
619
619
|
[]
|
|
620
620
|
), h = T(null);
|
|
@@ -626,12 +626,12 @@ function Qt() {
|
|
|
626
626
|
/* @__PURE__ */ g("points", { geometry: o, material: c.stars, frustumCulled: !1, renderOrder: -9 })
|
|
627
627
|
] });
|
|
628
628
|
}
|
|
629
|
-
const
|
|
630
|
-
function
|
|
631
|
-
const o = e.inst, c = T(null), h = T(null), p = T(null), y = T(null),
|
|
629
|
+
const no = new t.Color("#6f7fb8"), ro = new t.Color("#ff6b7a"), Ue = 0.95, so = new t.MeshBasicMaterial({ colorWrite: !1, depthWrite: !1, transparent: !0, opacity: 0 });
|
|
630
|
+
function ao({ agent: e, selected: n, onSelect: r }) {
|
|
631
|
+
const o = e.inst, c = T(null), h = T(null), p = T(null), y = T(null), x = T(null), z = T(null), M = T(null), b = T(null), u = T(null), S = P(() => [...o.id].reduce((s, f) => (s * 31 + f.charCodeAt(0)) % 9973, 7) / 9973, [o.id]), a = Oe[o.type], l = P(
|
|
632
632
|
() => ({
|
|
633
633
|
halo: le(Pe(), a),
|
|
634
|
-
spikes: le(
|
|
634
|
+
spikes: le(Tt(), a),
|
|
635
635
|
core: le(Pe(), "#fff"),
|
|
636
636
|
flare: le(ot(), a),
|
|
637
637
|
corona: new t.MeshBasicMaterial({ color: ke, blending: t.AdditiveBlending, transparent: !0, depthWrite: !1, toneMapped: !1 }),
|
|
@@ -643,7 +643,7 @@ function no({ agent: e, selected: n, onSelect: r }) {
|
|
|
643
643
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
644
644
|
[]
|
|
645
645
|
);
|
|
646
|
-
|
|
646
|
+
Pt(() => {
|
|
647
647
|
l.spikes.rotation = (S - 0.5) * 0.5;
|
|
648
648
|
}, [l, S]), se(({ clock: s }) => {
|
|
649
649
|
var he, J;
|
|
@@ -651,42 +651,42 @@ function no({ agent: e, selected: n, onSelect: r }) {
|
|
|
651
651
|
e.live.set(e.pos.x + Math.sin(m * 0.21 + S * 20) * w, e.pos.y + Math.cos(m * 0.17 + S * 13) * w, e.pos.z);
|
|
652
652
|
const B = e.scale;
|
|
653
653
|
c.current && (c.current.position.copy(e.live), c.current.scale.setScalar(Math.max(1e-4, B))), (he = b.current) == null || he.position.set(e.live.x, e.live.y - 0.95 * B - 0.35, e.live.z);
|
|
654
|
-
const U = (f - o.bornAt) / 1e3, V = o.parent && N.instances.has(o.parent) ? Ue * 0.85 : 0.05, k =
|
|
654
|
+
const U = (f - o.bornAt) / 1e3, V = o.parent && N.instances.has(o.parent) ? Ue * 0.85 : 0.05, k = H((U - V) / 0.55), E = we(k), F = k > 0 ? Math.exp(-(U - V) * 3.2) : 0, G = o.exitAt ? (f - o.exitAt) / 1e3 : -1, _ = G >= 0 ? xe(G / 0.7) : 0, D = G >= 0 ? H((G - 0.7) / 1.7) : 0, R = G < 0;
|
|
655
655
|
o.llmCalls !== i.calls && (i.calls = o.llmCalls, i.flareAt = f, i.flareK = o.pulse);
|
|
656
656
|
const j = (f - i.flareAt) / 1e3, I = yt(o, f);
|
|
657
|
-
let
|
|
658
|
-
for (const v of N.mcpPending.values()) v.instance === o.id && (
|
|
657
|
+
let Z = !1;
|
|
658
|
+
for (const v of N.mcpPending.values()) v.instance === o.id && (Z = !0);
|
|
659
659
|
const O = R && (o.status === "thinking" || o.status === "spawning"), Y = Q ? 0 : 1, $ = 1 + (O ? 0.16 : 0.05) * Math.sin(m * 3.3 + S * 40) * Math.sin(m * 1.9 + S * 17) * Y, ae = (O ? 1 : 0.62) * $ + I * 0.25 + F * 1.2;
|
|
660
|
-
i.c.copy(a), R || i.c.lerp(o.status === "failed" ?
|
|
660
|
+
i.c.copy(a), R || i.c.lerp(o.status === "failed" ? ro : no, _);
|
|
661
661
|
const te = (1 - _ * 0.8) * (1 - D), pe = E * (1 - _ * 0.62);
|
|
662
662
|
if (y.current && (y.current.scale.setScalar(Math.max(1e-4, pe * (0.95 + I * 0.12))), l.core.color.copy(K).lerp(i.c, _).multiplyScalar(Math.min(1.6, ae) * te)), h.current && (h.current.scale.setScalar(Math.max(1e-4, pe * (O ? 3.4 : 2.7) * (1 + I * 0.18))), l.halo.color.copy(i.c).multiplyScalar(0.42 * ae * te)), p.current) {
|
|
663
663
|
const v = j < 1.2 ? Math.exp(-j * 2.6) * i.flareK * 0.5 : 0, C = (O ? 1 : 0.55) * (1 - _);
|
|
664
664
|
p.current.scale.setScalar(Math.max(1e-4, pe * (3 + I * 1.2 + v * 4 + F * 3))), l.spikes.color.copy(i.c).lerp(K, 0.3).multiplyScalar((0.55 * C * $ + I * 0.25 + v * 0.6 + F) * te);
|
|
665
665
|
}
|
|
666
|
-
if (
|
|
666
|
+
if (x.current) {
|
|
667
667
|
const v = j < 1.1 && R;
|
|
668
|
-
if (
|
|
668
|
+
if (x.current.visible = v, v) {
|
|
669
669
|
const C = we(j / 1.1);
|
|
670
|
-
|
|
670
|
+
x.current.scale.setScalar(0.8 + C * (1.6 + i.flareK * 1.4)), l.flare.color.copy(i.c).lerp(K, 0.4).multiplyScalar((1 - C) * (1 - C) * (0.35 + i.flareK * 0.3));
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
-
if (i.coronaK += ((
|
|
673
|
+
if (i.coronaK += ((Z && R ? 1 : 0) - i.coronaK) * 0.08, z.current) {
|
|
674
674
|
z.current.visible = i.coronaK > 0.02;
|
|
675
675
|
const v = 0.75 + 0.25 * Math.sin(m * 2.4) * Y;
|
|
676
676
|
z.current.scale.setScalar(0.95 + 0.06 * v), z.current.rotation.z = m * 0.6 * Y, l.corona.color.copy(ke).multiplyScalar(1.4 * i.coronaK * v);
|
|
677
677
|
}
|
|
678
678
|
i.selK += ((n ? 1 : 0) - i.selK) * 0.12, M.current && (M.current.visible = i.selK > 0.02, M.current.scale.setScalar(1.1 + (1 - i.selK) * 0.5), l.sel.color.setScalar(0.9 * i.selK * te)), (J = u.current) == null || J.setOpacity(St(o.id) ? E * (R ? 0.95 : 0.6 * (1 - D)) : 0);
|
|
679
679
|
});
|
|
680
|
-
const
|
|
680
|
+
const A = (s) => {
|
|
681
681
|
s.stopPropagation(), r(o.id);
|
|
682
682
|
}, d = o.id.split(":")[2];
|
|
683
683
|
return /* @__PURE__ */ q(de, { children: [
|
|
684
684
|
/* @__PURE__ */ q("group", { ref: c, scale: 1e-4, children: [
|
|
685
|
-
/* @__PURE__ */ g("mesh", { geometry: Xe, material:
|
|
685
|
+
/* @__PURE__ */ g("mesh", { geometry: Xe, material: so, scale: 0.75, onClick: A, onPointerOver: () => document.body.style.cursor = "pointer", onPointerOut: () => document.body.style.cursor = "" }),
|
|
686
686
|
/* @__PURE__ */ g("sprite", { ref: h, material: l.halo, scale: 1e-4 }),
|
|
687
687
|
/* @__PURE__ */ g("sprite", { ref: p, material: l.spikes, scale: 1e-4 }),
|
|
688
688
|
/* @__PURE__ */ g("sprite", { ref: y, material: l.core, scale: 1e-4 }),
|
|
689
|
-
/* @__PURE__ */ g("sprite", { ref:
|
|
689
|
+
/* @__PURE__ */ g("sprite", { ref: x, material: l.flare, visible: !1 }),
|
|
690
690
|
/* @__PURE__ */ g("mesh", { ref: z, geometry: $e, material: l.corona, visible: !1 }),
|
|
691
691
|
/* @__PURE__ */ g("mesh", { ref: M, geometry: $e, material: l.sel, visible: !1 })
|
|
692
692
|
] }),
|
|
@@ -695,6 +695,7 @@ function no({ agent: e, selected: n, onSelect: r }) {
|
|
|
695
695
|
{
|
|
696
696
|
ref: u,
|
|
697
697
|
text: `${o.name}${d !== void 0 ? ` ${Number(d) + 1}` : ""}`,
|
|
698
|
+
live: o.job ? () => Mt(o) : null,
|
|
698
699
|
color: We[o.type],
|
|
699
700
|
size: o.subagent ? 0.22 : 0.28,
|
|
700
701
|
letterSpacing: 0.02,
|
|
@@ -706,22 +707,22 @@ function no({ agent: e, selected: n, onSelect: r }) {
|
|
|
706
707
|
] });
|
|
707
708
|
}
|
|
708
709
|
const Je = 96, Qe = 32;
|
|
709
|
-
function
|
|
710
|
+
function io() {
|
|
710
711
|
const { size: e, gl: n, camera: r } = Re(), o = P(() => new De(Je + Qe, 28), []), c = P(() => new ze(Je), []), h = P(() => new Fe(Qe), []), p = P(() => /* @__PURE__ */ new Map(), []), y = P(() => ({ ctrl: new t.Vector3(), h: new t.Vector3(), col: new t.Color(), a: new t.Vector3(), b: new t.Vector3() }), []);
|
|
711
|
-
return se(({ clock:
|
|
712
|
-
const z = performance.now(), M = Q ? 0 :
|
|
712
|
+
return se(({ clock: x }) => {
|
|
713
|
+
const z = performance.now(), M = Q ? 0 : x.elapsedTime;
|
|
713
714
|
h.setScale(e.height, n.getPixelRatio(), r.fov), o.begin(), c.begin(), h.begin();
|
|
714
715
|
const { ctrl: b, col: u, h: S } = y;
|
|
715
716
|
for (const a of p.keys()) N.instances.has(a) || p.delete(a);
|
|
716
717
|
for (const a of N.instances.values()) {
|
|
717
718
|
if (!a.parent) continue;
|
|
718
|
-
const l = ce(a.parent), i = ce(a.id),
|
|
719
|
+
const l = ce(a.parent), i = ce(a.id), A = N.instances.get(a.parent);
|
|
719
720
|
if (!l || !i) continue;
|
|
720
|
-
const d =
|
|
721
|
+
const d = A && !A.exitAt && !a.exitAt ? 1 : 0;
|
|
721
722
|
let s = p.get(a.id) ?? 0;
|
|
722
723
|
const f = (z - a.bornAt) / 1e3;
|
|
723
724
|
if (d && f < Ue && (s = 1), s += (d - s) * (d ? 0.08 : 0.03), p.set(a.id, s), s < 0.01) continue;
|
|
724
|
-
const m = l.distanceTo(i) || 1, w = Math.min(0.3, 0.55 * Ve.scale * (
|
|
725
|
+
const m = l.distanceTo(i) || 1, w = Math.min(0.3, 0.55 * Ve.scale * (A ? 1.35 : 1) / m), B = Math.min(0.3, 0.5 * Ve.scale / m), U = xe(f / Ue);
|
|
725
726
|
b.copy(l).add(i).multiplyScalar(0.5);
|
|
726
727
|
const V = w + (1 - B - w) * U;
|
|
727
728
|
u.copy(Oe[a.type]).lerp(Ce, 0.5);
|
|
@@ -731,13 +732,13 @@ function ro() {
|
|
|
731
732
|
for (const a of N.comets) {
|
|
732
733
|
const l = ce(a.from), i = ce(a.to);
|
|
733
734
|
if (!l || !i) continue;
|
|
734
|
-
const
|
|
735
|
-
if (
|
|
735
|
+
const A = At(a, z);
|
|
736
|
+
if (!xt(a, z)) continue;
|
|
736
737
|
const d = N.instances.get(a.from), s = N.instances.get(a.to);
|
|
737
738
|
(s == null ? void 0 : s.parent) === a.from || (d == null ? void 0 : d.parent) === a.to ? b.copy(l).add(i).multiplyScalar(0.5) : be(l, i, 1.4, 0.8, b);
|
|
738
|
-
const m =
|
|
739
|
+
const m = xe(A);
|
|
739
740
|
u.copy(d ? Oe[d.type] : Ce).lerp(K, 0.45);
|
|
740
|
-
const w = Math.min(1,
|
|
741
|
+
const w = Math.min(1, A / 0.1) * Math.min(1, (1 - A) / 0.15);
|
|
741
742
|
o.add(l, b, i, u, 0.9 * w, Math.max(0, m - 0.2), m, 0, 1, M, m, 1.6 * w), fe(l, b, i, m, S), h.add(S, 0.8, u, 1.4 * w);
|
|
742
743
|
}
|
|
743
744
|
o.end(), c.end(), h.end();
|
|
@@ -747,46 +748,46 @@ function ro() {
|
|
|
747
748
|
/* @__PURE__ */ g("primitive", { object: h.obj })
|
|
748
749
|
] });
|
|
749
750
|
}
|
|
750
|
-
const
|
|
751
|
+
const co = {
|
|
751
752
|
minPolarAngle: Math.PI * 0.22,
|
|
752
753
|
maxPolarAngle: Math.PI * 0.78,
|
|
753
754
|
minAzimuthAngle: -Math.PI * 0.35,
|
|
754
755
|
maxAzimuthAngle: Math.PI * 0.35
|
|
755
756
|
};
|
|
756
|
-
function
|
|
757
|
+
function vo() {
|
|
757
758
|
return /* @__PURE__ */ q(
|
|
758
|
-
|
|
759
|
+
Ct,
|
|
759
760
|
{
|
|
760
761
|
title: "constellation · night sky",
|
|
761
762
|
subtitle: "Agents are stars (brighter = parent) · delegation draws constellation lines · stars flare on LLM calls · ◉ MCP planets with backend moons · the graph nebula lights on reads/writes · ✦ final answer = shooting star",
|
|
762
763
|
preset: "radial",
|
|
763
764
|
plane: "xy",
|
|
764
765
|
camera: { position: [0, 0, 34], fov: 46, far: 1200 },
|
|
765
|
-
controls:
|
|
766
|
+
controls: co,
|
|
766
767
|
bg: "#040618",
|
|
767
768
|
gl: { antialias: !0 },
|
|
768
769
|
fit: { nRef: 4, min: 0.62, max: 1.6, minRadius: 5.5 },
|
|
769
770
|
agentRadius: 1.3,
|
|
770
771
|
graph: { natural: _e * 1.1, radius: 3.6 },
|
|
771
|
-
Background: /* @__PURE__ */ g(
|
|
772
|
-
Agent:
|
|
773
|
-
RunMarker:
|
|
774
|
-
McpServer:
|
|
775
|
-
Backend:
|
|
776
|
-
GraphResource:
|
|
772
|
+
Background: /* @__PURE__ */ g(oo, {}),
|
|
773
|
+
Agent: ao,
|
|
774
|
+
RunMarker: Yt,
|
|
775
|
+
McpServer: Dt,
|
|
776
|
+
Backend: Xt,
|
|
777
|
+
GraphResource: kt,
|
|
777
778
|
cluster: { radius: 1.5, variant: "stars", glowGain: 0.9 },
|
|
778
779
|
PostFX: /* @__PURE__ */ q(it, { multisampling: 0, children: [
|
|
779
780
|
/* @__PURE__ */ g(ct, { mipmapBlur: !0, intensity: 0.95, luminanceThreshold: 0.22, luminanceSmoothing: 0.35, radius: 0.7 }),
|
|
780
781
|
/* @__PURE__ */ g(lt, { eskil: !1, offset: 0.25, darkness: 0.75 })
|
|
781
782
|
] }),
|
|
782
783
|
children: [
|
|
783
|
-
/* @__PURE__ */ g(
|
|
784
|
-
/* @__PURE__ */ g(
|
|
785
|
-
/* @__PURE__ */ g(
|
|
784
|
+
/* @__PURE__ */ g(io, {}),
|
|
785
|
+
/* @__PURE__ */ g(qt, {}),
|
|
786
|
+
/* @__PURE__ */ g(Ht, {})
|
|
786
787
|
]
|
|
787
788
|
}
|
|
788
789
|
);
|
|
789
790
|
}
|
|
790
791
|
export {
|
|
791
|
-
|
|
792
|
+
vo as default
|
|
792
793
|
};
|