chore: format
This commit is contained in:
parent
5544662351
commit
10f180c539
4 changed files with 11 additions and 14 deletions
|
|
@ -11,8 +11,6 @@ import { reloadService, SERVICE_NAMES, services } from "./services/index.js";
|
|||
import { posthogService } from "./telemetry/posthogService.js";
|
||||
import { SlashCommandResult } from "./ui/hooks/useChat.types.js";
|
||||
|
||||
|
||||
|
||||
type CommandHandler = (
|
||||
args: string[],
|
||||
assistant: AssistantConfig,
|
||||
|
|
@ -98,8 +96,6 @@ function handleWhoami() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const commandHandlers: Record<string, CommandHandler> = {
|
||||
help: handleHelp,
|
||||
clear: () => {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ const ConfigSelector: React.FC<ConfigSelectorProps> = ({
|
|||
const organizations = await listUserOrganizations();
|
||||
const allOrgs = [
|
||||
{ id: null, name: "Personal" }, // Personal organization
|
||||
...(organizations || [])
|
||||
...(organizations || []),
|
||||
];
|
||||
|
||||
// Fetch assistants for each organization
|
||||
|
|
@ -81,7 +81,7 @@ const ConfigSelector: React.FC<ConfigSelectorProps> = ({
|
|||
return assistants.map((assistant) => {
|
||||
const displayName = `[${org.name}] ${assistant.ownerSlug}/${assistant.packageSlug}`;
|
||||
// Create unique ID that includes org info to avoid conflicts
|
||||
const uniqueId = `${org.id || 'personal'}-${assistant.packageSlug}`;
|
||||
const uniqueId = `${org.id || "personal"}-${assistant.packageSlug}`;
|
||||
return {
|
||||
id: uniqueId,
|
||||
name: displayName,
|
||||
|
|
@ -91,7 +91,10 @@ const ConfigSelector: React.FC<ConfigSelectorProps> = ({
|
|||
};
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(`Failed to load assistants for org ${org.name}:`, err);
|
||||
console.error(
|
||||
`Failed to load assistants for org ${org.name}:`,
|
||||
err,
|
||||
);
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
|
@ -118,9 +121,10 @@ const ConfigSelector: React.FC<ConfigSelectorProps> = ({
|
|||
// Find the matching config by slug and organization
|
||||
const packageSlug = assistantSlug.split("/")[1];
|
||||
const matchingConfig = options.find(
|
||||
(opt) => opt.type === "assistant" &&
|
||||
opt.slug === assistantSlug &&
|
||||
opt.organizationId === currentOrganizationId
|
||||
(opt) =>
|
||||
opt.type === "assistant" &&
|
||||
opt.slug === assistantSlug &&
|
||||
opt.organizationId === currentOrganizationId,
|
||||
);
|
||||
currentId = matchingConfig?.id || null;
|
||||
} else if (fs.existsSync(CONFIG_PATH)) {
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ export async function initChatHistory(
|
|||
return history;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Handle /config command
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@ import { exec } from "child_process";
|
|||
import * as path from "path";
|
||||
|
||||
import { env } from "../../env.js";
|
||||
import { services, reloadService } from "../../services/index.js";
|
||||
import { SERVICE_NAMES } from "../../services/types.js";
|
||||
import { services } from "../../services/index.js";
|
||||
import { useNavigation } from "../context/NavigationContext.js";
|
||||
|
||||
interface ConfigOption {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue