open-agents-ai 0.31.6 → 0.31.7
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.d.ts +6 -59
- package/dist/index.js +39 -10
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,59 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* Commands:
|
|
8
|
-
* open-agents "task" implicit run
|
|
9
|
-
* open-agents run "task" explicit run
|
|
10
|
-
* open-agents index /path/to/repo index a repository
|
|
11
|
-
* open-agents status show system status
|
|
12
|
-
* open-agents config show config
|
|
13
|
-
* open-agents config set KEY VALUE set config key
|
|
14
|
-
* open-agents serve start vLLM server
|
|
15
|
-
* open-agents eval run eval suite
|
|
16
|
-
* open-agents --help help
|
|
17
|
-
* open-agents --version version
|
|
18
|
-
*/
|
|
19
|
-
import type { BackendType } from "./config.js";
|
|
20
|
-
export type CommandName = "run" | "index" | "status" | "config" | "serve" | "eval" | "unknown";
|
|
21
|
-
export interface ParsedCliArgs {
|
|
22
|
-
command: CommandName;
|
|
23
|
-
/** Task text for the run command */
|
|
24
|
-
task?: string;
|
|
25
|
-
/** Repository path (for run and index commands) */
|
|
26
|
-
repoPath?: string;
|
|
27
|
-
/** Config sub-command (e.g. "set", "keys") */
|
|
28
|
-
configSubCommand?: string;
|
|
29
|
-
/** Config key (for config set) */
|
|
30
|
-
configKey?: string;
|
|
31
|
-
/** Config value (for config set) */
|
|
32
|
-
configValue?: string;
|
|
33
|
-
/** Eval suite name */
|
|
34
|
-
evalSuite?: string;
|
|
35
|
-
/** vLLM server port for serve command */
|
|
36
|
-
servePort?: number;
|
|
37
|
-
model?: string;
|
|
38
|
-
backendUrl?: string;
|
|
39
|
-
backendType?: BackendType;
|
|
40
|
-
dryRun?: boolean;
|
|
41
|
-
verbose?: boolean;
|
|
42
|
-
maxRetries?: number;
|
|
43
|
-
timeoutMs?: number;
|
|
44
|
-
offline?: boolean;
|
|
45
|
-
/** When true, config set writes to .oa/settings.json (project-local) */
|
|
46
|
-
local?: boolean;
|
|
47
|
-
help?: boolean;
|
|
48
|
-
version?: boolean;
|
|
49
|
-
}
|
|
50
|
-
export declare function routeCommand(command: string): CommandName;
|
|
51
|
-
export declare function parseCliArgs(argv: string[]): ParsedCliArgs;
|
|
52
|
-
export { createCli } from "./cli.js";
|
|
53
|
-
export { parseArgs } from "./args.js";
|
|
54
|
-
export type { CliOptions } from "./types.js";
|
|
55
|
-
export { loadConfig, mergeConfig, setConfigValue, DEFAULT_CONFIG } from "./config.js";
|
|
56
|
-
export type { AgentConfig, BackendType } from "./config.js";
|
|
57
|
-
export { Spinner } from "./ui/spinner.js";
|
|
58
|
-
export { printHeader, printSuccess, printError, printWarning, printInfo, printSection, printKeyValue, printBlank, printReport, formatDuration, } from "./ui/output.js";
|
|
59
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { parseCliArgs, routeCommand } from "./types.js";
|
|
2
|
+
export type { ParsedCliArgs, CommandName } from "./types.js";
|
|
3
|
+
export { loadConfig, mergeConfig, setConfigValue, DEFAULT_CONFIG } from "./types.js";
|
|
4
|
+
export type { AgentConfig, BackendType } from "./types.js";
|
|
5
|
+
export { Spinner } from "./types.js";
|
|
6
|
+
export { printHeader, printSuccess, printError, printWarning, printInfo, printSection, printKeyValue, printBlank, printReport, formatDuration } from "./types.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
5
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
@@ -14997,8 +14998,10 @@ function renderSlashHelp() {
|
|
|
14997
14998
|
["/evaluate", "Evaluate last completed task (LLM quality scoring)"],
|
|
14998
14999
|
["/task-type", "Set task type (code, document, analysis, plan, general, auto)"],
|
|
14999
15000
|
["/stats", "Show session dashboard (metrics, tool usage, task history)"],
|
|
15000
|
-
["/
|
|
15001
|
-
["/
|
|
15001
|
+
["/pause", "Pause after current turn finishes (gentle halt, /resume to continue)"],
|
|
15002
|
+
["/stop", "Kill current inference immediately and save state (/resume to continue)"],
|
|
15003
|
+
["/resume", "Resume a paused or stopped task"],
|
|
15004
|
+
["/destroy", "Remove .oa folder, kill all tasks, clear console, and exit"],
|
|
15002
15005
|
["/compact", "Force context compaction now (default strategy)"],
|
|
15003
15006
|
["/compact <strategy>", "Compact with strategy: aggressive, decisions, errors, summary, structured"],
|
|
15004
15007
|
["/bruteforce", "Toggle brute-force mode (auto re-engage on turn limit)"],
|
|
@@ -17450,7 +17453,7 @@ async function handleSlashCommand(input, ctx) {
|
|
|
17450
17453
|
}
|
|
17451
17454
|
const paused = ctx.pauseTask?.() ?? false;
|
|
17452
17455
|
if (paused) {
|
|
17453
|
-
renderInfo("Task paused. Use /resume to continue or /stop to
|
|
17456
|
+
renderInfo("Task paused (current turn will finish, then halt). Use /resume to continue or /stop to kill.");
|
|
17454
17457
|
} else {
|
|
17455
17458
|
renderWarning("Could not pause the task.");
|
|
17456
17459
|
}
|
|
@@ -17464,9 +17467,9 @@ async function handleSlashCommand(input, ctx) {
|
|
|
17464
17467
|
const saved = ctx.savePendingTaskState?.() ?? false;
|
|
17465
17468
|
const aborted = ctx.abortTask?.() ?? false;
|
|
17466
17469
|
if (saved && aborted) {
|
|
17467
|
-
renderInfo("Task
|
|
17470
|
+
renderInfo("Task killed and state saved. Use /resume to continue later.");
|
|
17468
17471
|
} else if (aborted) {
|
|
17469
|
-
renderWarning("Task
|
|
17472
|
+
renderWarning("Task killed but state could not be saved.");
|
|
17470
17473
|
} else {
|
|
17471
17474
|
renderWarning("Could not stop the task.");
|
|
17472
17475
|
}
|
|
@@ -17492,6 +17495,13 @@ async function handleSlashCommand(input, ctx) {
|
|
|
17492
17495
|
}
|
|
17493
17496
|
return "handled";
|
|
17494
17497
|
}
|
|
17498
|
+
case "destroy": {
|
|
17499
|
+
if (ctx.hasActiveTask?.()) {
|
|
17500
|
+
ctx.abortTask?.();
|
|
17501
|
+
}
|
|
17502
|
+
ctx.destroyProject?.();
|
|
17503
|
+
return "exit";
|
|
17504
|
+
}
|
|
17495
17505
|
case "compact":
|
|
17496
17506
|
case "gc": {
|
|
17497
17507
|
if (!ctx.hasActiveTask?.()) {
|
|
@@ -21271,7 +21281,7 @@ var init_status_bar = __esm({
|
|
|
21271
21281
|
completionTokens: 0,
|
|
21272
21282
|
totalTokens: 0,
|
|
21273
21283
|
estimatedContextTokens: 0,
|
|
21274
|
-
contextWindowSize:
|
|
21284
|
+
contextWindowSize: 0
|
|
21275
21285
|
};
|
|
21276
21286
|
active = false;
|
|
21277
21287
|
scrollRegionTop = 1;
|
|
@@ -21596,9 +21606,14 @@ var init_status_bar = __esm({
|
|
|
21596
21606
|
const tokOutLabel = pastel2(151, "Out: ") + c2.bold(tokOut);
|
|
21597
21607
|
const ctxUsed = m.estimatedContextTokens;
|
|
21598
21608
|
const ctxTotal = m.contextWindowSize;
|
|
21599
|
-
|
|
21600
|
-
|
|
21601
|
-
|
|
21609
|
+
let ctxLabel;
|
|
21610
|
+
if (ctxTotal <= 0) {
|
|
21611
|
+
ctxLabel = pastel2(153, "Ctx: ") + c2.dim("--");
|
|
21612
|
+
} else {
|
|
21613
|
+
const ctxPct = Math.max(0, Math.min(100, Math.round((1 - ctxUsed / ctxTotal) * 100)));
|
|
21614
|
+
const ctxColor = ctxPct > 50 ? c2.green : ctxPct > 20 ? c2.yellow : c2.red;
|
|
21615
|
+
ctxLabel = pastel2(153, "Ctx: ") + c2.bold(`${ctxUsed.toLocaleString()}/${ctxTotal.toLocaleString()}`) + ` ${ctxColor(`${ctxPct}%`)}`;
|
|
21616
|
+
}
|
|
21602
21617
|
let costLabel = "";
|
|
21603
21618
|
if (m.hasPricing && m.estimatedCost !== void 0) {
|
|
21604
21619
|
const costStr = m.estimatedCost < 0.01 ? `$${m.estimatedCost.toFixed(4)}` : m.estimatedCost < 1 ? `$${m.estimatedCost.toFixed(3)}` : `$${m.estimatedCost.toFixed(2)}`;
|
|
@@ -21900,7 +21915,7 @@ import { cwd } from "node:process";
|
|
|
21900
21915
|
import { resolve as resolve19, join as join31, dirname as dirname10, extname as extname9 } from "node:path";
|
|
21901
21916
|
import { createRequire as createRequire2 } from "node:module";
|
|
21902
21917
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
21903
|
-
import { readFileSync as readFileSync18 } from "node:fs";
|
|
21918
|
+
import { readFileSync as readFileSync18, rmSync as rmSync2 } from "node:fs";
|
|
21904
21919
|
import { existsSync as existsSync24 } from "node:fs";
|
|
21905
21920
|
function getVersion() {
|
|
21906
21921
|
try {
|
|
@@ -22933,6 +22948,20 @@ async function startInteractive(config, repoPath) {
|
|
|
22933
22948
|
rl.emit("line", resumeContext);
|
|
22934
22949
|
}, 100);
|
|
22935
22950
|
return true;
|
|
22951
|
+
},
|
|
22952
|
+
destroyProject() {
|
|
22953
|
+
const oaPath = join31(repoRoot, OA_DIR);
|
|
22954
|
+
if (existsSync24(oaPath)) {
|
|
22955
|
+
try {
|
|
22956
|
+
rmSync2(oaPath, { recursive: true, force: true });
|
|
22957
|
+
writeContent(() => renderInfo(`Removed ${OA_DIR}/ directory.`));
|
|
22958
|
+
} catch (err) {
|
|
22959
|
+
writeContent(() => renderWarning(`Could not remove ${OA_DIR}/: ${err instanceof Error ? err.message : String(err)}`));
|
|
22960
|
+
}
|
|
22961
|
+
} else {
|
|
22962
|
+
writeContent(() => renderInfo(`No ${OA_DIR}/ directory found.`));
|
|
22963
|
+
}
|
|
22964
|
+
process.stdout.write("\x1Bc");
|
|
22936
22965
|
}
|
|
22937
22966
|
};
|
|
22938
22967
|
showPrompt();
|
package/package.json
CHANGED