copilot-agent 1.0.0 → 1.0.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 +59 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1921,6 +1921,58 @@ function runBlessedDashboard(refreshSec, limit) {
|
|
|
1921
1921
|
let selectedIdx = 0;
|
|
1922
1922
|
let focusedPanel = "sessions";
|
|
1923
1923
|
let lastDetailId = "";
|
|
1924
|
+
let detailDebounce = null;
|
|
1925
|
+
function showQuickPreview(s) {
|
|
1926
|
+
const project = s.cwd?.split("/").pop() || s.id.slice(0, 12);
|
|
1927
|
+
const agent = s.agent === "claude" ? "{yellow-fg}claude{/}" : "{cyan-fg}copilot{/}";
|
|
1928
|
+
const status = s.complete ? "{green-fg}\u2714 complete{/}" : "{yellow-fg}\u23F3 incomplete{/}";
|
|
1929
|
+
const lines = [
|
|
1930
|
+
`{bold}${project}{/} ${agent}`,
|
|
1931
|
+
`{gray-fg}${s.id}{/}`,
|
|
1932
|
+
"",
|
|
1933
|
+
` Status ${status}`,
|
|
1934
|
+
` Premium {yellow-fg}${s.premiumRequests}{/}`,
|
|
1935
|
+
` Activity ${fmtTimeAgo(s.mtime)}`,
|
|
1936
|
+
` Directory {gray-fg}${s.cwd || "\u2014"}{/}`,
|
|
1937
|
+
"",
|
|
1938
|
+
"{gray-fg}Loading full report\u2026{/}"
|
|
1939
|
+
];
|
|
1940
|
+
detailBox.setContent(lines.join("\n"));
|
|
1941
|
+
detailBox.setLabel(` {cyan-fg}{bold}Detail \u2014 ${s.id.slice(0, 12)}\u2026{/} `);
|
|
1942
|
+
}
|
|
1943
|
+
function scheduleDetailRender(force = false) {
|
|
1944
|
+
if (detailDebounce) clearTimeout(detailDebounce);
|
|
1945
|
+
if (sessions.length === 0 || selectedIdx < 0 || selectedIdx >= sessions.length) {
|
|
1946
|
+
detailBox.setContent("{gray-fg}No session selected{/}");
|
|
1947
|
+
lastDetailId = "";
|
|
1948
|
+
return;
|
|
1949
|
+
}
|
|
1950
|
+
const s = sessions[selectedIdx];
|
|
1951
|
+
const cached = cache.details.get(s.id);
|
|
1952
|
+
if (!force && cached && Date.now() - cached.ts < 1e4 && cached.report) {
|
|
1953
|
+
lastDetailId = s.id;
|
|
1954
|
+
detailBox.setContent(detailContent(cached.report));
|
|
1955
|
+
detailBox.setLabel(` {cyan-fg}{bold}Detail \u2014 ${s.id.slice(0, 12)}\u2026{/} `);
|
|
1956
|
+
return;
|
|
1957
|
+
}
|
|
1958
|
+
if (s.id !== lastDetailId) {
|
|
1959
|
+
showQuickPreview(s);
|
|
1960
|
+
}
|
|
1961
|
+
detailDebounce = setTimeout(() => {
|
|
1962
|
+
detailDebounce = null;
|
|
1963
|
+
if (selectedIdx < 0 || selectedIdx >= sessions.length) return;
|
|
1964
|
+
const current = sessions[selectedIdx];
|
|
1965
|
+
lastDetailId = current.id;
|
|
1966
|
+
const report = cacheDetail(cache, current);
|
|
1967
|
+
if (report) {
|
|
1968
|
+
detailBox.setContent(detailContent(report));
|
|
1969
|
+
detailBox.setLabel(` {cyan-fg}{bold}Detail \u2014 ${current.id.slice(0, 12)}\u2026{/} `);
|
|
1970
|
+
} else {
|
|
1971
|
+
detailBox.setContent(`{gray-fg}No report data for ${current.id.slice(0, 8)}\u2026{/}`);
|
|
1972
|
+
}
|
|
1973
|
+
screen.render();
|
|
1974
|
+
}, 150);
|
|
1975
|
+
}
|
|
1924
1976
|
function renderHeader() {
|
|
1925
1977
|
const time = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-GB");
|
|
1926
1978
|
const totalPremium = sessions.reduce((s, x) => s + x.premiumRequests, 0);
|
|
@@ -1946,30 +1998,13 @@ ${rows.join("\n")}`);
|
|
|
1946
1998
|
}
|
|
1947
1999
|
sessionList.setLabel(` {cyan-fg}{bold}Sessions (${sessions.length}){/} `);
|
|
1948
2000
|
}
|
|
1949
|
-
function renderDetail2(force = false) {
|
|
1950
|
-
if (sessions.length === 0 || selectedIdx < 0 || selectedIdx >= sessions.length) {
|
|
1951
|
-
detailBox.setContent("{gray-fg}No session selected{/}");
|
|
1952
|
-
lastDetailId = "";
|
|
1953
|
-
return;
|
|
1954
|
-
}
|
|
1955
|
-
const s = sessions[selectedIdx];
|
|
1956
|
-
if (!force && s.id === lastDetailId) return;
|
|
1957
|
-
lastDetailId = s.id;
|
|
1958
|
-
const report = cacheDetail(cache, s);
|
|
1959
|
-
if (report) {
|
|
1960
|
-
detailBox.setContent(detailContent(report));
|
|
1961
|
-
detailBox.setLabel(` {cyan-fg}{bold}Detail \u2014 ${s.id.slice(0, 12)}\u2026{/} `);
|
|
1962
|
-
} else {
|
|
1963
|
-
detailBox.setContent(`{gray-fg}Could not load report for ${s.id.slice(0, 8)}\u2026{/}`);
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
2001
|
function render() {
|
|
1967
2002
|
sessions = cacheSessions(cache, limit);
|
|
1968
2003
|
procs = cacheProcs(cache);
|
|
1969
2004
|
renderHeader();
|
|
1970
2005
|
renderProcesses2();
|
|
1971
2006
|
renderSessions();
|
|
1972
|
-
|
|
2007
|
+
scheduleDetailRender();
|
|
1973
2008
|
screen.render();
|
|
1974
2009
|
}
|
|
1975
2010
|
function forceRefresh() {
|
|
@@ -1980,6 +2015,7 @@ ${rows.join("\n")}`);
|
|
|
1980
2015
|
render();
|
|
1981
2016
|
}
|
|
1982
2017
|
screen.key(["q", "C-c"], () => {
|
|
2018
|
+
if (detailDebounce) clearTimeout(detailDebounce);
|
|
1983
2019
|
screen.destroy();
|
|
1984
2020
|
process.exit(0);
|
|
1985
2021
|
});
|
|
@@ -2000,14 +2036,14 @@ ${rows.join("\n")}`);
|
|
|
2000
2036
|
});
|
|
2001
2037
|
sessionList.on("select item", (_item, index) => {
|
|
2002
2038
|
selectedIdx = index;
|
|
2003
|
-
|
|
2039
|
+
scheduleDetailRender();
|
|
2004
2040
|
screen.render();
|
|
2005
2041
|
});
|
|
2006
2042
|
sessionList.key(["up", "k"], () => {
|
|
2007
2043
|
if (selectedIdx > 0) {
|
|
2008
2044
|
selectedIdx--;
|
|
2009
2045
|
sessionList.select(selectedIdx);
|
|
2010
|
-
|
|
2046
|
+
scheduleDetailRender();
|
|
2011
2047
|
screen.render();
|
|
2012
2048
|
}
|
|
2013
2049
|
});
|
|
@@ -2015,12 +2051,12 @@ ${rows.join("\n")}`);
|
|
|
2015
2051
|
if (selectedIdx < sessions.length - 1) {
|
|
2016
2052
|
selectedIdx++;
|
|
2017
2053
|
sessionList.select(selectedIdx);
|
|
2018
|
-
|
|
2054
|
+
scheduleDetailRender();
|
|
2019
2055
|
screen.render();
|
|
2020
2056
|
}
|
|
2021
2057
|
});
|
|
2022
2058
|
sessionList.key(["enter"], () => {
|
|
2023
|
-
|
|
2059
|
+
scheduleDetailRender(true);
|
|
2024
2060
|
focusedPanel = "detail";
|
|
2025
2061
|
detailBox.focus();
|
|
2026
2062
|
sessionList.style.border.fg = BORDER_COLOR;
|
|
@@ -4290,7 +4326,7 @@ function registerScheduleCommand(program2) {
|
|
|
4290
4326
|
|
|
4291
4327
|
// src/index.ts
|
|
4292
4328
|
var program = new Command();
|
|
4293
|
-
program.name("copilot-agent").version("1.0.
|
|
4329
|
+
program.name("copilot-agent").version("1.0.1").description("Autonomous AI agent manager \u2014 auto-resume, task discovery, overnight runs. Supports GitHub Copilot CLI + Claude Code.");
|
|
4294
4330
|
registerStatusCommand(program);
|
|
4295
4331
|
registerWatchCommand(program);
|
|
4296
4332
|
registerRunCommand(program);
|