dsh-composer-ux 0.25.0 → 0.26.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/lib/client.js CHANGED
@@ -1006,6 +1006,7 @@ var REPO_URL = "https://github.com/fangwen9527/dsh-composer-ux";
1006
1006
  var SITE_URL = "https://www.deepseek.com/harness/";
1007
1007
  var RESTART_API_PATH = "/composer-ux/restart";
1008
1008
  var USAGE_API_PATH = "/composer-ux/usage";
1009
+ var QUOTA_API_PATH = "/composer-ux/quota";
1009
1010
  var MODELS_API_PATH = "/composer-ux/models";
1010
1011
  var RESTART_CSRF_HEADER = "x-composer-ux-restart";
1011
1012
  var RESTART_CSRF_VALUE = "1";
@@ -2392,17 +2393,58 @@ function clampPanelHeight(height) {
2392
2393
 
2393
2394
  // src/client/settings-style.ts
2394
2395
  var CARD_CSS = `
2396
+ /* \u2500\u2500 \u8BBE\u7F6E\u9875\u6839 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2397
+ /* \u6570\u5B57\u4E00\u5F8B\u7B49\u5BBD\uFF1A\u5C3A\u5BF8 / \u5355\u4EF7 / \u5929\u6570\u90FD\u5728\u5361\u7247\u91CC\uFF0C\u8DF3\u52A8\u65F6\u4E0D\u80FD\u8BA9\u5C0F\u6570\u70B9\u6765\u56DE\u632A\u3002 */
2398
+ .dsh-ux-settings { font-variant-numeric: tabular-nums; }
2399
+
2400
+ /* \u2500\u2500 \u5361\u7247\u5916\u58F3 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2395
2401
  .dsh-ux-card {
2396
2402
  border: 1px solid var(--dsw-alias-border-l2);
2397
2403
  background: var(--dsw-alias-bg-layer-3);
2398
2404
  border-radius: 12px;
2399
2405
  margin-bottom: 12px;
2400
- transition: border-color .16s, background .16s;
2406
+ transition: border-color .16s, background-color .16s;
2401
2407
  }
2402
2408
  .dsh-ux-card:hover { border-color: var(--dsw-alias-label-dimmed); }
2403
- .dsh-ux-cardOpen {
2404
- background: var(--dsw-alias-bg-layer-2);
2405
- border-color: var(--dsw-alias-label-dimmed);
2409
+ /* \u5C55\u5F00\u65F6\u53EA\u52A0\u6DF1\u63CF\u8FB9\u3001**\u4E0D\u6362\u5E95\u8272**\uFF1A\u5361\u91CC\u7684\u5206\u6BB5\u63A7\u4EF6\u9009\u4E2D\u9879\u753B\u5728 layer-2 \u4E0A\uFF0C
2410
+ \u5361\u7247\u672C\u8EAB\u4E5F\u6389\u5230 layer-2 \u7684\u8BDD\uFF0C\u9009\u4E2D\u9879\u5C31\u6CA1\u5E95\u4E86\uFF08\u6362\u76AE\u6700\u5BB9\u6613\u6F0F\u7684\u4E00\u5904\uFF09\u3002 */
2411
+ .dsh-ux-cardOpen { border-color: var(--dsw-alias-label-dimmed); }
2412
+ /* \u672A\u542F\u7528\uFF1A\u63CF\u8FB9\u6539\u865A\u7EBF\uFF0C\u4E00\u773C\u770B\u51FA"\u8FD9\u4E00\u680F\u73B0\u5728\u4E0D\u751F\u6548"\u3002 */
2413
+ .dsh-ux-cardOff { border-style: dashed; }
2414
+ .dsh-ux-cardOff .dsh-ux-cardBody { opacity: .62; }
2415
+ /* \u9876\u90E8\u8FD9\u5F20\u5361\u5728 DOM \u4E0A\u8FD8\u5305\u7740\u300C\u5FAE\u4FE1\u901A\u77E5 / \u76EE\u5F55\u9009\u62E9 / \u81EA\u68C0 / \u81EA\u542F\u52A8\u300D\u4E0E\u603B\u5F00\u5173\u90A3\u4E00\u884C
2416
+ \uFF08\u90A3\u51E0\u5757\u7684\u5148\u540E\u987A\u5E8F\u88AB test/client-registration.mjs \u9489\u7740\uFF0C\u8FD9\u4E00\u8F6E\u4E0D\u52A8\u7ED3\u6784\uFF09\u3002
2417
+ \u6240\u4EE5\u5B83\u81EA\u5DF1**\u4E0D\u753B\u5361\u7247**\uFF1A\u753B\u4E86\u5C31\u662F"\u5361\u7247\u5957\u5361\u7247"\uFF0C\u5185\u5916\u4E24\u5C42\u63CF\u8FB9\u4F1A\u8D34\u5728\u4E00\u8D77\u53D8\u6210\u53CC\u7EBF\u3002
2418
+ \u5B83\u9000\u5316\u6210\u4E00\u5757\u9875\u5934 \u2014\u2014 \u6807\u9898 + \u4E00\u884C\u63CF\u8FF0 + \u5237\u65B0/\u91CD\u542F/\u94FE\u63A5\uFF0C\u4E0E\u53C2\u8003\u4ED3\u5E93\u7684\u8BBE\u7F6E\u9875\u4E00\u81F4\u3002 */
2419
+ .dsh-ux-cardTop {
2420
+ background: transparent;
2421
+ border: 0;
2422
+ margin-bottom: 0;
2423
+ }
2424
+ .dsh-ux-cardTop:hover { border-color: transparent; }
2425
+ .dsh-ux-cardTop .dsh-ux-cardHeaderStatic { padding: 2px 0 14px; }
2426
+ .dsh-ux-cardTop > .dsh-ux-restartBanner { margin: 0 0 12px; }
2427
+ /* \u603B\u5F00\u5173\u90A3\u4E00\u884C\u662F\u9875\u5934\u7684\u5C3E\u5DF4\uFF08DOM \u4E0A\u5B83\u6392\u5728\u90A3\u51E0\u5F20\u5361\u4E4B\u540E\uFF09\uFF0C\u5355\u72EC\u8BFB\u6210\u4E00\u5F20\u5C0F\u5361\uFF0C
2428
+ \u5426\u5219\u5B83\u4F1A\u5939\u5728\u4E24\u5F20\u5361\u4E2D\u95F4\u3001\u53EA\u6709\u4E00\u6761\u5B64\u96F6\u96F6\u7684\u6A2A\u7EBF\u3002 */
2429
+ .dsh-ux-cardTop > .dsh-ux-cardBody {
2430
+ background: var(--dsw-alias-bg-layer-3);
2431
+ border: 1px solid var(--dsw-alias-border-l2);
2432
+ border-radius: 12px;
2433
+ margin: 0 0 12px;
2434
+ padding: 0 16px;
2435
+ }
2436
+ /* \u9876\u90E8\u90A3\u5F20\u680F\u76EE\u5934\u5361\uFF1A\u5B83\u4E0D\u662F\u6298\u53E0\u5361\uFF0C\u6807\u9898\u6BD4\u5176\u4ED6 11 \u5F20\u9AD8\u4E00\u53F7\u3002 */
2437
+ .dsh-ux-cardTop .dsh-ux-cardName { font-size: 15px; }
2438
+
2439
+ /* \u2500\u2500 \u6807\u9898\u884C \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2440
+ /* \u6807\u9898\u884C = \u5DE6\u8FB9"\u5C55\u5F00"\u6309\u94AE\uFF08\u5360\u6EE1\u5269\u4F59\u5BBD\u5EA6\uFF09+ \u53F3\u8FB9\u4ECE\u5C5E\u63A7\u4EF6\u4E0E\u672C\u680F\u5F00\u5173\u3002
2441
+ \u4E0D\u80FD\u5728 <button> \u91CC\u585E\u6309\u94AE\uFF0C\u6240\u4EE5\u4E24\u8005\u662F\u5144\u5F1F\u8282\u70B9\u3002 */
2442
+ .dsh-ux-cardHeaderRow {
2443
+ display: flex;
2444
+ align-items: center;
2445
+ flex-wrap: wrap;
2446
+ gap: 8px;
2447
+ padding-right: 12px;
2406
2448
  }
2407
2449
  .dsh-ux-cardHeader {
2408
2450
  appearance: none;
@@ -2418,21 +2460,46 @@ var CARD_CSS = `
2418
2460
  border-radius: 12px;
2419
2461
  display: flex;
2420
2462
  align-items: center;
2421
- gap: 12px;
2422
- padding: 14px 16px;
2463
+ gap: 10px;
2464
+ padding: 12px 14px;
2423
2465
  }
2424
2466
  .dsh-ux-cardHeader:focus-visible {
2425
2467
  outline: 2px solid var(--dsw-alias-brand-primary);
2426
2468
  outline-offset: -2px;
2427
2469
  }
2428
- /* \u6807\u9898\u884C = \u5DE6\u8FB9"\u5C55\u5F00"\u6309\u94AE\uFF08\u5360\u6EE1\u5269\u4F59\u5BBD\u5EA6\uFF09+ \u53F3\u8FB9\u4ECE\u5C5E\u63A7\u4EF6\u4E0E\u672C\u680F\u5F00\u5173\u3002
2429
- \u4E0D\u80FD\u5728 <button> \u91CC\u585E\u6309\u94AE\uFF0C\u6240\u4EE5\u4E24\u8005\u662F\u5144\u5F1F\u8282\u70B9\u3002 */
2430
- .dsh-ux-cardHeaderRow {
2470
+ .dsh-ux-cardHeaderStatic {
2471
+ box-sizing: border-box;
2431
2472
  display: flex;
2432
- align-items: center;
2473
+ align-items: flex-start;
2433
2474
  flex-wrap: wrap;
2475
+ gap: 12px;
2476
+ padding: 14px 16px;
2477
+ }
2478
+ .dsh-ux-cardHeadText {
2479
+ display: flex;
2480
+ flex-direction: column;
2481
+ flex: 1;
2482
+ gap: 3px;
2483
+ min-width: 0;
2484
+ }
2485
+ .dsh-ux-cardTitleRow {
2486
+ align-items: center;
2487
+ display: flex;
2434
2488
  gap: 6px;
2435
- padding-right: 12px;
2489
+ min-width: 0;
2490
+ }
2491
+ .dsh-ux-cardName {
2492
+ color: var(--dsw-alias-label-primary);
2493
+ font-size: 13.5px;
2494
+ font-weight: 600;
2495
+ line-height: 1.35;
2496
+ margin: 0;
2497
+ }
2498
+ .dsh-ux-cardDescription {
2499
+ color: var(--dsw-alias-label-tertiary);
2500
+ font-size: 12px;
2501
+ line-height: 1.5;
2502
+ margin: 0;
2436
2503
  }
2437
2504
  .dsh-ux-cardControls {
2438
2505
  align-items: center;
@@ -2441,7 +2508,7 @@ var CARD_CSS = `
2441
2508
  flex-wrap: wrap;
2442
2509
  gap: 8px;
2443
2510
  }
2444
- /* \u6807\u9898\u884C\u91CC\u7684"\u6587\u5B57 + \u5C0F\u5F00\u5173"\uFF08\u5BFC\u822A\u6EDA\u52A8 / \u8FB9\u7F18\u7F29\u653E\uFF09\u3002 */
2511
+ /* \u6807\u9898\u884C\u91CC\u7684"\u6587\u5B57 + \u5C0F\u5F00\u5173"\uFF08\u8FB9\u7F18\u7F29\u653E\u8FD9\u7C7B\uFF09\u3002 */
2445
2512
  .dsh-ux-miniToggle {
2446
2513
  align-items: center;
2447
2514
  color: var(--dsw-alias-label-secondary);
@@ -2451,36 +2518,188 @@ var CARD_CSS = `
2451
2518
  gap: 5px;
2452
2519
  white-space: nowrap;
2453
2520
  }
2454
- /* \u672A\u542F\u7528\uFF1A\u6807\u9898\u884C\u91CC\u8BF4\u6E05\u695A\uFF0C\u6B63\u6587\u538B\u6697\uFF0C\u8BA9\u4EBA\u4E00\u773C\u770B\u51FA"\u8FD9\u4E00\u680F\u73B0\u5728\u4E0D\u751F\u6548"\u3002 */
2455
- .dsh-ux-cardOff { border-style: dashed; }
2456
- .dsh-ux-cardOff .dsh-ux-cardBody { opacity: .6; }
2457
- .dsh-ux-cardHeaderStatic {
2458
- box-sizing: border-box;
2459
- display: flex;
2521
+ .dsh-ux-cardChevron {
2522
+ color: var(--dsw-alias-label-tertiary);
2523
+ flex: none;
2524
+ transition: transform .16s;
2525
+ }
2526
+ .dsh-ux-cardChevronOpen { transform: rotate(180deg); }
2527
+
2528
+ /* \u2500\u2500 \u5361\u5185\u6B63\u6587 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2529
+ .dsh-ux-cardBody {
2530
+ border-top: 1px solid var(--dsw-alias-border-l2);
2531
+ margin: 0 16px;
2532
+ padding: 2px 0 14px;
2533
+ }
2534
+ /* \u5BFC\u8BED\uFF1A\u5361\u7247\u5F00\u5934\u90A3\u6BB5"\u8FD9\u4E00\u680F\u5E72\u4EC0\u4E48"\u7684\u957F\u8BF4\u660E\uFF08\u7A84\u9762\u677F\u91CC\u8981\u8BFB\u5F97\u4E0B\u53BB\uFF09\u3002 */
2535
+ .dsh-ux-lead {
2536
+ color: var(--dsw-alias-label-secondary);
2537
+ font-size: 12px;
2538
+ line-height: 1.7;
2539
+ margin: 12px 0;
2540
+ }
2541
+ .dsh-ux-lead strong { color: var(--dsw-alias-label-primary); font-weight: 600; }
2542
+
2543
+ /* \u2500\u2500 \u8BBE\u7F6E\u884C \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2544
+ .dsh-ux-row {
2460
2545
  align-items: center;
2546
+ border-top: 1px solid var(--dsw-alias-border-l2);
2547
+ display: flex;
2461
2548
  gap: 12px;
2462
- padding: 14px 16px;
2549
+ padding: 10px 0;
2463
2550
  }
2464
- .dsh-ux-cardHeadText {
2551
+ .dsh-ux-rowFirst { border-top: none; }
2552
+ .dsh-ux-rowStacked { align-items: stretch; flex-direction: column; gap: 8px; }
2553
+ .dsh-ux-rowText { flex: 1; min-width: 0; }
2554
+ .dsh-ux-rowTitle {
2555
+ align-items: center;
2556
+ color: var(--dsw-alias-label-primary);
2465
2557
  display: flex;
2466
- flex-direction: column;
2467
- flex: 1;
2468
- gap: 4px;
2469
- min-width: 0;
2558
+ font-size: 12.5px;
2559
+ gap: 6px;
2560
+ line-height: 1.45;
2470
2561
  }
2471
- .dsh-ux-cardName {
2562
+ .dsh-ux-rowDesc {
2563
+ color: var(--dsw-alias-label-tertiary);
2564
+ font-size: 11.5px;
2565
+ line-height: 1.55;
2566
+ margin-top: 2px;
2567
+ }
2568
+ .dsh-ux-rowControl {
2569
+ align-items: center;
2570
+ display: inline-flex;
2571
+ flex: none;
2572
+ flex-wrap: wrap;
2573
+ gap: 8px;
2574
+ justify-content: flex-end;
2575
+ }
2576
+ .dsh-ux-rowStacked .dsh-ux-rowControl { justify-content: flex-start; }
2577
+
2578
+ /* \u2500\u2500 \u5206\u6BB5\u63A7\u4EF6 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2579
+ .dsh-ux-segmented {
2580
+ align-items: center;
2581
+ background: transparent;
2582
+ border: 1px solid var(--dsw-alias-border-l2);
2583
+ border-radius: 8px;
2584
+ display: inline-flex;
2585
+ flex: none;
2586
+ gap: 2px;
2587
+ padding: 2px;
2588
+ }
2589
+ .dsh-ux-segment {
2590
+ appearance: none;
2591
+ background: transparent;
2592
+ border: 1px solid transparent;
2593
+ border-radius: 6px;
2594
+ color: var(--dsw-alias-label-tertiary);
2595
+ cursor: pointer;
2596
+ font: inherit;
2597
+ font-size: 12px;
2598
+ line-height: 1;
2599
+ padding: 5px 10px;
2600
+ transition: background-color .14s, border-color .14s, color .14s;
2601
+ white-space: nowrap;
2602
+ }
2603
+ .dsh-ux-segment:hover { color: var(--dsw-alias-label-primary); }
2604
+ .dsh-ux-segmentOn {
2605
+ background: var(--dsw-alias-bg-layer-2);
2606
+ border-color: var(--dsw-alias-border-l2);
2472
2607
  color: var(--dsw-alias-label-primary);
2473
- font-size: 15px;
2474
2608
  font-weight: 600;
2475
- line-height: 1.4;
2476
- margin: 0;
2477
2609
  }
2478
- .dsh-ux-cardDescription {
2610
+ .dsh-ux-segmentedCompact .dsh-ux-segment { font-size: 11px; padding: 4px 8px; }
2611
+
2612
+ /* \u6807\u9898\u884C/\u5361\u5185\u7684 PillChoice\uFF08role=group\uFF09\uFF1A\u5B83\u662F\u4E2A\u72EC\u7ACB\u7EC4\u4EF6\u3001\u5185\u8054\u6837\u5F0F\u5199\u5728\u90A3\u8FB9\uFF0C
2613
+ \u8FD9\u4E00\u8F6E\u4E0D\u80FD\u6539\u90A3\u4E2A\u6587\u4EF6\uFF0C\u800C\u6807\u9898\u884C\u8981\u7684\u662F"\u4E00\u4E2A\u63A7\u4EF6\u5206\u6210\u51E0\u6BB5"\u7684\u89C2\u611F\uFF0C\u6240\u4EE5\u53EA\u5728
2614
+ \u672C\u63D2\u4EF6\u7684\u5BB9\u5668\u91CC\u3001\u5BF9\u5B83\u90A3\u51E0\u4E2A\u5185\u8054\u5C5E\u6027\u7528 !important \u76D6\u4F4F\uFF08\u5185\u8054\u6837\u5F0F\u662F\u666E\u901A\u4F18\u5148\u7EA7\uFF09\u3002
2615
+ :not(.dsh-ux-segmented) \u662F\u4E3A\u4E86\u4E0D\u91CD\u590D\u547D\u4E2D\u672C\u6587\u4EF6\u81EA\u5DF1\u7684\u5206\u6BB5\u63A7\u4EF6\u3002 */
2616
+ .dsh-ux-cardControls > [role='group']:not(.dsh-ux-segmented),
2617
+ .dsh-ux-cardBody [role='group']:not(.dsh-ux-segmented) {
2618
+ border: 1px solid var(--dsw-alias-border-l2);
2619
+ border-radius: 8px;
2620
+ padding: 2px;
2621
+ }
2622
+ .dsh-ux-cardControls > [role='group']:not(.dsh-ux-segmented) > button,
2623
+ .dsh-ux-cardBody [role='group']:not(.dsh-ux-segmented) > button {
2624
+ background: transparent !important;
2625
+ border: 1px solid transparent !important;
2626
+ border-radius: 6px !important;
2627
+ color: var(--dsw-alias-label-tertiary) !important;
2628
+ font-size: 11px !important;
2629
+ line-height: 1 !important;
2630
+ padding: 4px 8px !important;
2631
+ transition: background-color .14s, border-color .14s, color .14s;
2632
+ }
2633
+ .dsh-ux-cardControls > [role='group']:not(.dsh-ux-segmented) > button:hover,
2634
+ .dsh-ux-cardBody [role='group']:not(.dsh-ux-segmented) > button:hover {
2635
+ color: var(--dsw-alias-label-primary) !important;
2636
+ }
2637
+ .dsh-ux-cardControls > [role='group']:not(.dsh-ux-segmented) > button[aria-pressed='true'],
2638
+ .dsh-ux-cardBody [role='group']:not(.dsh-ux-segmented) > button[aria-pressed='true'] {
2639
+ background: var(--dsw-alias-bg-layer-2) !important;
2640
+ border-color: var(--dsw-alias-border-l2) !important;
2641
+ color: var(--dsw-alias-label-primary) !important;
2642
+ font-weight: 600;
2643
+ }
2644
+
2645
+ /* \u2500\u2500 ? \u60AC\u505C\u8BF4\u660E \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2646
+ /* \u5FBD\u6807\u53EA\u5360 14px\uFF1A\u8BF4\u660E\u6587\u5B57\u653E\u8FDB\u6D6E\u5C42\uFF0C\u5361\u9762\u624D\u6536\u5F97\u56DE"\u4E00\u53E5\u6982\u89C8"\u7684\u5BC6\u5EA6\u3002 */
2647
+ .dsh-ux-hint {
2648
+ align-items: center;
2649
+ appearance: none;
2650
+ background: transparent;
2651
+ border: 1px solid var(--dsw-alias-border-l2);
2652
+ border-radius: 50%;
2653
+ color: var(--dsw-alias-label-tertiary);
2654
+ cursor: help;
2655
+ display: inline-flex;
2656
+ flex: none;
2657
+ font: inherit;
2658
+ font-size: 10px;
2659
+ height: 14px;
2660
+ justify-content: center;
2661
+ line-height: 1;
2662
+ padding: 0;
2663
+ transition: border-color .14s, color .14s;
2664
+ width: 14px;
2665
+ }
2666
+ .dsh-ux-hint:hover,
2667
+ .dsh-ux-hintOpen {
2668
+ border-color: var(--dsw-alias-label-dimmed);
2669
+ color: var(--dsw-alias-label-primary);
2670
+ }
2671
+ /* \u6D6E\u5C42\uFF1A\u5B98\u65B9\u83DC\u5355\u9762 + \u6BDB\u73BB\u7483\uFF08\u53EA\u6284\u534A\u900F\u660E\u4F1A\u51FA\u73B0"\u4E00\u5757\u6CA1\u78E8\u7802\u7684\u73BB\u7483"\uFF0C0.1.7 \u8E29\u8FC7\uFF09\u3002
2672
+ \u56FA\u5B9A\u5B9A\u4F4D + \u7531 JS \u5939\u8FDB\u89C6\u53E3\uFF0C\u89C1 ui-kit.tsx \u7684 Hint\u3002 */
2673
+ .dsh-ux-hintBubble {
2674
+ background: var(--dsw-specific-menu);
2675
+ backdrop-filter: var(--dsw-menu-backdrop-filter);
2676
+ border: 1px solid var(--dsw-alias-border-l1);
2677
+ border-radius: 8px;
2678
+ box-shadow: var(--dsw-elevation-prominent);
2679
+ box-sizing: border-box;
2479
2680
  color: var(--dsw-alias-label-secondary);
2480
- font-size: 13px;
2481
- line-height: 1.5;
2482
- margin: 0;
2681
+ font-size: 12px;
2682
+ line-height: 1.6;
2683
+ padding: 8px 10px;
2684
+ pointer-events: none;
2685
+ position: fixed;
2686
+ white-space: pre-wrap;
2687
+ z-index: 1200;
2688
+ }
2689
+
2690
+ /* \u2500\u2500 \u5361\u5185\u5C0F\u6807\u9898 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2691
+ .dsh-ux-groupLabel {
2692
+ align-items: center;
2693
+ color: var(--dsw-alias-label-tertiary);
2694
+ display: flex;
2695
+ font-size: 11.5px;
2696
+ font-weight: 600;
2697
+ gap: 6px;
2698
+ letter-spacing: .04em;
2699
+ margin: 14px 0 2px;
2483
2700
  }
2701
+
2702
+ /* \u2500\u2500 \u62AC\u5934\uFF1A\u52A8\u4F5C\u6309\u94AE\u4E0E\u94FE\u63A5 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
2484
2703
  .dsh-ux-cardLink {
2485
2704
  align-items: center;
2486
2705
  color: var(--dsw-alias-label-secondary);
@@ -2495,12 +2714,13 @@ var CARD_CSS = `
2495
2714
  color: var(--dsw-alias-brand-primary);
2496
2715
  text-decoration: underline;
2497
2716
  }
2498
- /* \u62AC\u5934\u53F3\u7AEF\u90A3\u4E00\u7EC4\uFF1A\u91CD\u542F\u6309\u94AE + GitHub \u94FE\u63A5\uFF0C\u4E24\u679A\u90FD\u4E0D\u53C2\u4E0E\u6536\u7F29\u3002 */
2717
+ /* \u62AC\u5934\u53F3\u7AEF\u90A3\u4E00\u7EC4\uFF1A\u5237\u65B0 + \u91CD\u542F + \u4E24\u4E2A\u94FE\u63A5\uFF0C\u56DB\u679A\u90FD\u4E0D\u53C2\u4E0E\u6536\u7F29\u3002 */
2499
2718
  .dsh-ux-cardActions {
2500
2719
  align-items: center;
2501
2720
  display: inline-flex;
2502
2721
  flex: none;
2503
- gap: 10px;
2722
+ flex-wrap: wrap;
2723
+ gap: 8px;
2504
2724
  }
2505
2725
  .dsh-ux-restartButton {
2506
2726
  appearance: none;
@@ -2584,17 +2804,6 @@ var CARD_CSS = `
2584
2804
  border-color: var(--dsw-alias-label-dimmed);
2585
2805
  color: var(--dsw-alias-label-primary);
2586
2806
  }
2587
- .dsh-ux-cardChevron {
2588
- color: var(--dsw-alias-label-tertiary);
2589
- flex: none;
2590
- transition: transform .16s;
2591
- }
2592
- .dsh-ux-cardChevronOpen { transform: rotate(180deg); }
2593
- .dsh-ux-cardBody {
2594
- border-top: 1px solid var(--dsw-alias-border-l2);
2595
- margin: 0 16px;
2596
- padding-bottom: 8px;
2597
- }
2598
2807
  `;
2599
2808
  function installSettingsCardStyle() {
2600
2809
  const tag = document.createElement("style");
@@ -2664,8 +2873,8 @@ var row = {
2664
2873
  justifyContent: "space-between",
2665
2874
  gap: 12,
2666
2875
  minHeight: 40,
2667
- padding: "7px 0",
2668
- borderTop: "0.5px solid var(--dsw-alias-border-l2)"
2876
+ padding: "10px 0",
2877
+ borderTop: "1px solid var(--dsw-alias-border-l2)"
2669
2878
  };
2670
2879
  var rowText = {
2671
2880
  minWidth: 0,
@@ -2673,13 +2882,13 @@ var rowText = {
2673
2882
  };
2674
2883
  var rowTitle = {
2675
2884
  color: "var(--dsw-alias-label-primary)",
2676
- fontSize: 13,
2677
- lineHeight: 1.4
2885
+ fontSize: 12.5,
2886
+ lineHeight: 1.45
2678
2887
  };
2679
2888
  var rowDesc = {
2680
2889
  color: "var(--dsw-alias-label-tertiary)",
2681
- fontSize: 11,
2682
- lineHeight: 1.4,
2890
+ fontSize: 11.5,
2891
+ lineHeight: 1.55,
2683
2892
  marginTop: 2
2684
2893
  };
2685
2894
  var kbd = {
@@ -4007,7 +4216,7 @@ function RestartTitlebarButton() {
4007
4216
  }
4008
4217
 
4009
4218
  // src/client/SettingsSection.tsx
4010
- var import_react9 = require("react");
4219
+ var import_react10 = require("react");
4011
4220
 
4012
4221
  // src/client/DoctorCard.tsx
4013
4222
  var import_react4 = require("react");
@@ -4059,7 +4268,11 @@ function DoctorCard() {
4059
4268
  });
4060
4269
  }, []);
4061
4270
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
4062
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { style: description, children: "\u628A\u63D2\u4EF6\u5404\u5904\u72B6\u6001\u644A\u5E73\u6210\u4E00\u5F20\u8868\uFF1A\u8BBE\u7F6E\u5B57\u6BB5\u662F\u5426\u90FD\u5728\u5BBF\u4E3B schema \u91CC\uFF08\u4E0D\u5728\u7684\u8BDD\u5F00\u5173\u62E8\u4E0D\u52A8\uFF09\u3001 \u516B\u680F\u5F00\u5173\u3001\u7EC8\u7AEF\u66FF\u6362\u3001\u8BF7\u6C42\u5934\u8FD0\u884C\u671F\u8986\u76D6\u3001\u5FEB\u6377\u6307\u4EE4\u672C\u3001\u901A\u77E5\u51ED\u636E\u3001\u89E3\u91CA\u5C42\u6863\u4F4D\u3001\u8FD0\u884C\u73AF\u5883\u3002 \u8FD9\u4E9B\u90FD\u662F**\u53EA\u8BFB**\u68C0\u67E5\uFF0C\u4E0D\u4F1A\u6539\u52A8\u4EFB\u4F55\u4E1C\u897F\u3002" }),
4271
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("p", { style: description, children: [
4272
+ "\u628A\u63D2\u4EF6\u5404\u5904\u72B6\u6001\u644A\u5E73\u6210\u4E00\u5F20\u8868\uFF1A\u8BBE\u7F6E\u5B57\u6BB5\u662F\u5426\u90FD\u5728\u5BBF\u4E3B schema \u91CC\uFF08\u4E0D\u5728\u7684\u8BDD\u5F00\u5173\u62E8\u4E0D\u52A8\uFF09\u3001 \u516B\u680F\u5F00\u5173\u3001\u7EC8\u7AEF\u66FF\u6362\u3001\u8BF7\u6C42\u5934\u8FD0\u884C\u671F\u8986\u76D6\u3001\u5FEB\u6377\u6307\u4EE4\u672C\u3001\u901A\u77E5\u51ED\u636E\u3001\u89E3\u91CA\u5C42\u6863\u4F4D\u3001\u8FD0\u884C\u73AF\u5883\u3002 \u8FD9\u4E9B\u90FD\u662F",
4273
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("strong", { children: "\u53EA\u8BFB" }),
4274
+ "\u68C0\u67E5\uFF0C\u4E0D\u4F1A\u6539\u52A8\u4EFB\u4F55\u4E1C\u897F\u3002"
4275
+ ] }),
4063
4276
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "10px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4064
4277
  "button",
4065
4278
  {
@@ -4098,7 +4311,13 @@ function AutostartCard(props) {
4098
4311
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u5F53\u524D\u8FD9\u4E2A\u8FD0\u884C\u65F6" }),
4099
4312
  "\uFF1A\u5728\u7F51\u9875\u7248\u91CC\u6253\u5F00\u5C31\u6CE8\u518C\u7F51\u9875\u7248\uFF08\u7528\u5F53\u524D profile\u3001\u5F53\u524D\u8FD9\u6761\u542F\u52A8\u547D\u4EE4\uFF09\uFF0C \u5728\u684C\u9762\u5E94\u7528\u91CC\u6253\u5F00\u5C31\u6CE8\u518C\u684C\u9762\u5E94\u7528\u3002\u4E24\u4E2A\u8FD0\u884C\u65F6\u5404\u7528\u81EA\u5DF1\u90A3\u4E00\u6761\u542F\u52A8\u9879\uFF0C\u4E92\u4E0D\u8986\u76D6\u3002",
4100
4313
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("br", {}),
4101
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { opacity: 0.75 }, children: "\u53EA\u5199 `HKEY_CURRENT_USER\\...\\Run`\uFF08\u5F53\u524D\u7528\u6237\uFF0C**\u4E0D\u9700\u8981\u7BA1\u7406\u5458**\uFF09\uFF1B\u5173\u6389\u5F00\u5173\u5C31\u662F\u5220\u6389\u81EA\u5DF1\u90A3\u4E00\u6761\u3002 \u72B6\u6001\u4EE5**\u7CFB\u7EDF\u91CC\u5B9E\u9645\u6709\u6CA1\u6709**\u4E3A\u51C6 \u2014\u2014 \u4F60\u5728\u6CE8\u518C\u8868\u91CC\u624B\u52A8\u5220\u4E86\uFF0C\u8FD9\u91CC\u5C31\u663E\u793A\u5173\u3002" })
4314
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { style: { opacity: 0.75 }, children: [
4315
+ "\u53EA\u5199 `HKEY_CURRENT_USER\\...\\Run`\uFF08\u5F53\u524D\u7528\u6237\uFF0C",
4316
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u4E0D\u9700\u8981\u7BA1\u7406\u5458" }),
4317
+ "\uFF09\uFF1B\u5173\u6389\u5F00\u5173\u5C31\u662F\u5220\u6389\u81EA\u5DF1\u90A3\u4E00\u6761\u3002 \u72B6\u6001\u4EE5",
4318
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u7CFB\u7EDF\u91CC\u5B9E\u9645\u6709\u6CA1\u6709" }),
4319
+ "\u4E3A\u51C6 \u2014\u2014 \u4F60\u5728\u6CE8\u518C\u8868\u91CC\u624B\u52A8\u5220\u4E86\uFF0C\u8FD9\u91CC\u5C31\u663E\u793A\u5173\u3002"
4320
+ ] })
4102
4321
  ] }),
4103
4322
  state2 === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { style: optHint, children: view.error !== "" ? `\u8BFB\u4E0D\u5230\u542F\u52A8\u9879\u72B6\u6001\uFF1A${view.error}` : "\u6B63\u5728\u8BFB\u542F\u52A8\u9879\u72B6\u6001\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { style: { margin: "10px 0", fontSize: 12, lineHeight: 1.7 }, children: [
4104
4323
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
@@ -4413,6 +4632,19 @@ function AddPromptRow({
4413
4632
  // src/client/CostCard.tsx
4414
4633
  var import_react8 = __toESM(require("react"), 1);
4415
4634
 
4635
+ // src/subscription-plans.ts
4636
+ var QUOTA_WINDOW_LABEL = {
4637
+ rolling: "5 \u5C0F\u65F6",
4638
+ weekly: "\u672C\u5468",
4639
+ monthly: "\u672C\u6708"
4640
+ };
4641
+ function formatUsd(usd) {
4642
+ if (!Number.isFinite(usd) || usd <= 0) return "$0.00";
4643
+ if (usd < 0.01) return `$${usd.toFixed(4)}`;
4644
+ if (usd < 1) return `$${usd.toFixed(3)}`;
4645
+ return `$${usd.toFixed(2)}`;
4646
+ }
4647
+
4416
4648
  // src/client/money-admin.ts
4417
4649
  var import_react7 = __toESM(require("react"), 1);
4418
4650
 
@@ -4532,6 +4764,74 @@ function aliasNote(model) {
4532
4764
  function stampText(value) {
4533
4765
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? new Date(value).toLocaleString("zh-CN") : "\u4ECE\u6CA1\u540C\u6B65\u8FC7";
4534
4766
  }
4767
+ function resetText(iso) {
4768
+ if (typeof iso !== "string" || iso === "") return "";
4769
+ const at = Date.parse(iso);
4770
+ if (!Number.isFinite(at)) return "";
4771
+ const ms = at - Date.now();
4772
+ if (ms <= 0) return " \xB7 \u5373\u5C06\u91CD\u7F6E";
4773
+ const hours = Math.floor(ms / 36e5);
4774
+ if (hours < 1) return ` \xB7 ${Math.max(1, Math.round(ms / 6e4))} \u5206\u949F\u540E\u91CD\u7F6E`;
4775
+ if (hours < 48) return ` \xB7 ${hours} \u5C0F\u65F6\u540E\u91CD\u7F6E`;
4776
+ return ` \xB7 ${Math.round(hours / 24)} \u5929\u540E\u91CD\u7F6E`;
4777
+ }
4778
+ function usePlanQuota() {
4779
+ const [state2, setState] = import_react8.default.useState({ plans: [], error: "" });
4780
+ import_react8.default.useEffect(() => {
4781
+ let alive = true;
4782
+ const load = () => {
4783
+ void fetch(QUOTA_API_PATH, { headers: { accept: "application/json" } }).then((response) => response.json()).then((next) => {
4784
+ if (!alive) return;
4785
+ setState({
4786
+ plans: Array.isArray(next.plans) ? next.plans : [],
4787
+ error: next.ok === true ? "" : typeof next.error === "string" ? next.error : "\u53D6\u4E0D\u5230\u989D\u5EA6\u7A97\u53E3"
4788
+ });
4789
+ }).catch(() => {
4790
+ if (alive) setState((current) => ({ plans: current.plans, error: "\u53D6\u4E0D\u5230\u989D\u5EA6\u7A97\u53E3\uFF08\u7F51\u7EDC\u6216\u5BBF\u4E3B\u4E0D\u53EF\u8FBE\uFF09" }));
4791
+ });
4792
+ };
4793
+ load();
4794
+ const timer = setInterval(load, 6e4);
4795
+ return () => {
4796
+ alive = false;
4797
+ clearInterval(timer);
4798
+ };
4799
+ }, []);
4800
+ return state2;
4801
+ }
4802
+ function QuotaBars(props) {
4803
+ const windows = props.plan.windows ?? [];
4804
+ if (windows.length === 0) return null;
4805
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6, marginTop: 8 }, children: windows.map((window2) => {
4806
+ const percent = typeof window2.percent === "number" && Number.isFinite(window2.percent) ? Math.min(100, Math.max(0, window2.percent)) : 0;
4807
+ const id = window2.id ?? "weekly";
4808
+ const hot = percent >= 90;
4809
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
4810
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { width: 52, flex: "none", fontSize: 12, color: "var(--dsw-alias-label-tertiary)" }, children: QUOTA_WINDOW_LABEL[id] }),
4811
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: {
4812
+ flex: 1,
4813
+ height: 6,
4814
+ borderRadius: 3,
4815
+ background: "var(--dsw-alias-border-l2)",
4816
+ overflow: "hidden"
4817
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: {
4818
+ display: "block",
4819
+ width: `${String(percent)}%`,
4820
+ height: "100%",
4821
+ borderRadius: 3,
4822
+ background: hot ? "var(--dsw-alias-label-error, #d33)" : "var(--dsw-alias-brand-primary)"
4823
+ } }) }),
4824
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: {
4825
+ width: 130,
4826
+ flex: "none",
4827
+ textAlign: "right",
4828
+ fontSize: 12,
4829
+ fontVariantNumeric: "tabular-nums",
4830
+ color: hot ? "var(--dsw-alias-label-error, #d33)" : "var(--dsw-alias-label-secondary)"
4831
+ }, children: `${percent.toFixed(0)}%${resetText(window2.resetsAt)}` })
4832
+ ] }, id);
4833
+ }) });
4834
+ }
4535
4835
  function CostCardBody(props) {
4536
4836
  const { settings, setField, clearField } = props;
4537
4837
  const [table, setTable] = import_react8.default.useState(settings.priceOverrides);
@@ -4672,7 +4972,37 @@ function CostCardBody(props) {
4672
4972
  const synced = settings.syncedPrices;
4673
4973
  const alert = settings.peakAlert;
4674
4974
  const holidayInfo = effectiveHolidays(settings.peakHolidays, synced?.holidays);
4975
+ const quota = usePlanQuota();
4675
4976
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
4977
+ quota.plans.length > 0 || quota.error !== "" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: {
4978
+ marginBottom: 12,
4979
+ padding: "10px 12px",
4980
+ border: "0.5px solid var(--dsw-alias-border-l2)",
4981
+ borderRadius: 8
4982
+ }, children: [
4983
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { display: "flex", alignItems: "baseline", justifyContent: "space-between", gap: 8 }, children: [
4984
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("strong", { style: { fontSize: 12.5 }, children: "\u8BA2\u9605\u989D\u5EA6" }),
4985
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { style: { fontSize: 11.5, color: "var(--dsw-alias-label-tertiary)" }, children: quota.error !== "" ? quota.error : "\u6BCF 60 \u79D2\u5237\u65B0" })
4986
+ ] }),
4987
+ quota.plans.map((plan) => {
4988
+ const status = plan.status ?? "pending";
4989
+ const fee = typeof plan.monthlyFeeUsd === "number" && plan.monthlyFeeUsd > 0 ? ` \xB7 $${String(plan.monthlyFeeUsd)}/\u6708` : "";
4990
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { marginTop: 8 }, children: [
4991
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { fontSize: 12, color: "var(--dsw-alias-label-secondary)" }, children: [
4992
+ plan.displayName ?? plan.provider ?? "\u8BA2\u9605\u5957\u9910",
4993
+ fee,
4994
+ status === "pending" ? " \xB7 \u6B63\u5728\u53D6\u989D\u5EA6\u2026" : ""
4995
+ ] }),
4996
+ status === "ok" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(QuotaBars, { plan }) : null,
4997
+ status !== "ok" && status !== "pending" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { style: { ...hintInfo, marginTop: 6 }, children: status === "not-configured" ? `\u6CA1\u627E\u5230\u8FD9\u628A key\uFF1A\u5728\u51ED\u636E\u91CC\u914D\u4E0A ${(plan.keyRefs ?? []).join(" \u6216 ")}\uFF08\u4E0E\u6A21\u578B\u8DEF\u7531\u91CC apiKeyEnv \u7684\u5199\u6CD5\u4E00\u81F4\uFF09\u5C31\u80FD\u770B\u5230\u989D\u5EA6\u3002` : `\u989D\u5EA6\u7A97\u53E3\u53D6\u4E0D\u5230\uFF1A${plan.reason === void 0 || plan.reason === "" ? status : plan.reason}` }) : null
4998
+ ] }, plan.provider ?? plan.displayName ?? "plan");
4999
+ }),
5000
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { style: { ...hintInfo, marginTop: 8 }, children: [
5001
+ "\u8BA2\u9605\u901A\u9053\uFF08OpenCode Go \u8FD9\u7C7B\u300C\u6708\u8D39 + \u989D\u5EA6\u300D\uFF09",
5002
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("strong", { children: "\u5355\u6B21\u8C03\u7528\u4E0D\u6263\u94B1\u3001\u6263\u989D\u5EA6" }),
5003
+ "\uFF1A\u91D1\u989D\u80F6\u56CA\u4E0A\u663E\u793A\u7684 \u90A3\u4E2A $ \u5C31\u662F\u672C\u4F1A\u8BDD\u5403\u6389\u7684\u989D\u5EA6\uFF08\u542B\u5B50\u4EE3\u7406\uFF09\uFF1B\u4E0B\u9762\u300C\u5355\u4EF7\u300D\u90A3\u5F20\u8868\u662F\u53E6\u4E00\u5957\u53E3\u5F84 \u2014\u2014 \u8FD9\u4E9B token \u6309\u5B98\u65B9\u520A\u4F8B\u4EF7\u6298\u7B97\u503C\u591A\u5C11\u94B1\uFF0C\u4E24\u8005\u4E0D\u51B2\u7A81\u3001\u4E5F\u4E0D\u8981\u76F8\u52A0\u3002"
5004
+ ] })
5005
+ ] }) : null,
4676
5006
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { style: hintInfo, children: [
4677
5007
  "\u8FD9\u91CC\u6539\u7684",
4678
5008
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("strong", { children: "\u53EA\u662F\u672C\u63D2\u4EF6\u663E\u793A\u7684\u8D39\u7528\u4F30\u7B97" }),
@@ -5421,70 +5751,279 @@ function statsLineEnabled(settings) {
5421
5751
  return activeSections(settings).stats;
5422
5752
  }
5423
5753
 
5424
- // src/client/SettingsSection.tsx
5754
+ // src/client/ui-kit.tsx
5755
+ var import_react9 = require("react");
5756
+ var import_react_dom2 = require("react-dom");
5425
5757
  var import_jsx_runtime11 = require("react/jsx-runtime");
5426
- var bodyLead = { ...description, margin: "12px 0" };
5427
- function Chevron() {
5428
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5429
- "path",
5758
+ var HINT_EDGE = 12;
5759
+ var HINT_WIDTH = 280;
5760
+ var HINT_FLIP_ROOM = 120;
5761
+ var useIsoLayoutEffect = typeof window === "undefined" ? import_react9.useEffect : import_react9.useLayoutEffect;
5762
+ function Card(props) {
5763
+ const classes = ["dsh-ux-card"];
5764
+ if (props.open === true) classes.push("dsh-ux-cardOpen");
5765
+ if (props.off === true) classes.push("dsh-ux-cardOff");
5766
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: classes.join(" "), children: [
5767
+ props.head,
5768
+ props.children
5769
+ ] });
5770
+ }
5771
+ function CardTitle(props) {
5772
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardHeadText", children: [
5773
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardTitleRow", children: [
5774
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-cardName", children: props.name }),
5775
+ props.hint !== void 0 && props.hint !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Hint, { text: props.hint, insideButton: true })
5776
+ ] }),
5777
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-cardDescription", children: props.summary })
5778
+ ] });
5779
+ }
5780
+ function CardChevron(props) {
5781
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5782
+ "span",
5430
5783
  {
5431
- d: "M3.25 5.5L7 9.25L10.75 5.5",
5432
- stroke: "currentColor",
5433
- strokeWidth: "1.4",
5434
- strokeLinecap: "round",
5435
- strokeLinejoin: "round"
5784
+ className: props.open ? "dsh-ux-cardChevron dsh-ux-cardChevronOpen" : "dsh-ux-cardChevron",
5785
+ "aria-hidden": "true",
5786
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5787
+ "path",
5788
+ {
5789
+ d: "M3.25 5.5L7 9.25L10.75 5.5",
5790
+ stroke: "currentColor",
5791
+ strokeWidth: "1.4",
5792
+ strokeLinecap: "round",
5793
+ strokeLinejoin: "round"
5794
+ }
5795
+ ) })
5436
5796
  }
5437
- ) });
5797
+ );
5438
5798
  }
5439
- function FoldCard(props) {
5440
- const [open, setOpen] = (0, import_react9.useState)(false);
5441
- const off = props.toggle !== void 0 && props.toggle.checked === false;
5442
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: [
5443
- "dsh-ux-card",
5444
- open ? "dsh-ux-cardOpen" : "",
5445
- off ? "dsh-ux-cardOff" : ""
5446
- ].filter((part) => part !== "").join(" "), children: [
5447
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-cardHeaderRow", children: [
5448
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
5799
+ function Hint(props) {
5800
+ const { text, insideButton = false } = props;
5801
+ const badge = (0, import_react9.useRef)(null);
5802
+ const [hover, setHover] = (0, import_react9.useState)(false);
5803
+ const [pinned, setPinned] = (0, import_react9.useState)(false);
5804
+ const [placement, setPlacement] = (0, import_react9.useState)(null);
5805
+ const open = hover || pinned;
5806
+ const measure = (0, import_react9.useCallback)(() => {
5807
+ const rect = badge.current?.getBoundingClientRect();
5808
+ if (rect === void 0) {
5809
+ setPlacement(null);
5810
+ return;
5811
+ }
5812
+ const width = Math.min(HINT_WIDTH, Math.max(160, window.innerWidth - HINT_EDGE * 2));
5813
+ const left = Math.min(
5814
+ Math.max(rect.left - 4, HINT_EDGE),
5815
+ Math.max(HINT_EDGE, window.innerWidth - HINT_EDGE - width)
5816
+ );
5817
+ setPlacement(
5818
+ window.innerHeight - rect.bottom >= HINT_FLIP_ROOM ? { left, width, top: rect.bottom + 6 } : { left, width, bottom: window.innerHeight - rect.top + 6 }
5819
+ );
5820
+ }, []);
5821
+ useIsoLayoutEffect(() => {
5822
+ if (!open) {
5823
+ setPlacement(null);
5824
+ return;
5825
+ }
5826
+ measure();
5827
+ }, [open, measure]);
5828
+ (0, import_react9.useEffect)(() => {
5829
+ if (!open) return;
5830
+ const relayout = () => {
5831
+ measure();
5832
+ };
5833
+ window.addEventListener("scroll", relayout, true);
5834
+ window.addEventListener("resize", relayout);
5835
+ return () => {
5836
+ window.removeEventListener("scroll", relayout, true);
5837
+ window.removeEventListener("resize", relayout);
5838
+ };
5839
+ }, [open, measure]);
5840
+ (0, import_react9.useEffect)(() => {
5841
+ if (!pinned) return;
5842
+ const onPointerDown = (event) => {
5843
+ const target = event.target;
5844
+ if (target !== null && badge.current?.contains(target) === true) return;
5845
+ if (target !== null && target.closest?.("[data-dsh-ux-hint]") !== null) return;
5846
+ setPinned(false);
5847
+ };
5848
+ const onKeyDown = (event) => {
5849
+ if (event.key === "Escape") setPinned(false);
5850
+ };
5851
+ document.addEventListener("mousedown", onPointerDown, true);
5852
+ document.addEventListener("keydown", onKeyDown, true);
5853
+ return () => {
5854
+ document.removeEventListener("mousedown", onPointerDown, true);
5855
+ document.removeEventListener("keydown", onKeyDown, true);
5856
+ };
5857
+ }, [pinned]);
5858
+ const toggle = (event) => {
5859
+ event.preventDefault();
5860
+ event.stopPropagation();
5861
+ setPinned((current) => !current);
5862
+ };
5863
+ const shared = {
5864
+ className: open ? "dsh-ux-hint dsh-ux-hintOpen" : "dsh-ux-hint",
5865
+ title: text,
5866
+ onClick: toggle,
5867
+ onMouseEnter: () => {
5868
+ setHover(true);
5869
+ },
5870
+ onMouseLeave: () => {
5871
+ setHover(false);
5872
+ }
5873
+ };
5874
+ const bubble = open && placement !== null ? (0, import_react_dom2.createPortal)(
5875
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5876
+ "div",
5877
+ {
5878
+ "data-dsh-ux-hint": "",
5879
+ role: "tooltip",
5880
+ className: "dsh-ux-hintBubble",
5881
+ style: {
5882
+ left: placement.left,
5883
+ width: placement.width,
5884
+ top: placement.top,
5885
+ bottom: placement.bottom
5886
+ },
5887
+ children: text
5888
+ }
5889
+ ),
5890
+ document.body
5891
+ ) : null;
5892
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5893
+ insideButton ? (
5894
+ // 外层已经是 <button>:这里只能是 span,否则按钮套按钮(无效 HTML,点击也会打架)。
5895
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5896
+ "span",
5897
+ {
5898
+ ref: (node) => {
5899
+ badge.current = node;
5900
+ },
5901
+ ...shared,
5902
+ "aria-hidden": "true",
5903
+ children: "?"
5904
+ }
5905
+ )
5906
+ ) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5907
+ "button",
5908
+ {
5909
+ ref: (node) => {
5910
+ badge.current = node;
5911
+ },
5912
+ type: "button",
5913
+ ...shared,
5914
+ "aria-label": `\u8BF4\u660E\uFF1A${text}`,
5915
+ "aria-expanded": open,
5916
+ children: "?"
5917
+ }
5918
+ ),
5919
+ bubble
5920
+ ] });
5921
+ }
5922
+ function Segmented(props) {
5923
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5924
+ "div",
5925
+ {
5926
+ role: "group",
5927
+ "aria-label": props.ariaLabel,
5928
+ className: props.compact === true ? "dsh-ux-segmented dsh-ux-segmentedCompact" : "dsh-ux-segmented",
5929
+ children: props.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5449
5930
  "button",
5450
5931
  {
5451
5932
  type: "button",
5452
- className: "dsh-ux-cardHeader",
5453
- "aria-expanded": open,
5933
+ title: item.hint,
5934
+ "aria-pressed": props.value === item.id,
5935
+ className: props.value === item.id ? "dsh-ux-segment dsh-ux-segmentOn" : "dsh-ux-segment",
5936
+ onMouseDown: (event) => {
5937
+ event.preventDefault();
5938
+ },
5454
5939
  onClick: () => {
5455
- setOpen((current) => !current);
5940
+ props.onChange(item.id);
5456
5941
  },
5457
- children: [
5458
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardHeadText", children: [
5459
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-cardName", children: props.name }),
5460
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-cardDescription", children: off ? `\u672A\u542F\u7528 \xB7 ${props.summary}` : props.summary })
5461
- ] }),
5462
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: open ? "dsh-ux-cardChevron dsh-ux-cardChevronOpen" : "dsh-ux-cardChevron", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Chevron, {}) })
5463
- ]
5464
- }
5465
- ),
5466
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardControls", children: [
5467
- props.controls,
5468
- props.toggle !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5469
- Switch,
5470
- {
5471
- small: true,
5472
- label: `${props.name}\uFF1A\u542F\u7528\u8FD9\u4E00\u680F`,
5473
- checked: props.toggle.checked,
5474
- disabled: props.toggle.disabled === true,
5475
- onChange: props.toggle.onChange
5476
- }
5477
- )
5478
- ] })
5942
+ children: item.label
5943
+ },
5944
+ item.id
5945
+ ))
5946
+ }
5947
+ );
5948
+ }
5949
+ function Row(props) {
5950
+ const classes = ["dsh-ux-row"];
5951
+ if (props.first === true) classes.push("dsh-ux-rowFirst");
5952
+ if (props.stacked === true) classes.push("dsh-ux-rowStacked");
5953
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: classes.join(" "), children: [
5954
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-rowText", children: [
5955
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-rowTitle", children: [
5956
+ props.title,
5957
+ props.hint !== void 0 && props.hint !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Hint, { text: props.hint })
5958
+ ] }),
5959
+ props.desc !== void 0 && props.desc !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-ux-rowDesc", children: props.desc })
5479
5960
  ] }),
5480
- open && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-ux-cardBody", children: props.children })
5961
+ props.children !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsh-ux-rowControl", children: props.children })
5962
+ ] });
5963
+ }
5964
+ function GroupLabel(props) {
5965
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-groupLabel", children: [
5966
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: props.children }),
5967
+ props.hint !== void 0 && props.hint !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Hint, { text: props.hint })
5481
5968
  ] });
5482
5969
  }
5970
+
5971
+ // src/client/SettingsSection.tsx
5972
+ var import_jsx_runtime12 = require("react/jsx-runtime");
5973
+ function FoldCard(props) {
5974
+ const [open, setOpen] = (0, import_react10.useState)(false);
5975
+ const off = props.toggle !== void 0 && props.toggle.checked === false;
5976
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5977
+ Card,
5978
+ {
5979
+ open,
5980
+ off,
5981
+ head: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-ux-cardHeaderRow", children: [
5982
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
5983
+ "button",
5984
+ {
5985
+ type: "button",
5986
+ className: "dsh-ux-cardHeader",
5987
+ "aria-expanded": open,
5988
+ onClick: () => {
5989
+ setOpen((current) => !current);
5990
+ },
5991
+ children: [
5992
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5993
+ CardTitle,
5994
+ {
5995
+ name: props.name,
5996
+ hint: props.hint,
5997
+ summary: off ? `\u672A\u542F\u7528 \xB7 ${props.summary}` : props.summary
5998
+ }
5999
+ ),
6000
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CardChevron, { open })
6001
+ ]
6002
+ }
6003
+ ),
6004
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-ux-cardControls", children: [
6005
+ props.controls,
6006
+ props.toggle !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6007
+ Switch,
6008
+ {
6009
+ small: true,
6010
+ label: `${props.name}\uFF1A\u542F\u7528\u8FD9\u4E00\u680F`,
6011
+ checked: props.toggle.checked,
6012
+ disabled: props.toggle.disabled === true,
6013
+ onChange: props.toggle.onChange
6014
+ }
6015
+ )
6016
+ ] })
6017
+ ] }),
6018
+ children: open && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsh-ux-cardBody", children: props.children })
6019
+ }
6020
+ );
6021
+ }
5483
6022
  function KeyRow(props) {
5484
6023
  const { title, desc, value, presets, conflict, onChange, first } = props;
5485
- const [recording, setRecording] = (0, import_react9.useState)(false);
5486
- const [error, setError] = (0, import_react9.useState)(null);
5487
- (0, import_react9.useEffect)(() => {
6024
+ const [recording, setRecording] = (0, import_react10.useState)(false);
6025
+ const [error, setError] = (0, import_react10.useState)(null);
6026
+ (0, import_react10.useEffect)(() => {
5488
6027
  if (!recording) return;
5489
6028
  const onKeyDown = (event) => {
5490
6029
  event.preventDefault();
@@ -5521,49 +6060,42 @@ function KeyRow(props) {
5521
6060
  window.removeEventListener("keydown", onKeyDown, true);
5522
6061
  };
5523
6062
  }, [recording, conflict, onChange]);
5524
- const base2 = first === true ? { ...row, borderTop: "none" } : row;
5525
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...base2, flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
5526
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
5527
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: title }),
5528
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: desc })
5529
- ] }),
5530
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
5531
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: kbd, children: displayChord(value) }),
5532
- !recording && presets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5533
- "button",
5534
- {
5535
- type: "button",
5536
- style: value === preset ? pillActive : pill,
5537
- onClick: () => {
5538
- setError(null);
5539
- onChange(preset);
5540
- },
5541
- children: displayChord(preset)
6063
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Row, { title, desc, first, stacked: true, children: [
6064
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: kbd, children: displayChord(value) }),
6065
+ !recording && presets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6066
+ "button",
6067
+ {
6068
+ type: "button",
6069
+ style: value === preset ? pillActive : pill,
6070
+ onClick: () => {
6071
+ setError(null);
6072
+ onChange(preset);
5542
6073
  },
5543
- preset
5544
- )),
5545
- !recording && value !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: () => {
5546
- setError(null);
5547
- onChange("");
5548
- }, children: "\u6E05\u9664" }),
5549
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5550
- "button",
5551
- {
5552
- type: "button",
5553
- style: recording ? pillActive : pill,
5554
- onClick: () => {
5555
- setRecording(true);
5556
- setError(null);
5557
- },
5558
- children: recording ? "\u8BF7\u6309\u4E0B\u65B0\u7EC4\u5408\u952E\u2026" : "\u81EA\u5B9A\u4E49\u2026"
5559
- }
5560
- ),
5561
- recording && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: () => {
5562
- setRecording(false);
5563
- setError(null);
5564
- }, children: "Esc \u53D6\u6D88" }),
5565
- error !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { color: "var(--dsw-alias-state-error-primary)", fontSize: 12 }, children: error })
5566
- ] })
6074
+ children: displayChord(preset)
6075
+ },
6076
+ preset
6077
+ )),
6078
+ !recording && value !== "" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, onClick: () => {
6079
+ setError(null);
6080
+ onChange("");
6081
+ }, children: "\u6E05\u9664" }),
6082
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6083
+ "button",
6084
+ {
6085
+ type: "button",
6086
+ style: recording ? pillActive : pill,
6087
+ onClick: () => {
6088
+ setRecording(true);
6089
+ setError(null);
6090
+ },
6091
+ children: recording ? "\u8BF7\u6309\u4E0B\u65B0\u7EC4\u5408\u952E\u2026" : "\u81EA\u5B9A\u4E49\u2026"
6092
+ }
6093
+ ),
6094
+ recording && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, onClick: () => {
6095
+ setRecording(false);
6096
+ setError(null);
6097
+ }, children: "Esc \u53D6\u6D88" }),
6098
+ error !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { color: "var(--dsw-alias-state-error-primary)", fontSize: 12 }, children: error })
5567
6099
  ] });
5568
6100
  }
5569
6101
  function Switch(props) {
@@ -5571,7 +6103,7 @@ function Switch(props) {
5571
6103
  const width = small ? 30 : 36;
5572
6104
  const height = small ? 16 : 20;
5573
6105
  const knob = small ? 12 : 14;
5574
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6106
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5575
6107
  "button",
5576
6108
  {
5577
6109
  type: "button",
@@ -5593,7 +6125,7 @@ function Switch(props) {
5593
6125
  flex: "0 0 auto",
5594
6126
  padding: 0
5595
6127
  },
5596
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6128
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5597
6129
  "span",
5598
6130
  {
5599
6131
  style: {
@@ -5612,80 +6144,69 @@ function Switch(props) {
5612
6144
  );
5613
6145
  }
5614
6146
  function MiniToggle(props) {
5615
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-miniToggle", children: [
5616
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-miniToggleLabel", children: props.label }),
5617
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Switch, { small: true, label: props.label, checked: props.checked, onChange: props.onChange })
6147
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-ux-miniToggle", children: [
6148
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "dsh-ux-miniToggleLabel", children: props.label }),
6149
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Switch, { small: true, label: props.label, checked: props.checked, onChange: props.onChange })
5618
6150
  ] });
5619
6151
  }
5620
6152
  function ToggleRow(props) {
5621
6153
  const { label, desc, checked, onChange, action, first } = props;
5622
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: first === true ? { ...row, borderTop: "none" } : row, children: [
5623
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
5624
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: label }),
5625
- desc !== void 0 && desc !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: desc })
5626
- ] }),
5627
- action !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: action.onClick, children: action.label }),
5628
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Switch, { label, checked, onChange })
6154
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Row, { title: label, desc, first, children: [
6155
+ action !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, onClick: action.onClick, children: action.label }),
6156
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Switch, { label, checked, onChange })
5629
6157
  ] });
5630
6158
  }
5631
6159
  function TextFieldRow(props) {
5632
6160
  const { title, desc, value, placeholder, maxLength, onChange, action, first } = props;
5633
- const [draft, setDraft] = (0, import_react9.useState)(value);
5634
- const focused = (0, import_react9.useRef)(false);
5635
- (0, import_react9.useEffect)(() => {
6161
+ const [draft, setDraft] = (0, import_react10.useState)(value);
6162
+ const focused = (0, import_react10.useRef)(false);
6163
+ (0, import_react10.useEffect)(() => {
5636
6164
  if (!focused.current) setDraft(value);
5637
6165
  }, [value]);
5638
6166
  const commit = () => {
5639
6167
  if (draft === value) return;
5640
6168
  onChange(draft.trim());
5641
6169
  };
5642
- const base2 = first === true ? { ...row, borderTop: "none" } : row;
5643
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...base2, flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
5644
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
5645
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: title }),
5646
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: desc })
5647
- ] }),
5648
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
5649
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5650
- "input",
5651
- {
5652
- type: "text",
5653
- value: draft,
5654
- placeholder: placeholder ?? "",
5655
- maxLength,
5656
- spellCheck: false,
5657
- autoCorrect: "off",
5658
- autoCapitalize: "off",
5659
- onFocus: () => {
5660
- focused.current = true;
5661
- },
5662
- onChange: (event) => {
5663
- setDraft(event.target.value);
5664
- },
5665
- onBlur: () => {
5666
- focused.current = false;
5667
- commit();
5668
- },
5669
- onKeyDown: (event) => {
5670
- if (event.key !== "Enter") return;
5671
- event.preventDefault();
5672
- commit();
5673
- event.currentTarget.blur();
5674
- },
5675
- style: textInput
5676
- }
5677
- ),
5678
- action !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: action.onClick, children: action.label })
5679
- ] })
5680
- ] });
6170
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Row, { title, desc, first, stacked: true, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, width: "100%" }, children: [
6171
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6172
+ "input",
6173
+ {
6174
+ type: "text",
6175
+ value: draft,
6176
+ placeholder: placeholder ?? "",
6177
+ maxLength,
6178
+ spellCheck: false,
6179
+ autoCorrect: "off",
6180
+ autoCapitalize: "off",
6181
+ onFocus: () => {
6182
+ focused.current = true;
6183
+ },
6184
+ onChange: (event) => {
6185
+ setDraft(event.target.value);
6186
+ },
6187
+ onBlur: () => {
6188
+ focused.current = false;
6189
+ commit();
6190
+ },
6191
+ onKeyDown: (event) => {
6192
+ if (event.key !== "Enter") return;
6193
+ event.preventDefault();
6194
+ commit();
6195
+ event.currentTarget.blur();
6196
+ },
6197
+ style: textInput
6198
+ }
6199
+ ),
6200
+ action !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, onClick: action.onClick, children: action.label })
6201
+ ] }) });
5681
6202
  }
5682
6203
  function QuickPromptsEditor(props) {
5683
- const [draft, setDraft] = (0, import_react9.useState)(() => props.book);
5684
- const [activeId, setActiveId] = (0, import_react9.useState)(() => props.book.categories[0]?.id ?? "");
5685
- const [dirty, setDirty] = (0, import_react9.useState)(false);
5686
- const [newName, setNewName] = (0, import_react9.useState)("");
5687
- const [note2, setNote] = (0, import_react9.useState)("");
5688
- (0, import_react9.useEffect)(() => {
6204
+ const [draft, setDraft] = (0, import_react10.useState)(() => props.book);
6205
+ const [activeId, setActiveId] = (0, import_react10.useState)(() => props.book.categories[0]?.id ?? "");
6206
+ const [dirty, setDirty] = (0, import_react10.useState)(false);
6207
+ const [newName, setNewName] = (0, import_react10.useState)("");
6208
+ const [note2, setNote] = (0, import_react10.useState)("");
6209
+ (0, import_react10.useEffect)(() => {
5689
6210
  if (dirty) return;
5690
6211
  setDraft(props.book);
5691
6212
  if (!props.book.categories.some((category) => category.id === activeId)) {
@@ -5709,9 +6230,9 @@ function QuickPromptsEditor(props) {
5709
6230
  border: "0.5px solid var(--dsw-alias-border-l2)",
5710
6231
  background: "var(--dsw-alias-bg-layer-1)"
5711
6232
  };
5712
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
5713
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4, flexWrap: "wrap" }, children: [
5714
- draft.categories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
6233
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
6234
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4, flexWrap: "wrap" }, children: [
6235
+ draft.categories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
5715
6236
  "button",
5716
6237
  {
5717
6238
  type: "button",
@@ -5728,7 +6249,7 @@ function QuickPromptsEditor(props) {
5728
6249
  },
5729
6250
  category.id
5730
6251
  )),
5731
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6252
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5732
6253
  "input",
5733
6254
  {
5734
6255
  type: "text",
@@ -5742,7 +6263,7 @@ function QuickPromptsEditor(props) {
5742
6263
  style: { ...textInput, flex: "0 0 110px" }
5743
6264
  }
5744
6265
  ),
5745
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6266
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5746
6267
  "button",
5747
6268
  {
5748
6269
  type: "button",
@@ -5756,10 +6277,10 @@ function QuickPromptsEditor(props) {
5756
6277
  }
5757
6278
  )
5758
6279
  ] }),
5759
- current === void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: rowDesc, children: "\u8FD8\u6CA1\u6709\u5206\u7C7B\u3002\u5148\u52A0\u4E00\u4E2A\u5206\u7C7B\uFF0C\u518D\u5F80\u91CC\u653E\u6761\u76EE\u3002" }),
5760
- current !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5761
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
5762
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6280
+ current === void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: rowDesc, children: "\u8FD8\u6CA1\u6709\u5206\u7C7B\u3002\u5148\u52A0\u4E00\u4E2A\u5206\u7C7B\uFF0C\u518D\u5F80\u91CC\u653E\u6761\u76EE\u3002" }),
6281
+ current !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
6282
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
6283
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5763
6284
  "input",
5764
6285
  {
5765
6286
  type: "text",
@@ -5773,13 +6294,13 @@ function QuickPromptsEditor(props) {
5773
6294
  style: { ...textInput, flex: "0 0 150px" }
5774
6295
  }
5775
6296
  ),
5776
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, title: "\u5206\u7C7B\u4E0A\u79FB", onClick: () => {
6297
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, title: "\u5206\u7C7B\u4E0A\u79FB", onClick: () => {
5777
6298
  edit(withCategoryMoved(draft, current.id, -1));
5778
6299
  }, children: "\u2191" }),
5779
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, title: "\u5206\u7C7B\u4E0B\u79FB", onClick: () => {
6300
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, title: "\u5206\u7C7B\u4E0B\u79FB", onClick: () => {
5780
6301
  edit(withCategoryMoved(draft, current.id, 1));
5781
6302
  }, children: "\u2193" }),
5782
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6303
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5783
6304
  "button",
5784
6305
  {
5785
6306
  type: "button",
@@ -5791,16 +6312,16 @@ function QuickPromptsEditor(props) {
5791
6312
  children: "\u2715 \u5220\u9664\u5206\u7C7B"
5792
6313
  }
5793
6314
  ),
5794
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: rowDesc, children: [
6315
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: rowDesc, children: [
5795
6316
  current.prompts.length,
5796
6317
  " / ",
5797
6318
  QUICK_PROMPT_MAX,
5798
6319
  " \u6761"
5799
6320
  ] })
5800
6321
  ] }),
5801
- current.prompts.map((prompt) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowBox, children: [
5802
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
5803
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6322
+ current.prompts.map((prompt) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: rowBox, children: [
6323
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
6324
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5804
6325
  "input",
5805
6326
  {
5806
6327
  type: "text",
@@ -5814,7 +6335,7 @@ function QuickPromptsEditor(props) {
5814
6335
  style: { ...textInput, flex: "0 0 150px" }
5815
6336
  }
5816
6337
  ),
5817
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6338
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5818
6339
  InsertModeControl,
5819
6340
  {
5820
6341
  label: prompt.label,
@@ -5824,18 +6345,18 @@ function QuickPromptsEditor(props) {
5824
6345
  }
5825
6346
  }
5826
6347
  ),
5827
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { flex: 1 } }),
5828
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, title: "\u4E0A\u79FB", onClick: () => {
6348
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { flex: 1 } }),
6349
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, title: "\u4E0A\u79FB", onClick: () => {
5829
6350
  edit(withPromptMoved(draft, current.id, prompt.id, -1));
5830
6351
  }, children: "\u2191" }),
5831
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, title: "\u4E0B\u79FB", onClick: () => {
6352
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, title: "\u4E0B\u79FB", onClick: () => {
5832
6353
  edit(withPromptMoved(draft, current.id, prompt.id, 1));
5833
6354
  }, children: "\u2193" }),
5834
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, title: "\u5220\u9664\u8FD9\u6761", onClick: () => {
6355
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, title: "\u5220\u9664\u8FD9\u6761", onClick: () => {
5835
6356
  edit(withPromptRemoved(draft, current.id, prompt.id));
5836
6357
  }, children: "\u2715" })
5837
6358
  ] }),
5838
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6359
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5839
6360
  "textarea",
5840
6361
  {
5841
6362
  value: prompt.prompt,
@@ -5850,7 +6371,7 @@ function QuickPromptsEditor(props) {
5850
6371
  }
5851
6372
  )
5852
6373
  ] }, prompt.id)),
5853
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6374
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5854
6375
  AddPromptRow,
5855
6376
  {
5856
6377
  book: draft,
@@ -5864,8 +6385,8 @@ function QuickPromptsEditor(props) {
5864
6385
  }
5865
6386
  )
5866
6387
  ] }),
5867
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
5868
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6388
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
6389
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5869
6390
  "button",
5870
6391
  {
5871
6392
  type: "button",
@@ -5887,13 +6408,13 @@ function QuickPromptsEditor(props) {
5887
6408
  children: saving ? "\u4FDD\u5B58\u4E2D\u2026" : dirty ? "\u4FDD\u5B58\u4FEE\u6539" : "\u5DF2\u4FDD\u5B58"
5888
6409
  }
5889
6410
  ),
5890
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: () => {
6411
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, onClick: () => {
5891
6412
  props.onReload();
5892
6413
  }, children: "\u91CD\u65B0\u8BFB\u53D6" }),
5893
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: () => {
6414
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", style: pill, onClick: () => {
5894
6415
  props.onReset();
5895
6416
  }, children: "\u6062\u590D\u5185\u7F6E 9 \u6761" }),
5896
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: rowDesc, children: [
6417
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: rowDesc, children: [
5897
6418
  "\u5171 ",
5898
6419
  counts.categories,
5899
6420
  " \u4E2A\u5206\u7C7B \xB7 ",
@@ -5907,9 +6428,9 @@ function QuickPromptsEditor(props) {
5907
6428
  failed ? ` \xB7 ${props.status}` : ""
5908
6429
  ] })
5909
6430
  ] }),
5910
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: rowDesc, children: [
6431
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: rowDesc, children: [
5911
6432
  "\u6570\u636E\u5B58\u5728 ",
5912
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("code", { children: "~/.dsh/quick-prompts.json" }),
6433
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("code", { children: "~/.dsh/quick-prompts.json" }),
5913
6434
  "\uFF08\u4E0E\u4F1A\u8BDD\u3001\u9879\u76EE\u65E0\u5173\uFF0C\u53EF\u5355\u72EC\u5907\u4EFD\u6216\u624B\u5DE5\u7F16\u8F91\uFF0C \u6539\u5B8C\u70B9\u300C\u91CD\u65B0\u8BFB\u53D6\u300D\u5373\u53EF\u52A0\u8F7D\uFF09\u3002"
5914
6435
  ] })
5915
6436
  ] });
@@ -5923,11 +6444,11 @@ var candidatePill = {
5923
6444
  };
5924
6445
  function DefaultTerminalBody(props) {
5925
6446
  const { settings, setField, hideMode = false } = props;
5926
- const [note2, setNote] = (0, import_react9.useState)("");
5927
- const [busy, setBusy] = (0, import_react9.useState)(false);
6447
+ const [note2, setNote] = (0, import_react10.useState)("");
6448
+ const [busy, setBusy] = (0, import_react10.useState)(false);
5928
6449
  const candidates = settings.terminalCandidates;
5929
6450
  if (settings.terminalEffective === "unsupported") {
5930
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: "\u672C\u63D2\u4EF6\u53EA\u5728 Windows \u4E0A\u63A5\u7BA1\u7EC8\u7AEF\uFF08Windows \u4E0A DSH \u9ED8\u8BA4\u7ED9\u6A21\u578B\u7684\u662F PowerShell\uFF09\u3002\u5F53\u524D\u5E73\u53F0\u4E0D\u9700\u8981\u5B83\uFF0C \u8FD9\u91CC\u7684\u8BBE\u7F6E\u4E0D\u4F1A\u751F\u6548\u3002" });
6451
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: "\u672C\u63D2\u4EF6\u53EA\u5728 Windows \u4E0A\u63A5\u7BA1\u7EC8\u7AEF\uFF08Windows \u4E0A DSH \u9ED8\u8BA4\u7ED9\u6A21\u578B\u7684\u662F PowerShell\uFF09\u3002\u5F53\u524D\u5E73\u53F0\u4E0D\u9700\u8981\u5B83\uFF0C \u8FD9\u91CC\u7684\u8BBE\u7F6E\u4E0D\u4F1A\u751F\u6548\u3002" });
5931
6452
  }
5932
6453
  const discover = async () => {
5933
6454
  setBusy(true);
@@ -5943,26 +6464,29 @@ function DefaultTerminalBody(props) {
5943
6464
  setBusy(false);
5944
6465
  }
5945
6466
  };
5946
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5947
- !hideMode && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...row, borderTop: "none", flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
5948
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
5949
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u7EC8\u7AEF\u5DE5\u5177" }),
5950
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: TERMINAL_MODES.find((item) => item.id === settings.terminalMode)?.hint ?? "" })
5951
- ] }),
5952
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5953
- PillChoice,
5954
- {
5955
- items: TERMINAL_MODES,
5956
- value: settings.terminalMode,
5957
- onChange: (mode) => {
5958
- setField(TERMINAL_MODE_FIELD, mode);
5959
- },
5960
- ariaLabel: "\u7EC8\u7AEF\u5DE5\u5177"
5961
- }
5962
- )
5963
- ] }),
5964
- settings.terminalMode !== "pwsh" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5965
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6467
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
6468
+ !hideMode && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6469
+ Row,
6470
+ {
6471
+ title: "\u7EC8\u7AEF\u5DE5\u5177",
6472
+ desc: TERMINAL_MODES.find((item) => item.id === settings.terminalMode)?.hint ?? "",
6473
+ first: true,
6474
+ stacked: true,
6475
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6476
+ Segmented,
6477
+ {
6478
+ items: TERMINAL_MODES,
6479
+ value: settings.terminalMode,
6480
+ onChange: (mode) => {
6481
+ setField(TERMINAL_MODE_FIELD, mode);
6482
+ },
6483
+ ariaLabel: "\u7EC8\u7AEF\u5DE5\u5177"
6484
+ }
6485
+ )
6486
+ }
6487
+ ),
6488
+ settings.terminalMode !== "pwsh" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
6489
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5966
6490
  TextFieldRow,
5967
6491
  {
5968
6492
  title: "Git Bash \u8DEF\u5F84",
@@ -5978,7 +6502,7 @@ function DefaultTerminalBody(props) {
5978
6502
  } }
5979
6503
  }
5980
6504
  ),
5981
- candidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6, marginTop: 2 }, children: candidates.map((candidate) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
6505
+ candidates.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: 6, marginTop: 2 }, children: candidates.map((candidate) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
5982
6506
  "button",
5983
6507
  {
5984
6508
  type: "button",
@@ -5996,15 +6520,15 @@ function DefaultTerminalBody(props) {
5996
6520
  },
5997
6521
  candidate.path
5998
6522
  )) }),
5999
- note2 !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: note2 })
6523
+ note2 !== "" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: note2 })
6000
6524
  ] }),
6001
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
6525
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: hintInfo, children: [
6002
6526
  "\u72B6\u6001\uFF1A",
6003
6527
  settings.terminalStatus === "" ? "\u7B49\u5F85\u5BBF\u4E3B\u534A\u63A2\u6D4B\u2026" : settings.terminalStatus
6004
6528
  ] }),
6005
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: "\xB7 \u6362\u6210 Git Bash \u540E\uFF0C\u6A21\u578B\u770B\u5230\u7684\u7EC8\u7AEF\u5DE5\u5177\u5C31\u53EB bash\uFF08\u547D\u4EE4\u6309 bash/POSIX \u5199\uFF09\uFF0CPowerShell \u90A3\u4E2A\u5DE5\u5177 \u4F1A\u4ECE\u5B83\u7684\u5DE5\u5177\u5217\u8868\u91CC\u6D88\u5931 \u2014\u2014 \u4E00\u4E2A\u4F1A\u8BDD\u53EA\u9762\u5BF9\u4E00\u4E2A\u7EC8\u7AEF\u5DE5\u5177\u3002" }),
6006
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: "\xB7 \u6539\u6863\u4F4D\u4F1A\u7ACB\u523B\u91CD\u65B0\u4E0B\u53D1\u7ED9\u6B63\u5728\u8DD1\u7684\u4F1A\u8BDD\u3002\u4F46\u4F1A\u8BDD\u5386\u53F2\u91CC\u53EF\u80FD\u8FD8\u7559\u7740\u65E7\u5DE5\u5177\u540D\uFF1A\u5982\u679C\u54EA\u513F\u62A5\u4E86 unknown tool \u4E4B\u7C7B\u7684\u9519\uFF0C\u8BA9\u6A21\u578B\u6539\u7528 bash \u91CD\u8BD5\u5373\u53EF\uFF0C\u4E0D\u5F71\u54CD\u4F1A\u8BDD\u672C\u8EAB\u3002" }),
6007
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: "\xB7 \u53EA\u5BF9 Windows \u751F\u6548\uFF1BWSL \u7684 bash.exe \u4F1A\u88AB\u4E3B\u52A8\u6392\u9664\uFF08\u5B83\u628A D:\\ \u8FD9\u7C7B\u8DEF\u5F84\u89E3\u91CA\u6210 /mnt/d\uFF0C\u4E0E\u6A21\u578B\u624B\u91CC\u7684 Windows \u5DE5\u4F5C\u76EE\u5F55\u4E0D\u517C\u5BB9\uFF09\u3002\u6C99\u7BB1\u3001\u5BA1\u6279\u3001\u8D85\u65F6\u4E0E\u8F93\u51FA\u622A\u65AD\u7684\u884C\u4E3A\u4E0E DSH \u81EA\u5E26\u7EC8\u7AEF\u4E00\u81F4\u3002" })
6529
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: "\xB7 \u6362\u6210 Git Bash \u540E\uFF0C\u6A21\u578B\u770B\u5230\u7684\u7EC8\u7AEF\u5DE5\u5177\u5C31\u53EB bash\uFF08\u547D\u4EE4\u6309 bash/POSIX \u5199\uFF09\uFF0CPowerShell \u90A3\u4E2A\u5DE5\u5177 \u4F1A\u4ECE\u5B83\u7684\u5DE5\u5177\u5217\u8868\u91CC\u6D88\u5931 \u2014\u2014 \u4E00\u4E2A\u4F1A\u8BDD\u53EA\u9762\u5BF9\u4E00\u4E2A\u7EC8\u7AEF\u5DE5\u5177\u3002" }),
6530
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: "\xB7 \u6539\u6863\u4F4D\u4F1A\u7ACB\u523B\u91CD\u65B0\u4E0B\u53D1\u7ED9\u6B63\u5728\u8DD1\u7684\u4F1A\u8BDD\u3002\u4F46\u4F1A\u8BDD\u5386\u53F2\u91CC\u53EF\u80FD\u8FD8\u7559\u7740\u65E7\u5DE5\u5177\u540D\uFF1A\u5982\u679C\u54EA\u513F\u62A5\u4E86 unknown tool \u4E4B\u7C7B\u7684\u9519\uFF0C\u8BA9\u6A21\u578B\u6539\u7528 bash \u91CD\u8BD5\u5373\u53EF\uFF0C\u4E0D\u5F71\u54CD\u4F1A\u8BDD\u672C\u8EAB\u3002" }),
6531
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: "\xB7 \u53EA\u5BF9 Windows \u751F\u6548\uFF1BWSL \u7684 bash.exe \u4F1A\u88AB\u4E3B\u52A8\u6392\u9664\uFF08\u5B83\u628A D:\\ \u8FD9\u7C7B\u8DEF\u5F84\u89E3\u91CA\u6210 /mnt/d\uFF0C\u4E0E\u6A21\u578B\u624B\u91CC\u7684 Windows \u5DE5\u4F5C\u76EE\u5F55\u4E0D\u517C\u5BB9\uFF09\u3002\u6C99\u7BB1\u3001\u5BA1\u6279\u3001\u8D85\u65F6\u4E0E\u8F93\u51FA\u622A\u65AD\u7684\u884C\u4E3A\u4E0E DSH \u81EA\u5E26\u7EC8\u7AEF\u4E00\u81F4\u3002" })
6008
6532
  ] });
6009
6533
  }
6010
6534
  var RESTART_WAIT_MS = 6e4;
@@ -6019,9 +6543,9 @@ function blockedText(blocked) {
6019
6543
  return `\u8FD9\u4E2A\u5BBF\u4E3B\u5F53\u524D\u4E0D\u5141\u8BB8\u4ECE\u754C\u9762\u91CD\u542F\uFF08${blocked}\uFF09\u3002`;
6020
6544
  }
6021
6545
  function useRestart() {
6022
- const [stage, setStage] = (0, import_react9.useState)("idle");
6023
- const [detail2, setDetail] = (0, import_react9.useState)("");
6024
- const [blocked, setBlocked] = (0, import_react9.useState)(null);
6546
+ const [stage, setStage] = (0, import_react10.useState)("idle");
6547
+ const [detail2, setDetail] = (0, import_react10.useState)("");
6548
+ const [blocked, setBlocked] = (0, import_react10.useState)(null);
6025
6549
  const readFacts = async () => {
6026
6550
  const response = await fetch(RESTART_API_PATH, {
6027
6551
  cache: "no-store",
@@ -6130,8 +6654,8 @@ function NotifyCard({ settings, setField }) {
6130
6654
  const on = settings.notifyEnabled;
6131
6655
  const channel = settings.notifyChannel;
6132
6656
  const kinds = settings.notifyKinds;
6133
- const [busy, setBusy] = (0, import_react9.useState)(false);
6134
- const [note2, setNote] = (0, import_react9.useState)("");
6657
+ const [busy, setBusy] = (0, import_react10.useState)(false);
6658
+ const [note2, setNote] = (0, import_react10.useState)("");
6135
6659
  const send = () => {
6136
6660
  setBusy(true);
6137
6661
  setNote("");
@@ -6147,22 +6671,24 @@ function NotifyCard({ settings, setField }) {
6147
6671
  setBusy(false);
6148
6672
  });
6149
6673
  };
6150
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
6674
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6151
6675
  FoldCard,
6152
6676
  {
6153
6677
  name: "\u5FAE\u4FE1\u901A\u77E5",
6678
+ hint: "\u4E00\u6B21\u4E8B\u4EF6\u53EA\u53D1\u4E00\u6761\uFF1A\u4E0D\u8F6E\u8BE2\u3001\u4E0D\u91CD\u8BD5\u3001\u4E0D\u56DE\u6267\u3002\u53D1\u9001\u5931\u8D25\u53EA\u5728\u8FD9\u4E00\u9875\u7684\u72B6\u6001\u884C\u91CC\u8BF4\uFF0C\u4E0D\u4F1A\u8865\u53D1\u3002",
6154
6679
  summary: on ? `\u5DF2\u5F00 \xB7 ${channel === "pushplus" ? "PushPlus" : "\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"} \xB7 \u53EA\u80FD\u901A\u77E5\uFF0C\u4E0D\u80FD\u56DE` : "\u53EA\u80FD\u901A\u77E5\uFF0C\u4E0D\u80FD\u56DE",
6155
6680
  toggle: { checked: on, onChange: (next) => {
6156
6681
  setField(NOTIFY_ENABLED_FIELD, next);
6157
6682
  } },
6158
6683
  children: [
6159
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { margin: "10px 0", fontSize: 12, lineHeight: 1.6, opacity: 0.85 }, children: [
6160
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u53EA\u80FD\u901A\u77E5\uFF0C\u4E0D\u80FD\u56DE\u3002" }),
6684
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsh-ux-lead", children: [
6685
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u53EA\u80FD\u901A\u77E5\uFF0C\u4E0D\u80FD\u56DE\u3002" }),
6161
6686
  "\u9700\u8981\u4F60\u56DE\u5E94 / \u5B8C\u6210 / \u51FA\u9519\u65F6\u63A8\u4E00\u6761\u5230\u4F60\u624B\u673A\uFF1B\u8981\u5904\u7406\u4ECD\u56DE DSH \u754C\u9762\u70B9\u3002",
6162
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
6163
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { opacity: 0.75 }, children: '\u5982\u679C\u4F60\u540C\u65F6\u88C5\u4E86 dsh-notify-plugin\uFF08\u4E2A\u4EBA\u5FAE\u4FE1\u76F4\u8FDE\u90A3\u6761\uFF09\uFF0C\u540C\u4E00\u7C7B\u4E8B\u4EF6\u53EA\u5F00\u4E00\u8FB9 \u2014\u2014 \u4E24\u8FB9\u90FD\u5F00\u5C31\u4F1A\u6536\u5230\u4E24\u6761\u3002\u8FD9\u4E00\u6761\u662F\u7ED9"\u4E0D\u60F3\u518D\u88C5\u4E00\u4E2A\u63D2\u4EF6"\u7684\u4EBA\u7559\u7684\u9000\u8DEF\u3002' })
6687
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("br", {}),
6688
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { opacity: 0.75 }, children: '\u5982\u679C\u4F60\u540C\u65F6\u88C5\u4E86 dsh-notify-plugin\uFF08\u4E2A\u4EBA\u5FAE\u4FE1\u76F4\u8FDE\u90A3\u6761\uFF09\uFF0C\u540C\u4E00\u7C7B\u4E8B\u4EF6\u53EA\u5F00\u4E00\u8FB9 \u2014\u2014 \u4E24\u8FB9\u90FD\u5F00\u5C31\u4F1A\u6536\u5230\u4E24\u6761\u3002\u8FD9\u4E00\u6761\u662F\u7ED9"\u4E0D\u60F3\u518D\u88C5\u4E00\u4E2A\u63D2\u4EF6"\u7684\u4EBA\u7559\u7684\u9000\u8DEF\u3002' })
6164
6689
  ] }),
6165
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6690
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GroupLabel, { children: "\u63A8\u9001\u6E20\u9053" }),
6691
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6166
6692
  ToggleRow,
6167
6693
  {
6168
6694
  label: "\u7528 PushPlus\uFF08\u5230\u4F60\u5173\u6CE8\u7684\u516C\u4F17\u53F7\uFF09",
@@ -6174,7 +6700,7 @@ function NotifyCard({ settings, setField }) {
6174
6700
  first: true
6175
6701
  }
6176
6702
  ),
6177
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6703
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6178
6704
  TextFieldRow,
6179
6705
  {
6180
6706
  title: "PushPlus token",
@@ -6187,7 +6713,7 @@ function NotifyCard({ settings, setField }) {
6187
6713
  }
6188
6714
  }
6189
6715
  ),
6190
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6716
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6191
6717
  ToggleRow,
6192
6718
  {
6193
6719
  label: "\u7528\u4F01\u4E1A\u5FAE\u4FE1\u7FA4\u673A\u5668\u4EBA",
@@ -6198,7 +6724,7 @@ function NotifyCard({ settings, setField }) {
6198
6724
  }
6199
6725
  }
6200
6726
  ),
6201
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6727
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6202
6728
  TextFieldRow,
6203
6729
  {
6204
6730
  title: "\u4F01\u4E1A\u5FAE\u4FE1 webhook",
@@ -6211,7 +6737,8 @@ function NotifyCard({ settings, setField }) {
6211
6737
  }
6212
6738
  }
6213
6739
  ),
6214
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6740
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GroupLabel, { children: "\u63A8\u9001\u65F6\u673A" }),
6741
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6215
6742
  ToggleRow,
6216
6743
  {
6217
6744
  label: "\u9700\u8981\u4F60\u56DE\u5E94\u65F6\u901A\u77E5",
@@ -6219,10 +6746,11 @@ function NotifyCard({ settings, setField }) {
6219
6746
  checked: kinds["needs-input"],
6220
6747
  onChange: (next) => {
6221
6748
  setField(NOTIFY_KINDS_FIELD, { ...kinds, "needs-input": next });
6222
- }
6749
+ },
6750
+ first: true
6223
6751
  }
6224
6752
  ),
6225
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6753
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6226
6754
  ToggleRow,
6227
6755
  {
6228
6756
  label: "\u4EFB\u52A1\u5B8C\u6210\u65F6\u901A\u77E5",
@@ -6233,7 +6761,7 @@ function NotifyCard({ settings, setField }) {
6233
6761
  }
6234
6762
  }
6235
6763
  ),
6236
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6764
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6237
6765
  ToggleRow,
6238
6766
  {
6239
6767
  label: "\u4EFB\u52A1\u51FA\u9519\u65F6\u901A\u77E5",
@@ -6244,7 +6772,7 @@ function NotifyCard({ settings, setField }) {
6244
6772
  }
6245
6773
  }
6246
6774
  ),
6247
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6775
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6248
6776
  ToggleRow,
6249
6777
  {
6250
6778
  label: "\u6D4B\u8BD5\u63A8\u9001",
@@ -6260,18 +6788,19 @@ function NotifyCard({ settings, setField }) {
6260
6788
  );
6261
6789
  }
6262
6790
  function DirectoryPickCard() {
6263
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6791
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6264
6792
  FoldCard,
6265
6793
  {
6266
6794
  name: "\u5DE5\u4F5C\u533A\u76EE\u5F55\u9009\u62E9",
6795
+ hint: "\u6062\u590D\u70B9\u5199\u5728 src/client.tsx\uFF1A\u63A5\u7BA1\u90A3\u4E24\u4E2A\u69FD\u4F4D\u7684\u90A3\u4E00\u6BB5\u88AB\u786C\u7F16\u7801\u4E3A\u4E0D\u5B89\u88C5\uFF0C\u4FEE\u597D\u5171\u5B58\u4E4B\u540E\u4ECE\u90A3\u91CC\u63A5\u56DE\u6765\u3002",
6267
6796
  summary: "\u5DF2\u505C\u7528 \xB7 \u4E0E\u5B98\u65B9\u76EE\u5F55\u6D41\u7A0B\u5171\u5B58\u65F6\u4F1A\u56DE\u6EDA\u5DE5\u4F5C\u533A\u72B6\u6001\uFF08\u73B0\u5728\u7528\u5B98\u65B9\u5E94\u7528\u5185\u6D4F\u89C8\u5BF9\u8BDD\u6846\uFF09",
6268
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { margin: "10px 0", fontSize: 12, lineHeight: 1.6, opacity: 0.85 }, children: [
6269
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u6682\u65F6\u505C\u7528" }),
6797
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsh-ux-lead", children: [
6798
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u6682\u65F6\u505C\u7528" }),
6270
6799
  "\uFF1A\u6253\u5F00\u5B83\u65F6\uFF0C\u63D2\u4EF6\u4F1A\u63A5\u7BA1\u5B98\u65B9\u90A3\u4E24\u4E2A\u76EE\u5F55\u6D41\u7A0B\u69FD\u4F4D\uFF0C\u771F\u673A\u4E0A\u8868\u73B0\u4E3A",
6271
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u9009\u5B8C\u5DE5\u4F5C\u533A\u51E0\u79D2\u540E\u53C8\u9000\u56DE\u300C\u9009\u62E9\u4E00\u4E2A\u5DE5\u4F5C\u533A\u5F00\u59CB\u300D" }),
6800
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u9009\u5B8C\u5DE5\u4F5C\u533A\u51E0\u79D2\u540E\u53C8\u9000\u56DE\u300C\u9009\u62E9\u4E00\u4E2A\u5DE5\u4F5C\u533A\u5F00\u59CB\u300D" }),
6272
6801
  "\uFF08\u5DE5\u4F5C\u533A\u5176\u5B9E\u5DF2\u7ECF\u5EFA\u597D\uFF0C \u53EA\u662F\u754C\u9762\u72B6\u6001\u88AB\u9876\u56DE\u53BB\uFF09\u3002\u4E0D\u63A5\u7BA1\u5C31\u6B63\u5E38\uFF0C\u6240\u4EE5\u73B0\u5728\u9ED8\u8BA4\u4E0D\u63A5\u7BA1\u3002",
6273
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
6274
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { opacity: 0.75 }, children: "\u5B83\u672C\u6765\u8981\u89E3\u51B3\u7684\u95EE\u9898\u8FD8\u5728\uFF1A\u5B98\u65B9\u90A3\u4E2A\u5E94\u7528\u5185\u5BF9\u8BDD\u6846\u5728 Windows \u4E0A\u7956\u5148\u94FE\u6B62\u4E8E\u76D8\u7B26\u6839 \uFF08\u5B83\u81EA\u5DF1\u7684 README \u5199\u7740\u300C\u4E0D\u679A\u4E3E\u76D8\u7B26\u6839 \u2014\u2014 \u8DE8\u76D8\u4F9D\u8D56\u6D4F\u89C8\u5668 UI \u7684\u8DEF\u5F84\u8F93\u5165\u5165\u53E3\u300D\uFF09\uFF0C \u6240\u4EE5\u6362\u76D8\u8981\u624B\u8F93\uFF1B\u8FD9\u4E00\u9879\u5C31\u662F\u628A\u5B83\u6362\u6210\u7CFB\u7EDF\u6587\u4EF6\u5939\u6846\u3002\u7B49\u4FEE\u597D\u5171\u5B58\u90A3\u4E00\u6B65\u518D\u6062\u590D\u3002" })
6802
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("br", {}),
6803
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { opacity: 0.75 }, children: "\u5B83\u672C\u6765\u8981\u89E3\u51B3\u7684\u95EE\u9898\u8FD8\u5728\uFF1A\u5B98\u65B9\u90A3\u4E2A\u5E94\u7528\u5185\u5BF9\u8BDD\u6846\u5728 Windows \u4E0A\u7956\u5148\u94FE\u6B62\u4E8E\u76D8\u7B26\u6839 \uFF08\u5B83\u81EA\u5DF1\u7684 README \u5199\u7740\u300C\u4E0D\u679A\u4E3E\u76D8\u7B26\u6839 \u2014\u2014 \u8DE8\u76D8\u4F9D\u8D56\u6D4F\u89C8\u5668 UI \u7684\u8DEF\u5F84\u8F93\u5165\u5165\u53E3\u300D\uFF09\uFF0C \u6240\u4EE5\u6362\u76D8\u8981\u624B\u8F93\uFF1B\u8FD9\u4E00\u9879\u5C31\u662F\u628A\u5B83\u6362\u6210\u7CFB\u7EDF\u6587\u4EF6\u5939\u6846\u3002\u7B49\u4FEE\u597D\u5171\u5B58\u90A3\u4E00\u6B65\u518D\u6062\u590D\u3002" })
6275
6804
  ] })
6276
6805
  }
6277
6806
  );
@@ -6279,7 +6808,7 @@ function DirectoryPickCard() {
6279
6808
  function RestartButton({ restart }) {
6280
6809
  const busy = restart.stage === "restarting" || restart.stage === "asking";
6281
6810
  const blocked = restart.blocked;
6282
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6811
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6283
6812
  "button",
6284
6813
  {
6285
6814
  type: "button",
@@ -6294,7 +6823,7 @@ function RestartButton({ restart }) {
6294
6823
  );
6295
6824
  }
6296
6825
  function RefreshButton({ busy }) {
6297
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6826
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6298
6827
  "button",
6299
6828
  {
6300
6829
  type: "button",
@@ -6311,17 +6840,17 @@ function RefreshButton({ busy }) {
6311
6840
  function RestartBanner({ restart }) {
6312
6841
  if (restart.stage === "idle") return null;
6313
6842
  const failed = restart.stage === "failed";
6314
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: failed ? "dsh-ux-restartBanner dsh-ux-restartBannerFailed" : "dsh-ux-restartBanner", children: [
6315
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-restartBannerText", children: restart.detail }),
6316
- restart.stage === "asking" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-restartBannerActions", children: [
6317
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "dsh-ux-restartGo", onClick: () => {
6843
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: failed ? "dsh-ux-restartBanner dsh-ux-restartBannerFailed" : "dsh-ux-restartBanner", children: [
6844
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "dsh-ux-restartBannerText", children: restart.detail }),
6845
+ restart.stage === "asking" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-ux-restartBannerActions", children: [
6846
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "dsh-ux-restartGo", onClick: () => {
6318
6847
  restart.confirm();
6319
6848
  }, children: "\u786E\u8BA4\u91CD\u542F" }),
6320
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "dsh-ux-restartCancel", onClick: () => {
6849
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "dsh-ux-restartCancel", onClick: () => {
6321
6850
  restart.cancel();
6322
6851
  }, children: "\u53D6\u6D88" })
6323
6852
  ] }),
6324
- failed && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-restartBannerActions", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "dsh-ux-restartCancel", onClick: () => {
6853
+ failed && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "dsh-ux-restartBannerActions", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "dsh-ux-restartCancel", onClick: () => {
6325
6854
  restart.cancel();
6326
6855
  }, children: "\u77E5\u9053\u4E86" }) })
6327
6856
  ] });
@@ -6331,10 +6860,10 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6331
6860
  const book = useBook((item) => item);
6332
6861
  const bookStatus = useBookStatus((item) => item);
6333
6862
  const writeNotice = useWriteNotice((item) => item);
6334
- const [conflict, setConflict] = (0, import_react9.useState)(null);
6863
+ const [conflict, setConflict] = (0, import_react10.useState)(null);
6335
6864
  const restart = useRestart();
6336
6865
  const sections = activeSections(settings);
6337
- const [autostartEnabled, setAutostartEnabled] = (0, import_react9.useState)(false);
6866
+ const [autostartEnabled, setAutostartEnabled] = (0, import_react10.useState)(false);
6338
6867
  const autostart = useAutostart(setAutostartEnabled);
6339
6868
  const setKey = (side, chord) => {
6340
6869
  const other = side === "send" ? settings.newlineKey : settings.sendKey;
@@ -6352,7 +6881,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6352
6881
  const panelSize = typeof settings.panelWidth === "number" && typeof settings.panelHeight === "number" ? `${settings.panelWidth}\xD7${settings.panelHeight}` : "\u5C3A\u5BF8\u7528\u5B98\u65B9\u9ED8\u8BA4";
6353
6882
  const panelSummary = `\u8FB9\u7F18\u7F29\u653E ${settings.panelResize ? "\u5F00" : "\u5173"} \xB7 ${panelSize}`;
6354
6883
  const headerNative = settings.headerStatus.startsWith(NATIVE_STATUS_PREFIX);
6355
- const headerSummary = headerNative ? "\u5BBF\u4E3B\u5DF2\u539F\u751F\u652F\u6301\uFF08\u4E0D\u9700\u8981\uFF09" : settings.headerEnabled ? settings.headerStatus === "" ? "\u5DF2\u542F\u7528" : settings.headerStatus : "\u672A\u542F\u7528";
6884
+ const headerSummary = headerNative ? "\u5BBF\u4E3B\u5DF2\u539F\u751F\u652F\u6301\uFF08\u4E0D\u9700\u8981\uFF09" : settings.headerEnabled ? settings.headerStatus === "" ? "\u5DF2\u542F\u7528" : settings.headerStatus : "\u65E7\u5BBF\u4E3B\u624D\u9700\u8981\uFF0C\u8FD9\u4E00\u680F\u73B0\u5728\u4E0D\u8D77\u4F5C\u7528";
6356
6885
  const quickCounts = bookCounts(book);
6357
6886
  const quickSummary = `${quickCounts.categories} \u4E2A\u5206\u7C7B \xB7 ${quickCounts.prompts} \u6761 \xB7 \u6BCF\u6B21 ${quickCounts.always} \xB7 \u4EC5\u9996\u6B21 ${quickCounts.first} \xB7 \u4F18\u5316\u6863\u4F4D ${OPTIMIZER_TIERS.find((item) => item.id === settings.optimizerTier)?.label ?? "\u9AD8\u7EA7"}`;
6358
6887
  const headerStatusText = headerNative ? settings.headerStatus : settings.headerEnabled ? settings.headerStatus === "" ? "\u7B49\u5F85\u9996\u6B21\u5199\u5165\u2026" : settings.headerStatus : "\u672A\u542F\u7528\uFF08\u6253\u5F00\u4E0A\u65B9\u5F00\u5173\u5373\u5199\u5165\uFF09";
@@ -6368,17 +6897,17 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6368
6897
  const sync = count2 === void 0 ? synced?.eras === void 0 || synced.eras.length === 0 ? "" : ` \xB7 \u5DF2\u540C\u6B65 ${synced.eras.length} \u4E2A\u4EF7\u683C\u6863` : ` \xB7 \u7B2C\u4E09\u65B9\u4EF7\u76EE ${count2} \u4E2A\u6A21\u578B`;
6369
6898
  return `${price}${holidayText}${sync}`;
6370
6899
  })();
6371
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: "4px 2px" }, children: [
6372
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-ux-card", children: [
6373
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-cardHeaderStatic", children: [
6374
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardHeadText", children: [
6375
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { className: "dsh-ux-cardName", children: "\u8F93\u5165\u4F53\u9A8C" }),
6376
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsh-ux-cardDescription", children: "dsh-composer-ux \xB7 \u4E3B\u804A\u5929\u8F93\u5165\u6846\u7684\u952E\u4F4D\u3001\u53F3\u952E\u83DC\u5355\u4E0E\u8BBE\u7F6E\u9762\u677F\uFF1B\u8BBE\u7F6E\u5373\u65F6\u751F\u6548\u5E76\u6301\u4E45\u4FDD\u5B58\u3002" })
6900
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-ux-settings", style: { padding: "4px 2px" }, children: [
6901
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsh-ux-card dsh-ux-cardTop", children: [
6902
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-ux-cardHeaderStatic", children: [
6903
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-ux-cardHeadText", children: [
6904
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { className: "dsh-ux-cardName", children: "\u8F93\u5165\u4F53\u9A8C" }),
6905
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsh-ux-cardDescription", children: "dsh-composer-ux \xB7 \u4E3B\u804A\u5929\u8F93\u5165\u6846\u7684\u952E\u4F4D\u3001\u53F3\u952E\u83DC\u5355\u4E0E\u8BBE\u7F6E\u9762\u677F\uFF1B\u8BBE\u7F6E\u5373\u65F6\u751F\u6548\u5E76\u6301\u4E45\u4FDD\u5B58\u3002" })
6377
6906
  ] }),
6378
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardActions", children: [
6379
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RefreshButton, { busy: restart.stage === "restarting" || restart.stage === "asking" }),
6380
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RestartButton, { restart }),
6381
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
6907
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-ux-cardActions", children: [
6908
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RefreshButton, { busy: restart.stage === "restarting" || restart.stage === "asking" }),
6909
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RestartButton, { restart }),
6910
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6382
6911
  "a",
6383
6912
  {
6384
6913
  className: "dsh-ux-cardLink",
@@ -6388,11 +6917,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6388
6917
  title: "\u5728 GitHub \u4E0A\u67E5\u770B\u8FD9\u4E2A\u63D2\u4EF6\uFF08\u65B0\u6807\u7B7E\u6253\u5F00\uFF09",
6389
6918
  children: [
6390
6919
  "GitHub ",
6391
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", children: "\u2197" })
6920
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "aria-hidden": "true", children: "\u2197" })
6392
6921
  ]
6393
6922
  }
6394
6923
  ),
6395
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
6924
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6396
6925
  "a",
6397
6926
  {
6398
6927
  className: "dsh-ux-cardLink",
@@ -6402,20 +6931,29 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6402
6931
  title: "\u6253\u5F00 DSH \u5B98\u7F51\uFF08\u65B0\u6807\u7B7E\uFF09",
6403
6932
  children: [
6404
6933
  "\u5B98\u7F51 ",
6405
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", children: "\u2197" })
6934
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { "aria-hidden": "true", children: "\u2197" })
6406
6935
  ]
6407
6936
  }
6408
6937
  )
6409
6938
  ] })
6410
6939
  ] }),
6411
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RestartBanner, { restart }),
6412
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NotifyCard, { settings, setField: actions.setField }),
6413
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DirectoryPickCard, {}),
6414
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FoldCard, { name: "\u81EA\u68C0", summary: "\u628A\u63D2\u4EF6\u5404\u5904\u72B6\u6001\u644A\u6210\u4E00\u5F20\u8868\uFF08\u5B57\u6BB5 / \u5F00\u5173 / \u7EC8\u7AEF / \u8BF7\u6C42\u5934 / \u901A\u77E5 / \u73AF\u5883\uFF09", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DoctorCard, {}) }),
6415
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6940
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RestartBanner, { restart }),
6941
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(NotifyCard, { settings, setField: actions.setField }),
6942
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DirectoryPickCard, {}),
6943
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6944
+ FoldCard,
6945
+ {
6946
+ name: "\u81EA\u68C0",
6947
+ hint: "\u53EA\u8BFB\u53D6\u3001\u4E0D\u6539\u4EFB\u4F55\u8BBE\u7F6E\uFF1B\u8868\u91CC\u7684\u6BCF\u4E00\u884C\u90FD\u80FD\u5728\u6E90\u7801\u91CC\u627E\u5230\u5BF9\u5E94\u4F4D\u7F6E\u3002",
6948
+ summary: "\u628A\u63D2\u4EF6\u5404\u5904\u72B6\u6001\u644A\u6210\u4E00\u5F20\u8868\uFF08\u5B57\u6BB5 / \u5F00\u5173 / \u7EC8\u7AEF / \u8BF7\u6C42\u5934 / \u901A\u77E5 / \u73AF\u5883\uFF09",
6949
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DoctorCard, {})
6950
+ }
6951
+ ),
6952
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6416
6953
  FoldCard,
6417
6954
  {
6418
6955
  name: "\u81EA\u542F\u52A8",
6956
+ hint: "\u4EE5\u6CE8\u518C\u8868\u4E3A\u51C6\uFF1A\u8FD9\u91CC\u663E\u793A\u7684\u662F\u5BBF\u4E3B\u5F53\u524D\u8BFB\u5230\u7684\u72B6\u6001\uFF0C\u4E0D\u662F\u4E0A\u6B21\u70B9\u4E86\u4EC0\u4E48\u3002\u4E24\u4E2A\u8FD0\u884C\u65F6\u5404\u5199\u5404\u7684\u542F\u52A8\u9879\uFF0C\u4E92\u4E0D\u8986\u76D6\u3002",
6419
6957
  summary: autostart.state?.supported === false ? "\u4EC5 Windows \u652F\u6301\uFF08\u767B\u5F55\u65F6\u81EA\u52A8\u62C9\u8D77\u5F53\u524D\u8FD9\u4E2A\u8FD0\u884C\u65F6\uFF09" : autostartEnabled ? "\u5F00\u542F\u4E2D \xB7 \u767B\u5F55 Windows \u65F6\u81EA\u52A8\u62C9\u8D77\u5F53\u524D\u8FD9\u4E2A\u8FD0\u884C\u65F6" : "\u767B\u5F55\u65F6\u81EA\u52A8\u62C9\u8D77\u5F53\u524D\u8FD9\u4E2A\u8FD0\u884C\u65F6",
6420
6958
  toggle: {
6421
6959
  checked: autostartEnabled,
@@ -6424,20 +6962,20 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6424
6962
  autostart.set(next);
6425
6963
  }
6426
6964
  },
6427
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AutostartCard, { view: autostart })
6965
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AutostartCard, { view: autostart })
6428
6966
  }
6429
6967
  ),
6430
- writeNotice !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-restartBanner dsh-ux-restartBannerFailed", role: "status", children: [
6431
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-restartBannerText", children: [
6968
+ writeNotice !== "" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-ux-restartBanner dsh-ux-restartBannerFailed", role: "status", children: [
6969
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "dsh-ux-restartBannerText", children: [
6432
6970
  "\u8BBE\u7F6E\u672A\u751F\u6548\uFF1A",
6433
6971
  writeNotice
6434
6972
  ] }),
6435
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-restartBannerActions", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "dsh-ux-restartCancel", onClick: () => {
6973
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "dsh-ux-restartBannerActions", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "dsh-ux-restartCancel", onClick: () => {
6436
6974
  actions.dismissNotice();
6437
6975
  }, children: "\u77E5\u9053\u4E86" }) })
6438
6976
  ] }),
6439
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-cardBody", children: [
6440
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6977
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsh-ux-cardBody", children: [
6978
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6441
6979
  ToggleRow,
6442
6980
  {
6443
6981
  first: true,
@@ -6449,14 +6987,15 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6449
6987
  }
6450
6988
  }
6451
6989
  ),
6452
- !settings.enabled && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: "\u5DF2\u505C\u7528\uFF1A\u53D1\u9001/\u6362\u884C\u952E\u4F4D\u3001\u53F3\u952E\u83DC\u5355\u3001\u8BBE\u7F6E\u9762\u677F\u6EDA\u52A8\u4E0E\u8FB9\u7F18\u7F29\u653E\u5747\u4E0D\u518D\u751F\u6548\uFF0C\u8F93\u5165\u6846\u6062\u590D DSH \u539F\u751F\u884C\u4E3A\u3002 \u6253\u5F00\u4E0A\u65B9\u5F00\u5173\u5373\u53EF\u4E00\u952E\u6062\u590D\uFF1B\u6240\u6709\u8BBE\u7F6E\u503C\u4ECD\u4FDD\u7559\u3002" })
6990
+ !settings.enabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: "\u5DF2\u505C\u7528\uFF1A\u53D1\u9001/\u6362\u884C\u952E\u4F4D\u3001\u53F3\u952E\u83DC\u5355\u3001\u8BBE\u7F6E\u9762\u677F\u6EDA\u52A8\u4E0E\u8FB9\u7F18\u7F29\u653E\u5747\u4E0D\u518D\u751F\u6548\uFF0C\u8F93\u5165\u6846\u6062\u590D DSH \u539F\u751F\u884C\u4E3A\u3002 \u6253\u5F00\u4E0A\u65B9\u5F00\u5173\u5373\u53EF\u4E00\u952E\u6062\u590D\uFF1B\u6240\u6709\u8BBE\u7F6E\u503C\u4ECD\u4FDD\u7559\u3002" })
6453
6991
  ] })
6454
6992
  ] }),
6455
- settings.enabled && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
6456
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
6993
+ settings.enabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
6994
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6457
6995
  FoldCard,
6458
6996
  {
6459
6997
  name: "\u952E\u4F4D",
6998
+ hint: "\u53EA\u7BA1\u8F93\u5165\u6846\u91CC\u7684\u53D1\u9001\u4E0E\u6362\u884C\u3002\u672A\u7ED1\u5B9A\u7684 Enter \u7CFB\u6309\u952E\u4E0D\u4F1A\u89E6\u53D1\u53D1\u9001\u6216\u6362\u884C\uFF1B\u4E2D\u6587\u8F93\u5165\u6CD5\u7EC4\u5408\u671F\u95F4\u4E0D\u53D7\u5F71\u54CD\u3002",
6460
6999
  summary: keySummary,
6461
7000
  toggle: {
6462
7001
  checked: sections.keys,
@@ -6465,8 +7004,8 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6465
7004
  }
6466
7005
  },
6467
7006
  children: [
6468
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: bodyLead, children: "\u652F\u6301\u5E38\u7528\u9884\u8BBE\uFF0C\u4E5F\u53EF\u4EE5\u70B9\u51FB\u300C\u81EA\u5B9A\u4E49\u2026\u300D\u540E\u76F4\u63A5\u6309\u4E0B\u4EFB\u610F\u7EC4\u5408\u952E\u5F55\u5236\uFF08Esc \u53D6\u6D88\uFF0CBackspace \u6E05\u9664\uFF09\u3002 \u672A\u7ED1\u5B9A\u7684 Enter \u7CFB\u6309\u952E\u4E0D\u4F1A\u89E6\u53D1\u53D1\u9001\u6216\u6362\u884C\uFF1BCtrl+Enter / \u2318+Enter \u672A\u88AB\u7ED1\u5B9A\u65F6\u4FDD\u7559\u539F\u300C\u52A0\u901F\u63D0\u4EA4\u300D\u884C\u4E3A\uFF1B \u4E2D\u6587\u8F93\u5165\u6CD5\u7EC4\u5408\u671F\u95F4\u4E0D\u53D7\u5F71\u54CD\u3002" }),
6469
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7007
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsh-ux-lead", children: "\u652F\u6301\u5E38\u7528\u9884\u8BBE\uFF0C\u4E5F\u53EF\u4EE5\u70B9\u51FB\u300C\u81EA\u5B9A\u4E49\u2026\u300D\u540E\u76F4\u63A5\u6309\u4E0B\u4EFB\u610F\u7EC4\u5408\u952E\u5F55\u5236\uFF08Esc \u53D6\u6D88\uFF0CBackspace \u6E05\u9664\uFF09\u3002 \u672A\u7ED1\u5B9A\u7684 Enter \u7CFB\u6309\u952E\u4E0D\u4F1A\u89E6\u53D1\u53D1\u9001\u6216\u6362\u884C\uFF1BCtrl+Enter / \u2318+Enter \u672A\u88AB\u7ED1\u5B9A\u65F6\u4FDD\u7559\u539F\u300C\u52A0\u901F\u63D0\u4EA4\u300D\u884C\u4E3A\uFF1B \u4E2D\u6587\u8F93\u5165\u6CD5\u7EC4\u5408\u671F\u95F4\u4E0D\u53D7\u5F71\u54CD\u3002" }),
7008
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6470
7009
  KeyRow,
6471
7010
  {
6472
7011
  first: true,
@@ -6480,7 +7019,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6480
7019
  }
6481
7020
  }
6482
7021
  ),
6483
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7022
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6484
7023
  KeyRow,
6485
7024
  {
6486
7025
  title: "\u6362\u884C\u952E",
@@ -6493,8 +7032,8 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6493
7032
  }
6494
7033
  }
6495
7034
  ),
6496
- conflictHint !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintError, children: conflictHint }),
6497
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { marginTop: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7035
+ conflictHint !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintError, children: conflictHint }),
7036
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { marginTop: 10 }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6498
7037
  "button",
6499
7038
  {
6500
7039
  type: "button",
@@ -6509,10 +7048,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6509
7048
  ]
6510
7049
  }
6511
7050
  ),
6512
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7051
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6513
7052
  FoldCard,
6514
7053
  {
6515
7054
  name: "\u53F3\u952E\u83DC\u5355",
7055
+ hint: "\u53EA\u5F71\u54CD\u53F3\u952E\u5F39\u51FA\u7684\u83DC\u5355\u3002\u5B98\u65B9\u6863\u4E0B\u672C\u63D2\u4EF6\u5B8C\u5168\u4E0D\u4ECB\u5165\uFF0C\u522B\u7684\u63D2\u4EF6\u4E0E\u6D4F\u89C8\u5668\u81EA\u5DF1\u7684\u53F3\u952E\u5904\u7406\u539F\u6837\u751F\u6548\u3002",
6516
7056
  summary: menuSummary,
6517
7057
  toggle: {
6518
7058
  checked: sections.menu,
@@ -6521,42 +7061,36 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6521
7061
  }
6522
7062
  },
6523
7063
  children: [
6524
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: bodyLead, children: "\u53F3\u952E\u70B9\u51FB\u8F93\u5165\u6846\u65F6\u5F39\u51FA\u54EA\u4E00\u79CD\u83DC\u5355\u3002\u53EA\u5F71\u54CD\u53F3\u952E\uFF0C\u4E0D\u5F71\u54CD\u952E\u4F4D\u4E0E\u5176\u5B83\u529F\u80FD\u3002" }),
6525
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...row, borderTop: "none", flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
6526
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowText, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u83DC\u5355\u6765\u6E90" }) }),
6527
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6528
- PillChoice,
6529
- {
6530
- items: MENU_MODES,
6531
- value: settings.menuMode,
6532
- onChange: (mode) => {
6533
- actions.setField(MENU_MODE_FIELD, mode);
6534
- },
6535
- ariaLabel: "\u53F3\u952E\u83DC\u5355\u6765\u6E90"
6536
- }
6537
- )
6538
- ] }),
6539
- settings.menuMode === "official" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
6540
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u5B98\u65B9" }),
7064
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsh-ux-lead", children: "\u53F3\u952E\u70B9\u51FB\u8F93\u5165\u6846\u65F6\u5F39\u51FA\u54EA\u4E00\u79CD\u83DC\u5355\u3002\u53EA\u5F71\u54CD\u53F3\u952E\uFF0C\u4E0D\u5F71\u54CD\u952E\u4F4D\u4E0E\u5176\u5B83\u529F\u80FD\u3002" }),
7065
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Row, { title: "\u83DC\u5355\u6765\u6E90", first: true, stacked: true, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7066
+ Segmented,
7067
+ {
7068
+ items: MENU_MODES,
7069
+ value: settings.menuMode,
7070
+ onChange: (mode) => {
7071
+ actions.setField(MENU_MODE_FIELD, mode);
7072
+ },
7073
+ ariaLabel: "\u53F3\u952E\u83DC\u5355\u6765\u6E90"
7074
+ }
7075
+ ) }),
7076
+ settings.menuMode === "official" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: hintInfo, children: [
7077
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u5B98\u65B9" }),
6541
7078
  "\uFF1A\u672C\u63D2\u4EF6\u5B8C\u5168\u4E0D\u4ECB\u5165\uFF0CDSH \u4E0E\u5176\u5B83\u63D2\u4EF6\u81EA\u5DF1\u7684\u53F3\u952E\u5904\u7406\u539F\u6837\u751F\u6548 \uFF08DSH \u5B98\u65B9\u8F93\u5165\u6846\u672C\u8EAB\u6CA1\u6709\u53F3\u952E\u83DC\u5355\uFF0C\u6240\u4EE5\u901A\u5E38\u770B\u5230\u7684\u5C31\u662F\u6D4F\u89C8\u5668\u7684\u83DC\u5355\uFF09\u3002"
6542
7079
  ] }),
6543
- settings.menuMode === "browser" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
6544
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u6D4F\u89C8\u5668" }),
7080
+ settings.menuMode === "browser" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: hintInfo, children: [
7081
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u6D4F\u89C8\u5668" }),
6545
7082
  "\uFF1A\u56FA\u5B9A\u7528\u6D4F\u89C8\u5668\u81EA\u5E26\u7684\u83DC\u5355\uFF08\u6837\u5B50\u968F\u6D4F\u89C8\u5668\u800C\u53D8\uFF09\uFF0C\u5E76\u5728\u672C\u63D2\u4EF6\u8FD9\u4E00\u5C42 \u6321\u4F4F\u5176\u5B83\u63D2\u4EF6\u7684\u83DC\u5355\uFF1B\u597D\u5904\u662F\u7C98\u8D34\u514D\u6388\u6743\u3001\u96F6\u914D\u7F6E\u3002"
6546
7083
  ] }),
6547
- settings.menuMode === "custom" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
6548
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
6549
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u81EA\u5B9A\u4E49" }),
7084
+ settings.menuMode === "custom" && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
7085
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: hintInfo, children: [
7086
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u81EA\u5B9A\u4E49" }),
6550
7087
  "\uFF1A\u7528\u672C\u63D2\u4EF6\u56FA\u5B9A\u6837\u5F0F\u7684\u83DC\u5355\uFF08\u672A\u9009\u4E2D\u6587\u672C\u65F6\u300C\u526A\u5207 / \u590D\u5236 / \u5220\u9664\u300D\u7F6E\u7070\uFF09\u3002 \u8FD9\u4E00\u6863\u7684\u300C\u7C98\u8D34\u300D\u8981\u8BFB\u526A\u8D34\u677F\uFF0C\u6D4F\u89C8\u5668\u4F1A\u5148\u8981\u4E00\u6B21\u6388\u6743\u2014\u2014\u4E09\u5BB6\u6D4F\u89C8\u5668\u7684\u5904\u7406\u4E0D\u4E00\u6837\uFF1A"
6551
7088
  ] }),
6552
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: "\xB7 Chrome / Edge\uFF08\u8C37\u6B4C / \u5FAE\u8F6F\u6D4F\u89C8\u5668\uFF09\uFF1A\u5F39\u51FA\u540E\u70B9\u300C\u5141\u8BB8\u300D\u5373\u53EF\uFF0C\u4E4B\u540E\u4F1A\u8BB0\u4F4F\u8FD9\u4E2A\u7AD9\u70B9\u3001\u4E0D\u518D\u95EE\u3002 \u8981\u6539\u6216\u64A4\u9500\u6388\u6743\uFF1A\u70B9\u5730\u5740\u680F\u6700\u5DE6\u8FB9\u7684\u7F51\u7AD9\u56FE\u6807 \u2192 \u7F51\u7AD9\u8BBE\u7F6E\uFF08Edge \u53EB\u300C\u6B64\u7AD9\u70B9\u7684\u6743\u9650\u300D\uFF09\u2192 \u526A\u8D34\u677F\uFF1B \u4E5F\u53EF\u4EE5\u76F4\u63A5\u5728\u5730\u5740\u680F\u8F93\u5165 chrome://settings/content/clipboard\uFF08Edge \u8F93\u5165 edge://settings/content/clipboard\uFF09\u3002" }),
6553
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: "\xB7 Firefox\uFF1A\u4E0D\u5141\u8BB8\u7F51\u9875\u9759\u9ED8\u8BFB\u526A\u8D34\u677F\u2014\u2014\u4F60\u70B9\u672C\u63D2\u4EF6\u7684\u300C\u7C98\u8D34\u300D\u540E\uFF0C\u5B83\u4F1A\u5148\u5F39\u4E00\u4E2A\u53EA\u6709\u300C\u7C98\u8D34(P)\u300D \u4E00\u9879\u7684\u5C0F\u7A97\uFF08\u7EA6 1 \u79D2\u540E\u624D\u53EF\u70B9\uFF09\uFF0C\u70B9\u5B83\u624D\u5B8C\u6210\u8FD9\u6B21\u7C98\u8D34\u3002\u8FD9\u662F Firefox \u7684\u5B89\u5168\u673A\u5236\uFF0C\u63D2\u4EF6\u5173\u4E0D\u6389 \uFF08\u5B9E\u6D4B\uFF1Aabout:config \u91CC\u7684\u526A\u8D34\u677F\u9996\u9009\u9879\u5BF9\u5B83\u65E0\u6548\uFF09\u3002\u4E0D\u60F3\u591A\u8FD9\u4E00\u6B65\u5C31\u76F4\u63A5\u6309 Ctrl+V\uFF0C \u6216\u628A\u4E0A\u9762\u7684\u300C\u83DC\u5355\u6765\u6E90\u300D\u6362\u6210\u300C\u6D4F\u89C8\u5668 / \u5B98\u65B9\u300D\u6863\u2014\u2014\u90A3\u4E24\u6863\u7528\u7684\u662F\u6D4F\u89C8\u5668\u81EA\u5DF1\u7684\u7C98\u8D34\u3002" }),
6554
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: "\u6CE8\u610F\uFF1Achrome://\u3001edge:// \u8FD9\u4E9B\u5730\u5740\u6D4F\u89C8\u5668\u4E0D\u5141\u8BB8\u505A\u6210\u7F51\u9875\u91CC\u7684\u94FE\u63A5\uFF0C\u53EA\u80FD\u624B\u8F93\uFF0C \u6216\u590D\u5236\u4E0A\u9762\u90A3\u4E32\u7C98\u8D34\u5230\u5730\u5740\u680F\u3002" }),
6555
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { ...row, flexDirection: "column", alignItems: "stretch", gap: 8 }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
6556
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u83DC\u5355\u6761\u76EE" }),
6557
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: "\u8FD9 7 \u4E2A\u5F00\u5173\u51B3\u5B9A\u81EA\u5B9A\u4E49\u83DC\u5355\u91CC\u51FA\u73B0\u54EA\u4E9B\u6761\u76EE\uFF0C\u5173\u6389\u7684\u4E0D\u663E\u793A\u3002" })
6558
- ] }) }),
6559
- MENU_ITEMS.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7089
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: "\xB7 Chrome / Edge\uFF08\u8C37\u6B4C / \u5FAE\u8F6F\u6D4F\u89C8\u5668\uFF09\uFF1A\u5F39\u51FA\u540E\u70B9\u300C\u5141\u8BB8\u300D\u5373\u53EF\uFF0C\u4E4B\u540E\u4F1A\u8BB0\u4F4F\u8FD9\u4E2A\u7AD9\u70B9\u3001\u4E0D\u518D\u95EE\u3002 \u8981\u6539\u6216\u64A4\u9500\u6388\u6743\uFF1A\u70B9\u5730\u5740\u680F\u6700\u5DE6\u8FB9\u7684\u7F51\u7AD9\u56FE\u6807 \u2192 \u7F51\u7AD9\u8BBE\u7F6E\uFF08Edge \u53EB\u300C\u6B64\u7AD9\u70B9\u7684\u6743\u9650\u300D\uFF09\u2192 \u526A\u8D34\u677F\uFF1B \u4E5F\u53EF\u4EE5\u76F4\u63A5\u5728\u5730\u5740\u680F\u8F93\u5165 chrome://settings/content/clipboard\uFF08Edge \u8F93\u5165 edge://settings/content/clipboard\uFF09\u3002" }),
7090
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: "\xB7 Firefox\uFF1A\u4E0D\u5141\u8BB8\u7F51\u9875\u9759\u9ED8\u8BFB\u526A\u8D34\u677F\u2014\u2014\u4F60\u70B9\u672C\u63D2\u4EF6\u7684\u300C\u7C98\u8D34\u300D\u540E\uFF0C\u5B83\u4F1A\u5148\u5F39\u4E00\u4E2A\u53EA\u6709\u300C\u7C98\u8D34(P)\u300D \u4E00\u9879\u7684\u5C0F\u7A97\uFF08\u7EA6 1 \u79D2\u540E\u624D\u53EF\u70B9\uFF09\uFF0C\u70B9\u5B83\u624D\u5B8C\u6210\u8FD9\u6B21\u7C98\u8D34\u3002\u8FD9\u662F Firefox \u7684\u5B89\u5168\u673A\u5236\uFF0C\u63D2\u4EF6\u5173\u4E0D\u6389 \uFF08\u5B9E\u6D4B\uFF1Aabout:config \u91CC\u7684\u526A\u8D34\u677F\u9996\u9009\u9879\u5BF9\u5B83\u65E0\u6548\uFF09\u3002\u4E0D\u60F3\u591A\u8FD9\u4E00\u6B65\u5C31\u76F4\u63A5\u6309 Ctrl+V\uFF0C \u6216\u628A\u4E0A\u9762\u7684\u300C\u83DC\u5355\u6765\u6E90\u300D\u6362\u6210\u300C\u6D4F\u89C8\u5668 / \u5B98\u65B9\u300D\u6863\u2014\u2014\u90A3\u4E24\u6863\u7528\u7684\u662F\u6D4F\u89C8\u5668\u81EA\u5DF1\u7684\u7C98\u8D34\u3002" }),
7091
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: "\u6CE8\u610F\uFF1Achrome://\u3001edge:// \u8FD9\u4E9B\u5730\u5740\u6D4F\u89C8\u5668\u4E0D\u5141\u8BB8\u505A\u6210\u7F51\u9875\u91CC\u7684\u94FE\u63A5\uFF0C\u53EA\u80FD\u624B\u8F93\uFF0C \u6216\u590D\u5236\u4E0A\u9762\u90A3\u4E32\u7C98\u8D34\u5230\u5730\u5740\u680F\u3002" }),
7092
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Row, { title: "\u83DC\u5355\u6761\u76EE", desc: "\u8FD9 7 \u4E2A\u5F00\u5173\u51B3\u5B9A\u81EA\u5B9A\u4E49\u83DC\u5355\u91CC\u51FA\u73B0\u54EA\u4E9B\u6761\u76EE\uFF0C\u5173\u6389\u7684\u4E0D\u663E\u793A\u3002", stacked: true }),
7093
+ MENU_ITEMS.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6560
7094
  ToggleRow,
6561
7095
  {
6562
7096
  first: index === 0,
@@ -6569,7 +7103,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6569
7103
  },
6570
7104
  item.field
6571
7105
  )),
6572
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { padding: "8px 0 2px" }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7106
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { padding: "8px 0 2px" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6573
7107
  "button",
6574
7108
  {
6575
7109
  type: "button",
@@ -6584,10 +7118,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6584
7118
  ]
6585
7119
  }
6586
7120
  ),
6587
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7121
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6588
7122
  FoldCard,
6589
7123
  {
6590
7124
  name: "\u5FEB\u6377\u6307\u4EE4",
7125
+ hint: "\u8FD9\u91CC\u7BA1\u6E05\u5355\u5185\u5BB9\u4E0E\u9644\u52A0\u89C4\u5219\uFF1B\u8F93\u5165\u6846\u5DE5\u5177\u884C\u91CC\u90A3\u4E2A\u6309\u94AE\u53EA\u662F\u5165\u53E3\u3002\u9644\u52A0\u89C4\u5219\u6309\u5217\u8868\u987A\u5E8F\u62FC\u63A5\uFF0C\u8F93\u5165\u6846\u91CC\u4E0D\u63D0\u524D\u663E\u793A\u3002",
6591
7126
  summary: quickSummary,
6592
7127
  toggle: {
6593
7128
  checked: sections.quick,
@@ -6596,37 +7131,38 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6596
7131
  }
6597
7132
  },
6598
7133
  children: [
6599
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: bodyLead, children: [
7134
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsh-ux-lead", children: [
6600
7135
  "\u8F93\u5165\u6846\u5DE5\u5177\u884C\u91CC\u90A3\u4E2A\u300C\u5FEB\u6377\u6307\u4EE4\u300D\u6309\u94AE\u70B9\u5F00\u5C31\u662F\u8FD9\u5F20\u6E05\u5355\uFF1A\u70B9\u6761\u76EE\u628A\u5185\u5BB9\u63D2\u5165\u8F93\u5165\u6846\u3002 \u6BCF\u6761\u53F3\u4FA7\u7684\u4E09\u9009\u4E00\u51B3\u5B9A",
6601
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u53D1\u9001\u65F6\u600E\u4E48\u9644\u52A0" }),
7136
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u53D1\u9001\u65F6\u600E\u4E48\u9644\u52A0" }),
6602
7137
  "\uFF1A \u300C\u5173\u300D= \u53EA\u63D2\u5165\u4E0D\u9644\u52A0\uFF1B\u300C\u6BCF\u6B21\u300D= \u6BCF\u6B21\u53D1\u9001\u90FD\u9644\u52A0\u5230\u6D88\u606F",
6603
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u672B\u5C3E" }),
7138
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u672B\u5C3E" }),
6604
7139
  "\uFF1B \u300C\u4EC5\u9996\u6B21\u300D= \u53EA\u5728",
6605
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u8FD9\u4E2A\u4F1A\u8BDD\u7684\u7B2C\u4E00\u6761\u6D88\u606F" }),
7140
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u8FD9\u4E2A\u4F1A\u8BDD\u7684\u7B2C\u4E00\u6761\u6D88\u606F" }),
6606
7141
  '\u4E0A\u9644\u52A0\uFF08\u4E4B\u540E\u4E0D\u518D\u9644\u52A0\uFF0C\u5237\u65B0\u9875\u9762\u4E5F\u4E0D\u4F1A\u91CD\u590D\uFF09\u3002 \u591A\u6761\u6309\u5217\u8868\u987A\u5E8F\u62FC\u63A5\uFF0C\u8F93\u5165\u6846\u91CC\u4E0D\u63D0\u524D\u663E\u793A\u3002 \u300C\u4F18\u5316\u63D0\u793A\u8BCD\u300D\u4F1A\u7528\u53E6\u4E00\u4E2A AI \u628A\u8F93\u5165\u6846\u91CC\u7684\u8BDD\u6574\u7406\u6210\u4E00\u6761\u80FD\u76F4\u63A5\u53D1\u51FA\u53BB\u7684\u6E05\u6670\u6307\u4EE4\uFF0C \u7ED3\u679C\u76F4\u63A5\u5199\u56DE\u8F93\u5165\u6846\uFF08Ctrl+Z \u53EF\u8FD8\u539F\uFF09\u2014\u2014\u4E0D\u4F1A\u6C61\u67D3\u5F53\u524D\u5BF9\u8BDD\uFF0C\u4E5F\u4E0D\u5360\u4F60\u7684\u5BF9\u8BDD\u8F6E\u6B21\u3002 0.6.0 \u8D77\u5B83\u4E0D\u518D"\u81EA\u7531\u6539\u5199"\uFF1A\u5B83\u53EA\u80FD\u4EA7\u51FA',
6607
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u80FD\u6307\u56DE\u4F60\u539F\u8BDD\u67D0\u4E00\u53E5\u8BDD" }),
7142
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u80FD\u6307\u56DE\u4F60\u539F\u8BDD\u67D0\u4E00\u53E5\u8BDD" }),
6608
7143
  '\u7684\u6761\u76EE\uFF0C \u5BBF\u4E3B\u9010\u6761\u505A\u5B57\u9762\u6BD4\u5BF9\uFF0C\u5BF9\u4E0D\u4E0A\u5C31\u4E22\u6389\u90A3\u4E00\u6761\u5E76\u5728\u72B6\u6001\u884C\u91CC\u8BB0\u8D26 \u2014\u2014 \u6240\u4EE5"\u66FF\u4F60\u53D1\u660E\u4E00\u6761\u4F60\u6CA1\u8BF4\u8FC7\u7684\u9700\u6C42"\u5728\u7ED3\u6784\u4E0A\u505A\u4E0D\u5230\u3002\u4E0B\u9762\u53EF\u4EE5\u6539\u6BCF\u4E00\u6863\u7528\u7684\u63D0\u793A\u8BCD\u3002'
6609
7144
  ] }),
6610
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...row, borderTop: "none", flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
6611
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
6612
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u4F18\u5316\u5F3A\u5EA6" }),
6613
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: OPTIMIZER_TIERS.find((item) => item.id === settings.optimizerTier)?.hint ?? "" })
6614
- ] }),
6615
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: OPTIMIZER_TIERS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6616
- "button",
6617
- {
6618
- type: "button",
6619
- title: item.hint,
6620
- style: settings.optimizerTier === item.id ? pillActive : pill,
6621
- onClick: () => {
6622
- actions.setField(OPTIMIZER_TIER_FIELD, item.id);
6623
- },
6624
- children: item.label
6625
- },
6626
- item.id
6627
- )) })
6628
- ] }),
6629
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7145
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7146
+ Row,
7147
+ {
7148
+ title: "\u4F18\u5316\u5F3A\u5EA6",
7149
+ desc: OPTIMIZER_TIERS.find((item) => item.id === settings.optimizerTier)?.hint ?? "",
7150
+ first: true,
7151
+ stacked: true,
7152
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7153
+ Segmented,
7154
+ {
7155
+ items: OPTIMIZER_TIERS,
7156
+ value: settings.optimizerTier,
7157
+ onChange: (tier) => {
7158
+ actions.setField(OPTIMIZER_TIER_FIELD, tier);
7159
+ },
7160
+ ariaLabel: "\u4F18\u5316\u5F3A\u5EA6"
7161
+ }
7162
+ )
7163
+ }
7164
+ ),
7165
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6630
7166
  ToggleRow,
6631
7167
  {
6632
7168
  label: "\u643A\u5E26\u4F1A\u8BDD\u4E0A\u4E0B\u6587",
@@ -6637,7 +7173,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6637
7173
  }
6638
7174
  }
6639
7175
  ),
6640
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7176
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6641
7177
  ToggleRow,
6642
7178
  {
6643
7179
  label: "\u8BB0\u5F55\u6BCF\u8F6E\u4F18\u5316\u53F0\u8D26",
@@ -6648,7 +7184,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6648
7184
  }
6649
7185
  }
6650
7186
  ),
6651
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7187
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6652
7188
  ToggleRow,
6653
7189
  {
6654
7190
  label: "\u91CD\u542F\u540E\u4FDD\u7559\u7ED3\u679C\u6846",
@@ -6660,7 +7196,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6660
7196
  action: { label: "\u6E05\u7A7A\u7ED3\u679C\u6846\u72B6\u6001", onClick: actions.clearDockState }
6661
7197
  }
6662
7198
  ),
6663
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7199
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6664
7200
  ToggleRow,
6665
7201
  {
6666
7202
  label: "\u4F18\u5316\u65F6\u5141\u8BB8\u53EA\u8BFB\u67E5\u8BC1\u9879\u76EE\u6587\u4EF6",
@@ -6671,7 +7207,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6671
7207
  }
6672
7208
  }
6673
7209
  ),
6674
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7210
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6675
7211
  OptimizerPromptEditor,
6676
7212
  {
6677
7213
  tier: settings.optimizerTier,
@@ -6681,35 +7217,38 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6681
7217
  }
6682
7218
  }
6683
7219
  ),
6684
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...row, borderTop: "none", flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
6685
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
6686
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u5FEB\u6377\u6307\u4EE4\u6E05\u5355" }),
6687
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: "\u5206\u7C7B\u5728\u8FD9\u91CC\u7BA1\u7406\uFF08\u9762\u677F\u91CC\u53EA\u505A\u5207\u6362\uFF09\uFF1B\u5185\u7F6E 9 \u6761\u53EF\u4EE5\u76F4\u63A5\u7528\uFF0C\u6539\u5B8C\u8BB0\u5F97\u70B9\u300C\u4FDD\u5B58\u4FEE\u6539\u300D\u3002" })
6688
- ] }),
6689
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6690
- QuickPromptsEditor,
6691
- {
6692
- book,
6693
- status: bookStatus,
6694
- onSave: (next) => {
6695
- actions.saveBook(next);
6696
- },
6697
- onReload: () => {
6698
- actions.reloadBook();
6699
- },
6700
- onReset: () => {
6701
- actions.resetBook();
7220
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7221
+ Row,
7222
+ {
7223
+ title: "\u5FEB\u6377\u6307\u4EE4\u6E05\u5355",
7224
+ desc: "\u5206\u7C7B\u5728\u8FD9\u91CC\u7BA1\u7406\uFF08\u9762\u677F\u91CC\u53EA\u505A\u5207\u6362\uFF09\uFF1B\u5185\u7F6E 9 \u6761\u53EF\u4EE5\u76F4\u63A5\u7528\uFF0C\u6539\u5B8C\u8BB0\u5F97\u70B9\u300C\u4FDD\u5B58\u4FEE\u6539\u300D\u3002",
7225
+ stacked: true,
7226
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7227
+ QuickPromptsEditor,
7228
+ {
7229
+ book,
7230
+ status: bookStatus,
7231
+ onSave: (next) => {
7232
+ actions.saveBook(next);
7233
+ },
7234
+ onReload: () => {
7235
+ actions.reloadBook();
7236
+ },
7237
+ onReset: () => {
7238
+ actions.resetBook();
7239
+ }
6702
7240
  }
6703
- }
6704
- )
6705
- ] })
7241
+ ) })
7242
+ }
7243
+ )
6706
7244
  ]
6707
7245
  }
6708
7246
  ),
6709
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7247
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6710
7248
  FoldCard,
6711
7249
  {
6712
7250
  name: "\u8BBE\u7F6E\u9762\u677F",
7251
+ hint: "\u53EA\u7BA1\u8FD9\u4E2A\u8BBE\u7F6E\u9762\u677F\u7684\u5927\u5C0F\u4E0E\u8FB9\u7F18\u7F29\u653E\u3002\u5BFC\u822A\u5217\u7684\u6EDA\u52A8\u7531 DSH \u5B98\u65B9\u8D1F\u8D23\uFF0C\u672C\u63D2\u4EF6\u4E0D\u4ECB\u5165\u3002",
6713
7252
  summary: panelSummary,
6714
7253
  toggle: {
6715
7254
  checked: sections.panel,
@@ -6717,7 +7256,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6717
7256
  actions.setField(PANEL_ENABLED_FIELD, next);
6718
7257
  }
6719
7258
  },
6720
- controls: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7259
+ controls: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6721
7260
  MiniToggle,
6722
7261
  {
6723
7262
  label: "\u8FB9\u7F18\u7F29\u653E",
@@ -6728,10 +7267,10 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6728
7267
  }
6729
7268
  ),
6730
7269
  children: [
6731
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: bodyLead, children: "\u5BFC\u822A\u5217\u7684\u6EDA\u52A8\u7531 DSH \u5B98\u65B9\u7684\u8BBE\u7F6E\u9875\u81EA\u5DF1\u8D1F\u8D23\uFF0C\u672C\u63D2\u4EF6\u4E0D\u518D\u4ECB\u5165\u3002 \u5F00\u542F\u300C\u8FB9\u7F18\u8C03\u6574\u5927\u5C0F\u300D\u540E\uFF0C\u628A\u9F20\u6807\u79FB\u5230\u8BBE\u7F6E\u9762\u677F\u7684\u8FB9\u6216\u89D2\u4E0A\uFF08\u51FA\u73B0\u9AD8\u4EAE\u6216\u5149\u6807\u53D8\u5316\uFF09\u62D6\u52A8\u5373\u53EF\u6539\u53D8\u9762\u677F\u5927\u5C0F\uFF0C \u5C3A\u5BF8\u4F1A\u8BB0\u4F4F\uFF0C\u4E0B\u6B21\u6253\u5F00\u4FDD\u6301\u3002\uFF08\u8FD9\u4E2A\u5F00\u5173\u5728\u6807\u9898\u884C\u4E0A\u3002\uFF09" }),
6732
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap", marginTop: 10 }, children: [
6733
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: rowDesc, children: "\u5C3A\u5BF8\u9884\u8BBE\uFF1A" }),
6734
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7270
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsh-ux-lead", children: "\u5BFC\u822A\u5217\u7684\u6EDA\u52A8\u7531 DSH \u5B98\u65B9\u7684\u8BBE\u7F6E\u9875\u81EA\u5DF1\u8D1F\u8D23\uFF0C\u672C\u63D2\u4EF6\u4E0D\u518D\u4ECB\u5165\u3002 \u5F00\u542F\u300C\u8FB9\u7F18\u8C03\u6574\u5927\u5C0F\u300D\u540E\uFF0C\u628A\u9F20\u6807\u79FB\u5230\u8BBE\u7F6E\u9762\u677F\u7684\u8FB9\u6216\u89D2\u4E0A\uFF08\u51FA\u73B0\u9AD8\u4EAE\u6216\u5149\u6807\u53D8\u5316\uFF09\u62D6\u52A8\u5373\u53EF\u6539\u53D8\u9762\u677F\u5927\u5C0F\uFF0C \u5C3A\u5BF8\u4F1A\u8BB0\u4F4F\uFF0C\u4E0B\u6B21\u6253\u5F00\u4FDD\u6301\u3002\uFF08\u8FD9\u4E2A\u5F00\u5173\u5728\u6807\u9898\u884C\u4E0A\u3002\uFF09" }),
7271
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap", marginTop: 10 }, children: [
7272
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: rowDesc, children: "\u5C3A\u5BF8\u9884\u8BBE\uFF1A" }),
7273
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6735
7274
  "button",
6736
7275
  {
6737
7276
  type: "button",
@@ -6743,7 +7282,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6743
7282
  children: "\u9ED8\u8BA4\uFF08800\uFF09"
6744
7283
  }
6745
7284
  ),
6746
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7285
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6747
7286
  "button",
6748
7287
  {
6749
7288
  type: "button",
@@ -6755,7 +7294,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6755
7294
  children: "\u7D27\u51D1\uFF08640\xD7600\uFF09"
6756
7295
  }
6757
7296
  ),
6758
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7297
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6759
7298
  "button",
6760
7299
  {
6761
7300
  type: "button",
@@ -6771,10 +7310,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6771
7310
  ]
6772
7311
  }
6773
7312
  ),
6774
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7313
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6775
7314
  FoldCard,
6776
7315
  {
6777
7316
  name: "OpenCode \u8BF7\u6C42\u5934",
7317
+ hint: "\u53EA\u8865\u8FDB llm-pi-ai \u91CC\u5DF2\u5B58\u5728\u7684 opencode \u7CFB\u8DEF\u7531\uFF0C\u4E0D\u4F1A\u51ED\u7A7A\u65B0\u5EFA provider\uFF1B\u603B\u5F00\u5173\u5173\u95ED\u65F6\u8865\u7684\u5934\u4F1A\u81EA\u52A8\u64A4\u9500\u3002",
6778
7318
  summary: headerSummary,
6779
7319
  toggle: {
6780
7320
  checked: sections.header,
@@ -6783,14 +7323,14 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6783
7323
  }
6784
7324
  },
6785
7325
  children: [
6786
- headerNative ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
7326
+ headerNative ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: hintInfo, children: [
6787
7327
  "\u672C\u5BBF\u4E3B\u5DF2\u539F\u751F\u652F\u6301\uFF1Api-ai \u4F1A\u6309\u6BCF\u6BB5\u5BF9\u8BDD\u7684\u771F\u5B9E session id \u53D1\u9001 ",
6788
7328
  DEFAULT_HEADER_NAME,
6789
7329
  "\uFF08\u5B83\u540C\u65F6\u4E5F\u662F OpenCode \u7528\u6765\u4F18\u5316\u8DEF\u7531\u4E0E\u63D0\u793A\u8BCD\u7F13\u5B58\u7684\u90A3\u4E00\u7EF4\uFF09\u3002\u6240\u4EE5\u8FD9\u4E00\u680F\u73B0\u5728\u4EC0\u4E48\u90FD\u4E0D\u505A\u2014\u2014 \u6253\u5F00\u5F00\u5173\u4E5F\u4E0D\u4F1A\u6CE8\u5165\uFF08\u6CE8\u5165\u7684\u662F\u56FA\u5B9A\u503C\uFF0C\u53CD\u800C\u4F1A\u9876\u6389\u771F\u5B9E id\uFF09\u3002\u53EA\u6709\u65E7\u5BBF\u4E3B\uFF08pi-ai 1.0.2 \u4E4B\u524D\u3001 \u6CA1\u6709 opencode-headers \u6A21\u5757\uFF09\u624D\u9700\u8981\u6253\u5F00\u5B83\u3002"
6790
7330
  ] }) : null,
6791
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintError, children: "\u26A0\uFE0F \u8BF7\u4F7F\u7528\u81EA\u5B9A\u4E49\u7684 OpenCode API \u5730\u5740\uFF0C\u4E0D\u8981\u7528 DSH \u81EA\u5E26\u7684 API \u5730\u5740\u914D\u7F6E\uFF1A \u7528\u81EA\u5E26\u7684\u914D\u7F6E\u65E0\u6CD5\u4E0A\u4F20\u56FE\u7247\uFF0C\u4E00\u65E6\u53D1\u9001\u56FE\u7247\u5C31\u4F1A\u62A5\u9519\u3002" }),
6792
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: bodyLead, children: "OpenCode \u7684\u63A5\u53E3\u8981\u6C42\u5BA2\u6237\u7AEF\u6BCF\u6B21\u8BF7\u6C42\u90FD\u5E26\u4E0A\u4E00\u4E2A\u7A33\u5B9A\u7684\u4F1A\u8BDD ID \u8BF7\u6C42\u5934\uFF08\u5B98\u65B9 Go \u6587\u6863 \u300C\u53EF\u4EE5\u5728\u54EA\u91CC\u4F7F\u7528\uFF1F\u300D\u7B2C 3 \u6761\uFF1A\u4E3A\u6BCF\u6BB5\u5BF9\u8BDD\u5728 x-opencode-session \u4E2D\u53D1\u9001\u4F1A\u8BDD ID\uFF0C \u4EE5\u4FBF\u5176\u4F18\u5316\u8DEF\u7531\u4E0E\u63D0\u793A\u8BCD\u7F13\u5B58\uFF09\u3002\u65E7\u7248 DSH \u4E0D\u53D1\u8FD9\u4E2A\u5934\uFF0C\u6240\u4EE5\u8FD9\u4E00\u680F\u628A\u5B83\u8865\u8FDB llm-pi-ai \u7684 provider \u914D\u7F6E\u2014\u2014\u4E0B\u4E00\u6B21\u6A21\u578B\u8BF7\u6C42\u5C31\u751F\u6548\uFF0C\u4E0D\u7528\u91CD\u542F\uFF0C\u4E5F\u4E0D\u7528\u624B\u5DE5\u6539 settings.yaml\u3002 \u53EA\u5BF9 llm-pi-ai \u91CC\u300C\u5DF2\u5B58\u5728\u300D\u7684 opencode \u7CFB\u8DEF\u7531\u751F\u6548\uFF0C\u4E0D\u4F1A\u51ED\u7A7A\u65B0\u5EFA provider\uFF1B \u603B\u5F00\u5173\u5173\u95ED\u6216\u672C\u680F\u76EE\u505C\u7528\u65F6\uFF0C\u8865\u7684\u5934\u4F1A\u81EA\u52A8\u64A4\u9500\u3002" }),
6793
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7331
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintError, children: "\u26A0\uFE0F \u8BF7\u4F7F\u7528\u81EA\u5B9A\u4E49\u7684 OpenCode API \u5730\u5740\uFF0C\u4E0D\u8981\u7528 DSH \u81EA\u5E26\u7684 API \u5730\u5740\u914D\u7F6E\uFF1A \u7528\u81EA\u5E26\u7684\u914D\u7F6E\u65E0\u6CD5\u4E0A\u4F20\u56FE\u7247\uFF0C\u4E00\u65E6\u53D1\u9001\u56FE\u7247\u5C31\u4F1A\u62A5\u9519\u3002" }),
7332
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsh-ux-lead", children: "OpenCode \u7684\u63A5\u53E3\u8981\u6C42\u5BA2\u6237\u7AEF\u6BCF\u6B21\u8BF7\u6C42\u90FD\u5E26\u4E0A\u4E00\u4E2A\u7A33\u5B9A\u7684\u4F1A\u8BDD ID \u8BF7\u6C42\u5934\uFF08\u5B98\u65B9 Go \u6587\u6863 \u300C\u53EF\u4EE5\u5728\u54EA\u91CC\u4F7F\u7528\uFF1F\u300D\u7B2C 3 \u6761\uFF1A\u4E3A\u6BCF\u6BB5\u5BF9\u8BDD\u5728 x-opencode-session \u4E2D\u53D1\u9001\u4F1A\u8BDD ID\uFF0C \u4EE5\u4FBF\u5176\u4F18\u5316\u8DEF\u7531\u4E0E\u63D0\u793A\u8BCD\u7F13\u5B58\uFF09\u3002\u65E7\u7248 DSH \u4E0D\u53D1\u8FD9\u4E2A\u5934\uFF0C\u6240\u4EE5\u8FD9\u4E00\u680F\u628A\u5B83\u8865\u8FDB llm-pi-ai \u7684 provider \u914D\u7F6E\u2014\u2014\u4E0B\u4E00\u6B21\u6A21\u578B\u8BF7\u6C42\u5C31\u751F\u6548\uFF0C\u4E0D\u7528\u91CD\u542F\uFF0C\u4E5F\u4E0D\u7528\u624B\u5DE5\u6539 settings.yaml\u3002 \u53EA\u5BF9 llm-pi-ai \u91CC\u300C\u5DF2\u5B58\u5728\u300D\u7684 opencode \u7CFB\u8DEF\u7531\u751F\u6548\uFF0C\u4E0D\u4F1A\u51ED\u7A7A\u65B0\u5EFA provider\uFF1B \u603B\u5F00\u5173\u5173\u95ED\u6216\u672C\u680F\u76EE\u505C\u7528\u65F6\uFF0C\u8865\u7684\u5934\u4F1A\u81EA\u52A8\u64A4\u9500\u3002" }),
7333
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6794
7334
  TextFieldRow,
6795
7335
  {
6796
7336
  title: "\u5934\u540D",
@@ -6803,7 +7343,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6803
7343
  }
6804
7344
  }
6805
7345
  ),
6806
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7346
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6807
7347
  TextFieldRow,
6808
7348
  {
6809
7349
  title: "\u503C",
@@ -6822,7 +7362,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6822
7362
  }
6823
7363
  }
6824
7364
  ),
6825
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7365
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6826
7366
  TextFieldRow,
6827
7367
  {
6828
7368
  title: "\u4F5C\u7528\u8DEF\u7531",
@@ -6835,17 +7375,18 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6835
7375
  }
6836
7376
  }
6837
7377
  ),
6838
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
7378
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: hintInfo, children: [
6839
7379
  "\u72B6\u6001\uFF1A",
6840
7380
  headerStatusText
6841
7381
  ] })
6842
7382
  ]
6843
7383
  }
6844
7384
  ),
6845
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7385
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6846
7386
  FoldCard,
6847
7387
  {
6848
7388
  name: "\u9ED8\u8BA4\u7EC8\u7AEF",
7389
+ hint: "\u53EA\u5728 Windows \u4E0A\u63A5\u7BA1\u3002\u6362\u6863\u4F1A\u7ACB\u523B\u91CD\u65B0\u4E0B\u53D1\u7ED9\u6B63\u5728\u8DD1\u7684\u4F1A\u8BDD\uFF0C\u4F46\u4F1A\u8BDD\u5386\u53F2\u91CC\u53EF\u80FD\u8FD8\u7559\u7740\u65E7\u5DE5\u5177\u540D\u3002",
6849
7390
  summary: terminalSummary,
6850
7391
  toggle: {
6851
7392
  checked: sections.terminal,
@@ -6853,7 +7394,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6853
7394
  actions.setField(TERMINAL_ENABLED_FIELD, next);
6854
7395
  }
6855
7396
  },
6856
- controls: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7397
+ controls: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6857
7398
  PillChoice,
6858
7399
  {
6859
7400
  compact: true,
@@ -6866,15 +7407,16 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6866
7407
  }
6867
7408
  ),
6868
7409
  children: [
6869
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: bodyLead, children: "Windows \u4E0A DSH \u7ED9\u6A21\u578B\u7684\u7EC8\u7AEF\u5DE5\u5177\u662F PowerShell\uFF0C\u800C\u6A21\u578B\u5BF9 bash \u8BED\u6CD5\u7684\u628A\u63E1\u660E\u663E\u66F4\u597D\u3002\u8FD9\u4E00\u680F\u628A\u7EC8\u7AEF \u6362\u6210 Git Bash\uFF1A\u6A21\u578B\u770B\u5230\u7684\u5DE5\u5177\u5C31\u53EB bash\u3001PowerShell \u90A3\u4E2A\u5DE5\u5177\u4F1A\u4ECE\u5B83\u7684\u5DE5\u5177\u5217\u8868\u91CC\u6D88\u5931\uFF0C \u547D\u4EE4\u91CC\u7684\u8DEF\u5F84\u4E0E\u5F15\u53F7\u6309 bash \u89C4\u5219\u5199\u3002\u672C\u673A\u4E0D\u9700\u8981\u88C5 Git for Windows \u5230\u9ED8\u8BA4\u76EE\u5F55\u2014\u2014\u63A2\u6D4B\u4F1A\u5148\u627E git\uFF0C\u518D\u7531\u540C\u4E00\u4E2A\u5B89\u88C5\u53CD\u63A8 bash\u3002\uFF08\u6863\u4F4D\u5728\u6807\u9898\u884C\u4E0A\uFF1A\u81EA\u52A8 / Git Bash / PowerShell\u3002\uFF09" }),
6870
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DefaultTerminalBody, { settings, setField: actions.setField, hideMode: true })
7410
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsh-ux-lead", children: "Windows \u4E0A DSH \u7ED9\u6A21\u578B\u7684\u7EC8\u7AEF\u5DE5\u5177\u662F PowerShell\uFF0C\u800C\u6A21\u578B\u5BF9 bash \u8BED\u6CD5\u7684\u628A\u63E1\u660E\u663E\u66F4\u597D\u3002\u8FD9\u4E00\u680F\u628A\u7EC8\u7AEF \u6362\u6210 Git Bash\uFF1A\u6A21\u578B\u770B\u5230\u7684\u5DE5\u5177\u5C31\u53EB bash\u3001PowerShell \u90A3\u4E2A\u5DE5\u5177\u4F1A\u4ECE\u5B83\u7684\u5DE5\u5177\u5217\u8868\u91CC\u6D88\u5931\uFF0C \u547D\u4EE4\u91CC\u7684\u8DEF\u5F84\u4E0E\u5F15\u53F7\u6309 bash \u89C4\u5219\u5199\u3002\u672C\u673A\u4E0D\u9700\u8981\u88C5 Git for Windows \u5230\u9ED8\u8BA4\u76EE\u5F55\u2014\u2014\u63A2\u6D4B\u4F1A\u5148\u627E git\uFF0C\u518D\u7531\u540C\u4E00\u4E2A\u5B89\u88C5\u53CD\u63A8 bash\u3002\uFF08\u6863\u4F4D\u5728\u6807\u9898\u884C\u4E0A\uFF1A\u81EA\u52A8 / Git Bash / PowerShell\u3002\uFF09" }),
7411
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DefaultTerminalBody, { settings, setField: actions.setField, hideMode: true })
6871
7412
  ]
6872
7413
  }
6873
7414
  ),
6874
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7415
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6875
7416
  FoldCard,
6876
7417
  {
6877
7418
  name: "\u7EDF\u8BA1\u884C",
7419
+ hint: "\u53EA\u6539\u8F93\u5165\u6846\u4E0B\u9762\u90A3\u4E00\u884C\u6587\u5B57\u7684\u5C0F\u6570\u4F4D\u6570\uFF08\u8FDE\u5B83\u7684\u65E0\u969C\u788D\u540D\u5B57\u4E00\u8D77\u6539\uFF09\uFF1B\u6BCF\u8F6E\u7528\u91CF\u5F39\u7A97\u4FDD\u6301\u5B98\u65B9\u539F\u6837\u3002",
6878
7420
  summary: statsSummary,
6879
7421
  toggle: {
6880
7422
  checked: sections.stats,
@@ -6883,26 +7425,34 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6883
7425
  }
6884
7426
  },
6885
7427
  children: [
6886
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: bodyLead, children: [
7428
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsh-ux-lead", children: [
6887
7429
  "\u8F93\u5165\u6846\u4E0B\u65B9\u90A3\u884C\u7528\u91CF\u7EDF\u8BA1\u91CC\u7684\u300C\u7F13\u5B58\u547D\u4E2D xx%\u300D\u3002\u5B98\u65B9\u5E73\u65F6\u7ED9\u6574\u6570\uFF08\u300C\u7F13\u5B58\u547D\u4E2D 12%\u300D\uFF09\uFF0C \u53EA\u5728\u300C\u6574\u6570\u56DB\u820D\u4E94\u5165\u4F1A\u628A\u6CA1\u6EE1\u8BF4\u6210\u6EE1\u300D\u65F6\u624D\u81EA\u52A8\u591A\u7ED9\u51E0\u4F4D\uFF08\u300C99.95%\u300D\uFF09\u3002 \u6253\u5F00\u540E\u5E38\u6001\u7ED9 ",
6888
7430
  HIT_DIGITS,
6889
7431
  " \u4F4D\u5C0F\u6570\uFF08\u300C\u7F13\u5B58\u547D\u4E2D 12.346%\u300D\uFF09\uFF0C\u5E76",
6890
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u6CBF\u7528\u5B98\u65B9\u90A3\u6761 \u4E0D\u6492\u8C0E\u7684\u89C4\u5219" }),
7432
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u6CBF\u7528\u5B98\u65B9\u90A3\u6761 \u4E0D\u6492\u8C0E\u7684\u89C4\u5219" }),
6891
7433
  "\uFF1A\u4E00\u65E6 ",
6892
7434
  HIT_DIGITS,
6893
7435
  " \u4F4D\u5C0F\u6570\u4F1A\u51D1\u6210\u300C100.000%\u300D\u5C31\u7EE7\u7EED\u52A0\u4F4D\uFF0C \u5B81\u53EF\u663E\u793A\u300C99.9999%\u300D\uFF0C\u4E5F\u4E0D\u628A\u300C\u5DEE\u4E00\u70B9\u300D\u8BF4\u6210\u300C\u6EE1\u300D\u3002"
6894
7436
  ] }),
6895
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintInfo, children: "\u53E3\u5F84\u4E0E\u5B98\u65B9\u4E00\u81F4\uFF1A\u7F13\u5B58\u8BFB \xF7\uFF08\u672A\u7F13\u5B58\u8F93\u5165 + \u7F13\u5B58\u8BFB + \u7F13\u5B58\u5199\uFF09\u3002\u53EA\u6539\u8F93\u5165\u6846\u4E0B\u9762\u8FD9\u4E00\u884C\uFF0C \u8FDE\u5B83\u7684\u65E0\u969C\u788D\u540D\u5B57\u4E00\u8D77\u6539\uFF08\u8BFB\u5C4F\u542C\u5230\u7684\u4E5F\u662F\u4E09\u4F4D\u5C0F\u6570\uFF09\uFF1B\u70B9\u5F00\u7EDF\u8BA1\u884C\u7684\u5F39\u7A97\u3001\u6BCF\u8F6E\u7528\u91CF\u5F39\u7A97\u91CC\u7684 \u767E\u5206\u6BD4\u4FDD\u6301\u5B98\u65B9\u539F\u6837\u3002\u5173\u6389\u4E0A\u65B9\u7684\u5F00\u5173\uFF0C\u672C\u63D2\u4EF6\u4F1A\u628A\u5B98\u65B9\u90A3\u4E00\u7248\u539F\u6837\u5199\u56DE\u53BB\u3002" })
7437
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { style: hintInfo, children: "\u53E3\u5F84\u4E0E\u5B98\u65B9\u4E00\u81F4\uFF1A\u7F13\u5B58\u8BFB \xF7\uFF08\u672A\u7F13\u5B58\u8F93\u5165 + \u7F13\u5B58\u8BFB + \u7F13\u5B58\u5199\uFF09\u3002\u53EA\u6539\u8F93\u5165\u6846\u4E0B\u9762\u8FD9\u4E00\u884C\uFF0C \u8FDE\u5B83\u7684\u65E0\u969C\u788D\u540D\u5B57\u4E00\u8D77\u6539\uFF08\u8BFB\u5C4F\u542C\u5230\u7684\u4E5F\u662F\u4E09\u4F4D\u5C0F\u6570\uFF09\uFF1B\u70B9\u5F00\u7EDF\u8BA1\u884C\u7684\u5F39\u7A97\u3001\u6BCF\u8F6E\u7528\u91CF\u5F39\u7A97\u91CC\u7684 \u767E\u5206\u6BD4\u4FDD\u6301\u5B98\u65B9\u539F\u6837\u3002\u5173\u6389\u4E0A\u65B9\u7684\u5F00\u5173\uFF0C\u672C\u63D2\u4EF6\u4F1A\u628A\u5B98\u65B9\u90A3\u4E00\u7248\u539F\u6837\u5199\u56DE\u53BB\u3002" })
6896
7438
  ]
6897
7439
  }
6898
7440
  ),
6899
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FoldCard, { name: "\u91D1\u989D", summary: costSummary, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CostCardBody, { settings, setField: actions.setField, clearField: actions.clearField }) })
7441
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7442
+ FoldCard,
7443
+ {
7444
+ name: "\u91D1\u989D",
7445
+ hint: "\u53EA\u5F71\u54CD\u672C\u63D2\u4EF6\u663E\u793A\u7684\u8D39\u7528\u4F30\u7B97\uFF0C\u4E0D\u6539\u8D26\u5355\uFF1B\u7559\u7A7A\uFF1D\u6CBF\u7528\u5B98\u65B9\u4EF7\u3002\u5CF0\u8C37\u6309\u6BCF\u7B14\u7528\u91CF\u53D1\u751F\u65F6\u523B\u7684\u6863\u7ED3\u7B97\u3002",
7446
+ summary: costSummary,
7447
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CostCardBody, { settings, setField: actions.setField, clearField: actions.clearField })
7448
+ }
7449
+ )
6900
7450
  ] })
6901
7451
  ] });
6902
7452
  }
6903
7453
 
6904
7454
  // src/client/StatsLineEntry.tsx
6905
- var import_react10 = __toESM(require("react"), 1);
7455
+ var import_react11 = __toESM(require("react"), 1);
6906
7456
 
6907
7457
  // src/client/stats-dom.ts
6908
7458
  var MAX_HOST_DEPTH = 6;
@@ -6932,15 +7482,15 @@ function rewriteCacheHit(stats, display) {
6932
7482
  }
6933
7483
 
6934
7484
  // src/client/StatsLineEntry.tsx
6935
- var import_jsx_runtime12 = require("react/jsx-runtime");
7485
+ var import_jsx_runtime13 = require("react/jsx-runtime");
6936
7486
  var SCAN_DEBOUNCE_MS = 80;
6937
7487
  function StatsLineEntry({ useLive, useProjection }) {
6938
7488
  const settings = useLive((item) => item);
6939
7489
  const active2 = statsLineEnabled(settings);
6940
7490
  const usage = typeof useProjection === "function" ? useProjection("tokenUsage") : void 0;
6941
7491
  const target = cacheHitDisplay(usage, active2 ? HIT_DIGITS : 0);
6942
- const anchor = import_react10.default.useRef(null);
6943
- import_react10.default.useLayoutEffect(() => {
7492
+ const anchor = import_react11.default.useRef(null);
7493
+ import_react11.default.useLayoutEffect(() => {
6944
7494
  const host = hostOf(anchor.current);
6945
7495
  if (host === null) return;
6946
7496
  let timer;
@@ -6971,7 +7521,7 @@ function StatsLineEntry({ useLive, useProjection }) {
6971
7521
  if (timer !== void 0) clearTimeout(timer);
6972
7522
  };
6973
7523
  }, [active2, target]);
6974
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7524
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6975
7525
  "span",
6976
7526
  {
6977
7527
  ref: anchor,
@@ -6984,8 +7534,8 @@ function StatsLineEntry({ useLive, useProjection }) {
6984
7534
  }
6985
7535
 
6986
7536
  // src/client/CostChipEntry.tsx
6987
- var import_react13 = __toESM(require("react"), 1);
6988
- var import_react_dom2 = require("react-dom");
7537
+ var import_react14 = __toESM(require("react"), 1);
7538
+ var import_react_dom3 = require("react-dom");
6989
7539
 
6990
7540
  // src/usage-fold.ts
6991
7541
  var UNKNOWN_ROUTE = "\u672A\u77E5";
@@ -7014,14 +7564,14 @@ function agreesWithProjection(fold, projection) {
7014
7564
  }
7015
7565
 
7016
7566
  // src/client/peak-alert.ts
7017
- var import_react11 = __toESM(require("react"), 1);
7567
+ var import_react12 = __toESM(require("react"), 1);
7018
7568
  var TICK_MS = 1e4;
7019
7569
  var notifiedSwitchAt = Number.NaN;
7020
7570
  function usePeakPhase(holidays) {
7021
7571
  const table = holidays ?? DEFAULT_PEAK_HOLIDAYS;
7022
- const [phase, setPhase] = import_react11.default.useState(() => peakPhaseAt(Date.now(), { holidays: table }));
7572
+ const [phase, setPhase] = import_react12.default.useState(() => peakPhaseAt(Date.now(), { holidays: table }));
7023
7573
  const tableKey = table.join(",");
7024
- import_react11.default.useEffect(() => {
7574
+ import_react12.default.useEffect(() => {
7025
7575
  const compute = () => {
7026
7576
  setPhase(peakPhaseAt(Date.now(), { holidays: table }));
7027
7577
  };
@@ -7044,7 +7594,7 @@ function usePeakAlert(settings, holidays) {
7044
7594
  const phase = usePeakPhase(holidays);
7045
7595
  const alert = settings.peakAlert;
7046
7596
  const text = peakNoticeText(phase);
7047
- import_react11.default.useEffect(() => {
7597
+ import_react12.default.useEffect(() => {
7048
7598
  if (!alert.enabled || !alert.webNotify) return;
7049
7599
  if (!Number.isFinite(phase.nextAtMs)) return;
7050
7600
  if (phase.minutesUntil > alert.aheadMinutes) return;
@@ -7064,27 +7614,27 @@ function usePeakAlert(settings, holidays) {
7064
7614
  }
7065
7615
 
7066
7616
  // src/client/session-cost.ts
7067
- var import_react12 = __toESM(require("react"), 1);
7617
+ var import_react13 = __toESM(require("react"), 1);
7068
7618
  var MIN_INTERVAL_MS = 600;
7069
7619
  function useSessionCost(sessionId, fingerprint, force) {
7070
- const [entry, setEntry] = import_react12.default.useState(null);
7071
- const [loading, setLoading] = import_react12.default.useState(false);
7072
- const lastAt = import_react12.default.useRef(0);
7073
- const timer = import_react12.default.useRef(null);
7074
- const inflight = import_react12.default.useRef(false);
7075
- const again = import_react12.default.useRef(false);
7076
- const serial = import_react12.default.useRef(0);
7077
- const alive = import_react12.default.useRef(true);
7078
- const runRef = import_react12.default.useRef(() => {
7620
+ const [entry, setEntry] = import_react13.default.useState(null);
7621
+ const [loading, setLoading] = import_react13.default.useState(false);
7622
+ const lastAt = import_react13.default.useRef(0);
7623
+ const timer = import_react13.default.useRef(null);
7624
+ const inflight = import_react13.default.useRef(false);
7625
+ const again = import_react13.default.useRef(false);
7626
+ const serial = import_react13.default.useRef(0);
7627
+ const alive = import_react13.default.useRef(true);
7628
+ const runRef = import_react13.default.useRef(() => {
7079
7629
  });
7080
- import_react12.default.useEffect(() => {
7630
+ import_react13.default.useEffect(() => {
7081
7631
  alive.current = true;
7082
7632
  return () => {
7083
7633
  alive.current = false;
7084
7634
  if (timer.current !== null) clearTimeout(timer.current);
7085
7635
  };
7086
7636
  }, []);
7087
- const run = import_react12.default.useCallback(() => {
7637
+ const run = import_react13.default.useCallback(() => {
7088
7638
  if (typeof sessionId !== "string" || sessionId === "") return;
7089
7639
  if (inflight.current) {
7090
7640
  again.current = true;
@@ -7115,7 +7665,7 @@ function useSessionCost(sessionId, fingerprint, force) {
7115
7665
  });
7116
7666
  }, [sessionId]);
7117
7667
  runRef.current = run;
7118
- import_react12.default.useEffect(() => {
7668
+ import_react13.default.useEffect(() => {
7119
7669
  if (typeof sessionId !== "string" || sessionId === "") return;
7120
7670
  const wait = Math.max(0, MIN_INTERVAL_MS - (Date.now() - lastAt.current));
7121
7671
  if (wait === 0 || force) {
@@ -7135,7 +7685,7 @@ function useSessionCost(sessionId, fingerprint, force) {
7135
7685
  }
7136
7686
 
7137
7687
  // src/client/CostChipEntry.tsx
7138
- var import_jsx_runtime13 = require("react/jsx-runtime");
7688
+ var import_jsx_runtime14 = require("react/jsx-runtime");
7139
7689
  var VIEWPORT_MARGIN = 12;
7140
7690
  var PANEL_MIN_WIDTH = "min(300px, calc(100vw - 24px))";
7141
7691
  var PANEL_MAX_WIDTH = "min(440px, calc(100vw - 24px))";
@@ -7147,9 +7697,9 @@ function tokenTotal(buckets) {
7147
7697
  return num(buckets.inputTokens) + num(buckets.outputTokens) + num(buckets.cacheReadTokens) + num(buckets.cacheWriteTokens);
7148
7698
  }
7149
7699
  function detail(label, value, key) {
7150
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react13.default.Fragment, { children: [
7151
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { style: { minWidth: 0, margin: 0, color: "var(--dsw-alias-label-tertiary)", overflowWrap: "anywhere" }, children: label }),
7152
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { style: {
7700
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react14.default.Fragment, { children: [
7701
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { style: { minWidth: 0, margin: 0, color: "var(--dsw-alias-label-tertiary)", overflowWrap: "anywhere" }, children: label }),
7702
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { style: {
7153
7703
  minWidth: 0,
7154
7704
  margin: 0,
7155
7705
  color: "var(--dsw-alias-label-secondary)",
@@ -7159,7 +7709,7 @@ function detail(label, value, key) {
7159
7709
  ] }, key ?? label);
7160
7710
  }
7161
7711
  function note(text, key) {
7162
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { gridColumn: "1 / -1", color: "var(--dsw-alias-label-tertiary)" }, children: text }, key ?? text);
7712
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { gridColumn: "1 / -1", color: "var(--dsw-alias-label-tertiary)" }, children: text }, key ?? text);
7163
7713
  }
7164
7714
  function priceText(triple) {
7165
7715
  return `${triple.miss} / ${triple.hit} / ${triple.out}`;
@@ -7170,10 +7720,10 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7170
7720
  const project = typeof useProjection === "function" ? useProjection : () => void 0;
7171
7721
  const usage = project("tokenUsage");
7172
7722
  const selection = project("modelSelection");
7173
- const [open, setOpen] = import_react13.default.useState(false);
7174
- const [hover, setHover] = import_react13.default.useState(false);
7175
- const [anchor, setAnchor] = import_react13.default.useState(null);
7176
- const chip = import_react13.default.useRef(null);
7723
+ const [open, setOpen] = import_react14.default.useState(false);
7724
+ const [hover, setHover] = import_react14.default.useState(false);
7725
+ const [anchor, setAnchor] = import_react14.default.useState(null);
7726
+ const chip = import_react14.default.useRef(null);
7177
7727
  const buckets = costBucketsOf(usage);
7178
7728
  const write = num(usage?.cacheWriteTokens);
7179
7729
  const model = selection?.lastUsed?.model;
@@ -7185,7 +7735,7 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7185
7735
  const estimate = resolvePrice(model, { overrides, ...lastProvider === void 0 ? {} : { provider: lastProvider }, ...eras === void 0 ? {} : { eras } });
7186
7736
  const estimateParts = costPartsOf(buckets, estimate.prices);
7187
7737
  const { text: peakText } = usePeakAlert(settings, data?.holidays ?? settings.peakHolidays ?? DEFAULT_PEAK_HOLIDAYS);
7188
- const close = import_react13.default.useCallback(() => {
7738
+ const close = import_react14.default.useCallback(() => {
7189
7739
  setOpen(false);
7190
7740
  setAnchor(null);
7191
7741
  }, []);
@@ -7204,7 +7754,7 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7204
7754
  setAnchor({ left, top: rect.top - 8 });
7205
7755
  setOpen(true);
7206
7756
  };
7207
- import_react13.default.useEffect(() => {
7757
+ import_react14.default.useEffect(() => {
7208
7758
  if (!open) return;
7209
7759
  const onPointerDown = (event) => {
7210
7760
  const target = event.target;
@@ -7336,20 +7886,24 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7336
7886
  });
7337
7887
  const viewHitRate = cacheHitText(view.hit, viewBilledInput);
7338
7888
  const viewUnpriced = !useBreakdown && estimate.unpriced;
7339
- const headline = viewUnpriced ? "\u672A\u5B9A\u4EF7" : formatMoney(view.total);
7889
+ const quotaUsd = useBreakdown ? num(data?.quota?.usd) : 0;
7890
+ const hasQuota = quotaUsd > 0;
7891
+ const planInfo = data?.plan;
7892
+ const planWindows = Array.isArray(planInfo?.windows) ? planInfo.windows : [];
7893
+ const headline = hasQuota ? formatUsd(quotaUsd) : viewUnpriced ? "\u672A\u5B9A\u4EF7" : formatMoney(view.total);
7340
7894
  const expanded = hover || open;
7341
7895
  const peakPrice = resolvePrice(model, { peak: true, overrides, ...lastProvider === void 0 ? {} : { provider: lastProvider }, ...eras === void 0 ? {} : { eras } });
7342
7896
  const offPrice = resolvePrice(model, { peak: false, overrides, ...lastProvider === void 0 ? {} : { provider: lastProvider }, ...eras === void 0 ? {} : { eras } });
7343
7897
  const overridden = peakPrice.overridden || offPrice.overridden || overrideTierOf(overrides, model, true) !== void 0 || overrideTierOf(overrides, model, false) !== void 0;
7344
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7345
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
7898
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7899
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
7346
7900
  "button",
7347
7901
  {
7348
7902
  ref: chip,
7349
7903
  type: "button",
7350
7904
  "data-composer-ux-cost": "",
7351
7905
  "aria-expanded": open,
7352
- title: (useBreakdown ? sub !== void 0 ? "\u672C\u4F1A\u8BDD\u8D39\u7528\uFF08\u542B\u5B50\u4EE3\u7406\uFF0C\u6309\u6BCF\u7B14\u7528\u91CF\u53D1\u751F\u7684\u65F6\u95F4\u8BA1\u4EF7\uFF09" : "\u672C\u4F1A\u8BDD\u8D39\u7528\uFF08\u6309\u6BCF\u7B14\u7528\u91CF\u53D1\u751F\u7684\u65F6\u95F4\u8BA1\u4EF7\uFF09" : "\u672C\u4F1A\u8BDD\u8D39\u7528\uFF08\u4F30\u7B97\uFF09") + ` \xB7 ${peakText}`,
7906
+ title: (useBreakdown ? hasQuota ? "\u672C\u4F1A\u8BDD\u989D\u5EA6\u6D88\u8017\uFF08\u8BA2\u9605\u5185\uFF0C\u6309\u5957\u9910\u5355\u4EF7\u8BA1\uFF0C\u542B\u5B50\u4EE3\u7406\uFF09" : sub !== void 0 ? "\u672C\u4F1A\u8BDD\u8D39\u7528\uFF08\u542B\u5B50\u4EE3\u7406\uFF0C\u6309\u6BCF\u7B14\u7528\u91CF\u53D1\u751F\u7684\u65F6\u95F4\u8BA1\u4EF7\uFF09" : "\u672C\u4F1A\u8BDD\u8D39\u7528\uFF08\u6309\u6BCF\u7B14\u7528\u91CF\u53D1\u751F\u7684\u65F6\u95F4\u8BA1\u4EF7\uFF09" : "\u672C\u4F1A\u8BDD\u8D39\u7528\uFF08\u4F30\u7B97\uFF09") + ` \xB7 ${peakText}`,
7353
7907
  onClick: toggle,
7354
7908
  onMouseEnter: () => setHover(true),
7355
7909
  onMouseLeave: () => setHover(false),
@@ -7377,11 +7931,22 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7377
7931
  whiteSpace: "nowrap",
7378
7932
  cursor: "pointer"
7379
7933
  },
7380
- children: headline
7934
+ children: [
7935
+ headline,
7936
+ hasQuota ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: {
7937
+ fontSize: 9,
7938
+ lineHeight: "12px",
7939
+ padding: "0 4px",
7940
+ borderRadius: 6,
7941
+ border: "0.5px solid var(--dsw-alias-border-l2)",
7942
+ color: "var(--dsw-alias-label-tertiary)",
7943
+ fontVariantNumeric: "normal"
7944
+ }, children: "\u8BA2\u9605\u5185" }) : null
7945
+ ]
7381
7946
  }
7382
7947
  ),
7383
- open && anchor !== null ? (0, import_react_dom2.createPortal)(
7384
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7948
+ open && anchor !== null ? (0, import_react_dom3.createPortal)(
7949
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
7385
7950
  "div",
7386
7951
  {
7387
7952
  "data-composer-ux-cost-panel": "",
@@ -7411,7 +7976,7 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7411
7976
  // 与 styles.ts 里那些样式对象同一做法(那边也是 `as CSSProperties`)。
7412
7977
  },
7413
7978
  children: [
7414
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: {
7979
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: {
7415
7980
  display: "flex",
7416
7981
  justifyContent: "space-between",
7417
7982
  gap: 16,
@@ -7419,17 +7984,33 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7419
7984
  color: "var(--dsw-alias-label-primary)",
7420
7985
  fontWeight: 500
7421
7986
  }, children: [
7422
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u672C\u4F1A\u8BDD\u8D39\u7528" }),
7423
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { fontVariantNumeric: "tabular-nums" }, children: headline })
7987
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: hasQuota ? "\u672C\u4F1A\u8BDD\u989D\u5EA6\u6D88\u8017" : "\u672C\u4F1A\u8BDD\u8D39\u7528" }),
7988
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { style: { fontVariantNumeric: "tabular-nums" }, children: headline })
7424
7989
  ] }),
7425
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginBottom: 10, borderTop: "0.5px solid var(--dsw-alias-border-l2)" } }),
7426
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: {
7990
+ hasQuota ? note(`\u8BA2\u9605\u5185 \xB7 \u6309\u520A\u4F8B\u4EF7\u6298\u7B97 ${formatMoney(view.total)}\uFF08\u4E24\u5957\u53E3\u5F84\u5E76\u5B58\uFF1A\u4E0A\u9762\u662F\u5B9E\u9645\u88AB\u6263\u7684\u5957\u9910\u989D\u5EA6\uFF0C\u8FD9\u91CC\u662F\u8FD9\u4E9B token \u6309\u5B98\u65B9\u4EF7\u6298\u7B97\u503C\u591A\u5C11\u94B1\uFF09`, "__quota_head__") : null,
7991
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { marginBottom: 10, borderTop: "0.5px solid var(--dsw-alias-border-l2)" } }),
7992
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: {
7427
7993
  display: "grid",
7428
7994
  gridTemplateColumns: "minmax(76px, auto) minmax(0, 1fr)",
7429
7995
  gap: "6px 16px",
7430
7996
  margin: 0
7431
7997
  }, children: [
7432
- useBreakdown ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7998
+ hasQuota ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7999
+ detail("\u989D\u5EA6\u6D88\u8017\uFF08\u542B\u5B50\u4EE3\u7406\uFF09", formatUsd(quotaUsd), "__quota__"),
8000
+ (data?.quota?.models ?? []).map((row2) => detail(
8001
+ `\u5176\u4E2D ${row2.model === void 0 || row2.model === "" ? "\u672A\u77E5\u6A21\u578B" : row2.model}`,
8002
+ `${formatUsd(num(row2.usd))}${row2.percentOfLimit === void 0 ? "" : ` \xB7 \u5360\u6708\u989D\u5EA6 ${num(row2.percentOfLimit).toFixed(2)}%`}`,
8003
+ `__quota_${row2.model ?? ""}`
8004
+ )),
8005
+ planWindows.length > 0 ? detail(
8006
+ "\u989D\u5EA6\u7A97\u53E3",
8007
+ planWindows.map((window2) => `${window2.id === void 0 ? "" : QUOTA_WINDOW_LABEL[window2.id]} ${num(window2.percent).toFixed(0)}%`).filter((text) => text !== "").join(" \xB7 "),
8008
+ "__quota_windows__"
8009
+ ) : null,
8010
+ planInfo?.status === "pending" ? note('\u989D\u5EA6\u7A97\u53E3\u6B63\u5728\u53D6\uFF08\u5B98\u65B9\u63A5\u53E3\u7B2C\u4E00\u6B21\u8FD4\u56DE\u524D\u5148\u663E\u793A"\u2014"\uFF1B\u4E0D\u5F71\u54CD\u4E0A\u9762\u7684\u989D\u5EA6\u6D88\u8017\uFF09', "__quota_pending__") : null,
8011
+ planInfo !== void 0 && planInfo.status !== void 0 && planInfo.status !== "ok" && planInfo.status !== "pending" ? note(`\u989D\u5EA6\u7A97\u53E3\u53D6\u4E0D\u5230\uFF1A${planInfo.reason === void 0 || planInfo.reason === "" ? planInfo.status : planInfo.reason}`, "__quota_gap__") : null
8012
+ ] }) : null,
8013
+ useBreakdown ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7433
8014
  routeRows.map((route) => detail(
7434
8015
  `${route.provider} \xB7 ${route.model}` + (route.deepseek ? route.peak ? "\uFF08\u9AD8\u5CF0\uFF09" : "\uFF08\u7A7A\u95F2\uFF09" : "\uFF08\u5E73\u5766\u4EF7\uFF09"),
7435
8016
  `${formatTokens(route.tokens)} \xB7 ${route.unpriced ? "\u672A\u5B9A\u4EF7" : formatMoney(route.cost)}`,
@@ -7451,7 +8032,7 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7451
8032
  builtinCount > 0 ? note(`\u6709 ${builtinCount} \u884C\u7528\u7684\u662F\u5185\u7F6E\u5FEB\u7167\u4EF7\uFF08models.dev \u5FEB\u7167 ${PROVIDER_PRICES_SNAPSHOT_AT}\uFF09\u2014\u2014\u60F3\u6362\u6210\u6700\u65B0\u4EF7\uFF0C\u53BB\u8BBE\u7F6E\u9875\u300C\u91D1\u989D\u300D\u70B9\u4E00\u6B21\u300C\u540C\u6B65\u7B2C\u4E09\u65B9\u4EF7\u76EE\u300D\u3002`, "__builtin__") : null,
7452
8033
  unpricedCount > 0 ? note(`\u6709 ${unpricedCount} \u884C\u300C\u672A\u5B9A\u4EF7\u300D\uFF1A\u90A3\u662F\u975E DeepSeek \u6A21\u578B\uFF0C\u540C\u6B65\u4EF7\u76EE\u4E0E\u5185\u7F6E\u5FEB\u7167\u91CC\u90FD\u6CA1\u6709\u5B83\uFF0C\u6240\u4EE5\u90A3\u90E8\u5206\u6309 0 \u8BA1\u3002\u53BB\u8BBE\u7F6E\u9875\u300C\u91D1\u989D\u300D\u5237\u65B0\u4E00\u6B21\u300C\u540C\u6B65\u7B2C\u4E09\u65B9\u4EF7\u76EE\u300D\uFF0C\u6216\u7ED9\u90A3\u884C\u76F4\u63A5\u586B\u4E2A\u4EF7\u3002`, "__unpriced__") : null,
7453
8034
  subGapText !== null ? note(subGapText, "__sub_gap__") : null
7454
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
8035
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7455
8036
  detail("\u672A\u7F13\u5B58\u8F93\u5165", `${formatTokens(buckets.miss)} \xB7 ${formatMoney(estimateParts.miss)}`),
7456
8037
  detail("\u7F13\u5B58\u547D\u4E2D", `${formatTokens(buckets.hit)} \xB7 ${formatMoney(estimateParts.hit)}`),
7457
8038
  detail("\u8F93\u51FA", `${formatTokens(buckets.out)} \xB7 ${formatMoney(estimateParts.out)}`),
@@ -7473,8 +8054,8 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7473
8054
  }
7474
8055
 
7475
8056
  // src/client/QuickCommandsButton.tsx
7476
- var import_react14 = require("react");
7477
- var import_jsx_runtime14 = require("react/jsx-runtime");
8057
+ var import_react15 = require("react");
8058
+ var import_jsx_runtime15 = require("react/jsx-runtime");
7478
8059
  function QuickCommandsButton({
7479
8060
  useInput,
7480
8061
  inputActions,
@@ -7488,8 +8069,8 @@ function QuickCommandsButton({
7488
8069
  const anchor = usePanel((item) => item);
7489
8070
  const draft = useInput((state2) => state2.draft);
7490
8071
  const blank = useSession((state2) => state2?.blank === true);
7491
- const ref = (0, import_react14.useRef)(null);
7492
- (0, import_react14.useEffect)(() => {
8072
+ const ref = (0, import_react15.useRef)(null);
8073
+ (0, import_react15.useEffect)(() => {
7493
8074
  const sid = typeof sessionId === "string" ? sessionId : "";
7494
8075
  publishInputBridge({
7495
8076
  actions: inputActions ?? null,
@@ -7503,7 +8084,7 @@ function QuickCommandsButton({
7503
8084
  }, [inputActions, draft, sessionId, blank]);
7504
8085
  if (!activeSections(settings).quick) return null;
7505
8086
  const open = anchor !== null;
7506
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
8087
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
7507
8088
  "button",
7508
8089
  {
7509
8090
  ref,
@@ -7524,14 +8105,14 @@ function QuickCommandsButton({
7524
8105
  });
7525
8106
  },
7526
8107
  children: [
7527
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8108
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7528
8109
  "svg",
7529
8110
  {
7530
8111
  viewBox: "0 0 16 16",
7531
8112
  width: "12",
7532
8113
  height: "12",
7533
8114
  "aria-hidden": true,
7534
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8115
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7535
8116
  "path",
7536
8117
  {
7537
8118
  d: "M9.2 1.2 3.4 9.1h3.5l-0.9 5.7 6-8.1H8.4l0.8-5.5Z",
@@ -7540,17 +8121,17 @@ function QuickCommandsButton({
7540
8121
  )
7541
8122
  }
7542
8123
  ),
7543
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "\u5FEB\u6377\u6307\u4EE4" })
8124
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: "\u5FEB\u6377\u6307\u4EE4" })
7544
8125
  ]
7545
8126
  }
7546
8127
  );
7547
8128
  }
7548
8129
 
7549
8130
  // src/client/QuickCommandsPanel.tsx
7550
- var import_react18 = require("react");
8131
+ var import_react19 = require("react");
7551
8132
 
7552
8133
  // src/client/OptimizeOptionsCard.tsx
7553
- var import_react15 = __toESM(require("react"), 1);
8134
+ var import_react16 = __toESM(require("react"), 1);
7554
8135
 
7555
8136
  // src/client/model-catalog.ts
7556
8137
  var textOf = (value) => typeof value === "string" ? value.trim() : "";
@@ -7594,11 +8175,11 @@ async function fetchModelCatalog(options = {}) {
7594
8175
  }
7595
8176
 
7596
8177
  // src/client/OptimizeOptionsCard.tsx
7597
- var import_jsx_runtime15 = require("react/jsx-runtime");
7598
- function Segmented(props) {
7599
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7600
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optLabel, title: props.hint, children: props.label }),
7601
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: optSegmented, role: "group", "aria-label": props.label, children: props.options.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8178
+ var import_jsx_runtime16 = require("react/jsx-runtime");
8179
+ function Segmented2(props) {
8180
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: optRow, children: [
8181
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optLabel, title: props.hint, children: props.label }),
8182
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: optSegmented, role: "group", "aria-label": props.label, children: props.options.map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7602
8183
  "button",
7603
8184
  {
7604
8185
  type: "button",
@@ -7618,8 +8199,8 @@ function Segmented(props) {
7618
8199
  ] });
7619
8200
  }
7620
8201
  function Toggle(props) {
7621
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7622
- Segmented,
8202
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8203
+ Segmented2,
7623
8204
  {
7624
8205
  label: props.label,
7625
8206
  hint: props.hint,
@@ -7637,13 +8218,13 @@ function currentPrompt(settings) {
7637
8218
  return settings.optimizerPromptStandard;
7638
8219
  }
7639
8220
  function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7640
- const [detailOpen, setDetailOpen] = (0, import_react15.useState)(false);
7641
- const [modelText, setModelText] = (0, import_react15.useState)(settings.optimizerModel);
7642
- const [pickerOpen, setPickerOpen] = (0, import_react15.useState)(false);
7643
- const [catalog, setCatalog] = (0, import_react15.useState)(null);
7644
- const [manual, setManual] = (0, import_react15.useState)(false);
7645
- const [retrySeq, setRetrySeq] = (0, import_react15.useState)(0);
7646
- (0, import_react15.useEffect)(() => {
8221
+ const [detailOpen, setDetailOpen] = (0, import_react16.useState)(false);
8222
+ const [modelText, setModelText] = (0, import_react16.useState)(settings.optimizerModel);
8223
+ const [pickerOpen, setPickerOpen] = (0, import_react16.useState)(false);
8224
+ const [catalog, setCatalog] = (0, import_react16.useState)(null);
8225
+ const [manual, setManual] = (0, import_react16.useState)(false);
8226
+ const [retrySeq, setRetrySeq] = (0, import_react16.useState)(0);
8227
+ (0, import_react16.useEffect)(() => {
7647
8228
  if (!pickerOpen) return;
7648
8229
  let alive = true;
7649
8230
  setCatalog({ kind: "loading" });
@@ -7665,8 +8246,8 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7665
8246
  `Bash ${settings.optimizeBash ? "\u5F00" : "\u5173"}`,
7666
8247
  ...settings.optimizerModel === "" ? [] : [`\u6A21\u578B ${settings.optimizerModel}`]
7667
8248
  ].join(" \xB7 ");
7668
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optCard, role: "group", "aria-label": "\u4F18\u5316\u9009\u9879", children: [
7669
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
8249
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: optCard, role: "group", "aria-label": "\u4F18\u5316\u9009\u9879", children: [
8250
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7670
8251
  "button",
7671
8252
  {
7672
8253
  type: "button",
@@ -7678,15 +8259,15 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7678
8259
  },
7679
8260
  onClick: onToggle,
7680
8261
  children: [
7681
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optFoldArrow, "aria-hidden": true, children: open ? "\u25BE" : "\u25B8" }),
7682
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optCardTitle, title: "\u8FD9\u4E9B\u5F00\u5173\u90FD\u5C5E\u4E8E\u300C\u4F18\u5316\u63D0\u793A\u8BCD\u300D\u8FD9\u4E00\u8F6E\uFF1B\u6863\u4F4D\u5728\u9762\u677F\u6807\u9898\u884C", children: "\u4F18\u5316\u9009\u9879" }),
7683
- !open && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optFoldSummary, children: summary })
8262
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optFoldArrow, "aria-hidden": true, children: open ? "\u25BE" : "\u25B8" }),
8263
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optCardTitle, title: "\u8FD9\u4E9B\u5F00\u5173\u90FD\u5C5E\u4E8E\u300C\u4F18\u5316\u63D0\u793A\u8BCD\u300D\u8FD9\u4E00\u8F6E\uFF1B\u6863\u4F4D\u5728\u9762\u677F\u6807\u9898\u884C", children: "\u4F18\u5316\u9009\u9879" }),
8264
+ !open && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optFoldSummary, children: summary })
7684
8265
  ]
7685
8266
  }
7686
8267
  ),
7687
- open && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7688
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7689
- Segmented,
8268
+ open && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
8269
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8270
+ Segmented2,
7690
8271
  {
7691
8272
  label: "\u6743\u9650",
7692
8273
  hint: "\u5BA1\u67E5 = \u6210\u54C1\u8FDB\u7ED3\u679C\u6846\uFF0C\u4F60\u770B\u8FC7\u518D\u70B9\u300C\u63D2\u5165\u8F93\u5165\u6846\u300D\uFF1B\u81EA\u52A8 = \u8DD1\u5B8C\u81EA\u52A8\u5199\u56DE\u8F93\u5165\u6846\uFF08\u90FD\u4E0D\u4F1A\u81EA\u52A8\u53D1\u9001\u6D88\u606F\uFF09",
@@ -7695,8 +8276,8 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7695
8276
  onPick: actions.setPermission
7696
8277
  }
7697
8278
  ),
7698
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7699
- Segmented,
8279
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8280
+ Segmented2,
7700
8281
  {
7701
8282
  label: "\u534F\u4F5C\u57FA\u8C03",
7702
8283
  hint: "\u786C\u90A6\u90A6 = \u6574\u4EFD\u8F85\u52A9\u5305\u6539\u7528\u53E3\u8BED\u76F4\u7ED9\u7684\u5199\u6CD5\uFF08\u53EA\u6539\u5199\u6CD5\uFF1A\u6761\u76EE\u96C6\u5408\u4E0E\u9010\u5B57\u4F9D\u636E\u89C4\u5219\u4E0D\u53D8\uFF09",
@@ -7705,9 +8286,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7705
8286
  onPick: actions.setFraming
7706
8287
  }
7707
8288
  ),
7708
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7709
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optLabel, title: "\u89E3\u91CA\u5C42\u7528\u54EA\u4E2A\u6A21\u578B\uFF1A\u8DDF\u968F\u4F1A\u8BDD\u5F53\u524D\u9009\u7684\uFF0C\u6216\u4ECE\u6E05\u5355\u91CC\u6307\u5B9A\u4E00\u6761", children: "\u6A21\u578B" }),
7710
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
8289
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: optRow, children: [
8290
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optLabel, title: "\u89E3\u91CA\u5C42\u7528\u54EA\u4E2A\u6A21\u578B\uFF1A\u8DDF\u968F\u4F1A\u8BDD\u5F53\u524D\u9009\u7684\uFF0C\u6216\u4ECE\u6E05\u5355\u91CC\u6307\u5B9A\u4E00\u6761", children: "\u6A21\u578B" }),
8291
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7711
8292
  "button",
7712
8293
  {
7713
8294
  type: "button",
@@ -7728,8 +8309,8 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7728
8309
  }
7729
8310
  )
7730
8311
  ] }),
7731
- pickerOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optPickerPanel, role: "listbox", "aria-label": "\u6A21\u578B\u6E05\u5355", children: [
7732
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
8312
+ pickerOpen && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: optPickerPanel, role: "listbox", "aria-label": "\u6A21\u578B\u6E05\u5355", children: [
8313
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7733
8314
  "button",
7734
8315
  {
7735
8316
  type: "button",
@@ -7745,19 +8326,19 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7745
8326
  },
7746
8327
  children: [
7747
8328
  "\u8DDF\u968F\u4F1A\u8BDD\u6A21\u578B",
7748
- catalog !== null && catalog.kind === "ok" && catalog.current.model !== "" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { style: optPickerModelId, children: [
8329
+ catalog !== null && catalog.kind === "ok" && catalog.current.model !== "" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: optPickerModelId, children: [
7749
8330
  "\u5F53\u524D\uFF1A",
7750
8331
  catalog.current.model
7751
8332
  ] })
7752
8333
  ]
7753
8334
  }
7754
8335
  ),
7755
- catalog === null || catalog.kind === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optHint, children: "\u6B63\u5728\u8BFB\u6A21\u578B\u6E05\u5355\u2026" }) : catalog.kind === "error" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7756
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { style: optHint, children: [
8336
+ catalog === null || catalog.kind === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optHint, children: "\u6B63\u5728\u8BFB\u6A21\u578B\u6E05\u5355\u2026" }) : catalog.kind === "error" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
8337
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: optHint, children: [
7757
8338
  "\u8BFB\u4E0D\u5230\u6A21\u578B\u6E05\u5355\uFF1A",
7758
8339
  catalog.error
7759
8340
  ] }),
7760
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8341
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7761
8342
  "button",
7762
8343
  {
7763
8344
  type: "button",
@@ -7771,14 +8352,14 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7771
8352
  children: "\u91CD\u8BD5"
7772
8353
  }
7773
8354
  )
7774
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7775
- catalog.groups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optHint, children: "\u5BBF\u4E3B\u6CA1\u62A5\u51FA\u4EFB\u4F55 provider\uFF08\u5728\u8BBE\u7F6E\u91CC\u770B\u8FC7\u6A21\u578B\u8DEF\u7531\u5417\uFF1F\uFF09" }),
7776
- catalog.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react15.default.Fragment, { children: [
7777
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optPickerGroup, children: group.name }),
7778
- group.models.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optHint, children: group.error === void 0 ? "\u8FD9\u4E00\u7EC4\u6CA1\u6709\u6A21\u578B" : `\u8FD9\u4E00\u7EC4\u8BFB\u4E0D\u5230\uFF1A${group.error}` }),
8355
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
8356
+ catalog.groups.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optHint, children: "\u5BBF\u4E3B\u6CA1\u62A5\u51FA\u4EFB\u4F55 provider\uFF08\u5728\u8BBE\u7F6E\u91CC\u770B\u8FC7\u6A21\u578B\u8DEF\u7531\u5417\uFF1F\uFF09" }),
8357
+ catalog.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react16.default.Fragment, { children: [
8358
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optPickerGroup, children: group.name }),
8359
+ group.models.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optHint, children: group.error === void 0 ? "\u8FD9\u4E00\u7EC4\u6CA1\u6709\u6A21\u578B" : `\u8FD9\u4E00\u7EC4\u8BFB\u4E0D\u5230\uFF1A${group.error}` }),
7779
8360
  group.models.map((model) => {
7780
8361
  const value = `${group.id}/${model.id}`;
7781
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
8362
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7782
8363
  "button",
7783
8364
  {
7784
8365
  type: "button",
@@ -7793,7 +8374,7 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7793
8374
  },
7794
8375
  children: [
7795
8376
  model.name,
7796
- model.name === model.id ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optPickerModelId, children: model.id })
8377
+ model.name === model.id ? null : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optPickerModelId, children: model.id })
7797
8378
  ]
7798
8379
  },
7799
8380
  value
@@ -7801,7 +8382,7 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7801
8382
  })
7802
8383
  ] }, group.id))
7803
8384
  ] }),
7804
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8385
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7805
8386
  "button",
7806
8387
  {
7807
8388
  type: "button",
@@ -7815,7 +8396,7 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7815
8396
  children: "\u624B\u52A8\u8F93\u5165 provider/model\u2026"
7816
8397
  }
7817
8398
  ),
7818
- manual && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8399
+ manual && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7819
8400
  "input",
7820
8401
  {
7821
8402
  "aria-label": "\u624B\u52A8\u8F93\u5165\u6A21\u578B",
@@ -7834,8 +8415,8 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7834
8415
  }
7835
8416
  )
7836
8417
  ] }),
7837
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7838
- Segmented,
8418
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8419
+ Segmented2,
7839
8420
  {
7840
8421
  label: "\u4E0A\u4E0B\u6587",
7841
8422
  hint: "\u56DE\u5408 = \u53EA\u5E26\u6700\u8FD1 N \u8F6E\u5F80\u6765\uFF080 = \u4E0D\u5E26\uFF09\uFF1B\u5168\u6587 = \u5C3D\u91CF\u7ED9\u5168\uFF08\u4ECD\u53D7\u5B57\u7B26\u9884\u7B97\u7EA6\u675F\uFF09",
@@ -7847,9 +8428,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7847
8428
  onPick: actions.setHistory
7848
8429
  }
7849
8430
  ),
7850
- settings.optimizerHistory === "turns" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7851
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optLabel }),
7852
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8431
+ settings.optimizerHistory === "turns" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: optRow, children: [
8432
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optLabel }),
8433
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7853
8434
  "input",
7854
8435
  {
7855
8436
  "aria-label": "\u4E0A\u4E0B\u6587\u56DE\u5408\u6570",
@@ -7865,9 +8446,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7865
8446
  style: optSlider
7866
8447
  }
7867
8448
  ),
7868
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optNumber, children: settings.optimizerTurns === 0 ? "\u4E0D\u5E26" : `${String(settings.optimizerTurns)} \u8F6E` })
8449
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optNumber, children: settings.optimizerTurns === 0 ? "\u4E0D\u5E26" : `${String(settings.optimizerTurns)} \u8F6E` })
7869
8450
  ] }),
7870
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8451
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7871
8452
  Toggle,
7872
8453
  {
7873
8454
  label: "\u53EA\u8BFB\u5DE5\u5177",
@@ -7876,7 +8457,7 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7876
8457
  onToggle: actions.setReadTools
7877
8458
  }
7878
8459
  ),
7879
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8460
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7880
8461
  Toggle,
7881
8462
  {
7882
8463
  label: "\u5185\u7F6E Bash",
@@ -7885,9 +8466,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7885
8466
  onToggle: actions.setBash
7886
8467
  }
7887
8468
  ),
7888
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7889
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optLabel, title: "\u6539\u89E3\u91CA\u5C42\u300C\u4EFB\u52A1\u4E0E\u98CE\u683C\u300D\u90A3\u4E00\u6BB5\u63D0\u793A\u8BCD\uFF1B\u8F93\u51FA\u5951\u7EA6\u7531\u63D2\u4EF6\u8FFD\u52A0\uFF0C\u6539\u4E0D\u6389", children: "\u8BE6\u60C5" }),
7890
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8469
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: optRow, children: [
8470
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optLabel, title: "\u6539\u89E3\u91CA\u5C42\u300C\u4EFB\u52A1\u4E0E\u98CE\u683C\u300D\u90A3\u4E00\u6BB5\u63D0\u793A\u8BCD\uFF1B\u8F93\u51FA\u5951\u7EA6\u7531\u63D2\u4EF6\u8FFD\u52A0\uFF0C\u6539\u4E0D\u6389", children: "\u8BE6\u60C5" }),
8471
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7891
8472
  "button",
7892
8473
  {
7893
8474
  type: "button",
@@ -7904,9 +8485,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7904
8485
  }
7905
8486
  )
7906
8487
  ] }),
7907
- detailOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7908
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optHint, children: "\u6539\u7684\u662F**\u8FD9\u4E00\u6863**\u7684\u300C\u4EFB\u52A1\u4E0E\u98CE\u683C\u300D\u6BB5\uFF1B\u7559\u7A7A = \u7528\u5185\u7F6E\u90A3\u4EFD\u3002\u8F93\u51FA\u5951\u7EA6\uFF08\u516D\u7C7B\u6761\u76EE\u4E0E\u5FC5\u586B\u4F9D\u636E\uFF09\u7531\u63D2\u4EF6\u8FFD\u52A0\uFF0C\u6539\u4E0D\u6389 \u2014\u2014 \u5B83\u6B63\u662F\u5BBF\u4E3B\u9010\u6761\u6821\u9A8C\u5F15\u6587\u7684\u4F9D\u636E\u3002" }),
7909
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8488
+ detailOpen && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
8489
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optHint, children: "\u6539\u7684\u662F**\u8FD9\u4E00\u6863**\u7684\u300C\u4EFB\u52A1\u4E0E\u98CE\u683C\u300D\u6BB5\uFF1B\u7559\u7A7A = \u7528\u5185\u7F6E\u90A3\u4EFD\u3002\u8F93\u51FA\u5951\u7EA6\uFF08\u516D\u7C7B\u6761\u76EE\u4E0E\u5FC5\u586B\u4F9D\u636E\uFF09\u7531\u63D2\u4EF6\u8FFD\u52A0\uFF0C\u6539\u4E0D\u6389 \u2014\u2014 \u5B83\u6B63\u662F\u5BBF\u4E3B\u9010\u6761\u6821\u9A8C\u5F15\u6587\u7684\u4F9D\u636E\u3002" }),
8490
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7910
8491
  "textarea",
7911
8492
  {
7912
8493
  "aria-label": "\u81EA\u5B9A\u4E49\u63D0\u793A\u8BCD",
@@ -7920,9 +8501,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7920
8501
  spellCheck: false
7921
8502
  }
7922
8503
  ),
7923
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7924
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optLabel }),
7925
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8504
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: optRow, children: [
8505
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: optLabel }),
8506
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7926
8507
  "button",
7927
8508
  {
7928
8509
  type: "button",
@@ -7945,12 +8526,12 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7945
8526
  }
7946
8527
 
7947
8528
  // src/client/optimize-clock.ts
7948
- var import_react16 = require("react");
8529
+ var import_react17 = require("react");
7949
8530
  var TICK_MS2 = 1e3;
7950
8531
  function useOptimizeElapsed(startedAt) {
7951
8532
  const running = startedAt > 0;
7952
- const [seconds, setSeconds] = (0, import_react16.useState)(() => elapsedSeconds(startedAt, Date.now()));
7953
- (0, import_react16.useEffect)(() => {
8533
+ const [seconds, setSeconds] = (0, import_react17.useState)(() => elapsedSeconds(startedAt, Date.now()));
8534
+ (0, import_react17.useEffect)(() => {
7954
8535
  setSeconds(elapsedSeconds(startedAt, Date.now()));
7955
8536
  if (!running) return void 0;
7956
8537
  const timer = setInterval(() => {
@@ -7978,7 +8559,7 @@ function sectionForDock(dockPresent, current) {
7978
8559
  }
7979
8560
 
7980
8561
  // src/client/OptimizeDock.tsx
7981
- var import_react17 = require("react");
8562
+ var import_react18 = require("react");
7982
8563
 
7983
8564
  // src/client/optimize-dock.ts
7984
8565
  function dockReducer(state2, event) {
@@ -8145,7 +8726,7 @@ function sanitizeDockSnapshot(raw) {
8145
8726
  }
8146
8727
 
8147
8728
  // src/client/OptimizeDock.tsx
8148
- var import_jsx_runtime16 = require("react/jsx-runtime");
8729
+ var import_jsx_runtime17 = require("react/jsx-runtime");
8149
8730
  var KIND_LABEL = {
8150
8731
  // 0.14.0(上游本体)六类
8151
8732
  user_requirement: "\u4F60\u8981\u7684",
@@ -8186,8 +8767,8 @@ async function copyText(text) {
8186
8767
  }
8187
8768
  }
8188
8769
  function OptimizeDock({ state: state2, seconds, actions }) {
8189
- const [copied, setCopied] = (0, import_react17.useState)(false);
8190
- const [discardArmed, setDiscardArmed] = (0, import_react17.useState)(false);
8770
+ const [copied, setCopied] = (0, import_react18.useState)(false);
8771
+ const [discardArmed, setDiscardArmed] = (0, import_react18.useState)(false);
8191
8772
  const running = state2.phase === "running";
8192
8773
  const hasText = state2.text.trim() !== "";
8193
8774
  const canInsert = state2.phase === "done" && hasText;
@@ -8200,11 +8781,11 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8200
8781
  }, 1500);
8201
8782
  });
8202
8783
  };
8203
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: dockBox, role: "group", "aria-label": "\u4F18\u5316\u7ED3\u679C", children: [
8204
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: dockHead, children: [
8205
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: dockPhase, role: "status", children: dockPhaseText(state2) }),
8206
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: dockMeta, children: running ? `\u5DF2\u7B49\u5F85 ${String(seconds)}s` : state2.elapsedMs > 0 ? `\u7528\u65F6 ${(state2.elapsedMs / 1e3).toFixed(1)} \u79D2` : "" }),
8207
- !running && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8784
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: dockBox, role: "group", "aria-label": "\u4F18\u5316\u7ED3\u679C", children: [
8785
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: dockHead, children: [
8786
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: dockPhase, role: "status", children: dockPhaseText(state2) }),
8787
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: dockMeta, children: running ? `\u5DF2\u7B49\u5F85 ${String(seconds)}s` : state2.elapsedMs > 0 ? `\u7528\u65F6 ${(state2.elapsedMs / 1e3).toFixed(1)} \u79D2` : "" }),
8788
+ !running && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8208
8789
  "button",
8209
8790
  {
8210
8791
  type: "button",
@@ -8227,7 +8808,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8227
8808
  children: discardArmed ? "\u70B9\u7B2C\u4E8C\u6B21\u4E22\u5F03" : "\u4E22\u5F03"
8228
8809
  }
8229
8810
  ),
8230
- running ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8811
+ running ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8231
8812
  "button",
8232
8813
  {
8233
8814
  type: "button",
@@ -8239,7 +8820,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8239
8820
  onClick: actions.cancel,
8240
8821
  children: "\u53D6\u6D88"
8241
8822
  }
8242
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8823
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8243
8824
  "button",
8244
8825
  {
8245
8826
  type: "button",
@@ -8254,15 +8835,15 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8254
8835
  }
8255
8836
  )
8256
8837
  ] }),
8257
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: dockBody, children: [
8258
- state2.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ol", { style: dockList, children: state2.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("li", { style: dockItemRow, children: [
8259
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: dockKind, children: KIND_LABEL[item.kind] ?? item.kind }),
8260
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: dockItemText, children: item.text }),
8261
- item.quote !== "" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: dockMeta, children: item.quoteSource === "none" ? `\uFF08\u6A21\u578B\u81EA\u5DF1\u8865\u7684\uFF0C\u4F9D\u636E\u4E0D\u662F\u4F60\u539F\u8BDD\uFF1A\u300C${item.quote}\u300D\uFF09` : `\uFF08\u4F9D\u636E\uFF1A"${item.quote}"\uFF09` })
8838
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: dockBody, children: [
8839
+ state2.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ol", { style: dockList, children: state2.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { style: dockItemRow, children: [
8840
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: dockKind, children: KIND_LABEL[item.kind] ?? item.kind }),
8841
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: dockItemText, children: item.text }),
8842
+ item.quote !== "" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: dockMeta, children: item.quoteSource === "none" ? `\uFF08\u6A21\u578B\u81EA\u5DF1\u8865\u7684\uFF0C\u4F9D\u636E\u4E0D\u662F\u4F60\u539F\u8BDD\uFF1A\u300C${item.quote}\u300D\uFF09` : `\uFF08\u4F9D\u636E\uFF1A"${item.quote}"\uFF09` })
8262
8843
  ] }, item.id)) }),
8263
- state2.dropped.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: dockDropped, children: `\u4E22\u5F03 ${String(state2.dropped.length)} \u6761\uFF1A${state2.dropped.map((row2) => row2.reason).join("\uFF1B")}` }),
8264
- state2.phase === "error" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: dockError, role: "alert", children: state2.error === "" ? "\u4F18\u5316\u5931\u8D25" : state2.error }),
8265
- (state2.phase === "done" || state2.phase === "cancelled") && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8844
+ state2.dropped.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: dockDropped, children: `\u4E22\u5F03 ${String(state2.dropped.length)} \u6761\uFF1A${state2.dropped.map((row2) => row2.reason).join("\uFF1B")}` }),
8845
+ state2.phase === "error" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: dockError, role: "alert", children: state2.error === "" ? "\u4F18\u5316\u5931\u8D25" : state2.error }),
8846
+ (state2.phase === "done" || state2.phase === "cancelled") && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8266
8847
  "textarea",
8267
8848
  {
8268
8849
  value: state2.text,
@@ -8275,10 +8856,10 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8275
8856
  style: dockEditor
8276
8857
  }
8277
8858
  ),
8278
- state2.phase === "done" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: dockSummaryLine, children: state2.route === "" ? dockSummary(state2) : `${dockSummary(state2)} \xB7 ${state2.route}` })
8859
+ state2.phase === "done" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: dockSummaryLine, children: state2.route === "" ? dockSummary(state2) : `${dockSummary(state2)} \xB7 ${state2.route}` })
8279
8860
  ] }),
8280
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { ...dockButtons, ...dockButtonsPinned }, children: [
8281
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8861
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { ...dockButtons, ...dockButtonsPinned }, children: [
8862
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8282
8863
  "button",
8283
8864
  {
8284
8865
  type: "button",
@@ -8292,7 +8873,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8292
8873
  children: "\u63D2\u5165\u8F93\u5165\u6846"
8293
8874
  }
8294
8875
  ),
8295
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8876
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8296
8877
  "button",
8297
8878
  {
8298
8879
  type: "button",
@@ -8306,7 +8887,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8306
8887
  children: "\u91CD\u65B0\u4F18\u5316"
8307
8888
  }
8308
8889
  ),
8309
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8890
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8310
8891
  "button",
8311
8892
  {
8312
8893
  type: "button",
@@ -8325,7 +8906,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8325
8906
  }
8326
8907
 
8327
8908
  // src/client/QuickCommandsPanel.tsx
8328
- var import_jsx_runtime17 = require("react/jsx-runtime");
8909
+ var import_jsx_runtime18 = require("react/jsx-runtime");
8329
8910
  var MARGIN = 8;
8330
8911
  var GAP = 8;
8331
8912
  function QuickCommandsPanel({
@@ -8349,11 +8930,11 @@ function QuickCommandsPanel({
8349
8930
  const status = useBookStatus((item) => item);
8350
8931
  const dock = useDock((item) => item);
8351
8932
  const dockHidden = useDockHidden((item) => item);
8352
- const ref = (0, import_react18.useRef)(null);
8353
- const [position, setPosition] = (0, import_react18.useState)(null);
8354
- const [activeId, setActiveId] = (0, import_react18.useState)("");
8355
- const [section, setSection] = (0, import_react18.useState)(DEFAULT_PANEL_SECTION);
8356
- const [optionsOpen, setOptionsOpen] = (0, import_react18.useState)(OPTIONS_FOLD_DEFAULT_OPEN);
8933
+ const ref = (0, import_react19.useRef)(null);
8934
+ const [position, setPosition] = (0, import_react19.useState)(null);
8935
+ const [activeId, setActiveId] = (0, import_react19.useState)("");
8936
+ const [section, setSection] = (0, import_react19.useState)(DEFAULT_PANEL_SECTION);
8937
+ const [optionsOpen, setOptionsOpen] = (0, import_react19.useState)(OPTIONS_FOLD_DEFAULT_OPEN);
8357
8938
  const dockPresent = dock !== null;
8358
8939
  const tierOff = settings.optimizerTier === "off";
8359
8940
  const seconds = useOptimizeElapsed(busy ? startedAt : 0);
@@ -8362,7 +8943,7 @@ function QuickCommandsPanel({
8362
8943
  const counts = bookCounts(book);
8363
8944
  const categories = book.categories;
8364
8945
  const active2 = categories.find((category) => category.id === activeId) ?? categories[0];
8365
- (0, import_react18.useLayoutEffect)(() => {
8946
+ (0, import_react19.useLayoutEffect)(() => {
8366
8947
  if (anchor === null) {
8367
8948
  setPosition(null);
8368
8949
  return;
@@ -8375,7 +8956,7 @@ function QuickCommandsPanel({
8375
8956
  const top = above >= MARGIN ? above : Math.min(anchor.bottom + GAP, window.innerHeight - height - MARGIN);
8376
8957
  setPosition({ left, top: Math.max(MARGIN, top) });
8377
8958
  }, [anchor?.left, anchor?.bottom, counts.prompts, categories.length, busy, section, dock !== null]);
8378
- (0, import_react18.useEffect)(() => {
8959
+ (0, import_react19.useEffect)(() => {
8379
8960
  if (anchor === null) return;
8380
8961
  const onPointerDown = (event) => {
8381
8962
  if (ref.current !== null && event.target instanceof Node && ref.current.contains(event.target)) return;
@@ -8403,8 +8984,8 @@ function QuickCommandsPanel({
8403
8984
  }, [anchor === null, actions, dockRunning]);
8404
8985
  const panelOpen = anchor !== null;
8405
8986
  const dockVisible = dockPresent && !dockHidden;
8406
- const prevOpen = (0, import_react18.useRef)(false);
8407
- const prevDockVisible = (0, import_react18.useRef)(false);
8987
+ const prevOpen = (0, import_react19.useRef)(false);
8988
+ const prevDockVisible = (0, import_react19.useRef)(false);
8408
8989
  if (prevOpen.current !== panelOpen) {
8409
8990
  prevOpen.current = panelOpen;
8410
8991
  if (panelOpen) {
@@ -8423,7 +9004,7 @@ function QuickCommandsPanel({
8423
9004
  const tier = settings.optimizerTier;
8424
9005
  const items = active2?.prompts ?? [];
8425
9006
  const failure = status !== "" && status !== "saving" ? status : "";
8426
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9007
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8427
9008
  "div",
8428
9009
  {
8429
9010
  ref,
@@ -8431,10 +9012,10 @@ function QuickCommandsPanel({
8431
9012
  "aria-label": "\u5FEB\u6377\u6307\u4EE4",
8432
9013
  style: { ...quickPanel, left: position?.left ?? anchor.left, top: position?.top ?? anchor.bottom },
8433
9014
  children: [
8434
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickPanelHead, children: [
8435
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickPanelTitleRow, children: [
8436
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: quickPanelTitle, children: "\u5FEB\u6377\u6307\u4EE4" }),
8437
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: quickTierRow, role: "group", "aria-label": "\u4F18\u5316\u5F3A\u5EA6", children: OPTIMIZER_TIERS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9015
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: quickPanelHead, children: [
9016
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: quickPanelTitleRow, children: [
9017
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: quickPanelTitle, children: "\u5FEB\u6377\u6307\u4EE4" }),
9018
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: quickTierRow, role: "group", "aria-label": "\u4F18\u5316\u5F3A\u5EA6", children: OPTIMIZER_TIERS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8438
9019
  "button",
8439
9020
  {
8440
9021
  type: "button",
@@ -8452,7 +9033,7 @@ function QuickCommandsPanel({
8452
9033
  item.id
8453
9034
  )) })
8454
9035
  ] }),
8455
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9036
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8456
9037
  "button",
8457
9038
  {
8458
9039
  type: "button",
@@ -8467,13 +9048,13 @@ function QuickCommandsPanel({
8467
9048
  if (section !== "optimize") setSection("optimize");
8468
9049
  },
8469
9050
  children: [
8470
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, children: "\u2728" }),
8471
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: tierOff ? "\u4F18\u5316\u5DF2\u5173\u95ED" : busy ? `\u4F18\u5316\u4E2D\u2026\uFF08${String(seconds)}s\uFF09` : "\u4F18\u5316\u63D0\u793A\u8BCD" })
9051
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { "aria-hidden": true, children: "\u2728" }),
9052
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: tierOff ? "\u4F18\u5316\u5DF2\u5173\u95ED" : busy ? `\u4F18\u5316\u4E2D\u2026\uFF08${String(seconds)}s\uFF09` : "\u4F18\u5316\u63D0\u793A\u8BCD" })
8472
9053
  ]
8473
9054
  }
8474
9055
  )
8475
9056
  ] }),
8476
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9057
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8477
9058
  "button",
8478
9059
  {
8479
9060
  type: "button",
@@ -8489,14 +9070,14 @@ function QuickCommandsPanel({
8489
9070
  setSection(next);
8490
9071
  },
8491
9072
  children: [
8492
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: quickSectionToggleArrow, "aria-hidden": true, children: section === "optimize" ? "\u25BE" : "\u25B8" }),
8493
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "\u4F18\u5316\u63D0\u793A\u8BCD" }),
8494
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { marginLeft: "auto", color: "var(--dsw-alias-label-tertiary)" }, children: section === "optimize" ? "\u70B9\u6B64\u56DE\u5230\u5FEB\u6377\u6307\u4EE4" : dockPresent ? "\u4E0A\u6B21\u7684\u7ED3\u679C\u5728\u8FD9\u513F" : "\u8FD8\u6CA1\u6709\u7ED3\u679C" })
9073
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: quickSectionToggleArrow, "aria-hidden": true, children: section === "optimize" ? "\u25BE" : "\u25B8" }),
9074
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "\u4F18\u5316\u63D0\u793A\u8BCD" }),
9075
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: { marginLeft: "auto", color: "var(--dsw-alias-label-tertiary)" }, children: section === "optimize" ? "\u70B9\u6B64\u56DE\u5230\u5FEB\u6377\u6307\u4EE4" : dockPresent ? "\u4E0A\u6B21\u7684\u7ED3\u679C\u5728\u8FD9\u513F" : "\u8FD8\u6CA1\u6709\u7ED3\u679C" })
8495
9076
  ]
8496
9077
  }
8497
9078
  ),
8498
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickSectionBody, children: [
8499
- section === "optimize" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9079
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: quickSectionBody, children: [
9080
+ section === "optimize" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8500
9081
  OptimizeOptionsCard,
8501
9082
  {
8502
9083
  settings,
@@ -8533,7 +9114,7 @@ function QuickCommandsPanel({
8533
9114
  }
8534
9115
  }
8535
9116
  ),
8536
- dock !== null && section === "optimize" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { padding: "8px 12px 8px", flex: "1 1 auto", minHeight: 0, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9117
+ dock !== null && section === "optimize" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { padding: "8px 12px 8px", flex: "1 1 auto", minHeight: 0, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8537
9118
  OptimizeDock,
8538
9119
  {
8539
9120
  state: dock,
@@ -8555,16 +9136,16 @@ function QuickCommandsPanel({
8555
9136
  }
8556
9137
  }
8557
9138
  ) }),
8558
- section === "optimize" && dock === null && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickEmpty, children: [
9139
+ section === "optimize" && dock === null && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: quickEmpty, children: [
8559
9140
  "\u8FD8\u6CA1\u8DD1\u8FC7\u4F18\u5316\u3002",
8560
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
9141
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
8561
9142
  "\u70B9\u4E0A\u9762\u7684\u300C\u2728 \u4F18\u5316\u63D0\u793A\u8BCD\u300D\u628A\u8F93\u5165\u6846\u91CC\u7684\u8BDD\u4EA4\u7ED9\u53E6\u4E00\u4E2A AI \u6574\u7406\u6210\u4E00\u6761\u80FD\u76F4\u63A5\u53D1\u7684\u6E05\u6670\u6307\u4EE4 \u2014\u2014 \u7ED3\u679C\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\uFF08\u53EF\u7F16\u8F91\u3001\u53EF\u63D2\u5165\u8F93\u5165\u6846\u3001\u53EF\u590D\u5236\uFF09\u3002",
8562
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
9143
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
8563
9144
  "\u5F3A\u5EA6\u7528\u6807\u9898\u884C\u90A3\u4E09\u4E2A\u6863\u4F4D\uFF08\u666E\u901A / \u9AD8\u7EA7 / \u6781\u7AEF\uFF09\u3002"
8564
9145
  ] }),
8565
- section === "quick" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
8566
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { padding: "8px 12px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickCategoryRow, children: [
8567
- categories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9146
+ section === "quick" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
9147
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { padding: "8px 12px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: quickCategoryRow, children: [
9148
+ categories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8568
9149
  "button",
8569
9150
  {
8570
9151
  type: "button",
@@ -8581,7 +9162,7 @@ function QuickCommandsPanel({
8581
9162
  },
8582
9163
  category.id
8583
9164
  )),
8584
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9165
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8585
9166
  "button",
8586
9167
  {
8587
9168
  type: "button",
@@ -8598,14 +9179,14 @@ function QuickCommandsPanel({
8598
9179
  }
8599
9180
  )
8600
9181
  ] }) }),
8601
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickList, children: [
8602
- items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickEmpty, children: [
9182
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: quickList, children: [
9183
+ items.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: quickEmpty, children: [
8603
9184
  "\u8FD9\u4E2A\u5206\u7C7B\u91CC\u8FD8\u6CA1\u6709\u6761\u76EE\u3002",
8604
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
9185
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
8605
9186
  "\u5728\u300C\u8BBE\u7F6E \u2192 \u8F93\u5165\u4F53\u9A8C \u2192 \u5FEB\u6377\u6307\u4EE4\u6E05\u5355\u300D\u91CC\u6DFB\u52A0\u3002"
8606
9187
  ] }),
8607
- items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
8608
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9188
+ items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
9189
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8609
9190
  "button",
8610
9191
  {
8611
9192
  type: "button",
@@ -8618,12 +9199,12 @@ function QuickCommandsPanel({
8618
9199
  actions.insert(item.prompt);
8619
9200
  },
8620
9201
  children: [
8621
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: quickItemLabel, children: item.label }),
8622
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: quickItemPreview, children: item.prompt.replace(/\s+/g, " ") })
9202
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: quickItemLabel, children: item.label }),
9203
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: quickItemPreview, children: item.prompt.replace(/\s+/g, " ") })
8623
9204
  ]
8624
9205
  }
8625
9206
  ),
8626
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9207
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8627
9208
  InsertModeControl,
8628
9209
  {
8629
9210
  compact: true,
@@ -8635,7 +9216,7 @@ function QuickCommandsPanel({
8635
9216
  }
8636
9217
  )
8637
9218
  ] }, item.id)),
8638
- active2 !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9219
+ active2 !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8639
9220
  AddPromptRow,
8640
9221
  {
8641
9222
  variant: "panel",
@@ -8652,9 +9233,9 @@ function QuickCommandsPanel({
8652
9233
  ] })
8653
9234
  ] })
8654
9235
  ] }),
8655
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickPanelFoot, children: [
8656
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: quickNotice, role: "status", children: notice !== "" ? notice : failure }),
8657
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9236
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: quickPanelFoot, children: [
9237
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { style: quickNotice, role: "status", children: notice !== "" ? notice : failure }),
9238
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8658
9239
  "span",
8659
9240
  {
8660
9241
  style: quickFootHint,
@@ -8787,26 +9368,26 @@ function createDirectoryFlowController(options) {
8787
9368
  }
8788
9369
 
8789
9370
  // src/client/DirectoryFlowEntry.tsx
8790
- var import_react19 = require("react");
9371
+ var import_react20 = require("react");
8791
9372
  function DirectoryFlowEntry(props) {
8792
9373
  const { open, pick } = props;
8793
- const alive = (0, import_react19.useRef)(true);
8794
- const latest = (0, import_react19.useRef)(props);
9374
+ const alive = (0, import_react20.useRef)(true);
9375
+ const latest = (0, import_react20.useRef)(props);
8795
9376
  latest.current = props;
8796
- const flow = (0, import_react19.useMemo)(() => createPickFlow({
9377
+ const flow = (0, import_react20.useMemo)(() => createPickFlow({
8797
9378
  pick,
8798
9379
  report: (outcome) => {
8799
9380
  applyOutcome(latest.current, outcome);
8800
9381
  },
8801
9382
  isAlive: () => alive.current
8802
9383
  }), [pick]);
8803
- (0, import_react19.useEffect)(() => {
9384
+ (0, import_react20.useEffect)(() => {
8804
9385
  alive.current = true;
8805
9386
  return () => {
8806
9387
  alive.current = false;
8807
9388
  };
8808
9389
  }, []);
8809
- (0, import_react19.useEffect)(() => {
9390
+ (0, import_react20.useEffect)(() => {
8810
9391
  flow.setOpen(open);
8811
9392
  }, [flow, open]);
8812
9393
  return null;