Initial commit: Product OS platform
- Control Plane API with Gemini integration - Executors: Deploy, Analytics, Marketing - MCP Adapter for Continue integration - VSCode/VSCodium extension - Tool registry and run tracking - In-memory storage for local dev - Terraform infrastructure setup
This commit is contained in:
23
platform/backend/control-plane/src/storage/index.ts
Normal file
23
platform/backend/control-plane/src/storage/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Storage adapter that switches between GCP (Firestore/GCS) and in-memory
|
||||
*/
|
||||
import { config } from "../config.js";
|
||||
import * as memory from "./memory.js";
|
||||
import * as firestore from "./firestore.js";
|
||||
import * as gcs from "./gcs.js";
|
||||
|
||||
const useMemory = config.storageMode === "memory";
|
||||
|
||||
if (useMemory) {
|
||||
console.log("💾 Using in-memory storage (set GCP_PROJECT_ID for Firestore/GCS)");
|
||||
memory.seedTools();
|
||||
} else {
|
||||
console.log(`☁️ Using GCP storage (project: ${config.projectId})`);
|
||||
}
|
||||
|
||||
// Export unified interface
|
||||
export const saveRun = useMemory ? memory.saveRun : firestore.saveRun;
|
||||
export const getRun = useMemory ? memory.getRun : firestore.getRun;
|
||||
export const saveTool = useMemory ? memory.saveTool : firestore.saveTool;
|
||||
export const listTools = useMemory ? memory.listTools : firestore.listTools;
|
||||
export const writeArtifactText = useMemory ? memory.writeArtifactText : gcs.writeArtifactText;
|
||||
Reference in New Issue
Block a user