fix: 补充 ClientConfig 接口和 clientConfig() 方法

This commit is contained in:
ywkj 2026-04-26 20:14:59 +08:00
parent 0d72c189b3
commit 5430437bfd
1 changed files with 21 additions and 0 deletions

View File

@ -55,6 +55,20 @@ export interface SessionResponse {
hookToken?: string;
}
export interface ClientConfig {
clientId: string;
name: string;
status: string;
metadata: {
provider?: {
api_key?: string;
base_url?: string;
model?: string;
};
[key: string]: unknown;
};
}
export interface SkillClientOptions {
apiBase?: string;
dryRun?: boolean;
@ -91,6 +105,13 @@ export class SkillClient {
return JSON.parse(runCli('session'));
}
async clientConfig(): Promise<ClientConfig> {
if (this.dryRun) {
return { clientId: '<dry-run>', name: '<dry-run>', status: 'active', metadata: {} };
}
return JSON.parse(runCli('client-config'));
}
async get(urlPath: string): Promise<ApiResponse> {
return this.request('GET', urlPath);
}