@xcanwin/manyoyo 5.9.1 → 5.9.2
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 +5 -46
- package/lib/web/frontend/app.js +52 -48
- package/package.json +1 -1
package/lib/web/frontend/app.css
CHANGED
|
@@ -1667,22 +1667,6 @@ body.command-mode .msg.origin-agent .bubble {
|
|
|
1667
1667
|
gap: 10px;
|
|
1668
1668
|
}
|
|
1669
1669
|
|
|
1670
|
-
.trace-summary {
|
|
1671
|
-
display: flex;
|
|
1672
|
-
flex-direction: column;
|
|
1673
|
-
gap: 6px;
|
|
1674
|
-
}
|
|
1675
|
-
|
|
1676
|
-
.trace-summary-line {
|
|
1677
|
-
padding: 7px 10px;
|
|
1678
|
-
border-radius: 8px;
|
|
1679
|
-
border: 1px dashed rgba(181, 146, 99, 0.45);
|
|
1680
|
-
background: rgba(255, 250, 242, 0.82);
|
|
1681
|
-
color: var(--muted);
|
|
1682
|
-
font-size: 12px;
|
|
1683
|
-
line-height: 1.45;
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
1670
|
.trace-flow {
|
|
1687
1671
|
display: flex;
|
|
1688
1672
|
flex-direction: column;
|
|
@@ -1722,6 +1706,11 @@ body.command-mode .msg.origin-agent .bubble {
|
|
|
1722
1706
|
border-left-color: var(--line-strong);
|
|
1723
1707
|
}
|
|
1724
1708
|
|
|
1709
|
+
.trace-card.trace-card-residual {
|
|
1710
|
+
background: rgba(255, 250, 242, 0.86);
|
|
1711
|
+
box-shadow: none;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1725
1714
|
.trace-card-summary {
|
|
1726
1715
|
list-style: none;
|
|
1727
1716
|
display: flex;
|
|
@@ -1735,36 +1724,6 @@ details.trace-card > .trace-card-summary {
|
|
|
1735
1724
|
cursor: pointer;
|
|
1736
1725
|
}
|
|
1737
1726
|
|
|
1738
|
-
.trace-card.trace-card-compact {
|
|
1739
|
-
border-left-width: 2px;
|
|
1740
|
-
border-radius: 999px;
|
|
1741
|
-
background: rgba(255, 251, 245, 0.78);
|
|
1742
|
-
box-shadow: none;
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
.trace-card.trace-card-compact .trace-card-summary {
|
|
1746
|
-
padding: 5px 10px;
|
|
1747
|
-
gap: 7px;
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
.trace-card.trace-card-compact .trace-card-badge {
|
|
1751
|
-
min-width: 0;
|
|
1752
|
-
padding: 2px 6px;
|
|
1753
|
-
background: rgba(31, 26, 20, 0.06);
|
|
1754
|
-
font-size: 10px;
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1757
|
-
.trace-card.trace-card-compact .trace-card-title {
|
|
1758
|
-
font-size: 11px;
|
|
1759
|
-
font-weight: 500;
|
|
1760
|
-
color: #6e6256;
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
|
-
.trace-card.trace-card-compact .trace-card-phase {
|
|
1764
|
-
font-size: 10px;
|
|
1765
|
-
color: #8a7d70;
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
1727
|
.trace-card-summary::-webkit-details-marker {
|
|
1769
1728
|
display: none;
|
|
1770
1729
|
}
|
package/lib/web/frontend/app.js
CHANGED
|
@@ -385,34 +385,6 @@
|
|
|
385
385
|
return 'neutral';
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
function shouldCompactTraceEvent(traceEvent) {
|
|
389
|
-
const event = traceEvent && typeof traceEvent === 'object' ? traceEvent : {};
|
|
390
|
-
const phase = event.phase ? String(event.phase) : '';
|
|
391
|
-
const kind = event.kind ? String(event.kind) : '';
|
|
392
|
-
if (phase !== 'completed') {
|
|
393
|
-
return false;
|
|
394
|
-
}
|
|
395
|
-
return kind === 'command' || kind === 'mcp' || kind === 'tool';
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
function buildCompactTraceText(traceEvent) {
|
|
399
|
-
const event = traceEvent && typeof traceEvent === 'object' ? traceEvent : {};
|
|
400
|
-
if (event.kind === 'command') {
|
|
401
|
-
const suffix = typeof event.exitCode === 'number'
|
|
402
|
-
? `exit ${event.exitCode}`
|
|
403
|
-
: (event.status ? String(event.status) : 'completed');
|
|
404
|
-
return `${event.command || event.text || '命令'} · ${suffix}`;
|
|
405
|
-
}
|
|
406
|
-
if (event.kind === 'mcp') {
|
|
407
|
-
const toolLabel = [event.server, event.tool].filter(Boolean).join('.') || event.text || 'MCP';
|
|
408
|
-
return event.argumentSummary ? `${toolLabel} · ${event.argumentSummary}` : toolLabel;
|
|
409
|
-
}
|
|
410
|
-
if (event.kind === 'tool') {
|
|
411
|
-
return event.toolName || event.text || '工具';
|
|
412
|
-
}
|
|
413
|
-
return event.text || '事件';
|
|
414
|
-
}
|
|
415
|
-
|
|
416
388
|
function appendTraceCardBody(cardBody, label, value) {
|
|
417
389
|
const text = stringifyPrettyJson(value).trim();
|
|
418
390
|
if (!text) {
|
|
@@ -436,12 +408,19 @@
|
|
|
436
408
|
|
|
437
409
|
function createTraceEventCard(traceEvent) {
|
|
438
410
|
const event = traceEvent && typeof traceEvent === 'object' ? traceEvent : {};
|
|
439
|
-
const compact = shouldCompactTraceEvent(event);
|
|
440
411
|
const bodyParts = [];
|
|
441
|
-
if (
|
|
412
|
+
if (event.kind === 'command' && event.command) {
|
|
442
413
|
bodyParts.push({ label: '命令', value: event.command });
|
|
414
|
+
if (typeof event.exitCode === 'number') {
|
|
415
|
+
bodyParts.push({ label: '退出码', value: String(event.exitCode) });
|
|
416
|
+
} else if (event.status) {
|
|
417
|
+
bodyParts.push({ label: '状态', value: event.status });
|
|
418
|
+
}
|
|
443
419
|
}
|
|
444
|
-
if (
|
|
420
|
+
if (event.kind === 'mcp') {
|
|
421
|
+
if (event.server || event.tool) {
|
|
422
|
+
bodyParts.push({ label: '工具', value: [event.server, event.tool].filter(Boolean).join('.') });
|
|
423
|
+
}
|
|
445
424
|
if (event.argumentSummary) {
|
|
446
425
|
bodyParts.push({ label: '参数摘要', value: event.argumentSummary });
|
|
447
426
|
}
|
|
@@ -455,7 +434,7 @@
|
|
|
455
434
|
bodyParts.push({ label: '错误', value: event.error });
|
|
456
435
|
}
|
|
457
436
|
}
|
|
458
|
-
if (
|
|
437
|
+
if (event.kind === 'tool' && event.toolName) {
|
|
459
438
|
bodyParts.push({ label: '工具', value: event.toolName });
|
|
460
439
|
}
|
|
461
440
|
if ((event.kind === 'agent_message' || event.kind === 'status' || event.kind === 'error') && event.detail) {
|
|
@@ -464,7 +443,7 @@
|
|
|
464
443
|
|
|
465
444
|
const hasBody = bodyParts.length > 0;
|
|
466
445
|
const card = document.createElement(hasBody ? 'details' : 'div');
|
|
467
|
-
card.className = 'trace-card trace-tone-' + resolveTraceTone(event)
|
|
446
|
+
card.className = 'trace-card trace-tone-' + resolveTraceTone(event);
|
|
468
447
|
if (hasBody && event.kind === 'error') {
|
|
469
448
|
card.open = true;
|
|
470
449
|
}
|
|
@@ -479,7 +458,7 @@
|
|
|
479
458
|
|
|
480
459
|
const title = document.createElement('span');
|
|
481
460
|
title.className = 'trace-card-title';
|
|
482
|
-
title.textContent =
|
|
461
|
+
title.textContent = event && event.text ? String(event.text) : '事件';
|
|
483
462
|
header.appendChild(title);
|
|
484
463
|
|
|
485
464
|
const phaseText = humanizeTracePhase(event);
|
|
@@ -498,9 +477,44 @@
|
|
|
498
477
|
bodyParts.forEach(function (part) {
|
|
499
478
|
appendTraceCardBody(body, part.label, part.value);
|
|
500
479
|
});
|
|
501
|
-
|
|
480
|
+
card.appendChild(body);
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
return card;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function resolveResidualTraceTone(line) {
|
|
487
|
+
const text = String(line || '').trim();
|
|
488
|
+
if (!text) {
|
|
489
|
+
return 'neutral';
|
|
490
|
+
}
|
|
491
|
+
if (text.startsWith('[stderr]') || text.startsWith('[错误]')) {
|
|
492
|
+
return 'error';
|
|
502
493
|
}
|
|
494
|
+
if (text.startsWith('[任务]') || text.includes('上下文模式') || text.includes('会话恢复') || text.includes('等待 Agent 启动')) {
|
|
495
|
+
return 'status';
|
|
496
|
+
}
|
|
497
|
+
return 'neutral';
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function createResidualTraceCard(line) {
|
|
501
|
+
const card = document.createElement('div');
|
|
502
|
+
card.className = 'trace-card trace-tone-' + resolveResidualTraceTone(line) + ' trace-card-residual';
|
|
503
|
+
|
|
504
|
+
const header = document.createElement('div');
|
|
505
|
+
header.className = 'trace-card-summary';
|
|
506
|
+
|
|
507
|
+
const badge = document.createElement('span');
|
|
508
|
+
badge.className = 'trace-card-badge';
|
|
509
|
+
badge.textContent = '状态';
|
|
510
|
+
header.appendChild(badge);
|
|
503
511
|
|
|
512
|
+
const title = document.createElement('span');
|
|
513
|
+
title.className = 'trace-card-title';
|
|
514
|
+
title.textContent = String(line || '');
|
|
515
|
+
header.appendChild(title);
|
|
516
|
+
|
|
517
|
+
card.appendChild(header);
|
|
504
518
|
return card;
|
|
505
519
|
}
|
|
506
520
|
|
|
@@ -509,21 +523,11 @@
|
|
|
509
523
|
const container = document.createElement('div');
|
|
510
524
|
container.className = 'trace-structured';
|
|
511
525
|
|
|
512
|
-
const residualLines = buildStructuredTraceResidualLines(message);
|
|
513
|
-
if (residualLines.length) {
|
|
514
|
-
const summary = document.createElement('div');
|
|
515
|
-
summary.className = 'trace-summary';
|
|
516
|
-
residualLines.forEach(function (line) {
|
|
517
|
-
const item = document.createElement('div');
|
|
518
|
-
item.className = 'trace-summary-line';
|
|
519
|
-
item.textContent = line;
|
|
520
|
-
summary.appendChild(item);
|
|
521
|
-
});
|
|
522
|
-
container.appendChild(summary);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
526
|
const flow = document.createElement('div');
|
|
526
527
|
flow.className = 'trace-flow';
|
|
528
|
+
buildStructuredTraceResidualLines(message).forEach(function (line) {
|
|
529
|
+
flow.appendChild(createResidualTraceCard(line));
|
|
530
|
+
});
|
|
527
531
|
(Array.isArray(message && message.traceEvents) ? message.traceEvents : []).forEach(function (traceEvent) {
|
|
528
532
|
flow.appendChild(createTraceEventCard(traceEvent));
|
|
529
533
|
});
|