@livx.cc/agentx 0.99.105 → 0.99.106
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 +2 -0
- package/dist/cli.d.ts +12 -5
- package/dist/cli.js +3515 -2669
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +202 -14
- package/dist/index.js +1712 -113
- package/dist/index.js.map +1 -1
- package/dist/{Agent-BhOcPaxG.d.ts → secondChannel-BYW5qPAJ.d.ts} +290 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -118,6 +118,8 @@ agentx --resume <id> "…" # resume a specific session
|
|
|
118
118
|
- **@-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).
|
|
119
119
|
- **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.
|
|
120
120
|
- **Tab-completion** — `Tab` completes `/<command>` names and `@<path>` file/dir references (descends subdirs, dotfiles hidden unless typed) straight from the working tree.
|
|
121
|
+
- **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.
|
|
122
|
+
- **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.
|
|
121
123
|
- **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).
|
|
122
124
|
- **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.
|
|
123
125
|
- **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,11 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import {
|
|
2
|
+
import { o as RouterState, H as Hooks, p as RunResult, R as ReasoningEffort, C as ChannelMode, A as Agent } from './secondChannel-BYW5qPAJ.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-DZHZIyxh.js';
|
|
5
5
|
|
|
6
|
-
/** How talkative the second channel is (`--channel-mode`). */
|
|
7
|
-
type ChannelMode = 'turn' | 'normal' | 'chatty';
|
|
8
|
-
|
|
9
6
|
/**
|
|
10
7
|
* On-disk session store for the CLI: each conversation is one JSON file at
|
|
11
8
|
* `<cwd>/.agent/sessions/<id>.json`. Writes are atomic (temp + rename) so a crash
|
|
@@ -144,6 +141,7 @@ interface Args {
|
|
|
144
141
|
version: boolean;
|
|
145
142
|
duplex: boolean;
|
|
146
143
|
duplexV2?: boolean;
|
|
144
|
+
call?: boolean;
|
|
147
145
|
channelOnly?: boolean;
|
|
148
146
|
channelMode?: ChannelMode;
|
|
149
147
|
voiceModel?: string;
|
|
@@ -173,6 +171,15 @@ interface Args {
|
|
|
173
171
|
autoRoute?: boolean;
|
|
174
172
|
}
|
|
175
173
|
declare function parseArgs(argv: string[]): Args;
|
|
174
|
+
/** Fallback .env loader: CWD .env (bun), install-dir .env, then ~/.agent/.env (user-wide). Never overrides. */
|
|
175
|
+
declare function loadInstallEnv(): void;
|
|
176
|
+
/** Fetch secrets from a Bodify app's secrets store into process.env: overrides .env-file values, never the shell's.
|
|
177
|
+
* Token: BODIFY_API_KEY, else Para's vault token in the macOS Keychain ('Para Settings' / VAULT_TOKEN) — the same
|
|
178
|
+
* vault Para's agent tab uses. App: BODIFY_APP_ID (default para-browser). Optional BODIFY_URL (default https://bodify.bod.ee). */
|
|
179
|
+
declare function loadBodifySecrets(): Promise<void>;
|
|
180
|
+
/** Map env vars → provider api keys. DYNAMIC over `listProviders()` (convention `${PROVIDER}_API_KEY` +
|
|
181
|
+
* aliases), so a provider newly added to ai.libx.js is picked up automatically — no edit needed here. */
|
|
182
|
+
declare function apiKeysFromEnv(): Record<string, string>;
|
|
176
183
|
/** Can `model` be called here: its provider runs keyless, or has a key (config or env — call after the .env/Bodify loads). */
|
|
177
184
|
declare function modelUsable(model: string, apiKeys: Record<string, string | undefined>): boolean;
|
|
178
185
|
/** The duplex tiers' models — the reflex (--voice-model / config reflexModel / DuplexAgent's default, groq) and the Think
|
|
@@ -368,4 +375,4 @@ declare function runTurn(agent: Agent, store: SessionStore, session: SessionData
|
|
|
368
375
|
/** A failed duplex turn's cause, for the host to show: the provider's message, and for a missing key what to set. */
|
|
369
376
|
declare function duplexError(e: unknown, reflexModel: string): string;
|
|
370
377
|
|
|
371
|
-
export { type PermMode, abortActiveTurn, appendMemoryNote, cacheMultipliers, condenseReplay, costOf, duplexError, duplexModels, estimateTranscriptTokens, expandMentions, exportMarkdown, fmtUsd, formatHistory, formatStatus, formatTranscriptFull, jsonResult, makeHost, mcpMentionResolver, mentionRefs, modelUsable, parseArgs, pastePathClassifier, readImageParts, readMultiline, resolvePermMode, runShellLine, runTurn, setMcpMentionResolver, summarizeResult, turnCost };
|
|
378
|
+
export { type PermMode, abortActiveTurn, apiKeysFromEnv, appendMemoryNote, cacheMultipliers, condenseReplay, costOf, duplexError, duplexModels, estimateTranscriptTokens, expandMentions, exportMarkdown, fmtUsd, formatHistory, formatStatus, formatTranscriptFull, jsonResult, loadBodifySecrets, loadInstallEnv, makeHost, mcpMentionResolver, mentionRefs, modelUsable, parseArgs, pastePathClassifier, readImageParts, readMultiline, resolvePermMode, runShellLine, runTurn, setMcpMentionResolver, summarizeResult, turnCost };
|