Skip to content

Commit 08dc816

Browse files
committed
feat: update api types and task stop confirmation copy
1 parent d6408f2 commit 08dc816

File tree

3 files changed

+49
-36
lines changed

3 files changed

+49
-36
lines changed

frontend/src/api/Api.ts

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ export enum ConstsTransactionKind {
162162
TransactionKindUltraAutoRenew = "ultra_auto_renew",
163163
TransactionKindProUpgradeRefund = "pro_upgrade_refund",
164164
TransactionKindDailyGrant = "daily_grant",
165+
TransactionKindMCPToolConsumption = "mcp_tool_consumption",
165166
TransactionKindTopUp = "top_up",
166167
TransactionKindCheckin = "checkin",
167168
}
@@ -602,6 +603,28 @@ export interface DomainGitRepository {
602603
url?: string;
603604
}
604605

606+
export interface DomainHelpAgentChatReq {
607+
captcha_token: string;
608+
message: string;
609+
}
610+
611+
export interface DomainHelpAgentSSEvent {
612+
/** 事件数据 */
613+
data?: DomainHelpAgentSSEventData;
614+
/**
615+
* 事件类型
616+
* @example "text_delta"
617+
*/
618+
event?: "text_delta" | "done" | "error";
619+
}
620+
621+
export interface DomainHelpAgentSSEventData {
622+
/** 文本增量内容(text_delta 事件) */
623+
content?: string;
624+
/** 错误信息(error 事件) */
625+
message?: string;
626+
}
627+
605628
export interface DomainHost {
606629
arch?: string;
607630
cores?: number;
@@ -749,10 +772,6 @@ export interface DomainListTransactionResp {
749772
transactions?: DomainTransactionLog[];
750773
}
751774

752-
export interface DomainListUserMCPToolsResp {
753-
items?: DomainMCPTool[];
754-
}
755-
756775
export interface DomainListUserMCPUpstreamsResp {
757776
items?: DomainMCPUpstream[];
758777
}
@@ -823,6 +842,7 @@ export interface DomainModel {
823842
provider?: string;
824843
temperature?: number;
825844
updated_at?: number;
845+
weight?: number;
826846
}
827847

828848
export interface DomainNotifyChannel {
@@ -1731,7 +1751,6 @@ export interface GitInChaitinNetAiMonkeycodeMonkeycodeAiEntTypesCondition {
17311751
type?: GitInChaitinNetAiMonkeycodeMonkeycodeAiEntTypesConditionType;
17321752
}
17331753

1734-
/** @format int32 */
17351754
export enum GitInChaitinNetAiMonkeycodeMonkeycodeAiEntTypesConditionStatus {
17361755
ConditionStatusCONDITIONSTATUSUNKNOWN = 0,
17371756
ConditionStatusCONDITIONSTATUSINPROGRESS = 1,
@@ -2199,6 +2218,24 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
21992218
...params,
22002219
}),
22012220

2221+
/**
2222+
* @description 流式 SSE 对话,返回 text_delta / done / error 事件
2223+
*
2224+
* @tags helpagent
2225+
* @name V1HelpagentChatCreate
2226+
* @summary HelpAgent 智能助手对话
2227+
* @request POST:/api/v1/helpagent/chat
2228+
*/
2229+
v1HelpagentChatCreate: (body: DomainHelpAgentChatReq, params: RequestParams = {}) =>
2230+
this.request<DomainHelpAgentSSEvent[], GitInChaitinNetGoDevWebResp>({
2231+
path: `/api/v1/helpagent/chat`,
2232+
method: "POST",
2233+
body: body,
2234+
type: ContentType.Json,
2235+
format: "json",
2236+
...params,
2237+
}),
2238+
22022239
/**
22032240
* @description 绑定第三方平台
22042241
*
@@ -4636,30 +4673,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
46364673
...params,
46374674
}),
46384675

4639-
/**
4640-
* @description 获取当前登录用户可使用的 MCP Tool 列表及其启用状态
4641-
*
4642-
* @tags 【用户】MCP 配置
4643-
* @name V1UsersMcpToolsList
4644-
* @summary 获取当前用户可见的 MCP Tool 列表
4645-
* @request GET:/api/v1/users/mcp/tools
4646-
* @secure
4647-
*/
4648-
v1UsersMcpToolsList: (params: RequestParams = {}) =>
4649-
this.request<
4650-
GithubComGoYokoWebResp & {
4651-
data?: DomainListUserMCPToolsResp;
4652-
},
4653-
GithubComGoYokoWebResp
4654-
>({
4655-
path: `/api/v1/users/mcp/tools`,
4656-
method: "GET",
4657-
secure: true,
4658-
type: ContentType.Json,
4659-
format: "json",
4660-
...params,
4661-
}),
4662-
46634676
/**
46644677
* @description 更新当前登录用户指定 MCP Tool 的启用状态
46654678
*

frontend/src/components/console/nav/nav-project.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export default function NavProject() {
432432
<AlertDialogHeader>
433433
<AlertDialogTitle>确认终止任务</AlertDialogTitle>
434434
<AlertDialogDescription>
435-
确定要终止任务「{getTaskDisplayName(taskToStop)}」吗?
435+
确定要终止任务「{getTaskDisplayName(taskToStop)}」吗?任务终止后无法恢复。
436436
</AlertDialogDescription>
437437
</AlertDialogHeader>
438438
<AlertDialogFooter>

frontend/src/pages/console/user/tasks.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,12 @@ export default function TasksPage() {
272272
</AlertDialog>
273273
<AlertDialog open={!!taskToStop} onOpenChange={(open) => !open && setTaskToStop(null)}>
274274
<AlertDialogContent>
275-
<AlertDialogHeader>
276-
<AlertDialogTitle>确认终止任务</AlertDialogTitle>
277-
<AlertDialogDescription>
278-
确定要终止任务「{getTaskDisplayName(taskToStop)}」吗?
279-
</AlertDialogDescription>
280-
</AlertDialogHeader>
275+
<AlertDialogHeader>
276+
<AlertDialogTitle>确认终止任务</AlertDialogTitle>
277+
<AlertDialogDescription>
278+
确定要终止任务「{getTaskDisplayName(taskToStop)}」吗?任务终止后无法恢复。
279+
</AlertDialogDescription>
280+
</AlertDialogHeader>
281281
<AlertDialogFooter>
282282
<AlertDialogCancel disabled={stopping}>取消</AlertDialogCancel>
283283
<AlertDialogAction

0 commit comments

Comments
 (0)