Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.vscode.md

This file was deleted.

2 changes: 1 addition & 1 deletion apps/web-evals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"format": "prettier --write src",
"build": "next build",
"start": "next start",
"clean": "rimraf .next .turbo"
"clean": "rimraf tsconfig.tsbuildinfo .next .turbo"
},
"dependencies": {
"@hookform/resolvers": "^5.1.1",
Expand Down
3 changes: 2 additions & 1 deletion apps/web-roo-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"check-types": "tsc --noEmit",
"dev": "next dev",
"build": "next build",
"start": "next start"
"start": "next start",
"clean": "rimraf .next .turbo"
},
"dependencies": {
"@radix-ui/react-dialog": "^1.1.14",
Expand Down
6 changes: 4 additions & 2 deletions packages/cloud/src/CloudService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class CloudService {

try {
const cloudToken = process.env.ROO_CODE_CLOUD_TOKEN

if (cloudToken && cloudToken.length > 0) {
this.authService = new StaticTokenAuthService(this.context, cloudToken, this.log)
} else {
Expand All @@ -62,8 +63,9 @@ export class CloudService {
this.authService.on("logged-out", this.authListener)
this.authService.on("user-info", this.authListener)

// Check for static settings environment variable
// Check for static settings environment variable.
const staticOrgSettings = process.env.ROO_CODE_CLOUD_ORG_SETTINGS

if (staticOrgSettings && staticOrgSettings.length > 0) {
this.settingsService = new StaticSettingsService(staticOrgSettings, this.log)
} else {
Expand All @@ -73,12 +75,12 @@ export class CloudService {
() => this.callbacks.stateChanged?.(),
this.log,
)

cloudSettingsService.initialize()
this.settingsService = cloudSettingsService
}

this.telemetryClient = new TelemetryClient(this.authService, this.settingsService)

this.shareService = new ShareService(this.authService, this.settingsService, this.log)

try {
Expand Down
7 changes: 4 additions & 3 deletions src/core/task/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ import { restoreTodoListForTask } from "../tools/updateTodoListTool"
// Constants
const MAX_EXPONENTIAL_BACKOFF_SECONDS = 600 // 10 minutes

export type ClineEvents = {
export type TaskEvents = {
message: [{ action: "created" | "updated"; message: ClineMessage }]
taskStarted: []
taskModeSwitched: [taskId: string, mode: string]
Expand Down Expand Up @@ -125,10 +125,10 @@ export type TaskOptions = {
rootTask?: Task
parentTask?: Task
taskNumber?: number
onCreated?: (cline: Task) => void
onCreated?: (task: Task) => void
}

export class Task extends EventEmitter<ClineEvents> {
export class Task extends EventEmitter<TaskEvents> {
todoList?: TodoItem[]
readonly taskId: string
readonly instanceId: string
Expand All @@ -137,6 +137,7 @@ export class Task extends EventEmitter<ClineEvents> {
readonly parentTask: Task | undefined = undefined
readonly taskNumber: number
readonly workspacePath: string

/**
* The mode associated with this task. Persisted across sessions
* to maintain user context when reopening tasks from history.
Expand Down
37 changes: 18 additions & 19 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,7 @@ import { getWorkspaceGitInfo } from "../../utils/git"
*/

export type ClineProviderEvents = {
clineCreated: [cline: Task]
}

class OrganizationAllowListViolationError extends Error {
constructor(message: string) {
super(message)
}
taskCreated: [task: Task]
}

export class ClineProvider
Expand Down Expand Up @@ -380,6 +374,7 @@ export class ClineProvider
// Errors from terminal commands seem to get swallowed / ignored.
vscode.window.showErrorMessage(error.message)
}

throw error
}
}
Expand Down Expand Up @@ -526,7 +521,7 @@ export class ClineProvider
// of tasks, each one being a sub task of the previous one until the main
// task is finished.
public async initClineWithTask(
task?: string,
text?: string,
images?: string[],
parentTask?: Task,
options: Partial<
Expand All @@ -549,30 +544,30 @@ export class ClineProvider
throw new OrganizationAllowListViolationError(t("common:errors.violated_organization_allowlist"))
}

const cline = new Task({
const task = new Task({
provider: this,
apiConfiguration,
enableDiff,
enableCheckpoints,
fuzzyMatchThreshold,
consecutiveMistakeLimit: apiConfiguration.consecutiveMistakeLimit,
task,
task: text,
images,
experiments,
rootTask: this.clineStack.length > 0 ? this.clineStack[0] : undefined,
parentTask,
taskNumber: this.clineStack.length + 1,
onCreated: (cline) => this.emit("clineCreated", cline),
onCreated: (instance) => this.emit("taskCreated", instance),
...options,
})

await this.addClineToStack(cline)
await this.addClineToStack(task)

this.log(
`[subtasks] ${cline.parentTask ? "child" : "parent"} task ${cline.taskId}.${cline.instanceId} instantiated`,
`[subtasks] ${task.parentTask ? "child" : "parent"} task ${task.taskId}.${task.instanceId} instantiated`,
)

return cline
return task
}

public async initClineWithHistoryItem(historyItem: HistoryItem & { rootTask?: Task; parentTask?: Task }) {
Expand Down Expand Up @@ -629,7 +624,7 @@ export class ClineProvider
experiments,
} = await this.getState()

const cline = new Task({
const task = new Task({
provider: this,
apiConfiguration,
enableDiff,
Expand All @@ -641,14 +636,16 @@ export class ClineProvider
rootTask: historyItem.rootTask,
parentTask: historyItem.parentTask,
taskNumber: historyItem.number,
onCreated: (cline) => this.emit("clineCreated", cline),
onCreated: (instance) => this.emit("taskCreated", instance),
})

await this.addClineToStack(cline)
await this.addClineToStack(task)

this.log(
`[subtasks] ${cline.parentTask ? "child" : "parent"} task ${cline.taskId}.${cline.instanceId} instantiated`,
`[subtasks] ${task.parentTask ? "child" : "parent"} task ${task.taskId}.${task.instanceId} instantiated`,
)
return cline

return task
}

public async postMessageToWebview(message: ExtensionMessage) {
Expand Down Expand Up @@ -1979,3 +1976,5 @@ export class ClineProvider
}
}
}

class OrganizationAllowListViolationError extends Error {}
2 changes: 1 addition & 1 deletion src/extension/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class API extends EventEmitter<RooCodeEvents> implements RooCodeAPI {
}

private registerListeners(provider: ClineProvider) {
provider.on("clineCreated", (cline) => {
provider.on("taskCreated", (cline) => {
cline.on("taskStarted", async () => {
this.emit(RooCodeEventName.TaskStarted, cline.taskId)
this.taskMap.set(cline.taskId, provider)
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
"publish:marketplace": "vsce publish --no-dependencies && ovsx publish --no-dependencies",
"watch:bundle": "pnpm bundle --watch",
"watch:tsc": "cd .. && tsc --noEmit --watch --project src/tsconfig.json",
"clean": "rimraf README.md CHANGELOG.md LICENSE dist mock .turbo"
"clean": "rimraf README.md CHANGELOG.md LICENSE dist logs mock .turbo"
},
"dependencies": {
"@anthropic-ai/bedrock-sdk": "^0.10.2",
Expand Down
15 changes: 10 additions & 5 deletions src/services/marketplace/MarketplaceManager.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import * as vscode from "vscode"
import * as fs from "fs/promises"
import * as path from "path"

import * as vscode from "vscode"
import * as yaml from "yaml"
import { RemoteConfigLoader } from "./RemoteConfigLoader"
import { SimpleInstaller } from "./SimpleInstaller"

import type { MarketplaceItem, MarketplaceItemType, McpMarketplaceItem, OrganizationSettings } from "@roo-code/types"
import { TelemetryService } from "@roo-code/telemetry"
import { CloudService } from "@roo-code/cloud"

import { GlobalFileNames } from "../../shared/globalFileNames"
import { ensureSettingsDirectoryExists } from "../../utils/globalContext"
import { t } from "../../i18n"
import { TelemetryService } from "@roo-code/telemetry"
import type { CustomModesManager } from "../../core/config/CustomModesManager"
import { CloudService } from "@roo-code/cloud"

import { RemoteConfigLoader } from "./RemoteConfigLoader"
import { SimpleInstaller } from "./SimpleInstaller"

export interface MarketplaceItemsResponse {
organizationMcps: MarketplaceItem[]
Expand All @@ -35,6 +39,7 @@ export class MarketplaceManager {
const errors: string[] = []

let orgSettings: OrganizationSettings | undefined

try {
if (CloudService.hasInstance() && CloudService.instance.isAuthenticated()) {
orgSettings = CloudService.instance.getOrganizationSettings()
Expand Down
1 change: 1 addition & 0 deletions src/shared/ProfileValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export class ProfileValidator {
}

const providerAllowList = allowList.providers[providerName]

if (!providerAllowList) {
return false
}
Expand Down