@linnlabs/linnkit 0.37.5 → 0.38.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 +36 -1
- package/dist/cli.cjs +346 -178
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +346 -178
- package/dist/cli.js.map +1 -1
- package/dist/context-manager.cjs +55 -11
- package/dist/context-manager.cjs.map +1 -1
- package/dist/context-manager.js +55 -11
- package/dist/context-manager.js.map +1 -1
- package/dist/contracts/events.d.cts +517 -35
- package/dist/contracts/events.d.ts +517 -35
- package/dist/contracts/llm-retry.d.cts +47 -0
- package/dist/contracts/llm-retry.d.ts +47 -0
- package/dist/contracts/runtime-error.d.cts +26 -0
- package/dist/contracts/runtime-error.d.ts +26 -0
- package/dist/contracts/sse.d.cts +555 -39
- package/dist/contracts/sse.d.ts +555 -39
- package/dist/contracts/sub-run-trace-payload.d.cts +102 -6
- package/dist/contracts/sub-run-trace-payload.d.ts +102 -6
- package/dist/contracts/token-accounting.d.cts +18 -18
- package/dist/contracts/token-accounting.d.ts +18 -18
- package/dist/contracts.cjs +65 -10
- package/dist/contracts.cjs.map +1 -1
- package/dist/contracts.d.cts +4 -2
- package/dist/contracts.d.ts +4 -2
- package/dist/contracts.js +62 -11
- package/dist/contracts.js.map +1 -1
- package/dist/index.cjs +551 -286
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +551 -286
- package/dist/index.js.map +1 -1
- package/dist/ports/canonical-inference.d.cts +3 -0
- package/dist/ports/canonical-inference.d.ts +3 -0
- package/dist/ports/llm-call.d.cts +4 -0
- package/dist/ports/llm-call.d.ts +4 -0
- package/dist/quickstart.cjs +346 -178
- package/dist/quickstart.cjs.map +1 -1
- package/dist/quickstart.js +346 -178
- package/dist/quickstart.js.map +1 -1
- package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.cts +8 -0
- package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.ts +8 -0
- package/dist/runtime-kernel/events/agentEvents.d.cts +85 -4
- package/dist/runtime-kernel/events/agentEvents.d.ts +85 -4
- package/dist/runtime-kernel/events/eventGovernance.d.cts +1 -1
- package/dist/runtime-kernel/events/eventGovernance.d.ts +1 -1
- package/dist/runtime-kernel/events.cjs +55 -11
- package/dist/runtime-kernel/events.cjs.map +1 -1
- package/dist/runtime-kernel/events.js +55 -11
- package/dist/runtime-kernel/events.js.map +1 -1
- package/dist/runtime-kernel/llm/request-builder.d.cts +2 -0
- package/dist/runtime-kernel/llm/request-builder.d.ts +2 -0
- package/dist/runtime-kernel.cjs +513 -271
- package/dist/runtime-kernel.cjs.map +1 -1
- package/dist/runtime-kernel.js +513 -271
- package/dist/runtime-kernel.js.map +1 -1
- package/dist/shared/errorClassifier.d.cts +5 -0
- package/dist/shared/errorClassifier.d.ts +5 -0
- package/dist/testkit.cjs +511 -269
- package/dist/testkit.cjs.map +1 -1
- package/dist/testkit.js +511 -269
- package/dist/testkit.js.map +1 -1
- package/docs/integration/llm-provider.md +24 -5
- package/docs/integration/realtime.md +29 -0
- package/docs/integration/tools.md +4 -0
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LlmRetryCategory } from '../contracts/llm-retry.cjs';
|
|
1
2
|
import { SerializableJsonValue } from '../contracts/json.cjs';
|
|
2
3
|
import { CanonicalLlmUsage } from '../contracts/token-usage.cjs';
|
|
3
4
|
import { ProviderContinuation } from '../contracts/provider-continuation.cjs';
|
|
@@ -127,6 +128,8 @@ type CanonicalInferenceEvent = {
|
|
|
127
128
|
readonly kind: CanonicalInferenceFailureKind;
|
|
128
129
|
readonly code: string;
|
|
129
130
|
readonly retryable: boolean;
|
|
131
|
+
/** Host 按实际失败事实分类;框架不得从 Provider 私有 code 猜测。 */
|
|
132
|
+
readonly retry_category?: LlmRetryCategory;
|
|
130
133
|
};
|
|
131
134
|
interface CanonicalInferencePort {
|
|
132
135
|
stream(request: CanonicalInferenceRequest): AsyncIterable<CanonicalInferenceEvent>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LlmRetryCategory } from '../contracts/llm-retry.js';
|
|
1
2
|
import { SerializableJsonValue } from '../contracts/json.js';
|
|
2
3
|
import { CanonicalLlmUsage } from '../contracts/token-usage.js';
|
|
3
4
|
import { ProviderContinuation } from '../contracts/provider-continuation.js';
|
|
@@ -127,6 +128,8 @@ type CanonicalInferenceEvent = {
|
|
|
127
128
|
readonly kind: CanonicalInferenceFailureKind;
|
|
128
129
|
readonly code: string;
|
|
129
130
|
readonly retryable: boolean;
|
|
131
|
+
/** Host 按实际失败事实分类;框架不得从 Provider 私有 code 猜测。 */
|
|
132
|
+
readonly retry_category?: LlmRetryCategory;
|
|
130
133
|
};
|
|
131
134
|
interface CanonicalInferencePort {
|
|
132
135
|
stream(request: CanonicalInferenceRequest): AsyncIterable<CanonicalInferenceEvent>;
|
|
@@ -2,6 +2,7 @@ import { AiMessage } from '../contracts/messages.cjs';
|
|
|
2
2
|
import { RuntimeResourceRef } from '../contracts/resource-ref.cjs';
|
|
3
3
|
import { ReasoningEffort } from '../contracts/reasoning.cjs';
|
|
4
4
|
import { AssistantReplayPart, ProviderContinuation } from '../contracts/provider-continuation.cjs';
|
|
5
|
+
import { LlmRetryCategory } from '../contracts/llm-retry.cjs';
|
|
5
6
|
import { CanonicalInferenceTool, CanonicalInferenceCachePolicy, CanonicalToolChoice } from './canonical-inference.cjs';
|
|
6
7
|
|
|
7
8
|
/** Runtime 内部持久化和工具执行使用的工具调用结果。 */
|
|
@@ -91,7 +92,10 @@ interface LlmCallOptions {
|
|
|
91
92
|
reasoning_effort?: ReasoningEffort;
|
|
92
93
|
}
|
|
93
94
|
interface LlmRetryConfig {
|
|
95
|
+
/** 单次编排的同模型重试总上限;fallback 另受 maxTotalAttempts 限制。 */
|
|
94
96
|
maxRetries: number;
|
|
97
|
+
/** 类别的独立子配额,不会提高 maxRetries 总上限。未指定类别沿用总上限。 */
|
|
98
|
+
maxRetriesByCategory?: Readonly<Partial<Record<LlmRetryCategory, number>>>;
|
|
95
99
|
/**
|
|
96
100
|
* 单次 LLM 编排允许触发的真实上游调用总数。
|
|
97
101
|
*
|
package/dist/ports/llm-call.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { AiMessage } from '../contracts/messages.js';
|
|
|
2
2
|
import { RuntimeResourceRef } from '../contracts/resource-ref.js';
|
|
3
3
|
import { ReasoningEffort } from '../contracts/reasoning.js';
|
|
4
4
|
import { AssistantReplayPart, ProviderContinuation } from '../contracts/provider-continuation.js';
|
|
5
|
+
import { LlmRetryCategory } from '../contracts/llm-retry.js';
|
|
5
6
|
import { CanonicalInferenceTool, CanonicalInferenceCachePolicy, CanonicalToolChoice } from './canonical-inference.js';
|
|
6
7
|
|
|
7
8
|
/** Runtime 内部持久化和工具执行使用的工具调用结果。 */
|
|
@@ -91,7 +92,10 @@ interface LlmCallOptions {
|
|
|
91
92
|
reasoning_effort?: ReasoningEffort;
|
|
92
93
|
}
|
|
93
94
|
interface LlmRetryConfig {
|
|
95
|
+
/** 单次编排的同模型重试总上限;fallback 另受 maxTotalAttempts 限制。 */
|
|
94
96
|
maxRetries: number;
|
|
97
|
+
/** 类别的独立子配额,不会提高 maxRetries 总上限。未指定类别沿用总上限。 */
|
|
98
|
+
maxRetriesByCategory?: Readonly<Partial<Record<LlmRetryCategory, number>>>;
|
|
95
99
|
/**
|
|
96
100
|
* 单次 LLM 编排允许触发的真实上游调用总数。
|
|
97
101
|
*
|