forked from continuedev/continue
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add config metadata for server * wip, add interfaces, read/write config * toggle configuration support * remove project id set in activation * remove unnecessary imports * add toggle back * inventory toggle * wip mem0 memories panel UI * icons * page control * add filtering * Added in-place editing of memories * add handle delete shell + remove cancel/save buttons * fix issues * add button * Add key listeners for editing * Add to homepage + shortcut * Add card with instructions and intro when no memories * Add batch update * handle batch, cancel changes * add stop event propagation for delete card * clean up and add colours for edits * new status bug * align center edit status * fix no memories card * Remove react. * Remove wrong keyboard event type * filter message * add no memories found card * add badge * better margins * add messaging protocol * fix UI bugs * delete on erasing memory + enter * clean up * add undo for delete * improvements for ui * fetch all memories complete * working version, pre-cleanup * rdy for production, add redux state for memories * camel case * remove console logs --------- Co-authored-by: Duke Pan <[email protected]>
- Loading branch information
1 parent
e5d17c7
commit 4d695bc
Showing
21 changed files
with
865 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* eslint-disable @typescript-eslint/naming-convention */ | ||
import { SERVER_URL } from "core/util/parameters"; | ||
import { getHeaders } from "core/pearaiServer/stubs/headers"; | ||
import { MemoryChange } from "../../util/integrationUtils"; | ||
import * as vscode from 'vscode'; | ||
|
||
export async function getMem0Memories(repo_id: string) { | ||
try { | ||
const baseHeaders = await getHeaders(); | ||
const auth: any = await vscode.commands.executeCommand("pearai.getPearAuth"); | ||
const response = await fetch(`${SERVER_URL}/integrations/memory/${repo_id}`, { | ||
method: "GET", | ||
headers: { | ||
...baseHeaders, | ||
"Content-Type": "application/json", | ||
Authorization: `Bearer ${auth.accessToken}`, | ||
}, | ||
}); | ||
|
||
if (!response.ok) { | ||
const errorData = await response.json(); | ||
throw new Error(errorData.detail || `${response.statusText}`); | ||
} | ||
|
||
const data = await response.json(); | ||
return data; | ||
} catch (error) { | ||
// Show error message in VSCode | ||
vscode.window.showErrorMessage(`Error fetching memories: ${(error as any).message}`); | ||
} | ||
} | ||
|
||
export async function updateMem0Memories(repo_id: string, changes: MemoryChange[]) { | ||
const baseHeaders = await getHeaders(); | ||
const auth: any = await vscode.commands.executeCommand("pearai.getPearAuth"); | ||
|
||
const response = await fetch(`${SERVER_URL}/integrations/memory/update`, { | ||
method: "POST", | ||
headers: { | ||
...baseHeaders, | ||
"Content-Type": "application/json", | ||
Authorization: `Bearer ${auth.accessToken}`, | ||
}, | ||
body: JSON.stringify({ | ||
id: repo_id, | ||
updatedMemories: changes, | ||
}), | ||
}); | ||
return await response.json(); | ||
} |
Oops, something went wrong.