@linnlabs/linnkit 0.34.0 → 0.35.1
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 +16 -0
- package/dist/cli.cjs +11 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +11 -2
- package/dist/cli.js.map +1 -1
- package/dist/contracts/agentSpec.d.cts +30 -30
- package/dist/contracts/agentSpec.d.ts +30 -30
- package/dist/contracts/audit.d.cts +32 -32
- package/dist/contracts/audit.d.ts +32 -32
- package/dist/contracts/contextPolicy.d.cts +36 -36
- package/dist/contracts/contextPolicy.d.ts +36 -36
- package/dist/contracts/events.d.cts +1113 -1113
- package/dist/contracts/events.d.ts +1113 -1113
- package/dist/contracts/execution.d.cts +8 -8
- package/dist/contracts/execution.d.ts +8 -8
- package/dist/contracts/messages.d.cts +1178 -1178
- package/dist/contracts/messages.d.ts +1178 -1178
- package/dist/contracts/provider-continuation.d.cts +28 -28
- package/dist/contracts/provider-continuation.d.ts +28 -28
- package/dist/contracts/sse.d.cts +897 -897
- package/dist/contracts/sse.d.ts +897 -897
- package/dist/contracts/sub-run-trace-payload.d.cts +26 -26
- package/dist/contracts/sub-run-trace-payload.d.ts +26 -26
- package/dist/contracts/token-accounting.d.cts +38 -38
- package/dist/contracts/token-accounting.d.ts +38 -38
- package/dist/index.cjs +19 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -6
- package/dist/index.js.map +1 -1
- package/dist/quickstart.cjs +11 -2
- package/dist/quickstart.cjs.map +1 -1
- package/dist/quickstart.js +11 -2
- package/dist/quickstart.js.map +1 -1
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.cts +5 -0
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.ts +5 -0
- package/dist/runtime-kernel/events/agentEvents.d.cts +172 -172
- package/dist/runtime-kernel/events/agentEvents.d.ts +172 -172
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +1 -0
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +1 -0
- package/dist/runtime-kernel.cjs +19 -6
- package/dist/runtime-kernel.cjs.map +1 -1
- package/dist/runtime-kernel.js +19 -6
- package/dist/runtime-kernel.js.map +1 -1
- package/dist/testkit.cjs +19 -6
- package/dist/testkit.cjs.map +1 -1
- package/dist/testkit.js +19 -6
- package/dist/testkit.js.map +1 -1
- package/docs/integration/child-runs.md +8 -0
- package/package.json +1 -1
package/dist/runtime-kernel.js
CHANGED
|
@@ -2990,13 +2990,21 @@ var GraphExecutor = class {
|
|
|
2990
2990
|
if (existing) {
|
|
2991
2991
|
throw new Error(`Graph checkpoint already exists: ${checkpointKey}`);
|
|
2992
2992
|
}
|
|
2993
|
-
this.
|
|
2993
|
+
const initialLocal = this.executionCheckpointPort ? {
|
|
2994
|
+
...local,
|
|
2995
|
+
executorLocal: {
|
|
2996
|
+
...isRecord4(local.executorLocal) ? local.executorLocal : {},
|
|
2997
|
+
stepCount: 0,
|
|
2998
|
+
maxSteps: options.maxSteps ?? this.config.maxSteps
|
|
2999
|
+
}
|
|
3000
|
+
} : local;
|
|
3001
|
+
this.ephemeralLocals.set(checkpointKey, { ...initialLocal });
|
|
2994
3002
|
await this.commitCheckpoint(checkpointKey, {
|
|
2995
3003
|
nodeId,
|
|
2996
3004
|
...this.executionCheckpointPort ? { executionStatus: "ready" } : {},
|
|
2997
3005
|
revision: 1,
|
|
2998
3006
|
schemaVersion: ENGINE_STATE_SCHEMA_VERSION,
|
|
2999
|
-
local: sanitizeCheckpointLocal(
|
|
3007
|
+
local: sanitizeCheckpointLocal(initialLocal)
|
|
3000
3008
|
});
|
|
3001
3009
|
return this.runUntilYieldQueued(
|
|
3002
3010
|
checkpointKey,
|
|
@@ -12005,10 +12013,10 @@ var ChildRunInvoker = class {
|
|
|
12005
12013
|
runtimeEventSink,
|
|
12006
12014
|
runtimeEventCommitPort,
|
|
12007
12015
|
seedHistoryEvents,
|
|
12008
|
-
maxSteps = 8,
|
|
12009
12016
|
modelId,
|
|
12010
12017
|
abortSignal
|
|
12011
12018
|
} = config;
|
|
12019
|
+
const maxSteps = config.initialInput?.request.maxSteps ?? config.maxSteps ?? 8;
|
|
12012
12020
|
const childRunId = runId ?? generateRunId();
|
|
12013
12021
|
const internalCheckpointKey = childRunId;
|
|
12014
12022
|
const resolvedParentRunId = parentRunId ?? parentToolContext.runId;
|
|
@@ -12053,7 +12061,8 @@ var ChildRunInvoker = class {
|
|
|
12053
12061
|
if (config.persistence?.expectedRevision !== void 0) {
|
|
12054
12062
|
return this.continueChild(config, childRunId, runtimeConversationId);
|
|
12055
12063
|
}
|
|
12056
|
-
const turnId = generateTurnId();
|
|
12064
|
+
const turnId = config.initialInput?.turnId ?? generateTurnId();
|
|
12065
|
+
if (config.initialInput && (!turnId.trim() || config.initialInput.request.query !== userMessage || config.initialInput.request.promptKey !== agentConfig.promptKey || !config.initialInput.request.model_id)) throw new Error("Child initial input does not match the admitted invocation");
|
|
12057
12066
|
logger17.info(`\u542F\u52A8 child-run: ${agentConfig.id}`, {
|
|
12058
12067
|
conversationId: runtimeConversationId,
|
|
12059
12068
|
checkpointKey: internalCheckpointKey,
|
|
@@ -12070,11 +12079,14 @@ var ChildRunInvoker = class {
|
|
|
12070
12079
|
});
|
|
12071
12080
|
const admittedChildUserInput = runtimeEventSink(childUserInput, "ChildRunInvoker.user_input");
|
|
12072
12081
|
const childModelId = resolveChildRunModelId({
|
|
12073
|
-
explicitModelId: modelId,
|
|
12082
|
+
explicitModelId: config.initialInput?.request.model_id ?? modelId,
|
|
12074
12083
|
agentConfig,
|
|
12075
12084
|
resolveDefaultModelId: () => this.modelResolver.resolveModelId()
|
|
12076
12085
|
});
|
|
12077
|
-
const request = {
|
|
12086
|
+
const request = config.initialInput ? {
|
|
12087
|
+
...config.initialInput.request,
|
|
12088
|
+
currentUserEventId: admittedChildUserInput.id
|
|
12089
|
+
} : {
|
|
12078
12090
|
query: userMessage,
|
|
12079
12091
|
currentUserEventId: admittedChildUserInput.id,
|
|
12080
12092
|
promptKey: agentConfig.promptKey,
|
|
@@ -13985,6 +13997,7 @@ var DefaultRunSupervisor = class {
|
|
|
13985
13997
|
metadata: { ...record.metadata, executionId: input.executionId }
|
|
13986
13998
|
});
|
|
13987
13999
|
const controller = new AbortController();
|
|
14000
|
+
forwardParentAbortSignal(controller, input.parentSignal);
|
|
13988
14001
|
handle.replaceExecutionAbortController(controller, input.executionId);
|
|
13989
14002
|
handle.attachTransportEventBus(input.eventBus);
|
|
13990
14003
|
this.controllers.set(input.runId, controller);
|