Skip to content

Commit 80f7986

Browse files
committed
feat: add ToolCall component
1 parent c83c28e commit 80f7986

26 files changed

Lines changed: 1458 additions & 2 deletions

packages/x/components/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ export type {
3535
ThoughtChainProps,
3636
} from './thought-chain';
3737
export { default as ThoughtChain } from './thought-chain';
38+
export type {
39+
ToolCallError,
40+
ToolCallItem,
41+
ToolCallProps,
42+
ToolCallRef,
43+
ToolCallSemanticType,
44+
ToolCallStatus,
45+
} from './tool-call';
46+
export { default as ToolCall } from './tool-call';
3847
export { default as version } from './version';
3948
export type { WelcomeProps } from './welcome';
4049
export { default as Welcome } from './welcome';

packages/x/components/locale/en_US.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ const localeValues: Required<xLocale> = {
3535
noService: 'File content service not configured',
3636
loadFailed: 'Failed to load file',
3737
},
38+
ToolCall: {
39+
status: {
40+
pending: 'Pending',
41+
streaming: 'Receiving arguments',
42+
running: 'Running',
43+
completed: 'Completed',
44+
failed: 'Failed',
45+
cancelled: 'Cancelled',
46+
},
47+
retry: 'Retry',
48+
copyResult: 'Copy result',
49+
expand: 'Expand details',
50+
collapse: 'Collapse details',
51+
arguments: 'Arguments',
52+
result: 'Result',
53+
error: 'Error',
54+
},
3855
};
3956

4057
export default localeValues;

packages/x/components/locale/index.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ export interface xLocale {
4343
noService: string;
4444
loadFailed: string;
4545
};
46+
ToolCall?: {
47+
status: Record<
48+
'pending' | 'streaming' | 'running' | 'completed' | 'failed' | 'cancelled',
49+
string
50+
>;
51+
retry: string;
52+
copyResult: string;
53+
expand: string;
54+
collapse: string;
55+
arguments: string;
56+
result: string;
57+
error: string;
58+
};
4659
}
4760

4861
export type Locale = xLocale & antdLocale;

packages/x/components/locale/zh_CN.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ const localeValues: Required<xLocale> = {
3535
noService: '未配置文件内容服务',
3636
loadFailed: '加载文件失败',
3737
},
38+
ToolCall: {
39+
status: {
40+
pending: '等待执行',
41+
streaming: '正在接收参数',
42+
running: '正在执行',
43+
completed: '已完成',
44+
failed: '执行失败',
45+
cancelled: '已取消',
46+
},
47+
retry: '重试',
48+
copyResult: '复制结果',
49+
expand: '展开详情',
50+
collapse: '收起详情',
51+
arguments: '参数',
52+
result: '结果',
53+
error: '错误',
54+
},
3855
};
3956

4057
export default localeValues;

packages/x/components/theme/interface/components.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type { ComponentToken as SourcesComponentToken } from '../../sources/styl
1212
import type { ComponentToken as SuggestionComponentToken } from '../../suggestion/style';
1313
import type { ComponentToken as ThinkComponentToken } from '../../think/style';
1414
import type { ComponentToken as ThoughtChainComponentToken } from '../../thought-chain/style';
15+
import type { ComponentToken as ToolCallComponentToken } from '../../tool-call/style';
1516
import type { ComponentToken as WelcomeComponentToken } from '../../welcome/style';
1617

1718
export interface ComponentTokenMap {
@@ -23,6 +24,7 @@ export interface ComponentTokenMap {
2324
Suggestion?: SuggestionComponentToken;
2425
Think?: ThinkComponentToken;
2526
ThoughtChain?: ThoughtChainComponentToken;
27+
ToolCall?: ToolCallComponentToken;
2628
Welcome?: WelcomeComponentToken;
2729
Actions?: ActionsToken;
2830
FileCard?: FileCardComponentToken;

0 commit comments

Comments
 (0)