agentglow 0.2.10 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -16
- package/cli/agentglow.mjs +22 -3
- package/cli/lib/server.mjs +44 -13
- package/cli/lib/settings.mjs +3 -3
- package/dist/chunks/KitScene-Cug87OSc.js +3121 -0
- package/dist/chunks/index-B0urBeRS.js +48 -0
- package/dist/chunks/index-BM4W1tNM.js +495 -0
- package/dist/chunks/{index-D-r9aJ4u.js → index-BTFr1mn1.js} +175 -175
- package/dist/chunks/index-Cj5cs1rS.js +948 -0
- package/dist/chunks/{index-_IwfbZy7.js → index-iZBODPwI.js} +175 -175
- package/dist/chunks/index-ueGnGU_X.js +838 -0
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/themes.d.ts +1 -1
- package/dist/types/world.d.ts +71 -6
- package/package.json +1 -1
- package/dist/chunks/KitScene-Bm1I35Zc.js +0 -3041
- package/dist/chunks/index-AugvjZJN.js +0 -838
- package/dist/chunks/index-BAQDf-0T.js +0 -492
- package/dist/chunks/index-BRnLrSfZ.js +0 -605
- package/dist/chunks/index-BWsSd_Wm.js +0 -784
- package/dist/chunks/index-C2vLpNCb.js +0 -980
- package/dist/chunks/index-CGTp73GN.js +0 -1010
- package/dist/chunks/index-CKyn9lcT.js +0 -753
- package/dist/chunks/index-COLbf8XM.js +0 -1086
- package/dist/chunks/index-CnoB0ZDk.js +0 -889
- package/dist/chunks/index-D4Wlmsay.js +0 -68
- package/dist/chunks/index-KmczAvvY.js +0 -818
- package/dist/chunks/index-Z4vdWCok.js +0 -763
- package/dist/chunks/index-cRPj-lzn.js +0 -1143
- package/dist/chunks/index-uZGu9jzU.js +0 -887
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as b, useContext as v, useMemo as S, Suspense as w, lazy as A } from "react";
|
|
3
|
+
const m = (e) => (e ?? "").trim().replace(/\/+$/, "");
|
|
4
|
+
function C() {
|
|
5
|
+
var t;
|
|
6
|
+
const e = typeof location > "u" ? new URLSearchParams() : new URLSearchParams(location.search), n = (o) => e.has(o) && !["0", "false", "no"].includes(e.get(o).toLowerCase());
|
|
7
|
+
return {
|
|
8
|
+
source: m(e.get("source")),
|
|
9
|
+
sim: n("sim"),
|
|
10
|
+
hud: e.get("hud") === null ? !0 : n("hud"),
|
|
11
|
+
embedded: !1,
|
|
12
|
+
run: ((t = e.get("run")) == null ? void 0 : t.trim()) || void 0
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const d = b(null), E = d.Provider;
|
|
16
|
+
function F() {
|
|
17
|
+
return v(d) ?? C();
|
|
18
|
+
}
|
|
19
|
+
const M = ["neural", "constellation", "orbit", "atom", "flow"], T = {
|
|
20
|
+
orbit: { name: "Orbit", tagline: "Agents orbit a graph galaxy; runs are rings, MCP servers are satellites." },
|
|
21
|
+
neural: { name: "Neural", tagline: "A living brain: agents fire as neurons, messages pulse along synapses." },
|
|
22
|
+
flow: { name: "Flow", tagline: "A murmuration: agents condense as eddies out of the current." },
|
|
23
|
+
constellation: { name: "Constellation", tagline: "A night sky: agents are stars linked into constellations as they delegate." },
|
|
24
|
+
atom: { name: "Atom", tagline: "An atom: agents are electrons in shells, subagents jump orbits, LLM calls flash photons." }
|
|
25
|
+
}, x = {
|
|
26
|
+
orbit: () => import("./index-BM4W1tNM.js"),
|
|
27
|
+
neural: () => import("./index-iZBODPwI.js"),
|
|
28
|
+
flow: () => import("./index-Cj5cs1rS.js"),
|
|
29
|
+
constellation: () => import("./index-BTFr1mn1.js"),
|
|
30
|
+
atom: () => import("./index-ueGnGU_X.js")
|
|
31
|
+
}, g = /* @__PURE__ */ new Map();
|
|
32
|
+
function y(e) {
|
|
33
|
+
let n = g.get(e);
|
|
34
|
+
return n || g.set(e, n = A(x[e])), n;
|
|
35
|
+
}
|
|
36
|
+
function H({ theme: e = "neural", source: n = "", hud: t = !0, sim: o = !1, scope: s, run: r, token: l, style: f, className: i }) {
|
|
37
|
+
const c = M.includes(e) ? e : "neural", p = y(c), u = m(n), h = S(
|
|
38
|
+
() => ({ source: u, sim: o, hud: t, embedded: !0, scope: s || void 0, run: r || void 0, token: l || void 0 }),
|
|
39
|
+
[u, o, t, s, r, l]
|
|
40
|
+
);
|
|
41
|
+
return /* @__PURE__ */ a("div", { className: `agentglow-embed${i ? ` ${i}` : ""}`, style: f, "data-theme": c, children: /* @__PURE__ */ a(E, { value: h, children: /* @__PURE__ */ a(w, { fallback: null, children: /* @__PURE__ */ a(p, {}) }) }) });
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
H as A,
|
|
45
|
+
M as T,
|
|
46
|
+
T as a,
|
|
47
|
+
F as u
|
|
48
|
+
};
|
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
import { jsxs as L, jsx as a, Fragment as se } from "react/jsx-runtime";
|
|
2
|
+
import { Trail as be, Sparkles as He, Stars as je } from "@react-three/drei";
|
|
3
|
+
import { EffectComposer as Ke, Bloom as Qe, Vignette as Je, Noise as et } from "@react-three/postprocessing";
|
|
4
|
+
import { useFrame as N } from "@react-three/fiber";
|
|
5
|
+
import { useRef as A, useMemo as R, useEffect as tt, useState as De } from "react";
|
|
6
|
+
import * as e from "three";
|
|
7
|
+
import { h as oe, i as nt, T as le, f as ot, a as Z, p as rt, e as st, l as at, s as ct, L as ue, w as T, K as it, G as lt, m as Fe, b as Q, c as Re, d as ut, g as Me, S as ye, R as pt, j as ft, u as dt, k as mt, n as ht } from "./KitScene-Cug87OSc.js";
|
|
8
|
+
var Ye;
|
|
9
|
+
const F = typeof window < "u" && !!((Ye = window.matchMedia) != null && Ye.call(window, "(prefers-reduced-motion: reduce)").matches), _e = Math.PI * 2, Ge = [Math.PI * 0.5, Math.PI * 0.5 + _e / 3, Math.PI * 0.5 + _e * 2 / 3], Ve = nt, yt = (t) => (oe(t, 11) - 0.5) * 2.4, V = {
|
|
10
|
+
/** the galaxy's inner (tilted) group; its matrixWorld includes the kit's side placement + scale */
|
|
11
|
+
group: null,
|
|
12
|
+
pos: [],
|
|
13
|
+
index: /* @__PURE__ */ new Map()
|
|
14
|
+
};
|
|
15
|
+
function Te(t) {
|
|
16
|
+
const s = t.toLowerCase();
|
|
17
|
+
let o = V.index.get(s);
|
|
18
|
+
if (o === void 0) {
|
|
19
|
+
const n = Math.max(1, V.pos.length);
|
|
20
|
+
let i = 7;
|
|
21
|
+
for (let m = 0; m < s.length; m++) i = i * 31 + s.charCodeAt(m) >>> 0;
|
|
22
|
+
o = i % n, V.index.set(s, o);
|
|
23
|
+
}
|
|
24
|
+
return o;
|
|
25
|
+
}
|
|
26
|
+
function gt(t, s) {
|
|
27
|
+
const o = V.group;
|
|
28
|
+
return !o || !V.pos.length ? !1 : (s.copy(V.pos[Te(t)]).applyMatrix4(o.matrixWorld), !0);
|
|
29
|
+
}
|
|
30
|
+
const Mt = new e.Color("#ef4444"), wt = new e.Color("#f59e0b"), bt = new e.Color("#ffffff"), xt = new e.SphereGeometry(1, 32, 32), vt = new e.SphereGeometry(1, 24, 24), St = new e.SphereGeometry(0.06, 10, 10), At = new e.RingGeometry(0.85, 1, 48), Ct = new e.RingGeometry(0.92, 1, 48), Bt = new e.Vector3();
|
|
31
|
+
function Gt(t) {
|
|
32
|
+
for (const s of T.mcpPending.values()) if (s.instance === t) return !0;
|
|
33
|
+
return !1;
|
|
34
|
+
}
|
|
35
|
+
function Rt({ agent: t, selected: s, onSelect: o }) {
|
|
36
|
+
const n = t.inst, i = n.id, m = n.type, c = le[m], g = Ve(m), r = g ? 0.46 : 0.35, p = A(null), f = A(null), u = A(null), w = A(null), y = A(null), d = A(null), b = A(null), h = A(null), P = A(""), q = A(1), X = R(() => new e.Color(c), [c]), B = R(() => new e.Color(), []), C = R(
|
|
37
|
+
() => ({
|
|
38
|
+
core: new e.MeshBasicMaterial({ toneMapped: !1 }),
|
|
39
|
+
halo: new e.MeshBasicMaterial({ color: c, transparent: !0, opacity: 0.1, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
|
|
40
|
+
electron: new e.MeshBasicMaterial({ color: new e.Color(4, 4, 4), toneMapped: !1 }),
|
|
41
|
+
shock: new e.MeshBasicMaterial({ transparent: !0, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1, side: e.DoubleSide }),
|
|
42
|
+
sel: new e.MeshBasicMaterial({ color: new e.Color(3, 3, 3), transparent: !0, opacity: 0.8, depthWrite: !1, toneMapped: !1, side: e.DoubleSide })
|
|
43
|
+
}),
|
|
44
|
+
[c]
|
|
45
|
+
), x = R(() => ({ phase: oe(i, 12) * Math.PI * 2, rr: 0.75 + oe(i, 13) * 0.5, tilt: 0.25 + oe(i, 14) * 0.5, seed: oe(i, 15) * Math.PI * 2, last: -1, born: new e.Vector3(), bornSet: !1 }), [i]);
|
|
46
|
+
N(({ clock: E, camera: I }) => {
|
|
47
|
+
var Oe;
|
|
48
|
+
const M = p.current;
|
|
49
|
+
if (!M) return;
|
|
50
|
+
const l = performance.now(), v = E.elapsedTime, G = x.last < 0 ? 0 : Math.min(0.1, v - x.last);
|
|
51
|
+
x.last = v;
|
|
52
|
+
const S = n.status, O = S === "thinking" ? g ? 1.5 : 0.75 : S === "waiting" ? g ? 0.35 : 0.18 : g ? 0.8 : 0.4;
|
|
53
|
+
x.phase += G * O * (F ? 0.3 : 1);
|
|
54
|
+
const Y = (g ? 0.42 : 0.24) * ot.spread * x.rr * (F ? 0.4 : 1), $ = t.live;
|
|
55
|
+
$.copy(t.pos), $.x += Math.cos(x.phase) * Y, $.z += Math.sin(x.phase) * Y, $.y += Math.sin(x.phase * 2 + x.seed) * Y * x.tilt + (F ? 0 : Math.sin(v * 0.9 + x.seed) * 0.12);
|
|
56
|
+
const U = Math.min(1, (l - n.bornAt) / 950);
|
|
57
|
+
if (U < 1) {
|
|
58
|
+
const _ = n.parent ? Z(n.parent) : void 0;
|
|
59
|
+
x.bornSet || (x.born.copy(_ ?? $), x.bornSet = !0), _ && x.born.copy(_);
|
|
60
|
+
const Be = 1 - Math.pow(1 - U, 3);
|
|
61
|
+
$.lerpVectors(Bt.copy(x.born), $, Be);
|
|
62
|
+
}
|
|
63
|
+
M.position.copy($);
|
|
64
|
+
const j = rt(n, l), pe = st(n, l), J = (l - n.bornAt) / 1e3, H = n.exitAt ? (l - n.exitAt) / at(n) : 0, ee = r * t.scale, fe = !n.exitAt && S === "thinking", xe = !n.exitAt && S === "waiting", Ee = !n.exitAt && Gt(i), de = F ? 0.3 : 1, ve = fe ? 0.5 + 0.5 * Math.sin(v * 7 * de) : 0, Se = xe || Ee ? 0.5 + 0.5 * Math.sin(v * 1.7 * de) : 0;
|
|
65
|
+
let me = fe ? 2.4 + ve * 1.8 : xe ? 0.35 + Se * 0.55 : 1.3;
|
|
66
|
+
me += pe * 5;
|
|
67
|
+
const Ae = J < 0.6 ? 1 - J / 0.6 : 0;
|
|
68
|
+
me += Ae * 3.5;
|
|
69
|
+
let Ce = j * (1 + pe * 0.35 + ve * 0.12 + Se * 0.08), ae = 0;
|
|
70
|
+
if (n.exitAt && (ae = H < 0.1 ? 1 - H / 0.1 : 0, Ce = H < 0.1 ? 1 + H * 4 : 1.4 * Math.pow(Math.max(0, 1 - (H - 0.1) / 0.75), 2), me = 2 + ae * 5), f.current && (f.current.scale.setScalar(Math.max(1e-3, ee * Ce)), B.copy(X), Ee && B.lerp(wt, 0.25 + Se * 0.25), S === "failed" && B.lerp(Mt, 0.8), ae > 0 && B.lerp(bt, ae * 0.7), C.core.color.copy(B).multiplyScalar(me)), u.current && (u.current.scale.setScalar(Math.max(1e-3, ee * Ce * (1.45 + pe * 0.6 + ve * 0.2 + Ae * 1))), C.halo.opacity = (fe ? 0.09 : xe ? 0.04 : 0.06) + pe * 0.06 + Ae * 0.15 + ae * 0.25), w.current && (w.current.visible = fe, w.current.scale.setScalar(Math.max(1e-3, ee * 2.2 * j)), w.current.rotation.y += 0.07 * de, w.current.rotation.x += 0.03 * de), y.current) {
|
|
71
|
+
let _ = -1;
|
|
72
|
+
J < 0.9 ? (_ = J / 0.9, C.shock.color.copy(X).multiplyScalar(2.2 * (1 - _) * (1 - _))) : n.exitAt && H < 0.5 && (_ = H / 0.5, C.shock.color.set(S === "failed" ? "#ef4444" : "#ffffff").multiplyScalar(2.5 * (1 - _) * (1 - _))), y.current.visible = _ >= 0, _ >= 0 && (y.current.quaternion.copy(I.quaternion), y.current.scale.setScalar(ee * (1.2 + _ * 2.6)));
|
|
73
|
+
}
|
|
74
|
+
if (d.current && (d.current.visible = s, d.current.quaternion.copy(I.quaternion), d.current.scale.setScalar(ee * 2.6 * Math.max(0.2, j))), (Oe = h.current) == null || Oe.position.set(0, -ee * 1.5 - 0.35, 0), b.current) {
|
|
75
|
+
const _ = n.exitAt ? S === "failed" ? "failed" : "done" : J < 2.4 ? "born" : "name";
|
|
76
|
+
if (_ !== P.current) {
|
|
77
|
+
P.current = _;
|
|
78
|
+
const Pe = i.split(":")[2], he = `${n.name}${Pe !== void 0 ? ` ${Number(Pe) + 1}` : ""}`;
|
|
79
|
+
b.current.setText(_ === "born" ? `+ ${he}` : _ === "done" ? `${he} done` : _ === "failed" ? `× ${he}` : he);
|
|
80
|
+
}
|
|
81
|
+
const Be = _ === "born" ? 1 : _ === "name" ? 0.85 : Math.max(0, 1 - H * 1.6);
|
|
82
|
+
q.current += ((ct(i) ? 1 : 0) - q.current) * 0.12, b.current.setOpacity(Be * q.current * Math.min(1, J / 0.4));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const k = (E) => (E.stopPropagation(), o(i));
|
|
86
|
+
return /* @__PURE__ */ L("group", { ref: p, position: t.pos, children: [
|
|
87
|
+
/* @__PURE__ */ a(be, { width: g ? 1.5 : 2.6, length: g ? 3 : 5, color: c, attenuation: (E) => E * E, decay: 1, children: /* @__PURE__ */ a("mesh", { ref: f, geometry: xt, material: C.core, scale: 1e-3, onClick: k, onPointerOver: () => document.body.style.cursor = "pointer", onPointerOut: () => document.body.style.cursor = "" }) }),
|
|
88
|
+
/* @__PURE__ */ a("mesh", { ref: u, geometry: vt, material: C.halo, scale: 1e-3, onClick: k }),
|
|
89
|
+
/* @__PURE__ */ a("group", { ref: w, visible: !1, children: [0, 1, 2].map((E) => /* @__PURE__ */ a("mesh", { geometry: St, material: C.electron, position: [Math.cos(E * Math.PI * 2 / 3), Math.sin(E * 2.1) * 0.35, Math.sin(E * Math.PI * 2 / 3)] }, E)) }),
|
|
90
|
+
/* @__PURE__ */ a("mesh", { ref: y, geometry: At, material: C.shock, visible: !1, raycast: () => null }),
|
|
91
|
+
/* @__PURE__ */ a("mesh", { ref: d, geometry: Ct, material: C.sel, visible: !1, raycast: () => null }),
|
|
92
|
+
/* @__PURE__ */ a("group", { ref: h, children: /* @__PURE__ */ a(ue, { ref: b, text: "", color: c, size: g ? 0.24 : 0.3, opacity: 0, fit: !0, pxRange: g ? [8, 11.5] : [9, 13] }) })
|
|
93
|
+
] });
|
|
94
|
+
}
|
|
95
|
+
function Tt(t) {
|
|
96
|
+
const s = [];
|
|
97
|
+
for (let n = 0; n < t; n++) {
|
|
98
|
+
const i = n / t, m = 0.45 + 4.1 * Math.sqrt(i) + (Math.random() - 0.5) * 0.4, g = n % 3 / 3 * Math.PI * 2 + m * 1.3 + (Math.random() - 0.5) * 0.5;
|
|
99
|
+
s.push(new e.Vector3(Math.cos(g) * m, (Math.random() - 0.5) * 0.5 * (1.4 - i), Math.sin(g) * m));
|
|
100
|
+
}
|
|
101
|
+
return s;
|
|
102
|
+
}
|
|
103
|
+
const ze = 32, Le = new e.Color(5, 5, 5), Et = 200, Ne = 1.35, Ue = 4.75 * Ne + 0.6, ge = 6;
|
|
104
|
+
function Ot({ galaxy: t }) {
|
|
105
|
+
const s = R(() => {
|
|
106
|
+
const B = t.nodes.slice(0, Et), C = new Set(B.map((x) => x.id));
|
|
107
|
+
return { nodes: B, links: t.links.filter((x) => C.has(x.source) && C.has(x.target)) };
|
|
108
|
+
}, [t]), o = A([]), n = A([]), i = A([]), m = A(Array(ge).fill(-1)), c = A(null), g = A(null), r = A(null), p = A(null), f = s.nodes.length, u = R(() => Tt(f), [f]), w = R(() => s.nodes.map((B) => new e.Color(it[B.kind] ?? "#94a3b8")), [s]), y = R(() => new Float32Array(Math.max(1, f)), [f]), d = R(() => new Uint8Array(Math.max(1, f)), [f]), b = R(() => new e.Object3D(), []), h = R(() => new e.Color(), []), P = R(() => new e.Vector3(), []), q = R(() => {
|
|
109
|
+
const B = new Map(s.nodes.map((M, l) => [M.id, l])), C = [], x = [], k = /* @__PURE__ */ new Set(), E = (M, l) => {
|
|
110
|
+
const v = M < l ? `${M}-${l}` : `${l}-${M}`;
|
|
111
|
+
M === l || k.has(v) || (k.add(v), C.push(u[M].x, u[M].y, u[M].z, u[l].x, u[l].y, u[l].z), x.push(w[M].r, w[M].g, w[M].b, w[l].r, w[l].g, w[l].b));
|
|
112
|
+
};
|
|
113
|
+
for (const M of s.links) {
|
|
114
|
+
const l = B.get(M.source), v = B.get(M.target);
|
|
115
|
+
l !== void 0 && v !== void 0 && u[l].distanceTo(u[v]) < 3 && E(l, v);
|
|
116
|
+
}
|
|
117
|
+
for (let M = 0; M < f; M++) {
|
|
118
|
+
let l = -1, v = -1, G = 1e9, S = 1e9;
|
|
119
|
+
for (let O = 0; O < f; O++) {
|
|
120
|
+
if (O === M) continue;
|
|
121
|
+
const Y = u[M].distanceToSquared(u[O]);
|
|
122
|
+
Y < G ? (v = l, S = G, l = O, G = Y) : Y < S && (v = O, S = Y);
|
|
123
|
+
}
|
|
124
|
+
l >= 0 && E(M, l), v >= 0 && S < 1.2 && E(M, v);
|
|
125
|
+
}
|
|
126
|
+
const I = new e.BufferGeometry();
|
|
127
|
+
return I.setAttribute("position", new e.Float32BufferAttribute(C, 3)), I.setAttribute("color", new e.Float32BufferAttribute(x, 3)), I;
|
|
128
|
+
}, [s, u, w, f]);
|
|
129
|
+
tt(() => (V.pos = u, V.index = new Map(s.nodes.map((B, C) => [B.name.toLowerCase(), C])), V.group = c.current, () => void (V.group = null)), [s, u]), N(({ camera: B, clock: C }) => {
|
|
130
|
+
const x = c.current, k = g.current;
|
|
131
|
+
if (!x || !k) return;
|
|
132
|
+
x.updateMatrixWorld();
|
|
133
|
+
const E = performance.now();
|
|
134
|
+
y.fill(0), d.fill(0);
|
|
135
|
+
let I = 0;
|
|
136
|
+
for (const l of T.flares) {
|
|
137
|
+
const v = (E - l.start) / 1e3, G = Te(l.node), S = Math.exp(-v * 1.3);
|
|
138
|
+
if (S > y[G] && (y[G] = S), l.op === "write" && (d[G] = 1), r.current && I < ze && v < 1.6) {
|
|
139
|
+
P.copy(u[G]).applyMatrix4(x.matrix), b.position.copy(P), b.quaternion.copy(B.quaternion);
|
|
140
|
+
const O = v / 1.6;
|
|
141
|
+
b.scale.setScalar((l.op === "write" ? 0.6 + O * 3.2 : 0.3 + O * 1.4) * (1 - O * 0.2)), b.updateMatrix(), r.current.setMatrixAt(I, b.matrix), l.op === "write" ? h.copy(Le).multiplyScalar(1 - O) : h.copy(w[G]).multiplyScalar(3 * (1 - O)), r.current.setColorAt(I, h), I++;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
r.current && (r.current.count = I, r.current.instanceMatrix.needsUpdate = !0, r.current.instanceColor && (r.current.instanceColor.needsUpdate = !0));
|
|
145
|
+
let M = 0;
|
|
146
|
+
for (let l = T.flares.length - 1; l >= 0 && M < ge; l--) {
|
|
147
|
+
const v = T.flares[l], G = (E - v.start) / 1e3;
|
|
148
|
+
if (G > 1.8) continue;
|
|
149
|
+
const S = Te(v.node);
|
|
150
|
+
let O = !1;
|
|
151
|
+
for (let U = 0; U < M; U++) m.current[U] === S && (O = !0);
|
|
152
|
+
if (O) continue;
|
|
153
|
+
const Y = o.current[M], $ = n.current[M];
|
|
154
|
+
Y && $ && (Y.position.copy(u[S]), (m.current[M] !== S || i.current[M] !== v.op) && ($.setText(`${v.op === "write" ? "wrote · " : ""}${v.node}`), i.current[M] = v.op, $.setColor(v.op === "write" ? "#ffffff" : `#${w[S].getHexString()}`)), $.setOpacity(Math.min(1, (1.8 - G) / 0.5)), Y.visible = !0), m.current[M] = S, M++;
|
|
155
|
+
}
|
|
156
|
+
for (let l = M; l < ge; l++)
|
|
157
|
+
m.current[l] = -1, o.current[l] && (o.current[l].visible = !1);
|
|
158
|
+
for (let l = 0; l < f; l++) {
|
|
159
|
+
const v = y[l];
|
|
160
|
+
b.position.copy(u[l]), b.quaternion.identity(), b.scale.setScalar(1 + v * (d[l] ? 4.5 : 3)), b.updateMatrix(), k.setMatrixAt(l, b.matrix), h.copy(w[l]).multiplyScalar(0.85 + v * 5), d[l] && h.lerp(Le, v * 0.7), k.setColorAt(l, h);
|
|
161
|
+
}
|
|
162
|
+
k.instanceMatrix.needsUpdate = !0, k.instanceColor && (k.instanceColor.needsUpdate = !0), p.current && p.current.scale.setScalar(1 + Math.sin(C.elapsedTime * 1.3) * 0.06);
|
|
163
|
+
});
|
|
164
|
+
const X = R(() => new e.Color("#c7d2fe").multiplyScalar(2.4), []);
|
|
165
|
+
return /* @__PURE__ */ L(se, { children: [
|
|
166
|
+
/* @__PURE__ */ L("group", { ref: c, rotation: [0.3, 0, 0.08], scale: Ne, children: [
|
|
167
|
+
/* @__PURE__ */ L("instancedMesh", { ref: g, args: [void 0, void 0, Math.max(1, f)], frustumCulled: !1, children: [
|
|
168
|
+
/* @__PURE__ */ a("sphereGeometry", { args: [0.065, 10, 10] }),
|
|
169
|
+
/* @__PURE__ */ a("meshBasicMaterial", { toneMapped: !1 })
|
|
170
|
+
] }),
|
|
171
|
+
/* @__PURE__ */ a("lineSegments", { geometry: q, children: /* @__PURE__ */ a("lineBasicMaterial", { vertexColors: !0, transparent: !0, opacity: 0.4, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1 }) }),
|
|
172
|
+
/* @__PURE__ */ L("mesh", { ref: p, children: [
|
|
173
|
+
/* @__PURE__ */ a("sphereGeometry", { args: [0.38, 32, 32] }),
|
|
174
|
+
/* @__PURE__ */ a("meshBasicMaterial", { color: X, toneMapped: !1 })
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ L("mesh", { children: [
|
|
177
|
+
/* @__PURE__ */ a("sphereGeometry", { args: [1.1, 32, 32] }),
|
|
178
|
+
/* @__PURE__ */ a("meshBasicMaterial", { color: "#818cf8", transparent: !0, opacity: 0.07, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1 })
|
|
179
|
+
] }),
|
|
180
|
+
Array.from({ length: ge }, (B, C) => /* @__PURE__ */ a("group", { ref: (x) => void (o.current[C] = x), visible: !1, children: /* @__PURE__ */ a(ue, { ref: (x) => void (n.current[C] = x), position: [0, 0.32, 0], text: "", size: 0.2, opacity: 0, pxRange: [8, 11.5] }) }, C)),
|
|
181
|
+
/* @__PURE__ */ a(He, { count: F ? 30 : 110, scale: [9, 1.3, 9], size: 0.7, speed: F ? 0.05 : 0.3, color: "#a5b4fc", opacity: 0.6 })
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ L("instancedMesh", { ref: r, args: [void 0, void 0, ze], frustumCulled: !1, children: [
|
|
184
|
+
/* @__PURE__ */ a("ringGeometry", { args: [0.2, 0.26, 40] }),
|
|
185
|
+
/* @__PURE__ */ a("meshBasicMaterial", { transparent: !0, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1, side: e.DoubleSide })
|
|
186
|
+
] }),
|
|
187
|
+
/* @__PURE__ */ a(lt, { position: [0, -0.6, Ue * 0.78], color: "#a5b4fc", size: 0.42, pxRange: [10, 15] })
|
|
188
|
+
] });
|
|
189
|
+
}
|
|
190
|
+
const W = new e.Vector3(), D = new e.Vector3(), z = new e.Color(), K = new e.Color(), ke = new e.Color("#f59e0b"), Pt = new e.Color("#ef4444"), ce = 900, te = 22;
|
|
191
|
+
function _t() {
|
|
192
|
+
const t = R(() => {
|
|
193
|
+
const s = new e.BufferGeometry();
|
|
194
|
+
return s.setAttribute("position", new e.BufferAttribute(new Float32Array(ce * 6), 3)), s.setAttribute("color", new e.BufferAttribute(new Float32Array(ce * 6), 3)), s;
|
|
195
|
+
}, []);
|
|
196
|
+
return N(({ clock: s }) => {
|
|
197
|
+
const o = t.getAttribute("position"), n = t.getAttribute("color"), i = performance.now(), m = s.elapsedTime;
|
|
198
|
+
let c = 0;
|
|
199
|
+
const g = (r, p, f, u) => {
|
|
200
|
+
c >= ce || (o.setXYZ(c * 2, r.x, r.y, r.z), o.setXYZ(c * 2 + 1, p.x, p.y, p.z), n.setXYZ(c * 2, f.r, f.g, f.b), n.setXYZ(c * 2 + 1, u.r, u.g, u.b), c++);
|
|
201
|
+
};
|
|
202
|
+
for (const r of T.flares) {
|
|
203
|
+
const p = (i - r.start) / 1900;
|
|
204
|
+
if (p >= 1 || !Q(r.instance)) continue;
|
|
205
|
+
const f = Z(r.instance);
|
|
206
|
+
if (!f || !gt(r.node, D)) continue;
|
|
207
|
+
const u = T.instances.get(r.instance), w = 1 - p;
|
|
208
|
+
r.op === "write" ? (z.setRGB(3, 3, 3.4).multiplyScalar(w), K.setRGB(5, 5, 5).multiplyScalar(w)) : (z.set(u ? le[u.type] : "#c7d2fe").multiplyScalar(1.6 * w), K.copy(z).multiplyScalar(1.6)), g(f, D, z, K);
|
|
209
|
+
}
|
|
210
|
+
for (const r of T.instances.values()) {
|
|
211
|
+
if (!r.parent || !Q(r)) continue;
|
|
212
|
+
const p = T.instances.get(r.parent);
|
|
213
|
+
if (!p) continue;
|
|
214
|
+
const f = (i - r.bornAt) / 1e3, u = f < 1.4 ? 1 - f / 1.4 : 0, w = Ve(r.type) && !r.exitAt ? 0.35 : 0, y = Math.max(u * 3, w);
|
|
215
|
+
if (y <= 0.01) continue;
|
|
216
|
+
const d = Z(r.parent), b = Z(r.id);
|
|
217
|
+
!d || !b || (z.set(le[p.type]).multiplyScalar(y), K.set(le[r.type]).multiplyScalar(y * 1.4), g(d, b, z, K));
|
|
218
|
+
}
|
|
219
|
+
for (const r of T.mcpPending.values()) {
|
|
220
|
+
if (!Q(r.instance)) continue;
|
|
221
|
+
const p = Z(r.instance), f = T.mcpServers.get(r.server), u = Re(r.server);
|
|
222
|
+
if (!p || !f || !u) continue;
|
|
223
|
+
D.copy(u), D.y += re(f.slot);
|
|
224
|
+
const w = ut(r, i), y = Math.min(1, w / 2.2), d = K.set(f.color);
|
|
225
|
+
y < 0.5 ? d.lerp(ke, y * 2) : d.copy(ke).lerp(Pt, (y - 0.5) * 2);
|
|
226
|
+
const b = 0.8 + Math.min(2.5, w * 0.9), h = m * (F ? 0.3 : 1.4);
|
|
227
|
+
for (let P = 0; P < te; P++) {
|
|
228
|
+
const q = P / te, X = (P + 0.55) / te, B = ((q - h) % 1 + 1) % 1, C = 0.25 + Math.pow(1 - B, 6) * 2.2 + ((q * 3 - h * 3) % 1 + 1) % 1 * 0.15;
|
|
229
|
+
z.copy(d).multiplyScalar(C * b), W.copy(p).lerp(D, q);
|
|
230
|
+
const x = W.x, k = W.y, E = W.z;
|
|
231
|
+
if (W.copy(p).lerp(D, X), c >= ce) break;
|
|
232
|
+
o.setXYZ(c * 2, x, k, E), o.setXYZ(c * 2 + 1, W.x, W.y, W.z), n.setXYZ(c * 2, z.r, z.g, z.b), n.setXYZ(c * 2 + 1, z.r, z.g, z.b), c++;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
for (const r of T.mcpResolved) {
|
|
236
|
+
const p = (i - r.resolvedAt) / 700;
|
|
237
|
+
if (p >= 1 || !Q(r.instance)) continue;
|
|
238
|
+
const f = Z(r.instance), u = T.mcpServers.get(r.server), w = Re(r.server);
|
|
239
|
+
if (!f || !u || !w) continue;
|
|
240
|
+
D.copy(w), D.y += re(u.slot);
|
|
241
|
+
const y = 1 - p;
|
|
242
|
+
for (let d = 0; d < te; d++) {
|
|
243
|
+
const b = d / te, h = (d + 1) / te, P = Math.abs(b - y), q = (1 - p) * (0.15 + Math.exp(-P * 18) * 5);
|
|
244
|
+
z.set(u.color).lerp(K.setRGB(1, 1, 1), 0.6).multiplyScalar(q), W.copy(f).lerp(D, b);
|
|
245
|
+
const X = W.x, B = W.y, C = W.z;
|
|
246
|
+
if (W.copy(f).lerp(D, h), c >= ce) break;
|
|
247
|
+
o.setXYZ(c * 2, X, B, C), o.setXYZ(c * 2 + 1, W.x, W.y, W.z), n.setXYZ(c * 2, z.r, z.g, z.b), n.setXYZ(c * 2 + 1, z.r, z.g, z.b), c++;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
t.setDrawRange(0, c * 2), o.needsUpdate = !0, n.needsUpdate = !0;
|
|
251
|
+
}), /* @__PURE__ */ a("lineSegments", { geometry: t, frustumCulled: !1, children: /* @__PURE__ */ a("lineBasicMaterial", { vertexColors: !0, transparent: !0, opacity: 0.95, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1 }) });
|
|
252
|
+
}
|
|
253
|
+
function zt(t, s, o, n, i) {
|
|
254
|
+
const m = (t.x + s.x) / 2, c = (t.y + s.y) / 2 + n, g = (t.z + s.z) / 2, r = 1 - o;
|
|
255
|
+
return i.set(r * r * t.x + 2 * r * o * m + o * o * s.x, r * r * t.y + 2 * r * o * c + o * o * s.y, r * r * t.z + 2 * r * o * g + o * o * s.z);
|
|
256
|
+
}
|
|
257
|
+
function Lt({ comet: t }) {
|
|
258
|
+
const s = A(null), o = T.instances.get(t.from), n = o ? le[o.type] : "#ffffff", i = R(() => new e.Color(n).multiplyScalar(4), [n]);
|
|
259
|
+
return N(() => {
|
|
260
|
+
const m = performance.now(), c = Math.min(1, (m - t.start) / t.dur), g = c < 0.5 ? 2 * c * c : 1 - Math.pow(-2 * c + 2, 2) / 2, r = Z(t.from), p = Z(t.to);
|
|
261
|
+
!s.current || !r || !p || (D.copy(r), zt(D, p, g, 1.2 + r.distanceTo(p) * 0.15, s.current.position), s.current.scale.setScalar(c >= 1 ? 1e-3 : 1));
|
|
262
|
+
}), /* @__PURE__ */ a(be, { width: 2.2, length: 7, color: n, attenuation: (m) => m * m, decay: 1.2, children: /* @__PURE__ */ L("mesh", { ref: s, scale: 1e-3, children: [
|
|
263
|
+
/* @__PURE__ */ a("sphereGeometry", { args: [0.13, 14, 14] }),
|
|
264
|
+
/* @__PURE__ */ a("meshBasicMaterial", { color: i, toneMapped: !1 })
|
|
265
|
+
] }) });
|
|
266
|
+
}
|
|
267
|
+
function kt() {
|
|
268
|
+
const [t, s] = De([]), o = A(-1);
|
|
269
|
+
return N(() => {
|
|
270
|
+
let n = T.comets.length * 7919 + Me.version * 104729;
|
|
271
|
+
for (const i of T.comets) n += i.id;
|
|
272
|
+
n !== o.current && (o.current = n, s(Me.grouped ? T.comets.filter((i) => Q(i.from) && Q(i.to)) : T.comets.slice()));
|
|
273
|
+
}), /* @__PURE__ */ a(se, { children: t.map((n) => /* @__PURE__ */ a(Lt, { comet: n }, n.id)) });
|
|
274
|
+
}
|
|
275
|
+
const It = new e.Vector3(0, 1, 0);
|
|
276
|
+
function $t({ call: t }) {
|
|
277
|
+
var i;
|
|
278
|
+
const s = A(null), o = ((i = T.mcpServers.get(t.server)) == null ? void 0 : i.color) ?? "#e5e7eb", n = R(() => new e.Color(o).lerp(new e.Color("#ffffff"), 0.35).multiplyScalar(6), [o]);
|
|
279
|
+
return N(() => {
|
|
280
|
+
var w;
|
|
281
|
+
const m = performance.now(), c = Math.min(1, (m - t.start) / t.dur), g = c * c * (3 - 2 * c), r = Z(t.instance), p = Re(t.server);
|
|
282
|
+
if (!s.current || !r || !p) return;
|
|
283
|
+
D.copy(p), D.y += re(((w = T.mcpServers.get(t.server)) == null ? void 0 : w.slot) ?? 0);
|
|
284
|
+
const f = t.phase === "call" ? r : D, u = t.phase === "call" ? D : r;
|
|
285
|
+
s.current.position.copy(f).lerp(u, g), W.copy(u).sub(f).normalize(), s.current.quaternion.setFromUnitVectors(It, W), s.current.scale.set(c >= 1 ? 1e-3 : 1, c >= 1 ? 1e-3 : 1, c >= 1 ? 1e-3 : 1);
|
|
286
|
+
}), /* @__PURE__ */ a(be, { width: 1.4, length: 10, color: o, attenuation: (m) => m * m * m, decay: 1.5, children: /* @__PURE__ */ L("mesh", { ref: s, scale: 1e-3, children: [
|
|
287
|
+
/* @__PURE__ */ a("capsuleGeometry", { args: [0.05, 0.7, 4, 8] }),
|
|
288
|
+
/* @__PURE__ */ a("meshBasicMaterial", { color: n, toneMapped: !1 })
|
|
289
|
+
] }) });
|
|
290
|
+
}
|
|
291
|
+
function Wt() {
|
|
292
|
+
const [t, s] = De([]), o = A(-1);
|
|
293
|
+
return N(() => {
|
|
294
|
+
let n = T.mcpCalls.length * 7919 + Me.version * 104729;
|
|
295
|
+
for (const i of T.mcpCalls) n += i.id;
|
|
296
|
+
n !== o.current && (o.current = n, s(Me.grouped ? T.mcpCalls.filter((i) => Q(i.instance)) : T.mcpCalls.slice()));
|
|
297
|
+
}), /* @__PURE__ */ a(se, { children: t.map((n) => /* @__PURE__ */ a($t, { call: n }, n.id)) });
|
|
298
|
+
}
|
|
299
|
+
const qt = new e.CylinderGeometry(0.22, 0.22, 0.75, 12), Xt = new e.TorusGeometry(0.5, 0.04, 8, 40), Yt = new e.BoxGeometry(0.3, 0.03, 0.03), Dt = new e.BoxGeometry(0.75, 0.02, 0.42), Ft = new e.SphereGeometry(0.55, 20, 20), re = (t) => t % 2 ? 0.9 : 1.6;
|
|
300
|
+
function Vt({ mcp: t }) {
|
|
301
|
+
const s = t.srv, o = s.color, n = A(null), i = A(null), m = A(null), c = R(() => new e.Color(o), [o]), g = R(
|
|
302
|
+
() => ({
|
|
303
|
+
body: new e.MeshBasicMaterial({ toneMapped: !1 }),
|
|
304
|
+
ring: new e.MeshBasicMaterial({ toneMapped: !1 }),
|
|
305
|
+
strut: new e.MeshBasicMaterial({ color: "#94a3b8" }),
|
|
306
|
+
panel: new e.MeshBasicMaterial({ color: new e.Color(o).lerp(new e.Color("#1e3a8a"), 0.6).multiplyScalar(0.9), toneMapped: !1 }),
|
|
307
|
+
beacon: new e.MeshBasicMaterial({ color: o, transparent: !0, opacity: 0.1, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1 })
|
|
308
|
+
}),
|
|
309
|
+
[o]
|
|
310
|
+
), r = A(null);
|
|
311
|
+
return N(({ clock: p }, f) => {
|
|
312
|
+
if (!n.current) return;
|
|
313
|
+
const u = performance.now(), w = p.elapsedTime;
|
|
314
|
+
n.current.position.copy(t.pos), n.current.position.y += re(s.slot);
|
|
315
|
+
const y = Fe(s.activeAt, u, 1.8), d = s.inflight > 0, b = F ? 0.25 : 1;
|
|
316
|
+
i.current && (i.current.rotation.x += f * (d ? 2.4 : 0.35) * b), g.body.color.copy(c).multiplyScalar(0.9 + (d ? 1.6 + Math.sin(w * 6) * 0.6 : 0) + y * 3), r.current && (r.current.rotation.z += f * (d ? 1.5 : 0.25) * b), g.ring.color.copy(c).multiplyScalar(0.7 + y * 3 + (d ? 1 : 0)), m.current && m.current.scale.setScalar(1 + y * 1.2 + (d ? 0.4 + Math.sin(w * 6) * 0.25 : 0)), g.beacon.opacity = 0.05 + y * 0.1 + (d ? 0.07 : 0);
|
|
317
|
+
}), /* @__PURE__ */ L("group", { ref: n, children: [
|
|
318
|
+
/* @__PURE__ */ a("mesh", { geometry: qt, material: g.body }),
|
|
319
|
+
/* @__PURE__ */ a("mesh", { ref: r, geometry: Xt, material: g.ring, rotation: [Math.PI / 2, 0, 0] }),
|
|
320
|
+
/* @__PURE__ */ a("group", { ref: i, children: [-1, 1].map((p) => /* @__PURE__ */ L("group", { children: [
|
|
321
|
+
/* @__PURE__ */ a("mesh", { geometry: Yt, material: g.strut, position: [p * 0.55, 0, 0] }),
|
|
322
|
+
/* @__PURE__ */ a("mesh", { geometry: Dt, material: g.panel, position: [p * 1.05, 0, 0] })
|
|
323
|
+
] }, p)) }),
|
|
324
|
+
/* @__PURE__ */ a("mesh", { ref: m, geometry: Ft, material: g.beacon }),
|
|
325
|
+
/* @__PURE__ */ a(ue, { position: [0, -1.1, 0], text: `MCP · ${s.name}`, color: o, size: 0.3, pxRange: [9, 13] })
|
|
326
|
+
] });
|
|
327
|
+
}
|
|
328
|
+
const Ze = new e.OctahedronGeometry(0.3, 0), Nt = new e.EdgesGeometry(Ze), ie = new e.Vector3(), ne = new e.Vector3();
|
|
329
|
+
function Ut({ mcp: t, backend: s }) {
|
|
330
|
+
const o = t.srv, n = s.res, i = R(() => new e.Color(o.color).lerp(new e.Color("#ffffff"), 0.3), [o.color]), m = A(null), c = A(null), g = A(null), r = A(""), p = R(
|
|
331
|
+
() => ({
|
|
332
|
+
fill: new e.MeshBasicMaterial({ color: i, transparent: !0, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
|
|
333
|
+
edge: new e.LineBasicMaterial({ color: i, transparent: !0, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1 }),
|
|
334
|
+
tether: new e.LineBasicMaterial({ color: i, transparent: !0, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1 })
|
|
335
|
+
}),
|
|
336
|
+
[i]
|
|
337
|
+
), f = R(() => {
|
|
338
|
+
const u = new e.BufferGeometry();
|
|
339
|
+
return u.setAttribute("position", new e.BufferAttribute(new Float32Array(6), 3)), Object.assign(new e.Line(u, p.tether), { frustumCulled: !1 });
|
|
340
|
+
}, [p.tether]);
|
|
341
|
+
return N(({ clock: u }) => {
|
|
342
|
+
var X;
|
|
343
|
+
const w = performance.now(), y = n.inflight > 0, d = Fe(n.activeAt, w, 1.5), b = y && !F ? 0.5 + 0.5 * Math.sin(u.elapsedTime * 5) : 0;
|
|
344
|
+
ne.copy(s.pos), ne.y += re(o.slot) * 0.6, (X = m.current) == null || X.position.copy(ne), c.current && (c.current.rotation.y = F ? 0.4 : u.elapsedTime * (y ? 1.2 : 0.25));
|
|
345
|
+
const h = y ? 1.4 + b * 0.8 : 0.18 + d * 0.9;
|
|
346
|
+
p.fill.color.copy(i).multiplyScalar(h * 0.35), p.edge.color.copy(i).multiplyScalar(h * 1.4), p.tether.color.copy(i).multiplyScalar(y ? 0.7 + b * 0.4 : 0.12 + d * 0.5), ie.copy(t.pos), ie.y += re(o.slot);
|
|
347
|
+
const P = f.geometry.getAttribute("position");
|
|
348
|
+
P.setXYZ(0, ie.x, ie.y, ie.z), P.setXYZ(1, ne.x, ne.y, ne.z), P.needsUpdate = !0;
|
|
349
|
+
let q = n.name;
|
|
350
|
+
if (y) {
|
|
351
|
+
let B = "";
|
|
352
|
+
for (const C of T.mcpPending.values()) C.server === o.name && C.resource === n.name && (B = C.tool);
|
|
353
|
+
q = `${n.name} ▸ ${B || "query"}()`;
|
|
354
|
+
}
|
|
355
|
+
g.current && (q !== r.current && g.current.setText(r.current = q), g.current.setOpacity(y ? 1 : 0.5 + d * 0.5));
|
|
356
|
+
}), /* @__PURE__ */ L(se, { children: [
|
|
357
|
+
/* @__PURE__ */ a("primitive", { object: f }),
|
|
358
|
+
/* @__PURE__ */ L("group", { ref: m, children: [
|
|
359
|
+
/* @__PURE__ */ L("group", { ref: c, children: [
|
|
360
|
+
/* @__PURE__ */ a("mesh", { geometry: Ze, material: p.fill }),
|
|
361
|
+
/* @__PURE__ */ a("lineSegments", { geometry: Nt, material: p.edge })
|
|
362
|
+
] }),
|
|
363
|
+
/* @__PURE__ */ a(ue, { ref: g, position: [0, -0.7, 0], text: n.name, color: o.color, size: 0.2, opacity: 0.5, pxRange: [7.5, 11] })
|
|
364
|
+
] })
|
|
365
|
+
] });
|
|
366
|
+
}
|
|
367
|
+
const we = { queued: "#64748b", running: "#fbbf24", done: "#22c55e", failed: "#ef4444" }, Zt = new e.TorusGeometry(1, 1, 6, 320);
|
|
368
|
+
function Ht() {
|
|
369
|
+
return new e.ShaderMaterial({
|
|
370
|
+
uniforms: { uA: { value: 4 }, uB: { value: 3 }, uTube: { value: 0.03 }, uColor: { value: new e.Color() }, uOpacity: { value: 0 } },
|
|
371
|
+
vertexShader: (
|
|
372
|
+
/* glsl */
|
|
373
|
+
`
|
|
374
|
+
uniform float uA; uniform float uB; uniform float uTube;
|
|
375
|
+
void main(){
|
|
376
|
+
float th = atan(position.y, position.x);
|
|
377
|
+
vec3 c = vec3(cos(th), sin(th), 0.0);
|
|
378
|
+
vec3 off = position - c * 1.0; // torus radius 1, tube radius 1
|
|
379
|
+
vec3 p = vec3(cos(th) * uA, sin(th) * uB, 0.0) + off * uTube;
|
|
380
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(p, 1.0);
|
|
381
|
+
}`
|
|
382
|
+
),
|
|
383
|
+
fragmentShader: (
|
|
384
|
+
/* glsl */
|
|
385
|
+
`
|
|
386
|
+
uniform vec3 uColor; uniform float uOpacity;
|
|
387
|
+
void main(){ gl_FragColor = vec4(uColor * uOpacity, 1.0); }`
|
|
388
|
+
),
|
|
389
|
+
transparent: !0,
|
|
390
|
+
depthWrite: !1,
|
|
391
|
+
blending: e.AdditiveBlending
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
const jt = new e.OctahedronGeometry(0.26, 0), Kt = new e.RingGeometry(0.34, 0.42, 40), Qt = new e.SphereGeometry(0.16, 12, 12), Ie = new e.Matrix4(), $e = new e.Vector3(), We = new e.Quaternion(), qe = new e.Quaternion(), Jt = new e.Vector3(1, 0, 0), Xe = (t, s, o, n) => n.set(Math.cos(o) * t, Math.sin(o) * s, 0);
|
|
395
|
+
function en({ run: t, color: s }) {
|
|
396
|
+
dt();
|
|
397
|
+
const o = t.status !== "started", n = [{ text: "hatchet ", color: s }];
|
|
398
|
+
if (t.hasSteps) {
|
|
399
|
+
const { shown: i, more: m } = mt(t);
|
|
400
|
+
for (const c of i) n.push({ text: ` ${t.steps[c] === "running" ? "›" : "·"}${c}`, color: we[t.steps[c]] });
|
|
401
|
+
m && n.push({ text: ` +${m}`, color: we.queued });
|
|
402
|
+
} else n.push({ text: o ? "complete" : "running…", color: "#94a3b8" });
|
|
403
|
+
return o && n.push({ text: " brief ready", color: "#4ade80" }), /* @__PURE__ */ a(ue, { text: t.topic, secondary: n, textColor: "#f1f5f9", color: s, size: 0.32, maxWidth: 9, opacity: o ? 0.65 : 1, fadeMs: 300, anchorY: "bottom", pxRange: [9.5, 14] });
|
|
404
|
+
}
|
|
405
|
+
function tn({ run: t }) {
|
|
406
|
+
const s = t.id, o = t.color, n = R(() => yt(s), [s]), i = R(() => (oe(s, 16) - 0.5) * 0.24, [s]), m = A(null), c = A([]), g = A([]), r = A([]), p = A(null), f = A(null), u = R(() => new e.Color(), []), w = R(() => new e.Color(o), [o]), y = R(
|
|
407
|
+
() => ({
|
|
408
|
+
orbit: Ht(),
|
|
409
|
+
beads: ye.map(() => new e.MeshBasicMaterial({ transparent: !0, toneMapped: !1 })),
|
|
410
|
+
halos: ye.map(() => new e.MeshBasicMaterial({ transparent: !0, blending: e.AdditiveBlending, depthWrite: !1, toneMapped: !1, side: e.DoubleSide })),
|
|
411
|
+
runner: new e.MeshBasicMaterial({ color: new e.Color("#fde68a").multiplyScalar(5), toneMapped: !1 })
|
|
412
|
+
}),
|
|
413
|
+
[]
|
|
414
|
+
);
|
|
415
|
+
return N(({ clock: d }) => {
|
|
416
|
+
var v;
|
|
417
|
+
const b = m.current;
|
|
418
|
+
if (!b) return;
|
|
419
|
+
const h = t.run ?? T.runs.get(s), P = performance.now(), q = d.elapsedTime;
|
|
420
|
+
$e.crossVectors(t.side, t.axis), Ie.makeBasis(t.side, t.axis, $e), We.setFromRotationMatrix(Ie), qe.setFromAxisAngle(Jt, i), b.quaternion.copy(We).multiply(qe), b.position.copy(t.origin);
|
|
421
|
+
const X = t.hu + 0.35, B = t.hv + 0.35, C = h ? Math.min(1, (P - h.startedAt) / 900) : 1, x = h != null && h.endedAt ? Math.max(0, 1 - (P - h.endedAt) / pt) : 1, k = C * x, E = h != null && h.endedAt ? Math.exp(-((P - h.endedAt) / 1e3) * 2.5) : 0, I = y.orbit.uniforms;
|
|
422
|
+
I.uA.value = X, I.uB.value = B, I.uOpacity.value = k * 0.75, I.uColor.value.copy(w).multiplyScalar(1.1 + E * 3), (h == null ? void 0 : h.status) === "completed" && I.uColor.value.lerp(u.set("#4ade80"), E);
|
|
423
|
+
for (let G = 0; G < ye.length; G++) {
|
|
424
|
+
const S = h ? ft(h, G) : "queued", O = !!(h != null && h.hasSteps), Y = g.current[G];
|
|
425
|
+
if (Y && (Y.visible = O, Xe(X, B, Ge[G] + n, Y.position)), !O) continue;
|
|
426
|
+
const $ = S === "running" ? 0.5 + 0.5 * Math.sin(q * (F ? 2 : 6)) : 0, U = c.current[G];
|
|
427
|
+
U && (u.set(we[S]).multiplyScalar(S === "queued" ? 0.7 : S === "running" ? 2 + $ * 2 : 2.4), y.beads[G].color.copy(u), y.beads[G].opacity = k, U.scale.setScalar((S === "running" ? 1.3 + $ * 0.25 : S === "done" ? 1.05 : 0.8) * Math.max(0.01, k)));
|
|
428
|
+
const j = r.current[G];
|
|
429
|
+
j && (j.visible = S !== "queued", y.halos[G].color.set(we[S]), y.halos[G].opacity = k * (S === "running" ? 0.35 + $ * 0.4 : 0.18), j.scale.setScalar(S === "running" ? 1.6 + $ * 0.9 : 1.3));
|
|
430
|
+
}
|
|
431
|
+
const M = h != null && h.handoffAt ? (P - h.handoffAt) / 1400 : 2;
|
|
432
|
+
if (p.current && h) {
|
|
433
|
+
const G = Ge[h.handoffFrom] + n;
|
|
434
|
+
let S = Ge[h.handoffTo] + n;
|
|
435
|
+
S < G && (S += Math.PI * 2);
|
|
436
|
+
const O = M >= 1 ? 1 : 1 - Math.pow(1 - Math.max(0, M), 3);
|
|
437
|
+
Xe(X, B, G + (S - G) * O, p.current.position), p.current.scale.setScalar(M < 1 ? 1 : 1e-3);
|
|
438
|
+
}
|
|
439
|
+
const l = Math.hypot(t.side.z * X, t.axis.z * B);
|
|
440
|
+
(v = f.current) == null || v.position.set(t.origin.x, 0.4, t.origin.z - l - 0.5);
|
|
441
|
+
}), /* @__PURE__ */ L(se, { children: [
|
|
442
|
+
/* @__PURE__ */ L("group", { ref: m, children: [
|
|
443
|
+
/* @__PURE__ */ a("mesh", { geometry: Zt, material: y.orbit, frustumCulled: !1 }),
|
|
444
|
+
ye.map((d) => /* @__PURE__ */ L("group", { ref: (b) => void (g.current[d] = b), visible: !1, children: [
|
|
445
|
+
/* @__PURE__ */ a("mesh", { ref: (b) => void (c.current[d] = b), geometry: jt, material: y.beads[d] }),
|
|
446
|
+
/* @__PURE__ */ a("mesh", { ref: (b) => void (r.current[d] = b), geometry: Kt, material: y.halos[d] })
|
|
447
|
+
] }, d)),
|
|
448
|
+
/* @__PURE__ */ a(be, { width: 3.2, length: 9, color: "#fde68a", attenuation: (d) => d * d, children: /* @__PURE__ */ a("mesh", { ref: p, geometry: Qt, material: y.runner, scale: 1e-3 }) })
|
|
449
|
+
] }),
|
|
450
|
+
/* @__PURE__ */ a("group", { ref: f, children: t.run && /* @__PURE__ */ a(en, { run: t.run, color: o }) })
|
|
451
|
+
] });
|
|
452
|
+
}
|
|
453
|
+
const nn = /* @__PURE__ */ L(se, { children: [
|
|
454
|
+
/* @__PURE__ */ a("fog", { attach: "fog", args: ["#03050b", 70, 170] }),
|
|
455
|
+
/* @__PURE__ */ a(je, { radius: 130, depth: 50, count: F ? 1500 : 5e3, factor: 3.4, saturation: 0.4, fade: !0, speed: F ? 0 : 0.2 })
|
|
456
|
+
] });
|
|
457
|
+
function un() {
|
|
458
|
+
return /* @__PURE__ */ L(
|
|
459
|
+
ht,
|
|
460
|
+
{
|
|
461
|
+
title: "orbit · planetary system",
|
|
462
|
+
subtitle: "agents orbit at the centre · each Hatchet run is an orbit · agents are born, work and implode · MCP stations on the rim · knowledge-graph galaxy on the side",
|
|
463
|
+
preset: "radial",
|
|
464
|
+
plane: "xz",
|
|
465
|
+
camera: { position: [0, 25, 21], fov: 50 },
|
|
466
|
+
controls: { maxPolarAngle: Math.PI * 0.42 },
|
|
467
|
+
bg: "#03050b",
|
|
468
|
+
fit: { nRef: 4, min: 0.62, max: 1.6, minRadius: 5.5 },
|
|
469
|
+
agentRadius: 0.85,
|
|
470
|
+
graph: { natural: Ue, radius: 2.6 },
|
|
471
|
+
peripheryGap: 3.8,
|
|
472
|
+
Background: nn,
|
|
473
|
+
Agent: Rt,
|
|
474
|
+
RunMarker: tn,
|
|
475
|
+
McpServer: Vt,
|
|
476
|
+
Backend: Ut,
|
|
477
|
+
GraphResource: Ot,
|
|
478
|
+
cluster: { radius: 1.35, variant: "stars" },
|
|
479
|
+
clusterOffset: [0, 1.2, 0],
|
|
480
|
+
PostFX: /* @__PURE__ */ L(Ke, { multisampling: 0, children: [
|
|
481
|
+
/* @__PURE__ */ a(Qe, { mipmapBlur: !0, intensity: 1.3, luminanceThreshold: 0.2, luminanceSmoothing: 0.25, radius: 0.78 }),
|
|
482
|
+
/* @__PURE__ */ a(Je, { eskil: !1, offset: 0.25, darkness: 0.85 }),
|
|
483
|
+
/* @__PURE__ */ a(et, { opacity: 0.025 })
|
|
484
|
+
] }),
|
|
485
|
+
children: [
|
|
486
|
+
/* @__PURE__ */ a(_t, {}),
|
|
487
|
+
/* @__PURE__ */ a(kt, {}),
|
|
488
|
+
/* @__PURE__ */ a(Wt, {})
|
|
489
|
+
]
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
export {
|
|
494
|
+
un as default
|
|
495
|
+
};
|