@0perator/operator 0.1.338 → 0.1.340

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.
@@ -2234,24 +2234,12 @@ async function voiceTranscribe(args) {
2234
2234
  const TOOLS = [
2235
2235
  {
2236
2236
  name: "bash", safe: false,
2237
- description: "Run a bash command in a PERSISTENT shell session — a real terminal that stays open across " +
2238
- "calls. State PERSISTS: a `cd`, an exported variable, an activated venv, or a defined function " +
2239
- "in one call is still in effect on the next. So set things up ONCE and reuse them — do NOT " +
2240
- "re-run `source .../activate && ...` or re-`cd` on every call; activate/enter once, then just " +
2241
- "run the command. stdout and stderr come back merged (like a terminal) with the exit code. " +
2242
- "Optional `cwd` runs that one command in a subshell without moving the session. For anything " +
2243
- "that can run more than ~2 minutes -- a server/build/watcher, but ALSO a full test suite or any " +
2244
- "other verification run -- use shell_background instead of guessing a bigger timeout_ms; a timeout " +
2245
- "here kills the command (and resets this shell's cwd/env only if bash itself wedges). Known-long commands (installs, builds, test suites, downloads) are auto-started as background jobs. " +
2246
- "If the user presses ctrl+b while this runs, it moves to the background (shN) and you are told when it finishes; do not poll. " +
2247
- "Pipelines run with `set -o pipefail`: if ANY stage fails the pipeline fails and you see [exit N] — a check hidden behind `| tail` can never fake success. " +
2248
- "Prefer SINGLE quotes for patterns and paths (grep -l '^x', not grep -l \"^x\"): a raw double-quote " +
2249
- "inside the command can break tool-call serialization on the local model and make the call fail.",
2237
+ 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.",
2250
2238
  parameters: { type: "object", properties: {
2251
- command: { type: "string", description: "the bash command to run in the persistent shell" },
2252
- description: { type: "string", description: "plain-English label for what this command does (shown in the UI as a summary tag)" },
2253
- cwd: { type: "string", description: "optional: run this one command from here (scoped; does not move the session)" },
2254
- timeout_ms: { type: "number", description: "optional per-command timeout (default 120000); on timeout the command is killed (the shell is kept unless it wedges) -- for a command that may legitimately run long (a full test suite, a build), use shell_background instead of raising this" },
2239
+ command: { type: "string", description: "the command to run" },
2240
+ description: { type: "string", description: "short label for the UI" },
2241
+ cwd: { type: "string", description: "run this one command here (the session's cwd is unchanged)" },
2242
+ timeout_ms: { type: "number", description: "default 120000; on timeout the command is killed — long runs belong in shell_background" },
2255
2243
  }, required: ["command"] },
2256
2244
  run: shellExec,
2257
2245
  },
@@ -2266,92 +2254,87 @@ const TOOLS = [
2266
2254
  },
2267
2255
  {
2268
2256
  name: "shell_background", safe: false,
2269
- description: "Start a long-running shell command DETACHED and return a job id immediately (does not block). Use it from the start for servers, builds, watchers, and for a full test suite or any verification run expected to take more than ~2 minutes -- bash's foreground timeout would otherwise kill it AND reset the shell's cwd/env. You are notified when it finishes, so do not poll in a loop; read output with bash_output, stop it with bash_kill.",
2257
+ 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.",
2270
2258
  parameters: { type: "object", properties: { command: { type: "string" }, description: { type: "string" }, cwd: { type: "string" } }, required: ["command"] },
2271
2259
  run: shellBackground,
2272
2260
  },
2273
2261
  {
2274
2262
  name: "download_file", safe: false,
2275
- description: "Download a URL to disk, correctly. USE THIS instead of curl/wget in bash: it fails loudly on any HTTP error (404/403/5xx), resumes a partial file, retries network drops and stalls, refuses an HTML page that is standing in for the file (the classic silent failure), checks the size and, when you pass sha256, the hash, and only then renames onto dest, so a half download never sits at the final name. Runs in the BACKGROUND by default (job id like shell_background; you are notified on completion with the final size + sha256, or the exact error) — start downloads one at a time and never report one as done until that notice arrives. `dest` is a file path, or a directory ending in `/` (the name comes from the URL). Pass `sha256` / `expected_bytes` whenever a trustworthy value exists. background:false waits up to timeout_ms (default 120000) — only for small files.",
2263
+ 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).",
2276
2264
  parameters: { type: "object", properties: {
2277
2265
  url: { type: "string", description: "http(s) URL" },
2278
- dest: { type: "string", description: "file path, or a directory ending in /" },
2279
- sha256: { type: "string", description: "expected SHA-256 (64 hex); a mismatch deletes the download" },
2266
+ dest: { type: "string", description: "file path, or a directory ending in / (name from the URL)" },
2267
+ sha256: { type: "string", description: "expected SHA-256 hex; a mismatch deletes the file" },
2280
2268
  expected_bytes: { type: "number" },
2281
2269
  overwrite: { type: "boolean", description: "replace an existing dest (default false: refuse)" },
2282
2270
  background: { type: "boolean", description: "default true; false waits for the result" },
2283
2271
  timeout_ms: { type: "number", description: "only with background:false" },
2284
- headers: { type: "object", description: "extra request headers, e.g. {\"authorization\": \"Bearer …\"}" },
2272
+ headers: { type: "object", description: "extra request headers" },
2285
2273
  }, required: ["url", "dest"] },
2286
2274
  run: downloadFileTool,
2287
2275
  },
2288
2276
  {
2289
2277
  name: "bash_output", safe: true,
2290
- description: "Read new stdout/stderr from a background shell job (shell_background, or a command moved to the background with ctrl+b; drains what's arrived since the last read) and whether it's still running. A finished job is announced to you, so do not poll. NOT for a spawn_agent sub-agent id — use agent_status for those instead.",
2291
- parameters: { type: "object", properties: { id: { type: "string", description: "the job id from shell_background" } }, required: ["id"] },
2278
+ description: "Read new output from a background shell job (shell_background or ctrl+b) and whether it is still running. Finished jobs are announced — don't poll. Not for spawn_agent ids: use agent_status.",
2279
+ parameters: { type: "object", properties: { id: { type: "string", description: "the job id" } }, required: ["id"] },
2292
2280
  run: bashOutput,
2293
2281
  },
2294
2282
  {
2295
2283
  name: "bash_kill", safe: false,
2296
- description: "Stop a running background shell job (SIGTERM): one from shell_background or one moved to the background with ctrl+b.",
2284
+ description: "Stop a background shell job (from shell_background or ctrl+b) with SIGTERM.",
2297
2285
  parameters: { type: "object", properties: { id: { type: "string" } }, required: ["id"] },
2298
2286
  run: bashKill,
2299
2287
  },
2300
2288
  {
2301
2289
  name: "verify_pipeline", safe: false,
2302
- description: "Run a multi-stage verification pipeline: build → serve → test → screenshot in labeled stages. " +
2303
- "Each stage runs its command sequentially; if a stage fails the pipeline aborts with the failure. " +
2304
- "Output is formatted with === STAGE === markers for readability. Use this for end-to-end verification " +
2305
- "chains where you need structured pass/fail per step.",
2290
+ 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.",
2306
2291
  parameters: { type: "object", properties: {
2307
2292
  stages: {
2308
2293
  type: "array",
2309
2294
  items: { type: "object", properties: {
2310
- label: { type: "string", description: "human-readable stage name (e.g. 'Type Check', 'Build', 'Test')" },
2311
- command: { type: "string", description: "bash command to run" },
2312
- timeout_ms: { type: "number", description: "per-stage timeout (default 120000)" },
2313
- expect: { type: "string", enum: ["zero", "output"], description: "zero = exit 0 required (default); output = any output is success" },
2295
+ label: { type: "string", description: "stage name" },
2296
+ command: { type: "string", description: "bash command" },
2297
+ timeout_ms: { type: "number", description: "default 120000" },
2298
+ expect: { type: "string", enum: ["zero", "output"], description: "zero = exit 0 required (default); output = any output passes" },
2314
2299
  }, required: ["label", "command"] },
2315
- description: "ordered list of verification stages",
2300
+ description: "ordered stages",
2316
2301
  },
2317
2302
  }, required: ["stages"] },
2318
2303
  run: verifyPipeline,
2319
2304
  },
2320
2305
  {
2321
2306
  name: "brief_update", safe: false,
2322
- description: "Update a structured _ai-docs brief during verification — write or append to a named section. " +
2323
- "Creates the file with a standard header if absent. Use this to maintain a living verification " +
2324
- "document as stages complete.",
2307
+ description: "Write or append a named section of an _ai-docs brief (created with a standard header if absent) — a living verification doc.",
2325
2308
  parameters: { type: "object", properties: {
2326
- path: { type: "string", description: "path to the _ai-docs brief (e.g. _ai-docs/briefs/my-feature.md)" },
2327
- section: { type: "string", description: "section heading (e.g. 'Verification', 'Results')" },
2328
- content: { type: "string", description: "markdown content to write in the section" },
2329
- mode: { type: "string", enum: ["replace", "append"], description: "replace = overwrite section; append = add below existing content (default: replace)" },
2309
+ path: { type: "string", description: "the brief, e.g. _ai-docs/briefs/x.md" },
2310
+ section: { type: "string", description: "section heading" },
2311
+ content: { type: "string", description: "markdown" },
2312
+ mode: { type: "string", enum: ["replace", "append"], description: "replace (default) | append" },
2330
2313
  }, required: ["path", "section", "content"] },
2331
2314
  run: briefUpdate,
2332
2315
  },
2333
2316
  {
2334
2317
  name: "task_add", safe: false,
2335
- description: "Track a task list for multi-step work (3+ steps) or when the user gives several tasks — write it FIRST, before acting, with every step as its own item (for \"all N items\" work enumerate each instance so none is silently dropped). List order is priority. The owner sees this list live in the plan pane, so it REPLACES restating the plan in prose. Give `text` for one task or `tasks` (array) for several; returns each task's id.",
2318
+ description: "Write the plan FIRST for multi-step work (3+ steps) or several user tasks: every step its own item, every \"all N\" instance enumerated so none is dropped. Order is priority. The owner sees the list live, so it replaces restating the plan in prose. `text` for one task, `tasks` for several; returns each id.",
2336
2319
  parameters: { type: "object", properties: { text: { type: "string" }, tasks: { type: "array", items: { type: "string" } } } },
2337
2320
  run: taskAdd,
2338
2321
  },
2339
2322
  {
2340
2323
  name: "task_list", safe: true,
2341
- description: "Show the session task list with each task's status ([ ] pending, [>] in progress, [x] done, [~] cancelled). Read it before resuming work after a compaction.",
2324
+ description: "Show the task list with statuses ([ ] pending, [>] in progress, [x] done, [~] cancelled); read it before resuming after a compaction.",
2342
2325
  parameters: { type: "object", properties: {} },
2343
2326
  run: taskList,
2344
2327
  },
2345
2328
  {
2346
2329
  name: "task_update", safe: false,
2347
- description: "Set a task's status: pending | in_progress | done | cancelled. Exactly ONE task in_progress at a time (marking another in_progress returns the previous one to pending). Mark `in_progress` when you start a step and `done` only after the work is VERIFIED — never on intent. If a step fails, mark it cancelled and task_add a revised one. Update as each step lands, not in a batch at the end.",
2330
+ description: "Set a task's status. Exactly ONE task in_progress at a time (marking another returns the previous to pending). in_progress when you start a step, done only once the work is VERIFIED — never on intent; a failed step → cancelled and task_add a revised one. Update as each step lands.",
2348
2331
  parameters: { type: "object", properties: { id: { type: "number" }, status: { type: "string", enum: ["pending", "in_progress", "done", "cancelled"] } }, required: ["id", "status"] },
2349
2332
  run: taskUpdate,
2350
2333
  },
2351
2334
  {
2352
2335
  name: "task_clear", safe: false,
2353
- description: "Clear the session TODO list. Default removes ALL tasks — use this when the user says to clear the list, reset the plan, start fresh, or move on (do NOT instead mark everything done). Set completed_only:true to drop only finished tasks and keep the unfinished ones.",
2354
- parameters: { type: "object", properties: { completed_only: { type: "boolean", description: "true = remove only done tasks; default false = wipe the whole list" } } },
2336
+ description: "Clear the task list — ALL tasks by default. Use it when the user says clear the list, reset, start fresh or move on (instead of marking everything done); completed_only:true drops only done tasks.",
2337
+ parameters: { type: "object", properties: { completed_only: { type: "boolean", description: "true = remove only done tasks" } } },
2355
2338
  run: taskClear,
2356
2339
  },
2357
2340
  {
@@ -2364,7 +2347,7 @@ const TOOLS = [
2364
2347
  },
2365
2348
  {
2366
2349
  name: "read_files", safe: true,
2367
- description: "Read multiple files in ONE call (parallel I/O). Use when you need several files and one doesn't depend on another — massively faster than serial file_read calls. Each entry can optionally specify offset/limit. Returns all results separated by clear headers.",
2350
+ 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.",
2368
2351
  parameters: { type: "object", properties: {
2369
2352
  paths: {
2370
2353
  type: "array",
@@ -2376,7 +2359,7 @@ const TOOLS = [
2376
2359
  }, required: ["path"] },
2377
2360
  ],
2378
2361
  },
2379
- description: "file paths to read (strings, or objects with path/offset/limit)",
2362
+ description: "paths, or {path, offset, limit} objects",
2380
2363
  },
2381
2364
  }, required: ["paths"] },
2382
2365
  run: readFiles,
@@ -2399,24 +2382,24 @@ const TOOLS = [
2399
2382
  },
2400
2383
  {
2401
2384
  name: "scratchpad", safe: true,
2402
- description: "Your PRIVATE scratchpad for working notes, plans, and intermediate results that must NOT go in the workspace. Call with no args to read it; with `content` to append (or mode:\"overwrite\" to replace). Persists for this session — use it to think, track progress, and stash findings instead of cluttering the repo or your reply.",
2385
+ description: "Your PRIVATE session scratchpad for notes, plans and intermediate results that must not go in the workspace or your reply. No args = read; `content` appends (mode \"overwrite\" replaces).",
2403
2386
  parameters: { type: "object", properties: {
2404
- content: { type: "string", description: "text to add; omit to READ the scratchpad" },
2387
+ content: { type: "string", description: "text to add; omit to read" },
2405
2388
  mode: { type: "string", enum: ["append", "overwrite"], description: "default append" },
2406
2389
  } },
2407
2390
  run: scratchpad,
2408
2391
  },
2409
2392
  {
2410
2393
  name: "session_handoff", safe: true,
2411
- description: "Write a handoff for your FUTURE self working in THIS directory: what you did, the current state, decisions, and the next steps. It is auto-loaded into your context at the start of the next session here, so you resume seamlessly. Call with no args to read the current handoff; with `content` to save one (overwrites). Update it before you finish or when you're running low on context.",
2394
+ description: "Your handoff to your next session in THIS directory — what you did, state, decisions, next steps; it is auto-loaded there. No args = read; `content` saves (overwrites). Update it before you finish or when context runs low.",
2412
2395
  parameters: { type: "object", properties: {
2413
- content: { type: "string", description: "the handoff (markdown); omit to READ the current handoff" },
2396
+ content: { type: "string", description: "the handoff (markdown); omit to read" },
2414
2397
  } },
2415
2398
  run: sessionHandoff,
2416
2399
  },
2417
2400
  {
2418
2401
  name: "grep_search", safe: true,
2419
- description: "Recursively grep for a regex pattern under a path. Prefer the `search` tool for most searches — it is faster (ripgrep, parallel) and .gitignore-aware; use grep_search only when you specifically need plain grep semantics.",
2402
+ description: "Plain recursive grep for a regex under a path. Prefer `search` (ripgrep: faster, .gitignore-aware) unless you need grep semantics.",
2420
2403
  parameters: { type: "object", properties: {
2421
2404
  pattern: { type: "string" }, path: { type: "string" }, glob: { type: "string" },
2422
2405
  }, required: ["pattern"] },
@@ -2424,33 +2407,33 @@ const TOOLS = [
2424
2407
  },
2425
2408
  {
2426
2409
  name: "search", safe: true,
2427
- description: "Fast code/text search (ripgrep: parallel, .gitignore-aware, skips binaries). ALWAYS prefer this over `find … | grep` for locating things. Scope it to a directory with `path` (default: current dir). HARD REFUSAL: path may not be $HOME, /, /Users, or other machine-wide roots — those hang for minutes; use find_files for names, or a narrow subtree for content. `glob` filters filenames (e.g. \"*.ts\"). Set `files_with_matches` to get just the matching file paths (cheap — locate before you read).",
2410
+ 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).",
2428
2411
  parameters: { type: "object", properties: {
2429
- pattern: { type: "string", description: "regex to search for" },
2430
- path: { type: "string", description: "directory to scope the search to; default is the current dir. Must NOT be $HOME or /" },
2431
- glob: { type: "string", description: "filename glob filter, e.g. \"*.ts\"" },
2432
- files_with_matches: { type: "boolean", description: "return only the paths of files that match" },
2412
+ pattern: { type: "string", description: "regex" },
2413
+ path: { type: "string", description: "directory scope (default current dir; not $HOME or /)" },
2414
+ glob: { type: "string", description: "filename glob, e.g. \"*.ts\"" },
2415
+ files_with_matches: { type: "boolean", description: "return only matching paths" },
2433
2416
  }, required: ["pattern"] },
2434
2417
  run: ripgrepSearch,
2435
2418
  },
2436
2419
  {
2437
2420
  name: "find_files", safe: true,
2438
- description: "Find files anywhere on the machine by NAME or METADATA (kind, date, size, extension, author, Finder tags) — reads the OS search index (Spotlight / Windows Search / locate), so it is instant and covers the whole home directory by default. Use this for \"where is the file\" questions; use `search` for exact content/regex within a scoped directory. Results are absolute paths, newest first. Pass `path` to scope. `content: true` also matches the index's full-text content. `where` appends a raw backend predicate for power use — Spotlight: `kMDItemPixelHeight > 2000`; Windows Search SQL: `System.ItemType = '.docx'`. If the index is unavailable the tool falls back to scanning ONE directory (`path`, else the current dir) and says so on its first line. `details: true` returns `<path>\\t<size>\\t<modified ISO>\\t<kind>` per hit.",
2421
+ 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.",
2439
2422
  parameters: { type: "object", properties: {
2440
- query: { type: "string", description: "words or a filename fragment (matches names; with content:true also full-text content)" },
2441
- name: { type: "string", description: "filename fragment matched on the file name only" },
2442
- path: { type: "string", description: "scope directory; default: the whole home dir (index) or the current dir (fallback)" },
2443
- kind: { type: "string", enum: [...KINDS], description: "file kind filter" },
2444
- modified_within: { type: "string", description: "only files changed within this window, e.g. 30m, 24h, 7d" },
2423
+ query: { type: "string", description: "words or a filename fragment" },
2424
+ name: { type: "string", description: "fragment matched on file names only" },
2425
+ path: { type: "string", description: "scope directory (default: home, or cwd in the fallback)" },
2426
+ kind: { type: "string", enum: [...KINDS], description: "kind filter" },
2427
+ modified_within: { type: "string", description: "e.g. 30m, 24h, 7d" },
2445
2428
  limit: { type: "number", description: `max results (default ${FIND_FILES_DEFAULT_LIMIT}, max ${FIND_FILES_MAX_LIMIT})` },
2446
- content: { type: "boolean", description: "match the index's full-text content too, not only names" },
2447
- min_size: { type: "string", description: "minimum size, e.g. 500KB, 10MB" },
2448
- max_size: { type: "string", description: "maximum size, e.g. 1.5GB" },
2449
- author: { type: "string", description: "document author (index metadata; ignored by the fallback)" },
2450
- tags: { type: "array", items: { type: "string" }, description: "Finder tags / keywords (index metadata; ignored by the fallback)" },
2451
- extension: { type: "string", description: "file extension, e.g. pdf" },
2452
- where: { type: "string", description: "raw backend predicate appended verbatim (Spotlight query syntax or Windows Search SQL WHERE fragment); refused by the fallback" },
2453
- details: { type: "boolean", description: "one line per hit: path, size, modified ISO, kind" },
2429
+ content: { type: "boolean", description: "also match indexed full text" },
2430
+ min_size: { type: "string", description: "e.g. 500KB, 10MB" },
2431
+ max_size: { type: "string", description: "e.g. 1.5GB" },
2432
+ author: { type: "string", description: "document author (index only)" },
2433
+ tags: { type: "array", items: { type: "string" }, description: "Finder tags / keywords (index only)" },
2434
+ extension: { type: "string", description: "e.g. pdf" },
2435
+ where: { type: "string", description: "raw backend predicate (Spotlight `kMDItemPixelHeight > 2000` / Windows Search SQL); refused by the fallback" },
2436
+ details: { type: "boolean", description: "per hit: path, size, modified, kind" },
2454
2437
  }, required: ["query"] },
2455
2438
  run: findFiles,
2456
2439
  },
@@ -2462,7 +2445,7 @@ const TOOLS = [
2462
2445
  },
2463
2446
  {
2464
2447
  name: "git_status", safe: true,
2465
- description: "Structured git state in one read: branch, ahead/behind vs upstream, and staged/unstaged/untracked file lists — a clean tree is reported as 'nothing to commit'. Use this instead of parsing raw `git status`; don't loop re-running git to figure out state.",
2448
+ 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.",
2466
2449
  parameters: { type: "object", properties: { cwd: { type: "string" } } },
2467
2450
  run: gitStatus,
2468
2451
  },
@@ -2476,7 +2459,7 @@ const TOOLS = [
2476
2459
  },
2477
2460
  {
2478
2461
  name: "checkpoint", safe: false,
2479
- description: "Git add+commit a workspace and leave a memory note, in one call. Stages only the workspace's own subtree (never sibling dirs of the enclosing repo); pass `paths` to stage just those files/dirs.",
2462
+ 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.",
2480
2463
  parameters: { type: "object", properties: {
2481
2464
  summary: { type: "string" }, workspace: { type: "string" }, push: { type: "boolean" },
2482
2465
  paths: { type: "array", items: { type: "string" } },
@@ -2485,7 +2468,7 @@ const TOOLS = [
2485
2468
  },
2486
2469
  {
2487
2470
  name: "memory_search", safe: true,
2488
- description: "Search stored memory notes by substring/tag match, most recent first. Each result's leading [id] is what you pass to memory_store's `supersedes` to retract/correct it.",
2471
+ description: "Search stored memory notes by substring/tag, newest first. A result's [id] is what memory_store's `supersedes` takes.",
2489
2472
  parameters: { type: "object", properties: {
2490
2473
  query: { type: "string" }, limit: { type: "number" },
2491
2474
  } },
@@ -2493,46 +2476,46 @@ const TOOLS = [
2493
2476
  },
2494
2477
  {
2495
2478
  name: "memory_store", safe: false,
2496
- description: "Store a durable memory note with optional tags. If a stored note turns out to be wrong or outdated, don't just add a corrected note beside it -- pass `supersedes` (the [id] from memory_search) so the old one stops surfacing in future recall. Nothing is deleted (the old note stays on disk for history), it's just excluded going forward.",
2479
+ description: "Store a durable memory note with optional tags. To correct a wrong or outdated note pass `supersedes` (its [id] from memory_search) instead of adding a second note beside it — the old one stops surfacing (it stays on disk).",
2497
2480
  parameters: { type: "object", properties: {
2498
2481
  text: { type: "string" }, tags: { type: "array", items: { type: "string" } },
2499
- supersedes: { type: "string", description: "id (from memory_search's [id]) of an earlier note this one corrects or retracts" },
2482
+ supersedes: { type: "string", description: "id of the earlier note this corrects or retracts" },
2500
2483
  }, required: ["text"] },
2501
2484
  run: memoryStore,
2502
2485
  },
2503
2486
  {
2504
2487
  name: "web_fetch", safe: true,
2505
- description: "Fetch an http(s) URL and return its text content (HTML is stripped to plain text, truncated to max_chars). Read-only.",
2488
+ description: "Fetch an http(s) URL as plain text (HTML stripped, capped at max_chars). Read-only.",
2506
2489
  parameters: { type: "object", properties: {
2507
- url: { type: "string", description: "the http(s) URL to fetch" },
2508
- max_chars: { type: "number", description: "max characters to return (default 20000)" },
2490
+ url: { type: "string", description: "http(s) URL" },
2491
+ max_chars: { type: "number", description: "default 20000" },
2509
2492
  timeout_ms: { type: "number" },
2510
2493
  }, required: ["url"] },
2511
2494
  run: webFetch,
2512
2495
  },
2513
2496
  {
2514
2497
  name: "http_request", safe: false,
2515
- description: "Make a real HTTP request to any API — full control beyond web_fetch's dumb GET. Any method (GET/POST/PUT/PATCH/DELETE/HEAD), custom headers, a JSON body (`json`) or raw `body`, and bearer/basic auth. Returns status + response headers + the (capped) body verbatim (no HTML stripping). Use for authenticated REST/GraphQL calls, webhooks, and service integrations.",
2498
+ description: "HTTP request to any API: any method, headers, a JSON body (`json`) or raw `body`, bearer/basic auth. Returns status + headers + the capped body verbatim. For REST/GraphQL calls, webhooks and integrations; web_fetch is the plain read.",
2516
2499
  parameters: { type: "object", properties: {
2517
- url: { type: "string", description: "the http(s) URL" },
2518
- method: { type: "string", description: "HTTP method (default GET)" },
2519
- headers: { type: "object", description: "request headers as a flat object" },
2520
- json: { description: "a JSON-serializable body (sets Content-Type: application/json)" },
2521
- body: { type: "string", description: "raw request body (ignored if `json` is set)" },
2522
- bearer: { type: "string", description: "convenience: sets Authorization: Bearer <token>" },
2523
- basic: { type: "object", description: "convenience: {user, pass} → Authorization: Basic" },
2500
+ url: { type: "string", description: "http(s) URL" },
2501
+ method: { type: "string", description: "default GET" },
2502
+ headers: { type: "object", description: "flat object" },
2503
+ json: { description: "JSON body (sets Content-Type: application/json)" },
2504
+ body: { type: "string", description: "raw body (ignored if `json` is set)" },
2505
+ bearer: { type: "string", description: "sets Authorization: Bearer <token>" },
2506
+ basic: { type: "object", description: "{user, pass} → Authorization: Basic" },
2524
2507
  timeout_ms: { type: "number", description: "default 30000" },
2525
2508
  }, required: ["url"] },
2526
2509
  run: httpRequest,
2527
2510
  },
2528
2511
  {
2529
2512
  name: "file_upload", safe: false,
2530
- description: "Upload a local file to a URL — the push side web_fetch/download lacks. POST multipart/form-data (default; set `field` for the form field name) or PUT raw bytes (S3 presigned-PUT style). Supports the same bearer/basic auth + custom headers as http_request. Confirm the destination — this sends your file to an external service.",
2513
+ 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.",
2531
2514
  parameters: { type: "object", properties: {
2532
- path: { type: "string", description: "local file path to upload" },
2533
- url: { type: "string", description: "destination http(s) URL" },
2534
- method: { type: "string", enum: ["POST", "PUT"], description: "POST=multipart (default), PUT=raw bytes" },
2535
- field: { type: "string", description: "multipart form field name (default \"file\")" },
2515
+ path: { type: "string", description: "local file" },
2516
+ url: { type: "string", description: "destination URL" },
2517
+ method: { type: "string", enum: ["POST", "PUT"], description: "POST = multipart (default), PUT = raw bytes" },
2518
+ field: { type: "string", description: "form field name (default \"file\")" },
2536
2519
  headers: { type: "object" }, bearer: { type: "string" }, basic: { type: "object" },
2537
2520
  timeout_ms: { type: "number", description: "default 120000" },
2538
2521
  }, required: ["path", "url"] },
@@ -2540,199 +2523,199 @@ const TOOLS = [
2540
2523
  },
2541
2524
  {
2542
2525
  name: "web_search", safe: true,
2543
- description: "Search the web (via the AXE autopilot SERP service, or a self-hosted SearXNG) and return ranked title/url/snippet results. Read-only. Follow up with web_fetch to read a result.",
2526
+ 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.",
2544
2527
  parameters: { type: "object", properties: {
2545
2528
  query: { type: "string", description: "the search query" },
2546
- count: { type: "number", description: "max results (1-20, default 8)" },
2547
- engine: { type: "string", enum: ["google", "bing", "ddg"], description: "search engine for the autopilot backend (default bing; google currently returns nothing on the SERP backend)" },
2529
+ count: { type: "number", description: "1-20 (default 8)" },
2530
+ engine: { type: "string", enum: ["google", "bing", "ddg"], description: "autopilot fallback engine (default bing; google returns nothing there)" },
2548
2531
  timeout_ms: { type: "number" },
2549
2532
  }, required: ["query"] },
2550
2533
  run: webSearch,
2551
2534
  },
2552
2535
  {
2553
2536
  name: "knowledge_search", safe: true,
2554
- description: "Search the local Skylark knowledge base (vector KB) for semantic retrieval. Returns top hits with source, distance, and snippet. Use for retrieving past work, project context, and stored facts.",
2537
+ description: "Semantic search of the local Skylark knowledge base → hits with source, distance and snippet: past work, project context, stored facts.",
2555
2538
  parameters: { type: "object", properties: {
2556
2539
  query: { type: "string", description: "the search query" },
2557
- n: { type: "number", description: "max results (1-20, default 5)" },
2558
- timeout_ms: { type: "number", description: "optional timeout in ms (default 15000)" },
2540
+ n: { type: "number", description: "1-20 (default 5)" },
2541
+ timeout_ms: { type: "number", description: "default 15000" },
2559
2542
  }, required: ["query"] },
2560
2543
  run: knowledgeSearch,
2561
2544
  },
2562
2545
  {
2563
2546
  name: "deep_research", safe: true,
2564
- description: "Deep, multi-source web research on a question → a cited brief. Haiku 4.5 plans several search angles, Operator fans out web_search + web_fetch across them, then Haiku synthesizes a thorough answer with inline source citations. Read-only. Use when one search isn't enough — comparisons, state-of-the-art surveys, sourced background. Requires a research API key to be configured.",
2547
+ description: "Multi-source web research → a cited brief: plans several search angles, fans out web_search + web_fetch, and synthesizes an answer with inline citations. Read-only. For comparisons, surveys, sourced background — one lookup is faster with web_search. Requires a research API key.",
2565
2548
  parameters: { type: "object", properties: {
2566
2549
  question: { type: "string", description: "the research question" },
2567
- angles: { type: "number", description: "how many search angles to plan (1-6, default 4)" },
2568
- max_sources: { type: "number", description: "how many sources to fetch + read (1-12, default 6)" },
2569
- timeout_ms: { type: "number", description: "overall budget in ms (default 240000)" },
2550
+ angles: { type: "number", description: "search angles (1-6, default 4)" },
2551
+ max_sources: { type: "number", description: "sources to read (1-12, default 6)" },
2552
+ timeout_ms: { type: "number", description: "default 240000" },
2570
2553
  }, required: ["question"] },
2571
2554
  run: deepResearch,
2572
2555
  },
2573
2556
  {
2574
2557
  name: "email_send", safe: false,
2575
- description: "Send an email through the AXE Quill SMTP engine (iCloud transport). Use when the owner asks you to email something — e.g. \"email me what you made\" or \"send this to <addr>\". `to` defaults to the signed-in owner's own address, so a bare \"email me …\" just works. Plain text by default; pass `html` for a formatted body. A real, outward side-effect (it actually sends), so it is gated by the permission policy — it asks first in manual mode and runs in autonomous. Returns a clear error if the box has no Quill key configured.",
2558
+ 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.",
2576
2559
  parameters: { type: "object", properties: {
2577
- to: { type: "string", description: "recipient email address; omit to send to the signed-in owner (\"email me\")" },
2578
- subject: { type: "string", description: "the email subject line" },
2579
- body: { type: "string", description: "the email body, plain text" },
2580
- html: { type: "string", description: "optional HTML body, sent alongside the plain-text body" },
2560
+ to: { type: "string", description: "recipient; omit for the owner" },
2561
+ subject: { type: "string", description: "subject line" },
2562
+ body: { type: "string", description: "plain-text body" },
2563
+ html: { type: "string", description: "optional HTML body" },
2581
2564
  }, required: ["subject", "body"] },
2582
2565
  run: emailSend,
2583
2566
  },
2584
2567
  {
2585
2568
  name: "image_generate",
2586
- description: "Generate an image from a text prompt via the AXE image worker (local FLUX.1-schnell, scale-to-zero — no cloud key, no resident GPU). Writes a PNG and returns its path. This is the ONLY way to make images: NEVER load a diffusion model inline (e.g. ml.load of FLUX weights) — that pins GBs on the serving box and crawls your own decode.",
2569
+ description: "Generate an image (AXE image worker, FLUX.1-schnell, scale-to-zero) → PNG path. The ONLY way to make images: never load diffusion weights inline (e.g. ml.load) — that pins GBs on the serving box and crawls your decode.",
2587
2570
  parameters: { type: "object", properties: {
2588
2571
  prompt: { type: "string", description: "what to generate" },
2589
- size: { type: "string", description: 'WxH, e.g. "512x512" (default) or "1024x1024"' },
2590
- n: { type: "number", description: "how many images (1-4, default 1)" },
2591
- reference: { type: "string", description: "optional reference image (path/url). A FACE photo → routes to the identity broker and preserves THAT specific person (IP-Adapter-FaceID) — this is how you 'generate HER'. Otherwise → flux img2img (restyle / match composition)." },
2592
- strength: { type: "number", description: "img2img / denoise strength when a reference is given (0-1, default 0.65; lower = closer to the reference)" },
2593
- ip_adapter_scale: { type: "number", description: "identity strength when a reference FACE is given (0-1, default 0.8; higher = stronger likeness to the person)" },
2594
- expand: { type: "boolean", description: "ask the worker to auto-expand/rewrite the prompt (Aurora) before rendering; the richer prompt is returned and logged to the flywheel (never blocks)" },
2595
- steps: { type: "number", description: "sampling steps (schnell default 4); raise to ~8 for finer img2img control (retain-vs-restyle resolution) when a reference is given" },
2596
- out: { type: "string", description: "output .png path (default a temp file); for n>1 an index is appended" },
2597
- timeout_ms: { type: "number", description: "default 180000 — a cold FLUX load + render is tens of seconds" },
2572
+ size: { type: "string", description: "WxH (default \"512x512\")" },
2573
+ n: { type: "number", description: "1-4 (default 1)" },
2574
+ reference: { type: "string", description: "reference image path/url: a FACE photo keeps THAT person (identity broker); otherwise img2img restyle" },
2575
+ strength: { type: "number", description: "img2img 0-1 (default 0.65; lower = closer)" },
2576
+ ip_adapter_scale: { type: "number", description: "face likeness 0-1 (default 0.8)" },
2577
+ expand: { type: "boolean", description: "rewrite the prompt richer first (the quality lever)" },
2578
+ steps: { type: "number", description: "default 4; ~8 for finer img2img" },
2579
+ out: { type: "string", description: ".png path (default temp)" },
2580
+ timeout_ms: { type: "number", description: "default 180000" },
2598
2581
  }, required: ["prompt"] },
2599
2582
  run: imageGenerate,
2600
2583
  },
2601
2584
  {
2602
2585
  name: "video_generate",
2603
- description: "Generate a short video from a text prompt via the AXE video worker (LTX-Video on the scale-to-zero broker at video.axe.onl — no cloud key, no resident GPU). Returns the video's URL (renderable in-app) or a saved .mp4 path. NEVER load a video model inline (e.g. ml.load of weights) — that pins GBs on the serving box and crawls your own decode.",
2586
+ description: "Generate a short video (AXE video worker, LTX-Video, scale-to-zero) → a renderable URL or .mp4 path. Never load a video model inline — that pins GBs on the serving box and crawls your decode.",
2604
2587
  parameters: { type: "object", properties: {
2605
2588
  prompt: { type: "string", description: "what to generate" },
2606
- size: { type: "string", description: 'WxH, e.g. "704x480" (default; the broker rounds w/h to multiples of 32)' },
2607
- num_frames: { type: "number", description: "frames to render (default 97 ≈ 4s @ 24fps; the broker rounds to 8n+1)" },
2608
- fps: { type: "number", description: "playback frames per second (default 24)" },
2609
- seed: { type: "number", description: "optional seed for a reproducible render" },
2610
- reference_image: { type: "string", description: "optional first-frame image (path/url) to condition on — image-to-video (e.g. animate a still made by image_generate)" },
2611
- expand: { type: "boolean", description: "ask the worker to auto-expand/rewrite the prompt (Aurora) before rendering" },
2612
- out: { type: "string", description: "output .mp4 path (default a temp file); for multiple results an index is appended" },
2613
- timeout_ms: { type: "number", description: "default 600000 — a cold LTX load + sampling runs minutes" },
2589
+ size: { type: "string", description: "WxH (default \"704x480\")" },
2590
+ num_frames: { type: "number", description: "default 97 ≈ 4s" },
2591
+ fps: { type: "number", description: "default 24" },
2592
+ seed: { type: "number", description: "for a reproducible render" },
2593
+ reference_image: { type: "string", description: "first-frame image path/url (image-to-video)" },
2594
+ expand: { type: "boolean", description: "rewrite the prompt richer first" },
2595
+ out: { type: "string", description: ".mp4 path (default temp)" },
2596
+ timeout_ms: { type: "number", description: "default 600000" },
2614
2597
  }, required: ["prompt"] },
2615
2598
  run: videoGenerate,
2616
2599
  },
2617
2600
  {
2618
2601
  name: "image_analyze", safe: true,
2619
- description: "Analyze/describe an image with REAL vision (not pixel stats) through the 0perator gateway's `vision` route — the router picks a healthy fleet VL server. Pass a local path or an http(s) url + an optional question; returns the model's answer. Use this to actually SEE a reference, screenshot, or generated image before acting on it — NEVER guess an image's content from its file size or numpy brightness. A DOCUMENT (PDF, DOCX, XLSX, PPTX, RTF, HTML) comes back as its extracted TEXT, every page — answer from that; only a scanned/image-only document is rendered and looked at (first page). Pass as_image: true to look at a document's first page as a picture (layout, charts).",
2602
+ 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.",
2620
2603
  parameters: { type: "object", properties: {
2621
- image: { type: "string", description: "a local file path or an http(s) url — an image, OR a document (pdf/docx/xlsx/pptx/rtf/html/…), which comes back as its extracted text" },
2622
- question: { type: "string", description: 'what to ask about the image (default "Describe this image in detail.")' },
2623
- max_tokens: { type: "number", description: "optional cap on answer length; omit for a full, uncapped description" },
2604
+ image: { type: "string", description: "local path or http(s) url — an image, or a document (returned as text)" },
2605
+ question: { type: "string", description: "default \"Describe this image in detail.\"" },
2606
+ max_tokens: { type: "number", description: "optional answer cap (default uncapped)" },
2624
2607
  timeout_ms: { type: "number", description: "default 120000" },
2625
- as_image: { type: "boolean", description: "for a document: skip text extraction and look at its rendered first page (layout, charts, pictures)" },
2608
+ as_image: { type: "boolean", description: "document: look at its first page as an image (layout, charts)" },
2626
2609
  }, required: ["image"] },
2627
2610
  run: imageAnalyze,
2628
2611
  },
2629
2612
  {
2630
2613
  name: "image_inspect", safe: true,
2631
- description: "Deterministic FACTS about an image — dimensions, format, megapixels, aspect ratio, file size, dominant colors (hex), frames, and EXIF (camera/lens/date/exposure) — computed classically (Pillow, CPU, instant, no model loaded). Use this instead of image_analyze whenever you need measurements/metadata rather than meaning: it never competes with the serving model for RAM. Reserve image_analyze (the vision model) for SEMANTICS — what is in the image / who is this.",
2614
+ 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.",
2632
2615
  parameters: { type: "object", properties: {
2633
- image: { type: "string", description: "a local file path or an http(s) url to the image" },
2616
+ image: { type: "string", description: "local path or http(s) url" },
2634
2617
  }, required: ["image"] },
2635
2618
  run: imageInspect,
2636
2619
  },
2637
2620
  {
2638
2621
  name: "video_analyze", safe: true,
2639
- description: "Analyze/describe a VIDEO through the 0perator gateway's `vision` route — ffmpeg samples frames evenly across the clip and the VL model (multi-image) describes what happens. Pass a local path or an http(s) url + an optional question; returns the analysis. Use this to actually SEE a video's content — never guess from the file.",
2622
+ 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.",
2640
2623
  parameters: { type: "object", properties: {
2641
- video: { type: "string", description: "a local file path or an http(s) url to the video" },
2642
- question: { type: "string", description: "what to ask about the video (default: describe what happens across it)" },
2643
- frames: { type: "number", description: "how many frames to sample across the clip (2-16, default 8)" },
2644
- max_tokens: { type: "number", description: "optional cap on answer length; omit for a full, uncapped description" },
2624
+ video: { type: "string", description: "local path or http(s) url" },
2625
+ question: { type: "string", description: "default: describe what happens" },
2626
+ frames: { type: "number", description: "2-16 (default 8)" },
2627
+ max_tokens: { type: "number", description: "optional answer cap (default uncapped)" },
2645
2628
  timeout_ms: { type: "number", description: "default 180000" },
2646
2629
  }, required: ["video"] },
2647
2630
  run: videoAnalyze,
2648
2631
  },
2649
2632
  {
2650
2633
  name: "voice_speak", safe: false,
2651
- description: "Speak text aloud in Operator's OWN voice (Kokoro TTS on operator-voice :8099). Synthesizes `text` to speech in `voice` (default bf_emma, the canonical Operator/Cortana voice) and plays it on the owner's machine. Use it to actually SAY something to the owner — a spoken status, answer, or heads-up — not just print it. Saves the WAV and returns its path; on a headless/remote box it saves without playing (pass play:false to only synthesize for a surface to play).",
2634
+ 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.",
2652
2635
  parameters: { type: "object", properties: {
2653
2636
  text: { type: "string", description: "what to say" },
2654
- voice: { type: "string", description: 'Kokoro voice id (default "bf_emma", the Operator voice)' },
2655
- play: { type: "boolean", description: "play it locally (default true); false = synthesize + save only" },
2656
- out: { type: "string", description: "output .wav path (default a temp file)" },
2637
+ voice: { type: "string", description: "Kokoro voice id (default \"bf_emma\", the Operator voice)" },
2638
+ play: { type: "boolean", description: "default true; false = synthesize + save only" },
2639
+ out: { type: "string", description: ".wav path (default a temp file)" },
2657
2640
  timeout_ms: { type: "number", description: "default 60000" },
2658
2641
  }, required: ["text"] },
2659
2642
  run: voiceSpeak,
2660
2643
  },
2661
2644
  {
2662
2645
  name: "voice_transcribe", safe: true,
2663
- description: "Transcribe an audio file to text via Operator's speech-to-text (whisper.cpp on operator-voice :8099). Pass a local `file` (wav/mp3/m4a/ogg — any ffmpeg-readable format); returns the transcribed text. Use this to actually HEAR a voice note or recording the owner shares, instead of guessing at it.",
2646
+ description: "Transcribe an audio file (wav/mp3/m4a/ogg — any ffmpeg format) to text with whisper.cpp — HEAR a voice note instead of guessing.",
2664
2647
  parameters: { type: "object", properties: {
2665
- file: { type: "string", description: "local path to an audio file (wav/mp3/m4a/ogg)" },
2648
+ file: { type: "string", description: "local audio file" },
2666
2649
  timeout_ms: { type: "number", description: "default 120000" },
2667
2650
  }, required: ["file"] },
2668
2651
  run: voiceTranscribe,
2669
2652
  },
2670
2653
  {
2671
2654
  name: "image_recreate",
2672
- description: "Recreate a shared REFERENCE image: Operator SEES it with the vision model, extracts a faithful text-to-image prompt, and generates a matching image — the 'share a reference → recreate it' flow in one call. Pass a local path or http(s) url + optional `instructions` to adjust. Returns the recreation + what it understood. (Pixel-exact fidelity — same face/scene — will use img2img/IP-Adapter once the edit broker lands; today it matches subject/style/composition/lighting from the analyzed prompt.)",
2655
+ 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.",
2673
2656
  parameters: { type: "object", properties: {
2674
- reference: { type: "string", description: "the reference image to recreate (a local path or an http(s) url)" },
2675
- instructions: { type: "string", description: "optional adjustments layered on the match, e.g. 'but in daylight' or 'make it a wide shot'" },
2676
- size: { type: "string", description: 'WxH, default "1024x1024"' },
2677
- out: { type: "string", description: "output .png path (default a temp file)" },
2657
+ reference: { type: "string", description: "image path or http(s) url" },
2658
+ instructions: { type: "string", description: "optional tweaks, e.g. 'but in daylight'" },
2659
+ size: { type: "string", description: "default \"1024x1024\"" },
2660
+ out: { type: "string", description: ".png path (default a temp file)" },
2678
2661
  }, required: ["reference"] },
2679
2662
  run: imageRecreate,
2680
2663
  },
2681
2664
  {
2682
2665
  name: "artifact_create",
2683
- description: "Make a shareable ARTIFACT — an HTML page / dashboard / landing page, an SVG, a markdown doc, a DECK / PRESENTATION, or an interactive canvas — hosted on compose.casa, returning a public clickable URL. This is THE way to create an artifact / design / page / deck for the owner: NEVER write a local file or hunt for a 'compose' folder, AS LONG AS compose.casa IS REACHABLE. If this call errors (compose.casa down/502), that rule no longer applies to this request — write the content as a plain local file with file_create instead (a .md file for markdown/text content, matching what was asked for) rather than reaching for document_generate's PDF path just because it also produces a file; PDF is for when a PDF specifically was wanted, not a substitute hosted-artifact fallback. Pass the full content; use content_type 'canvas' for interactive HTML/JS (animations, visualizations, presentations).",
2666
+ description: "Make a shareable hosted ARTIFACT on compose.casa — HTML page / dashboard, SVG, markdown doc, deck, or interactive canvas — and get a public URL. While compose.casa IS REACHABLE this is THE way to make an artifact / page / deck: never write a local file or hunt for a 'compose' folder. If this call errors (compose.casa down), write a plain local file with file_create instead (.md for text) — not a PDF unless one was asked for.",
2684
2667
  parameters: { type: "object", properties: {
2685
- content: { type: "string", description: "the full artifact content — a complete HTML document, SVG, or markdown" },
2686
- title: { type: "string", description: "a short title for the artifact" },
2687
- content_type: { type: "string", description: "html (default) | svg | markdown | canvas (interactive HTML/JS — animations, visualizations, presentations)" },
2668
+ content: { type: "string", description: "the full HTML document, SVG, or markdown" },
2669
+ title: { type: "string", description: "short title" },
2670
+ content_type: { type: "string", description: "html (default) | svg | markdown | canvas (interactive HTML/JS)" },
2688
2671
  }, required: ["content"] },
2689
2672
  run: artifactCreate,
2690
2673
  },
2691
2674
  {
2692
2675
  name: "document_generate",
2693
- description: "Generate a real, downloadable PDF from markdown (or plain text) — a report, brief, client deliverable, or presentation handout — with NO external renderer (no Chrome/pandoc needed; works on any machine Operator runs). Pass `content` as markdown: headings, **bold**/*italic*, `code`, bullet + numbered lists, tables, code blocks, blockquotes, links, and local images all render with clean typography + page numbers. Optional `title`/`subtitle` add a cover header; `out` sets the path (default a durable attachments/ file). Returns the PDF path to open or send. Use THIS for a downloadable document/deck FILE; use artifact_create for a hosted, shareable HTML page URL.",
2676
+ description: "Render markdown (or plain text) to a real PDF — report, brief, deliverable, deck handout — with NO external renderer (works on every box; never pandoc/Chrome). Headings, emphasis, lists, tables, code, quotes, links and local images render with page numbers; `title`/`subtitle` add a cover header. Returns the PDF path. For a hosted page URL use artifact_create.",
2694
2677
  parameters: { type: "object", properties: {
2695
- content: { type: "string", description: "the document body as markdown (or plain text)" },
2696
- title: { type: "string", description: "optional title, rendered as a cover header" },
2697
- subtitle: { type: "string", description: "optional subtitle / byline under the title" },
2698
- out: { type: "string", description: "output .pdf path (default a durable attachments/<slug>-<ts>.pdf)" },
2678
+ content: { type: "string", description: "the body as markdown" },
2679
+ title: { type: "string", description: "optional cover title" },
2680
+ subtitle: { type: "string", description: "optional subtitle" },
2681
+ out: { type: "string", description: ".pdf path (default attachments/<slug>-<ts>.pdf)" },
2699
2682
  }, required: ["content"] },
2700
2683
  run: documentGenerate,
2701
2684
  },
2702
2685
  {
2703
2686
  name: "skill_list", safe: true,
2704
- description: "List or search AXE skills from the Operator registry (operator.axe.onl /v1/skills) — reusable playbooks for code review, security audit, debugging, architecture, and more. With no query it lists the curated skills; pass a query to search the full catalogue (community skills too). Read-only.",
2687
+ description: "List the curated AXE skills (reusable playbooks), or search the full catalogue including community skills with `query`. Read-only.",
2705
2688
  parameters: { type: "object", properties: {
2706
- query: { type: "string", description: "optional search term — also searches community skills; omit for the curated list" },
2689
+ query: { type: "string", description: "search term; omit for the curated list" },
2707
2690
  } },
2708
2691
  run: (a) => skillList(str(a.query)),
2709
2692
  },
2710
2693
  {
2711
2694
  name: "skill_fetch", safe: true,
2712
- description: "Fetch one AXE skill by name from the hub (or your profile) and return its full instructions to follow/apply. Checks your saved profile skills first, then the hub (operator.axe.onl/skills.axe.onl). For directory skills, pass file_path to load a linked file (references/, templates/, scripts/). Read-only.",
2695
+ description: "Load one skill's full instructions by name (your saved profile skills first, then the hub). For a directory skill, file_path loads a linked file (references/, templates/, scripts/). Read-only.",
2713
2696
  parameters: { type: "object", properties: {
2714
- slug: { type: "string", description: "the skill name/slug to fetch and use" },
2715
- file_path: { type: "string", description: "optional path inside a directory skill (e.g. references/foo.md); rejected if it escapes the skill directory" },
2697
+ slug: { type: "string", description: "the skill name" },
2698
+ file_path: { type: "string", description: "path inside a directory skill; may not escape it" },
2716
2699
  }, required: ["slug"] },
2717
2700
  run: (a) => skillFetch(str(a.slug), str(a.file_path).trim() || undefined),
2718
2701
  },
2719
2702
  {
2720
2703
  name: "skill_save",
2721
- description: "Save a reusable skill to your profile so it persists and is available next session with no settings edit — auto-harvest a new capability. Saved skills are listed by skill_list and loaded by skill_fetch (profile skills take precedence over the hub). Use when you've worked out a repeatable playbook worth keeping.",
2704
+ description: "Save a repeatable playbook as a skill in your profile — listed by skill_list and loaded by skill_fetch from the next session (profile skills win over the hub).",
2722
2705
  parameters: { type: "object", properties: {
2723
- name: { type: "string", description: "short skill name (kebab-cased automatically)" },
2724
- content: { type: "string", description: "the skill instructions/playbook (skillmd or plain markdown)" },
2706
+ name: { type: "string", description: "short name (kebab-cased)" },
2707
+ content: { type: "string", description: "the instructions (markdown)" },
2725
2708
  }, required: ["name", "content"] },
2726
2709
  run: (a) => skillSave(str(a.name), str(a.content)),
2727
2710
  },
2728
2711
  {
2729
2712
  name: "memory", safe: false,
2730
- description: "Batch-edit the structured memory files (memories/MEMORY.md or memories/USER.md) under the operator home. Each operation adds, replaces, or removes text. Budget-checked on the final result; atomic single write with a lockfile.",
2713
+ description: "Batch-edit memories/MEMORY.md or memories/USER.md: each operation adds, replaces or removes text; budget-checked, one atomic write.",
2731
2714
  parameters: { type: "object", properties: {
2732
- target: { type: "string", enum: ["memory", "user"], description: "which file to edit (default: memory)" },
2715
+ target: { type: "string", enum: ["memory", "user"], description: "default memory" },
2733
2716
  operations: { type: "array", items: { type: "object", properties: {
2734
2717
  action: { type: "string", enum: ["add", "replace", "remove"] },
2735
- content: { type: "string", description: "text to add or the replacement (add/replace)" },
2718
+ content: { type: "string", description: "text to add, or the replacement" },
2736
2719
  old_text: { type: "string", description: "text to find (replace/remove)" },
2737
2720
  }, required: ["action"] } },
2738
2721
  }, required: ["operations"] },
@@ -2740,12 +2723,12 @@ const TOOLS = [
2740
2723
  },
2741
2724
  {
2742
2725
  name: "session_search", safe: true,
2743
- description: "Search past agent sessions on this machine — Operator's own and other agents' (providers configured in agents.md) — by what was said in them (every term must appear in one message), newest first. Each hit: title · agent · messages · age · model · folder, the matching line with who said it, and an id for session_read. An empty query lists the newest sessions. scope: workspace (this folder), project (this git repo), all (default).",
2726
+ description: "Search past sessions on this machine — Operator's and other agents' (agents.md providers) — every term in one message, newest first. A hit gives title · agent · messages · age · model · folder, the matching line, and an id for session_read. An empty query lists the newest.",
2744
2727
  parameters: { type: "object", properties: {
2745
- query: { type: "string", description: "search terms (all must appear); empty lists the newest sessions" },
2746
- scope: { type: "string", enum: SESSION_SCOPES, description: "workspace · project · all (default all)" },
2747
- source: { type: "string", description: "only this agent's sessions: \"operator\" or a provider slug from agents.md (its name, lowercased, dashes for spaces)" },
2748
- limit: { type: "number", description: "max results (default 8)" },
2728
+ query: { type: "string", description: "terms (all must appear); empty = newest" },
2729
+ scope: { type: "string", enum: SESSION_SCOPES, description: "workspace (this folder) · project (this repo) · all (default)" },
2730
+ source: { type: "string", description: "\"operator\" or a provider slug from agents.md" },
2731
+ limit: { type: "number", description: "default 8" },
2749
2732
  }, required: ["query"] },
2750
2733
  run: async (a) => {
2751
2734
  await indexSessions();
@@ -2763,7 +2746,7 @@ const TOOLS = [
2763
2746
  },
2764
2747
  {
2765
2748
  name: "session_read", safe: true,
2766
- description: "Read one past session by id (as returned by session_search) — Operator's own or another agent's. Returns readable text capped at 24k chars.",
2749
+ description: "Read one past session by id (from session_search), capped at 24k chars.",
2767
2750
  parameters: { type: "object", properties: {
2768
2751
  id: { type: "string", description: "the session id" },
2769
2752
  }, required: ["id"] },
@@ -2771,31 +2754,31 @@ const TOOLS = [
2771
2754
  },
2772
2755
  {
2773
2756
  name: "session_rewind", safe: false,
2774
- description: "Truncate a saved session transcript back before the last N user turns (owner undo for a gone-wrong thread). NEVER empties a transcript (refuses when N >= user-turn count), writes a full rewind copy next to the original first, and the session index resyncs on next maintenance. Working-tree files are NOT touched — revert those with git yourself (checkpoints are ordinary commits).",
2757
+ description: "Truncate a saved session transcript before its last N user turns (owner undo). Never empties a transcript and writes a full copy first. Working-tree files are NOT touched — revert those with git.",
2775
2758
  parameters: { type: "object", properties: {
2776
- id: { type: "string", description: "session id (from session_search)" },
2777
- turns: { type: "number", description: "user turns to drop (default 1, max 50)" },
2759
+ id: { type: "string", description: "session id" },
2760
+ turns: { type: "number", description: "default 1, max 50" },
2778
2761
  }, required: ["id"] },
2779
2762
  run: runSessionRewind,
2780
2763
  },
2781
2764
  {
2782
2765
  name: "cronjob", safe: false,
2783
- description: "Manage scheduled headless agent runs (cron/jobs.json under the operator home). create adds a job; list shows jobs with next/last run; remove deletes by id; run forces one job now on a fresh headless session. Each execution is logged to cron/executions.jsonl with its output saved under cron/output/.",
2766
+ description: "Manage scheduled headless agent runs: create, list (next/last run), remove by id, run one now. Runs are logged under cron/ in the operator home.",
2784
2767
  parameters: { type: "object", properties: {
2785
2768
  action: { type: "string", enum: ["create", "list", "remove", "run"], description: "what to do" },
2786
- name: { type: "string", description: "create: optional human-readable job name" },
2787
- schedule: { description: "create: 5-field cron string (\"30 2 * * *\"), interval minutes (30), or {kind:'interval',everyMinutes} / {kind:'cron',expr}" },
2788
- task: { type: "string", description: "create: the prompt run headlessly on each fire" },
2789
- id: { type: "string", description: "remove/run: the job id (from create or list)" },
2769
+ name: { type: "string", description: "create: optional name" },
2770
+ schedule: { description: "create: a 5-field cron string (\"30 2 * * *\"), interval minutes (30), or {kind:'interval',everyMinutes} / {kind:'cron',expr}" },
2771
+ task: { type: "string", description: "create: the prompt run on each fire" },
2772
+ id: { type: "string", description: "remove/run: the job id" },
2790
2773
  }, required: ["action"] },
2791
2774
  run: runCronTool,
2792
2775
  },
2793
2776
  {
2794
2777
  name: "delegate_task", safe: false,
2795
- description: `Hand ONE self-contained subtask to a sub-agent running on a chosen model and get its final answer back (blocks until it finishes). The sub-agent is a full headless Operator session with its own tools, but NO memory of this conversation and it cannot ask you questions — so \`task\` must carry everything it needs (paths, constraints, the exact output you want). \`model\` is any /model id; OMIT IT to use the owner's configured default sub-agent (settings autonomy.delegateModel), which is the right choice almost always. Name a model only when the subtask needs a specific one, and never pick a model you have not seen answer in this fleet: an unloaded model fails the delegation. Anything TOOL-HEAVY — reviewing a remote/GitHub repo, multi-file exploration, web research, debugging, a repo audit — needs a strong tool-driver such as "cortana"; small models (e.g. "scout", 4B) drive tools unreliably and are often not loaded. Other fleet models: venice-24b, qwen3.8-flash, operator-1m. YOU CAN ALSO DELEGATE TO ANY CLOUD PROVIDER THE OWNER HAS CONNECTED (a stored vendor key): Claude via "claude-sonnet" (full tool-using), and any BYO provider — ${BYO_DELEGATE_PROVIDERS} — registered with "operator auth byo-model" (e.g. an OpenAI/Gemini/Groq/DeepSeek model id). A provider with NO stored key is refused with the exact command to store it, so a failed delegation is never silent — pick "cortana" if you're unsure a cloud key is connected. Use delegation to farm out an independent chunk while you keep planning; do not delegate what you can do in one tool call. Sub-agents cannot delegate further. The sub-agent runs with the owner's permission policy and can mutate the workspace.`,
2778
+ description: `Run ONE self-contained subtask on a sub-agent (a headless Operator session with its own tools) and get its final answer; blocks. It has NO memory of this conversation and cannot ask — \`task\` must carry every path, constraint and the exact output wanted. \`model\`: any /model id; OMIT IT to use the owner's configured default sub-agent (almost always right). Never name a model you have not seen answer in this fleet (an unloaded one fails); tool-heavy work (repo review, exploration, web research, debugging) needs a strong tool-driver such as "cortana". Connected cloud providers work too ("claude-sonnet", BYO: ${BYO_DELEGATE_PROVIDERS}); one without a stored key is refused with the command to store it. Don't delegate a single tool call; sub-agents cannot delegate further and can mutate the workspace.`,
2796
2779
  parameters: { type: "object", properties: {
2797
2780
  task: { type: "string", description: "the complete, self-contained subtask — the sub-agent sees only this" },
2798
- model: { type: "string", description: "registry model id to run it on; omit for the owner's configured default sub-agent" },
2781
+ model: { type: "string", description: "registry model id; omit for the owner's configured default sub-agent" },
2799
2782
  }, required: ["task"] },
2800
2783
  run: (a) => runDelegateTask(a),
2801
2784
  },
@@ -2803,22 +2786,22 @@ const TOOLS = [
2803
2786
  name: "delegate_to_agent", safe: false,
2804
2787
  description: agentCliToolDescription(),
2805
2788
  parameters: { type: "object", properties: {
2806
- task: { type: "string", description: "the complete, self-contained task — the agent CLI sees only this and cannot ask you questions" },
2807
- agent: { type: "string", description: "which local agent CLI to run it on (e.g. \"cursor-agent\", \"claude\", \"codex\") — only INSTALLED ones work" },
2789
+ task: { type: "string", description: "the complete, self-contained task — the CLI sees only this" },
2790
+ agent: { type: "string", description: "an INSTALLED agent CLI id from the list above" },
2808
2791
  model: { type: "string", description: "optional underlying model id for that CLI" },
2809
2792
  }, required: ["task", "agent"] },
2810
2793
  run: (a) => runDelegateToAgent(a),
2811
2794
  },
2812
2795
  {
2813
2796
  name: "browser", safe: false,
2814
- description: "Drive a REAL headless browser (Chrome over CDP) with session state that persists across calls — for JS-rendered pages, logins, forms, clicks. Text-first: prefer browser_read for content; use eval/click/fill/submit to act. actions: open(url) navigate(url) reload cache_bust? back forward click(selector settle_ms?) fill(selector,text) submit(selector) eval(js — awaits promises, returnByValue) screenshot() -> png path tab_select(index) tab_close(index?) close. Screenshot files land under the operator home's cache/browser/. Policy: http/https/about/data only (no file://, no chrome://). Login wall: NEVER guess credentials — ask the owner.",
2797
+ 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.",
2815
2798
  parameters: { type: "object", properties: {
2816
2799
  action: { type: "string", enum: ["open", "navigate", "reload", "back", "forward", "click", "fill", "submit", "eval", "screenshot", "tab_select", "tab_close", "close"], description: "the browser action" },
2817
- url: { type: "string", description: "http(s)/about/data URL for open|navigate" },
2800
+ url: { type: "string", description: "for open|navigate" },
2818
2801
  selector: { type: "string", description: "CSS selector for click|fill|submit" },
2819
2802
  text: { type: "string", description: "value for fill" },
2820
- js: { type: "string", description: "JS expression for eval (returnByValue; awaits promises)" },
2821
- index: { type: "number", description: "tab index for tab_select|tab_close" },
2803
+ js: { type: "string", description: "JS expression for eval" },
2804
+ index: { type: "number", description: "tab index" },
2822
2805
  settle_ms: { type: "number", description: "post-click settle (default 250)" },
2823
2806
  cache_bust: { type: "boolean", description: "reload: ignore cache" },
2824
2807
  }, required: ["action"] },
@@ -2826,21 +2809,21 @@ const TOOLS = [
2826
2809
  },
2827
2810
  {
2828
2811
  name: "browser_read", safe: true,
2829
- description: "Read the active browser page — no mutation. actions: info (title/url/readyState) text(max_chars? — page innerText) tab_list (index tabs). Uses the SAME persistent browser as the gated 'browser' tool (an active tab must exist — open it first with browser).",
2812
+ 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.",
2830
2813
  parameters: { type: "object", properties: {
2831
2814
  action: { type: "string", enum: ["info", "text", "tab_list"], description: "what to read" },
2832
- max_chars: { type: "number", description: "text() cap (default 20000, max 100000)" },
2815
+ max_chars: { type: "number", description: "text cap (default 20000, max 100000)" },
2833
2816
  }, required: ["action"] },
2834
2817
  run: runBrowserRead,
2835
2818
  },
2836
2819
  {
2837
2820
  name: "browser_vault", safe: false,
2838
- description: "Origin-bound website credentials from the owner's vault (macOS keychain first, encrypted-file fallback). THE RULE: never type a password yourself, never ask for one in chat, never repeat one back — this tool's results deliberately withhold values. actions: list (handles + users + bound origins; NO secrets), fill(handle, user_selector, password_selector — fills the ACTIVE browser page after exact origin match; open the login page with the browser tool first). When the vault has no item for an origin: tell the owner to run the add command in their terminal — do not guess.",
2821
+ description: "Origin-bound website credentials from the owner's vault. THE RULE: never type a password yourself, never ask for one in chat, never repeat one — results withhold values. list: handles, users, bound origins (no secrets). fill(handle, user_selector, password_selector): fills the ACTIVE browser page after an exact origin match (open the login page with browser first). No item for an origin → tell the owner to add one in their terminal; never guess.",
2839
2822
  parameters: { type: "object", properties: {
2840
2823
  action: { type: "string", enum: ["list", "fill"], description: "what to do" },
2841
- handle: { type: "string", description: "fill: the vault handle from list" },
2842
- user_selector: { type: "string", description: "fill: CSS selector of the username field" },
2843
- password_selector: { type: "string", description: "fill: CSS selector of the password field" },
2824
+ handle: { type: "string", description: "fill: vault handle from list" },
2825
+ user_selector: { type: "string", description: "fill: username field selector" },
2826
+ password_selector: { type: "string", description: "fill: password field selector" },
2844
2827
  }, required: ["action"] },
2845
2828
  run: async (args) => {
2846
2829
  // dynamic by-variable import keeps the node-touching vault out of the neutral bundle (purity)
@@ -2851,33 +2834,33 @@ const TOOLS = [
2851
2834
  },
2852
2835
  {
2853
2836
  name: "skill_catalog", safe: false,
2854
- description: "The gated OFFICIAL optional-skills catalogue that ships with Operator (152 entries across 23 categories, MIT-licensed). Nothing from it is active unless installed. actions: browse(query?) lists entries + categories (read-only), install(name) copies a skill tree into the operator home's skills/ so it is live for skill_list/skill_fetch next session, remove(name) deletes an installed catalogue copy (hand-written skills are never touched).",
2837
+ description: "The OFFICIAL optional-skills catalogue shipped with Operator; nothing in it is active until installed. browse(query?) lists entries; install(name) copies a skill into the operator home's skills/ (live next session); remove(name) deletes an installed copy (hand-written skills are never touched).",
2855
2838
  parameters: { type: "object", properties: {
2856
2839
  action: { type: "string", enum: ["browse", "install", "remove"], description: "what to do" },
2857
- query: { type: "string", description: "browse: filter by name/category/description substring" },
2858
- name: { type: "string", description: "install/remove: exact skill name from browse" },
2840
+ query: { type: "string", description: "browse: name/category/description filter" },
2841
+ name: { type: "string", description: "install/remove: exact name from browse" },
2859
2842
  }, required: ["action"] },
2860
2843
  run: runSkillCatalog,
2861
2844
  },
2862
2845
  // ── Chauffeur native tools (gated on binary availability) ──
2863
2846
  {
2864
2847
  name: "desktop_screenshot", safe: true,
2865
- description: "Take a screenshot of the desktop or a specific window via Chauffeur. Returns the current screen state as text + image.",
2848
+ description: "Screenshot the desktop or one window via Chauffeur (text + image).",
2866
2849
  parameters: { type: "object", properties: {
2867
- pid: { type: "number", description: "optional: target a specific process" },
2850
+ pid: { type: "number", description: "optional target process" },
2868
2851
  window_id: { type: "number" },
2869
2852
  } },
2870
2853
  run: desktopScreenshot,
2871
2854
  },
2872
2855
  {
2873
2856
  name: "desktop_click", safe: false,
2874
- description: "Click an element on the desktop via Chauffeur. Specify coordinates (x, y), an element selector, or both. Auto-verifies the click landed.",
2857
+ description: "Click on the desktop via Chauffeur by coordinates (x, y), an accessibility element, or both; verifies the click landed.",
2875
2858
  parameters: { type: "object", properties: {
2876
2859
  description: { type: "string", description: "what you're clicking and why" },
2877
2860
  x: { type: "number" }, y: { type: "number" },
2878
- element: { type: "string", description: "accessibility element to click" },
2879
- button: { type: "string", enum: ["left", "right"], description: "default: left" },
2880
- verify: { type: "boolean", description: "verify after click (default true)" },
2861
+ element: { type: "string", description: "accessibility element" },
2862
+ button: { type: "string", enum: ["left", "right"], description: "default left" },
2863
+ verify: { type: "boolean", description: "default true" },
2881
2864
  } },
2882
2865
  run: desktopClick,
2883
2866
  },
@@ -2891,12 +2874,12 @@ const TOOLS = [
2891
2874
  },
2892
2875
  {
2893
2876
  name: "app_interact", safe: false,
2894
- description: "High-level app interaction: launch an app, find an element, click, type, or read its state. Chauffeur handles the low-level AX/input.",
2877
+ description: "High-level app control via Chauffeur: launch an app, or find / click / type into / read an element.",
2895
2878
  parameters: { type: "object", properties: {
2896
- app: { type: "string", description: "application name (e.g. 'Safari', 'Slack')" },
2879
+ app: { type: "string", description: "app name, e.g. 'Safari'" },
2897
2880
  action: { type: "string", enum: ["launch", "find", "click", "type", "read"], description: "what to do" },
2898
- element: { type: "string", description: "element to interact with (for click/find)" },
2899
- text: { type: "string", description: "text to type (for type action)" },
2881
+ element: { type: "string", description: "target element (click/find)" },
2882
+ text: { type: "string", description: "text for type" },
2900
2883
  }, required: ["app", "action"] },
2901
2884
  run: appInteract,
2902
2885
  },
@@ -2911,17 +2894,16 @@ const TOOLS = [
2911
2894
  },
2912
2895
  {
2913
2896
  name: "live_drive", safe: false,
2914
- description: "Browser-based live verification: open a URL and run labeled checks (screenshot, find element, click, read text). " +
2915
- "Each check is a labeled stage with === markers. Returns structured pass/fail. Use this for end-to-end UI verification.",
2897
+ description: "Live UI verification in the browser: open `url` and run labeled checks (screenshot, find, click, text); pass/fail per check.",
2916
2898
  parameters: { type: "object", properties: {
2917
- url: { type: "string", description: "URL to open in the browser" },
2899
+ url: { type: "string", description: "URL to open" },
2918
2900
  checks: {
2919
2901
  type: "array",
2920
2902
  items: { type: "object", properties: {
2921
- label: { type: "string", description: "check name (e.g. 'Login Page Loads')" },
2903
+ label: { type: "string", description: "check name" },
2922
2904
  action: { type: "string", enum: ["screenshot", "find", "click", "text"], description: "what to check" },
2923
- selector: { type: "string", description: "CSS selector or text to find/click" },
2924
- expect: { type: "string", description: "expected text in the result" },
2905
+ selector: { type: "string", description: "CSS selector or text" },
2906
+ expect: { type: "string", description: "text expected in the result" },
2925
2907
  }, required: ["label", "action"] },
2926
2908
  },
2927
2909
  }, required: ["url", "checks"] },
@@ -3142,7 +3124,7 @@ export function toSchemas(reg = registry) {
3142
3124
  function: { name: t.name, description: t.description, parameters: t.parameters },
3143
3125
  }));
3144
3126
  }
3145
- const CATALOGUE_LIST_CAP = 24000;
3127
+ const CATALOGUE_LIST_CAP = 6000;
3146
3128
  const MCP_NOTE_MAX = 12;
3147
3129
  // Best-effort SYNCHRONOUS read of the owned-MCP registry (the name-keyed map loadMcpConfig consumes, from
3148
3130
  // $KODE_MCP_CONFIG or ~/.axe/cli/backend/mcp_servers.json) so the catalogue names the servers actually
@@ -3176,42 +3158,41 @@ function ownedMcpNote() {
3176
3158
  }
3177
3159
  }
3178
3160
  // A compact, SELF-MAINTAINING capability index for the system prompt. The per-call tool SCHEMAS
3179
- // (toSchemas) already tell the model how to CALL each tool; this gives it the high-level MAP of its
3180
- // whole surface — every native tool one line each (name — trimmed description, in declaration order,
3181
- // which is already grouped), plus the MCP layer, the in-session /commands, the headless CLI modes, and
3182
- // the skills catalogue. Rendered from the LIVE registry so a newly-added tool appears here automatically
3183
- // (no prose to drift) — that is the whole point: "Operator aware of all its tools". Pass a merged map
3184
- // (native + connected MCP tools) to include those too; defaults to the native registry. `lean` (a
3185
- // small-context model) skips the per-tool list — it duplicates the schemas attached to every request — and
3186
- // keeps only the surface summary; the list is also char-capped so a large merged map can't blow the prompt.
3161
+ // (toSchemas) already carry every tool's description and parameters, so this is only the MAP of the whole
3162
+ // surface: every native tool by NAME (declaration order, which is already grouped), plus the MCP layer, the
3163
+ // in-session /commands, the headless CLI modes, and the skills catalogue. Rendered from the LIVE registry so a
3164
+ // newly-added tool appears here automatically — "Operator aware of all its tools". It used to repeat a
3165
+ // 150-char description per tool (~15K chars, ~4K tokens of the cached prefix duplicating the schemas); names
3166
+ // alone keep the map at a tenth of that. Pass a merged map (native + connected MCP tools) to include those too;
3167
+ // `lean` (a small-context model) skips the name list, which is also char-capped for a large merged map. `deferred`
3168
+ // (the `deferredTools` flag) names the tools whose schemas are NOT attached: they are listed apart, reached through
3169
+ // tool_search / tool_call.
3187
3170
  export function renderToolCatalogue(reg = registry, opts = {}) {
3188
- const short = (d) => {
3189
- const one = d.replace(/\s+/g, " ").trim();
3190
- if (one.length <= 150)
3191
- return one;
3192
- const cut = one.slice(0, 150);
3193
- const sp = cut.lastIndexOf(" ");
3194
- return (sp > 60 ? cut.slice(0, sp) : cut) + "…";
3195
- };
3171
+ const deferNote = opts.deferred?.size
3172
+ ? `\nDeferred tools (no schema attached): find one with \`tool_search\`, run it with \`tool_call\`.`
3173
+ : "";
3196
3174
  let head;
3197
3175
  if (opts.lean) {
3198
- head = `Your tool schemas are attached to every request — they are the full list of what you can call; use a tool you HAVE, don't claim one you don't.`;
3176
+ head = `Your tool schemas are attached to every request — they are the full list of what you can call; use a tool you HAVE, don't claim one you don't.` + deferNote;
3199
3177
  }
3200
3178
  else {
3201
3179
  const tools = [...reg.values()];
3202
- const lines = [];
3180
+ const names = [];
3181
+ const later = [];
3203
3182
  let used = 0;
3204
3183
  for (const t of tools) {
3205
- const line = `- \`${t.name}\` — ${short(t.description)}`;
3206
- if (used + line.length + 1 > CATALOGUE_LIST_CAP)
3184
+ const name = `\`${t.name}\``;
3185
+ if (used + name.length + 1 > CATALOGUE_LIST_CAP)
3207
3186
  break;
3208
- lines.push(line);
3209
- used += line.length + 1;
3187
+ (opts.deferred?.has(t.name) ? later : names).push(name);
3188
+ used += name.length + 1;
3210
3189
  }
3190
+ const listed = names.length + later.length;
3211
3191
  head =
3212
3192
  `You act through TOOLS, not prose. Your ${tools.length} native tools, each already callable this session` +
3213
- (lines.length < tools.length ? ` (first ${lines.length} listed — the rest are in your attached tool schemas)` : "") +
3214
- `:\n` + lines.join("\n");
3193
+ (listed < tools.length ? ` (first ${listed} listed — the rest are in your attached tool schemas)` : "") +
3194
+ ` — how to call each is in its attached schema:\n` + names.join(" ") +
3195
+ (later.length ? `${deferNote}\n` + later.join(" ") : "");
3215
3196
  }
3216
3197
  return (`\n\n## Your capabilities — the full surface (use a tool you HAVE; don't claim one you don't)\n` +
3217
3198
  head +