@0perator/operator 0.1.23 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -16,7 +16,7 @@ import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
16
16
  import { join } from "node:path";
17
17
  import { homedir } from "node:os";
18
18
  import { createHash } from "node:crypto";
19
- const VERSION = "0.1.23";
19
+ const VERSION = "0.1.25";
20
20
  // operator/settings.json (override path via KODE_TSI_SETTINGS), env vars still win — see config/settings.ts.
21
21
  const settings = loadSettings();
22
22
  // Propagate the resolved sandbox mode to the tool layer (registry reads KODE_SANDBOX at exec time).
@@ -28,6 +28,8 @@ if (settings.search?.autopilotUrl)
28
28
  process.env.KODE_AUTOPILOT_URL = settings.search.autopilotUrl;
29
29
  if (settings.search?.searxngUrl)
30
30
  process.env.KODE_SEARXNG_URL = settings.search.searxngUrl;
31
+ if (settings.search?.searxngEngines)
32
+ process.env.KODE_SEARXNG_ENGINES = settings.search.searxngEngines;
31
33
  const sd = settings.search?.docker;
32
34
  if (sd) {
33
35
  if (sd.enabled === false)
@@ -258,7 +258,9 @@ async function webSearch(args) {
258
258
  if (!q)
259
259
  return "error: web_search needs a query";
260
260
  const n = Math.min(Math.max(Number(args.count ?? 8), 1), 20);
261
- const engine = str(args.engine) || "google";
261
+ // Default to bing: on the live AXE autopilot SERP, google currently returns 0
262
+ // results while bing/ddg work — so google was silently yielding "(no results)".
263
+ const engine = str(args.engine) || "bing";
262
264
  const ctrl = new AbortController();
263
265
  const timer = setTimeout(() => ctrl.abort(), Number(args.timeout_ms ?? 25_000));
264
266
  try {
@@ -268,10 +270,14 @@ async function webSearch(args) {
268
270
  // never yields "(no results)" when the other could answer.
269
271
  // SearXNG: an explicit KODE_SEARXNG_URL if reachable, else a container Operator stands up on demand
270
272
  // and tears down when idle / at exit (ensureSearxng handles both; null = unavailable here).
273
+ // Pin SearXNG to independent, non-Microsoft indexes by default (Brave + Mojeek are own-crawler; Google
274
+ // + Startpage are non-MS). Deliberately excludes Bing and DuckDuckGo (DDG is Bing-syndicated). Microsoft
275
+ // is only ever reached via the autopilot fallback below, and only when SearXNG is entirely unavailable.
276
+ const searxEngines = process.env.KODE_SEARXNG_ENGINES ?? "brave,mojeek,google,startpage";
271
277
  const searx = await ensureSearxng();
272
278
  if (searx) {
273
279
  try {
274
- const res = await fetch(`${searx.replace(/\/$/, "")}/search?q=${encodeURIComponent(q)}&format=json`, { signal: ctrl.signal, headers: { "User-Agent": "operator/kode-tsi" } });
280
+ const res = await fetch(`${searx.replace(/\/$/, "")}/search?q=${encodeURIComponent(q)}&format=json&engines=${encodeURIComponent(searxEngines)}`, { signal: ctrl.signal, headers: { "User-Agent": "operator/kode-tsi" } });
275
281
  if (res.ok) {
276
282
  const j = await res.json().catch(() => ({}));
277
283
  const rows = j.results ?? [];
@@ -551,7 +557,7 @@ const TOOLS = [
551
557
  parameters: { type: "object", properties: {
552
558
  query: { type: "string", description: "the search query" },
553
559
  count: { type: "number", description: "max results (1-20, default 8)" },
554
- engine: { type: "string", enum: ["google", "bing", "ddg"], description: "search engine for the autopilot backend (default google)" },
560
+ engine: { type: "string", enum: ["google", "bing", "ddg"], description: "search engine for the autopilot backend (default bing; google currently returns nothing on the SERP backend)" },
555
561
  timeout_ms: { type: "number" },
556
562
  }, required: ["query"] },
557
563
  run: webSearch,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0perator/operator",
3
- "version": "0.1.23",
3
+ "version": "0.1.25",
4
4
  "description": "Operator (KODE) — TypeScript + Ink terminal coding agent. Full-frame render, single-engine core shared across CLI/web/mobile; runs against a local Aurora model.",
5
5
  "type": "module",
6
6
  "bin": {