@leviyuan/lodestar 0.19.13 → 0.20.0
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/dsh-bridge.js +2 -6
- package/dist/lodestar-agent.js +54 -59
- package/dist/lodestar-setup.js +56 -61
- package/dist/lodestar-update.js +53 -58
- package/dist/lodestar-version.js +14 -19
- package/dist/lodestar.js +209 -202
- package/docs/claude-agent-backend.md +2 -2
- package/docs/usage.md +6 -4
- package/package.json +11 -2
package/dist/dsh-bridge.js
CHANGED
|
@@ -16,7 +16,6 @@ var inject = ["agents", "llm", "agentDefaultModel", "sessionPersistence", "tools
|
|
|
16
16
|
var PROVIDER = process.env.LODESTAR_DSH_PROVIDER ?? "deepseek-official";
|
|
17
17
|
if (!["deepseek-official", "zai-coding-cn", "zai"].includes(PROVIDER))
|
|
18
18
|
throw new Error(`Unsupported DSH provider: ${PROVIDER}`);
|
|
19
|
-
var DELEGATION_TOOLS = ["subagent", "subagent_fork", "workflow", "ralph", "send_message"];
|
|
20
19
|
function nativeErrorMessage(error, depth = 0) {
|
|
21
20
|
if (!(error instanceof Error))
|
|
22
21
|
return String(error);
|
|
@@ -56,8 +55,8 @@ function apply(ctx) {
|
|
|
56
55
|
delete process.env.DSH_LODESTAR_AGENT_CONTEXT;
|
|
57
56
|
ctx.shellEnv.register({
|
|
58
57
|
name: "lodestar-agent",
|
|
59
|
-
variables: { DSH_LODESTAR_AGENT_CONTEXT: { description: "Lodestar
|
|
60
|
-
resolve: (
|
|
58
|
+
variables: { DSH_LODESTAR_AGENT_CONTEXT: { description: "Inherited Lodestar task context for this agent and its native descendants." } },
|
|
59
|
+
resolve: () => delegationContext ? { DSH_LODESTAR_AGENT_CONTEXT: delegationContext } : {}
|
|
61
60
|
});
|
|
62
61
|
const settle = () => {
|
|
63
62
|
if (root?.agent.status === "idle" && turnFailure && lastEnd?.data.turn !== activeTurn) {
|
|
@@ -113,7 +112,6 @@ function apply(ctx) {
|
|
|
113
112
|
ctx.on("agent/created", ({ agent }) => {
|
|
114
113
|
if (agent.session.id === rootId)
|
|
115
114
|
return;
|
|
116
|
-
agent.ctx.tools.restrict({ deny: DELEGATION_TOOLS });
|
|
117
115
|
notify("subagent.started", { sessionId: agent.session.id, parentSessionId: agent.session.header.parentSession });
|
|
118
116
|
});
|
|
119
117
|
ctx.on("agent/disposed", ({ agent }) => {
|
|
@@ -193,8 +191,6 @@ function apply(ctx) {
|
|
|
193
191
|
const resolved = await next();
|
|
194
192
|
return payload.agent === agent ? { ...resolved, ...turnRoute } : resolved;
|
|
195
193
|
});
|
|
196
|
-
if (!input.allowDelegation)
|
|
197
|
-
agentCtx.tools.restrict({ deny: DELEGATION_TOOLS });
|
|
198
194
|
if (input.allowUserInput === false)
|
|
199
195
|
agentCtx.tools.restrict({ deny: ["ask_user_question"] });
|
|
200
196
|
if (input.allowedTools)
|