refactor: drop orgId, projectId, enableGraph config options, update CLI prompts, and clean up related code (#4734)
This commit is contained in:
+12
-16
@@ -384,10 +384,6 @@ export function registerCliCommands(
|
||||
console.log(` User ID: ${existingAuth.userId}`);
|
||||
if (existingAuth.mode)
|
||||
console.log(` Mode: ${existingAuth.mode}`);
|
||||
if (existingAuth.orgId)
|
||||
console.log(` Org ID: ${existingAuth.orgId}`);
|
||||
if (existingAuth.projectId)
|
||||
console.log(` Project: ${existingAuth.projectId}`);
|
||||
console.log("");
|
||||
|
||||
// Validate existing key before asking
|
||||
@@ -408,7 +404,7 @@ export function registerCliCommands(
|
||||
}
|
||||
|
||||
const reuse = await promptInput(
|
||||
" Keep existing configuration? (Y/n): ",
|
||||
" Keep existing configuration? (y/n): ",
|
||||
);
|
||||
if (
|
||||
reuse === "" ||
|
||||
@@ -432,7 +428,7 @@ export function registerCliCommands(
|
||||
console.log(" 2. Enter API key manually");
|
||||
console.log(" 3. Open-source mode (self-hosted)\n");
|
||||
|
||||
const choice = (await promptInput(" Choice: ", "1")) || "1";
|
||||
const choice = (await promptInput(" Choice (1/2/3): ")) || "1";
|
||||
|
||||
if (choice === "1") {
|
||||
// --- Email interactive flow ---
|
||||
@@ -952,9 +948,6 @@ export function registerCliCommands(
|
||||
email: "userEmail",
|
||||
base_url: "baseUrl",
|
||||
user_id: "userId",
|
||||
org_id: "orgId",
|
||||
project_id: "projectId",
|
||||
enable_graph: "enableGraph",
|
||||
auto_recall: "autoRecall",
|
||||
auto_capture: "autoCapture",
|
||||
top_k: "topK",
|
||||
@@ -969,6 +962,8 @@ export function registerCliCommands(
|
||||
vector_host: "oss.vectorStore.config.host",
|
||||
vector_port: "oss.vectorStore.config.port",
|
||||
collection_name: "oss.vectorStore.config.collectionName",
|
||||
vector_db_name: "oss.vectorStore.config.dbname",
|
||||
vector_db_user: "oss.vectorStore.config.user",
|
||||
vector_db_path: "oss.vectorStore.config.dbPath",
|
||||
history_db_path: "oss.historyDbPath",
|
||||
disable_history: "oss.disableHistory",
|
||||
@@ -979,7 +974,6 @@ export function registerCliCommands(
|
||||
|
||||
// Boolean config fields — coerce "true"/"1"/"yes" on set
|
||||
const BOOLEAN_KEYS = new Set([
|
||||
"enableGraph",
|
||||
"autoRecall",
|
||||
"autoCapture",
|
||||
"oss.disableHistory",
|
||||
@@ -1009,11 +1003,8 @@ export function registerCliCommands(
|
||||
apiKey: auth.apiKey ?? cfg.apiKey,
|
||||
baseUrl: auth.baseUrl ?? cfg.baseUrl ?? "https://api.mem0.ai",
|
||||
userId: auth.userId ?? cfg.userId,
|
||||
orgId: auth.orgId ?? cfg.orgId,
|
||||
projectId: auth.projectId ?? cfg.projectId,
|
||||
mode: auth.mode ?? cfg.mode,
|
||||
userEmail: auth.userEmail,
|
||||
enableGraph: cfg.enableGraph,
|
||||
autoRecall: cfg.autoRecall,
|
||||
autoCapture: cfg.autoCapture,
|
||||
topK: cfg.topK,
|
||||
@@ -1055,9 +1046,6 @@ export function registerCliCommands(
|
||||
entries.push(
|
||||
["api_key", "apiKey"],
|
||||
["email", "userEmail"],
|
||||
["org_id", "orgId"],
|
||||
["project_id", "projectId"],
|
||||
["enable_graph", "enableGraph"],
|
||||
);
|
||||
} else {
|
||||
entries.push(
|
||||
@@ -1238,6 +1226,10 @@ export function registerCliCommands(
|
||||
.description("List recent background events")
|
||||
.action(async () => {
|
||||
try {
|
||||
if (!backend || cfg.mode === "open-source") {
|
||||
console.log("Event tracking is only available in platform mode.");
|
||||
return;
|
||||
}
|
||||
const results = await backend.listEvents();
|
||||
if (!results.length) {
|
||||
console.log("No events found.");
|
||||
@@ -1282,6 +1274,10 @@ export function registerCliCommands(
|
||||
.argument("<event_id>", "Event ID to check")
|
||||
.action(async (eventId: string) => {
|
||||
try {
|
||||
if (!backend || cfg.mode === "open-source") {
|
||||
console.log("Event tracking is only available in platform mode.");
|
||||
return;
|
||||
}
|
||||
const ev = await backend.getEvent(eventId);
|
||||
|
||||
const status = String(ev.status ?? "—");
|
||||
|
||||
@@ -29,11 +29,8 @@ export interface PluginAuthConfig {
|
||||
apiKey?: string;
|
||||
baseUrl?: string;
|
||||
userId?: string;
|
||||
orgId?: string;
|
||||
projectId?: string;
|
||||
userEmail?: string;
|
||||
mode?: string;
|
||||
enableGraph?: boolean;
|
||||
autoRecall?: boolean;
|
||||
autoCapture?: boolean;
|
||||
topK?: number;
|
||||
@@ -76,11 +73,8 @@ export function readPluginAuth(): PluginAuthConfig {
|
||||
apiKey: (cfg.apiKey ?? cfg.api_key) as string | undefined,
|
||||
baseUrl: (cfg.baseUrl ?? cfg.base_url) as string | undefined,
|
||||
userId: (cfg.userId ?? cfg.user_id) as string | undefined,
|
||||
orgId: (cfg.orgId ?? cfg.org_id) as string | undefined,
|
||||
projectId: (cfg.projectId ?? cfg.project_id) as string | undefined,
|
||||
userEmail: (cfg.userEmail ?? cfg.user_email) as string | undefined,
|
||||
mode: cfg.mode as string | undefined,
|
||||
enableGraph: cfg.enableGraph as boolean | undefined,
|
||||
autoRecall: cfg.autoRecall as boolean | undefined,
|
||||
autoCapture: cfg.autoCapture as boolean | undefined,
|
||||
topK: cfg.topK as number | undefined,
|
||||
|
||||
Reference in New Issue
Block a user