open-agents-ai 0.187.555 → 0.187.556
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 +41 -18
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13806,6 +13806,10 @@ Process error: ${err.message}`;
|
|
|
13806
13806
|
return null;
|
|
13807
13807
|
return toInfo(entry);
|
|
13808
13808
|
}
|
|
13809
|
+
getLatestTask() {
|
|
13810
|
+
const entry = Array.from(this.tasks.values()).at(-1);
|
|
13811
|
+
return entry ? toInfo(entry) : null;
|
|
13812
|
+
}
|
|
13809
13813
|
getOutput(id, tail) {
|
|
13810
13814
|
const entry = this.tasks.get(id);
|
|
13811
13815
|
if (!entry)
|
|
@@ -13896,7 +13900,7 @@ Process error: ${err.message}`;
|
|
|
13896
13900
|
workingDir;
|
|
13897
13901
|
manager;
|
|
13898
13902
|
name = "background_run";
|
|
13899
|
-
description =
|
|
13903
|
+
description = `Run a shell command in the background. Returns a task ID immediately. Use task_status(task_id="...") to check progress and task_output(task_id="...") to read results. Useful for long-running commands (builds, tests) that shouldn't block the agent.`;
|
|
13900
13904
|
parameters = {
|
|
13901
13905
|
type: "object",
|
|
13902
13906
|
properties: {
|
|
@@ -13921,7 +13925,7 @@ Process error: ${err.message}`;
|
|
|
13921
13925
|
success: true,
|
|
13922
13926
|
output: `Background task started: ${taskId}
|
|
13923
13927
|
Command: ${command}
|
|
13924
|
-
Use task_status or task_output to check progress.`,
|
|
13928
|
+
Use task_status(task_id="${taskId}") or task_output(task_id="${taskId}") to check progress.`,
|
|
13925
13929
|
durationMs: Date.now() - start2
|
|
13926
13930
|
};
|
|
13927
13931
|
}
|
|
@@ -13973,32 +13977,43 @@ Exit code: ${task.exitCode ?? "N/A"}`,
|
|
|
13973
13977
|
TaskOutputTool = class {
|
|
13974
13978
|
manager;
|
|
13975
13979
|
name = "task_output";
|
|
13976
|
-
description = "Read the output of a background task. Returns stdout+stderr combined. Use tail parameter to get only the last N lines.";
|
|
13980
|
+
description = "Read the output of a background task. Returns stdout+stderr combined. If task_id is omitted, uses the most recently created task. Use tail parameter to get only the last N lines.";
|
|
13977
13981
|
parameters = {
|
|
13978
13982
|
type: "object",
|
|
13979
13983
|
properties: {
|
|
13980
|
-
task_id: { type: "string", description: "Task ID to read output from" },
|
|
13984
|
+
task_id: { type: "string", description: "Task ID to read output from (optional — falls back to most recent task)" },
|
|
13981
13985
|
tail: { type: "number", description: "Only return the last N lines (optional)" }
|
|
13982
|
-
}
|
|
13983
|
-
required: ["task_id"]
|
|
13986
|
+
}
|
|
13984
13987
|
};
|
|
13985
13988
|
constructor(manager) {
|
|
13986
13989
|
this.manager = manager;
|
|
13987
13990
|
}
|
|
13988
13991
|
async execute(args) {
|
|
13989
13992
|
const start2 = Date.now();
|
|
13990
|
-
const
|
|
13993
|
+
const explicitTaskId = typeof args["task_id"] === "string" ? args["task_id"].trim() : "";
|
|
13994
|
+
const fallbackTask = explicitTaskId ? null : this.manager.getLatestTask();
|
|
13995
|
+
const taskId = explicitTaskId || fallbackTask?.id || "";
|
|
13991
13996
|
const tail = typeof args["tail"] === "number" ? args["tail"] : void 0;
|
|
13992
13997
|
const output = this.manager.getOutput(taskId, tail);
|
|
13993
13998
|
if (output === null) {
|
|
13999
|
+
if (!taskId) {
|
|
14000
|
+
return {
|
|
14001
|
+
success: false,
|
|
14002
|
+
output: "",
|
|
14003
|
+
error: "task_id is required when no background tasks exist yet",
|
|
14004
|
+
durationMs: Date.now() - start2
|
|
14005
|
+
};
|
|
14006
|
+
}
|
|
13994
14007
|
return { success: false, output: "", error: `Task not found: ${taskId}`, durationMs: Date.now() - start2 };
|
|
13995
14008
|
}
|
|
13996
14009
|
const task = this.manager.getTask(taskId);
|
|
13997
14010
|
const header = task ? `[${task.status}${task.exitCode !== null ? `, exit ${task.exitCode}` : ""}]
|
|
14011
|
+
` : "";
|
|
14012
|
+
const fallbackNote = explicitTaskId ? "" : fallbackTask ? `[fallback to ${taskId}]
|
|
13998
14013
|
` : "";
|
|
13999
14014
|
return {
|
|
14000
14015
|
success: true,
|
|
14001
|
-
output: header + (output || "(no output yet)"),
|
|
14016
|
+
output: fallbackNote + header + (output || "(no output yet)"),
|
|
14002
14017
|
durationMs: Date.now() - start2
|
|
14003
14018
|
};
|
|
14004
14019
|
}
|
|
@@ -525320,6 +525335,9 @@ function classifyShellIntent(cmd) {
|
|
|
525320
525335
|
if (tokens.length === 0)
|
|
525321
525336
|
return { klass: "other", verb: "", tool: "" };
|
|
525322
525337
|
const first2 = tokens[0].toLowerCase();
|
|
525338
|
+
if (first2 === "test" || first2 === "[" || first2 === "[[") {
|
|
525339
|
+
return { klass: "read", verb: "test", tool: first2 };
|
|
525340
|
+
}
|
|
525323
525341
|
const isRunner = RUNNERS.has(first2);
|
|
525324
525342
|
let verbToken;
|
|
525325
525343
|
if (isRunner && tokens.length >= 2) {
|
|
@@ -608550,7 +608568,7 @@ function createSubAgentTool(config, repoRoot, ctxWindowSize) {
|
|
|
608550
608568
|
success: true,
|
|
608551
608569
|
output: `Sub-agent started in background: ${taskId}
|
|
608552
608570
|
Task: ${task}
|
|
608553
|
-
Use task_status("${taskId}") or task_output("${taskId}") to check progress.`
|
|
608571
|
+
Use task_status(task_id="${taskId}") or task_output(task_id="${taskId}") to check progress.`
|
|
608554
608572
|
};
|
|
608555
608573
|
}
|
|
608556
608574
|
if (onViewStatus) onViewStatus(agentId, "running");
|
|
@@ -610466,13 +610484,10 @@ async function startInteractive(config, repoPath) {
|
|
|
610466
610484
|
} catch {
|
|
610467
610485
|
}
|
|
610468
610486
|
}
|
|
610469
|
-
if (!isResumed &&
|
|
610470
|
-
const
|
|
610471
|
-
|
|
610472
|
-
|
|
610473
|
-
const freshConfig = loadConfig();
|
|
610474
|
-
config = { ...config, ...freshConfig, model: setupModel ?? freshConfig.model };
|
|
610475
|
-
}
|
|
610487
|
+
if (!isResumed && await shouldRunFirstRunSetup(config)) {
|
|
610488
|
+
const setupModel = await runSetupWizard(config);
|
|
610489
|
+
const freshConfig = loadConfig();
|
|
610490
|
+
config = { ...config, ...freshConfig, model: setupModel ?? freshConfig.model };
|
|
610476
610491
|
}
|
|
610477
610492
|
let carouselPhrases = null;
|
|
610478
610493
|
try {
|
|
@@ -614292,11 +614307,19 @@ ${c3.dim("(Use /quit to exit)")}
|
|
|
614292
614307
|
showPrompt();
|
|
614293
614308
|
};
|
|
614294
614309
|
}
|
|
614310
|
+
async function shouldRunFirstRunSetup(config, firstRun = isFirstRun()) {
|
|
614311
|
+
if (config.backendType !== "ollama") return false;
|
|
614312
|
+
if (!firstRun) return false;
|
|
614313
|
+
try {
|
|
614314
|
+
return !await isModelAvailable(config);
|
|
614315
|
+
} catch {
|
|
614316
|
+
return false;
|
|
614317
|
+
}
|
|
614318
|
+
}
|
|
614295
614319
|
async function runWithTUI(task, config, repoPath, callbacks) {
|
|
614296
614320
|
const repoRoot = resolve39(repoPath ?? cwd());
|
|
614297
614321
|
initOaDirectory(repoRoot);
|
|
614298
|
-
|
|
614299
|
-
if (needsSetup && config.backendType === "ollama") {
|
|
614322
|
+
if (await shouldRunFirstRunSetup(config)) {
|
|
614300
614323
|
const setupModel = await runSetupWizard(config);
|
|
614301
614324
|
const freshConfig = loadConfig();
|
|
614302
614325
|
config = { ...config, ...freshConfig, model: setupModel ?? freshConfig.model };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-agents-ai",
|
|
3
|
-
"version": "0.187.
|
|
3
|
+
"version": "0.187.556",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "open-agents-ai",
|
|
9
|
-
"version": "0.187.
|
|
9
|
+
"version": "0.187.556",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "CC-BY-NC-4.0",
|
|
12
12
|
"dependencies": {
|
package/package.json
CHANGED