Files
Vincent Koc 1fc5b2b703 feat(migrations): add plugin-owned Hermes import
* 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>
2026-04-27 00:34:29 -07:00

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 });
},
};
}