open-agents-ai 0.187.362 → 0.187.364
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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as
|
|
2
|
+
import { createRequire as __oa_createRequire } from "node:module"; import { fileURLToPath as __oa_fileURLToPath } from "node:url"; import { dirname as __oa_dirname } from "node:path"; const require = __oa_createRequire(import.meta.url); const __filename = __oa_fileURLToPath(import.meta.url); const __dirname = __oa_dirname(__filename);
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1653,21 +1653,27 @@ ${elevatedResult.stderr}` : ""),
|
|
|
1653
1653
|
}
|
|
1654
1654
|
runCommand(command, timeout2, stdinInput) {
|
|
1655
1655
|
const start2 = performance.now();
|
|
1656
|
-
const
|
|
1657
|
-
let
|
|
1658
|
-
let
|
|
1659
|
-
let wrappedCommand
|
|
1660
|
-
if (
|
|
1661
|
-
|
|
1662
|
-
|
|
1656
|
+
const isWin2 = process.platform === "win32";
|
|
1657
|
+
let pwdDir = mkdtempSync(join3(tmpdir(), "oa-shell-"));
|
|
1658
|
+
let pwdFile = join3(pwdDir, `cwd-${randomUUID()}`);
|
|
1659
|
+
let wrappedCommand;
|
|
1660
|
+
if (isWin2) {
|
|
1661
|
+
wrappedCommand = `${command}\r
|
|
1662
|
+
set OA_EXIT=%ERRORLEVEL%\r
|
|
1663
|
+
cd > "${pwdFile}" 2>nul\r
|
|
1664
|
+
exit /B %OA_EXIT%\r
|
|
1665
|
+
`;
|
|
1666
|
+
} else {
|
|
1663
1667
|
wrappedCommand = `${command}
|
|
1664
1668
|
__oa_exit=$?
|
|
1665
1669
|
pwd -P > "${pwdFile}" 2>/dev/null || true
|
|
1666
1670
|
exit $__oa_exit
|
|
1667
1671
|
`;
|
|
1668
1672
|
}
|
|
1673
|
+
const shellBin = isWin2 ? "cmd.exe" : "bash";
|
|
1674
|
+
const shellArgs = isWin2 ? ["/d", "/s", "/c", wrappedCommand] : ["-c", wrappedCommand];
|
|
1669
1675
|
return new Promise((resolve40) => {
|
|
1670
|
-
const child = spawn(
|
|
1676
|
+
const child = spawn(shellBin, shellArgs, {
|
|
1671
1677
|
cwd: this.currentCwd,
|
|
1672
1678
|
env: {
|
|
1673
1679
|
...process.env,
|
|
@@ -254977,15 +254983,17 @@ var init_import_graph = __esm({
|
|
|
254977
254983
|
});
|
|
254978
254984
|
|
|
254979
254985
|
// packages/indexer/dist/codebase-indexer.js
|
|
254980
|
-
import {
|
|
254986
|
+
import { createRequire as __createRequireGlob } from "node:module";
|
|
254981
254987
|
import ignore from "ignore";
|
|
254982
254988
|
import { readFile as readFile20, stat as stat4 } from "node:fs/promises";
|
|
254983
254989
|
import { createHash as createHash4 } from "node:crypto";
|
|
254984
254990
|
import { join as join46, relative as relative4, extname as extname8, basename as basename11 } from "node:path";
|
|
254985
|
-
var DEFAULT_EXCLUDE, LANGUAGE_MAP, CodebaseIndexer;
|
|
254991
|
+
var __requireGlob, glob2, DEFAULT_EXCLUDE, LANGUAGE_MAP, CodebaseIndexer;
|
|
254986
254992
|
var init_codebase_indexer = __esm({
|
|
254987
254993
|
"packages/indexer/dist/codebase-indexer.js"() {
|
|
254988
254994
|
"use strict";
|
|
254995
|
+
__requireGlob = __createRequireGlob(import.meta.url);
|
|
254996
|
+
({ glob: glob2 } = __requireGlob("glob"));
|
|
254989
254997
|
DEFAULT_EXCLUDE = [
|
|
254990
254998
|
"node_modules",
|
|
254991
254999
|
".git",
|
package/package.json
CHANGED
|
@@ -227,6 +227,23 @@ These are backed by a persistent SQLite code-graph in .oa/index/. First
|
|
|
227
227
|
call pays a one-shot index cost; subsequent calls are fast. Use grep_search
|
|
228
228
|
for free-text matching that spans non-code files or comments.
|
|
229
229
|
|
|
230
|
+
## Shell Working Directory Persistence
|
|
231
|
+
|
|
232
|
+
`shell` calls maintain a persistent current directory across invocations.
|
|
233
|
+
If you run `cd subdir && pnpm install`, the next `shell` call starts in
|
|
234
|
+
`subdir`. This matches a real interactive terminal — you don't need to
|
|
235
|
+
re-cd before every command.
|
|
236
|
+
|
|
237
|
+
- `cd /tmp` → next call starts in /tmp
|
|
238
|
+
- `cd subdir/foo && do_x` → tracking captures whatever pwd ends at; if
|
|
239
|
+
any cd in the chain failed, prior cwd is preserved
|
|
240
|
+
- The host process working directory is NEVER mutated; only this tool's
|
|
241
|
+
tracked cwd. Other tools (file_read, grep_search, etc.) still resolve
|
|
242
|
+
paths relative to the project root.
|
|
243
|
+
- Capture works on POSIX shells and on Windows cmd.exe. Tracking is
|
|
244
|
+
best-effort; if the wrapper can't write the post-execution pwd
|
|
245
|
+
(read-only tmpdir, killed shell, etc.) the prior cwd is kept.
|
|
246
|
+
|
|
230
247
|
## Self-Learning
|
|
231
248
|
|
|
232
249
|
When you encounter an unfamiliar API, language feature, or runtime behavior:
|
|
@@ -32,7 +32,7 @@ NEVER say "I can't do that". ALWAYS attempt the task using your tools. If a tool
|
|
|
32
32
|
- symbol_search: AST-precise symbol lookup (exact or pattern). Use for "where is X defined?" instead of grep.
|
|
33
33
|
- impact_analysis: Blast-radius for a file/symbol (callers, importers, inheritors). Use before refactoring.
|
|
34
34
|
- code_neighbors: Nth-degree file traversal along import/inherit/call edges. Use to explore structure.
|
|
35
|
-
- shell: Execute any shell command (tests, builds, git, npm, etc.)
|
|
35
|
+
- shell: Execute any shell command (tests, builds, git, npm, etc.). Working directory persists across calls — `cd subdir` sticks for the next `shell` call.
|
|
36
36
|
- list_directory: List files in a directory
|
|
37
37
|
- web_search: Search the web
|
|
38
38
|
- web_fetch: Fetch a web page's text
|
|
@@ -42,6 +42,7 @@ Rules:
|
|
|
42
42
|
- If ENOENT, list_directory on project root. Don't guess paths.
|
|
43
43
|
- To FIND something in code: use grep_search FIRST, then file_read the specific result. Do NOT read entire files hoping to find text.
|
|
44
44
|
- For SYMBOLS (where is X defined? who calls X? what imports this file?): use symbol_search / impact_analysis / code_neighbors — they query an AST-precise index and are faster+cheaper than grep on large codebases.
|
|
45
|
+
- shell `cd` PERSISTS across calls. `cd subdir` then `do_x` works without re-cd-ing.
|
|
45
46
|
- Simple questions need 1-3 tool calls. Do NOT over-engineer simple tasks.
|
|
46
47
|
- Directory entries are RELATIVE. If you list "parent/" and see "child", the path is "parent/child" — NOT ".child".
|
|
47
48
|
- Use list_directory for directories, NOT file_read. Prefer list_directory over shell ls.
|