agent.libx.js 0.94.14 → 0.94.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.js +7 -4
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -113,7 +113,7 @@ agentx --resume <id> "…" # resume a specific session
|
|
|
113
113
|
- **`/agents`** — list subagent types from `./.agent/agents` (description, model, tool scope); `/agents new <name>` scaffolds a frontmatter'd definition for the `Task` tool's `agentType`. **`!<partial>` + menu** completes from past `!` shell commands. **`@server:uri`** mentions inline an MCP resource body into the prompt. Transient network drops mid-step retry automatically (2 attempts, backoff) instead of failing the turn.
|
|
114
114
|
- **Project instructions** — `./AGENTS.md` (or `CLAUDE.md`) auto-loads into every run; `/init` scaffolds one.
|
|
115
115
|
- **Any provider** — set `ANTHROPIC_API_KEY` / `OPENAI_API_KEY` / `GOOGLE_API_KEY` / `GROQ_API_KEY`; choose with `-m provider/model`.
|
|
116
|
-
- **@-file mentions & headless JSON** — reference files inline in a prompt with `@path` (e.g. `explain @src/Agent.ts
|
|
116
|
+
- **@-file mentions & headless JSON** — reference files inline in a prompt with `@path` (e.g. `explain @src/Agent.ts`; `~/` expands to the home directory); script with `-p --output-format json` to get one machine-readable result object on stdout (activity stays on stderr).
|
|
117
117
|
- **Tab-completion** — `Tab` completes `/<command>` names and `@<path>` file/dir references (descends subdirs, dotfiles hidden unless typed) straight from the working tree.
|
|
118
118
|
- **Duplex mode** — `agentx --duplex` runs the full standard REPL (slash commands, sessions, postures, rewind, MCP) with the three-tier engine driving turns: a fast voice model (`--voice-model`, default `groq/openai/gpt-oss-120b`) answers every line instantly and delegates real work to background workers built with the same wiring as a normal run (fs mode, permissions, MCP); worker activity shows as dim chrome and results are re-voiced when ready. Switch any tier live with `/model` (opens a reflex/act/think picker), or the `/voice-model` · `/think-model` shortcuts. `/tasks` lists background tasks, inspects a task's live output tail, and cancels a running one from a picker (Esc mid-turn cancels the foreground turn; Esc again at the idle prompt cancels running workers).
|
|
119
119
|
- **MCP servers** — declare `mcpServers: { name: { command, args } | { url } }` in config and they're auto-mounted at startup (in parallel, with an optional `mountTimeoutMs` deadline so one slow/dead server never blocks the rest): the client does the JSON-RPC handshake (stdio or HTTP) + `tools/list`, and the discovered tools appear as `mcp__<name>__<tool>` in `/tools` (inspect with `/mcp`). A bad server is logged and skipped, never blocking the agent. For large tool sets, **deferred mode** (`makeMcpToolSearch` / `mountMcpDeferred`) exposes just two bounded tools (`ToolSearch` + `McpCall`) instead of N defs — dodging the provider tool-cap and improving selection accuracy. **`mountMcpCatalog`** goes further: a cached, hash-keyed catalog + lazy connect means a turn that uses no MCP tool opens **zero** connections, and one that uses a tool connects exactly that server — latency scales with tools-used, not servers-configured. A down server is **negative-cached** (`failureCooldownMs`) so it never re-floors a later turn at the deadline. For zero turn-path latency even on a cold process, call **`warmMcpCatalog`** at boot + on a timer (off-turn discovery) and mount with **`{ discover: 'cache-only' }`** — the turn then never synchronously connects: it serves the warmed catalog and discovers any miss in the background.
|
package/dist/cli.js
CHANGED
|
@@ -9313,14 +9313,16 @@ async function closeMcp(mounted) {
|
|
|
9313
9313
|
await Promise.all(mounted.map((m) => m.client.close().catch((e) => log17.debug("mcp close failed", e))));
|
|
9314
9314
|
}
|
|
9315
9315
|
var IMG_EXT = { ".png": "image/png", ".jpg": "image/jpeg", ".jpeg": "image/jpeg", ".gif": "image/gif", ".webp": "image/webp" };
|
|
9316
|
+
var untilde = (p) => p.startsWith("~/") ? join9(homedir6(), p.slice(2)) : p;
|
|
9316
9317
|
function readImageParts(cwd, line) {
|
|
9317
9318
|
const refs = [...line.matchAll(/(?:^|\s)@(\S+)/g)].map((m) => m[1].replace(/[?!.,;:)\]}'">]+$/, "")).filter(Boolean);
|
|
9318
9319
|
const parts = [];
|
|
9319
9320
|
for (const ref of refs) {
|
|
9320
9321
|
const mime = IMG_EXT[extname(ref).toLowerCase()];
|
|
9321
9322
|
if (!mime) continue;
|
|
9323
|
+
const abs = ref.startsWith("~/") ? untilde(ref) : resolve3(cwd, ref);
|
|
9322
9324
|
try {
|
|
9323
|
-
parts.push(imagePart(`data:${mime};base64,${readFileSync5(
|
|
9325
|
+
parts.push(imagePart(`data:${mime};base64,${readFileSync5(abs).toString("base64")}`));
|
|
9324
9326
|
} catch {
|
|
9325
9327
|
}
|
|
9326
9328
|
}
|
|
@@ -9333,7 +9335,7 @@ function pastePathClassifier(cwd) {
|
|
|
9333
9335
|
t = t.replace(/\\ /g, " ").replace(/^['"]|['"]$/g, "");
|
|
9334
9336
|
if (/\s/.test(t)) return null;
|
|
9335
9337
|
if (!/^(\/|~\/|\.\/|\.\.\/)/.test(t)) return null;
|
|
9336
|
-
const abs = t.startsWith("~/") ?
|
|
9338
|
+
const abs = t.startsWith("~/") ? untilde(t) : resolve3(cwd, t);
|
|
9337
9339
|
try {
|
|
9338
9340
|
if (!statSync3(abs).isFile()) return null;
|
|
9339
9341
|
} catch {
|
|
@@ -9366,10 +9368,11 @@ ${body}`);
|
|
|
9366
9368
|
continue;
|
|
9367
9369
|
}
|
|
9368
9370
|
}
|
|
9371
|
+
const path = untilde(ref);
|
|
9369
9372
|
try {
|
|
9370
|
-
if (await fs.exists(
|
|
9373
|
+
if (await fs.exists(path)) {
|
|
9371
9374
|
blocks.push(`--- @${ref} ---
|
|
9372
|
-
${await fs.readFile(
|
|
9375
|
+
${await fs.readFile(path)}`);
|
|
9373
9376
|
loaded.push(ref);
|
|
9374
9377
|
} else missing.push(ref);
|
|
9375
9378
|
} catch {
|