mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
* feat: add migration providers * feat: offer Hermes migration during onboarding * feat(hermes): map imported config surfaces * feat(onboard): require fresh migration imports * docs(cli): clarify Hermes import coverage * chore(migrations): rename Hermes importer package * chore(migrations): rewire Hermes importer id * fix(migrations): redact migration JSON details * fix(hermes): use provider runtime for config imports * test(hermes): cover missing source planning --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import type {
|
|
MigrationPlan,
|
|
MigrationProviderContext,
|
|
MigrationProviderPlugin,
|
|
} from "openclaw/plugin-sdk/plugin-entry";
|
|
import { applyHermesPlan } from "./apply.js";
|
|
import { buildHermesPlan } from "./plan.js";
|
|
import { discoverHermesSource, hasHermesSource } from "./source.js";
|
|
|
|
export function buildHermesMigrationProvider(
|
|
params: {
|
|
runtime?: MigrationProviderContext["runtime"];
|
|
} = {},
|
|
): MigrationProviderPlugin {
|
|
return {
|
|
id: "hermes",
|
|
label: "Hermes",
|
|
description: "Import Hermes config, memories, skills, and supported credentials.",
|
|
async detect(ctx) {
|
|
const source = await discoverHermesSource(ctx.source);
|
|
const found = hasHermesSource(source);
|
|
return {
|
|
found,
|
|
source: source.root,
|
|
label: "Hermes",
|
|
confidence: found ? "high" : "low",
|
|
message: found ? "Hermes state found." : "Hermes state not found.",
|
|
};
|
|
},
|
|
plan: buildHermesPlan,
|
|
async apply(ctx, plan?: MigrationPlan) {
|
|
return await applyHermesPlan({ ctx, plan, runtime: params.runtime });
|
|
},
|
|
};
|
|
}
|