MCPcopy Index your code
hub / github.com/CommandCodeAI/BaseAI / handleProdSupersetOfLocal

Function handleProdSupersetOfLocal

packages/baseai/src/deploy/index.ts:772–807  ·  view source on GitHub ↗
({
	memory,
	localDocs,
	prodDocs,
	documents,
	account
}: {
	memory: MemoryI;
	localDocs: string[];
	prodDocs: string[];
	documents: MemoryDocumentI[];
	account: Account;
})

Source from the content-addressed store, hash-verified

770}
771
772async function handleProdSupersetOfLocal({
773 memory,
774 localDocs,
775 prodDocs,
776 documents,
777 account
778}: {
779 memory: MemoryI;
780 localDocs: string[];
781 prodDocs: string[];
782 documents: MemoryDocumentI[];
783 account: Account;
784}) {
785 // Show the diff table.
786 printDiffTable(localDocs, prodDocs);
787
788 // Inform user, Memory deploy is currently in beta and can currently only overwrite the prod memory.
789 p.log.warning(
790 `Memory deploy is currently in beta. We only support overwriting the prod memory on Langbase.com.`
791 );
792
793 // Ask user to overwrite.
794 const shouldOverwrite = await p.confirm({
795 message:
796 'Do you want to overwrite the prod memory? This will delete all prod documents.',
797 initialValue: false
798 });
799
800 if (!shouldOverwrite) {
801 p.log.message(`Skipping memory deployment for "${memory.name}".`);
802 return;
803 }
804
805 // Overwrite the prod memory
806 await overwriteMemory({ memory, documents, account });
807}
808
809async function uploadMissingDocumentsToMemory({
810 memory,

Callers 1

Calls 2

printDiffTableFunction · 0.90
overwriteMemoryFunction · 0.85

Tested by

no test coverage detected