MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / importSettings

Function importSettings

src/core/config/importExport.ts:271–293  ·  view source on GitHub ↗
({ providerSettingsManager, contextProxy, customModesManager }: ImportOptions)

Source from the content-addressed store, hash-verified

269 * @returns Promise resolving to import result
270 */
271export const importSettings = async ({ providerSettingsManager, contextProxy, customModesManager }: ImportOptions) => {
272 // Use the last export path as a sensible default, falling back to Downloads
273 const defaultUri = resolveDefaultSaveUri(contextProxy, "lastSettingsExportPath", "roo-code-settings.json", {
274 useWorkspace: false,
275 fallbackDir: path.join(os.homedir(), "Downloads"),
276 })
277
278 const uris = await vscode.window.showOpenDialog({
279 filters: { JSON: ["json"] },
280 canSelectMany: false,
281 defaultUri,
282 })
283
284 if (!uris) {
285 return { success: false, error: "User cancelled file selection" }
286 }
287
288 return importSettingsFromPath(uris[0].fsPath, {
289 providerSettingsManager,
290 contextProxy,
291 customModesManager,
292 })
293}
294
295/**
296 * Import settings from a specific file

Callers 2

Calls 3

resolveDefaultSaveUriFunction · 0.90
importSettingsFromPathFunction · 0.85
showOpenDialogMethod · 0.80

Tested by

no test coverage detected