@shmulikdav/solix 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -317,6 +317,32 @@ async function probeHealth(port) {
|
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
+
async function probeWrappers(port) {
|
|
321
|
+
try {
|
|
322
|
+
const res = await fetch(`http://127.0.0.1:${port}/api/wrappers`, {
|
|
323
|
+
signal: AbortSignal.timeout(800)
|
|
324
|
+
});
|
|
325
|
+
if (!res.ok) {
|
|
326
|
+
return {
|
|
327
|
+
ok: true,
|
|
328
|
+
label: "Active solix run wrappers",
|
|
329
|
+
detail: "server too old to report (pre-1.2.1)"
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
const records = await res.json();
|
|
333
|
+
return {
|
|
334
|
+
ok: true,
|
|
335
|
+
label: "Active solix run wrappers",
|
|
336
|
+
detail: records.length === 0 ? "none registered" : `${records.length} active`
|
|
337
|
+
};
|
|
338
|
+
} catch {
|
|
339
|
+
return {
|
|
340
|
+
ok: true,
|
|
341
|
+
label: "Active solix run wrappers",
|
|
342
|
+
detail: "unknown \u2014 server unreachable"
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
}
|
|
320
346
|
async function doctor() {
|
|
321
347
|
const port = Number(process.env.SOLIX_PORT ?? 4242);
|
|
322
348
|
const checks = [];
|
|
@@ -398,6 +424,7 @@ async function doctor() {
|
|
|
398
424
|
detail: skillCount > 0 ? `${skillCount} skills in ${SOLIX_SKILLS_DIR}` : "none"
|
|
399
425
|
});
|
|
400
426
|
checks.push(await probeHealth(port));
|
|
427
|
+
checks.push(await probeWrappers(port));
|
|
401
428
|
console.log("\nSolix Diagnostics\n");
|
|
402
429
|
let allOk = true;
|
|
403
430
|
for (const c of checks) {
|
|
@@ -1155,8 +1182,8 @@ function getDb() {
|
|
|
1155
1182
|
}
|
|
1156
1183
|
|
|
1157
1184
|
// ../server/src/http.ts
|
|
1158
|
-
import { existsSync as
|
|
1159
|
-
import { dirname as dirname4, extname, join as
|
|
1185
|
+
import { existsSync as existsSync8, readFileSync as readFileSync6, statSync as statSync4 } from "fs";
|
|
1186
|
+
import { dirname as dirname4, extname, join as join11, resolve as resolve3 } from "path";
|
|
1160
1187
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
1161
1188
|
import { spawnSync } from "child_process";
|
|
1162
1189
|
import { Hono } from "hono";
|
|
@@ -1329,6 +1356,13 @@ function setSessionMission(db, sessionId, missionId) {
|
|
|
1329
1356
|
).run(missionId, ts2, sessionId);
|
|
1330
1357
|
return getSession(db, sessionId);
|
|
1331
1358
|
}
|
|
1359
|
+
function clearSessionWrapper(db, sessionId) {
|
|
1360
|
+
const ts2 = now();
|
|
1361
|
+
db.prepare(
|
|
1362
|
+
`UPDATE sessions SET wrapper_socket_path = NULL, updated_at = ? WHERE id = ?`
|
|
1363
|
+
).run(ts2, sessionId);
|
|
1364
|
+
return getSession(db, sessionId);
|
|
1365
|
+
}
|
|
1332
1366
|
function setSessionContextUsage(db, sessionId, pct) {
|
|
1333
1367
|
const clamped = Math.max(0, Math.min(100, pct));
|
|
1334
1368
|
const ts2 = now();
|
|
@@ -1795,13 +1829,40 @@ function readAdvisorAgentMd(advisor) {
|
|
|
1795
1829
|
|
|
1796
1830
|
// ../server/src/state/wrappers.ts
|
|
1797
1831
|
import { connect } from "net";
|
|
1832
|
+
import { existsSync as existsSync6, readdirSync as readdirSync3, unlinkSync as unlinkSync2 } from "fs";
|
|
1833
|
+
import { homedir as homedir6 } from "os";
|
|
1834
|
+
import { join as join9 } from "path";
|
|
1798
1835
|
var wrappers = /* @__PURE__ */ new Map();
|
|
1836
|
+
var wrapperToSession = /* @__PURE__ */ new Map();
|
|
1799
1837
|
var FRESHNESS_WINDOW_MS = 6e4;
|
|
1800
1838
|
function registerWrapper(rec) {
|
|
1801
1839
|
wrappers.set(rec.wrapperId, rec);
|
|
1802
1840
|
}
|
|
1803
1841
|
function unregisterWrapper(wrapperId) {
|
|
1804
1842
|
wrappers.delete(wrapperId);
|
|
1843
|
+
const sessionId = wrapperToSession.get(wrapperId);
|
|
1844
|
+
wrapperToSession.delete(wrapperId);
|
|
1845
|
+
return sessionId;
|
|
1846
|
+
}
|
|
1847
|
+
function bindWrapperToSession(wrapperId, sessionId) {
|
|
1848
|
+
wrapperToSession.set(wrapperId, sessionId);
|
|
1849
|
+
}
|
|
1850
|
+
function listWrappers() {
|
|
1851
|
+
return [...wrappers.values()];
|
|
1852
|
+
}
|
|
1853
|
+
function cleanupOrphanedSockets() {
|
|
1854
|
+
const dir = join9(homedir6(), ".solix", "wrappers");
|
|
1855
|
+
if (!existsSync6(dir)) return 0;
|
|
1856
|
+
let removed = 0;
|
|
1857
|
+
for (const f of readdirSync3(dir)) {
|
|
1858
|
+
if (!f.endsWith(".sock")) continue;
|
|
1859
|
+
try {
|
|
1860
|
+
unlinkSync2(join9(dir, f));
|
|
1861
|
+
removed++;
|
|
1862
|
+
} catch {
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
return removed;
|
|
1805
1866
|
}
|
|
1806
1867
|
function claimWrapperForCwd(cwd) {
|
|
1807
1868
|
const now2 = Date.now();
|
|
@@ -1817,21 +1878,17 @@ function claimWrapperForCwd(cwd) {
|
|
|
1817
1878
|
return best;
|
|
1818
1879
|
}
|
|
1819
1880
|
function writeToWrapperSocket(socketPath, text) {
|
|
1881
|
+
if (!existsSync6(socketPath)) return false;
|
|
1820
1882
|
try {
|
|
1821
1883
|
const client = connect(socketPath);
|
|
1822
|
-
let settled = false;
|
|
1823
1884
|
client.on("error", () => {
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
client.destroy();
|
|
1828
|
-
} catch {
|
|
1829
|
-
}
|
|
1885
|
+
try {
|
|
1886
|
+
client.destroy();
|
|
1887
|
+
} catch {
|
|
1830
1888
|
}
|
|
1831
1889
|
});
|
|
1832
1890
|
client.write(JSON.stringify({ type: "send_prompt", text }) + "\n");
|
|
1833
1891
|
client.end();
|
|
1834
|
-
settled = true;
|
|
1835
1892
|
return true;
|
|
1836
1893
|
} catch {
|
|
1837
1894
|
return false;
|
|
@@ -1925,10 +1982,10 @@ function buildContextEnvelope(db, args) {
|
|
|
1925
1982
|
}
|
|
1926
1983
|
|
|
1927
1984
|
// ../server/src/state/skills.ts
|
|
1928
|
-
import { existsSync as
|
|
1929
|
-
import { dirname as dirname3, join as
|
|
1985
|
+
import { existsSync as existsSync7, readdirSync as readdirSync4, readFileSync as readFileSync5, statSync as statSync3 } from "fs";
|
|
1986
|
+
import { dirname as dirname3, join as join10, resolve as resolve2 } from "path";
|
|
1930
1987
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
1931
|
-
import { homedir as
|
|
1988
|
+
import { homedir as homedir7 } from "os";
|
|
1932
1989
|
function findSolixSkillsDir() {
|
|
1933
1990
|
const here = dirname3(fileURLToPath3(import.meta.url));
|
|
1934
1991
|
const candidates = [
|
|
@@ -1937,12 +1994,12 @@ function findSolixSkillsDir() {
|
|
|
1937
1994
|
resolve2(process.cwd(), "packages", "skills")
|
|
1938
1995
|
];
|
|
1939
1996
|
for (const c of candidates) {
|
|
1940
|
-
if (
|
|
1997
|
+
if (existsSync7(c)) return c;
|
|
1941
1998
|
}
|
|
1942
1999
|
return candidates[0];
|
|
1943
2000
|
}
|
|
1944
2001
|
var SOLIX_SKILLS_DIR2 = findSolixSkillsDir();
|
|
1945
|
-
var ANTHROPIC_SKILLS_DIR =
|
|
2002
|
+
var ANTHROPIC_SKILLS_DIR = join10(homedir7(), ".claude", "skills");
|
|
1946
2003
|
function parseSkillManifest(manifestPath, fallbackId) {
|
|
1947
2004
|
try {
|
|
1948
2005
|
const txt = readFileSync5(manifestPath, "utf8");
|
|
@@ -1994,9 +2051,9 @@ function discoverSkills(db) {
|
|
|
1994
2051
|
{ dir: SOLIX_SKILLS_DIR2, source: "solix" }
|
|
1995
2052
|
];
|
|
1996
2053
|
for (const { dir, source } of sources) {
|
|
1997
|
-
if (!
|
|
1998
|
-
for (const entry of
|
|
1999
|
-
const full =
|
|
2054
|
+
if (!existsSync7(dir)) continue;
|
|
2055
|
+
for (const entry of readdirSync4(dir)) {
|
|
2056
|
+
const full = join10(dir, entry);
|
|
2000
2057
|
let isDir = false;
|
|
2001
2058
|
try {
|
|
2002
2059
|
isDir = statSync3(full).isDirectory();
|
|
@@ -2004,8 +2061,8 @@ function discoverSkills(db) {
|
|
|
2004
2061
|
continue;
|
|
2005
2062
|
}
|
|
2006
2063
|
if (!isDir) continue;
|
|
2007
|
-
const manifestPath =
|
|
2008
|
-
if (!
|
|
2064
|
+
const manifestPath = join10(full, "SKILL.md");
|
|
2065
|
+
if (!existsSync7(manifestPath)) continue;
|
|
2009
2066
|
const parsed = parseSkillManifest(manifestPath, entry);
|
|
2010
2067
|
if (!parsed) continue;
|
|
2011
2068
|
const id = `${source}:${parsed.id}`;
|
|
@@ -2030,7 +2087,7 @@ function getSkill(db, id) {
|
|
|
2030
2087
|
return row ? rowToSkill(row) : null;
|
|
2031
2088
|
}
|
|
2032
2089
|
function readSkillManifest(skill) {
|
|
2033
|
-
if (!
|
|
2090
|
+
if (!existsSync7(skill.manifestPath)) return "";
|
|
2034
2091
|
return readFileSync5(skill.manifestPath, "utf8");
|
|
2035
2092
|
}
|
|
2036
2093
|
function recordSkillInstall(db, skillId, projectId) {
|
|
@@ -2561,9 +2618,16 @@ function createHttpApp(opts) {
|
|
|
2561
2618
|
return c.json({ ok: true });
|
|
2562
2619
|
});
|
|
2563
2620
|
app.post("/api/wrappers/:id/unregister", (c) => {
|
|
2564
|
-
unregisterWrapper(c.req.param("id"));
|
|
2621
|
+
const sessionId = unregisterWrapper(c.req.param("id"));
|
|
2622
|
+
if (sessionId) {
|
|
2623
|
+
const cleared = clearSessionWrapper(opts.db, sessionId);
|
|
2624
|
+
if (cleared) {
|
|
2625
|
+
opts.router.broadcastSessionUpsert(cleared);
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2565
2628
|
return c.json({ ok: true });
|
|
2566
2629
|
});
|
|
2630
|
+
app.get("/api/wrappers", (c) => c.json(listWrappers()));
|
|
2567
2631
|
let preflightCache = null;
|
|
2568
2632
|
app.get("/api/system/preflight", (c) => {
|
|
2569
2633
|
if (preflightCache) return c.json(preflightCache);
|
|
@@ -2593,16 +2657,16 @@ function createHttpApp(opts) {
|
|
|
2593
2657
|
return c.notFound();
|
|
2594
2658
|
}
|
|
2595
2659
|
const safe = url.pathname.replace(/\.\.+/g, ".");
|
|
2596
|
-
const candidate =
|
|
2660
|
+
const candidate = join11(webDist, safe === "/" ? "index.html" : safe);
|
|
2597
2661
|
let filePath = candidate;
|
|
2598
2662
|
try {
|
|
2599
|
-
if (!
|
|
2600
|
-
filePath =
|
|
2663
|
+
if (!existsSync8(filePath) || statSync4(filePath).isDirectory()) {
|
|
2664
|
+
filePath = join11(webDist, "index.html");
|
|
2601
2665
|
}
|
|
2602
2666
|
} catch {
|
|
2603
|
-
filePath =
|
|
2667
|
+
filePath = join11(webDist, "index.html");
|
|
2604
2668
|
}
|
|
2605
|
-
if (!
|
|
2669
|
+
if (!existsSync8(filePath)) return c.notFound();
|
|
2606
2670
|
const data = readFileSync6(filePath);
|
|
2607
2671
|
return new Response(data, {
|
|
2608
2672
|
headers: { "Content-Type": mimeFor(filePath) }
|
|
@@ -2661,7 +2725,7 @@ function createHttpApp(opts) {
|
|
|
2661
2725
|
}
|
|
2662
2726
|
function findWebDist() {
|
|
2663
2727
|
if (process.env.SOLIX_WEB_DIST) {
|
|
2664
|
-
return
|
|
2728
|
+
return existsSync8(process.env.SOLIX_WEB_DIST) ? process.env.SOLIX_WEB_DIST : null;
|
|
2665
2729
|
}
|
|
2666
2730
|
const here = dirname4(fileURLToPath4(import.meta.url));
|
|
2667
2731
|
const candidates = [
|
|
@@ -2674,7 +2738,7 @@ function findWebDist() {
|
|
|
2674
2738
|
resolve3(process.cwd(), "packages", "web", "dist")
|
|
2675
2739
|
];
|
|
2676
2740
|
for (const c of candidates) {
|
|
2677
|
-
if (
|
|
2741
|
+
if (existsSync8(join11(c, "index.html"))) return c;
|
|
2678
2742
|
}
|
|
2679
2743
|
return null;
|
|
2680
2744
|
}
|
|
@@ -2700,9 +2764,9 @@ function mimeFor(filePath) {
|
|
|
2700
2764
|
|
|
2701
2765
|
// ../server/src/launcher.ts
|
|
2702
2766
|
import { spawn, spawnSync as spawnSync2 } from "child_process";
|
|
2703
|
-
import { existsSync as
|
|
2704
|
-
import { homedir as
|
|
2705
|
-
import { basename as basename3, join as
|
|
2767
|
+
import { existsSync as existsSync9, mkdirSync as mkdirSync4 } from "fs";
|
|
2768
|
+
import { homedir as homedir8 } from "os";
|
|
2769
|
+
import { basename as basename3, join as join12 } from "path";
|
|
2706
2770
|
import { nanoid as nanoid5 } from "nanoid";
|
|
2707
2771
|
function ensureWorktree(opts) {
|
|
2708
2772
|
const repoRoot = (() => {
|
|
@@ -2717,8 +2781,8 @@ function ensureWorktree(opts) {
|
|
|
2717
2781
|
})();
|
|
2718
2782
|
const repoName = basename3(repoRoot);
|
|
2719
2783
|
const safeBranch = opts.branch.replace(/[^a-zA-Z0-9._-]+/g, "-");
|
|
2720
|
-
const worktreesDir =
|
|
2721
|
-
const path =
|
|
2784
|
+
const worktreesDir = join12(homedir8(), ".solix", "worktrees");
|
|
2785
|
+
const path = join12(worktreesDir, `${repoName}-${safeBranch}`);
|
|
2722
2786
|
const list = spawnSync2("git", ["worktree", "list", "--porcelain"], {
|
|
2723
2787
|
cwd: repoRoot,
|
|
2724
2788
|
encoding: "utf8"
|
|
@@ -2930,7 +2994,7 @@ var Launcher = class {
|
|
|
2930
2994
|
worktreePath
|
|
2931
2995
|
});
|
|
2932
2996
|
}
|
|
2933
|
-
if (!
|
|
2997
|
+
if (!existsSync9(spawnCwd)) {
|
|
2934
2998
|
this.broadcaster.broadcast({
|
|
2935
2999
|
type: "toast",
|
|
2936
3000
|
level: "error",
|
|
@@ -3236,6 +3300,7 @@ var EventRouter = class {
|
|
|
3236
3300
|
worktreePath,
|
|
3237
3301
|
wrapperSocketPath: wrapper?.socketPath
|
|
3238
3302
|
});
|
|
3303
|
+
if (wrapper) bindWrapperToSession(wrapper.wrapperId, session.id);
|
|
3239
3304
|
this.broadcaster.broadcast({ type: "session_upsert", session });
|
|
3240
3305
|
if (!session.parentSessionId) {
|
|
3241
3306
|
this.transcripts?.startWatching(sessionId, event.cwd);
|
|
@@ -3535,10 +3600,13 @@ var EventRouter = class {
|
|
|
3535
3600
|
}
|
|
3536
3601
|
});
|
|
3537
3602
|
} else {
|
|
3603
|
+
const cleared = clearSessionWrapper(this.db, sessionId);
|
|
3604
|
+
if (cleared)
|
|
3605
|
+
this.broadcaster.broadcast({ type: "session_upsert", session: cleared });
|
|
3538
3606
|
this.broadcaster.broadcast({
|
|
3539
3607
|
type: "toast",
|
|
3540
3608
|
level: "warn",
|
|
3541
|
-
message:
|
|
3609
|
+
message: `Wrapper for ${session.name ?? session.id.slice(0, 8)} exited \u2014 chat is now read-only. Restart with \`solix run\`.`
|
|
3542
3610
|
});
|
|
3543
3611
|
}
|
|
3544
3612
|
return ok;
|
|
@@ -3551,6 +3619,11 @@ var EventRouter = class {
|
|
|
3551
3619
|
pendingPermissions() {
|
|
3552
3620
|
return [...this.permissions.values()];
|
|
3553
3621
|
}
|
|
3622
|
+
/** Public re-broadcast helper for cases where state mutates outside
|
|
3623
|
+
* the hook flow (e.g. wrapper unregister clearing the socket path). */
|
|
3624
|
+
broadcastSessionUpsert(session) {
|
|
3625
|
+
this.broadcaster.broadcast({ type: "session_upsert", session });
|
|
3626
|
+
}
|
|
3554
3627
|
broadcastGalaxyImported(manifest) {
|
|
3555
3628
|
this.broadcaster.broadcast({ type: "galaxy_imported", manifest });
|
|
3556
3629
|
this.broadcaster.broadcast({
|
|
@@ -3677,15 +3750,15 @@ function handleClientMessage(ctx, _ws, msg) {
|
|
|
3677
3750
|
// ../server/src/state/transcript.ts
|
|
3678
3751
|
import {
|
|
3679
3752
|
closeSync,
|
|
3680
|
-
existsSync as
|
|
3753
|
+
existsSync as existsSync10,
|
|
3681
3754
|
openSync,
|
|
3682
3755
|
readSync,
|
|
3683
3756
|
statSync as statSync5,
|
|
3684
3757
|
watch
|
|
3685
3758
|
} from "fs";
|
|
3686
|
-
import { homedir as
|
|
3687
|
-
import { join as
|
|
3688
|
-
var TRANSCRIPT_BASE =
|
|
3759
|
+
import { homedir as homedir9 } from "os";
|
|
3760
|
+
import { join as join13 } from "path";
|
|
3761
|
+
var TRANSCRIPT_BASE = join13(homedir9(), ".claude", "projects");
|
|
3689
3762
|
var CONTEXT_BUDGETS_BY_MODEL = {
|
|
3690
3763
|
"claude-opus-4-7": 2e5,
|
|
3691
3764
|
"claude-opus-4-6": 2e5,
|
|
@@ -3698,7 +3771,7 @@ function encodeProjectPath(cwd) {
|
|
|
3698
3771
|
return cwd.replace(/[/\\]/g, "-");
|
|
3699
3772
|
}
|
|
3700
3773
|
function transcriptPathFor(cwd, sessionId) {
|
|
3701
|
-
return
|
|
3774
|
+
return join13(TRANSCRIPT_BASE, encodeProjectPath(cwd), `${sessionId}.jsonl`);
|
|
3702
3775
|
}
|
|
3703
3776
|
var TranscriptWatcherManager = class {
|
|
3704
3777
|
constructor(db, broadcaster) {
|
|
@@ -3718,7 +3791,7 @@ var TranscriptWatcherManager = class {
|
|
|
3718
3791
|
startWatching(sessionId, cwd) {
|
|
3719
3792
|
if (this.records.has(sessionId)) return;
|
|
3720
3793
|
const filePath = transcriptPathFor(cwd, sessionId);
|
|
3721
|
-
if (!
|
|
3794
|
+
if (!existsSync10(filePath)) {
|
|
3722
3795
|
this.scheduleRetry(sessionId, cwd, 0);
|
|
3723
3796
|
return;
|
|
3724
3797
|
}
|
|
@@ -3729,7 +3802,7 @@ var TranscriptWatcherManager = class {
|
|
|
3729
3802
|
const t = setTimeout(() => {
|
|
3730
3803
|
this.deferredRetry.delete(sessionId);
|
|
3731
3804
|
const filePath = transcriptPathFor(cwd, sessionId);
|
|
3732
|
-
if (
|
|
3805
|
+
if (existsSync10(filePath)) {
|
|
3733
3806
|
this.attach(sessionId, filePath);
|
|
3734
3807
|
} else {
|
|
3735
3808
|
this.scheduleRetry(sessionId, cwd, attempt + 1);
|
|
@@ -3925,6 +3998,13 @@ async function createSolixServer(opts = {}) {
|
|
|
3925
3998
|
const db = getDb();
|
|
3926
3999
|
seedAdvisors(db);
|
|
3927
4000
|
discoverSkills(db);
|
|
4001
|
+
const cleared = cleanupOrphanedSockets();
|
|
4002
|
+
if (cleared > 0) {
|
|
4003
|
+
console.log(`[solix] cleaned up ${cleared} orphaned wrapper socket(s)`);
|
|
4004
|
+
}
|
|
4005
|
+
db.prepare(
|
|
4006
|
+
`UPDATE sessions SET wrapper_socket_path = NULL WHERE wrapper_socket_path IS NOT NULL`
|
|
4007
|
+
).run();
|
|
3928
4008
|
const broadcaster = new Broadcaster();
|
|
3929
4009
|
const launcher = new Launcher(db, broadcaster);
|
|
3930
4010
|
const transcripts = new TranscriptWatcherManager(db, broadcaster);
|
|
@@ -3991,15 +4071,15 @@ async function start(opts = {}) {
|
|
|
3991
4071
|
}
|
|
3992
4072
|
|
|
3993
4073
|
// src/uninstall.ts
|
|
3994
|
-
import { copyFileSync as copyFileSync2, existsSync as
|
|
4074
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync11, readFileSync as readFileSync7, writeFileSync as writeFileSync4 } from "fs";
|
|
3995
4075
|
function uninstall() {
|
|
3996
4076
|
uninstallShim();
|
|
3997
|
-
if (
|
|
4077
|
+
if (existsSync11(CLAUDE_BACKUP)) {
|
|
3998
4078
|
copyFileSync2(CLAUDE_BACKUP, CLAUDE_SETTINGS);
|
|
3999
4079
|
console.log(`[solix] restored settings.json from backup`);
|
|
4000
4080
|
return;
|
|
4001
4081
|
}
|
|
4002
|
-
if (!
|
|
4082
|
+
if (!existsSync11(CLAUDE_SETTINGS)) {
|
|
4003
4083
|
console.log("[solix] nothing to uninstall (no settings.json found)");
|
|
4004
4084
|
return;
|
|
4005
4085
|
}
|
|
@@ -4184,7 +4184,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
|
|
|
4184
4184
|
float fres = pow(max(0.0, dot(vNormal, vViewDir)), uPower);
|
|
4185
4185
|
gl_FragColor = vec4(uColor * uIntensity, fres);
|
|
4186
4186
|
}
|
|
4187
|
-
`}),[e,t,i]);return E.jsxs("mesh",{children:[E.jsx("sphereGeometry",{args:[n*1.18,32,32]}),E.jsx("primitive",{object:r,attach:"material"})]})}function bR(n,e,t){const i=[];let r=30;switch(n.status){case"error":r=0,i.push("In error state");break;case"plan_review":case"awaiting_input":r=15,i.push(`Status: ${n.status}`);break;case"awaiting_permission":r=12,i.push("Awaiting permission");break;case"terminated":r=5,i.push("Terminated");break;default:r=30}const s=Math.max(0,30-t*15);t>0&&i.push(`${t} pending permission${t===1?"":"s"}`);const a=25*Math.max(0,1-n.contextUsagePct/100);n.contextUsagePct>=90?i.push(`Context at ${n.contextUsagePct.toFixed(0)}%`):n.contextUsagePct>=80&&i.push(`Context warm (${n.contextUsagePct.toFixed(0)}%)`);let c=0;if(e&&e.status==="active"){const f=e.metrics.toolCallCount;c=Math.min(15,f*2)}else e&&e.status==="completed"&&(c=15);return{score:Math.round(Math.max(0,Math.min(100,r+s+a+c))),reasons:i}}function TR(n){return n>=75?"#10b981":n>=50?"#fbbf24":n>=25?"#f97316":"#ef4444"}const wg={active:"The agent is currently working — emitting tool calls or generating output.",idle:"No mission running. The agent is waiting for the next prompt or has been quiet for a while.",spawning:"The agent process just started. It will transition to active within a second or two.",awaiting_permission:"The agent paused to ask permission for a sensitive tool call. Approve or deny in the Decision Queue.",awaiting_input:"The agent finished what it could and is waiting for your next prompt.",plan_review:"The agent produced a plan and is waiting for your approval before executing.",error:"The agent crashed or hit an unrecoverable error. Look at the SidePanel transcript for details.",terminated:"The agent process exited. No more activity will come from this session.",subagent:"A child agent spawned by another session (typically via the Task tool). Rendered as a moon orbiting the parent planet.",advisor:"A long-lived specialist agent (Compass, Forge, Lumen, Argus, Sentinel, …) with its own AGENT.md describing its role.",pinned:"An advisor that's always running. Pinned advisors orbit close to the sun in the inner ring."};function NH({session:n}){const e=V.useRef(null),t=V.useRef(null),i=V.useRef(null),r=V.useRef(null),s=V.useRef(null),o=V.useMemo(()=>yS(n.orbitSlot,n.id,n.projectId),[n.orbitSlot,n.id]),a=V.useMemo(()=>Mg(n.orbitSlot),[n.orbitSlot]),c=we(P=>mH(P,n.id)),d=we(P=>P.selectSession),f=we(P=>P.selectAdvisor),h=we(P=>n.advisorRole?Object.values(P.advisors).find(C=>C.id===n.advisorRole)??null:null),v=we(P=>P.selectedSessionId)===n.id,x=n.kind==="advisor",w=we(P=>n.currentMissionId?P.missions[n.currentMissionId]:void 0),M=we(P=>Object.values(P.pendingPermissions).filter(C=>C.sessionId===n.id).length),g=V.useMemo(()=>bR(n,w,M),[n,w,M]),_=g.score,S=.4+_/100*.8,b=V.useMemo(()=>new De(x&&h?h.color:wm(n.model)),[x,h,n.model]),N=V.useRef(o),A=V.useRef(1);Ti((P,C)=>{const U=we.getState(),W=U.motionEnabled,X=!!(U.selectedSessionId||U.selectedAdvisorId||U.selectedSkillId),te=U.selectedSessionId===n.id||x&&U.selectedAdvisorId===n.advisorRole,ee=X&&!te?.25:1;A.current=Eo.lerp(A.current,ee,.08);const Q=A.current,le=RH(n.status==="active",n.orbitSlot);W&&(N.current+=C*le*.3);const z=N.current,$=Math.cos(z)*a,q=Math.sin(z)*a,oe=Math.sin(z*.5)*.4;e.current&&e.current.position.set($,oe,q);const Ee=P.clock.getElapsedTime();if(t.current){W&&(t.current.rotation.y+=C*.4);const Pe=.55+n.contextUsagePct/100*.5,ne=t.current.scale.x,ge=Eo.lerp(ne,Pe,.04);t.current.scale.set(ge,ge,ge)}if(s.current){const Pe=wR(n.status),ne=new De(Pe.color);s.current.emissive.lerp(ne,.08),s.current.emissiveIntensity=Eo.lerp(s.current.emissiveIntensity,Pe.intensity*Q,.06),s.current.opacity=Q,s.current.transparent=Q<.99}if(i.current){const Pe=n.contextUsagePct>=90,ne=n.contextUsagePct>=80&&!Pe;if(n.status==="awaiting_permission"||n.status==="awaiting_input"||Pe||ne){let Te=.8,be="#f59e0b";n.status==="awaiting_permission"?(Te=1.5,be="#ef4444"):n.status==="awaiting_input"?(Te=.8,be="#f59e0b"):Pe?(Te=1.2,be="#dc2626"):ne&&(Te=.6,be="#fb923c");const Ke=.5+.5*Math.sin(Ee*Math.PI*2*Te),st=i.current.material;st.color.set(be),st.opacity=(.25+Ke*.5)*Q,i.current.visible=!0;const We=1.4+Ke*.5;i.current.scale.set(We,We,We)}else i.current.visible=!1}r.current&&(r.current.visible=n.status==="plan_review",r.current.rotation.z+=C*.3)});const I=P=>{P.stopPropagation(),d(n.id),x&&h&&f(h.id)},L=.55;return E.jsxs("group",{ref:e,children:[E.jsxs("mesh",{ref:t,onClick:I,castShadow:!0,children:[E.jsx("sphereGeometry",{args:[L,32,32]}),E.jsx("meshStandardMaterial",{ref:s,color:b,emissive:b,emissiveIntensity:.1,roughness:.6,metalness:.3})]}),E.jsx(ER,{radius:L,color:x&&h?h.color:wm(n.model),intensity:S*(n.status==="active"?1.2:.9)}),E.jsxs("mesh",{ref:i,visible:!1,children:[E.jsx("sphereGeometry",{args:[L*1.4,24,24]}),E.jsx("meshBasicMaterial",{color:"#ef4444",transparent:!0,opacity:.4})]}),E.jsxs("mesh",{ref:r,visible:!1,rotation:[Math.PI/2.4,0,0],children:[E.jsx("ringGeometry",{args:[L*1.4,L*2,64]}),E.jsx("meshBasicMaterial",{color:"#a78bfa",transparent:!0,opacity:.5,side:2})]}),x&&E.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[E.jsx("ringGeometry",{args:[L*1.25,L*1.35,64]}),E.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.7,side:2})]}),c.map((P,C)=>E.jsx(IH,{session:P,index:C,speed:PH()},P.id)),E.jsx(hS,{center:!0,distanceFactor:10,style:{pointerEvents:"none",userSelect:"none"},position:[0,L+.4,0],children:E.jsxs("div",{className:`px-2 py-1 rounded text-[10px] whitespace-nowrap border ${v?"bg-solix-accent/20 border-solix-accent text-white":x?"bg-amber-500/10 border-amber-300/50 text-amber-100":"bg-black/50 border-white/10 text-slate-200"}`,children:[E.jsxs("div",{className:"font-semibold flex items-center gap-1",children:[x&&h&&E.jsx("span",{style:{color:h.color},children:h.glyph}),E.jsx("span",{children:n.name??(x&&h?`${h.codename} (pinned)`:n.id.slice(0,8))})]}),E.jsxs("div",{className:"opacity-70",title:wg[n.status]??void 0,children:[String(n.model)," · ",xS(n.status)]}),E.jsxs("div",{className:"opacity-70",title:g.reasons.length?g.reasons.join(" · "):"Stable, low context, no pending decisions",children:[E.jsx("span",{style:{color:TR(_)},children:"♥"})," ","health ",_,g.reasons[0]&&E.jsxs("span",{className:"opacity-80",children:[" · ",g.reasons[0]]})]})]})})]})}function LH({orbitSlot:n}){const e=Mg(n);return E.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[E.jsx("ringGeometry",{args:[e-.02,e+.02,128]}),E.jsx("meshBasicMaterial",{color:"#1e293b",transparent:!0,opacity:.35,side:2})]})}const DH=1800;function UH(n){switch(n){case"Bash":return"#94a3b8";case"Read":return"#60a5fa";case"Write":return"#34d399";case"Edit":case"MultiEdit":return"#fbbf24";case"Task":return"#a78bfa";default:return"#cbd5e1"}}function kH({toolCallId:n,startX:e,startZ:t,color:i,receivedAt:r}){const s=V.useRef(null),o=V.useRef(null),a=V.useMemo(()=>{const c=Math.hypot(e,t)||1,d=e/c,f=t/c;return{nx:d,nz:f}},[e,t]);return Ti(()=>{const c=Date.now()-r,d=Math.min(1,c/DH);if(s.current){const f=Eo.lerp(0,12,d);s.current.position.set(e+a.nx*f,Math.sin(d*Math.PI)*1.4,t+a.nz*f)}if(o.current){const f=o.current.material;f.opacity=1-d}}),E.jsx("group",{ref:s,children:E.jsxs("mesh",{ref:o,children:[E.jsx("sphereGeometry",{args:[.08,8,8]}),E.jsx("meshBasicMaterial",{color:i,transparent:!0,opacity:.9})]})})}function OH(){const n=we(t=>t.playback.active?t.playback.derivedToolCalls:t.recentToolCalls),e=we(t=>t.playback.active?t.playback.derivedSessions:t.sessions);return E.jsx("group",{children:n.map(t=>{const i=e[t.sessionId];if(!i)return null;const r=Mg(i.orbitSlot),s=yS(i.orbitSlot,i.id,i.projectId),o=(Date.now()-t.startedAt)/1e3,c=s+o*.18*.3,d=Math.cos(c)*r,f=Math.sin(c)*r;return E.jsx(kH,{toolCallId:t.id,startX:d,startZ:f,color:UH(t.tool),receivedAt:t.receivedAt},t.id)})})}const Em=3.3,Ma=.34,FH={saturn:{body:"/textures/saturn.jpg",ring:"/textures/saturn_ring.png",ringInner:1.5,ringOuter:2.4,axialTilt:.45},mars:{body:"/textures/mars.jpg",axialTilt:.4},earth:{body:"/textures/earth.jpg",cloud:"/textures/earth_clouds.png",axialTilt:.41},jupiter:{body:"/textures/jupiter.jpg",axialTilt:.05},moon:{body:"/textures/moon.jpg",axialTilt:.1}};function zH({advisor:n,index:e,total:t}){const i=V.useRef(null),r=V.useMemo(()=>e/Math.max(1,t)*Math.PI*2,[e,t]),s=we(h=>h.selectAdvisor),o=we(h=>h.selectedAdvisorId===n.id),a=V.useRef(r);Ti((h,p)=>{we.getState().motionEnabled&&(a.current+=p*.18);const v=a.current;i.current&&i.current.position.set(Math.cos(v)*Em,0,Math.sin(v)*Em)});const c=V.useRef(1);Ti(()=>{const h=we.getState(),p=!!(h.selectedSessionId||h.selectedAdvisorId||h.selectedSkillId),v=h.selectedAdvisorId===n.id||n.pinnedSessionId&&h.selectedSessionId===n.pinnedSessionId,x=p&&!v?.25:1;c.current=Eo.lerp(c.current,x,.08)});const d=h=>{h.stopPropagation(),s(n.id)},f=n.texturePack?FH[n.texturePack]:void 0;return E.jsxs("group",{ref:i,children:[f?E.jsx(V.Suspense,{fallback:E.jsx(xb,{advisor:n,onClick:d,dimRef:c}),children:E.jsx(BH,{advisor:n,pack:f,onClick:d,dimRef:c})}):E.jsx(xb,{advisor:n,onClick:d,dimRef:c}),E.jsx(ER,{radius:Ma,color:n.color,intensity:n.pinned?1.4:.7,power:3.5}),E.jsx(hS,{center:!0,distanceFactor:9,style:{pointerEvents:"none",userSelect:"none"},position:[0,Ma+.32,0],children:E.jsxs("div",{className:`px-1.5 py-0.5 rounded text-[9px] whitespace-nowrap border ${o?"bg-amber-400/20 border-amber-300 text-amber-100":"bg-black/60 border-white/10 text-amber-100/80"}`,children:[E.jsx("span",{className:"mr-1",children:n.glyph}),n.codename,n.pinned&&E.jsx("span",{className:"ml-1 text-amber-300",children:"●"})]})})]})}function BH({advisor:n,pack:e,onClick:t,dimRef:i}){const r=V.useRef(null),s=V.useRef(null),o=V.useRef(null),a=V.useRef(null),c=V.useRef(null),d=V.useRef(null),f=Is(bo,e.body),h=Is(bo,e.cloud??"/textures/sun.jpg"),p=Is(bo,e.ring??"/textures/sun.jpg");f.wrapS=Fs,f.wrapT=Fs,Ti((M,g)=>{we.getState().motionEnabled&&(r.current&&(r.current.rotation.y+=g*.18),s.current&&(s.current.rotation.y+=g*.25),o.current&&(o.current.rotation.z+=g*.05));const S=i.current;a.current&&(a.current.opacity=S,a.current.transparent=S<.99),c.current&&(c.current.opacity=.55*S),d.current&&(d.current.opacity=.85*S)});const v=e.axialTilt??0,x=(e.ringInner??1.5)*Ma,w=(e.ringOuter??2.4)*Ma;return E.jsxs("group",{rotation:[v,0,0],children:[E.jsxs("mesh",{ref:r,onClick:t,children:[E.jsx("sphereGeometry",{args:[Ma,48,48]}),E.jsx("meshStandardMaterial",{ref:a,map:f,roughness:.85,metalness:.05,emissive:new De(n.color),emissiveIntensity:n.pinned?.25:.1,transparent:!0,opacity:1})]}),e.cloud&&E.jsxs("mesh",{ref:s,children:[E.jsx("sphereGeometry",{args:[Ma*1.02,48,48]}),E.jsx("meshStandardMaterial",{ref:c,map:h,transparent:!0,opacity:.55,depthWrite:!1,roughness:1})]}),e.ring&&E.jsxs("mesh",{ref:o,rotation:[Math.PI/2,0,0],children:[E.jsx("ringGeometry",{args:[x,w,96]}),E.jsx("meshStandardMaterial",{ref:d,map:p,transparent:!0,opacity:.85,side:Jn,depthWrite:!1,roughness:1})]})]})}function xb({advisor:n,onClick:e,dimRef:t}){const i=V.useRef(null),r=V.useRef(null),s=V.useMemo(()=>new De(n.color),[n.color]);return Ti((o,a)=>{if(we.getState().motionEnabled&&i.current&&(i.current.rotation.y+=a*.4),r.current){const d=t.current,f=n.pinned?.6:.22;r.current.emissiveIntensity=Eo.lerp(r.current.emissiveIntensity,f*d,.05),r.current.opacity=d,r.current.transparent=d<.99}}),E.jsxs("mesh",{ref:i,onClick:e,children:[E.jsx("sphereGeometry",{args:[Ma,24,24]}),E.jsx("meshStandardMaterial",{ref:r,color:s,emissive:s,emissiveIntensity:.22,roughness:.55,metalness:.4,transparent:!0,opacity:1})]})}function HH(){const n=we(gH);return n.length?E.jsxs("group",{children:[E.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[E.jsx("ringGeometry",{args:[Em-.03,Em+.03,128]}),E.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.12,side:Jn})]}),n.map((e,t)=>E.jsx(zH,{advisor:e,index:t,total:n.length},e.id))]}):null}const VH=22,GH=1.6,jH=.2;function WH(n){switch(n){case"anthropic":return new De("#94a3b8");case"solix":return new De("#a855f7");case"user":return new De("#06b6d4");default:return new De("#cbd5e1")}}const Ll=new It;function XH(){const n=we(vH),e=we(c=>c.selectSkill),t=we(c=>c.selectedSkillId),i=V.useRef(null),r=V.useMemo(()=>n.map((c,d)=>{const f=d/Math.max(1,n.length)*Math.PI*2,h=(c.id.charCodeAt(0)??0)%13/13-.5,p=VH+h*GH,v=Math.sin(f*1.7+(c.id.charCodeAt(1)??0))*.3+Math.tan(jH)*Math.sin(f)*.4,x=.18+c.id.length%5*.04,w=new ei;return w.setFromAxisAngle(new F(1,.4,.1).normalize(),f*1.3),{angle:f,radius:p,y:v,size:x,rot:w,color:WH(c.source),skill:c}}),[n]),s=V.useRef(0),o=V.useRef(0);if(Ti((c,d)=>{if(!i.current||!r.length)return;we.getState().motionEnabled&&(s.current+=d*.04,o.current+=d*.8);const h=s.current,p=o.current;for(let v=0;v<r.length;v++){const x=r[v],w=x.angle+h;Ll.position.set(Math.cos(w)*x.radius,x.y,Math.sin(w)*x.radius),Ll.quaternion.copy(x.rot),Ll.rotateY(p+v);const g=t===x.skill.id?x.size*1.6:x.size;Ll.scale.set(g,g,g),Ll.updateMatrix(),i.current.setMatrixAt(v,Ll.matrix),i.current.setColorAt(v,x.color)}i.current.instanceMatrix.needsUpdate=!0,i.current.instanceColor&&(i.current.instanceColor.needsUpdate=!0)}),!r.length)return null;const a=c=>{c.stopPropagation();const d=c.instanceId;if(typeof d!="number")return;const f=r[d];f&&e(f.skill.id)};return E.jsxs("instancedMesh",{ref:i,args:[void 0,void 0,r.length],onClick:a,children:[E.jsx("icosahedronGeometry",{args:[1,0]}),E.jsx("meshStandardMaterial",{roughness:.85,metalness:.05})]})}function YH(){const n=we(r=>r.projects),e=we(Sg),t=we(vS),i=V.useMemo(()=>{const r=[...e,...t],s=new Map;for(const o of r){const a=n[o.projectId];if(!a)continue;const c=s.get(a.id);c?c.sessions.push(o):s.set(a.id,{project:a,sessions:[o]})}return[...s.values()]},[e,t,n]);return i.length<2?E.jsx(E.Fragment,{}):E.jsx(E.Fragment,{children:i.map(({project:r,sessions:s})=>{const o=s.reduce((h,p)=>Math.max(h,p.orbitSlot),0),a=yS(o,s[0].id,r.id),c=Mg(o)+1.2,d=Math.cos(a)*c,f=Math.sin(a)*c;return E.jsx(hS,{position:[d,1.6,f],center:!0,distanceFactor:14,style:{pointerEvents:"none",userSelect:"none"},children:E.jsxs("div",{className:"px-2 py-1 rounded text-[9px] uppercase tracking-widest border border-solix-accent/30 bg-black/50 text-solix-accent/80 whitespace-nowrap",children:[r.name,E.jsxs("span",{className:"ml-1.5 text-slate-500",children:["· ",s.length]})]})},r.id)})})}const Wt={controls:null,camera:null,initialPosition:null,initialTarget:null};function qH(n,e){Wt.controls=n,Wt.camera=e,e&&!Wt.initialPosition&&(Wt.initialPosition=e.position.clone()),n&&!Wt.initialTarget&&(Wt.initialTarget=n.target.clone())}function KH(){Wt.controls=null,Wt.camera=null}const AR=1.18,yb=2.5;function CR(n=AR){if(!Wt.controls||!Wt.camera)return;const e=new F().subVectors(Wt.controls.target,Wt.camera.position).multiplyScalar(1-1/n);Wt.camera.position.add(e),Wt.controls.update()}function ZH(n=AR){CR(1/n)}function Eg(n,e){if(!Wt.controls||!Wt.camera)return;const t=Wt.camera,i=new F().subVectors(Wt.controls.target,t.position).normalize(),r=new F().crossVectors(i,t.up).normalize(),s=new F().crossVectors(r,i).normalize(),o=new F().addScaledVector(r,n*yb).addScaledVector(s,e*yb);t.position.add(o),Wt.controls.target.add(o),Wt.controls.update()}const $H=()=>Eg(-1,0),JH=()=>Eg(1,0),QH=()=>Eg(0,1),eV=()=>Eg(0,-1);function tV(){!Wt.controls||!Wt.camera||(Wt.initialPosition&&Wt.camera.position.copy(Wt.initialPosition),Wt.initialTarget&&Wt.controls.target.copy(Wt.initialTarget),Wt.controls.update())}const nV="/textures/milky_way.jpg";function iV(){const n=we(Sg),e=we(vS),t=we(a=>a.selectSession),i=we(a=>a.selectAdvisor),r=we(a=>a.selectSkill),s=[...n,...e],o=Array.from(new Set(s.map(a=>a.orbitSlot))).sort((a,c)=>a-c);return E.jsxs(VB,{shadows:!1,camera:{position:[0,14,22],fov:55,near:.1,far:600},onPointerMissed:()=>{t(null),i(null),r(null)},children:[E.jsx("color",{attach:"background",args:["#05060c"]}),E.jsx("fog",{attach:"fog",args:["#080a14",60,280]}),E.jsx("ambientLight",{intensity:.18}),E.jsx(V.Suspense,{fallback:E.jsx(f4,{radius:180,depth:80,count:6e3,factor:4,saturation:.4,fade:!0,speed:0}),children:E.jsx(rV,{})}),E.jsx(wH,{}),E.jsx(yH,{}),E.jsx(HH,{}),E.jsx(XH,{}),o.map(a=>E.jsx(LH,{orbitSlot:a},a)),s.map(a=>E.jsx(NH,{session:a},a.id)),E.jsx(OH,{}),E.jsx(YH,{}),E.jsx(sV,{}),E.jsx(iH,{multisampling:4,children:E.jsx(oH,{intensity:1.1,luminanceThreshold:.55,luminanceSmoothing:.2,mipmapBlur:!0})})]})}function rV(){const n=V.useRef(null),e=pS(nV);return E.jsxs("mesh",{ref:n,scale:[-1,1,1],children:[E.jsx("sphereGeometry",{args:[400,48,32]}),E.jsx("meshBasicMaterial",{map:e,side:bn,toneMapped:!1})]})}function sV(){const n=V.useRef(null),{camera:e}=Zi();return V.useEffect(()=>(qH(n.current,e),()=>KH()),[e]),E.jsx(c4,{ref:n,makeDefault:!0,enablePan:!0,enableZoom:!0,enableRotate:!0,minDistance:6,maxDistance:140,target:[0,0,0]})}const _b={awaiting_permission:0,awaiting_input:1,plan_review:2,error:3,active:4,spawning:5,idle:6,terminated:7};function oV(){const n=we(Sg),e=we(vS),t=we(b=>b.projects),i=we(b=>b.missions),r=we(b=>b.pendingPermissions),s=we(b=>b.selectSession),o=we(b=>b.selectedSessionIds),a=we(b=>b.toggleSessionSelection),c=we(b=>b.clearSessionSelection),d=we(b=>b.terminateSessions),[f,h]=V.useState("needs"),[p,v]=V.useState("asc"),x=V.useMemo(()=>{const b=[...n,...e],N=new Set(Object.values(r).map(A=>A.sessionId));return b.map(A=>{const I=A.currentMissionId?i[A.currentMissionId]:void 0,L=Object.values(r).filter(U=>U.sessionId===A.id).length,{score:P,reasons:C}=bR(A,I,L);return{session:A,project:t[A.projectId],mission:I,needsAttention:N.has(A.id)||A.status==="awaiting_permission"||A.status==="awaiting_input"||A.status==="plan_review",health:P,healthReasons:C}})},[n,e,t,i,r]),w=V.useMemo(()=>{var N;const b=new Map;for(const A of x){const I=((N=A.project)==null?void 0:N.id)??"_",L=b.get(I);L?L.rows.push(A):b.set(I,{project:A.project,rows:[A]})}return[...b.values()].sort((A,I)=>{var L,P;return(((L=I.project)==null?void 0:L.lastActiveAt)??0)-(((P=A.project)==null?void 0:P.lastActiveAt)??0)})},[x]),M=(b,N)=>{var I,L;const A=p==="asc"?1:-1;switch(f){case"name":return((b.session.name??b.session.id)>(N.session.name??N.session.id)?1:-1)*A;case"status":return((_b[b.session.status]??99)-(_b[N.session.status]??99))*A;case"progress":return((((I=b.mission)==null?void 0:I.metrics.toolCallCount)??0)-(((L=N.mission)==null?void 0:L.metrics.toolCallCount)??0))*A;case"context":return(b.session.contextUsagePct-N.session.contextUsagePct)*A;case"lastActivity":return(b.session.updatedAt-N.session.updatedAt)*A;case"needs":return b.needsAttention===N.needsAttention?0:b.needsAttention?-1*A:1*A;case"health":return(b.health-N.health)*A}},g=b=>{f===b?v(p==="asc"?"desc":"asc"):(h(b),v(b==="lastActivity"?"desc":"asc"))},_=b=>f!==b?"":p==="asc"?" ▲":" ▼",S=o.size;return E.jsxs("div",{className:"absolute inset-0 overflow-y-auto bg-solix-bg pt-20 pb-20 px-6 z-0",children:[S>0&&E.jsx("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-30 pointer-events-auto",children:E.jsxs("div",{className:"rounded-full border border-solix-accent/60 bg-solix-panel/95 backdrop-blur shadow-2xl px-4 py-2 flex items-center gap-3",children:[E.jsxs("span",{className:"text-xs text-slate-200 font-mono",children:[S," selected"]}),E.jsx("button",{onClick:()=>d([...o]),className:"text-xs px-3 py-1 rounded border border-solix-danger text-solix-danger hover:bg-solix-danger/15",children:"Terminate"}),E.jsx("button",{onClick:c,className:"text-xs text-slate-400 hover:text-slate-200",children:"Clear"})]})}),E.jsxs("div",{className:"max-w-6xl mx-auto",children:[E.jsxs("div",{className:"text-xs text-slate-500 uppercase tracking-widest mb-3",children:["List view · ",x.length," agent",x.length===1?"":"s"]}),x.length===0?E.jsxs("div",{className:"text-sm text-slate-500 italic py-12 text-center border border-solix-border rounded",children:["No agents yet. Run ",E.jsx("code",{children:"claude"})," in any terminal — a row will appear here within a second."]}):w.map(({project:b,rows:N})=>{const A=[...N].sort(M),I=(b==null?void 0:b.name)??"(unassigned)";return E.jsxs("section",{className:"mb-8 rounded border border-solix-border overflow-hidden",children:[E.jsxs("header",{className:"bg-solix-panel/60 px-4 py-2 flex items-center justify-between",children:[E.jsxs("div",{children:[E.jsx("span",{className:"text-sm font-semibold text-slate-100",children:I}),E.jsxs("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-slate-500",children:[N.length," agent",N.length===1?"":"s"]})]}),(b==null?void 0:b.cwd)&&E.jsx("span",{className:"text-[10px] font-mono text-slate-500 truncate max-w-[55%]",children:b.cwd})]}),E.jsxs("table",{className:"w-full text-sm",children:[E.jsx("thead",{className:"bg-black/30 text-[10px] uppercase tracking-wide text-slate-500",children:E.jsxs("tr",{children:[E.jsx(Ms,{children:E.jsx("input",{type:"checkbox","aria-label":"Select all in project",checked:A.length>0&&A.every(L=>o.has(L.session.id)),onChange:L=>{L.stopPropagation();const P=A.every(C=>o.has(C.session.id));for(const C of A){const U=o.has(C.session.id);(P&&U||!P&&!U)&&a(C.session.id)}},className:"cursor-pointer"})}),E.jsxs(Ms,{onClick:()=>g("needs"),children:["● ",_("needs")]}),E.jsxs(Ms,{onClick:()=>g("name"),children:["Agent",_("name")]}),E.jsx(Ms,{children:"Advisor"}),E.jsxs(Ms,{onClick:()=>g("status"),children:["Status",_("status")]}),E.jsxs(Ms,{onClick:()=>g("health"),numeric:!0,children:["Health",_("health")]}),E.jsxs(Ms,{onClick:()=>g("progress"),children:["Mission · tools",_("progress")]}),E.jsxs(Ms,{onClick:()=>g("context"),numeric:!0,children:["Context",_("context")]}),E.jsxs(Ms,{onClick:()=>g("lastActivity"),numeric:!0,children:["Last activity",_("lastActivity")]})]})}),E.jsx("tbody",{children:A.map(L=>E.jsxs("tr",{onClick:()=>s(L.session.id),className:`border-t border-solix-border hover:bg-solix-border/20 cursor-pointer ${L.needsAttention?"bg-solix-danger/5":""} ${o.has(L.session.id)?"bg-solix-accent/5":""}`,children:[E.jsx("td",{className:"px-3 py-2",onClick:P=>P.stopPropagation(),children:E.jsx("input",{type:"checkbox","aria-label":"Select agent",checked:o.has(L.session.id),onChange:()=>a(L.session.id),className:"cursor-pointer"})}),E.jsx("td",{className:"px-3 py-2",children:L.needsAttention?E.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-solix-danger solix-pulse"}):L.session.status==="active"?E.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-solix-ok"}):E.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-slate-600"})}),E.jsx("td",{className:"px-3 py-2",children:E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{background:wm(L.session.model)},title:String(L.session.model)}),E.jsx("span",{className:"text-slate-100 font-medium",children:L.session.name??L.session.id.slice(0,8)}),L.session.kind==="advisor"&&E.jsx("span",{className:"text-[9px] uppercase tracking-wide text-amber-300",children:"advisor"}),L.session.worktreePath&&E.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded border border-solix-accent/40 text-solix-accent",title:L.session.worktreePath,children:["⌥",aV(L.session.worktreePath)]})]})}),E.jsx("td",{className:"px-3 py-2 text-xs",children:E.jsx(cV,{session:L.session,mission:L.mission})}),E.jsx("td",{className:"px-3 py-2 text-xs text-slate-300",title:wg[L.session.status]??void 0,children:xS(L.session.status)}),E.jsx("td",{className:"px-3 py-2 text-right",children:E.jsx(uV,{score:L.health,reasons:L.healthReasons})}),E.jsx("td",{className:"px-3 py-2 text-xs text-slate-300 truncate max-w-xs",children:L.mission?E.jsxs(E.Fragment,{children:[E.jsx("span",{className:"text-slate-100",children:L.mission.shortName}),E.jsxs("span",{className:"text-slate-500 ml-1",children:["· ",L.mission.metrics.toolCallCount," tools"]})]}):E.jsx("span",{className:"text-slate-500 italic",children:"idle"})}),E.jsx("td",{className:"px-3 py-2 text-right",children:E.jsx(dV,{pct:L.session.contextUsagePct})}),E.jsx("td",{className:"px-3 py-2 text-right text-[11px] text-slate-500 font-mono",children:fV(L.session.updatedAt)})]},L.session.id))})]})]},(b==null?void 0:b.id)??"_")})]})]})}function aV(n){const e=n.split("/").filter(Boolean);return e[e.length-1]??n}const lV=/^\[Acting as ([^\s—]+)/;function cV({session:n,mission:e}){var s;const t=we(o=>o.advisors);let i,r=!1;if(n.advisorRole)i=Object.values(t).find(o=>o.id===n.advisorRole);else if(e!=null&&e.prompt){const o=e.prompt.match(lV),a=(s=o==null?void 0:o[1])==null?void 0:s.toLowerCase();a&&(i=Object.values(t).find(c=>c.codename.toLowerCase()===a),r=!0)}return i?E.jsxs("span",{className:`inline-flex items-center gap-1 ${r?"opacity-60":""}`,title:i.description,children:[E.jsx("span",{style:{color:i.color},children:i.glyph}),E.jsx("span",{className:"text-slate-200",children:i.codename})]}):E.jsx("span",{className:"text-slate-700",children:"—"})}function Ms({children:n,onClick:e,numeric:t}){return E.jsx("th",{onClick:e,className:`px-3 py-2 select-none ${t?"text-right":"text-left"} ${e?"cursor-pointer hover:text-slate-300":""}`,children:n})}function uV({score:n,reasons:e}){const t=TR(n);return E.jsxs("div",{className:"relative inline-flex items-center gap-2 group",children:[E.jsx("span",{className:"text-[11px] font-mono font-bold",style:{color:t},children:n}),E.jsx("div",{className:"w-16 h-1.5 rounded-full bg-slate-800 overflow-hidden",children:E.jsx("div",{className:"h-full",style:{width:`${Math.max(2,n)}%`,background:t}})}),E.jsxs("div",{className:"pointer-events-none absolute right-0 top-full mt-1 z-50 hidden group-hover:block w-64 rounded border border-solix-border bg-solix-panel/95 backdrop-blur p-2 text-left shadow-xl",children:[E.jsxs("div",{className:"flex items-center justify-between mb-1",children:[E.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-400",children:"Health"}),E.jsxs("span",{className:"text-xs font-bold",style:{color:t},children:[n,"/100"]})]}),e.length===0?E.jsx("div",{className:"text-[11px] text-slate-400 italic",children:"All four bands healthy: stable status, no pending decisions, context budget, mission progress."}):E.jsx("ul",{className:"space-y-0.5",children:e.map(i=>E.jsxs("li",{className:"text-[11px] text-slate-200 leading-snug",children:["· ",i]},i))})]})]})}function dV({pct:n}){const e=n>=90?"bg-solix-danger":n>=80?"bg-solix-warn":"bg-solix-accent";return E.jsxs("div",{className:"inline-flex items-center gap-2",children:[E.jsxs("span",{className:"text-[11px] text-slate-400 font-mono",children:[n.toFixed(0),"%"]}),E.jsx("div",{className:"w-20 h-1.5 rounded-full bg-slate-800 overflow-hidden",children:E.jsx("div",{className:`h-full ${e}`,style:{width:`${Math.min(100,n)}%`}})})]})}function fV(n){const e=Date.now()-n;if(e<0)return"now";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m`;const r=Math.floor(i/60);return r<24?`${r}h`:new Date(n).toLocaleDateString()}function hV(){const n=we(c=>c.missions),e=we(c=>c.sessions),t=we(c=>c.projects),i=we(c=>c.selectSession),[r,s]=V.useState("all"),o=V.useMemo(()=>{const c=Object.values(n).sort((d,f)=>f.startedAt-d.startedAt);return r==="all"?c:c.filter(d=>d.status===r)},[n,r]),a=V.useMemo(()=>{const c=new Map;for(const d of o){const f=e[d.sessionId],h=f?t[f.projectId]:void 0,p=(h==null?void 0:h.id)??"_",v=c.get(p);v?v.missions.push(d):c.set(p,{project:h,missions:[d]})}return[...c.values()].sort((d,f)=>{var h,p;return(((h=f.missions[0])==null?void 0:h.startedAt)??0)-(((p=d.missions[0])==null?void 0:p.startedAt)??0)})},[o,e,t]);return E.jsx("div",{className:"absolute inset-0 overflow-y-auto bg-solix-bg pt-20 pb-8 px-6 z-0",children:E.jsxs("div",{className:"max-w-4xl mx-auto",children:[E.jsxs("div",{className:"flex items-center justify-between mb-3",children:[E.jsxs("div",{className:"text-xs text-slate-500 uppercase tracking-widest",children:["Missions · ",o.length]}),E.jsx("div",{className:"flex items-center gap-1.5",children:["all","active","completed","failed","cancelled"].map(c=>E.jsx("button",{onClick:()=>s(c),className:`text-[10px] px-2 py-0.5 rounded border ${r===c?"bg-solix-accent/15 border-solix-accent text-solix-accent":"border-solix-border text-slate-400 hover:text-slate-200"}`,children:c},c))})]}),o.length===0?E.jsx("div",{className:"text-sm text-slate-500 italic py-12 text-center border border-solix-border rounded",children:"No missions yet. Send a prompt to a Claude Code session and a mission card will appear here."}):a.map(({project:c,missions:d})=>{const f=(c==null?void 0:c.name)??"(unassigned)";return E.jsxs("section",{className:"mb-6 rounded border border-solix-border overflow-hidden",children:[E.jsxs("header",{className:"bg-solix-panel/60 px-4 py-2 flex items-center justify-between",children:[E.jsxs("div",{children:[E.jsx("span",{className:"text-sm font-semibold text-slate-100",children:f}),E.jsxs("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-slate-500",children:[d.length," mission",d.length===1?"":"s"]})]}),(c==null?void 0:c.cwd)&&E.jsx("span",{className:"text-[10px] font-mono text-slate-500 truncate max-w-[55%]",children:c.cwd})]}),E.jsx("ul",{className:"divide-y divide-solix-border",children:d.map(h=>{const p=e[h.sessionId];return E.jsx("li",{children:E.jsxs("button",{onClick:()=>i(h.sessionId),className:"w-full text-left p-4 hover:bg-solix-border/20 cursor-pointer block",children:[E.jsxs("div",{className:"flex items-start justify-between gap-3",children:[E.jsxs("div",{className:"min-w-0 flex-1",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-sm font-semibold text-slate-100",children:h.shortName}),E.jsx(pV,{status:h.status})]}),E.jsx("div",{className:"mt-1 text-xs text-slate-400 line-clamp-2",children:h.prompt}),h.longSummary&&E.jsx("div",{className:"mt-1 text-xs text-slate-300 italic",children:h.longSummary}),h.status==="failed"&&h.errorSummary&&E.jsxs("div",{className:"mt-1 text-xs text-solix-danger italic line-clamp-2",children:["error: ",h.errorSummary]})]}),E.jsxs("div",{className:"text-right text-[10px] text-slate-500 font-mono whitespace-nowrap",children:[gV(h.startedAt),h.metrics.durationMs!==void 0&&E.jsxs("div",{children:[(h.metrics.durationMs/1e3).toFixed(1),"s"]})]})]}),E.jsxs("div",{className:"mt-2 flex items-center gap-3 text-[10px] text-slate-500",children:[p&&E.jsxs("span",{children:["agent:"," ",E.jsx("span",{className:"text-slate-300",children:p.name??p.id.slice(0,8)})]}),E.jsxs("span",{children:[h.metrics.toolCallCount," tools"]}),E.jsxs("span",{title:wg.subagent,children:[h.metrics.subagentCount," subagents"]}),E.jsxs("span",{children:[h.filesTouched.length," files"]})]}),h.filesTouched.length>0&&E.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[h.filesTouched.slice(0,6).map(v=>E.jsx("span",{className:"text-[10px] font-mono text-slate-400 bg-black/30 border border-solix-border rounded px-1.5 py-0.5",children:mV(v)},v)),h.filesTouched.length>6&&E.jsxs("span",{className:"text-[10px] text-slate-500",children:["+",h.filesTouched.length-6]})]})]})},h.id)})})]},(c==null?void 0:c.id)??"_")})]})})}function pV({status:n}){const e=n==="active"?"border-solix-warn text-solix-warn":n==="completed"?"border-solix-ok text-solix-ok":n==="failed"?"border-solix-danger text-solix-danger":"border-solix-border text-slate-400";return E.jsx("span",{className:`text-[9px] uppercase tracking-wide px-1.5 py-0.5 rounded border ${e}`,children:n})}function mV(n){const e=n.match(/[^/\\]+\/?$/);return e?e[0].replace(/\/$/,""):n}function gV(n){const e=Date.now()-n;if(e<0)return"now";const t=Math.floor(e/1e3);if(t<60)return`${t}s ago`;const i=Math.floor(t/60);if(i<60)return`${i}m ago`;const r=Math.floor(i/60);return r<24?`${r}h ago`:new Date(n).toLocaleDateString()}const vV=[1,4,16,64];function xV({open:n,onClose:e}){const t=we(M=>M.playback),i=we(M=>M.enterPlayback),r=we(M=>M.exitPlayback),s=we(M=>M.setPlaybackTime),o=we(M=>M.setPlaybackSpeed),a=we(M=>M.setPlaybackPlaying),c=we(M=>M.setPlaybackLoading),[d,f]=V.useState(30);V.useEffect(()=>{if(!n||t.active&&t.events.length>0)return;c(!0);const M=Date.now()-d*60*1e3;fetch(`/api/timeline?sinceMs=${M}&untilMs=${Date.now()}`).then(g=>g.json()).then(g=>{if(g.events.length===0){c(!1),i([],Date.now()-6e4,Date.now());return}i(g.events,g.earliest,g.latest)}).catch(g=>{console.warn("[timeline] fetch failed",g),c(!1)})},[n,d]);const h=V.useRef(0);if(V.useEffect(()=>{if(!t.active||!t.playing)return;let M=0;const g=_=>{const S=h.current?_-h.current:16;h.current=_;const b=t.currentMs+S*t.speed;b>=t.latestMs?(s(t.latestMs),a(!1)):(s(b),M=requestAnimationFrame(g))};return M=requestAnimationFrame(g),()=>{cancelAnimationFrame(M),h.current=0}},[t.active,t.playing,t.speed,t.latestMs]),!n)return null;const p=()=>{r(),e()},v=Math.max(1,t.latestMs-t.earliestMs),x=t.active?(t.currentMs-t.earliestMs)/v*100:0,w=t.events.filter(M=>M.ts<=t.currentMs);return E.jsx("div",{className:"absolute bottom-0 inset-x-0 z-30 bg-solix-panel/95 backdrop-blur border-t border-solix-border",children:E.jsxs("div",{className:"px-4 py-3 max-w-6xl mx-auto",children:[E.jsxs("div",{className:"flex items-center justify-between mb-2",children:[E.jsxs("div",{className:"flex items-center gap-3",children:[E.jsx("span",{className:"text-xs uppercase tracking-widest text-solix-accent",children:"▸ Playback"}),E.jsxs("span",{className:"text-[10px] text-slate-400",children:[t.events.length," events · last ",d," min"]})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsxs("select",{value:d,onChange:M=>f(parseInt(M.target.value,10)),className:"text-[10px] bg-black/40 border border-solix-border rounded px-1.5 py-0.5 text-slate-300",children:[E.jsx("option",{value:5,children:"5 min"}),E.jsx("option",{value:15,children:"15 min"}),E.jsx("option",{value:30,children:"30 min"}),E.jsx("option",{value:60,children:"1 hour"}),E.jsx("option",{value:180,children:"3 hours"})]}),E.jsx("button",{onClick:p,className:"text-slate-400 hover:text-slate-100 text-xs",children:"✕ Live"})]})]}),E.jsxs("div",{className:"flex items-center gap-3",children:[E.jsx("button",{onClick:()=>a(!t.playing),disabled:!t.active||t.events.length===0,className:"w-8 h-8 rounded-full bg-solix-accent/20 border border-solix-accent text-solix-accent text-sm hover:bg-solix-accent/30 disabled:opacity-40 flex items-center justify-center",children:t.playing?"⏸":"▶"}),E.jsxs("div",{className:"flex-1 relative",children:[E.jsx("input",{type:"range",min:t.earliestMs,max:t.latestMs,value:t.currentMs,onChange:M=>s(parseInt(M.target.value,10)),className:"w-full",disabled:!t.active}),E.jsx("div",{className:"absolute -top-1.5 h-0.5 bg-solix-accent/40 pointer-events-none",style:{left:0,width:`${x}%`}})]}),E.jsx("div",{className:"flex items-center gap-1",children:vV.map(M=>E.jsxs("button",{onClick:()=>o(M),className:`text-[10px] px-1.5 py-0.5 rounded border ${t.speed===M?"bg-solix-accent/20 border-solix-accent text-solix-accent":"border-solix-border text-slate-400 hover:text-slate-200"}`,children:[M,"×"]},M))})]}),E.jsxs("div",{className:"mt-2 flex items-center justify-between text-[10px] text-slate-500 font-mono",children:[E.jsx("span",{children:rx(t.earliestMs)}),E.jsxs("span",{className:"text-solix-accent",children:[rx(t.currentMs)," · ",w.length," events"]}),E.jsx("span",{children:rx(t.latestMs)})]}),t.loading&&E.jsx("div",{className:"text-center text-xs text-slate-500 italic mt-2",children:"Loading timeline…"}),!t.loading&&t.events.length===0&&t.active&&E.jsx("div",{className:"text-center text-xs text-slate-500 italic mt-2",children:"No events in this range. Try a longer window or run some agents first."})]})})}function rx(n){return n?new Date(n).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"—"}function yV({onOpenGalaxy:n,onNewTask:e,onOpenTimeline:t,onOpenHelp:i}={}){const r=we(f=>f.connected),s=we(Sg),o=we(f=>f.viewMode),a=we(f=>f.playback.active),c=we(f=>f.exitPlayback),d=s.reduce((f,h)=>(h.status==="active"?f.active+=1:h.status==="awaiting_permission"||h.status==="awaiting_input"||h.status==="plan_review"?f.attention+=1:h.status==="idle"&&(f.idle+=1),f),{active:0,idle:0,attention:0});return E.jsxs("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex items-start justify-between p-4 z-40",children:[E.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 sm:gap-3",children:[E.jsx("div",{className:"text-xl font-bold tracking-widest text-solix-accent",children:"SOLIX"}),E.jsx("div",{className:"hidden md:block text-xs text-slate-400",children:"a solar-system command center"}),E.jsx("div",{className:`ml-1 sm:ml-3 px-2 py-1 rounded text-[10px] border ${r?"border-solix-ok text-solix-ok":"border-solix-danger text-solix-danger solix-pulse"}`,children:r?"CONNECTED":"OFFLINE"}),a&&E.jsxs("button",{onClick:c,className:"ml-2 px-2 py-1 rounded text-[10px] border border-solix-accent text-solix-accent solix-pulse hover:bg-solix-accent/15 cursor-pointer flex items-center gap-1.5",title:"Exit Timeline Playback (Esc)","aria-label":"Exit playback",children:[E.jsx("span",{children:"▸ PLAYBACK"}),E.jsx("span",{className:"opacity-70",children:"· exit ✕"})]})]}),E.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 sm:gap-3 text-xs",children:[E.jsxs("div",{className:"hidden sm:flex items-center gap-2",children:[E.jsx(sx,{label:"active",value:d.active,color:"text-solix-ok"}),E.jsx(sx,{label:"attention",value:d.attention,color:"text-solix-warn"}),E.jsx(sx,{label:"idle",value:d.idle,color:"text-slate-400"})]}),E.jsx(_V,{viewMode:o}),t&&E.jsx("button",{onClick:t,className:"hidden sm:inline-block px-2 py-1 rounded bg-solix-panel border border-solix-border text-slate-300 hover:text-white hover:bg-solix-border/30",title:"Timeline playback (T)",children:"⏱ Timeline"}),e&&E.jsx("button",{onClick:e,className:"px-2 py-1 rounded bg-solix-ok/15 border border-solix-ok/40 text-solix-ok hover:bg-solix-ok/25",title:"Launch a new Claude Code task (L)",children:"+ Task"}),n&&E.jsx("button",{onClick:n,className:"px-2 py-1 rounded bg-solix-accent/15 border border-solix-accent/40 text-solix-accent hover:bg-solix-accent/25",title:"Galaxy: export and import (G)",children:"⌬ Galaxy"}),i&&E.jsx("button",{onClick:i,className:"w-7 h-7 rounded-full bg-solix-panel border border-solix-border text-slate-300 hover:text-white hover:bg-solix-border/30 text-sm",title:"Help (?)","aria-label":"Help",children:"?"})]})]})}function _V({viewMode:n}){const e=we(i=>i.setViewMode),t=[{mode:"galaxy",label:"🪐"},{mode:"list",label:"☰"},{mode:"missions",label:"◎"}];return E.jsx("div",{className:"inline-flex rounded border border-solix-border bg-solix-panel overflow-hidden",children:t.map(i=>E.jsxs("button",{onClick:()=>e(i.mode),className:`px-2 py-1 text-xs ${n===i.mode?"bg-solix-border/50 text-white":"text-slate-400 hover:text-slate-100"}`,title:`${i.mode} view (V)`,children:[i.label," ",E.jsx("span",{className:"hidden sm:inline capitalize",children:i.mode})]},i.mode))})}function sx({label:n,value:e,color:t}){return E.jsxs("div",{className:"px-2 py-1 rounded bg-solix-panel border border-solix-border",children:[E.jsx("span",{className:`font-bold ${t}`,children:e}),E.jsx("span",{className:"ml-1 opacity-60 uppercase tracking-wide",children:n})]})}function SV(){const n=we(t=>t.toasts),e=we(t=>t.dismissToast);return E.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex flex-col gap-2 z-30",children:n.map(t=>E.jsx("button",{onClick:()=>e(t.id),className:`pointer-events-auto px-3 py-2 rounded text-xs border max-w-md text-left ${t.level==="error"?"bg-solix-danger/10 border-solix-danger text-solix-danger":t.level==="warn"?"bg-solix-warn/10 border-solix-warn text-solix-warn":"bg-solix-panel border-solix-border text-slate-200"}`,children:t.message},t.id))})}const Sb="solix.welcome.dismissed.v1";function MV({onOpenGalaxy:n,forceOpen:e=!1,onClose:t}){const[i,r]=V.useState(!1),s=we(f=>f.advisors),o=we(f=>Object.keys(f.skills).length),a=we(f=>Object.keys(f.sessions).length);if(V.useEffect(()=>{try{r(localStorage.getItem(Sb)==="1")}catch{}},[]),!e&&(i||a>0))return null;const c=()=>{try{localStorage.setItem(Sb,"1")}catch{}r(!0),t==null||t()},d=Object.values(s).filter(f=>f.enabled).sort((f,h)=>f.codename.localeCompare(h.codename));return E.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center pointer-events-none",children:E.jsxs("div",{className:"pointer-events-auto max-w-xl w-full mx-4 rounded-xl border border-solix-accent/40 bg-solix-panel/95 backdrop-blur-md shadow-2xl",children:[E.jsxs("div",{className:"px-6 pt-5 pb-3 border-b border-solix-border",children:[E.jsx("div",{className:"text-xs uppercase tracking-widest text-solix-accent",children:"welcome"}),E.jsx("div",{className:"text-2xl font-bold mt-1",children:"Solix — your agent solar system"}),E.jsx("div",{className:"text-sm text-slate-400 mt-1",children:"Mission control for Claude Code. Each agent orbits the sun; each click is a conversation with one of your planets."})]}),E.jsxs("div",{className:"px-6 py-4 space-y-3 text-sm text-slate-300",children:[E.jsx(yu,{n:1,title:"Run a Claude Code session",body:E.jsxs(E.Fragment,{children:["Open a terminal anywhere and run"," ",E.jsx("code",{className:"bg-black/40 px-1 rounded",children:"claude"}),". A planet will appear here within a second."]})}),E.jsx(yu,{n:2,title:"Or seed the demo state",body:E.jsxs(E.Fragment,{children:["In another terminal:"," ",E.jsx("code",{className:"bg-black/40 px-1 rounded",children:"solix demo"}),". You'll get 3 planets, a moon, a permission flare, and a pinned advisor — without running Claude Code."]})}),E.jsx(yu,{n:3,title:"Meet the advisor crew",body:E.jsxs(E.Fragment,{children:[d.length>0?`${d.length} crew members loaded. Click any in the inner ring to read their role and invoke them on the focused planet.`:"Crew loading…",d.length>0&&E.jsx("ul",{className:"mt-2 space-y-1",children:d.map(f=>E.jsxs("li",{className:"flex items-baseline gap-2",children:[E.jsxs("span",{className:"font-mono text-xs",style:{color:f.color},children:[f.glyph," ",f.codename]}),E.jsx("span",{className:"text-slate-500 text-xs",children:"—"}),E.jsx("span",{className:"text-slate-300 text-xs",children:f.name})]},f.id))})]})}),E.jsx(yu,{n:4,title:"Browse the asteroid belt",body:E.jsxs(E.Fragment,{children:["Each asteroid is a Skill (",o," discovered). Click one to read its SKILL.md and see which advisors require it."]})}),E.jsx(yu,{n:5,title:"Share your galaxy",body:E.jsxs(E.Fragment,{children:["Press"," ",E.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-black/50 border border-solix-border text-[10px]",children:"G"})," ","or click ",E.jsx("span",{className:"text-solix-accent",children:"⌬ Galaxy"})," ","in the top bar to export, import, publish, or install a galaxy from a registry."]})})]}),E.jsxs("div",{className:"px-6 pb-3 pt-1",children:[E.jsx("div",{className:"text-[10px] uppercase tracking-widest text-slate-500 mb-1.5",children:"Keyboard shortcuts"}),E.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px] text-slate-400",children:[E.jsx($r,{k:"V",children:"cycle Galaxy → List → Missions"}),E.jsx($r,{k:"G",children:"toggle Galaxy panel"}),E.jsx($r,{k:"L",children:"new task"}),E.jsx($r,{k:"T",children:"timeline"}),E.jsx($r,{k:"M",children:"jump to Missions"}),E.jsx($r,{k:"Y",children:"approve top decision"}),E.jsx($r,{k:"N",children:"deny top decision"}),E.jsx($r,{k:"Space",children:"play / pause orbits"}),E.jsx($r,{k:"?",children:"re-open this help"}),E.jsx($r,{k:"Esc",children:"close panels / exit playback"})]}),E.jsx("div",{className:"text-[10px] text-slate-500 italic mt-2",children:"If clicks feel stuck, a third-party screen overlay (note-taker, recorder) may be intercepting. Quit it temporarily, or use the shortcuts above."})]}),E.jsxs("div",{className:"px-6 py-3 border-t border-solix-border flex items-center gap-2",children:[E.jsx("button",{onClick:()=>{n(),c()},className:"px-3 py-1.5 rounded bg-solix-accent/15 border border-solix-accent/40 text-solix-accent text-xs hover:bg-solix-accent/25",children:"Open Galaxy panel"}),E.jsx("div",{className:"flex-1"}),E.jsx("button",{onClick:c,className:"px-3 py-1.5 rounded border border-solix-border text-xs text-slate-300 hover:text-white",children:"Got it"})]})]})})}function $r({k:n,children:e}){return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("kbd",{className:"shrink-0 px-1.5 py-0.5 rounded bg-black/50 border border-solix-border text-[10px] font-mono text-slate-300",children:n}),E.jsx("span",{className:"truncate",children:e})]})}function yu({n,title:e,body:t}){return E.jsxs("div",{className:"flex gap-3",children:[E.jsx("div",{className:"shrink-0 w-6 h-6 rounded-full bg-solix-accent/20 border border-solix-accent/40 text-solix-accent text-xs flex items-center justify-center",children:n}),E.jsxs("div",{children:[E.jsx("div",{className:"text-slate-100 font-medium text-sm",children:e}),E.jsx("div",{className:"text-slate-400 text-xs mt-0.5 leading-relaxed",children:t})]})]})}function wV(n,e,t,i){const r=ox(i,"command"),s=ox(i,"file_path"),o=ox(i,"url");if(t==="Bash"&&r){if(/\brm\s+-rf\b/i.test(r)||/\bsudo\b/i.test(r))return{severity:"danger",text:"Destructive command. Deny unless you have already confirmed the diff."};if(/--no-verify\b/.test(r))return{severity:"warn",text:"Skipping pre-commit hooks. Investigate the failure first."};if(/git\s+push.*--force\b/.test(r))return{severity:"danger",text:"Force-push. Confirm no one else has pushed since."};if(/git\s+push/.test(r)&&/\b(main|master|prod|production)\b/.test(r))return{severity:"warn",text:"Pushing to main/prod. Confirm the diff first."};if(/git\s+reset\s+--hard\b/.test(r))return{severity:"warn",text:"Hard reset will discard uncommitted changes. Stash first if unsure."}}if((t==="Edit"||t==="Write"||t==="MultiEdit")&&s){if(/\.env(\b|\.|\/)|credentials\.json|\.pem$|\.key$/i.test(s))return{severity:"danger",text:"Editing a secrets file. Make sure the agent really needs to."};if(/(^|\/)\.git\//.test(s))return{severity:"warn",text:"Editing inside .git/. Almost certainly a mistake."}}if(t==="WebFetch"&&o){if(/^https?:\/\/(localhost|127\.0\.0\.1|0\.0\.0\.0)/.test(o))return null;if(/^http:\/\//.test(o))return{severity:"info",text:"Plain HTTP fetch. OK for known internal hosts."}}return n.contextUsagePct>=90?{severity:"warn",text:`Context at ${n.contextUsagePct.toFixed(0)}%. Run /compact before continuing.`}:null}function EV(n,e){return n.status==="error"?{severity:"danger",text:"Session is in error state. Check the chat tab and consider restarting."}:n.contextUsagePct>=90?{severity:"warn",text:`Context at ${n.contextUsagePct.toFixed(0)}%. Compact the conversation before the next prompt.`}:n.contextUsagePct>=80?{severity:"info",text:`Context at ${n.contextUsagePct.toFixed(0)}%. Watch out — output quality drops past 90.`}:e&&e.status==="active"&&e.metrics.toolCallCount===0&&Date.now()-e.startedAt>5*60*1e3?{severity:"info",text:"Active mission with no tool calls in 5+ minutes. Agent may be stuck."}:null}function ox(n,e){const t=n[e];return typeof t=="string"?t:null}function bV(){const n=we(f=>f.pendingPermissions),e=we(f=>f.sessions),t=we(f=>f.missions),i=we(f=>f.resolvePermission),r=we(f=>f.selectSession),s=Object.values(n).sort((f,h)=>h.receivedAt-f.receivedAt),[o,a]=V.useState(!1),c=s.length;V.useEffect(()=>{c>0&&a(!1)},[c]);const d=f=>{r(f),a(!0)};return c===0?E.jsx("div",{className:"absolute top-20 right-4 z-30 pointer-events-none",children:E.jsxs("div",{className:"pointer-events-auto rounded-full border border-solix-border bg-solix-panel/60 backdrop-blur px-3 py-1 text-[10px] text-slate-500 flex items-center gap-2",children:[E.jsx("span",{className:"uppercase tracking-widest",children:"decisions"}),E.jsx("span",{className:"font-bold",children:"0"}),E.jsx("span",{className:"italic opacity-80",children:"— all clear"})]})}):E.jsxs("div",{className:"absolute top-20 right-4 z-30 w-80 flex flex-col gap-2 pointer-events-none",children:[E.jsxs("div",{className:"pointer-events-auto rounded border border-solix-border bg-solix-panel/85 backdrop-blur px-3 py-2 flex items-center justify-between",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-[10px] uppercase tracking-widest text-slate-400",children:"Decisions"}),E.jsx("span",{className:"text-xs font-bold text-solix-danger",children:c})]}),E.jsx("button",{onClick:()=>a(f=>!f),className:"text-[10px] text-slate-400 hover:text-slate-100",children:o?"show":"hide"})]}),!o&&s.map(f=>{const h=e[f.sessionId],p=h!=null&&h.currentMissionId?t[h.currentMissionId]:void 0;return E.jsx(TV,{session:h,mission:p,tool:f.tool,args:f.args,onApprove:()=>i(f.requestId,!0),onDeny:()=>i(f.requestId,!1),onAsk:()=>d(f.sessionId)},f.requestId)})]})}function TV({session:n,mission:e,tool:t,args:i,onApprove:r,onDeny:s,onAsk:o}){const a=(n==null?void 0:n.name)??(n==null?void 0:n.id.slice(0,8))??"unknown agent",c=n!=null&&n.cwd?PV(n.cwd):"",d=n?wV(n,e,t,i):null;return E.jsxs("div",{className:"pointer-events-auto rounded border border-solix-danger bg-solix-danger/10 p-3 backdrop-blur shadow-lg",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("div",{className:"text-xs uppercase tracking-wide text-solix-danger",children:a}),c&&E.jsx("div",{className:"text-[10px] text-slate-500 truncate ml-2 max-w-[55%]",children:c})]}),e&&E.jsxs("div",{className:"mt-1 text-[11px] text-slate-400 italic truncate",children:["mission: ",e.shortName]}),E.jsxs("div",{className:"mt-2 text-sm text-slate-100",children:[E.jsx("span",{className:"font-semibold",children:t}),E.jsx("span",{className:"ml-1 text-slate-300 text-xs break-words",children:IV(i)})]}),E.jsx(AV,{tool:t,args:i}),d&&E.jsx(RV,{suggestion:d}),E.jsxs("div",{className:"mt-3 flex gap-1.5",children:[E.jsx("button",{onClick:r,className:"flex-1 py-1.5 rounded bg-solix-ok/20 border border-solix-ok text-solix-ok text-xs hover:bg-solix-ok/30",children:"Approve · Y"}),E.jsx("button",{onClick:s,className:"flex-1 py-1.5 rounded bg-solix-danger/20 border border-solix-danger text-solix-danger text-xs hover:bg-solix-danger/30",children:"Deny · N"}),E.jsx("button",{onClick:o,className:"px-2.5 py-1.5 rounded border border-solix-border text-slate-300 text-xs hover:text-white hover:bg-solix-border/30",title:"Open chat with this agent for context",children:"Ask"})]})]})}function AV({tool:n,args:e}){const[t,i]=V.useState(!1);if(n==="Bash"){const r=ao(e,"command")??"",s=ao(e,"description");return r?E.jsxs(ax,{label:"will run",children:[E.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-[11px] text-slate-100",children:r}),s&&E.jsx("div",{className:"mt-1 text-[10px] text-slate-500 italic",children:s})]}):null}if(n==="Edit"||n==="NotebookEdit"){const r=ao(e,"file_path")??ao(e,"notebook_path"),s=ao(e,"old_string"),o=ao(e,"new_string");return!r&&!s&&!o?null:E.jsxs(ax,{label:"patch",children:[r&&E.jsx("div",{className:"font-mono text-[11px] text-solix-accent break-all",children:r}),s&&E.jsx(lx,{sign:"-",text:s,expanded:t,colorClass:"text-solix-danger bg-solix-danger/10"}),o&&E.jsx(lx,{sign:"+",text:o,expanded:t,colorClass:"text-solix-ok bg-solix-ok/10"}),(cx(s)||cx(o))&&E.jsx("button",{onClick:()=>i(a=>!a),className:"mt-1 text-[10px] text-slate-400 hover:text-slate-100",children:t?"collapse":"expand"})]})}if(n==="Write"){const r=ao(e,"file_path"),s=ao(e,"content")??"";return r?E.jsxs(ax,{label:"will write",children:[E.jsx("div",{className:"font-mono text-[11px] text-solix-accent break-all",children:r}),s&&E.jsx(lx,{sign:"+",text:s,expanded:t,colorClass:"text-solix-ok bg-solix-ok/10"}),cx(s)&&E.jsx("button",{onClick:()=>i(o=>!o),className:"mt-1 text-[10px] text-slate-400 hover:text-slate-100",children:t?"collapse":"expand"})]}):null}return null}function ax({label:n,children:e}){return E.jsxs("div",{className:"mt-2 rounded border border-solix-border bg-black/30 px-2 py-1.5",children:[E.jsx("div",{className:"text-[9px] uppercase tracking-wider text-slate-500 mb-1",children:n}),e]})}function lx({sign:n,text:e,expanded:t,colorClass:i}){const r=t?e:CV(e,240);return E.jsxs("pre",{className:`mt-1 px-1.5 py-1 rounded text-[11px] font-mono whitespace-pre-wrap break-words ${i}`,children:[E.jsx("span",{className:"opacity-50 mr-1",children:n}),r]})}function ao(n,e){const t=n[e];return typeof t=="string"?t:void 0}function cx(n){return!!(n&&n.length>240)}function CV(n,e){if(n.length<=e)return n;const t=Math.floor((e-3)/2);return`${n.slice(0,t)}
|
|
4187
|
+
`}),[e,t,i]);return E.jsxs("mesh",{children:[E.jsx("sphereGeometry",{args:[n*1.18,32,32]}),E.jsx("primitive",{object:r,attach:"material"})]})}function bR(n,e,t){const i=[];let r=30;switch(n.status){case"error":r=0,i.push("In error state");break;case"plan_review":case"awaiting_input":r=15,i.push(`Status: ${n.status}`);break;case"awaiting_permission":r=12,i.push("Awaiting permission");break;case"terminated":r=5,i.push("Terminated");break;default:r=30}const s=Math.max(0,30-t*15);t>0&&i.push(`${t} pending permission${t===1?"":"s"}`);const a=25*Math.max(0,1-n.contextUsagePct/100);n.contextUsagePct>=90?i.push(`Context at ${n.contextUsagePct.toFixed(0)}%`):n.contextUsagePct>=80&&i.push(`Context warm (${n.contextUsagePct.toFixed(0)}%)`);let c=0;if(e&&e.status==="active"){const f=e.metrics.toolCallCount;c=Math.min(15,f*2)}else e&&e.status==="completed"&&(c=15);return{score:Math.round(Math.max(0,Math.min(100,r+s+a+c))),reasons:i}}function TR(n){return n>=75?"#10b981":n>=50?"#fbbf24":n>=25?"#f97316":"#ef4444"}const wg={active:"The agent is currently working — emitting tool calls or generating output.",idle:"No mission running. The agent is waiting for the next prompt or has been quiet for a while.",spawning:"The agent process just started. It will transition to active within a second or two.",awaiting_permission:"The agent paused to ask permission for a sensitive tool call. Approve or deny in the Decision Queue.",awaiting_input:"The agent finished what it could and is waiting for your next prompt.",plan_review:"The agent produced a plan and is waiting for your approval before executing.",error:"The agent crashed or hit an unrecoverable error. Look at the SidePanel transcript for details.",terminated:"The agent process exited. No more activity will come from this session.",subagent:"A child agent spawned by another session (typically via the Task tool). Rendered as a moon orbiting the parent planet.",advisor:"A long-lived specialist agent (Compass, Forge, Lumen, Argus, Sentinel, …) with its own AGENT.md describing its role.",pinned:"An advisor that's always running. Pinned advisors orbit close to the sun in the inner ring."};function NH({session:n}){const e=V.useRef(null),t=V.useRef(null),i=V.useRef(null),r=V.useRef(null),s=V.useRef(null),o=V.useMemo(()=>yS(n.orbitSlot,n.id,n.projectId),[n.orbitSlot,n.id]),a=V.useMemo(()=>Mg(n.orbitSlot),[n.orbitSlot]),c=we(P=>mH(P,n.id)),d=we(P=>P.selectSession),f=we(P=>P.selectAdvisor),h=we(P=>n.advisorRole?Object.values(P.advisors).find(C=>C.id===n.advisorRole)??null:null),v=we(P=>P.selectedSessionId)===n.id,x=n.kind==="advisor",w=we(P=>n.currentMissionId?P.missions[n.currentMissionId]:void 0),M=we(P=>Object.values(P.pendingPermissions).filter(C=>C.sessionId===n.id).length),g=V.useMemo(()=>bR(n,w,M),[n,w,M]),_=g.score,S=.4+_/100*.8,b=V.useMemo(()=>new De(x&&h?h.color:wm(n.model)),[x,h,n.model]),N=V.useRef(o),A=V.useRef(1);Ti((P,C)=>{const U=we.getState(),W=U.motionEnabled,X=!!(U.selectedSessionId||U.selectedAdvisorId||U.selectedSkillId),te=U.selectedSessionId===n.id||x&&U.selectedAdvisorId===n.advisorRole,ee=X&&!te?.25:1;A.current=Eo.lerp(A.current,ee,.08);const Q=A.current,le=RH(n.status==="active",n.orbitSlot);W&&(N.current+=C*le*.3);const z=N.current,$=Math.cos(z)*a,q=Math.sin(z)*a,oe=Math.sin(z*.5)*.4;e.current&&e.current.position.set($,oe,q);const Ee=P.clock.getElapsedTime();if(t.current){W&&(t.current.rotation.y+=C*.4);const Pe=.55+n.contextUsagePct/100*.5,ne=t.current.scale.x,ge=Eo.lerp(ne,Pe,.04);t.current.scale.set(ge,ge,ge)}if(s.current){const Pe=wR(n.status),ne=new De(Pe.color);s.current.emissive.lerp(ne,.08),s.current.emissiveIntensity=Eo.lerp(s.current.emissiveIntensity,Pe.intensity*Q,.06),s.current.opacity=Q,s.current.transparent=Q<.99}if(i.current){const Pe=n.contextUsagePct>=90,ne=n.contextUsagePct>=80&&!Pe;if(n.status==="awaiting_permission"||n.status==="awaiting_input"||Pe||ne){let Te=.8,be="#f59e0b";n.status==="awaiting_permission"?(Te=1.5,be="#ef4444"):n.status==="awaiting_input"?(Te=.8,be="#f59e0b"):Pe?(Te=1.2,be="#dc2626"):ne&&(Te=.6,be="#fb923c");const Ke=.5+.5*Math.sin(Ee*Math.PI*2*Te),st=i.current.material;st.color.set(be),st.opacity=(.25+Ke*.5)*Q,i.current.visible=!0;const We=1.4+Ke*.5;i.current.scale.set(We,We,We)}else i.current.visible=!1}r.current&&(r.current.visible=n.status==="plan_review",r.current.rotation.z+=C*.3)});const I=P=>{P.stopPropagation(),d(n.id),x&&h&&f(h.id)},L=.55;return E.jsxs("group",{ref:e,children:[E.jsxs("mesh",{ref:t,onClick:I,castShadow:!0,children:[E.jsx("sphereGeometry",{args:[L,32,32]}),E.jsx("meshStandardMaterial",{ref:s,color:b,emissive:b,emissiveIntensity:.1,roughness:.6,metalness:.3})]}),E.jsx(ER,{radius:L,color:x&&h?h.color:wm(n.model),intensity:S*(n.status==="active"?1.2:.9)}),E.jsxs("mesh",{ref:i,visible:!1,children:[E.jsx("sphereGeometry",{args:[L*1.4,24,24]}),E.jsx("meshBasicMaterial",{color:"#ef4444",transparent:!0,opacity:.4})]}),E.jsxs("mesh",{ref:r,visible:!1,rotation:[Math.PI/2.4,0,0],children:[E.jsx("ringGeometry",{args:[L*1.4,L*2,64]}),E.jsx("meshBasicMaterial",{color:"#a78bfa",transparent:!0,opacity:.5,side:2})]}),x&&E.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[E.jsx("ringGeometry",{args:[L*1.25,L*1.35,64]}),E.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.7,side:2})]}),c.map((P,C)=>E.jsx(IH,{session:P,index:C,speed:PH()},P.id)),E.jsx(hS,{center:!0,distanceFactor:10,style:{pointerEvents:"none",userSelect:"none"},position:[0,L+.4,0],children:E.jsxs("div",{className:`px-2 py-1 rounded text-[10px] whitespace-nowrap border ${v?"bg-solix-accent/20 border-solix-accent text-white":x?"bg-amber-500/10 border-amber-300/50 text-amber-100":"bg-black/50 border-white/10 text-slate-200"}`,children:[E.jsxs("div",{className:"font-semibold flex items-center gap-1",children:[x&&h&&E.jsx("span",{style:{color:h.color},children:h.glyph}),E.jsx("span",{children:n.name??(x&&h?`${h.codename} (pinned)`:n.id.slice(0,8))})]}),E.jsxs("div",{className:"opacity-70",title:wg[n.status]??void 0,children:[String(n.model)," · ",xS(n.status),n.wrapperSocketPath&&E.jsx("span",{className:"ml-1.5 text-[9px] uppercase tracking-wide text-solix-accent",title:"Wrapped by `solix run` — UI prompts route to this terminal",children:"· wrapped"})]}),E.jsxs("div",{className:"opacity-70",title:g.reasons.length?g.reasons.join(" · "):"Stable, low context, no pending decisions",children:[E.jsx("span",{style:{color:TR(_)},children:"♥"})," ","health ",_,g.reasons[0]&&E.jsxs("span",{className:"opacity-80",children:[" · ",g.reasons[0]]})]})]})})]})}function LH({orbitSlot:n}){const e=Mg(n);return E.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[E.jsx("ringGeometry",{args:[e-.02,e+.02,128]}),E.jsx("meshBasicMaterial",{color:"#1e293b",transparent:!0,opacity:.35,side:2})]})}const DH=1800;function UH(n){switch(n){case"Bash":return"#94a3b8";case"Read":return"#60a5fa";case"Write":return"#34d399";case"Edit":case"MultiEdit":return"#fbbf24";case"Task":return"#a78bfa";default:return"#cbd5e1"}}function kH({toolCallId:n,startX:e,startZ:t,color:i,receivedAt:r}){const s=V.useRef(null),o=V.useRef(null),a=V.useMemo(()=>{const c=Math.hypot(e,t)||1,d=e/c,f=t/c;return{nx:d,nz:f}},[e,t]);return Ti(()=>{const c=Date.now()-r,d=Math.min(1,c/DH);if(s.current){const f=Eo.lerp(0,12,d);s.current.position.set(e+a.nx*f,Math.sin(d*Math.PI)*1.4,t+a.nz*f)}if(o.current){const f=o.current.material;f.opacity=1-d}}),E.jsx("group",{ref:s,children:E.jsxs("mesh",{ref:o,children:[E.jsx("sphereGeometry",{args:[.08,8,8]}),E.jsx("meshBasicMaterial",{color:i,transparent:!0,opacity:.9})]})})}function OH(){const n=we(t=>t.playback.active?t.playback.derivedToolCalls:t.recentToolCalls),e=we(t=>t.playback.active?t.playback.derivedSessions:t.sessions);return E.jsx("group",{children:n.map(t=>{const i=e[t.sessionId];if(!i)return null;const r=Mg(i.orbitSlot),s=yS(i.orbitSlot,i.id,i.projectId),o=(Date.now()-t.startedAt)/1e3,c=s+o*.18*.3,d=Math.cos(c)*r,f=Math.sin(c)*r;return E.jsx(kH,{toolCallId:t.id,startX:d,startZ:f,color:UH(t.tool),receivedAt:t.receivedAt},t.id)})})}const Em=3.3,Ma=.34,FH={saturn:{body:"/textures/saturn.jpg",ring:"/textures/saturn_ring.png",ringInner:1.5,ringOuter:2.4,axialTilt:.45},mars:{body:"/textures/mars.jpg",axialTilt:.4},earth:{body:"/textures/earth.jpg",cloud:"/textures/earth_clouds.png",axialTilt:.41},jupiter:{body:"/textures/jupiter.jpg",axialTilt:.05},moon:{body:"/textures/moon.jpg",axialTilt:.1}};function zH({advisor:n,index:e,total:t}){const i=V.useRef(null),r=V.useMemo(()=>e/Math.max(1,t)*Math.PI*2,[e,t]),s=we(h=>h.selectAdvisor),o=we(h=>h.selectedAdvisorId===n.id),a=V.useRef(r);Ti((h,p)=>{we.getState().motionEnabled&&(a.current+=p*.18);const v=a.current;i.current&&i.current.position.set(Math.cos(v)*Em,0,Math.sin(v)*Em)});const c=V.useRef(1);Ti(()=>{const h=we.getState(),p=!!(h.selectedSessionId||h.selectedAdvisorId||h.selectedSkillId),v=h.selectedAdvisorId===n.id||n.pinnedSessionId&&h.selectedSessionId===n.pinnedSessionId,x=p&&!v?.25:1;c.current=Eo.lerp(c.current,x,.08)});const d=h=>{h.stopPropagation(),s(n.id)},f=n.texturePack?FH[n.texturePack]:void 0;return E.jsxs("group",{ref:i,children:[f?E.jsx(V.Suspense,{fallback:E.jsx(xb,{advisor:n,onClick:d,dimRef:c}),children:E.jsx(BH,{advisor:n,pack:f,onClick:d,dimRef:c})}):E.jsx(xb,{advisor:n,onClick:d,dimRef:c}),E.jsx(ER,{radius:Ma,color:n.color,intensity:n.pinned?1.4:.7,power:3.5}),E.jsx(hS,{center:!0,distanceFactor:9,style:{pointerEvents:"none",userSelect:"none"},position:[0,Ma+.32,0],children:E.jsxs("div",{className:`px-1.5 py-0.5 rounded text-[9px] whitespace-nowrap border ${o?"bg-amber-400/20 border-amber-300 text-amber-100":"bg-black/60 border-white/10 text-amber-100/80"}`,children:[E.jsx("span",{className:"mr-1",children:n.glyph}),n.codename,n.pinned&&E.jsx("span",{className:"ml-1 text-amber-300",children:"●"})]})})]})}function BH({advisor:n,pack:e,onClick:t,dimRef:i}){const r=V.useRef(null),s=V.useRef(null),o=V.useRef(null),a=V.useRef(null),c=V.useRef(null),d=V.useRef(null),f=Is(bo,e.body),h=Is(bo,e.cloud??"/textures/sun.jpg"),p=Is(bo,e.ring??"/textures/sun.jpg");f.wrapS=Fs,f.wrapT=Fs,Ti((M,g)=>{we.getState().motionEnabled&&(r.current&&(r.current.rotation.y+=g*.18),s.current&&(s.current.rotation.y+=g*.25),o.current&&(o.current.rotation.z+=g*.05));const S=i.current;a.current&&(a.current.opacity=S,a.current.transparent=S<.99),c.current&&(c.current.opacity=.55*S),d.current&&(d.current.opacity=.85*S)});const v=e.axialTilt??0,x=(e.ringInner??1.5)*Ma,w=(e.ringOuter??2.4)*Ma;return E.jsxs("group",{rotation:[v,0,0],children:[E.jsxs("mesh",{ref:r,onClick:t,children:[E.jsx("sphereGeometry",{args:[Ma,48,48]}),E.jsx("meshStandardMaterial",{ref:a,map:f,roughness:.85,metalness:.05,emissive:new De(n.color),emissiveIntensity:n.pinned?.25:.1,transparent:!0,opacity:1})]}),e.cloud&&E.jsxs("mesh",{ref:s,children:[E.jsx("sphereGeometry",{args:[Ma*1.02,48,48]}),E.jsx("meshStandardMaterial",{ref:c,map:h,transparent:!0,opacity:.55,depthWrite:!1,roughness:1})]}),e.ring&&E.jsxs("mesh",{ref:o,rotation:[Math.PI/2,0,0],children:[E.jsx("ringGeometry",{args:[x,w,96]}),E.jsx("meshStandardMaterial",{ref:d,map:p,transparent:!0,opacity:.85,side:Jn,depthWrite:!1,roughness:1})]})]})}function xb({advisor:n,onClick:e,dimRef:t}){const i=V.useRef(null),r=V.useRef(null),s=V.useMemo(()=>new De(n.color),[n.color]);return Ti((o,a)=>{if(we.getState().motionEnabled&&i.current&&(i.current.rotation.y+=a*.4),r.current){const d=t.current,f=n.pinned?.6:.22;r.current.emissiveIntensity=Eo.lerp(r.current.emissiveIntensity,f*d,.05),r.current.opacity=d,r.current.transparent=d<.99}}),E.jsxs("mesh",{ref:i,onClick:e,children:[E.jsx("sphereGeometry",{args:[Ma,24,24]}),E.jsx("meshStandardMaterial",{ref:r,color:s,emissive:s,emissiveIntensity:.22,roughness:.55,metalness:.4,transparent:!0,opacity:1})]})}function HH(){const n=we(gH);return n.length?E.jsxs("group",{children:[E.jsxs("mesh",{rotation:[Math.PI/2,0,0],children:[E.jsx("ringGeometry",{args:[Em-.03,Em+.03,128]}),E.jsx("meshBasicMaterial",{color:"#fbbf24",transparent:!0,opacity:.12,side:Jn})]}),n.map((e,t)=>E.jsx(zH,{advisor:e,index:t,total:n.length},e.id))]}):null}const VH=22,GH=1.6,jH=.2;function WH(n){switch(n){case"anthropic":return new De("#94a3b8");case"solix":return new De("#a855f7");case"user":return new De("#06b6d4");default:return new De("#cbd5e1")}}const Ll=new It;function XH(){const n=we(vH),e=we(c=>c.selectSkill),t=we(c=>c.selectedSkillId),i=V.useRef(null),r=V.useMemo(()=>n.map((c,d)=>{const f=d/Math.max(1,n.length)*Math.PI*2,h=(c.id.charCodeAt(0)??0)%13/13-.5,p=VH+h*GH,v=Math.sin(f*1.7+(c.id.charCodeAt(1)??0))*.3+Math.tan(jH)*Math.sin(f)*.4,x=.18+c.id.length%5*.04,w=new ei;return w.setFromAxisAngle(new F(1,.4,.1).normalize(),f*1.3),{angle:f,radius:p,y:v,size:x,rot:w,color:WH(c.source),skill:c}}),[n]),s=V.useRef(0),o=V.useRef(0);if(Ti((c,d)=>{if(!i.current||!r.length)return;we.getState().motionEnabled&&(s.current+=d*.04,o.current+=d*.8);const h=s.current,p=o.current;for(let v=0;v<r.length;v++){const x=r[v],w=x.angle+h;Ll.position.set(Math.cos(w)*x.radius,x.y,Math.sin(w)*x.radius),Ll.quaternion.copy(x.rot),Ll.rotateY(p+v);const g=t===x.skill.id?x.size*1.6:x.size;Ll.scale.set(g,g,g),Ll.updateMatrix(),i.current.setMatrixAt(v,Ll.matrix),i.current.setColorAt(v,x.color)}i.current.instanceMatrix.needsUpdate=!0,i.current.instanceColor&&(i.current.instanceColor.needsUpdate=!0)}),!r.length)return null;const a=c=>{c.stopPropagation();const d=c.instanceId;if(typeof d!="number")return;const f=r[d];f&&e(f.skill.id)};return E.jsxs("instancedMesh",{ref:i,args:[void 0,void 0,r.length],onClick:a,children:[E.jsx("icosahedronGeometry",{args:[1,0]}),E.jsx("meshStandardMaterial",{roughness:.85,metalness:.05})]})}function YH(){const n=we(r=>r.projects),e=we(Sg),t=we(vS),i=V.useMemo(()=>{const r=[...e,...t],s=new Map;for(const o of r){const a=n[o.projectId];if(!a)continue;const c=s.get(a.id);c?c.sessions.push(o):s.set(a.id,{project:a,sessions:[o]})}return[...s.values()]},[e,t,n]);return i.length<2?E.jsx(E.Fragment,{}):E.jsx(E.Fragment,{children:i.map(({project:r,sessions:s})=>{const o=s.reduce((h,p)=>Math.max(h,p.orbitSlot),0),a=yS(o,s[0].id,r.id),c=Mg(o)+1.2,d=Math.cos(a)*c,f=Math.sin(a)*c;return E.jsx(hS,{position:[d,1.6,f],center:!0,distanceFactor:14,style:{pointerEvents:"none",userSelect:"none"},children:E.jsxs("div",{className:"px-2 py-1 rounded text-[9px] uppercase tracking-widest border border-solix-accent/30 bg-black/50 text-solix-accent/80 whitespace-nowrap",children:[r.name,E.jsxs("span",{className:"ml-1.5 text-slate-500",children:["· ",s.length]})]})},r.id)})})}const Wt={controls:null,camera:null,initialPosition:null,initialTarget:null};function qH(n,e){Wt.controls=n,Wt.camera=e,e&&!Wt.initialPosition&&(Wt.initialPosition=e.position.clone()),n&&!Wt.initialTarget&&(Wt.initialTarget=n.target.clone())}function KH(){Wt.controls=null,Wt.camera=null}const AR=1.18,yb=2.5;function CR(n=AR){if(!Wt.controls||!Wt.camera)return;const e=new F().subVectors(Wt.controls.target,Wt.camera.position).multiplyScalar(1-1/n);Wt.camera.position.add(e),Wt.controls.update()}function ZH(n=AR){CR(1/n)}function Eg(n,e){if(!Wt.controls||!Wt.camera)return;const t=Wt.camera,i=new F().subVectors(Wt.controls.target,t.position).normalize(),r=new F().crossVectors(i,t.up).normalize(),s=new F().crossVectors(r,i).normalize(),o=new F().addScaledVector(r,n*yb).addScaledVector(s,e*yb);t.position.add(o),Wt.controls.target.add(o),Wt.controls.update()}const $H=()=>Eg(-1,0),JH=()=>Eg(1,0),QH=()=>Eg(0,1),eV=()=>Eg(0,-1);function tV(){!Wt.controls||!Wt.camera||(Wt.initialPosition&&Wt.camera.position.copy(Wt.initialPosition),Wt.initialTarget&&Wt.controls.target.copy(Wt.initialTarget),Wt.controls.update())}const nV="/textures/milky_way.jpg";function iV(){const n=we(Sg),e=we(vS),t=we(a=>a.selectSession),i=we(a=>a.selectAdvisor),r=we(a=>a.selectSkill),s=[...n,...e],o=Array.from(new Set(s.map(a=>a.orbitSlot))).sort((a,c)=>a-c);return E.jsxs(VB,{shadows:!1,camera:{position:[0,14,22],fov:55,near:.1,far:600},onPointerMissed:()=>{t(null),i(null),r(null)},children:[E.jsx("color",{attach:"background",args:["#05060c"]}),E.jsx("fog",{attach:"fog",args:["#080a14",60,280]}),E.jsx("ambientLight",{intensity:.18}),E.jsx(V.Suspense,{fallback:E.jsx(f4,{radius:180,depth:80,count:6e3,factor:4,saturation:.4,fade:!0,speed:0}),children:E.jsx(rV,{})}),E.jsx(wH,{}),E.jsx(yH,{}),E.jsx(HH,{}),E.jsx(XH,{}),o.map(a=>E.jsx(LH,{orbitSlot:a},a)),s.map(a=>E.jsx(NH,{session:a},a.id)),E.jsx(OH,{}),E.jsx(YH,{}),E.jsx(sV,{}),E.jsx(iH,{multisampling:4,children:E.jsx(oH,{intensity:1.1,luminanceThreshold:.55,luminanceSmoothing:.2,mipmapBlur:!0})})]})}function rV(){const n=V.useRef(null),e=pS(nV);return E.jsxs("mesh",{ref:n,scale:[-1,1,1],children:[E.jsx("sphereGeometry",{args:[400,48,32]}),E.jsx("meshBasicMaterial",{map:e,side:bn,toneMapped:!1})]})}function sV(){const n=V.useRef(null),{camera:e}=Zi();return V.useEffect(()=>(qH(n.current,e),()=>KH()),[e]),E.jsx(c4,{ref:n,makeDefault:!0,enablePan:!0,enableZoom:!0,enableRotate:!0,minDistance:6,maxDistance:140,target:[0,0,0]})}const _b={awaiting_permission:0,awaiting_input:1,plan_review:2,error:3,active:4,spawning:5,idle:6,terminated:7};function oV(){const n=we(Sg),e=we(vS),t=we(b=>b.projects),i=we(b=>b.missions),r=we(b=>b.pendingPermissions),s=we(b=>b.selectSession),o=we(b=>b.selectedSessionIds),a=we(b=>b.toggleSessionSelection),c=we(b=>b.clearSessionSelection),d=we(b=>b.terminateSessions),[f,h]=V.useState("needs"),[p,v]=V.useState("asc"),x=V.useMemo(()=>{const b=[...n,...e],N=new Set(Object.values(r).map(A=>A.sessionId));return b.map(A=>{const I=A.currentMissionId?i[A.currentMissionId]:void 0,L=Object.values(r).filter(U=>U.sessionId===A.id).length,{score:P,reasons:C}=bR(A,I,L);return{session:A,project:t[A.projectId],mission:I,needsAttention:N.has(A.id)||A.status==="awaiting_permission"||A.status==="awaiting_input"||A.status==="plan_review",health:P,healthReasons:C}})},[n,e,t,i,r]),w=V.useMemo(()=>{var N;const b=new Map;for(const A of x){const I=((N=A.project)==null?void 0:N.id)??"_",L=b.get(I);L?L.rows.push(A):b.set(I,{project:A.project,rows:[A]})}return[...b.values()].sort((A,I)=>{var L,P;return(((L=I.project)==null?void 0:L.lastActiveAt)??0)-(((P=A.project)==null?void 0:P.lastActiveAt)??0)})},[x]),M=(b,N)=>{var I,L;const A=p==="asc"?1:-1;switch(f){case"name":return((b.session.name??b.session.id)>(N.session.name??N.session.id)?1:-1)*A;case"status":return((_b[b.session.status]??99)-(_b[N.session.status]??99))*A;case"progress":return((((I=b.mission)==null?void 0:I.metrics.toolCallCount)??0)-(((L=N.mission)==null?void 0:L.metrics.toolCallCount)??0))*A;case"context":return(b.session.contextUsagePct-N.session.contextUsagePct)*A;case"lastActivity":return(b.session.updatedAt-N.session.updatedAt)*A;case"needs":return b.needsAttention===N.needsAttention?0:b.needsAttention?-1*A:1*A;case"health":return(b.health-N.health)*A}},g=b=>{f===b?v(p==="asc"?"desc":"asc"):(h(b),v(b==="lastActivity"?"desc":"asc"))},_=b=>f!==b?"":p==="asc"?" ▲":" ▼",S=o.size;return E.jsxs("div",{className:"absolute inset-0 overflow-y-auto bg-solix-bg pt-20 pb-20 px-6 z-0",children:[S>0&&E.jsx("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-30 pointer-events-auto",children:E.jsxs("div",{className:"rounded-full border border-solix-accent/60 bg-solix-panel/95 backdrop-blur shadow-2xl px-4 py-2 flex items-center gap-3",children:[E.jsxs("span",{className:"text-xs text-slate-200 font-mono",children:[S," selected"]}),E.jsx("button",{onClick:()=>d([...o]),className:"text-xs px-3 py-1 rounded border border-solix-danger text-solix-danger hover:bg-solix-danger/15",children:"Terminate"}),E.jsx("button",{onClick:c,className:"text-xs text-slate-400 hover:text-slate-200",children:"Clear"})]})}),E.jsxs("div",{className:"max-w-6xl mx-auto",children:[E.jsxs("div",{className:"text-xs text-slate-500 uppercase tracking-widest mb-3",children:["List view · ",x.length," agent",x.length===1?"":"s"]}),x.length===0?E.jsxs("div",{className:"text-sm text-slate-500 italic py-12 text-center border border-solix-border rounded",children:["No agents yet. Run ",E.jsx("code",{children:"claude"})," in any terminal — a row will appear here within a second."]}):w.map(({project:b,rows:N})=>{const A=[...N].sort(M),I=(b==null?void 0:b.name)??"(unassigned)";return E.jsxs("section",{className:"mb-8 rounded border border-solix-border overflow-hidden",children:[E.jsxs("header",{className:"bg-solix-panel/60 px-4 py-2 flex items-center justify-between",children:[E.jsxs("div",{children:[E.jsx("span",{className:"text-sm font-semibold text-slate-100",children:I}),E.jsxs("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-slate-500",children:[N.length," agent",N.length===1?"":"s"]})]}),(b==null?void 0:b.cwd)&&E.jsx("span",{className:"text-[10px] font-mono text-slate-500 truncate max-w-[55%]",children:b.cwd})]}),E.jsxs("table",{className:"w-full text-sm",children:[E.jsx("thead",{className:"bg-black/30 text-[10px] uppercase tracking-wide text-slate-500",children:E.jsxs("tr",{children:[E.jsx(Ms,{children:E.jsx("input",{type:"checkbox","aria-label":"Select all in project",checked:A.length>0&&A.every(L=>o.has(L.session.id)),onChange:L=>{L.stopPropagation();const P=A.every(C=>o.has(C.session.id));for(const C of A){const U=o.has(C.session.id);(P&&U||!P&&!U)&&a(C.session.id)}},className:"cursor-pointer"})}),E.jsxs(Ms,{onClick:()=>g("needs"),children:["● ",_("needs")]}),E.jsxs(Ms,{onClick:()=>g("name"),children:["Agent",_("name")]}),E.jsx(Ms,{children:"Advisor"}),E.jsxs(Ms,{onClick:()=>g("status"),children:["Status",_("status")]}),E.jsxs(Ms,{onClick:()=>g("health"),numeric:!0,children:["Health",_("health")]}),E.jsxs(Ms,{onClick:()=>g("progress"),children:["Mission · tools",_("progress")]}),E.jsxs(Ms,{onClick:()=>g("context"),numeric:!0,children:["Context",_("context")]}),E.jsxs(Ms,{onClick:()=>g("lastActivity"),numeric:!0,children:["Last activity",_("lastActivity")]})]})}),E.jsx("tbody",{children:A.map(L=>E.jsxs("tr",{onClick:()=>s(L.session.id),className:`border-t border-solix-border hover:bg-solix-border/20 cursor-pointer ${L.needsAttention?"bg-solix-danger/5":""} ${o.has(L.session.id)?"bg-solix-accent/5":""}`,children:[E.jsx("td",{className:"px-3 py-2",onClick:P=>P.stopPropagation(),children:E.jsx("input",{type:"checkbox","aria-label":"Select agent",checked:o.has(L.session.id),onChange:()=>a(L.session.id),className:"cursor-pointer"})}),E.jsx("td",{className:"px-3 py-2",children:L.needsAttention?E.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-solix-danger solix-pulse"}):L.session.status==="active"?E.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-solix-ok"}):E.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-slate-600"})}),E.jsx("td",{className:"px-3 py-2",children:E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"inline-block w-2 h-2 rounded-full",style:{background:wm(L.session.model)},title:String(L.session.model)}),E.jsx("span",{className:"text-slate-100 font-medium",children:L.session.name??L.session.id.slice(0,8)}),L.session.kind==="advisor"&&E.jsx("span",{className:"text-[9px] uppercase tracking-wide text-amber-300",children:"advisor"}),L.session.wrapperSocketPath&&E.jsx("span",{className:"text-[9px] uppercase tracking-wide text-solix-accent",title:"Wrapped by `solix run` — UI composer is enabled",children:"wrapped"}),L.session.worktreePath&&E.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded border border-solix-accent/40 text-solix-accent",title:L.session.worktreePath,children:["⌥",aV(L.session.worktreePath)]})]})}),E.jsx("td",{className:"px-3 py-2 text-xs",children:E.jsx(cV,{session:L.session,mission:L.mission})}),E.jsx("td",{className:"px-3 py-2 text-xs text-slate-300",title:wg[L.session.status]??void 0,children:xS(L.session.status)}),E.jsx("td",{className:"px-3 py-2 text-right",children:E.jsx(uV,{score:L.health,reasons:L.healthReasons})}),E.jsx("td",{className:"px-3 py-2 text-xs text-slate-300 truncate max-w-xs",children:L.mission?E.jsxs(E.Fragment,{children:[E.jsx("span",{className:"text-slate-100",children:L.mission.shortName}),E.jsxs("span",{className:"text-slate-500 ml-1",children:["· ",L.mission.metrics.toolCallCount," tools"]})]}):E.jsx("span",{className:"text-slate-500 italic",children:"idle"})}),E.jsx("td",{className:"px-3 py-2 text-right",children:E.jsx(dV,{pct:L.session.contextUsagePct})}),E.jsx("td",{className:"px-3 py-2 text-right text-[11px] text-slate-500 font-mono",children:fV(L.session.updatedAt)})]},L.session.id))})]})]},(b==null?void 0:b.id)??"_")})]})]})}function aV(n){const e=n.split("/").filter(Boolean);return e[e.length-1]??n}const lV=/^\[Acting as ([^\s—]+)/;function cV({session:n,mission:e}){var s;const t=we(o=>o.advisors);let i,r=!1;if(n.advisorRole)i=Object.values(t).find(o=>o.id===n.advisorRole);else if(e!=null&&e.prompt){const o=e.prompt.match(lV),a=(s=o==null?void 0:o[1])==null?void 0:s.toLowerCase();a&&(i=Object.values(t).find(c=>c.codename.toLowerCase()===a),r=!0)}return i?E.jsxs("span",{className:`inline-flex items-center gap-1 ${r?"opacity-60":""}`,title:i.description,children:[E.jsx("span",{style:{color:i.color},children:i.glyph}),E.jsx("span",{className:"text-slate-200",children:i.codename})]}):E.jsx("span",{className:"text-slate-700",children:"—"})}function Ms({children:n,onClick:e,numeric:t}){return E.jsx("th",{onClick:e,className:`px-3 py-2 select-none ${t?"text-right":"text-left"} ${e?"cursor-pointer hover:text-slate-300":""}`,children:n})}function uV({score:n,reasons:e}){const t=TR(n);return E.jsxs("div",{className:"relative inline-flex items-center gap-2 group",children:[E.jsx("span",{className:"text-[11px] font-mono font-bold",style:{color:t},children:n}),E.jsx("div",{className:"w-16 h-1.5 rounded-full bg-slate-800 overflow-hidden",children:E.jsx("div",{className:"h-full",style:{width:`${Math.max(2,n)}%`,background:t}})}),E.jsxs("div",{className:"pointer-events-none absolute right-0 top-full mt-1 z-50 hidden group-hover:block w-64 rounded border border-solix-border bg-solix-panel/95 backdrop-blur p-2 text-left shadow-xl",children:[E.jsxs("div",{className:"flex items-center justify-between mb-1",children:[E.jsx("span",{className:"text-[10px] uppercase tracking-wide text-slate-400",children:"Health"}),E.jsxs("span",{className:"text-xs font-bold",style:{color:t},children:[n,"/100"]})]}),e.length===0?E.jsx("div",{className:"text-[11px] text-slate-400 italic",children:"All four bands healthy: stable status, no pending decisions, context budget, mission progress."}):E.jsx("ul",{className:"space-y-0.5",children:e.map(i=>E.jsxs("li",{className:"text-[11px] text-slate-200 leading-snug",children:["· ",i]},i))})]})]})}function dV({pct:n}){const e=n>=90?"bg-solix-danger":n>=80?"bg-solix-warn":"bg-solix-accent";return E.jsxs("div",{className:"inline-flex items-center gap-2",children:[E.jsxs("span",{className:"text-[11px] text-slate-400 font-mono",children:[n.toFixed(0),"%"]}),E.jsx("div",{className:"w-20 h-1.5 rounded-full bg-slate-800 overflow-hidden",children:E.jsx("div",{className:`h-full ${e}`,style:{width:`${Math.min(100,n)}%`}})})]})}function fV(n){const e=Date.now()-n;if(e<0)return"now";const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m`;const r=Math.floor(i/60);return r<24?`${r}h`:new Date(n).toLocaleDateString()}function hV(){const n=we(c=>c.missions),e=we(c=>c.sessions),t=we(c=>c.projects),i=we(c=>c.selectSession),[r,s]=V.useState("all"),o=V.useMemo(()=>{const c=Object.values(n).sort((d,f)=>f.startedAt-d.startedAt);return r==="all"?c:c.filter(d=>d.status===r)},[n,r]),a=V.useMemo(()=>{const c=new Map;for(const d of o){const f=e[d.sessionId],h=f?t[f.projectId]:void 0,p=(h==null?void 0:h.id)??"_",v=c.get(p);v?v.missions.push(d):c.set(p,{project:h,missions:[d]})}return[...c.values()].sort((d,f)=>{var h,p;return(((h=f.missions[0])==null?void 0:h.startedAt)??0)-(((p=d.missions[0])==null?void 0:p.startedAt)??0)})},[o,e,t]);return E.jsx("div",{className:"absolute inset-0 overflow-y-auto bg-solix-bg pt-20 pb-8 px-6 z-0",children:E.jsxs("div",{className:"max-w-4xl mx-auto",children:[E.jsxs("div",{className:"flex items-center justify-between mb-3",children:[E.jsxs("div",{className:"text-xs text-slate-500 uppercase tracking-widest",children:["Missions · ",o.length]}),E.jsx("div",{className:"flex items-center gap-1.5",children:["all","active","completed","failed","cancelled"].map(c=>E.jsx("button",{onClick:()=>s(c),className:`text-[10px] px-2 py-0.5 rounded border ${r===c?"bg-solix-accent/15 border-solix-accent text-solix-accent":"border-solix-border text-slate-400 hover:text-slate-200"}`,children:c},c))})]}),o.length===0?E.jsx("div",{className:"text-sm text-slate-500 italic py-12 text-center border border-solix-border rounded",children:"No missions yet. Send a prompt to a Claude Code session and a mission card will appear here."}):a.map(({project:c,missions:d})=>{const f=(c==null?void 0:c.name)??"(unassigned)";return E.jsxs("section",{className:"mb-6 rounded border border-solix-border overflow-hidden",children:[E.jsxs("header",{className:"bg-solix-panel/60 px-4 py-2 flex items-center justify-between",children:[E.jsxs("div",{children:[E.jsx("span",{className:"text-sm font-semibold text-slate-100",children:f}),E.jsxs("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-slate-500",children:[d.length," mission",d.length===1?"":"s"]})]}),(c==null?void 0:c.cwd)&&E.jsx("span",{className:"text-[10px] font-mono text-slate-500 truncate max-w-[55%]",children:c.cwd})]}),E.jsx("ul",{className:"divide-y divide-solix-border",children:d.map(h=>{const p=e[h.sessionId];return E.jsx("li",{children:E.jsxs("button",{onClick:()=>i(h.sessionId),className:"w-full text-left p-4 hover:bg-solix-border/20 cursor-pointer block",children:[E.jsxs("div",{className:"flex items-start justify-between gap-3",children:[E.jsxs("div",{className:"min-w-0 flex-1",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-sm font-semibold text-slate-100",children:h.shortName}),E.jsx(pV,{status:h.status})]}),E.jsx("div",{className:"mt-1 text-xs text-slate-400 line-clamp-2",children:h.prompt}),h.longSummary&&E.jsx("div",{className:"mt-1 text-xs text-slate-300 italic",children:h.longSummary}),h.status==="failed"&&h.errorSummary&&E.jsxs("div",{className:"mt-1 text-xs text-solix-danger italic line-clamp-2",children:["error: ",h.errorSummary]})]}),E.jsxs("div",{className:"text-right text-[10px] text-slate-500 font-mono whitespace-nowrap",children:[gV(h.startedAt),h.metrics.durationMs!==void 0&&E.jsxs("div",{children:[(h.metrics.durationMs/1e3).toFixed(1),"s"]})]})]}),E.jsxs("div",{className:"mt-2 flex items-center gap-3 text-[10px] text-slate-500",children:[p&&E.jsxs("span",{children:["agent:"," ",E.jsx("span",{className:"text-slate-300",children:p.name??p.id.slice(0,8)})]}),E.jsxs("span",{children:[h.metrics.toolCallCount," tools"]}),E.jsxs("span",{title:wg.subagent,children:[h.metrics.subagentCount," subagents"]}),E.jsxs("span",{children:[h.filesTouched.length," files"]})]}),h.filesTouched.length>0&&E.jsxs("div",{className:"mt-2 flex flex-wrap gap-1",children:[h.filesTouched.slice(0,6).map(v=>E.jsx("span",{className:"text-[10px] font-mono text-slate-400 bg-black/30 border border-solix-border rounded px-1.5 py-0.5",children:mV(v)},v)),h.filesTouched.length>6&&E.jsxs("span",{className:"text-[10px] text-slate-500",children:["+",h.filesTouched.length-6]})]})]})},h.id)})})]},(c==null?void 0:c.id)??"_")})]})})}function pV({status:n}){const e=n==="active"?"border-solix-warn text-solix-warn":n==="completed"?"border-solix-ok text-solix-ok":n==="failed"?"border-solix-danger text-solix-danger":"border-solix-border text-slate-400";return E.jsx("span",{className:`text-[9px] uppercase tracking-wide px-1.5 py-0.5 rounded border ${e}`,children:n})}function mV(n){const e=n.match(/[^/\\]+\/?$/);return e?e[0].replace(/\/$/,""):n}function gV(n){const e=Date.now()-n;if(e<0)return"now";const t=Math.floor(e/1e3);if(t<60)return`${t}s ago`;const i=Math.floor(t/60);if(i<60)return`${i}m ago`;const r=Math.floor(i/60);return r<24?`${r}h ago`:new Date(n).toLocaleDateString()}const vV=[1,4,16,64];function xV({open:n,onClose:e}){const t=we(M=>M.playback),i=we(M=>M.enterPlayback),r=we(M=>M.exitPlayback),s=we(M=>M.setPlaybackTime),o=we(M=>M.setPlaybackSpeed),a=we(M=>M.setPlaybackPlaying),c=we(M=>M.setPlaybackLoading),[d,f]=V.useState(30);V.useEffect(()=>{if(!n||t.active&&t.events.length>0)return;c(!0);const M=Date.now()-d*60*1e3;fetch(`/api/timeline?sinceMs=${M}&untilMs=${Date.now()}`).then(g=>g.json()).then(g=>{if(g.events.length===0){c(!1),i([],Date.now()-6e4,Date.now());return}i(g.events,g.earliest,g.latest)}).catch(g=>{console.warn("[timeline] fetch failed",g),c(!1)})},[n,d]);const h=V.useRef(0);if(V.useEffect(()=>{if(!t.active||!t.playing)return;let M=0;const g=_=>{const S=h.current?_-h.current:16;h.current=_;const b=t.currentMs+S*t.speed;b>=t.latestMs?(s(t.latestMs),a(!1)):(s(b),M=requestAnimationFrame(g))};return M=requestAnimationFrame(g),()=>{cancelAnimationFrame(M),h.current=0}},[t.active,t.playing,t.speed,t.latestMs]),!n)return null;const p=()=>{r(),e()},v=Math.max(1,t.latestMs-t.earliestMs),x=t.active?(t.currentMs-t.earliestMs)/v*100:0,w=t.events.filter(M=>M.ts<=t.currentMs);return E.jsx("div",{className:"absolute bottom-0 inset-x-0 z-30 bg-solix-panel/95 backdrop-blur border-t border-solix-border",children:E.jsxs("div",{className:"px-4 py-3 max-w-6xl mx-auto",children:[E.jsxs("div",{className:"flex items-center justify-between mb-2",children:[E.jsxs("div",{className:"flex items-center gap-3",children:[E.jsx("span",{className:"text-xs uppercase tracking-widest text-solix-accent",children:"▸ Playback"}),E.jsxs("span",{className:"text-[10px] text-slate-400",children:[t.events.length," events · last ",d," min"]})]}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsxs("select",{value:d,onChange:M=>f(parseInt(M.target.value,10)),className:"text-[10px] bg-black/40 border border-solix-border rounded px-1.5 py-0.5 text-slate-300",children:[E.jsx("option",{value:5,children:"5 min"}),E.jsx("option",{value:15,children:"15 min"}),E.jsx("option",{value:30,children:"30 min"}),E.jsx("option",{value:60,children:"1 hour"}),E.jsx("option",{value:180,children:"3 hours"})]}),E.jsx("button",{onClick:p,className:"text-slate-400 hover:text-slate-100 text-xs",children:"✕ Live"})]})]}),E.jsxs("div",{className:"flex items-center gap-3",children:[E.jsx("button",{onClick:()=>a(!t.playing),disabled:!t.active||t.events.length===0,className:"w-8 h-8 rounded-full bg-solix-accent/20 border border-solix-accent text-solix-accent text-sm hover:bg-solix-accent/30 disabled:opacity-40 flex items-center justify-center",children:t.playing?"⏸":"▶"}),E.jsxs("div",{className:"flex-1 relative",children:[E.jsx("input",{type:"range",min:t.earliestMs,max:t.latestMs,value:t.currentMs,onChange:M=>s(parseInt(M.target.value,10)),className:"w-full",disabled:!t.active}),E.jsx("div",{className:"absolute -top-1.5 h-0.5 bg-solix-accent/40 pointer-events-none",style:{left:0,width:`${x}%`}})]}),E.jsx("div",{className:"flex items-center gap-1",children:vV.map(M=>E.jsxs("button",{onClick:()=>o(M),className:`text-[10px] px-1.5 py-0.5 rounded border ${t.speed===M?"bg-solix-accent/20 border-solix-accent text-solix-accent":"border-solix-border text-slate-400 hover:text-slate-200"}`,children:[M,"×"]},M))})]}),E.jsxs("div",{className:"mt-2 flex items-center justify-between text-[10px] text-slate-500 font-mono",children:[E.jsx("span",{children:rx(t.earliestMs)}),E.jsxs("span",{className:"text-solix-accent",children:[rx(t.currentMs)," · ",w.length," events"]}),E.jsx("span",{children:rx(t.latestMs)})]}),t.loading&&E.jsx("div",{className:"text-center text-xs text-slate-500 italic mt-2",children:"Loading timeline…"}),!t.loading&&t.events.length===0&&t.active&&E.jsx("div",{className:"text-center text-xs text-slate-500 italic mt-2",children:"No events in this range. Try a longer window or run some agents first."})]})})}function rx(n){return n?new Date(n).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}):"—"}function yV({onOpenGalaxy:n,onNewTask:e,onOpenTimeline:t,onOpenHelp:i}={}){const r=we(f=>f.connected),s=we(Sg),o=we(f=>f.viewMode),a=we(f=>f.playback.active),c=we(f=>f.exitPlayback),d=s.reduce((f,h)=>(h.status==="active"?f.active+=1:h.status==="awaiting_permission"||h.status==="awaiting_input"||h.status==="plan_review"?f.attention+=1:h.status==="idle"&&(f.idle+=1),f),{active:0,idle:0,attention:0});return E.jsxs("div",{className:"pointer-events-none absolute inset-x-0 top-0 flex items-start justify-between p-4 z-40",children:[E.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 sm:gap-3",children:[E.jsx("div",{className:"text-xl font-bold tracking-widest text-solix-accent",children:"SOLIX"}),E.jsx("div",{className:"hidden md:block text-xs text-slate-400",children:"a solar-system command center"}),E.jsx("div",{className:`ml-1 sm:ml-3 px-2 py-1 rounded text-[10px] border ${r?"border-solix-ok text-solix-ok":"border-solix-danger text-solix-danger solix-pulse"}`,children:r?"CONNECTED":"OFFLINE"}),a&&E.jsxs("button",{onClick:c,className:"ml-2 px-2 py-1 rounded text-[10px] border border-solix-accent text-solix-accent solix-pulse hover:bg-solix-accent/15 cursor-pointer flex items-center gap-1.5",title:"Exit Timeline Playback (Esc)","aria-label":"Exit playback",children:[E.jsx("span",{children:"▸ PLAYBACK"}),E.jsx("span",{className:"opacity-70",children:"· exit ✕"})]})]}),E.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 sm:gap-3 text-xs",children:[E.jsxs("div",{className:"hidden sm:flex items-center gap-2",children:[E.jsx(sx,{label:"active",value:d.active,color:"text-solix-ok"}),E.jsx(sx,{label:"attention",value:d.attention,color:"text-solix-warn"}),E.jsx(sx,{label:"idle",value:d.idle,color:"text-slate-400"})]}),E.jsx(_V,{viewMode:o}),t&&E.jsx("button",{onClick:t,className:"hidden sm:inline-block px-2 py-1 rounded bg-solix-panel border border-solix-border text-slate-300 hover:text-white hover:bg-solix-border/30",title:"Timeline playback (T)",children:"⏱ Timeline"}),e&&E.jsx("button",{onClick:e,className:"px-2 py-1 rounded bg-solix-ok/15 border border-solix-ok/40 text-solix-ok hover:bg-solix-ok/25",title:"Launch a new Claude Code task (L)",children:"+ Task"}),n&&E.jsx("button",{onClick:n,className:"px-2 py-1 rounded bg-solix-accent/15 border border-solix-accent/40 text-solix-accent hover:bg-solix-accent/25",title:"Galaxy: export and import (G)",children:"⌬ Galaxy"}),i&&E.jsx("button",{onClick:i,className:"w-7 h-7 rounded-full bg-solix-panel border border-solix-border text-slate-300 hover:text-white hover:bg-solix-border/30 text-sm",title:"Help (?)","aria-label":"Help",children:"?"})]})]})}function _V({viewMode:n}){const e=we(i=>i.setViewMode),t=[{mode:"galaxy",label:"🪐"},{mode:"list",label:"☰"},{mode:"missions",label:"◎"}];return E.jsx("div",{className:"inline-flex rounded border border-solix-border bg-solix-panel overflow-hidden",children:t.map(i=>E.jsxs("button",{onClick:()=>e(i.mode),className:`px-2 py-1 text-xs ${n===i.mode?"bg-solix-border/50 text-white":"text-slate-400 hover:text-slate-100"}`,title:`${i.mode} view (V)`,children:[i.label," ",E.jsx("span",{className:"hidden sm:inline capitalize",children:i.mode})]},i.mode))})}function sx({label:n,value:e,color:t}){return E.jsxs("div",{className:"px-2 py-1 rounded bg-solix-panel border border-solix-border",children:[E.jsx("span",{className:`font-bold ${t}`,children:e}),E.jsx("span",{className:"ml-1 opacity-60 uppercase tracking-wide",children:n})]})}function SV(){const n=we(t=>t.toasts),e=we(t=>t.dismissToast);return E.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex flex-col gap-2 z-30",children:n.map(t=>E.jsx("button",{onClick:()=>e(t.id),className:`pointer-events-auto px-3 py-2 rounded text-xs border max-w-md text-left ${t.level==="error"?"bg-solix-danger/10 border-solix-danger text-solix-danger":t.level==="warn"?"bg-solix-warn/10 border-solix-warn text-solix-warn":"bg-solix-panel border-solix-border text-slate-200"}`,children:t.message},t.id))})}const Sb="solix.welcome.dismissed.v1";function MV({onOpenGalaxy:n,forceOpen:e=!1,onClose:t}){const[i,r]=V.useState(!1),s=we(f=>f.advisors),o=we(f=>Object.keys(f.skills).length),a=we(f=>Object.keys(f.sessions).length);if(V.useEffect(()=>{try{r(localStorage.getItem(Sb)==="1")}catch{}},[]),!e&&(i||a>0))return null;const c=()=>{try{localStorage.setItem(Sb,"1")}catch{}r(!0),t==null||t()},d=Object.values(s).filter(f=>f.enabled).sort((f,h)=>f.codename.localeCompare(h.codename));return E.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center pointer-events-none",children:E.jsxs("div",{className:"pointer-events-auto max-w-xl w-full mx-4 rounded-xl border border-solix-accent/40 bg-solix-panel/95 backdrop-blur-md shadow-2xl",children:[E.jsxs("div",{className:"px-6 pt-5 pb-3 border-b border-solix-border",children:[E.jsx("div",{className:"text-xs uppercase tracking-widest text-solix-accent",children:"welcome"}),E.jsx("div",{className:"text-2xl font-bold mt-1",children:"Solix — your agent solar system"}),E.jsx("div",{className:"text-sm text-slate-400 mt-1",children:"Mission control for Claude Code. Each agent orbits the sun; each click is a conversation with one of your planets."})]}),E.jsxs("div",{className:"px-6 py-4 space-y-3 text-sm text-slate-300",children:[E.jsx(yu,{n:1,title:"Run a Claude Code session",body:E.jsxs(E.Fragment,{children:["Open a terminal anywhere and run"," ",E.jsx("code",{className:"bg-black/40 px-1 rounded",children:"claude"}),". A planet will appear here within a second."]})}),E.jsx(yu,{n:2,title:"Or seed the demo state",body:E.jsxs(E.Fragment,{children:["In another terminal:"," ",E.jsx("code",{className:"bg-black/40 px-1 rounded",children:"solix demo"}),". You'll get 3 planets, a moon, a permission flare, and a pinned advisor — without running Claude Code."]})}),E.jsx(yu,{n:3,title:"Meet the advisor crew",body:E.jsxs(E.Fragment,{children:[d.length>0?`${d.length} crew members loaded. Click any in the inner ring to read their role and invoke them on the focused planet.`:"Crew loading…",d.length>0&&E.jsx("ul",{className:"mt-2 space-y-1",children:d.map(f=>E.jsxs("li",{className:"flex items-baseline gap-2",children:[E.jsxs("span",{className:"font-mono text-xs",style:{color:f.color},children:[f.glyph," ",f.codename]}),E.jsx("span",{className:"text-slate-500 text-xs",children:"—"}),E.jsx("span",{className:"text-slate-300 text-xs",children:f.name})]},f.id))})]})}),E.jsx(yu,{n:4,title:"Browse the asteroid belt",body:E.jsxs(E.Fragment,{children:["Each asteroid is a Skill (",o," discovered). Click one to read its SKILL.md and see which advisors require it."]})}),E.jsx(yu,{n:5,title:"Share your galaxy",body:E.jsxs(E.Fragment,{children:["Press"," ",E.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-black/50 border border-solix-border text-[10px]",children:"G"})," ","or click ",E.jsx("span",{className:"text-solix-accent",children:"⌬ Galaxy"})," ","in the top bar to export, import, publish, or install a galaxy from a registry."]})})]}),E.jsxs("div",{className:"px-6 pb-3 pt-1",children:[E.jsx("div",{className:"text-[10px] uppercase tracking-widest text-slate-500 mb-1.5",children:"Keyboard shortcuts"}),E.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px] text-slate-400",children:[E.jsx($r,{k:"V",children:"cycle Galaxy → List → Missions"}),E.jsx($r,{k:"G",children:"toggle Galaxy panel"}),E.jsx($r,{k:"L",children:"new task"}),E.jsx($r,{k:"T",children:"timeline"}),E.jsx($r,{k:"M",children:"jump to Missions"}),E.jsx($r,{k:"Y",children:"approve top decision"}),E.jsx($r,{k:"N",children:"deny top decision"}),E.jsx($r,{k:"Space",children:"play / pause orbits"}),E.jsx($r,{k:"?",children:"re-open this help"}),E.jsx($r,{k:"Esc",children:"close panels / exit playback"})]}),E.jsx("div",{className:"text-[10px] text-slate-500 italic mt-2",children:"If clicks feel stuck, a third-party screen overlay (note-taker, recorder) may be intercepting. Quit it temporarily, or use the shortcuts above."})]}),E.jsxs("div",{className:"px-6 py-3 border-t border-solix-border flex items-center gap-2",children:[E.jsx("button",{onClick:()=>{n(),c()},className:"px-3 py-1.5 rounded bg-solix-accent/15 border border-solix-accent/40 text-solix-accent text-xs hover:bg-solix-accent/25",children:"Open Galaxy panel"}),E.jsx("div",{className:"flex-1"}),E.jsx("button",{onClick:c,className:"px-3 py-1.5 rounded border border-solix-border text-xs text-slate-300 hover:text-white",children:"Got it"})]})]})})}function $r({k:n,children:e}){return E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("kbd",{className:"shrink-0 px-1.5 py-0.5 rounded bg-black/50 border border-solix-border text-[10px] font-mono text-slate-300",children:n}),E.jsx("span",{className:"truncate",children:e})]})}function yu({n,title:e,body:t}){return E.jsxs("div",{className:"flex gap-3",children:[E.jsx("div",{className:"shrink-0 w-6 h-6 rounded-full bg-solix-accent/20 border border-solix-accent/40 text-solix-accent text-xs flex items-center justify-center",children:n}),E.jsxs("div",{children:[E.jsx("div",{className:"text-slate-100 font-medium text-sm",children:e}),E.jsx("div",{className:"text-slate-400 text-xs mt-0.5 leading-relaxed",children:t})]})]})}function wV(n,e,t,i){const r=ox(i,"command"),s=ox(i,"file_path"),o=ox(i,"url");if(t==="Bash"&&r){if(/\brm\s+-rf\b/i.test(r)||/\bsudo\b/i.test(r))return{severity:"danger",text:"Destructive command. Deny unless you have already confirmed the diff."};if(/--no-verify\b/.test(r))return{severity:"warn",text:"Skipping pre-commit hooks. Investigate the failure first."};if(/git\s+push.*--force\b/.test(r))return{severity:"danger",text:"Force-push. Confirm no one else has pushed since."};if(/git\s+push/.test(r)&&/\b(main|master|prod|production)\b/.test(r))return{severity:"warn",text:"Pushing to main/prod. Confirm the diff first."};if(/git\s+reset\s+--hard\b/.test(r))return{severity:"warn",text:"Hard reset will discard uncommitted changes. Stash first if unsure."}}if((t==="Edit"||t==="Write"||t==="MultiEdit")&&s){if(/\.env(\b|\.|\/)|credentials\.json|\.pem$|\.key$/i.test(s))return{severity:"danger",text:"Editing a secrets file. Make sure the agent really needs to."};if(/(^|\/)\.git\//.test(s))return{severity:"warn",text:"Editing inside .git/. Almost certainly a mistake."}}if(t==="WebFetch"&&o){if(/^https?:\/\/(localhost|127\.0\.0\.1|0\.0\.0\.0)/.test(o))return null;if(/^http:\/\//.test(o))return{severity:"info",text:"Plain HTTP fetch. OK for known internal hosts."}}return n.contextUsagePct>=90?{severity:"warn",text:`Context at ${n.contextUsagePct.toFixed(0)}%. Run /compact before continuing.`}:null}function EV(n,e){return n.status==="error"?{severity:"danger",text:"Session is in error state. Check the chat tab and consider restarting."}:n.contextUsagePct>=90?{severity:"warn",text:`Context at ${n.contextUsagePct.toFixed(0)}%. Compact the conversation before the next prompt.`}:n.contextUsagePct>=80?{severity:"info",text:`Context at ${n.contextUsagePct.toFixed(0)}%. Watch out — output quality drops past 90.`}:e&&e.status==="active"&&e.metrics.toolCallCount===0&&Date.now()-e.startedAt>5*60*1e3?{severity:"info",text:"Active mission with no tool calls in 5+ minutes. Agent may be stuck."}:null}function ox(n,e){const t=n[e];return typeof t=="string"?t:null}function bV(){const n=we(f=>f.pendingPermissions),e=we(f=>f.sessions),t=we(f=>f.missions),i=we(f=>f.resolvePermission),r=we(f=>f.selectSession),s=Object.values(n).sort((f,h)=>h.receivedAt-f.receivedAt),[o,a]=V.useState(!1),c=s.length;V.useEffect(()=>{c>0&&a(!1)},[c]);const d=f=>{r(f),a(!0)};return c===0?E.jsx("div",{className:"absolute top-20 right-4 z-30 pointer-events-none",children:E.jsxs("div",{className:"pointer-events-auto rounded-full border border-solix-border bg-solix-panel/60 backdrop-blur px-3 py-1 text-[10px] text-slate-500 flex items-center gap-2",children:[E.jsx("span",{className:"uppercase tracking-widest",children:"decisions"}),E.jsx("span",{className:"font-bold",children:"0"}),E.jsx("span",{className:"italic opacity-80",children:"— all clear"})]})}):E.jsxs("div",{className:"absolute top-20 right-4 z-30 w-80 flex flex-col gap-2 pointer-events-none",children:[E.jsxs("div",{className:"pointer-events-auto rounded border border-solix-border bg-solix-panel/85 backdrop-blur px-3 py-2 flex items-center justify-between",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"text-[10px] uppercase tracking-widest text-slate-400",children:"Decisions"}),E.jsx("span",{className:"text-xs font-bold text-solix-danger",children:c})]}),E.jsx("button",{onClick:()=>a(f=>!f),className:"text-[10px] text-slate-400 hover:text-slate-100",children:o?"show":"hide"})]}),!o&&s.map(f=>{const h=e[f.sessionId],p=h!=null&&h.currentMissionId?t[h.currentMissionId]:void 0;return E.jsx(TV,{session:h,mission:p,tool:f.tool,args:f.args,onApprove:()=>i(f.requestId,!0),onDeny:()=>i(f.requestId,!1),onAsk:()=>d(f.sessionId)},f.requestId)})]})}function TV({session:n,mission:e,tool:t,args:i,onApprove:r,onDeny:s,onAsk:o}){const a=(n==null?void 0:n.name)??(n==null?void 0:n.id.slice(0,8))??"unknown agent",c=n!=null&&n.cwd?PV(n.cwd):"",d=n?wV(n,e,t,i):null;return E.jsxs("div",{className:"pointer-events-auto rounded border border-solix-danger bg-solix-danger/10 p-3 backdrop-blur shadow-lg",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("div",{className:"text-xs uppercase tracking-wide text-solix-danger",children:a}),c&&E.jsx("div",{className:"text-[10px] text-slate-500 truncate ml-2 max-w-[55%]",children:c})]}),e&&E.jsxs("div",{className:"mt-1 text-[11px] text-slate-400 italic truncate",children:["mission: ",e.shortName]}),E.jsxs("div",{className:"mt-2 text-sm text-slate-100",children:[E.jsx("span",{className:"font-semibold",children:t}),E.jsx("span",{className:"ml-1 text-slate-300 text-xs break-words",children:IV(i)})]}),E.jsx(AV,{tool:t,args:i}),d&&E.jsx(RV,{suggestion:d}),E.jsxs("div",{className:"mt-3 flex gap-1.5",children:[E.jsx("button",{onClick:r,className:"flex-1 py-1.5 rounded bg-solix-ok/20 border border-solix-ok text-solix-ok text-xs hover:bg-solix-ok/30",children:"Approve · Y"}),E.jsx("button",{onClick:s,className:"flex-1 py-1.5 rounded bg-solix-danger/20 border border-solix-danger text-solix-danger text-xs hover:bg-solix-danger/30",children:"Deny · N"}),E.jsx("button",{onClick:o,className:"px-2.5 py-1.5 rounded border border-solix-border text-slate-300 text-xs hover:text-white hover:bg-solix-border/30",title:"Open chat with this agent for context",children:"Ask"})]})]})}function AV({tool:n,args:e}){const[t,i]=V.useState(!1);if(n==="Bash"){const r=ao(e,"command")??"",s=ao(e,"description");return r?E.jsxs(ax,{label:"will run",children:[E.jsx("pre",{className:"whitespace-pre-wrap break-words font-mono text-[11px] text-slate-100",children:r}),s&&E.jsx("div",{className:"mt-1 text-[10px] text-slate-500 italic",children:s})]}):null}if(n==="Edit"||n==="NotebookEdit"){const r=ao(e,"file_path")??ao(e,"notebook_path"),s=ao(e,"old_string"),o=ao(e,"new_string");return!r&&!s&&!o?null:E.jsxs(ax,{label:"patch",children:[r&&E.jsx("div",{className:"font-mono text-[11px] text-solix-accent break-all",children:r}),s&&E.jsx(lx,{sign:"-",text:s,expanded:t,colorClass:"text-solix-danger bg-solix-danger/10"}),o&&E.jsx(lx,{sign:"+",text:o,expanded:t,colorClass:"text-solix-ok bg-solix-ok/10"}),(cx(s)||cx(o))&&E.jsx("button",{onClick:()=>i(a=>!a),className:"mt-1 text-[10px] text-slate-400 hover:text-slate-100",children:t?"collapse":"expand"})]})}if(n==="Write"){const r=ao(e,"file_path"),s=ao(e,"content")??"";return r?E.jsxs(ax,{label:"will write",children:[E.jsx("div",{className:"font-mono text-[11px] text-solix-accent break-all",children:r}),s&&E.jsx(lx,{sign:"+",text:s,expanded:t,colorClass:"text-solix-ok bg-solix-ok/10"}),cx(s)&&E.jsx("button",{onClick:()=>i(o=>!o),className:"mt-1 text-[10px] text-slate-400 hover:text-slate-100",children:t?"collapse":"expand"})]}):null}return null}function ax({label:n,children:e}){return E.jsxs("div",{className:"mt-2 rounded border border-solix-border bg-black/30 px-2 py-1.5",children:[E.jsx("div",{className:"text-[9px] uppercase tracking-wider text-slate-500 mb-1",children:n}),e]})}function lx({sign:n,text:e,expanded:t,colorClass:i}){const r=t?e:CV(e,240);return E.jsxs("pre",{className:`mt-1 px-1.5 py-1 rounded text-[11px] font-mono whitespace-pre-wrap break-words ${i}`,children:[E.jsx("span",{className:"opacity-50 mr-1",children:n}),r]})}function ao(n,e){const t=n[e];return typeof t=="string"?t:void 0}function cx(n){return!!(n&&n.length>240)}function CV(n,e){if(n.length<=e)return n;const t=Math.floor((e-3)/2);return`${n.slice(0,t)}
|
|
4188
4188
|
…
|
|
4189
4189
|
${n.slice(-t)}`}function RV({suggestion:n}){const e=n.severity==="danger"?"text-solix-danger border-solix-danger/40 bg-solix-danger/10":n.severity==="warn"?"text-solix-warn border-solix-warn/40 bg-solix-warn/10":"text-slate-300 border-solix-border bg-black/20";return E.jsxs("div",{className:`mt-2 px-2 py-1 rounded border text-[11px] leading-snug ${e}`,children:[E.jsx("span",{className:"font-semibold mr-1",children:"Suggested:"}),n.text]})}function PV(n){const e=n.match(/[^/\\]+\/?$/);return e?e[0].replace(/\/$/,""):n}function IV(n){const e=Object.keys(n);return e.length?e.slice(0,2).map(i=>{const r=n[i],s=typeof r=="string"?r:JSON.stringify(r);return`${i}=${s.length>40?s.slice(0,40)+"…":s}`}).join(" · "):""}const Mb="solix.scenehint.dismissed.v1";function NV(){const n=we(o=>o.motionEnabled),e=we(o=>o.viewMode),t=we(o=>o.toggleMotion),[i,r]=V.useState(!0);V.useEffect(()=>{try{r(localStorage.getItem(Mb)==="1")}catch{}},[]);const s=()=>{try{localStorage.setItem(Mb,"1")}catch{}r(!0)};return E.jsxs(E.Fragment,{children:[e==="galaxy"&&!i&&E.jsx("div",{className:"pointer-events-none absolute bottom-4 left-1/2 -translate-x-1/2 z-20",children:E.jsxs("div",{className:"pointer-events-auto rounded-full border border-solix-border bg-solix-panel/85 backdrop-blur px-3 py-1.5 text-[11px] text-slate-300 flex items-center gap-3",children:[E.jsxs("span",{children:[E.jsx("kbd",{className:"px-1 py-0.5 rounded bg-black/40 border border-solix-border text-[10px] mr-1",children:"drag"}),"pan"]}),E.jsxs("span",{children:[E.jsx("kbd",{className:"px-1 py-0.5 rounded bg-black/40 border border-solix-border text-[10px] mr-1",children:"scroll"}),"zoom"]}),E.jsxs("span",{children:[E.jsx("kbd",{className:"px-1 py-0.5 rounded bg-black/40 border border-solix-border text-[10px] mr-1",children:"space"}),"pause"]}),E.jsx("button",{onClick:s,className:"ml-1 text-slate-500 hover:text-slate-100","aria-label":"Dismiss hint",children:"✕"})]})}),E.jsx("div",{className:"pointer-events-none absolute bottom-4 right-4 z-20",children:E.jsx("button",{onClick:t,title:`${n?"Pause":"Play"} orbital motion (Space)`,className:`pointer-events-auto w-10 h-10 rounded-full text-base flex items-center justify-center border backdrop-blur transition-colors ${n?"bg-solix-accent/20 border-solix-accent text-solix-accent":"bg-solix-panel/80 border-solix-border text-slate-300 hover:bg-solix-border/40 hover:text-white"}`,children:n?"⏸":"▶"})})]})}function LV(){const n=we(b=>b.selectedSessionId),e=we(b=>b.sessions),t=we(b=>b.missions),i=we(b=>b.chatBySessionId),r=we(b=>b.selectSession),s=we(b=>b.sendPromptTo),[o,a]=V.useState("chat"),[c,d]=V.useState(""),f=V.useRef(null),h=n?e[n]:null,p=V.useMemo(()=>n?i[n]??[]:[],[i,n]),v=V.useMemo(()=>h?Object.values(t).filter(b=>b.sessionId===h.id).sort((b,N)=>N.startedAt-b.startedAt):[],[t,h]),x=V.useMemo(()=>{if(h!=null&&h.currentMissionId)return t[h.currentMissionId]},[t,h]),w=h?EV(h,x):null;if(V.useEffect(()=>{if(o!=="chat")return;const b=f.current;b&&(b.scrollTop=b.scrollHeight)},[o,p.length,n]),!h)return null;const M=h.origin==="internal",g=!!h.wrapperSocketPath,_=M||g,S=()=>{c.trim()&&(s(h.id,c),d(""))};return E.jsxs("div",{className:"absolute top-0 right-0 h-full w-full sm:w-[460px] bg-solix-panel border-l border-solix-border backdrop-blur-md flex flex-col z-20",children:[E.jsxs("div",{className:"px-4 py-3 border-b border-solix-border flex items-start justify-between",children:[E.jsxs("div",{className:"min-w-0",children:[E.jsx("div",{className:"text-xs uppercase tracking-wide text-slate-400",children:"Planet"}),E.jsx("div",{className:"text-lg font-semibold truncate",children:h.name??h.id.slice(0,8)}),E.jsxs("div",{className:"text-xs text-slate-400 mt-0.5 truncate",title:wg[h.status]??void 0,children:[String(h.model)," · ",xS(h.status),h.origin==="external"?" · external":" · internal",g&&E.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 rounded text-[9px] uppercase tracking-wide border border-solix-accent/50 text-solix-accent",title:"Wrapped by `solix run` — UI prompts go to your terminal.",children:"wrapped"})]})]}),E.jsx("button",{onClick:()=>r(null),className:"text-slate-400 hover:text-slate-100","aria-label":"Close",children:"✕"})]}),w&&E.jsxs("div",{className:`px-4 py-2 border-b border-solix-border text-[11px] leading-snug ${w.severity==="danger"?"text-solix-danger bg-solix-danger/10":w.severity==="warn"?"text-solix-warn bg-solix-warn/10":"text-slate-300 bg-black/20"}`,children:[E.jsx("span",{className:"font-semibold mr-1",children:"Suggested:"}),w.text]}),E.jsxs("div",{className:"px-4 py-2 border-b border-solix-border",children:[E.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-400",children:[E.jsx("span",{children:"context"}),E.jsxs("span",{children:[h.contextUsagePct.toFixed(0),"%"]})]}),E.jsx("div",{className:"mt-1 h-1.5 rounded-full bg-slate-800 overflow-hidden",children:E.jsx("div",{className:`h-full ${h.contextUsagePct>=90?"bg-solix-danger":h.contextUsagePct>=80?"bg-solix-warn":"bg-solix-accent"}`,style:{width:`${Math.min(100,h.contextUsagePct)}%`}})})]}),E.jsxs("div",{className:"flex border-b border-solix-border text-xs",children:[E.jsxs(ux,{active:o==="chat",onClick:()=>a("chat"),children:["Chat ",p.length>0&&E.jsxs("span",{className:"opacity-60",children:["(",p.length,")"]})]}),E.jsxs(ux,{active:o==="missions",onClick:()=>a("missions"),children:["Missions ",v.length>0&&E.jsxs("span",{className:"opacity-60",children:["(",v.length,")"]})]}),E.jsx(ux,{active:o==="files",onClick:()=>a("files"),children:"Files"})]}),E.jsxs("div",{className:"flex-1 overflow-hidden",children:[o==="chat"&&E.jsx(DV,{chat:p,scrollRef:f,session:h}),o==="missions"&&E.jsx(UV,{missions:v}),o==="files"&&E.jsx(kV,{missions:v})]}),o==="chat"&&E.jsx("div",{className:"px-3 py-3 border-t border-solix-border",children:_?E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"flex gap-2",children:[E.jsx("textarea",{value:c,onChange:b=>d(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),S())},placeholder:g?"Type a prompt — it goes straight into your terminal claude (Cmd/Ctrl+Enter)":"Send a prompt to this session… (Cmd/Ctrl+Enter)",rows:2,className:"flex-1 text-sm bg-black/40 border border-solix-border rounded p-2 text-slate-100 placeholder-slate-600 focus:outline-none focus:border-solix-accent resize-none"}),E.jsx("button",{onClick:S,disabled:!c.trim(),className:"px-3 py-2 rounded bg-solix-accent/20 border border-solix-accent text-solix-accent text-sm hover:bg-solix-accent/30 disabled:opacity-40",children:"Send"})]}),g&&E.jsxs("div",{className:"text-[10px] text-slate-500 italic mt-1.5",children:["Wrapped by ",E.jsx("code",{children:"solix run"}),". Don't type in the terminal while sending from here, or characters will interleave."]})]}):E.jsxs("div",{className:"text-xs text-slate-500",children:["External session — keep typing in your terminal. To send prompts from here instead, restart the session with"," ",E.jsx("code",{className:"bg-black/40 px-1 rounded",children:"solix run"}),"."]})})]})}function ux({active:n,onClick:e,children:t}){return E.jsx("button",{onClick:e,className:`flex-1 px-3 py-2 ${n?"text-solix-accent border-b-2 border-solix-accent":"text-slate-400 hover:text-slate-200 border-b-2 border-transparent"}`,children:t})}function DV({chat:n,scrollRef:e,session:t}){return E.jsxs("div",{ref:e,className:"h-full overflow-y-auto p-4 space-y-3",children:[n.length===0&&E.jsxs("div",{className:"text-sm text-slate-500 italic",children:["No chat yet. Type a prompt to this session in your terminal — it will stream here as it happens.",E.jsxs("div",{className:"mt-2 text-[11px] text-slate-600",children:["Watching transcript at ",E.jsxs("code",{children:["~/.claude/projects/","<encoded>","/",t.id,".jsonl"]})]})]}),n.map(i=>E.jsx("div",{className:`flex ${i.role==="user"?"justify-end":"justify-start"}`,children:E.jsxs("div",{className:`max-w-[85%] rounded-lg px-3 py-2 text-sm ${i.role==="user"?"bg-solix-accent/15 border border-solix-accent/40 text-slate-100":"bg-black/40 border border-solix-border text-slate-200"}`,children:[E.jsxs("div",{className:"text-[10px] uppercase tracking-wide opacity-60 mb-1",children:[i.role,E.jsx("span",{className:"ml-2 text-slate-500",children:new Date(i.ts).toLocaleTimeString()})]}),E.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed",children:i.content})]})},i.messageId))]})}function UV({missions:n}){return E.jsx("div",{className:"h-full overflow-y-auto p-4 space-y-3",children:n.length===0?E.jsx("div",{className:"text-sm text-slate-500 italic",children:"No missions yet."}):n.map(e=>E.jsxs("div",{className:"rounded border border-solix-border p-3 bg-black/30",children:[E.jsxs("div",{className:"flex items-center justify-between text-xs",children:[E.jsx("span",{className:`font-semibold ${e.status==="active"?"text-solix-warn":e.status==="completed"?"text-solix-ok":"text-slate-300"}`,children:e.shortName}),E.jsx("span",{className:"text-slate-500",children:new Date(e.startedAt).toLocaleTimeString()})]}),E.jsx("div",{className:"mt-1 text-sm text-slate-200 line-clamp-3",children:e.prompt}),E.jsxs("div",{className:"mt-2 flex gap-3 text-[10px] text-slate-500",children:[E.jsxs("span",{children:[e.metrics.toolCallCount," tools"]}),E.jsxs("span",{children:[e.metrics.subagentCount," subagents"]}),E.jsxs("span",{children:[e.filesTouched.length," files"]}),e.metrics.durationMs!==void 0&&E.jsxs("span",{children:[(e.metrics.durationMs/1e3).toFixed(1),"s"]})]})]},e.id))})}function kV({missions:n}){const e=Array.from(new Set(n.flatMap(t=>t.filesTouched))).sort();return E.jsx("div",{className:"h-full overflow-y-auto p-4",children:e.length===0?E.jsx("div",{className:"text-sm text-slate-500 italic",children:"No files touched yet."}):E.jsx("ul",{className:"space-y-1 text-xs font-mono text-slate-300",children:e.map(t=>E.jsx("li",{className:"truncate",children:t},t))})})}function OV(){const n=we(x=>x.selectedAdvisorId),e=we(x=>n?x.advisors[n]:null),t=we(x=>x.selectedSessionId?x.sessions[x.selectedSessionId]:null),i=we(x=>x.selectAdvisor),r=we(x=>x.invokeAdvisor),s=we(x=>x.pinAdvisor),o=we(x=>x.unpinAdvisor),[a,c]=V.useState(""),[d,f]=V.useState(null),[h,p]=V.useState(!1);if(V.useEffect(()=>{if(!e){f(null);return}let x=!1;const w=new URLSearchParams;t&&w.set("targetSessionId",t.id),a.trim()&&w.set("prompt",a.trim());const M=w.toString();return fetch(`/api/advisors/${encodeURIComponent(e.id)}/preview${M?`?${M}`:""}`).then(g=>g.ok?g.json():null).then(g=>{x||f(g)}).catch(()=>{x||f(null)}),()=>{x=!0}},[e==null?void 0:e.id,t==null?void 0:t.id,a]),!e)return null;const v=()=>{r(e.id,a.trim()||void 0),c("")};return E.jsxs("div",{className:"absolute top-0 right-0 h-full w-[420px] bg-solix-panel border-l border-solix-border backdrop-blur-md flex flex-col z-20",children:[E.jsxs("div",{className:"px-4 py-3 border-b border-solix-border flex items-start justify-between",children:[E.jsxs("div",{children:[E.jsx("div",{className:"text-xs uppercase tracking-wide text-amber-200/70",children:"Advisor"}),E.jsxs("div",{className:"text-lg font-semibold flex items-center gap-2",children:[E.jsx("span",{style:{color:e.color},children:e.glyph}),E.jsx("span",{children:e.codename}),e.pinned&&E.jsx("span",{className:"text-[10px] uppercase tracking-wider text-amber-300 border border-amber-300/40 rounded px-1.5 py-0.5",children:"pinned"})]}),E.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[e.name," · ",String(e.defaultModel)]})]}),E.jsx("button",{onClick:()=>i(null),className:"text-slate-400 hover:text-slate-100","aria-label":"Close",children:"✕"})]}),E.jsx("div",{className:"px-4 py-3 border-b border-solix-border text-sm text-slate-300 leading-relaxed",children:e.description}),e.requiredSkills.length>0&&E.jsxs("div",{className:"px-4 py-2 border-b border-solix-border",children:[E.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-500 mb-1",children:"requires skills"}),E.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.requiredSkills.map(x=>E.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-solix-accent/15 border border-solix-accent/40 text-solix-accent",children:x},x))})]}),E.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3 text-sm text-slate-300",children:[E.jsx("div",{className:"text-xs uppercase tracking-wide text-slate-400",children:"Invoke"}),E.jsx("div",{className:"text-xs text-slate-500",children:t?E.jsxs(E.Fragment,{children:["Will dispatch to"," ",E.jsx("span",{className:"text-slate-200",children:t.name??t.id.slice(0,8)})," ",E.jsxs("span",{className:"text-slate-500",children:["(",t.cwd,")"]})]}):E.jsx(E.Fragment,{children:"No planet focused. Click a user planet first to set a target."})}),E.jsx("textarea",{value:a,onChange:x=>c(x.target.value),placeholder:`Optional: hand ${e.codename} a specific brief…`,rows:4,className:"w-full text-sm bg-black/40 border border-solix-border rounded p-2 text-slate-100 placeholder-slate-600 focus:outline-none focus:border-solix-accent resize-none"}),d&&E.jsxs("div",{className:"rounded border border-solix-border bg-black/30",children:[E.jsxs("button",{onClick:()=>p(x=>!x),className:"w-full text-left px-2 py-1.5 text-xs flex items-center justify-between text-slate-400 hover:text-slate-100",children:[E.jsxs("span",{children:["Context envelope · ",d.recentMissionsCount," mission(s)",d.contextUsagePct!==null&&` · target at ${d.contextUsagePct.toFixed(0)}%`]}),E.jsx("span",{children:h?"▾":"▸"})]}),h&&E.jsx("pre",{className:"text-[10.5px] text-slate-300 whitespace-pre-wrap px-3 pb-3 max-h-72 overflow-auto leading-relaxed",children:d.prompt})]})]}),E.jsxs("div",{className:"px-4 py-3 border-t border-solix-border flex gap-2",children:[E.jsx("button",{onClick:v,className:"flex-1 py-2 rounded bg-solix-accent/20 border border-solix-accent text-solix-accent text-sm hover:bg-solix-accent/30",children:"Invoke"}),e.pinned?E.jsx("button",{onClick:()=>o(e.id),className:"px-3 py-2 rounded bg-amber-500/15 border border-amber-400/50 text-amber-200 text-sm hover:bg-amber-500/25",children:"Unpin"}):E.jsx("button",{onClick:()=>s(e.id),className:"px-3 py-2 rounded bg-amber-500/10 border border-amber-400/30 text-amber-200/80 text-sm hover:bg-amber-500/20",title:"Spawn an always-on session for this advisor",children:"Pin"})]})]})}function FV(){const n=we(d=>d.selectedSkillId),e=we(d=>n?d.skills[n]:null),t=we(d=>d.selectSkill),i=we(d=>d.advisors),[r,s]=V.useState(null),[o,a]=V.useState(!1);if(V.useEffect(()=>{if(!n){s(null);return}let d=!1;return a(!0),fetch(`/api/skills/${encodeURIComponent(n)}`).then(f=>f.ok?f.json():null).then(f=>{d||s(f)}).catch(()=>{d||s(null)}).finally(()=>{d||a(!1)}),()=>{d=!0}},[n]),!e)return null;const c=Object.values(i).filter(d=>d.requiredSkills.some(f=>e.id.endsWith(`:${f}`)||e.id===f));return E.jsxs("div",{className:"absolute top-0 right-0 h-full w-[480px] bg-solix-panel border-l border-solix-border backdrop-blur-md flex flex-col z-20",children:[E.jsxs("div",{className:"px-4 py-3 border-b border-solix-border flex items-start justify-between",children:[E.jsxs("div",{children:[E.jsxs("div",{className:"text-xs uppercase tracking-wide text-cyan-300/70",children:["Skill · ",e.source]}),E.jsx("div",{className:"text-lg font-semibold",children:e.name}),E.jsx("div",{className:"text-xs text-slate-400 mt-0.5 break-all",children:e.id})]}),E.jsx("button",{onClick:()=>t(null),className:"text-slate-400 hover:text-slate-100","aria-label":"Close",children:"✕"})]}),c.length>0&&E.jsxs("div",{className:"px-4 py-2 border-b border-solix-border",children:[E.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-500 mb-1",children:"required by"}),E.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.map(d=>E.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded border border-amber-300/40 text-amber-200",children:[E.jsx("span",{className:"mr-1",children:d.glyph}),d.codename]},d.id))})]}),E.jsx("div",{className:"px-4 py-3 border-b border-solix-border text-sm text-slate-300 leading-relaxed",children:e.description}),E.jsxs("div",{className:"flex-1 overflow-y-auto p-4",children:[E.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-500 mb-2",children:"manifest"}),o&&E.jsx("div",{className:"text-sm text-slate-500 italic",children:"Loading…"}),r&&E.jsx("pre",{className:"text-[11px] text-slate-300 whitespace-pre-wrap break-words bg-black/40 p-3 rounded border border-solix-border",children:r.manifest})]}),E.jsx("div",{className:"px-4 py-3 border-t border-solix-border text-xs text-slate-500",children:e.installedInProjects.length===0?"Not installed in any project yet.":`Installed in ${e.installedInProjects.length} project(s).`})]})}function zV(n,e){const t=new Map(n.advisors.map(w=>[w.role,w])),i=new Map(e.advisors.map(w=>[w.role,w])),r=[...i.keys()].filter(w=>!t.has(w)),s=[...t.keys()].filter(w=>!i.has(w)),o=[...i.keys()].filter(w=>t.has(w)).map(w=>({role:w,from:t.get(w).pinned,to:i.get(w).pinned})).filter(w=>w.from!==w.to),a=new Set(n.skills.map(w=>w.id)),c=new Set(e.skills.map(w=>w.id)),d=[...c].filter(w=>!a.has(w)),f=[...a].filter(w=>!c.has(w)),h=new Set(n.projects.map(w=>w.name)),p=new Set(e.projects.map(w=>w.name)),v=[...p].filter(w=>!h.has(w)),x=[...h].filter(w=>!p.has(w));return{advisors:{added:r.sort(),removed:s.sort(),pinChanged:o.sort((w,M)=>w.role.localeCompare(M.role))},skills:{added:d.sort(),removed:f.sort()},projects:{added:v.sort(),removed:x.sort()}}}function BV({open:n,onClose:e}){const[t,i]=V.useState("share"),[r,s]=V.useState("My Galaxy"),[o,a]=V.useState(""),[c,d]=V.useState(""),[f,h]=V.useState(!1),[p,v]=V.useState(null),[x,w]=V.useState(null),M=we(C=>Object.keys(C.sessions).length),g=we(C=>Object.values(C.advisors).filter(U=>U.enabled).length),_=we(C=>Object.keys(C.skills).length);if(!n)return null;const S=async()=>{h(!0),v(null);try{const C=new URLSearchParams({name:r}),U=await fetch(`/api/galaxy/export?${C.toString()}`);if(!U.ok)throw new Error(`HTTP ${U.status}`);const W=await U.json(),X=new Blob([JSON.stringify(W,null,2)],{type:"application/json"}),te=URL.createObjectURL(X),ee=document.createElement("a");ee.href=te,ee.download=`${r.toLowerCase().replace(/\s+/g,"-")}.galaxy.json`,ee.click(),URL.revokeObjectURL(te),v("Downloaded.")}catch(C){v(`Export failed: ${String(C)}`)}finally{h(!1)}},b=async C=>{h(!0),v(null);try{const W=await(await fetch("/api/galaxy/import",{method:"POST",headers:{"Content-Type":"application/json"},body:C})).json();W.ok?(v(`Imported: ${W.advisorsEnabled} enabled, ${W.advisorsDisabled} disabled, ${W.projectsHinted} projects.`),a(""),d("")):v(`Import failed: ${W.error??"unknown"}`)}catch(U){v(`Import failed: ${String(U)}`)}finally{h(!1)}},N=async(C,U,W)=>{v(null);let X,te=W;if(te)try{const ee=await fetch("/api/galaxy/export?preview=1");if(ee.ok){const Q=await ee.json();X=zV(Q,te)}}catch{}w({body:C,label:U,diff:X,manifest:te})},A=()=>{let C;try{C=JSON.parse(o)}catch{v("Could not parse JSON.");return}N(o,"pasted manifest",C)},I=()=>{N(JSON.stringify({url:c}),`URL: ${c}`,void 0)},L=()=>{if(!x)return;const C=x.body;w(null),b(C)},P=()=>{w(null)};return E.jsxs("div",{className:"absolute top-0 right-0 h-full w-full sm:w-[480px] bg-solix-panel border-l border-solix-border backdrop-blur-md flex flex-col z-30",children:[E.jsxs("div",{className:"px-4 py-3 border-b border-solix-border flex items-start justify-between",children:[E.jsxs("div",{children:[E.jsx("div",{className:"text-xs uppercase tracking-wide text-solix-accent",children:"Galaxy"}),E.jsx("div",{className:"text-lg font-semibold",children:"Share your space"}),E.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[g," advisors · ",_," skills ·"," ",M," sessions"]})]}),E.jsx("button",{onClick:e,className:"text-slate-400 hover:text-slate-100",children:"✕"})]}),E.jsxs("div",{className:"flex border-b border-solix-border text-xs",children:[E.jsx(dx,{active:t==="share",onClick:()=>i("share"),children:"Sharing"}),E.jsx(dx,{active:t==="versions",onClick:()=>i("versions"),children:"Versions"}),E.jsx(dx,{active:t==="audit",onClick:()=>i("audit"),children:"Audit"})]}),t==="audit"?E.jsx(VV,{open:n}):t==="versions"?E.jsx(jV,{open:n}):E.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-6",children:[E.jsxs("section",{children:[E.jsx("div",{className:"text-xs uppercase tracking-wide text-slate-400 mb-2",children:"Export"}),E.jsx("input",{value:r,onChange:C=>s(C.target.value),placeholder:"Galaxy name",className:"w-full text-sm bg-black/40 border border-solix-border rounded p-2 text-slate-100 placeholder-slate-600 focus:outline-none focus:border-solix-accent"}),E.jsx("button",{onClick:()=>void S(),disabled:f,className:"mt-2 w-full py-2 rounded bg-solix-accent/20 border border-solix-accent text-solix-accent text-sm hover:bg-solix-accent/30 disabled:opacity-50",children:"Download manifest (.galaxy.json)"})]}),E.jsxs("section",{children:[E.jsx("div",{className:"text-xs uppercase tracking-wide text-slate-400 mb-2",children:"Import from URL"}),E.jsx("input",{value:c,onChange:C=>d(C.target.value),placeholder:"https://… or local server URL",className:"w-full text-sm bg-black/40 border border-solix-border rounded p-2 text-slate-100 placeholder-slate-600 focus:outline-none focus:border-solix-accent"}),E.jsx("button",{onClick:I,disabled:f||!c.trim(),className:"mt-2 w-full py-2 rounded bg-cyan-500/15 border border-cyan-400/40 text-cyan-200 text-sm hover:bg-cyan-500/25 disabled:opacity-50",children:"Pull and import"})]}),E.jsxs("section",{children:[E.jsx("div",{className:"text-xs uppercase tracking-wide text-slate-400 mb-2",children:"Import from JSON"}),E.jsx("textarea",{value:o,onChange:C=>a(C.target.value),placeholder:"Paste a galaxy manifest JSON here…",rows:10,className:"w-full text-xs bg-black/40 border border-solix-border rounded p-2 text-slate-100 placeholder-slate-600 focus:outline-none focus:border-solix-accent font-mono resize-none"}),E.jsx("button",{onClick:A,disabled:f||!o.trim(),className:"mt-2 w-full py-2 rounded bg-cyan-500/15 border border-cyan-400/40 text-cyan-200 text-sm hover:bg-cyan-500/25 disabled:opacity-50",children:"Apply manifest"})]}),x&&E.jsx(WV,{label:x.label,diff:x.diff,manifest:x.manifest,busy:f,onConfirm:L,onCancel:P}),p&&E.jsx("div",{className:"text-xs text-slate-300 border border-solix-border rounded p-2 bg-black/30",children:p})]}),E.jsx("div",{className:"px-4 py-3 border-t border-solix-border text-xs text-slate-500",children:t==="audit"?"Append-only history. Read-only.":t==="versions"?"Each export snapshots a version. Identical re-exports are deduped.":"Imports never spawn pinned advisors or run shell commands. You're in control."})]})}function dx({active:n,onClick:e,children:t}){return E.jsx("button",{onClick:e,className:`flex-1 px-3 py-2 ${n?"text-solix-accent border-b-2 border-solix-accent":"text-slate-400 hover:text-slate-200 border-b-2 border-transparent"}`,children:t})}const HV=["permission_approved","permission_denied","advisor_invoked","advisor_pinned","advisor_unpinned","galaxy_imported"];function VV({open:n}){const[e,t]=V.useState([]),[i,r]=V.useState("all"),[s,o]=V.useState(!1),[a,c]=V.useState(null);return V.useEffect(()=>{if(!n)return;let d=!1;o(!0),c(null);const f=`/api/audit${i==="all"?"":`?kind=${i}`}`;return fetch(f).then(h=>h.ok?h.json():Promise.reject(new Error(`HTTP ${h.status}`))).then(h=>{d||t(h)}).catch(h=>{d||c(h.message)}).finally(()=>{d||o(!1)}),()=>{d=!0}},[n,i]),E.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:[E.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[E.jsx(wb,{label:"all",active:i==="all",onClick:()=>r("all")}),HV.map(d=>E.jsx(wb,{label:Eb(d),active:i===d,onClick:()=>r(d)},d))]}),s&&E.jsx("div",{className:"text-xs text-slate-500 italic",children:"Loading…"}),a&&E.jsxs("div",{className:"text-xs text-solix-danger italic",children:["Could not load audit events: ",a]}),!s&&e.length===0&&E.jsx("div",{className:"text-xs text-slate-500 italic",children:"No audit events yet. Approve a permission or invoke an advisor and they'll start appearing here."}),E.jsx("ul",{className:"space-y-1.5",children:e.map(d=>E.jsxs("li",{className:"rounded border border-solix-border bg-black/20 p-2",children:[E.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[E.jsx("span",{className:`uppercase tracking-wide ${GV(d.kind)}`,children:Eb(d.kind)}),E.jsx("span",{className:"text-slate-500 font-mono",children:new Date(d.ts).toLocaleString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,month:"short",day:"numeric"})})]}),E.jsx("div",{className:"text-[12px] text-slate-100 mt-1 leading-snug",children:d.summary})]},d.id))})]})}function wb({label:n,active:e,onClick:t}){return E.jsx("button",{onClick:t,className:`text-[10px] px-2 py-0.5 rounded border ${e?"bg-solix-accent/15 border-solix-accent text-solix-accent":"border-solix-border text-slate-400 hover:text-slate-200"}`,children:n})}function Eb(n){return n==="all"?"all":n.replace(/_/g," ")}function GV(n){return n==="permission_approved"?"text-solix-ok":n==="permission_denied"?"text-solix-danger":n==="galaxy_imported"?"text-cyan-300":n.startsWith("advisor_")?"text-amber-300":"text-slate-300"}function jV({open:n}){const[e,t]=V.useState([]),[i,r]=V.useState(!1),[s,o]=V.useState(null),[a,c]=V.useState(null),[d,f]=V.useState(null),[h,p]=V.useState(null),[v,x]=V.useState(!1);V.useEffect(()=>{if(!n)return;let _=!1;return r(!0),fetch("/api/galaxy/versions").then(S=>S.ok?S.json():Promise.reject(new Error(`HTTP ${S.status}`))).then(S=>{_||t(S)}).catch(S=>{_||o(S.message)}).finally(()=>{_||r(!1)}),()=>{_=!0}},[n]),V.useEffect(()=>{if(!a||!d){p(null);return}if(a===d){p(null);return}let _=!1;return x(!0),fetch(`/api/galaxy/diff?from=${a}&to=${d}`).then(S=>S.ok?S.json():Promise.reject(new Error(`HTTP ${S.status}`))).then(S=>{_||p(S)}).catch(()=>{_||p(null)}).finally(()=>{_||x(!1)}),()=>{_=!0}},[a,d]);const w=_=>{a?!d&&_!==a?f(_):(c(_),f(null),p(null)):c(_)},M=()=>{c(null),f(null),p(null)},g=_=>_.id===a?"from":_.id===d?"to":null;return E.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:[(a||d)&&E.jsxs("div",{className:"flex items-center justify-between text-[11px] text-slate-400",children:[E.jsxs("div",{children:[a&&!d&&"Pick a second version to diff…",a&&d&&v&&"Computing diff…",a&&d&&!v&&h&&E.jsxs(E.Fragment,{children:["v",h.from.ordinal," → v",h.to.ordinal]})]}),E.jsx("button",{onClick:M,className:"text-slate-500 hover:text-slate-100",children:"clear"})]}),h&&E.jsx(RR,{diff:h.diff}),i&&E.jsx("div",{className:"text-xs text-slate-500 italic",children:"Loading…"}),s&&E.jsxs("div",{className:"text-xs text-solix-danger italic",children:["Could not load versions: ",s]}),!i&&e.length===0&&E.jsx("div",{className:"text-xs text-slate-500 italic",children:'No versions yet. Hit "Download manifest" on the Sharing tab to create one.'}),E.jsx("ul",{className:"space-y-1.5",children:e.map(_=>{const S=g(_);return E.jsx("li",{children:E.jsxs("button",{onClick:()=>w(_.id),className:`w-full text-left rounded border p-2 ${S==="from"?"border-solix-accent bg-solix-accent/10":S==="to"?"border-cyan-400 bg-cyan-400/10":"border-solix-border bg-black/20 hover:bg-solix-border/30"}`,children:[E.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[E.jsxs("span",{className:"uppercase tracking-wide text-slate-400",children:["v",_.ordinal," · ",_.name]}),E.jsx("span",{className:"text-slate-500 font-mono",children:new Date(_.ts).toLocaleString("en-US",{hour:"2-digit",minute:"2-digit",month:"short",day:"numeric"})})]}),E.jsxs("div",{className:"text-[11px] text-slate-300 mt-1",children:[_.manifest.advisors.length," advisors ·"," ",_.manifest.skills.length," skills ·"," ",_.manifest.projects.length," projects",S&&E.jsxs("span",{className:"ml-2 text-[9px] uppercase tracking-wider text-slate-400",children:["[",S,"]"]})]})]})},_.id)})})]})}function RR({diff:n}){return n.advisors.added.length===0&&n.advisors.removed.length===0&&n.advisors.pinChanged.length===0&&n.skills.added.length===0&&n.skills.removed.length===0&&n.projects.added.length===0&&n.projects.removed.length===0?E.jsx("div",{className:"text-xs text-slate-500 italic border border-solix-border rounded p-2 bg-black/20",children:"No changes between these versions."}):E.jsxs("div",{className:"rounded border border-solix-border bg-black/30 p-2 space-y-2 text-xs",children:[E.jsx(fx,{label:"Advisors",added:n.advisors.added,removed:n.advisors.removed}),n.advisors.pinChanged.length>0&&E.jsxs("div",{children:[E.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Advisor pin changes"}),E.jsx("ul",{className:"mt-1 space-y-0.5",children:n.advisors.pinChanged.map(t=>E.jsxs("li",{className:"text-slate-200",children:[E.jsx("span",{className:"font-mono",children:t.role}),":"," ",t.from?"pinned":"unpinned"," →"," ",t.to?"pinned":"unpinned"]},t.role))})]}),E.jsx(fx,{label:"Skills",added:n.skills.added,removed:n.skills.removed}),E.jsx(fx,{label:"Projects",added:n.projects.added,removed:n.projects.removed})]})}function WV({label:n,diff:e,manifest:t,busy:i,onConfirm:r,onCancel:s}){return E.jsxs("div",{className:"rounded border border-amber-300/60 bg-amber-500/10 p-3 space-y-2",children:[E.jsxs("div",{className:"flex items-center justify-between",children:[E.jsx("div",{className:"text-[11px] uppercase tracking-wide text-amber-200",children:"confirm import"}),E.jsx("div",{className:"text-[10px] text-slate-400 font-mono truncate max-w-[55%]",children:n})]}),t&&E.jsxs("div",{className:"text-xs text-slate-200",children:[E.jsx("span",{className:"font-semibold",children:t.name}),t.author&&E.jsxs("span",{className:"text-slate-400",children:[" · by ",t.author]})]}),e?E.jsx(RR,{diff:e}):t?E.jsx("div",{className:"text-xs text-slate-400 italic",children:"Could not compute a diff against the current galaxy. Apply will still proceed if you confirm."}):E.jsx("div",{className:"text-xs text-slate-300",children:"Solix will fetch the manifest from this URL and apply it. Diff preview is only available for pasted JSON."}),E.jsxs("div",{className:"flex gap-2",children:[E.jsx("button",{onClick:r,disabled:i,className:"flex-1 py-1.5 rounded bg-amber-500/20 border border-amber-300 text-amber-100 text-xs hover:bg-amber-500/30 disabled:opacity-50",children:"Apply"}),E.jsx("button",{onClick:s,disabled:i,className:"px-3 py-1.5 rounded border border-solix-border text-slate-300 text-xs hover:text-white disabled:opacity-50",children:"Cancel"})]})]})}function fx({label:n,added:e,removed:t}){return e.length===0&&t.length===0?null:E.jsxs("div",{children:[E.jsx("div",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:n}),E.jsxs("ul",{className:"mt-1 space-y-0.5",children:[e.map(i=>E.jsxs("li",{className:"text-solix-ok",children:["+ ",i]},`+${i}`)),t.map(i=>E.jsxs("li",{className:"text-solix-danger",children:["− ",i]},`-${i}`))]})]})}const XV=["default","opus","sonnet","haiku"];function YV({open:n,onClose:e}){const t=we(A=>A.projects),i=we(A=>A.advisors),r=we(A=>A.launchTask),s=Object.values(t).sort((A,I)=>I.lastActiveAt-A.lastActiveAt),o=V.useMemo(()=>Object.values(i).filter(A=>A.enabled).sort((A,I)=>A.codename.localeCompare(I.codename)),[i]),[a,c]=V.useState(""),[d,f]=V.useState("default"),[h,p]=V.useState(null),[v,x]=V.useState(""),[w,M]=V.useState(""),[g,_]=V.useState(""),[S,b]=V.useState(null);if(V.useEffect(()=>{if(!n)return;let A=!1;return fetch("/api/system/preflight").then(I=>I.ok?I.json():null).then(I=>{A||b(I)}).catch(()=>{}),()=>{A=!0}},[n]),V.useEffect(()=>{if(!n||a)return;const A=s[0];A&&c(A.cwd)},[n,s,a]),!n)return null;const N=()=>{const A=a.trim(),I=v.trim();if(!A||!I)return;const L=h?o.find(W=>W.id===h):void 0,P=L?`[Acting as ${L.codename} — ${L.name}. ${L.description}]
|
|
4190
4190
|
|
package/dist/web/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<link rel="icon" type="image/png" sizes="192x192" href="/icons/solix-192.png" />
|
|
11
11
|
<link rel="apple-touch-icon" href="/icons/solix-192.png" />
|
|
12
12
|
<title>Solix — agent solar system</title>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-Dpn0WSQC.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/index-CzhFbCNn.css">
|
|
15
15
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
16
16
|
<body class="bg-solix-bg text-slate-100 font-mono antialiased">
|
package/dist/web/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let e,
|
|
1
|
+
if(!self.define){let e,i={};const s=(s,r)=>(s=new URL(s+".js",r).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(r,n)=>{const t=e||("document"in self?document.currentScript.src:"")||location.href;if(i[t])return;let d={};const o=e=>s(e,t),c={module:{uri:t},exports:d,require:o};i[t]=Promise.all(r.map(e=>c[e]||o(e))).then(e=>(n(...e),d))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"index.html",revision:"814c2b8c3422108be1514768f3dc6e05"},{url:"textures/sun.jpg",revision:"b829dfb4a0a036c4727c5d61104c197b"},{url:"textures/saturn_ring.png",revision:"8e80b3cf6d20013de762d29484a6c761"},{url:"textures/saturn.jpg",revision:"038ec3cf432f1a9ad5f876680d3de338"},{url:"textures/moon.jpg",revision:"2e7ade181b8d94636304008d6f23a516"},{url:"textures/milky_way.jpg",revision:"1c46fa10182c00d019cabcecfab7aaf0"},{url:"textures/mars.jpg",revision:"56f226a559fd3807a5aab2e2efab8e24"},{url:"textures/jupiter.jpg",revision:"f69754cbb9d0129d83e3a6b0a2a91df3"},{url:"textures/earth_clouds.png",revision:"63b2ef0cc6d1bbac112d9eb4612663ad"},{url:"textures/earth.jpg",revision:"e15eb8d2a32d001aa4e06884f6a566cd"},{url:"icons/solix-512.png",revision:"226858b9daf4713d145e876f8f40c45d"},{url:"icons/solix-192.png",revision:"de33849807e2beaa616c4e536e7b6125"},{url:"assets/index-Dpn0WSQC.js",revision:null},{url:"assets/index-CzhFbCNn.css",revision:null},{url:"icons/solix-192.png",revision:"de33849807e2beaa616c4e536e7b6125"},{url:"icons/solix-512.png",revision:"226858b9daf4713d145e876f8f40c45d"},{url:"manifest.webmanifest",revision:"c594b6ea55050c15c2dc222e3f23179d"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"),{denylist:[/^\/api/,/^\/events/,/^\/ws/]}))});
|