@livx.cc/agentx 0.99.144 → 0.99.146

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 CHANGED
@@ -120,8 +120,8 @@ agentx --resume <id> "…" # resume a specific session
120
120
  - **@-file mentions & headless JSON** — reference files inline in a prompt with `@path` (e.g. `explain @src/Agent.ts`; `~/` expands to the home directory; quote paths with spaces as `@"…"` — drag-dropped files, e.g. macOS screenshots, quote themselves automatically); script with `-p --output-format json` to get one machine-readable result object on stdout (activity stays on stderr).
121
121
  - **Raise, don't guess** (`AskUserQuestion` + `finishReason: 'needs_input'`) — when a decision is genuinely the user's, the agent asks. Interactively that's an arrow-select prompt. **Headless** (`-p`, piped, no TTY) there's nobody to prompt, so instead of blocking on a prompt no one can see — or, worse, "proceeding with best judgment" — the run **stops and hands the question to its caller**: exit code `2`, a yellow `? needs input` footer, and `{finishReason:'needs_input', question:{…}, sessionId}` in `--output-format json`. The transcript is preserved, so the caller answers and continues (`--resume <id> -p "<answer>"`) instead of re-running. A delegated agent silently deciding something that was never its to decide is the failure this closes.
122
122
  - **Tab-completion** — `Tab` completes `/<command>` names and `@<path>` file/dir references (descends subdirs, dotfiles hidden unless typed) straight from the working tree.
123
- - **Voice call (duplex v3)** — `agentx --call --voice` (also what interactive `--duplex`/`--duplex-v2`/`--voice` run now; `AGENTX_DUPLEX_V1=1` keeps the reflex engine below for one release): the main agent (`-m`, full tools, real history) hears the user's exact words and answers every turn; a fast model (`--voice-model`, default Claude Haiku) only covers the wait — backchannels, fillers, bridges and tool-progress lines — and has no path into the history. `VoiceCall` (`src/voice/call.ts`, exported) is the host-agnostic core: `TurnGate` holds mid-phrase finals, merges re-finals, drops duplicates and a second goodbye; `Progress` speaks "checking the board…" during long tool runs.
124
- - **Fill channel for host apps** — `agentx --channel-only --input-format stream-json --output-format stream-json` hosts a `VoiceCall` behind NDJSON for an app whose MAIN is its own agent: stdin `{type:'final', text, sttId?}`, `{type:'main', ev}` (MAIN's start/text/tool/tool_done/audio/done/error), `{type:'interim'|'pause'|'barge'|'overlap'}`; stdout `{type:'turn', id, text, replaces?}` (run MAIN on it), `{type:'abort', id}`, `{type:'channel', kind, text}`. The v2 inputs (`user`/`text`/`agent_state`) still work.
123
+ - **Voice call (duplex v3)** — `agentx --call --voice` (also what interactive `--duplex`/`--duplex-v2`/`--voice` run now; `AGENTX_DUPLEX_V1=1` keeps the reflex engine below for one release): the main agent (`-m`, full tools, real history) hears the user's exact words and answers every turn; a fast model (`--voice-model`, default Claude Haiku) only covers the wait — backchannels, fillers, bridges and tool-progress lines — and has no path into the history. `VoiceCall` (`src/voice/call.ts`, exported) is the host-agnostic core: `TurnGate` holds mid-phrase finals, merges re-finals, drops duplicates and a second goodbye; `Progress` speaks "checking the board…" during long tool runs. `--voice-persona <file>` sets who the call is: it replaces the default call style in MAIN's prompt and feeds the live prediction tree. In `--channel-mode live`, bridges and progress carry the request's own words ("Hacker News, one sec.": a tree leaf, else the fast model, else silence), never a stock line. A call's greeting uses no tools and its prompt is warmed first.
124
+ - **Fill channel for host apps** — `agentx --channel-only --input-format stream-json --output-format stream-json` hosts a `VoiceCall` behind NDJSON for an app whose MAIN is its own agent: stdin `{type:'final', text, sttId?}`, `{type:'main', ev}` (MAIN's start/text/tool/tool_done/audio/done/error), `{type:'interim'|'pause'|'barge'|'overlap'}`; stdout `{type:'turn', id, text, replaces?}` (run MAIN on it), `{type:'abort', id}`, `{type:'channel', kind, text, speech?}` (`speech`: what to play when it differs: tagged; `text` is '' for a sound alone). The v2 inputs (`user`/`text`/`agent_state`) still work.
125
125
  - **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).
126
126
  - **Headless duplex for host apps** — `agentx --voice --input-format stream-json --output-format stream-json` runs the same duplex engine behind an NDJSON pipe, for an app that owns its own mic/TTS (the Bare browser uses it). stdin: `{type:'user', text, id?, replaces?, cut?}` (`cut` = the host voice engine's `takeInterruptedReply()`, so "heard up to" / parked deliveries work exactly as in the CLI), `{type:'barge'}`, `{type:'cancel', task}`, `{type:'exit'}`. stdout: reflex `text`/`thinking` deltas, worker `speak` utterances, `filler`, `task` lifecycle events, `turn_done`, `revoice_done`, `exit`. `--append-system-prompt` goes to the workers, `--voice-system-prompt` to the voice model.
127
127
  - **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; the CLI applies this automatically past 12 mounted tools (a 42-tool server was costing ~80k tok/turn in schema alone), and permission rules written against the real `mcp__<name>__<tool>` names still match through `McpCall`. **`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. **Slow tools are jobs, not timeouts**: `timeoutMs` (default 30s) bounds protocol requests (`initialize`, `tools/list`) only; a `tools/call` still running after the soft foreground timeout (`foregroundMs.mcp`, 30s) returns `[still running] … background job job-N` while the request keeps going, and its result is delivered when it lands. The client sends a `progressToken` and reads progress over stdio and incrementally over HTTP/SSE; a call is cancelled (`notifications/cancelled`) only by `JobKill`, the stuck-job reaper, or its hard cap `callTimeoutMs` (per server, default 30 min).
package/dist/cli.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bun
2
- import { w as RouterState, H as Hooks, c as AgentOptions, x as RunResult, f as ChatUsage, R as ReasoningEffort, d as ChannelMode, b as Agent } from './secondChannel--Iv3ZQ69.js';
2
+ import { w as RouterState, H as Hooks, c as AgentOptions, x as RunResult, f as ChatUsage, R as ReasoningEffort, d as ChannelMode, b as Agent } from './secondChannel-CJ1eYZKA.js';
3
3
  import { IFilesystem } from '@livx.cc/wcli/core';
4
4
  import { M as Message, U as UserQuestion, H as HostBridge, c as ContentPart, o as MessageContent } from './tools-DwfeF8VQ.js';
5
5
 
@@ -174,6 +174,7 @@ interface Args {
174
174
  onlyTools?: string[];
175
175
  appendSystemPrompt?: string;
176
176
  voiceSystemPrompt?: string;
177
+ voicePersona?: string;
177
178
  addDirs?: string[];
178
179
  mcpConfig?: string;
179
180
  print?: boolean;