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

Method setHistory

packages/core/src/core/client.ts:177–204  ·  view source on GitHub ↗
(
    history: Content[],
    { stripThoughts = false }: { stripThoughts?: boolean } = {},
  )

Source from the content-addressed store, hash-verified

175 }
176
177 setHistory(
178 history: Content[],
179 { stripThoughts = false }: { stripThoughts?: boolean } = {},
180 ) {
181 const historyToSet = stripThoughts
182 ? history.map((content) => {
183 const newContent = { ...content };
184 if (newContent.parts) {
185 newContent.parts = newContent.parts.map((part) => {
186 if (
187 part &&
188 typeof part === 'object' &&
189 'thoughtSignature' in part
190 ) {
191 const newPart = { ...part };
192 delete (newPart as { thoughtSignature?: string })
193 .thoughtSignature;
194 return newPart;
195 }
196 return part;
197 });
198 }
199 return newContent;
200 })
201 : history;
202 this.getChat().setHistory(historyToSet);
203 this.forceFullIdeContext = true;
204 }
205
206 async setTools(): Promise<void> {
207 const toolRegistry = await this.config.getToolRegistry();

Callers 5

tryCompressChatMethod · 0.45
client.test.tsFile · 0.45
refreshAuthMethod · 0.45
restoreActionFunction · 0.45
useSlashCommandProcessorFunction · 0.45

Calls 1

getChatMethod · 0.95

Tested by

no test coverage detected