agentglow 0.4.3 → 0.4.4
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-CsXvCpWR.js} +3204 -2979
- package/dist/chunks/{index-CW8fTJn1.js → index-06NeTpVb.js} +7 -7
- package/dist/chunks/{index-nw9i304P.js → index-CMyk3b1y.js} +1 -1
- package/dist/chunks/{index-CoeLwySn.js → index-CZCnCMDL.js} +1 -1
- package/dist/chunks/{index-DATZHNA0.js → index-CaU-znb0.js} +42 -42
- package/dist/chunks/{index-DlvN9YSt.js → index-DS_Ev4sI.js} +169 -169
- package/dist/chunks/{index-s99mYaJ9.js → index-DvmCk82M.js} +39 -39
- package/dist/chunks/{index-B6EboYGn.js → index-jIBsR1lw.js} +30 -30
- package/dist/chunks/{index-avfwD6eP.js → index-zAkSg1r8.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,11 +6,11 @@ import { EffectComposer as Le, Bloom as Oe, Vignette as Ee } from "@react-three/
|
|
|
6
6
|
import * as r from "three";
|
|
7
7
|
import { useFrame as ht, useThree as Fe } from "@react-three/fiber";
|
|
8
8
|
import { useMemo as D, useRef as I, useEffect as ce } from "react";
|
|
9
|
-
import { T as le, h as et, f as Rt, K as je, w as L, F as qe, a as St,
|
|
9
|
+
import { T as le, h as et, f as Rt, K as je, w as L, F as qe, a as St, Q as We, L as Bt, C as Ke, u as _e, A as st, d as ve, k as Ue, H as Xe, R as Ne, E as $e, X as He, e as Ze, s as Ye, j as Qe, n as Je, o as to, x as eo } from "./KitScene-CsXvCpWR.js";
|
|
10
10
|
var Pe;
|
|
11
|
-
const nt = typeof window < "u" && !!((Pe = window.matchMedia) != null && Pe.call(window, "(prefers-reduced-motion: reduce)").matches), rt = (t) => t < 0 ? 0 : t > 1 ? 1 : t, jt = (t) => 1 - Math.pow(1 - rt(t), 3), ne = (t) => (t = rt(t), t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2), pt = () => performance.now() / 1e3,
|
|
11
|
+
const nt = typeof window < "u" && !!((Pe = window.matchMedia) != null && Pe.call(window, "(prefers-reduced-motion: reduce)").matches), rt = (t) => t < 0 ? 0 : t > 1 ? 1 : t, jt = (t) => 1 - Math.pow(1 - rt(t), 3), ne = (t) => (t = rt(t), t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2), pt = () => performance.now() / 1e3, X = new r.Color(1, 1, 1), N = new r.Color("#bff3ff");
|
|
12
12
|
new r.Color("#2dd4bf");
|
|
13
|
-
const
|
|
13
|
+
const Nt = new r.Color("#fbbf24"), _t = new r.Color("#ff3048"), It = Object.fromEntries(Object.entries(le).map(([t, e]) => [t, new r.Color(e).lerp(N, 0.38)])), oo = Object.fromEntries(Object.entries(le).map(([t, e]) => [t, new r.Color(e)]));
|
|
14
14
|
let Dt = null;
|
|
15
15
|
function no() {
|
|
16
16
|
if (Dt) return Dt;
|
|
@@ -231,7 +231,7 @@ function Ie(t) {
|
|
|
231
231
|
const e = ((a = $t.get(t.run.id)) == null ? void 0 : a.z) ?? 0, s = et(t.id, 77) - 0.5, o = Math.max(t.inst.parent ? 2 : 1.2, R.hz * (t.inst.parent ? 0.34 + 0.05 * Math.min(2, t.depth - 1) : 0.14)), d = e + s * 2 * o * Math.max(0.85, Math.min(1.2, Rt.spread)), c = Math.max(0.5, R.hz - 1.1);
|
|
232
232
|
return d < -c ? -c : d > c ? c : d;
|
|
233
233
|
}
|
|
234
|
-
const zt = 7, Wt = 8, ue = 5, ft = 6.2, ut = 3.5, he = 0.08, Be = 0.92, Te = 0.52, po = 0.09, mo = 1.15, Et = Wt * ue, at = zt * Et, de = ft / Wt, pe = ut / ue, De = (zt - 1) / 2 * Be + ut / 2 * Math.sin(Te), Mo = Math.hypot(ft / 2 + 0.6, De + 0.4), go = 32,
|
|
234
|
+
const zt = 7, Wt = 8, ue = 5, ft = 6.2, ut = 3.5, he = 0.08, Be = 0.92, Te = 0.52, po = 0.09, mo = 1.15, Et = Wt * ue, at = zt * Et, de = ft / Wt, pe = ut / ue, De = (zt - 1) / 2 * Be + ut / 2 * Math.sin(Te), Mo = Math.hypot(ft / 2 + 0.6, De + 0.4), go = 32, Xt = 3, Ve = new r.BoxGeometry(ft, he, ut), yo = new r.EdgesGeometry(Ve), wo = (() => {
|
|
235
235
|
const t = [], e = he / 2 + 4e-3;
|
|
236
236
|
for (let s = 1; s < Wt; s++) {
|
|
237
237
|
const o = -ft / 2 + s * de;
|
|
@@ -255,7 +255,7 @@ function xo({ galaxy: t }) {
|
|
|
255
255
|
const z = Math.floor(et(A.id, 9) * at) % at;
|
|
256
256
|
y[S] = z, v[z]++, x[z].add(B.set(je[A.kind] ?? "#94a3b8"));
|
|
257
257
|
});
|
|
258
|
-
for (let A = 0; A < at; A++) v[A] && x[A].multiplyScalar(1 / v[A]).lerp(
|
|
258
|
+
for (let A = 0; A < at; A++) v[A] && x[A].multiplyScalar(1 / v[A]).lerp(N, 0.35);
|
|
259
259
|
return { cellOf: y, occ: v, base: x, dep: new Float32Array(at), white: new Float32Array(at), depC: Array.from({ length: at }, () => new r.Color()) };
|
|
260
260
|
}, [t, e]), o = D(
|
|
261
261
|
() => Array.from({ length: zt }, () => ({
|
|
@@ -275,7 +275,7 @@ function xo({ galaxy: t }) {
|
|
|
275
275
|
), d = I([]), c = D(() => new r.MeshBasicMaterial({ blending: r.AdditiveBlending, depthWrite: !1, transparent: !0, toneMapped: !1, side: r.DoubleSide }), []), a = D(() => {
|
|
276
276
|
const y = new r.InstancedMesh(vo, c, at);
|
|
277
277
|
return y.instanceColor = new r.InstancedBufferAttribute(new Float32Array(at * 3), 3), y.frustumCulled = !1, y.renderOrder = 3, y;
|
|
278
|
-
}, [c]), l = D(() => new Yt(go, 24), []), f = D(() => /* @__PURE__ */ new Map(), [t]), u = D(() => /* @__PURE__ */ new Set(), []), i = I([]), p = I([]), h = I(Array(
|
|
278
|
+
}, [c]), l = D(() => new Yt(go, 24), []), f = D(() => /* @__PURE__ */ new Map(), [t]), u = D(() => /* @__PURE__ */ new Set(), []), i = I([]), p = I([]), h = I(Array(Xt).fill("")), m = D(
|
|
279
279
|
() => ({ v: new r.Vector3(), w: new r.Vector3(), ctrl: new r.Vector3(), h: new r.Vector3(), c: new r.Color(), cm: new r.Matrix4(), sm: new r.Matrix4(), off: new r.Vector3(), one: new r.Vector3(1, 1, 1) }),
|
|
280
280
|
[]
|
|
281
281
|
), w = (y) => {
|
|
@@ -289,18 +289,18 @@ function xo({ galaxy: t }) {
|
|
|
289
289
|
for (const g of o)
|
|
290
290
|
g.act = 0, g.read = 0, g.want.setRGB(0, 0, 0);
|
|
291
291
|
for (const g of L.flares) {
|
|
292
|
-
const M = w(g.node), P = (x - g.start) / 1e3, K = L.instances.get(g.instance), O = K ? It[K.type] :
|
|
293
|
-
U > F[M] && (F[M] = U, T[M].copy(j ?
|
|
292
|
+
const M = w(g.node), P = (x - g.start) / 1e3, K = L.instances.get(g.instance), O = K ? It[K.type] : N, j = g.op === "write", U = P < 0.25 ? P / 0.25 : Math.exp(-(P - 0.25) * 1.1);
|
|
293
|
+
U > F[M] && (F[M] = U, T[M].copy(j ? X : O), E[M] = j ? 1 : 0);
|
|
294
294
|
const J = o[Math.floor(M / Et)];
|
|
295
|
-
U > J.act && (J.act = U, J.want.copy(j ?
|
|
295
|
+
U > J.act && (J.act = U, J.want.copy(j ? X : O)), !j && P < 2.2 && (J.read = Math.max(J.read, P < 0.2 ? P / 0.2 : rt((2.2 - P) / 0.8)));
|
|
296
296
|
}
|
|
297
297
|
for (let g = 0; g < zt; g++) {
|
|
298
298
|
const M = o[g];
|
|
299
299
|
M.slide += (M.read - M.slide) * Math.min(1, A * (M.read > M.slide ? 7 : 2.5)), bo(g, M.pos, M.q), gt.set(0, 0.06, mo).applyQuaternion(M.q).multiplyScalar(zo(M.slide)), M.pos.add(gt), M.m.compose(M.pos, M.q, Ct);
|
|
300
300
|
const P = d.current[g];
|
|
301
|
-
P && (P.position.copy(M.pos), P.quaternion.copy(M.q)), M.tint.lerp(M.act > 0.02 ? M.want :
|
|
301
|
+
P && (P.position.copy(M.pos), P.quaternion.copy(M.q)), M.tint.lerp(M.act > 0.02 ? M.want : N, Math.min(1, A * 6));
|
|
302
302
|
const K = nt ? 1 : 0.9 + 0.1 * Math.sin(S * 0.7 + g * 1.3), O = M.act;
|
|
303
|
-
M.edge.color.copy(
|
|
303
|
+
M.edge.color.copy(N).lerp(M.tint, O).multiplyScalar((0.2 + 0.06 * g / zt) * K + O * 0.75 + M.slide * 0.2), M.grid.color.copy(N).lerp(M.tint, O).multiplyScalar(0.06 + O * 0.18), M.fill.color.copy($.set("#4fd1c5")).lerp(M.tint, O * 0.8).multiplyScalar(0.03 + O * 0.06 + M.slide * 0.03);
|
|
304
304
|
}
|
|
305
305
|
l.begin();
|
|
306
306
|
for (const g of u) {
|
|
@@ -309,13 +309,13 @@ function xo({ galaxy: t }) {
|
|
|
309
309
|
M || u.delete(g);
|
|
310
310
|
}
|
|
311
311
|
for (const g of L.flares) {
|
|
312
|
-
const M = w(g.node), P = (x - g.start) / 1e3, K = L.instances.get(g.instance), O = K ? It[K.type] :
|
|
313
|
-
n(M, V), qe(V, G), j && !u.has(g.id) && P > 0.55 && (u.add(g.id), re(G, 12, 0.45, 0.1,
|
|
312
|
+
const M = w(g.node), P = (x - g.start) / 1e3, K = L.instances.get(g.instance), O = K ? It[K.type] : N, j = g.op === "write";
|
|
313
|
+
n(M, V), qe(V, G), j && !u.has(g.id) && P > 0.55 && (u.add(g.id), re(G, 12, 0.45, 0.1, X, 1, 2.2, B), Z().emit(G.x, G.y, G.z, 1.2, X, 0.9, 0.5, B, 2));
|
|
314
314
|
const U = St(g.instance);
|
|
315
315
|
if (U && P < 1.9) {
|
|
316
316
|
qt(U, G, 0.1, W);
|
|
317
317
|
const J = Math.min(1, P / 0.2) * Math.pow(1 - P / 1.9, 1.5), dt = j ? Math.min(1, P * 1.6) : 1 - Math.min(1, P * 1.6);
|
|
318
|
-
$.copy(j ?
|
|
318
|
+
$.copy(j ? X : O).lerp(X, 0.2), l.add(U, W, G, $, (j ? 0.32 : 0.24) * J, 0.03, 0.99, 0, 0, dt, 1.5 * J), dt > 0.02 && dt < 0.98 && (Ut(U, W, G, dt, Y), Z().emit(Y.x, Y.y, Y.z, 0.45, $, 1.3 * J, 0.12, B, 1));
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
l.end();
|
|
@@ -326,7 +326,7 @@ function xo({ galaxy: t }) {
|
|
|
326
326
|
}
|
|
327
327
|
a.instanceMatrix.needsUpdate = !0, yt.needsUpdate = !0;
|
|
328
328
|
let Q = 0;
|
|
329
|
-
for (let g = L.flares.length - 1; g >= 0 && Q <
|
|
329
|
+
for (let g = L.flares.length - 1; g >= 0 && Q < Xt; g--) {
|
|
330
330
|
const M = L.flares[g];
|
|
331
331
|
if (x - M.start > 2200) break;
|
|
332
332
|
if (M.area) continue;
|
|
@@ -340,7 +340,7 @@ function xo({ galaxy: t }) {
|
|
|
340
340
|
const K = i.current[Q], O = p.current[Q];
|
|
341
341
|
K && O && (O.position.copy(V), h.current[Q] !== M.node && (K.setText(`${M.op === "write" ? "wrote" : "read"} · ${M.node}`), K.setColor(M.op === "write" ? "#ffffff" : "#8fe9f5")), K.setOpacity(rt(1.4 - (x - M.start) / 1600))), h.current[Q] = M.node, Q++;
|
|
342
342
|
}
|
|
343
|
-
for (let g = Q; g <
|
|
343
|
+
for (let g = Q; g < Xt; g++)
|
|
344
344
|
(H = i.current[g]) == null || H.setOpacity(0), h.current[g] = "";
|
|
345
345
|
}), /* @__PURE__ */ lt(Kt, { children: [
|
|
346
346
|
o.map((y, v) => /* @__PURE__ */ lt("group", { ref: (x) => void (d.current[v] = x), children: [
|
|
@@ -350,7 +350,7 @@ function xo({ galaxy: t }) {
|
|
|
350
350
|
] }, v)),
|
|
351
351
|
/* @__PURE__ */ b("primitive", { object: a }),
|
|
352
352
|
/* @__PURE__ */ b(We, { children: /* @__PURE__ */ b("primitive", { object: l.obj }) }),
|
|
353
|
-
Array.from({ length:
|
|
353
|
+
Array.from({ length: Xt }, (y, v) => /* @__PURE__ */ b("group", { ref: (x) => void (p.current[v] = x), children: /* @__PURE__ */ b(Bt, { ref: (x) => void (i.current[v] = x), text: "", offset: [0, 0.45], size: 0.24, opacity: 0, fadeMs: 250, pxRange: [8, 12] }) }, v)),
|
|
354
354
|
/* @__PURE__ */ b(So, {})
|
|
355
355
|
] });
|
|
356
356
|
}
|
|
@@ -502,7 +502,7 @@ function To() {
|
|
|
502
502
|
const C = Math.random() * Ft, F = Math.sqrt(Math.random()) * 0.85;
|
|
503
503
|
Se.set(Math.cos(C) * F * R.rx, Math.sin(C) * F * R.ry, (Math.random() - 0.5) * 1.7 * R.hz);
|
|
504
504
|
const E = Math.random() < 0.3, T = Math.random() < 0.5 ? 1 : -1;
|
|
505
|
-
Re(Se, Math.random() * Ft, E ? 0.9 + Math.random() * 0.8 : 0.3 + Math.random() * 0.4, E ? 2.4 : 1.6, E ? 70 : 30, 0.075,
|
|
505
|
+
Re(Se, Math.random() * Ft, E ? 0.9 + Math.random() * 0.8 : 0.3 + Math.random() * 0.4, E ? 2.4 : 1.6, E ? 70 : 30, 0.075, N, 0.3, 6, z, T, T * (E ? 1.4 : 0.6));
|
|
506
506
|
}), /* @__PURE__ */ lt(Kt, { children: [
|
|
507
507
|
/* @__PURE__ */ b("mesh", { ref: l, material: e.back, position: [0, 0, -14], renderOrder: -10, frustumCulled: !1, children: /* @__PURE__ */ b("planeGeometry", { args: [700, 500] }) }),
|
|
508
508
|
/* @__PURE__ */ lt("group", { ref: f, children: [
|
|
@@ -559,7 +559,7 @@ function Go() {
|
|
|
559
559
|
if (!l || !f || !u) continue;
|
|
560
560
|
qt(l, f, 0.12, Vt);
|
|
561
561
|
const i = Ue(a, o);
|
|
562
|
-
wt.set(u.color).lerp(
|
|
562
|
+
wt.set(u.color).lerp(Nt, rt(i / 1.2)), i > 1.2 && wt.lerp(_t, rt((i - 1.2) / 1));
|
|
563
563
|
const p = l.distanceTo(f), h = 0.04 + 0.92 * jt(i / 0.45);
|
|
564
564
|
t.add(l, Vt, f, wt, (0.3 + Math.min(0.3, i * 0.12)) * jt(i / 0.3), 0.04, h, Math.max(4, Math.round(p / 0.5)), c * 1.4, i < 0.45 ? h : -1, 1);
|
|
565
565
|
}
|
|
@@ -577,7 +577,7 @@ function Go() {
|
|
|
577
577
|
let p = e.get(a.id);
|
|
578
578
|
p || e.set(a.id, p = new fe()), qt(f, u, 0.12, Vt);
|
|
579
579
|
const h = ne(l);
|
|
580
|
-
Ut(f, Vt, u, 1 - h, Gt), wt.set(i.color).lerp(
|
|
580
|
+
Ut(f, Vt, u, 1 - h, Gt), wt.set(i.color).lerp(X, 0.45);
|
|
581
581
|
const m = 1 - Math.max(0, (h - 0.85) / 0.15);
|
|
582
582
|
t.add(f, Vt, u, wt, 0.1 * m, 0.04, 0.96, 0, 0, 1 - h, 1.3 * m), p.step(Gt, 0.065, 0.08, wt, 0.95 * m, 2.6, d, 6), Z().emit(Gt.x, Gt.y, Gt.z, 0.5, wt, 1.3 * m, 0.12, d, 1);
|
|
583
583
|
}
|
|
@@ -594,7 +594,7 @@ const ko = (() => {
|
|
|
594
594
|
})(), Lo = new r.Vector3(1, 0.07, 0).normalize(), ee = new r.Vector3(), Oo = new r.Vector3();
|
|
595
595
|
function Eo(t, e, s, o) {
|
|
596
596
|
const d = Z(), c = pt();
|
|
597
|
-
d.emit(t.x, t.y, t.z, 1.6 * o,
|
|
597
|
+
d.emit(t.x, t.y, t.z, 1.6 * o, X, 1.4, 0.6, c, 1), d.emit(t.x, t.y, t.z, 3.2 * o, s, 1, 0.9, c, 2);
|
|
598
598
|
const a = 5 + Math.floor(et(e, 41) * 3);
|
|
599
599
|
for (let l = 0; l < a; l++) {
|
|
600
600
|
const f = l / a * Math.PI * 2 + et(e, 50 + l) * 0.9, u = (1.2 + et(e, 60 + l) * 4) * o, i = (1.1 + et(e, 70 + l) * 1.8) * o, p = et(e, 80 + l) < 0.5 ? 1 : -1, h = (et(e, 90 + l) - 0.5) * 1.6, m = Math.max(6, Math.round(i / (0.075 * o))), w = t.x + Math.cos(f + p * Math.PI * 0.5) * u, n = t.y + Math.sin(f + p * Math.PI * 0.5) * u, y = f - p * Math.PI * 0.5;
|
|
@@ -605,7 +605,7 @@ function Eo(t, e, s, o) {
|
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
function Fo({ run: t }) {
|
|
608
|
-
const e = D(() => new r.Color(t.color).lerp(
|
|
608
|
+
const e = D(() => new r.Color(t.color).lerp(N, 0.35), [t.color]), s = D(() => se("#000"), []), o = D(() => ot("#000"), []), d = I(null), c = D(() => new Yt(1, 64), []), a = I(null), l = I(null), f = D(() => ({ p: new r.Vector3(), fired: !1, init: !1, dep: { z: 0, tz: 0 } }), []);
|
|
609
609
|
return ce(() => (xt.set(t.id, f.p), $t.set(t.id, f.dep), () => {
|
|
610
610
|
xt.get(t.id) === f.p && xt.delete(t.id), $t.get(t.id) === f.dep && $t.delete(t.id);
|
|
611
611
|
}), [t.id, f]), ht(({ clock: u, camera: i }, p) => {
|
|
@@ -615,11 +615,11 @@ function Fo({ run: t }) {
|
|
|
615
615
|
for (const W of st.agents.values())
|
|
616
616
|
W.run !== t || W.inst.parent || (w += W.eu, n++, W.ev < y && (y = W.ev));
|
|
617
617
|
const v = n ? w / n : t.cu, x = (n ? y : t.cv - t.hv) - 1.55 * Rt.spread;
|
|
618
|
-
|
|
618
|
+
Xe(t, v, x, f.p), f.dep.tz = ho(t.index, t.count), f.dep.z = f.init ? f.dep.z + (f.dep.tz - f.dep.z) * Math.min(1, Math.min(0.05, p) * 1.2) : f.dep.tz, f.p.z = f.dep.z, f.init = !0;
|
|
619
619
|
const B = m ? (h - m.startedAt) / 1e3 : 99;
|
|
620
620
|
f.fired || (f.fired = !0, B < 1.2 && Eo(f.p, t.id, e, Math.max(0.6, Rt.scale)));
|
|
621
|
-
const A = jt(B / 0.8), S = m ? m.status !== "started" : !1, z = m != null && m.endedAt ? rt(1 - (h - m.endedAt - (
|
|
622
|
-
a.current && (a.current.position.copy(f.p), a.current.scale.setScalar((0.9 + (S ? 0 : 0.25)) * Math.max(0.7, Rt.scale))), d.current && (d.current.position.copy(f.p), d.current.quaternion.copy(i.quaternion), d.current.scale.setScalar(Math.max(0.7, Rt.scale))), o.color.copy(e).lerp(
|
|
621
|
+
const A = jt(B / 0.8), S = m ? m.status !== "started" : !1, z = m != null && m.endedAt ? rt(1 - (h - m.endedAt - (Ne - 2500)) / 2500) : 1, C = nt || S ? 1 : 0.85 + 0.15 * Math.sin(u.elapsedTime * 2.2 + t.index);
|
|
622
|
+
a.current && (a.current.position.copy(f.p), a.current.scale.setScalar((0.9 + (S ? 0 : 0.25)) * Math.max(0.7, Rt.scale))), d.current && (d.current.position.copy(f.p), d.current.quaternion.copy(i.quaternion), d.current.scale.setScalar(Math.max(0.7, Rt.scale))), o.color.copy(e).lerp(X, 0.3).multiplyScalar((S ? 0.3 : 0.75) * A * z), s.color.copy(e).lerp(X, 0.4).multiplyScalar((S ? 0.35 : 0.8) * C * A * z), c.begin();
|
|
623
623
|
const F = 7 + st.core.hw * 0.6;
|
|
624
624
|
ee.copy(f.p).addScaledVector(Lo, -F);
|
|
625
625
|
const E = Oo.copy(ee).add(f.p).multiplyScalar(0.5);
|
|
@@ -668,12 +668,12 @@ function qo() {
|
|
|
668
668
|
if (!l) continue;
|
|
669
669
|
let f;
|
|
670
670
|
for (const z of L.instances.values()) z.run === a.id && !z.parent && (f = St(z.id) ?? f);
|
|
671
|
-
const u = (f ?? xt.get(a.id) ?? l.origin).clone(), i = Math.abs(u.x) > 0.5 ? u.x < 0 ? -1 : 1 : et(a.id, 23) < 0.5 ? 1 : -1, p = Math.atan2(-0.35 - et(a.id, 22) * 0.4, i), h = 40 * (et(a.id, 24) < 0.5 ? 1 : -1), m = (et(a.id, 25) - 0.5) * 0.35, w = st.core.r + 9, n = new r.Color(a.color).lerp(
|
|
671
|
+
const u = (f ?? xt.get(a.id) ?? l.origin).clone(), i = Math.abs(u.x) > 0.5 ? u.x < 0 ? -1 : 1 : et(a.id, 23) < 0.5 ? 1 : -1, p = Math.atan2(-0.35 - et(a.id, 22) * 0.4, i), h = 40 * (et(a.id, 24) < 0.5 ? 1 : -1), m = (et(a.id, 25) - 0.5) * 0.35, w = st.core.r + 9, n = new r.Color(a.color).lerp(X, 0.6), y = Z(), v = pt(), x = u.x + Math.cos(p + Math.PI * 0.5) * h, B = u.y + Math.sin(p + Math.PI * 0.5) * h, A = p - Math.PI * 0.5, S = Math.round(w / 0.085);
|
|
672
672
|
for (let z = 1; z <= S; z++) {
|
|
673
673
|
const C = z / S * w, F = A + C / h, E = x + Math.cos(F) * h, T = B + Math.sin(F) * h, V = v + C / 11, G = u.z + C * m;
|
|
674
|
-
y.emit(E, T, G, 0.09 * (0.75 + Math.random() * 0.5), n, 0.7, 5.5, V, 0), z % 3 === 0 && y.emit(E, T, G, 0.6,
|
|
674
|
+
y.emit(E, T, G, 0.09 * (0.75 + Math.random() * 0.5), n, 0.7, 5.5, V, 0), z % 3 === 0 && y.emit(E, T, G, 0.6, X, 0.9, 0.16, V, 1);
|
|
675
675
|
}
|
|
676
|
-
y.emit(u.x, u.y, u.z, 1.6,
|
|
676
|
+
y.emit(u.x, u.y, u.z, 1.6, X, 1.3, 0.6, v, 1), e.current.push({ run: a.id, at: c, from: u, text: a.final }), e.current.length > oe && e.current.shift();
|
|
677
677
|
}
|
|
678
678
|
if (t.current.size > 200)
|
|
679
679
|
for (const a of t.current) L.runs.has(a) || t.current.delete(a);
|
|
@@ -696,7 +696,7 @@ function Ko({ agent: t, selected: e, onSelect: s }) {
|
|
|
696
696
|
halo: se(m),
|
|
697
697
|
core: se("#fff"),
|
|
698
698
|
sel: ot("#e6fbff"),
|
|
699
|
-
wait: ot(
|
|
699
|
+
wait: ot(Nt)
|
|
700
700
|
}),
|
|
701
701
|
[m]
|
|
702
702
|
), n = D(
|
|
@@ -745,7 +745,7 @@ function Ko({ agent: t, selected: e, onSelect: s }) {
|
|
|
745
745
|
const ct = 4.2 * Math.max(0.6, Rt.spread);
|
|
746
746
|
it.length() > ct && n.from.copy(t.pos).addScaledVector(it.normalize(), ct);
|
|
747
747
|
const Tt = Z(), Pt = n.from;
|
|
748
|
-
if (Tt.emit(Pt.x, Pt.y, Pt.z, 0.9 * C,
|
|
748
|
+
if (Tt.emit(Pt.x, Pt.y, Pt.z, 0.9 * C, N, 1.3, 0.45, S, 1), Tt.emit(Pt.x, Pt.y, Pt.z, 1.5 * C, It[o.type], 0.9, 0.6, S, 2), _ && o.parent) {
|
|
749
749
|
const we = st.agents.get(o.parent);
|
|
750
750
|
it.copy(t.pos).sub(n.from);
|
|
751
751
|
const Qt = it.length() || 1, Jt = we ? we.scale : C;
|
|
@@ -758,13 +758,13 @@ function Ko({ agent: t, selected: e, onSelect: s }) {
|
|
|
758
758
|
const _ = Math.min(2.5, Math.max(0.6, o.pulse));
|
|
759
759
|
n.boost = Math.min(1.1, n.boost + 0.25 + _ * 0.22);
|
|
760
760
|
const q = t.live;
|
|
761
|
-
re(q, Math.round(6 + _ * 7), (0.14 + _ * 0.12) * C, 0.12 * C,
|
|
761
|
+
re(q, Math.round(6 + _ * 7), (0.14 + _ * 0.12) * C, 0.12 * C, N, 1, 2.8, S), Z().emit(q.x, q.y, q.z, (0.7 + _ * 0.45) * C, N, 0.9, 0.45, S, 1), nt || Re(q, Y + n.q * 0.9, (0.14 + _ * 0.07) * C, 1.7, 22, 0.07 * C, N, 0.85, 3.4, S, -n.q, -n.q * (0.25 + _ * 0.1) * C);
|
|
762
762
|
}
|
|
763
763
|
if (o.toolCalls !== n.tools && (n.tools = o.toolCalls, !T)) {
|
|
764
764
|
const _ = Math.random() < 0.5 ? 1 : -1;
|
|
765
765
|
te(o.id, Math.cos(Y + _ * 1.4) * 0.2 * C, Math.sin(Y + _ * 1.4) * 0.2 * C, _ * 0.16 * C, A);
|
|
766
766
|
const q = t.live;
|
|
767
|
-
Z().emit(q.x, q.y, q.z, 0.55 * C,
|
|
767
|
+
Z().emit(q.x, q.y, q.z, 0.55 * C, X, 1.1, 0.3, S + 0.05, 1);
|
|
768
768
|
}
|
|
769
769
|
const $ = o.decisions;
|
|
770
770
|
for (let _ = 0; _ < $.length; _++) {
|
|
@@ -795,7 +795,7 @@ function Ko({ agent: t, selected: e, onSelect: s }) {
|
|
|
795
795
|
_ >= 1 ? n.fly = !1 : (P = !0, it.copy(H), qt(n.from, it, n.q * 0.24, bt), Ut(n.from, bt, it, jt(_ * 0.85 + 0.15 * _ * _), H));
|
|
796
796
|
}
|
|
797
797
|
const K = Math.hypot(t.pos.x - n.hx, t.pos.y - n.hy) / Math.max(1e-3, z) / Math.max(0.3, C);
|
|
798
|
-
n.hx = t.pos.x, n.hy = t.pos.y, n.move += (Math.min(1, Math.max(0, K - 0.4) * 0.5) - n.move) * Math.min(1, z * 8), n.waitK += ((G ? 1 : 0) - n.waitK) * Math.min(1, z * 4), n.col.copy(It[o.type]).lerp(
|
|
798
|
+
n.hx = t.pos.x, n.hy = t.pos.y, n.move += (Math.min(1, Math.max(0, K - 0.4) * 0.5) - n.move) * Math.min(1, z * 8), n.waitK += ((G ? 1 : 0) - n.waitK) * Math.min(1, z * 4), n.col.copy(It[o.type]).lerp(Nt, n.waitK * 0.75).lerp(_t, n.red * 0.85), o.status === "failed" && n.col.lerp(_t, 0.5);
|
|
799
799
|
const O = n.rc + n.rg + (P ? 1 : 0);
|
|
800
800
|
if (!n.stopped) {
|
|
801
801
|
const _ = (P ? 1.5 : T ? 0.7 : V ? 1.55 : 0.95) * (P ? 1 : 1 - 0.85 * n.move);
|
|
@@ -803,13 +803,13 @@ function Ko({ agent: t, selected: e, onSelect: s }) {
|
|
|
803
803
|
}
|
|
804
804
|
!T && n.stopped && (n.stopped = !1, n.trail.reset());
|
|
805
805
|
const j = o.exitAt ? (A - o.exitAt) / 1e3 : -1, U = j >= 0 ? rt(j / 1.6) : 0, J = jt(W / 0.35), dt = Ze(o, A), me = ((T ? 0.45 : V ? 1 : 0.6) + dt * 0.25 + n.boost * 0.4 + (P ? 0.5 : 0)) * (1 - U);
|
|
806
|
-
if (d.current && (d.current.position.copy(H), d.current.scale.setScalar(Math.max(1e-4, C * J))), l.current && (l.current.scale.setScalar(0.5 + dt * 0.1 + n.boost * 0.12), w.core.color.copy(
|
|
806
|
+
if (d.current && (d.current.position.copy(H), d.current.scale.setScalar(Math.max(1e-4, C * J))), l.current && (l.current.scale.setScalar(0.5 + dt * 0.1 + n.boost * 0.12), w.core.color.copy(X).lerp(n.col, 0.2).multiplyScalar(Math.min(2, 1.5 * me))), a.current) {
|
|
807
807
|
const _ = Math.min(1, Math.sqrt(1.3 / Math.max(0.1, C)));
|
|
808
808
|
a.current.scale.setScalar(((V ? 2 : 1.5) + dt * 0.4 + n.boost * 0.6) * _), w.halo.color.copy(m).lerp(n.col, 0.4).multiplyScalar(0.62 * me);
|
|
809
809
|
}
|
|
810
810
|
c.current && (c.current.position.copy(t.pos), c.current.quaternion.copy(x.quaternion), c.current.scale.setScalar(Math.max(1e-4, g)));
|
|
811
811
|
const Me = 0.34 + 0.28 + 0.3;
|
|
812
|
-
n.selK += ((e ? 1 : 0) - n.selK) * 0.14, f.current && (f.current.visible = n.selK > 0.02, f.current.scale.setScalar(Me + 0.18 + (1 - n.selK) * 0.3), f.current.rotation.z = nt ? 0 : S * 0.15, w.sel.color.setScalar(0.85 * n.selK)), u.current && (u.current.visible = n.waitK > 0.02, u.current.scale.setScalar(0.5 + 0.03 * Math.sin(S * 3)), u.current.rotation.z = nt ? 0 : -S * 0.8, w.wait.color.copy(
|
|
812
|
+
n.selK += ((e ? 1 : 0) - n.selK) * 0.14, f.current && (f.current.visible = n.selK > 0.02, f.current.scale.setScalar(Me + 0.18 + (1 - n.selK) * 0.3), f.current.rotation.z = nt ? 0 : S * 0.15, w.sel.color.setScalar(0.85 * n.selK)), u.current && (u.current.visible = n.waitK > 0.02, u.current.scale.setScalar(0.5 + 0.03 * Math.sin(S * 3)), u.current.rotation.z = nt ? 0 : -S * 0.8, w.wait.color.copy(Nt).multiplyScalar(0.9 * n.waitK)), (ge = i.current) == null || ge.position.set(t.pos.x, t.pos.y - (Me + 0.12) * g - 0.3, t.pos.z), (ye = p.current) == null || ye.setOpacity(Ye(o.id) ? J * (E ? 0.95 : 0.6 * (1 - U)) : 0);
|
|
813
813
|
});
|
|
814
814
|
const y = (x) => {
|
|
815
815
|
x.stopPropagation(), s(o.id);
|
|
@@ -852,9 +852,9 @@ function Uo() {
|
|
|
852
852
|
for (const o of Ot.keys()) st.agents.has(o) || Ot.delete(o);
|
|
853
853
|
}, -1), null;
|
|
854
854
|
}
|
|
855
|
-
const
|
|
855
|
+
const Xo = 160, No = 32;
|
|
856
856
|
function $o() {
|
|
857
|
-
const t = D(() => new Yt(
|
|
857
|
+
const t = D(() => new Yt(Xo + No, 24), []), e = D(() => /* @__PURE__ */ new Map(), []), s = D(() => ({ a: new r.Vector3(), b: new r.Vector3(), col: new r.Color() }), []);
|
|
858
858
|
return ht(({ clock: o }) => {
|
|
859
859
|
const d = performance.now(), c = pt(), a = nt ? 0 : o.elapsedTime;
|
|
860
860
|
t.begin();
|
|
@@ -865,7 +865,7 @@ function $o() {
|
|
|
865
865
|
const w = i.pos.distanceTo(m);
|
|
866
866
|
if (w < 0.5) continue;
|
|
867
867
|
const n = Math.min(0.4, ((h ? 0.85 * h.scale : 0.25) + 0.05) / w), y = Math.max(n + 0.05, 1 - (0.85 * i.scale + 0.05) / w), v = (d - p.bornAt) / 1e3, x = ne(v / ie), B = (h ? 0.3 : 0.2) * (1 - 0.65 * i.dim) * x;
|
|
868
|
-
u.copy(It[p.type]).lerp(
|
|
868
|
+
u.copy(It[p.type]).lerp(N, 0.4), l.copy(m), f.copy(i.pos), bt.copy(l).add(f).multiplyScalar(0.5), t.add(l, bt, f, u, B, n, n + (y - n) * x, Math.max(3, Math.round(w / 0.42)), a * 0.35, -1, 0);
|
|
869
869
|
}
|
|
870
870
|
for (const i of e.keys()) {
|
|
871
871
|
let p = !1;
|
|
@@ -882,7 +882,7 @@ function $o() {
|
|
|
882
882
|
const n = ne(m);
|
|
883
883
|
Ut(p, bt, h, n, Lt);
|
|
884
884
|
const y = L.instances.get(i.from);
|
|
885
|
-
u.copy(y ? It[y.type] :
|
|
885
|
+
u.copy(y ? It[y.type] : N).lerp(X, 0.35);
|
|
886
886
|
const v = Math.min(1, m / 0.08) * Math.min(1, (1 - m) / 0.12);
|
|
887
887
|
t.add(p, bt, h, u, 0, 0, 1, 0, 0, n, 1.1 * v), w.step(Lt, 0.06, 0.07, u, 0.9 * v, 2.4, c, 6), Z().emit(Lt.x, Lt.y, Lt.z, 0.42, u, 1.2 * v, 0.12, c, 1);
|
|
888
888
|
}
|
|
@@ -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-CsXvCpWR.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 },
|
|
@@ -6,7 +6,7 @@ import { EffectComposer as bt, Bloom as yt, Vignette as Mt } from "@react-three/
|
|
|
6
6
|
import { useMemo as V, useRef as U, useEffect as St, useState as xt } from "react";
|
|
7
7
|
import * as t from "three";
|
|
8
8
|
import { useFrame as Ae } from "@react-three/fiber";
|
|
9
|
-
import { T as mt, w as H, k as Ct, a as ge, d as st, h as Me, l as At,
|
|
9
|
+
import { T as mt, w as H, k as Ct, a as ge, d as st, h as Me, l as At, V as Vt, p as Pt, e as zt, f as Se, s as Et, L as nt, j as Gt, n as Bt, o as Ft, S as Ye, H as Rt, R as It, q as Lt, A as he, u as _t, W as Ot, E as Tt, t as Nt, v as Ut, g as Xt, b as jt, K as Kt, B as Yt, G as Ht, C as qt, x as Wt } from "./KitScene-CsXvCpWR.js";
|
|
10
10
|
var dt;
|
|
11
11
|
const ee = typeof window < "u" && !!((dt = window.matchMedia) != null && dt.call(window, "(prefers-reduced-motion: reduce)").matches), at = new t.Color("#3db8ff"), ve = new t.Color("#9fdcff"), _e = new t.Color("#ff4fa8"), it = new t.Color("#ff9ccf"), ie = new t.Color(1, 1, 1), Ge = new t.Color("#ffc24a"), Zt = new t.Color("#ff2d55"), Dt = new t.Color("#3a4560"), rt = Object.fromEntries(Object.entries(mt).map(([e, s]) => [e, new t.Color(s)])), D = (e) => e < 0 ? 0 : e > 1 ? 1 : e, Te = (e) => 1 - Math.pow(1 - D(e), 3), Ne = (e) => (e = D(e), e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2);
|
|
12
12
|
let Ie = null;
|