agentglow 0.4.3 → 0.4.5
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 +5 -0
- package/dist/chunks/{KitScene-DsZmpTf7.js → KitScene-DNk9wirq.js} +3146 -2915
- package/dist/chunks/{index-DlvN9YSt.js → index-B7hfNEXI.js} +284 -284
- package/dist/chunks/{index-DATZHNA0.js → index-B8MtKKcW.js} +42 -42
- package/dist/chunks/{index-nw9i304P.js → index-BXBnv8GE.js} +1 -1
- package/dist/chunks/{index-B6EboYGn.js → index-CHIG9x__.js} +30 -30
- package/dist/chunks/{index-CW8fTJn1.js → index-CXhdtTJn.js} +7 -7
- package/dist/chunks/{index-s99mYaJ9.js → index-DOXpqUvk.js} +352 -345
- package/dist/chunks/{index-avfwD6eP.js → index-Mp_16YlZ.js} +1 -1
- package/dist/chunks/{index-CoeLwySn.js → index-n6GWpbis.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/world.d.ts +3 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { EffectComposer as _e, Bloom as Ee, Vignette as Be } from "@react-three/
|
|
|
6
6
|
import { useThree as Kt, useFrame as At } from "@react-three/fiber";
|
|
7
7
|
import { useMemo as I, useRef as F } from "react";
|
|
8
8
|
import * as r from "three";
|
|
9
|
-
import {
|
|
9
|
+
import { Y as ke, T as ue, g as Ke, h as kt, b as Ve, K as Oe, A as Qt, w as U, a as ht, F as Fe, Q as je, L as te, G as Ge, C as Ie, d as ve, k as Le, Z as De, U as We, R as Ne, u as Ue, E as Xe, l as Ye, X as He, _ as $e, e as Ze, s as qe, j as Qe, n as Je, o as tn, f as $t, x as en } from "./KitScene-DNk9wirq.js";
|
|
10
10
|
var Me;
|
|
11
11
|
const Z = typeof window < "u" && !!((Me = window.matchMedia) != null && Me.call(window, "(prefers-reduced-motion: reduce)").matches), q = (t) => t < 0 ? 0 : t > 1 ? 1 : t, ce = (t) => 1 - Math.pow(1 - q(t), 3), Zt = (t) => (t = q(t), t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2), D = new r.Color(1, 1, 1), H = new r.Color("#ffc46b"), It = new r.Color("#ff7a2e"), nn = new r.Color("#fbbf24"), Gt = new r.Color("#ff2d4a"), xe = new r.Color("#8a93b8"), Lt = Object.fromEntries(Object.entries(ue).map(([t, n]) => [t, new r.Color(n).lerp(D, 0.12)])), on = Object.fromEntries(Object.entries(ue).map(([t, n]) => [t, new r.Color(n).lerp(H, 0.35).lerp(D, 0.25)]));
|
|
12
12
|
function fe(t, n) {
|
|
@@ -427,8 +427,8 @@ function Rn({ galaxy: t }) {
|
|
|
427
427
|
const { pos: et, base: W, baseSize: V, fire: Y, white: _, fireC: G, phase: C } = s, { v: ut, w: M, ctrl: j, h: Wt, c: K } = g;
|
|
428
428
|
Y.fill(0), _.fill(0), y.begin(), u.begin();
|
|
429
429
|
let ft = 0, Rt = 0;
|
|
430
|
-
for (const x of
|
|
431
|
-
const z = w(x.node), L = (h - x.start) / 1e3, gt =
|
|
430
|
+
for (const x of U.flares) {
|
|
431
|
+
const z = w(x.node), L = (h - x.start) / 1e3, gt = U.instances.get(x.instance), nt = gt ? Lt[gt.type] : H, O = x.op === "write", N = L < 0.3 ? L / 0.3 : Math.exp(-(L - 0.3) * 1.1);
|
|
432
432
|
if (Rt = Math.max(Rt, N), N > Y[z] && (Y[z] = N, G[z].copy(O ? D : nt), _[z] = O ? 1 : 0), ut.fromArray(et, z * 3), O && L < 1.6 && ft < ae) {
|
|
433
433
|
const at = p.current[ft];
|
|
434
434
|
if (at) {
|
|
@@ -462,8 +462,8 @@ function Rn({ galaxy: t }) {
|
|
|
462
462
|
}
|
|
463
463
|
Nt.needsUpdate = !0;
|
|
464
464
|
let tt = 0;
|
|
465
|
-
for (let x =
|
|
466
|
-
const z =
|
|
465
|
+
for (let x = U.flares.length - 1; x >= 0 && tt < Yt; x--) {
|
|
466
|
+
const z = U.flares[x];
|
|
467
467
|
if (h - z.start > 2200) break;
|
|
468
468
|
if (z.area) continue;
|
|
469
469
|
let L = !1;
|
|
@@ -500,8 +500,8 @@ function _n() {
|
|
|
500
500
|
const m = performance.now(), i = Z ? 0 : f.elapsedTime;
|
|
501
501
|
c.setScale(t.height, n.getPixelRatio(), o.fov), e.begin(), c.begin();
|
|
502
502
|
const a = Vt();
|
|
503
|
-
for (const p of
|
|
504
|
-
const s = ht(p.instance), v = ve(p.server), y =
|
|
503
|
+
for (const p of U.mcpPending.values()) {
|
|
504
|
+
const s = ht(p.instance), v = ve(p.server), y = U.mcpServers.get(p.server);
|
|
505
505
|
if (!s || !y || !v) continue;
|
|
506
506
|
yt.copy(s), ct.copy(v), St(yt, ct, 0.8, 1.2, wt);
|
|
507
507
|
const u = Le(p, m);
|
|
@@ -512,11 +512,11 @@ function _n() {
|
|
|
512
512
|
w && (St(ct, w, 0.25, 0.2, wt), e.add(ct, wt, w, dt, b * 0.9, 0.15, 0.85, 0.7, i, -1, 0));
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
for (const p of
|
|
515
|
+
for (const p of U.mcpCalls) {
|
|
516
516
|
if (p.phase !== "result") continue;
|
|
517
517
|
const s = q((m - p.start) / p.dur);
|
|
518
518
|
if (s >= 1) continue;
|
|
519
|
-
const v = ht(p.instance), y = ve(p.server), u =
|
|
519
|
+
const v = ht(p.instance), y = ve(p.server), u = U.mcpServers.get(p.server);
|
|
520
520
|
if (!v || !u || !y) continue;
|
|
521
521
|
ct.copy(y), dt.set(u.color).lerp(D, 0.45), yt.copy(v), St(yt, ct, 0.8, 1.2, wt);
|
|
522
522
|
const b = Zt(s), g = 1 - Math.max(0, (b - 0.85) / 0.15);
|
|
@@ -532,7 +532,7 @@ function En({ run: t }) {
|
|
|
532
532
|
const n = I(() => new r.Color(t.color), [t.color]), o = I(() => ({ haze: xt(Dt(), "#000") }), []), e = F(null), c = F(null), f = I(() => ({ x: 0, fresh: !0 }), []);
|
|
533
533
|
return At(({ clock: m }) => {
|
|
534
534
|
var d;
|
|
535
|
-
const i = performance.now(), a = t.run ??
|
|
535
|
+
const i = performance.now(), a = t.run ?? U.runs.get(t.id), p = a ? ce((i - a.startedAt) / 1500) : 1, s = a != null && a.endedAt ? q(1 - (i - a.endedAt - (Ne - 2500)) / 2500) : 1, v = Z ? 0 : m.elapsedTime, y = Math.abs(t.side.x) * t.hu + Math.abs(t.axis.x) * t.hv, u = Math.abs(t.side.y) * t.hu + Math.abs(t.axis.y) * t.hv;
|
|
536
536
|
e.current && (e.current.position.set(t.origin.x, t.origin.y, -0.4), e.current.scale.set(y * 2.6 + 5, u * 2.6 + 4, 1), o.haze.color.copy(n).multiplyScalar(0.045 * p * s * (0.9 + 0.1 * Math.sin(v * 0.4 + t.index))));
|
|
537
537
|
let b = 0, g = 0;
|
|
538
538
|
for (const h of Qt.agents.values()) h.run === t && h.depth === 0 && (b += h.live.x, g++);
|
|
@@ -544,13 +544,13 @@ function En({ run: t }) {
|
|
|
544
544
|
] });
|
|
545
545
|
}
|
|
546
546
|
function Bn({ run: t }) {
|
|
547
|
-
|
|
547
|
+
Ue();
|
|
548
548
|
const n = t.status !== "started";
|
|
549
549
|
return /* @__PURE__ */ S(
|
|
550
550
|
te,
|
|
551
551
|
{
|
|
552
552
|
text: t.topic,
|
|
553
|
-
secondary:
|
|
553
|
+
secondary: Xe(t, { base: "#a39bb8", current: "#ffd28a", done: "#d6d0e6" }, ["running…", "run complete"]),
|
|
554
554
|
color: t.color,
|
|
555
555
|
textColor: "#fff3e6",
|
|
556
556
|
plate: "none",
|
|
@@ -571,13 +571,13 @@ function kn() {
|
|
|
571
571
|
const t = F(/* @__PURE__ */ new Set()), n = F([]), o = F([]), e = F([]), c = F([]), f = I(() => new r.Color(), []);
|
|
572
572
|
return At(() => {
|
|
573
573
|
const m = performance.now();
|
|
574
|
-
for (const i of
|
|
574
|
+
for (const i of U.runs.values()) {
|
|
575
575
|
if (!i.final || t.current.has(i.id)) continue;
|
|
576
576
|
t.current.add(i.id);
|
|
577
577
|
const a = Qt.runs.get(i.id);
|
|
578
578
|
if (!a) continue;
|
|
579
579
|
let p;
|
|
580
|
-
for (const u of
|
|
580
|
+
for (const u of U.instances.values()) u.run === i.id && !u.parent && (p = ht(u.id) ?? p);
|
|
581
581
|
const s = (p ?? a.origin).clone();
|
|
582
582
|
s.y += 2.2, n.current.push({ run: i.id, start: m, at: s, text: i.final }), n.current.length > se && n.current.shift();
|
|
583
583
|
const v = Vt();
|
|
@@ -590,7 +590,7 @@ function kn() {
|
|
|
590
590
|
for (let u = 0; u < 6 * ot; u++) v.emit(s.x + (Math.random() - 0.5) * 3, s.y + (Math.random() - 0.5) * 2, s.z, 0.15, 0.12, 0, 0.5, -0.03, 5, 3.2, xe, 1, le);
|
|
591
591
|
}
|
|
592
592
|
if (t.current.size > 200)
|
|
593
|
-
for (const i of t.current)
|
|
593
|
+
for (const i of t.current) U.runs.has(i) || t.current.delete(i);
|
|
594
594
|
n.current.length && m - n.current[0].start > 5600 && n.current.shift();
|
|
595
595
|
for (let i = 0; i < se; i++) {
|
|
596
596
|
const a = n.current[i], p = o.current[i], s = e.current[i];
|
|
@@ -665,20 +665,20 @@ function Gn({ agent: t, selected: n, onSelect: o }) {
|
|
|
665
665
|
else {
|
|
666
666
|
const k = j ? ht(e.parent) : void 0;
|
|
667
667
|
k ? (l.from.copy(k), St(l.from, M, 0.4 * G, 0.6 * G, l.ctrl)) : l.aimed || (l.aimed = !0, Fn(M, kt(t.run.id, 3), d, Math.max(12, m.position.length()), l.from, l.ctrl)), ie(A, j, l.from, l.ctrl, M, T);
|
|
668
|
-
const
|
|
669
|
-
v.current && (v.current.visible = !0, v.current.position.copy(T), v.current.scale.setScalar((j ? 0.5 : 1.15) * (Z ? 1 : 0.85 + 0.15 * Math.sin(Y * 37 + d * 9)))), P.rocket.color.copy(H).lerp(D, 0.6).multiplyScalar(1.5 *
|
|
670
|
-
const Ct = P.tailGeo.getAttribute("position"), Ft = P.tailGeo.getAttribute("color"),
|
|
668
|
+
const X = j ? 1 : q(A / 0.12);
|
|
669
|
+
v.current && (v.current.visible = !0, v.current.position.copy(T), v.current.scale.setScalar((j ? 0.5 : 1.15) * (Z ? 1 : 0.85 + 0.15 * Math.sin(Y * 37 + d * 9)))), P.rocket.color.copy(H).lerp(D, 0.6).multiplyScalar(1.5 * X);
|
|
670
|
+
const Ct = P.tailGeo.getAttribute("position"), Ft = P.tailGeo.getAttribute("color"), Ut = j ? 0.3 : 0.32;
|
|
671
671
|
for (let zt = 0; zt < Jt; zt++)
|
|
672
|
-
for (let
|
|
673
|
-
const ne = (zt +
|
|
674
|
-
ie(A -
|
|
675
|
-
const me = zt * 2 +
|
|
672
|
+
for (let Xt = 0; Xt < 2; Xt++) {
|
|
673
|
+
const ne = (zt + Xt) / Jt;
|
|
674
|
+
ie(A - Ut * (1 - ne), j, l.from, l.ctrl, M, $);
|
|
675
|
+
const me = zt * 2 + Xt;
|
|
676
676
|
Ct.setXYZ(me, $.x, $.y, $.z);
|
|
677
|
-
const oe = ne * ne * (j ? 1.1 : 1.6) *
|
|
677
|
+
const oe = ne * ne * (j ? 1.1 : 1.6) * X;
|
|
678
678
|
Ft.setXYZ(me, H.r * oe, H.g * oe * 0.92, H.b * oe * 0.8);
|
|
679
679
|
}
|
|
680
680
|
Ct.needsUpdate = !0, Ft.needsUpdate = !0, y.current && (y.current.visible = !0);
|
|
681
|
-
const Pe = (j ? 2 : 9) * ot *
|
|
681
|
+
const Pe = (j ? 2 : 9) * ot * X;
|
|
682
682
|
for (let zt = 0; zt < Pe; zt++)
|
|
683
683
|
ie(A - R() * (j ? 0.04 : 0.025), j, l.from, l.ctrl, M, $), j ? _.emit($.x, $.y, $.z, (R() - 0.5) * 0.9, -0.3 - R() * 1.2, (R() - 0.5) * 0.2, 2.2, 2, 0.35 + R() * 0.55, 0.06, R() < 0.3 ? D : H, 0.95, R() < 0.4 ? mt : pt) : _.emit($.x, $.y, $.z, (R() - 0.5) * 0.35, (R() - 0.5) * 0.35, (R() - 0.5) * 0.15, 1.6, 0.45, 0.9 + R() * 1.2, 0.08, R() < 0.4 ? D : R() < 0.5 ? H : h, 0.95, R() < 0.65 ? mt : pt);
|
|
684
684
|
}
|
|
@@ -689,7 +689,7 @@ function Gn({ agent: t, selected: n, onSelect: o }) {
|
|
|
689
689
|
l.burst = !0;
|
|
690
690
|
const A = Math.round((j ? 100 : 230) * ot), k = 2.4;
|
|
691
691
|
_.burst(M.x, M.y, M.z, A, C * 2.6 * k, h, 1.55, { drag: k, grav: 1.1, life: j ? 1.7 : 2.5, size: j ? 0.095 : 0.13, glitter: 0.3, c2: E });
|
|
692
|
-
for (let
|
|
692
|
+
for (let X = 0; X < 5 * ot; X++)
|
|
693
693
|
Et(T), _.emit(M.x + T.x * C * 0.4, M.y + T.y * C * 0.4, M.z, T.x * 0.35, T.y * 0.35 + 0.1, 0, 0.8, -0.05, 3.2 + R(), C * 1.5, h, 0.9, le);
|
|
694
694
|
}
|
|
695
695
|
const ft = e.exitAt ? (V - e.exitAt) / Math.max(400, Ye(e)) : -1, Rt = ft >= 0 ? q(ft) : 0, J = ft < 0 && !e.doneAt, Ot = e.status === "failed";
|
|
@@ -698,8 +698,8 @@ function Gn({ agent: t, selected: n, onSelect: o }) {
|
|
|
698
698
|
const A = Math.round((j ? 26 : 50) * ot);
|
|
699
699
|
for (let k = 0; k < A; k++) {
|
|
700
700
|
Et(T);
|
|
701
|
-
const
|
|
702
|
-
_.emit(M.x + T.x *
|
|
701
|
+
const X = C * (0.75 + R() * 0.3);
|
|
702
|
+
_.emit(M.x + T.x * X, M.y + T.y * X, M.z + T.z * X, T.x * 0.5, T.y * 0.3 - 0.2, 0, 1.3, 0.9, 2.2 + R() * 1.2, 0.075, Ot ? Gt : R() < 0.5 ? H : It, 0.85, hn);
|
|
703
703
|
}
|
|
704
704
|
for (let k = 0; k < 6 * ot; k++)
|
|
705
705
|
Et(T), _.emit(M.x + T.x * C * 0.6, M.y + T.y * C * 0.6, M.z, T.x * 0.25 + 0.08, 0.18 + R() * 0.15, 0, 0.6, -0.04, 4 + R() * 1.5, C * 1.6, xe, 1, le);
|
|
@@ -710,8 +710,8 @@ function Gn({ agent: t, selected: n, onSelect: o }) {
|
|
|
710
710
|
const A = Math.round((10 + 26 * (e.pulse / 2.5)) * ot);
|
|
711
711
|
for (let k = 0; k < A; k++) {
|
|
712
712
|
Et(T);
|
|
713
|
-
const
|
|
714
|
-
_.emit(M.x + T.x *
|
|
713
|
+
const X = C * (0.7 + R() * 0.35);
|
|
714
|
+
_.emit(M.x + T.x * X, M.y + T.y * X, M.z + T.z * X, T.x * C * 0.9, T.y * C * 0.9, T.z * C * 0.4, 3.2, 0.5, 0.45 + R() * 0.55 * (e.pulse / 1.5), 0.065, R() < 0.5 ? D : E, 1, mt, R() * 0.25);
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
717
|
if (e.toolCalls !== l.tools && (l.tools = e.toolCalls, J && K > 0)) {
|
|
@@ -727,10 +727,10 @@ function Gn({ agent: t, selected: n, onSelect: o }) {
|
|
|
727
727
|
if (k.at <= l.decAt) break;
|
|
728
728
|
if (!(k.at > V) && He(k) && V - l.saluteAt > 450 && J) {
|
|
729
729
|
l.saluteAt = V;
|
|
730
|
-
const
|
|
731
|
-
for (let Ct = 0; Ct <
|
|
732
|
-
const Ft = Ct /
|
|
733
|
-
_.emit(M.x, M.y, M.z + 0.05, Math.cos(Ft) *
|
|
730
|
+
const X = Math.round(30 * ot);
|
|
731
|
+
for (let Ct = 0; Ct < X; Ct++) {
|
|
732
|
+
const Ft = Ct / X * Math.PI * 2, Ut = C * 7 * (0.85 + R() * 0.3);
|
|
733
|
+
_.emit(M.x, M.y, M.z + 0.05, Math.cos(Ft) * Ut, Math.sin(Ft) * Ut, 0, 6, 0.8, 0.35 + R() * 0.2, 0.08, Ct % 4 === 0 ? D : Gt, 1.2, pt);
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
}
|
|
@@ -795,12 +795,12 @@ function Ln() {
|
|
|
795
795
|
return At(({ clock: m }) => {
|
|
796
796
|
const i = performance.now(), a = Z ? 0 : m.elapsedTime;
|
|
797
797
|
c.setScale(t.height, n.getPixelRatio(), o.fov), e.begin(), c.begin();
|
|
798
|
-
for (const s of f.keys())
|
|
799
|
-
for (const s of
|
|
798
|
+
for (const s of f.keys()) U.instances.has(s) || f.delete(s);
|
|
799
|
+
for (const s of U.instances.values()) {
|
|
800
800
|
if (!s.parent) continue;
|
|
801
801
|
const v = ht(s.parent), y = ht(s.id);
|
|
802
802
|
if (!v || !y) continue;
|
|
803
|
-
const u =
|
|
803
|
+
const u = U.instances.get(s.parent), g = (i - s.bornAt) / 1e3 > ze && u && !u.exitAt && !s.exitAt && !s.doneAt ? 1 : 0;
|
|
804
804
|
let w = f.get(s.id) ?? 0;
|
|
805
805
|
if (w += (g - w) * (g ? 0.04 : 0.03), f.set(s.id, w), w < 0.01) continue;
|
|
806
806
|
const d = $t.scale;
|
|
@@ -809,12 +809,12 @@ function Ln() {
|
|
|
809
809
|
Mt.copy(Lt[s.type]).lerp(H, 0.5), e.add(v, bt, y, Mt, 0.16 * w, E, P, 0.12 * w, a, -1, 0);
|
|
810
810
|
}
|
|
811
811
|
const p = Vt();
|
|
812
|
-
for (const s of
|
|
812
|
+
for (const s of U.comets) {
|
|
813
813
|
const v = ht(s.from), y = ht(s.to);
|
|
814
814
|
if (!v || !y) continue;
|
|
815
815
|
const u = Je(s, i);
|
|
816
816
|
if (!tn(s, i)) continue;
|
|
817
|
-
const b =
|
|
817
|
+
const b = U.instances.get(s.from), g = U.instances.get(s.to);
|
|
818
818
|
if ((g == null ? void 0 : g.parent) === s.from || (b == null ? void 0 : b.parent) === s.to) {
|
|
819
819
|
const d = (g == null ? void 0 : g.parent) === s.from;
|
|
820
820
|
$.copy(d ? v : y), Ht.copy(d ? y : v), St($, Ht, 0.4 * $t.scale, 0.6 * $t.scale, bt);
|
|
@@ -887,7 +887,7 @@ function Nn() {
|
|
|
887
887
|
m.uK.value = t.height / (2.2 * 2 * Math.tan(s * Math.PI / 360));
|
|
888
888
|
}), /* @__PURE__ */ S("mesh", { ref: c, material: e, position: [0, 0, -0.6], renderOrder: -10, frustumCulled: !1, children: /* @__PURE__ */ S("planeGeometry", { args: [6e3, 6e3] }) });
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function Un() {
|
|
891
891
|
const { size: t, gl: n, camera: o } = Kt(), e = Vt();
|
|
892
892
|
return At(() => {
|
|
893
893
|
e.setScale(t.height, n.getPixelRatio(), o.fov), e.flush();
|
|
@@ -896,7 +896,7 @@ function Xn() {
|
|
|
896
896
|
/* @__PURE__ */ S("primitive", { object: e.points })
|
|
897
897
|
] });
|
|
898
898
|
}
|
|
899
|
-
const
|
|
899
|
+
const Xn = {
|
|
900
900
|
emit: (t, n, o) => {
|
|
901
901
|
Math.random() > ot || Vt().emit(t.x, t.y, t.z, n.x, n.y, n.z, 2.4, 2.2, 0.4 + Math.random() * 0.35, 0.06, o, 1, Math.random() < 0.3 ? mt : pt);
|
|
902
902
|
}
|
|
@@ -922,7 +922,7 @@ function to() {
|
|
|
922
922
|
Background: /* @__PURE__ */ S(Nn, {}),
|
|
923
923
|
Agent: Gn,
|
|
924
924
|
RunMarker: En,
|
|
925
|
-
mcpStyle:
|
|
925
|
+
mcpStyle: Xn,
|
|
926
926
|
GraphResource: Rn,
|
|
927
927
|
cluster: { radius: 1.5, variant: "stars", glowGain: 0.9 },
|
|
928
928
|
PostFX: /* @__PURE__ */ vt(_e, { multisampling: 0, children: [
|
|
@@ -933,7 +933,7 @@ function to() {
|
|
|
933
933
|
/* @__PURE__ */ S(Ln, {}),
|
|
934
934
|
/* @__PURE__ */ S(_n, {}),
|
|
935
935
|
/* @__PURE__ */ S(kn, {}),
|
|
936
|
-
/* @__PURE__ */ S(
|
|
936
|
+
/* @__PURE__ */ S(Un, {})
|
|
937
937
|
]
|
|
938
938
|
}
|
|
939
939
|
);
|
|
@@ -4,7 +4,7 @@ import { EffectComposer as Ne, Bloom as je, Vignette as Ke, Noise as Qe } from "
|
|
|
4
4
|
import { useFrame as K } from "@react-three/fiber";
|
|
5
5
|
import { useRef as A, useMemo as E, useEffect as Je, useState as Xe } from "react";
|
|
6
6
|
import * as t from "three";
|
|
7
|
-
import { h as oe, i as et, T as ae, f as tt, a as H, p as nt, e as ot, l as rt, j as st, s as at, L as Ge, w as G, g as ct, b as it, K as lt, G as ut, c as J, d as Ce, k as pt, m as he, n as ft, o as dt, S as fe, R as ht, q as mt, u as yt, r as gt, t as Oe, v as Pe, x as Mt } from "./KitScene-
|
|
7
|
+
import { h as oe, i as et, T as ae, f as tt, a as H, p as nt, e as ot, l as rt, j as st, s as at, L as Ge, w as G, g as ct, b as it, K as lt, G as ut, c as J, d as Ce, k as pt, m as he, n as ft, o as dt, S as fe, R as ht, q as mt, u as yt, r as gt, t as Oe, v as Pe, x as Mt } from "./KitScene-DNk9wirq.js";
|
|
8
8
|
var Fe;
|
|
9
9
|
const U = typeof window < "u" && !!((Fe = window.matchMedia) != null && Fe.call(window, "(prefers-reduced-motion: reduce)").matches), Le = Math.PI * 2, Ae = [Math.PI * 0.5, Math.PI * 0.5 + Le / 3, Math.PI * 0.5 + Le * 2 / 3], Ye = et, wt = (e) => (oe(e, 11) - 0.5) * 2.4, Z = {
|
|
10
10
|
/** the galaxy's inner (tilted) group; its matrixWorld includes the kit's side placement + scale */
|
|
@@ -4,12 +4,12 @@ var O = (e, n, s) => et(e, typeof n != "symbol" ? n + "" : n, s);
|
|
|
4
4
|
import { jsxs as J, Fragment as we, jsx as b } from "react/jsx-runtime";
|
|
5
5
|
import { EffectComposer as tt, Bloom as ot, Vignette as nt } from "@react-three/postprocessing";
|
|
6
6
|
import * as t from "three";
|
|
7
|
-
import { T as
|
|
7
|
+
import { T as ke, g as rt, h as $, b as st, K as at, A as Be, w as G, a as ie, F as it, Q as ct, L as je, G as lt, C as ft, d as Ne, k as dt, U as Xe, R as ut, u as pt, D as ht, E as mt, e as gt, s as vt, j as bt, f as Re, n as wt, o as yt, x as St } from "./KitScene-DNk9wirq.js";
|
|
8
8
|
import { useThree as Pe, useFrame as fe } from "@react-three/fiber";
|
|
9
9
|
import { useMemo as T, useRef as E, useEffect as Mt } from "react";
|
|
10
10
|
var $e;
|
|
11
|
-
const re = typeof window < "u" && !!(($e = window.matchMedia) != null && $e.call(window, "(prefers-reduced-motion: reduce)").matches), Y = (e) => e < 0 ? 0 : e > 1 ? 1 : e, be = (e) => 1 - Math.pow(1 - Y(e), 3), xe = (e) => (e = Y(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2), H = new t.Color(1, 1, 1), Ae = new t.Color("#cfe0ff"), Ie = new t.Color("#fbbf24"), xt = new t.Color("#ff3b4e"), Ve = Object.fromEntries(Object.entries(
|
|
12
|
-
Object.fromEntries(Object.entries(
|
|
11
|
+
const re = typeof window < "u" && !!(($e = window.matchMedia) != null && $e.call(window, "(prefers-reduced-motion: reduce)").matches), Y = (e) => e < 0 ? 0 : e > 1 ? 1 : e, be = (e) => 1 - Math.pow(1 - Y(e), 3), xe = (e) => (e = Y(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2), H = new t.Color(1, 1, 1), Ae = new t.Color("#cfe0ff"), Ie = new t.Color("#fbbf24"), xt = new t.Color("#ff3b4e"), Ve = Object.fromEntries(Object.entries(ke).map(([e, n]) => [e, new t.Color(n).lerp(Ae, 0.45)]));
|
|
12
|
+
Object.fromEntries(Object.entries(ke).map(([e, n]) => [e, new t.Color(n)]));
|
|
13
13
|
function Ke(e, n) {
|
|
14
14
|
const s = document.createElement("canvas");
|
|
15
15
|
s.width = s.height = e, n(s.getContext("2d"), e);
|
|
@@ -214,10 +214,10 @@ function It({ galaxy: e }) {
|
|
|
214
214
|
}), st(n, r, Me * 0.12);
|
|
215
215
|
const V = n.nodes.map((A) => new t.Color(at[A.kind] ?? "#94a3b8").lerp(jt, 0.45).multiplyScalar(1)), K = n.nodes.map((A) => 0.42 + Math.pow($(A.id, 5), 4) * 0.55), j = new t.BufferGeometry();
|
|
216
216
|
j.setAttribute("position", new t.BufferAttribute(r, 3)), j.setAttribute("aSize", new t.BufferAttribute(new Float32Array(s), 1)), j.setAttribute("aColor", new t.BufferAttribute(new Float32Array(s * 3), 3));
|
|
217
|
-
const L = new Map(n.nodes.map((A, B) => [A.id, B])), I = [], W = new t.Vector3(),
|
|
217
|
+
const L = new Map(n.nodes.map((A, B) => [A.id, B])), I = [], W = new t.Vector3(), U = new t.Vector3();
|
|
218
218
|
for (const A of n.links) {
|
|
219
219
|
const B = L.get(A.source), F = L.get(A.target);
|
|
220
|
-
B === void 0 || F === void 0 || B === F || (W.fromArray(r, B * 3),
|
|
220
|
+
B === void 0 || F === void 0 || B === F || (W.fromArray(r, B * 3), U.fromArray(r, F * 3), W.distanceTo(U) < 3.2 && I.push(B, F));
|
|
221
221
|
}
|
|
222
222
|
const R = new Float32Array(I.length * 3);
|
|
223
223
|
I.forEach((A, B) => R.set([r[A * 3], r[A * 3 + 1], r[A * 3 + 2]], B * 3));
|
|
@@ -238,23 +238,23 @@ function It({ galaxy: e }) {
|
|
|
238
238
|
return fe(({ clock: r }) => {
|
|
239
239
|
const c = performance.now(), h = Math.max(1e-4, Be.graph.scale), x = re ? 0 : r.elapsedTime, V = m.fov, K = f.getPixelRatio();
|
|
240
240
|
v.nodes.uniforms.uScale.value = o.height * K / (2 * Math.tan(V * Math.PI / 360)) * Be.graph.scale * 2.1, i.setScale(o.height, K, V);
|
|
241
|
-
const { pos: j, base: L, baseSize: I, fire: W, white:
|
|
242
|
-
W.fill(0),
|
|
241
|
+
const { pos: j, base: L, baseSize: I, fire: W, white: U, fireC: R, phase: N } = S, { v: A, w: B, ctrl: F, h: q, c: _ } = a;
|
|
242
|
+
W.fill(0), U.fill(0), d.begin(), M.begin(), i.begin();
|
|
243
243
|
let X = 0, D = 0;
|
|
244
244
|
for (const p of G.flares) {
|
|
245
|
-
const w = C(p.node),
|
|
246
|
-
if (D = Math.max(D, Q), Q > W[w] && (W[w] = Q, R[w].copy(te ? H : le),
|
|
245
|
+
const w = C(p.node), k = (c - p.start) / 1e3, pe = G.instances.get(p.instance), le = pe ? Ve[pe.type] : Ae, te = p.op === "write", Q = k < 0.3 ? k / 0.3 : Math.exp(-(k - 0.3) * 1.1);
|
|
246
|
+
if (D = Math.max(D, Q), Q > W[w] && (W[w] = Q, R[w].copy(te ? H : le), U[w] = te ? 1 : 0), A.fromArray(j, w * 3), te && k < 1.6 && X < Ee) {
|
|
247
247
|
const ne = z.current[X];
|
|
248
248
|
if (ne) {
|
|
249
|
-
const ae =
|
|
249
|
+
const ae = k / 1.6;
|
|
250
250
|
ne.visible = !0, ne.position.copy(A), ne.scale.setScalar(0.4 + ae * 3.2), v.ripples[X].color.setScalar((1 - ae) * (1 - ae) * 0.9);
|
|
251
251
|
}
|
|
252
252
|
X++;
|
|
253
253
|
}
|
|
254
254
|
const oe = ie(p.instance);
|
|
255
|
-
if (oe &&
|
|
255
|
+
if (oe && k < 2) {
|
|
256
256
|
it(A, B), ve(oe, B, 1.2, 2.5, F);
|
|
257
|
-
const ne = Math.min(1,
|
|
257
|
+
const ne = Math.min(1, k / 0.25) * Math.pow(1 - k / 2, 1.5), ae = te ? Math.min(1, k * 0.9) : 1 - Math.min(1, k * 0.9);
|
|
258
258
|
_.copy(te ? H : le).lerp(H, 0.2), d.add(oe, F, B, _, (te ? 0.55 : 0.4) * ne, 0.04, 0.99, 0, 1, x, ae, 1.9 * ne), ae > 0.02 && ae < 0.98 && (ce(oe, F, B, ae, q), i.add(q, 0.7, _, 1.6 * ne)), te ? M.add(oe, F, B, 0.95, 1, 0.4, H, ne * 1.2) : M.add(oe, F, B, 0.07, -1, 0.4, _, ne * 1.5);
|
|
259
259
|
}
|
|
260
260
|
}
|
|
@@ -265,8 +265,8 @@ function It({ galaxy: e }) {
|
|
|
265
265
|
d.end(), M.end(), i.end(), a.act += (D - a.act) * 0.05, v.gas.uniforms.uTime.value = x, v.gas.uniforms.uAct.value = a.act;
|
|
266
266
|
const se = S.ngeo.getAttribute("aSize"), ee = S.ngeo.getAttribute("aColor");
|
|
267
267
|
for (let p = 0; p < s; p++) {
|
|
268
|
-
const w = W[p],
|
|
269
|
-
se.setX(p, I[p] + w * (0.9 +
|
|
268
|
+
const w = W[p], k = re ? 1 : 0.85 + 0.15 * Math.sin(x * 0.9 + N[p]);
|
|
269
|
+
se.setX(p, I[p] + w * (0.9 + U[p] * 0.5)), _.copy(L[p]).multiplyScalar(k), w > 0.01 && (_.r += R[p].r * w * 1.5 + w * (0.25 + U[p]), _.g += R[p].g * w * 1.5 + w * (0.25 + U[p]), _.b += R[p].b * w * 1.5 + w * (0.25 + U[p])), ee.setXYZ(p, _.r, _.g, _.b);
|
|
270
270
|
}
|
|
271
271
|
se.needsUpdate = !0, ee.needsUpdate = !0;
|
|
272
272
|
const de = S.lgeo.getAttribute("color"), ue = S.owner;
|
|
@@ -280,15 +280,15 @@ function It({ galaxy: e }) {
|
|
|
280
280
|
const w = G.flares[p];
|
|
281
281
|
if (c - w.start > 2200) break;
|
|
282
282
|
if (w.area) continue;
|
|
283
|
-
let
|
|
284
|
-
for (let Q = 0; Q < Z; Q++) P.current[Q] === w.node && (
|
|
285
|
-
if (
|
|
283
|
+
let k = !1;
|
|
284
|
+
for (let Q = 0; Q < Z; Q++) P.current[Q] === w.node && (k = !0);
|
|
285
|
+
if (k) continue;
|
|
286
286
|
const pe = C(w.node);
|
|
287
287
|
for (let Q = 0; Q < Z; Q++) {
|
|
288
288
|
const oe = y.current[Q];
|
|
289
|
-
oe && Math.abs(oe.position.y - j[pe * 3 + 1]) < 0.9 / h && Math.abs(oe.position.x - j[pe * 3]) < 4.5 / h && (
|
|
289
|
+
oe && Math.abs(oe.position.y - j[pe * 3 + 1]) < 0.9 / h && Math.abs(oe.position.x - j[pe * 3]) < 4.5 / h && (k = !0);
|
|
290
290
|
}
|
|
291
|
-
if (
|
|
291
|
+
if (k) continue;
|
|
292
292
|
const le = g.current[Z], te = y.current[Z];
|
|
293
293
|
le && te && (te.position.fromArray(j, pe * 3), P.current[Z] !== w.node && (le.setText(`${w.op === "write" ? "wrote" : "read"} · ${w.node}`), le.setColor(w.op === "write" ? "#ffffff" : "#9db4ff")), le.setOpacity(Y(1.4 - (c - w.start) / 1600))), P.current[Z] = w.node, Z++;
|
|
294
294
|
}
|
|
@@ -356,7 +356,7 @@ function Lt() {
|
|
|
356
356
|
/* @__PURE__ */ b("primitive", { object: m.obj })
|
|
357
357
|
] });
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Ut({ run: e }) {
|
|
360
360
|
const n = T(() => new t.Color(e.color), [e.color]), s = T(() => ge(Le(), "#000"), []), o = E(null), f = E(null);
|
|
361
361
|
return fe(({ clock: m }) => {
|
|
362
362
|
var M;
|
|
@@ -366,10 +366,10 @@ function kt({ run: e }) {
|
|
|
366
366
|
o.current && (o.current.position.set(e.origin.x, e.origin.y, -3), o.current.scale.set(v * 2.8 + 6, d * 2.8 + 5, 1)), (M = f.current) == null || M.position.set(e.origin.x, e.origin.y + d + 0.7, 0);
|
|
367
367
|
}), /* @__PURE__ */ J(we, { children: [
|
|
368
368
|
/* @__PURE__ */ b("sprite", { ref: o, material: s }),
|
|
369
|
-
/* @__PURE__ */ b("group", { ref: f, children: e.run && /* @__PURE__ */ b(
|
|
369
|
+
/* @__PURE__ */ b("group", { ref: f, children: e.run && /* @__PURE__ */ b(kt, { run: e.run }) })
|
|
370
370
|
] });
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function kt({ run: e }) {
|
|
373
373
|
pt();
|
|
374
374
|
const n = e.status !== "started" || ht(e);
|
|
375
375
|
return /* @__PURE__ */ b(
|
|
@@ -426,14 +426,14 @@ function Wt() {
|
|
|
426
426
|
c && h && (h.position.copy(r.from).add(C.set(0, -2.3, 0)), y.current[u] !== r.run + r.start && (y.current[u] = r.run + r.start, c.setText(`final answer - ${r.text.length > 64 ? r.text.slice(0, 62) + "…" : r.text}`)), c.setOpacity(Y(x / 0.3) * Y((5.2 - x) / 1.2)));
|
|
427
427
|
const V = x / Kt;
|
|
428
428
|
if (V >= 1.25) continue;
|
|
429
|
-
const K = r.travel * (re ? 0.6 : 1), j = K * be(Math.min(1, V)), L = Math.min(7.5, K * 0.4) * Math.min(1, V * 3) * (V > 1 ? Math.max(0, 1 - (V - 1) / 0.25) : 1), I = V > 1 ? Math.max(0, 1 - (V - 1) / 0.25) : 1, W = -r.dir.y,
|
|
429
|
+
const K = r.travel * (re ? 0.6 : 1), j = K * be(Math.min(1, V)), L = Math.min(7.5, K * 0.4) * Math.min(1, V * 3) * (V > 1 ? Math.max(0, 1 - (V - 1) / 0.25) : 1), I = V > 1 ? Math.max(0, 1 - (V - 1) / 0.25) : 1, W = -r.dir.y, U = r.dir.x;
|
|
430
430
|
for (let R = 0; R < Se; R++)
|
|
431
431
|
for (let N = 0; N < me; N++)
|
|
432
432
|
for (let A = 0; A < 2; A++) {
|
|
433
433
|
const B = (N + A) / me, F = (R - 1) * 0.05 * (1 - B);
|
|
434
434
|
C.copy(r.from).addScaledVector(r.dir, j - L * (1 - B));
|
|
435
435
|
const q = ((l * Se + R) * me + N) * 2 + A;
|
|
436
|
-
M.setXYZ(q, C.x + W * F, C.y +
|
|
436
|
+
M.setXYZ(q, C.x + W * F, C.y + U * F, C.z);
|
|
437
437
|
const _ = Math.pow(B, 2) * (R === 1 ? 2.6 : 1.2) * I;
|
|
438
438
|
i.setXYZ(q, r.color.r * _, r.color.g * _, r.color.b * _);
|
|
439
439
|
}
|
|
@@ -533,7 +533,7 @@ function Yt() {
|
|
|
533
533
|
/* @__PURE__ */ b("points", { geometry: o, material: f.stars, frustumCulled: !1, renderOrder: -9 })
|
|
534
534
|
] });
|
|
535
535
|
}
|
|
536
|
-
const Zt = new t.Color("#6f7fb8"), $t = new t.Color("#ff6b7a"),
|
|
536
|
+
const Zt = new t.Color("#6f7fb8"), $t = new t.Color("#ff6b7a"), Ue = 0.95, Ht = new t.MeshBasicMaterial({ colorWrite: !1, depthWrite: !1, transparent: !0, opacity: 0 });
|
|
537
537
|
function Qt({ agent: e, selected: n, onSelect: s }) {
|
|
538
538
|
const o = e.inst, f = E(null), m = E(null), g = E(null), y = E(null), P = E(null), z = E(null), S = E(null), v = E(null), d = E(null), M = T(() => [...o.id].reduce((r, c) => (r * 31 + c.charCodeAt(0)) % 9973, 7) / 9973, [o.id]), i = Ve[o.type], l = T(
|
|
539
539
|
() => ({
|
|
@@ -558,7 +558,7 @@ function Qt({ agent: e, selected: n, onSelect: s }) {
|
|
|
558
558
|
e.live.set(e.pos.x + Math.sin(h * 0.21 + M * 20) * x, e.pos.y + Math.cos(h * 0.17 + M * 13) * x, e.pos.z);
|
|
559
559
|
const V = e.scale;
|
|
560
560
|
f.current && (f.current.position.copy(e.live), f.current.scale.setScalar(Math.max(1e-4, V))), (ue = v.current) == null || ue.position.set(e.live.x, e.live.y - 0.95 * V - 0.35, e.live.z);
|
|
561
|
-
const K = (c - o.bornAt) / 1e3, j = o.parent && G.instances.has(o.parent) ?
|
|
561
|
+
const K = (c - o.bornAt) / 1e3, j = o.parent && G.instances.has(o.parent) ? Ue * 0.85 : 0.05, L = Y((K - j) / 0.55), I = be(L), W = L > 0 ? Math.exp(-(K - j) * 3.2) : 0, U = o.exitAt ? (c - o.exitAt) / 1e3 : -1, R = U >= 0 ? xe(U / 0.7) : 0, N = U >= 0 ? Y((U - 0.7) / 1.7) : 0, A = U < 0;
|
|
562
562
|
o.llmCalls !== a.calls && (a.calls = o.llmCalls, a.flareAt = c, a.flareK = o.pulse);
|
|
563
563
|
const B = (c - a.flareAt) / 1e3, F = gt(o, c);
|
|
564
564
|
let q = !1;
|
|
@@ -603,7 +603,7 @@ function Qt({ agent: e, selected: n, onSelect: s }) {
|
|
|
603
603
|
ref: d,
|
|
604
604
|
text: `${o.name}${u !== void 0 ? ` ${Number(u) + 1}` : ""}`,
|
|
605
605
|
live: o.job ? () => bt(o) : null,
|
|
606
|
-
color:
|
|
606
|
+
color: ke[o.type],
|
|
607
607
|
size: o.subagent ? 0.22 : 0.28,
|
|
608
608
|
letterSpacing: 0.02,
|
|
609
609
|
opacity: 0,
|
|
@@ -628,8 +628,8 @@ function Jt() {
|
|
|
628
628
|
const u = C && !C.exitAt && !i.exitAt ? 1 : 0;
|
|
629
629
|
let r = g.get(i.id) ?? 0;
|
|
630
630
|
const c = (z - i.bornAt) / 1e3;
|
|
631
|
-
if (u && c <
|
|
632
|
-
const h = l.distanceTo(a) || 1, x = Math.min(0.3, 0.55 * Re.scale * (C ? 1.35 : 1) / h), V = Math.min(0.3, 0.5 * Re.scale / h), K = xe(c /
|
|
631
|
+
if (u && c < Ue && (r = 1), r += (u - r) * (u ? 0.08 : 0.03), g.set(i.id, r), r < 0.01) continue;
|
|
632
|
+
const h = l.distanceTo(a) || 1, x = Math.min(0.3, 0.55 * Re.scale * (C ? 1.35 : 1) / h), V = Math.min(0.3, 0.5 * Re.scale / h), K = xe(c / Ue);
|
|
633
633
|
v.copy(l).add(a).multiplyScalar(0.5);
|
|
634
634
|
const j = x + (1 - V - x) * K;
|
|
635
635
|
d.copy(Ve[i.type]).lerp(Ae, 0.5);
|
|
@@ -678,7 +678,7 @@ function co() {
|
|
|
678
678
|
graph: { natural: Me * 1.1, radius: 3.6 },
|
|
679
679
|
Background: /* @__PURE__ */ b(Yt, {}),
|
|
680
680
|
Agent: Qt,
|
|
681
|
-
RunMarker:
|
|
681
|
+
RunMarker: Ut,
|
|
682
682
|
mcpStyle: eo,
|
|
683
683
|
GraphResource: It,
|
|
684
684
|
cluster: { radius: 1.5, variant: "stars", glowGain: 0.9 },
|
|
@@ -26,13 +26,13 @@ const y = ["neural", "constellation", "orbit", "atom", "flow", "bubblechamber",
|
|
|
26
26
|
bubblechamber: { name: "Bubble chamber", tagline: "A bubble chamber: agents curl as particle tracks, spawns decay into a V, LLM calls burst bubbles." },
|
|
27
27
|
fireworks: { name: "Fireworks", tagline: "A night show over the water: agents burst as star shells, subagents as secondary bursts, LLM calls crackle." }
|
|
28
28
|
}, E = {
|
|
29
|
-
orbit: () => import("./index-
|
|
30
|
-
neural: () => import("./index-
|
|
31
|
-
flow: () => import("./index-
|
|
32
|
-
constellation: () => import("./index-
|
|
33
|
-
atom: () => import("./index-
|
|
34
|
-
bubblechamber: () => import("./index-
|
|
35
|
-
fireworks: () => import("./index-
|
|
29
|
+
orbit: () => import("./index-BXBnv8GE.js"),
|
|
30
|
+
neural: () => import("./index-n6GWpbis.js"),
|
|
31
|
+
flow: () => import("./index-B7hfNEXI.js"),
|
|
32
|
+
constellation: () => import("./index-CHIG9x__.js"),
|
|
33
|
+
atom: () => import("./index-Mp_16YlZ.js"),
|
|
34
|
+
bubblechamber: () => import("./index-DOXpqUvk.js"),
|
|
35
|
+
fireworks: () => import("./index-B8MtKKcW.js")
|
|
36
36
|
}, b = /* @__PURE__ */ new Map();
|
|
37
37
|
function x(e) {
|
|
38
38
|
let n = b.get(e);
|