MCPcopy Create free account
hub / github.com/cortexkit/magic-context / promptMemoryAction

Function promptMemoryAction

packages/cli/src/commands/migrate-session.ts:447–470  ·  view source on GitHub ↗
(plan: MigrateSessionPlan)

Source from the content-addressed store, hash-verified

445}
446
447async function promptMemoryAction(plan: MigrateSessionPlan): Promise<MemoryAction> {
448 const all = plan.injectableMemoryCount;
449 const originated = plan.originatedMemoryCount;
450 promptIO.note(
451 `${all} memory${all === 1 ? "" : "ies"} live under the current project ` +
452 `(${plan.fromMcIdentity}); ${originated} of them originated from this session.`,
453 "Memories",
454 );
455 const choice = await promptIO.selectOne("How should memories be handled?", [
456 {
457 label: `Move only memories originated from this session (${originated})`,
458 value: "move-originated",
459 recommended: true,
460 },
461 { label: `Move all memories of this project (${all})`, value: "move-all" },
462 {
463 label: `Copy only memories originated from this session (${originated})`,
464 value: "copy-originated",
465 },
466 { label: `Copy all memories of this project (${all})`, value: "copy-all" },
467 { label: "Leave memories as is", value: "leave" },
468 ]);
469 return choice as MemoryAction;
470}
471
472export async function runMigrateSessionCli(args: string[]): Promise<number> {
473 if (args.includes("--help") || args.includes("-h")) {

Callers 1

runMigrateSessionCliFunction · 0.85

Calls 2

noteMethod · 0.65
selectOneMethod · 0.65

Tested by

no test coverage detected