MCPcopy
hub / github.com/anomalyco/opencode / clear

Method clear

packages/function/src/api.ts:98–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96 }
97
98 async clear() {
99 const sessionID = await this.getSessionID()
100 const list = await this.env.Bucket.list({
101 prefix: `session/message/${sessionID}/`,
102 limit: 1000,
103 })
104 for (const item of list.objects) {
105 await this.env.Bucket.delete(item.key)
106 }
107 await this.env.Bucket.delete(`session/info/${sessionID}`)
108 await this.ctx.storage.deleteAll()
109 }
110
111 static shortName(id: string) {
112 return id.substring(id.length - 8)

Callers 15

api.tsFile · 0.45
registerIpcHandlersFunction · 0.45
stopAndFlushFunction · 0.45
startFunction · 0.45
checkFunction · 0.45
startFunction · 0.45
clearFunction · 0.45
registerWslIpcHandlersFunction · 0.45
stopAllFunction · 0.45
showFunction · 0.45
showFunction · 0.45
showFunction · 0.45

Calls 3

getSessionIDMethod · 0.95
listMethod · 0.65
deleteMethod · 0.45

Tested by 1

destroyFunction · 0.36