mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:20:43 +00:00
Add a bundled Claude migration provider for Claude Code and Claude Desktop imports.\n\nIncludes source discovery, preview/apply behavior for instructions, MCP servers, skills and command prompts, archive/manual handling for unsafe Claude state, docs, labeler, and tests.
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import type {
|
|
MigrationPlan,
|
|
MigrationProviderContext,
|
|
MigrationProviderPlugin,
|
|
} from "openclaw/plugin-sdk/plugin-entry";
|
|
import { applyClaudePlan } from "./apply.js";
|
|
import { buildClaudePlan } from "./plan.js";
|
|
import { discoverClaudeSource, hasClaudeSource } from "./source.js";
|
|
|
|
export function buildClaudeMigrationProvider(
|
|
params: {
|
|
runtime?: MigrationProviderContext["runtime"];
|
|
} = {},
|
|
): MigrationProviderPlugin {
|
|
return {
|
|
id: "claude",
|
|
label: "Claude",
|
|
description: "Import Claude Code and Claude Desktop instructions, MCP servers, and skills.",
|
|
async detect(ctx) {
|
|
const source = await discoverClaudeSource(ctx.source);
|
|
const found = hasClaudeSource(source);
|
|
return {
|
|
found,
|
|
source: source.root,
|
|
label: "Claude",
|
|
confidence: found ? source.confidence : "low",
|
|
message: found ? "Claude state found." : "Claude state not found.",
|
|
};
|
|
},
|
|
plan: buildClaudePlan,
|
|
async apply(ctx, plan?: MigrationPlan) {
|
|
return await applyClaudePlan({ ctx, plan, runtime: params.runtime });
|
|
},
|
|
};
|
|
}
|