repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/controller/web/fetchOpenGraphData.ts | src/core/controller/web/fetchOpenGraphData.ts | import { StringRequest } from "@shared/proto/cline/common"
import { OpenGraphData } from "@shared/proto/cline/web"
import { fetchOpenGraphData as fetchOGData } from "../../../integrations/misc/link-preview"
import { convertDomainOpenGraphDataToProto } from "../../../shared/proto-conversions/web/open-graph-conversion"
i... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/controller/web/openInBrowser.ts | src/core/controller/web/openInBrowser.ts | import { Empty, StringRequest } from "@shared/proto/cline/common"
import { openExternal } from "@utils/env"
import { Controller } from ".."
/**
* Opens a URL in the user's default browser
* @param controller The controller instance
* @param request The URL to open
* @returns Empty response since the client doesn't... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/controller/web/checkIsImageUrl.ts | src/core/controller/web/checkIsImageUrl.ts | import { detectImageUrl } from "@integrations/misc/link-preview"
import { StringRequest } from "@shared/proto/cline/common"
import { IsImageUrl } from "@shared/proto/cline/web"
import { Controller } from "../index"
/**
* Checks if a URL is an image URL
* @param controller The controller instance
* @param request Th... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/storage/error-messages.ts | src/core/storage/error-messages.ts | export const STATE_MANAGER_NOT_INITIALIZED = "StateManager must be initialized before attempting to access state."
| typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/storage/StateManager.ts | src/core/storage/StateManager.ts | import { ApiConfiguration, ModelInfo } from "@shared/api"
import {
GlobalState,
GlobalStateAndSettings,
GlobalStateAndSettingsKey,
GlobalStateKey,
LocalState,
LocalStateKey,
RemoteConfigFields,
SecretKey,
Secrets,
Settings,
SettingsKey,
} from "@shared/storage/state-keys"
import chokidar, { FSWatcher } from ... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | true |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/storage/disk.ts | src/core/storage/disk.ts | import { Anthropic } from "@anthropic-ai/sdk"
import { EnvironmentMetadataEntry, TaskMetadata } from "@core/context/context-tracking/ContextTrackerTypes"
import { execa } from "@packages/execa"
import { ClineMessage } from "@shared/ExtensionMessage"
import { HistoryItem } from "@shared/HistoryItem"
import { RemoteConfi... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/storage/state-migrations.ts | src/core/storage/state-migrations.ts | import fs from "fs/promises"
import path from "path"
import * as vscode from "vscode"
import { HistoryItem } from "@/shared/HistoryItem"
import { ensureRulesDirectoryExists, readTaskHistoryFromState, writeTaskHistoryToState } from "./disk"
export async function migrateWorkspaceToGlobalStorage(context: vscode.Extension... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/storage/utils/state-helpers.ts | src/core/storage/utils/state-helpers.ts | import { ANTHROPIC_MIN_THINKING_BUDGET, ApiProvider, fireworksDefaultModelId, type OcaModelInfo } from "@shared/api"
import { GlobalStateAndSettings, LocalState, SecretKey, Secrets } from "@shared/storage/state-keys"
import { ExtensionContext } from "vscode"
import { Controller } from "@/core/controller"
import { getHo... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | true |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/storage/__tests__/disk.test.ts | src/core/storage/__tests__/disk.test.ts | import { afterEach, beforeEach, describe, it } from "mocha"
import "should"
import { HistoryItem } from "@shared/HistoryItem"
import * as fsUtils from "@utils/fs"
import fs from "fs/promises"
import os from "os"
import path from "path"
import sinon from "sinon"
import { HostProvider } from "@/hosts/host-provider"
impor... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/storage/remote-config/utils.ts | src/core/storage/remote-config/utils.ts | import { synchronizeRemoteRuleToggles } from "@core/context/instructions/user-instructions/rule-helpers"
import { RemoteConfig } from "@shared/remote-config/schema"
import { RemoteConfigFields } from "@shared/storage/state-keys"
import { getTelemetryService } from "@/services/telemetry"
import { OpenTelemetryClientProv... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/storage/remote-config/fetch.ts | src/core/storage/remote-config/fetch.ts | import axios, { AxiosRequestConfig, AxiosResponse } from "axios"
import { Controller } from "@/core/controller"
import { getAxiosSettings } from "@/shared/net"
import { ClineEnv } from "../../../config"
import { AuthService } from "../../../services/auth/AuthService"
import { CLINE_API_ENDPOINT } from "../../../shared/... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/assistant-message/diff_edge_cases2.test.ts | src/core/assistant-message/diff_edge_cases2.test.ts | // import { constructNewFileContent as cnfc } from "./diff"
// import { describe, it } from "mocha"
// import { expect } from "chai"
// async function cnfc2(diffContent: string, originalContent: string, isFinal: boolean): Promise<string> {
// return cnfc(diffContent, originalContent, isFinal, "v2")
// }
// describe(... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/assistant-message/diff_edge_cases.test.ts | src/core/assistant-message/diff_edge_cases.test.ts | import { expect } from "chai"
import { describe, it } from "mocha"
import { constructNewFileContent as cnfc } from "./diff"
async function cnfc2(diffContent: string, originalContent: string, isFinal: boolean): Promise<string> {
return cnfc(diffContent, originalContent, isFinal, "v2")
}
describe("Diff Format Edge Cas... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/assistant-message/diff.ts | src/core/assistant-message/diff.ts | const SEARCH_BLOCK_START = "------- SEARCH"
const SEARCH_BLOCK_END = "======="
const REPLACE_BLOCK_END = "+++++++ REPLACE"
const SEARCH_BLOCK_CHAR = "-"
const REPLACE_BLOCK_CHAR = "+"
const LEGACY_SEARCH_BLOCK_CHAR = "<"
const LEGACY_REPLACE_BLOCK_CHAR = ">"
// Replace the exact string constants with flexible regex p... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/assistant-message/index.ts | src/core/assistant-message/index.ts | import { ClineDefaultTool } from "@shared/tools"
export type AssistantMessageContent = TextStreamContent | ToolUse | ReasoningStreamContent
export { parseAssistantMessageV2 } from "./parse-assistant-message"
export interface TextStreamContent {
type: "text"
content: string
partial: boolean
}
export const toolPar... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/assistant-message/parse-assistant-message.ts | src/core/assistant-message/parse-assistant-message.ts | import { ClineDefaultTool, toolUseNames } from "@shared/tools"
import { AssistantMessageContent, TextStreamContent, ToolParamName, ToolUse, toolParamNames } from "." // Assuming types are defined in index.ts or a similar file
// parseAssistantmessageV1 removed in https://github.com/cline/cline/pull/5425
/**
* @descr... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/assistant-message/diff.test.ts | src/core/assistant-message/diff.test.ts | import { expect } from "chai"
import { describe, it } from "mocha"
import { constructNewFileContent as cnfc } from "./diff"
async function cnfc2(diffContent: string, originalContent: string, isFinal: boolean): Promise<string> {
return cnfc(diffContent, originalContent, isFinal, "v2")
}
describe("constructNewFileCont... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/mentions/index.test.ts | src/core/mentions/index.test.ts | import { FileContextTracker } from "@core/context/context-tracking/FileContextTracker"
import * as extractTextModule from "@integrations/misc/extract-text"
import { UrlContentFetcher } from "@services/browser/UrlContentFetcher"
import * as gitModule from "@utils/git"
import { expect } from "chai"
import * as fs from "f... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/mentions/index.ts | src/core/mentions/index.ts | import { diagnosticsToProblemsString } from "@integrations/diagnostics"
import { extractTextFromFile } from "@integrations/misc/extract-text"
import { openFile } from "@integrations/misc/open-file"
import { UrlContentFetcher } from "@services/browser/UrlContentFetcher"
import { telemetryService } from "@services/teleme... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/commands/reconstructTaskHistory.ts | src/core/commands/reconstructTaskHistory.ts | import { getSavedClineMessages, getTaskMetadata, readTaskHistoryFromState, writeTaskHistoryToState } from "@core/storage/disk"
import { HostProvider } from "@hosts/host-provider"
import { ClineMessage } from "@shared/ExtensionMessage"
import { HistoryItem } from "@shared/HistoryItem"
import { ShowMessageType } from "@s... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/locks/SqliteLockManager.ts | src/core/locks/SqliteLockManager.ts | import Database from "better-sqlite3"
import * as fs from "fs"
import { existsSync, mkdirSync, unlinkSync } from "fs"
import * as path from "path"
import type { LockRow, SqliteLockManagerOptions } from "./types"
export class SqliteLockManager {
private db!: Database.Database
private instanceAddress: string
private d... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/locks/types.ts | src/core/locks/types.ts | export type LockType = "file" | "instance" | "folder"
export interface LockRow {
id: number
held_by: string
lock_type: LockType
lock_target: string // varies by type: file path, host address, or folder path
locked_at: number
}
export interface SqliteLockManagerOptions {
dbPath: string
instanceAddress: string /... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/locks/FolderLockUtils.ts | src/core/locks/FolderLockUtils.ts | import type { SqliteLockManager } from "./SqliteLockManager"
import type { FolderLockOptions, FolderLockResult, FolderLockWithRetryResult } from "./types"
/**
* Retry configuration for folder lock acquisition
*/
export interface FolderLockRetryConfig {
initialDelayMs: number
incrementPerAttemptMs: number
maxTotal... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/multi-root-utils.ts | src/core/workspace/multi-root-utils.ts | import type { StateManager } from "../storage/StateManager"
/**
* Determines if multi-root workspace mode should be enabled.
*
* Multi-root is enabled when the user has opted in via their settings.
*
* @param stateManager - The state manager to check user preferences
* @returns true if user setting is enabled
*... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/WorkspacePathAdapter.ts | src/core/workspace/WorkspacePathAdapter.ts | /**
* WorkspacePathAdapter - Utility for resolving paths in single or multi-workspace environments
*
* This adapter provides a unified interface for path resolution that works with both
* single-root (legacy) and multi-root workspace configurations. It encapsulates the
* logic for determining which workspace a pat... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/WorkspaceRootManager.ts | src/core/workspace/WorkspaceRootManager.ts | /**
* WorkspaceRootManager - Central manager for multi-workspace operations
* This class handles workspace root resolution, path mapping, and workspace context
*/
import { VcsType, WorkspaceRoot } from "@shared/multi-root/types"
import { execa } from "execa"
import * as path from "path"
import { getGitRemoteUrls, g... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/setup.ts | src/core/workspace/setup.ts | import type { WorkspaceRoot } from "@shared/multi-root/types"
import { HostProvider } from "@/hosts/host-provider"
import { telemetryService } from "@/services/telemetry"
import type { HistoryItem } from "@/shared/HistoryItem"
import { ShowMessageType } from "@/shared/proto/host/window"
import { getCwd, getDesktopDir }... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/MigrationReporter.ts | src/core/workspace/MigrationReporter.ts | /**
* Handles formatting and presentation of workspace migration reports
*
* Separated from WorkspaceResolver to follow Single Responsibility Principle.
* This class focuses purely on report generation and formatting.
*/
/**
* Tracks path resolution usage for migration planning
*/
export interface UsageStats {
... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/WorkspaceResolver.ts | src/core/workspace/WorkspaceResolver.ts | /**
* Workspace path resolution with migration tracing for multi-workspace support
*
* Phase 0: Acts as a tracer to identify all single-root path operations
* Phase 1+: Will handle multi-root path resolution
*/
import { WorkspaceRoot } from "@shared/multi-root/types"
import * as path from "path"
import { Migratio... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/index.ts | src/core/workspace/index.ts | /**
* Workspace module exports for multi-workspace support
*/
// Export workspace path parsing utilities
export type { ParsedWorkspacePath } from "./utils/parseWorkspaceInlinePath"
export {
addWorkspaceHint,
hasWorkspaceHint,
parseMultipleWorkspacePaths,
parseWorkspaceInlinePath,
removeWorkspaceHint,
} from "./... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/detection.ts | src/core/workspace/detection.ts | import { VcsType, WorkspaceRoot } from "@shared/multi-root/types"
import * as path from "path"
import { HostProvider } from "@/hosts/host-provider"
import { getLatestGitCommitHash, isGitRepository } from "@/utils/git"
import { getCwd, getDesktopDir } from "@/utils/path"
/**
* Detect the VCS type for a given directory... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/utils/workspace-detection.ts | src/core/workspace/utils/workspace-detection.ts | import { HostProvider } from "@/hosts/host-provider"
import { EmptyRequest } from "@/shared/proto/cline/common"
/**
* Checks if the current workspace has multiple root folders open.
* This is a lightweight check that only counts workspace folders,
* independent of feature flags or internal multi-root implementation... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/utils/parseWorkspaceInlinePath.ts | src/core/workspace/utils/parseWorkspaceInlinePath.ts | /**
* parseWorkspaceInlinePath - Utility for parsing workspace-prefixed paths
*
* This utility extracts workspace hints from paths using the @workspace:path syntax.
* This allows tools to target specific workspaces in multi-root environments.
*
* Examples:
* "@frontend:src/index.ts" -> { workspaceHint: "fronte... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/__tests__/setup.test.ts | src/core/workspace/__tests__/setup.test.ts | import type { WorkspaceRoot } from "@shared/multi-root/types"
import { VcsType } from "@shared/multi-root/types"
import { expect } from "chai"
import * as path from "path"
import sinon from "sinon"
import { HostProvider } from "@/hosts/host-provider"
import * as telemetry from "@/services/telemetry"
import * as pathUti... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/__tests__/WorkspaceResolver.test.ts | src/core/workspace/__tests__/WorkspaceResolver.test.ts | /**
* Unit tests for WorkspaceResolver
* These tests ensure behavior preservation during refactoring
*/
import { VcsType, WorkspaceRoot } from "@shared/multi-root/types"
import { expect } from "chai"
import { afterEach, beforeEach, describe, it } from "mocha"
import * as path from "path"
import * as sinon from "sin... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/__tests__/WorkspacePathAdapter.test.ts | src/core/workspace/__tests__/WorkspacePathAdapter.test.ts | /**
* Unit tests for WorkspacePathAdapter
* Tests the core functionality of path resolution in single and multi-root workspaces
*/
import { VcsType, WorkspaceRoot } from "@shared/multi-root/types"
import { expect } from "chai"
import { afterEach, beforeEach, describe, it } from "mocha"
import * as path from "path"
... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/workspace/__tests__/parseWorkspaceInlinePath.test.ts | src/core/workspace/__tests__/parseWorkspaceInlinePath.test.ts | import { expect } from "chai"
import { describe, it } from "mocha"
import {
addWorkspaceHint,
hasWorkspaceHint,
parseMultipleWorkspacePaths,
parseWorkspaceInlinePath,
removeWorkspaceHint,
} from "../../../core/workspace/utils/parseWorkspaceInlinePath"
describe("parseWorkspaceInlinePath", () => {
describe("basic ... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/templates.ts | src/core/hooks/templates.ts | /**
* Hook script templates for all supported hook types.
* Templates are provided as executable Bash shell scripts with comprehensive examples.
* Scripts use jq for JSON parsing when available, with fallback to basic parsing.
*/
export function getHookTemplate(hookName: string): string {
const templates: Record<... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/utils.ts | src/core/hooks/utils.ts | import os from "os"
import path from "path"
import { HostProvider } from "@/hosts/host-provider"
import { getCwd, getDesktopDir } from "@/utils/path"
/**
* All valid hook types that can be created and executed by Cline.
* These hooks correspond to specific lifecycle events in the task execution process.
*/
export c... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/HookProcessRegistry.ts | src/core/hooks/HookProcessRegistry.ts | import { HookProcess } from "./HookProcess"
/**
* Global registry for tracking active hook processes.
*
* Purpose:
* - Prevents zombie processes by tracking all running hooks
* - Enables cleanup on extension deactivation
* - Provides visibility into active hook executions
*
* Usage:
* - HookProcess automatica... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/PreToolUseHookCancellationError.ts | src/core/hooks/PreToolUseHookCancellationError.ts | /**
* Error thrown when a PreToolUse hook requests cancellation.
* This signals to the tool handler that execution should be aborted.
*/
export class PreToolUseHookCancellationError extends Error {
constructor(message: string = "PreToolUse hook requested cancellation") {
super(message)
this.name = "PreToolUseHo... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/hook-factory.ts | src/core/hooks/hook-factory.ts | import fs from "fs/promises"
import path from "path"
import { version as clineVersion } from "../../../package.json"
import { getDistinctId } from "../../services/logging/distinctId"
import { telemetryService } from "../../services/telemetry"
import {
HookInput,
HookOutput,
PostToolUseData,
PreCompactData,
PreTool... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/HookProcess.ts | src/core/hooks/HookProcess.ts | import { ChildProcess, spawn } from "child_process"
import { EventEmitter } from "events"
import { HookProcessRegistry } from "./HookProcessRegistry"
import { escapeShellPath } from "./shell-escape"
// Maximum total output size (stdout + stderr combined)
const MAX_HOOK_OUTPUT_SIZE = 1024 * 1024 // 1MB
/**
* HookProc... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/shell-escape.ts | src/core/hooks/shell-escape.ts | /**
* Platform-specific shell escaping utilities for hook script paths.
* Ensures paths with spaces and special characters work correctly when
* executed through a shell (shell: true in spawn).
*/
/**
* Escapes a path for safe use in a Windows shell command.
* Handles spaces, quotes, and other special characters... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/hook-executor.ts | src/core/hooks/hook-executor.ts | import { ClineMessage } from "@shared/ExtensionMessage"
import { MessageStateHandler } from "../task/message-state"
import { HookExecutionError } from "./HookError"
import { HookFactory } from "./hook-factory"
export interface HookExecutionOptions<Name extends keyof Hooks = any> {
hookName: Name
hookInput: Hooks[Nam... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/precompact-executor.ts | src/core/hooks/precompact-executor.ts | import { findLastIndex } from "@shared/array"
import type { ClineMessage } from "@shared/ExtensionMessage"
import type { ClineStorageMessage } from "@shared/messages/content"
import type { ContextManager } from "../context/context-management/ContextManager"
import type { MessageStateHandler } from "../task/message-stat... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/HookError.ts | src/core/hooks/HookError.ts | /**
* Types of errors that can occur during hook execution
*/
export enum HookErrorType {
/** Hook execution exceeded the timeout limit */
TIMEOUT = "timeout",
/** Hook output failed JSON validation */
VALIDATION = "validation",
/** Hook script execution failed (non-zero exit, crash, etc.) */
EXECUTION = "execu... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/HookDiscoveryCache.ts | src/core/hooks/HookDiscoveryCache.ts | import { telemetryService } from "../../services/telemetry"
import { getAllHooksDirs } from "../storage/disk"
import { HookFactory, Hooks } from "./hook-factory"
type HookName = keyof Hooks
/**
* Cached hook discovery results
*/
interface HookCacheEntry {
scriptPaths: string[] // Paths to hook scripts for this hoo... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/hooks-utils.ts | src/core/hooks/hooks-utils.ts | /**
* Determines if hooks are safely enabled based on platform support.
*
* Hooks are not yet supported on Windows, so this function ensures they
* remain disabled on that platform regardless of user settings.
*
* @param userSetting The user's hooks enabled setting from global state (may be undefined)
* @returns... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/user-prompt-submit.test.ts | src/core/hooks/__tests__/user-prompt-submit.test.ts | import { afterEach, beforeEach, describe, it } from "mocha"
import "should"
import fs from "fs/promises"
import os from "os"
import path from "path"
import sinon from "sinon"
import { StateManager } from "../../storage/StateManager"
import { HookFactory } from "../hook-factory"
describe("UserPromptSubmit Hook", () => ... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/taskresume.test.ts | src/core/hooks/__tests__/taskresume.test.ts | import { afterEach, beforeEach, describe, it } from "mocha"
import "should"
import fs from "fs/promises"
import os from "os"
import path from "path"
import sinon from "sinon"
import { StateManager } from "../../storage/StateManager"
import { HookFactory } from "../hook-factory"
describe("TaskResume Hook", () => {
// ... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/shell-escape.test.ts | src/core/hooks/__tests__/shell-escape.test.ts | import { describe, it } from "mocha"
import "should"
import { escapeShellPath } from "../shell-escape"
describe("Shell Path Escaping", () => {
const originalPlatform = process.platform
// Helper to temporarily set platform
const setPlatform = (platform: NodeJS.Platform) => {
Object.defineProperty(process, "platf... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/hook-factory.test.ts | src/core/hooks/__tests__/hook-factory.test.ts | import { afterEach, beforeEach, describe, it } from "mocha"
import "should"
import fs from "fs/promises"
import os from "os"
import path from "path"
import sinon from "sinon"
import { setDistinctId } from "@/services/logging/distinctId"
import { StateManager } from "../../storage/StateManager"
import { HookFactory } fr... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/setup.ts | src/core/hooks/__tests__/setup.ts | import * as fs from "fs/promises"
import * as os from "os"
import * as path from "path"
import sinon from "sinon"
import { StateManager } from "../../storage/StateManager"
import { createHooksDirectory } from "./test-utils"
/**
* Test environment containing temp directories and cleanup functions.
*/
export interface... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/test-utils.ts | src/core/hooks/__tests__/test-utils.ts | import * as fs from "fs/promises"
import * as path from "path"
import should from "should"
import { HookOutput } from "../../../shared/proto/cline/hooks"
import { Hooks, NamedHookInput } from "../hook-factory"
// Define HookName locally since it's not exported from hook-factory
type HookName = keyof Hooks
/**
* Crea... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/taskcomplete.test.ts | src/core/hooks/__tests__/taskcomplete.test.ts | import { afterEach, beforeEach, describe, it } from "mocha"
import "should"
import fs from "fs/promises"
import os from "os"
import path from "path"
import sinon from "sinon"
import { StateManager } from "../../storage/StateManager"
import { HookFactory } from "../hook-factory"
import { loadFixture } from "./test-utils... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/taskstart.test.ts | src/core/hooks/__tests__/taskstart.test.ts | import { afterEach, beforeEach, describe, it } from "mocha"
import "should"
import fs from "fs/promises"
import os from "os"
import path from "path"
import sinon from "sinon"
import { StateManager } from "../../storage/StateManager"
import { HookFactory } from "../hook-factory"
import { loadFixture } from "./test-utils... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/hooks-utils.test.ts | src/core/hooks/__tests__/hooks-utils.test.ts | import { afterEach, beforeEach, describe, it } from "mocha"
import "should"
import sinon from "sinon"
import { getHooksEnabledSafe } from "../hooks-utils"
describe("hooks-utils", () => {
let sandbox: sinon.SinonSandbox
let originalPlatform: string
beforeEach(() => {
sandbox = sinon.createSandbox()
originalPlat... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/hooks/__tests__/taskcancel.test.ts | src/core/hooks/__tests__/taskcancel.test.ts | import { afterEach, beforeEach, describe, it } from "mocha"
import "should"
import fs from "fs/promises"
import os from "os"
import path from "path"
import sinon from "sinon"
import { StateManager } from "../../storage/StateManager"
import { HookFactory } from "../hook-factory"
import { loadFixture } from "./test-utils... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/slash-commands/index.ts | src/core/slash-commands/index.ts | import type { ApiProviderInfo } from "@core/api"
import { ClineRulesToggles } from "@shared/cline-rules"
import fs from "fs/promises"
import { telemetryService } from "@/services/telemetry"
import { isNativeToolCallingConfig } from "@/utils/model-utils"
import {
condenseToolResponse,
deepPlanningToolResponse,
explai... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/ignore/ClineIgnoreController.ts | src/core/ignore/ClineIgnoreController.ts | import { fileExistsAtPath } from "@utils/fs"
import chokidar, { FSWatcher } from "chokidar"
import fs from "fs/promises"
import ignore, { Ignore } from "ignore"
import path from "path"
export const LOCK_TEXT_SYMBOL = "\u{1F512}"
/**
* Controls LLM access to files by enforcing ignore patterns.
* Designed to be insta... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/ignore/ClineIgnoreController.test.ts | src/core/ignore/ClineIgnoreController.test.ts | import fs from "fs/promises"
import { after, beforeEach, describe, it } from "mocha"
import os from "os"
import path from "path"
import { ClineIgnoreController } from "./ClineIgnoreController"
import "should"
describe("ClineIgnoreController", () => {
let tempDir: string
let controller: ClineIgnoreController
before... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/retry.ts | src/core/api/retry.ts | interface RetryOptions {
maxRetries?: number
baseDelay?: number
maxDelay?: number
retryAllErrors?: boolean
}
const DEFAULT_OPTIONS: Required<RetryOptions> = {
maxRetries: 3,
baseDelay: 1_000,
maxDelay: 10_000,
retryAllErrors: false,
}
export class RetriableError extends Error {
status: number = 429
retryAft... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/retry.test.ts | src/core/api/retry.test.ts | import { describe, it } from "mocha"
import "should"
import sinon from "sinon"
import { withRetry } from "./retry"
describe("Retry Decorator", () => {
afterEach(() => {
sinon.restore()
})
describe("withRetry", () => {
it("should not retry on success", async () => {
let callCount = 0
class TestClass {
... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/index.ts | src/core/api/index.ts | import { ApiConfiguration, ModelInfo, QwenApiRegions } from "@shared/api"
import { Mode } from "@shared/storage/types"
import { ClineStorageMessage } from "@/shared/messages/content"
import { ClineTool } from "@/shared/tools"
import { AIhubmixHandler } from "./providers/aihubmix"
import { AnthropicHandler } from "./pro... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/anthropic.ts | src/core/api/providers/anthropic.ts | import { Anthropic } from "@anthropic-ai/sdk"
import { Tool as AnthropicTool } from "@anthropic-ai/sdk/resources/index"
import { Stream as AnthropicStream } from "@anthropic-ai/sdk/streaming"
import { AnthropicModelId, anthropicDefaultModelId, anthropicModels, CLAUDE_SONNET_1M_SUFFIX, ModelInfo } from "@shared/api"
imp... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/ollama.ts | src/core/api/providers/ollama.ts | import { type ModelInfo, openAiModelInfoSaneDefaults } from "@shared/api"
import { type Config, type Message, Ollama } from "ollama"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import type { ApiHandler, CommonApiHandlerOptions } from "../"
import { withRetry } fr... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/fireworks.ts | src/core/api/providers/fireworks.ts | import { FireworksModelId, fireworksDefaultModelId, fireworksModels, ModelInfo } from "@shared/api"
import OpenAI from "openai"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import { ApiHandler, CommonApiHandlerOptions } from ".."
import { withRetry } from "../retr... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/zai.ts | src/core/api/providers/zai.ts | import {
internationalZAiDefaultModelId,
internationalZAiModelId,
internationalZAiModels,
ModelInfo,
mainlandZAiDefaultModelId,
mainlandZAiModelId,
mainlandZAiModels,
} from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import ... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/together.ts | src/core/api/providers/together.ts | import { ModelInfo, openAiModelInfoSaneDefaults } from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import { ApiHandler, CommonApiHa... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/vercel-ai-gateway.ts | src/core/api/providers/vercel-ai-gateway.ts | import { ModelInfo, openRouterDefaultModelId, openRouterDefaultModelInfo } from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import ... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/openai-native.ts | src/core/api/providers/openai-native.ts | import {
ModelInfo,
OpenAiCompatibleModelInfo,
OpenAiNativeModelId,
openAiNativeDefaultModelId,
openAiNativeModels,
} from "@shared/api"
import { calculateApiCostOpenAI } from "@utils/cost"
import OpenAI from "openai"
import type { ChatCompletionReasoningEffort, ChatCompletionTool } from "openai/resources/chat/com... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/nebius.ts | src/core/api/providers/nebius.ts | import { type ModelInfo, type NebiusModelId, nebiusDefaultModelId, nebiusModels } from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/requesty.ts | src/core/api/providers/requesty.ts | import { ModelInfo, requestyDefaultModelId, requestyDefaultModelInfo } from "@shared/api"
import { calculateApiCostOpenAI } from "@utils/cost"
import OpenAI from "openai"
import { toRequestyServiceStringUrl } from "@/shared/clients/requesty"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/deepseek.ts | src/core/api/providers/deepseek.ts | import { DeepSeekModelId, deepSeekDefaultModelId, deepSeekModels, ModelInfo } from "@shared/api"
import { calculateApiCostOpenAI } from "@utils/cost"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messag... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/gemini.ts | src/core/api/providers/gemini.ts | // Restore GenerateContentConfig import and add GenerateContentResponseUsageMetadata
import {
ApiError,
FunctionCallingConfigMode,
type GenerateContentConfig,
type GenerateContentResponseUsageMetadata,
GoogleGenAI,
FunctionDeclaration as GoogleTool,
ThinkingLevel,
} from "@google/genai"
import { GeminiModelId, g... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/minimax.ts | src/core/api/providers/minimax.ts | import { Anthropic } from "@anthropic-ai/sdk"
import { Tool as AnthropicTool } from "@anthropic-ai/sdk/resources/index"
import { Stream as AnthropicStream } from "@anthropic-ai/sdk/streaming"
import { MinimaxModelId, ModelInfo, minimaxDefaultModelId, minimaxModels } from "@/shared/api"
import { ClineStorageMessage } fr... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/cline.ts | src/core/api/providers/cline.ts | import { ModelInfo, openRouterDefaultModelId, openRouterDefaultModelInfo } from "@shared/api"
import { shouldSkipReasoningForModel } from "@utils/model-utils"
import axios from "axios"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineEnv... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/lmstudio.ts | src/core/api/providers/lmstudio.ts | import { type ModelInfo, openAiModelInfoSaneDefaults } from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import type { ApiHandler, C... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/doubao.ts | src/core/api/providers/doubao.ts | import { DoubaoModelId, doubaoDefaultModelId, doubaoModels, ModelInfo } from "@shared/api"
import OpenAI from "openai"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import { ApiHandler, CommonApiHandlerOptions } from ".."
import { withRetry } from "../retry"
import... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/vertex.ts | src/core/api/providers/vertex.ts | import { Tool as AnthropicTool } from "@anthropic-ai/sdk/resources/index"
import { AnthropicVertex } from "@anthropic-ai/vertex-sdk"
import { FunctionDeclaration as GoogleTool } from "@google/genai"
import { ModelInfo, VertexModelId, vertexDefaultModelId, vertexModels } from "@shared/api"
import { ClineStorageMessage }... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/openai.ts | src/core/api/providers/openai.ts | import { azureOpenAiDefaultApiVersion, ModelInfo, OpenAiCompatibleModelInfo, openAiModelInfoSaneDefaults } from "@shared/api"
import OpenAI, { AzureOpenAI } from "openai"
import type { ChatCompletionReasoningEffort, ChatCompletionTool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/sha... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/huawei-cloud-maas.ts | src/core/api/providers/huawei-cloud-maas.ts | import { HuaweiCloudMaasModelId, huaweiCloudMaasDefaultModelId, huaweiCloudMaasModels, ModelInfo } from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } fro... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/bedrock.ts | src/core/api/providers/bedrock.ts | // Import proper AWS SDK types
import type { ContentBlock, Message } from "@aws-sdk/client-bedrock-runtime"
import {
BedrockRuntimeClient,
ConversationRole,
ConverseCommand,
ConverseStreamCommand,
InvokeModelWithResponseStreamCommand,
} from "@aws-sdk/client-bedrock-runtime"
import { fromNodeProviderChain } from "... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | true |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/qwen.ts | src/core/api/providers/qwen.ts | import {
InternationalQwenModelId,
internationalQwenDefaultModelId,
internationalQwenModels,
MainlandQwenModelId,
ModelInfo,
mainlandQwenDefaultModelId,
mainlandQwenModels,
QwenApiRegions,
} from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/ch... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/litellm.ts | src/core/api/providers/litellm.ts | import { Anthropic } from "@anthropic-ai/sdk"
import { LiteLLMModelInfo, liteLlmDefaultModelId, liteLlmModelInfoSaneDefaults } from "@shared/api"
import OpenAI from "openai"
import { StateManager } from "@/core/storage/StateManager"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/vscode-lm.ts | src/core/api/providers/vscode-lm.ts | import { ModelInfo, openAiModelInfoSaneDefaults } from "@shared/api"
import { SELECTOR_SEPARATOR, stringifyVsCodeLmModelSelector } from "@shared/vsCodeSelectorUtils"
import { calculateApiCostAnthropic } from "@utils/cost"
import * as vscode from "vscode"
import { ClineStorageMessage } from "@/shared/messages/content"
i... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/sambanova.ts | src/core/api/providers/sambanova.ts | import { ModelInfo, SambanovaModelId, sambanovaDefaultModelId, sambanovaModels } from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
i... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/openrouter.ts | src/core/api/providers/openrouter.ts | import { setTimeout as setTimeoutPromise } from "node:timers/promises"
import { StateManager } from "@core/storage/StateManager"
import { ModelInfo, openRouterDefaultModelId, openRouterDefaultModelInfo } from "@shared/api"
import { shouldSkipReasoningForModel } from "@utils/model-utils"
import axios from "axios"
import... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/hicap.ts | src/core/api/providers/hicap.ts | import { hicapModelInfoSaneDefaults, ModelInfo } from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionReasoningEffort } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messages/content"
import { ApiHandler, CommonApiHandlerOptions } from "../index"
import { w... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/baseten.ts | src/core/api/providers/baseten.ts | import { BasetenModelId, basetenDefaultModelId, basetenModels, ModelInfo } from "@shared/api"
import { calculateApiCostOpenAI } from "@utils/cost"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messages/... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/groq.ts | src/core/api/providers/groq.ts | import { GroqModelId, groqDefaultModelId, groqModels, ModelInfo } from "@shared/api"
import { calculateApiCostOpenAI } from "@utils/cost"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ClineStorageMessage } from "@/shared/messages/content"
... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/gemini-mock.test.ts | src/core/api/providers/gemini-mock.test.ts | // Mock for @google/genai module to avoid ESM compatibility issues in tests
export class GoogleGenAI {
constructor(_options: any) {
// Mock constructor
}
models = {
generateContentStream: async (_params: any) => {
// Mock implementation that returns an async iterator
return {
async *[Symbol.asyncIter... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/qwen-code.ts | src/core/api/providers/qwen-code.ts | import { promises as fs } from "node:fs"
import { ModelInfo, QwenCodeModelId, qwenCodeDefaultModelId, qwenCodeModels } from "@shared/api"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import * as os from "os"
import * as path from "path"
import { C... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/cerebras.ts | src/core/api/providers/cerebras.ts | import Cerebras from "@cerebras/cerebras_cloud_sdk"
import { CerebrasModelId, cerebrasDefaultModelId, cerebrasModels, ModelInfo } from "@shared/api"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import { ApiHandler, CommonApiHandlerOptions } from "../index"
import ... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/moonshot.ts | src/core/api/providers/moonshot.ts | import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ModelInfo, MoonshotModelId, moonshotDefaultModelId, moonshotModels } from "@/shared/api"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
imp... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/xai.ts | src/core/api/providers/xai.ts | import { ModelInfo, XAIModelId, xaiDefaultModelId, xaiModels } from "@shared/api"
import { shouldSkipReasoningForModel } from "@utils/model-utils"
import OpenAI from "openai"
import type { ChatCompletionTool as OpenAITool } from "openai/resources/chat/completions"
import { ChatCompletionReasoningEffort } from "openai/r... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/aihubmix.ts | src/core/api/providers/aihubmix.ts | import { Anthropic } from "@anthropic-ai/sdk"
import { GenerateContentConfig, GoogleGenAI } from "@google/genai"
import { ModelInfo } from "@shared/api"
import OpenAI from "openai"
import { ApiHandler, CommonApiHandlerOptions } from "../index"
import { withRetry } from "../retry"
import { sanitizeAnthropicMessages } fr... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/asksage.ts | src/core/api/providers/asksage.ts | import { AskSageModelId, askSageDefaultModelId, askSageDefaultURL, askSageModels, ModelInfo } from "@shared/api"
import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import { ApiHandler, CommonApiHandlerOptions } from ".."
import { withRetry } from "../retry"
import { Api... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
cline/cline | https://github.com/cline/cline/blob/0d04205dc4194c54e4bf424d2dc80f2fe1697e98/src/core/api/providers/dify.ts | src/core/api/providers/dify.ts | import { ClineStorageMessage } from "@/shared/messages/content"
import { fetch } from "@/shared/net"
import { ModelInfo } from "../../../shared/api"
import { ApiHandler } from "../index"
import { ApiStream } from "../transform/stream"
interface DifyHandlerOptions {
difyApiKey?: string
difyBaseUrl?: string
}
// Dify... | typescript | Apache-2.0 | 0d04205dc4194c54e4bf424d2dc80f2fe1697e98 | 2026-01-04T15:28:48.884804Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.