(plan: MigrateSessionPlan)
| 445 | } |
| 446 | |
| 447 | async 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 | |
| 472 | export async function runMigrateSessionCli(args: string[]): Promise<number> { |
| 473 | if (args.includes("--help") || args.includes("-h")) { |
no test coverage detected