(self, args: str, context: CommandContext)
| 151 | """Pick a memory file, ensure it exists, and report its path.""" |
| 152 | |
| 153 | async def run(self, args: str, context: CommandContext) -> InteractiveOutcome: |
| 154 | cwd = str(context.cwd) |
| 155 | options = await build_memory_options(cwd) |
| 156 | picked = await context.ui.select("Memory", options) |
| 157 | if picked is None: |
| 158 | # Verbatim TS (memory.tsx:65). |
| 159 | return InteractiveOutcome( |
| 160 | message="Cancelled memory editing", display="system" |
| 161 | ) |
| 162 | try: |
| 163 | _ensure_file(picked) |
| 164 | except Exception as exc: |
| 165 | # Verbatim TS catch shape (memory.tsx:61) — onDone without options. |
| 166 | return InteractiveOutcome( |
| 167 | message=f"Error opening memory file: {exc}", display="user" |
| 168 | ) |
| 169 | return InteractiveOutcome( |
| 170 | message=( |
| 171 | f"Memory file at {_display_path(picked, cwd)}. " |
| 172 | f"Open it in your editor.\n\n{_EDITOR_HINT}" |
| 173 | ), |
| 174 | display="system", # TS uses display:'system' for the success line |
| 175 | ) |
| 176 | |
| 177 | |
| 178 | MEMORY_COMMAND = MemoryCommand( |
nothing calls this directly
no test coverage detected