@linnlabs/linnkit 0.32.3 → 0.34.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 +40 -0
- package/dist/cli.cjs +458 -70
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +458 -70
- package/dist/cli.js.map +1 -1
- package/dist/context-manager.cjs +55 -0
- package/dist/context-manager.cjs.map +1 -1
- package/dist/context-manager.js +55 -0
- package/dist/context-manager.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 +24 -24
- package/dist/contracts/audit.d.ts +24 -24
- package/dist/contracts/contextPolicy.d.cts +36 -36
- package/dist/contracts/contextPolicy.d.ts +36 -36
- package/dist/contracts/events.d.cts +1083 -1083
- package/dist/contracts/events.d.ts +1083 -1083
- 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 +899 -899
- package/dist/contracts/sse.d.ts +899 -899
- 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 +30 -30
- package/dist/contracts/token-accounting.d.ts +30 -30
- package/dist/index.cjs +538 -94
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +538 -94
- package/dist/index.js.map +1 -1
- package/dist/quickstart/toolRuntime.d.cts +1 -1
- package/dist/quickstart/toolRuntime.d.ts +1 -1
- package/dist/quickstart/types.d.cts +1 -1
- package/dist/quickstart/types.d.ts +1 -1
- package/dist/quickstart.cjs +458 -70
- package/dist/quickstart.cjs.map +1 -1
- package/dist/quickstart.js +458 -70
- package/dist/quickstart.js.map +1 -1
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.cts +11 -0
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.ts +11 -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/execution/eventBusEventPersistence.d.cts +15 -1
- package/dist/runtime-kernel/execution/eventBusEventPersistence.d.ts +15 -1
- package/dist/runtime-kernel/graph-engine/definitions/runContinuation.d.cts +34 -0
- package/dist/runtime-kernel/graph-engine/definitions/runContinuation.d.ts +34 -0
- package/dist/runtime-kernel/graph-engine/engine.d.cts +13 -2
- package/dist/runtime-kernel/graph-engine/engine.d.ts +13 -2
- package/dist/runtime-kernel/graph-engine/functions/parseEngineCheckpoint.d.cts +6 -0
- package/dist/runtime-kernel/graph-engine/functions/parseEngineCheckpoint.d.ts +6 -0
- package/dist/runtime-kernel/graph-engine/index.d.cts +3 -1
- package/dist/runtime-kernel/graph-engine/index.d.ts +3 -1
- package/dist/runtime-kernel/graph-engine/types.d.cts +8 -0
- package/dist/runtime-kernel/graph-engine/types.d.ts +8 -0
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +35 -6
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +35 -6
- package/dist/runtime-kernel/run-supervisor/index.d.cts +1 -1
- package/dist/runtime-kernel/run-supervisor/index.d.ts +1 -1
- package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.cts +1 -0
- package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.ts +1 -0
- package/dist/runtime-kernel/run-supervisor/runHandle.d.cts +9 -5
- package/dist/runtime-kernel/run-supervisor/runHandle.d.ts +9 -5
- package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.cts +2 -0
- package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.ts +2 -0
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.cts +9 -2
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.ts +9 -2
- package/dist/runtime-kernel.cjs +535 -91
- package/dist/runtime-kernel.cjs.map +1 -1
- package/dist/runtime-kernel.d.cts +3 -1
- package/dist/runtime-kernel.d.ts +3 -1
- package/dist/runtime-kernel.js +532 -92
- package/dist/runtime-kernel.js.map +1 -1
- package/dist/testkit.cjs +535 -91
- package/dist/testkit.cjs.map +1 -1
- package/dist/testkit.js +535 -91
- package/dist/testkit.js.map +1 -1
- package/docs/integration/child-runs.md +12 -0
- package/docs/integration/persistence.md +24 -0
- package/docs/integration/run-supervisor.md +15 -2
- package/package.json +2 -2
package/dist/context-manager.js
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import 'eventsource-parser';
|
|
3
3
|
import { get_encoding } from 'tiktoken';
|
|
4
4
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
5
|
+
import 'util';
|
|
5
6
|
import 'fs/promises';
|
|
6
7
|
import 'path';
|
|
7
8
|
|
|
@@ -6429,6 +6430,9 @@ function createDefaultAgentPreprocessorPipeline(context = {}, options = {}) {
|
|
|
6429
6430
|
const registry = createDefaultAgentPreprocessorRegistry(options);
|
|
6430
6431
|
return new PreprocessorPipeline(registry, context);
|
|
6431
6432
|
}
|
|
6433
|
+
|
|
6434
|
+
// src/runtime-kernel/graph-engine/types.ts
|
|
6435
|
+
var ENGINE_STATE_SCHEMA_VERSION = 1;
|
|
6432
6436
|
new AsyncLocalStorage();
|
|
6433
6437
|
|
|
6434
6438
|
// src/runtime-kernel/graph-engine/tick-pipeline/runTickPipeline.ts
|
|
@@ -7477,6 +7481,57 @@ function findLatestProgressAnswer(events) {
|
|
|
7477
7481
|
}
|
|
7478
7482
|
return void 0;
|
|
7479
7483
|
}
|
|
7484
|
+
var counter = z.number().int().nonnegative();
|
|
7485
|
+
var executor = z.object({
|
|
7486
|
+
stepCount: counter,
|
|
7487
|
+
phase: z.string().optional(),
|
|
7488
|
+
maxSteps: counter.optional(),
|
|
7489
|
+
remainingSteps: z.number().int().optional(),
|
|
7490
|
+
finalStepPolicy: z.enum(["final_answer", "force_tools"]).optional(),
|
|
7491
|
+
finalStepForcedTools: z.array(z.string()).optional(),
|
|
7492
|
+
lastStepsHintThreshold: counter.optional(),
|
|
7493
|
+
systemReminderPolicy: AgentSpecSystemReminderPolicy.optional(),
|
|
7494
|
+
toolObservationPolicy: AgentSpecToolObservationGovernancePolicy.optional(),
|
|
7495
|
+
runLockedModelId: z.string().optional(),
|
|
7496
|
+
lastSuccessfulLlmModelId: z.string().optional(),
|
|
7497
|
+
llmInvocationKind: z.enum(["user_initiated", "continuation"]).optional(),
|
|
7498
|
+
llmInvocationCount: counter.optional(),
|
|
7499
|
+
lockRequestedModelId: z.boolean().optional(),
|
|
7500
|
+
contextCompaction: z.object({
|
|
7501
|
+
attemptCount: counter,
|
|
7502
|
+
committedCount: counter,
|
|
7503
|
+
lastCommittedFingerprint: z.string().optional()
|
|
7504
|
+
}).strict().optional()
|
|
7505
|
+
}).strict();
|
|
7506
|
+
z.object({
|
|
7507
|
+
nodeId: z.string().min(1),
|
|
7508
|
+
schemaVersion: z.literal(ENGINE_STATE_SCHEMA_VERSION).optional(),
|
|
7509
|
+
revision: counter.optional(),
|
|
7510
|
+
executionStatus: z.enum(["ready", "executing", "yielded", "awaiting_user"]).optional(),
|
|
7511
|
+
local: z.object({
|
|
7512
|
+
runId: RunIdSchema.optional(),
|
|
7513
|
+
parentRunId: RunIdSchema.optional(),
|
|
7514
|
+
conversationId: z.string().optional(),
|
|
7515
|
+
turnId: z.string().optional(),
|
|
7516
|
+
request: SerializableJsonRecord.optional(),
|
|
7517
|
+
history: z.array(RuntimeEvent).optional(),
|
|
7518
|
+
newEvents: z.array(RuntimeEvent).optional(),
|
|
7519
|
+
executorLocal: executor.optional(),
|
|
7520
|
+
pendingToolCalls: z.array(z.object({
|
|
7521
|
+
id: ToolCallIdSchema,
|
|
7522
|
+
type: z.literal("function"),
|
|
7523
|
+
function: z.object({ name: z.string().min(1), arguments: z.string() }).strict()
|
|
7524
|
+
}).strict()).optional(),
|
|
7525
|
+
executingToolCallId: ToolCallIdSchema.optional(),
|
|
7526
|
+
toolBatchCompletionMode: z.enum(["continue_to_llm", "yield_after_batch"]).optional(),
|
|
7527
|
+
pendingInteractionSpec: SerializableJsonRecord.optional(),
|
|
7528
|
+
lastToolResult: SerializableJsonRecord.optional(),
|
|
7529
|
+
finalAnswer: z.string().optional(),
|
|
7530
|
+
answerId: z.string().optional(),
|
|
7531
|
+
chunkSeq: counter.optional(),
|
|
7532
|
+
contextUsage: ContextUsageSnapshot.optional()
|
|
7533
|
+
}).passthrough().optional()
|
|
7534
|
+
}).strict();
|
|
7480
7535
|
|
|
7481
7536
|
// src/runtime-kernel/audit/consoleAudit.ts
|
|
7482
7537
|
function createConsoleAudit(options = {}) {
|