@tbox.cn/app-template-agent 0.7.5 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore +5 -0
- package/.tbox/app.json +9 -1
- package/AGENTS.md +12 -4
- package/ENV.md +105 -21
- package/README.md +40 -38
- package/apps/client/VISUAL_RESTORE.md +11 -11
- package/apps/client/index.html +3 -1
- package/apps/client/package.json +9 -8
- package/apps/client/src/business/App.tsx +4 -4
- package/apps/client/src/business/README.md +5 -11
- package/apps/client/src/cards/registry.ts +23 -8
- package/apps/client/src/main.tsx +36 -2
- package/apps/client/src/modules.ts +7 -4
- package/apps/client/src/pages/index/index.tsx +18 -162
- package/apps/client/src/platform/AgentChatApp.tsx +7 -6
- package/apps/client/src/platform/agent-runtime.ts +5 -0
- package/apps/client/src/store/chat.ts +47 -185
- package/apps/client/src/test/setup.ts +7 -0
- package/apps/client/vite.config.ts +16 -1
- package/apps/server/package.json +0 -3
- package/apps/server/src/app-tools.ts +2 -1
- package/apps/server/src/app.ts +248 -119
- package/apps/server/src/config/integration.ts +2 -6
- package/apps/server/src/dev.ts +0 -1
- package/apps/server/src/intent-routes.ts +3 -3
- package/apps/server/src/modules.ts +4 -4
- package/apps/server/src/pre-tools.ts +4 -3
- package/apps/server/tests/agent-prompt.test.ts +81 -0
- package/apps/server/tests/cards-registry.test.ts +1 -3
- package/apps/server/tests/deployment-loader.test.ts +35 -56
- package/apps/server/tests/tool-runtime.test.ts +25 -61
- package/package.json +5 -4
- package/packages/agent-ui-kit/LICENSE +21 -0
- package/packages/agent-ui-kit/README.md +17 -0
- package/packages/agent-ui-kit/package.json +58 -0
- package/packages/agent-ui-kit/src/ChatPage.less +62 -0
- package/packages/agent-ui-kit/src/ChatPage.tsx +305 -0
- package/packages/agent-ui-kit/src/chat-config.test.ts +82 -0
- package/packages/agent-ui-kit/src/chat-config.ts +62 -0
- package/{apps/client → packages/agent-ui-kit}/src/components/ActionBar/DebugButton.tsx +2 -2
- package/{apps/client → packages/agent-ui-kit}/src/components/ActionBar/index.less +19 -16
- package/{apps/client → packages/agent-ui-kit}/src/components/ActionBar/index.tsx +10 -15
- package/packages/agent-ui-kit/src/components/CardRenderer.tsx +36 -0
- package/packages/agent-ui-kit/src/components/ChatHeader/index.less +148 -0
- package/packages/agent-ui-kit/src/components/ChatHeader/index.test.tsx +74 -0
- package/{apps/client → packages/agent-ui-kit}/src/components/ChatHeader/index.tsx +27 -15
- package/{apps/client → packages/agent-ui-kit}/src/components/ChatInput/index.less +47 -39
- package/packages/agent-ui-kit/src/components/ChatInput/index.test.tsx +156 -0
- package/{apps/client → packages/agent-ui-kit}/src/components/ChatInput/index.tsx +13 -4
- package/{apps/client → packages/agent-ui-kit}/src/components/ChatInput/voice/useVoicePress.ts +2 -2
- package/packages/agent-ui-kit/src/components/HistoryEntry/index.less +49 -0
- package/packages/agent-ui-kit/src/components/HistoryEntry/index.tsx +42 -0
- package/{apps/client → packages/agent-ui-kit}/src/components/MediaList/index.less +3 -3
- package/{apps/client → packages/agent-ui-kit}/src/components/MediaList/index.tsx +6 -6
- package/{apps/client → packages/agent-ui-kit}/src/components/MessageBubble/index.less +25 -20
- package/packages/agent-ui-kit/src/components/MessageBubble/index.test.tsx +112 -0
- package/{apps/client → packages/agent-ui-kit}/src/components/MessageBubble/index.tsx +22 -17
- package/{apps/client → packages/agent-ui-kit}/src/components/PullDownIndicator/index.less +2 -2
- package/{apps/client → packages/agent-ui-kit}/src/components/PullDownIndicator/index.tsx +2 -2
- package/packages/agent-ui-kit/src/components/QuickCommands/index.less +63 -0
- package/packages/agent-ui-kit/src/components/QuickCommands/index.test.tsx +99 -0
- package/packages/agent-ui-kit/src/components/QuickCommands/index.tsx +52 -0
- package/{apps/client → packages/agent-ui-kit}/src/components/ScrollToBottomButton/index.less +1 -1
- package/packages/agent-ui-kit/src/components/ToolCallBlock/detail.test.ts +346 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/detail.ts +204 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/index.less +312 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/index.test.tsx +261 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/index.tsx +212 -0
- package/packages/agent-ui-kit/src/components/ToolCallBlock/titles.ts +102 -0
- package/packages/agent-ui-kit/src/hooks/use-drag-gesture.test.ts +66 -0
- package/packages/agent-ui-kit/src/hooks/use-drag-gesture.ts +129 -0
- package/packages/agent-ui-kit/src/hooks/use-pull-down-history.ts +241 -0
- package/packages/agent-ui-kit/src/hooks/use-pull-down-wheel-native.test.ts +64 -0
- package/{apps/client → packages/agent-ui-kit}/src/hooks/useMediaUpload.ts +3 -3
- package/{apps/client → packages/agent-ui-kit}/src/hooks/useTTSAutoPlay.ts +7 -5
- package/packages/agent-ui-kit/src/index.ts +69 -0
- package/packages/agent-ui-kit/src/store-context.tsx +92 -0
- package/packages/agent-ui-kit/src/test/setup.ts +7 -0
- package/packages/agent-ui-kit/src/theme/contract.json +72 -0
- package/packages/agent-ui-kit/src/theme/global.less +99 -0
- package/packages/agent-ui-kit/src/theme/motion.less +19 -0
- package/packages/agent-ui-kit/src/theme/theme-contract.test.ts +69 -0
- package/packages/agent-ui-kit/src/theme/theme.ts +17 -0
- package/packages/agent-ui-kit/src/theme/tokens.less +79 -0
- package/packages/agent-ui-kit/src/utils/haptics.test.ts +51 -0
- package/packages/agent-ui-kit/src/utils/haptics.ts +44 -0
- package/packages/agent-ui-kit/src/utils/pull-down-machine.test.ts +188 -0
- package/packages/agent-ui-kit/src/utils/pull-down-machine.ts +157 -0
- package/packages/agent-ui-kit/src/utils/tool-call-display.test.ts +240 -0
- package/packages/agent-ui-kit/src/utils/tool-call-display.ts +146 -0
- package/packages/agent-ui-kit/src/vite-env.d.ts +1 -0
- package/packages/agent-ui-kit/tsconfig.json +8 -0
- package/packages/agent-ui-kit/vitest.config.ts +7 -0
- package/pnpm-lock.template.yaml +177 -111
- package/pnpm-workspace.template.yaml +12 -4
- package/profiles/mall/config/agent.jsonc +33 -0
- package/profiles/mall/config/chat.json +21 -0
- package/profiles/mall/config/knowledge.json +5 -0
- package/profiles/mall/config/llm_provider.json +5 -0
- package/profiles/mall/config/plugins.json +3 -0
- package/profiles/mall.json +16 -0
- package/scripts/check-workspace.mjs +3 -2
- package/apps/client/assets/copy@2x.png +0 -0
- package/apps/client/assets/debug.png +0 -0
- package/apps/client/assets/dislike@2x.png +0 -0
- package/apps/client/assets/like@2x.png +0 -0
- package/apps/client/assets/speaker@2x.png +0 -0
- package/apps/client/src/cards/CardRenderer.tsx +0 -20
- package/apps/client/src/components/ChatHeader/index.less +0 -104
- package/apps/client/src/components/ErrorBoundary.tsx +0 -2
- package/apps/client/src/components/QuickCommands/index.less +0 -48
- package/apps/client/src/components/QuickCommands/index.tsx +0 -29
- package/apps/client/src/components/ToolCallBlock/index.less +0 -131
- package/apps/client/src/components/ToolCallBlock/index.tsx +0 -125
- package/apps/client/src/examples/tourism/TourismLanding.tsx +0 -96
- package/apps/client/src/examples/tourism/index.less +0 -192
- package/apps/client/src/pages/index/index.less +0 -43
- package/apps/client/src/store/chat-config.ts +0 -40
- package/apps/client/src/styles/global.less +0 -60
- package/apps/client/src/styles/tokens.less +0 -60
- package/apps/server/src/config/deployment.ts +0 -47
- package/packages/module-weather/package.json +0 -36
- package/packages/module-weather/skills/weather-guide/SKILL.md +0 -22
- package/packages/module-weather/skills/weather-guide/references/dressing-tips.md +0 -5
- package/packages/module-weather/src/client/cards/weather/index.less +0 -22
- package/packages/module-weather/src/client/cards/weather/index.tsx +0 -14
- package/packages/module-weather/src/client/index.ts +0 -19
- package/packages/module-weather/src/index.ts +0 -2
- package/packages/module-weather/src/server/cards/weather/meta.ts +0 -27
- package/packages/module-weather/src/server/index.ts +0 -45
- package/packages/module-weather/src/server/pre-tools.ts +0 -20
- package/packages/module-weather/src/server/tool.ts +0 -29
- package/packages/module-weather/tbox.module.json +0 -27
- package/packages/module-weather/tsconfig.json +0 -14
- /package/{apps/client → packages/agent-ui-kit}/assets/keyboard-circle.svg +0 -0
- /package/{apps/client → packages/agent-ui-kit}/assets/more-circle.svg +0 -0
- /package/{apps/client → packages/agent-ui-kit}/assets/new-chat.svg +0 -0
- /package/{apps/client → packages/agent-ui-kit}/assets/quick-command-star.svg +0 -0
- /package/{apps/client → packages/agent-ui-kit}/assets/send-gradient.svg +0 -0
- /package/{apps/client → packages/agent-ui-kit}/assets/stop@2x.png +0 -0
- /package/{apps/client → packages/agent-ui-kit}/assets/voice-circle.svg +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/components/ChatInput/voice/VoicePressField.tsx +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/components/ChatInput/voice/VoiceRecordingOverlay.tsx +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/components/ChatInput/voice/machine.ts +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/components/ReasoningBlock/index.less +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/components/ReasoningBlock/index.tsx +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/components/ScrollToBottomButton/index.tsx +0 -0
- /package/{apps/client/src/types/chat.ts → packages/agent-ui-kit/src/types.ts} +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/utils/copyText.ts +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/utils/imagePreview.ts +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/utils/session-error.ts +0 -0
- /package/{apps/client → packages/agent-ui-kit}/src/utils/toast.ts +0 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工具调用展示视图模型:聚合摘要 / 流内活动行 / 行内详情。
|
|
3
|
+
* 语义来源链:SDK describeToolCall 判定四分支 → 契约 parse 取原始字段 → 此处组装视图模型;
|
|
4
|
+
* 模板唯一需要理解 display.kind 的地方(SDK 新增伪工具 kind 经 assertNever 编译期暴露到此单文件)。
|
|
5
|
+
* debug 门控在渲染层(组件 debug prop)——视图模型保持纯数据投影,不感知环境。
|
|
6
|
+
*/
|
|
7
|
+
import { describeToolCall } from '../../utils/tool-call-display';
|
|
8
|
+
import type { ToolCallInfo } from '@tbox.cn/app-sdk/client';
|
|
9
|
+
import {
|
|
10
|
+
MEMORY_TOOL_CALL_NAME,
|
|
11
|
+
parseMemoryToolCallArgs,
|
|
12
|
+
parsePreToolToolCallArgs,
|
|
13
|
+
parseSkillToolCallArgs,
|
|
14
|
+
} from '@tbox.cn/app-contracts';
|
|
15
|
+
import { resolveToolTitle } from './titles';
|
|
16
|
+
|
|
17
|
+
export type ToolCallBadge = '前置工具' | '前置技能' | '记忆召回';
|
|
18
|
+
|
|
19
|
+
export type ToolCallItemStatus = 'calling' | 'done' | 'error';
|
|
20
|
+
|
|
21
|
+
export interface ToolCallDetail {
|
|
22
|
+
/** 紧凑原始文本;详情展开时经 prettyDetailText 归一(幂等) */
|
|
23
|
+
inputText: string;
|
|
24
|
+
outputText: string;
|
|
25
|
+
isError: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ToolCallViewItem {
|
|
29
|
+
id: string;
|
|
30
|
+
kind: 'skill' | 'preTool' | 'normal' | 'memory';
|
|
31
|
+
/** 用户可见中文标题;协议中的技术 name 不在此字段透出 */
|
|
32
|
+
label: string;
|
|
33
|
+
status: ToolCallItemStatus;
|
|
34
|
+
/** normal 恒无 */
|
|
35
|
+
badge?: ToolCallBadge;
|
|
36
|
+
/** 协议技术名/底层工具标识(018 dev 视图展示用;prod 渲染层不消费) */
|
|
37
|
+
techName?: string;
|
|
38
|
+
/** undefined ⇒ 无详情入口(calling 恒无);prod 渲染层门控不展示 */
|
|
39
|
+
detail?: ToolCallDetail;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ToolCallSummary {
|
|
43
|
+
/** skill 条目总数(含进行中) */
|
|
44
|
+
skillCount: number;
|
|
45
|
+
/** preTool + normal 条目总数 */
|
|
46
|
+
toolCount: number;
|
|
47
|
+
/** 当前摘要包含的全部活动数 */
|
|
48
|
+
totalCount: number;
|
|
49
|
+
/** 当前仍在执行的活动数 */
|
|
50
|
+
callingCount: number;
|
|
51
|
+
/** 最近开始且仍在执行的任务标题;技术 name 已在视图层中文化 */
|
|
52
|
+
activeTitle?: string;
|
|
53
|
+
/** 任一执行中 → 摘要行 spinner */
|
|
54
|
+
calling: boolean;
|
|
55
|
+
failedCount: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const SKILL_LOADED_TEXT = '已加载';
|
|
59
|
+
|
|
60
|
+
/** 单条 tool-call → 视图条目(kind 判定唯一来源 SDK describeToolCall) */
|
|
61
|
+
export function deriveToolCallItem(tc: ToolCallInfo): ToolCallViewItem {
|
|
62
|
+
const display = describeToolCall(tc);
|
|
63
|
+
switch (display.kind) {
|
|
64
|
+
case 'skill': {
|
|
65
|
+
const args = parseSkillToolCallArgs(tc.args);
|
|
66
|
+
return {
|
|
67
|
+
id: tc.id,
|
|
68
|
+
kind: 'skill',
|
|
69
|
+
label: resolveToolTitle(display.label || tc.name, args?.description, '加载技能'),
|
|
70
|
+
status: tc.status,
|
|
71
|
+
badge: '前置技能',
|
|
72
|
+
// dev 视图技术标识:skill 的可排障身份是 skillName(args 解析失败回退伪工具名)
|
|
73
|
+
techName: args?.skillName ?? tc.name,
|
|
74
|
+
...(tc.status !== 'calling' && args?.description
|
|
75
|
+
? {
|
|
76
|
+
detail: {
|
|
77
|
+
inputText: args.description,
|
|
78
|
+
outputText: tc.error ?? SKILL_LOADED_TEXT,
|
|
79
|
+
isError: tc.status === 'error',
|
|
80
|
+
},
|
|
81
|
+
}
|
|
82
|
+
: {}),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
case 'preTool': {
|
|
86
|
+
const args = parsePreToolToolCallArgs(tc.args);
|
|
87
|
+
const isError = display.status === 'error';
|
|
88
|
+
return {
|
|
89
|
+
id: tc.id,
|
|
90
|
+
kind: 'preTool',
|
|
91
|
+
label: resolveToolTitle(args?.toolName ?? tc.name, display.label, '准备工具任务'),
|
|
92
|
+
status: display.status,
|
|
93
|
+
badge: '前置工具',
|
|
94
|
+
// dev 视图技术标识:被预执行的真实工具 id
|
|
95
|
+
techName: args?.toolName ?? tc.name,
|
|
96
|
+
...(display.status !== 'calling'
|
|
97
|
+
? {
|
|
98
|
+
detail: {
|
|
99
|
+
inputText: JSON.stringify(args?.toolArgs ?? {}),
|
|
100
|
+
outputText: isError
|
|
101
|
+
? (display.errorText ?? tc.error ?? '预执行失败')
|
|
102
|
+
: (display.resultText ?? ''),
|
|
103
|
+
isError,
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
: {}),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
case 'memory': {
|
|
110
|
+
const args = parseMemoryToolCallArgs(tc.args);
|
|
111
|
+
// status 单一来源 = display(SDK envelope 派生)——此处不重复 parse result
|
|
112
|
+
const status = display.status;
|
|
113
|
+
// degraded → error 视觉态(超时/存储异常);miss/skipped 恒 done
|
|
114
|
+
const itemStatus: ToolCallItemStatus = status === 'degraded' ? 'error' : 'done';
|
|
115
|
+
const isError = status === 'degraded';
|
|
116
|
+
return {
|
|
117
|
+
id: tc.id,
|
|
118
|
+
kind: 'memory',
|
|
119
|
+
label: display.label,
|
|
120
|
+
status: itemStatus,
|
|
121
|
+
badge: '记忆召回',
|
|
122
|
+
techName: MEMORY_TOOL_CALL_NAME,
|
|
123
|
+
...(display.hasDetail && display.detailText
|
|
124
|
+
? {
|
|
125
|
+
detail: {
|
|
126
|
+
inputText: args?.query ?? '',
|
|
127
|
+
outputText: display.detailText,
|
|
128
|
+
isError,
|
|
129
|
+
},
|
|
130
|
+
}
|
|
131
|
+
: {}),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
case 'normal': {
|
|
135
|
+
const isError = tc.status === 'error' || !!tc.error;
|
|
136
|
+
return {
|
|
137
|
+
id: tc.id,
|
|
138
|
+
kind: 'normal',
|
|
139
|
+
label: resolveToolTitle(tc.name),
|
|
140
|
+
status: tc.status,
|
|
141
|
+
techName: tc.name,
|
|
142
|
+
...(tc.status !== 'calling' && (tc.args || tc.result || tc.error)
|
|
143
|
+
? {
|
|
144
|
+
detail: {
|
|
145
|
+
inputText: tc.args ?? '',
|
|
146
|
+
outputText: isError ? (tc.error ?? '') : (tc.result ?? ''),
|
|
147
|
+
isError,
|
|
148
|
+
},
|
|
149
|
+
}
|
|
150
|
+
: {}),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
default:
|
|
154
|
+
return assertNever(display);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** L1 聚合:技能/工具计数 + 执行中/失败标记 */
|
|
159
|
+
export function deriveSummary(items: ToolCallViewItem[]): ToolCallSummary {
|
|
160
|
+
const skillCount = items.filter((i) => i.kind === 'skill').length;
|
|
161
|
+
const callingCount = items.filter((i) => i.status === 'calling').length;
|
|
162
|
+
const activeItem = [...items].reverse().find((item) => item.status === 'calling');
|
|
163
|
+
return {
|
|
164
|
+
skillCount,
|
|
165
|
+
toolCount: items.length - skillCount,
|
|
166
|
+
totalCount: items.length,
|
|
167
|
+
callingCount,
|
|
168
|
+
...(activeItem ? { activeTitle: activeItem.label } : {}),
|
|
169
|
+
calling: callingCount > 0,
|
|
170
|
+
failedCount: items.filter((i) => i.status === 'error').length,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* 聚合行文案:执行中以最近任务标题为主、并行数量为辅;稳定态按 [技能, 工具] 报告已经发生的活动。
|
|
176
|
+
* 失败段由组件独立渲染,避免把失败混写成成功。
|
|
177
|
+
*/
|
|
178
|
+
export function buildSummaryText(s: ToolCallSummary): string[] {
|
|
179
|
+
if (s.callingCount > 0) {
|
|
180
|
+
const activeTitle = s.activeTitle ?? '处理当前任务';
|
|
181
|
+
const activeText = activeTitle.startsWith('正在') ? activeTitle : `正在${activeTitle}`;
|
|
182
|
+
return [s.callingCount > 1 ? `${activeText} · 另有 ${s.callingCount - 1} 项` : activeText];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const segments: string[] = [];
|
|
186
|
+
if (s.skillCount > 0) segments.push(`已加载技能 ${s.skillCount} 个`);
|
|
187
|
+
if (s.toolCount > 0) segments.push(`已调用工具 ${s.toolCount} 个`);
|
|
188
|
+
return segments.length > 0 ? segments : ['暂无工具活动'];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/** 详情文本归一:合法 JSON→pretty(幂等),否则原文;不截断(行内区域可滚动) */
|
|
192
|
+
export function prettyDetailText(raw: string): string {
|
|
193
|
+
if (!raw) return '';
|
|
194
|
+
try {
|
|
195
|
+
return JSON.stringify(JSON.parse(raw), null, 2);
|
|
196
|
+
} catch {
|
|
197
|
+
return raw;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** 穷尽守卫:SDK display 新增 kind 时编译期报错(不静默落 default) */
|
|
202
|
+
function assertNever(x: never): never {
|
|
203
|
+
throw new Error(`unhandled tool call display kind: ${JSON.stringify(x)}`);
|
|
204
|
+
}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
// Codex 风格工具活动日志:无卡框、弱层级、流内展开。
|
|
2
|
+
// web-view 约定:颜色走现有 mall token;滚动区隐藏滚动条;图标走 currentColor。
|
|
3
|
+
.tool-calls {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
margin: 0 0 12px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.tool-calls__summary,
|
|
10
|
+
.tool-calls__item-trigger,
|
|
11
|
+
.tool-calls__copy {
|
|
12
|
+
appearance: none;
|
|
13
|
+
border: 0;
|
|
14
|
+
font: inherit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// 工具活动区统一沿用摘要字号,保留现有 rem 缩放比例。
|
|
18
|
+
.tool-calls__summary-text,
|
|
19
|
+
.tool-calls__item-name,
|
|
20
|
+
.tool-calls__badge,
|
|
21
|
+
.tool-calls__item-tech,
|
|
22
|
+
.tool-calls__detail-label,
|
|
23
|
+
.tool-calls__detail-body,
|
|
24
|
+
.tool-calls__copy {
|
|
25
|
+
font-size: 24px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.tool-calls__summary {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
width: 100%;
|
|
33
|
+
min-height: 88px;
|
|
34
|
+
padding: 10px 4px;
|
|
35
|
+
border-radius: 16px;
|
|
36
|
+
background: transparent;
|
|
37
|
+
color: var(--tbox-text-muted);
|
|
38
|
+
text-align: left;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
transition:
|
|
41
|
+
color var(--tbox-transition-fast),
|
|
42
|
+
background var(--tbox-transition-fast);
|
|
43
|
+
|
|
44
|
+
&:active {
|
|
45
|
+
background: rgba(11, 15, 23, 0.035);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:focus-visible {
|
|
49
|
+
outline: 4px solid var(--tbox-primary);
|
|
50
|
+
outline-offset: 4px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&--calling {
|
|
54
|
+
color: var(--tbox-text-secondary);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.tool-calls__left {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 16px;
|
|
62
|
+
min-width: 0;
|
|
63
|
+
flex: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.tool-calls__summary-text {
|
|
67
|
+
min-width: 0;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
color: currentColor;
|
|
70
|
+
font-weight: 400;
|
|
71
|
+
line-height: 1.4;
|
|
72
|
+
text-overflow: ellipsis;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.tool-calls__failed {
|
|
77
|
+
color: var(--tbox-text-muted);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.tool-calls__chevron,
|
|
81
|
+
.tool-calls__item-chevron {
|
|
82
|
+
color: var(--tbox-text-muted);
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
transition: transform var(--tbox-transition-fast);
|
|
85
|
+
|
|
86
|
+
&--up {
|
|
87
|
+
transform: rotate(180deg);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.tool-calls__chevron {
|
|
92
|
+
margin-left: 16px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.tool-calls__icon {
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
|
|
98
|
+
&--success {
|
|
99
|
+
color: var(--tbox-text-muted);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--error {
|
|
103
|
+
color: var(--tbox-text-muted);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.tool-calls__spinner {
|
|
108
|
+
width: 28px;
|
|
109
|
+
height: 28px;
|
|
110
|
+
border: 4px solid rgba(9, 107, 250, 0.2);
|
|
111
|
+
border-top-color: var(--tbox-primary);
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
animation: tool-spin 0.8s linear infinite;
|
|
115
|
+
|
|
116
|
+
&--sm {
|
|
117
|
+
width: 24px;
|
|
118
|
+
height: 24px;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.tool-calls__list {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-direction: column;
|
|
125
|
+
gap: 2px;
|
|
126
|
+
margin-top: 4px;
|
|
127
|
+
padding-left: 4px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.tool-calls__item {
|
|
131
|
+
display: flex;
|
|
132
|
+
min-width: 0;
|
|
133
|
+
flex-direction: column;
|
|
134
|
+
|
|
135
|
+
&--calling .tool-calls__item-name {
|
|
136
|
+
color: var(--tbox-text-secondary);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&--error .tool-calls__item-name {
|
|
140
|
+
color: var(--tbox-text-muted);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.tool-calls__item-trigger {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
justify-content: space-between;
|
|
148
|
+
width: 100%;
|
|
149
|
+
min-height: 88px;
|
|
150
|
+
padding: 10px 4px;
|
|
151
|
+
border-radius: 16px;
|
|
152
|
+
background: transparent;
|
|
153
|
+
color: var(--tbox-text-secondary);
|
|
154
|
+
text-align: left;
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
transition:
|
|
157
|
+
color var(--tbox-transition-fast),
|
|
158
|
+
background var(--tbox-transition-fast);
|
|
159
|
+
|
|
160
|
+
&:active {
|
|
161
|
+
background: rgba(11, 15, 23, 0.035);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
&:focus-visible {
|
|
165
|
+
outline: 4px solid var(--tbox-primary);
|
|
166
|
+
outline-offset: 4px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&--static {
|
|
170
|
+
cursor: default;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.tool-calls__item-left {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: baseline;
|
|
177
|
+
gap: 16px;
|
|
178
|
+
min-width: 0;
|
|
179
|
+
|
|
180
|
+
> .tool-calls__icon,
|
|
181
|
+
> .tool-calls__spinner {
|
|
182
|
+
align-self: center;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.tool-calls__item-name {
|
|
187
|
+
min-width: 0;
|
|
188
|
+
overflow: hidden;
|
|
189
|
+
color: var(--tbox-text-secondary);
|
|
190
|
+
font-weight: 400;
|
|
191
|
+
line-height: 1.4;
|
|
192
|
+
text-overflow: ellipsis;
|
|
193
|
+
white-space: nowrap;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.tool-calls__badge,
|
|
197
|
+
.tool-calls__item-tech {
|
|
198
|
+
color: var(--tbox-text-muted);
|
|
199
|
+
font-family: inherit;
|
|
200
|
+
line-height: 1.4;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.tool-calls__badge {
|
|
204
|
+
flex-shrink: 0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// 018 dev 视图技术名后缀(debug 态渲染;prod 不出 DOM)
|
|
208
|
+
.tool-calls__item-tech {
|
|
209
|
+
word-break: break-all;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.tool-calls__item-chevron {
|
|
213
|
+
margin-left: 16px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.tool-calls__detail {
|
|
217
|
+
display: flex;
|
|
218
|
+
flex-direction: column;
|
|
219
|
+
gap: 20px;
|
|
220
|
+
margin: 2px 0 16px 40px;
|
|
221
|
+
padding: 10px 0 10px 28px;
|
|
222
|
+
border-left: 4px solid var(--tbox-border);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.tool-calls__detail-section {
|
|
226
|
+
display: flex;
|
|
227
|
+
min-width: 0;
|
|
228
|
+
flex-direction: column;
|
|
229
|
+
gap: 10px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.tool-calls__detail-heading {
|
|
233
|
+
display: flex;
|
|
234
|
+
align-items: center;
|
|
235
|
+
justify-content: space-between;
|
|
236
|
+
gap: 16px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.tool-calls__detail-label {
|
|
240
|
+
color: var(--tbox-text-muted);
|
|
241
|
+
line-height: 1.4;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.tool-calls__detail-body {
|
|
245
|
+
max-height: 560px;
|
|
246
|
+
margin: 0;
|
|
247
|
+
padding: 20px 24px;
|
|
248
|
+
overflow: auto;
|
|
249
|
+
border-radius: 16px;
|
|
250
|
+
background: var(--tbox-bg-subtle);
|
|
251
|
+
color: var(--tbox-text-secondary);
|
|
252
|
+
font-family: Menlo, Monaco, Consolas, monospace;
|
|
253
|
+
line-height: 1.6;
|
|
254
|
+
white-space: pre-wrap;
|
|
255
|
+
word-break: break-all;
|
|
256
|
+
-webkit-overflow-scrolling: touch;
|
|
257
|
+
|
|
258
|
+
&::-webkit-scrollbar {
|
|
259
|
+
display: none;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&--error {
|
|
263
|
+
color: var(--tbox-text-muted);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.tool-calls__copy {
|
|
268
|
+
display: inline-flex;
|
|
269
|
+
align-items: center;
|
|
270
|
+
gap: 8px;
|
|
271
|
+
min-height: 88px;
|
|
272
|
+
padding: 6px 10px;
|
|
273
|
+
border-radius: 12px;
|
|
274
|
+
background: transparent;
|
|
275
|
+
color: var(--tbox-text-muted);
|
|
276
|
+
line-height: 1.2;
|
|
277
|
+
flex-shrink: 0;
|
|
278
|
+
cursor: pointer;
|
|
279
|
+
|
|
280
|
+
&:active {
|
|
281
|
+
color: var(--tbox-text-secondary);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
&:focus-visible {
|
|
285
|
+
outline: 4px solid var(--tbox-primary);
|
|
286
|
+
outline-offset: 2px;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
&:disabled {
|
|
290
|
+
opacity: 0.55;
|
|
291
|
+
cursor: default;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@keyframes tool-spin {
|
|
296
|
+
to {
|
|
297
|
+
transform: rotate(360deg);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
@media (prefers-reduced-motion: reduce) {
|
|
302
|
+
.tool-calls__summary,
|
|
303
|
+
.tool-calls__item-trigger,
|
|
304
|
+
.tool-calls__chevron,
|
|
305
|
+
.tool-calls__item-chevron {
|
|
306
|
+
transition: none;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.tool-calls__spinner {
|
|
310
|
+
animation: none;
|
|
311
|
+
}
|
|
312
|
+
}
|