@cline/shared 0.0.74 → 0.0.75
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/dist/agent.d.ts +28 -0
- package/dist/agents/types.d.ts +12 -0
- package/dist/index.browser.d.ts +1 -0
- package/dist/index.browser.js +6 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -13
- package/dist/llms/gateway.d.ts +17 -0
- package/dist/llms/model-tools.d.ts +24 -0
- package/dist/llms/tools.d.ts +6 -0
- package/package.json +1 -1
package/dist/llms/gateway.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { AgentMessage, AgentModelEvent, AgentToolDefinition } from "../agen
|
|
|
2
2
|
import type { BasicLogger } from "../logging/logger";
|
|
3
3
|
import type { ProviderCapability, ProviderConfigField } from "../rpc/runtime";
|
|
4
4
|
import type { ITelemetryService } from "../services/telemetry";
|
|
5
|
+
import type { ModelTool, ModelToolName } from "./model-tools";
|
|
5
6
|
import type { ModelReasoningOption, ReasoningEffort } from "./reasoning-options";
|
|
6
7
|
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
7
8
|
[key: string]: JsonValue | undefined;
|
|
@@ -23,6 +24,18 @@ export type GatewayModelRoute = {
|
|
|
23
24
|
modelId: string;
|
|
24
25
|
requiredCapability?: GatewayModelCapability;
|
|
25
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* A provider-executed model tool exposed for matching models.
|
|
29
|
+
*
|
|
30
|
+
* Omitted `routes` means the tool is supported by every model on the provider.
|
|
31
|
+
* Exclusion routes take precedence so mixed transports such as Vertex can
|
|
32
|
+
* disable a tool for one model family while retaining a provider-level default.
|
|
33
|
+
*/
|
|
34
|
+
export interface GatewayModelToolCapability {
|
|
35
|
+
name: ModelToolName;
|
|
36
|
+
routes?: readonly GatewayModelRoute[];
|
|
37
|
+
excludeRoutes?: readonly GatewayModelRoute[];
|
|
38
|
+
}
|
|
26
39
|
export interface GatewayProviderRouting {
|
|
27
40
|
promptCache?: {
|
|
28
41
|
format: GatewayPromptCacheFormat;
|
|
@@ -70,6 +83,7 @@ export interface GatewayProviderManifest {
|
|
|
70
83
|
description?: string;
|
|
71
84
|
defaultModelId: string;
|
|
72
85
|
models: readonly GatewayModelDefinition[];
|
|
86
|
+
modelToolCapabilities?: readonly GatewayModelToolCapability[];
|
|
73
87
|
capabilities?: readonly ProviderCapability[];
|
|
74
88
|
env?: readonly ("browser" | "node")[];
|
|
75
89
|
api?: string;
|
|
@@ -119,6 +133,8 @@ export interface GatewayStreamRequest {
|
|
|
119
133
|
systemPrompt?: string;
|
|
120
134
|
messages: readonly AgentMessage[];
|
|
121
135
|
tools?: readonly AgentToolDefinition[];
|
|
136
|
+
/** Provider-executed tools requested independently of runtime tools. */
|
|
137
|
+
modelTools?: readonly ModelTool[];
|
|
122
138
|
temperature?: number;
|
|
123
139
|
maxTokens?: number;
|
|
124
140
|
/**
|
|
@@ -149,6 +165,7 @@ export interface GatewayProviderRegistration {
|
|
|
149
165
|
}
|
|
150
166
|
export interface GatewayModelHandleOptions {
|
|
151
167
|
tools?: readonly AgentToolDefinition[];
|
|
168
|
+
modelTools?: readonly ModelTool[];
|
|
152
169
|
temperature?: number;
|
|
153
170
|
maxTokens?: number;
|
|
154
171
|
metadata?: Record<string, unknown>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Provider-executed tools requested from the selected language model. */
|
|
2
|
+
export declare const MODEL_TOOL_NAMES: readonly ["web_search"];
|
|
3
|
+
export type ModelToolName = (typeof MODEL_TOOL_NAMES)[number];
|
|
4
|
+
export interface WebSearchModelTool {
|
|
5
|
+
name: "web_search";
|
|
6
|
+
maxUses?: number;
|
|
7
|
+
allowedDomains?: string[];
|
|
8
|
+
blockedDomains?: string[];
|
|
9
|
+
userLocation?: {
|
|
10
|
+
country?: string;
|
|
11
|
+
region?: string;
|
|
12
|
+
city?: string;
|
|
13
|
+
timezone?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A tool executed by the model provider as part of inference. Unlike an
|
|
18
|
+
* AgentTool, it has no local executor or approval lifecycle.
|
|
19
|
+
*/
|
|
20
|
+
export type ModelTool = WebSearchModelTool;
|
|
21
|
+
export interface ModelToolSetting {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
}
|
|
24
|
+
export type ModelToolSettings = Partial<Record<ModelToolName, ModelToolSetting>>;
|
package/dist/llms/tools.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export interface ToolCallRecord {
|
|
|
22
22
|
id: string;
|
|
23
23
|
/** Name of the tool that was called */
|
|
24
24
|
name: string;
|
|
25
|
+
/** Absent for ordinary AgentRuntime-executed tools. */
|
|
26
|
+
execution?: "client" | "provider";
|
|
25
27
|
/** Input passed to the tool */
|
|
26
28
|
input: unknown;
|
|
27
29
|
/** Output returned from the tool (if successful) */
|
|
@@ -77,6 +79,10 @@ export interface ToolApprovalResult {
|
|
|
77
79
|
export declare const ToolCallRecordSchema: z.ZodObject<{
|
|
78
80
|
id: z.ZodString;
|
|
79
81
|
name: z.ZodString;
|
|
82
|
+
execution: z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
client: "client";
|
|
84
|
+
provider: "provider";
|
|
85
|
+
}>>;
|
|
80
86
|
input: z.ZodUnknown;
|
|
81
87
|
output: z.ZodUnknown;
|
|
82
88
|
error: z.ZodOptional<z.ZodString>;
|