agentglow 0.2.9 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{KitScene-Bm1I35Zc.js → KitScene-DG_pcnWW.js} +1273 -1195
- package/dist/chunks/{index-COLbf8XM.js → index-Agh7jdYu.js} +182 -182
- package/dist/chunks/{index-CGTp73GN.js → index-B2EHxcBQ.js} +400 -400
- package/dist/chunks/{index-D-r9aJ4u.js → index-B4Cqo621.js} +33 -33
- package/dist/chunks/index-BfQsJ0TH.js +751 -0
- package/dist/chunks/index-BmBGYhJS.js +891 -0
- package/dist/chunks/index-Bnn-x-aE.js +767 -0
- package/dist/chunks/{index-BWsSd_Wm.js → index-CTQTtm9q.js} +212 -212
- package/dist/chunks/{index-_IwfbZy7.js → index-CTZbUTDY.js} +62 -62
- package/dist/chunks/{index-cRPj-lzn.js → index-CdKvybsL.js} +284 -284
- package/dist/chunks/index-CeiIEWek.js +818 -0
- package/dist/chunks/{index-D4Wlmsay.js → index-Ci8tSMhc.js} +15 -15
- package/dist/chunks/{index-C2vLpNCb.js → index-Cls_VZdb.js} +100 -100
- package/dist/chunks/index-DFFRhihO.js +892 -0
- package/dist/chunks/index-DMCETM4H.js +605 -0
- package/dist/chunks/{index-AugvjZJN.js → index-URn4zDHp.js} +223 -223
- package/dist/chunks/index-u4rYZ1UO.js +495 -0
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/world.d.ts +30 -5
- package/package.json +1 -1
- package/dist/chunks/index-BAQDf-0T.js +0 -492
- package/dist/chunks/index-BRnLrSfZ.js +0 -605
- package/dist/chunks/index-CKyn9lcT.js +0 -753
- package/dist/chunks/index-CnoB0ZDk.js +0 -889
- package/dist/chunks/index-KmczAvvY.js +0 -818
- package/dist/chunks/index-Z4vdWCok.js +0 -763
- package/dist/chunks/index-uZGu9jzU.js +0 -887
|
@@ -1,605 +0,0 @@
|
|
|
1
|
-
import { jsxs as w, jsx as r, Fragment as Ee } from "react/jsx-runtime";
|
|
2
|
-
import { Sparkles as ct, Stars as lt, Grid as pt } from "@react-three/drei";
|
|
3
|
-
import { EffectComposer as ut, Bloom as ft, Vignette as dt, Noise as mt } from "@react-three/postprocessing";
|
|
4
|
-
import * as n from "three";
|
|
5
|
-
import { useFrame as J } from "@react-three/fiber";
|
|
6
|
-
import { useRef as v, useMemo as A, useEffect as ht } from "react";
|
|
7
|
-
import { k as Se, f as be, i as Mt, q as et, K as gt, w as T, r as H, G as yt, t as tt, T as ke, n as wt, L as Ae, v as bt, a as ge, R as xt, S as Oe, x as Ce, u as vt, p as St, e as At, l as Bt, M as Ct, c as nt, d as Gt, j as Rt } from "./KitScene-Bm1I35Zc.js";
|
|
8
|
-
const $ = 0.05, Ge = 0.3, Pt = Mt;
|
|
9
|
-
function I(e, t) {
|
|
10
|
-
return new n.Color(e).multiplyScalar(t);
|
|
11
|
-
}
|
|
12
|
-
const ye = /* @__PURE__ */ new Map(), rt = (e) => e.depth === 0 ? e.sib ? e.ev : 0 : e.ev;
|
|
13
|
-
function ot(e, t) {
|
|
14
|
-
const c = e.inst.parent ? Se.agents.get(e.inst.parent) : void 0, a = c ? rt(c) : 0, s = c ? c.eu : e.eu - 2.8 * be.spread, o = e.ev - a;
|
|
15
|
-
return t.base = a, t.off = o, t.div = 0.7 + 0.14 * Math.abs(o), t.u0 = s + 0.5, t.u1 = Math.max(t.u0 + 2 * t.div + 0.8, 2 * e.eu - t.u0), t;
|
|
16
|
-
}
|
|
17
|
-
const We = (e) => {
|
|
18
|
-
const t = Math.min(1, Math.max(0, e));
|
|
19
|
-
return t * t * (3 - 2 * t);
|
|
20
|
-
};
|
|
21
|
-
function It(e, t) {
|
|
22
|
-
return e <= t.u0 || e >= t.u1 ? 0 : e < t.u0 + t.div ? We((e - t.u0) / t.div) : e <= t.u1 - t.div ? 1 : We((t.u1 - e) / t.div);
|
|
23
|
-
}
|
|
24
|
-
function Re(e, t, c, a, s, o) {
|
|
25
|
-
const p = c ? c.base + c.off * It(t, c) : a;
|
|
26
|
-
return et(e, t, p, o), o.y = s, o;
|
|
27
|
-
}
|
|
28
|
-
function Fe(e, t) {
|
|
29
|
-
return t.u0 = e.cu - e.hu - 0.6, t.u1 = e.cu + e.hu + 0.6, t;
|
|
30
|
-
}
|
|
31
|
-
const st = { pos: [] }, ae = 0.5, Xe = 2.55, xe = 3.75, zt = xe + 0.3, Pe = new n.Vector3();
|
|
32
|
-
function at(e, t) {
|
|
33
|
-
const c = st.pos[e];
|
|
34
|
-
return c ? Pe.set(c.x, c.y + ae, c.z) : Pe.set(0, ae, 0), bt(Pe, t);
|
|
35
|
-
}
|
|
36
|
-
function _t(e) {
|
|
37
|
-
const t = [];
|
|
38
|
-
for (let c = 0; c < e; c++) {
|
|
39
|
-
const a = c / e * Math.PI * 2 + (Math.random() - 0.5) * 0.1, s = Math.random() * Math.PI * 2, o = 0.25 + 0.6 * Math.sqrt(Math.random());
|
|
40
|
-
t.push(new n.Vector3((Xe + o * Math.cos(s)) * Math.cos(a), o * Math.sin(s) * 0.7, (Xe + o * Math.cos(s)) * Math.sin(a)));
|
|
41
|
-
}
|
|
42
|
-
return t;
|
|
43
|
-
}
|
|
44
|
-
const it = 200, Le = (e, t) => wt(e, t) % Math.min(it, e.nodes.length);
|
|
45
|
-
function Tt({ galaxy: e }) {
|
|
46
|
-
const t = Math.min(it, e.nodes.length), c = v(null), a = v(null), s = A(() => _t(t), [t]);
|
|
47
|
-
st.pos = s;
|
|
48
|
-
const o = A(() => e.nodes.slice(0, t).map((i) => new n.Color(gt[i.kind] ?? "#94a3b8")), [e]), p = A(() => new Float32Array(Math.max(1, t)), [t]), M = A(() => new Uint8Array(Math.max(1, t)), [t]), f = A(() => new n.Object3D(), []), g = A(() => new n.Color(), []), y = A(() => new n.Color(5, 5, 5.5), []), B = v(/* @__PURE__ */ new Map()), S = A(() => {
|
|
49
|
-
const i = [];
|
|
50
|
-
for (let l = 0; l < t; l++) {
|
|
51
|
-
const d = [];
|
|
52
|
-
for (let u = 0; u < t; u++) {
|
|
53
|
-
if (l === u) continue;
|
|
54
|
-
const h = s[l].distanceToSquared(s[u]);
|
|
55
|
-
d.push([h, u]);
|
|
56
|
-
}
|
|
57
|
-
d.sort((u, h) => u[0] - h[0]);
|
|
58
|
-
for (const [, u] of d.slice(0, 2)) (u > l || l % 3 === 0) && i.push(s[l].x, s[l].y, s[l].z, s[u].x, s[u].y, s[u].z);
|
|
59
|
-
}
|
|
60
|
-
const b = new Map(e.nodes.slice(0, t).map((l, d) => [l.id, d]));
|
|
61
|
-
for (const l of e.links) {
|
|
62
|
-
const d = b.get(l.source), u = b.get(l.target);
|
|
63
|
-
d === void 0 || u === void 0 || s[d].distanceTo(s[u]) > 3 || i.push(s[d].x, s[d].y, s[d].z, s[u].x, s[u].y, s[u].z);
|
|
64
|
-
}
|
|
65
|
-
const R = new n.BufferGeometry();
|
|
66
|
-
return R.setAttribute("position", new n.Float32BufferAttribute(i, 3)), R;
|
|
67
|
-
}, [e, s]);
|
|
68
|
-
return J(() => {
|
|
69
|
-
const i = c.current;
|
|
70
|
-
if (!i) return;
|
|
71
|
-
const b = performance.now();
|
|
72
|
-
p.fill(0), M.fill(0);
|
|
73
|
-
let R = 0;
|
|
74
|
-
for (const l of T.flares) {
|
|
75
|
-
let d = B.current.get(l.node);
|
|
76
|
-
d === void 0 && (d = Le(e, l.node), B.current.set(l.node, d));
|
|
77
|
-
const u = (b - l.start) / 1e3, h = Math.exp(-u * 1.3) * Math.min(1, u * 8);
|
|
78
|
-
h > p[d] && (p[d] = h), l.op === "write" && (M[d] = 1), R = Math.max(R, h);
|
|
79
|
-
}
|
|
80
|
-
for (let l = 0; l < t; l++) {
|
|
81
|
-
const d = p[l];
|
|
82
|
-
f.position.copy(s[l]), f.scale.setScalar(1 + d * (M[l] ? 4.5 : 3)), f.updateMatrix(), i.setMatrixAt(l, f.matrix), g.copy(o[l]).multiplyScalar(0.75 + d * 4), M[l] && d > 0.01 && g.lerp(y, d * 0.8), i.setColorAt(l, g);
|
|
83
|
-
}
|
|
84
|
-
i.instanceMatrix.needsUpdate = !0, i.instanceColor && (i.instanceColor.needsUpdate = !0), a.current && a.current.material.color.set("#c7d2fe").multiplyScalar(1.4 + R * 2.2 + (H ? 0 : Math.sin(b / 700) * 0.2));
|
|
85
|
-
}), /* @__PURE__ */ w("group", { position: [0, ae, 0], children: [
|
|
86
|
-
/* @__PURE__ */ w("group", { children: [
|
|
87
|
-
/* @__PURE__ */ w("instancedMesh", { ref: c, args: [void 0, void 0, Math.max(1, t)], children: [
|
|
88
|
-
/* @__PURE__ */ r("sphereGeometry", { args: [0.095, 10, 10] }),
|
|
89
|
-
/* @__PURE__ */ r("meshBasicMaterial", { toneMapped: !1 })
|
|
90
|
-
] }),
|
|
91
|
-
/* @__PURE__ */ r("lineSegments", { geometry: S, children: /* @__PURE__ */ r("lineBasicMaterial", { color: "#8b9cff", transparent: !0, opacity: 0.42, blending: n.AdditiveBlending, depthWrite: !1 }) })
|
|
92
|
-
] }),
|
|
93
|
-
/* @__PURE__ */ w("mesh", { rotation: [-Math.PI / 2, 0, 0], position: [0, -ae + 0.04, 0], children: [
|
|
94
|
-
/* @__PURE__ */ r("ringGeometry", { args: [xe - 0.18, xe + 0.18, 128] }),
|
|
95
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: I("#a5b4fc", 1.3), transparent: !0, opacity: 0.55, toneMapped: !1, side: n.DoubleSide })
|
|
96
|
-
] }),
|
|
97
|
-
/* @__PURE__ */ w("mesh", { rotation: [-Math.PI / 2, 0, 0], position: [0, -ae + 0.03, 0], children: [
|
|
98
|
-
/* @__PURE__ */ r("circleGeometry", { args: [xe - 0.2, 96] }),
|
|
99
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: "#0b1030", transparent: !0, opacity: 0.75 })
|
|
100
|
-
] }),
|
|
101
|
-
/* @__PURE__ */ w("mesh", { rotation: [-Math.PI / 2, 0, 0], position: [0, -ae + 0.05, 0], children: [
|
|
102
|
-
/* @__PURE__ */ r("ringGeometry", { args: [1.35, 1.45, 96] }),
|
|
103
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: I("#818cf8", 1.6), transparent: !0, opacity: 0.6, toneMapped: !1 })
|
|
104
|
-
] }),
|
|
105
|
-
/* @__PURE__ */ w("mesh", { ref: a, position: [0, 0.1, 0], children: [
|
|
106
|
-
/* @__PURE__ */ r("octahedronGeometry", { args: [0.55, 0] }),
|
|
107
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: "#c7d2fe", toneMapped: !1, wireframe: !0 })
|
|
108
|
-
] }),
|
|
109
|
-
/* @__PURE__ */ w("mesh", { position: [0, 0.1, 0], children: [
|
|
110
|
-
/* @__PURE__ */ r("sphereGeometry", { args: [0.22, 20, 20] }),
|
|
111
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: I("#e0e7ff", 3), toneMapped: !1 })
|
|
112
|
-
] }),
|
|
113
|
-
/* @__PURE__ */ r(ct, { count: H ? 20 : 60, scale: [7, 1.4, 7], size: 1.8, speed: 0.25, color: "#a5b4fc", opacity: 0.55 }),
|
|
114
|
-
/* @__PURE__ */ r(yt, { position: [0, 2.4, 0], suffix: " · Graph Central", color: "#a5b4fc", size: 0.36, pxRange: [9.5, 14] })
|
|
115
|
-
] });
|
|
116
|
-
}
|
|
117
|
-
const le = 48;
|
|
118
|
-
function Vt() {
|
|
119
|
-
const e = tt(), t = v(null), c = v(null), a = A(() => {
|
|
120
|
-
const g = new n.BufferGeometry();
|
|
121
|
-
return g.setAttribute("position", new n.BufferAttribute(new Float32Array(le * 6), 3)), g.setAttribute("color", new n.BufferAttribute(new Float32Array(le * 6), 3)), g;
|
|
122
|
-
}, []), s = A(() => new n.Object3D(), []), o = A(() => new n.Vector3(), []), p = A(() => new n.Color(), []), M = A(() => Object.fromEntries(Object.entries(ke).map(([g, y]) => [g, new n.Color(y)])), []), f = v(/* @__PURE__ */ new Map());
|
|
123
|
-
return J(() => {
|
|
124
|
-
const g = t.current, y = c.current;
|
|
125
|
-
if (!g || !y) return;
|
|
126
|
-
if (!e.nodes.length || !Se.graphWanted) {
|
|
127
|
-
g.count = y.count = 0, a.setDrawRange(0, 0);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
const B = performance.now(), S = a.getAttribute("position"), i = a.getAttribute("color");
|
|
131
|
-
let b = 0;
|
|
132
|
-
const R = T.flares;
|
|
133
|
-
for (let l = R.length - 1; l >= 0 && b < le; l--) {
|
|
134
|
-
const d = R[l], u = (B - d.start) / 2600;
|
|
135
|
-
if (u >= 1) continue;
|
|
136
|
-
let h = f.current.get(d.node);
|
|
137
|
-
h === void 0 && (h = Le(e, d.node), f.current.set(d.node, h)), at(h, o);
|
|
138
|
-
const x = d.op === "write", F = T.instances.get(d.instance), V = F ? M[F.type] : M.researcher;
|
|
139
|
-
s.position.copy(o), s.rotation.set(-Math.PI / 2, 0, 0), s.scale.setScalar((x ? 0.35 : 0.2) + u * (x ? 1.6 : 0.8)), s.updateMatrix(), g.setMatrixAt(b, s.matrix), x ? p.setRGB(4, 4, 4.4).multiplyScalar(1 - u) : p.copy(V).multiplyScalar(2.4 * (1 - u)), g.setColorAt(b, p);
|
|
140
|
-
const m = ge(d.instance), C = Math.min(1, (B - d.start) / 700);
|
|
141
|
-
if (m && u < 0.75) {
|
|
142
|
-
const L = 1 - u / 0.75;
|
|
143
|
-
S.setXYZ(b * 2, m.x, m.y, m.z), S.setXYZ(b * 2 + 1, o.x, o.y, o.z), x ? p.setRGB(2.6, 2.6, 3).multiplyScalar(L) : p.copy(V).multiplyScalar(1.2 * L), i.setXYZ(b * 2, p.r, p.g, p.b), i.setXYZ(b * 2 + 1, p.r * 0.7, p.g * 0.7, p.b * 0.7);
|
|
144
|
-
const _ = x ? C : 1 - C;
|
|
145
|
-
s.position.set(m.x + (o.x - m.x) * _, m.y + (o.y - m.y) * _ + Math.sin(_ * Math.PI) * 0.6, m.z + (o.z - m.z) * _), s.rotation.set(0, 0, 0), s.scale.setScalar(C >= 1 ? 1e-4 : x ? 1.4 : 1), s.updateMatrix(), y.setMatrixAt(b, s.matrix), x ? p.setRGB(6, 6, 6.5) : p.copy(V).multiplyScalar(4), y.setColorAt(b, p);
|
|
146
|
-
} else
|
|
147
|
-
S.setXYZ(b * 2, 0, 0, 0), S.setXYZ(b * 2 + 1, 0, 0, 0), s.scale.setScalar(1e-4), s.updateMatrix(), y.setMatrixAt(b, s.matrix);
|
|
148
|
-
b++;
|
|
149
|
-
}
|
|
150
|
-
g.count = b, y.count = b, g.instanceMatrix.needsUpdate = !0, y.instanceMatrix.needsUpdate = !0, g.instanceColor && (g.instanceColor.needsUpdate = !0), y.instanceColor && (y.instanceColor.needsUpdate = !0), a.setDrawRange(0, b * 2), S.needsUpdate = !0, i.needsUpdate = !0;
|
|
151
|
-
}), /* @__PURE__ */ w("group", { children: [
|
|
152
|
-
/* @__PURE__ */ w("instancedMesh", { ref: t, args: [void 0, void 0, le], frustumCulled: !1, children: [
|
|
153
|
-
/* @__PURE__ */ r("torusGeometry", { args: [1, 0.05, 6, 40] }),
|
|
154
|
-
/* @__PURE__ */ r("meshBasicMaterial", { toneMapped: !1, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1 })
|
|
155
|
-
] }),
|
|
156
|
-
/* @__PURE__ */ w("instancedMesh", { ref: c, args: [void 0, void 0, le], frustumCulled: !1, children: [
|
|
157
|
-
/* @__PURE__ */ r("sphereGeometry", { args: [0.1, 10, 10] }),
|
|
158
|
-
/* @__PURE__ */ r("meshBasicMaterial", { toneMapped: !1 })
|
|
159
|
-
] }),
|
|
160
|
-
/* @__PURE__ */ r("lineSegments", { geometry: a, frustumCulled: !1, children: /* @__PURE__ */ r("lineBasicMaterial", { vertexColors: !0, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, toneMapped: !1 }) })
|
|
161
|
-
] });
|
|
162
|
-
}
|
|
163
|
-
function Ye({ galaxy: e, op: t }) {
|
|
164
|
-
const c = v(null), a = v(null), s = v(0);
|
|
165
|
-
return J(() => {
|
|
166
|
-
const o = performance.now();
|
|
167
|
-
let p = null;
|
|
168
|
-
for (let f = T.flares.length - 1; f >= 0; f--) if (T.flares[f].op === t) {
|
|
169
|
-
p = T.flares[f];
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
const M = p ? o - p.start : 1e9;
|
|
173
|
-
if (!(!c.current || !a.current)) {
|
|
174
|
-
if (!p || M > 1700) {
|
|
175
|
-
a.current.setOpacity(0);
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
p.id !== s.current && (s.current = p.id, a.current.setText((t === "write" ? "wrote · " : "") + p.node), at(Le(e, p.node), c.current.position)), a.current.setOpacity(Math.min(1, (1700 - M) / 400));
|
|
179
|
-
}
|
|
180
|
-
}), /* @__PURE__ */ r("group", { ref: c, children: /* @__PURE__ */ r(Ae, { ref: a, position: [0, t === "write" ? 1.1 : 0.7, 0], text: "", color: t === "write" ? "#ffffff" : "#a5b4fc", size: 0.28, opacity: 0, fadeMs: 200, pxRange: [8, 12] }) });
|
|
181
|
-
}
|
|
182
|
-
function Ot() {
|
|
183
|
-
const e = tt();
|
|
184
|
-
return e.nodes.length ? /* @__PURE__ */ w(Ee, { children: [
|
|
185
|
-
/* @__PURE__ */ r(Ye, { galaxy: e, op: "read" }),
|
|
186
|
-
/* @__PURE__ */ r(Ye, { galaxy: e, op: "write" })
|
|
187
|
-
] }) : null;
|
|
188
|
-
}
|
|
189
|
-
const Ie = { queued: "#64748b", running: "#fbbf24", done: "#22c55e", failed: "#ef4444" }, ze = { plan: "planner", research: "researcher", write: "writer" }, je = 10, Ze = new n.CylinderGeometry(1, 1, 1, 8, 1, !0), De = new n.Vector3(0, 1, 0), re = new n.Vector3(), oe = new n.Vector3(), ve = new n.Vector3(), pe = new n.Object3D(), qe = new n.Matrix4(), _e = new n.Vector3(), ue = new n.Vector3(), j = { u0: 0, u1: 0, div: 1, base: 0, off: 0 }, fe = { u0: 0, u1: 0 }, Dt = new Float64Array(4);
|
|
190
|
-
function we(e, t, c, a, s) {
|
|
191
|
-
ve.subVectors(a, c);
|
|
192
|
-
const o = ve.length();
|
|
193
|
-
pe.position.copy(c).add(a).multiplyScalar(0.5), o > 1e-5 && pe.quaternion.setFromUnitVectors(De, ve.divideScalar(o)), pe.scale.set(s, Math.max(1e-4, o), s), pe.updateMatrix(), e.setMatrixAt(t, pe.matrix);
|
|
194
|
-
}
|
|
195
|
-
function Ut({ run: e }) {
|
|
196
|
-
const t = e.color, c = v(null), a = v(null), s = v([]), o = v([]), p = v([]), M = v(null), f = v(null), g = v(null), y = v(null), B = v(null), S = A(() => new n.Color(), []), i = A(
|
|
197
|
-
() => ({
|
|
198
|
-
trunk: new n.MeshBasicMaterial({ color: I(t, 1.5), toneMapped: !1, transparent: !0 }),
|
|
199
|
-
glow: new n.MeshBasicMaterial({ color: I(t, 0.5), toneMapped: !1, transparent: !0, opacity: 0.22, blending: n.AdditiveBlending, depthWrite: !1 }),
|
|
200
|
-
spur: new n.MeshBasicMaterial({ color: I(t, 1.9), toneMapped: !1, transparent: !0 }),
|
|
201
|
-
platform: new n.MeshBasicMaterial({ color: I(t, 0.35), toneMapped: !1, transparent: !0, opacity: 0.6 })
|
|
202
|
-
}),
|
|
203
|
-
[t]
|
|
204
|
-
), b = A(() => {
|
|
205
|
-
const l = new n.InstancedMesh(Ze, i.spur, 1 + je * 3);
|
|
206
|
-
return l.frustumCulled = !1, l.count = 0, l;
|
|
207
|
-
}, [i]), R = A(() => {
|
|
208
|
-
const l = new n.InstancedMesh(Ze, i.glow, 1 + je * 3);
|
|
209
|
-
return l.frustumCulled = !1, l.count = 0, l;
|
|
210
|
-
}, [i]);
|
|
211
|
-
return J(({ clock: l }) => {
|
|
212
|
-
var te, ie, ne;
|
|
213
|
-
const d = c.current;
|
|
214
|
-
if (!d) return;
|
|
215
|
-
_e.copy(e.side), ue.copy(e.axis), ve.crossVectors(_e, De).dot(ue) < 0 && ue.negate(), qe.makeBasis(_e, De, ue), d.quaternion.setFromRotationMatrix(qe), d.position.copy(e.origin).addScaledVector(e.side, -e.cu).addScaledVector(e.axis, -e.cv);
|
|
216
|
-
const u = ue.dot(e.axis) < 0 ? -1 : 1, h = e.run ?? T.runs.get(e.id), x = performance.now(), F = l.elapsedTime, V = h ? Math.min(1, (x - h.startedAt) / 1300) : 1, m = 1 - Math.pow(1 - V, 3), C = h != null && h.endedAt ? Math.max(0, 1 - (x - h.endedAt) / xt) : 1;
|
|
217
|
-
Fe(e, fe);
|
|
218
|
-
const L = fe.u0, _ = L + (fe.u1 - L) * Math.max(1e-3, m);
|
|
219
|
-
let E = 0;
|
|
220
|
-
re.set(L, $, 0), oe.set(_, $, 0), we(b, E, re, oe, 0.075), we(R, E++, re, oe, 0.26);
|
|
221
|
-
for (const D of Se.agents.values()) {
|
|
222
|
-
if (D.run !== e || D.depth === 0 || E + 3 > b.instanceMatrix.count) continue;
|
|
223
|
-
ot(D, j);
|
|
224
|
-
const z = (j.base + j.off) * u, k = j.base * u, G = Dt;
|
|
225
|
-
G[0] = j.u0, G[1] = j.u0 + j.div, G[2] = j.u1 - j.div, G[3] = j.u1;
|
|
226
|
-
for (let U = 0; U < 3; U++)
|
|
227
|
-
re.set(G[U], $, U === 0 ? k : z), oe.set(Math.min(_, G[U + 1]), $, U === 2 ? k : z), we(b, E, re, oe, 0.06), we(R, E++, re, oe, 0.22);
|
|
228
|
-
}
|
|
229
|
-
b.count = R.count = E, b.instanceMatrix.needsUpdate = !0, R.instanceMatrix.needsUpdate = !0, (te = g.current) == null || te.position.set(fe.u0, $ + 0.12, 0), (ie = y.current) == null || ie.position.set(_, $ + 0.12, 0), (ne = B.current) == null || ne.position.set(fe.u0 - 0.2, 0.2, -2.7 * u), i.trunk.opacity = C, i.glow.opacity = 0.22 * C, i.spur.opacity = C * (h && h.hasSteps && h.steps.research === "queued" ? 0.25 : 1), i.platform.opacity = 0.6 * C;
|
|
230
|
-
const Y = !!(h != null && h.hasSteps);
|
|
231
|
-
Oe.forEach((D, z) => {
|
|
232
|
-
const k = s.current[z];
|
|
233
|
-
if (k && (k.visible = Y, k.position.set(Ce(ze[D]), $, 0), k.scale.setScalar(Math.max(1e-3, Math.min(1, (V - 0.3) * 1.6)))), !h || !Y) return;
|
|
234
|
-
const G = h.steps[D], U = o.current[z], q = G === "running", ce = q ? H ? 0.5 : 0.5 + 0.5 * Math.sin(F * 5.5) : 0;
|
|
235
|
-
U && (S.set(Ie[G] ?? Ie.queued).multiplyScalar((G === "queued" ? 0.6 : q ? 1.8 + ce * 2.2 : 2.4) * C), U.material.color.copy(S), U.scale.setScalar(q ? 1.05 + ce * 0.22 : 1));
|
|
236
|
-
const Q = p.current[z];
|
|
237
|
-
if (Q) {
|
|
238
|
-
Q.visible = q || G === "done";
|
|
239
|
-
const P = Q.material;
|
|
240
|
-
P.color.set(Ie[G]).multiplyScalar(q ? 1.2 + ce : 0.5), P.opacity = (q ? 0.5 : 0.18) * C, Q.scale.y = q ? 1 : 0.45;
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
const O = h != null && h.handoffAt ? (x - h.handoffAt) / 1200 : 2, W = h ? Ce(ze[h.handoffFrom]) : 0, Z = h ? Ce(ze[h.handoffTo]) : 0, Be = O >= 1 ? 1 : 1 - Math.pow(1 - Math.max(0, O), 3), ee = W + (Z - W) * Be;
|
|
244
|
-
if (M.current && (M.current.position.set(ee, 0.32, 0), M.current.scale.setScalar(O < 1 ? 1 : 1e-3)), f.current) {
|
|
245
|
-
const D = O < 1.6;
|
|
246
|
-
if (f.current.visible = D, D) {
|
|
247
|
-
const z = Math.max(0.01, ee - W);
|
|
248
|
-
f.current.position.set(W + z / 2, $ + 0.02, 0), f.current.scale.set(z, 1, 1), f.current.material.opacity = O < 1 ? 0.9 : Math.max(0, 1 - (O - 1) / 0.6) * 0.9;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}), /* @__PURE__ */ w("group", { ref: c, children: [
|
|
252
|
-
/* @__PURE__ */ w("group", { ref: a, children: [
|
|
253
|
-
/* @__PURE__ */ r("primitive", { object: b }),
|
|
254
|
-
/* @__PURE__ */ r("primitive", { object: R }),
|
|
255
|
-
/* @__PURE__ */ r("mesh", { ref: g, material: i.trunk, children: /* @__PURE__ */ r("boxGeometry", { args: [0.12, 0.25, 0.9] }) }),
|
|
256
|
-
/* @__PURE__ */ r("mesh", { ref: y, material: i.trunk, children: /* @__PURE__ */ r("boxGeometry", { args: [0.12, 0.25, 0.9] }) })
|
|
257
|
-
] }),
|
|
258
|
-
Oe.map((l, d) => /* @__PURE__ */ w("group", { ref: (u) => void (s.current[d] = u), visible: !1, children: [
|
|
259
|
-
/* @__PURE__ */ w("mesh", { ref: (u) => void (o.current[d] = u), rotation: [-Math.PI / 2, 0, 0], position: [0, 0.03, 0], children: [
|
|
260
|
-
/* @__PURE__ */ r("ringGeometry", { args: [0.62, 0.86, 48] }),
|
|
261
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: "#64748b", toneMapped: !1, transparent: !0, side: n.DoubleSide })
|
|
262
|
-
] }),
|
|
263
|
-
/* @__PURE__ */ w("mesh", { rotation: [-Math.PI / 2, 0, 0], position: [0, 0.02, 0], children: [
|
|
264
|
-
/* @__PURE__ */ r("circleGeometry", { args: [0.6, 40] }),
|
|
265
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: "#060a18" })
|
|
266
|
-
] }),
|
|
267
|
-
/* @__PURE__ */ r("mesh", { position: [0, 0.02, -1.15], rotation: [-Math.PI / 2, 0, 0], material: i.platform, children: /* @__PURE__ */ r("planeGeometry", { args: [2.2, 0.32] }) }),
|
|
268
|
-
/* @__PURE__ */ w("mesh", { ref: (u) => void (p.current[d] = u), position: [0, 1.6, 0], visible: !1, children: [
|
|
269
|
-
/* @__PURE__ */ r("cylinderGeometry", { args: [0.07, 0.3, 3.2, 12, 1, !0] }),
|
|
270
|
-
/* @__PURE__ */ r("meshBasicMaterial", { toneMapped: !1, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, side: n.DoubleSide })
|
|
271
|
-
] }),
|
|
272
|
-
/* @__PURE__ */ r(Ae, { position: [0, 0, -1.75], text: l, color: t, textColor: "#cbd5e1", uppercase: !0, letterSpacing: 0.08, size: 0.26, opacity: 0.85, pxRange: [7.5, 11] })
|
|
273
|
-
] }, l)),
|
|
274
|
-
/* @__PURE__ */ r("group", { ref: B, children: /* @__PURE__ */ r(kt, { runId: e.id, color: t }) }),
|
|
275
|
-
/* @__PURE__ */ w("mesh", { ref: f, visible: !1, children: [
|
|
276
|
-
/* @__PURE__ */ r("boxGeometry", { args: [1, 0.05, 0.28] }),
|
|
277
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: I("#fde68a", 3), toneMapped: !1, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1 })
|
|
278
|
-
] }),
|
|
279
|
-
/* @__PURE__ */ w("mesh", { ref: M, scale: 1e-3, children: [
|
|
280
|
-
/* @__PURE__ */ r("sphereGeometry", { args: [0.22, 14, 14] }),
|
|
281
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: I("#fff7d6", 7), toneMapped: !1 })
|
|
282
|
-
] })
|
|
283
|
-
] });
|
|
284
|
-
}
|
|
285
|
-
const Et = { running: "#fde68a", done: "#bbf7d0", failed: "#fecaca", queued: "#64748b" };
|
|
286
|
-
function kt({ runId: e, color: t }) {
|
|
287
|
-
const a = vt().runs.get(e);
|
|
288
|
-
if (!a) return null;
|
|
289
|
-
const s = [];
|
|
290
|
-
return Oe.forEach((o, p) => s.push({ text: `${p ? " " : ""}${o.toUpperCase()}`, color: Et[a.steps[o]] ?? "#94a3b8" })), /* @__PURE__ */ r(
|
|
291
|
-
Ae,
|
|
292
|
-
{
|
|
293
|
-
anchorX: "left",
|
|
294
|
-
anchorY: "bottom",
|
|
295
|
-
textAlign: "left",
|
|
296
|
-
plate: "box",
|
|
297
|
-
text: `${a.hasSteps ? "hatchet · " : ""}${a.topic}`,
|
|
298
|
-
secondary: a.hasSteps ? s : a.status === "started" ? "running…" : "run complete",
|
|
299
|
-
letterSpacing: 0.02,
|
|
300
|
-
color: t,
|
|
301
|
-
size: 0.34,
|
|
302
|
-
secondarySize: 0.24,
|
|
303
|
-
maxWidth: 11,
|
|
304
|
-
opacity: a.status === "started" ? 1 : 0.55,
|
|
305
|
-
fadeMs: 300,
|
|
306
|
-
pxRange: [9.5, 13.5]
|
|
307
|
-
}
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
const X = {
|
|
311
|
-
body: new n.CapsuleGeometry(0.27, 0.95, 6, 16).rotateZ(Math.PI / 2),
|
|
312
|
-
window: new n.BoxGeometry(0.2, 0.1, 0.57),
|
|
313
|
-
roof: new n.BoxGeometry(1.1, 0.04, 0.12),
|
|
314
|
-
lamp: new n.SphereGeometry(0.075, 12, 12),
|
|
315
|
-
beam: new n.ConeGeometry(0.35, 1.6, 20, 1, !0).rotateZ(Math.PI / 2),
|
|
316
|
-
halo: new n.SphereGeometry(0.62, 20, 20),
|
|
317
|
-
shimmer: new n.CylinderGeometry(0.75, 0.75, 3.2, 28, 1, !0),
|
|
318
|
-
portal: new n.TorusGeometry(0.75, 0.07, 10, 48),
|
|
319
|
-
portalDisc: new n.CircleGeometry(0.72, 40),
|
|
320
|
-
sel: new n.RingGeometry(0.95, 1.08, 48)
|
|
321
|
-
}, Ft = [-0.48, -0.16, 0.16, 0.48], K = new n.Vector3(), de = new n.Vector3(), Lt = { u0: 0, u1: 0 };
|
|
322
|
-
function Wt({ agent: e, selected: t, onSelect: c }) {
|
|
323
|
-
const a = e.id, s = e.inst, o = ke[s.type], p = e.depth > 0 || Pt(s.type), M = v(null), f = v(null), g = v(null), y = v(null), B = v(null), S = v(null), i = A(
|
|
324
|
-
() => ({
|
|
325
|
-
body: new n.MeshStandardMaterial({ color: new n.Color(o).multiplyScalar(0.18), emissive: new n.Color(o), emissiveIntensity: 0.6, metalness: 0.55, roughness: 0.3, transparent: !0, toneMapped: !1 }),
|
|
326
|
-
win: new n.MeshBasicMaterial({ color: I(o, 2.5), toneMapped: !1, transparent: !0 }),
|
|
327
|
-
lampF: new n.MeshBasicMaterial({ color: I("#ffffff", 6), toneMapped: !1, transparent: !0 }),
|
|
328
|
-
lampR: new n.MeshBasicMaterial({ color: I("#ff3355", 3), toneMapped: !1, transparent: !0 }),
|
|
329
|
-
beam: new n.MeshBasicMaterial({ color: I("#fff7e0", 0.9), toneMapped: !1, transparent: !0, opacity: 0.14, blending: n.AdditiveBlending, depthWrite: !1, side: n.DoubleSide }),
|
|
330
|
-
halo: new n.MeshBasicMaterial({ color: I(o, 1), toneMapped: !1, transparent: !0, opacity: 0.1, blending: n.AdditiveBlending, depthWrite: !1 }),
|
|
331
|
-
shimmer: new n.MeshBasicMaterial({ color: I(o, 2), toneMapped: !1, transparent: !0, opacity: 0, blending: n.AdditiveBlending, depthWrite: !1, side: n.DoubleSide }),
|
|
332
|
-
portal: new n.MeshBasicMaterial({ color: I(o, 3), toneMapped: !1, transparent: !0 }),
|
|
333
|
-
portalDisc: new n.MeshBasicMaterial({ color: new n.Color("#000000"), transparent: !0, opacity: 0.85, side: n.DoubleSide }),
|
|
334
|
-
sel: new n.MeshBasicMaterial({ color: I("#ffffff", 2.5), toneMapped: !1, transparent: !0, side: n.DoubleSide })
|
|
335
|
-
}),
|
|
336
|
-
[o]
|
|
337
|
-
), b = A(() => new n.Color(o), [o]), R = A(() => new n.Color("#ffffff"), []), l = v({ r: -1 / 0, phase: Math.random() * 6, dir: 1, exitR: 0, exitPos: new n.Vector3(), spur: { u0: 0, u1: 0, div: 1, base: 0, off: 0 } });
|
|
338
|
-
ht(() => {
|
|
339
|
-
const u = { pos: new n.Vector3(), u: 0 };
|
|
340
|
-
return ye.set(a, u), () => void ye.delete(a);
|
|
341
|
-
}, [a]), J(({ clock: u }, h) => {
|
|
342
|
-
const x = e.inst, F = M.current;
|
|
343
|
-
if (!F) return;
|
|
344
|
-
const V = e.run, m = l.current, C = p ? ot(e, m.spur) : null, L = rt(e), _ = e.eu, E = Math.min(0.05, h), Y = performance.now(), O = St(x, Y), W = At(x, Y);
|
|
345
|
-
let Z = !1;
|
|
346
|
-
for (const P of T.mcpPending.values()) P.instance === a && (Z = !0);
|
|
347
|
-
if (m.r === -1 / 0) {
|
|
348
|
-
const P = x.parent ? ye.get(x.parent) : null;
|
|
349
|
-
m.r = P ? P.u : Fe(V, Lt).u0;
|
|
350
|
-
}
|
|
351
|
-
const Be = m.r;
|
|
352
|
-
let ee = _, te = 2.2;
|
|
353
|
-
if (x.exitAt)
|
|
354
|
-
m.exitR || (m.exitR = m.r), ee = m.exitR + 3.4, te = 1.6;
|
|
355
|
-
else if (x.status === "thinking") {
|
|
356
|
-
m.phase += E * (H ? 0.25 : 0.8 + W * 2.4) * (Z ? 0.25 : 1);
|
|
357
|
-
const P = C ? Math.max(0.2, (C.u1 - C.u0) / 2 - C.div) : 1.6 * be.spread, N = Math.min(P, p ? 1.05 : x.type === "researcher" ? 1.5 : 1.6) * Math.max(0.8, be.spread);
|
|
358
|
-
ee = _ + N * Math.sin(m.phase), te = 3;
|
|
359
|
-
}
|
|
360
|
-
m.r += (ee - m.r) * (1 - Math.exp(-E * te));
|
|
361
|
-
const ie = m.r - Be;
|
|
362
|
-
Math.abs(ie) > 15e-4 && (m.dir = ie > 0 ? 1 : -1), Re(V, m.r, C, L, Ge, K), Re(V, m.r + 0.05, C, L, Ge, de), F.position.copy(K), F.rotation.y = Math.atan2(-(de.z - K.z), de.x - K.x), e.live.copy(K);
|
|
363
|
-
const ne = ye.get(a);
|
|
364
|
-
ne && (ne.pos.copy(K), ne.u = m.r);
|
|
365
|
-
const D = u.elapsedTime, z = x.status === "waiting" || Z, k = H ? 0.5 : 0.5 + 0.5 * Math.sin(D * (Z ? 2.2 : 1.4) + m.phase), G = x.exitAt ? Math.min(1, (Y - x.exitAt) / Bt(x)) : 0;
|
|
366
|
-
if (f.current) {
|
|
367
|
-
const P = (p ? 1.1 : 1.35) * be.scale;
|
|
368
|
-
x.exitAt ? f.current.scale.set(P * (1 + G * 1.8), P * Math.max(0.05, 1 - G), P * Math.max(0.05, 1 - G)) : f.current.scale.setScalar(P * Math.max(1e-3, O) * (1 + W * 0.06) * (Z ? 1 + k * 0.06 : 1)), f.current.scale.x *= m.dir;
|
|
369
|
-
}
|
|
370
|
-
const U = x.exitAt ? 0 : e.dim, q = (x.exitAt ? 3 * (1 - G) : z ? 0.25 + k * (Z ? 0.9 : 0.35) : 1.1 + W * 2.6) * (1 - 0.75 * U);
|
|
371
|
-
i.body.emissiveIntensity = q, i.body.opacity = Math.min(1, O * 1.2);
|
|
372
|
-
const ce = (x.exitAt ? 4 * (1 - G) : z ? 0.5 + k * (Z ? 1.4 : 0.5) : 2.2 + W * 3) * (1 - 0.75 * U);
|
|
373
|
-
i.win.color.copy(b).multiplyScalar(ce), x.exitAt && G < 0.25 && i.win.color.lerp(R, 1 - G * 4).multiplyScalar(1.5), i.win.opacity = O, i.lampF.opacity = O * (z ? 0.4 : 1), i.lampR.opacity = O, i.beam.opacity = (z ? 0.04 : 0.13 + W * 0.08) * O * (1 - U), g.current && (g.current.scale.setScalar(0.9 + W * 0.6 + (z ? k * 0.25 : 0)), i.halo.opacity = O * (z ? 0.04 + k * 0.04 : 0.07 + W * 0.08));
|
|
374
|
-
const Q = (Y - x.bornAt) / 1e3;
|
|
375
|
-
if (y.current) {
|
|
376
|
-
const P = Q < 1.2;
|
|
377
|
-
if (y.current.visible = P, P) {
|
|
378
|
-
const N = Q / 1.2;
|
|
379
|
-
y.current.scale.set(1 - N * 0.5, Math.min(1, N * 4), 1 - N * 0.5), y.current.rotation.y = D * 3, i.shimmer.opacity = 0.75 * (1 - N) * (0.75 + 0.25 * Math.sin(D * 40));
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
if (B.current) {
|
|
383
|
-
const P = !!x.exitAt;
|
|
384
|
-
if (B.current.visible = P, P) {
|
|
385
|
-
m.exitPos.lengthSq() || Re(V, m.exitR + 2.7, C, L, Ge + 0.15, m.exitPos), B.current.position.copy(m.exitPos), B.current.rotation.set(0, Math.atan2(de.x - K.x, de.z - K.z), 0);
|
|
386
|
-
const N = Math.sin(Math.PI * Math.min(1, G * 1.15));
|
|
387
|
-
B.current.scale.setScalar(Math.max(1e-3, N) * (p ? 0.85 : 1)), i.portal.color.copy(b).multiplyScalar(2 + 3 * N);
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
S.current && (S.current.visible = t, S.current.rotation.z = D);
|
|
391
|
-
});
|
|
392
|
-
const d = (u) => {
|
|
393
|
-
u.stopPropagation(), c(a);
|
|
394
|
-
};
|
|
395
|
-
return /* @__PURE__ */ w(Ee, { children: [
|
|
396
|
-
/* @__PURE__ */ w("group", { ref: M, children: [
|
|
397
|
-
/* @__PURE__ */ w("group", { ref: f, children: [
|
|
398
|
-
/* @__PURE__ */ r("mesh", { geometry: X.body, material: i.body, onClick: d, onPointerOver: () => document.body.style.cursor = "pointer", onPointerOut: () => document.body.style.cursor = "" }),
|
|
399
|
-
Ft.map((u) => /* @__PURE__ */ r("mesh", { geometry: X.window, material: i.win, position: [u, 0.06, 0] }, u)),
|
|
400
|
-
/* @__PURE__ */ r("mesh", { geometry: X.roof, material: i.win, position: [0, 0.27, 0] }),
|
|
401
|
-
/* @__PURE__ */ r("mesh", { geometry: X.lamp, material: i.lampF, position: [0.74, 0.02, 0] }),
|
|
402
|
-
/* @__PURE__ */ r("mesh", { geometry: X.lamp, material: i.lampR, position: [-0.74, 0.02, 0], scale: 0.7 }),
|
|
403
|
-
/* @__PURE__ */ r("mesh", { geometry: X.beam, material: i.beam, position: [1.55, -0.05, 0] })
|
|
404
|
-
] }),
|
|
405
|
-
/* @__PURE__ */ r("mesh", { ref: g, geometry: X.halo, material: i.halo }),
|
|
406
|
-
/* @__PURE__ */ r("mesh", { ref: y, geometry: X.shimmer, material: i.shimmer, position: [0, 1.2, 0], visible: !1 }),
|
|
407
|
-
/* @__PURE__ */ r("mesh", { ref: S, geometry: X.sel, material: i.sel, rotation: [-Math.PI / 2, 0, 0], position: [0, -0.22, 0], visible: !1 })
|
|
408
|
-
] }),
|
|
409
|
-
/* @__PURE__ */ w("group", { ref: B, visible: !1, children: [
|
|
410
|
-
/* @__PURE__ */ r("mesh", { geometry: X.portal, material: i.portal }),
|
|
411
|
-
/* @__PURE__ */ r("mesh", { geometry: X.portalDisc, material: i.portalDisc })
|
|
412
|
-
] })
|
|
413
|
-
] });
|
|
414
|
-
}
|
|
415
|
-
const me = new n.Vector3();
|
|
416
|
-
function Ue(e, t, c, a, s) {
|
|
417
|
-
me.copy(e).add(t).multiplyScalar(0.5), me.y += a;
|
|
418
|
-
const o = 1 - c;
|
|
419
|
-
return s.set(o * o * e.x + 2 * o * c * me.x + c * c * t.x, o * o * e.y + 2 * o * c * me.y + c * c * t.y, o * o * e.z + 2 * o * c * me.z + c * c * t.z);
|
|
420
|
-
}
|
|
421
|
-
const se = 10, Ne = 48, $e = new n.Vector3(), Te = new n.Vector3(), he = new n.Object3D(), Ke = new n.Color(), He = Object.fromEntries(Object.entries(ke).map(([e, t]) => [e, new n.Color(t)])), Je = /* @__PURE__ */ new Map();
|
|
422
|
-
function Xt() {
|
|
423
|
-
const e = v(null);
|
|
424
|
-
return J(() => {
|
|
425
|
-
const t = e.current;
|
|
426
|
-
if (!t) return;
|
|
427
|
-
const c = performance.now();
|
|
428
|
-
let a = 0;
|
|
429
|
-
const s = (o, p, M, f, g, y, B) => {
|
|
430
|
-
for (let S = 0; S < se && a < Ne * se; S++) {
|
|
431
|
-
const i = M - S / se * B;
|
|
432
|
-
i < 0 || M >= 1 ? he.scale.setScalar(1e-4) : (Ue(o, p, i, f, $e), he.position.copy($e), he.scale.setScalar(y * (1 - S / se * 0.75))), he.updateMatrix(), t.setMatrixAt(a, he.matrix), Ke.copy(g).multiplyScalar(S === 0 ? 5 : 3 * (1 - S / se)), t.setColorAt(a, Ke), a++;
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
for (const o of T.comets) {
|
|
436
|
-
const p = ge(o.from), M = ge(o.to);
|
|
437
|
-
if (!p || !M) continue;
|
|
438
|
-
const f = Math.min(1, (c - o.start) / o.dur), g = f < 0.5 ? 2 * f * f : 1 - Math.pow(-2 * f + 2, 2) / 2, y = T.instances.get(o.from);
|
|
439
|
-
s(p, M, g, 0.9, y ? He[y.type] : He.planner, 1, 0.22);
|
|
440
|
-
}
|
|
441
|
-
for (const o of T.mcpCalls) {
|
|
442
|
-
const p = T.mcpServers.get(o.server), M = nt(o.server), f = ge(o.instance);
|
|
443
|
-
if (!p || !M || !f) continue;
|
|
444
|
-
Te.copy(M).setY(0.9);
|
|
445
|
-
const g = Math.min(1, (c - o.start) / o.dur), y = 1 - Math.pow(1 - g, 2.2);
|
|
446
|
-
let B = Je.get(p.name);
|
|
447
|
-
B || Je.set(p.name, B = new n.Color(p.color)), o.phase === "call" ? s(f, Te, y, 3.2, B, 1.5, 0.3) : s(Te, f, y, 3.2, Yt, 1.5, 0.3);
|
|
448
|
-
}
|
|
449
|
-
t.count = a, t.instanceMatrix.needsUpdate = !0, t.instanceColor && (t.instanceColor.needsUpdate = !0);
|
|
450
|
-
}), /* @__PURE__ */ w("instancedMesh", { ref: e, args: [void 0, void 0, Ne * se], frustumCulled: !1, children: [
|
|
451
|
-
/* @__PURE__ */ r("sphereGeometry", { args: [0.12, 10, 10] }),
|
|
452
|
-
/* @__PURE__ */ r("meshBasicMaterial", { toneMapped: !1, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1 })
|
|
453
|
-
] });
|
|
454
|
-
}
|
|
455
|
-
const Yt = new n.Color("#ffffff"), jt = (() => {
|
|
456
|
-
const e = [];
|
|
457
|
-
for (let c = 0; c < 10; c++) {
|
|
458
|
-
const a = -1.7 - c * 0.42;
|
|
459
|
-
e.push(a, 0.04, 0, a - 0.25, 0.04, 0);
|
|
460
|
-
}
|
|
461
|
-
const t = new n.BufferGeometry();
|
|
462
|
-
return t.setAttribute("position", new n.Float32BufferAttribute(e, 3)), t;
|
|
463
|
-
})();
|
|
464
|
-
function Zt({ mcp: e }) {
|
|
465
|
-
const t = e.srv, c = t.name, a = t.color ?? Ct[c] ?? "#94a3b8", s = v(null), o = v(null), p = v(null), M = v(null), f = A(() => new n.LineBasicMaterial({ color: I(a, 0.9), transparent: !0, opacity: 0.45, toneMapped: !1 }), [a]);
|
|
466
|
-
return J(({ clock: g }, y) => {
|
|
467
|
-
s.current && (s.current.position.set(e.pos.x, 0.9, e.pos.z), s.current.rotation.y = Math.atan2(-e.out.z, e.out.x));
|
|
468
|
-
const B = performance.now(), S = Math.exp(-(B - t.activeAt) / 450), i = t.inflight > 0;
|
|
469
|
-
o.current && (o.current.rotation.y += y * (H ? 0.1 : i ? 2.4 : 0.25)), p.current && (p.current.material.color.set(a).multiplyScalar(1.5 + S * 5 + (i ? 1 + Math.sin(g.elapsedTime * 8) : 0)), p.current.scale.setScalar(1 + S * 0.8)), M.current && M.current.material.color.set(a).multiplyScalar(0.5 + S * 2 + (i ? 0.6 : 0)), f.opacity = 0.3 + S * 0.6 + (i ? 0.25 : 0);
|
|
470
|
-
}), /* @__PURE__ */ w("group", { ref: s, children: [
|
|
471
|
-
/* @__PURE__ */ r("lineSegments", { geometry: jt, material: f, position: [0, -0.85, 0] }),
|
|
472
|
-
/* @__PURE__ */ w("mesh", { ref: M, rotation: [-Math.PI / 2, 0, 0], position: [0, -0.85, 0], children: [
|
|
473
|
-
/* @__PURE__ */ r("ringGeometry", { args: [1.25, 1.55, 6] }),
|
|
474
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: a, toneMapped: !1, side: n.DoubleSide })
|
|
475
|
-
] }),
|
|
476
|
-
/* @__PURE__ */ w("mesh", { rotation: [-Math.PI / 2, 0, 0], position: [0, -0.86, 0], children: [
|
|
477
|
-
/* @__PURE__ */ r("circleGeometry", { args: [1.25, 6] }),
|
|
478
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: "#070b18" })
|
|
479
|
-
] }),
|
|
480
|
-
/* @__PURE__ */ w("mesh", { position: [0, -0.35, 0], children: [
|
|
481
|
-
/* @__PURE__ */ r("cylinderGeometry", { args: [0.18, 0.3, 1, 8] }),
|
|
482
|
-
/* @__PURE__ */ r("meshStandardMaterial", { color: "#111827", emissive: a, emissiveIntensity: 0.4, metalness: 0.6, roughness: 0.3 })
|
|
483
|
-
] }),
|
|
484
|
-
/* @__PURE__ */ w("group", { ref: o, position: [0, 0.3, 0], children: [
|
|
485
|
-
/* @__PURE__ */ w("mesh", { rotation: [Math.PI / 2, 0, 0], children: [
|
|
486
|
-
/* @__PURE__ */ r("torusGeometry", { args: [0.85, 0.045, 8, 48] }),
|
|
487
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: I(a, 2), toneMapped: !1 })
|
|
488
|
-
] }),
|
|
489
|
-
/* @__PURE__ */ w("mesh", { rotation: [Math.PI / 2.6, 0, 0], children: [
|
|
490
|
-
/* @__PURE__ */ r("torusGeometry", { args: [0.62, 0.03, 8, 40] }),
|
|
491
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: I(a, 1.6), toneMapped: !1 })
|
|
492
|
-
] })
|
|
493
|
-
] }),
|
|
494
|
-
/* @__PURE__ */ w("mesh", { ref: p, position: [0, 0.3, 0], children: [
|
|
495
|
-
/* @__PURE__ */ r("sphereGeometry", { args: [0.2, 16, 16] }),
|
|
496
|
-
/* @__PURE__ */ r("meshBasicMaterial", { color: a, toneMapped: !1 })
|
|
497
|
-
] }),
|
|
498
|
-
/* @__PURE__ */ r(Ae, { position: [0, 1.55, 0], text: c, color: a, size: 0.34, pxRange: [9, 13] })
|
|
499
|
-
] });
|
|
500
|
-
}
|
|
501
|
-
const Me = 36, Ve = 24;
|
|
502
|
-
function qt() {
|
|
503
|
-
const e = A(() => {
|
|
504
|
-
const f = new n.BufferGeometry();
|
|
505
|
-
return f.setAttribute("position", new n.BufferAttribute(new Float32Array(Ve * Me * 6), 3)), f.setAttribute("color", new n.BufferAttribute(new Float32Array(Ve * Me * 6), 3)), f;
|
|
506
|
-
}, []), t = A(() => new n.Vector3(), []), c = A(() => new n.Vector3(), []), a = A(() => new n.Vector3(), []), s = A(() => new n.Color(), []), o = A(() => new n.Color("#fbbf24"), []), p = A(() => new n.Color("#ef4444"), []), M = A(() => new n.Color(), []);
|
|
507
|
-
return J(({ clock: f }) => {
|
|
508
|
-
const g = e.getAttribute("position"), y = e.getAttribute("color"), B = performance.now(), S = f.elapsedTime;
|
|
509
|
-
let i = 0, b = 0;
|
|
510
|
-
const R = (l, d, u, h) => {
|
|
511
|
-
const x = T.mcpServers.get(d), F = ge(l), V = nt(d);
|
|
512
|
-
if (!(!x || !F || !V || b >= Ve)) {
|
|
513
|
-
if (b++, t.copy(V).setY(0.9), s.set(x.color), u === "pending") {
|
|
514
|
-
const m = h;
|
|
515
|
-
m < 1 ? s.lerp(o, m) : s.copy(o).lerp(p, Math.min(1, (m - 1) / 1));
|
|
516
|
-
}
|
|
517
|
-
for (let m = 0; m < Me; m++) {
|
|
518
|
-
const C = m / Me, L = (m + 1) / Me;
|
|
519
|
-
Ue(F, t, C, 3.2, c), Ue(F, t, L, 3.2, a);
|
|
520
|
-
let _;
|
|
521
|
-
if (u === "pending") {
|
|
522
|
-
const E = ((C * 7 - S * (H ? 0.4 : 1.8)) % 1 + 1) % 1;
|
|
523
|
-
_ = (0.35 + Math.min(1.6, h * 0.8)) * (0.25 + (E < 0.35 ? 1.6 : 0));
|
|
524
|
-
} else {
|
|
525
|
-
const E = 1 - h, Y = Math.abs(C - E);
|
|
526
|
-
_ = Math.exp(-Y * Y * 120) * 7 + 0.6 * (1 - h), s.set("#ffffff");
|
|
527
|
-
}
|
|
528
|
-
M.copy(s).multiplyScalar(_), g.setXYZ(i, c.x, c.y, c.z), y.setXYZ(i++, M.r, M.g, M.b), g.setXYZ(i, a.x, a.y, a.z), y.setXYZ(i++, M.r, M.g, M.b);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
for (const l of T.mcpPending.values()) R(l.instance, l.server, "pending", Gt(l, B));
|
|
533
|
-
for (const l of T.mcpResolved) R(l.instance, l.server, "resolved", Math.min(1, (B - l.resolvedAt) / 700));
|
|
534
|
-
e.setDrawRange(0, i), g.needsUpdate = !0, y.needsUpdate = !0;
|
|
535
|
-
}), /* @__PURE__ */ r("lineSegments", { geometry: e, frustumCulled: !1, children: /* @__PURE__ */ r("lineBasicMaterial", { vertexColors: !0, transparent: !0, blending: n.AdditiveBlending, depthWrite: !1, toneMapped: !1 }) });
|
|
536
|
-
}
|
|
537
|
-
const Nt = new n.Vector3(), Qe = { u0: 0, u1: 0 };
|
|
538
|
-
function $t(e) {
|
|
539
|
-
for (const t of Se.runs.values())
|
|
540
|
-
Fe(t, Qe), e(et(t, Qe.u0 + 3, -3.4, Nt), 1.5);
|
|
541
|
-
}
|
|
542
|
-
const Kt = /* @__PURE__ */ w(Ee, { children: [
|
|
543
|
-
/* @__PURE__ */ r("fog", { attach: "fog", args: ["#02040a", 60, 140] }),
|
|
544
|
-
/* @__PURE__ */ r("ambientLight", { intensity: 0.35 }),
|
|
545
|
-
/* @__PURE__ */ r("pointLight", { position: [0, 8, 0], intensity: 60, distance: 40, color: "#818cf8" }),
|
|
546
|
-
/* @__PURE__ */ r("directionalLight", { position: [10, 20, 8], intensity: 0.6, color: "#c7d2fe" }),
|
|
547
|
-
/* @__PURE__ */ r(lt, { radius: 120, depth: 50, count: H ? 1200 : 3500, factor: 3, saturation: 0.3, fade: !0, speed: 0.4 }),
|
|
548
|
-
/* @__PURE__ */ r(
|
|
549
|
-
pt,
|
|
550
|
-
{
|
|
551
|
-
position: [0, -0.02, 0],
|
|
552
|
-
args: [120, 120],
|
|
553
|
-
cellSize: 1,
|
|
554
|
-
cellThickness: 0.5,
|
|
555
|
-
cellColor: "#0f1733",
|
|
556
|
-
sectionSize: 6,
|
|
557
|
-
sectionThickness: 0.9,
|
|
558
|
-
sectionColor: "#1e2a5a",
|
|
559
|
-
fadeDistance: 90,
|
|
560
|
-
fadeStrength: 1.6,
|
|
561
|
-
infiniteGrid: !0
|
|
562
|
-
}
|
|
563
|
-
)
|
|
564
|
-
] });
|
|
565
|
-
function rn() {
|
|
566
|
-
return /* @__PURE__ */ w(
|
|
567
|
-
Rt,
|
|
568
|
-
{
|
|
569
|
-
title: "subway",
|
|
570
|
-
subtitle: "neon transit map · each hatchet run is a line, each agent a train, MCP servers are airports, the knowledge graph is Graph Central",
|
|
571
|
-
preset: "lanes",
|
|
572
|
-
plane: "xz",
|
|
573
|
-
camera: { position: [0, 29, 35], fov: 46 },
|
|
574
|
-
controls: { maxPolarAngle: Math.PI * 0.42, minPolarAngle: Math.PI * 0.12 },
|
|
575
|
-
bg: "#02040a",
|
|
576
|
-
gl: { preserveDrawingBuffer: !0 },
|
|
577
|
-
fit: { nRef: 4, min: 0.7, max: 1.3, minRadius: 7.5 },
|
|
578
|
-
agentRadius: 1,
|
|
579
|
-
graph: { natural: zt, radius: 2.8 },
|
|
580
|
-
peripheryGap: 4.5,
|
|
581
|
-
Background: Kt,
|
|
582
|
-
Agent: Wt,
|
|
583
|
-
RunMarker: Ut,
|
|
584
|
-
McpServer: Zt,
|
|
585
|
-
GraphResource: Tt,
|
|
586
|
-
cluster: { radius: 1.9, variant: "stars", pointSize: 1.1 },
|
|
587
|
-
clusterOffset: [0, 1.9, 0],
|
|
588
|
-
extents: $t,
|
|
589
|
-
PostFX: /* @__PURE__ */ w(ut, { multisampling: 0, children: [
|
|
590
|
-
/* @__PURE__ */ r(ft, { mipmapBlur: !0, intensity: 1.25, luminanceThreshold: 0.22, luminanceSmoothing: 0.25, radius: 0.72 }),
|
|
591
|
-
/* @__PURE__ */ r(dt, { eskil: !1, offset: 0.22, darkness: 0.85 }),
|
|
592
|
-
/* @__PURE__ */ r(mt, { opacity: 0.025 })
|
|
593
|
-
] }),
|
|
594
|
-
children: [
|
|
595
|
-
/* @__PURE__ */ r(Vt, {}),
|
|
596
|
-
/* @__PURE__ */ r(Ot, {}),
|
|
597
|
-
/* @__PURE__ */ r(Xt, {}),
|
|
598
|
-
/* @__PURE__ */ r(qt, {})
|
|
599
|
-
]
|
|
600
|
-
}
|
|
601
|
-
);
|
|
602
|
-
}
|
|
603
|
-
export {
|
|
604
|
-
rn as default
|
|
605
|
-
};
|