MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / run

Method run

src/command_system/memory_command.py:153–175  ·  view source on GitHub ↗
(self, args: str, context: CommandContext)

Source from the content-addressed store, hash-verified

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
178MEMORY_COMMAND = MemoryCommand(

Callers

nothing calls this directly

Calls 5

build_memory_optionsFunction · 0.85
InteractiveOutcomeClass · 0.85
_display_pathFunction · 0.85
_ensure_fileFunction · 0.70
selectMethod · 0.45

Tested by

no test coverage detected