pantheon-opencode 1.5.0-beta.5 → 1.5.0-beta.6
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/CHANGELOG.md +25 -0
- package/README.md +7 -2
- package/README.pt-BR.md +7 -2
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/install/opencode.mjs +15 -0
- package/src/plugins/tui/dist/tui.d.ts +39 -7
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +253 -97
- package/src/plugins/tui/dist/tui.tsx +188 -16
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/plugins/tui/src/index.tsx +188 -16
|
@@ -164,7 +164,7 @@ async function detectVersion(api) {
|
|
|
164
164
|
if (ver) return ver;
|
|
165
165
|
}
|
|
166
166
|
} catch {}
|
|
167
|
-
return "1.5.0-beta.
|
|
167
|
+
return "1.5.0-beta.6";
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
170
|
* usage-bar — AI subscription usage gauge for the opencode TUI.
|
|
@@ -868,19 +868,31 @@ function tuiLogPath(projectRoot) {
|
|
|
868
868
|
* falling back to startedAt, descending). Shared by the md reader and
|
|
869
869
|
* mergeDelegationSources. */
|
|
870
870
|
function compareDelegationEntries(a, b) {
|
|
871
|
-
const
|
|
872
|
-
const
|
|
871
|
+
const isActive = (st) => st === "running" || st === "retry" || st === "stale-running" ? 1 : 0;
|
|
872
|
+
const aRun = isActive(a.state);
|
|
873
|
+
const bRun = isActive(b.state);
|
|
873
874
|
if (aRun !== bRun) return bRun - aRun;
|
|
874
875
|
return (b.updatedAt ?? b.startedAt) - (a.updatedAt ?? a.startedAt);
|
|
875
876
|
}
|
|
876
|
-
/**
|
|
877
|
-
* recent terminal reports
|
|
878
|
-
*
|
|
879
|
-
*
|
|
877
|
+
/** Split the panel list: active jobs (running/retry, stale-marked) first,
|
|
878
|
+
* then the most recent terminal reports, then the archived tail (paginated
|
|
879
|
+
* in the View). Pure — so the history-only panel (no sessionID) is testable
|
|
880
|
+
* without the TUI runtime. */
|
|
881
|
+
function splitDelegationList(all, maxRecent = 8, now = Date.now(), staleThresholdMs = 1800 * 1e3) {
|
|
882
|
+
const active = all.filter((d) => d.state === "running" || d.state === "retry").map((d) => markStaleIfRunning(d, now, staleThresholdMs));
|
|
883
|
+
const terminal = all.filter((d) => d.state !== "running" && d.state !== "retry");
|
|
884
|
+
return {
|
|
885
|
+
active,
|
|
886
|
+
recent: terminal.slice(0, maxRecent),
|
|
887
|
+
archived: terminal.slice(maxRecent)
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
/** The list the panel actually renders (kept for the header count and
|
|
891
|
+
* existing tests): active jobs first, then the most recent terminal
|
|
892
|
+
* reports (capped) — the archived tail is rendered separately. Pure. */
|
|
880
893
|
function visibleDelegationList(all, maxTerminal = 8, now = Date.now(), staleThresholdMs = 1800 * 1e3) {
|
|
881
|
-
const
|
|
882
|
-
|
|
883
|
-
return [...running, ...terminal];
|
|
894
|
+
const { active, recent } = splitDelegationList(all, maxTerminal, now, staleThresholdMs);
|
|
895
|
+
return [...active, ...recent];
|
|
884
896
|
}
|
|
885
897
|
/** Default stale-running threshold: 30 minutes. */
|
|
886
898
|
const STALE_RUNNING_THRESHOLD_MS = 1800 * 1e3;
|
|
@@ -935,6 +947,7 @@ function delegationActivity(entry) {
|
|
|
935
947
|
return "working";
|
|
936
948
|
}
|
|
937
949
|
function delegationActivityLabel(entry) {
|
|
950
|
+
if (entry.state === "retry") return "RETRYING";
|
|
938
951
|
switch (delegationActivity(entry)) {
|
|
939
952
|
case "delegating": return "DELEGATING";
|
|
940
953
|
case "working": return "WORKING";
|
|
@@ -961,6 +974,65 @@ function delegationSpinnerFrame(now) {
|
|
|
961
974
|
const index = Math.floor(Math.max(0, now) / 140) % DELEGATION_SPINNER_FRAMES.length;
|
|
962
975
|
return DELEGATION_SPINNER_FRAMES[index] ?? DELEGATION_SPINNER_FRAMES[0];
|
|
963
976
|
}
|
|
977
|
+
/** Bounded tracker: child session id → latest running tool call. */
|
|
978
|
+
const latestToolActivity = /* @__PURE__ */ new Map();
|
|
979
|
+
const MAX_TOOL_ACTIVITY_ENTRIES = 200;
|
|
980
|
+
const TOOL_ACTIVITY_TTL_MS = 300 * 1e3;
|
|
981
|
+
/** Archived-section pagination state — module-level so it survives sidebar
|
|
982
|
+
* remounts (route changes) without leaking into the component tree. */
|
|
983
|
+
const archivedUiState = { page: 0 };
|
|
984
|
+
/** First usable summary string from common tool input fields. */
|
|
985
|
+
function summarizeToolInput(input) {
|
|
986
|
+
if (!input) return "";
|
|
987
|
+
for (const key of [
|
|
988
|
+
"command",
|
|
989
|
+
"description",
|
|
990
|
+
"prompt",
|
|
991
|
+
"filePath",
|
|
992
|
+
"pattern",
|
|
993
|
+
"url",
|
|
994
|
+
"query"
|
|
995
|
+
]) {
|
|
996
|
+
const value = input[key];
|
|
997
|
+
if (typeof value === "string" && value.trim() !== "") return value;
|
|
998
|
+
}
|
|
999
|
+
return "";
|
|
1000
|
+
}
|
|
1001
|
+
/** Reduce one message.part.updated tool part to displayable activity.
|
|
1002
|
+
* Returns null for non-tool parts, completed/error parts (no live activity)
|
|
1003
|
+
* or parts without a session id. Pure. */
|
|
1004
|
+
function extractToolActivity(part, now = Date.now()) {
|
|
1005
|
+
if (part?.type !== "tool") return null;
|
|
1006
|
+
const status = part.state?.status;
|
|
1007
|
+
if (status !== "pending" && status !== "running") return null;
|
|
1008
|
+
const sessionID = typeof part.sessionID === "string" ? part.sessionID : "";
|
|
1009
|
+
if (sessionID === "") return null;
|
|
1010
|
+
return {
|
|
1011
|
+
sessionID,
|
|
1012
|
+
activity: {
|
|
1013
|
+
tool: typeof part.tool === "string" && part.tool !== "" ? part.tool : "tool",
|
|
1014
|
+
summary: summarizeToolInput(part.state?.input).replace(/\s+/g, " ").trim().slice(0, 48),
|
|
1015
|
+
at: now
|
|
1016
|
+
}
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
/** Record an activity sample (bounded map, oldest dropped). */
|
|
1020
|
+
function trackToolActivity(map, sessionID, activity) {
|
|
1021
|
+
if (sessionID === "") return;
|
|
1022
|
+
if (map.size >= MAX_TOOL_ACTIVITY_ENTRIES) {
|
|
1023
|
+
const oldest = map.keys().next().value;
|
|
1024
|
+
if (oldest !== void 0) map.delete(oldest);
|
|
1025
|
+
}
|
|
1026
|
+
map.set(sessionID, activity);
|
|
1027
|
+
}
|
|
1028
|
+
/** Latest live activity for a child session, or null when absent/stale. */
|
|
1029
|
+
function latestToolActivityFor(map, sessionID, now = Date.now(), ttlMs = TOOL_ACTIVITY_TTL_MS) {
|
|
1030
|
+
if (!sessionID) return null;
|
|
1031
|
+
const hit = map.get(sessionID);
|
|
1032
|
+
if (hit === void 0) return null;
|
|
1033
|
+
if (now - hit.at > ttlMs) return null;
|
|
1034
|
+
return hit;
|
|
1035
|
+
}
|
|
964
1036
|
/** Merge the immediate tool-event channel into the child-session channel.
|
|
965
1037
|
*
|
|
966
1038
|
* Children remain the durable source, while live entries make a delegation
|
|
@@ -1309,6 +1381,7 @@ function buildChildrenPath(id) {
|
|
|
1309
1381
|
* correct it as soon as terminal data exists). */
|
|
1310
1382
|
function childStatusToState(status) {
|
|
1311
1383
|
if (status === "idle") return "completed";
|
|
1384
|
+
if (status === "retry") return "retry";
|
|
1312
1385
|
return "running";
|
|
1313
1386
|
}
|
|
1314
1387
|
/** Row tag for a delegation entry: `[native]` for native task() children
|
|
@@ -1431,6 +1504,7 @@ function DelegationRow(props) {
|
|
|
1431
1504
|
const t = theme();
|
|
1432
1505
|
switch (props.job.state) {
|
|
1433
1506
|
case "running": return t.warning;
|
|
1507
|
+
case "retry": return t.warning;
|
|
1434
1508
|
case "stale-running": return t.error;
|
|
1435
1509
|
case "completed": return t.success;
|
|
1436
1510
|
case "error": return t.error;
|
|
@@ -1439,6 +1513,7 @@ function DelegationRow(props) {
|
|
|
1439
1513
|
});
|
|
1440
1514
|
const marker = createMemo(() => {
|
|
1441
1515
|
if (props.job.state === "running") return `${delegationSpinnerFrame(props.animationNow)} `;
|
|
1516
|
+
if (props.job.state === "retry") return "⟳ ";
|
|
1442
1517
|
if (props.job.state === "stale-running") return "⚠ ";
|
|
1443
1518
|
switch (props.job.state) {
|
|
1444
1519
|
case "completed": return "✓ ";
|
|
@@ -1451,6 +1526,7 @@ function DelegationRow(props) {
|
|
|
1451
1526
|
const line = `${delegationElapsed(props.job, props.now)}${props.job.description !== "" ? ` \u2014 ${props.job.description}` : ""}`;
|
|
1452
1527
|
return line.length > 180 ? `${line.slice(0, 177)}\u2026` : line;
|
|
1453
1528
|
});
|
|
1529
|
+
const activity = createMemo(() => latestToolActivityFor(latestToolActivity, props.job.taskID, props.now));
|
|
1454
1530
|
const open = () => {
|
|
1455
1531
|
navigateToDelegationSession(props.api.route, props.job.taskID);
|
|
1456
1532
|
};
|
|
@@ -1467,6 +1543,17 @@ function DelegationRow(props) {
|
|
|
1467
1543
|
insert(_el$16, () => delegationTag(props.job));
|
|
1468
1544
|
insert(_el$17, () => ` ${props.job.agent} \u2014 ${delegationActivityLabel(props.job)}`);
|
|
1469
1545
|
insert(_el$18, detail);
|
|
1546
|
+
insert(_el$13, createComponent(Show, {
|
|
1547
|
+
get when() {
|
|
1548
|
+
return activity();
|
|
1549
|
+
},
|
|
1550
|
+
children: (a) => (() => {
|
|
1551
|
+
var _el$19 = createElement("text");
|
|
1552
|
+
insert(_el$19, () => ` \u21b3 ${a().tool}${a().summary !== "" ? " " + a().summary : ""}`);
|
|
1553
|
+
effect((_$p) => setProp(_el$19, "fg", theme().textMuted, _$p));
|
|
1554
|
+
return _el$19;
|
|
1555
|
+
})()
|
|
1556
|
+
}), null);
|
|
1470
1557
|
effect((_p$) => {
|
|
1471
1558
|
var _v$5 = color(), _v$6 = tagColor(), _v$7 = color(), _v$8 = theme().textMuted;
|
|
1472
1559
|
_v$5 !== _p$.e && (_p$.e = setProp(_el$15, "fg", _v$5, _p$.e));
|
|
@@ -1594,7 +1681,14 @@ function View(props) {
|
|
|
1594
1681
|
})();
|
|
1595
1682
|
return delegationsInflight;
|
|
1596
1683
|
};
|
|
1597
|
-
const
|
|
1684
|
+
const delegationSplit = createMemo(() => splitDelegationList(childDelegations()));
|
|
1685
|
+
const visibleDelegations = createMemo(() => [...delegationSplit().active, ...delegationSplit().recent]);
|
|
1686
|
+
const [archivedPage, setArchivedPage] = createSignal(archivedUiState.page);
|
|
1687
|
+
const clampArchivedPage = (page, pages) => {
|
|
1688
|
+
const clamped = Math.max(0, Math.min(page, Math.max(0, pages - 1)));
|
|
1689
|
+
archivedUiState.page = clamped;
|
|
1690
|
+
setArchivedPage(clamped);
|
|
1691
|
+
};
|
|
1598
1692
|
onMount(() => {
|
|
1599
1693
|
const cleanup = [];
|
|
1600
1694
|
try {
|
|
@@ -1643,78 +1737,78 @@ function View(props) {
|
|
|
1643
1737
|
}));
|
|
1644
1738
|
});
|
|
1645
1739
|
const HR = () => (() => {
|
|
1646
|
-
var _el$
|
|
1647
|
-
insertNode(_el$
|
|
1648
|
-
effect((_$p) => setProp(_el$
|
|
1649
|
-
return _el$
|
|
1740
|
+
var _el$20 = createElement("text");
|
|
1741
|
+
insertNode(_el$20, createTextNode(`────────────────────────────`));
|
|
1742
|
+
effect((_$p) => setProp(_el$20, "fg", theme().textMuted, _$p));
|
|
1743
|
+
return _el$20;
|
|
1650
1744
|
})();
|
|
1651
1745
|
return (() => {
|
|
1652
|
-
var _el$
|
|
1653
|
-
insertNode(_el$
|
|
1654
|
-
insertNode(_el$
|
|
1655
|
-
insertNode(_el$
|
|
1656
|
-
setProp(_el$
|
|
1657
|
-
setProp(_el$
|
|
1658
|
-
setProp(_el$
|
|
1659
|
-
insert(_el$
|
|
1660
|
-
insert(_el$
|
|
1746
|
+
var _el$22 = createElement("box"), _el$23 = createElement("text"), _el$24 = createElement("box"), _el$25 = createElement("text"), _el$26 = createElement("text"), _el$28 = createElement("box"), _el$29 = createElement("text"), _el$30 = createElement("text");
|
|
1747
|
+
insertNode(_el$22, _el$23);
|
|
1748
|
+
insertNode(_el$22, _el$24);
|
|
1749
|
+
insertNode(_el$22, _el$28);
|
|
1750
|
+
setProp(_el$22, "flexDirection", "column");
|
|
1751
|
+
setProp(_el$22, "width", "100%");
|
|
1752
|
+
setProp(_el$23, "attributes", 1);
|
|
1753
|
+
insert(_el$23, () => `Pantheon${props.version ? ` v${props.version}` : ""}`);
|
|
1754
|
+
insert(_el$22, createComponent(Show, {
|
|
1661
1755
|
get when() {
|
|
1662
1756
|
return branch();
|
|
1663
1757
|
},
|
|
1664
1758
|
children: (b) => (() => {
|
|
1665
|
-
var _el$
|
|
1666
|
-
insert(_el$
|
|
1667
|
-
effect((_$p) => setProp(_el$
|
|
1668
|
-
return _el$
|
|
1759
|
+
var _el$32 = createElement("text");
|
|
1760
|
+
insert(_el$32, b);
|
|
1761
|
+
effect((_$p) => setProp(_el$32, "fg", theme().textMuted, _$p));
|
|
1762
|
+
return _el$32;
|
|
1669
1763
|
})()
|
|
1670
|
-
}), _el$
|
|
1671
|
-
insert(_el$
|
|
1764
|
+
}), _el$24);
|
|
1765
|
+
insert(_el$22, createComponent(Show, {
|
|
1672
1766
|
get when() {
|
|
1673
1767
|
return preset().name;
|
|
1674
1768
|
},
|
|
1675
1769
|
get fallback() {
|
|
1676
1770
|
return (() => {
|
|
1677
|
-
var _el$
|
|
1678
|
-
insertNode(_el$
|
|
1679
|
-
setProp(_el$
|
|
1680
|
-
setProp(_el$
|
|
1681
|
-
insertNode(_el$
|
|
1682
|
-
effect((_$p) => setProp(_el$
|
|
1683
|
-
return _el$
|
|
1771
|
+
var _el$33 = createElement("box"), _el$34 = createElement("text");
|
|
1772
|
+
insertNode(_el$33, _el$34);
|
|
1773
|
+
setProp(_el$33, "flexDirection", "row");
|
|
1774
|
+
setProp(_el$33, "gap", 1);
|
|
1775
|
+
insertNode(_el$34, createTextNode(`Preset: default`));
|
|
1776
|
+
effect((_$p) => setProp(_el$34, "fg", theme().textMuted, _$p));
|
|
1777
|
+
return _el$33;
|
|
1684
1778
|
})();
|
|
1685
1779
|
},
|
|
1686
1780
|
children: (name) => (() => {
|
|
1687
|
-
var _el$
|
|
1688
|
-
insertNode(_el$
|
|
1689
|
-
insertNode(_el$
|
|
1690
|
-
insertNode(_el$
|
|
1691
|
-
setProp(_el$
|
|
1692
|
-
setProp(_el$
|
|
1693
|
-
insertNode(_el$
|
|
1694
|
-
insert(_el$
|
|
1695
|
-
insert(_el$
|
|
1781
|
+
var _el$36 = createElement("box"), _el$37 = createElement("text"), _el$39 = createElement("text"), _el$40 = createElement("text");
|
|
1782
|
+
insertNode(_el$36, _el$37);
|
|
1783
|
+
insertNode(_el$36, _el$39);
|
|
1784
|
+
insertNode(_el$36, _el$40);
|
|
1785
|
+
setProp(_el$36, "flexDirection", "row");
|
|
1786
|
+
setProp(_el$36, "gap", 1);
|
|
1787
|
+
insertNode(_el$37, createTextNode(`⚡ Preset:`));
|
|
1788
|
+
insert(_el$39, name);
|
|
1789
|
+
insert(_el$40, () => `(${preset().source ?? ""})`);
|
|
1696
1790
|
effect((_p$) => {
|
|
1697
1791
|
var _v$12 = theme().textMuted, _v$13 = theme().accent, _v$14 = theme().textMuted;
|
|
1698
|
-
_v$12 !== _p$.e && (_p$.e = setProp(_el$
|
|
1699
|
-
_v$13 !== _p$.t && (_p$.t = setProp(_el$
|
|
1700
|
-
_v$14 !== _p$.a && (_p$.a = setProp(_el$
|
|
1792
|
+
_v$12 !== _p$.e && (_p$.e = setProp(_el$37, "fg", _v$12, _p$.e));
|
|
1793
|
+
_v$13 !== _p$.t && (_p$.t = setProp(_el$39, "fg", _v$13, _p$.t));
|
|
1794
|
+
_v$14 !== _p$.a && (_p$.a = setProp(_el$40, "fg", _v$14, _p$.a));
|
|
1701
1795
|
return _p$;
|
|
1702
1796
|
}, {
|
|
1703
1797
|
e: void 0,
|
|
1704
1798
|
t: void 0,
|
|
1705
1799
|
a: void 0
|
|
1706
1800
|
});
|
|
1707
|
-
return _el$
|
|
1801
|
+
return _el$36;
|
|
1708
1802
|
})()
|
|
1709
|
-
}), _el$
|
|
1710
|
-
insert(_el$
|
|
1711
|
-
insertNode(_el$
|
|
1712
|
-
insertNode(_el$
|
|
1713
|
-
setProp(_el$
|
|
1714
|
-
setProp(_el$
|
|
1715
|
-
insert(_el$
|
|
1716
|
-
insert(_el$
|
|
1717
|
-
insert(_el$
|
|
1803
|
+
}), _el$24);
|
|
1804
|
+
insert(_el$22, createComponent(HR, {}), _el$24);
|
|
1805
|
+
insertNode(_el$24, _el$25);
|
|
1806
|
+
insertNode(_el$24, _el$26);
|
|
1807
|
+
setProp(_el$24, "onMouseDown", () => setShowSessions((x) => !x));
|
|
1808
|
+
setProp(_el$25, "attributes", 1);
|
|
1809
|
+
insert(_el$25, () => `${showSessions() ? "▼" : "▶"} Sessions`);
|
|
1810
|
+
insert(_el$26, () => ` (${String(totalSessions())})`);
|
|
1811
|
+
insert(_el$22, createComponent(Show, {
|
|
1718
1812
|
get when() {
|
|
1719
1813
|
return showSessions();
|
|
1720
1814
|
},
|
|
@@ -1725,19 +1819,19 @@ function View(props) {
|
|
|
1725
1819
|
},
|
|
1726
1820
|
get fallback() {
|
|
1727
1821
|
return (() => {
|
|
1728
|
-
var _el$
|
|
1729
|
-
insertNode(_el$
|
|
1730
|
-
setProp(_el$
|
|
1731
|
-
insertNode(_el$
|
|
1732
|
-
effect((_$p) => setProp(_el$
|
|
1733
|
-
return _el$
|
|
1822
|
+
var _el$41 = createElement("box"), _el$42 = createElement("text");
|
|
1823
|
+
insertNode(_el$41, _el$42);
|
|
1824
|
+
setProp(_el$41, "marginLeft", 1);
|
|
1825
|
+
insertNode(_el$42, createTextNode(`No recent sessions`));
|
|
1826
|
+
effect((_$p) => setProp(_el$42, "fg", theme().textMuted, _$p));
|
|
1827
|
+
return _el$41;
|
|
1734
1828
|
})();
|
|
1735
1829
|
},
|
|
1736
1830
|
get children() {
|
|
1737
|
-
var _el$
|
|
1738
|
-
setProp(_el$
|
|
1739
|
-
setProp(_el$
|
|
1740
|
-
insert(_el$
|
|
1831
|
+
var _el$27 = createElement("box");
|
|
1832
|
+
setProp(_el$27, "marginLeft", 1);
|
|
1833
|
+
setProp(_el$27, "flexDirection", "column");
|
|
1834
|
+
insert(_el$27, createComponent(For, {
|
|
1741
1835
|
get each() {
|
|
1742
1836
|
return recentSessions();
|
|
1743
1837
|
},
|
|
@@ -1748,18 +1842,18 @@ function View(props) {
|
|
|
1748
1842
|
session: ses
|
|
1749
1843
|
})
|
|
1750
1844
|
}));
|
|
1751
|
-
return _el$
|
|
1845
|
+
return _el$27;
|
|
1752
1846
|
}
|
|
1753
1847
|
});
|
|
1754
1848
|
}
|
|
1755
|
-
}), _el$
|
|
1756
|
-
insertNode(_el$
|
|
1757
|
-
insertNode(_el$
|
|
1758
|
-
setProp(_el$
|
|
1759
|
-
setProp(_el$
|
|
1760
|
-
insert(_el$
|
|
1761
|
-
insert(_el$
|
|
1762
|
-
insert(_el$
|
|
1849
|
+
}), _el$28);
|
|
1850
|
+
insertNode(_el$28, _el$29);
|
|
1851
|
+
insertNode(_el$28, _el$30);
|
|
1852
|
+
setProp(_el$28, "onMouseDown", () => setShowDelegations((x) => !x));
|
|
1853
|
+
setProp(_el$29, "attributes", 1);
|
|
1854
|
+
insert(_el$29, () => `${showDelegations() ? "▼" : "▶"} Delegations`);
|
|
1855
|
+
insert(_el$30, () => ` (${String(visibleDelegations().length)})`);
|
|
1856
|
+
insert(_el$22, createComponent(Show, {
|
|
1763
1857
|
get when() {
|
|
1764
1858
|
return showDelegations();
|
|
1765
1859
|
},
|
|
@@ -1770,19 +1864,19 @@ function View(props) {
|
|
|
1770
1864
|
},
|
|
1771
1865
|
get fallback() {
|
|
1772
1866
|
return (() => {
|
|
1773
|
-
var _el$
|
|
1774
|
-
insertNode(_el$
|
|
1775
|
-
setProp(_el$
|
|
1776
|
-
insertNode(_el$
|
|
1777
|
-
effect((_$p) => setProp(_el$
|
|
1778
|
-
return _el$
|
|
1867
|
+
var _el$44 = createElement("box"), _el$45 = createElement("text");
|
|
1868
|
+
insertNode(_el$44, _el$45);
|
|
1869
|
+
setProp(_el$44, "marginLeft", 1);
|
|
1870
|
+
insertNode(_el$45, createTextNode(`No delegations`));
|
|
1871
|
+
effect((_$p) => setProp(_el$45, "fg", theme().textMuted, _$p));
|
|
1872
|
+
return _el$44;
|
|
1779
1873
|
})();
|
|
1780
1874
|
},
|
|
1781
1875
|
get children() {
|
|
1782
|
-
var _el$
|
|
1783
|
-
setProp(_el$
|
|
1784
|
-
setProp(_el$
|
|
1785
|
-
insert(_el$
|
|
1876
|
+
var _el$31 = createElement("box");
|
|
1877
|
+
setProp(_el$31, "marginLeft", 1);
|
|
1878
|
+
setProp(_el$31, "flexDirection", "column");
|
|
1879
|
+
insert(_el$31, createComponent(For, {
|
|
1786
1880
|
get each() {
|
|
1787
1881
|
return visibleDelegations();
|
|
1788
1882
|
},
|
|
@@ -1798,19 +1892,79 @@ function View(props) {
|
|
|
1798
1892
|
return animationNow();
|
|
1799
1893
|
}
|
|
1800
1894
|
})
|
|
1801
|
-
}));
|
|
1802
|
-
|
|
1895
|
+
}), null);
|
|
1896
|
+
insert(_el$31, createComponent(Show, {
|
|
1897
|
+
get when() {
|
|
1898
|
+
return delegationSplit().archived.length > 0;
|
|
1899
|
+
},
|
|
1900
|
+
get children() {
|
|
1901
|
+
return (() => {
|
|
1902
|
+
const archived = delegationSplit().archived;
|
|
1903
|
+
const pageSize = 8;
|
|
1904
|
+
const pages = Math.ceil(archived.length / pageSize);
|
|
1905
|
+
const page = Math.min(archivedPage(), pages - 1);
|
|
1906
|
+
const slice = archived.slice(page * pageSize, page * pageSize + pageSize);
|
|
1907
|
+
return (() => {
|
|
1908
|
+
var _el$47 = createElement("box"), _el$48 = createElement("box"), _el$49 = createElement("text"), _el$51 = createElement("text"), _el$52 = createElement("text"), _el$53 = createElement("text");
|
|
1909
|
+
insertNode(_el$47, _el$48);
|
|
1910
|
+
setProp(_el$47, "flexDirection", "column");
|
|
1911
|
+
insertNode(_el$48, _el$49);
|
|
1912
|
+
insertNode(_el$48, _el$51);
|
|
1913
|
+
insertNode(_el$48, _el$52);
|
|
1914
|
+
insertNode(_el$48, _el$53);
|
|
1915
|
+
setProp(_el$48, "flexDirection", "row");
|
|
1916
|
+
setProp(_el$48, "marginLeft", 0);
|
|
1917
|
+
insertNode(_el$49, createTextNode(`‹ `));
|
|
1918
|
+
setProp(_el$49, "onMouseDown", () => clampArchivedPage(page - 1, pages));
|
|
1919
|
+
insert(_el$51, () => `Archived (${archived.length}) `);
|
|
1920
|
+
insert(_el$52, `${page + 1}/${pages}`);
|
|
1921
|
+
insertNode(_el$53, createTextNode(` ›`));
|
|
1922
|
+
setProp(_el$53, "onMouseDown", () => clampArchivedPage(page + 1, pages));
|
|
1923
|
+
insert(_el$47, createComponent(For, {
|
|
1924
|
+
each: slice,
|
|
1925
|
+
children: (job) => createComponent(DelegationRow, {
|
|
1926
|
+
get api() {
|
|
1927
|
+
return props.api;
|
|
1928
|
+
},
|
|
1929
|
+
job,
|
|
1930
|
+
get now() {
|
|
1931
|
+
return now();
|
|
1932
|
+
},
|
|
1933
|
+
get animationNow() {
|
|
1934
|
+
return animationNow();
|
|
1935
|
+
}
|
|
1936
|
+
})
|
|
1937
|
+
}), null);
|
|
1938
|
+
effect((_p$) => {
|
|
1939
|
+
var _v$15 = theme().textMuted, _v$16 = theme().textMuted, _v$17 = theme().textMuted, _v$18 = theme().textMuted;
|
|
1940
|
+
_v$15 !== _p$.e && (_p$.e = setProp(_el$49, "fg", _v$15, _p$.e));
|
|
1941
|
+
_v$16 !== _p$.t && (_p$.t = setProp(_el$51, "fg", _v$16, _p$.t));
|
|
1942
|
+
_v$17 !== _p$.a && (_p$.a = setProp(_el$52, "fg", _v$17, _p$.a));
|
|
1943
|
+
_v$18 !== _p$.o && (_p$.o = setProp(_el$53, "fg", _v$18, _p$.o));
|
|
1944
|
+
return _p$;
|
|
1945
|
+
}, {
|
|
1946
|
+
e: void 0,
|
|
1947
|
+
t: void 0,
|
|
1948
|
+
a: void 0,
|
|
1949
|
+
o: void 0
|
|
1950
|
+
});
|
|
1951
|
+
return _el$47;
|
|
1952
|
+
})();
|
|
1953
|
+
})();
|
|
1954
|
+
}
|
|
1955
|
+
}), null);
|
|
1956
|
+
return _el$31;
|
|
1803
1957
|
}
|
|
1804
1958
|
});
|
|
1805
1959
|
}
|
|
1806
1960
|
}), null);
|
|
1807
1961
|
effect((_p$) => {
|
|
1808
1962
|
var _v$9 = theme().accent, _v$0 = theme().text, _v$1 = theme().textMuted, _v$10 = theme().text, _v$11 = theme().textMuted;
|
|
1809
|
-
_v$9 !== _p$.e && (_p$.e = setProp(_el$
|
|
1810
|
-
_v$0 !== _p$.t && (_p$.t = setProp(_el$
|
|
1811
|
-
_v$1 !== _p$.a && (_p$.a = setProp(_el$
|
|
1812
|
-
_v$10 !== _p$.o && (_p$.o = setProp(_el$
|
|
1813
|
-
_v$11 !== _p$.i && (_p$.i = setProp(_el$
|
|
1963
|
+
_v$9 !== _p$.e && (_p$.e = setProp(_el$23, "fg", _v$9, _p$.e));
|
|
1964
|
+
_v$0 !== _p$.t && (_p$.t = setProp(_el$25, "fg", _v$0, _p$.t));
|
|
1965
|
+
_v$1 !== _p$.a && (_p$.a = setProp(_el$26, "fg", _v$1, _p$.a));
|
|
1966
|
+
_v$10 !== _p$.o && (_p$.o = setProp(_el$29, "fg", _v$10, _p$.o));
|
|
1967
|
+
_v$11 !== _p$.i && (_p$.i = setProp(_el$30, "fg", _v$11, _p$.i));
|
|
1814
1968
|
return _p$;
|
|
1815
1969
|
}, {
|
|
1816
1970
|
e: void 0,
|
|
@@ -1819,7 +1973,7 @@ function View(props) {
|
|
|
1819
1973
|
o: void 0,
|
|
1820
1974
|
i: void 0
|
|
1821
1975
|
});
|
|
1822
|
-
return _el$
|
|
1976
|
+
return _el$22;
|
|
1823
1977
|
})();
|
|
1824
1978
|
}
|
|
1825
1979
|
const tui = (api, _options, _meta) => {
|
|
@@ -1839,6 +1993,8 @@ const tui = (api, _options, _meta) => {
|
|
|
1839
1993
|
const props = event?.properties ?? {};
|
|
1840
1994
|
const part = props.part ?? props.info?.part;
|
|
1841
1995
|
if (part === void 0) return;
|
|
1996
|
+
const sample = extractToolActivity(part);
|
|
1997
|
+
if (sample !== null) trackToolActivity(latestToolActivity, sample.sessionID, sample.activity);
|
|
1842
1998
|
if (reduceDelegationToolPart(liveStore.map, part)) liveStore.bump();
|
|
1843
1999
|
}));
|
|
1844
2000
|
} catch {}
|
|
@@ -1877,6 +2033,6 @@ const plugin = {
|
|
|
1877
2033
|
setup: async () => {}
|
|
1878
2034
|
};
|
|
1879
2035
|
//#endregion
|
|
1880
|
-
export { IDLE_SILENCE_MS, STALE_RUNNING_THRESHOLD_MS, buildChildrenPath, childStatusToState, childrenToDelegationEntries, collectDelegationToolParts, compareDelegationEntries, plugin as default, delegationActivity, delegationActivityLabel, delegationElapsed, delegationSpinnerFrame, delegationTag, fmtElapsed, isValidSessionId, markStaleIfRunning, mergeChildDelegationSources, mergeDelegationSources, navigateToDelegationSession, panelLogDir, parseDelegationMarkdown, parseDelegationToolPart, readAllDelegationEntries, readDelegationEntries, reduceDelegationToolPart, removeDelegationEntry, resolveCurrentSessionID, resolveDelegationsDir, safeSessionPath, seedLiveDelegationMap, toDelegationEntry, tuiLogPath, visibleDelegationList };
|
|
2036
|
+
export { IDLE_SILENCE_MS, STALE_RUNNING_THRESHOLD_MS, buildChildrenPath, childStatusToState, childrenToDelegationEntries, collectDelegationToolParts, compareDelegationEntries, plugin as default, delegationActivity, delegationActivityLabel, delegationElapsed, delegationSpinnerFrame, delegationTag, extractToolActivity, fmtElapsed, isValidSessionId, latestToolActivityFor, markStaleIfRunning, mergeChildDelegationSources, mergeDelegationSources, navigateToDelegationSession, panelLogDir, parseDelegationMarkdown, parseDelegationToolPart, readAllDelegationEntries, readDelegationEntries, reduceDelegationToolPart, removeDelegationEntry, resolveCurrentSessionID, resolveDelegationsDir, safeSessionPath, seedLiveDelegationMap, splitDelegationList, toDelegationEntry, trackToolActivity, tuiLogPath, visibleDelegationList };
|
|
1881
2037
|
|
|
1882
2038
|
//# sourceMappingURL=tui.js.map
|