@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/testkit.js
CHANGED
|
@@ -3178,13 +3178,21 @@ var GraphExecutor = class {
|
|
|
3178
3178
|
if (existing) {
|
|
3179
3179
|
throw new Error(`Graph checkpoint already exists: ${checkpointKey}`);
|
|
3180
3180
|
}
|
|
3181
|
-
this.
|
|
3181
|
+
const initialLocal = this.executionCheckpointPort ? {
|
|
3182
|
+
...local,
|
|
3183
|
+
executorLocal: {
|
|
3184
|
+
...isRecord4(local.executorLocal) ? local.executorLocal : {},
|
|
3185
|
+
stepCount: 0,
|
|
3186
|
+
maxSteps: options.maxSteps ?? this.config.maxSteps
|
|
3187
|
+
}
|
|
3188
|
+
} : local;
|
|
3189
|
+
this.ephemeralLocals.set(checkpointKey, { ...initialLocal });
|
|
3182
3190
|
await this.commitCheckpoint(checkpointKey, {
|
|
3183
3191
|
nodeId,
|
|
3184
3192
|
...this.executionCheckpointPort ? { executionStatus: "ready" } : {},
|
|
3185
3193
|
revision: 1,
|
|
3186
3194
|
schemaVersion: ENGINE_STATE_SCHEMA_VERSION,
|
|
3187
|
-
local: sanitizeCheckpointLocal(
|
|
3195
|
+
local: sanitizeCheckpointLocal(initialLocal)
|
|
3188
3196
|
});
|
|
3189
3197
|
return this.runUntilYieldQueued(
|
|
3190
3198
|
checkpointKey,
|
|
@@ -12193,10 +12201,10 @@ var ChildRunInvoker = class {
|
|
|
12193
12201
|
runtimeEventSink,
|
|
12194
12202
|
runtimeEventCommitPort,
|
|
12195
12203
|
seedHistoryEvents,
|
|
12196
|
-
maxSteps = 8,
|
|
12197
12204
|
modelId,
|
|
12198
12205
|
abortSignal
|
|
12199
12206
|
} = config;
|
|
12207
|
+
const maxSteps = config.initialInput?.request.maxSteps ?? config.maxSteps ?? 8;
|
|
12200
12208
|
const childRunId = runId ?? generateRunId();
|
|
12201
12209
|
const internalCheckpointKey = childRunId;
|
|
12202
12210
|
const resolvedParentRunId = parentRunId ?? parentToolContext.runId;
|
|
@@ -12241,7 +12249,8 @@ var ChildRunInvoker = class {
|
|
|
12241
12249
|
if (config.persistence?.expectedRevision !== void 0) {
|
|
12242
12250
|
return this.continueChild(config, childRunId, runtimeConversationId);
|
|
12243
12251
|
}
|
|
12244
|
-
const turnId = generateTurnId();
|
|
12252
|
+
const turnId = config.initialInput?.turnId ?? generateTurnId();
|
|
12253
|
+
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");
|
|
12245
12254
|
logger17.info(`\u542F\u52A8 child-run: ${agentConfig.id}`, {
|
|
12246
12255
|
conversationId: runtimeConversationId,
|
|
12247
12256
|
checkpointKey: internalCheckpointKey,
|
|
@@ -12258,11 +12267,14 @@ var ChildRunInvoker = class {
|
|
|
12258
12267
|
});
|
|
12259
12268
|
const admittedChildUserInput = runtimeEventSink(childUserInput, "ChildRunInvoker.user_input");
|
|
12260
12269
|
const childModelId = resolveChildRunModelId({
|
|
12261
|
-
explicitModelId: modelId,
|
|
12270
|
+
explicitModelId: config.initialInput?.request.model_id ?? modelId,
|
|
12262
12271
|
agentConfig,
|
|
12263
12272
|
resolveDefaultModelId: () => this.modelResolver.resolveModelId()
|
|
12264
12273
|
});
|
|
12265
|
-
const request = {
|
|
12274
|
+
const request = config.initialInput ? {
|
|
12275
|
+
...config.initialInput.request,
|
|
12276
|
+
currentUserEventId: admittedChildUserInput.id
|
|
12277
|
+
} : {
|
|
12266
12278
|
query: userMessage,
|
|
12267
12279
|
currentUserEventId: admittedChildUserInput.id,
|
|
12268
12280
|
promptKey: agentConfig.promptKey,
|
|
@@ -14173,6 +14185,7 @@ var DefaultRunSupervisor = class {
|
|
|
14173
14185
|
metadata: { ...record.metadata, executionId: input.executionId }
|
|
14174
14186
|
});
|
|
14175
14187
|
const controller = new AbortController();
|
|
14188
|
+
forwardParentAbortSignal(controller, input.parentSignal);
|
|
14176
14189
|
handle.replaceExecutionAbortController(controller, input.executionId);
|
|
14177
14190
|
handle.attachTransportEventBus(input.eventBus);
|
|
14178
14191
|
this.controllers.set(input.runId, controller);
|