fix: 补充 ClientConfig 接口和 clientConfig() 方法
This commit is contained in:
parent
0d72c189b3
commit
5430437bfd
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue