@0perator/operator 0.1.32 → 0.1.33
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/cli.js +8 -4
- package/dist/tools/registry.js +16 -2
- package/dist/update.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
|
18
18
|
import { join } from "node:path";
|
|
19
19
|
import { homedir, hostname } from "node:os";
|
|
20
20
|
import { createHash } from "node:crypto";
|
|
21
|
-
const VERSION = "0.1.
|
|
21
|
+
const VERSION = "0.1.33";
|
|
22
22
|
// operator/settings.json (override path via KODE_TSI_SETTINGS), env vars still win — see config/settings.ts.
|
|
23
23
|
const settings = loadSettings();
|
|
24
24
|
// Propagate the resolved sandbox mode to the tool layer (registry reads KODE_SANDBOX at exec time).
|
|
@@ -104,7 +104,7 @@ function buildRouter() {
|
|
|
104
104
|
}
|
|
105
105
|
// Project context: auto-load a per-repo instructions file (AGENTS.md / CLAUDE.md / .operator/AGENTS.md)
|
|
106
106
|
// from the working dir and append it to the system prompt, so Operator picks up house rules, conventions
|
|
107
|
-
// and build commands the way
|
|
107
|
+
// and build commands the way modern coding agents do. First match wins; capped so a huge file can't blow
|
|
108
108
|
// the prompt. Best-effort — a missing file is normal.
|
|
109
109
|
function loadProjectContext() {
|
|
110
110
|
for (const name of ["AGENTS.md", "CLAUDE.md", ".operator/AGENTS.md", "OPERATOR.md"]) {
|
|
@@ -118,7 +118,11 @@ function loadProjectContext() {
|
|
|
118
118
|
return "";
|
|
119
119
|
}
|
|
120
120
|
const SYSTEM_PROMPT = (settings.systemPrompt ??
|
|
121
|
-
`You are Operator,
|
|
121
|
+
`You are Operator, AXE's terminal coding agent — built by AXE, running on AXE's Aurora model. Refer to ` +
|
|
122
|
+
`yourself as Operator and to the platform as AXE; never call yourself or the platform Claude, ` +
|
|
123
|
+
`Anthropic, or any other vendor. When you encounter files or directories on disk named "claude", ` +
|
|
124
|
+
`".claude", "anthropic", etc., describe them neutrally (by their literal path, or as "AI tooling ` +
|
|
125
|
+
`files") — do not attribute them to a vendor. Use your tools to inspect and edit the ` +
|
|
122
126
|
`workspace; prefer doing over explaining. Answer concisely.\n## This machine\nWorking dir: ${process.cwd()}` +
|
|
123
127
|
`\nContext window: 1,048,576 tokens (1M) — you run on the Aurora model served locally with a full ` +
|
|
124
128
|
`1M-token context. You can hold very large files and long histories; do not claim a smaller limit.` +
|
|
@@ -738,7 +742,7 @@ if (process.argv[2] === "auth") {
|
|
|
738
742
|
const { runAuth } = await import("./auth/commands.js");
|
|
739
743
|
process.exit(await runAuth(process.argv.slice(3)));
|
|
740
744
|
}
|
|
741
|
-
// `operator update` (bareword
|
|
745
|
+
// `operator update` (bareword) and `operator --update` both self-update.
|
|
742
746
|
if (process.argv[2] === "update" || process.argv.includes("--update")) {
|
|
743
747
|
const { runUpdate } = await import("./update.js");
|
|
744
748
|
process.exit(await runUpdate());
|
package/dist/tools/registry.js
CHANGED
|
@@ -137,16 +137,30 @@ async function grepSearch(args) {
|
|
|
137
137
|
const path = str(args.path, ".");
|
|
138
138
|
if (!pattern)
|
|
139
139
|
return "error: no pattern given";
|
|
140
|
-
|
|
140
|
+
// -s suppresses errors for unreadable/special files (sockets, FIFOs, permission-denied) that a
|
|
141
|
+
// recursive grep over a real dir (e.g. /private/tmp, full of IPC sockets) inevitably hits; without it
|
|
142
|
+
// grep exits 2 and the tool used to report a hard failure even when it HAD found matches.
|
|
143
|
+
const flags = ["-rns", "-I", "--exclude-dir=.git", "--exclude-dir=node_modules", "--exclude=.operator-session.json"];
|
|
141
144
|
if (args.glob)
|
|
142
145
|
flags.push(`--include=${str(args.glob)}`);
|
|
143
146
|
try {
|
|
144
|
-
|
|
147
|
+
// A hard timeout+SIGKILL guards against a pathological special file grep can BLOCK on: a socket
|
|
148
|
+
// errors immediately, but a FIFO with no writer hangs grep on open forever. Killed grep still leaves
|
|
149
|
+
// whatever it matched in stdout (handled in the catch), so a real dir with a stray pipe can't wedge
|
|
150
|
+
// the agent.
|
|
151
|
+
const { stdout } = await pexecFile("grep", [...flags, "-E", pattern, path], { maxBuffer: 10 * 1024 * 1024, timeout: 20_000, killSignal: "SIGKILL" });
|
|
145
152
|
return capMatches(stdout);
|
|
146
153
|
}
|
|
147
154
|
catch (e) {
|
|
155
|
+
// grep exit codes: 0=match, 1=no match, 2=error. With -r, grep still emits every match it DID find
|
|
156
|
+
// before exiting 2 on an unreadable file (or being killed on timeout) — so prefer stdout when present;
|
|
157
|
+
// only a truly empty result is an error worth surfacing.
|
|
158
|
+
if (e.stdout && String(e.stdout).trim())
|
|
159
|
+
return capMatches(String(e.stdout));
|
|
148
160
|
if (e.code === 1)
|
|
149
161
|
return "(no matches)";
|
|
162
|
+
if (e.killed)
|
|
163
|
+
return "(search timed out — narrow the path; a blocking special file may be present)";
|
|
150
164
|
return `error: ${e.stderr || e.message}`;
|
|
151
165
|
}
|
|
152
166
|
}
|
package/dist/update.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// `operator update` — self-update,
|
|
1
|
+
// `operator update` — self-update (bareword, like a CLI self-updater). Two install shapes:
|
|
2
2
|
// • npm-global → the published package on the registry; update = reinstall @latest.
|
|
3
3
|
// • source/dev → a git checkout linked via `npm link`; update = pull + rebuild.
|
|
4
4
|
// We detect the shape from where THIS module resolves: a checkout still has a .git above it;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0perator/operator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"description": "Operator (KODE) — TypeScript + Ink terminal coding agent. Full-frame render, single-engine core shared across CLI/web/mobile; runs against a local Aurora model.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|