MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / ToolRunDetail

Function ToolRunDetail

ai-code-studio/src/components/ToolWorkbenchPanel.tsx:214–293  ·  view source on GitHub ↗
({ call }: { call: ToolCall | null })

Source from the content-addressed store, hash-verified

212}
213
214function ToolRunDetail({ call }: { call: ToolCall | null }) {
215 if (!call) {
216 return (
217 <div className="rounded-2xl border border-dashed border-[#E4DACD] px-4 py-8 text-[13px] text-[#978C7E]">
218 选择一次工具调用后,这里会显示输入、结果和关联文件。
219 </div>
220 );
221 }
222
223 const files = Array.isArray(call.diff?.files) ? call.diff?.files || [] : [];
224
225 return (
226 <div className="space-y-4">
227 <div className="rounded-2xl border border-[#ECE2D6] bg-[#FCFAF6] p-4">
228 <div className="flex items-start justify-between gap-4">
229 <div>
230 <div className="text-[12px] text-[#8A7F70]">工具调用</div>
231 <div className="mt-1 text-[15px] font-semibold text-[#241F17]">
232 {call.title || call.name || '工具'}
233 </div>
234 </div>
235 <span className={['rounded-full border px-2.5 py-1 text-[11px]', toolStatusTone(call.status)].join(' ')}>
236 {toolStatusLabel(call.status)}
237 </span>
238 </div>
239 <div className="mt-3 grid gap-3 md:grid-cols-2 text-[12px] text-[#7B6F61]">
240 <div>
241 <div className="text-[#8A7F70]">开始时间</div>
242 <div className="mt-1 text-[#241F17]">{formatTimestamp(call.startedAt || null) || '未知'}</div>
243 </div>
244 <div>
245 <div className="text-[#8A7F70]">结束时间</div>
246 <div className="mt-1 text-[#241F17]">{formatTimestamp(call.completedAt || null) || '未知'}</div>
247 </div>
248 </div>
249 </div>
250
251 <div className="grid gap-4 lg:grid-cols-2">
252 <div className="rounded-2xl border border-[#ECE2D6] bg-white/80 p-4">
253 <div className="mb-3 text-[12px] font-semibold uppercase tracking-[0.18em] text-[#8C8173]">输入摘要</div>
254 <pre className="max-h-[320px] overflow-auto whitespace-pre-wrap break-words rounded-2xl bg-[#FBF8F3] p-4 font-mono text-[12px] leading-6 text-[#5B5145]">
255 {trimText(call.inputPreview, '这次工具没有可展示的输入摘要。')}
256 </pre>
257 </div>
258
259 <div className="rounded-2xl border border-[#ECE2D6] bg-white/80 p-4">
260 <div className="mb-3 text-[12px] font-semibold uppercase tracking-[0.18em] text-[#8C8173]">结果摘要</div>
261 <pre className="max-h-[320px] overflow-auto whitespace-pre-wrap break-words rounded-2xl bg-[#FBF8F3] p-4 font-mono text-[12px] leading-6 text-[#5B5145]">
262 {trimText(call.resultPreview, '这次工具没有文本结果摘要。')}
263 </pre>
264 </div>
265 </div>
266
267 <div className="rounded-2xl border border-[#ECE2D6] bg-white/80 p-4">
268 <div className="mb-3 text-[12px] font-semibold uppercase tracking-[0.18em] text-[#8C8173]">关联文件</div>
269 {files.length > 0 ? (
270 <div className="space-y-3">
271 {files.map((file: DiffFile) => (

Callers

nothing calls this directly

Calls 4

formatTimestampFunction · 0.90
trimTextFunction · 0.90
toolStatusToneFunction · 0.85
toolStatusLabelFunction · 0.85

Tested by

no test coverage detected