open-agents-ai 0.104.14 → 0.104.15
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 +108 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27085,31 +27085,56 @@ function setContentWriteHook(hook) {
|
|
|
27085
27085
|
_contentWriteHook = hook;
|
|
27086
27086
|
}
|
|
27087
27087
|
function renderError(message) {
|
|
27088
|
-
_contentWriteHook?.
|
|
27088
|
+
const redir = _contentWriteHook?.redirect?.();
|
|
27089
27089
|
const icon = _emojisEnabled ? c2.red("\u2716") : c2.red("E");
|
|
27090
|
+
if (redir) {
|
|
27091
|
+
redir(`
|
|
27092
|
+
${icon} ${message}
|
|
27093
|
+
`);
|
|
27094
|
+
return;
|
|
27095
|
+
}
|
|
27096
|
+
_contentWriteHook?.begin();
|
|
27090
27097
|
process.stdout.write(`
|
|
27091
27098
|
${icon} ${message}
|
|
27092
27099
|
`);
|
|
27093
27100
|
_contentWriteHook?.end();
|
|
27094
27101
|
}
|
|
27095
27102
|
function renderInfo(message) {
|
|
27096
|
-
_contentWriteHook?.
|
|
27103
|
+
const redir = _contentWriteHook?.redirect?.();
|
|
27097
27104
|
const icon = _emojisEnabled ? c2.cyan("\u2139") : c2.cyan("i");
|
|
27105
|
+
if (redir) {
|
|
27106
|
+
redir(`${icon} ${message}
|
|
27107
|
+
`);
|
|
27108
|
+
return;
|
|
27109
|
+
}
|
|
27110
|
+
_contentWriteHook?.begin();
|
|
27098
27111
|
process.stdout.write(`${icon} ${message}
|
|
27099
27112
|
`);
|
|
27100
27113
|
_contentWriteHook?.end();
|
|
27101
27114
|
}
|
|
27102
27115
|
function renderWarning(message) {
|
|
27103
|
-
_contentWriteHook?.
|
|
27116
|
+
const redir = _contentWriteHook?.redirect?.();
|
|
27104
27117
|
const icon = _emojisEnabled ? c2.yellow("\u26A0") : c2.yellow("!");
|
|
27118
|
+
if (redir) {
|
|
27119
|
+
redir(`${icon} ${message}
|
|
27120
|
+
`);
|
|
27121
|
+
return;
|
|
27122
|
+
}
|
|
27123
|
+
_contentWriteHook?.begin();
|
|
27105
27124
|
process.stdout.write(`${icon} ${message}
|
|
27106
27125
|
`);
|
|
27107
27126
|
_contentWriteHook?.end();
|
|
27108
27127
|
}
|
|
27109
27128
|
function renderVerbose(message) {
|
|
27129
|
+
const redir = _contentWriteHook?.redirect?.();
|
|
27130
|
+
const text = `${c2.dim(` > ${message}`)}
|
|
27131
|
+
`;
|
|
27132
|
+
if (redir) {
|
|
27133
|
+
redir(text);
|
|
27134
|
+
return;
|
|
27135
|
+
}
|
|
27110
27136
|
_contentWriteHook?.begin();
|
|
27111
|
-
process.stdout.write(
|
|
27112
|
-
`);
|
|
27137
|
+
process.stdout.write(text);
|
|
27113
27138
|
_contentWriteHook?.end();
|
|
27114
27139
|
}
|
|
27115
27140
|
function renderRichHeader(opts) {
|
|
@@ -34583,7 +34608,7 @@ async function startNeovimMode(opts) {
|
|
|
34583
34608
|
'local lp = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"',
|
|
34584
34609
|
'if not vim.loop.fs_stat(lp) then pcall(vim.fn.system, {"git", "clone", "--filter=blob:none", "--depth=1", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lp}) end',
|
|
34585
34610
|
"vim.opt.rtp:prepend(lp)",
|
|
34586
|
-
'pcall(function() require("lazy").setup({{"nvim-neo-tree/neo-tree.nvim", branch="v3.x", dependencies={"nvim-lua/plenary.nvim","MunifTanjim/nui.nvim"},config=function() require("neo-tree").setup({close_if_last_window=true,filesystem={follow_current_file={enabled=true},use_libuv_file_watcher=true,hijack_netrw_behavior="
|
|
34611
|
+
'pcall(function() require("lazy").setup({{"nvim-neo-tree/neo-tree.nvim", branch="v3.x", lazy=false, dependencies={"nvim-lua/plenary.nvim","MunifTanjim/nui.nvim","nvim-tree/nvim-web-devicons"},config=function() require("neo-tree").setup({close_if_last_window=true,enable_git_status=true,filesystem={follow_current_file={enabled=true},use_libuv_file_watcher=true,hijack_netrw_behavior="open_default",filtered_items={hide_dotfiles=false,hide_gitignored=false}},window={position="left",width=30}}) end}},{install={colorscheme={}},checker={enabled=false}}) end)',
|
|
34587
34612
|
// Open neo-tree sidebar after lazy.nvim finishes loading (needs short defer).
|
|
34588
34613
|
// Uses pcall so a missing/broken neo-tree doesn't block the editor.
|
|
34589
34614
|
'vim.defer_fn(function() pcall(vim.cmd, "Neotree show") end, 300)'
|
|
@@ -34810,10 +34835,10 @@ function toggleFocus(state) {
|
|
|
34810
34835
|
if (state.opts.rl) {
|
|
34811
34836
|
try {
|
|
34812
34837
|
state.opts.rl.resume();
|
|
34813
|
-
state.opts.rl.prompt(false);
|
|
34814
34838
|
} catch {
|
|
34815
34839
|
}
|
|
34816
34840
|
}
|
|
34841
|
+
state.opts.onFocusToTUI?.();
|
|
34817
34842
|
} else {
|
|
34818
34843
|
state.focused = true;
|
|
34819
34844
|
if (state.opts.rl) {
|
|
@@ -37993,7 +38018,8 @@ async function handleSlashCommand(input, ctx) {
|
|
|
37993
38018
|
initialFile: arg || void 0,
|
|
37994
38019
|
onExit: () => {
|
|
37995
38020
|
renderInfo("Neovim mode exited.");
|
|
37996
|
-
}
|
|
38021
|
+
},
|
|
38022
|
+
onFocusToTUI: ctx.showPrompt
|
|
37997
38023
|
});
|
|
37998
38024
|
if (err) {
|
|
37999
38025
|
renderError(err);
|
|
@@ -49367,6 +49393,22 @@ ${entry.fullContent}`
|
|
|
49367
49393
|
let streamStartMs = 0;
|
|
49368
49394
|
let streamTextBuffer = "";
|
|
49369
49395
|
const contentWrite = (fn) => {
|
|
49396
|
+
if (isNeovimActive()) {
|
|
49397
|
+
const origWrite = process.stdout.write;
|
|
49398
|
+
let captured = "";
|
|
49399
|
+
process.stdout.write = ((chunk) => {
|
|
49400
|
+
captured += typeof chunk === "string" ? chunk : Buffer.isBuffer(chunk) ? chunk.toString() : "";
|
|
49401
|
+
return true;
|
|
49402
|
+
});
|
|
49403
|
+
try {
|
|
49404
|
+
fn();
|
|
49405
|
+
} finally {
|
|
49406
|
+
process.stdout.write = origWrite;
|
|
49407
|
+
}
|
|
49408
|
+
if (captured)
|
|
49409
|
+
writeToNeovimOutput(captured);
|
|
49410
|
+
return;
|
|
49411
|
+
}
|
|
49370
49412
|
if (isOverlayActive()) {
|
|
49371
49413
|
const origWrite = process.stdout.write;
|
|
49372
49414
|
const chunks = [];
|
|
@@ -49791,7 +49833,10 @@ async function startInteractive(config, repoPath) {
|
|
|
49791
49833
|
statusBar.activate(scrollTop);
|
|
49792
49834
|
setContentWriteHook({
|
|
49793
49835
|
begin: () => statusBar.beginContentWrite(),
|
|
49794
|
-
end: () => statusBar.endContentWrite()
|
|
49836
|
+
end: () => statusBar.endContentWrite(),
|
|
49837
|
+
// When neovim is active, redirect all render output to the Agent Output
|
|
49838
|
+
// pane instead of writing to stdout (which would push the PTY upward).
|
|
49839
|
+
redirect: () => isNeovimActive() ? writeToNeovimOutput : null
|
|
49795
49840
|
});
|
|
49796
49841
|
}
|
|
49797
49842
|
let resolvedContextWindowSize = 0;
|
|
@@ -50183,6 +50228,22 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
50183
50228
|
}
|
|
50184
50229
|
}
|
|
50185
50230
|
function writeContent(fn) {
|
|
50231
|
+
if (isNeovimActive()) {
|
|
50232
|
+
const origWrite = process.stdout.write;
|
|
50233
|
+
let captured = "";
|
|
50234
|
+
process.stdout.write = ((chunk) => {
|
|
50235
|
+
captured += typeof chunk === "string" ? chunk : Buffer.isBuffer(chunk) ? chunk.toString() : "";
|
|
50236
|
+
return true;
|
|
50237
|
+
});
|
|
50238
|
+
try {
|
|
50239
|
+
fn();
|
|
50240
|
+
} finally {
|
|
50241
|
+
process.stdout.write = origWrite;
|
|
50242
|
+
}
|
|
50243
|
+
if (captured)
|
|
50244
|
+
writeToNeovimOutput(captured);
|
|
50245
|
+
return;
|
|
50246
|
+
}
|
|
50186
50247
|
if (isOverlayActive()) {
|
|
50187
50248
|
const origWrite = process.stdout.write;
|
|
50188
50249
|
const chunks = [];
|
|
@@ -50338,7 +50399,11 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
50338
50399
|
}
|
|
50339
50400
|
sudoPromptPending = true;
|
|
50340
50401
|
const sudoPromptStr = ` ${c2.bold(c2.yellow("\u{1F511} Password:"))} `;
|
|
50341
|
-
|
|
50402
|
+
if (isNeovimActive()) {
|
|
50403
|
+
writeToNeovimOutput(sudoPromptStr);
|
|
50404
|
+
} else {
|
|
50405
|
+
process.stdout.write(sudoPromptStr);
|
|
50406
|
+
}
|
|
50342
50407
|
}
|
|
50343
50408
|
async function handleAskUser(question, options, allowMultiple) {
|
|
50344
50409
|
if (statusBar?.isActive)
|
|
@@ -51087,7 +51152,12 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
51087
51152
|
const exposeFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
51088
51153
|
let exposeFrame = 0;
|
|
51089
51154
|
const exposeSpinner = setInterval(() => {
|
|
51090
|
-
|
|
51155
|
+
if (isNeovimActive()) {
|
|
51156
|
+
writeToNeovimOutput(`${c2.cyan(exposeFrames[exposeFrame % exposeFrames.length])} ${c2.dim(exposeSpinnerMsg)}\r
|
|
51157
|
+
`);
|
|
51158
|
+
} else {
|
|
51159
|
+
process.stdout.write(`\r ${c2.cyan(exposeFrames[exposeFrame % exposeFrames.length])} ${c2.dim(exposeSpinnerMsg)}`);
|
|
51160
|
+
}
|
|
51091
51161
|
exposeFrame++;
|
|
51092
51162
|
}, 80);
|
|
51093
51163
|
const newP2P = new ExposeP2PGateway({
|
|
@@ -51116,7 +51186,8 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
51116
51186
|
try {
|
|
51117
51187
|
const peerId = await newP2P.start();
|
|
51118
51188
|
clearInterval(exposeSpinner);
|
|
51119
|
-
|
|
51189
|
+
if (!isNeovimActive())
|
|
51190
|
+
process.stdout.write(`\r\x1B[2K`);
|
|
51120
51191
|
p2pGateway = newP2P;
|
|
51121
51192
|
writeContent(() => {
|
|
51122
51193
|
process.stdout.write("\n" + newP2P.formatConnectionInfo() + "\n\n");
|
|
@@ -51124,7 +51195,8 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
51124
51195
|
return peerId;
|
|
51125
51196
|
} catch (err) {
|
|
51126
51197
|
clearInterval(exposeSpinner);
|
|
51127
|
-
|
|
51198
|
+
if (!isNeovimActive())
|
|
51199
|
+
process.stdout.write(`\r\x1B[2K`);
|
|
51128
51200
|
if (!transport) {
|
|
51129
51201
|
writeContent(() => {
|
|
51130
51202
|
renderWarning(`libp2p expose failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -51388,6 +51460,9 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
51388
51460
|
availableContentRows() {
|
|
51389
51461
|
return statusBar.isActive ? statusBar.availableContentRows : Math.max(3, (process.stdout.rows ?? 24) - 6);
|
|
51390
51462
|
},
|
|
51463
|
+
showPrompt() {
|
|
51464
|
+
showPrompt();
|
|
51465
|
+
},
|
|
51391
51466
|
destroyProject() {
|
|
51392
51467
|
const oaPath = join51(repoRoot, OA_DIR);
|
|
51393
51468
|
if (existsSync42(oaPath)) {
|
|
@@ -51562,7 +51637,12 @@ ${sessionCtx}` : "",
|
|
|
51562
51637
|
function showPasteIndicator() {
|
|
51563
51638
|
const count = pasteBuffer.length;
|
|
51564
51639
|
const label = ` ${c2.dim("[")}${c2.bold(c2.cyan(String(count)))}${c2.dim(" pasted line" + (count !== 1 ? "s" : "") + " \u2014 press Enter to submit]")}`;
|
|
51565
|
-
|
|
51640
|
+
if (isNeovimActive()) {
|
|
51641
|
+
writeToNeovimOutput(`${label}\r
|
|
51642
|
+
`);
|
|
51643
|
+
} else {
|
|
51644
|
+
process.stdout.write(`\r\x1B[K${label}`);
|
|
51645
|
+
}
|
|
51566
51646
|
pasteIndicatorShown = true;
|
|
51567
51647
|
}
|
|
51568
51648
|
const buildSlashCommandHandler = () => {
|
|
@@ -51627,8 +51707,13 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
|
|
|
51627
51707
|
async function processLine(input) {
|
|
51628
51708
|
if (depSudoPromptPending && depSudoResolver) {
|
|
51629
51709
|
const pw = input.trim();
|
|
51630
|
-
|
|
51631
|
-
|
|
51710
|
+
const pwRecvMsg = `\r\x1B[K ${c2.dim("\u{1F511} Password received")}
|
|
51711
|
+
`;
|
|
51712
|
+
if (isNeovimActive()) {
|
|
51713
|
+
writeToNeovimOutput(pwRecvMsg);
|
|
51714
|
+
} else {
|
|
51715
|
+
process.stdout.write(pwRecvMsg);
|
|
51716
|
+
}
|
|
51632
51717
|
depSudoResolver(pw || null);
|
|
51633
51718
|
showPrompt();
|
|
51634
51719
|
return;
|
|
@@ -51637,8 +51722,13 @@ ${result.content.slice(0, 2e3)}${result.content.length > 2e3 ? "\n[truncated]" :
|
|
|
51637
51722
|
sudoPromptPending = false;
|
|
51638
51723
|
sessionSudoPassword = input;
|
|
51639
51724
|
activeTask.runner.setSudoPassword(input);
|
|
51640
|
-
|
|
51641
|
-
|
|
51725
|
+
const pwRecvMsg2 = `\r\x1B[K ${c2.dim("\u{1F511} Password received")}
|
|
51726
|
+
`;
|
|
51727
|
+
if (isNeovimActive()) {
|
|
51728
|
+
writeToNeovimOutput(pwRecvMsg2);
|
|
51729
|
+
} else {
|
|
51730
|
+
process.stdout.write(pwRecvMsg2);
|
|
51731
|
+
}
|
|
51642
51732
|
showPrompt();
|
|
51643
51733
|
return;
|
|
51644
51734
|
}
|
package/package.json
CHANGED