mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 04:18:05 +00:00
feat(dashboard): enrich droid docs and quick settings controls
- add reusable compatible-CLI docs registry with external provider fact-check links - render docs links in Droid notes panel and keep future CLI extension points - add left-column quick controls for key settings.json fields (reasoning/autonomy/diff/automation)
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
export interface CompatibleCliDocLink {
|
||||
id: string;
|
||||
label: string;
|
||||
url: string;
|
||||
category: 'overview' | 'configuration' | 'byok' | 'reference';
|
||||
source: 'factory' | 'provider';
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface CompatibleCliProviderDocLink {
|
||||
provider: string;
|
||||
label: string;
|
||||
apiFormat: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface CompatibleCliDocsReference {
|
||||
providerValues: string[];
|
||||
settingsHierarchy: string[];
|
||||
notes: string[];
|
||||
links: CompatibleCliDocLink[];
|
||||
providerDocs: CompatibleCliProviderDocLink[];
|
||||
}
|
||||
|
||||
interface CompatibleCliDocsRegistryEntry {
|
||||
cliId: string;
|
||||
displayName: string;
|
||||
docsReference: CompatibleCliDocsReference;
|
||||
}
|
||||
|
||||
const COMPATIBLE_CLI_DOCS_REGISTRY: Record<string, CompatibleCliDocsRegistryEntry> = {
|
||||
droid: {
|
||||
cliId: 'droid',
|
||||
displayName: 'Droid CLI',
|
||||
docsReference: {
|
||||
providerValues: ['anthropic', 'openai', 'generic-chat-completion-api'],
|
||||
settingsHierarchy: [
|
||||
'project-level config',
|
||||
'user-level config',
|
||||
'home-level config',
|
||||
'CLI flags and env vars',
|
||||
],
|
||||
notes: [
|
||||
'BYOK custom models are read from ~/.factory/settings.json customModels[]',
|
||||
'Factory docs mention legacy support for ~/.factory/config.json',
|
||||
'Interactive model selection uses settings.model (custom:<alias>)',
|
||||
'droid exec supports --model for one-off execution mode',
|
||||
],
|
||||
links: [
|
||||
{
|
||||
id: 'droid-cli-overview',
|
||||
label: 'Droid CLI Overview',
|
||||
url: 'https://docs.factory.ai/cli/',
|
||||
category: 'overview',
|
||||
source: 'factory',
|
||||
description: 'Primary entry docs for setup, auth, and core CLI usage.',
|
||||
},
|
||||
{
|
||||
id: 'droid-byok-overview',
|
||||
label: 'BYOK Overview',
|
||||
url: 'https://docs.factory.ai/cli/byok/overview/',
|
||||
category: 'byok',
|
||||
source: 'factory',
|
||||
description: 'BYOK model/provider shape, provider values, and migration notes.',
|
||||
},
|
||||
{
|
||||
id: 'droid-settings-reference',
|
||||
label: 'settings.json Reference',
|
||||
url: 'https://docs.factory.ai/cli/configuration/settings/',
|
||||
category: 'configuration',
|
||||
source: 'factory',
|
||||
description: 'Supported settings keys, defaults, and allowed values.',
|
||||
},
|
||||
],
|
||||
providerDocs: [
|
||||
{
|
||||
provider: 'anthropic',
|
||||
label: 'Anthropic Messages API',
|
||||
apiFormat: 'Messages API',
|
||||
url: 'https://docs.anthropic.com/en/api/messages',
|
||||
},
|
||||
{
|
||||
provider: 'openai',
|
||||
label: 'OpenAI Responses API',
|
||||
apiFormat: 'Responses API',
|
||||
url: 'https://platform.openai.com/docs/api-reference/responses',
|
||||
},
|
||||
{
|
||||
provider: 'generic-chat-completion-api',
|
||||
label: 'OpenAI Chat Completions Spec',
|
||||
apiFormat: 'Chat Completions API',
|
||||
url: 'https://platform.openai.com/docs/api-reference/chat',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export function getCompatibleCliDocsReference(cliId: string): CompatibleCliDocsReference {
|
||||
const entry = COMPATIBLE_CLI_DOCS_REGISTRY[cliId];
|
||||
if (!entry) {
|
||||
throw new Error(`Unsupported compatible CLI docs reference: ${cliId}`);
|
||||
}
|
||||
return entry.docsReference;
|
||||
}
|
||||
@@ -44,6 +44,30 @@ export interface DroidByokDiagnostics {
|
||||
customModels: DroidCustomModelDiagnostics[];
|
||||
}
|
||||
|
||||
export interface CompatibleCliDocLink {
|
||||
id: string;
|
||||
label: string;
|
||||
url: string;
|
||||
category: 'overview' | 'configuration' | 'byok' | 'reference';
|
||||
source: 'factory' | 'provider';
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface CompatibleCliProviderDocLink {
|
||||
provider: string;
|
||||
label: string;
|
||||
apiFormat: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface CompatibleCliDocsReference {
|
||||
providerValues: string[];
|
||||
settingsHierarchy: string[];
|
||||
notes: string[];
|
||||
links: CompatibleCliDocLink[];
|
||||
providerDocs: CompatibleCliProviderDocLink[];
|
||||
}
|
||||
|
||||
export interface DroidDashboardDiagnostics {
|
||||
binary: DroidBinaryDiagnostics;
|
||||
files: {
|
||||
@@ -52,11 +76,7 @@ export interface DroidDashboardDiagnostics {
|
||||
};
|
||||
byok: DroidByokDiagnostics;
|
||||
warnings: string[];
|
||||
docsReference: {
|
||||
providerValues: string[];
|
||||
settingsHierarchy: string[];
|
||||
notes: string[];
|
||||
};
|
||||
docsReference: CompatibleCliDocsReference;
|
||||
}
|
||||
|
||||
export interface DroidRawSettingsResponse {
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
probeJsonObjectFile,
|
||||
writeJsonObjectFileAtomic,
|
||||
} from './compatible-cli-json-file-service';
|
||||
import { getCompatibleCliDocsReference } from './compatible-cli-docs-registry';
|
||||
|
||||
interface DroidConfigPaths {
|
||||
settingsPath: string;
|
||||
@@ -160,6 +161,7 @@ export function summarizeDroidCustomModels(customModelsValue: unknown): DroidByo
|
||||
export async function getDroidDashboardDiagnostics(): Promise<DroidDashboardDiagnostics> {
|
||||
const paths = resolveDroidConfigPaths();
|
||||
const binaryPath = detectDroidCli();
|
||||
const docsReference = getCompatibleCliDocsReference('droid');
|
||||
|
||||
const source = process.env.CCS_DROID_PATH ? 'CCS_DROID_PATH' : binaryPath ? 'PATH' : 'missing';
|
||||
|
||||
@@ -204,21 +206,7 @@ export async function getDroidDashboardDiagnostics(): Promise<DroidDashboardDiag
|
||||
},
|
||||
byok,
|
||||
warnings,
|
||||
docsReference: {
|
||||
providerValues: ['anthropic', 'openai', 'generic-chat-completion-api'],
|
||||
settingsHierarchy: [
|
||||
'project-level config',
|
||||
'user-level config',
|
||||
'home-level config',
|
||||
'CLI flags and env vars',
|
||||
],
|
||||
notes: [
|
||||
'BYOK custom models are read from ~/.factory/settings.json customModels[]',
|
||||
'Factory docs mention legacy support for ~/.factory/config.json',
|
||||
'Interactive model selection uses settings.model (custom:<alias>)',
|
||||
'droid exec supports --model for one-off execution mode',
|
||||
],
|
||||
},
|
||||
docsReference,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user