open-agents-ai 0.187.57 → 0.187.59
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 +343 -96
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -85626,22 +85626,22 @@ var require_axios = __commonJS({
|
|
|
85626
85626
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
85627
85627
|
var xhrAdapter = isXHRAdapterSupported && function(config) {
|
|
85628
85628
|
return new Promise(function dispatchXhrRequest(resolve39, reject) {
|
|
85629
|
-
const
|
|
85630
|
-
let requestData =
|
|
85631
|
-
const requestHeaders = AxiosHeaders$1.from(
|
|
85632
|
-
let { responseType, onUploadProgress, onDownloadProgress } =
|
|
85629
|
+
const _config3 = resolveConfig(config);
|
|
85630
|
+
let requestData = _config3.data;
|
|
85631
|
+
const requestHeaders = AxiosHeaders$1.from(_config3.headers).normalize();
|
|
85632
|
+
let { responseType, onUploadProgress, onDownloadProgress } = _config3;
|
|
85633
85633
|
let onCanceled;
|
|
85634
85634
|
let uploadThrottled, downloadThrottled;
|
|
85635
85635
|
let flushUpload, flushDownload;
|
|
85636
85636
|
function done() {
|
|
85637
85637
|
flushUpload && flushUpload();
|
|
85638
85638
|
flushDownload && flushDownload();
|
|
85639
|
-
|
|
85640
|
-
|
|
85639
|
+
_config3.cancelToken && _config3.cancelToken.unsubscribe(onCanceled);
|
|
85640
|
+
_config3.signal && _config3.signal.removeEventListener("abort", onCanceled);
|
|
85641
85641
|
}
|
|
85642
85642
|
let request = new XMLHttpRequest();
|
|
85643
|
-
request.open(
|
|
85644
|
-
request.timeout =
|
|
85643
|
+
request.open(_config3.method.toUpperCase(), _config3.url, true);
|
|
85644
|
+
request.timeout = _config3.timeout;
|
|
85645
85645
|
function onloadend() {
|
|
85646
85646
|
if (!request) {
|
|
85647
85647
|
return;
|
|
@@ -85699,10 +85699,10 @@ var require_axios = __commonJS({
|
|
|
85699
85699
|
request = null;
|
|
85700
85700
|
};
|
|
85701
85701
|
request.ontimeout = function handleTimeout() {
|
|
85702
|
-
let timeoutErrorMessage =
|
|
85703
|
-
const transitional =
|
|
85704
|
-
if (
|
|
85705
|
-
timeoutErrorMessage =
|
|
85702
|
+
let timeoutErrorMessage = _config3.timeout ? "timeout of " + _config3.timeout + "ms exceeded" : "timeout exceeded";
|
|
85703
|
+
const transitional = _config3.transitional || transitionalDefaults;
|
|
85704
|
+
if (_config3.timeoutErrorMessage) {
|
|
85705
|
+
timeoutErrorMessage = _config3.timeoutErrorMessage;
|
|
85706
85706
|
}
|
|
85707
85707
|
reject(
|
|
85708
85708
|
new AxiosError$1(
|
|
@@ -85720,11 +85720,11 @@ var require_axios = __commonJS({
|
|
|
85720
85720
|
request.setRequestHeader(key, val);
|
|
85721
85721
|
});
|
|
85722
85722
|
}
|
|
85723
|
-
if (!utils$1.isUndefined(
|
|
85724
|
-
request.withCredentials = !!
|
|
85723
|
+
if (!utils$1.isUndefined(_config3.withCredentials)) {
|
|
85724
|
+
request.withCredentials = !!_config3.withCredentials;
|
|
85725
85725
|
}
|
|
85726
85726
|
if (responseType && responseType !== "json") {
|
|
85727
|
-
request.responseType =
|
|
85727
|
+
request.responseType = _config3.responseType;
|
|
85728
85728
|
}
|
|
85729
85729
|
if (onDownloadProgress) {
|
|
85730
85730
|
[downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
|
|
@@ -85735,7 +85735,7 @@ var require_axios = __commonJS({
|
|
|
85735
85735
|
request.upload.addEventListener("progress", uploadThrottled);
|
|
85736
85736
|
request.upload.addEventListener("loadend", flushUpload);
|
|
85737
85737
|
}
|
|
85738
|
-
if (
|
|
85738
|
+
if (_config3.cancelToken || _config3.signal) {
|
|
85739
85739
|
onCanceled = (cancel) => {
|
|
85740
85740
|
if (!request) {
|
|
85741
85741
|
return;
|
|
@@ -85744,12 +85744,12 @@ var require_axios = __commonJS({
|
|
|
85744
85744
|
request.abort();
|
|
85745
85745
|
request = null;
|
|
85746
85746
|
};
|
|
85747
|
-
|
|
85748
|
-
if (
|
|
85749
|
-
|
|
85747
|
+
_config3.cancelToken && _config3.cancelToken.subscribe(onCanceled);
|
|
85748
|
+
if (_config3.signal) {
|
|
85749
|
+
_config3.signal.aborted ? onCanceled() : _config3.signal.addEventListener("abort", onCanceled);
|
|
85750
85750
|
}
|
|
85751
85751
|
}
|
|
85752
|
-
const protocol = parseProtocol(
|
|
85752
|
+
const protocol = parseProtocol(_config3.url);
|
|
85753
85753
|
if (protocol && platform6.protocols.indexOf(protocol) === -1) {
|
|
85754
85754
|
reject(
|
|
85755
85755
|
new AxiosError$1(
|
|
@@ -271208,7 +271208,7 @@ function formatDuration2(ms) {
|
|
|
271208
271208
|
const secs = Math.floor(totalSecs % 60);
|
|
271209
271209
|
return `${mins}m ${secs}s`;
|
|
271210
271210
|
}
|
|
271211
|
-
var isTTY2, c3,
|
|
271211
|
+
var isTTY2, c3, _emojisEnabled, _colorsEnabled, MD, TOOL_ICONS, TOOL_LABELS, accent, accentBright, accentDim, accentWarm, accentSoft, TOOL_COLORS, _contentWriteHook, SLASH_COMMANDS;
|
|
271212
271212
|
var init_render = __esm({
|
|
271213
271213
|
"packages/cli/dist/tui/render.js"() {
|
|
271214
271214
|
"use strict";
|
|
@@ -271227,19 +271227,7 @@ var init_render = __esm({
|
|
|
271227
271227
|
bgBlue: (t2) => ansi2("44", t2),
|
|
271228
271228
|
bgGreen: (t2) => ansi2("42", t2)
|
|
271229
271229
|
};
|
|
271230
|
-
|
|
271231
|
-
pink: (t2) => fg256(218, t2),
|
|
271232
|
-
peach: (t2) => fg256(216, t2),
|
|
271233
|
-
lavender: (t2) => fg256(183, t2),
|
|
271234
|
-
mint: (t2) => fg256(158, t2),
|
|
271235
|
-
sky: (t2) => fg256(117, t2),
|
|
271236
|
-
coral: (t2) => fg256(209, t2),
|
|
271237
|
-
lilac: (t2) => fg256(177, t2),
|
|
271238
|
-
sage: (t2) => fg256(151, t2),
|
|
271239
|
-
butter: (t2) => fg256(229, t2),
|
|
271240
|
-
ice: (t2) => fg256(153, t2)
|
|
271241
|
-
};
|
|
271242
|
-
_emojisEnabled = true;
|
|
271230
|
+
_emojisEnabled = false;
|
|
271243
271231
|
_colorsEnabled = true;
|
|
271244
271232
|
MD = {
|
|
271245
271233
|
heading1: 75,
|
|
@@ -271333,37 +271321,42 @@ var init_render = __esm({
|
|
|
271333
271321
|
// User interaction
|
|
271334
271322
|
ask_user: "Ask user"
|
|
271335
271323
|
};
|
|
271324
|
+
accent = (t2) => fg256(178, t2);
|
|
271325
|
+
accentBright = (t2) => fg256(220, t2);
|
|
271326
|
+
accentDim = (t2) => fg256(136, t2);
|
|
271327
|
+
accentWarm = (t2) => fg256(214, t2);
|
|
271328
|
+
accentSoft = (t2) => fg256(180, t2);
|
|
271336
271329
|
TOOL_COLORS = {
|
|
271337
|
-
file_read:
|
|
271338
|
-
file_write:
|
|
271339
|
-
file_edit:
|
|
271340
|
-
shell:
|
|
271341
|
-
grep_search:
|
|
271342
|
-
find_files:
|
|
271343
|
-
list_directory:
|
|
271344
|
-
web_search:
|
|
271345
|
-
web_fetch:
|
|
271346
|
-
memory_read:
|
|
271347
|
-
memory_write:
|
|
271348
|
-
task_complete:
|
|
271349
|
-
aiwg_setup:
|
|
271350
|
-
aiwg_health:
|
|
271351
|
-
aiwg_workflow:
|
|
271352
|
-
batch_edit:
|
|
271353
|
-
codebase_map:
|
|
271354
|
-
diagnostic:
|
|
271355
|
-
git_info:
|
|
271356
|
-
background_run:
|
|
271357
|
-
task_status:
|
|
271358
|
-
task_output:
|
|
271359
|
-
task_stop:
|
|
271360
|
-
sub_agent:
|
|
271361
|
-
image_read:
|
|
271362
|
-
screenshot:
|
|
271363
|
-
ocr:
|
|
271364
|
-
transcribe_file:
|
|
271365
|
-
transcribe_url:
|
|
271366
|
-
ask_user:
|
|
271330
|
+
file_read: accentSoft,
|
|
271331
|
+
file_write: accentWarm,
|
|
271332
|
+
file_edit: accentWarm,
|
|
271333
|
+
shell: accentBright,
|
|
271334
|
+
grep_search: accentDim,
|
|
271335
|
+
find_files: accentDim,
|
|
271336
|
+
list_directory: accentDim,
|
|
271337
|
+
web_search: accent,
|
|
271338
|
+
web_fetch: accent,
|
|
271339
|
+
memory_read: accentSoft,
|
|
271340
|
+
memory_write: accentSoft,
|
|
271341
|
+
task_complete: accentBright,
|
|
271342
|
+
aiwg_setup: accentDim,
|
|
271343
|
+
aiwg_health: accentDim,
|
|
271344
|
+
aiwg_workflow: accentDim,
|
|
271345
|
+
batch_edit: accentWarm,
|
|
271346
|
+
codebase_map: accentDim,
|
|
271347
|
+
diagnostic: accentWarm,
|
|
271348
|
+
git_info: accentDim,
|
|
271349
|
+
background_run: accent,
|
|
271350
|
+
task_status: accent,
|
|
271351
|
+
task_output: accent,
|
|
271352
|
+
task_stop: accent,
|
|
271353
|
+
sub_agent: accentBright,
|
|
271354
|
+
image_read: accentSoft,
|
|
271355
|
+
screenshot: accentSoft,
|
|
271356
|
+
ocr: accentSoft,
|
|
271357
|
+
transcribe_file: accentWarm,
|
|
271358
|
+
transcribe_url: accentWarm,
|
|
271359
|
+
ask_user: accentBright
|
|
271367
271360
|
};
|
|
271368
271361
|
_contentWriteHook = null;
|
|
271369
271362
|
SLASH_COMMANDS = [
|
|
@@ -276136,17 +276129,20 @@ var oa_directory_exports = {};
|
|
|
276136
276129
|
__export(oa_directory_exports, {
|
|
276137
276130
|
OA_DIR: () => OA_DIR,
|
|
276138
276131
|
buildContextRestorePrompt: () => buildContextRestorePrompt,
|
|
276132
|
+
deleteSession: () => deleteSession,
|
|
276139
276133
|
deleteUsageRecord: () => deleteUsageRecord,
|
|
276140
276134
|
discoverContextFiles: () => discoverContextFiles,
|
|
276141
276135
|
generateProjectMap: () => generateProjectMap,
|
|
276142
276136
|
getLastTaskSummary: () => getLastTaskSummary,
|
|
276143
276137
|
hasOaDirectory: () => hasOaDirectory,
|
|
276144
276138
|
initOaDirectory: () => initOaDirectory,
|
|
276139
|
+
listSessions: () => listSessions,
|
|
276145
276140
|
loadGlobalSettings: () => loadGlobalSettings,
|
|
276146
276141
|
loadPendingTask: () => loadPendingTask,
|
|
276147
276142
|
loadProjectSettings: () => loadProjectSettings,
|
|
276148
276143
|
loadRecentSessions: () => loadRecentSessions,
|
|
276149
276144
|
loadSessionContext: () => loadSessionContext,
|
|
276145
|
+
loadSessionHistory: () => loadSessionHistory,
|
|
276150
276146
|
loadUsageHistory: () => loadUsageHistory,
|
|
276151
276147
|
readIndexData: () => readIndexData,
|
|
276152
276148
|
readIndexMeta: () => readIndexMeta,
|
|
@@ -276157,6 +276153,7 @@ __export(oa_directory_exports, {
|
|
|
276157
276153
|
saveProjectSettings: () => saveProjectSettings,
|
|
276158
276154
|
saveSession: () => saveSession,
|
|
276159
276155
|
saveSessionContext: () => saveSessionContext,
|
|
276156
|
+
saveSessionHistory: () => saveSessionHistory,
|
|
276160
276157
|
writeIndexData: () => writeIndexData,
|
|
276161
276158
|
writeIndexMeta: () => writeIndexMeta
|
|
276162
276159
|
});
|
|
@@ -276476,6 +276473,111 @@ function getLastTaskSummary(repoRoot) {
|
|
|
276476
276473
|
const clean3 = text.replace(/^\[.*?\]\s*/, "").replace(/\s+/g, " ").trim();
|
|
276477
276474
|
return clean3.length > 40 ? clean3.slice(0, 37) + "..." : clean3;
|
|
276478
276475
|
}
|
|
276476
|
+
function saveSessionHistory(repoRoot, sessionId, contentLines, meta) {
|
|
276477
|
+
const sessDir = join58(repoRoot, OA_DIR, SESSIONS_DIR);
|
|
276478
|
+
mkdirSync16(sessDir, { recursive: true });
|
|
276479
|
+
const stripped = contentLines.map((line) => typeof line === "string" ? line.replace(/\x1B\[[0-9;]*[a-zA-Z]/g, "") : "");
|
|
276480
|
+
const autoName = meta.name || generateSessionName(stripped);
|
|
276481
|
+
const autoDesc = meta.description || generateSessionDescription(stripped);
|
|
276482
|
+
const contentPath = join58(sessDir, `${sessionId}.jsonl`);
|
|
276483
|
+
writeFileSync17(contentPath, stripped.join("\n"), "utf-8");
|
|
276484
|
+
const indexPath = join58(sessDir, SESSIONS_INDEX);
|
|
276485
|
+
let index = [];
|
|
276486
|
+
try {
|
|
276487
|
+
if (existsSync41(indexPath)) {
|
|
276488
|
+
index = JSON.parse(readFileSync31(indexPath, "utf-8"));
|
|
276489
|
+
}
|
|
276490
|
+
} catch {
|
|
276491
|
+
}
|
|
276492
|
+
const existing = index.findIndex((s2) => s2.id === sessionId);
|
|
276493
|
+
const record = {
|
|
276494
|
+
id: sessionId,
|
|
276495
|
+
name: autoName,
|
|
276496
|
+
description: autoDesc,
|
|
276497
|
+
createdAt: existing >= 0 ? index[existing].createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
276498
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
276499
|
+
taskCount: meta.taskCount ?? 1,
|
|
276500
|
+
model: meta.model ?? "unknown"
|
|
276501
|
+
};
|
|
276502
|
+
if (existing >= 0) {
|
|
276503
|
+
index[existing] = record;
|
|
276504
|
+
} else {
|
|
276505
|
+
index.push(record);
|
|
276506
|
+
}
|
|
276507
|
+
if (index.length > 50) {
|
|
276508
|
+
const removed = index.shift();
|
|
276509
|
+
try {
|
|
276510
|
+
unlinkSync7(join58(sessDir, `${removed.id}.jsonl`));
|
|
276511
|
+
} catch {
|
|
276512
|
+
}
|
|
276513
|
+
}
|
|
276514
|
+
writeFileSync17(indexPath, JSON.stringify(index, null, 2), "utf-8");
|
|
276515
|
+
}
|
|
276516
|
+
function listSessions(repoRoot) {
|
|
276517
|
+
const indexPath = join58(repoRoot, OA_DIR, SESSIONS_DIR, SESSIONS_INDEX);
|
|
276518
|
+
try {
|
|
276519
|
+
if (!existsSync41(indexPath))
|
|
276520
|
+
return [];
|
|
276521
|
+
const index = JSON.parse(readFileSync31(indexPath, "utf-8"));
|
|
276522
|
+
return index.sort((a2, b) => b.updatedAt.localeCompare(a2.updatedAt));
|
|
276523
|
+
} catch {
|
|
276524
|
+
return [];
|
|
276525
|
+
}
|
|
276526
|
+
}
|
|
276527
|
+
function loadSessionHistory(repoRoot, sessionId) {
|
|
276528
|
+
const contentPath = join58(repoRoot, OA_DIR, SESSIONS_DIR, `${sessionId}.jsonl`);
|
|
276529
|
+
try {
|
|
276530
|
+
if (!existsSync41(contentPath))
|
|
276531
|
+
return null;
|
|
276532
|
+
return readFileSync31(contentPath, "utf-8").split("\n");
|
|
276533
|
+
} catch {
|
|
276534
|
+
return null;
|
|
276535
|
+
}
|
|
276536
|
+
}
|
|
276537
|
+
function deleteSession(repoRoot, sessionId) {
|
|
276538
|
+
const sessDir = join58(repoRoot, OA_DIR, SESSIONS_DIR);
|
|
276539
|
+
const indexPath = join58(sessDir, SESSIONS_INDEX);
|
|
276540
|
+
try {
|
|
276541
|
+
const contentPath = join58(sessDir, `${sessionId}.jsonl`);
|
|
276542
|
+
if (existsSync41(contentPath))
|
|
276543
|
+
unlinkSync7(contentPath);
|
|
276544
|
+
if (existsSync41(indexPath)) {
|
|
276545
|
+
let index = JSON.parse(readFileSync31(indexPath, "utf-8"));
|
|
276546
|
+
index = index.filter((s2) => s2.id !== sessionId);
|
|
276547
|
+
writeFileSync17(indexPath, JSON.stringify(index, null, 2), "utf-8");
|
|
276548
|
+
}
|
|
276549
|
+
return true;
|
|
276550
|
+
} catch {
|
|
276551
|
+
return false;
|
|
276552
|
+
}
|
|
276553
|
+
}
|
|
276554
|
+
function generateSessionName(lines) {
|
|
276555
|
+
for (const line of lines.slice(0, 30)) {
|
|
276556
|
+
const clean3 = line.trim();
|
|
276557
|
+
if (clean3.length > 10 && !clean3.startsWith("i ") && !clean3.startsWith(" ")) {
|
|
276558
|
+
const phrase = clean3.replace(/^[>❯▹]\s*/, "").slice(0, 40);
|
|
276559
|
+
return phrase.length > 37 ? phrase.slice(0, 37) + "..." : phrase;
|
|
276560
|
+
}
|
|
276561
|
+
}
|
|
276562
|
+
return `Session ${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}`;
|
|
276563
|
+
}
|
|
276564
|
+
function generateSessionDescription(lines) {
|
|
276565
|
+
const topics = [];
|
|
276566
|
+
const seen = /* @__PURE__ */ new Set();
|
|
276567
|
+
for (const line of lines) {
|
|
276568
|
+
const fileMatch = line.match(/(?:Read|Write|Edit|Shell):\s*(.+)/);
|
|
276569
|
+
if (fileMatch) {
|
|
276570
|
+
const file = fileMatch[1].trim().slice(0, 30);
|
|
276571
|
+
if (!seen.has(file)) {
|
|
276572
|
+
topics.push(file);
|
|
276573
|
+
seen.add(file);
|
|
276574
|
+
}
|
|
276575
|
+
}
|
|
276576
|
+
if (topics.length >= 3)
|
|
276577
|
+
break;
|
|
276578
|
+
}
|
|
276579
|
+
return topics.length > 0 ? topics.join(", ") : "General session";
|
|
276580
|
+
}
|
|
276479
276581
|
function detectManifests(repoRoot) {
|
|
276480
276582
|
const manifests = [];
|
|
276481
276583
|
const checks = [
|
|
@@ -276653,7 +276755,7 @@ function deleteUsageRecord(kind, value2, repoRoot) {
|
|
|
276653
276755
|
remove(join58(repoRoot, OA_DIR, USAGE_HISTORY_FILE));
|
|
276654
276756
|
}
|
|
276655
276757
|
}
|
|
276656
|
-
var OA_DIR, SUBDIRS, CONTEXT_FILES, PENDING_TASK_FILE, CONTEXT_SAVE_FILE, MAX_CONTEXT_ENTRIES, SKIP_DIRS, USAGE_HISTORY_FILE, MAX_HISTORY_RECORDS;
|
|
276758
|
+
var OA_DIR, SUBDIRS, CONTEXT_FILES, PENDING_TASK_FILE, CONTEXT_SAVE_FILE, MAX_CONTEXT_ENTRIES, SESSIONS_DIR, SESSIONS_INDEX, SKIP_DIRS, USAGE_HISTORY_FILE, MAX_HISTORY_RECORDS;
|
|
276657
276759
|
var init_oa_directory = __esm({
|
|
276658
276760
|
"packages/cli/dist/tui/oa-directory.js"() {
|
|
276659
276761
|
"use strict";
|
|
@@ -276672,6 +276774,8 @@ var init_oa_directory = __esm({
|
|
|
276672
276774
|
PENDING_TASK_FILE = "pending-task.json";
|
|
276673
276775
|
CONTEXT_SAVE_FILE = "session-context.json";
|
|
276674
276776
|
MAX_CONTEXT_ENTRIES = 20;
|
|
276777
|
+
SESSIONS_DIR = "sessions";
|
|
276778
|
+
SESSIONS_INDEX = "sessions-index.json";
|
|
276675
276779
|
SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
276676
276780
|
"node_modules",
|
|
276677
276781
|
".git",
|
|
@@ -276696,6 +276800,57 @@ var init_oa_directory = __esm({
|
|
|
276696
276800
|
}
|
|
276697
276801
|
});
|
|
276698
276802
|
|
|
276803
|
+
// packages/cli/dist/tui/theme.js
|
|
276804
|
+
function setThemeMode(mode) {
|
|
276805
|
+
_config2 = { ...PRESETS[mode] };
|
|
276806
|
+
}
|
|
276807
|
+
function getThemeConfig() {
|
|
276808
|
+
return _config2;
|
|
276809
|
+
}
|
|
276810
|
+
var PRESETS, _config2;
|
|
276811
|
+
var init_theme = __esm({
|
|
276812
|
+
"packages/cli/dist/tui/theme.js"() {
|
|
276813
|
+
"use strict";
|
|
276814
|
+
PRESETS = {
|
|
276815
|
+
system: {
|
|
276816
|
+
mode: "system",
|
|
276817
|
+
bg: -1,
|
|
276818
|
+
// terminal default background
|
|
276819
|
+
accent: -1,
|
|
276820
|
+
// terminal default foreground
|
|
276821
|
+
textPrimary: -1,
|
|
276822
|
+
// terminal default foreground
|
|
276823
|
+
textDim: 245,
|
|
276824
|
+
// slightly dim
|
|
276825
|
+
boxColor: -1
|
|
276826
|
+
// terminal default foreground
|
|
276827
|
+
},
|
|
276828
|
+
branding: {
|
|
276829
|
+
mode: "branding",
|
|
276830
|
+
bg: 0,
|
|
276831
|
+
// black
|
|
276832
|
+
accent: 178,
|
|
276833
|
+
// #ffae00 yellow
|
|
276834
|
+
textPrimary: 178,
|
|
276835
|
+
// #ffae00 yellow
|
|
276836
|
+
textDim: 240,
|
|
276837
|
+
// grey
|
|
276838
|
+
boxColor: 178
|
|
276839
|
+
// #ffae00 yellow
|
|
276840
|
+
},
|
|
276841
|
+
custom: {
|
|
276842
|
+
mode: "custom",
|
|
276843
|
+
bg: 0,
|
|
276844
|
+
accent: 178,
|
|
276845
|
+
textPrimary: 252,
|
|
276846
|
+
textDim: 245,
|
|
276847
|
+
boxColor: 252
|
|
276848
|
+
}
|
|
276849
|
+
};
|
|
276850
|
+
_config2 = { ...PRESETS.branding };
|
|
276851
|
+
}
|
|
276852
|
+
});
|
|
276853
|
+
|
|
276699
276854
|
// packages/cli/dist/tui/overlay-lock.js
|
|
276700
276855
|
var overlay_lock_exports = {};
|
|
276701
276856
|
__export(overlay_lock_exports, {
|
|
@@ -285603,6 +285758,17 @@ async function handleSlashCommand(input, ctx3) {
|
|
|
285603
285758
|
await showConfigEditor(ctx3);
|
|
285604
285759
|
return "handled";
|
|
285605
285760
|
}
|
|
285761
|
+
case "color":
|
|
285762
|
+
case "colors":
|
|
285763
|
+
case "theme": {
|
|
285764
|
+
await showColorMenu(ctx3);
|
|
285765
|
+
return "handled";
|
|
285766
|
+
}
|
|
285767
|
+
case "sessions":
|
|
285768
|
+
case "session": {
|
|
285769
|
+
await showSessionsMenu(ctx3);
|
|
285770
|
+
return "handled";
|
|
285771
|
+
}
|
|
285606
285772
|
case "cost":
|
|
285607
285773
|
case "costs":
|
|
285608
285774
|
if (ctx3.costTracker) {
|
|
@@ -288213,6 +288379,78 @@ The session corrections MUST become hard rules in the SKILL.md Rules section.`;
|
|
|
288213
288379
|
}
|
|
288214
288380
|
}
|
|
288215
288381
|
}
|
|
288382
|
+
async function showSessionsMenu(ctx3) {
|
|
288383
|
+
const sessions2 = listSessions(ctx3.repoRoot);
|
|
288384
|
+
if (sessions2.length === 0) {
|
|
288385
|
+
renderInfo("No saved sessions found. Sessions are saved automatically after each task.");
|
|
288386
|
+
return;
|
|
288387
|
+
}
|
|
288388
|
+
const items = sessions2.map((s2) => {
|
|
288389
|
+
const date = s2.updatedAt.slice(0, 16).replace("T", " ");
|
|
288390
|
+
const tasks = s2.taskCount > 1 ? `${s2.taskCount} tasks` : "1 task";
|
|
288391
|
+
return {
|
|
288392
|
+
key: s2.id,
|
|
288393
|
+
label: `${s2.name}`,
|
|
288394
|
+
detail: `${date} | ${tasks} | ${s2.model}`
|
|
288395
|
+
};
|
|
288396
|
+
});
|
|
288397
|
+
const result = await tuiSelect({
|
|
288398
|
+
items,
|
|
288399
|
+
title: "Session History",
|
|
288400
|
+
onDelete: async (item) => {
|
|
288401
|
+
deleteSession(ctx3.repoRoot, item.key);
|
|
288402
|
+
return true;
|
|
288403
|
+
}
|
|
288404
|
+
});
|
|
288405
|
+
if (!result || result.key === "cancel")
|
|
288406
|
+
return;
|
|
288407
|
+
const content = loadSessionHistory(ctx3.repoRoot, result.key);
|
|
288408
|
+
if (!content || content.length === 0) {
|
|
288409
|
+
renderWarning("Session content not found or empty.");
|
|
288410
|
+
return;
|
|
288411
|
+
}
|
|
288412
|
+
const session = sessions2.find((s2) => s2.id === result.key);
|
|
288413
|
+
renderInfo(`Loading session: ${session?.name ?? result.key} (${content.length} lines)`);
|
|
288414
|
+
for (const line of content) {
|
|
288415
|
+
process.stdout.write(` ${line}
|
|
288416
|
+
`);
|
|
288417
|
+
}
|
|
288418
|
+
renderInfo("Session history loaded. Scroll up to review.");
|
|
288419
|
+
}
|
|
288420
|
+
async function showColorMenu(_ctx) {
|
|
288421
|
+
const currentConfig = getThemeConfig();
|
|
288422
|
+
const items = [
|
|
288423
|
+
{
|
|
288424
|
+
key: "system",
|
|
288425
|
+
label: `System defaults${currentConfig.mode === "system" ? " (active)" : ""}`,
|
|
288426
|
+
detail: "Inherit terminal fg/bg colors"
|
|
288427
|
+
},
|
|
288428
|
+
{
|
|
288429
|
+
key: "branding",
|
|
288430
|
+
label: `OA Branding${currentConfig.mode === "branding" ? " (active)" : ""}`,
|
|
288431
|
+
detail: "#ffae00 accent on black"
|
|
288432
|
+
},
|
|
288433
|
+
{
|
|
288434
|
+
key: "custom",
|
|
288435
|
+
label: `Custom${currentConfig.mode === "custom" ? " (active)" : ""}`,
|
|
288436
|
+
detail: "User-defined overrides"
|
|
288437
|
+
}
|
|
288438
|
+
];
|
|
288439
|
+
const result = await tuiSelect({
|
|
288440
|
+
items,
|
|
288441
|
+
title: "Color Theme"
|
|
288442
|
+
});
|
|
288443
|
+
if (!result || result.key === "cancel")
|
|
288444
|
+
return;
|
|
288445
|
+
setThemeMode(result.key);
|
|
288446
|
+
renderInfo(`Theme set to: ${result.key}`);
|
|
288447
|
+
try {
|
|
288448
|
+
const settings = loadGlobalSettings();
|
|
288449
|
+
settings.colorTheme = result.key;
|
|
288450
|
+
saveGlobalSettings(settings);
|
|
288451
|
+
} catch {
|
|
288452
|
+
}
|
|
288453
|
+
}
|
|
288216
288454
|
async function showConfigEditor(ctx3) {
|
|
288217
288455
|
const merged = { ...loadGlobalSettings(), ...loadProjectSettings(ctx3.repoRoot) };
|
|
288218
288456
|
const pendingChanges = {};
|
|
@@ -291084,6 +291322,7 @@ var init_commands = __esm({
|
|
|
291084
291322
|
init_dist8();
|
|
291085
291323
|
init_updater();
|
|
291086
291324
|
init_oa_directory();
|
|
291325
|
+
init_theme();
|
|
291087
291326
|
init_setup();
|
|
291088
291327
|
init_listen();
|
|
291089
291328
|
init_dist();
|
|
@@ -291223,7 +291462,7 @@ function loadMemoryDir(memDir, scope) {
|
|
|
291223
291462
|
}
|
|
291224
291463
|
return lines.join("\n");
|
|
291225
291464
|
}
|
|
291226
|
-
function
|
|
291465
|
+
function loadSessionHistory2(repoRoot) {
|
|
291227
291466
|
const sessions2 = loadRecentSessions(repoRoot, 5);
|
|
291228
291467
|
if (sessions2.length === 0)
|
|
291229
291468
|
return "";
|
|
@@ -291326,7 +291565,7 @@ function buildProjectContext(repoRoot, stores) {
|
|
|
291326
291565
|
projectMap: loadProjectMap(repoRoot),
|
|
291327
291566
|
gitInfo: getGitInfo(repoRoot),
|
|
291328
291567
|
memoryContext: loadMemoryContext(repoRoot),
|
|
291329
|
-
sessionHistory:
|
|
291568
|
+
sessionHistory: loadSessionHistory2(repoRoot),
|
|
291330
291569
|
environment: getEnvironment(repoRoot),
|
|
291331
291570
|
taskMemories: stores?.taskMemoryStore ? loadTaskMemories(repoRoot, stores.taskMemoryStore) : "",
|
|
291332
291571
|
failurePatterns: stores?.failureStore ? loadFailurePatterns(stores.failureStore) : "",
|
|
@@ -299242,13 +299481,6 @@ var init_text_selection = __esm({
|
|
|
299242
299481
|
}
|
|
299243
299482
|
});
|
|
299244
299483
|
|
|
299245
|
-
// packages/cli/dist/tui/theme.js
|
|
299246
|
-
var init_theme = __esm({
|
|
299247
|
-
"packages/cli/dist/tui/theme.js"() {
|
|
299248
|
-
"use strict";
|
|
299249
|
-
}
|
|
299250
|
-
});
|
|
299251
|
-
|
|
299252
299484
|
// packages/cli/dist/tui/status-bar.js
|
|
299253
299485
|
import { readFileSync as readFileSync45 } from "node:fs";
|
|
299254
299486
|
function setTerminalTitle(task, version4) {
|
|
@@ -301014,8 +301246,8 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301014
301246
|
buildMetricsLine() {
|
|
301015
301247
|
const m2 = this.metrics;
|
|
301016
301248
|
const termWidth = getTermWidth();
|
|
301017
|
-
const
|
|
301018
|
-
const pipe3 =
|
|
301249
|
+
const pastel = (code8, s2) => `${PANEL_BG_SEQ}\x1B[38;5;${code8}m${s2}\x1B[0m${PANEL_BG_SEQ}`;
|
|
301250
|
+
const pipe3 = pastel(60, " \u2502 ");
|
|
301019
301251
|
const pipeW = 3;
|
|
301020
301252
|
const sections = [];
|
|
301021
301253
|
const compactOrder = [];
|
|
@@ -301029,8 +301261,8 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301029
301261
|
const effectiveOut = this.effectiveCompletionTokens;
|
|
301030
301262
|
const tokOutRaw = effectiveOut > 0 ? effectiveOut : Math.ceil(m2.totalTokens > 0 ? m2.totalTokens - m2.promptTokens : m2.estimatedContextTokens * 0.3);
|
|
301031
301263
|
const tokOutVal = Math.max(0, tokOutRaw);
|
|
301032
|
-
const tokExpanded =
|
|
301033
|
-
const tokCompact =
|
|
301264
|
+
const tokExpanded = pastel(117, "\u2191") + c3.bold(tokInRaw.toLocaleString()) + " " + pastel(151, "\u2193") + c3.bold(tokOutVal.toLocaleString());
|
|
301265
|
+
const tokCompact = pastel(117, "\u2191") + c3.bold(_StatusBar.compactNum(tokInRaw)) + " " + pastel(151, "\u2193") + c3.bold(_StatusBar.compactNum(tokOutVal));
|
|
301034
301266
|
const tokExpW = 1 + tokInRaw.toLocaleString().length + 1 + 1 + tokOutVal.toLocaleString().length;
|
|
301035
301267
|
const tokCompW = 1 + _StatusBar.compactNum(tokInRaw).length + 1 + 1 + _StatusBar.compactNum(tokOutVal).length;
|
|
301036
301268
|
sections.push({ expanded: tokExpanded, compact: tokCompact, expandedW: tokExpW, compactW: tokCompW, empty: false });
|
|
@@ -301062,14 +301294,14 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301062
301294
|
if (this._modelName) {
|
|
301063
301295
|
const paramMatch = this._modelName.match(/(\d+\.?\d*[bBmM])/);
|
|
301064
301296
|
const paramStr = paramMatch ? paramMatch[1] : this._modelName.split(":")[0]?.split("/").pop() ?? this._modelName;
|
|
301065
|
-
const modelExpanded =
|
|
301066
|
-
const modelCompact = (capParts.length > 0 ?
|
|
301297
|
+
const modelExpanded = pastel(146, this._modelName) + (capsStr ? " " + pastel(183, capParts.join(" ")) : "") + ctxSuffix;
|
|
301298
|
+
const modelCompact = (capParts.length > 0 ? pastel(183, capParts.join(" ")) : pastel(146, paramStr)) + ctxCompSuffix;
|
|
301067
301299
|
const expW = this._modelName.length + capsVisW + ctxSuffixW;
|
|
301068
301300
|
const compW = (capParts.length > 0 ? capParts.length * 2 + (capParts.length - 1) : paramStr.length) + ctxCompSuffixW;
|
|
301069
301301
|
modelSectionIdx = sections.length;
|
|
301070
301302
|
sections.push({ expanded: modelExpanded, compact: modelCompact, expandedW: expW, compactW: compW, empty: false });
|
|
301071
301303
|
} else if (capParts.length > 0) {
|
|
301072
|
-
const capsOnly =
|
|
301304
|
+
const capsOnly = pastel(183, capParts.join(" ")) + ctxCompSuffix;
|
|
301073
301305
|
const capsOnlyW = capParts.length * 2 + (capParts.length - 1) + ctxCompSuffixW;
|
|
301074
301306
|
sections.push({ expanded: capsOnly, compact: capsOnly, expandedW: capsOnlyW, compactW: capsOnlyW, empty: false });
|
|
301075
301307
|
} else if (ctxTotal > 0) {
|
|
@@ -301081,13 +301313,13 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301081
301313
|
const snrColor = snrPct >= 70 ? c3.green : snrPct >= 40 ? c3.yellow : c3.red;
|
|
301082
301314
|
const dPrimeStr = this._snr.dPrime.toFixed(1);
|
|
301083
301315
|
const capStr = this._snr.capacityWarning ? c3.red(" !CAP") : "";
|
|
301084
|
-
const snrExpanded =
|
|
301316
|
+
const snrExpanded = pastel(183, "SNR ") + snrColor(c3.bold(`${snrPct}%`)) + c3.dim(` d'${dPrimeStr}`) + capStr;
|
|
301085
301317
|
const snrCompact = snrColor(`${snrPct}%`);
|
|
301086
301318
|
const expW = 4 + `${snrPct}%`.length + 3 + dPrimeStr.length + (this._snr.capacityWarning ? 5 : 0);
|
|
301087
301319
|
sections.push({ expanded: snrExpanded, compact: snrCompact, expandedW: expW, compactW: `${snrPct}%`.length, empty: false });
|
|
301088
301320
|
}
|
|
301089
301321
|
if (this._emotion) {
|
|
301090
|
-
const emotionExpanded = this._emotion.emoji + " " +
|
|
301322
|
+
const emotionExpanded = this._emotion.emoji + " " + pastel(183, this._emotion.label);
|
|
301091
301323
|
const emotionCompact = this._emotion.emoji;
|
|
301092
301324
|
sections.push({
|
|
301093
301325
|
expanded: emotionExpanded,
|
|
@@ -301102,7 +301334,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301102
301334
|
if (ratio > 0) {
|
|
301103
301335
|
const ratioStr = ratio >= 10 ? `${Math.round(ratio)}x` : `${ratio.toFixed(1)}x`;
|
|
301104
301336
|
const ratioColor = ratio >= 2 ? c3.green : ratio >= 1 ? c3.yellow : c3.red;
|
|
301105
|
-
const speedExpanded =
|
|
301337
|
+
const speedExpanded = pastel(218, "Exp ") + ratioColor(c3.bold(ratioStr));
|
|
301106
301338
|
sections.push({
|
|
301107
301339
|
expanded: speedExpanded,
|
|
301108
301340
|
compact: speedExpanded,
|
|
@@ -301114,7 +301346,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301114
301346
|
}
|
|
301115
301347
|
if (m2.hasPricing && m2.estimatedCost !== void 0) {
|
|
301116
301348
|
const costStr = m2.estimatedCost < 0.01 ? `$${m2.estimatedCost.toFixed(4)}` : m2.estimatedCost < 1 ? `$${m2.estimatedCost.toFixed(3)}` : `$${m2.estimatedCost.toFixed(2)}`;
|
|
301117
|
-
const costExpanded =
|
|
301349
|
+
const costExpanded = pastel(222, "Cost ") + c3.bold(costStr);
|
|
301118
301350
|
const costCompact = c3.bold(costStr);
|
|
301119
301351
|
sections.push({
|
|
301120
301352
|
expanded: costExpanded,
|
|
@@ -301137,8 +301369,8 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301137
301369
|
const visibleReqs = Array.from(this._expose.modelUsage.entries()).filter(([m3]) => !INTERNAL_CAPS.has(m3)).reduce((sum, [, n2]) => sum + n2, 0);
|
|
301138
301370
|
const reqStr = visibleReqs > 0 ? ` ${visibleReqs}req` : "";
|
|
301139
301371
|
const connStr = this._expose.activeConnections > 0 ? ` ${this._expose.activeConnections}conn` : "";
|
|
301140
|
-
const exposeExpanded = statusEmoji +
|
|
301141
|
-
const exposeCompact = statusEmoji + (modelStr ?
|
|
301372
|
+
const exposeExpanded = statusEmoji + pastel(183, (modelStr ? " " + modelStr : "") + reqStr + connStr);
|
|
301373
|
+
const exposeCompact = statusEmoji + (modelStr ? pastel(183, " " + modelStr) : "");
|
|
301142
301374
|
const expFullStr = (modelStr ? " " + modelStr : "") + reqStr + connStr;
|
|
301143
301375
|
const expCompStr = modelStr ? " " + modelStr : "";
|
|
301144
301376
|
sections.push({
|
|
@@ -301153,7 +301385,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301153
301385
|
const um = this._unifiedMetrics ?? getInstantSnapshot();
|
|
301154
301386
|
const rm3 = um.hardware;
|
|
301155
301387
|
const isLocal = um.source === "local";
|
|
301156
|
-
const srcTag = isLocal ?
|
|
301388
|
+
const srcTag = isLocal ? pastel(120, "L") : pastel(117, "R");
|
|
301157
301389
|
const srcW = 1;
|
|
301158
301390
|
let hwExpStr = "";
|
|
301159
301391
|
let hwCompStr = "";
|
|
@@ -301201,7 +301433,7 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301201
301433
|
const net5 = um.network;
|
|
301202
301434
|
const rxStr = formatRate(net5.rxBytesPerSec);
|
|
301203
301435
|
const txStr = formatRate(net5.txBytesPerSec);
|
|
301204
|
-
const netExpStr = ` ${
|
|
301436
|
+
const netExpStr = ` ${pastel(116, "\u2193" + rxStr)} ${pastel(218, "\u2191" + txStr)}`;
|
|
301205
301437
|
const netCompStr = netExpStr;
|
|
301206
301438
|
const netW = 1 + 1 + rxStr.length + 1 + 1 + txStr.length;
|
|
301207
301439
|
const sysExpanded = srcTag + " " + hwExpStr + netExpStr;
|
|
@@ -301215,15 +301447,15 @@ ${CONTENT_BG_SEQ}`);
|
|
|
301215
301447
|
});
|
|
301216
301448
|
}
|
|
301217
301449
|
if (this._recording) {
|
|
301218
|
-
const dot = this._recBlink ?
|
|
301450
|
+
const dot = this._recBlink ? pastel(210, "\u25CF") : " ";
|
|
301219
301451
|
const countdown = this._countdown > 0 ? c3.dim(` ${this._countdown}s`) : "";
|
|
301220
|
-
const recStr = dot +
|
|
301452
|
+
const recStr = dot + pastel(210, " REC") + countdown;
|
|
301221
301453
|
const recW = 1 + 4 + (this._countdown > 0 ? 1 + `${this._countdown}s`.length : 0);
|
|
301222
301454
|
sections.push({ expanded: recStr, compact: recStr, expandedW: recW, compactW: recW, empty: false });
|
|
301223
301455
|
}
|
|
301224
301456
|
if (this._version) {
|
|
301225
301457
|
versionSectionIdx = sections.length;
|
|
301226
|
-
const vStr =
|
|
301458
|
+
const vStr = pastel(245, "v" + this._version);
|
|
301227
301459
|
const vW = 1 + this._version.length;
|
|
301228
301460
|
sections.push({ expanded: vStr, compact: vStr, expandedW: vW, compactW: vW, empty: false });
|
|
301229
301461
|
}
|
|
@@ -303832,7 +304064,7 @@ function addAssistantMessage(session, content) {
|
|
|
303832
304064
|
session.messages.push({ role: "assistant", content });
|
|
303833
304065
|
session.lastActivity = Date.now();
|
|
303834
304066
|
}
|
|
303835
|
-
function
|
|
304067
|
+
function listSessions2() {
|
|
303836
304068
|
return Array.from(sessions.values()).map((s2) => ({
|
|
303837
304069
|
id: s2.id,
|
|
303838
304070
|
model: s2.model,
|
|
@@ -305957,7 +306189,7 @@ ${historyLines}
|
|
|
305957
306189
|
if (pathname === "/v1/chat/sessions" && method === "GET") {
|
|
305958
306190
|
if (!checkAuth(req2, res, "read"))
|
|
305959
306191
|
return;
|
|
305960
|
-
jsonResponse(res, 200, { sessions:
|
|
306192
|
+
jsonResponse(res, 200, { sessions: listSessions2() });
|
|
305961
306193
|
return;
|
|
305962
306194
|
}
|
|
305963
306195
|
if (pathname === "/v1/models" && method === "GET") {
|
|
@@ -308056,6 +308288,21 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
308056
308288
|
});
|
|
308057
308289
|
} catch {
|
|
308058
308290
|
}
|
|
308291
|
+
try {
|
|
308292
|
+
const sessionId2 = `session-${Date.now().toString(36)}`;
|
|
308293
|
+
const contentLines = statusBar?._contentLines ?? [];
|
|
308294
|
+
if (contentLines.length > 0) {
|
|
308295
|
+
saveSessionHistory(repoRoot, sessionId2, contentLines, {
|
|
308296
|
+
name: void 0,
|
|
308297
|
+
// auto-generate from content
|
|
308298
|
+
description: void 0,
|
|
308299
|
+
// auto-generate
|
|
308300
|
+
taskCount: 1,
|
|
308301
|
+
model: config.model
|
|
308302
|
+
});
|
|
308303
|
+
}
|
|
308304
|
+
} catch {
|
|
308305
|
+
}
|
|
308059
308306
|
if (taskStores?.taskMemoryStore) {
|
|
308060
308307
|
try {
|
|
308061
308308
|
taskStores.taskMemoryStore.insert({
|
|
@@ -312397,7 +312644,7 @@ __export(index_repo_exports, {
|
|
|
312397
312644
|
import { resolve as resolve37 } from "node:path";
|
|
312398
312645
|
import { existsSync as existsSync66, statSync as statSync17 } from "node:fs";
|
|
312399
312646
|
import { cwd as cwd2 } from "node:process";
|
|
312400
|
-
async function indexRepoCommand(opts,
|
|
312647
|
+
async function indexRepoCommand(opts, _config3) {
|
|
312401
312648
|
const repoRoot = resolve37(opts.repoPath ?? cwd2());
|
|
312402
312649
|
printHeader("Index Repository");
|
|
312403
312650
|
printInfo(`Indexing: ${repoRoot}`);
|
|
@@ -312751,7 +312998,7 @@ function handleShow(opts, config) {
|
|
|
312751
312998
|
}
|
|
312752
312999
|
}
|
|
312753
313000
|
}
|
|
312754
|
-
function handleSet(opts,
|
|
313001
|
+
function handleSet(opts, _config3) {
|
|
312755
313002
|
const { key, value: value2 } = opts;
|
|
312756
313003
|
if (!key) {
|
|
312757
313004
|
printError("Usage: open-agents config set KEY VALUE [--local]");
|
package/package.json
CHANGED