@livx.cc/agentx 0.99.162 → 0.99.163

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-CR3xWWB_.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-BNDDJv6d.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
@@ -4207,6 +4207,20 @@ var PermissionPolicy = class {
4207
4207
  denyRules(explicitOnly = false) {
4208
4208
  return this.options.rules.filter((r) => r.decision === "deny" && (!explicitOnly || r.explicit)).map((r) => `${r.tool ?? "*"}${r.pathGlob ? `(${r.pathGlob})` : ""}`);
4209
4209
  }
4210
+ /** An allow-list policy (default 'deny') as Claude Code's base tool set (SDK `tools`): the built-in tools it allows, so the
4211
+ * model never sees the rest — the hook alone let it reach for them and fail (live: a sandboxed phone-call agent tried
4212
+ * ReportFindings). MCP tools are not built-ins (the hook gates them). undefined = not an allow-list, or one that names
4213
+ * built-ins by wildcard / any-tool (then only the hook holds). */
4214
+ ccBuiltinTools() {
4215
+ if (this.options.default !== "deny") return void 0;
4216
+ const out = /* @__PURE__ */ new Set();
4217
+ for (const r of this.options.rules) {
4218
+ if (r.decision !== "allow" || r.tool?.startsWith("mcp__")) continue;
4219
+ if (!r.tool || r.tool.includes("*")) return void 0;
4220
+ out.add(CC_TOOL_ALIAS[r.tool] ?? r.tool);
4221
+ }
4222
+ return [...out];
4223
+ }
4210
4224
  /** An allow-list policy (default 'deny') as Claude Code SDK hooks: claude-code runs its own tools, which never reach
4211
4225
  * {@link hooks}, and `disallowedTools` can't say "everything else". Every tool call (native and MCP) goes through
4212
4226
  * decide(); `ask` has no host there → deny. undefined for a default-allow policy (its deny rules travel as disallowedTools). */
@@ -5312,6 +5326,8 @@ var Agent = class _Agent {
5312
5326
  const h = po.hooks ?? o.providerOptions?.hooks ?? {};
5313
5327
  po.hooks = { ...h, PreToolUse: [...h.PreToolUse ?? [], ...allowOnly.PreToolUse] };
5314
5328
  }
5329
+ const builtins = o.providerOptions?.tools === void 0 ? o.permissions?.ccBuiltinTools() : void 0;
5330
+ if (builtins) po.tools = builtins;
5315
5331
  if (this.modeKind && o.providerOptions?.claudeCodeSession) po.claudeCodeSession = `${o.providerOptions.claudeCodeSession}:${this.modeKind}`;
5316
5332
  if (denyTools.length) {
5317
5333
  const prior = o.providerOptions?.disallowedTools ?? [];