@cline/core 0.0.38-nightly.1778113663
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 +108 -0
- package/dist/ClineCore.d.ts +282 -0
- package/dist/account/cline-account-service.d.ts +37 -0
- package/dist/account/index.d.ts +3 -0
- package/dist/account/rpc.d.ts +40 -0
- package/dist/account/types.d.ts +98 -0
- package/dist/auth/bounded-ttl-cache.d.ts +13 -0
- package/dist/auth/client.d.ts +30 -0
- package/dist/auth/cline.d.ts +64 -0
- package/dist/auth/codex.d.ts +43 -0
- package/dist/auth/oca.d.ts +28 -0
- package/dist/auth/server.d.ts +54 -0
- package/dist/auth/types.d.ts +103 -0
- package/dist/auth/utils.d.ts +32 -0
- package/dist/cline-core/automation.d.ts +34 -0
- package/dist/cline-core/runtime-services.d.ts +5 -0
- package/dist/cline-core/start-input.d.ts +10 -0
- package/dist/cline-core/telemetry.d.ts +10 -0
- package/dist/cline-core/types.d.ts +221 -0
- package/dist/cron/events/cron-event-ingress.d.ts +37 -0
- package/dist/cron/reports/cron-report-writer.d.ts +40 -0
- package/dist/cron/runner/cron-materializer.d.ts +35 -0
- package/dist/cron/runner/cron-runner.d.ts +45 -0
- package/dist/cron/runner/resource-limiter.d.ts +8 -0
- package/dist/cron/schedule/scheduler.d.ts +12 -0
- package/dist/cron/service/cron-service.d.ts +56 -0
- package/dist/cron/service/schedule-command-service.d.ts +9 -0
- package/dist/cron/service/schedule-service.d.ts +98 -0
- package/dist/cron/specs/cron-reconciler.d.ts +61 -0
- package/dist/cron/specs/cron-spec-parser.d.ts +26 -0
- package/dist/cron/specs/cron-watcher.d.ts +22 -0
- package/dist/cron/store/cron-schema.d.ts +2 -0
- package/dist/cron/store/sqlite-cron-store.d.ts +240 -0
- package/dist/extensions/config/index.d.ts +7 -0
- package/dist/extensions/config/runtime-commands.d.ts +11 -0
- package/dist/extensions/config/skill-frontmatter-toggle.d.ts +11 -0
- package/dist/extensions/config/unified-config-file-watcher.d.ts +77 -0
- package/dist/extensions/config/user-instruction-config-loader.d.ts +64 -0
- package/dist/extensions/config/user-instruction-plugin.d.ts +25 -0
- package/dist/extensions/config/user-instruction-service.d.ts +23 -0
- package/dist/extensions/context/agentic-compaction.d.ts +12 -0
- package/dist/extensions/context/basic-compaction.d.ts +8 -0
- package/dist/extensions/context/compaction-shared.d.ts +60 -0
- package/dist/extensions/context/compaction.d.ts +24 -0
- package/dist/extensions/index.d.ts +5 -0
- package/dist/extensions/mcp/client.d.ts +2 -0
- package/dist/extensions/mcp/config-loader.d.ts +15 -0
- package/dist/extensions/mcp/index.d.ts +8 -0
- package/dist/extensions/mcp/manager.d.ts +23 -0
- package/dist/extensions/mcp/name-transform.d.ts +2 -0
- package/dist/extensions/mcp/policies.d.ts +14 -0
- package/dist/extensions/mcp/tools.d.ts +3 -0
- package/dist/extensions/mcp/types.d.ts +94 -0
- package/dist/extensions/plugin/plugin-config-loader.d.ts +40 -0
- package/dist/extensions/plugin/plugin-load-report.d.ts +18 -0
- package/dist/extensions/plugin/plugin-loader.d.ts +22 -0
- package/dist/extensions/plugin/plugin-module-import.d.ts +4 -0
- package/dist/extensions/plugin/plugin-sandbox.d.ts +36 -0
- package/dist/extensions/plugin/plugin-targeting.d.ts +6 -0
- package/dist/extensions/plugin-sandbox-bootstrap.js +1 -0
- package/dist/extensions/tools/constants.d.ts +24 -0
- package/dist/extensions/tools/definitions.d.ts +102 -0
- package/dist/extensions/tools/executors/apply-patch-parser.d.ts +68 -0
- package/dist/extensions/tools/executors/apply-patch.d.ts +28 -0
- package/dist/extensions/tools/executors/bash.d.ts +49 -0
- package/dist/extensions/tools/executors/editor.d.ts +31 -0
- package/dist/extensions/tools/executors/file-read.d.ts +40 -0
- package/dist/extensions/tools/executors/index.d.ts +50 -0
- package/dist/extensions/tools/executors/search.d.ts +50 -0
- package/dist/extensions/tools/executors/web-fetch.d.ts +58 -0
- package/dist/extensions/tools/helpers.d.ts +15 -0
- package/dist/extensions/tools/index.d.ts +59 -0
- package/dist/extensions/tools/model-tool-routing.d.ts +33 -0
- package/dist/extensions/tools/presets.d.ts +132 -0
- package/dist/extensions/tools/runtime.d.ts +24 -0
- package/dist/extensions/tools/schemas.d.ts +241 -0
- package/dist/extensions/tools/team/delegated-agent.d.ts +43 -0
- package/dist/extensions/tools/team/index.d.ts +2 -0
- package/dist/extensions/tools/team/multi-agent.d.ts +230 -0
- package/dist/extensions/tools/team/projections.d.ts +8 -0
- package/dist/extensions/tools/team/runtime.d.ts +4 -0
- package/dist/extensions/tools/team/spawn-agent-tool.d.ts +83 -0
- package/dist/extensions/tools/team/subagent-prompts.d.ts +3 -0
- package/dist/extensions/tools/team/team-tools.d.ts +35 -0
- package/dist/extensions/tools/types.d.ts +254 -0
- package/dist/hooks/checkpoint-hooks.d.ts +45 -0
- package/dist/hooks/hook-extension.d.ts +2 -0
- package/dist/hooks/hook-file-config.d.ts +24 -0
- package/dist/hooks/hook-file-hooks.d.ts +21 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/subprocess-runner.d.ts +21 -0
- package/dist/hooks/subprocess.d.ts +68 -0
- package/dist/hub/client/connect.d.ts +14 -0
- package/dist/hub/client/index.d.ts +88 -0
- package/dist/hub/client/session-client.d.ts +118 -0
- package/dist/hub/client/ui-client.d.ts +45 -0
- package/dist/hub/daemon/entry.d.ts +1 -0
- package/dist/hub/daemon/entry.js +720 -0
- package/dist/hub/daemon/index.d.ts +8 -0
- package/dist/hub/daemon/runtime-handlers.d.ts +12 -0
- package/dist/hub/daemon/start-shared-server.d.ts +18 -0
- package/dist/hub/discovery/defaults.d.ts +16 -0
- package/dist/hub/discovery/index.d.ts +30 -0
- package/dist/hub/discovery/workspace.d.ts +3 -0
- package/dist/hub/index.d.ts +32 -0
- package/dist/hub/index.js +717 -0
- package/dist/hub/runtime-host/hub-runtime-host.d.ts +73 -0
- package/dist/hub/runtime-host/remote-runtime-host.d.ts +9 -0
- package/dist/hub/server/browser-websocket.d.ts +17 -0
- package/dist/hub/server/command-transport.d.ts +7 -0
- package/dist/hub/server/handlers/approval-handlers.d.ts +17 -0
- package/dist/hub/server/handlers/capability-handlers.d.ts +12 -0
- package/dist/hub/server/handlers/client-handlers.d.ts +6 -0
- package/dist/hub/server/handlers/context.d.ts +56 -0
- package/dist/hub/server/handlers/run-handlers.d.ts +5 -0
- package/dist/hub/server/handlers/session-event-projector.d.ts +7 -0
- package/dist/hub/server/handlers/session-handlers.d.ts +20 -0
- package/dist/hub/server/hub-client-contributions.d.ts +19 -0
- package/dist/hub/server/hub-notifications.d.ts +7 -0
- package/dist/hub/server/hub-schedule-events.d.ts +2 -0
- package/dist/hub/server/hub-server-logging.d.ts +2 -0
- package/dist/hub/server/hub-server-options.d.ts +55 -0
- package/dist/hub/server/hub-server-transport.d.ts +34 -0
- package/dist/hub/server/hub-session-records.d.ts +8 -0
- package/dist/hub/server/hub-websocket-server.d.ts +6 -0
- package/dist/hub/server/index.d.ts +4 -0
- package/dist/hub/server/native-transport.d.ts +16 -0
- package/dist/index.d.ts +102 -0
- package/dist/index.js +715 -0
- package/dist/runtime/capabilities/index.d.ts +2 -0
- package/dist/runtime/capabilities/normalize-runtime-capabilities.d.ts +2 -0
- package/dist/runtime/capabilities/runtime-capabilities.d.ts +6 -0
- package/dist/runtime/config/agent-message-codec.d.ts +6 -0
- package/dist/runtime/config/agent-runtime-config-builder.d.ts +87 -0
- package/dist/runtime/host/history.d.ts +18 -0
- package/dist/runtime/host/host.d.ts +7 -0
- package/dist/runtime/host/local/agent-event-bridge.d.ts +29 -0
- package/dist/runtime/host/local/session-record.d.ts +6 -0
- package/dist/runtime/host/local/session-service-invoker.d.ts +4 -0
- package/dist/runtime/host/local/spawn-tool.d.ts +15 -0
- package/dist/runtime/host/local/user-files.d.ts +1 -0
- package/dist/runtime/host/local-runtime-host.d.ts +119 -0
- package/dist/runtime/host/runtime-host-support.d.ts +20 -0
- package/dist/runtime/host/runtime-host.d.ts +163 -0
- package/dist/runtime/orchestration/runtime-builder.d.ts +6 -0
- package/dist/runtime/orchestration/runtime-event-adapter.d.ts +101 -0
- package/dist/runtime/orchestration/runtime-oauth-token-manager.d.ts +30 -0
- package/dist/runtime/orchestration/session-runtime-orchestrator.d.ts +218 -0
- package/dist/runtime/orchestration/session-runtime.d.ts +58 -0
- package/dist/runtime/orchestration/user-input-builder.d.ts +15 -0
- package/dist/runtime/safety/loop-detection.d.ts +58 -0
- package/dist/runtime/safety/mistake-tracker.d.ts +68 -0
- package/dist/runtime/safety/rules.d.ts +6 -0
- package/dist/runtime/tools/subprocess-sandbox.d.ts +43 -0
- package/dist/runtime/tools/tool-approval.d.ts +9 -0
- package/dist/runtime/turn-queue/pending-prompt-service.d.ts +64 -0
- package/dist/services/agent-events.d.ts +33 -0
- package/dist/services/config.d.ts +2 -0
- package/dist/services/global-settings.d.ts +34 -0
- package/dist/services/llms/cline-recommended-models.d.ts +19 -0
- package/dist/services/llms/configured-provider-registry.d.ts +27 -0
- package/dist/services/llms/handler-factory.d.ts +3 -0
- package/dist/services/llms/provider-defaults.d.ts +28 -0
- package/dist/services/llms/provider-settings.d.ts +247 -0
- package/dist/services/llms/runtime-config.d.ts +3 -0
- package/dist/services/llms/runtime-registry.d.ts +19 -0
- package/dist/services/llms/runtime-types.d.ts +84 -0
- package/dist/services/local-runtime-bootstrap.d.ts +45 -0
- package/dist/services/plugin-tools.d.ts +15 -0
- package/dist/services/providers/local-provider-registry.d.ts +218 -0
- package/dist/services/providers/local-provider-service.d.ts +99 -0
- package/dist/services/providers/model-source.d.ts +3 -0
- package/dist/services/session-artifacts.d.ts +17 -0
- package/dist/services/session-data.d.ts +51 -0
- package/dist/services/session-telemetry.d.ts +15 -0
- package/dist/services/storage/file-team-store.d.ts +28 -0
- package/dist/services/storage/provider-settings-legacy-migration.d.ts +38 -0
- package/dist/services/storage/provider-settings-manager.d.ts +23 -0
- package/dist/services/storage/sqlite-session-store.d.ts +30 -0
- package/dist/services/storage/sqlite-team-store.d.ts +34 -0
- package/dist/services/storage/team-store.d.ts +15 -0
- package/dist/services/telemetry/ITelemetryAdapter.d.ts +54 -0
- package/dist/services/telemetry/OpenTelemetryAdapter.d.ts +43 -0
- package/dist/services/telemetry/OpenTelemetryProvider.d.ts +83 -0
- package/dist/services/telemetry/TelemetryLoggerSink.d.ts +27 -0
- package/dist/services/telemetry/TelemetryService.d.ts +34 -0
- package/dist/services/telemetry/core-events.d.ts +198 -0
- package/dist/services/telemetry/distinct-id.d.ts +1 -0
- package/dist/services/telemetry/index.d.ts +3 -0
- package/dist/services/telemetry/index.js +1 -0
- package/dist/services/usage.d.ts +18 -0
- package/dist/services/workspace/file-indexer.d.ts +5 -0
- package/dist/services/workspace/index.d.ts +4 -0
- package/dist/services/workspace/mention-enricher.d.ts +13 -0
- package/dist/services/workspace/workspace-manager.d.ts +27 -0
- package/dist/services/workspace/workspace-manifest.d.ts +31 -0
- package/dist/services/workspace/workspace-telemetry.d.ts +18 -0
- package/dist/session/checkpoint-restore.d.ts +20 -0
- package/dist/session/models/session-graph.d.ts +15 -0
- package/dist/session/models/session-manifest.d.ts +29 -0
- package/dist/session/models/session-row.d.ts +92 -0
- package/dist/session/services/file-session-service.d.ts +8 -0
- package/dist/session/services/message-builder.d.ts +66 -0
- package/dist/session/services/persistence-service.d.ts +58 -0
- package/dist/session/services/session-service.d.ts +13 -0
- package/dist/session/session-snapshot.d.ts +57 -0
- package/dist/session/session-versioning-service.d.ts +48 -0
- package/dist/session/stores/conversation-store.d.ts +29 -0
- package/dist/session/stores/session-manifest-store.d.ts +21 -0
- package/dist/session/stores/team-persistence-store.d.ts +23 -0
- package/dist/session/team/index.d.ts +2 -0
- package/dist/session/team/team-child-session-manager.d.ts +35 -0
- package/dist/session/team/team-session-coordinator.d.ts +13 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/settings-service.d.ts +6 -0
- package/dist/settings/types.d.ts +42 -0
- package/dist/types/chat-schema.d.ts +161 -0
- package/dist/types/common.d.ts +19 -0
- package/dist/types/config.d.ts +167 -0
- package/dist/types/events.d.ts +89 -0
- package/dist/types/provider-settings.d.ts +19 -0
- package/dist/types/session.d.ts +116 -0
- package/dist/types/sessions.d.ts +28 -0
- package/dist/types/storage.d.ts +36 -0
- package/dist/types.d.ts +32 -0
- package/dist/version.d.ts +1 -0
- package/package.json +83 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AgentConfig, AgentModel, BasicLogger, ModelInfo } from "@cline/shared";
|
|
2
|
+
export declare function resolveKnownModelsFromConfig(config: AgentConfig): Record<string, ModelInfo> | undefined;
|
|
3
|
+
export declare function createAgentModelFromConfig(config: AgentConfig, logger: BasicLogger | undefined): AgentModel;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** biome-ignore-all lint/style/noNonNullAssertion: static */
|
|
2
|
+
import * as Llms from "@cline/llms";
|
|
3
|
+
import type { ModelCatalogConfig, ModelInfo, ProviderCapability, ProviderConfig } from "./provider-settings";
|
|
4
|
+
export interface BuiltInProviderManifest {
|
|
5
|
+
id: string;
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
modelsSourceUrl?: string;
|
|
8
|
+
modelId: string;
|
|
9
|
+
knownModels?: Record<string, ModelInfo>;
|
|
10
|
+
capabilities?: Llms.CatalogProviderCapability[];
|
|
11
|
+
env?: readonly string[];
|
|
12
|
+
client: Llms.ProviderClient;
|
|
13
|
+
protocol?: Llms.ProviderProtocol;
|
|
14
|
+
}
|
|
15
|
+
export interface ProviderDefaults {
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
modelId: string;
|
|
18
|
+
knownModels?: Record<string, ModelInfo>;
|
|
19
|
+
capabilities?: ProviderCapability[];
|
|
20
|
+
}
|
|
21
|
+
export declare const DEFAULT_MODELS_CATALOG_URL = "https://models.dev/api.json";
|
|
22
|
+
export declare function clearPublicModelsCatalogCache(): void;
|
|
23
|
+
export declare function getLiveModelsCatalog(options?: Pick<ModelCatalogConfig, "url" | "cacheTtlMs">): Promise<Record<string, Record<string, ModelInfo>>>;
|
|
24
|
+
export declare function clearLiveModelsCatalogCache(url?: string): void;
|
|
25
|
+
export declare function clearPrivateModelsCatalogCache(): void;
|
|
26
|
+
export declare const OPENAI_COMPATIBLE_PROVIDERS: Record<string, ProviderDefaults>;
|
|
27
|
+
export declare function getProviderConfig(providerId: string): ProviderDefaults | undefined;
|
|
28
|
+
export declare function resolveProviderConfig(providerId: string, modelCatalog?: ModelCatalogConfig, config?: ProviderConfig): Promise<ProviderDefaults | undefined>;
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import * as Llms from "@cline/llms";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type ProviderDefaults } from "./provider-defaults";
|
|
4
|
+
export type ModelInfo = Llms.ModelInfo;
|
|
5
|
+
export type ProviderClient = Llms.ProviderClient;
|
|
6
|
+
export type ProviderProtocol = Llms.ProviderProtocol;
|
|
7
|
+
export type ProviderId = Llms.ProviderId;
|
|
8
|
+
export type ProviderCapability = Llms.ProviderCapability;
|
|
9
|
+
export type ProviderConfig = Llms.ProviderConfig;
|
|
10
|
+
export type BuiltInProviderId = Llms.BuiltInProviderId;
|
|
11
|
+
export declare const BUILT_IN_PROVIDER: typeof Llms.BUILT_IN_PROVIDER;
|
|
12
|
+
export declare const BUILT_IN_PROVIDER_IDS: [Llms.BUILT_IN_PROVIDER, ...Llms.BUILT_IN_PROVIDER[]];
|
|
13
|
+
export declare const isBuiltInProviderId: typeof Llms.isBuiltInProviderId;
|
|
14
|
+
export declare const normalizeProviderId: typeof Llms.normalizeProviderId;
|
|
15
|
+
export type ProviderDefaultsConfig = ProviderDefaults;
|
|
16
|
+
export declare const ProviderIdSchema: z.ZodString;
|
|
17
|
+
export declare const ProviderProtocolSchema: z.ZodEnum<{
|
|
18
|
+
"openai-responses": "openai-responses";
|
|
19
|
+
anthropic: "anthropic";
|
|
20
|
+
gemini: "gemini";
|
|
21
|
+
"openai-chat": "openai-chat";
|
|
22
|
+
"openai-r1": "openai-r1";
|
|
23
|
+
"ai-sdk": "ai-sdk";
|
|
24
|
+
}>;
|
|
25
|
+
export declare const ProviderClientSchema: z.ZodEnum<{
|
|
26
|
+
custom: "custom";
|
|
27
|
+
anthropic: "anthropic";
|
|
28
|
+
gemini: "gemini";
|
|
29
|
+
"openai-r1": "openai-r1";
|
|
30
|
+
"ai-sdk": "ai-sdk";
|
|
31
|
+
"ai-sdk-community": "ai-sdk-community";
|
|
32
|
+
openai: "openai";
|
|
33
|
+
"openai-compatible": "openai-compatible";
|
|
34
|
+
bedrock: "bedrock";
|
|
35
|
+
fetch: "fetch";
|
|
36
|
+
vertex: "vertex";
|
|
37
|
+
}>;
|
|
38
|
+
export declare const AuthSettingsSchema: z.ZodObject<{
|
|
39
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
40
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
41
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
42
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type AuthSettings = z.infer<typeof AuthSettingsSchema>;
|
|
46
|
+
export declare const ReasoningSettingsSchema: z.ZodObject<{
|
|
47
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
low: "low";
|
|
50
|
+
high: "high";
|
|
51
|
+
medium: "medium";
|
|
52
|
+
xhigh: "xhigh";
|
|
53
|
+
none: "none";
|
|
54
|
+
}>>;
|
|
55
|
+
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type ReasoningSettings = z.infer<typeof ReasoningSettingsSchema>;
|
|
58
|
+
export declare const AwsSettingsSchema: z.ZodObject<{
|
|
59
|
+
accessKey: z.ZodOptional<z.ZodString>;
|
|
60
|
+
secretKey: z.ZodOptional<z.ZodString>;
|
|
61
|
+
sessionToken: z.ZodOptional<z.ZodString>;
|
|
62
|
+
region: z.ZodOptional<z.ZodString>;
|
|
63
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
64
|
+
authentication: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
iam: "iam";
|
|
66
|
+
"api-key": "api-key";
|
|
67
|
+
profile: "profile";
|
|
68
|
+
}>>;
|
|
69
|
+
usePromptCache: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
useCrossRegionInference: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
useGlobalInference: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
73
|
+
customModelBaseId: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type AwsSettings = z.infer<typeof AwsSettingsSchema>;
|
|
76
|
+
export declare const GcpSettingsSchema: z.ZodObject<{
|
|
77
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
78
|
+
region: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type GcpSettings = z.infer<typeof GcpSettingsSchema>;
|
|
81
|
+
export declare const AzureSettingsSchema: z.ZodObject<{
|
|
82
|
+
apiVersion: z.ZodOptional<z.ZodString>;
|
|
83
|
+
useIdentity: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
export type AzureSettings = z.infer<typeof AzureSettingsSchema>;
|
|
86
|
+
export declare const SapSettingsSchema: z.ZodObject<{
|
|
87
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
88
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
89
|
+
tokenUrl: z.ZodOptional<z.ZodString>;
|
|
90
|
+
resourceGroup: z.ZodOptional<z.ZodString>;
|
|
91
|
+
deploymentId: z.ZodOptional<z.ZodString>;
|
|
92
|
+
useOrchestrationMode: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
api: z.ZodOptional<z.ZodEnum<{
|
|
94
|
+
orchestration: "orchestration";
|
|
95
|
+
"foundation-models": "foundation-models";
|
|
96
|
+
}>>;
|
|
97
|
+
defaultSettings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
export type SapSettings = z.infer<typeof SapSettingsSchema>;
|
|
100
|
+
export declare const OcaSettingsSchema: z.ZodObject<{
|
|
101
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
102
|
+
external: "external";
|
|
103
|
+
internal: "internal";
|
|
104
|
+
}>>;
|
|
105
|
+
usePromptCache: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
export type OcaSettings = z.infer<typeof OcaSettingsSchema>;
|
|
108
|
+
export declare const ModelCatalogSettingsSchema: z.ZodObject<{
|
|
109
|
+
loadLatestOnInit: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
loadPrivateOnAuth: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
url: z.ZodOptional<z.ZodString>;
|
|
112
|
+
cacheTtlMs: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
failOnError: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
export type ModelCatalogSettings = z.infer<typeof ModelCatalogSettingsSchema>;
|
|
116
|
+
export type ModelCatalogConfig = ModelCatalogSettings;
|
|
117
|
+
export declare const ProviderSettingsSchema: z.ZodObject<{
|
|
118
|
+
provider: z.ZodString;
|
|
119
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
120
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
122
|
+
accessToken: z.ZodOptional<z.ZodString>;
|
|
123
|
+
refreshToken: z.ZodOptional<z.ZodString>;
|
|
124
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
model: z.ZodOptional<z.ZodString>;
|
|
128
|
+
protocol: z.ZodOptional<z.ZodEnum<{
|
|
129
|
+
"openai-responses": "openai-responses";
|
|
130
|
+
anthropic: "anthropic";
|
|
131
|
+
gemini: "gemini";
|
|
132
|
+
"openai-chat": "openai-chat";
|
|
133
|
+
"openai-r1": "openai-r1";
|
|
134
|
+
"ai-sdk": "ai-sdk";
|
|
135
|
+
}>>;
|
|
136
|
+
client: z.ZodOptional<z.ZodEnum<{
|
|
137
|
+
custom: "custom";
|
|
138
|
+
anthropic: "anthropic";
|
|
139
|
+
gemini: "gemini";
|
|
140
|
+
"openai-r1": "openai-r1";
|
|
141
|
+
"ai-sdk": "ai-sdk";
|
|
142
|
+
"ai-sdk-community": "ai-sdk-community";
|
|
143
|
+
openai: "openai";
|
|
144
|
+
"openai-compatible": "openai-compatible";
|
|
145
|
+
bedrock: "bedrock";
|
|
146
|
+
fetch: "fetch";
|
|
147
|
+
vertex: "vertex";
|
|
148
|
+
}>>;
|
|
149
|
+
routingProviderId: z.ZodOptional<z.ZodString>;
|
|
150
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
contextWindow: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
153
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
154
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
reasoning: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
158
|
+
low: "low";
|
|
159
|
+
high: "high";
|
|
160
|
+
medium: "medium";
|
|
161
|
+
xhigh: "xhigh";
|
|
162
|
+
none: "none";
|
|
163
|
+
}>>;
|
|
164
|
+
budgetTokens: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
aws: z.ZodOptional<z.ZodObject<{
|
|
167
|
+
accessKey: z.ZodOptional<z.ZodString>;
|
|
168
|
+
secretKey: z.ZodOptional<z.ZodString>;
|
|
169
|
+
sessionToken: z.ZodOptional<z.ZodString>;
|
|
170
|
+
region: z.ZodOptional<z.ZodString>;
|
|
171
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
172
|
+
authentication: z.ZodOptional<z.ZodEnum<{
|
|
173
|
+
iam: "iam";
|
|
174
|
+
"api-key": "api-key";
|
|
175
|
+
profile: "profile";
|
|
176
|
+
}>>;
|
|
177
|
+
usePromptCache: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
+
useCrossRegionInference: z.ZodOptional<z.ZodBoolean>;
|
|
179
|
+
useGlobalInference: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
181
|
+
customModelBaseId: z.ZodOptional<z.ZodString>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
gcp: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
185
|
+
region: z.ZodOptional<z.ZodString>;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
azure: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
apiVersion: z.ZodOptional<z.ZodString>;
|
|
189
|
+
useIdentity: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
}, z.core.$strip>>;
|
|
191
|
+
sap: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
193
|
+
clientSecret: z.ZodOptional<z.ZodString>;
|
|
194
|
+
tokenUrl: z.ZodOptional<z.ZodString>;
|
|
195
|
+
resourceGroup: z.ZodOptional<z.ZodString>;
|
|
196
|
+
deploymentId: z.ZodOptional<z.ZodString>;
|
|
197
|
+
useOrchestrationMode: z.ZodOptional<z.ZodBoolean>;
|
|
198
|
+
api: z.ZodOptional<z.ZodEnum<{
|
|
199
|
+
orchestration: "orchestration";
|
|
200
|
+
"foundation-models": "foundation-models";
|
|
201
|
+
}>>;
|
|
202
|
+
defaultSettings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
204
|
+
oca: z.ZodOptional<z.ZodObject<{
|
|
205
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
206
|
+
external: "external";
|
|
207
|
+
internal: "internal";
|
|
208
|
+
}>>;
|
|
209
|
+
usePromptCache: z.ZodOptional<z.ZodBoolean>;
|
|
210
|
+
}, z.core.$strip>>;
|
|
211
|
+
region: z.ZodOptional<z.ZodString>;
|
|
212
|
+
apiLine: z.ZodOptional<z.ZodEnum<{
|
|
213
|
+
china: "china";
|
|
214
|
+
international: "international";
|
|
215
|
+
}>>;
|
|
216
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
217
|
+
tools: "tools";
|
|
218
|
+
streaming: "streaming";
|
|
219
|
+
"prompt-cache": "prompt-cache";
|
|
220
|
+
reasoning: "reasoning";
|
|
221
|
+
"computer-use": "computer-use";
|
|
222
|
+
oauth: "oauth";
|
|
223
|
+
vision: "vision";
|
|
224
|
+
}>>>;
|
|
225
|
+
modelCatalog: z.ZodOptional<z.ZodObject<{
|
|
226
|
+
loadLatestOnInit: z.ZodOptional<z.ZodBoolean>;
|
|
227
|
+
loadPrivateOnAuth: z.ZodOptional<z.ZodBoolean>;
|
|
228
|
+
url: z.ZodOptional<z.ZodString>;
|
|
229
|
+
cacheTtlMs: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
failOnError: z.ZodOptional<z.ZodBoolean>;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export type ProviderSettings = z.infer<typeof ProviderSettingsSchema>;
|
|
234
|
+
export interface ToProviderConfigOptions {
|
|
235
|
+
includeKnownModels?: boolean;
|
|
236
|
+
}
|
|
237
|
+
export declare function parseSettings(input: unknown): ProviderSettings;
|
|
238
|
+
export declare function safeParseSettings(input: unknown): ReturnType<typeof ProviderSettingsSchema.safeParse>;
|
|
239
|
+
export declare function toProviderConfig(settings: ProviderSettings, options?: ToProviderConfigOptions): ProviderConfig;
|
|
240
|
+
export declare function createProviderConfig(input: unknown): ProviderConfig;
|
|
241
|
+
export declare function safeCreateProviderConfig(input: unknown): {
|
|
242
|
+
success: true;
|
|
243
|
+
config: ProviderConfig;
|
|
244
|
+
} | {
|
|
245
|
+
success: false;
|
|
246
|
+
error: z.ZodError;
|
|
247
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ApiHandler } from "@cline/llms";
|
|
2
|
+
import type { BuiltInProviderSummary, CreateHandlerInput, LlmsConfig, LlmsSdk, RegisterBuiltinProviderInput, RegisteredProviderSummary, RegisterModelInput, RegisterProviderInput } from "./runtime-types";
|
|
3
|
+
export declare class DefaultLlmsSdk implements LlmsSdk {
|
|
4
|
+
private readonly configuredProviders;
|
|
5
|
+
constructor(config: LlmsConfig);
|
|
6
|
+
createHandler(input: CreateHandlerInput): ApiHandler;
|
|
7
|
+
createHandlerAsync(input: CreateHandlerInput): Promise<ApiHandler>;
|
|
8
|
+
registerProvider(input: RegisterProviderInput): void;
|
|
9
|
+
registerBuiltinProvider(input: RegisterBuiltinProviderInput): void;
|
|
10
|
+
registerModel(input: RegisterModelInput): void;
|
|
11
|
+
getProviders(): RegisteredProviderSummary[];
|
|
12
|
+
getBuiltInProviderIds(): import("@cline/llms").BUILT_IN_PROVIDER[];
|
|
13
|
+
getBuiltInProviders(): Promise<BuiltInProviderSummary[]>;
|
|
14
|
+
getModels(providerId: string): string[];
|
|
15
|
+
isProviderConfigured(providerId: string): boolean;
|
|
16
|
+
isModelConfigured(providerId: string, modelId: string): boolean;
|
|
17
|
+
private applyConfig;
|
|
18
|
+
}
|
|
19
|
+
export declare function createLlmsSdk(config: LlmsConfig): LlmsSdk;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ApiHandler, BuiltInProviderId, HandlerFactory, LazyHandlerFactory, ModelCollection, ModelInfo, CatalogProviderCapability as ModelProviderCapability, ProviderClient, ProviderConfig, ProviderInfo, ProviderProtocol } from "@cline/llms";
|
|
2
|
+
import type { ProviderCapability } from "./provider-settings";
|
|
3
|
+
export type ProviderConfigDefaults = Omit<ProviderConfig, "providerId" | "modelId">;
|
|
4
|
+
export interface ProviderSelectionConfig {
|
|
5
|
+
id: string;
|
|
6
|
+
models: string[];
|
|
7
|
+
defaultModel?: string;
|
|
8
|
+
builtinProviderId?: BuiltInProviderId;
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
apiKeyEnv?: string;
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
capabilities?: ProviderCapability[];
|
|
15
|
+
settings?: ProviderConfigDefaults;
|
|
16
|
+
}
|
|
17
|
+
export interface AdditionalModelConfig {
|
|
18
|
+
providerId: string;
|
|
19
|
+
modelId: string;
|
|
20
|
+
info: ModelInfo;
|
|
21
|
+
}
|
|
22
|
+
export interface CustomProviderConfig {
|
|
23
|
+
collection: ModelCollection;
|
|
24
|
+
defaults?: ProviderConfigDefaults;
|
|
25
|
+
handlerFactory?: HandlerFactory;
|
|
26
|
+
asyncHandlerFactory?: LazyHandlerFactory;
|
|
27
|
+
}
|
|
28
|
+
export interface LlmsConfig {
|
|
29
|
+
providers: ProviderSelectionConfig[];
|
|
30
|
+
models?: AdditionalModelConfig[];
|
|
31
|
+
customProviders?: CustomProviderConfig[];
|
|
32
|
+
}
|
|
33
|
+
export interface CreateHandlerInput {
|
|
34
|
+
providerId: string;
|
|
35
|
+
modelId?: string;
|
|
36
|
+
overrides?: ProviderConfigDefaults;
|
|
37
|
+
}
|
|
38
|
+
export interface RegisteredProviderSummary {
|
|
39
|
+
id: string;
|
|
40
|
+
models: string[];
|
|
41
|
+
defaultModel: string;
|
|
42
|
+
}
|
|
43
|
+
export interface BuiltInProviderSummary extends Pick<ProviderInfo, "id" | "name" | "description" | "protocol" | "baseUrl" | "capabilities" | "env"> {
|
|
44
|
+
models: string[];
|
|
45
|
+
defaultModel: string;
|
|
46
|
+
modelCount: number;
|
|
47
|
+
}
|
|
48
|
+
export interface RegisterBuiltinProviderInput {
|
|
49
|
+
id: string;
|
|
50
|
+
builtinProviderId: BuiltInProviderId;
|
|
51
|
+
models: Record<string, ModelInfo>;
|
|
52
|
+
name?: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
protocol?: ProviderProtocol;
|
|
55
|
+
baseUrl?: string;
|
|
56
|
+
client?: ProviderClient;
|
|
57
|
+
capabilities?: ModelProviderCapability[];
|
|
58
|
+
env?: string[];
|
|
59
|
+
defaultModel?: string;
|
|
60
|
+
defaults?: ProviderConfigDefaults;
|
|
61
|
+
exposeModels?: string[];
|
|
62
|
+
}
|
|
63
|
+
export interface RegisterProviderInput extends CustomProviderConfig {
|
|
64
|
+
exposeModels?: string[];
|
|
65
|
+
defaultModel?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface RegisterModelInput {
|
|
68
|
+
providerId: string;
|
|
69
|
+
modelId: string;
|
|
70
|
+
info: ModelInfo;
|
|
71
|
+
}
|
|
72
|
+
export interface LlmsSdk {
|
|
73
|
+
createHandler(input: CreateHandlerInput): ApiHandler;
|
|
74
|
+
createHandlerAsync(input: CreateHandlerInput): Promise<ApiHandler>;
|
|
75
|
+
registerProvider(input: RegisterProviderInput): void;
|
|
76
|
+
registerBuiltinProvider(input: RegisterBuiltinProviderInput): void;
|
|
77
|
+
registerModel(input: RegisterModelInput): void;
|
|
78
|
+
getProviders(): RegisteredProviderSummary[];
|
|
79
|
+
getBuiltInProviderIds(): BuiltInProviderId[];
|
|
80
|
+
getBuiltInProviders(): Promise<BuiltInProviderSummary[]>;
|
|
81
|
+
getModels(providerId: string): string[];
|
|
82
|
+
isProviderConfigured(providerId: string): boolean;
|
|
83
|
+
isModelConfigured(providerId: string, modelId: string): boolean;
|
|
84
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AgentConfig, AgentHooks, AgentTool, ITelemetryService, ToolApprovalRequest, ToolApprovalResult, WorkspaceInfo } from "@cline/shared";
|
|
2
|
+
import type { TeamEvent } from "../extensions/tools/team";
|
|
3
|
+
import type { RuntimeCapabilities } from "../runtime/capabilities";
|
|
4
|
+
import type { LocalRuntimeStartOptions, StartSessionInput } from "../runtime/host/runtime-host";
|
|
5
|
+
import type { RuntimeBuilderInput } from "../runtime/orchestration/session-runtime";
|
|
6
|
+
import type { CoreSessionConfig } from "../types/config";
|
|
7
|
+
import { type ProviderConfig } from "../types/provider-settings";
|
|
8
|
+
import type { ProviderSettingsManager } from "./storage/provider-settings-manager";
|
|
9
|
+
export interface PrepareLocalRuntimeBootstrapOptions {
|
|
10
|
+
input: StartSessionInput;
|
|
11
|
+
localRuntime?: LocalRuntimeStartOptions;
|
|
12
|
+
sessionId: string;
|
|
13
|
+
providerSettingsManager: ProviderSettingsManager;
|
|
14
|
+
defaultTelemetry?: ITelemetryService;
|
|
15
|
+
defaultCapabilities?: RuntimeCapabilities;
|
|
16
|
+
defaultToolPolicies?: AgentConfig["toolPolicies"];
|
|
17
|
+
/**
|
|
18
|
+
* Host-level default `fetch` threaded into `ProviderConfig.fetch` so the
|
|
19
|
+
* AI gateway providers can use a custom HTTP implementation.
|
|
20
|
+
*/
|
|
21
|
+
defaultFetch?: typeof fetch;
|
|
22
|
+
onPluginEvent: (event: {
|
|
23
|
+
name: string;
|
|
24
|
+
payload?: unknown;
|
|
25
|
+
}) => void;
|
|
26
|
+
onTeamEvent: (event: TeamEvent) => void;
|
|
27
|
+
createSpawnTool: () => AgentTool;
|
|
28
|
+
readSessionMetadata: () => Promise<Record<string, unknown> | undefined>;
|
|
29
|
+
writeSessionMetadata: (metadata: Record<string, unknown>) => Promise<void> | void;
|
|
30
|
+
}
|
|
31
|
+
export interface LocalRuntimeBootstrap {
|
|
32
|
+
effectiveInput: StartSessionInput;
|
|
33
|
+
config: CoreSessionConfig;
|
|
34
|
+
providerConfig: ProviderConfig;
|
|
35
|
+
workspaceMetadata: string;
|
|
36
|
+
/** Structured git + path metadata generated alongside workspaceMetadata. */
|
|
37
|
+
workspaceInfo: WorkspaceInfo;
|
|
38
|
+
extensions: AgentConfig["extensions"];
|
|
39
|
+
hooks: AgentHooks | undefined;
|
|
40
|
+
toolPolicies: AgentConfig["toolPolicies"];
|
|
41
|
+
requestToolApproval?: (request: ToolApprovalRequest) => Promise<ToolApprovalResult> | ToolApprovalResult;
|
|
42
|
+
pluginSandboxShutdown?: () => Promise<void>;
|
|
43
|
+
runtimeBuilderInput: RuntimeBuilderInput;
|
|
44
|
+
}
|
|
45
|
+
export declare function prepareLocalRuntimeBootstrap(options: PrepareLocalRuntimeBootstrapOptions): Promise<LocalRuntimeBootstrap>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface PluginToolSummary {
|
|
2
|
+
name: string;
|
|
3
|
+
pluginName: string;
|
|
4
|
+
path: string;
|
|
5
|
+
source: "workspace-plugin" | "global-plugin";
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function listPluginTools(input: {
|
|
10
|
+
workspacePath: string;
|
|
11
|
+
cwd?: string;
|
|
12
|
+
disabledToolNames?: ReadonlyArray<string>;
|
|
13
|
+
providerId?: string;
|
|
14
|
+
modelId?: string;
|
|
15
|
+
}): Promise<PluginToolSummary[]>;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { type ProviderModel } from "@cline/shared";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { ProviderSettings, StoredProviderSettings } from "../../types/provider-settings";
|
|
4
|
+
import type { ProviderSettingsManager } from "../storage/provider-settings-manager";
|
|
5
|
+
export declare const StoredModelEntrySchema: z.ZodObject<{
|
|
6
|
+
id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
name: z.ZodOptional<z.ZodString>;
|
|
8
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
9
|
+
images: "images";
|
|
10
|
+
tools: "tools";
|
|
11
|
+
streaming: "streaming";
|
|
12
|
+
"prompt-cache": "prompt-cache";
|
|
13
|
+
reasoning: "reasoning";
|
|
14
|
+
"reasoning-effort": "reasoning-effort";
|
|
15
|
+
"computer-use": "computer-use";
|
|
16
|
+
"global-endpoint": "global-endpoint";
|
|
17
|
+
structured_output: "structured_output";
|
|
18
|
+
temperature: "temperature";
|
|
19
|
+
files: "files";
|
|
20
|
+
}>>>;
|
|
21
|
+
supportsVision: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
supportsAttachments: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
supportsReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
}, z.core.$loose>;
|
|
25
|
+
export type StoredModelEntry = z.infer<typeof StoredModelEntrySchema>;
|
|
26
|
+
export declare const StoredProviderMetadataSchema: z.ZodObject<{
|
|
27
|
+
name: z.ZodString;
|
|
28
|
+
baseUrl: z.ZodString;
|
|
29
|
+
defaultModelId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
protocol: z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
"openai-responses": "openai-responses";
|
|
32
|
+
anthropic: "anthropic";
|
|
33
|
+
gemini: "gemini";
|
|
34
|
+
"openai-chat": "openai-chat";
|
|
35
|
+
"openai-r1": "openai-r1";
|
|
36
|
+
"ai-sdk": "ai-sdk";
|
|
37
|
+
}>>;
|
|
38
|
+
client: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
custom: "custom";
|
|
40
|
+
anthropic: "anthropic";
|
|
41
|
+
gemini: "gemini";
|
|
42
|
+
"openai-r1": "openai-r1";
|
|
43
|
+
"ai-sdk": "ai-sdk";
|
|
44
|
+
"ai-sdk-community": "ai-sdk-community";
|
|
45
|
+
openai: "openai";
|
|
46
|
+
"openai-compatible": "openai-compatible";
|
|
47
|
+
bedrock: "bedrock";
|
|
48
|
+
fetch: "fetch";
|
|
49
|
+
vertex: "vertex";
|
|
50
|
+
}>>;
|
|
51
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
52
|
+
tools: "tools";
|
|
53
|
+
streaming: "streaming";
|
|
54
|
+
"prompt-cache": "prompt-cache";
|
|
55
|
+
reasoning: "reasoning";
|
|
56
|
+
"computer-use": "computer-use";
|
|
57
|
+
temperature: "temperature";
|
|
58
|
+
files: "files";
|
|
59
|
+
"provider-tools": "provider-tools";
|
|
60
|
+
oauth: "oauth";
|
|
61
|
+
vision: "vision";
|
|
62
|
+
"local-auth": "local-auth";
|
|
63
|
+
}>>>;
|
|
64
|
+
modelsSourceUrl: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$loose>;
|
|
66
|
+
export declare const StoredProviderEntrySchema: z.ZodObject<{
|
|
67
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
baseUrl: z.ZodString;
|
|
70
|
+
defaultModelId: z.ZodOptional<z.ZodString>;
|
|
71
|
+
protocol: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
"openai-responses": "openai-responses";
|
|
73
|
+
anthropic: "anthropic";
|
|
74
|
+
gemini: "gemini";
|
|
75
|
+
"openai-chat": "openai-chat";
|
|
76
|
+
"openai-r1": "openai-r1";
|
|
77
|
+
"ai-sdk": "ai-sdk";
|
|
78
|
+
}>>;
|
|
79
|
+
client: z.ZodOptional<z.ZodEnum<{
|
|
80
|
+
custom: "custom";
|
|
81
|
+
anthropic: "anthropic";
|
|
82
|
+
gemini: "gemini";
|
|
83
|
+
"openai-r1": "openai-r1";
|
|
84
|
+
"ai-sdk": "ai-sdk";
|
|
85
|
+
"ai-sdk-community": "ai-sdk-community";
|
|
86
|
+
openai: "openai";
|
|
87
|
+
"openai-compatible": "openai-compatible";
|
|
88
|
+
bedrock: "bedrock";
|
|
89
|
+
fetch: "fetch";
|
|
90
|
+
vertex: "vertex";
|
|
91
|
+
}>>;
|
|
92
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
93
|
+
tools: "tools";
|
|
94
|
+
streaming: "streaming";
|
|
95
|
+
"prompt-cache": "prompt-cache";
|
|
96
|
+
reasoning: "reasoning";
|
|
97
|
+
"computer-use": "computer-use";
|
|
98
|
+
temperature: "temperature";
|
|
99
|
+
files: "files";
|
|
100
|
+
"provider-tools": "provider-tools";
|
|
101
|
+
oauth: "oauth";
|
|
102
|
+
vision: "vision";
|
|
103
|
+
"local-auth": "local-auth";
|
|
104
|
+
}>>>;
|
|
105
|
+
modelsSourceUrl: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$loose>>;
|
|
107
|
+
models: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
108
|
+
id: z.ZodOptional<z.ZodString>;
|
|
109
|
+
name: z.ZodOptional<z.ZodString>;
|
|
110
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
111
|
+
images: "images";
|
|
112
|
+
tools: "tools";
|
|
113
|
+
streaming: "streaming";
|
|
114
|
+
"prompt-cache": "prompt-cache";
|
|
115
|
+
reasoning: "reasoning";
|
|
116
|
+
"reasoning-effort": "reasoning-effort";
|
|
117
|
+
"computer-use": "computer-use";
|
|
118
|
+
"global-endpoint": "global-endpoint";
|
|
119
|
+
structured_output: "structured_output";
|
|
120
|
+
temperature: "temperature";
|
|
121
|
+
files: "files";
|
|
122
|
+
}>>>;
|
|
123
|
+
supportsVision: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
supportsAttachments: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
supportsReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
}, z.core.$loose>>>;
|
|
127
|
+
}, z.core.$loose>;
|
|
128
|
+
export type StoredProviderEntry = z.infer<typeof StoredProviderEntrySchema>;
|
|
129
|
+
export declare const StoredModelsFileSchema: z.ZodObject<{
|
|
130
|
+
version: z.ZodLiteral<1>;
|
|
131
|
+
providers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
132
|
+
provider: z.ZodOptional<z.ZodObject<{
|
|
133
|
+
name: z.ZodString;
|
|
134
|
+
baseUrl: z.ZodString;
|
|
135
|
+
defaultModelId: z.ZodOptional<z.ZodString>;
|
|
136
|
+
protocol: z.ZodOptional<z.ZodEnum<{
|
|
137
|
+
"openai-responses": "openai-responses";
|
|
138
|
+
anthropic: "anthropic";
|
|
139
|
+
gemini: "gemini";
|
|
140
|
+
"openai-chat": "openai-chat";
|
|
141
|
+
"openai-r1": "openai-r1";
|
|
142
|
+
"ai-sdk": "ai-sdk";
|
|
143
|
+
}>>;
|
|
144
|
+
client: z.ZodOptional<z.ZodEnum<{
|
|
145
|
+
custom: "custom";
|
|
146
|
+
anthropic: "anthropic";
|
|
147
|
+
gemini: "gemini";
|
|
148
|
+
"openai-r1": "openai-r1";
|
|
149
|
+
"ai-sdk": "ai-sdk";
|
|
150
|
+
"ai-sdk-community": "ai-sdk-community";
|
|
151
|
+
openai: "openai";
|
|
152
|
+
"openai-compatible": "openai-compatible";
|
|
153
|
+
bedrock: "bedrock";
|
|
154
|
+
fetch: "fetch";
|
|
155
|
+
vertex: "vertex";
|
|
156
|
+
}>>;
|
|
157
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
158
|
+
tools: "tools";
|
|
159
|
+
streaming: "streaming";
|
|
160
|
+
"prompt-cache": "prompt-cache";
|
|
161
|
+
reasoning: "reasoning";
|
|
162
|
+
"computer-use": "computer-use";
|
|
163
|
+
temperature: "temperature";
|
|
164
|
+
files: "files";
|
|
165
|
+
"provider-tools": "provider-tools";
|
|
166
|
+
oauth: "oauth";
|
|
167
|
+
vision: "vision";
|
|
168
|
+
"local-auth": "local-auth";
|
|
169
|
+
}>>>;
|
|
170
|
+
modelsSourceUrl: z.ZodOptional<z.ZodString>;
|
|
171
|
+
}, z.core.$loose>>;
|
|
172
|
+
models: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
173
|
+
id: z.ZodOptional<z.ZodString>;
|
|
174
|
+
name: z.ZodOptional<z.ZodString>;
|
|
175
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
176
|
+
images: "images";
|
|
177
|
+
tools: "tools";
|
|
178
|
+
streaming: "streaming";
|
|
179
|
+
"prompt-cache": "prompt-cache";
|
|
180
|
+
reasoning: "reasoning";
|
|
181
|
+
"reasoning-effort": "reasoning-effort";
|
|
182
|
+
"computer-use": "computer-use";
|
|
183
|
+
"global-endpoint": "global-endpoint";
|
|
184
|
+
structured_output: "structured_output";
|
|
185
|
+
temperature: "temperature";
|
|
186
|
+
files: "files";
|
|
187
|
+
}>>>;
|
|
188
|
+
supportsVision: z.ZodOptional<z.ZodBoolean>;
|
|
189
|
+
supportsAttachments: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
supportsReasoning: z.ZodOptional<z.ZodBoolean>;
|
|
191
|
+
}, z.core.$loose>>>;
|
|
192
|
+
}, z.core.$loose>>;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
export type StoredModelsFile = z.infer<typeof StoredModelsFileSchema>;
|
|
195
|
+
export declare function resolveModelsRegistryPath(manager: ProviderSettingsManager): string;
|
|
196
|
+
export declare function emptyModelsFile(): StoredModelsFile;
|
|
197
|
+
export declare function parseModelsFile(input: unknown): StoredModelsFile;
|
|
198
|
+
export declare function readModelsFileSync(filePath: string): StoredModelsFile;
|
|
199
|
+
export declare function readModelsFile(filePath: string): Promise<StoredModelsFile>;
|
|
200
|
+
export declare function writeModelsFileSync(filePath: string, state: StoredModelsFile): void;
|
|
201
|
+
export declare function writeModelsFile(filePath: string, state: StoredModelsFile): Promise<void>;
|
|
202
|
+
export declare function toProviderModel(modelId: string, info: {
|
|
203
|
+
name?: string;
|
|
204
|
+
capabilities?: string[];
|
|
205
|
+
thinkingConfig?: unknown;
|
|
206
|
+
}): ProviderModel;
|
|
207
|
+
export declare function registerProviderSettingsProvider(settings: ProviderSettings): void;
|
|
208
|
+
export declare function registerConfiguredProvidersFromSettings(state: StoredProviderSettings): void;
|
|
209
|
+
/**
|
|
210
|
+
* Custom Provider Registry
|
|
211
|
+
*
|
|
212
|
+
* This module manages the registration of custom OpenAI-compatible providers and
|
|
213
|
+
* their models based on local JSON files. It provides functions to read/write the models
|
|
214
|
+
* registry file and to register providers with the LlmsModels system.
|
|
215
|
+
*/
|
|
216
|
+
export declare function registerCustomProvider(providerId: string, entry: StoredProviderEntry): void;
|
|
217
|
+
export declare function ensureCustomProvidersLoadedSync(manager: ProviderSettingsManager): void;
|
|
218
|
+
export declare function ensureCustomProvidersLoaded(manager: ProviderSettingsManager): Promise<void>;
|