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