dsh-composer-ux 0.24.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";
@@ -1281,6 +1282,7 @@ var HEADER_ROUTES_FIELD = "headerRoutes";
1281
1282
  var HEADER_APPLIED_NAME_FIELD = "headerAppliedName";
1282
1283
  var HEADER_APPLIED_VALUE_FIELD = "headerAppliedValue";
1283
1284
  var HEADER_STATUS_FIELD = "headerStatus";
1285
+ var NATIVE_STATUS_PREFIX = "\u5BBF\u4E3B\u5DF2\u539F\u751F\u652F\u6301";
1284
1286
  var DEFAULT_HEADER_NAME = "x-opencode-session";
1285
1287
  var HEADER_VALUE_MAX = 200;
1286
1288
  var HEADER_NAME_MAX = 64;
@@ -2391,17 +2393,58 @@ function clampPanelHeight(height) {
2391
2393
 
2392
2394
  // src/client/settings-style.ts
2393
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 */
2394
2401
  .dsh-ux-card {
2395
2402
  border: 1px solid var(--dsw-alias-border-l2);
2396
2403
  background: var(--dsw-alias-bg-layer-3);
2397
2404
  border-radius: 12px;
2398
2405
  margin-bottom: 12px;
2399
- transition: border-color .16s, background .16s;
2406
+ transition: border-color .16s, background-color .16s;
2400
2407
  }
2401
2408
  .dsh-ux-card:hover { border-color: var(--dsw-alias-label-dimmed); }
2402
- .dsh-ux-cardOpen {
2403
- background: var(--dsw-alias-bg-layer-2);
2404
- 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;
2405
2448
  }
2406
2449
  .dsh-ux-cardHeader {
2407
2450
  appearance: none;
@@ -2417,21 +2460,46 @@ var CARD_CSS = `
2417
2460
  border-radius: 12px;
2418
2461
  display: flex;
2419
2462
  align-items: center;
2420
- gap: 12px;
2421
- padding: 14px 16px;
2463
+ gap: 10px;
2464
+ padding: 12px 14px;
2422
2465
  }
2423
2466
  .dsh-ux-cardHeader:focus-visible {
2424
2467
  outline: 2px solid var(--dsw-alias-brand-primary);
2425
2468
  outline-offset: -2px;
2426
2469
  }
2427
- /* \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
2428
- \u4E0D\u80FD\u5728 <button> \u91CC\u585E\u6309\u94AE\uFF0C\u6240\u4EE5\u4E24\u8005\u662F\u5144\u5F1F\u8282\u70B9\u3002 */
2429
- .dsh-ux-cardHeaderRow {
2470
+ .dsh-ux-cardHeaderStatic {
2471
+ box-sizing: border-box;
2430
2472
  display: flex;
2431
- align-items: center;
2473
+ align-items: flex-start;
2432
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;
2433
2488
  gap: 6px;
2434
- 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;
2435
2503
  }
2436
2504
  .dsh-ux-cardControls {
2437
2505
  align-items: center;
@@ -2440,7 +2508,7 @@ var CARD_CSS = `
2440
2508
  flex-wrap: wrap;
2441
2509
  gap: 8px;
2442
2510
  }
2443
- /* \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 */
2444
2512
  .dsh-ux-miniToggle {
2445
2513
  align-items: center;
2446
2514
  color: var(--dsw-alias-label-secondary);
@@ -2450,36 +2518,188 @@ var CARD_CSS = `
2450
2518
  gap: 5px;
2451
2519
  white-space: nowrap;
2452
2520
  }
2453
- /* \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 */
2454
- .dsh-ux-cardOff { border-style: dashed; }
2455
- .dsh-ux-cardOff .dsh-ux-cardBody { opacity: .6; }
2456
- .dsh-ux-cardHeaderStatic {
2457
- box-sizing: border-box;
2458
- 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 {
2459
2545
  align-items: center;
2546
+ border-top: 1px solid var(--dsw-alias-border-l2);
2547
+ display: flex;
2460
2548
  gap: 12px;
2461
- padding: 14px 16px;
2549
+ padding: 10px 0;
2462
2550
  }
2463
- .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);
2464
2557
  display: flex;
2465
- flex-direction: column;
2466
- flex: 1;
2467
- gap: 4px;
2468
- min-width: 0;
2558
+ font-size: 12.5px;
2559
+ gap: 6px;
2560
+ line-height: 1.45;
2469
2561
  }
2470
- .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);
2471
2607
  color: var(--dsw-alias-label-primary);
2472
- font-size: 15px;
2473
2608
  font-weight: 600;
2474
- line-height: 1.4;
2475
- margin: 0;
2476
2609
  }
2477
- .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;
2478
2680
  color: var(--dsw-alias-label-secondary);
2479
- font-size: 13px;
2480
- line-height: 1.5;
2481
- 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;
2482
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 */
2483
2703
  .dsh-ux-cardLink {
2484
2704
  align-items: center;
2485
2705
  color: var(--dsw-alias-label-secondary);
@@ -2494,12 +2714,13 @@ var CARD_CSS = `
2494
2714
  color: var(--dsw-alias-brand-primary);
2495
2715
  text-decoration: underline;
2496
2716
  }
2497
- /* \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 */
2498
2718
  .dsh-ux-cardActions {
2499
2719
  align-items: center;
2500
2720
  display: inline-flex;
2501
2721
  flex: none;
2502
- gap: 10px;
2722
+ flex-wrap: wrap;
2723
+ gap: 8px;
2503
2724
  }
2504
2725
  .dsh-ux-restartButton {
2505
2726
  appearance: none;
@@ -2583,17 +2804,6 @@ var CARD_CSS = `
2583
2804
  border-color: var(--dsw-alias-label-dimmed);
2584
2805
  color: var(--dsw-alias-label-primary);
2585
2806
  }
2586
- .dsh-ux-cardChevron {
2587
- color: var(--dsw-alias-label-tertiary);
2588
- flex: none;
2589
- transition: transform .16s;
2590
- }
2591
- .dsh-ux-cardChevronOpen { transform: rotate(180deg); }
2592
- .dsh-ux-cardBody {
2593
- border-top: 1px solid var(--dsw-alias-border-l2);
2594
- margin: 0 16px;
2595
- padding-bottom: 8px;
2596
- }
2597
2807
  `;
2598
2808
  function installSettingsCardStyle() {
2599
2809
  const tag = document.createElement("style");
@@ -2663,8 +2873,8 @@ var row = {
2663
2873
  justifyContent: "space-between",
2664
2874
  gap: 12,
2665
2875
  minHeight: 40,
2666
- padding: "7px 0",
2667
- borderTop: "0.5px solid var(--dsw-alias-border-l2)"
2876
+ padding: "10px 0",
2877
+ borderTop: "1px solid var(--dsw-alias-border-l2)"
2668
2878
  };
2669
2879
  var rowText = {
2670
2880
  minWidth: 0,
@@ -2672,13 +2882,13 @@ var rowText = {
2672
2882
  };
2673
2883
  var rowTitle = {
2674
2884
  color: "var(--dsw-alias-label-primary)",
2675
- fontSize: 13,
2676
- lineHeight: 1.4
2885
+ fontSize: 12.5,
2886
+ lineHeight: 1.45
2677
2887
  };
2678
2888
  var rowDesc = {
2679
2889
  color: "var(--dsw-alias-label-tertiary)",
2680
- fontSize: 11,
2681
- lineHeight: 1.4,
2890
+ fontSize: 11.5,
2891
+ lineHeight: 1.55,
2682
2892
  marginTop: 2
2683
2893
  };
2684
2894
  var kbd = {
@@ -4006,7 +4216,7 @@ function RestartTitlebarButton() {
4006
4216
  }
4007
4217
 
4008
4218
  // src/client/SettingsSection.tsx
4009
- var import_react9 = require("react");
4219
+ var import_react10 = require("react");
4010
4220
 
4011
4221
  // src/client/DoctorCard.tsx
4012
4222
  var import_react4 = require("react");
@@ -4058,7 +4268,11 @@ function DoctorCard() {
4058
4268
  });
4059
4269
  }, []);
4060
4270
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
4061
- /* @__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
+ ] }),
4062
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)(
4063
4277
  "button",
4064
4278
  {
@@ -4097,7 +4311,13 @@ function AutostartCard(props) {
4097
4311
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: "\u5F53\u524D\u8FD9\u4E2A\u8FD0\u884C\u65F6" }),
4098
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",
4099
4313
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("br", {}),
4100
- /* @__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
+ ] })
4101
4321
  ] }),
4102
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: [
4103
4323
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
@@ -4412,6 +4632,19 @@ function AddPromptRow({
4412
4632
  // src/client/CostCard.tsx
4413
4633
  var import_react8 = __toESM(require("react"), 1);
4414
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
+
4415
4648
  // src/client/money-admin.ts
4416
4649
  var import_react7 = __toESM(require("react"), 1);
4417
4650
 
@@ -4531,6 +4764,74 @@ function aliasNote(model) {
4531
4764
  function stampText(value) {
4532
4765
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? new Date(value).toLocaleString("zh-CN") : "\u4ECE\u6CA1\u540C\u6B65\u8FC7";
4533
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
+ }
4534
4835
  function CostCardBody(props) {
4535
4836
  const { settings, setField, clearField } = props;
4536
4837
  const [table, setTable] = import_react8.default.useState(settings.priceOverrides);
@@ -4671,7 +4972,37 @@ function CostCardBody(props) {
4671
4972
  const synced = settings.syncedPrices;
4672
4973
  const alert = settings.peakAlert;
4673
4974
  const holidayInfo = effectiveHolidays(settings.peakHolidays, synced?.holidays);
4975
+ const quota = usePlanQuota();
4674
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,
4675
5006
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { style: hintInfo, children: [
4676
5007
  "\u8FD9\u91CC\u6539\u7684",
4677
5008
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("strong", { children: "\u53EA\u662F\u672C\u63D2\u4EF6\u663E\u793A\u7684\u8D39\u7528\u4F30\u7B97" }),
@@ -5420,70 +5751,279 @@ function statsLineEnabled(settings) {
5420
5751
  return activeSections(settings).stats;
5421
5752
  }
5422
5753
 
5423
- // src/client/SettingsSection.tsx
5754
+ // src/client/ui-kit.tsx
5755
+ var import_react9 = require("react");
5756
+ var import_react_dom2 = require("react-dom");
5424
5757
  var import_jsx_runtime11 = require("react/jsx-runtime");
5425
- var bodyLead = { ...description, margin: "12px 0" };
5426
- function Chevron() {
5427
- 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)(
5428
- "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",
5429
5783
  {
5430
- d: "M3.25 5.5L7 9.25L10.75 5.5",
5431
- stroke: "currentColor",
5432
- strokeWidth: "1.4",
5433
- strokeLinecap: "round",
5434
- 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
+ ) })
5435
5796
  }
5436
- ) });
5797
+ );
5437
5798
  }
5438
- function FoldCard(props) {
5439
- const [open, setOpen] = (0, import_react9.useState)(false);
5440
- const off = props.toggle !== void 0 && props.toggle.checked === false;
5441
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: [
5442
- "dsh-ux-card",
5443
- open ? "dsh-ux-cardOpen" : "",
5444
- off ? "dsh-ux-cardOff" : ""
5445
- ].filter((part) => part !== "").join(" "), children: [
5446
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-cardHeaderRow", children: [
5447
- /* @__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)(
5448
5930
  "button",
5449
5931
  {
5450
5932
  type: "button",
5451
- className: "dsh-ux-cardHeader",
5452
- "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
+ },
5453
5939
  onClick: () => {
5454
- setOpen((current) => !current);
5940
+ props.onChange(item.id);
5455
5941
  },
5456
- children: [
5457
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardHeadText", children: [
5458
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-cardName", children: props.name }),
5459
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-cardDescription", children: off ? `\u672A\u542F\u7528 \xB7 ${props.summary}` : props.summary })
5460
- ] }),
5461
- /* @__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, {}) })
5462
- ]
5463
- }
5464
- ),
5465
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardControls", children: [
5466
- props.controls,
5467
- props.toggle !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5468
- Switch,
5469
- {
5470
- small: true,
5471
- label: `${props.name}\uFF1A\u542F\u7528\u8FD9\u4E00\u680F`,
5472
- checked: props.toggle.checked,
5473
- disabled: props.toggle.disabled === true,
5474
- onChange: props.toggle.onChange
5475
- }
5476
- )
5477
- ] })
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 })
5478
5960
  ] }),
5479
- 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 })
5480
5968
  ] });
5481
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
+ }
5482
6022
  function KeyRow(props) {
5483
6023
  const { title, desc, value, presets, conflict, onChange, first } = props;
5484
- const [recording, setRecording] = (0, import_react9.useState)(false);
5485
- const [error, setError] = (0, import_react9.useState)(null);
5486
- (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)(() => {
5487
6027
  if (!recording) return;
5488
6028
  const onKeyDown = (event) => {
5489
6029
  event.preventDefault();
@@ -5520,49 +6060,42 @@ function KeyRow(props) {
5520
6060
  window.removeEventListener("keydown", onKeyDown, true);
5521
6061
  };
5522
6062
  }, [recording, conflict, onChange]);
5523
- const base2 = first === true ? { ...row, borderTop: "none" } : row;
5524
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...base2, flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
5525
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
5526
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: title }),
5527
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: desc })
5528
- ] }),
5529
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
5530
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: kbd, children: displayChord(value) }),
5531
- !recording && presets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5532
- "button",
5533
- {
5534
- type: "button",
5535
- style: value === preset ? pillActive : pill,
5536
- onClick: () => {
5537
- setError(null);
5538
- onChange(preset);
5539
- },
5540
- 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);
5541
6073
  },
5542
- preset
5543
- )),
5544
- !recording && value !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: () => {
5545
- setError(null);
5546
- onChange("");
5547
- }, children: "\u6E05\u9664" }),
5548
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5549
- "button",
5550
- {
5551
- type: "button",
5552
- style: recording ? pillActive : pill,
5553
- onClick: () => {
5554
- setRecording(true);
5555
- setError(null);
5556
- },
5557
- children: recording ? "\u8BF7\u6309\u4E0B\u65B0\u7EC4\u5408\u952E\u2026" : "\u81EA\u5B9A\u4E49\u2026"
5558
- }
5559
- ),
5560
- recording && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: () => {
5561
- setRecording(false);
5562
- setError(null);
5563
- }, children: "Esc \u53D6\u6D88" }),
5564
- error !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { color: "var(--dsw-alias-state-error-primary)", fontSize: 12 }, children: error })
5565
- ] })
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 })
5566
6099
  ] });
5567
6100
  }
5568
6101
  function Switch(props) {
@@ -5570,7 +6103,7 @@ function Switch(props) {
5570
6103
  const width = small ? 30 : 36;
5571
6104
  const height = small ? 16 : 20;
5572
6105
  const knob = small ? 12 : 14;
5573
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6106
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5574
6107
  "button",
5575
6108
  {
5576
6109
  type: "button",
@@ -5592,7 +6125,7 @@ function Switch(props) {
5592
6125
  flex: "0 0 auto",
5593
6126
  padding: 0
5594
6127
  },
5595
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6128
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5596
6129
  "span",
5597
6130
  {
5598
6131
  style: {
@@ -5611,80 +6144,69 @@ function Switch(props) {
5611
6144
  );
5612
6145
  }
5613
6146
  function MiniToggle(props) {
5614
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-miniToggle", children: [
5615
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-miniToggleLabel", children: props.label }),
5616
- /* @__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 })
5617
6150
  ] });
5618
6151
  }
5619
6152
  function ToggleRow(props) {
5620
6153
  const { label, desc, checked, onChange, action, first } = props;
5621
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: first === true ? { ...row, borderTop: "none" } : row, children: [
5622
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
5623
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: label }),
5624
- desc !== void 0 && desc !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: desc })
5625
- ] }),
5626
- action !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: action.onClick, children: action.label }),
5627
- /* @__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 })
5628
6157
  ] });
5629
6158
  }
5630
6159
  function TextFieldRow(props) {
5631
6160
  const { title, desc, value, placeholder, maxLength, onChange, action, first } = props;
5632
- const [draft, setDraft] = (0, import_react9.useState)(value);
5633
- const focused = (0, import_react9.useRef)(false);
5634
- (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)(() => {
5635
6164
  if (!focused.current) setDraft(value);
5636
6165
  }, [value]);
5637
6166
  const commit = () => {
5638
6167
  if (draft === value) return;
5639
6168
  onChange(draft.trim());
5640
6169
  };
5641
- const base2 = first === true ? { ...row, borderTop: "none" } : row;
5642
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...base2, flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
5643
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
5644
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: title }),
5645
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: desc })
5646
- ] }),
5647
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
5648
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5649
- "input",
5650
- {
5651
- type: "text",
5652
- value: draft,
5653
- placeholder: placeholder ?? "",
5654
- maxLength,
5655
- spellCheck: false,
5656
- autoCorrect: "off",
5657
- autoCapitalize: "off",
5658
- onFocus: () => {
5659
- focused.current = true;
5660
- },
5661
- onChange: (event) => {
5662
- setDraft(event.target.value);
5663
- },
5664
- onBlur: () => {
5665
- focused.current = false;
5666
- commit();
5667
- },
5668
- onKeyDown: (event) => {
5669
- if (event.key !== "Enter") return;
5670
- event.preventDefault();
5671
- commit();
5672
- event.currentTarget.blur();
5673
- },
5674
- style: textInput
5675
- }
5676
- ),
5677
- action !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", style: pill, onClick: action.onClick, children: action.label })
5678
- ] })
5679
- ] });
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
+ ] }) });
5680
6202
  }
5681
6203
  function QuickPromptsEditor(props) {
5682
- const [draft, setDraft] = (0, import_react9.useState)(() => props.book);
5683
- const [activeId, setActiveId] = (0, import_react9.useState)(() => props.book.categories[0]?.id ?? "");
5684
- const [dirty, setDirty] = (0, import_react9.useState)(false);
5685
- const [newName, setNewName] = (0, import_react9.useState)("");
5686
- const [note2, setNote] = (0, import_react9.useState)("");
5687
- (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)(() => {
5688
6210
  if (dirty) return;
5689
6211
  setDraft(props.book);
5690
6212
  if (!props.book.categories.some((category) => category.id === activeId)) {
@@ -5708,9 +6230,9 @@ function QuickPromptsEditor(props) {
5708
6230
  border: "0.5px solid var(--dsw-alias-border-l2)",
5709
6231
  background: "var(--dsw-alias-bg-layer-1)"
5710
6232
  };
5711
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: [
5712
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4, flexWrap: "wrap" }, children: [
5713
- 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)(
5714
6236
  "button",
5715
6237
  {
5716
6238
  type: "button",
@@ -5727,7 +6249,7 @@ function QuickPromptsEditor(props) {
5727
6249
  },
5728
6250
  category.id
5729
6251
  )),
5730
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6252
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5731
6253
  "input",
5732
6254
  {
5733
6255
  type: "text",
@@ -5741,7 +6263,7 @@ function QuickPromptsEditor(props) {
5741
6263
  style: { ...textInput, flex: "0 0 110px" }
5742
6264
  }
5743
6265
  ),
5744
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6266
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5745
6267
  "button",
5746
6268
  {
5747
6269
  type: "button",
@@ -5755,10 +6277,10 @@ function QuickPromptsEditor(props) {
5755
6277
  }
5756
6278
  )
5757
6279
  ] }),
5758
- 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" }),
5759
- current !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5760
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
5761
- /* @__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)(
5762
6284
  "input",
5763
6285
  {
5764
6286
  type: "text",
@@ -5772,13 +6294,13 @@ function QuickPromptsEditor(props) {
5772
6294
  style: { ...textInput, flex: "0 0 150px" }
5773
6295
  }
5774
6296
  ),
5775
- /* @__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: () => {
5776
6298
  edit(withCategoryMoved(draft, current.id, -1));
5777
6299
  }, children: "\u2191" }),
5778
- /* @__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: () => {
5779
6301
  edit(withCategoryMoved(draft, current.id, 1));
5780
6302
  }, children: "\u2193" }),
5781
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6303
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5782
6304
  "button",
5783
6305
  {
5784
6306
  type: "button",
@@ -5790,16 +6312,16 @@ function QuickPromptsEditor(props) {
5790
6312
  children: "\u2715 \u5220\u9664\u5206\u7C7B"
5791
6313
  }
5792
6314
  ),
5793
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: rowDesc, children: [
6315
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: rowDesc, children: [
5794
6316
  current.prompts.length,
5795
6317
  " / ",
5796
6318
  QUICK_PROMPT_MAX,
5797
6319
  " \u6761"
5798
6320
  ] })
5799
6321
  ] }),
5800
- current.prompts.map((prompt) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowBox, children: [
5801
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, flexWrap: "wrap" }, children: [
5802
- /* @__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)(
5803
6325
  "input",
5804
6326
  {
5805
6327
  type: "text",
@@ -5813,7 +6335,7 @@ function QuickPromptsEditor(props) {
5813
6335
  style: { ...textInput, flex: "0 0 150px" }
5814
6336
  }
5815
6337
  ),
5816
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6338
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5817
6339
  InsertModeControl,
5818
6340
  {
5819
6341
  label: prompt.label,
@@ -5823,18 +6345,18 @@ function QuickPromptsEditor(props) {
5823
6345
  }
5824
6346
  }
5825
6347
  ),
5826
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { flex: 1 } }),
5827
- /* @__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: () => {
5828
6350
  edit(withPromptMoved(draft, current.id, prompt.id, -1));
5829
6351
  }, children: "\u2191" }),
5830
- /* @__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: () => {
5831
6353
  edit(withPromptMoved(draft, current.id, prompt.id, 1));
5832
6354
  }, children: "\u2193" }),
5833
- /* @__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: () => {
5834
6356
  edit(withPromptRemoved(draft, current.id, prompt.id));
5835
6357
  }, children: "\u2715" })
5836
6358
  ] }),
5837
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6359
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5838
6360
  "textarea",
5839
6361
  {
5840
6362
  value: prompt.prompt,
@@ -5849,7 +6371,7 @@ function QuickPromptsEditor(props) {
5849
6371
  }
5850
6372
  )
5851
6373
  ] }, prompt.id)),
5852
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6374
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
5853
6375
  AddPromptRow,
5854
6376
  {
5855
6377
  book: draft,
@@ -5863,8 +6385,8 @@ function QuickPromptsEditor(props) {
5863
6385
  }
5864
6386
  )
5865
6387
  ] }),
5866
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
5867
- /* @__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)(
5868
6390
  "button",
5869
6391
  {
5870
6392
  type: "button",
@@ -5886,13 +6408,13 @@ function QuickPromptsEditor(props) {
5886
6408
  children: saving ? "\u4FDD\u5B58\u4E2D\u2026" : dirty ? "\u4FDD\u5B58\u4FEE\u6539" : "\u5DF2\u4FDD\u5B58"
5887
6409
  }
5888
6410
  ),
5889
- /* @__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: () => {
5890
6412
  props.onReload();
5891
6413
  }, children: "\u91CD\u65B0\u8BFB\u53D6" }),
5892
- /* @__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: () => {
5893
6415
  props.onReset();
5894
6416
  }, children: "\u6062\u590D\u5185\u7F6E 9 \u6761" }),
5895
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { style: rowDesc, children: [
6417
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { style: rowDesc, children: [
5896
6418
  "\u5171 ",
5897
6419
  counts.categories,
5898
6420
  " \u4E2A\u5206\u7C7B \xB7 ",
@@ -5906,9 +6428,9 @@ function QuickPromptsEditor(props) {
5906
6428
  failed ? ` \xB7 ${props.status}` : ""
5907
6429
  ] })
5908
6430
  ] }),
5909
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: rowDesc, children: [
6431
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: rowDesc, children: [
5910
6432
  "\u6570\u636E\u5B58\u5728 ",
5911
- /* @__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" }),
5912
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"
5913
6435
  ] })
5914
6436
  ] });
@@ -5922,11 +6444,11 @@ var candidatePill = {
5922
6444
  };
5923
6445
  function DefaultTerminalBody(props) {
5924
6446
  const { settings, setField, hideMode = false } = props;
5925
- const [note2, setNote] = (0, import_react9.useState)("");
5926
- 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);
5927
6449
  const candidates = settings.terminalCandidates;
5928
6450
  if (settings.terminalEffective === "unsupported") {
5929
- 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" });
5930
6452
  }
5931
6453
  const discover = async () => {
5932
6454
  setBusy(true);
@@ -5942,26 +6464,29 @@ function DefaultTerminalBody(props) {
5942
6464
  setBusy(false);
5943
6465
  }
5944
6466
  };
5945
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5946
- !hideMode && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...row, borderTop: "none", flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
5947
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
5948
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u7EC8\u7AEF\u5DE5\u5177" }),
5949
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: TERMINAL_MODES.find((item) => item.id === settings.terminalMode)?.hint ?? "" })
5950
- ] }),
5951
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
5952
- PillChoice,
5953
- {
5954
- items: TERMINAL_MODES,
5955
- value: settings.terminalMode,
5956
- onChange: (mode) => {
5957
- setField(TERMINAL_MODE_FIELD, mode);
5958
- },
5959
- ariaLabel: "\u7EC8\u7AEF\u5DE5\u5177"
5960
- }
5961
- )
5962
- ] }),
5963
- settings.terminalMode !== "pwsh" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
5964
- /* @__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)(
5965
6490
  TextFieldRow,
5966
6491
  {
5967
6492
  title: "Git Bash \u8DEF\u5F84",
@@ -5977,7 +6502,7 @@ function DefaultTerminalBody(props) {
5977
6502
  } }
5978
6503
  }
5979
6504
  ),
5980
- 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)(
5981
6506
  "button",
5982
6507
  {
5983
6508
  type: "button",
@@ -5995,15 +6520,15 @@ function DefaultTerminalBody(props) {
5995
6520
  },
5996
6521
  candidate.path
5997
6522
  )) }),
5998
- 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 })
5999
6524
  ] }),
6000
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
6525
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: hintInfo, children: [
6001
6526
  "\u72B6\u6001\uFF1A",
6002
6527
  settings.terminalStatus === "" ? "\u7B49\u5F85\u5BBF\u4E3B\u534A\u63A2\u6D4B\u2026" : settings.terminalStatus
6003
6528
  ] }),
6004
- /* @__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" }),
6005
- /* @__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" }),
6006
- /* @__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" })
6007
6532
  ] });
6008
6533
  }
6009
6534
  var RESTART_WAIT_MS = 6e4;
@@ -6018,9 +6543,9 @@ function blockedText(blocked) {
6018
6543
  return `\u8FD9\u4E2A\u5BBF\u4E3B\u5F53\u524D\u4E0D\u5141\u8BB8\u4ECE\u754C\u9762\u91CD\u542F\uFF08${blocked}\uFF09\u3002`;
6019
6544
  }
6020
6545
  function useRestart() {
6021
- const [stage, setStage] = (0, import_react9.useState)("idle");
6022
- const [detail2, setDetail] = (0, import_react9.useState)("");
6023
- 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);
6024
6549
  const readFacts = async () => {
6025
6550
  const response = await fetch(RESTART_API_PATH, {
6026
6551
  cache: "no-store",
@@ -6129,8 +6654,8 @@ function NotifyCard({ settings, setField }) {
6129
6654
  const on = settings.notifyEnabled;
6130
6655
  const channel = settings.notifyChannel;
6131
6656
  const kinds = settings.notifyKinds;
6132
- const [busy, setBusy] = (0, import_react9.useState)(false);
6133
- const [note2, setNote] = (0, import_react9.useState)("");
6657
+ const [busy, setBusy] = (0, import_react10.useState)(false);
6658
+ const [note2, setNote] = (0, import_react10.useState)("");
6134
6659
  const send = () => {
6135
6660
  setBusy(true);
6136
6661
  setNote("");
@@ -6146,22 +6671,24 @@ function NotifyCard({ settings, setField }) {
6146
6671
  setBusy(false);
6147
6672
  });
6148
6673
  };
6149
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
6674
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6150
6675
  FoldCard,
6151
6676
  {
6152
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",
6153
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",
6154
6680
  toggle: { checked: on, onChange: (next) => {
6155
6681
  setField(NOTIFY_ENABLED_FIELD, next);
6156
6682
  } },
6157
6683
  children: [
6158
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { margin: "10px 0", fontSize: 12, lineHeight: 1.6, opacity: 0.85 }, children: [
6159
- /* @__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" }),
6160
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",
6161
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
6162
- /* @__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' })
6163
6689
  ] }),
6164
- /* @__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)(
6165
6692
  ToggleRow,
6166
6693
  {
6167
6694
  label: "\u7528 PushPlus\uFF08\u5230\u4F60\u5173\u6CE8\u7684\u516C\u4F17\u53F7\uFF09",
@@ -6173,7 +6700,7 @@ function NotifyCard({ settings, setField }) {
6173
6700
  first: true
6174
6701
  }
6175
6702
  ),
6176
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6703
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6177
6704
  TextFieldRow,
6178
6705
  {
6179
6706
  title: "PushPlus token",
@@ -6186,7 +6713,7 @@ function NotifyCard({ settings, setField }) {
6186
6713
  }
6187
6714
  }
6188
6715
  ),
6189
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6716
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6190
6717
  ToggleRow,
6191
6718
  {
6192
6719
  label: "\u7528\u4F01\u4E1A\u5FAE\u4FE1\u7FA4\u673A\u5668\u4EBA",
@@ -6197,7 +6724,7 @@ function NotifyCard({ settings, setField }) {
6197
6724
  }
6198
6725
  }
6199
6726
  ),
6200
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6727
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6201
6728
  TextFieldRow,
6202
6729
  {
6203
6730
  title: "\u4F01\u4E1A\u5FAE\u4FE1 webhook",
@@ -6210,7 +6737,8 @@ function NotifyCard({ settings, setField }) {
6210
6737
  }
6211
6738
  }
6212
6739
  ),
6213
- /* @__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)(
6214
6742
  ToggleRow,
6215
6743
  {
6216
6744
  label: "\u9700\u8981\u4F60\u56DE\u5E94\u65F6\u901A\u77E5",
@@ -6218,10 +6746,11 @@ function NotifyCard({ settings, setField }) {
6218
6746
  checked: kinds["needs-input"],
6219
6747
  onChange: (next) => {
6220
6748
  setField(NOTIFY_KINDS_FIELD, { ...kinds, "needs-input": next });
6221
- }
6749
+ },
6750
+ first: true
6222
6751
  }
6223
6752
  ),
6224
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6753
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6225
6754
  ToggleRow,
6226
6755
  {
6227
6756
  label: "\u4EFB\u52A1\u5B8C\u6210\u65F6\u901A\u77E5",
@@ -6232,7 +6761,7 @@ function NotifyCard({ settings, setField }) {
6232
6761
  }
6233
6762
  }
6234
6763
  ),
6235
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6764
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6236
6765
  ToggleRow,
6237
6766
  {
6238
6767
  label: "\u4EFB\u52A1\u51FA\u9519\u65F6\u901A\u77E5",
@@ -6243,7 +6772,7 @@ function NotifyCard({ settings, setField }) {
6243
6772
  }
6244
6773
  }
6245
6774
  ),
6246
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6775
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6247
6776
  ToggleRow,
6248
6777
  {
6249
6778
  label: "\u6D4B\u8BD5\u63A8\u9001",
@@ -6259,18 +6788,19 @@ function NotifyCard({ settings, setField }) {
6259
6788
  );
6260
6789
  }
6261
6790
  function DirectoryPickCard() {
6262
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6791
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6263
6792
  FoldCard,
6264
6793
  {
6265
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",
6266
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",
6267
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { margin: "10px 0", fontSize: 12, lineHeight: 1.6, opacity: 0.85 }, children: [
6268
- /* @__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" }),
6269
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",
6270
- /* @__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" }),
6271
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",
6272
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("br", {}),
6273
- /* @__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" })
6274
6804
  ] })
6275
6805
  }
6276
6806
  );
@@ -6278,7 +6808,7 @@ function DirectoryPickCard() {
6278
6808
  function RestartButton({ restart }) {
6279
6809
  const busy = restart.stage === "restarting" || restart.stage === "asking";
6280
6810
  const blocked = restart.blocked;
6281
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6811
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6282
6812
  "button",
6283
6813
  {
6284
6814
  type: "button",
@@ -6293,7 +6823,7 @@ function RestartButton({ restart }) {
6293
6823
  );
6294
6824
  }
6295
6825
  function RefreshButton({ busy }) {
6296
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6826
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6297
6827
  "button",
6298
6828
  {
6299
6829
  type: "button",
@@ -6310,17 +6840,17 @@ function RefreshButton({ busy }) {
6310
6840
  function RestartBanner({ restart }) {
6311
6841
  if (restart.stage === "idle") return null;
6312
6842
  const failed = restart.stage === "failed";
6313
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: failed ? "dsh-ux-restartBanner dsh-ux-restartBannerFailed" : "dsh-ux-restartBanner", children: [
6314
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "dsh-ux-restartBannerText", children: restart.detail }),
6315
- restart.stage === "asking" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-restartBannerActions", children: [
6316
- /* @__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: () => {
6317
6847
  restart.confirm();
6318
6848
  }, children: "\u786E\u8BA4\u91CD\u542F" }),
6319
- /* @__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: () => {
6320
6850
  restart.cancel();
6321
6851
  }, children: "\u53D6\u6D88" })
6322
6852
  ] }),
6323
- 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: () => {
6324
6854
  restart.cancel();
6325
6855
  }, children: "\u77E5\u9053\u4E86" }) })
6326
6856
  ] });
@@ -6330,10 +6860,10 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6330
6860
  const book = useBook((item) => item);
6331
6861
  const bookStatus = useBookStatus((item) => item);
6332
6862
  const writeNotice = useWriteNotice((item) => item);
6333
- const [conflict, setConflict] = (0, import_react9.useState)(null);
6863
+ const [conflict, setConflict] = (0, import_react10.useState)(null);
6334
6864
  const restart = useRestart();
6335
6865
  const sections = activeSections(settings);
6336
- const [autostartEnabled, setAutostartEnabled] = (0, import_react9.useState)(false);
6866
+ const [autostartEnabled, setAutostartEnabled] = (0, import_react10.useState)(false);
6337
6867
  const autostart = useAutostart(setAutostartEnabled);
6338
6868
  const setKey = (side, chord) => {
6339
6869
  const other = side === "send" ? settings.newlineKey : settings.sendKey;
@@ -6350,10 +6880,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6350
6880
  const menuSummary = settings.menuMode === "official" ? "\u5F53\u524D\uFF1A\u5B98\u65B9\u4E0D\u4ECB\u5165" : settings.menuMode === "browser" ? "\u5F53\u524D\uFF1A\u6D4F\u89C8\u5668\u83DC\u5355\uFF08\u7C98\u8D34\u514D\u6388\u6743\uFF09" : `\u5F53\u524D\uFF1A\u81EA\u5B9A\u4E49\u83DC\u5355 \xB7 ${menuEnabled} / ${MENU_ITEMS.length} \u9879\u5F00\u542F`;
6351
6881
  const panelSize = typeof settings.panelWidth === "number" && typeof settings.panelHeight === "number" ? `${settings.panelWidth}\xD7${settings.panelHeight}` : "\u5C3A\u5BF8\u7528\u5B98\u65B9\u9ED8\u8BA4";
6352
6882
  const panelSummary = `\u8FB9\u7F18\u7F29\u653E ${settings.panelResize ? "\u5F00" : "\u5173"} \xB7 ${panelSize}`;
6353
- const headerSummary = settings.headerEnabled ? settings.headerStatus === "" ? "\u5DF2\u542F\u7528" : settings.headerStatus : "\u672A\u542F\u7528";
6883
+ const headerNative = settings.headerStatus.startsWith(NATIVE_STATUS_PREFIX);
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";
6354
6885
  const quickCounts = bookCounts(book);
6355
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"}`;
6356
- const headerStatusText = 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";
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";
6357
6888
  const terminalSummary = sections.terminal === false ? settings.terminalMode === "pwsh" ? "\u4FDD\u6301 PowerShell" : "\u6253\u5F00\u540E\u63A5\u7BA1\u7EC8\u7AEF" : settings.terminalEffective === "unsupported" ? "\u975E Windows\uFF1A\u4E0D\u9700\u8981" : settings.terminalMode === "pwsh" ? "\u5F53\u524D\uFF1A\u4FDD\u6301 PowerShell" : settings.terminalEffective === "bash" ? "\u5F53\u524D\uFF1AGit Bash" : "\u5F53\u524D\uFF1APowerShell\uFF08\u672A\u63A5\u7BA1\uFF09";
6358
6889
  const statsSummary = `${HIT_DIGITS} \u4F4D\u5C0F\u6570`;
6359
6890
  const costSummary = (() => {
@@ -6366,17 +6897,17 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6366
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`;
6367
6898
  return `${price}${holidayText}${sync}`;
6368
6899
  })();
6369
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { padding: "4px 2px" }, children: [
6370
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsh-ux-card", children: [
6371
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-cardHeaderStatic", children: [
6372
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardHeadText", children: [
6373
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { className: "dsh-ux-cardName", children: "\u8F93\u5165\u4F53\u9A8C" }),
6374
- /* @__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" })
6375
6906
  ] }),
6376
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "dsh-ux-cardActions", children: [
6377
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RefreshButton, { busy: restart.stage === "restarting" || restart.stage === "asking" }),
6378
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RestartButton, { restart }),
6379
- /* @__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)(
6380
6911
  "a",
6381
6912
  {
6382
6913
  className: "dsh-ux-cardLink",
@@ -6386,11 +6917,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6386
6917
  title: "\u5728 GitHub \u4E0A\u67E5\u770B\u8FD9\u4E2A\u63D2\u4EF6\uFF08\u65B0\u6807\u7B7E\u6253\u5F00\uFF09",
6387
6918
  children: [
6388
6919
  "GitHub ",
6389
- /* @__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" })
6390
6921
  ]
6391
6922
  }
6392
6923
  ),
6393
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
6924
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6394
6925
  "a",
6395
6926
  {
6396
6927
  className: "dsh-ux-cardLink",
@@ -6400,20 +6931,29 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6400
6931
  title: "\u6253\u5F00 DSH \u5B98\u7F51\uFF08\u65B0\u6807\u7B7E\uFF09",
6401
6932
  children: [
6402
6933
  "\u5B98\u7F51 ",
6403
- /* @__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" })
6404
6935
  ]
6405
6936
  }
6406
6937
  )
6407
6938
  ] })
6408
6939
  ] }),
6409
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RestartBanner, { restart }),
6410
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NotifyCard, { settings, setField: actions.setField }),
6411
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DirectoryPickCard, {}),
6412
- /* @__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, {}) }),
6413
- /* @__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)(
6414
6953
  FoldCard,
6415
6954
  {
6416
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",
6417
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",
6418
6958
  toggle: {
6419
6959
  checked: autostartEnabled,
@@ -6422,20 +6962,20 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6422
6962
  autostart.set(next);
6423
6963
  }
6424
6964
  },
6425
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AutostartCard, { view: autostart })
6965
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AutostartCard, { view: autostart })
6426
6966
  }
6427
6967
  ),
6428
- writeNotice !== "" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-restartBanner dsh-ux-restartBannerFailed", role: "status", children: [
6429
- /* @__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: [
6430
6970
  "\u8BBE\u7F6E\u672A\u751F\u6548\uFF1A",
6431
6971
  writeNotice
6432
6972
  ] }),
6433
- /* @__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: () => {
6434
6974
  actions.dismissNotice();
6435
6975
  }, children: "\u77E5\u9053\u4E86" }) })
6436
6976
  ] }),
6437
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsh-ux-cardBody", children: [
6438
- /* @__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)(
6439
6979
  ToggleRow,
6440
6980
  {
6441
6981
  first: true,
@@ -6447,14 +6987,15 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6447
6987
  }
6448
6988
  }
6449
6989
  ),
6450
- !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" })
6451
6991
  ] })
6452
6992
  ] }),
6453
- settings.enabled && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
6454
- /* @__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)(
6455
6995
  FoldCard,
6456
6996
  {
6457
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",
6458
6999
  summary: keySummary,
6459
7000
  toggle: {
6460
7001
  checked: sections.keys,
@@ -6463,8 +7004,8 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6463
7004
  }
6464
7005
  },
6465
7006
  children: [
6466
- /* @__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" }),
6467
- /* @__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)(
6468
7009
  KeyRow,
6469
7010
  {
6470
7011
  first: true,
@@ -6478,7 +7019,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6478
7019
  }
6479
7020
  }
6480
7021
  ),
6481
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7022
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6482
7023
  KeyRow,
6483
7024
  {
6484
7025
  title: "\u6362\u884C\u952E",
@@ -6491,8 +7032,8 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6491
7032
  }
6492
7033
  }
6493
7034
  ),
6494
- conflictHint !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { style: hintError, children: conflictHint }),
6495
- /* @__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)(
6496
7037
  "button",
6497
7038
  {
6498
7039
  type: "button",
@@ -6507,10 +7048,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6507
7048
  ]
6508
7049
  }
6509
7050
  ),
6510
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7051
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6511
7052
  FoldCard,
6512
7053
  {
6513
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",
6514
7056
  summary: menuSummary,
6515
7057
  toggle: {
6516
7058
  checked: sections.menu,
@@ -6519,42 +7061,36 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6519
7061
  }
6520
7062
  },
6521
7063
  children: [
6522
- /* @__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" }),
6523
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...row, borderTop: "none", flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
6524
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowText, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u83DC\u5355\u6765\u6E90" }) }),
6525
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6526
- PillChoice,
6527
- {
6528
- items: MENU_MODES,
6529
- value: settings.menuMode,
6530
- onChange: (mode) => {
6531
- actions.setField(MENU_MODE_FIELD, mode);
6532
- },
6533
- ariaLabel: "\u53F3\u952E\u83DC\u5355\u6765\u6E90"
6534
- }
6535
- )
6536
- ] }),
6537
- settings.menuMode === "official" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
6538
- /* @__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" }),
6539
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"
6540
7079
  ] }),
6541
- settings.menuMode === "browser" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
6542
- /* @__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" }),
6543
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"
6544
7083
  ] }),
6545
- settings.menuMode === "custom" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
6546
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
6547
- /* @__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" }),
6548
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"
6549
7088
  ] }),
6550
- /* @__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" }),
6551
- /* @__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" }),
6552
- /* @__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" }),
6553
- /* @__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: [
6554
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u83DC\u5355\u6761\u76EE" }),
6555
- /* @__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" })
6556
- ] }) }),
6557
- 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)(
6558
7094
  ToggleRow,
6559
7095
  {
6560
7096
  first: index === 0,
@@ -6567,7 +7103,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6567
7103
  },
6568
7104
  item.field
6569
7105
  )),
6570
- /* @__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)(
6571
7107
  "button",
6572
7108
  {
6573
7109
  type: "button",
@@ -6582,10 +7118,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6582
7118
  ]
6583
7119
  }
6584
7120
  ),
6585
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7121
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6586
7122
  FoldCard,
6587
7123
  {
6588
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",
6589
7126
  summary: quickSummary,
6590
7127
  toggle: {
6591
7128
  checked: sections.quick,
@@ -6594,37 +7131,38 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6594
7131
  }
6595
7132
  },
6596
7133
  children: [
6597
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: bodyLead, children: [
7134
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsh-ux-lead", children: [
6598
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",
6599
- /* @__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" }),
6600
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",
6601
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("strong", { children: "\u672B\u5C3E" }),
7138
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "\u672B\u5C3E" }),
6602
7139
  "\uFF1B \u300C\u4EC5\u9996\u6B21\u300D= \u53EA\u5728",
6603
- /* @__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" }),
6604
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',
6605
- /* @__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" }),
6606
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'
6607
7144
  ] }),
6608
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...row, borderTop: "none", flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
6609
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
6610
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u4F18\u5316\u5F3A\u5EA6" }),
6611
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowDesc, children: OPTIMIZER_TIERS.find((item) => item.id === settings.optimizerTier)?.hint ?? "" })
6612
- ] }),
6613
- /* @__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)(
6614
- "button",
6615
- {
6616
- type: "button",
6617
- title: item.hint,
6618
- style: settings.optimizerTier === item.id ? pillActive : pill,
6619
- onClick: () => {
6620
- actions.setField(OPTIMIZER_TIER_FIELD, item.id);
6621
- },
6622
- children: item.label
6623
- },
6624
- item.id
6625
- )) })
6626
- ] }),
6627
- /* @__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)(
6628
7166
  ToggleRow,
6629
7167
  {
6630
7168
  label: "\u643A\u5E26\u4F1A\u8BDD\u4E0A\u4E0B\u6587",
@@ -6635,7 +7173,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6635
7173
  }
6636
7174
  }
6637
7175
  ),
6638
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7176
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6639
7177
  ToggleRow,
6640
7178
  {
6641
7179
  label: "\u8BB0\u5F55\u6BCF\u8F6E\u4F18\u5316\u53F0\u8D26",
@@ -6646,7 +7184,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6646
7184
  }
6647
7185
  }
6648
7186
  ),
6649
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7187
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6650
7188
  ToggleRow,
6651
7189
  {
6652
7190
  label: "\u91CD\u542F\u540E\u4FDD\u7559\u7ED3\u679C\u6846",
@@ -6658,7 +7196,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6658
7196
  action: { label: "\u6E05\u7A7A\u7ED3\u679C\u6846\u72B6\u6001", onClick: actions.clearDockState }
6659
7197
  }
6660
7198
  ),
6661
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7199
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6662
7200
  ToggleRow,
6663
7201
  {
6664
7202
  label: "\u4F18\u5316\u65F6\u5141\u8BB8\u53EA\u8BFB\u67E5\u8BC1\u9879\u76EE\u6587\u4EF6",
@@ -6669,7 +7207,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6669
7207
  }
6670
7208
  }
6671
7209
  ),
6672
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7210
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6673
7211
  OptimizerPromptEditor,
6674
7212
  {
6675
7213
  tier: settings.optimizerTier,
@@ -6679,35 +7217,38 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6679
7217
  }
6680
7218
  }
6681
7219
  ),
6682
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { ...row, borderTop: "none", flexDirection: "column", alignItems: "stretch", gap: 8 }, children: [
6683
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: rowText, children: [
6684
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { style: rowTitle, children: "\u5FEB\u6377\u6307\u4EE4\u6E05\u5355" }),
6685
- /* @__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" })
6686
- ] }),
6687
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
6688
- QuickPromptsEditor,
6689
- {
6690
- book,
6691
- status: bookStatus,
6692
- onSave: (next) => {
6693
- actions.saveBook(next);
6694
- },
6695
- onReload: () => {
6696
- actions.reloadBook();
6697
- },
6698
- onReset: () => {
6699
- 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
+ }
6700
7240
  }
6701
- }
6702
- )
6703
- ] })
7241
+ ) })
7242
+ }
7243
+ )
6704
7244
  ]
6705
7245
  }
6706
7246
  ),
6707
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7247
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6708
7248
  FoldCard,
6709
7249
  {
6710
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",
6711
7252
  summary: panelSummary,
6712
7253
  toggle: {
6713
7254
  checked: sections.panel,
@@ -6715,7 +7256,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6715
7256
  actions.setField(PANEL_ENABLED_FIELD, next);
6716
7257
  }
6717
7258
  },
6718
- controls: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7259
+ controls: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6719
7260
  MiniToggle,
6720
7261
  {
6721
7262
  label: "\u8FB9\u7F18\u7F29\u653E",
@@ -6726,10 +7267,10 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6726
7267
  }
6727
7268
  ),
6728
7269
  children: [
6729
- /* @__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" }),
6730
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap", marginTop: 10 }, children: [
6731
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: rowDesc, children: "\u5C3A\u5BF8\u9884\u8BBE\uFF1A" }),
6732
- /* @__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)(
6733
7274
  "button",
6734
7275
  {
6735
7276
  type: "button",
@@ -6741,7 +7282,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6741
7282
  children: "\u9ED8\u8BA4\uFF08800\uFF09"
6742
7283
  }
6743
7284
  ),
6744
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7285
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6745
7286
  "button",
6746
7287
  {
6747
7288
  type: "button",
@@ -6753,7 +7294,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6753
7294
  children: "\u7D27\u51D1\uFF08640\xD7600\uFF09"
6754
7295
  }
6755
7296
  ),
6756
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7297
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6757
7298
  "button",
6758
7299
  {
6759
7300
  type: "button",
@@ -6769,10 +7310,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6769
7310
  ]
6770
7311
  }
6771
7312
  ),
6772
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7313
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6773
7314
  FoldCard,
6774
7315
  {
6775
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",
6776
7318
  summary: headerSummary,
6777
7319
  toggle: {
6778
7320
  checked: sections.header,
@@ -6781,9 +7323,14 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6781
7323
  }
6782
7324
  },
6783
7325
  children: [
6784
- /* @__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" }),
6785
- /* @__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\u3002DSH \u7684\u8BBE\u7F6E\u9875\u4E0D\u63D0\u4F9B\u8BF7\u6C42\u5934\u7F16\u8F91\u5668\uFF0C\u6240\u4EE5\u8FD9\u91CC\u76F4\u63A5\u628A\u5B83\u5199\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\u5199\u5165\u7684\u5934\u4F1A\u81EA\u52A8\u64A4\u9500\u3002" }),
6786
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7326
+ headerNative ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: hintInfo, children: [
7327
+ "\u672C\u5BBF\u4E3B\u5DF2\u539F\u751F\u652F\u6301\uFF1Api-ai \u4F1A\u6309\u6BCF\u6BB5\u5BF9\u8BDD\u7684\u771F\u5B9E session id \u53D1\u9001 ",
7328
+ DEFAULT_HEADER_NAME,
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"
7330
+ ] }) : null,
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)(
6787
7334
  TextFieldRow,
6788
7335
  {
6789
7336
  title: "\u5934\u540D",
@@ -6796,11 +7343,11 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6796
7343
  }
6797
7344
  }
6798
7345
  ),
6799
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7346
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6800
7347
  TextFieldRow,
6801
7348
  {
6802
7349
  title: "\u503C",
6803
- desc: "\u6240\u6709\u5BF9\u8BDD\u5171\u7528\u8FD9\u4E00\u4E2A\u503C\uFF1B\u7559\u7A7A\u65F6\u9996\u6B21\u542F\u7528\u4F1A\u81EA\u52A8\u751F\u6210\u4E00\u4E2A UUID \u5E76\u4FDD\u5B58\u6CBF\u7528",
7350
+ desc: "\u65E7\u5BBF\u4E3B\u4E13\u7528\uFF1A\u6240\u6709\u5BF9\u8BDD\u5171\u7528\u8FD9\u4E00\u4E2A\u503C\uFF1B\u7559\u7A7A\u65F6\u9996\u6B21\u542F\u7528\u4F1A\u81EA\u52A8\u751F\u6210\u4E00\u4E2A UUID\uFF08\u5BBF\u4E3B\u5DF2\u539F\u751F\u652F\u6301\u65F6\u4E0D\u4F1A\u7528\u5230\u5B83\uFF09",
6804
7351
  value: settings.headerValue,
6805
7352
  placeholder: "\u7559\u7A7A = \u81EA\u52A8\u751F\u6210",
6806
7353
  maxLength: HEADER_VALUE_MAX,
@@ -6815,7 +7362,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6815
7362
  }
6816
7363
  }
6817
7364
  ),
6818
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7365
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6819
7366
  TextFieldRow,
6820
7367
  {
6821
7368
  title: "\u4F5C\u7528\u8DEF\u7531",
@@ -6828,17 +7375,18 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6828
7375
  }
6829
7376
  }
6830
7377
  ),
6831
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: hintInfo, children: [
7378
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { style: hintInfo, children: [
6832
7379
  "\u72B6\u6001\uFF1A",
6833
7380
  headerStatusText
6834
7381
  ] })
6835
7382
  ]
6836
7383
  }
6837
7384
  ),
6838
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7385
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6839
7386
  FoldCard,
6840
7387
  {
6841
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",
6842
7390
  summary: terminalSummary,
6843
7391
  toggle: {
6844
7392
  checked: sections.terminal,
@@ -6846,7 +7394,7 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6846
7394
  actions.setField(TERMINAL_ENABLED_FIELD, next);
6847
7395
  }
6848
7396
  },
6849
- controls: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
7397
+ controls: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6850
7398
  PillChoice,
6851
7399
  {
6852
7400
  compact: true,
@@ -6859,15 +7407,16 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6859
7407
  }
6860
7408
  ),
6861
7409
  children: [
6862
- /* @__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" }),
6863
- /* @__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 })
6864
7412
  ]
6865
7413
  }
6866
7414
  ),
6867
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
7415
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6868
7416
  FoldCard,
6869
7417
  {
6870
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",
6871
7420
  summary: statsSummary,
6872
7421
  toggle: {
6873
7422
  checked: sections.stats,
@@ -6876,26 +7425,34 @@ function SettingsSection({ useLive, useBook, useBookStatus, useWriteNotice, acti
6876
7425
  }
6877
7426
  },
6878
7427
  children: [
6879
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { style: bodyLead, children: [
7428
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsh-ux-lead", children: [
6880
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 ",
6881
7430
  HIT_DIGITS,
6882
7431
  " \u4F4D\u5C0F\u6570\uFF08\u300C\u7F13\u5B58\u547D\u4E2D 12.346%\u300D\uFF09\uFF0C\u5E76",
6883
- /* @__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" }),
6884
7433
  "\uFF1A\u4E00\u65E6 ",
6885
7434
  HIT_DIGITS,
6886
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"
6887
7436
  ] }),
6888
- /* @__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" })
6889
7438
  ]
6890
7439
  }
6891
7440
  ),
6892
- /* @__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
+ )
6893
7450
  ] })
6894
7451
  ] });
6895
7452
  }
6896
7453
 
6897
7454
  // src/client/StatsLineEntry.tsx
6898
- var import_react10 = __toESM(require("react"), 1);
7455
+ var import_react11 = __toESM(require("react"), 1);
6899
7456
 
6900
7457
  // src/client/stats-dom.ts
6901
7458
  var MAX_HOST_DEPTH = 6;
@@ -6925,15 +7482,15 @@ function rewriteCacheHit(stats, display) {
6925
7482
  }
6926
7483
 
6927
7484
  // src/client/StatsLineEntry.tsx
6928
- var import_jsx_runtime12 = require("react/jsx-runtime");
7485
+ var import_jsx_runtime13 = require("react/jsx-runtime");
6929
7486
  var SCAN_DEBOUNCE_MS = 80;
6930
7487
  function StatsLineEntry({ useLive, useProjection }) {
6931
7488
  const settings = useLive((item) => item);
6932
7489
  const active2 = statsLineEnabled(settings);
6933
7490
  const usage = typeof useProjection === "function" ? useProjection("tokenUsage") : void 0;
6934
7491
  const target = cacheHitDisplay(usage, active2 ? HIT_DIGITS : 0);
6935
- const anchor = import_react10.default.useRef(null);
6936
- import_react10.default.useLayoutEffect(() => {
7492
+ const anchor = import_react11.default.useRef(null);
7493
+ import_react11.default.useLayoutEffect(() => {
6937
7494
  const host = hostOf(anchor.current);
6938
7495
  if (host === null) return;
6939
7496
  let timer;
@@ -6964,7 +7521,7 @@ function StatsLineEntry({ useLive, useProjection }) {
6964
7521
  if (timer !== void 0) clearTimeout(timer);
6965
7522
  };
6966
7523
  }, [active2, target]);
6967
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
7524
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6968
7525
  "span",
6969
7526
  {
6970
7527
  ref: anchor,
@@ -6977,8 +7534,8 @@ function StatsLineEntry({ useLive, useProjection }) {
6977
7534
  }
6978
7535
 
6979
7536
  // src/client/CostChipEntry.tsx
6980
- var import_react13 = __toESM(require("react"), 1);
6981
- var import_react_dom2 = require("react-dom");
7537
+ var import_react14 = __toESM(require("react"), 1);
7538
+ var import_react_dom3 = require("react-dom");
6982
7539
 
6983
7540
  // src/usage-fold.ts
6984
7541
  var UNKNOWN_ROUTE = "\u672A\u77E5";
@@ -7007,14 +7564,14 @@ function agreesWithProjection(fold, projection) {
7007
7564
  }
7008
7565
 
7009
7566
  // src/client/peak-alert.ts
7010
- var import_react11 = __toESM(require("react"), 1);
7567
+ var import_react12 = __toESM(require("react"), 1);
7011
7568
  var TICK_MS = 1e4;
7012
7569
  var notifiedSwitchAt = Number.NaN;
7013
7570
  function usePeakPhase(holidays) {
7014
7571
  const table = holidays ?? DEFAULT_PEAK_HOLIDAYS;
7015
- 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 }));
7016
7573
  const tableKey = table.join(",");
7017
- import_react11.default.useEffect(() => {
7574
+ import_react12.default.useEffect(() => {
7018
7575
  const compute = () => {
7019
7576
  setPhase(peakPhaseAt(Date.now(), { holidays: table }));
7020
7577
  };
@@ -7037,7 +7594,7 @@ function usePeakAlert(settings, holidays) {
7037
7594
  const phase = usePeakPhase(holidays);
7038
7595
  const alert = settings.peakAlert;
7039
7596
  const text = peakNoticeText(phase);
7040
- import_react11.default.useEffect(() => {
7597
+ import_react12.default.useEffect(() => {
7041
7598
  if (!alert.enabled || !alert.webNotify) return;
7042
7599
  if (!Number.isFinite(phase.nextAtMs)) return;
7043
7600
  if (phase.minutesUntil > alert.aheadMinutes) return;
@@ -7057,27 +7614,27 @@ function usePeakAlert(settings, holidays) {
7057
7614
  }
7058
7615
 
7059
7616
  // src/client/session-cost.ts
7060
- var import_react12 = __toESM(require("react"), 1);
7617
+ var import_react13 = __toESM(require("react"), 1);
7061
7618
  var MIN_INTERVAL_MS = 600;
7062
7619
  function useSessionCost(sessionId, fingerprint, force) {
7063
- const [entry, setEntry] = import_react12.default.useState(null);
7064
- const [loading, setLoading] = import_react12.default.useState(false);
7065
- const lastAt = import_react12.default.useRef(0);
7066
- const timer = import_react12.default.useRef(null);
7067
- const inflight = import_react12.default.useRef(false);
7068
- const again = import_react12.default.useRef(false);
7069
- const serial = import_react12.default.useRef(0);
7070
- const alive = import_react12.default.useRef(true);
7071
- 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(() => {
7072
7629
  });
7073
- import_react12.default.useEffect(() => {
7630
+ import_react13.default.useEffect(() => {
7074
7631
  alive.current = true;
7075
7632
  return () => {
7076
7633
  alive.current = false;
7077
7634
  if (timer.current !== null) clearTimeout(timer.current);
7078
7635
  };
7079
7636
  }, []);
7080
- const run = import_react12.default.useCallback(() => {
7637
+ const run = import_react13.default.useCallback(() => {
7081
7638
  if (typeof sessionId !== "string" || sessionId === "") return;
7082
7639
  if (inflight.current) {
7083
7640
  again.current = true;
@@ -7108,7 +7665,7 @@ function useSessionCost(sessionId, fingerprint, force) {
7108
7665
  });
7109
7666
  }, [sessionId]);
7110
7667
  runRef.current = run;
7111
- import_react12.default.useEffect(() => {
7668
+ import_react13.default.useEffect(() => {
7112
7669
  if (typeof sessionId !== "string" || sessionId === "") return;
7113
7670
  const wait = Math.max(0, MIN_INTERVAL_MS - (Date.now() - lastAt.current));
7114
7671
  if (wait === 0 || force) {
@@ -7128,7 +7685,7 @@ function useSessionCost(sessionId, fingerprint, force) {
7128
7685
  }
7129
7686
 
7130
7687
  // src/client/CostChipEntry.tsx
7131
- var import_jsx_runtime13 = require("react/jsx-runtime");
7688
+ var import_jsx_runtime14 = require("react/jsx-runtime");
7132
7689
  var VIEWPORT_MARGIN = 12;
7133
7690
  var PANEL_MIN_WIDTH = "min(300px, calc(100vw - 24px))";
7134
7691
  var PANEL_MAX_WIDTH = "min(440px, calc(100vw - 24px))";
@@ -7140,9 +7697,9 @@ function tokenTotal(buckets) {
7140
7697
  return num(buckets.inputTokens) + num(buckets.outputTokens) + num(buckets.cacheReadTokens) + num(buckets.cacheWriteTokens);
7141
7698
  }
7142
7699
  function detail(label, value, key) {
7143
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react13.default.Fragment, { children: [
7144
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { style: { minWidth: 0, margin: 0, color: "var(--dsw-alias-label-tertiary)", overflowWrap: "anywhere" }, children: label }),
7145
- /* @__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: {
7146
7703
  minWidth: 0,
7147
7704
  margin: 0,
7148
7705
  color: "var(--dsw-alias-label-secondary)",
@@ -7152,7 +7709,7 @@ function detail(label, value, key) {
7152
7709
  ] }, key ?? label);
7153
7710
  }
7154
7711
  function note(text, key) {
7155
- 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);
7156
7713
  }
7157
7714
  function priceText(triple) {
7158
7715
  return `${triple.miss} / ${triple.hit} / ${triple.out}`;
@@ -7163,10 +7720,10 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7163
7720
  const project = typeof useProjection === "function" ? useProjection : () => void 0;
7164
7721
  const usage = project("tokenUsage");
7165
7722
  const selection = project("modelSelection");
7166
- const [open, setOpen] = import_react13.default.useState(false);
7167
- const [hover, setHover] = import_react13.default.useState(false);
7168
- const [anchor, setAnchor] = import_react13.default.useState(null);
7169
- 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);
7170
7727
  const buckets = costBucketsOf(usage);
7171
7728
  const write = num(usage?.cacheWriteTokens);
7172
7729
  const model = selection?.lastUsed?.model;
@@ -7178,7 +7735,7 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7178
7735
  const estimate = resolvePrice(model, { overrides, ...lastProvider === void 0 ? {} : { provider: lastProvider }, ...eras === void 0 ? {} : { eras } });
7179
7736
  const estimateParts = costPartsOf(buckets, estimate.prices);
7180
7737
  const { text: peakText } = usePeakAlert(settings, data?.holidays ?? settings.peakHolidays ?? DEFAULT_PEAK_HOLIDAYS);
7181
- const close = import_react13.default.useCallback(() => {
7738
+ const close = import_react14.default.useCallback(() => {
7182
7739
  setOpen(false);
7183
7740
  setAnchor(null);
7184
7741
  }, []);
@@ -7197,7 +7754,7 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7197
7754
  setAnchor({ left, top: rect.top - 8 });
7198
7755
  setOpen(true);
7199
7756
  };
7200
- import_react13.default.useEffect(() => {
7757
+ import_react14.default.useEffect(() => {
7201
7758
  if (!open) return;
7202
7759
  const onPointerDown = (event) => {
7203
7760
  const target = event.target;
@@ -7329,20 +7886,24 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7329
7886
  });
7330
7887
  const viewHitRate = cacheHitText(view.hit, viewBilledInput);
7331
7888
  const viewUnpriced = !useBreakdown && estimate.unpriced;
7332
- 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);
7333
7894
  const expanded = hover || open;
7334
7895
  const peakPrice = resolvePrice(model, { peak: true, overrides, ...lastProvider === void 0 ? {} : { provider: lastProvider }, ...eras === void 0 ? {} : { eras } });
7335
7896
  const offPrice = resolvePrice(model, { peak: false, overrides, ...lastProvider === void 0 ? {} : { provider: lastProvider }, ...eras === void 0 ? {} : { eras } });
7336
7897
  const overridden = peakPrice.overridden || offPrice.overridden || overrideTierOf(overrides, model, true) !== void 0 || overrideTierOf(overrides, model, false) !== void 0;
7337
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
7338
- /* @__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)(
7339
7900
  "button",
7340
7901
  {
7341
7902
  ref: chip,
7342
7903
  type: "button",
7343
7904
  "data-composer-ux-cost": "",
7344
7905
  "aria-expanded": open,
7345
- 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}`,
7346
7907
  onClick: toggle,
7347
7908
  onMouseEnter: () => setHover(true),
7348
7909
  onMouseLeave: () => setHover(false),
@@ -7370,11 +7931,22 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7370
7931
  whiteSpace: "nowrap",
7371
7932
  cursor: "pointer"
7372
7933
  },
7373
- 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
+ ]
7374
7946
  }
7375
7947
  ),
7376
- open && anchor !== null ? (0, import_react_dom2.createPortal)(
7377
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
7948
+ open && anchor !== null ? (0, import_react_dom3.createPortal)(
7949
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
7378
7950
  "div",
7379
7951
  {
7380
7952
  "data-composer-ux-cost-panel": "",
@@ -7404,7 +7976,7 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7404
7976
  // 与 styles.ts 里那些样式对象同一做法(那边也是 `as CSSProperties`)。
7405
7977
  },
7406
7978
  children: [
7407
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { style: {
7979
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: {
7408
7980
  display: "flex",
7409
7981
  justifyContent: "space-between",
7410
7982
  gap: 16,
@@ -7412,17 +7984,33 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7412
7984
  color: "var(--dsw-alias-label-primary)",
7413
7985
  fontWeight: 500
7414
7986
  }, children: [
7415
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "\u672C\u4F1A\u8BDD\u8D39\u7528" }),
7416
- /* @__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 })
7417
7989
  ] }),
7418
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { marginBottom: 10, borderTop: "0.5px solid var(--dsw-alias-border-l2)" } }),
7419
- /* @__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: {
7420
7993
  display: "grid",
7421
7994
  gridTemplateColumns: "minmax(76px, auto) minmax(0, 1fr)",
7422
7995
  gap: "6px 16px",
7423
7996
  margin: 0
7424
7997
  }, children: [
7425
- 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: [
7426
8014
  routeRows.map((route) => detail(
7427
8015
  `${route.provider} \xB7 ${route.model}` + (route.deepseek ? route.peak ? "\uFF08\u9AD8\u5CF0\uFF09" : "\uFF08\u7A7A\u95F2\uFF09" : "\uFF08\u5E73\u5766\u4EF7\uFF09"),
7428
8016
  `${formatTokens(route.tokens)} \xB7 ${route.unpriced ? "\u672A\u5B9A\u4EF7" : formatMoney(route.cost)}`,
@@ -7444,7 +8032,7 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7444
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,
7445
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,
7446
8034
  subGapText !== null ? note(subGapText, "__sub_gap__") : null
7447
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
8035
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
7448
8036
  detail("\u672A\u7F13\u5B58\u8F93\u5165", `${formatTokens(buckets.miss)} \xB7 ${formatMoney(estimateParts.miss)}`),
7449
8037
  detail("\u7F13\u5B58\u547D\u4E2D", `${formatTokens(buckets.hit)} \xB7 ${formatMoney(estimateParts.hit)}`),
7450
8038
  detail("\u8F93\u51FA", `${formatTokens(buckets.out)} \xB7 ${formatMoney(estimateParts.out)}`),
@@ -7466,8 +8054,8 @@ function CostChipEntry({ useLive, sessionId, useProjection }) {
7466
8054
  }
7467
8055
 
7468
8056
  // src/client/QuickCommandsButton.tsx
7469
- var import_react14 = require("react");
7470
- var import_jsx_runtime14 = require("react/jsx-runtime");
8057
+ var import_react15 = require("react");
8058
+ var import_jsx_runtime15 = require("react/jsx-runtime");
7471
8059
  function QuickCommandsButton({
7472
8060
  useInput,
7473
8061
  inputActions,
@@ -7481,8 +8069,8 @@ function QuickCommandsButton({
7481
8069
  const anchor = usePanel((item) => item);
7482
8070
  const draft = useInput((state2) => state2.draft);
7483
8071
  const blank = useSession((state2) => state2?.blank === true);
7484
- const ref = (0, import_react14.useRef)(null);
7485
- (0, import_react14.useEffect)(() => {
8072
+ const ref = (0, import_react15.useRef)(null);
8073
+ (0, import_react15.useEffect)(() => {
7486
8074
  const sid = typeof sessionId === "string" ? sessionId : "";
7487
8075
  publishInputBridge({
7488
8076
  actions: inputActions ?? null,
@@ -7496,7 +8084,7 @@ function QuickCommandsButton({
7496
8084
  }, [inputActions, draft, sessionId, blank]);
7497
8085
  if (!activeSections(settings).quick) return null;
7498
8086
  const open = anchor !== null;
7499
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
8087
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
7500
8088
  "button",
7501
8089
  {
7502
8090
  ref,
@@ -7517,14 +8105,14 @@ function QuickCommandsButton({
7517
8105
  });
7518
8106
  },
7519
8107
  children: [
7520
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8108
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7521
8109
  "svg",
7522
8110
  {
7523
8111
  viewBox: "0 0 16 16",
7524
8112
  width: "12",
7525
8113
  height: "12",
7526
8114
  "aria-hidden": true,
7527
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
8115
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7528
8116
  "path",
7529
8117
  {
7530
8118
  d: "M9.2 1.2 3.4 9.1h3.5l-0.9 5.7 6-8.1H8.4l0.8-5.5Z",
@@ -7533,17 +8121,17 @@ function QuickCommandsButton({
7533
8121
  )
7534
8122
  }
7535
8123
  ),
7536
- /* @__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" })
7537
8125
  ]
7538
8126
  }
7539
8127
  );
7540
8128
  }
7541
8129
 
7542
8130
  // src/client/QuickCommandsPanel.tsx
7543
- var import_react18 = require("react");
8131
+ var import_react19 = require("react");
7544
8132
 
7545
8133
  // src/client/OptimizeOptionsCard.tsx
7546
- var import_react15 = __toESM(require("react"), 1);
8134
+ var import_react16 = __toESM(require("react"), 1);
7547
8135
 
7548
8136
  // src/client/model-catalog.ts
7549
8137
  var textOf = (value) => typeof value === "string" ? value.trim() : "";
@@ -7587,11 +8175,11 @@ async function fetchModelCatalog(options = {}) {
7587
8175
  }
7588
8176
 
7589
8177
  // src/client/OptimizeOptionsCard.tsx
7590
- var import_jsx_runtime15 = require("react/jsx-runtime");
7591
- function Segmented(props) {
7592
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7593
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optLabel, title: props.hint, children: props.label }),
7594
- /* @__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)(
7595
8183
  "button",
7596
8184
  {
7597
8185
  type: "button",
@@ -7611,8 +8199,8 @@ function Segmented(props) {
7611
8199
  ] });
7612
8200
  }
7613
8201
  function Toggle(props) {
7614
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7615
- Segmented,
8202
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8203
+ Segmented2,
7616
8204
  {
7617
8205
  label: props.label,
7618
8206
  hint: props.hint,
@@ -7630,13 +8218,13 @@ function currentPrompt(settings) {
7630
8218
  return settings.optimizerPromptStandard;
7631
8219
  }
7632
8220
  function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7633
- const [detailOpen, setDetailOpen] = (0, import_react15.useState)(false);
7634
- const [modelText, setModelText] = (0, import_react15.useState)(settings.optimizerModel);
7635
- const [pickerOpen, setPickerOpen] = (0, import_react15.useState)(false);
7636
- const [catalog, setCatalog] = (0, import_react15.useState)(null);
7637
- const [manual, setManual] = (0, import_react15.useState)(false);
7638
- const [retrySeq, setRetrySeq] = (0, import_react15.useState)(0);
7639
- (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)(() => {
7640
8228
  if (!pickerOpen) return;
7641
8229
  let alive = true;
7642
8230
  setCatalog({ kind: "loading" });
@@ -7658,8 +8246,8 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7658
8246
  `Bash ${settings.optimizeBash ? "\u5F00" : "\u5173"}`,
7659
8247
  ...settings.optimizerModel === "" ? [] : [`\u6A21\u578B ${settings.optimizerModel}`]
7660
8248
  ].join(" \xB7 ");
7661
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optCard, role: "group", "aria-label": "\u4F18\u5316\u9009\u9879", children: [
7662
- /* @__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)(
7663
8251
  "button",
7664
8252
  {
7665
8253
  type: "button",
@@ -7671,15 +8259,15 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7671
8259
  },
7672
8260
  onClick: onToggle,
7673
8261
  children: [
7674
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optFoldArrow, "aria-hidden": true, children: open ? "\u25BE" : "\u25B8" }),
7675
- /* @__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" }),
7676
- !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 })
7677
8265
  ]
7678
8266
  }
7679
8267
  ),
7680
- open && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7681
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7682
- Segmented,
8268
+ open && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
8269
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8270
+ Segmented2,
7683
8271
  {
7684
8272
  label: "\u6743\u9650",
7685
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",
@@ -7688,8 +8276,8 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7688
8276
  onPick: actions.setPermission
7689
8277
  }
7690
8278
  ),
7691
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7692
- Segmented,
8279
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8280
+ Segmented2,
7693
8281
  {
7694
8282
  label: "\u534F\u4F5C\u57FA\u8C03",
7695
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",
@@ -7698,9 +8286,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7698
8286
  onPick: actions.setFraming
7699
8287
  }
7700
8288
  ),
7701
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7702
- /* @__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" }),
7703
- /* @__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)(
7704
8292
  "button",
7705
8293
  {
7706
8294
  type: "button",
@@ -7721,8 +8309,8 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7721
8309
  }
7722
8310
  )
7723
8311
  ] }),
7724
- pickerOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optPickerPanel, role: "listbox", "aria-label": "\u6A21\u578B\u6E05\u5355", children: [
7725
- /* @__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)(
7726
8314
  "button",
7727
8315
  {
7728
8316
  type: "button",
@@ -7738,19 +8326,19 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7738
8326
  },
7739
8327
  children: [
7740
8328
  "\u8DDF\u968F\u4F1A\u8BDD\u6A21\u578B",
7741
- 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: [
7742
8330
  "\u5F53\u524D\uFF1A",
7743
8331
  catalog.current.model
7744
8332
  ] })
7745
8333
  ]
7746
8334
  }
7747
8335
  ),
7748
- 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: [
7749
- /* @__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: [
7750
8338
  "\u8BFB\u4E0D\u5230\u6A21\u578B\u6E05\u5355\uFF1A",
7751
8339
  catalog.error
7752
8340
  ] }),
7753
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8341
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7754
8342
  "button",
7755
8343
  {
7756
8344
  type: "button",
@@ -7764,14 +8352,14 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7764
8352
  children: "\u91CD\u8BD5"
7765
8353
  }
7766
8354
  )
7767
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7768
- 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" }),
7769
- catalog.groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react15.default.Fragment, { children: [
7770
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optPickerGroup, children: group.name }),
7771
- 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}` }),
7772
8360
  group.models.map((model) => {
7773
8361
  const value = `${group.id}/${model.id}`;
7774
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
8362
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
7775
8363
  "button",
7776
8364
  {
7777
8365
  type: "button",
@@ -7786,7 +8374,7 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7786
8374
  },
7787
8375
  children: [
7788
8376
  model.name,
7789
- 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 })
7790
8378
  ]
7791
8379
  },
7792
8380
  value
@@ -7794,7 +8382,7 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7794
8382
  })
7795
8383
  ] }, group.id))
7796
8384
  ] }),
7797
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8385
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7798
8386
  "button",
7799
8387
  {
7800
8388
  type: "button",
@@ -7808,7 +8396,7 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7808
8396
  children: "\u624B\u52A8\u8F93\u5165 provider/model\u2026"
7809
8397
  }
7810
8398
  ),
7811
- manual && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8399
+ manual && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7812
8400
  "input",
7813
8401
  {
7814
8402
  "aria-label": "\u624B\u52A8\u8F93\u5165\u6A21\u578B",
@@ -7827,8 +8415,8 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7827
8415
  }
7828
8416
  )
7829
8417
  ] }),
7830
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7831
- Segmented,
8418
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8419
+ Segmented2,
7832
8420
  {
7833
8421
  label: "\u4E0A\u4E0B\u6587",
7834
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",
@@ -7840,9 +8428,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7840
8428
  onPick: actions.setHistory
7841
8429
  }
7842
8430
  ),
7843
- settings.optimizerHistory === "turns" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7844
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optLabel }),
7845
- /* @__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)(
7846
8434
  "input",
7847
8435
  {
7848
8436
  "aria-label": "\u4E0A\u4E0B\u6587\u56DE\u5408\u6570",
@@ -7858,9 +8446,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7858
8446
  style: optSlider
7859
8447
  }
7860
8448
  ),
7861
- /* @__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` })
7862
8450
  ] }),
7863
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8451
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7864
8452
  Toggle,
7865
8453
  {
7866
8454
  label: "\u53EA\u8BFB\u5DE5\u5177",
@@ -7869,7 +8457,7 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7869
8457
  onToggle: actions.setReadTools
7870
8458
  }
7871
8459
  ),
7872
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
8460
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
7873
8461
  Toggle,
7874
8462
  {
7875
8463
  label: "\u5185\u7F6E Bash",
@@ -7878,9 +8466,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7878
8466
  onToggle: actions.setBash
7879
8467
  }
7880
8468
  ),
7881
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7882
- /* @__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" }),
7883
- /* @__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)(
7884
8472
  "button",
7885
8473
  {
7886
8474
  type: "button",
@@ -7897,9 +8485,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7897
8485
  }
7898
8486
  )
7899
8487
  ] }),
7900
- detailOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
7901
- /* @__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" }),
7902
- /* @__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)(
7903
8491
  "textarea",
7904
8492
  {
7905
8493
  "aria-label": "\u81EA\u5B9A\u4E49\u63D0\u793A\u8BCD",
@@ -7913,9 +8501,9 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7913
8501
  spellCheck: false
7914
8502
  }
7915
8503
  ),
7916
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: optRow, children: [
7917
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { style: optLabel }),
7918
- /* @__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)(
7919
8507
  "button",
7920
8508
  {
7921
8509
  type: "button",
@@ -7938,12 +8526,12 @@ function OptimizeOptionsCard({ settings, actions, open, onToggle }) {
7938
8526
  }
7939
8527
 
7940
8528
  // src/client/optimize-clock.ts
7941
- var import_react16 = require("react");
8529
+ var import_react17 = require("react");
7942
8530
  var TICK_MS2 = 1e3;
7943
8531
  function useOptimizeElapsed(startedAt) {
7944
8532
  const running = startedAt > 0;
7945
- const [seconds, setSeconds] = (0, import_react16.useState)(() => elapsedSeconds(startedAt, Date.now()));
7946
- (0, import_react16.useEffect)(() => {
8533
+ const [seconds, setSeconds] = (0, import_react17.useState)(() => elapsedSeconds(startedAt, Date.now()));
8534
+ (0, import_react17.useEffect)(() => {
7947
8535
  setSeconds(elapsedSeconds(startedAt, Date.now()));
7948
8536
  if (!running) return void 0;
7949
8537
  const timer = setInterval(() => {
@@ -7971,7 +8559,7 @@ function sectionForDock(dockPresent, current) {
7971
8559
  }
7972
8560
 
7973
8561
  // src/client/OptimizeDock.tsx
7974
- var import_react17 = require("react");
8562
+ var import_react18 = require("react");
7975
8563
 
7976
8564
  // src/client/optimize-dock.ts
7977
8565
  function dockReducer(state2, event) {
@@ -8138,7 +8726,7 @@ function sanitizeDockSnapshot(raw) {
8138
8726
  }
8139
8727
 
8140
8728
  // src/client/OptimizeDock.tsx
8141
- var import_jsx_runtime16 = require("react/jsx-runtime");
8729
+ var import_jsx_runtime17 = require("react/jsx-runtime");
8142
8730
  var KIND_LABEL = {
8143
8731
  // 0.14.0(上游本体)六类
8144
8732
  user_requirement: "\u4F60\u8981\u7684",
@@ -8179,8 +8767,8 @@ async function copyText(text) {
8179
8767
  }
8180
8768
  }
8181
8769
  function OptimizeDock({ state: state2, seconds, actions }) {
8182
- const [copied, setCopied] = (0, import_react17.useState)(false);
8183
- 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);
8184
8772
  const running = state2.phase === "running";
8185
8773
  const hasText = state2.text.trim() !== "";
8186
8774
  const canInsert = state2.phase === "done" && hasText;
@@ -8193,11 +8781,11 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8193
8781
  }, 1500);
8194
8782
  });
8195
8783
  };
8196
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: dockBox, role: "group", "aria-label": "\u4F18\u5316\u7ED3\u679C", children: [
8197
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: dockHead, children: [
8198
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: dockPhase, role: "status", children: dockPhaseText(state2) }),
8199
- /* @__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` : "" }),
8200
- !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)(
8201
8789
  "button",
8202
8790
  {
8203
8791
  type: "button",
@@ -8220,7 +8808,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8220
8808
  children: discardArmed ? "\u70B9\u7B2C\u4E8C\u6B21\u4E22\u5F03" : "\u4E22\u5F03"
8221
8809
  }
8222
8810
  ),
8223
- running ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8811
+ running ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8224
8812
  "button",
8225
8813
  {
8226
8814
  type: "button",
@@ -8232,7 +8820,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8232
8820
  onClick: actions.cancel,
8233
8821
  children: "\u53D6\u6D88"
8234
8822
  }
8235
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8823
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8236
8824
  "button",
8237
8825
  {
8238
8826
  type: "button",
@@ -8247,15 +8835,15 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8247
8835
  }
8248
8836
  )
8249
8837
  ] }),
8250
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: dockBody, children: [
8251
- 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: [
8252
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: dockKind, children: KIND_LABEL[item.kind] ?? item.kind }),
8253
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: dockItemText, children: item.text }),
8254
- 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` })
8255
8843
  ] }, item.id)) }),
8256
- 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")}` }),
8257
- state2.phase === "error" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: dockError, role: "alert", children: state2.error === "" ? "\u4F18\u5316\u5931\u8D25" : state2.error }),
8258
- (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)(
8259
8847
  "textarea",
8260
8848
  {
8261
8849
  value: state2.text,
@@ -8268,10 +8856,10 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8268
8856
  style: dockEditor
8269
8857
  }
8270
8858
  ),
8271
- 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}` })
8272
8860
  ] }),
8273
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { ...dockButtons, ...dockButtonsPinned }, children: [
8274
- /* @__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)(
8275
8863
  "button",
8276
8864
  {
8277
8865
  type: "button",
@@ -8285,7 +8873,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8285
8873
  children: "\u63D2\u5165\u8F93\u5165\u6846"
8286
8874
  }
8287
8875
  ),
8288
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8876
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8289
8877
  "button",
8290
8878
  {
8291
8879
  type: "button",
@@ -8299,7 +8887,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8299
8887
  children: "\u91CD\u65B0\u4F18\u5316"
8300
8888
  }
8301
8889
  ),
8302
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
8890
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
8303
8891
  "button",
8304
8892
  {
8305
8893
  type: "button",
@@ -8318,7 +8906,7 @@ function OptimizeDock({ state: state2, seconds, actions }) {
8318
8906
  }
8319
8907
 
8320
8908
  // src/client/QuickCommandsPanel.tsx
8321
- var import_jsx_runtime17 = require("react/jsx-runtime");
8909
+ var import_jsx_runtime18 = require("react/jsx-runtime");
8322
8910
  var MARGIN = 8;
8323
8911
  var GAP = 8;
8324
8912
  function QuickCommandsPanel({
@@ -8342,11 +8930,11 @@ function QuickCommandsPanel({
8342
8930
  const status = useBookStatus((item) => item);
8343
8931
  const dock = useDock((item) => item);
8344
8932
  const dockHidden = useDockHidden((item) => item);
8345
- const ref = (0, import_react18.useRef)(null);
8346
- const [position, setPosition] = (0, import_react18.useState)(null);
8347
- const [activeId, setActiveId] = (0, import_react18.useState)("");
8348
- const [section, setSection] = (0, import_react18.useState)(DEFAULT_PANEL_SECTION);
8349
- 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);
8350
8938
  const dockPresent = dock !== null;
8351
8939
  const tierOff = settings.optimizerTier === "off";
8352
8940
  const seconds = useOptimizeElapsed(busy ? startedAt : 0);
@@ -8355,7 +8943,7 @@ function QuickCommandsPanel({
8355
8943
  const counts = bookCounts(book);
8356
8944
  const categories = book.categories;
8357
8945
  const active2 = categories.find((category) => category.id === activeId) ?? categories[0];
8358
- (0, import_react18.useLayoutEffect)(() => {
8946
+ (0, import_react19.useLayoutEffect)(() => {
8359
8947
  if (anchor === null) {
8360
8948
  setPosition(null);
8361
8949
  return;
@@ -8368,7 +8956,7 @@ function QuickCommandsPanel({
8368
8956
  const top = above >= MARGIN ? above : Math.min(anchor.bottom + GAP, window.innerHeight - height - MARGIN);
8369
8957
  setPosition({ left, top: Math.max(MARGIN, top) });
8370
8958
  }, [anchor?.left, anchor?.bottom, counts.prompts, categories.length, busy, section, dock !== null]);
8371
- (0, import_react18.useEffect)(() => {
8959
+ (0, import_react19.useEffect)(() => {
8372
8960
  if (anchor === null) return;
8373
8961
  const onPointerDown = (event) => {
8374
8962
  if (ref.current !== null && event.target instanceof Node && ref.current.contains(event.target)) return;
@@ -8396,8 +8984,8 @@ function QuickCommandsPanel({
8396
8984
  }, [anchor === null, actions, dockRunning]);
8397
8985
  const panelOpen = anchor !== null;
8398
8986
  const dockVisible = dockPresent && !dockHidden;
8399
- const prevOpen = (0, import_react18.useRef)(false);
8400
- const prevDockVisible = (0, import_react18.useRef)(false);
8987
+ const prevOpen = (0, import_react19.useRef)(false);
8988
+ const prevDockVisible = (0, import_react19.useRef)(false);
8401
8989
  if (prevOpen.current !== panelOpen) {
8402
8990
  prevOpen.current = panelOpen;
8403
8991
  if (panelOpen) {
@@ -8416,7 +9004,7 @@ function QuickCommandsPanel({
8416
9004
  const tier = settings.optimizerTier;
8417
9005
  const items = active2?.prompts ?? [];
8418
9006
  const failure = status !== "" && status !== "saving" ? status : "";
8419
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9007
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8420
9008
  "div",
8421
9009
  {
8422
9010
  ref,
@@ -8424,10 +9012,10 @@ function QuickCommandsPanel({
8424
9012
  "aria-label": "\u5FEB\u6377\u6307\u4EE4",
8425
9013
  style: { ...quickPanel, left: position?.left ?? anchor.left, top: position?.top ?? anchor.bottom },
8426
9014
  children: [
8427
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickPanelHead, children: [
8428
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickPanelTitleRow, children: [
8429
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: quickPanelTitle, children: "\u5FEB\u6377\u6307\u4EE4" }),
8430
- /* @__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)(
8431
9019
  "button",
8432
9020
  {
8433
9021
  type: "button",
@@ -8445,7 +9033,7 @@ function QuickCommandsPanel({
8445
9033
  item.id
8446
9034
  )) })
8447
9035
  ] }),
8448
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9036
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8449
9037
  "button",
8450
9038
  {
8451
9039
  type: "button",
@@ -8460,13 +9048,13 @@ function QuickCommandsPanel({
8460
9048
  if (section !== "optimize") setSection("optimize");
8461
9049
  },
8462
9050
  children: [
8463
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { "aria-hidden": true, children: "\u2728" }),
8464
- /* @__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" })
8465
9053
  ]
8466
9054
  }
8467
9055
  )
8468
9056
  ] }),
8469
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
9057
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
8470
9058
  "button",
8471
9059
  {
8472
9060
  type: "button",
@@ -8482,14 +9070,14 @@ function QuickCommandsPanel({
8482
9070
  setSection(next);
8483
9071
  },
8484
9072
  children: [
8485
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: quickSectionToggleArrow, "aria-hidden": true, children: section === "optimize" ? "\u25BE" : "\u25B8" }),
8486
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: "\u4F18\u5316\u63D0\u793A\u8BCD" }),
8487
- /* @__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" })
8488
9076
  ]
8489
9077
  }
8490
9078
  ),
8491
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickSectionBody, children: [
8492
- 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)(
8493
9081
  OptimizeOptionsCard,
8494
9082
  {
8495
9083
  settings,
@@ -8526,7 +9114,7 @@ function QuickCommandsPanel({
8526
9114
  }
8527
9115
  }
8528
9116
  ),
8529
- 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)(
8530
9118
  OptimizeDock,
8531
9119
  {
8532
9120
  state: dock,
@@ -8548,16 +9136,16 @@ function QuickCommandsPanel({
8548
9136
  }
8549
9137
  }
8550
9138
  ) }),
8551
- 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: [
8552
9140
  "\u8FD8\u6CA1\u8DD1\u8FC7\u4F18\u5316\u3002",
8553
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
9141
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
8554
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",
8555
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
9143
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
8556
9144
  "\u5F3A\u5EA6\u7528\u6807\u9898\u884C\u90A3\u4E09\u4E2A\u6863\u4F4D\uFF08\u666E\u901A / \u9AD8\u7EA7 / \u6781\u7AEF\uFF09\u3002"
8557
9145
  ] }),
8558
- section === "quick" && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
8559
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { padding: "8px 12px 0" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickCategoryRow, children: [
8560
- 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)(
8561
9149
  "button",
8562
9150
  {
8563
9151
  type: "button",
@@ -8574,7 +9162,7 @@ function QuickCommandsPanel({
8574
9162
  },
8575
9163
  category.id
8576
9164
  )),
8577
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9165
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8578
9166
  "button",
8579
9167
  {
8580
9168
  type: "button",
@@ -8591,14 +9179,14 @@ function QuickCommandsPanel({
8591
9179
  }
8592
9180
  )
8593
9181
  ] }) }),
8594
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickList, children: [
8595
- 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: [
8596
9184
  "\u8FD9\u4E2A\u5206\u7C7B\u91CC\u8FD8\u6CA1\u6709\u6761\u76EE\u3002",
8597
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("br", {}),
9185
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("br", {}),
8598
9186
  "\u5728\u300C\u8BBE\u7F6E \u2192 \u8F93\u5165\u4F53\u9A8C \u2192 \u5FEB\u6377\u6307\u4EE4\u6E05\u5355\u300D\u91CC\u6DFB\u52A0\u3002"
8599
9187
  ] }),
8600
- items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
8601
- /* @__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)(
8602
9190
  "button",
8603
9191
  {
8604
9192
  type: "button",
@@ -8611,12 +9199,12 @@ function QuickCommandsPanel({
8611
9199
  actions.insert(item.prompt);
8612
9200
  },
8613
9201
  children: [
8614
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: quickItemLabel, children: item.label }),
8615
- /* @__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, " ") })
8616
9204
  ]
8617
9205
  }
8618
9206
  ),
8619
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9207
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8620
9208
  InsertModeControl,
8621
9209
  {
8622
9210
  compact: true,
@@ -8628,7 +9216,7 @@ function QuickCommandsPanel({
8628
9216
  }
8629
9217
  )
8630
9218
  ] }, item.id)),
8631
- active2 !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
9219
+ active2 !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
8632
9220
  AddPromptRow,
8633
9221
  {
8634
9222
  variant: "panel",
@@ -8645,9 +9233,9 @@ function QuickCommandsPanel({
8645
9233
  ] })
8646
9234
  ] })
8647
9235
  ] }),
8648
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: quickPanelFoot, children: [
8649
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: quickNotice, role: "status", children: notice !== "" ? notice : failure }),
8650
- /* @__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)(
8651
9239
  "span",
8652
9240
  {
8653
9241
  style: quickFootHint,
@@ -8780,26 +9368,26 @@ function createDirectoryFlowController(options) {
8780
9368
  }
8781
9369
 
8782
9370
  // src/client/DirectoryFlowEntry.tsx
8783
- var import_react19 = require("react");
9371
+ var import_react20 = require("react");
8784
9372
  function DirectoryFlowEntry(props) {
8785
9373
  const { open, pick } = props;
8786
- const alive = (0, import_react19.useRef)(true);
8787
- const latest = (0, import_react19.useRef)(props);
9374
+ const alive = (0, import_react20.useRef)(true);
9375
+ const latest = (0, import_react20.useRef)(props);
8788
9376
  latest.current = props;
8789
- const flow = (0, import_react19.useMemo)(() => createPickFlow({
9377
+ const flow = (0, import_react20.useMemo)(() => createPickFlow({
8790
9378
  pick,
8791
9379
  report: (outcome) => {
8792
9380
  applyOutcome(latest.current, outcome);
8793
9381
  },
8794
9382
  isAlive: () => alive.current
8795
9383
  }), [pick]);
8796
- (0, import_react19.useEffect)(() => {
9384
+ (0, import_react20.useEffect)(() => {
8797
9385
  alive.current = true;
8798
9386
  return () => {
8799
9387
  alive.current = false;
8800
9388
  };
8801
9389
  }, []);
8802
- (0, import_react19.useEffect)(() => {
9390
+ (0, import_react20.useEffect)(() => {
8803
9391
  flow.setOpen(open);
8804
9392
  }, [flow, open]);
8805
9393
  return null;