@linnlabs/linnkit 0.42.0 → 0.43.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/CHANGELOG.md +20 -0
- package/dist/cli.cjs +12 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +12 -1
- package/dist/cli.js.map +1 -1
- package/dist/contracts/agentSpec.d.cts +5 -5
- package/dist/contracts/agentSpec.d.ts +5 -5
- package/dist/contracts/audit.d.cts +10 -10
- package/dist/contracts/audit.d.ts +10 -10
- package/dist/contracts/contextPolicy.d.cts +14 -14
- package/dist/contracts/contextPolicy.d.ts +14 -14
- package/dist/contracts/events.d.cts +117 -117
- package/dist/contracts/events.d.ts +117 -117
- package/dist/contracts/execution.d.cts +2 -2
- package/dist/contracts/execution.d.ts +2 -2
- package/dist/contracts/llm-retry.d.cts +2 -2
- package/dist/contracts/llm-retry.d.ts +2 -2
- package/dist/contracts/messages.d.cts +32 -32
- package/dist/contracts/messages.d.ts +32 -32
- package/dist/contracts/sse.d.cts +97 -97
- package/dist/contracts/sse.d.ts +97 -97
- package/dist/contracts/sub-run-trace-payload.d.cts +8 -8
- package/dist/contracts/sub-run-trace-payload.d.ts +8 -8
- package/dist/contracts/token-accounting.d.cts +12 -12
- package/dist/contracts/token-accounting.d.ts +12 -12
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/quickstart.cjs +12 -1
- package/dist/quickstart.cjs.map +1 -1
- package/dist/quickstart.js +12 -1
- package/dist/quickstart.js.map +1 -1
- package/dist/runtime-kernel/events/agentEvents.d.cts +2 -2
- package/dist/runtime-kernel/events/agentEvents.d.ts +2 -2
- package/dist/runtime-kernel/graph-engine/engine.d.cts +1 -0
- package/dist/runtime-kernel/graph-engine/engine.d.ts +1 -0
- package/dist/runtime-kernel.cjs +12 -1
- package/dist/runtime-kernel.cjs.map +1 -1
- package/dist/runtime-kernel.js +12 -1
- package/dist/runtime-kernel.js.map +1 -1
- package/dist/testkit.cjs +12 -1
- package/dist/testkit.cjs.map +1 -1
- package/dist/testkit.js +12 -1
- package/dist/testkit.js.map +1 -1
- package/docs/integration/tool-development-guide.md +1 -0
- package/package.json +2 -2
|
@@ -216,12 +216,12 @@ declare const AgentEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
216
216
|
id: z.ZodString;
|
|
217
217
|
retry_id: z.ZodString;
|
|
218
218
|
status: z.ZodEnum<{
|
|
219
|
+
failed: "failed";
|
|
220
|
+
cancelled: "cancelled";
|
|
219
221
|
waiting: "waiting";
|
|
220
222
|
retrying: "retrying";
|
|
221
223
|
succeeded: "succeeded";
|
|
222
224
|
exhausted: "exhausted";
|
|
223
|
-
failed: "failed";
|
|
224
|
-
cancelled: "cancelled";
|
|
225
225
|
}>;
|
|
226
226
|
category: z.ZodEnum<{
|
|
227
227
|
output: "output";
|
|
@@ -216,12 +216,12 @@ declare const AgentEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
216
216
|
id: z.ZodString;
|
|
217
217
|
retry_id: z.ZodString;
|
|
218
218
|
status: z.ZodEnum<{
|
|
219
|
+
failed: "failed";
|
|
220
|
+
cancelled: "cancelled";
|
|
219
221
|
waiting: "waiting";
|
|
220
222
|
retrying: "retrying";
|
|
221
223
|
succeeded: "succeeded";
|
|
222
224
|
exhausted: "exhausted";
|
|
223
|
-
failed: "failed";
|
|
224
|
-
cancelled: "cancelled";
|
|
225
225
|
}>;
|
|
226
226
|
category: z.ZodEnum<{
|
|
227
227
|
output: "output";
|
|
@@ -12,6 +12,7 @@ type GraphRunResult = {
|
|
|
12
12
|
interface GraphResumeSessionInput {
|
|
13
13
|
expectedRevision: number;
|
|
14
14
|
localPatch: Record<string, unknown>;
|
|
15
|
+
/** 恢复后的起点。省略时:同批还有未执行的工具调用则先回 tool,否则 llm;有未执行调用时只接受 tool。 */
|
|
15
16
|
nodeId?: string;
|
|
16
17
|
expectedNodeId?: string;
|
|
17
18
|
/** 本次 session execution 使用的步数预算;未传时沿用已持久化预算或 executor 默认值。 */
|
|
@@ -12,6 +12,7 @@ type GraphRunResult = {
|
|
|
12
12
|
interface GraphResumeSessionInput {
|
|
13
13
|
expectedRevision: number;
|
|
14
14
|
localPatch: Record<string, unknown>;
|
|
15
|
+
/** 恢复后的起点。省略时:同批还有未执行的工具调用则先回 tool,否则 llm;有未执行调用时只接受 tool。 */
|
|
15
16
|
nodeId?: string;
|
|
16
17
|
expectedNodeId?: string;
|
|
17
18
|
/** 本次 session execution 使用的步数预算;未传时沿用已持久化预算或 executor 默认值。 */
|
package/dist/runtime-kernel.cjs
CHANGED
|
@@ -3011,6 +3011,16 @@ function mergeResumeSessionLocal(persistedLocal, localPatch) {
|
|
|
3011
3011
|
}
|
|
3012
3012
|
};
|
|
3013
3013
|
}
|
|
3014
|
+
function resolveResumeNodeId(local, requested) {
|
|
3015
|
+
const pending = local?.pendingToolCalls;
|
|
3016
|
+
if (!Array.isArray(pending) || pending.length === 0) return requested ?? "llm";
|
|
3017
|
+
if (requested !== void 0 && requested !== "tool") {
|
|
3018
|
+
throw new Error(
|
|
3019
|
+
`Graph resume must first run ${pending.length} pending tool call(s) from the interrupted batch: requested node=${requested}`
|
|
3020
|
+
);
|
|
3021
|
+
}
|
|
3022
|
+
return "tool";
|
|
3023
|
+
}
|
|
3014
3024
|
var GraphExecutor = class {
|
|
3015
3025
|
constructor(checkpointer, config = {}) {
|
|
3016
3026
|
this.checkpointer = checkpointer;
|
|
@@ -3123,13 +3133,14 @@ var GraphExecutor = class {
|
|
|
3123
3133
|
);
|
|
3124
3134
|
}
|
|
3125
3135
|
const resumedLocal = mergeResumeSessionLocal(current.local, input.localPatch);
|
|
3136
|
+
const nodeId = resolveResumeNodeId(resumedLocal, input.nodeId);
|
|
3126
3137
|
if (this.executionCheckpointPort && current.local?.executorLocal) {
|
|
3127
3138
|
resumedLocal.executorLocal = { ...current.local.executorLocal };
|
|
3128
3139
|
}
|
|
3129
3140
|
this.ephemeralLocals.set(checkpointKey, resumedLocal);
|
|
3130
3141
|
await this.commitCheckpoint(checkpointKey, {
|
|
3131
3142
|
...current,
|
|
3132
|
-
nodeId
|
|
3143
|
+
nodeId,
|
|
3133
3144
|
...this.executionCheckpointPort ? { executionStatus: "ready" } : {},
|
|
3134
3145
|
revision: currentRevision + 1,
|
|
3135
3146
|
local: sanitizeCheckpointLocal(resumedLocal)
|