MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / deleteRepo

Method deleteRepo

deepwiki/deepwiki.ts:278–298  ·  view source on GitHub ↗
(chatKey: string, tag: string)

Source from the content-addressed store, hash-verified

276 }
277
278 async deleteRepo(chatKey: string, tag: string): Promise<boolean> {
279 this.ensureReady();
280 const main = await this.ensureMainChat(chatKey);
281 if (!main.repos?.[tag]) return false;
282
283 delete main.repos[tag];
284 if (main.currentTag === tag) main.currentTag = "";
285
286 const key = this.gk(chatKey);
287 this.dbMain.data!.chats[key] = main;
288 await this.dbMain.write();
289
290 const ctx = await this.ensureCtxChat(chatKey);
291 if (ctx.contextTurns?.[tag]) {
292 delete ctx.contextTurns[tag];
293 this.dbCtx.data!.chats[key] = ctx;
294 await this.dbCtx.write();
295 }
296
297 return true;
298 }
299
300 async setCurrent(chatKey: string, tag: string): Promise<void> {
301 this.ensureReady();

Callers 1

DeepWikiPluginClass · 0.80

Calls 5

ensureReadyMethod · 0.95
ensureMainChatMethod · 0.95
gkMethod · 0.95
ensureCtxChatMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected