@0perator/operator 0.1.349 → 0.1.351
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/autonomy/index.js +6 -5
- package/dist/autonomy/session-factory.js +4 -0
- package/dist/cli.js +32 -14
- package/dist/config/toolchain.js +151 -0
- package/dist/enterprise/cli.js +48 -1
- package/dist/gateway-cli.js +46 -4
- package/dist/models/bench.js +12 -7
- package/dist/models/switch.js +82 -29
- package/dist/permissions/policy.js +5 -2
- package/dist/services/preflight.js +98 -44
- package/dist/session.js +12 -2
- package/dist/toolchain/manifest.json +222 -0
- package/dist/toolchain/toolchain.py +2723 -0
- package/dist/toolchain-cli.js +26 -0
- package/dist/tools/computer.js +8 -0
- package/dist/tools/contract.js +9 -0
- package/dist/tools/git-pr.js +1 -0
- package/dist/tools/monitoring-tools.js +3 -0
- package/dist/tools/registry.js +38 -2
- package/dist/tools/wave-tools.js +4 -0
- package/dist/tools/wave2-tools.js +31 -9
- package/dist/ui/App.js +2 -2
- package/dist/ui/StatusRule.js +7 -6
- package/package.json +2 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// `operator toolchain …` — the Operator toolchain CLI (the repo's toolchain/toolchain.py: install, activate, rollback,
|
|
2
|
+
// which, verify, status, migrate, smoke, gate, manifest check). The package ships it in dist/toolchain/ beside the
|
|
3
|
+
// manifest it was released with (scripts/copy-toolchain.mjs); a checkout runs the repo's copy. Either way it runs under
|
|
4
|
+
// /usr/bin/python3 -I, like the fleet's toolchain/bin/toolchain shim, so Homebrew's python and PYTHON* never reach it.
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
export const SYSTEM_PYTHON = "/usr/bin/python3";
|
|
10
|
+
/** The toolchain.py this install runs: the packaged copy (dist/toolchain/), else the checkout's (../../toolchain/). */
|
|
11
|
+
export function toolchainScript(here = dirname(fileURLToPath(import.meta.url))) {
|
|
12
|
+
return [join(here, "toolchain", "toolchain.py"), join(here, "..", "..", "toolchain", "toolchain.py")].find((p) => existsSync(p));
|
|
13
|
+
}
|
|
14
|
+
export function runToolchain(args, here) {
|
|
15
|
+
const script = toolchainScript(here);
|
|
16
|
+
if (!script) {
|
|
17
|
+
process.stderr.write("operator toolchain: toolchain.py is not in this install (reinstall with `operator update`)\n");
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
const r = spawnSync(SYSTEM_PYTHON, ["-I", script, ...args], { stdio: "inherit" });
|
|
21
|
+
if (r.error) {
|
|
22
|
+
process.stderr.write(`operator toolchain: ${SYSTEM_PYTHON}: ${r.error.message}\n`);
|
|
23
|
+
return 1;
|
|
24
|
+
}
|
|
25
|
+
return r.status ?? 1;
|
|
26
|
+
}
|
package/dist/tools/computer.js
CHANGED
|
@@ -221,48 +221,56 @@ async function doctor(_args) {
|
|
|
221
221
|
export const COMPUTER_TOOLS = [
|
|
222
222
|
{
|
|
223
223
|
name: "app_open",
|
|
224
|
+
contract: { v: 1, effects: ["exec", "device"], bins: ["open"] },
|
|
224
225
|
description: "Open or bring a macOS application to the front by name (e.g. Safari, Notes, Finder). Launches it if not running.",
|
|
225
226
|
parameters: { type: "object", properties: { app: { type: "string", description: "Application name, e.g. \"Safari\"" } }, required: ["app"] },
|
|
226
227
|
run: appOpen,
|
|
227
228
|
},
|
|
228
229
|
{
|
|
229
230
|
name: "app_activate",
|
|
231
|
+
contract: { v: 1, effects: ["exec", "device"], bins: ["osascript"] },
|
|
230
232
|
description: "Focus/activate an already-running macOS app so keystrokes go to it.",
|
|
231
233
|
parameters: { type: "object", properties: { app: { type: "string" } }, required: ["app"] },
|
|
232
234
|
run: appActivate,
|
|
233
235
|
},
|
|
234
236
|
{
|
|
235
237
|
name: "computer_applescript",
|
|
238
|
+
contract: { v: 1, effects: ["exec", "device"], bins: ["osascript"] },
|
|
236
239
|
description: "Run an arbitrary AppleScript via osascript — the general escape hatch for controlling any scriptable macOS app (open a URL in Safari, compose Mail, read Notes, control Music, etc.). Returns the script's result.",
|
|
237
240
|
parameters: { type: "object", properties: { script: { type: "string", description: "AppleScript source" }, timeout_ms: { type: "number" } }, required: ["script"] },
|
|
238
241
|
run: runAppleScript,
|
|
239
242
|
},
|
|
240
243
|
{
|
|
241
244
|
name: "computer_type",
|
|
245
|
+
contract: { v: 1, effects: ["device"], bins: ["osascript"] },
|
|
242
246
|
description: "Type text into the frontmost app (or a named app) as if typed on the keyboard. Requires macOS Accessibility permission.",
|
|
243
247
|
parameters: { type: "object", properties: { text: { type: "string" }, app: { type: "string", description: "optional: activate this app first" } }, required: ["text"] },
|
|
244
248
|
run: typeText,
|
|
245
249
|
},
|
|
246
250
|
{
|
|
247
251
|
name: "computer_key",
|
|
252
|
+
contract: { v: 1, effects: ["device"], bins: ["osascript"] },
|
|
248
253
|
description: "Press a key or key-combo (e.g. { key: \"return\" }, { key: \"s\", modifiers: [\"command\"] }, { key: \"tab\" }). Requires Accessibility.",
|
|
249
254
|
parameters: { type: "object", properties: { key: { type: "string", description: "return|tab|space|escape|delete|up|down|left|right|home|end|f1..f12, or a single character" }, modifiers: { type: "array", items: { type: "string", enum: ["command", "control", "option", "shift"] } }, app: { type: "string" } }, required: ["key"] },
|
|
250
255
|
run: pressKey,
|
|
251
256
|
},
|
|
252
257
|
{
|
|
253
258
|
name: "computer_click",
|
|
259
|
+
contract: { v: 1, effects: ["device"], bins: ["cliclick", "osascript"] },
|
|
254
260
|
description: "Click the mouse at absolute screen coordinates (x, y). Uses cliclick if installed, else System Events. Requires Accessibility.",
|
|
255
261
|
parameters: { type: "object", properties: { x: { type: "number" }, y: { type: "number" } }, required: ["x", "y"] },
|
|
256
262
|
run: click,
|
|
257
263
|
},
|
|
258
264
|
{
|
|
259
265
|
name: "computer_screenshot",
|
|
266
|
+
contract: { v: 1, effects: ["device", "write"], bins: ["screencapture"] },
|
|
260
267
|
description: "Capture the screen to a PNG file and return its path. Requires Screen Recording permission. (Note: the model cannot read the image back yet — vision input is pending.)",
|
|
261
268
|
parameters: { type: "object", properties: { path: { type: "string", description: "optional output path; defaults to a temp file" } } },
|
|
262
269
|
run: screenshot,
|
|
263
270
|
},
|
|
264
271
|
{
|
|
265
272
|
name: "computer_doctor",
|
|
273
|
+
contract: { v: 1, effects: ["read", "device"], bins: ["osascript", "screencapture", "cliclick"] },
|
|
266
274
|
description: "Preflight check: report which macOS permissions (Accessibility, Screen Recording, Automation) and helper binaries are wired for computer control, and exactly what to grant.",
|
|
267
275
|
parameters: { type: "object", properties: {} },
|
|
268
276
|
run: doctor,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Per-tool contract: what a tool does to the world and which binaries it spawns, declared inline on the Tool
|
|
2
|
+
// beside `safe`. Phase 1 is declarations only — nothing at runtime reads a contract, toSchemas never sends one
|
|
3
|
+
// (the tools array is the cached prompt prefix), and `safe` stays authoritative. scripts/tool-catalog.mts
|
|
4
|
+
// publishes every contract to toolchain/tools/catalog.json; test/tool-contract.test.mts and
|
|
5
|
+
// test/tool-bins.test.mts hold the gaps to toolchain/tools/baseline.json, whose lists may only shrink.
|
|
6
|
+
// A DEPENDENCY-FREE leaf like mutating.ts: registry.ts reaches it from the neutral bundle.
|
|
7
|
+
export const EFFECTS = ["read", "fetch", "state", "write", "egress", "exec", "destructive", "device"];
|
|
8
|
+
/** What `safe` should mean once contracts drive it: every declared effect is a read. */
|
|
9
|
+
export const isReadOnly = (c) => c.effects.every((e) => e === "read" || e === "fetch");
|
package/dist/tools/git-pr.js
CHANGED
|
@@ -80,6 +80,7 @@ export async function gitPr(args) {
|
|
|
80
80
|
export const GIT_PR_TOOLS = [
|
|
81
81
|
{
|
|
82
82
|
name: "git_pr", safe: false,
|
|
83
|
+
contract: { v: 1, effects: ["read", "fetch", "egress"], bins: ["git", "gh"] },
|
|
83
84
|
description: "Open, check status of, or list pull requests via the gh CLI — open pushes the current " +
|
|
84
85
|
"branch and creates a real PR, so it needs approval like any other write.",
|
|
85
86
|
parameters: { type: "object", properties: {
|
|
@@ -269,6 +269,7 @@ export const MONITORING_TOOLS = [
|
|
|
269
269
|
},
|
|
270
270
|
{
|
|
271
271
|
name: "log_tail", safe: true,
|
|
272
|
+
contract: { v: 1, effects: ["read"] },
|
|
272
273
|
description: "Read the last N lines of a log file (default 80, hard cap 500). Path is realpath'd and must stay " +
|
|
273
274
|
"under $HOME (or cwd), or under the powertools root or the Operator home when set. No shell. Sensitive system paths refused.",
|
|
274
275
|
parameters: {
|
|
@@ -283,6 +284,7 @@ export const MONITORING_TOOLS = [
|
|
|
283
284
|
},
|
|
284
285
|
{
|
|
285
286
|
name: "process_snapshot", safe: true,
|
|
287
|
+
contract: { v: 1, effects: ["read"], bins: ["ps"] },
|
|
286
288
|
description: "Process table snapshot via ps with fixed columns (pid,ppid,user,pcpu,pmem,state,comm). " +
|
|
287
289
|
"Optional case-insensitive name substring filter applied in-process. max_results default 50 (hard 200). " +
|
|
288
290
|
"Native — works without the powertools MCP.",
|
|
@@ -297,6 +299,7 @@ export const MONITORING_TOOLS = [
|
|
|
297
299
|
},
|
|
298
300
|
{
|
|
299
301
|
name: "notify_local", safe: false,
|
|
302
|
+
contract: { v: 1, effects: ["device", "state"], bins: ["osascript"] },
|
|
300
303
|
description: "Local notification — macOS Notification Center via osascript, or append to operator notifications.log. " +
|
|
301
304
|
"Title/body length capped. Gated (safe:false).",
|
|
302
305
|
parameters: {
|
package/dist/tools/registry.js
CHANGED
|
@@ -2234,6 +2234,7 @@ async function voiceTranscribe(args) {
|
|
|
2234
2234
|
const TOOLS = [
|
|
2235
2235
|
{
|
|
2236
2236
|
name: "bash", safe: false,
|
|
2237
|
+
contract: { v: 1, effects: ["exec"], bins: ["bash", "sandbox-exec", "bwrap", "ps", "lsof"] },
|
|
2237
2238
|
description: "Run a command in a PERSISTENT bash session: `cd`, exported variables, an activated venv and functions carry over — set up once, don't re-`cd` or re-activate every call. stdout+stderr merged, with the exit code; pipelines run with `set -o pipefail`. Anything that may run over ~2 minutes (server, build, watcher, full test suite) goes to shell_background, not a bigger timeout_ms; ctrl+b moves a running command to the background and you are told when it ends — don't poll. Prefer SINGLE quotes for patterns and paths: a raw double-quote can break tool-call serialization.",
|
|
2238
2239
|
parameters: { type: "object", properties: {
|
|
2239
2240
|
command: { type: "string", description: "the command to run" },
|
|
@@ -2246,6 +2247,7 @@ const TOOLS = [
|
|
|
2246
2247
|
{
|
|
2247
2248
|
// Back-compat alias: older prompts/skills call `shell_exec`. Same persistent-session engine as `bash`.
|
|
2248
2249
|
name: "shell_exec", safe: false,
|
|
2250
|
+
contract: { v: 1, effects: ["exec"], bins: ["bash", "sandbox-exec", "bwrap", "ps", "lsof"] },
|
|
2249
2251
|
description: "Alias of `bash` — runs a command in the same persistent shell session (state persists across calls).",
|
|
2250
2252
|
parameters: { type: "object", properties: {
|
|
2251
2253
|
command: { type: "string" }, description: { type: "string" }, cwd: { type: "string" }, timeout_ms: { type: "number" },
|
|
@@ -2254,12 +2256,14 @@ const TOOLS = [
|
|
|
2254
2256
|
},
|
|
2255
2257
|
{
|
|
2256
2258
|
name: "shell_background", safe: false,
|
|
2259
|
+
contract: { v: 1, effects: ["exec"], bins: ["bash", "sandbox-exec", "bwrap"] },
|
|
2257
2260
|
description: "Start a long-running command DETACHED and get a job id at once. Use it from the start for servers, builds, watchers and full test suites — anything over ~2 minutes, which bash's timeout would kill. You are notified when it ends (don't poll); bash_output reads its output, bash_kill stops it.",
|
|
2258
2261
|
parameters: { type: "object", properties: { command: { type: "string" }, description: { type: "string" }, cwd: { type: "string" } }, required: ["command"] },
|
|
2259
2262
|
run: shellBackground,
|
|
2260
2263
|
},
|
|
2261
2264
|
{
|
|
2262
2265
|
name: "download_file", safe: false,
|
|
2266
|
+
contract: { v: 1, effects: ["fetch", "write"] },
|
|
2263
2267
|
description: "Download a URL to disk — use this instead of curl/wget in bash. Fails loudly on HTTP errors, resumes, retries, refuses an HTML page standing in for the file, and verifies size and (with sha256) the hash before renaming onto dest. Runs in the BACKGROUND by default; the completion notice gives the final size + sha256 or the exact error — start downloads one at a time and never report one as done until that notice arrives. background:false waits (small files only).",
|
|
2264
2268
|
parameters: { type: "object", properties: {
|
|
2265
2269
|
url: { type: "string", description: "http(s) URL" },
|
|
@@ -2287,6 +2291,7 @@ const TOOLS = [
|
|
|
2287
2291
|
},
|
|
2288
2292
|
{
|
|
2289
2293
|
name: "verify_pipeline", safe: false,
|
|
2294
|
+
contract: { v: 1, effects: ["exec"], bins: ["bash", "sandbox-exec", "bwrap", "ps", "lsof"] },
|
|
2290
2295
|
description: "Run labeled verification stages in order (e.g. build → serve → test → screenshot); aborts at the first failing stage and reports pass/fail per stage.",
|
|
2291
2296
|
parameters: { type: "object", properties: {
|
|
2292
2297
|
stages: {
|
|
@@ -2339,6 +2344,7 @@ const TOOLS = [
|
|
|
2339
2344
|
},
|
|
2340
2345
|
{
|
|
2341
2346
|
name: "file_read", safe: true,
|
|
2347
|
+
contract: { v: 1, effects: ["read"], bins: ["osascript", "textutil", "unzip"] },
|
|
2342
2348
|
description: "Read a file, optionally a line range, with line numbers. Without offset/limit, only the first 2000 lines are returned — pass offset/limit to page through a larger file.",
|
|
2343
2349
|
parameters: { type: "object", properties: {
|
|
2344
2350
|
path: { type: "string" }, offset: { type: "number" }, limit: { type: "number" },
|
|
@@ -2347,6 +2353,7 @@ const TOOLS = [
|
|
|
2347
2353
|
},
|
|
2348
2354
|
{
|
|
2349
2355
|
name: "read_files", safe: true,
|
|
2356
|
+
contract: { v: 1, effects: ["read"], bins: ["osascript", "textutil", "unzip"] },
|
|
2350
2357
|
description: "Read several files in ONE call (parallel I/O) — far faster than serial file_read calls. Entries may carry offset/limit; results come back under per-file headers.",
|
|
2351
2358
|
parameters: { type: "object", properties: {
|
|
2352
2359
|
paths: {
|
|
@@ -2399,6 +2406,7 @@ const TOOLS = [
|
|
|
2399
2406
|
},
|
|
2400
2407
|
{
|
|
2401
2408
|
name: "grep_search", safe: true,
|
|
2409
|
+
contract: { v: 1, effects: ["read"], bins: ["grep"] },
|
|
2402
2410
|
description: "Plain recursive grep for a regex under a path. Prefer `search` (ripgrep: faster, .gitignore-aware) unless you need grep semantics.",
|
|
2403
2411
|
parameters: { type: "object", properties: {
|
|
2404
2412
|
pattern: { type: "string" }, path: { type: "string" }, glob: { type: "string" },
|
|
@@ -2407,6 +2415,7 @@ const TOOLS = [
|
|
|
2407
2415
|
},
|
|
2408
2416
|
{
|
|
2409
2417
|
name: "search", safe: true,
|
|
2418
|
+
contract: { v: 1, effects: ["read"], bins: ["rg", "grep"] },
|
|
2410
2419
|
description: "Fast content search (ripgrep: parallel, .gitignore-aware, skips binaries) — prefer it over `find … | grep`. Scope with `path` (default: current dir). HARD REFUSAL: path may not be $HOME, /, /Users or another machine-wide root (they hang for minutes) — use find_files for names, a narrow subtree for content. `glob` filters filenames; files_with_matches returns just the paths (locate before you read).",
|
|
2411
2420
|
parameters: { type: "object", properties: {
|
|
2412
2421
|
pattern: { type: "string", description: "regex" },
|
|
@@ -2418,6 +2427,7 @@ const TOOLS = [
|
|
|
2418
2427
|
},
|
|
2419
2428
|
{
|
|
2420
2429
|
name: "find_files", safe: true,
|
|
2430
|
+
contract: { v: 1, effects: ["read"], bins: ["mdfind", "mdutil", "rg", "es.exe", "powershell", "tracker3", "plocate", "locate"] },
|
|
2421
2431
|
description: "Find files anywhere by NAME or METADATA (kind, date, size, extension, author, tags) through the OS search index (Spotlight / Windows Search / locate) — instant, the whole home directory by default. For \"where is the file\"; use `search` for exact content/regex within a scoped directory. Absolute paths, newest first. If the index is unavailable it scans ONE directory (`path`, else the current dir) and says so on its first line.",
|
|
2422
2432
|
parameters: { type: "object", properties: {
|
|
2423
2433
|
query: { type: "string", description: "words or a filename fragment" },
|
|
@@ -2445,12 +2455,14 @@ const TOOLS = [
|
|
|
2445
2455
|
},
|
|
2446
2456
|
{
|
|
2447
2457
|
name: "git_status", safe: true,
|
|
2458
|
+
contract: { v: 1, effects: ["read"], bins: ["git"] },
|
|
2448
2459
|
description: "Structured git state in one read: branch, ahead/behind, staged/unstaged/untracked ('nothing to commit' when clean). Use it instead of parsing `git status` in a loop.",
|
|
2449
2460
|
parameters: { type: "object", properties: { cwd: { type: "string" } } },
|
|
2450
2461
|
run: gitStatus,
|
|
2451
2462
|
},
|
|
2452
2463
|
{
|
|
2453
2464
|
name: "git_command", safe: false,
|
|
2465
|
+
contract: { v: 1, effects: ["read", "write", "destructive", "fetch", "egress", "exec"], bins: ["git"] },
|
|
2454
2466
|
description: "Run an arbitrary git subcommand (args as an argv array, no shell).",
|
|
2455
2467
|
parameters: { type: "object", properties: {
|
|
2456
2468
|
args: { type: "array", items: { type: "string" } }, cwd: { type: "string" },
|
|
@@ -2459,6 +2471,7 @@ const TOOLS = [
|
|
|
2459
2471
|
},
|
|
2460
2472
|
{
|
|
2461
2473
|
name: "checkpoint", safe: false,
|
|
2474
|
+
contract: { v: 1, effects: ["write", "state", "egress"], bins: ["git"] },
|
|
2462
2475
|
description: "Git add+commit a workspace and leave a memory note in one call. Stages only the workspace's own subtree; `paths` stages just those.",
|
|
2463
2476
|
parameters: { type: "object", properties: {
|
|
2464
2477
|
summary: { type: "string" }, workspace: { type: "string" }, push: { type: "boolean" },
|
|
@@ -2485,6 +2498,7 @@ const TOOLS = [
|
|
|
2485
2498
|
},
|
|
2486
2499
|
{
|
|
2487
2500
|
name: "web_fetch", safe: true,
|
|
2501
|
+
contract: { v: 1, effects: ["fetch"] },
|
|
2488
2502
|
description: "Fetch an http(s) URL as plain text (HTML stripped, capped at max_chars). Read-only.",
|
|
2489
2503
|
parameters: { type: "object", properties: {
|
|
2490
2504
|
url: { type: "string", description: "http(s) URL" },
|
|
@@ -2510,6 +2524,7 @@ const TOOLS = [
|
|
|
2510
2524
|
},
|
|
2511
2525
|
{
|
|
2512
2526
|
name: "file_upload", safe: false,
|
|
2527
|
+
contract: { v: 1, effects: ["read", "egress"] },
|
|
2513
2528
|
description: "Upload a local file: POST multipart/form-data (default; `field` names the form field) or PUT raw bytes (presigned-PUT style), with the same auth/headers as http_request. It sends the file to an external service — confirm the destination.",
|
|
2514
2529
|
parameters: { type: "object", properties: {
|
|
2515
2530
|
path: { type: "string", description: "local file" },
|
|
@@ -2523,6 +2538,7 @@ const TOOLS = [
|
|
|
2523
2538
|
},
|
|
2524
2539
|
{
|
|
2525
2540
|
name: "web_search", safe: true,
|
|
2541
|
+
contract: { v: 1, effects: ["fetch"], bins: ["docker"] },
|
|
2526
2542
|
description: "Search the web (a local SearXNG, falling back to the AXE autopilot SERP) → ranked title/url/snippet results. Read-only; follow up with web_fetch.",
|
|
2527
2543
|
parameters: { type: "object", properties: {
|
|
2528
2544
|
query: { type: "string", description: "the search query" },
|
|
@@ -2555,6 +2571,7 @@ const TOOLS = [
|
|
|
2555
2571
|
},
|
|
2556
2572
|
{
|
|
2557
2573
|
name: "email_send", safe: false,
|
|
2574
|
+
contract: { v: 1, effects: ["egress"] },
|
|
2558
2575
|
description: "Send an email (AXE Quill SMTP). `to` defaults to the signed-in owner, so \"email me …\" just works; plain text, `html` optional. It really sends, so the permission policy gates it. Errors clearly when no Quill key is configured.",
|
|
2559
2576
|
parameters: { type: "object", properties: {
|
|
2560
2577
|
to: { type: "string", description: "recipient; omit for the owner" },
|
|
@@ -2599,6 +2616,7 @@ const TOOLS = [
|
|
|
2599
2616
|
},
|
|
2600
2617
|
{
|
|
2601
2618
|
name: "image_analyze", safe: true,
|
|
2619
|
+
contract: { v: 1, effects: ["read"], bins: ["osascript", "textutil", "unzip", "qlmanage", "sips", "ffmpeg"] },
|
|
2602
2620
|
description: "SEE an image with real vision (the gateway's `vision` route): a local path or http(s) url + an optional question → the model's answer. Use it on a reference, screenshot or generated image before acting — never guess content from file size or pixel stats. A DOCUMENT (PDF, DOCX, XLSX, PPTX, RTF, HTML) returns its extracted TEXT, every page; only an image-only document is rendered (first page). as_image: true looks at a document's first page as a picture.",
|
|
2603
2621
|
parameters: { type: "object", properties: {
|
|
2604
2622
|
image: { type: "string", description: "local path or http(s) url — an image, or a document (returned as text)" },
|
|
@@ -2611,6 +2629,7 @@ const TOOLS = [
|
|
|
2611
2629
|
},
|
|
2612
2630
|
{
|
|
2613
2631
|
name: "image_inspect", safe: true,
|
|
2632
|
+
contract: { v: 1, effects: ["read", "fetch"], bins: ["python3"] },
|
|
2614
2633
|
description: "Image FACTS without a model — dimensions, format, megapixels, aspect, file size, dominant colors, frames, EXIF — instant, on the CPU. For measurements/metadata; image_analyze is for meaning.",
|
|
2615
2634
|
parameters: { type: "object", properties: {
|
|
2616
2635
|
image: { type: "string", description: "local path or http(s) url" },
|
|
@@ -2619,6 +2638,7 @@ const TOOLS = [
|
|
|
2619
2638
|
},
|
|
2620
2639
|
{
|
|
2621
2640
|
name: "video_analyze", safe: true,
|
|
2641
|
+
contract: { v: 1, effects: ["read", "fetch"], bins: ["ffprobe", "ffmpeg"] },
|
|
2622
2642
|
description: "SEE a video: frames sampled evenly across it are described by the VL model (the gateway's `vision` route). A local path or http(s) url + an optional question. Never guess a video's content from the file.",
|
|
2623
2643
|
parameters: { type: "object", properties: {
|
|
2624
2644
|
video: { type: "string", description: "local path or http(s) url" },
|
|
@@ -2631,6 +2651,7 @@ const TOOLS = [
|
|
|
2631
2651
|
},
|
|
2632
2652
|
{
|
|
2633
2653
|
name: "voice_speak", safe: false,
|
|
2654
|
+
contract: { v: 1, effects: ["write", "device"], bins: ["afplay"] },
|
|
2634
2655
|
description: "Say text ALOUD in Operator's own voice (Kokoro TTS) on the owner's machine — a spoken status or answer, not just printed text. Saves the WAV and returns its path; a headless box saves without playing.",
|
|
2635
2656
|
parameters: { type: "object", properties: {
|
|
2636
2657
|
text: { type: "string", description: "what to say" },
|
|
@@ -2652,6 +2673,7 @@ const TOOLS = [
|
|
|
2652
2673
|
},
|
|
2653
2674
|
{
|
|
2654
2675
|
name: "image_recreate",
|
|
2676
|
+
contract: { v: 1, effects: ["read", "write"], bins: ["osascript", "textutil", "unzip", "qlmanage", "sips", "ffmpeg"] },
|
|
2655
2677
|
description: "Recreate a REFERENCE image in one call: vision extracts a faithful prompt, then a matching image is generated (subject, style, composition, lighting — not pixel-exact). Returns the image + what it understood.",
|
|
2656
2678
|
parameters: { type: "object", properties: {
|
|
2657
2679
|
reference: { type: "string", description: "image path or http(s) url" },
|
|
@@ -2784,6 +2806,7 @@ const TOOLS = [
|
|
|
2784
2806
|
},
|
|
2785
2807
|
{
|
|
2786
2808
|
name: "delegate_to_agent", safe: false,
|
|
2809
|
+
contract: { v: 1, effects: ["exec", "egress"], bins: ["cursor-agent", "claude", "codex"] },
|
|
2787
2810
|
description: agentCliToolDescription(),
|
|
2788
2811
|
parameters: { type: "object", properties: {
|
|
2789
2812
|
task: { type: "string", description: "the complete, self-contained task — the CLI sees only this" },
|
|
@@ -2794,6 +2817,7 @@ const TOOLS = [
|
|
|
2794
2817
|
},
|
|
2795
2818
|
{
|
|
2796
2819
|
name: "browser", safe: false,
|
|
2820
|
+
contract: { v: 1, effects: ["fetch", "egress", "exec", "write"], bins: ["chrome"] },
|
|
2797
2821
|
description: "Drive a REAL headless browser (Chrome over CDP); state persists across calls — JS pages, logins, forms, clicks. Prefer browser_read for content. Actions: open/navigate(url) reload back forward click(selector) fill(selector, text) submit(selector) eval(js, awaits promises) screenshot → png path, tab_select/tab_close(index) close. http/https/about/data URLs only. Login wall: NEVER guess credentials — ask the owner.",
|
|
2798
2822
|
parameters: { type: "object", properties: {
|
|
2799
2823
|
action: { type: "string", enum: ["open", "navigate", "reload", "back", "forward", "click", "fill", "submit", "eval", "screenshot", "tab_select", "tab_close", "close"], description: "the browser action" },
|
|
@@ -2809,6 +2833,7 @@ const TOOLS = [
|
|
|
2809
2833
|
},
|
|
2810
2834
|
{
|
|
2811
2835
|
name: "browser_read", safe: true,
|
|
2836
|
+
contract: { v: 1, effects: ["read"], bins: ["chrome"] },
|
|
2812
2837
|
description: "Read the active page of the `browser` session without changing it: info (title/url/readyState), text (innerText), tab_list. Open a page with browser first.",
|
|
2813
2838
|
parameters: { type: "object", properties: {
|
|
2814
2839
|
action: { type: "string", enum: ["info", "text", "tab_list"], description: "what to read" },
|
|
@@ -2843,8 +2868,11 @@ const TOOLS = [
|
|
|
2843
2868
|
run: runSkillCatalog,
|
|
2844
2869
|
},
|
|
2845
2870
|
// ── Chauffeur native tools (gated on binary availability) ──
|
|
2871
|
+
// The screen reads are not `safe`: that would grant screen capture to every seat tier and run it unprompted in
|
|
2872
|
+
// gated and plan mode. It is computer control, like computer_screenshot (tier.ts).
|
|
2846
2873
|
{
|
|
2847
|
-
name: "desktop_screenshot", safe:
|
|
2874
|
+
name: "desktop_screenshot", safe: false,
|
|
2875
|
+
contract: { v: 1, effects: ["device"], bins: ["chauffeur-local", "chauffeur", "sh"] },
|
|
2848
2876
|
description: "Screenshot the desktop or one window via Chauffeur (text + image).",
|
|
2849
2877
|
parameters: { type: "object", properties: {
|
|
2850
2878
|
pid: { type: "number", description: "optional target process" },
|
|
@@ -2854,6 +2882,7 @@ const TOOLS = [
|
|
|
2854
2882
|
},
|
|
2855
2883
|
{
|
|
2856
2884
|
name: "desktop_click", safe: false,
|
|
2885
|
+
contract: { v: 1, effects: ["device"], bins: ["chauffeur-local", "chauffeur", "sh"] },
|
|
2857
2886
|
description: "Click on the desktop via Chauffeur by coordinates (x, y), an accessibility element, or both; verifies the click landed.",
|
|
2858
2887
|
parameters: { type: "object", properties: {
|
|
2859
2888
|
description: { type: "string", description: "what you're clicking and why" },
|
|
@@ -2865,7 +2894,8 @@ const TOOLS = [
|
|
|
2865
2894
|
run: desktopClick,
|
|
2866
2895
|
},
|
|
2867
2896
|
{
|
|
2868
|
-
name: "desktop_read", safe:
|
|
2897
|
+
name: "desktop_read", safe: false,
|
|
2898
|
+
contract: { v: 1, effects: ["device"], bins: ["chauffeur-local", "chauffeur", "sh"] },
|
|
2869
2899
|
description: "Read the accessibility tree / window state of a running application via Chauffeur.",
|
|
2870
2900
|
parameters: { type: "object", properties: {
|
|
2871
2901
|
pid: { type: "number" }, window_id: { type: "number" },
|
|
@@ -2874,6 +2904,7 @@ const TOOLS = [
|
|
|
2874
2904
|
},
|
|
2875
2905
|
{
|
|
2876
2906
|
name: "app_interact", safe: false,
|
|
2907
|
+
contract: { v: 1, effects: ["exec", "device"], bins: ["chauffeur-local", "chauffeur", "sh"] },
|
|
2877
2908
|
description: "High-level app control via Chauffeur: launch an app, or find / click / type into / read an element.",
|
|
2878
2909
|
parameters: { type: "object", properties: {
|
|
2879
2910
|
app: { type: "string", description: "app name, e.g. 'Safari'" },
|
|
@@ -2885,6 +2916,7 @@ const TOOLS = [
|
|
|
2885
2916
|
},
|
|
2886
2917
|
{
|
|
2887
2918
|
name: "capture_permalink", safe: false,
|
|
2919
|
+
contract: { v: 1, effects: ["exec", "device"], bins: ["chauffeur-local", "chauffeur", "sh"] },
|
|
2888
2920
|
description: "Capture a permalink from an app (e.g. Slack message link) by right-clicking an element and reading the clipboard.",
|
|
2889
2921
|
parameters: { type: "object", properties: {
|
|
2890
2922
|
app: { type: "string", description: "application to target" },
|
|
@@ -2894,6 +2926,7 @@ const TOOLS = [
|
|
|
2894
2926
|
},
|
|
2895
2927
|
{
|
|
2896
2928
|
name: "live_drive", safe: false,
|
|
2929
|
+
contract: { v: 1, effects: ["fetch", "device"], bins: ["chauffeur-local", "chauffeur", "sh"] },
|
|
2897
2930
|
description: "Live UI verification in the browser: open `url` and run labeled checks (screenshot, find, click, text); pass/fail per check.",
|
|
2898
2931
|
parameters: { type: "object", properties: {
|
|
2899
2932
|
url: { type: "string", description: "URL to open" },
|
|
@@ -3078,6 +3111,7 @@ const CLOUD_HOSTED_NOTE = "Runs in an ISOLATED DOCKER CONTAINER on a configured
|
|
|
3078
3111
|
export const CLOUD_AGENT_TOOLS = [
|
|
3079
3112
|
{
|
|
3080
3113
|
name: "spawn_cloud_agent", safe: false,
|
|
3114
|
+
contract: { v: 1, effects: ["exec", "egress"], bins: ["docker", "ssh"] },
|
|
3081
3115
|
description: `Spawn an autonomous "cloud agent". ${CLOUD_HOSTED_NOTE} MUTATES a repo: it creates and pushes a new branch \`cloud/<id>\` and opens a PR against \`base_branch\`. Pick \`host\` from settings.cloudAgents.hosts (defaults to settings.cloudAgents.defaultHost) and \`agent\` from the agent-CLI registry (cursor-agent / claude / codex / operator). Secrets (git creds, agent API keys) are passed to the container at runtime from the environment — never baked in or logged. Returns a tracked id; follow it with cloud_agent_status / list_cloud_agents and stop it with stop_cloud_agent.`,
|
|
3082
3116
|
parameters: { type: "object", properties: {
|
|
3083
3117
|
task: { type: "string", description: "the complete, self-contained task the container's agent runs autonomously (it has no memory of this conversation)" },
|
|
@@ -3097,6 +3131,7 @@ export const CLOUD_AGENT_TOOLS = [
|
|
|
3097
3131
|
},
|
|
3098
3132
|
{
|
|
3099
3133
|
name: "cloud_agent_status", safe: false,
|
|
3134
|
+
contract: { v: 1, effects: ["fetch", "state"], bins: ["docker", "ssh"] },
|
|
3100
3135
|
description: `Check one cloud agent by id: docker-inspects its container on its host, tails the container log, and reports status + branch + PR. ${CLOUD_HOSTED_NOTE}`,
|
|
3101
3136
|
parameters: { type: "object", properties: {
|
|
3102
3137
|
id: { type: "string", description: "the cloud-agent id (from spawn_cloud_agent / list_cloud_agents)" },
|
|
@@ -3105,6 +3140,7 @@ export const CLOUD_AGENT_TOOLS = [
|
|
|
3105
3140
|
},
|
|
3106
3141
|
{
|
|
3107
3142
|
name: "stop_cloud_agent", safe: false,
|
|
3143
|
+
contract: { v: 1, effects: ["destructive", "state"], bins: ["docker", "ssh"] },
|
|
3108
3144
|
description: `Stop and remove a cloud agent's container by id and mark it stopped. ${CLOUD_HOSTED_NOTE} Use when a run is wrong or no longer needed; already-pushed commits/PR are NOT deleted.`,
|
|
3109
3145
|
parameters: { type: "object", properties: {
|
|
3110
3146
|
id: { type: "string", description: "the cloud-agent id (from spawn_cloud_agent / list_cloud_agents)" },
|
package/dist/tools/wave-tools.js
CHANGED
|
@@ -462,6 +462,7 @@ export const WAVE_TOOLS = [
|
|
|
462
462
|
},
|
|
463
463
|
{
|
|
464
464
|
name: "pkg_install", safe: false,
|
|
465
|
+
contract: { v: 1, effects: ["fetch", "write", "exec"], bins: ["npm", "yarn", "pnpm", "cargo", "pip"] },
|
|
465
466
|
description: "Install packages. Auto-detects package manager from lockfile (npm/yarn/pnpm/cargo/pip).",
|
|
466
467
|
parameters: { type: "object", properties: {
|
|
467
468
|
packages: { type: "array", items: { type: "string" }, description: "package names to install" },
|
|
@@ -472,6 +473,7 @@ export const WAVE_TOOLS = [
|
|
|
472
473
|
},
|
|
473
474
|
{
|
|
474
475
|
name: "pkg_remove", safe: false,
|
|
476
|
+
contract: { v: 1, effects: ["write", "destructive", "exec"], bins: ["npm", "yarn", "pnpm", "cargo", "pip"] },
|
|
475
477
|
description: "Remove/uninstall packages. Auto-detects package manager.",
|
|
476
478
|
parameters: { type: "object", properties: {
|
|
477
479
|
packages: { type: "array", items: { type: "string" } },
|
|
@@ -482,6 +484,7 @@ export const WAVE_TOOLS = [
|
|
|
482
484
|
},
|
|
483
485
|
{
|
|
484
486
|
name: "validate", safe: true,
|
|
487
|
+
contract: { v: 1, effects: ["exec"], bins: ["sh"] },
|
|
485
488
|
description: "Run the project's registered validation command (see validate_register) and return PASS/FAIL + output. Registering or changing the command requires approval; this tool never runs an ad-hoc command.",
|
|
486
489
|
parameters: { type: "object", properties: {} },
|
|
487
490
|
run: validateRun,
|
|
@@ -519,6 +522,7 @@ export const WAVE_TOOLS = [
|
|
|
519
522
|
},
|
|
520
523
|
{
|
|
521
524
|
name: "lsp_diag", safe: true,
|
|
525
|
+
contract: { v: 1, effects: ["read", "write", "fetch", "exec"], bins: ["npx", "python3", "node"] },
|
|
522
526
|
description: "Get linter/compiler diagnostics for a file. Supports .ts/.tsx (tsc), .py (py_compile), .js/.mjs/.cjs (node --check).",
|
|
523
527
|
parameters: { type: "object", properties: {
|
|
524
528
|
path: { type: "string", description: "file to check" },
|
|
@@ -62,12 +62,20 @@ function termGroup(pid) {
|
|
|
62
62
|
catch { }
|
|
63
63
|
return false;
|
|
64
64
|
}
|
|
65
|
-
/** Deadline
|
|
66
|
-
function
|
|
67
|
-
|
|
65
|
+
/** Deadline note shared by status/list: a report, never a signal. */
|
|
66
|
+
function deadlineNote(meta) {
|
|
67
|
+
return alive(meta.pid) && overdue(meta) ? " (deadline passed — shell_task_kill stops it)" : "";
|
|
68
|
+
}
|
|
69
|
+
/** The OS start time of `pid` (`ps -o lstart=`), or "" when it is gone or unreadable. lstart is strftime %c in
|
|
70
|
+
* local time, so the C locale and UTC are pinned: the same process reads the same from any session. */
|
|
71
|
+
async function procStart(pid) {
|
|
72
|
+
try {
|
|
73
|
+
const env = { ...process.env, LC_ALL: "C", TZ: "UTC" };
|
|
74
|
+
return (await pexecFile("ps", ["-o", "lstart=", "-p", String(pid)], { timeout: 5_000, encoding: "utf8", env })).stdout.trim();
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
68
77
|
return "";
|
|
69
|
-
|
|
70
|
-
return " (deadline passed — terminated)";
|
|
78
|
+
}
|
|
71
79
|
}
|
|
72
80
|
async function shellTaskStartRun(args) {
|
|
73
81
|
const command = str(args.command);
|
|
@@ -94,7 +102,7 @@ async function shellTaskStartRun(args) {
|
|
|
94
102
|
}
|
|
95
103
|
child.unref();
|
|
96
104
|
await log.close();
|
|
97
|
-
const meta = { id, label, command, pid, logFile, started: new Date().toISOString(), deadlineMs };
|
|
105
|
+
const meta = { id, label, command, pid, logFile, started: new Date().toISOString(), deadlineMs, lstart: await procStart(pid) };
|
|
98
106
|
await writeJson(join(tasksDir(), `${id}.json`), meta);
|
|
99
107
|
const timer = setTimeout(() => termGroup(pid), deadlineMs);
|
|
100
108
|
timer.unref?.();
|
|
@@ -107,7 +115,7 @@ async function shellTaskStatusRun(args) {
|
|
|
107
115
|
const meta = await taskMeta(id);
|
|
108
116
|
if (!meta)
|
|
109
117
|
return `error: task ${id} not found`;
|
|
110
|
-
const note =
|
|
118
|
+
const note = deadlineNote(meta);
|
|
111
119
|
const { open } = await fsp();
|
|
112
120
|
let tailText = "";
|
|
113
121
|
try {
|
|
@@ -159,7 +167,7 @@ async function shellTaskListRun() {
|
|
|
159
167
|
const meta = await taskMeta(f.replace(/\.json$/, ""));
|
|
160
168
|
if (!meta)
|
|
161
169
|
continue;
|
|
162
|
-
const note =
|
|
170
|
+
const note = deadlineNote(meta);
|
|
163
171
|
rows.push(`${meta.id} ${alive(meta.pid) ? "RUNNING" : "STOPPED"}${note} pid=${meta.pid} ${meta.label}`);
|
|
164
172
|
}
|
|
165
173
|
return rows.length ? rows.join("\n") : "no background tasks";
|
|
@@ -173,6 +181,9 @@ async function shellTaskKillRun(args) {
|
|
|
173
181
|
return `error: task ${id} not found`;
|
|
174
182
|
if (!alive(meta.pid))
|
|
175
183
|
return `task ${id} already stopped`;
|
|
184
|
+
if (!meta.lstart || (await procStart(meta.pid)) !== meta.lstart) {
|
|
185
|
+
return `task ${id} not signalled: pid ${meta.pid} could not be confirmed as the process this task started`;
|
|
186
|
+
}
|
|
176
187
|
return termGroup(meta.pid) ? `killed ${id} (pid ${meta.pid})` : `task ${id} already stopped`;
|
|
177
188
|
}
|
|
178
189
|
// ─── sql_exec (approval-gated; argv, never a shell string) ──────────────────
|
|
@@ -188,8 +199,9 @@ async function sqlExecRun(args) {
|
|
|
188
199
|
return "error: database path required for sqlite";
|
|
189
200
|
if (!flagSafe(db))
|
|
190
201
|
return "error: database path must not start with '-'";
|
|
202
|
+
// argv keeps /bin/sh out, but sqlite3 itself runs a dot-command query (.shell, .system, .output); -safe refuses them.
|
|
191
203
|
try {
|
|
192
|
-
return (await pexecFile("sqlite3", ["-header", "-column", db, query], opts)).stdout || "(no output)";
|
|
204
|
+
return (await pexecFile("sqlite3", ["-safe", "-header", "-column", db, query], opts)).stdout || "(no output)";
|
|
193
205
|
}
|
|
194
206
|
catch (e) {
|
|
195
207
|
return `error: ${e.stderr?.trim() || e.message}`;
|
|
@@ -200,6 +212,9 @@ async function sqlExecRun(args) {
|
|
|
200
212
|
return "error: connection string required for psql";
|
|
201
213
|
if (!flagSafe(db))
|
|
202
214
|
return "error: connection string must not start with '-'";
|
|
215
|
+
// psql -c runs a string that starts with a backslash as a meta-command, and \! is a shell.
|
|
216
|
+
if (query.trimStart().startsWith("\\"))
|
|
217
|
+
return "error: psql backslash commands are refused — send SQL only";
|
|
203
218
|
try {
|
|
204
219
|
return (await pexecFile("psql", ["--no-psqlrc", db, "-c", query], opts)).stdout || "(no output)";
|
|
205
220
|
}
|
|
@@ -330,6 +345,7 @@ async function securityScanRun(args) {
|
|
|
330
345
|
export const WAVE2_TOOLS = [
|
|
331
346
|
{
|
|
332
347
|
name: "shell_task_start", safe: false,
|
|
348
|
+
contract: { v: 1, effects: ["exec"], bins: ["bash", "ps"] },
|
|
333
349
|
description: "Start a long-running background shell task with a deadline. Returns a task id for monitoring.",
|
|
334
350
|
parameters: { type: "object", properties: {
|
|
335
351
|
command: { type: "string" },
|
|
@@ -340,6 +356,7 @@ export const WAVE2_TOOLS = [
|
|
|
340
356
|
},
|
|
341
357
|
{
|
|
342
358
|
name: "shell_task_status", safe: true,
|
|
359
|
+
contract: { v: 1, effects: ["read"] },
|
|
343
360
|
description: "Check a background task's status and tail its log. Optionally match a regex in recent output.",
|
|
344
361
|
parameters: { type: "object", properties: {
|
|
345
362
|
id: { type: "string" },
|
|
@@ -349,12 +366,14 @@ export const WAVE2_TOOLS = [
|
|
|
349
366
|
},
|
|
350
367
|
{
|
|
351
368
|
name: "shell_task_list", safe: true,
|
|
369
|
+
contract: { v: 1, effects: ["read"] },
|
|
352
370
|
description: "List background shell tasks and their status (running/stopped).",
|
|
353
371
|
parameters: { type: "object", properties: {} },
|
|
354
372
|
run: shellTaskListRun,
|
|
355
373
|
},
|
|
356
374
|
{
|
|
357
375
|
name: "shell_task_kill", safe: false,
|
|
376
|
+
contract: { v: 1, effects: ["destructive"], bins: ["ps"] },
|
|
358
377
|
description: "Terminate a background shell task (and its process group) by id.",
|
|
359
378
|
parameters: { type: "object", properties: {
|
|
360
379
|
id: { type: "string" },
|
|
@@ -363,6 +382,7 @@ export const WAVE2_TOOLS = [
|
|
|
363
382
|
},
|
|
364
383
|
{
|
|
365
384
|
name: "sql_exec", safe: false,
|
|
385
|
+
contract: { v: 1, effects: ["read", "write", "destructive", "exec"], bins: ["sqlite3", "psql"] },
|
|
366
386
|
description: "Execute SQL against a database. Engines: sqlite (default; database = file path) and psql (database = connection string).",
|
|
367
387
|
parameters: { type: "object", properties: {
|
|
368
388
|
query: { type: "string", description: "SQL to execute" },
|
|
@@ -383,6 +403,7 @@ export const WAVE2_TOOLS = [
|
|
|
383
403
|
},
|
|
384
404
|
{
|
|
385
405
|
name: "deploy_logs", safe: false,
|
|
406
|
+
contract: { v: 1, effects: ["fetch"], bins: ["ssh"] },
|
|
386
407
|
description: "Fetch service logs from the deploy target over ssh (journalctl).",
|
|
387
408
|
parameters: { type: "object", properties: {
|
|
388
409
|
target: { type: "string", description: "ssh host or alias (default: the stored deploy target)" },
|
|
@@ -393,6 +414,7 @@ export const WAVE2_TOOLS = [
|
|
|
393
414
|
},
|
|
394
415
|
{
|
|
395
416
|
name: "peer_exchange", safe: false,
|
|
417
|
+
contract: { v: 1, effects: ["egress"], bins: ["switch"] },
|
|
396
418
|
description: "Send a message to a peer agent on the messaging bus.",
|
|
397
419
|
parameters: { type: "object", properties: {
|
|
398
420
|
to: { type: "string", description: "recipient agent name" },
|
package/dist/ui/App.js
CHANGED
|
@@ -45,7 +45,7 @@ function BackgroundHint({ rows }) {
|
|
|
45
45
|
return hint ? _jsx(Text, { dimColor: true, children: ` · ${hint}` }) : null;
|
|
46
46
|
}
|
|
47
47
|
export function App(props) {
|
|
48
|
-
const { messages, live = null, status, thinkingVerb, verbs, stepLabel, prefill = "", liveTools = [], route, ctxPct,
|
|
48
|
+
const { messages, live = null, status, thinkingVerb, verbs, stepLabel, prefill = "", liveTools = [], route, ctxPct, ctxWindow, version, build, fullscreen = false, metrics, sessionTokens, authUser, tier, planMode, thinkMode, bgAgents, shellJobs = [], onBackground, tasks = [], onSubmit, onQueue, queuedPreview = [], onEditQueued, onDropQueued, onInterrupt, onCycleMode, onCycleContext, opMode, rcConnected = false, rcActive = false, caffeinated = false, approval = null, onApprovalDecide, question = null, modelPicker = null, secretPrompt = null, planExitPicker = null, artifactsPicker = null, sessionsPicker = null } = props;
|
|
49
49
|
useTerminalSize(); // subscribe so the inline pinned UI (status rule, composer, footer) reflows the instant the terminal resizes
|
|
50
50
|
const thinking = status === "thinking" || status === "streaming";
|
|
51
51
|
// A parallel batch (2+ live rows) gets its own per-call view instead of the single-line StepSpinner —
|
|
@@ -60,7 +60,7 @@ export function App(props) {
|
|
|
60
60
|
// be scrolled off. The Composer is `suspended` (keystrokes route to the decision, not the draft).
|
|
61
61
|
const prompts = (_jsxs(_Fragment, { children: [_jsx(ApprovalPrompt, { approval: approval, onDecide: onApprovalDecide ?? (() => { }) }), _jsx(QuestionPrompt, { pending: question }), _jsx(QuestionPrompt, { pending: modelPicker }), _jsx(SecretPrompt, { pending: secretPrompt }), _jsx(QuestionPrompt, { pending: planExitPicker }), _jsx(ArtifactPicker, { pending: artifactsPicker }), _jsx(SessionPicker, { pending: sessionsPicker })] }));
|
|
62
62
|
// The pinned bottom band: status rule, composer, bottom rule, then the mode/cycle FOOTER below the rule.
|
|
63
|
-
const bottom = (_jsxs(_Fragment, { children: [_jsx(StatusRule, { route: route, ctxPct: ctxPct,
|
|
63
|
+
const bottom = (_jsxs(_Fragment, { children: [_jsx(StatusRule, { route: route, ctxPct: ctxPct, ctxWindow: ctxWindow, version: version, build: build, user: authUser, tier: tier, planMode: planMode, thinkMode: thinkMode, sessionTokens: sessionTokens }), queuedPreview.length ? _jsx(Text, { color: "yellow", children: queuedHint(queuedPreview) }) : null, _jsx(Composer, { onSubmit: onSubmit, onQueue: onQueue, queued: queuedPreview.length, onEditQueued: onEditQueued, onDropQueued: onDropQueued, onInterrupt: onInterrupt, onBackground: onBackground, onCycleMode: onCycleMode, onCycleContext: onCycleContext, disabled: status !== "idle", suspended: !!approval || !!question || !!modelPicker || !!secretPrompt || !!planExitPicker || !!artifactsPicker || !!sessionsPicker }), _jsx(InputRule, {}), opMode && (_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { dimColor: true, children: ` ${opMode === "auto" ? "⎈ Autonomous" : opMode === "manual" ? "⊙ Manual" : "◑ Plan"} · shift+tab to cycle` }), _jsx(Text, { color: rcConnected ? "green" : rcActive ? "yellow" : "gray", bold: rcConnected || rcActive, dimColor: !rcConnected && !rcActive, children: `${caffeinated ? "☕ " : ""}${rcConnected ? "▮ rc live" : rcActive ? "▮ rc on" : "▯ rc"} ` })] }))] }));
|
|
64
64
|
// Fullscreen (opt-in): a full-terminal-height column. The transcript fills a clipped, bottom-anchored
|
|
65
65
|
// region (non-Static tail) so the newest output sits just above a composer pinned to the very bottom —
|
|
66
66
|
// no dead space. Off by default: inline keeps the terminal's native scrollback (mouse-scroll + copy).
|
package/dist/ui/StatusRule.js
CHANGED
|
@@ -44,6 +44,7 @@ export function truncateToWidth(s, max) {
|
|
|
44
44
|
// the terminal is too narrow to hold every badge, `info` is truncated so cellWidth(right) ≤ cols-3 —
|
|
45
45
|
// which keeps the leading fill ≥ 1 and the whole line at cols-1, so the rule never becomes the line that
|
|
46
46
|
// wraps (the creep bug) no matter how many badges are lit or how narrow the window.
|
|
47
|
+
const ROUTE_LABELS = { "operator-1m": "aurora" };
|
|
47
48
|
export function statusRight(p, cols) {
|
|
48
49
|
const who = p.user ? `◆ ${p.user} · ` : "";
|
|
49
50
|
const seat = p.tier && p.tier !== "admin" ? `⛨ ${p.tier} · ` : ""; // a narrowed seat shows; owner's admin doesn't
|
|
@@ -51,12 +52,12 @@ export function statusRight(p, cols) {
|
|
|
51
52
|
const think = p.thinkMode === "ultrathink" ? `✲✲ ultrathink · ` : p.thinkMode === "think" ? `✲ think · ` : "";
|
|
52
53
|
const tok = p.sessionTokens && p.sessionTokens > 0 ? `Σ${fmtK(p.sessionTokens)} · ` : ""; // session token total
|
|
53
54
|
// ctx as a fill ring (○◔◑◕●) + the exact % — a glance shows how full the context window is, the number keeps precision.
|
|
54
|
-
// Show the active model
|
|
55
|
-
// ("cortana@192.168.1.103:8112" read as noise; /endpoints lists the legs).
|
|
56
|
-
//
|
|
57
|
-
const routeLabel = p.route;
|
|
58
|
-
const
|
|
59
|
-
let info = `${think}${plan}${seat}${who}${routeLabel}
|
|
55
|
+
// Show the active model (cortana, claude-opus, moa, custom …) and the window it runs on, never the leg that answered
|
|
56
|
+
// ("cortana@192.168.1.103:8112" read as noise; /endpoints lists the legs). The default model reads as "aurora", not
|
|
57
|
+
// its id operator-1m (owner, 11/03: "just aurora 300k"), and the window is the one served, not a pin above it.
|
|
58
|
+
const routeLabel = ROUTE_LABELS[p.route] ?? p.route;
|
|
59
|
+
const window = p.ctxWindow ? ` ${p.ctxWindow}` : "";
|
|
60
|
+
let info = `${think}${plan}${seat}${who}${routeLabel}${window} ${ring(p.ctxPct)} ${Math.round(p.ctxPct)}% · ${tok}v${p.version}${p.build ? ` ·${p.build}` : ""}`;
|
|
60
61
|
let right = `✷ OPERATOR · ${info} ─`;
|
|
61
62
|
const maxRight = cols - 3; // leaves fill ≥ 1 and total = cols-1
|
|
62
63
|
if (cellWidth(right) > maxRight) {
|