mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-08 03:07:53 +00:00
Move cloud types from @roo-code/types to @roo-code/cloud (#7038)
This commit is contained in:
parent
6f81b775c7
commit
9ffc2b0a36
36 changed files with 129 additions and 225 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@roo-code/types",
|
||||
"version": "1.45.0",
|
||||
"version": "1.46.0",
|
||||
"description": "TypeScript type definitions for Roo Code.",
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
|
|
|
|||
|
|
@ -1,158 +0,0 @@
|
|||
import { z } from "zod"
|
||||
|
||||
import { globalSettingsSchema } from "./global-settings.js"
|
||||
import { mcpMarketplaceItemSchema } from "./marketplace.js"
|
||||
import { discriminatedProviderSettingsWithIdSchema } from "./provider-settings.js"
|
||||
|
||||
/**
|
||||
* CloudUserInfo
|
||||
*/
|
||||
|
||||
export interface CloudUserInfo {
|
||||
id?: string
|
||||
name?: string
|
||||
email?: string
|
||||
picture?: string
|
||||
organizationId?: string
|
||||
organizationName?: string
|
||||
organizationRole?: string
|
||||
organizationImageUrl?: string
|
||||
extensionBridgeEnabled?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* CloudOrganization Types
|
||||
*/
|
||||
|
||||
export interface CloudOrganization {
|
||||
id: string
|
||||
name: string
|
||||
slug?: string
|
||||
image_url?: string
|
||||
has_image?: boolean
|
||||
created_at?: number
|
||||
updated_at?: number
|
||||
}
|
||||
|
||||
export interface CloudOrganizationMembership {
|
||||
id: string
|
||||
organization: CloudOrganization
|
||||
role: string
|
||||
permissions?: string[]
|
||||
created_at?: number
|
||||
updated_at?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* OrganizationAllowList
|
||||
*/
|
||||
|
||||
export const organizationAllowListSchema = z.object({
|
||||
allowAll: z.boolean(),
|
||||
providers: z.record(
|
||||
z.object({
|
||||
allowAll: z.boolean(),
|
||||
models: z.array(z.string()).optional(),
|
||||
}),
|
||||
),
|
||||
})
|
||||
|
||||
export type OrganizationAllowList = z.infer<typeof organizationAllowListSchema>
|
||||
|
||||
/**
|
||||
* OrganizationDefaultSettings
|
||||
*/
|
||||
|
||||
export const organizationDefaultSettingsSchema = globalSettingsSchema
|
||||
.pick({
|
||||
enableCheckpoints: true,
|
||||
fuzzyMatchThreshold: true,
|
||||
maxOpenTabsContext: true,
|
||||
maxReadFileLine: true,
|
||||
maxWorkspaceFiles: true,
|
||||
showRooIgnoredFiles: true,
|
||||
terminalCommandDelay: true,
|
||||
terminalCompressProgressBar: true,
|
||||
terminalOutputLineLimit: true,
|
||||
terminalShellIntegrationDisabled: true,
|
||||
terminalShellIntegrationTimeout: true,
|
||||
terminalZshClearEolMark: true,
|
||||
})
|
||||
// Add stronger validations for some fields.
|
||||
.merge(
|
||||
z.object({
|
||||
maxOpenTabsContext: z.number().int().nonnegative().optional(),
|
||||
maxReadFileLine: z.number().int().gte(-1).optional(),
|
||||
maxWorkspaceFiles: z.number().int().nonnegative().optional(),
|
||||
terminalCommandDelay: z.number().int().nonnegative().optional(),
|
||||
terminalOutputLineLimit: z.number().int().nonnegative().optional(),
|
||||
terminalShellIntegrationTimeout: z.number().int().nonnegative().optional(),
|
||||
}),
|
||||
)
|
||||
|
||||
export type OrganizationDefaultSettings = z.infer<typeof organizationDefaultSettingsSchema>
|
||||
|
||||
/**
|
||||
* OrganizationCloudSettings
|
||||
*/
|
||||
|
||||
export const organizationCloudSettingsSchema = z.object({
|
||||
recordTaskMessages: z.boolean().optional(),
|
||||
enableTaskSharing: z.boolean().optional(),
|
||||
taskShareExpirationDays: z.number().int().positive().optional(),
|
||||
allowMembersViewAllTasks: z.boolean().optional(),
|
||||
})
|
||||
|
||||
export type OrganizationCloudSettings = z.infer<typeof organizationCloudSettingsSchema>
|
||||
|
||||
/**
|
||||
* Organization Settings
|
||||
*/
|
||||
|
||||
export const organizationSettingsSchema = z.object({
|
||||
version: z.number(),
|
||||
cloudSettings: organizationCloudSettingsSchema.optional(),
|
||||
defaultSettings: organizationDefaultSettingsSchema,
|
||||
allowList: organizationAllowListSchema,
|
||||
hiddenMcps: z.array(z.string()).optional(),
|
||||
hideMarketplaceMcps: z.boolean().optional(),
|
||||
mcps: z.array(mcpMarketplaceItemSchema).optional(),
|
||||
providerProfiles: z.record(z.string(), discriminatedProviderSettingsWithIdSchema).optional(),
|
||||
})
|
||||
|
||||
export type OrganizationSettings = z.infer<typeof organizationSettingsSchema>
|
||||
|
||||
/**
|
||||
* Constants
|
||||
*/
|
||||
|
||||
export const ORGANIZATION_ALLOW_ALL: OrganizationAllowList = {
|
||||
allowAll: true,
|
||||
providers: {},
|
||||
} as const
|
||||
|
||||
export const ORGANIZATION_DEFAULT: OrganizationSettings = {
|
||||
version: 0,
|
||||
cloudSettings: {
|
||||
recordTaskMessages: true,
|
||||
enableTaskSharing: true,
|
||||
taskShareExpirationDays: 30,
|
||||
allowMembersViewAllTasks: true,
|
||||
},
|
||||
defaultSettings: {},
|
||||
allowList: ORGANIZATION_ALLOW_ALL,
|
||||
} as const
|
||||
|
||||
/**
|
||||
* Share Types
|
||||
*/
|
||||
|
||||
export const shareResponseSchema = z.object({
|
||||
success: z.boolean(),
|
||||
shareUrl: z.string().optional(),
|
||||
error: z.string().optional(),
|
||||
isNewShare: z.boolean().optional(),
|
||||
manageUrl: z.string().optional(),
|
||||
})
|
||||
|
||||
export type ShareResponse = z.infer<typeof shareResponseSchema>
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
export * from "./api.js"
|
||||
export * from "./cloud.js"
|
||||
export * from "./codebase-index.js"
|
||||
export * from "./events.js"
|
||||
export * from "./experiment.js"
|
||||
|
|
@ -13,7 +12,6 @@ export * from "./message.js"
|
|||
export * from "./mode.js"
|
||||
export * from "./model.js"
|
||||
export * from "./provider-settings.js"
|
||||
export * from "./sharing.js"
|
||||
export * from "./task.js"
|
||||
export * from "./todo.js"
|
||||
export * from "./telemetry.js"
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
/**
|
||||
* Types related to task sharing functionality
|
||||
*/
|
||||
|
||||
/**
|
||||
* Visibility options for sharing tasks
|
||||
*/
|
||||
export type ShareVisibility = "organization" | "public"
|
||||
13
pnpm-lock.yaml
generated
13
pnpm-lock.yaml
generated
|
|
@ -563,8 +563,8 @@ importers:
|
|||
specifier: ^1.14.0
|
||||
version: 1.14.0(typescript@5.8.3)
|
||||
'@roo-code/cloud':
|
||||
specifier: ^0.11.0
|
||||
version: 0.11.0
|
||||
specifier: ^0.13.0
|
||||
version: 0.13.0
|
||||
'@roo-code/ipc':
|
||||
specifier: workspace:^
|
||||
version: link:../packages/ipc
|
||||
|
|
@ -896,6 +896,9 @@ importers:
|
|||
'@radix-ui/react-tooltip':
|
||||
specifier: ^1.1.8
|
||||
version: 1.2.6(@types/react-dom@18.3.7(@types/react@18.3.23))(@types/react@18.3.23)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
|
||||
'@roo-code/cloud':
|
||||
specifier: ^0.13.0
|
||||
version: 0.13.0
|
||||
'@roo-code/types':
|
||||
specifier: workspace:^
|
||||
version: link:../packages/types
|
||||
|
|
@ -3065,8 +3068,8 @@ packages:
|
|||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@roo-code/cloud@0.11.0':
|
||||
resolution: {integrity: sha512-ZT3gBRNHI0HGmn5bMxdyhMxJVrp/7l7jcx/lDRl+xjeCP3KmJshzFKlfjdSGDtOoztnNj65hSbs/WiTS2wUodQ==}
|
||||
'@roo-code/cloud@0.13.0':
|
||||
resolution: {integrity: sha512-pIrfMpuHSk3LPMG3SLmsfr/IYvL5x0k0iUXQ51dgZ2fP7TlzWg2erxclNl79O7pRMDYFnA/8YoQTAnv1N8VXnQ==}
|
||||
|
||||
'@roo-code/types@1.45.0':
|
||||
resolution: {integrity: sha512-+rFJ9HcukDl59X9pI6lgZDtJHtKqHg6BIdS4LG759X+5MV7wvlNb4S+bQ3qKqIlBsQhH17bzIJCfsWZwjwxecw==}
|
||||
|
|
@ -12234,7 +12237,7 @@ snapshots:
|
|||
'@rollup/rollup-win32-x64-msvc@4.40.2':
|
||||
optional: true
|
||||
|
||||
'@roo-code/cloud@0.11.0':
|
||||
'@roo-code/cloud@0.13.0':
|
||||
dependencies:
|
||||
'@roo-code/types': 1.45.0
|
||||
ioredis: 5.6.1
|
||||
|
|
|
|||
|
|
@ -14,6 +14,13 @@ const config = {
|
|||
npmPath: "npm",
|
||||
watchCommand: "pnpm build:development:watch",
|
||||
},
|
||||
{
|
||||
name: "@roo-code/cloud",
|
||||
sourcePath: "../Roo-Code-Cloud/packages/sdk",
|
||||
targetPath: "webview-ui/node_modules/@roo-code/cloud",
|
||||
npmPath: "npm",
|
||||
watchCommand: "pnpm build:development:watch",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,17 +24,15 @@ import {
|
|||
type TerminalActionId,
|
||||
type TerminalActionPromptType,
|
||||
type HistoryItem,
|
||||
type CloudUserInfo,
|
||||
RooCodeEventName,
|
||||
requestyDefaultModelId,
|
||||
openRouterDefaultModelId,
|
||||
glamaDefaultModelId,
|
||||
ORGANIZATION_ALLOW_ALL,
|
||||
DEFAULT_TERMINAL_OUTPUT_CHARACTER_LIMIT,
|
||||
DEFAULT_WRITE_DELAY_MS,
|
||||
} from "@roo-code/types"
|
||||
import { TelemetryService } from "@roo-code/telemetry"
|
||||
import { CloudService, getRooCodeApiUrl } from "@roo-code/cloud"
|
||||
import { type CloudUserInfo, CloudService, ORGANIZATION_ALLOW_ALL, getRooCodeApiUrl } from "@roo-code/cloud"
|
||||
|
||||
import { Package } from "../../shared/package"
|
||||
import { findLast } from "../../shared/array"
|
||||
|
|
|
|||
|
|
@ -4,8 +4,9 @@ import Anthropic from "@anthropic-ai/sdk"
|
|||
import * as vscode from "vscode"
|
||||
import axios from "axios"
|
||||
|
||||
import { type ProviderSettingsEntry, type ClineMessage, ORGANIZATION_ALLOW_ALL } from "@roo-code/types"
|
||||
import { type ProviderSettingsEntry, type ClineMessage } from "@roo-code/types"
|
||||
import { TelemetryService } from "@roo-code/telemetry"
|
||||
import { ORGANIZATION_ALLOW_ALL } from "@roo-code/cloud"
|
||||
|
||||
import { ExtensionMessage, ExtensionState } from "../../../shared/ExtensionMessage"
|
||||
import { defaultModeSlug } from "../../../shared/modes"
|
||||
|
|
@ -17,11 +18,9 @@ import { safeWriteJson } from "../../../utils/safeWriteJson"
|
|||
|
||||
import { ClineProvider } from "../ClineProvider"
|
||||
|
||||
// Mock setup must come before imports
|
||||
// Mock setup must come before imports.
|
||||
vi.mock("../../prompts/sections/custom-instructions")
|
||||
|
||||
vi.mock("vscode")
|
||||
|
||||
vi.mock("p-wait-for", () => ({
|
||||
__esModule: true,
|
||||
default: vi.fn().mockResolvedValue(undefined),
|
||||
|
|
@ -95,7 +94,7 @@ vi.mock("../../../services/browser/browserDiscovery", () => ({
|
|||
testBrowserConnection: vi.fn(),
|
||||
}))
|
||||
|
||||
// Remove duplicate mock - it's already defined below
|
||||
// Remove duplicate mock - it's already defined below.
|
||||
|
||||
const mockAddCustomInstructions = vi.fn().mockResolvedValue("Combined instructions")
|
||||
|
||||
|
|
@ -228,7 +227,6 @@ vi.mock("../../../integrations/misc/extract-text", () => ({
|
|||
}),
|
||||
}))
|
||||
|
||||
// Mock getModels for router model tests
|
||||
vi.mock("../../../api/providers/fetchers/modelCache", () => ({
|
||||
getModels: vi.fn().mockResolvedValue({}),
|
||||
flushModels: vi.fn(),
|
||||
|
|
@ -324,6 +322,10 @@ vi.mock("@roo-code/cloud", () => ({
|
|||
},
|
||||
},
|
||||
getRooCodeApiUrl: vi.fn().mockReturnValue("https://app.roocode.com"),
|
||||
ORGANIZATION_ALLOW_ALL: {
|
||||
allowAll: true,
|
||||
providers: {},
|
||||
},
|
||||
}))
|
||||
|
||||
afterAll(() => {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ import { ContextProxy } from "../../config/ContextProxy"
|
|||
import { Task } from "../../task/Task"
|
||||
import type { HistoryItem, ProviderName } from "@roo-code/types"
|
||||
|
||||
// Mock setup
|
||||
vi.mock("vscode", () => ({
|
||||
ExtensionContext: vi.fn(),
|
||||
OutputChannel: vi.fn(),
|
||||
|
|
@ -54,7 +53,8 @@ vi.mock("vscode", () => ({
|
|||
},
|
||||
version: "1.85.0",
|
||||
}))
|
||||
// Create a counter for unique task IDs
|
||||
|
||||
// Create a counter for unique task IDs.
|
||||
let taskIdCounter = 0
|
||||
|
||||
vi.mock("../../task/Task", () => ({
|
||||
|
|
@ -75,8 +75,11 @@ vi.mock("../../task/Task", () => ({
|
|||
parentTask: options.parentTask,
|
||||
})),
|
||||
}))
|
||||
|
||||
vi.mock("../../prompts/sections/custom-instructions")
|
||||
|
||||
vi.mock("../../../utils/safeWriteJson")
|
||||
|
||||
vi.mock("../../../api", () => ({
|
||||
buildApiHandler: vi.fn().mockReturnValue({
|
||||
getModel: vi.fn().mockReturnValue({
|
||||
|
|
@ -85,12 +88,14 @@ vi.mock("../../../api", () => ({
|
|||
}),
|
||||
}),
|
||||
}))
|
||||
|
||||
vi.mock("../../../integrations/workspace/WorkspaceTracker", () => ({
|
||||
default: vi.fn().mockImplementation(() => ({
|
||||
initializeFilePaths: vi.fn(),
|
||||
dispose: vi.fn(),
|
||||
})),
|
||||
}))
|
||||
|
||||
vi.mock("../../diff/strategies/multi-search-replace", () => ({
|
||||
MultiSearchReplaceDiffStrategy: vi.fn().mockImplementation(() => ({
|
||||
getToolDescription: () => "test",
|
||||
|
|
@ -98,6 +103,7 @@ vi.mock("../../diff/strategies/multi-search-replace", () => ({
|
|||
applyDiff: vi.fn(),
|
||||
})),
|
||||
}))
|
||||
|
||||
vi.mock("@roo-code/cloud", () => ({
|
||||
CloudService: {
|
||||
hasInstance: vi.fn().mockReturnValue(true),
|
||||
|
|
@ -108,7 +114,12 @@ vi.mock("@roo-code/cloud", () => ({
|
|||
},
|
||||
},
|
||||
getRooCodeApiUrl: vi.fn().mockReturnValue("https://app.roocode.com"),
|
||||
ORGANIZATION_ALLOW_ALL: {
|
||||
allowAll: true,
|
||||
providers: {},
|
||||
},
|
||||
}))
|
||||
|
||||
vi.mock("../../../shared/modes", () => ({
|
||||
modes: [
|
||||
{
|
||||
|
|
@ -132,20 +143,25 @@ vi.mock("../../../shared/modes", () => ({
|
|||
}),
|
||||
defaultModeSlug: "code",
|
||||
}))
|
||||
|
||||
vi.mock("../../prompts/system", () => ({
|
||||
SYSTEM_PROMPT: vi.fn().mockResolvedValue("mocked system prompt"),
|
||||
codeMode: "code",
|
||||
}))
|
||||
|
||||
vi.mock("../../../api/providers/fetchers/modelCache", () => ({
|
||||
getModels: vi.fn().mockResolvedValue({}),
|
||||
flushModels: vi.fn(),
|
||||
}))
|
||||
|
||||
vi.mock("../../../integrations/misc/extract-text", () => ({
|
||||
extractTextFromFile: vi.fn().mockResolvedValue("Mock file content"),
|
||||
}))
|
||||
|
||||
vi.mock("p-wait-for", () => ({
|
||||
default: vi.fn().mockImplementation(async () => Promise.resolve()),
|
||||
}))
|
||||
|
||||
vi.mock("fs/promises", () => ({
|
||||
mkdir: vi.fn().mockResolvedValue(undefined),
|
||||
writeFile: vi.fn().mockResolvedValue(undefined),
|
||||
|
|
@ -153,6 +169,7 @@ vi.mock("fs/promises", () => ({
|
|||
unlink: vi.fn().mockResolvedValue(undefined),
|
||||
rmdir: vi.fn().mockResolvedValue(undefined),
|
||||
}))
|
||||
|
||||
vi.mock("@roo-code/telemetry", () => ({
|
||||
TelemetryService: {
|
||||
hasInstance: vi.fn().mockReturnValue(true),
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@
|
|||
"@mistralai/mistralai": "^1.3.6",
|
||||
"@modelcontextprotocol/sdk": "^1.9.0",
|
||||
"@qdrant/js-client-rest": "^1.14.0",
|
||||
"@roo-code/cloud": "^0.11.0",
|
||||
"@roo-code/cloud": "^0.13.0",
|
||||
"@roo-code/ipc": "workspace:^",
|
||||
"@roo-code/telemetry": "workspace:^",
|
||||
"@roo-code/types": "workspace:^",
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import * as path from "path"
|
|||
import * as vscode from "vscode"
|
||||
import * as yaml from "yaml"
|
||||
|
||||
import type { MarketplaceItem, MarketplaceItemType, McpMarketplaceItem, OrganizationSettings } from "@roo-code/types"
|
||||
import type { MarketplaceItem, MarketplaceItemType, McpMarketplaceItem } from "@roo-code/types"
|
||||
import { TelemetryService } from "@roo-code/telemetry"
|
||||
import { CloudService } from "@roo-code/cloud"
|
||||
import { type OrganizationSettings, CloudService } from "@roo-code/cloud"
|
||||
|
||||
import { GlobalFileNames } from "../../shared/globalFileNames"
|
||||
import { ensureSettingsDirectoryExists } from "../../utils/globalContext"
|
||||
|
|
|
|||
|
|
@ -7,17 +7,15 @@ import type {
|
|||
TelemetrySetting,
|
||||
Experiments,
|
||||
ClineMessage,
|
||||
OrganizationAllowList,
|
||||
CloudUserInfo,
|
||||
ShareVisibility,
|
||||
MarketplaceItem,
|
||||
} from "@roo-code/types"
|
||||
import type { CloudUserInfo, OrganizationAllowList, ShareVisibility } from "@roo-code/cloud"
|
||||
|
||||
import { GitCommit } from "../utils/git"
|
||||
|
||||
import { McpServer } from "./mcp"
|
||||
import { Mode } from "./modes"
|
||||
import { ModelRecord, RouterModels } from "./api"
|
||||
import type { MarketplaceItem } from "@roo-code/types"
|
||||
|
||||
// Command interface for frontend/backend communication
|
||||
export interface Command {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { OrganizationAllowList, ProviderSettings } from "@roo-code/types"
|
||||
import type { ProviderSettings } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
export class ProfileValidator {
|
||||
public static isProfileAllowed(profile: ProviderSettings, allowList: OrganizationAllowList): boolean {
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { z } from "zod"
|
||||
|
||||
import type {
|
||||
ProviderSettings,
|
||||
PromptComponent,
|
||||
ModeConfig,
|
||||
InstallMarketplaceItemOptions,
|
||||
MarketplaceItem,
|
||||
ShareVisibility,
|
||||
import {
|
||||
type ProviderSettings,
|
||||
type PromptComponent,
|
||||
type ModeConfig,
|
||||
type InstallMarketplaceItemOptions,
|
||||
type MarketplaceItem,
|
||||
marketplaceItemSchema,
|
||||
} from "@roo-code/types"
|
||||
import { marketplaceItemSchema } from "@roo-code/types"
|
||||
import type { ShareVisibility } from "@roo-code/cloud"
|
||||
|
||||
import { Mode } from "./modes"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
// npx vitest run src/shared/__tests__/ProfileValidator.spec.ts
|
||||
|
||||
import { OrganizationAllowList, ProviderSettings } from "@roo-code/types"
|
||||
import { type ProviderSettings } from "@roo-code/types"
|
||||
import { type OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import { ProfileValidator } from "../ProfileValidator"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { CloudUserInfo } from "@roo-code/types"
|
||||
import type { CloudUserInfo } from "@roo-code/cloud"
|
||||
|
||||
/**
|
||||
* Determines if remote control features should be enabled
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
"@radix-ui/react-slider": "^1.2.3",
|
||||
"@radix-ui/react-slot": "^1.1.2",
|
||||
"@radix-ui/react-tooltip": "^1.1.8",
|
||||
"@roo-code/cloud": "^0.13.0",
|
||||
"@roo-code/types": "workspace:^",
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"@tanstack/react-query": "^5.68.0",
|
||||
|
|
|
|||
18
webview-ui/src/__mocks__/vscode.ts
Normal file
18
webview-ui/src/__mocks__/vscode.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Minimal mock for the vscode module.
|
||||
* Used in tests to prevent module resolution errors.
|
||||
* The actual vscode API is only available in VS Code extension contexts.
|
||||
*/
|
||||
|
||||
export const window = {
|
||||
showInformationMessage: vi.fn(),
|
||||
showErrorMessage: vi.fn(),
|
||||
}
|
||||
|
||||
export const env = {
|
||||
openExternal: vi.fn(),
|
||||
}
|
||||
|
||||
export const Uri = {
|
||||
parse: vi.fn((uri: string) => ({ toString: () => uri })),
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import { useEffect, useRef } from "react"
|
||||
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react"
|
||||
|
||||
import type { CloudUserInfo } from "@roo-code/types"
|
||||
import { TelemetryEventName } from "@roo-code/types"
|
||||
import type { CloudUserInfo } from "@roo-code/cloud"
|
||||
|
||||
import { useAppTranslation } from "@src/i18n/TranslationContext"
|
||||
import { useExtensionState } from "@src/context/ExtensionStateContext"
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import { useState, useEffect, useRef } from "react"
|
|||
import { useTranslation } from "react-i18next"
|
||||
import { SquareArrowOutUpRightIcon } from "lucide-react"
|
||||
|
||||
import type { HistoryItem, ShareVisibility } from "@roo-code/types"
|
||||
import { TelemetryEventName } from "@roo-code/types"
|
||||
import { type HistoryItem, TelemetryEventName } from "@roo-code/types"
|
||||
import type { ShareVisibility } from "@roo-code/cloud"
|
||||
|
||||
import { vscode } from "@/utils/vscode"
|
||||
import { telemetryClient } from "@/utils/TelemetryClient"
|
||||
|
|
|
|||
|
|
@ -2,11 +2,20 @@ import { memo, useEffect, useRef, useState } from "react"
|
|||
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
|
||||
import { AlertTriangle } from "lucide-react"
|
||||
|
||||
import type { ProviderSettingsEntry, OrganizationAllowList } from "@roo-code/types"
|
||||
import type { ProviderSettingsEntry } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import { useAppTranslation } from "@/i18n/TranslationContext"
|
||||
import { Button, Input, Dialog, DialogContent, DialogTitle, StandardTooltip, SearchableSelect } from "@/components/ui"
|
||||
import type { SearchableSelectOption } from "@/components/ui"
|
||||
import {
|
||||
type SearchableSelectOption,
|
||||
Button,
|
||||
Input,
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogTitle,
|
||||
StandardTooltip,
|
||||
SearchableSelect,
|
||||
} from "@/components/ui"
|
||||
|
||||
interface ApiConfigManagerProps {
|
||||
currentApiConfigName?: string
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ import { VSCodeLink } from "@vscode/webview-ui-toolkit/react"
|
|||
import { Trans } from "react-i18next"
|
||||
import { ChevronsUpDown, Check, X } from "lucide-react"
|
||||
|
||||
import type { ProviderSettings, ModelInfo, OrganizationAllowList } from "@roo-code/types"
|
||||
import type { ProviderSettings, ModelInfo } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import { useAppTranslation } from "@src/i18n/TranslationContext"
|
||||
import { useSelectedModel } from "@/components/ui/hooks/useSelectedModel"
|
||||
|
|
@ -194,7 +195,9 @@ export const ModelPicker = ({
|
|||
value={model}
|
||||
onSelect={onSelect}
|
||||
data-testid={`model-option-${model}`}>
|
||||
<span className="truncate" title={model}>{model}</span>
|
||||
<span className="truncate" title={model}>
|
||||
{model}
|
||||
</span>
|
||||
<Check
|
||||
className={cn(
|
||||
"size-4 p-0.5 ml-auto",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import { useCallback } from "react"
|
||||
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
|
||||
|
||||
import { type ProviderSettings, type OrganizationAllowList, glamaDefaultModelId } from "@roo-code/types"
|
||||
import { type ProviderSettings, glamaDefaultModelId } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import type { RouterModels } from "@roo/api"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
import { useCallback } from "react"
|
||||
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
|
||||
|
||||
import type { ProviderSettings, OrganizationAllowList } from "@roo-code/types"
|
||||
import { ioIntelligenceDefaultModelId, ioIntelligenceModels } from "@roo-code/types"
|
||||
import { type ProviderSettings, ioIntelligenceDefaultModelId, ioIntelligenceModels } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import { useAppTranslation } from "@src/i18n/TranslationContext"
|
||||
import { VSCodeButtonLink } from "@src/components/common/VSCodeButtonLink"
|
||||
import { useExtensionState } from "@src/context/ExtensionStateContext"
|
||||
|
||||
import { ModelPicker } from "../ModelPicker"
|
||||
|
||||
import { inputEventTransform } from "../transforms"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import { useCallback, useState, useEffect, useRef } from "react"
|
||||
import { VSCodeTextField, VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
|
||||
|
||||
import { type ProviderSettings, type OrganizationAllowList, litellmDefaultModelId } from "@roo-code/types"
|
||||
import { type ProviderSettings, litellmDefaultModelId } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import { RouterName } from "@roo/api"
|
||||
import { ExtensionMessage } from "@roo/ExtensionMessage"
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ import {
|
|||
type ProviderSettings,
|
||||
type ModelInfo,
|
||||
type ReasoningEffort,
|
||||
type OrganizationAllowList,
|
||||
azureOpenAiDefaultApiVersion,
|
||||
openAiModelInfoSaneDefaults,
|
||||
} from "@roo-code/types"
|
||||
import { type OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import { ExtensionMessage } from "@roo/ExtensionMessage"
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ import { Trans } from "react-i18next"
|
|||
import { Checkbox } from "vscrui"
|
||||
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
|
||||
|
||||
import { type ProviderSettings, type OrganizationAllowList, openRouterDefaultModelId } from "@roo-code/types"
|
||||
import { type ProviderSettings, openRouterDefaultModelId } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import type { RouterModels } from "@roo/api"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import { useCallback, useEffect, useState } from "react"
|
||||
import { VSCodeCheckbox, VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
|
||||
|
||||
import { type ProviderSettings, type OrganizationAllowList, requestyDefaultModelId } from "@roo-code/types"
|
||||
import { type ProviderSettings, requestyDefaultModelId } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import type { RouterModels } from "@roo/api"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ import { useCallback, useState, useRef } from "react"
|
|||
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
|
||||
import { useQueryClient } from "@tanstack/react-query"
|
||||
|
||||
import { type ProviderSettings, type OrganizationAllowList, unboundDefaultModelId } from "@roo-code/types"
|
||||
import { type ProviderSettings, unboundDefaultModelId } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import type { RouterModels } from "@roo/api"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { ModelInfo, OrganizationAllowList } from "@roo-code/types"
|
||||
import type { ModelInfo } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import { filterProviders, filterModels } from "../organizationFilters"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { ProviderName, ModelInfo, OrganizationAllowList } from "@roo-code/types"
|
||||
import type { ProviderName, ModelInfo } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
export const filterProviders = (
|
||||
providers: Array<{ value: string; label: string }>,
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ import {
|
|||
type CustomModePrompts,
|
||||
type ModeConfig,
|
||||
type ExperimentId,
|
||||
type OrganizationAllowList,
|
||||
ORGANIZATION_ALLOW_ALL,
|
||||
} from "@roo-code/types"
|
||||
import { type OrganizationAllowList, ORGANIZATION_ALLOW_ALL } from "@roo-code/cloud"
|
||||
|
||||
import { ExtensionMessage, ExtensionState, MarketplaceInstalledMetadata, Command } from "@roo/ExtensionMessage"
|
||||
import { findLastIndex } from "@roo/array"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
import { ProviderSettings, OrganizationAllowList } from "@roo-code/types"
|
||||
import type { ProviderSettings } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import { RouterModels } from "@roo/api"
|
||||
|
||||
import { getModelValidationError, validateApiConfigurationExcludingModelErrors } from "../validate"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import i18next from "i18next"
|
||||
|
||||
import type { ProviderSettings, OrganizationAllowList } from "@roo-code/types"
|
||||
import type { ProviderSettings } from "@roo-code/types"
|
||||
import type { OrganizationAllowList } from "@roo-code/cloud"
|
||||
|
||||
import { isRouterName, RouterModels } from "@roo/api"
|
||||
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ export default defineConfig(({ mode }) => {
|
|||
// Ensure source maps are properly included in the build
|
||||
minify: mode === "production" ? "esbuild" : false,
|
||||
rollupOptions: {
|
||||
external: ["vscode"],
|
||||
output: {
|
||||
entryFileNames: `assets/[name].js`,
|
||||
chunkFileNames: (chunkInfo) => {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ export default defineConfig({
|
|||
"@": path.resolve(__dirname, "./src"),
|
||||
"@src": path.resolve(__dirname, "./src"),
|
||||
"@roo": path.resolve(__dirname, "../src/shared"),
|
||||
// Mock the vscode module for tests since it's not available outside
|
||||
// VS Code extension context.
|
||||
vscode: path.resolve(__dirname, "./src/__mocks__/vscode.ts"),
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue