@livx.cc/agentx 0.99.125 → 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 +1 -1
- package/dist/cli.js +12 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/{secondChannel-GFT69ax4.d.ts → secondChannel-B76KLrf7.d.ts} +7 -3
- package/package.json +1 -1
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-
|
|
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
|
-
|
|
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) {
|