@xcanwin/manyoyo 5.7.13 → 5.7.14
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/lib/web/frontend/app.css +30 -0
- package/lib/web/frontend/app.js +34 -5
- package/package.json +1 -1
package/lib/web/frontend/app.css
CHANGED
|
@@ -1516,6 +1516,36 @@ details.trace-card > .trace-card-summary {
|
|
|
1516
1516
|
cursor: pointer;
|
|
1517
1517
|
}
|
|
1518
1518
|
|
|
1519
|
+
.trace-card.trace-card-compact {
|
|
1520
|
+
border-left-width: 2px;
|
|
1521
|
+
border-radius: 999px;
|
|
1522
|
+
background: rgba(255, 251, 245, 0.78);
|
|
1523
|
+
box-shadow: none;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
.trace-card.trace-card-compact .trace-card-summary {
|
|
1527
|
+
padding: 5px 10px;
|
|
1528
|
+
gap: 7px;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
.trace-card.trace-card-compact .trace-card-badge {
|
|
1532
|
+
min-width: 0;
|
|
1533
|
+
padding: 2px 6px;
|
|
1534
|
+
background: rgba(31, 26, 20, 0.06);
|
|
1535
|
+
font-size: 10px;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
.trace-card.trace-card-compact .trace-card-title {
|
|
1539
|
+
font-size: 11px;
|
|
1540
|
+
font-weight: 500;
|
|
1541
|
+
color: #6e6256;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
.trace-card.trace-card-compact .trace-card-phase {
|
|
1545
|
+
font-size: 10px;
|
|
1546
|
+
color: #8a7d70;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1519
1549
|
.trace-card-summary::-webkit-details-marker {
|
|
1520
1550
|
display: none;
|
|
1521
1551
|
}
|
package/lib/web/frontend/app.js
CHANGED
|
@@ -354,6 +354,34 @@
|
|
|
354
354
|
return 'neutral';
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
+
function shouldCompactTraceEvent(traceEvent) {
|
|
358
|
+
const event = traceEvent && typeof traceEvent === 'object' ? traceEvent : {};
|
|
359
|
+
const phase = event.phase ? String(event.phase) : '';
|
|
360
|
+
const kind = event.kind ? String(event.kind) : '';
|
|
361
|
+
if (phase !== 'completed') {
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
return kind === 'command' || kind === 'mcp' || kind === 'tool';
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function buildCompactTraceText(traceEvent) {
|
|
368
|
+
const event = traceEvent && typeof traceEvent === 'object' ? traceEvent : {};
|
|
369
|
+
if (event.kind === 'command') {
|
|
370
|
+
const suffix = typeof event.exitCode === 'number'
|
|
371
|
+
? `exit ${event.exitCode}`
|
|
372
|
+
: (event.status ? String(event.status) : 'completed');
|
|
373
|
+
return `${event.command || event.text || '命令'} · ${suffix}`;
|
|
374
|
+
}
|
|
375
|
+
if (event.kind === 'mcp') {
|
|
376
|
+
const toolLabel = [event.server, event.tool].filter(Boolean).join('.') || event.text || 'MCP';
|
|
377
|
+
return event.argumentSummary ? `${toolLabel} · ${event.argumentSummary}` : toolLabel;
|
|
378
|
+
}
|
|
379
|
+
if (event.kind === 'tool') {
|
|
380
|
+
return event.toolName || event.text || '工具';
|
|
381
|
+
}
|
|
382
|
+
return event.text || '事件';
|
|
383
|
+
}
|
|
384
|
+
|
|
357
385
|
function appendTraceCardBody(cardBody, label, value) {
|
|
358
386
|
const text = stringifyPrettyJson(value).trim();
|
|
359
387
|
if (!text) {
|
|
@@ -377,11 +405,12 @@
|
|
|
377
405
|
|
|
378
406
|
function createTraceEventCard(traceEvent) {
|
|
379
407
|
const event = traceEvent && typeof traceEvent === 'object' ? traceEvent : {};
|
|
408
|
+
const compact = shouldCompactTraceEvent(event);
|
|
380
409
|
const bodyParts = [];
|
|
381
|
-
if (event.kind === 'command' && event.command) {
|
|
410
|
+
if (!compact && event.kind === 'command' && event.command) {
|
|
382
411
|
bodyParts.push({ label: '命令', value: event.command });
|
|
383
412
|
}
|
|
384
|
-
if (event.kind === 'mcp') {
|
|
413
|
+
if (!compact && event.kind === 'mcp') {
|
|
385
414
|
if (event.argumentSummary) {
|
|
386
415
|
bodyParts.push({ label: '参数摘要', value: event.argumentSummary });
|
|
387
416
|
}
|
|
@@ -395,7 +424,7 @@
|
|
|
395
424
|
bodyParts.push({ label: '错误', value: event.error });
|
|
396
425
|
}
|
|
397
426
|
}
|
|
398
|
-
if (event.kind === 'tool' && event.toolName) {
|
|
427
|
+
if (!compact && event.kind === 'tool' && event.toolName) {
|
|
399
428
|
bodyParts.push({ label: '工具', value: event.toolName });
|
|
400
429
|
}
|
|
401
430
|
if ((event.kind === 'agent_message' || event.kind === 'status' || event.kind === 'error') && event.detail) {
|
|
@@ -404,7 +433,7 @@
|
|
|
404
433
|
|
|
405
434
|
const hasBody = bodyParts.length > 0;
|
|
406
435
|
const card = document.createElement(hasBody ? 'details' : 'div');
|
|
407
|
-
card.className = 'trace-card trace-tone-' + resolveTraceTone(event);
|
|
436
|
+
card.className = 'trace-card trace-tone-' + resolveTraceTone(event) + (compact ? ' trace-card-compact' : '');
|
|
408
437
|
if (hasBody && event.kind === 'error') {
|
|
409
438
|
card.open = true;
|
|
410
439
|
}
|
|
@@ -419,7 +448,7 @@
|
|
|
419
448
|
|
|
420
449
|
const title = document.createElement('span');
|
|
421
450
|
title.className = 'trace-card-title';
|
|
422
|
-
title.textContent = event && event.text ? String(event.text) : '事件';
|
|
451
|
+
title.textContent = compact ? buildCompactTraceText(event) : (event && event.text ? String(event.text) : '事件');
|
|
423
452
|
header.appendChild(title);
|
|
424
453
|
|
|
425
454
|
const phaseText = humanizeTracePhase(event);
|