@cuylabs/agent-core 0.5.0 → 0.7.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/README.md +85 -372
- package/dist/{builder-RcTZuYnO.d.ts → builder-BRvqCcIk.d.ts} +2 -2
- package/dist/{resolver-DOfZ-xuk.d.ts → capability-resolver-CgRGsWVX.d.ts} +1 -1
- package/dist/{chunk-IMGQOTU2.js → chunk-3HNO5SVI.js} +286 -690
- package/dist/chunk-5K7AQVOU.js +619 -0
- package/dist/{chunk-QAQADS4X.js → chunk-BNSHUWCV.js} +1 -0
- package/dist/{chunk-OTUGSCED.js → chunk-CDTV2UYU.js} +159 -1
- package/dist/chunk-IEFIQENH.js +73 -0
- package/dist/chunk-N7P4PN3O.js +84 -0
- package/dist/{chunk-QWFMX226.js → chunk-QGOGIP7T.js} +148 -15
- package/dist/chunk-VNQBHPCT.js +398 -0
- package/dist/{chunk-X635CM2F.js → chunk-ZPMACVZK.js} +1 -1
- package/dist/context/index.js +1 -1
- package/dist/host/index.d.ts +45 -0
- package/dist/host/index.js +8 -0
- package/dist/{index-p0kOsVsE.d.ts → index-C33hlD6H.d.ts} +12 -7
- package/dist/{index-tmhaADz5.d.ts → index-CfBGYrpd.d.ts} +121 -2
- package/dist/index.d.ts +107 -126
- package/dist/index.js +322 -597
- package/dist/inference/index.d.ts +59 -0
- package/dist/inference/index.js +25 -0
- package/dist/middleware/index.d.ts +8 -4
- package/dist/middleware/index.js +5 -3
- package/dist/models/index.d.ts +104 -2
- package/dist/models/index.js +40 -6
- package/dist/prompt/index.d.ts +10 -6
- package/dist/reasoning/index.d.ts +54 -8
- package/dist/reasoning/index.js +2 -3
- package/dist/{registry-CuRWWtcT.d.ts → registry-BDLIHOQB.d.ts} +1 -1
- package/dist/{runner-C7aMP_x3.d.ts → runner-DSKaEz3z.d.ts} +290 -7
- package/dist/runtime/index.d.ts +41 -7
- package/dist/runtime/index.js +15 -6
- package/dist/scope/index.d.ts +10 -0
- package/dist/scope/index.js +14 -0
- package/dist/{session-manager-Uawm2Le7.d.ts → session-manager-B_CWGTsl.d.ts} +1 -1
- package/dist/skill/index.d.ts +7 -5
- package/dist/storage/index.d.ts +2 -2
- package/dist/sub-agent/index.d.ts +12 -8
- package/dist/tool/index.d.ts +8 -4
- package/dist/tool/index.js +4 -3
- package/dist/{tool-pFAnJc5Y.d.ts → tool-Db1Ue-1U.d.ts} +1 -1
- package/dist/{tool-DYp6-cC3.d.ts → tool-HUtkiVBx.d.ts} +5 -99
- package/dist/tracking/index.d.ts +3 -1
- package/dist/types-9jGQUjqW.d.ts +29 -0
- package/dist/types-CHiPh8U2.d.ts +100 -0
- package/dist/types-CqDZTh4d.d.ts +335 -0
- package/dist/types-FRpzzg_9.d.ts +355 -0
- package/package.json +19 -8
- package/dist/capabilities/index.d.ts +0 -97
- package/dist/capabilities/index.js +0 -46
- package/dist/chunk-6TDTQJ4P.js +0 -116
- package/dist/chunk-DWYX7ASF.js +0 -26
- package/dist/chunk-FG4MD5MU.js +0 -54
- package/dist/config-D2xeGEHK.d.ts +0 -52
- package/dist/identifiers-BLUxFqV_.d.ts +0 -12
- package/dist/network-D76DS5ot.d.ts +0 -5
- package/dist/types-MM1JoX5T.d.ts +0 -810
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ToolSet } from 'ai';
|
|
2
|
+
import { T as Tool } from '../tool-Db1Ue-1U.js';
|
|
3
|
+
import { T as ToolHost } from '../types-CHiPh8U2.js';
|
|
4
|
+
import { M as MiddlewareRunner } from '../runner-DSKaEz3z.js';
|
|
5
|
+
export { S as StreamChunk } from '../runner-DSKaEz3z.js';
|
|
6
|
+
import { d as TurnTrackerContext } from '../tool-HUtkiVBx.js';
|
|
7
|
+
import { T as ToolExecutionMode, I as InferenceStreamInput, A as AnyInferenceResult } from '../types-FRpzzg_9.js';
|
|
8
|
+
export { a as AnyStreamResult, C as CustomStreamProvider, b as CustomStreamResult, D as DEFAULT_MAX_OUTPUT_TOKENS, c as InferenceCustomResult, d as InferenceStepInfo, e as InferenceStreamResult, L as LLMStreamInput, f as LLMStreamResult, O as OUTPUT_TOKEN_MAX, S as StepInfo } from '../types-FRpzzg_9.js';
|
|
9
|
+
import 'zod';
|
|
10
|
+
import '@ai-sdk/provider-utils';
|
|
11
|
+
import '../messages-BYWGn8TY.js';
|
|
12
|
+
import '../types-9jGQUjqW.js';
|
|
13
|
+
import '../types-CQaXbRsS.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Build a Vercel AI SDK `ToolSet` from `Tool.Info` definitions.
|
|
17
|
+
*/
|
|
18
|
+
declare function buildToolSet(options: {
|
|
19
|
+
tools: Record<string, Tool.Info>;
|
|
20
|
+
cwd: string;
|
|
21
|
+
sessionID: string;
|
|
22
|
+
messageID: string;
|
|
23
|
+
abort: AbortSignal;
|
|
24
|
+
turnTracker?: TurnTrackerContext;
|
|
25
|
+
host?: ToolHost;
|
|
26
|
+
middleware?: MiddlewareRunner;
|
|
27
|
+
executionMode?: ToolExecutionMode;
|
|
28
|
+
}): Promise<ToolSet>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Create a model inference stream with optional retry support.
|
|
32
|
+
*/
|
|
33
|
+
declare function stream(input: InferenceStreamInput): Promise<AnyInferenceResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Create a stream without retry.
|
|
36
|
+
*/
|
|
37
|
+
declare function streamOnce(input: InferenceStreamInput): Promise<AnyInferenceResult>;
|
|
38
|
+
/**
|
|
39
|
+
* Create a single-step stream.
|
|
40
|
+
*/
|
|
41
|
+
declare function streamStep(input: InferenceStreamInput): Promise<AnyInferenceResult>;
|
|
42
|
+
|
|
43
|
+
declare const Inference: {
|
|
44
|
+
readonly buildToolSet: typeof buildToolSet;
|
|
45
|
+
readonly stream: typeof stream;
|
|
46
|
+
readonly streamOnce: typeof streamOnce;
|
|
47
|
+
readonly streamStep: typeof streamStep;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Use `Inference`.
|
|
51
|
+
*/
|
|
52
|
+
declare const LLM: {
|
|
53
|
+
readonly buildToolSet: typeof buildToolSet;
|
|
54
|
+
readonly stream: typeof stream;
|
|
55
|
+
readonly streamOnce: typeof streamOnce;
|
|
56
|
+
readonly streamStep: typeof streamStep;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export { AnyInferenceResult, Inference, InferenceStreamInput, LLM, ToolExecutionMode, buildToolSet, stream, streamOnce, streamStep };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_MAX_OUTPUT_TOKENS,
|
|
3
|
+
Inference,
|
|
4
|
+
LLM,
|
|
5
|
+
OUTPUT_TOKEN_MAX,
|
|
6
|
+
buildToolSet,
|
|
7
|
+
stream,
|
|
8
|
+
streamOnce,
|
|
9
|
+
streamStep
|
|
10
|
+
} from "../chunk-5K7AQVOU.js";
|
|
11
|
+
import "../chunk-ZPMACVZK.js";
|
|
12
|
+
import "../chunk-IEFIQENH.js";
|
|
13
|
+
import "../chunk-N7P4PN3O.js";
|
|
14
|
+
import "../chunk-VEKUXUVF.js";
|
|
15
|
+
import "../chunk-QGOGIP7T.js";
|
|
16
|
+
export {
|
|
17
|
+
DEFAULT_MAX_OUTPUT_TOKENS,
|
|
18
|
+
Inference,
|
|
19
|
+
LLM,
|
|
20
|
+
OUTPUT_TOKEN_MAX,
|
|
21
|
+
buildToolSet,
|
|
22
|
+
stream,
|
|
23
|
+
streamOnce,
|
|
24
|
+
streamStep
|
|
25
|
+
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { c as ApprovalMiddlewareConfig, O as OtelMiddlewareConfig, T as TelemetryConfig, e as TelemetryConfigResult, f as approvalMiddleware, g as createTelemetryConfig, o as otelMiddleware } from '../index-
|
|
1
|
+
export { h as AgentMiddleware, i as AgentModelHooks, B as BlockedModelCall, M as MiddlewareRunner, m as ModelCallContext, e as ModelCallInput, n as ModelCallOutput, T as ToolCallDecision } from '../runner-DSKaEz3z.js';
|
|
2
|
+
export { c as ApprovalMiddlewareConfig, C as CacheTTL, O as OtelMiddlewareConfig, P as PromptCacheConfig, T as TelemetryConfig, e as TelemetryConfigResult, f as approvalMiddleware, g as createTelemetryConfig, o as otelMiddleware, p as promptCacheMiddleware } from '../index-CfBGYrpd.js';
|
|
3
3
|
import 'ai';
|
|
4
|
+
import '@ai-sdk/provider-utils';
|
|
4
5
|
import '../messages-BYWGn8TY.js';
|
|
5
|
-
import '../tool-
|
|
6
|
+
import '../tool-Db1Ue-1U.js';
|
|
6
7
|
import 'zod';
|
|
7
|
-
import '../tool-
|
|
8
|
+
import '../tool-HUtkiVBx.js';
|
|
9
|
+
import '../types-CHiPh8U2.js';
|
|
10
|
+
import '../types-9jGQUjqW.js';
|
|
11
|
+
import '../types-CQaXbRsS.js';
|
package/dist/middleware/index.js
CHANGED
|
@@ -2,11 +2,13 @@ import {
|
|
|
2
2
|
MiddlewareRunner,
|
|
3
3
|
approvalMiddleware,
|
|
4
4
|
createTelemetryConfig,
|
|
5
|
-
otelMiddleware
|
|
6
|
-
|
|
5
|
+
otelMiddleware,
|
|
6
|
+
promptCacheMiddleware
|
|
7
|
+
} from "../chunk-CDTV2UYU.js";
|
|
7
8
|
export {
|
|
8
9
|
MiddlewareRunner,
|
|
9
10
|
approvalMiddleware,
|
|
10
11
|
createTelemetryConfig,
|
|
11
|
-
otelMiddleware
|
|
12
|
+
otelMiddleware,
|
|
13
|
+
promptCacheMiddleware
|
|
12
14
|
};
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
export { g as getModelId, a as getProviderId } from '../identifiers-BLUxFqV_.js';
|
|
2
1
|
import { LanguageModel } from 'ai';
|
|
2
|
+
import { C as CapabilitySource, S as SourcePriority, d as SourceResult, P as ProviderCompatibility, c as ResolverOptions, b as ModelEntry, M as ModelCapabilities, N as NetworkStatus } from '../capability-resolver-CgRGsWVX.js';
|
|
3
|
+
export { D as DEFAULT_RESOLVER_OPTIONS, I as InputModality, a as ModelCapabilityResolver, O as OutputModality, R as ResolutionResult, e as configureResolver, f as extractModelId, g as extractProvider, h as getDefaultResolver } from '../capability-resolver-CgRGsWVX.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Extract a model ID string from a LanguageModel instance.
|
|
7
|
+
*/
|
|
8
|
+
declare function getModelId(model: LanguageModel): string;
|
|
9
|
+
/**
|
|
10
|
+
* Extract a provider identifier from a LanguageModel instance.
|
|
11
|
+
*/
|
|
12
|
+
declare function getProviderId(model: LanguageModel): string | undefined;
|
|
3
13
|
|
|
4
14
|
type AdapterKind = "openai" | "anthropic" | "google" | "openai-compatible";
|
|
5
15
|
type AdapterSettings = {
|
|
@@ -30,4 +40,96 @@ type Resolver = (key: string) => Promise<LanguageModel>;
|
|
|
30
40
|
type SyncResolver = (key: string) => LanguageModel;
|
|
31
41
|
declare function createResolver(directory: Directory): Resolver;
|
|
32
42
|
|
|
33
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Profile-Based Capability Detection for @cuylabs/agent-core
|
|
45
|
+
*
|
|
46
|
+
* Static pattern matching for model capabilities when no external data is available.
|
|
47
|
+
* This is the fallback layer — always works offline.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Infer provider from model ID
|
|
52
|
+
*/
|
|
53
|
+
declare function inferProvider(modelId: string): string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Pattern-based capability source
|
|
56
|
+
* Always available, uses heuristics to detect capabilities
|
|
57
|
+
*/
|
|
58
|
+
declare class PatternCapabilitySource implements CapabilitySource {
|
|
59
|
+
readonly priority = SourcePriority.PatternMatch;
|
|
60
|
+
readonly name = "Pattern Matching";
|
|
61
|
+
lookup(modelId: string, providerHint?: string): Promise<SourceResult>;
|
|
62
|
+
isAvailable(): Promise<boolean>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Quick check if a model ID likely supports reasoning
|
|
66
|
+
*/
|
|
67
|
+
declare function likelySupportsReasoning(modelId: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get provider compatibility for a model
|
|
70
|
+
*/
|
|
71
|
+
declare function getProviderCompatibility(modelId: string, provider?: string): ProviderCompatibility | undefined;
|
|
72
|
+
|
|
73
|
+
type CapabilityOverrides = ResolverOptions["modelOverrides"];
|
|
74
|
+
type OverrideLookup = {
|
|
75
|
+
override?: Partial<ModelCapabilities>;
|
|
76
|
+
matchedKey?: string;
|
|
77
|
+
};
|
|
78
|
+
declare function findCapabilityOverride(overrides: CapabilityOverrides, modelId: string, provider?: string): OverrideLookup;
|
|
79
|
+
declare function applyCapabilityOverride(entry: ModelEntry, override?: Partial<ModelCapabilities>): ModelEntry;
|
|
80
|
+
|
|
81
|
+
declare class CapabilityCache {
|
|
82
|
+
private adapter;
|
|
83
|
+
private memoryCache;
|
|
84
|
+
private ttlMs;
|
|
85
|
+
private loaded;
|
|
86
|
+
constructor(options?: Partial<ResolverOptions>);
|
|
87
|
+
private load;
|
|
88
|
+
get(modelId: string, provider?: string): Promise<ModelEntry | undefined>;
|
|
89
|
+
set(entry: ModelEntry): Promise<void>;
|
|
90
|
+
setMany(entries: ModelEntry[]): Promise<void>;
|
|
91
|
+
persist(): Promise<void>;
|
|
92
|
+
clear(): Promise<void>;
|
|
93
|
+
stats(): {
|
|
94
|
+
size: number;
|
|
95
|
+
loaded: boolean;
|
|
96
|
+
};
|
|
97
|
+
getAll(): Promise<ModelEntry[]>;
|
|
98
|
+
getAllByProvider(): Promise<Record<string, ModelEntry[]>>;
|
|
99
|
+
}
|
|
100
|
+
declare class CacheCapabilitySource implements CapabilitySource {
|
|
101
|
+
private cache;
|
|
102
|
+
readonly priority = SourcePriority.LocalCache;
|
|
103
|
+
readonly name = "Local Cache";
|
|
104
|
+
constructor(cache: CapabilityCache);
|
|
105
|
+
lookup(modelId: string, provider?: string): Promise<SourceResult>;
|
|
106
|
+
isAvailable(): Promise<boolean>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
declare function getNetworkStatus(): NetworkStatus;
|
|
110
|
+
|
|
111
|
+
declare class RemoteCapabilityFetcher {
|
|
112
|
+
private apiUrl;
|
|
113
|
+
private timeoutMs;
|
|
114
|
+
private cache;
|
|
115
|
+
private lastFetchTime;
|
|
116
|
+
private minFetchInterval;
|
|
117
|
+
constructor(cache: CapabilityCache, options?: Partial<ResolverOptions>);
|
|
118
|
+
fetchAll(): Promise<ModelEntry[]>;
|
|
119
|
+
ping(): Promise<boolean>;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare class RemoteCapabilitySource implements CapabilitySource {
|
|
123
|
+
readonly priority = SourcePriority.RemoteAPI;
|
|
124
|
+
readonly name = "Remote API (models.dev)";
|
|
125
|
+
private fetcher;
|
|
126
|
+
private cache;
|
|
127
|
+
private fetchPromise;
|
|
128
|
+
private enabled;
|
|
129
|
+
constructor(cache: CapabilityCache, options?: Partial<ResolverOptions>);
|
|
130
|
+
lookup(modelId: string, provider?: string): Promise<SourceResult>;
|
|
131
|
+
isAvailable(): Promise<boolean>;
|
|
132
|
+
refresh(): Promise<void>;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { type AdapterSettings, CacheCapabilitySource, CapabilityCache, type CapabilityOverrides, CapabilitySource, type Directory, type EngineSpec, ModelCapabilities, ModelEntry, type ModelSpec, NetworkStatus, PatternCapabilitySource, ProviderCompatibility, RemoteCapabilityFetcher, RemoteCapabilitySource, type Resolver, ResolverOptions, SourcePriority, SourceResult, type SyncResolver, applyCapabilityOverride, createResolver, findCapabilityOverride, getModelId, getNetworkStatus, getProviderCompatibility, getProviderId, inferProvider, likelySupportsReasoning };
|
package/dist/models/index.js
CHANGED
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
CacheCapabilitySource,
|
|
3
|
+
CapabilityCache,
|
|
4
|
+
DEFAULT_RESOLVER_OPTIONS,
|
|
5
|
+
ModelCapabilityResolver,
|
|
6
|
+
PatternCapabilitySource,
|
|
7
|
+
RemoteCapabilityFetcher,
|
|
8
|
+
RemoteCapabilitySource,
|
|
9
|
+
SourcePriority,
|
|
10
|
+
applyCapabilityOverride,
|
|
11
|
+
configureResolver,
|
|
12
|
+
createResolver,
|
|
13
|
+
extractModelId,
|
|
14
|
+
extractProvider,
|
|
15
|
+
findCapabilityOverride,
|
|
16
|
+
getDefaultResolver,
|
|
5
17
|
getModelId,
|
|
6
|
-
|
|
7
|
-
|
|
18
|
+
getNetworkStatus,
|
|
19
|
+
getProviderCompatibility,
|
|
20
|
+
getProviderId,
|
|
21
|
+
inferProvider,
|
|
22
|
+
likelySupportsReasoning
|
|
23
|
+
} from "../chunk-QGOGIP7T.js";
|
|
8
24
|
export {
|
|
25
|
+
CacheCapabilitySource,
|
|
26
|
+
CapabilityCache,
|
|
27
|
+
DEFAULT_RESOLVER_OPTIONS,
|
|
28
|
+
ModelCapabilityResolver,
|
|
29
|
+
PatternCapabilitySource,
|
|
30
|
+
RemoteCapabilityFetcher,
|
|
31
|
+
RemoteCapabilitySource,
|
|
32
|
+
SourcePriority,
|
|
33
|
+
applyCapabilityOverride,
|
|
34
|
+
configureResolver,
|
|
9
35
|
createResolver,
|
|
36
|
+
extractModelId,
|
|
37
|
+
extractProvider,
|
|
38
|
+
findCapabilityOverride,
|
|
39
|
+
getDefaultResolver,
|
|
10
40
|
getModelId,
|
|
11
|
-
|
|
41
|
+
getNetworkStatus,
|
|
42
|
+
getProviderCompatibility,
|
|
43
|
+
getProviderId,
|
|
44
|
+
inferProvider,
|
|
45
|
+
likelySupportsReasoning
|
|
12
46
|
};
|
package/dist/prompt/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { c as ModelFamily,
|
|
2
|
-
export { a as PromptBuildContext, P as PromptConfig, b as PromptSection } from '../runner-
|
|
1
|
+
import { c as ModelFamily, l as EnvironmentInfo, I as InstructionFile } from '../runner-DSKaEz3z.js';
|
|
2
|
+
export { a as PromptBuildContext, P as PromptConfig, b as PromptSection } from '../runner-DSKaEz3z.js';
|
|
3
3
|
import { LanguageModel } from 'ai';
|
|
4
|
-
export { P as PromptBuilder, c as createPromptBuilder } from '../builder-
|
|
5
|
-
export { d as SkillConfig } from '../tool-
|
|
4
|
+
export { P as PromptBuilder, c as createPromptBuilder } from '../builder-BRvqCcIk.js';
|
|
5
|
+
export { d as SkillConfig } from '../tool-Db1Ue-1U.js';
|
|
6
|
+
import '@ai-sdk/provider-utils';
|
|
6
7
|
import '../messages-BYWGn8TY.js';
|
|
7
|
-
import '../
|
|
8
|
-
import '../
|
|
8
|
+
import '../types-9jGQUjqW.js';
|
|
9
|
+
import '../tool-HUtkiVBx.js';
|
|
10
|
+
import '../types-CHiPh8U2.js';
|
|
11
|
+
import '../types-CQaXbRsS.js';
|
|
12
|
+
import '../registry-BDLIHOQB.js';
|
|
9
13
|
import 'zod';
|
|
10
14
|
|
|
11
15
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { R as ReasoningLevel } from '../types-CQaXbRsS.js';
|
|
2
|
-
export { E as EXTENDED_LEVELS, F as FIXED_LEVELS,
|
|
3
|
-
import { P as ProviderCompatibility } from '../resolver-
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
import 'ai';
|
|
7
|
-
import '@ai-sdk/provider-utils';
|
|
1
|
+
import { R as ReasoningLevel, a as ReasoningConfig } from '../types-CQaXbRsS.js';
|
|
2
|
+
export { E as EXTENDED_LEVELS, F as FIXED_LEVELS, S as STANDARD_LEVELS, s as shouldIncludeReasoningSummary } from '../types-CQaXbRsS.js';
|
|
3
|
+
import { P as ProviderCompatibility } from '../capability-resolver-CgRGsWVX.js';
|
|
4
|
+
export { f as extractModelId, g as extractProvider } from '../capability-resolver-CgRGsWVX.js';
|
|
5
|
+
import { LanguageModel } from 'ai';
|
|
6
|
+
import { ProviderOptions } from '@ai-sdk/provider-utils';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Provider-Specific Reasoning Option Builders
|
|
@@ -68,4 +67,51 @@ declare function buildOpenRouterOptions(level: ReasoningLevel): Record<string, u
|
|
|
68
67
|
*/
|
|
69
68
|
declare function getProviderOptionsKey(provider: string): string;
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Reasoning Configuration & Option Builders
|
|
72
|
+
*
|
|
73
|
+
* Orchestrates capability detection and provider-specific option
|
|
74
|
+
* building to produce ready-to-use `providerOptions` for the
|
|
75
|
+
* Vercel AI SDK.
|
|
76
|
+
*
|
|
77
|
+
* Two flavours of every function are provided:
|
|
78
|
+
* - **Async** (`getReasoningConfig`, `buildReasoningOptions`) —
|
|
79
|
+
* uses the full capability resolver (network + cache).
|
|
80
|
+
* - **Sync** (`getReasoningConfigSync`, `buildReasoningOptionsSync`) —
|
|
81
|
+
* uses fast pattern-matching only (no network).
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Get the reasoning configuration for a model.
|
|
86
|
+
*
|
|
87
|
+
* Uses the full capability resolver (including network lookups)
|
|
88
|
+
* for the most accurate result.
|
|
89
|
+
*/
|
|
90
|
+
declare function getReasoningConfig(model: LanguageModel): Promise<ReasoningConfig>;
|
|
91
|
+
/**
|
|
92
|
+
* Synchronous reasoning config using pattern-matching only.
|
|
93
|
+
*
|
|
94
|
+
* Faster but less accurate than {@link getReasoningConfig}.
|
|
95
|
+
* Good for hot paths where async is impractical.
|
|
96
|
+
*/
|
|
97
|
+
declare function getReasoningConfigSync(model: LanguageModel): ReasoningConfig;
|
|
98
|
+
/**
|
|
99
|
+
* Build `providerOptions` for a reasoning level (async).
|
|
100
|
+
*
|
|
101
|
+
* Returns `undefined` when reasoning is off or unsupported.
|
|
102
|
+
*/
|
|
103
|
+
declare function buildReasoningOptions(model: LanguageModel, level: ReasoningLevel): Promise<ProviderOptions | undefined>;
|
|
104
|
+
/**
|
|
105
|
+
* Build `providerOptions` for a reasoning level (sync / pattern-only).
|
|
106
|
+
*/
|
|
107
|
+
declare function buildReasoningOptionsSync(model: LanguageModel, level: ReasoningLevel): ProviderOptions | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Check whether a model supports reasoning (async, full resolver).
|
|
110
|
+
*/
|
|
111
|
+
declare function supportsReasoning(model: LanguageModel): Promise<boolean>;
|
|
112
|
+
/**
|
|
113
|
+
* Synchronous check using pattern-matching only.
|
|
114
|
+
*/
|
|
115
|
+
declare function supportsReasoningSync(model: LanguageModel): boolean;
|
|
116
|
+
|
|
117
|
+
export { ReasoningConfig, ReasoningLevel, buildAnthropicOptions, buildBedrockOptions, buildGoogleOptions, buildGroqOptions, buildOpenAIOptions, buildOpenRouterOptions, buildReasoningOptions, buildReasoningOptionsSync, buildXAIOptions, getProviderOptionsKey, getReasoningConfig, getReasoningConfigSync, supportsReasoning, supportsReasoningSync };
|
package/dist/reasoning/index.js
CHANGED
|
@@ -17,12 +17,11 @@ import {
|
|
|
17
17
|
shouldIncludeReasoningSummary,
|
|
18
18
|
supportsReasoning,
|
|
19
19
|
supportsReasoningSync
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-ZPMACVZK.js";
|
|
21
21
|
import {
|
|
22
22
|
extractModelId,
|
|
23
23
|
extractProvider
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import "../chunk-DWYX7ASF.js";
|
|
24
|
+
} from "../chunk-QGOGIP7T.js";
|
|
26
25
|
export {
|
|
27
26
|
EXTENDED_LEVELS,
|
|
28
27
|
FIXED_LEVELS,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SkillDiscoveryResult, a as SkillMetadata, b as SkillContent, c as SkillResource, d as SkillConfig } from './tool-
|
|
1
|
+
import { S as SkillDiscoveryResult, a as SkillMetadata, b as SkillContent, c as SkillResource, d as SkillConfig } from './tool-Db1Ue-1U.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Skill Registry — in-memory store for discovered skills
|