@xcanwin/manyoyo 5.7.6 → 5.7.8

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.
@@ -13,6 +13,7 @@
13
13
 
14
14
  --line: #d9c7ad;
15
15
  --line-strong: #b59263;
16
+ --line-soft: rgba(181, 146, 99, 0.26);
16
17
 
17
18
  --text: #1f1a14;
18
19
  --muted: #6a5f52;
@@ -415,7 +416,7 @@ textarea:focus-visible {
415
416
  padding-right: 4px;
416
417
  display: flex;
417
418
  flex-direction: column;
418
- gap: 8px;
419
+ gap: 10px;
419
420
  }
420
421
 
421
422
  #sessionList::-webkit-scrollbar,
@@ -533,7 +534,7 @@ textarea:focus-visible {
533
534
  .workbench-group {
534
535
  display: flex;
535
536
  flex-direction: column;
536
- gap: 8px;
537
+ gap: 10px;
537
538
  }
538
539
 
539
540
  button.tree-toggle {
@@ -591,10 +592,49 @@ button.tree-toggle:focus-visible {
591
592
  }
592
593
 
593
594
  .workbench-group-head {
594
- padding: 10px 12px;
595
- border: 1px solid rgba(181, 146, 99, 0.38);
596
- border-radius: 12px;
597
- background: rgba(255, 250, 242, 0.92);
595
+ padding: 10px 14px;
596
+ border: 1px solid rgba(181, 146, 99, 0.34);
597
+ border-radius: 999px;
598
+ background: linear-gradient(180deg, rgba(255, 250, 242, 0.98) 0%, rgba(252, 242, 230, 0.96) 100%);
599
+ }
600
+
601
+ .workbench-path-bar .tree-toggle-main {
602
+ flex: 1;
603
+ min-width: 0;
604
+ display: grid;
605
+ grid-template-columns: auto minmax(0, 1fr);
606
+ align-items: center;
607
+ column-gap: 10px;
608
+ row-gap: 3px;
609
+ }
610
+
611
+ .workbench-path-bar .workbench-group-kicker {
612
+ grid-column: 1;
613
+ grid-row: 1;
614
+ display: inline-flex;
615
+ align-items: center;
616
+ padding: 3px 8px;
617
+ border-radius: 999px;
618
+ border: 1px solid rgba(181, 146, 99, 0.34);
619
+ background: rgba(255, 255, 255, 0.56);
620
+ }
621
+
622
+ .workbench-path-bar .workbench-group-title {
623
+ grid-column: 2;
624
+ grid-row: 1;
625
+ margin-top: 0;
626
+ min-width: 0;
627
+ overflow: hidden;
628
+ text-overflow: ellipsis;
629
+ white-space: nowrap;
630
+ font-family: var(--font-mono);
631
+ font-size: 12px;
632
+ font-weight: 600;
633
+ }
634
+
635
+ .workbench-path-bar .tree-toggle-meta {
636
+ grid-column: 2;
637
+ grid-row: 2;
598
638
  }
599
639
 
600
640
  .workbench-group.has-active .workbench-group-head,
@@ -606,7 +646,10 @@ button.tree-toggle:focus-visible {
606
646
  .workbench-group-body {
607
647
  display: flex;
608
648
  flex-direction: column;
609
- gap: 8px;
649
+ gap: 10px;
650
+ margin-left: 14px;
651
+ padding-left: 12px;
652
+ border-left: 1px solid var(--line-soft);
610
653
  }
611
654
 
612
655
  .workbench-group-body[hidden] {
@@ -634,48 +677,156 @@ button.tree-toggle:focus-visible {
634
677
  .container-stack {
635
678
  display: flex;
636
679
  flex-direction: column;
637
- gap: 8px;
680
+ gap: 10px;
638
681
  }
639
682
 
640
683
  .container-card {
641
- border: 1px solid var(--line);
642
- border-radius: 12px;
643
- background: rgba(255, 255, 255, 0.9);
644
- padding: 10px;
684
+ border: 1px solid rgba(181, 146, 99, 0.52);
685
+ border-radius: 16px;
686
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 242, 232, 0.98) 100%);
687
+ padding: 12px;
645
688
  display: flex;
646
689
  flex-direction: column;
647
690
  gap: 10px;
691
+ box-shadow: 0 10px 22px rgba(44, 31, 15, 0.08);
648
692
  }
649
693
 
650
694
  .container-card-head {
651
695
  display: flex;
696
+ flex-wrap: wrap;
652
697
  align-items: flex-start;
653
698
  justify-content: space-between;
654
- gap: 10px;
699
+ gap: 12px;
655
700
  }
656
701
 
657
702
  .container-toggle {
658
703
  flex: 1;
704
+ min-width: 0;
705
+ padding: 0;
706
+ border: none;
707
+ background: transparent;
708
+ color: var(--text);
709
+ display: flex;
710
+ align-items: flex-start;
711
+ justify-content: space-between;
712
+ gap: 12px;
713
+ }
714
+
715
+ button.container-toggle:hover,
716
+ button.container-toggle:active {
717
+ transform: none;
718
+ background: transparent;
719
+ }
720
+
721
+ button.container-toggle:focus-visible {
722
+ outline: none;
723
+ box-shadow: 0 0 0 3px rgba(196, 85, 31, 0.14);
724
+ }
725
+
726
+ .container-toggle-main {
727
+ min-width: 0;
728
+ flex: 1;
729
+ display: flex;
730
+ flex-direction: column;
731
+ gap: 8px;
732
+ }
733
+
734
+ .container-title-row {
735
+ display: flex;
736
+ align-items: flex-start;
737
+ gap: 10px;
738
+ min-width: 0;
739
+ }
740
+
741
+ .container-title-stack {
742
+ min-width: 0;
743
+ display: flex;
744
+ flex-direction: column;
745
+ gap: 4px;
746
+ }
747
+
748
+ .sidebar-icon {
749
+ width: 32px;
750
+ height: 32px;
751
+ flex: 0 0 auto;
752
+ display: inline-flex;
753
+ align-items: center;
754
+ justify-content: center;
755
+ border-radius: 11px;
756
+ border: 1px solid rgba(181, 146, 99, 0.34);
757
+ background: linear-gradient(180deg, rgba(255, 244, 232, 0.96) 0%, rgba(255, 252, 247, 0.9) 100%);
758
+ color: var(--accent-strong);
759
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
760
+ }
761
+
762
+ .sidebar-icon svg {
763
+ width: 18px;
764
+ height: 18px;
765
+ display: block;
659
766
  }
660
767
 
661
768
  .container-card-meta {
662
769
  display: flex;
663
770
  flex-wrap: wrap;
664
- gap: 6px;
771
+ gap: 8px;
665
772
  align-items: center;
666
- color: var(--muted);
773
+ }
774
+
775
+ .sidebar-badge {
776
+ display: inline-flex;
777
+ align-items: center;
778
+ gap: 4px;
779
+ min-height: 26px;
780
+ padding: 4px 10px;
781
+ border-radius: 999px;
782
+ border: 1px solid transparent;
667
783
  font-size: 11px;
784
+ font-weight: 700;
785
+ line-height: 1.2;
786
+ }
787
+
788
+ .container-status-pill {
789
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
790
+ }
791
+
792
+ .container-agent-badge {
793
+ background: rgba(15, 124, 114, 0.1);
794
+ border-color: rgba(15, 124, 114, 0.22);
795
+ color: var(--subaccent-strong);
796
+ }
797
+
798
+ .container-card-info {
799
+ color: #7b6d5d;
800
+ font-size: 11px;
801
+ line-height: 1.45;
802
+ white-space: nowrap;
803
+ overflow: hidden;
804
+ text-overflow: ellipsis;
668
805
  }
669
806
 
670
807
  .add-agent-btn {
671
- padding: 7px 10px;
808
+ align-self: flex-start;
809
+ padding: 7px 11px;
672
810
  font-size: 12px;
811
+ border-radius: 999px;
812
+ white-space: nowrap;
813
+ margin-bottom: 2px;
673
814
  }
674
815
 
675
816
  .agent-list {
676
817
  display: flex;
677
818
  flex-direction: column;
678
- gap: 6px;
819
+ gap: 7px;
820
+ }
821
+
822
+ .container-card-body {
823
+ margin-top: 2px;
824
+ padding: 10px;
825
+ border: 1px solid rgba(181, 146, 99, 0.28);
826
+ border-top-color: rgba(181, 146, 99, 0.4);
827
+ border-radius: 13px;
828
+ background: linear-gradient(180deg, rgba(244, 238, 228, 0.88) 0%, rgba(255, 255, 255, 0.98) 100%);
829
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
679
830
  }
680
831
 
681
832
  .agent-list[hidden] {
@@ -685,11 +836,11 @@ button.tree-toggle:focus-visible {
685
836
  .agent-item {
686
837
  text-align: left;
687
838
  width: 100%;
688
- border: 1px solid rgba(181, 146, 99, 0.42);
689
- background: var(--panel-strong);
839
+ border: 1px solid rgba(181, 146, 99, 0.38);
840
+ background: rgba(255, 255, 255, 0.94);
690
841
  color: var(--text);
691
- border-radius: 10px;
692
- padding: 10px;
842
+ border-radius: 12px;
843
+ padding: 10px 11px;
693
844
  animation: itemIn 220ms ease both;
694
845
  animation-delay: calc(var(--item-index, 0) * 24ms);
695
846
  }
@@ -2278,6 +2278,7 @@
2278
2278
  const title = document.createElement('div');
2279
2279
  title.className = opts.titleClassName || 'workbench-group-title';
2280
2280
  title.textContent = opts.title || '';
2281
+ title.title = opts.title || '';
2281
2282
  main.appendChild(title);
2282
2283
 
2283
2284
  const metaText = createTreeMetaText(opts.metaParts);
@@ -2303,6 +2304,91 @@
2303
2304
  return button;
2304
2305
  }
2305
2306
 
2307
+ function createSidebarIcon(name) {
2308
+ const icon = document.createElement('span');
2309
+ icon.className = `sidebar-icon ${name ? `sidebar-icon-${name}` : ''}`.trim();
2310
+ icon.setAttribute('aria-hidden', 'true');
2311
+
2312
+ if (name === 'cube') {
2313
+ icon.innerHTML = [
2314
+ '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">',
2315
+ '<path d="M12 3.5 4.75 7.5 12 11.5l7.25-4-7.25-4Z"></path>',
2316
+ '<path d="M4.75 7.5v9L12 20.5l7.25-4v-9"></path>',
2317
+ '<path d="M12 11.5v9"></path>',
2318
+ '</svg>'
2319
+ ].join('');
2320
+ }
2321
+
2322
+ return icon;
2323
+ }
2324
+
2325
+ function createSidebarBadge(text, className) {
2326
+ const badge = document.createElement('span');
2327
+ badge.className = `sidebar-badge ${className || ''}`.trim();
2328
+ badge.textContent = text || '';
2329
+ return badge;
2330
+ }
2331
+
2332
+ function createContainerToggle(containerGroup, expanded) {
2333
+ const status = sessionStatusInfo(containerGroup && containerGroup.status);
2334
+ const button = document.createElement('button');
2335
+ button.type = 'button';
2336
+ button.className = 'tree-toggle container-toggle';
2337
+ button.setAttribute('aria-expanded', expanded ? 'true' : 'false');
2338
+
2339
+ const main = document.createElement('div');
2340
+ main.className = 'container-toggle-main';
2341
+
2342
+ const titleRow = document.createElement('div');
2343
+ titleRow.className = 'container-title-row';
2344
+ titleRow.appendChild(createSidebarIcon('cube'));
2345
+
2346
+ const titleStack = document.createElement('div');
2347
+ titleStack.className = 'container-title-stack';
2348
+
2349
+ const kicker = document.createElement('div');
2350
+ kicker.className = 'container-card-kicker';
2351
+ kicker.textContent = '容器';
2352
+
2353
+ const title = document.createElement('div');
2354
+ title.className = 'container-card-title';
2355
+ title.textContent = containerGroup && containerGroup.containerName ? containerGroup.containerName : '';
2356
+ title.title = title.textContent;
2357
+
2358
+ titleStack.appendChild(kicker);
2359
+ titleStack.appendChild(title);
2360
+ titleRow.appendChild(titleStack);
2361
+ main.appendChild(titleRow);
2362
+
2363
+ const meta = document.createElement('div');
2364
+ meta.className = 'container-card-meta';
2365
+ meta.appendChild(createSidebarBadge(status.label, `session-status ${status.tone} container-status-pill`));
2366
+ meta.appendChild(createSidebarBadge(`${containerGroup && Array.isArray(containerGroup.sessions) ? containerGroup.sessions.length : 0} 个 AGENT`, 'container-agent-badge'));
2367
+ main.appendChild(meta);
2368
+
2369
+ const infoText = createTreeMetaText([
2370
+ containerGroup && containerGroup.image ? containerGroup.image : '',
2371
+ formatDateTime(containerGroup && containerGroup.updatedAt) || '暂无更新'
2372
+ ]);
2373
+ if (infoText) {
2374
+ const info = document.createElement('div');
2375
+ info.className = 'container-card-info';
2376
+ info.textContent = infoText;
2377
+ info.title = infoText;
2378
+ main.appendChild(info);
2379
+ }
2380
+
2381
+ const caret = document.createElement('span');
2382
+ caret.className = 'tree-toggle-caret';
2383
+ caret.setAttribute('aria-hidden', 'true');
2384
+ caret.textContent = '›';
2385
+
2386
+ button.appendChild(main);
2387
+ button.appendChild(caret);
2388
+
2389
+ return button;
2390
+ }
2391
+
2306
2392
  function createAgentRow(session, index) {
2307
2393
  const status = sessionStatusInfo(session.status);
2308
2394
  const btn = document.createElement('button');
@@ -2395,34 +2481,35 @@
2395
2481
  group.classList.toggle('has-active', directoryHasActive);
2396
2482
 
2397
2483
  const groupHead = createTreeToggle({
2398
- className: 'workbench-group-head',
2484
+ className: 'workbench-group-head workbench-path-bar',
2399
2485
  kickerClassName: 'workbench-group-kicker',
2400
2486
  titleClassName: 'workbench-group-title',
2401
- kicker: '目录',
2487
+ kicker: '路径分组',
2402
2488
  title: directoryGroup.path,
2403
2489
  expanded: directoryExpanded,
2404
2490
  metaParts: [
2405
- `${directoryGroup.containers.length} 个容器`,
2491
+ `${directoryGroup.containers.length} 容器`,
2406
2492
  `${directoryGroup.containers.reduce(function (count, containerGroup) {
2407
2493
  return count + containerGroup.sessions.length;
2408
- }, 0)} AGENT`,
2494
+ }, 0)} AGENT`,
2409
2495
  formatDateTime(directoryGroup.updatedAt) || '暂无更新'
2410
- ],
2411
- onClick: function () {
2412
- setSidebarDirectoryExpanded(directoryGroup.path, !directoryExpanded);
2413
- renderSessions();
2414
- }
2496
+ ]
2415
2497
  });
2416
2498
  group.appendChild(groupHead);
2417
2499
 
2418
2500
  const containerStack = document.createElement('div');
2419
2501
  containerStack.className = 'container-stack workbench-group-body';
2420
2502
  containerStack.hidden = !directoryExpanded;
2503
+ groupHead.addEventListener('click', function () {
2504
+ const nextExpanded = containerStack.hidden;
2505
+ setSidebarDirectoryExpanded(directoryGroup.path, nextExpanded);
2506
+ groupHead.setAttribute('aria-expanded', nextExpanded ? 'true' : 'false');
2507
+ containerStack.hidden = !nextExpanded;
2508
+ });
2421
2509
 
2422
2510
  directoryGroup.containers.forEach(function (containerGroup) {
2423
2511
  const containerExpanded = isContainerExpanded(containerGroup);
2424
2512
  const containerHasActive = containerContainsActiveSession(containerGroup);
2425
- const status = sessionStatusInfo(containerGroup.status);
2426
2513
  const containerCard = document.createElement('section');
2427
2514
  containerCard.className = 'container-card';
2428
2515
  containerCard.classList.toggle('has-active', containerHasActive);
@@ -2430,23 +2517,7 @@
2430
2517
  const containerHead = document.createElement('div');
2431
2518
  containerHead.className = 'container-card-head';
2432
2519
 
2433
- const containerInfo = createTreeToggle({
2434
- className: 'container-toggle',
2435
- kickerClassName: 'container-card-kicker',
2436
- titleClassName: 'container-card-title',
2437
- kicker: '容器',
2438
- title: containerGroup.containerName,
2439
- expanded: containerExpanded,
2440
- metaParts: [
2441
- status.label,
2442
- `${containerGroup.sessions.length} 个AGENT`,
2443
- formatDateTime(containerGroup.updatedAt) || '暂无更新'
2444
- ],
2445
- onClick: function () {
2446
- setSidebarContainerExpanded(containerGroup.containerName, !containerExpanded);
2447
- renderSessions();
2448
- }
2449
- });
2520
+ const containerToggle = createContainerToggle(containerGroup, containerExpanded);
2450
2521
 
2451
2522
  const addAgentBtn = document.createElement('button');
2452
2523
  addAgentBtn.type = 'button';
@@ -2456,13 +2527,19 @@
2456
2527
  createAgentSession(containerGroup.containerName);
2457
2528
  });
2458
2529
 
2459
- containerHead.appendChild(containerInfo);
2460
- containerHead.appendChild(addAgentBtn);
2530
+ containerHead.appendChild(containerToggle);
2461
2531
  containerCard.appendChild(containerHead);
2462
2532
 
2463
2533
  const agentList = document.createElement('div');
2464
- agentList.className = 'agent-list';
2534
+ agentList.className = 'agent-list container-card-body';
2465
2535
  agentList.hidden = !containerExpanded;
2536
+ containerToggle.addEventListener('click', function () {
2537
+ const nextExpanded = agentList.hidden;
2538
+ setSidebarContainerExpanded(containerGroup.containerName, nextExpanded);
2539
+ containerToggle.setAttribute('aria-expanded', nextExpanded ? 'true' : 'false');
2540
+ agentList.hidden = !nextExpanded;
2541
+ });
2542
+ agentList.appendChild(addAgentBtn);
2466
2543
  containerGroup.sessions.forEach(function (session) {
2467
2544
  const row = createAgentRow(session, itemIndex);
2468
2545
  state.sessionNodeMap.set(session.name, row);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcanwin/manyoyo",
3
- "version": "5.7.6",
3
+ "version": "5.7.8",
4
4
  "imageVersion": "1.9.0-common",
5
5
  "playwrightCliVersion": "0.1.1",
6
6
  "description": "AI Agent CLI Security Sandbox for Docker and Podman",