@livx.cc/agentx 0.99.69 → 0.99.70
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/{Agent-BpCqDWFG.d.ts → Agent-CuXPAfSY.d.ts} +3 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +61 -17
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +61 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -546,6 +546,9 @@ declare class Agent {
|
|
|
546
546
|
private ctx;
|
|
547
547
|
private lastTrimNotified;
|
|
548
548
|
private activeTools;
|
|
549
|
+
/** claude-code bridge for agentx-only tools (ccBridge.ts) + the current step's executor it calls. */
|
|
550
|
+
private ccServer?;
|
|
551
|
+
private ccExec?;
|
|
549
552
|
/** Per-run ground truth: every tool name actually INVOKED this run (native dispatch + delegated
|
|
550
553
|
* runtime activity). The ledger that makes a fabricated tool claim provable. Reset per run. */
|
|
551
554
|
private invokedTools;
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { m as RouterState, H as Hooks, n as RunResult, R as ReasoningEffort, A as Agent } from './Agent-
|
|
2
|
+
import { m as RouterState, H as Hooks, n as RunResult, R as ReasoningEffort, A as Agent } from './Agent-CuXPAfSY.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-DV4SkkQs.js';
|
|
5
5
|
|
package/dist/cli.js
CHANGED
|
@@ -3011,6 +3011,44 @@ function copyTextToClipboard(text, platform2 = process.platform) {
|
|
|
3011
3011
|
import { join as join14, resolve as resolve4, basename as basename2, extname, dirname as dirname5 } from "path";
|
|
3012
3012
|
import { AIClient, DecideClient, listModels, listProviders, getProviderFromModel, getModelInfo, resolveModel, isModelSupported, disposeCursorSessions, disposeClaudeCodeSessions } from "ai.libx.js";
|
|
3013
3013
|
|
|
3014
|
+
// src/ccBridge.ts
|
|
3015
|
+
var CC_BRIDGED = /* @__PURE__ */ new Set(["Recall", "Remember", "MemorySearch"]);
|
|
3016
|
+
function ccToolServer(name, tools, call) {
|
|
3017
|
+
const instance = {
|
|
3018
|
+
async connect(t) {
|
|
3019
|
+
const reply = (id, body) => t.send({ jsonrpc: "2.0", id, ...body });
|
|
3020
|
+
t.onmessage = async (m) => {
|
|
3021
|
+
if (m.id === void 0 || m.id === null) return;
|
|
3022
|
+
try {
|
|
3023
|
+
switch (m.method) {
|
|
3024
|
+
case "initialize":
|
|
3025
|
+
return await reply(m.id, { result: { protocolVersion: m.params?.protocolVersion ?? "2025-06-18", capabilities: { tools: {} }, serverInfo: { name, version: "1" } } });
|
|
3026
|
+
case "tools/list":
|
|
3027
|
+
return await reply(m.id, { result: { tools: tools().map((x) => ({ name: x.name, description: x.description, inputSchema: x.parameters })) } });
|
|
3028
|
+
case "tools/call": {
|
|
3029
|
+
const r = await call(m.params?.name, m.params?.arguments ?? {});
|
|
3030
|
+
const text = typeof r === "string" ? r : r.text;
|
|
3031
|
+
const images = typeof r === "string" ? [] : (r.images ?? []).map((i) => ({ type: "image", mimeType: i.mimeType, data: i.data }));
|
|
3032
|
+
return await reply(m.id, { result: { content: [{ type: "text", text }, ...images] } });
|
|
3033
|
+
}
|
|
3034
|
+
case "ping":
|
|
3035
|
+
return await reply(m.id, { result: {} });
|
|
3036
|
+
default:
|
|
3037
|
+
return await reply(m.id, { error: { code: -32601, message: `method not found: ${m.method}` } });
|
|
3038
|
+
}
|
|
3039
|
+
} catch (e) {
|
|
3040
|
+
if (m.method === "tools/call") return reply(m.id, { result: { content: [{ type: "text", text: String(e?.message ?? e) }], isError: true } });
|
|
3041
|
+
return reply(m.id, { error: { code: -32603, message: String(e?.message ?? e) } });
|
|
3042
|
+
}
|
|
3043
|
+
};
|
|
3044
|
+
await t.start?.();
|
|
3045
|
+
},
|
|
3046
|
+
async close() {
|
|
3047
|
+
}
|
|
3048
|
+
};
|
|
3049
|
+
return { type: "sdk", name, instance };
|
|
3050
|
+
}
|
|
3051
|
+
|
|
3014
3052
|
// src/Agent.ts
|
|
3015
3053
|
init_llm();
|
|
3016
3054
|
init_tools();
|
|
@@ -4411,6 +4449,9 @@ var Agent = class _Agent {
|
|
|
4411
4449
|
lastTrimNotified = 0;
|
|
4412
4450
|
// last auto-trim drop count surfaced via host.notify (dedup)
|
|
4413
4451
|
activeTools = [];
|
|
4452
|
+
/** claude-code bridge for agentx-only tools (ccBridge.ts) + the current step's executor it calls. */
|
|
4453
|
+
ccServer;
|
|
4454
|
+
ccExec;
|
|
4414
4455
|
/** Per-run ground truth: every tool name actually INVOKED this run (native dispatch + delegated
|
|
4415
4456
|
* runtime activity). The ledger that makes a fabricated tool claim provable. Reset per run. */
|
|
4416
4457
|
invokedTools = /* @__PURE__ */ new Set();
|
|
@@ -4776,25 +4817,28 @@ var Agent = class _Agent {
|
|
|
4776
4817
|
}
|
|
4777
4818
|
for (const v of toolTimeoutViolations(this.activeTools, effectiveToolTimeoutMs)) log7.warn(v);
|
|
4778
4819
|
}
|
|
4779
|
-
const
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
const
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
this.toolRanThisAttempt = true;
|
|
4793
|
-
this.stallPoke?.();
|
|
4794
|
-
}
|
|
4820
|
+
const hostExec = async (name, args) => {
|
|
4821
|
+
const tc = { id: `host-${Date.now()}`, type: "function", function: { name, arguments: JSON.stringify(args) } };
|
|
4822
|
+
const job = this.jobs.track({ kind: "host", label: name, holds: true, hardCapMs: effectiveToolTimeoutMs });
|
|
4823
|
+
try {
|
|
4824
|
+
const r = await this.dispatch(tc);
|
|
4825
|
+
job.finish("done");
|
|
4826
|
+
return r;
|
|
4827
|
+
} catch (e) {
|
|
4828
|
+
job.finish("error", void 0, String(e));
|
|
4829
|
+
throw e;
|
|
4830
|
+
} finally {
|
|
4831
|
+
this.toolRanThisAttempt = true;
|
|
4832
|
+
this.stallPoke?.();
|
|
4795
4833
|
}
|
|
4796
|
-
}
|
|
4834
|
+
};
|
|
4835
|
+
const cursorPo = isCursorWithTools ? { toolTimeoutMs: effectiveToolTimeoutMs, toolExecutor: hostExec } : void 0;
|
|
4797
4836
|
const claudeSteerPo = o.model.startsWith("claude-code/") ? { steer: () => this.drainPendingSteers() } : void 0;
|
|
4837
|
+
if (claudeSteerPo && o.providerOptions?.claudeCodeSession && this.activeTools.some((t) => CC_BRIDGED.has(t.name))) {
|
|
4838
|
+
this.ccServer ??= ccToolServer("agentx", () => this.activeTools.filter((t) => CC_BRIDGED.has(t.name)), (n, a) => this.ccExec(n, a));
|
|
4839
|
+
claudeSteerPo.mcpServers = { ...o.providerOptions?.mcpServers, agentx: this.ccServer };
|
|
4840
|
+
}
|
|
4841
|
+
if (this.ccServer) this.ccExec = hostExec;
|
|
4798
4842
|
const denyTools = o.model.startsWith("claude-code/") ? claudeCodeDisallowedTools(o.permissions) : [];
|
|
4799
4843
|
if (denyTools.length) {
|
|
4800
4844
|
const prior = o.providerOptions?.disallowedTools ?? [];
|