MCPcopy Create free account
hub / github.com/MatterAIOrg/OrbCode / appendPromptHistory

Function appendPromptHistory

src/config/promptHistory.ts:22–35  ·  view source on GitHub ↗
(entry: string)

Source from the content-addressed store, hash-verified

20}
21
22export function appendPromptHistory(entry: string): void {
23 try {
24 const history = loadPromptHistory()
25 // Like shells: skip consecutive duplicates.
26 if (history[history.length - 1] === entry) return
27 history.push(entry)
28 fs.mkdirSync(getConfigDir(), { recursive: true })
29 fs.writeFileSync(historyPath(), JSON.stringify(history.slice(-MAX_HISTORY), null, "\t") + "\n", {
30 mode: 0o600,
31 })
32 } catch {
33 // history is best-effort
34 }
35}

Callers 1

submitFunction · 0.85

Calls 3

loadPromptHistoryFunction · 0.85
getConfigDirFunction · 0.85
historyPathFunction · 0.85

Tested by

no test coverage detected