mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
* feat: remove Roomote Control from extension Remove all Roomote Control (remote control) functionality: - Remove BridgeOrchestrator and entire bridge directory from @roo-code/cloud - Remove remoteControlEnabled, featureRoomoteControlEnabled from extension state - Remove extensionBridgeEnabled from CloudUserInfo and user settings - Remove roomoteControlEnabled from organization/user feature schemas - Remove enableBridge from Task and ClineProvider - Remove remote control toggle from CloudView UI - Remove remoteControlEnabled message handler - Remove extension bridge disconnect on logout/deactivate - Update CloudTaskButton to show for all logged-in users - Remove remote control translation strings from all locales - Update all related tests CLO-765 * fix: remove dead getOrganizationMetadata and unused socket.io-client dep * Readmes * Readmes * Types * fix: remove leftover Roomote Control references from locale READMEs and stale BridgeOrchestrator mock * Removes cloudtaskbutton * fix: remove orphaned qrcode packages and dead openInCloud translation keys * pnpmlock * Revert these * Revert these * Revert these * Remove socket.io --------- Co-authored-by: Roo Code <roomote@roocode.com> Co-authored-by: Bruno Bergher <bruno@roocode.com> Co-authored-by: cte <cestreich@gmail.com>
79 lines
1.9 KiB
TypeScript
79 lines
1.9 KiB
TypeScript
import {
|
|
type SettingsService,
|
|
type UserFeatures,
|
|
type UserSettingsConfig,
|
|
type UserSettingsData,
|
|
OrganizationAllowList,
|
|
OrganizationSettings,
|
|
organizationSettingsSchema,
|
|
ORGANIZATION_ALLOW_ALL,
|
|
} from "@roo-code/types"
|
|
|
|
export class StaticSettingsService implements SettingsService {
|
|
private settings: OrganizationSettings
|
|
private log: (...args: unknown[]) => void
|
|
|
|
constructor(envValue: string, log?: (...args: unknown[]) => void) {
|
|
this.log = log || console.log
|
|
this.settings = this.parseEnvironmentSettings(envValue)
|
|
}
|
|
|
|
private parseEnvironmentSettings(envValue: string): OrganizationSettings {
|
|
try {
|
|
const decodedValue = Buffer.from(envValue, "base64").toString("utf-8")
|
|
const parsedJson = JSON.parse(decodedValue)
|
|
return organizationSettingsSchema.parse(parsedJson)
|
|
} catch (error) {
|
|
this.log(
|
|
`[StaticSettingsService] failed to parse static settings: ${error instanceof Error ? error.message : String(error)}`,
|
|
error,
|
|
)
|
|
|
|
throw new Error("Failed to parse static settings", { cause: error })
|
|
}
|
|
}
|
|
|
|
public getAllowList(): OrganizationAllowList {
|
|
return this.settings?.allowList || ORGANIZATION_ALLOW_ALL
|
|
}
|
|
|
|
public getSettings(): OrganizationSettings | undefined {
|
|
return this.settings
|
|
}
|
|
|
|
/**
|
|
* Returns static user settings with task sync enabled
|
|
*/
|
|
public getUserSettings(): UserSettingsData | undefined {
|
|
return {
|
|
features: {},
|
|
settings: {
|
|
taskSyncEnabled: true,
|
|
},
|
|
version: 1,
|
|
}
|
|
}
|
|
|
|
public getUserFeatures(): UserFeatures {
|
|
return {}
|
|
}
|
|
|
|
public getUserSettingsConfig(): UserSettingsConfig {
|
|
return {
|
|
taskSyncEnabled: true,
|
|
}
|
|
}
|
|
|
|
public async updateUserSettings(_settings: Partial<UserSettingsConfig>): Promise<boolean> {
|
|
throw new Error("User settings updates are not supported in static mode")
|
|
}
|
|
|
|
public isTaskSyncEnabled(): boolean {
|
|
// Static settings always enable task sync
|
|
return true
|
|
}
|
|
|
|
public dispose(): void {
|
|
// No resources to clean up for static settings.
|
|
}
|
|
}
|