@0perator/operator 0.1.37 → 0.1.39

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The TypeScript + [Ink](https://github.com/vadimdemedes/ink) port of KODE: an Aurora-backed agentic
4
4
  terminal coding agent, built to the frozen `SPEC/` contract shared with the Python core (`kode`/`kode+`).
5
- Launched as **`operator`** (1M-only) / **`operator+`** (Air⇄1M) — the AXE counterpart to Claude Code.
5
+ Launched as **`operator`** (1M-only) / **`operator+`** (Air⇄1M) — AXE's agentic terminal, built on the Aurora model.
6
6
 
7
7
  The port's reason to exist: a **full-frame React reconciler + Ink `<Static>`** render, which makes the
8
8
  scroll / echo / prompt-overwrite bug class of the ANSI-cursor Python REPL *structurally impossible*.
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ import { expandFileMentions } from "./util/mentions.js";
19
19
  import { join } from "node:path";
20
20
  import { homedir, hostname } from "node:os";
21
21
  import { createHash } from "node:crypto";
22
- const VERSION = "0.1.37";
22
+ const VERSION = "0.1.39";
23
23
  // operator/settings.json (override path via KODE_TSI_SETTINGS), env vars still win — see config/settings.ts.
24
24
  const settings = loadSettings();
25
25
  // Propagate the resolved sandbox mode to the tool layer (registry reads KODE_SANDBOX at exec time).
@@ -705,7 +705,7 @@ function Root() {
705
705
  onInterrupt: () => s.interrupt(), // follower cancels the turn
706
706
  onState: (st, detail) => {
707
707
  if (st === "live")
708
- sys(`✷ remote control LIVE — session ${rh.id} · attach from the app to drive it. /remotecontrol again to stop.`);
708
+ sys(`✷ remote control LIVE — session ${rh.id}\n Continue on your phone or at https://0perator.co/session/${rh.id}\n /remotecontrol again to stop.`);
709
709
  else if (st === "error")
710
710
  sys(`remote control error: ${detail ?? "connection lost"} — /remotecontrol to retry`);
711
711
  else if (st === "closed")
@@ -25,7 +25,10 @@ const PROD_CMD = [
25
25
  ];
26
26
  // Command/arg patterns for irreversible destruction (data / disk / filesystem).
27
27
  const DESTRUCTIVE_CMD = [
28
- /\brm\s+-[a-z]*r[a-z]*f?\b/i, // rm -rf …
28
+ // Recursive/forced rm in ANY flag form: -rf, -fr, -r -f, --recursive, --force (split flags used to slip
29
+ // the floor as an ordinary "ask"). A recursive OR forced delete is irreversible enough to need a human.
30
+ /\brm\b[^|;&\n]*\s-{1,2}[a-z]*r/i, // rm … -r / -rf / --recursive
31
+ /\brm\b[^|;&\n]*\s-{1,2}[a-z]*f/i, // rm … -f / --force
29
32
  /\b(mkfs|dd)\b/i,
30
33
  /\bshutdown\b|\breboot\b/i,
31
34
  /:\(\)\s*\{.*\}\s*;/, // fork bomb
@@ -1,18 +1,10 @@
1
+ import { pexecFile } from "./exec.js";
1
2
  const nodeImport = (m) => import(m);
2
3
  // Module-level enable flag: flipped once at startup from settings/env. Tools read it on every call so a
3
4
  // registry entry that somehow outlives a disable can never act.
4
5
  let ENABLED = false;
5
6
  export function setComputerEnabled(on) { ENABLED = on; }
6
7
  export function computerEnabled() { return ENABLED; }
7
- let _pexec = null;
8
- async function pexecFile(file, args, opts) {
9
- if (!_pexec) {
10
- const { execFile } = await nodeImport("node:child_process");
11
- const { promisify } = await nodeImport("node:util");
12
- _pexec = promisify(execFile);
13
- }
14
- return _pexec(file, args, opts);
15
- }
16
8
  function str(v, fallback = "") {
17
9
  return v === undefined || v === null ? fallback : String(v);
18
10
  }
@@ -0,0 +1,14 @@
1
+ // Shared lazy execFile helper (node-only). Same contract as promisify(execFile): resolves
2
+ // {stdout,stderr}, rejects with the error object (stdout/stderr attached) on non-zero exit. Imports are
3
+ // LAZY via an opaque specifier so this stays node-free at module load — safe to import from any bundle;
4
+ // the CLI tools (registry.ts, computer.ts) share this one copy instead of each carrying its own.
5
+ const nodeImport = (m) => import(/* @vite-ignore */ m);
6
+ let _pexec = null;
7
+ export async function pexecFile(file, args, opts) {
8
+ if (!_pexec) {
9
+ const { execFile } = await nodeImport("node:child_process");
10
+ const { promisify } = await nodeImport("node:util");
11
+ _pexec = promisify(execFile);
12
+ }
13
+ return _pexec(file, args, opts);
14
+ }
@@ -6,19 +6,10 @@
6
6
  // mobile app runs tools natively in Swift. nodeImport() keeps esbuild from statically resolving them.
7
7
  const nodeImport = (m) => import(m);
8
8
  import { MemoryStore } from "../memory/index.js";
9
+ import { pexecFile } from "./exec.js";
9
10
  import { deniedWriteAsync, deniedReadAsync, wrapShell } from "./sandbox.js";
10
11
  import { ensureSearxng, noteSearxngUsed } from "./searxng.js";
11
- // Lazily built + cached on first use (node only). Same contract as promisify(execFile): resolves
12
- // {stdout,stderr}, rejects with the error object (stdout/stderr attached) on non-zero exit.
13
- let _pexec = null;
14
- async function pexecFile(file, args, opts) {
15
- if (!_pexec) {
16
- const { execFile } = await nodeImport("node:child_process");
17
- const { promisify } = await nodeImport("node:util");
18
- _pexec = promisify(execFile);
19
- }
20
- return _pexec(file, args, opts);
21
- }
12
+ // execFile helper lives in ./exec (shared with computer.ts — one copy, not two).
22
13
  function str(v, fallback = "") {
23
14
  return v === undefined || v === null ? fallback : String(v);
24
15
  }
@@ -1,4 +1,4 @@
1
- // @file mentions (Claude-Code parity): when the owner types `@path`, inline that file's content into the
1
+ // @file mentions (parity with modern coding agents): when the owner types `@path`, inline that file's content into the
2
2
  // SENT prompt (the visible message keeps the @path as typed). Only tokens that resolve to a real file are
3
3
  // expanded — `@someone` that isn't a path is left untouched — and each file is bounded + oversized/dir
4
4
  // paths are skipped, so a stray `@node_modules/...` can't blow the context. Matched at a word boundary so
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0perator/operator",
3
- "version": "0.1.37",
3
+ "version": "0.1.39",
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": {