MCPcopy Create free account
hub / github.com/anus-dev/ANUS / completion

Function completion

packages/cli/src/ui/commands/restoreCommand.ts:123–143  ·  view source on GitHub ↗
(
  context: CommandContext,
  _partialArg: string,
)

Source from the content-addressed store, hash-verified

121}
122
123async function completion(
124 context: CommandContext,
125 _partialArg: string,
126): Promise<string[]> {
127 const { services } = context;
128 const { config } = services;
129 const checkpointDir = config?.getProjectTempDir()
130 ? path.join(config.getProjectTempDir(), 'checkpoints')
131 : undefined;
132 if (!checkpointDir) {
133 return [];
134 }
135 try {
136 const files = await fs.readdir(checkpointDir);
137 return files
138 .filter((file) => file.endsWith('.json'))
139 .map((file) => file.replace('.json', ''));
140 } catch (_err) {
141 return [];
142 }
143}
144
145export const restoreCommand = (config: Config | null): SlashCommand | null => {
146 if (!config?.getCheckpointingEnabled()) {

Callers

nothing calls this directly

Calls 1

getProjectTempDirMethod · 0.80

Tested by

no test coverage detected