MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / applyMigrationDryRun

Function applyMigrationDryRun

src/commands/mcp.ts:421–437  ·  view source on GitHub ↗

Pure classification pass that mirrors `applyMigration` but never writes. * Used by `--dry-run` and the default preview to surface the skipped count * without touching the file.

(entries: MigrationEntry[])

Source from the content-addressed store, hash-verified

419 * Used by `--dry-run` and the default preview to surface the skipped count
420 * without touching the file. */
421function applyMigrationDryRun(entries: MigrationEntry[]): {
422 added: string[]
423 skipped: { entry: MigrationEntry; reason: string }[]
424} {
425 const settings = loadSettings()
426 const existing = settings.mcpServers ?? {}
427 const added: string[] = []
428 const skipped: { entry: MigrationEntry; reason: string }[] = []
429 for (const entry of entries) {
430 if (entry.name in existing) {
431 skipped.push({ entry, reason: "already exists in ~/.orbcode/settings.json" })
432 } else {
433 added.push(entry.key)
434 }
435 }
436 return { added, skipped }
437}

Callers 1

runMigrateFunction · 0.85

Calls 1

loadSettingsFunction · 0.85

Tested by

no test coverage detected