@0perator/operator 0.1.263 → 0.1.275
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/auth/store.js +36 -5
- package/dist/cli.js +119 -26
- package/dist/config/persona.js +14 -1
- package/dist/engine/agent.js +4 -4
- package/dist/engine/anthropic.js +48 -0
- package/dist/engine/batch-scheduler.js +68 -21
- package/dist/engine/cli.js +1171 -0
- package/dist/mcp/index.js +2 -1
- package/dist/permissions/index.js +11 -4
- package/dist/remote/host.js +46 -5
- package/dist/remote/pairing.js +70 -0
- package/dist/router/models.js +8 -1
- package/dist/router/models.js.bak +78 -0
- package/dist/router/models.js.bak-1791259923 +78 -0
- package/dist/router/models.js.bak-pre-gateway +78 -0
- package/dist/router/models.js.bak-pre-patch2 +78 -0
- package/dist/router/models.js.bak2 +78 -0
- package/dist/services/model-autodetect.js +240 -0
- package/dist/tools/chauffeur.js +16 -3
- package/dist/tools/deferred.js +2 -1
- package/dist/tools/executor.js +15 -3
- package/dist/tools/native-redirect.js +140 -0
- package/dist/tools/power-tools.js +627 -0
- package/dist/tools/registry.js +252 -5
- package/dist/tools/registry.js.bak-1791259948 +1914 -0
- package/dist/tools/registry.js.bak-pre-plugins +1914 -0
- package/dist/ui/App.js +5 -4
- package/dist/ui/BusTray.js +70 -0
- package/dist/ui/Composer.js +28 -1
- package/dist/ui/ToolStep.js +1 -1
- package/dist/ui/format.js +18 -0
- package/dist/ui/liveTools.js +2 -5
- package/dist/ui/qr.js +10 -0
- package/dist/ui/resize.js +160 -0
- package/dist/ui/slashCommands.js +43 -0
- package/dist/ui/term.js +17 -0
- package/dist/util/slash.js +1 -1
- package/package.json +3 -1
package/dist/tools/registry.js
CHANGED
|
@@ -713,6 +713,123 @@ function authHeaders(args) {
|
|
|
713
713
|
}
|
|
714
714
|
return h;
|
|
715
715
|
}
|
|
716
|
+
// deep_research: Haiku 4.5 plans a few search angles, Operator fans out web_search + web_fetch across them,
|
|
717
|
+
// then Haiku synthesizes a cited brief. The one tool that calls a cloud model DIRECTLY (src/engine/anthropic),
|
|
718
|
+
// so it needs KODE_ANTHROPIC_KEY / ANTHROPIC_API_KEY; without it the tool returns a clear error, never hangs.
|
|
719
|
+
async function deepResearch(args) {
|
|
720
|
+
const question = str(args.question ?? args.query);
|
|
721
|
+
if (!question)
|
|
722
|
+
return "error: deep_research needs a question";
|
|
723
|
+
const { anthropicComplete, anthropicKey } = await import("../engine/anthropic.js");
|
|
724
|
+
if (!anthropicKey())
|
|
725
|
+
return "error: deep_research is not configured — no research API key available"; // key env vars in AGENTS.md
|
|
726
|
+
const maxAngles = Math.min(Math.max(Number(args.angles ?? 4), 1), 6);
|
|
727
|
+
const maxSources = Math.min(Math.max(Number(args.max_sources ?? 6), 1), 12);
|
|
728
|
+
const deadline = Date.now() + Number(args.timeout_ms ?? 240_000);
|
|
729
|
+
// 1. Haiku decomposes the question into focused, non-overlapping search angles.
|
|
730
|
+
let angles = [question];
|
|
731
|
+
try {
|
|
732
|
+
const plan = await anthropicComplete("You are a research planner. Given a question, reply with ONLY a JSON array of 3-5 focused, non-overlapping web-search queries that together answer it. No prose, no code fence.", question, { maxTokens: 400, timeoutMs: 60_000 });
|
|
733
|
+
const parsed = JSON.parse(plan.replace(/```(?:json)?/g, "").trim());
|
|
734
|
+
if (Array.isArray(parsed)) {
|
|
735
|
+
const a = parsed.filter((x) => typeof x === "string" && x.trim()).slice(0, maxAngles);
|
|
736
|
+
if (a.length)
|
|
737
|
+
angles = a;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
catch { /* fall back to the raw question as the single angle */ }
|
|
741
|
+
// 2. Fan out web_search on each angle; collect unique source URLs from the formatted results.
|
|
742
|
+
const urls = [];
|
|
743
|
+
const seen = new Set();
|
|
744
|
+
const searchBlocks = [];
|
|
745
|
+
for (const a of angles) {
|
|
746
|
+
if (Date.now() > deadline)
|
|
747
|
+
break;
|
|
748
|
+
const out = await webSearch({ query: a, count: 5 }).catch((e) => `(search failed: ${String(e?.message ?? e)})`);
|
|
749
|
+
searchBlocks.push(`### ${a}\n${out}`);
|
|
750
|
+
for (const m of out.matchAll(/https?:\/\/[^\s)\]]+/g)) {
|
|
751
|
+
const u = m[0].replace(/[.,)\]]+$/, "");
|
|
752
|
+
if (!seen.has(u)) {
|
|
753
|
+
seen.add(u);
|
|
754
|
+
urls.push(u);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
// 3. Fetch the top sources (read-only), capped so one research call can't fan out forever.
|
|
759
|
+
const fetched = [];
|
|
760
|
+
for (const u of urls.slice(0, maxSources)) {
|
|
761
|
+
if (Date.now() > deadline)
|
|
762
|
+
break;
|
|
763
|
+
const body = await webFetch({ url: u, timeout_ms: 25_000 }).catch(() => "");
|
|
764
|
+
if (body && body.length > 200)
|
|
765
|
+
fetched.push(`SOURCE: ${u}\n${body.slice(0, 6_000)}`);
|
|
766
|
+
}
|
|
767
|
+
// 4. Haiku synthesizes a cited brief from the searches + fetched sources.
|
|
768
|
+
const context = [
|
|
769
|
+
`QUESTION: ${question}`,
|
|
770
|
+
`\n## Search results\n${searchBlocks.join("\n\n")}`,
|
|
771
|
+
fetched.length ? `\n## Fetched sources\n${fetched.join("\n\n---\n\n")}` : "(no sources could be fetched; synthesize from the search snippets)",
|
|
772
|
+
].join("\n");
|
|
773
|
+
const report = await anthropicComplete("You are a rigorous research analyst. Using ONLY the supplied search results and sources, write a thorough, well-structured answer to the question. Cite every claim inline with its source URL in [brackets]. Call out disagreements and gaps. If the evidence is thin, say so — never invent facts or URLs. End with a short 'Sources' list of the URLs you actually used.", context, { maxTokens: 4096, timeoutMs: 120_000 });
|
|
774
|
+
return `${report}\n\n— deep_research · ${angles.length} angles · ${fetched.length}/${urls.length} sources read`;
|
|
775
|
+
}
|
|
776
|
+
// email_send: deliver an email through the AXE Quill SMTP engine (iCloud transport), so the owner can say
|
|
777
|
+
// "email me what you made" and Operator actually sends it. `to` defaults to the signed-in owner's address
|
|
778
|
+
// (email sign-in → external_id IS the email), so a bare "email me" resolves without asking. The Quill
|
|
779
|
+
// endpoint + bearer come from env (KODE_QUILL_URL / KODE_QUILL_KEY / KODE_QUILL_FROM) — NEVER hardcode the
|
|
780
|
+
// fleet email key in the repo; an unconfigured box returns a clear error instead of failing silently.
|
|
781
|
+
async function emailSend(args) {
|
|
782
|
+
const subject = str(args.subject).trim();
|
|
783
|
+
const body = str(args.body ?? args.text).trim();
|
|
784
|
+
if (!subject)
|
|
785
|
+
return "error: email_send needs a subject";
|
|
786
|
+
if (!body)
|
|
787
|
+
return "error: email_send needs a body";
|
|
788
|
+
let to = str(args.to).trim().toLowerCase();
|
|
789
|
+
if (!to) {
|
|
790
|
+
try {
|
|
791
|
+
// OPAQUE specifier: a LITERAL dynamic-import specifier is followed by esbuild into the
|
|
792
|
+
// platform:neutral iOS/web bundle (tools/registry is reachable from index.browser via
|
|
793
|
+
// permissions/tier), and auth/store statically imports node:child_process — the neutral
|
|
794
|
+
// gate hard-fails on it (this shipped red on main: the committed bundle predates the leak).
|
|
795
|
+
// Same non-analyzable trick as the `ws` / node:fs fallbacks. Node still resolves it fine.
|
|
796
|
+
const storeSpec = "../auth/store.js";
|
|
797
|
+
const { loadCredentials } = await import(storeSpec);
|
|
798
|
+
const creds = await loadCredentials().catch(() => null);
|
|
799
|
+
to = (creds?.user ?? "").toLowerCase(); // email sign-in: external_id == the owner's email
|
|
800
|
+
}
|
|
801
|
+
catch { /* no creds module / not signed in */ }
|
|
802
|
+
}
|
|
803
|
+
if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(to)) {
|
|
804
|
+
return "error: no recipient — pass `to`, or sign in with your email so \"email me\" can reach you";
|
|
805
|
+
}
|
|
806
|
+
const key = process.env.KODE_QUILL_KEY;
|
|
807
|
+
if (!key)
|
|
808
|
+
return "error: email sending isn't configured on this machine (Quill key missing). Ask the fleet owner to set it.";
|
|
809
|
+
const url = process.env.KODE_QUILL_URL || "http://127.0.0.1:8025/send";
|
|
810
|
+
const from = process.env.KODE_QUILL_FROM || "axetechnology@icloud.com";
|
|
811
|
+
const html = args.html != null ? str(args.html) : undefined;
|
|
812
|
+
const ctrl = new AbortController();
|
|
813
|
+
const timer = setTimeout(() => ctrl.abort(), 25_000);
|
|
814
|
+
try {
|
|
815
|
+
const res = await fetch(url, {
|
|
816
|
+
method: "POST",
|
|
817
|
+
headers: { "content-type": "application/json", "Authorization": `Bearer ${key}` },
|
|
818
|
+
body: JSON.stringify({ to, subject, text: body, ...(html ? { html } : {}), from_addr: from }),
|
|
819
|
+
signal: ctrl.signal,
|
|
820
|
+
});
|
|
821
|
+
if (!res.ok)
|
|
822
|
+
return `error: email send failed (HTTP ${res.status}) ${(await res.text().catch(() => "")).slice(0, 160)}`;
|
|
823
|
+
const j = await res.json().catch(() => ({}));
|
|
824
|
+
return `email sent to ${to} — "${subject}"${j && typeof j === "object" && "id" in j ? ` (id ${str(j.id)})` : ""}`;
|
|
825
|
+
}
|
|
826
|
+
catch (e) {
|
|
827
|
+
return `error: email send failed — ${e instanceof Error ? e.message : String(e)}`;
|
|
828
|
+
}
|
|
829
|
+
finally {
|
|
830
|
+
clearTimeout(timer);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
716
833
|
const HTTP_BODY_CAP = 200_000; // cap a response body so one huge payload can't balloon the model's context
|
|
717
834
|
/** Public render fallback for web_fetch's 403/429 path: Jina Reader (r.jina.ai/<url> returns
|
|
718
835
|
* markdown; keyless 20 RPM, Bearer KODE_JINA_KEY for more; KODE_JINA_URL swaps to a self-hosted
|
|
@@ -942,7 +1059,9 @@ async function taskUpdate(args) {
|
|
|
942
1059
|
const status = str(args.status);
|
|
943
1060
|
const t = agentTasks.find((x) => x.id === id);
|
|
944
1061
|
if (!t)
|
|
945
|
-
return
|
|
1062
|
+
return agentTasks.length
|
|
1063
|
+
? `error: no task #${id}. task IDs are assigned by task_add (don't guess them) — current tasks:\n${renderTasks()}`
|
|
1064
|
+
: `error: no tasks exist yet — call task_add first to create them (it returns each task's id), then task_update by that id.`;
|
|
946
1065
|
if (status !== "pending" && status !== "in_progress" && status !== "done")
|
|
947
1066
|
return "error: status must be pending | in_progress | done";
|
|
948
1067
|
t.status = status;
|
|
@@ -1256,9 +1375,39 @@ function visionTargets() {
|
|
|
1256
1375
|
}
|
|
1257
1376
|
/** Read a local image, downscaling its long edge to VISION_MAX_EDGE first (macOS `sips`, then `ffmpeg`, then
|
|
1258
1377
|
* the original bytes — never upscales). http(s) urls pass straight through (the server fetches them). */
|
|
1378
|
+
// Documents the vision model can't read as pixels — rendered to a PNG first (see renderDocForVision).
|
|
1379
|
+
// macOS Quick Look (qlmanage) covers all of these with no extra install, so image_analyze works on a
|
|
1380
|
+
// deck/PDF/page the same way it works on a photo.
|
|
1381
|
+
const VISION_DOC_EXTS = new Set(["pdf", "pptx", "ppt", "docx", "doc", "html", "htm", "rtf", "odt", "odp", "pages", "key", "numbers", "xlsx", "xls", "epub", "webarchive", "md"]);
|
|
1382
|
+
/** If `path` is a document (deck/PDF/page/sheet), render its first page to a PNG with macOS Quick Look and
|
|
1383
|
+
* return that PNG path — so the vision pipeline SEES the document. Non-documents pass straight through; a
|
|
1384
|
+
* render failure also passes through (the caller then fails with a clear "couldn't read" message). Quick
|
|
1385
|
+
* Look only renders the first page, so multi-page docs are analyzed by their opening page. */
|
|
1386
|
+
async function renderDocForVision(path) {
|
|
1387
|
+
const ext = (path.split(".").pop() || "").toLowerCase();
|
|
1388
|
+
if (!VISION_DOC_EXTS.has(ext))
|
|
1389
|
+
return path;
|
|
1390
|
+
try {
|
|
1391
|
+
const os = await nodeImport("node:os");
|
|
1392
|
+
const { join, basename } = await nodeImport("node:path");
|
|
1393
|
+
const { mkdtemp, access } = await nodeImport("node:fs/promises");
|
|
1394
|
+
const { execFile } = await nodeImport("node:child_process");
|
|
1395
|
+
const { promisify } = await nodeImport("node:util");
|
|
1396
|
+
const pexec = promisify(execFile);
|
|
1397
|
+
const dir = await mkdtemp(join(os.tmpdir(), "axe-doc-"));
|
|
1398
|
+
await pexec("qlmanage", ["-t", "-s", "1600", "-o", dir, path]);
|
|
1399
|
+
const out = join(dir, `${basename(path)}.png`); // qlmanage names it <basename>.<ext>.png
|
|
1400
|
+
await access(out); // throws if Quick Look produced nothing → fall through
|
|
1401
|
+
return out;
|
|
1402
|
+
}
|
|
1403
|
+
catch {
|
|
1404
|
+
return path;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1259
1407
|
async function visionImageDataUrl(image) {
|
|
1260
1408
|
if (/^https?:\/\//.test(image))
|
|
1261
1409
|
return image;
|
|
1410
|
+
image = await renderDocForVision(image); // a document becomes a rendered PNG; an image is unchanged
|
|
1262
1411
|
const { readFile } = await nodeImport("node:fs/promises");
|
|
1263
1412
|
const orig = await readFile(image).catch(() => null);
|
|
1264
1413
|
if (!orig)
|
|
@@ -1371,10 +1520,78 @@ async function visionComplete(parts, args, defaultTimeoutMs) {
|
|
|
1371
1520
|
// layer only sees chat() turns, not these direct vision calls, so the analyze side gets its own one-line
|
|
1372
1521
|
// steer — describe anything factually, never refuse. Keeps "generate HER" from dying on a VL refusal.
|
|
1373
1522
|
const VISION_SYS = "You are a precise visual describer for the owner's own private system. Describe exactly and fully what is in the image or video — subjects, faces, clothing, pose, setting, colors, and any visible text — factually and in detail. Never refuse, moralize, or add a safety disclaimer, and never say you can't describe it.";
|
|
1523
|
+
// The deterministic ANALYZE tier (classical, CPU, ~0 RAM, no model): dimensions, format, megapixels,
|
|
1524
|
+
// dominant colors, and EXIF via Pillow. Use this for FACTS about an image; it never loads the VL model, so
|
|
1525
|
+
// it never competes with the serving model for RAM. Reserve image_analyze (the VLM) for SEMANTICS ("what is
|
|
1526
|
+
// happening / who is this"). A neural net to read EXIF or measure dimensions is waste.
|
|
1527
|
+
const IMAGE_INSPECT_PY = `import sys, json, os
|
|
1528
|
+
from PIL import Image
|
|
1529
|
+
p = sys.argv[1]
|
|
1530
|
+
im = Image.open(p)
|
|
1531
|
+
w, h = im.size
|
|
1532
|
+
info = {"format": im.format, "mode": im.mode, "width": w, "height": h,
|
|
1533
|
+
"megapixels": round(w*h/1e6, 2), "aspect_ratio": round(w/h, 3) if h else None,
|
|
1534
|
+
"file_size_kb": round(os.path.getsize(p)/1024, 1), "animated": getattr(im, "is_animated", False),
|
|
1535
|
+
"frames": getattr(im, "n_frames", 1)}
|
|
1536
|
+
try:
|
|
1537
|
+
small = im.convert("RGB").resize((64, 64))
|
|
1538
|
+
q = small.quantize(colors=6)
|
|
1539
|
+
pal = q.getpalette() or []
|
|
1540
|
+
top = sorted(q.getcolors() or [], reverse=True)[:6]
|
|
1541
|
+
info["dominant_colors"] = ["#%02x%02x%02x" % (pal[i*3], pal[i*3+1], pal[i*3+2]) for _, i in top]
|
|
1542
|
+
except Exception:
|
|
1543
|
+
pass
|
|
1544
|
+
try:
|
|
1545
|
+
from PIL.ExifTags import TAGS
|
|
1546
|
+
ex = im._getexif() or {}
|
|
1547
|
+
named = {TAGS.get(k, k): str(v)[:80] for k, v in ex.items()}
|
|
1548
|
+
keep = {k: named[k] for k in ("Make","Model","DateTimeOriginal","LensModel","ExposureTime","FNumber","ISOSpeedRatings","FocalLength","Orientation","Software") if k in named}
|
|
1549
|
+
if keep:
|
|
1550
|
+
info["exif"] = keep
|
|
1551
|
+
except Exception:
|
|
1552
|
+
pass
|
|
1553
|
+
print(json.dumps(info))
|
|
1554
|
+
`;
|
|
1555
|
+
async function imageInspect(args) {
|
|
1556
|
+
const image = str(args.image);
|
|
1557
|
+
if (!image)
|
|
1558
|
+
return "error: image_inspect needs an image (a local path or an http(s) url)";
|
|
1559
|
+
const os = await nodeImport("node:os");
|
|
1560
|
+
const { join } = await nodeImport("node:path");
|
|
1561
|
+
const { mkdtemp, writeFile, rm, readFile, stat } = await nodeImport("node:fs/promises");
|
|
1562
|
+
const { execFile } = await nodeImport("node:child_process");
|
|
1563
|
+
const { promisify } = await nodeImport("node:util");
|
|
1564
|
+
const pexec = promisify(execFile);
|
|
1565
|
+
const dir = await mkdtemp(join(os.tmpdir(), "axe-insp-"));
|
|
1566
|
+
try {
|
|
1567
|
+
let path = image;
|
|
1568
|
+
if (/^https?:\/\//.test(image)) {
|
|
1569
|
+
const res = await fetch(image).catch(() => null);
|
|
1570
|
+
if (!res || !res.ok)
|
|
1571
|
+
return `error: image_inspect could not fetch ${image}`;
|
|
1572
|
+
path = join(dir, "img");
|
|
1573
|
+
await writeFile(path, Buffer.from(await res.arrayBuffer()));
|
|
1574
|
+
}
|
|
1575
|
+
else if (!(await stat(path).catch(() => null))) {
|
|
1576
|
+
return `error: image_inspect could not read a file at ${image}`;
|
|
1577
|
+
}
|
|
1578
|
+
const script = join(dir, "inspect.py");
|
|
1579
|
+
await writeFile(script, IMAGE_INSPECT_PY);
|
|
1580
|
+
const { stdout } = await pexec("python3", ["-I", script, path]);
|
|
1581
|
+
const facts = JSON.parse(stdout.trim());
|
|
1582
|
+
return Object.entries(facts).map(([k, v]) => `${k}: ${typeof v === "object" ? JSON.stringify(v) : v}`).join("\n");
|
|
1583
|
+
}
|
|
1584
|
+
catch (e) {
|
|
1585
|
+
return `error: image_inspect — ${String(e?.message ?? e)} (needs python3 + Pillow; for SEMANTIC questions use image_analyze instead)`;
|
|
1586
|
+
}
|
|
1587
|
+
finally {
|
|
1588
|
+
await rm(dir, { recursive: true, force: true }).catch(() => { });
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1374
1591
|
async function imageAnalyze(args) {
|
|
1375
1592
|
const image = str(args.image);
|
|
1376
1593
|
if (!image)
|
|
1377
|
-
return "error: image_analyze needs an image (a local path or an http(s) url)";
|
|
1594
|
+
return "error: image_analyze needs an image or document (a local path or an http(s) url)";
|
|
1378
1595
|
const question = str(args.question) || "Describe this image in detail.";
|
|
1379
1596
|
let imageUrl;
|
|
1380
1597
|
try {
|
|
@@ -1873,6 +2090,28 @@ const TOOLS = [
|
|
|
1873
2090
|
}, required: ["query"] },
|
|
1874
2091
|
run: webSearch,
|
|
1875
2092
|
},
|
|
2093
|
+
{
|
|
2094
|
+
name: "deep_research", safe: true,
|
|
2095
|
+
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.",
|
|
2096
|
+
parameters: { type: "object", properties: {
|
|
2097
|
+
question: { type: "string", description: "the research question" },
|
|
2098
|
+
angles: { type: "number", description: "how many search angles to plan (1-6, default 4)" },
|
|
2099
|
+
max_sources: { type: "number", description: "how many sources to fetch + read (1-12, default 6)" },
|
|
2100
|
+
timeout_ms: { type: "number", description: "overall budget in ms (default 240000)" },
|
|
2101
|
+
}, required: ["question"] },
|
|
2102
|
+
run: deepResearch,
|
|
2103
|
+
},
|
|
2104
|
+
{
|
|
2105
|
+
name: "email_send", safe: false,
|
|
2106
|
+
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.",
|
|
2107
|
+
parameters: { type: "object", properties: {
|
|
2108
|
+
to: { type: "string", description: "recipient email address; omit to send to the signed-in owner (\"email me\")" },
|
|
2109
|
+
subject: { type: "string", description: "the email subject line" },
|
|
2110
|
+
body: { type: "string", description: "the email body, plain text" },
|
|
2111
|
+
html: { type: "string", description: "optional HTML body, sent alongside the plain-text body" },
|
|
2112
|
+
}, required: ["subject", "body"] },
|
|
2113
|
+
run: emailSend,
|
|
2114
|
+
},
|
|
1876
2115
|
{
|
|
1877
2116
|
name: "image_generate",
|
|
1878
2117
|
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.",
|
|
@@ -1908,15 +2147,23 @@ const TOOLS = [
|
|
|
1908
2147
|
},
|
|
1909
2148
|
{
|
|
1910
2149
|
name: "image_analyze", safe: true,
|
|
1911
|
-
description: "Analyze/describe an image via the AXE vision model (Qwen2-VL on the fleet — REAL vision, not pixel stats). 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.",
|
|
2150
|
+
description: "Analyze/describe an image via the AXE vision model (Qwen2-VL on the fleet — REAL vision, not pixel stats). 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. ALSO accepts a DOCUMENT (PDF, slide deck/PPTX, DOCX, HTML page, spreadsheet) — its first page is rendered to an image so you can visually analyze a deck, report, or page the same way; for a multi-page document only the opening page is seen.",
|
|
1912
2151
|
parameters: { type: "object", properties: {
|
|
1913
|
-
image: { type: "string", description: "a local file path or an http(s) url
|
|
2152
|
+
image: { type: "string", description: "a local file path or an http(s) url — an image, OR a document (pdf/pptx/docx/html/xlsx/…) whose first page is auto-rendered for analysis" },
|
|
1914
2153
|
question: { type: "string", description: 'what to ask about the image (default "Describe this image in detail.")' },
|
|
1915
2154
|
max_tokens: { type: "number", description: "optional cap on answer length; omit for a full, uncapped description" },
|
|
1916
2155
|
timeout_ms: { type: "number", description: "default 120000" },
|
|
1917
2156
|
}, required: ["image"] },
|
|
1918
2157
|
run: imageAnalyze,
|
|
1919
2158
|
},
|
|
2159
|
+
{
|
|
2160
|
+
name: "image_inspect", safe: true,
|
|
2161
|
+
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.",
|
|
2162
|
+
parameters: { type: "object", properties: {
|
|
2163
|
+
image: { type: "string", description: "a local file path or an http(s) url to the image" },
|
|
2164
|
+
}, required: ["image"] },
|
|
2165
|
+
run: imageInspect,
|
|
2166
|
+
},
|
|
1920
2167
|
{
|
|
1921
2168
|
name: "video_analyze", safe: true,
|
|
1922
2169
|
description: "Analyze/describe a VIDEO via the AXE vision model — ffmpeg samples frames evenly across the clip and Qwen2-VL (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.",
|
|
@@ -2054,7 +2301,7 @@ const TOOLS = [
|
|
|
2054
2301
|
},
|
|
2055
2302
|
{
|
|
2056
2303
|
name: "delegate_task", safe: false,
|
|
2057
|
-
description: "Hand ONE self-contained subtask to a sub-agent running on a chosen fleet 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
|
|
2304
|
+
description: "Hand ONE self-contained subtask to a sub-agent running on a chosen fleet 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. CHOOSE IT BY TOOL-LOAD: use \"scout\" (fast 4B) ONLY for self-contained, tool-LIGHT subtasks (a lookup, a summary, a single-file edit); a 4B model drives tools unreliably, so anything TOOL-HEAVY — reviewing a remote/GitHub repo, multi-file exploration, web research, debugging, a repo audit — MUST go to \"cortana\" (the flagship) or it will spin without real progress. Also available: venice-24b, qwen3.8-flash, operator-1m. Use it 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.",
|
|
2058
2305
|
parameters: { type: "object", properties: {
|
|
2059
2306
|
task: { type: "string", description: "the complete, self-contained subtask — the sub-agent sees only this" },
|
|
2060
2307
|
model: { type: "string", description: "registry model id to run it on (default \"scout\")" },
|