@livx.cc/agentx 0.99.124 → 0.99.126

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.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-GFT69ax4.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-B76KLrf7.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
 
package/dist/cli.js CHANGED
@@ -4719,10 +4719,15 @@ function delegateWorkerFor(planner, worker) {
4719
4719
  function advisorFor(worker, advisor) {
4720
4720
  return advisor && pairOk("advisor", worker, advisor) ? advisor : void 0;
4721
4721
  }
4722
- function delegateTools(tools, planner) {
4722
+ function delegateTools(tools, planner, plannerMay) {
4723
4723
  return tools.map((t) => !plannerBlocks(t) ? t : {
4724
4724
  ...t,
4725
- run: async (...a) => a[1]?.model === planner ? PLANNER_REFUSAL : t.run(...a)
4725
+ // THROWN, not returned: a returned string read as a SUCCESSFUL write in every trace (isError false), so a host
4726
+ // counted a write that never happened (Blank prod 8834a8bd-d4b).
4727
+ run: async (...a) => {
4728
+ if (a[1]?.model === planner && !plannerMay?.(t.name, a[0])) throw new Error(PLANNER_REFUSAL);
4729
+ return t.run(...a);
4730
+ }
4726
4731
  });
4727
4732
  }
4728
4733
  function delegatePrompt(worker) {
@@ -5053,7 +5058,9 @@ var AgentOptions = class {
5053
5058
  subagents = false;
5054
5059
  /** DELEGATE MODE: `model` plans, `worker` writes. The planner's Write/Edit/MultiEdit/ApplyEdits/bash/Shell are
5055
5060
  * refused at execution; Task/TaskBatch are on (maxDepth 1, children default to `worker`) and children get the
5056
- * parent's `postToolUse` too. Off when the models are equal or either is cursor/*. Wins over `advisor`. */
5061
+ * parent's `postToolUse` too. Off when the models are equal or either is cursor/*. Wins over `advisor`.
5062
+ * `plannerMay(tool, args)`: a blocked call the planner may still make itself (the host's own carve-out, e.g. its
5063
+ * private notes) — say so in the host prompt, the planner prompt says it cannot write. */
5057
5064
  delegate;
5058
5065
  /** ADVISOR MODE: `model` does the work; an `Advise` tool asks `advisor.model` (≤`limit`, default 3) with only
5059
5066
  * the request + `snapshot()` (host state, optional) + the question. The first write waits for one consult. */
@@ -5436,7 +5443,7 @@ var Agent = class _Agent {
5436
5443
  traceDir: o.traceDir,
5437
5444
  permissions: o.permissions,
5438
5445
  // a child obeys the parent's allow/deny rules (else Task is a one-call bypass)
5439
- tools: worker ? delegateTools([...o.tools, ...this.injectedTools], o.model) : [...o.tools, ...this.injectedTools],
5446
+ tools: worker ? delegateTools([...o.tools, ...this.injectedTools], o.model, o.delegate?.plannerMay) : [...o.tools, ...this.injectedTools],
5440
5447
  systemPrompt: o.systemPrompt,
5441
5448
  // A child never resumes the parent's own claude-code session (the host's `resume` link is the parent's).
5442
5449
  providerOptionsFor: o.providerOptionsFor ?? ((m) => modelProvider(m) === modelProvider(o.model) && o.providerOptions ? { ...o.providerOptions, resume: void 0, onClaudeCodeSession: void 0 } : void 0)
@@ -5450,7 +5457,7 @@ var Agent = class _Agent {
5450
5457
  this.activeHooks = composeHooks(o.hooks, plan?.hooks, o.permissions?.hooks());
5451
5458
  this.activeTools = [...tools, ...this.injectedTools];
5452
5459
  if (worker) {
5453
- this.activeTools = delegateTools(this.activeTools, o.model);
5460
+ this.activeTools = delegateTools(this.activeTools, o.model, o.delegate?.plannerMay);
5454
5461
  systemPrompt += delegatePrompt(worker);
5455
5462
  }
5456
5463
  if (adv) {
@@ -15051,10 +15058,14 @@ import { BodDB as BodDB2 } from "@bod.ee/db";
15051
15058
  init_logging();
15052
15059
  import { existsSync as existsSync2, readFileSync as readFileSync5 } from "fs";
15053
15060
  import { homedir } from "os";
15061
+ import { delimiter as delimiter2 } from "path";
15054
15062
  var log33 = forComponent("cli-util");
15063
+ function extraDirs(env = process.env) {
15064
+ return (env.AGENTX_EXTRA_DIRS || "").split(delimiter2).map((d) => d.trim()).filter(Boolean);
15065
+ }
15055
15066
  function dotDirs(base, sub, opts = {}) {
15056
15067
  const home = opts.home ?? homedir();
15057
- const dirs = [`${base}/.agent/${sub}`, `${base}/.claude/${sub}`, `${home}/.agent/${sub}`, `${home}/.claude/${sub}`];
15068
+ const dirs = [`${base}/.agent/${sub}`, `${base}/.claude/${sub}`, `${home}/.agent/${sub}`, `${home}/.claude/${sub}`, ...extraDirs().map((d) => `${d}/${sub}`)];
15058
15069
  return opts.existing ? dirs.filter((d) => existsSync2(d)) : dirs;
15059
15070
  }
15060
15071
  function truncate(s, n, suffix = "\u2026") {
@@ -15226,7 +15237,7 @@ Reference files in them by their mount path (the left side).`;
15226
15237
  }
15227
15238
  const dot = (sub) => existsSync3(`${cwd}/.agent/${sub}`) ? `${cwd}/.agent/${sub}` : void 0;
15228
15239
  const dots = (sub) => {
15229
- const dirs = dotDirs(cwd, sub, { existing: true });
15240
+ const dirs = [...dotDirs(cwd, sub, { existing: true }), ...sub === "skills" ? (o.skillDirs ?? []).filter((d) => existsSync3(d)) : []];
15230
15241
  return dirs.length ? dirs : void 0;
15231
15242
  };
15232
15243
  const memoryDir = (() => {
@@ -16273,6 +16284,7 @@ function applyOverlay(cfg, file) {
16273
16284
  }
16274
16285
  if (raw?.mcpServers && typeof raw.mcpServers === "object") cfg.mcpServers = { ...cfg.mcpServers, ...raw.mcpServers };
16275
16286
  if (raw?.permissions && typeof raw.permissions === "object") cfg.permissions = mergePerms(cfg.permissions, raw.permissions);
16287
+ if (Array.isArray(raw?.skillDirs)) cfg.skillDirs = [...cfg.skillDirs ?? [], ...raw.skillDirs.filter((d) => typeof d === "string")];
16276
16288
  }
16277
16289
 
16278
16290
  // cli/hooks-config.ts
@@ -19591,7 +19603,7 @@ Flags:
19591
19603
  --no-think with --duplex: disable the Think tier (Act handles everything)
19592
19604
  --voice-system-prompt <text> with --duplex: appended to the voice (reflex) prompt only (--append-system-prompt \u2192 workers)
19593
19605
  --add-dir <path> mount another directory into the workspace (repeatable; disk mode only)
19594
- --mcp-config <file> JSON { mcpServers?, permissions? } merged over .agent config for this run only
19606
+ --mcp-config <file> JSON { mcpServers?, permissions?, skillDirs? } merged over .agent config for this run only
19595
19607
  --subagents allow the Task tool (spawn child agents)
19596
19608
  --delegate <worker> delegate mode: the main model plans (its writes are refused), <worker> writes via Task
19597
19609
  --advisor <model> advisor mode: the main model works; an Advise tool consults <model> (first write waits for it)
@@ -20393,6 +20405,7 @@ function optsFor(args, ai, cfg = {}, extraTools = []) {
20393
20405
  // Forwarded to cursor/* delegations for environment parity (chat-model providers ignore it).
20394
20406
  // Raw config (pre-OAuth): unresolved-oauth http servers are skipped by the cursor mapper.
20395
20407
  mcpServers: cfg.mcpServers,
20408
+ skillDirs: cfg.skillDirs,
20396
20409
  lean: args.lean,
20397
20410
  // Gates + powers default-on WebSearchAnthropic. Same precedence as the main client (env wins).
20398
20411
  anthropicKey: apiKeysFromEnv().anthropic ?? cfg.apiKeys?.anthropic,