@cold777/dsh-takeover 0.0.0-stage → 0.1.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/CHANGELOG.md +133 -0
- package/LICENSE +21 -0
- package/README.en.md +111 -0
- package/README.md +110 -2
- package/assets/icon.svg +22 -0
- package/cordis.patch.yml +9 -0
- package/cordis.yml +5 -0
- package/lib/client.js +3544 -0
- package/lib/dist-Dk2MQOZJ.js +2090 -0
- package/lib/index.d.ts +788 -0
- package/lib/index.js +4472 -0
- package/package.json +119 -6
package/lib/client.js
ADDED
|
@@ -0,0 +1,3544 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: "dsh-takeover",
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
var module = { exports: {} };
|
|
5
|
+
var exports = module.exports;
|
|
6
|
+
"use strict";
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
+
|
|
25
|
+
// src/client.ts
|
|
26
|
+
var client_exports = {};
|
|
27
|
+
__export(client_exports, {
|
|
28
|
+
CommandsGrid: () => CommandsGrid,
|
|
29
|
+
ComposerChip: () => ComposerChip,
|
|
30
|
+
ForeignBrowser: () => ForeignBrowser,
|
|
31
|
+
HELP_SVG: () => HELP_SVG,
|
|
32
|
+
HelpCard: () => HelpCard,
|
|
33
|
+
MEMORY_SVG: () => MEMORY_SVG,
|
|
34
|
+
MemoryCard: () => MemoryCard,
|
|
35
|
+
Panel: () => Panel,
|
|
36
|
+
PanelBoundary: () => PanelBoundary,
|
|
37
|
+
PendingList: () => PendingList,
|
|
38
|
+
PickupGuide: () => PickupGuide,
|
|
39
|
+
ProviderMatrix: () => ProviderMatrix,
|
|
40
|
+
SendCard: () => SendCard,
|
|
41
|
+
TargetChips: () => TargetChips,
|
|
42
|
+
WorkspaceBody: () => WorkspaceBody,
|
|
43
|
+
apply: () => apply,
|
|
44
|
+
buildReportHtml: () => buildReportHtml,
|
|
45
|
+
coverageTextOf: () => coverageTextOf,
|
|
46
|
+
envelopeCharsOf: () => envelopeCharsOf,
|
|
47
|
+
inject: () => inject,
|
|
48
|
+
rejectionCount: () => rejectionCount,
|
|
49
|
+
rejectionTitle: () => rejectionTitle,
|
|
50
|
+
reportWords: () => reportWords
|
|
51
|
+
});
|
|
52
|
+
module.exports = __toCommonJS(client_exports);
|
|
53
|
+
var import_react = require("react");
|
|
54
|
+
|
|
55
|
+
// src/brand-icons.ts
|
|
56
|
+
var BRAND_MARKS = {
|
|
57
|
+
claude: { viewBox: "0 0 24 24", tile: "#D97757", paths: [{ d: "m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z", fill: "#fff" }] },
|
|
58
|
+
codex: { viewBox: "0 0 24 24", tile: "#0f0f0f", paths: [{ d: "M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z", fill: "#fff" }] },
|
|
59
|
+
cursor: { viewBox: "0 0 24 24", tile: "#1a1a1a", paths: [{ d: "M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23", fill: "#fff" }] },
|
|
60
|
+
opencode: {
|
|
61
|
+
viewBox: "0 0 512 512",
|
|
62
|
+
tile: "#131010",
|
|
63
|
+
paths: [
|
|
64
|
+
// 白色方环即 opencode favicon 的全部可见形态(曾误塞一条 d="#5A5858" 的颜色串当「芯」,
|
|
65
|
+
// 浏览器对非法 path data 静默忽略——删掉让代码与渲染一致)
|
|
66
|
+
{ d: "M384 416H128V96H384V416ZM320 160H192V352H320V160Z", fill: "#fff" }
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
zcode: {
|
|
70
|
+
viewBox: "0 0 30 30",
|
|
71
|
+
tile: "#2D2D2D",
|
|
72
|
+
paths: [
|
|
73
|
+
{ d: "M15.47,7.1l-1.3,1.85c-0.2,0.29-0.54,0.47-0.9,0.47h-7.1V7.09C6.16,7.1,15.47,7.1,15.47,7.1z", fill: "#fff" },
|
|
74
|
+
{ d: "M24.3 7.1L13.14 22.91L5.7 22.91L16.86 7.1Z", fill: "#fff" },
|
|
75
|
+
{ d: "M14.53,22.91l1.31-1.86c0.2-0.29,0.54-0.47,0.9-0.47h7.09v2.33H14.53z", fill: "#fff" }
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
pi: {
|
|
79
|
+
viewBox: "0 0 800 800",
|
|
80
|
+
tile: "#27272a",
|
|
81
|
+
paths: [
|
|
82
|
+
{ d: "M165.29 165.29H517.36V400H400V282.65H165.29Z", fill: "#F09082" },
|
|
83
|
+
{ d: "M165.29 282.65H282.65V400H400V517.36H282.65V634.72H165.29Z", fill: "#4D9ABF" },
|
|
84
|
+
{ d: "M517.36 400H634.72V634.72H517.36Z", fill: "#F1BE58" }
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
dsh: { viewBox: "0 0 23.16 17.04", tile: "#4D6BFE", paths: [{ d: "M22.9168 1.43018C22.6713 1.31018 22.5658 1.53918 22.4223 1.65519C22.3733 1.69269 22.3318 1.74169 22.2903 1.78669C21.9317 2.1697 21.5127 2.42121 20.9657 2.39121C20.1657 2.34621 19.4827 2.59771 18.8787 3.20973C18.7502 2.45521 18.3236 2.0047 17.6746 1.71569C17.3351 1.56568 16.9916 1.41518 16.7536 1.08867C16.5876 0.856163 16.5421 0.597155 16.4591 0.341647C16.4061 0.187643 16.3536 0.0301382 16.1761 0.00363739C15.9836 -0.0263635 15.9081 0.135141 15.8326 0.270145C15.5306 0.822162 15.4136 1.43018 15.4251 2.0462C15.4516 3.43174 16.0366 4.53527 17.1991 5.3203C17.3311 5.4103 17.3651 5.5003 17.3236 5.63181C17.2441 5.90231 17.1501 6.16482 17.0671 6.43533C17.0141 6.60784 16.9351 6.64584 16.7501 6.57033C16.1121 6.30383 15.5611 5.90931 15.074 5.4328C14.2475 4.63328 13.5 3.75075 12.568 3.05973C12.349 2.89822 12.13 2.74822 11.9034 2.60522C10.9524 1.68169 12.028 0.923165 12.277 0.833162C12.5375 0.739159 12.3675 0.41615 11.5259 0.42015C10.6844 0.42365 9.91439 0.705658 8.93286 1.08117C8.78935 1.13767 8.63835 1.17867 8.48384 1.21267C7.59332 1.04367 6.66829 1.00617 5.70226 1.11517C3.88321 1.31768 2.43016 2.1777 1.36213 3.64575C0.0790928 5.4103 -0.222916 7.41536 0.146595 9.50642C0.535106 11.7105 1.66014 13.535 3.38869 14.9616C5.18125 16.4406 7.24581 17.1657 9.60138 17.0266C11.0319 16.9441 12.6245 16.7526 14.421 15.2321C14.874 15.4576 15.3496 15.5476 16.1381 15.6151C16.7456 15.6716 17.3306 15.5851 17.7836 15.4911C18.4931 15.3411 18.4441 14.6841 18.1876 14.5636C16.1081 13.595 16.5646 13.9891 16.1496 13.67C17.2061 12.42 18.8202 10.1979 19.3182 7.17235C19.3672 6.83834 19.4297 6.36783 19.4222 6.09732C19.4182 5.93231 19.4562 5.86831 19.6447 5.84931C20.1657 5.78931 20.6712 5.64681 21.1357 5.3913C22.4833 4.65528 23.0268 3.44624 23.1548 1.9972C23.1738 1.77569 23.1508 1.54668 22.9168 1.43018ZM11.1749 14.4736C9.15936 12.889 8.18184 12.3675 7.77832 12.39C7.40081 12.4125 7.46881 12.8445 7.55182 13.126C7.63882 13.404 7.75182 13.5955 7.91033 13.8396C8.01983 14.0011 8.09533 14.2411 7.80083 14.4216C7.15181 14.8231 6.02327 14.2866 5.97027 14.2601C4.65673 13.4865 3.5587 12.4655 2.78467 11.069C2.03715 9.72493 1.60314 8.28289 1.53164 6.74384C1.51264 6.37233 1.62214 6.24082 1.99215 6.17332C2.47916 6.08332 2.98118 6.06432 3.46769 6.13582C5.52476 6.43633 7.27581 7.35586 8.74385 8.8129C9.58188 9.64243 10.2159 10.634 10.8689 11.6025C11.5634 12.631 12.3105 13.611 13.262 14.4146C13.598 14.6961 13.866 14.9101 14.1225 15.0681C13.349 15.1546 12.058 15.1731 11.1749 14.4746L11.1749 14.4736ZM12.141 8.25988C12.141 8.09488 12.273 7.96338 12.439 7.96338C12.4765 7.96338 12.5105 7.97088 12.541 7.98188C12.5825 7.99688 12.6205 8.01938 12.6505 8.05338C12.7035 8.10588 12.7335 8.18088 12.7335 8.25988C12.7335 8.42489 12.6015 8.55639 12.4355 8.55639C12.2695 8.55639 12.141 8.42489 12.141 8.25988ZM15.1415 9.79893C14.949 9.87793 14.7565 9.94544 14.5715 9.95294C14.2845 9.96794 13.9715 9.85143 13.8015 9.70893C13.5375 9.48742 13.3485 9.36342 13.2695 8.97691C13.2355 8.8119 13.2545 8.55639 13.2845 8.40989C13.3525 8.09438 13.277 7.89187 13.0545 7.70787C12.8735 7.55786 12.643 7.51636 12.39 7.51636C12.2955 7.51636 12.209 7.47486 12.1445 7.44136C12.039 7.38886 11.9519 7.25735 12.035 7.09585C12.0615 7.04335 12.19 6.91584 12.22 6.89334C12.5635 6.69784 12.9595 6.76184 13.326 6.90834C13.6655 7.04735 13.9225 7.30236 14.292 7.66287C14.6695 8.09838 14.7375 8.21838 14.9525 8.54539C15.1225 8.8009 15.277 9.06341 15.3831 9.36392C15.4471 9.55142 15.3641 9.70493 15.1415 9.79893Z", fill: "#fff" }] },
|
|
88
|
+
grok: { viewBox: "0 0 256 246", tile: "#111111", paths: [{ d: "M63.8307299,56.8426545 C91.2989169,29.362978 131.465298,21.9776085 165.542128,34.9726459 L167.855892,35.8902557 C175.501463,38.7335174 182.164746,42.7796414 187.363427,46.5414469 L158.506099,59.882758 C131.637157,48.5973415 100.857492,56.2740175 82.0711204,75.0832754 C56.6656274,100.496833 51.5320736,144.566967 81.3069473,173.04336 L-1.42108547e-14,245.764227 C4.29613789,239.840925 9.45698399,234.190695 14.7493257,228.586421 L20.5645541,222.456072 L23.1726477,219.681571 C38.703877,203.027306 51.983468,185.912092 43.6693415,162.973056 L42.9033683,160.992465 C28.3109637,125.495663 36.8086459,83.896995 63.8307299,56.8426545 Z M220.785826,35.2560304 L256,0 L245.871984,14.068605 C224.778304,43.78544 215.415895,62.4930162 224.761831,102.727911 L224.69655,102.66263 C231.927394,133.390838 224.194269,167.466048 199.225391,192.464878 C167.746834,224.002573 117.372848,231.022982 75.8893821,202.634909 L104.811992,189.227703 C131.287711,199.638122 160.254097,195.066907 181.071863,174.224565 C201.890397,153.381454 206.565294,123.024196 196.101882,97.7634735 C194.113496,92.9733751 188.149873,91.7706665 183.977257,94.8542395 L98.8698734,157.755289 L220.785826,35.1466653 L220.785826,35.2560304 Z", fill: "#fff" }] }
|
|
89
|
+
};
|
|
90
|
+
var BRAND_FULL_SVG = {
|
|
91
|
+
workbuddy: '<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g clip-path="url(#clip0_542_3370)">\n<rect width="40" height="40" rx="20" fill="url(#paint0_linear_542_3370)"/>\n<g filter="url(#filter0_f_542_3370)">\n<circle cx="31.3411" cy="43.6183" r="12.8704" fill="#FFE355" fill-opacity="0.49" style="fill:#FFE355;fill:color(display-p3 1.0000 0.8891 0.3348);fill-opacity:0.49;"/>\n</g>\n<path d="M28.5931 3.12762C28.9853 2.77585 29.0091 2.76226 29.2968 2.74499C29.7628 2.71096 30.1894 2.93488 30.916 3.59634C32.6132 5.13875 34.9769 8.30904 36.4462 11.0168L37.0138 12.0682L37.8156 12.4668C38.5896 12.8579 39.8593 13.6593 40.3898 14.0895C40.6297 14.2878 40.6638 14.2925 40.9133 14.1954C42.0388 13.7572 43.6506 14.3382 45.0727 15.7024C46.3529 16.9294 47.5794 19.026 48.0491 20.7757C48.1177 21.0574 48.2087 21.6628 48.2419 22.1134C48.349 23.6964 47.8414 24.9608 46.8637 25.5331C46.664 25.6484 46.6505 25.6795 46.6561 26.1774C46.7011 28.5481 46.0621 30.9144 44.7785 33.2221C43.3293 35.8133 40.7489 38.4945 37.2566 41.0199C35.3813 42.3846 30.9445 44.9701 28.9382 45.8778C24.1324 48.0414 20.2794 48.8709 16.9329 48.4609C14.9368 48.219 12.6769 47.44 11.34 46.5355C10.9885 46.2925 10.9325 46.2774 10.6637 46.3543C9.2327 46.7651 7.35867 45.9207 5.76659 44.1535C5.13165 43.4471 4.1065 41.7127 3.77404 40.7843C3.0054 38.6118 3.15852 36.6506 4.18236 35.4799C4.44671 35.1785 4.45511 35.1658 4.39735 34.6589C4.30195 33.8289 4.25837 32.6008 4.30192 31.808L4.33666 31.0674L3.22502 29.101C1.5033 26.0375 0.409325 23.4645 -0.012563 21.4992C-0.235219 20.4218 -0.221193 19.9436 0.0522186 19.5899C0.21871 19.3763 0.764928 19.1545 1.42322 19.0329C3.08041 18.742 6.69466 19.0056 10.7155 19.7155L11.1329 19.788L12.0511 18.976C13.5747 17.6264 14.587 16.8696 16.4531 15.706C18.3981 14.4891 20.5929 13.4877 23.0648 12.695L23.8577 12.4414L24.2939 11.2964C25.8547 7.17615 27.4533 4.13844 28.5931 3.12762ZM15.5182 24.243C13.7542 25.2615 12.8718 25.7706 12.2236 26.3413C9.59893 28.6526 8.61811 32.3134 9.73545 35.6274C10.0114 36.4457 10.5201 37.3283 11.5386 39.0923C12.5571 40.8564 13.0671 41.7383 13.6378 42.3864C15.9491 45.0112 19.6103 45.9929 22.9243 44.8755C23.7426 44.5995 24.6249 44.0899 26.3888 43.0714L36.5375 37.2121C38.3016 36.1936 39.184 35.6845 39.8321 35.1137C42.4568 32.8024 43.4373 29.1409 42.3198 25.8269C42.0438 25.0086 41.5342 24.1264 40.5158 22.3624C39.4973 20.5983 38.9882 19.7159 38.4175 19.0678C36.1062 16.4432 32.4454 15.4622 29.1314 16.5796C28.3131 16.8556 27.431 17.3651 25.6669 18.3836L15.5182 24.243Z" fill="url(#paint1_linear_542_3370)"/>\n<rect x="16.4961" y="31.3344" width="4.00904" height="8.32646" rx="2.00452" transform="rotate(-30 16.4961 31.3344)" fill="white" style="fill:white;fill-opacity:1;"/>\n<rect x="27.3125" y="25.0894" width="4.00904" height="8.32646" rx="2.00452" transform="rotate(-30 27.3125 25.0894)" fill="white" style="fill:white;fill-opacity:1;"/>\n</g>\n<defs>\n<filter id="filter0_f_542_3370" x="7.47033" y="19.7475" width="47.742" height="47.7416" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>\n<feGaussianBlur stdDeviation="5.50019" result="effect1_foregroundBlur_542_3370"/>\n</filter>\n<linearGradient id="paint0_linear_542_3370" x1="20" y1="0" x2="20" y2="40" gradientUnits="userSpaceOnUse">\n<stop stop-color="#0EC8A9" style="stop-color:#0EC8A9;stop-color:color(display-p3 0.0565 0.7837 0.6625);stop-opacity:1;"/>\n<stop offset="1" stop-color="#01C886" style="stop-color:#01C886;stop-color:color(display-p3 0.0021 0.7858 0.5246);stop-opacity:1;"/>\n</linearGradient>\n<linearGradient id="paint1_linear_542_3370" x1="14.6642" y1="11.0783" x2="33.3762" y2="43.4885" gradientUnits="userSpaceOnUse">\n<stop stop-color="white" stop-opacity="0.8" style="stop-color:white;stop-opacity:0.8;"/>\n<stop offset="0.437689" stop-color="white" style="stop-color:white;stop-opacity:1;"/>\n</linearGradient>\n<clipPath id="clip0_542_3370">\n<rect width="40" height="40" rx="20" fill="white" style="fill:white;fill-opacity:1;"/>\n</clipPath>\n</defs>\n</svg>'
|
|
92
|
+
};
|
|
93
|
+
var PROVIDER_LABEL = {
|
|
94
|
+
claude: "Claude Code",
|
|
95
|
+
codex: "Codex CLI",
|
|
96
|
+
opencode: "OpenCode",
|
|
97
|
+
zcode: "ZCode",
|
|
98
|
+
pi: "Pi",
|
|
99
|
+
workbuddy: "WorkBuddy",
|
|
100
|
+
cursor: "Cursor",
|
|
101
|
+
grok: "Grok CLI",
|
|
102
|
+
gemini: "Gemini CLI",
|
|
103
|
+
dsh: "DeepSeek Harness"
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// src/locales.ts
|
|
107
|
+
var NS = "dsh-takeover";
|
|
108
|
+
var zh = {
|
|
109
|
+
appTitle: "dsh-takeover \u4F1A\u8BDD\u63A5\u7BA1",
|
|
110
|
+
appSubtitle: "\u547D\u4EE4\u901F\u89C8 \xB7 \u8BFB\u53D6\u5668\u5F00\u5173 \xB7 \u5DE5\u4F5C\u53F0\u5728\u4F1A\u8BDD\u8F93\u5165\u6846\u5185\u300C\u63A5\u529B\u300D\u6309\u94AE",
|
|
111
|
+
refresh: "\u27F3 \u5237\u65B0",
|
|
112
|
+
cmdTitle: "\u547D\u4EE4\u901F\u89C8",
|
|
113
|
+
cmdBadge: "\u4F1A\u8BDD\u91CC\u7528\uFF0C\u5361\u7247\u53EA\u8BFB",
|
|
114
|
+
cmdHandoffDesc: "\u5BC4\u5B58\u5F53\u524D\u4F1A\u8BDD \u2192 \u6536\u4EF6\u7BB1",
|
|
115
|
+
cmdInboxDesc: "\u5F00\u5C40\u53D6\u4EF6\uFF08\u6D88\u8D39\u5373\u5F03\uFF09",
|
|
116
|
+
cmdResumeDesc: "\u62C9\u53D6 {name} \u4F1A\u8BDD",
|
|
117
|
+
cmdOffTitle: "{label} \u5DF2\u5728\u652F\u6301\u77E9\u9635\u505C\u7528\uFF0C\u547D\u4EE4\u4F1A\u8FD4\u56DE\u300C\u5DF2\u505C\u7528\u300D",
|
|
118
|
+
inboxTitle: "\u6536\u4EF6\u7BB1\u6982\u89C8",
|
|
119
|
+
badgePending: "\u5F85\u53D6\u4EF6 {n}",
|
|
120
|
+
badgeArchived: "\u5DF2\u5B58\u6863 {n}",
|
|
121
|
+
pendingDupChip: "\u91CD\u590D {n}",
|
|
122
|
+
rejectionsBadge: "\u62D2\u6536 {n}",
|
|
123
|
+
rejectionsTitle: "\u5199=\u5BC4\u5B58\u95F8\u62D2\u6536 \u8BFB=\u8BFB\u4FA7\u574F\u5361 \u53D6=\u53D6\u4EF6\u6838\u9A8C\u5F02\u5E38",
|
|
124
|
+
pendingDupTitle: "\u540C id \u91CD\u590D\u6587\u4EF6\u5DF2\u6309\u9996\u89C1\u53BB\u91CD\u2014\u2014\u591A\u65B9\u53EF\u5199\u6536\u4EF6\u7BB1\u7684\u9632\u5FA1\u8BA1\u6570",
|
|
125
|
+
pendingDirHint: "\u5BF9\u5E94\u76EE\u5F55 ~/.handoff/pending/",
|
|
126
|
+
archivedDirHint: "\u5DF2\u6D88\u8D39\u5361\u7684\u5B58\u6863\u76EE\u5F55 ~/.handoff/archived/\uFF08\u6EDA\u52A8\u4FDD\u7559\u6700\u8FD1 50 \u5F20\uFF0C\u66F4\u65E9\u7684\u81EA\u52A8\u6E05\u7406\uFF09",
|
|
127
|
+
clearArchived: "\u6E05\u7A7A\u5DF2\u6D88\u8D39",
|
|
128
|
+
clearConfirm: "\u786E\u8BA4\u6E05\u7A7A {n} \u5F20\uFF1F\u4E0D\u53EF\u6062\u590D",
|
|
129
|
+
clearArchivedTitle: "\u5220\u9664 archived/ \u76EE\u5F55\u4E0B\u5168\u90E8\u5DF2\u6D88\u8D39\u5361\u7247\uFF08\u4E0D\u53EF\u6062\u590D\uFF09",
|
|
130
|
+
dismissBtn: "\u5FFD\u7565",
|
|
131
|
+
dismissingBtn: "\u5FFD\u7565\u4E2D\u2026",
|
|
132
|
+
dismissTitle: "\u8FD9\u5F20\u5361\u4E0D\u63A5\u4E86\uFF1A\u539F\u6837\u79FB\u5165 archived/ \u5B58\u6863\uFF08\u4E0D\u6D88\u8D39\u3001\u53EF\u8FFD\u6EAF\uFF09",
|
|
133
|
+
dismissedNotice: "\u5DF2\u5FFD\u7565 {id}\u2014\u2014\u5361\u4E0E\u4FE1\u5C01\u539F\u6837\u79FB\u5165 archived/",
|
|
134
|
+
emptyInbox: "\u6536\u4EF6\u7BB1\u4E3A\u7A7A\u2014\u2014\u8FD8\u6CA1\u6709\u5F85\u53D6\u4EF6\u7684\u4EA4\u63A5\u5361\u3002\u5BC4\u5B58\u540E\u5361\u7247\u4F1A\u51FA\u73B0\u5728\u8FD9\u91CC\uFF0C\u70B9\u5361\u7247\u4E0A\u7684\u300C\u4E00\u952E\u53D6\u4EF6\u300D\u5373\u53EF\u5F00\u5DE5\uFF1B\u4E5F\u53EF\u4EE5\u5728\u4F1A\u8BDD\u91CC\u8F93\u5165 /inbox \u53D6\u4EF6\u3002",
|
|
135
|
+
from: "\u6765\u6E90 {name}",
|
|
136
|
+
project: "\u9879\u76EE {name}",
|
|
137
|
+
idLabel: "\u7F16\u53F7 {id}",
|
|
138
|
+
previewEmpty: "\uFF08\u5361\u7247\u6B63\u6587\u4E3A\u7A7A\uFF09",
|
|
139
|
+
previewHint: "\u2014\u2014 \u9884\u89C8\u622A\u81EA\u5361\u7247\u6B63\u6587\uFF08\u76EE\u6807\u6BB5\u7A7A\u65F6\u56DE\u9000\u53D6\u300C\u505A\u5230\u54EA\u300D\u6BB5\uFF09\uFF1B\u5B8C\u6574\u5185\u5BB9\u8BF7\u5728\u4F1A\u8BDD\u91CC\u8F93\u5165 /inbox \u67E5\u770B\u3002",
|
|
140
|
+
filterPlaceholder: "\u8FC7\u6EE4\uFF1A\u6807\u9898 / \u6765\u6E90 / \u7F16\u53F7\u2026",
|
|
141
|
+
filterAria: "\u6536\u4EF6\u7BB1\u5373\u65F6\u8FC7\u6EE4\uFF08\u5339\u914D\u6807\u9898\u3001\u6765\u6E90\u540D\u6216\u7F16\u53F7\uFF0C\u6E05\u7A7A\u5373\u6062\u590D\u5168\u90E8\uFF09",
|
|
142
|
+
filterShortcut: "\u5FEB\u6377\u952E / \u6216 Ctrl/\u2318+K \u805A\u7126\uFF1B\u6709\u5B57\u65F6 Esc \u6E05\u7A7A",
|
|
143
|
+
chipAll: "\u5168\u90E8",
|
|
144
|
+
newOnlyChip: "\u53EA\u770B\u65B0\u5361",
|
|
145
|
+
newOnlyAria: "\u53EA\u663E\u793A\u6CA1\u5C55\u5F00\u770B\u8FC7\u7684\u5361",
|
|
146
|
+
chipSourceAria: "\u6309\u6765\u6E90\u7B5B\u9009\u5F85\u53D6\u4EF6",
|
|
147
|
+
filterEmpty: "\u6CA1\u6709\u5339\u914D\u7684\u5361\u7247\u2014\u2014\u6E05\u7A7A\u8FC7\u6EE4\u6846\u53EF\u6062\u590D\u5168\u90E8",
|
|
148
|
+
newBadge: "\u65B0",
|
|
149
|
+
groupCount: "\u5171 {n} \u5F20",
|
|
150
|
+
groupAria: "{title}\uFF0C\u5171 {n} \u5F20",
|
|
151
|
+
unknownSource: "\uFF08\u672A\u77E5\u6765\u6E90\uFF09",
|
|
152
|
+
lowInfoGroup: "\u7591\u4F3C\u7A7A\u5361\uFF08{n}\uFF09\u2014\u2014\u5185\u5BB9\u5168\u662F\u5360\u4F4D\u6A21\u677F\uFF0C\u591A\u534A\u662F\u8BEF\u64CD\u4F5C\u751F\u6210\u7684",
|
|
153
|
+
lowInfoBadge: "\u7A7A\u5361\uFF1F",
|
|
154
|
+
exportCard: "\u5BFC\u51FA .md",
|
|
155
|
+
exportCardTitle: "\u4E0B\u8F7D\u8BE5\u5361\u7247\u4E3A .md\uFF08frontmatter + \u516D\u6BB5\uFF1Bstate \u672A\u542B\u7684\u6BB5\u5168\u6587\u5C31\u5730\u6CE8\u660E\uFF0C\u4E0D\u81C6\u9020\uFF09",
|
|
156
|
+
exportAll: "\u5BFC\u51FA\u5168\u90E8",
|
|
157
|
+
exportAllTitle: "\u628A\u5168\u90E8\u5F85\u53D6\u4EF6\u5361\u7247\u62FC\u6210\u4E00\u4E2A .md \u4E0B\u8F7D\uFF08\u96F6\u4F9D\u8D56\uFF0C\u7EAF\u524D\u7AEF\u751F\u6210\uFF09",
|
|
158
|
+
exportMenu: "\u5BFC\u51FA \u25BE",
|
|
159
|
+
exportMenuAria: "\u5BFC\u51FA\u83DC\u5355\uFF1A\u5168\u90E8\u5361\u7247 .md \u6216 HTML \u62A5\u544A",
|
|
160
|
+
exportNoteTop: "> \u672C\u6587\u4EF6\u7531 dsh-takeover \u5BFC\u51FA\uFF0C\u4EC5\u542B\u6536\u4EF6\u7BB1 state \u63D0\u4F9B\u7684\u5B57\u6BB5\uFF1A\u7F16\u53F7 / \u6765\u6E90 / \u6807\u9898 / \u9879\u76EE / \u63A8\u9001\u65F6\u95F4\uFF0C\u4EE5\u53CA\u300C\u76EE\u6807\u300D\u6BB5\u9884\u89C8\uFF08\u670D\u52A1\u7AEF\u622A 240 \u5B57\uFF1B\u76EE\u6807\u6BB5\u4E3A\u7A7A\u65F6\u56DE\u9000\u300C\u505A\u5230\u54EA\u300D\u6BB5\uFF09\u3002\u6765\u6E90\u4F1A\u8BDD\u3001cwd\u3001git \u5FEB\u7167\u3001tasks \u4E0E\u5176\u4F59\u4E94\u6BB5\u5168\u6587\u4E0D\u5728 state \u5185\uFF0C\u672A\u4F5C\u81C6\u9020\u2014\u2014\u5B8C\u6574\u5361\u7247\u8BF7\u56DE\u4F1A\u8BDD\u7528 /inbox \u53D6\u4EF6\u3002",
|
|
161
|
+
exportSectionMissing: "\uFF08\u8BE5\u6BB5\u5168\u6587\u4E0D\u5728\u6B64\u6587\u4EF6\uFF1A\u8BBE\u7F6E\u5361 state \u672A\u63D0\u4F9B\u3002\u56DE\u4F1A\u8BDD\u7528 /inbox \u53D6\u4EF6\u67E5\u770B\u5B8C\u6574\u5361\u7247\u3002\uFF09",
|
|
162
|
+
exportHtml: "\u5BFC\u51FA HTML \u62A5\u544A",
|
|
163
|
+
exportHtmlTitle: "\u751F\u6210\u81EA\u5305\u542B\u5355\u6587\u4EF6 HTML \u62A5\u544A\u5E76\u4E0B\u8F7D\uFF08\u4E5D\u5BB6\u652F\u6301\u77E9\u9635 + \u5168\u90E8\u5F85\u53D6\u4EF6\u5361\u7247 + \u5DF2\u6D88\u8D39\u8BA1\u6570\uFF1B\u96F6\u4F9D\u8D56\u7EAF\u524D\u7AEF\u751F\u6210\uFF0C\u5185\u5BB9\u4E0E state \u9010\u5B57\u6BB5\u4E00\u81F4\uFF09",
|
|
164
|
+
envelopeArchived: "\u4FE1\u5C01\u9644\u4EF6 {v}",
|
|
165
|
+
envelopeArchivedTitle: "\u4FE1\u5C01\u9644\u4EF6\uFF1A\u5DF2\u6D88\u8D39\u5361\u7684\u968F\u5361\u9644\u4EF6\uFF08\u673A\u5668\u4FE1\u5C01 JSON\uFF09\u603B\u5B57\u7B26\u6570\uFF0C\u53D6\u4EF6\u65F6\u7528\u4E8E\u6838\u5BF9\u73AF\u5883",
|
|
166
|
+
coverageBadge: "\u8FDB\u5C55\u53EF\u67E5\u8BC1 {v}",
|
|
167
|
+
coverageBadgeTitle: "\u8D26\u672C\u8986\u76D6\uFF1A\u4EA4\u63A5\u5361\u300C\u505A\u5230\u54EA\u300D\u6BB5\u6807\u6CE8\u4E86\u8BC1\u636E\u72B6\u6001\u7684\u9648\u8FF0\u5360\u6BD4\uFF08x/y\uFF09\u3002\u56DB\u6001\uFF1A\u5F53\u4E0B\u4E8B\u5B9E / \u5386\u53F2\u6C47\u62A5 / \u4E0D\u7B26 / \u4E0D\u53EF\u7528\u2014\u2014\u5386\u53F2\u6C47\u62A5\u6C38\u8FDC\u5EFA\u8BAE\u5148\u6838\u5BF9\u518D\u6267\u884C",
|
|
168
|
+
matrixTitle: "\u652F\u6301\u77E9\u9635\uFF08\u4E5D\u5BB6\u8BFB\u53D6\u5668\uFF09",
|
|
169
|
+
browserTitle: "\u5916\u90E8\u4F1A\u8BDD\u6D4F\u89C8\u5668",
|
|
170
|
+
sidebarTabTitle: "\u63A5\u529B",
|
|
171
|
+
sidebarTabDesc: "\u6D4F\u89C8\u4E5D\u5BB6\u5916\u90E8 agent \u4F1A\u8BDD\u3001\u4E00\u952E\u63A5\u7BA1\u4E0E\u4F1A\u8BDD\u6536\u4EF6\u7BB1\u2014\u2014agent \u4E4B\u95F4\u4F20\u4E0A\u4E0B\u6587\u63A5\u7740\u5E72",
|
|
172
|
+
popoverTitle: "\u63A5\u529B\u5DE5\u4F5C\u53F0",
|
|
173
|
+
popoverSubtitle: "\u5728\u591A\u4E2A agent \u4E4B\u95F4\u63A5\u529B\u5E72\u6D3B\uFF1A\u63A5\u7BA1\u5916\u90E8\u4F1A\u8BDD\u63A5\u7740\u8DD1\u3001\u628A\u5F53\u524D\u4F1A\u8BDD\u4EA4\u63A5\u51FA\u53BB\u3001\u7528\u6536\u4EF6\u7BB1\u4F20\u4EA4\u63A5\u5361\u3002",
|
|
174
|
+
onboard1: "\u5728\u53F3\u4FA7\u70B9\u4E00\u5BB6 agent \u7684\u540D\u5B57\uFF0C\u6D4F\u89C8\u5B83\u7684\u6700\u8FD1\u4F1A\u8BDD",
|
|
175
|
+
onboard2: "\u70B9\u300C\u63A5\u7BA1\u300D\uFF0C\u65B0\u4F1A\u8BDD\u81EA\u52A8\u63A5\u7740\u8DD1",
|
|
176
|
+
onboard3: "\u5E72\u5B8C\u70B9\u300C\u4EA4\u63A5\u51FA\u53BB\u300D\uFF0C\u628A\u6D3B\u5BC4\u5B58\u7ED9\u4E0B\u4E00\u68D2",
|
|
177
|
+
onboardDone: "\u77E5\u9053\u4E86",
|
|
178
|
+
closeBtn: "\u5173\u95ED",
|
|
179
|
+
// 工作台重排(导航轨 + 四视图,DESIGN.md §5)
|
|
180
|
+
navAria: "\u5DE5\u4F5C\u53F0\u89C6\u56FE",
|
|
181
|
+
navInbox: "\u6536\u4EF6\u7BB1",
|
|
182
|
+
navBrowser: "\u4F1A\u8BDD\u6D4F\u89C8\u5668",
|
|
183
|
+
navGuide: "\u4E0A\u624B\u6307\u5357",
|
|
184
|
+
navBrowserBadgeTitle: "\u9ED8\u8BA4\u524D\u7F6E\u5BB6\uFF08{label}\uFF09\u7684\u672C\u5730\u4F1A\u8BDD\u6570\uFF1B\u5728\u89C6\u56FE\u91CC\u6362\u5BB6\u540E\u4EE5\u89C6\u56FE\u5185 chips \u4E3A\u51C6",
|
|
185
|
+
tilePending: "\u5F85\u53D6\u4EF6",
|
|
186
|
+
tileArchived: "\u5DF2\u5B58\u6863",
|
|
187
|
+
tileCoverage: "\u8FDB\u5C55\u53EF\u67E5\u8BC1",
|
|
188
|
+
tileEnvelope: "\u4FE1\u5C01\u9644\u4EF6",
|
|
189
|
+
tileRejected: "\u62D2\u6536",
|
|
190
|
+
tileDup: "\u91CD\u590D",
|
|
191
|
+
viewInboxSub: "{n} \u5F20\u5F85\u53D6\u4EF6 \xB7 \u6D88\u8D39\u5373\u5F03 \xB7 \u8D26\u672C\u53EF\u67E5\u8BC1",
|
|
192
|
+
viewMemorySub: "\u628A\u957F\u671F\u8BB0\u5FC6\u968F\u4EA4\u63A5\u5361\u5E26\u7ED9\u5BF9\u9762",
|
|
193
|
+
versionTitle: "\u63D2\u4EF6\u7248\u672C\uFF08\u6784\u5EFA\u671F\u6CE8\u5165 package.json\uFF09",
|
|
194
|
+
targetGroupLabel: "\u4EA4\u63A5\u7ED9\u8C01\uFF1A",
|
|
195
|
+
browserGroupLabel: "\u6D4F\u89C8\u8C01\u5BB6\u7684\u4F1A\u8BDD\uFF1A",
|
|
196
|
+
sendBtnTo: "\u4EA4\u63A5\u7ED9 {label}",
|
|
197
|
+
settingsPointer: "\u6D4F\u89C8\u4E0E\u4E00\u952E\u63A5\u7BA1\u5728\u4F1A\u8BDD\u8F93\u5165\u6846\u5185\uFF1A\u70B9\u300C\u63A5\u529B\u300D\u6309\u94AE\u5C55\u5F00\u5DE5\u4F5C\u53F0\u3002",
|
|
198
|
+
browserHint: "\u70B9\u4E00\u5BB6 agent \u7684\u540D\u5B57\uFF0C\u5217\u51FA\u5B83\u5728\u672C\u673A\u7684\u6700\u8FD1\u4F1A\u8BDD\uFF1B\u70B9\u300C\u63A5\u7BA1\u300D\u76F4\u63A5\u5F00\u65B0\u4F1A\u8BDD\u63A5\u7740\u8DD1\u3002",
|
|
199
|
+
actionSegAria: "\u63A5\u529B\u52A8\u4F5C\uFF1A\u6D4F\u89C8\u4F1A\u8BDD / \u4EA4\u63A5\u51FA\u53BB / \u8BB0\u5FC6\u5FEB\u7167",
|
|
200
|
+
browserPick: "\u70B9\u4E0A\u9762\u4EFB\u610F\u4E00\u5BB6\u5F00\u59CB\u6D4F\u89C8\u2014\u2014\u70B9\u8C01\u8BFB\u8C01\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u626B\u63CF\u3002",
|
|
201
|
+
browserEmpty: "\u8BE5\u8BFB\u53D6\u5668\u672C\u673A\u6CA1\u6709\u53D1\u73B0\u4F1A\u8BDD",
|
|
202
|
+
browserTotal: "\u5171 {m} \u4E2A\uFF0C\u663E\u793A\u6700\u8FD1 {n} \u4E2A",
|
|
203
|
+
browserNote: "\u63D0\u793A\uFF1A{note}",
|
|
204
|
+
browserChipAria: "\u9009\u62E9\u8981\u6D4F\u89C8\u7684\u8BFB\u53D6\u5668",
|
|
205
|
+
browserFilterEmpty: "\u6CA1\u6709\u5339\u914D\u7684\u4F1A\u8BDD\u2014\u2014\u6E05\u7A7A\u8FC7\u6EE4\u6846\u53EF\u6062\u590D\u5168\u90E8",
|
|
206
|
+
browserDisabledTitle: "{label} \u5DF2\u505C\u7528\u6216\u672C\u673A\u4E0D\u652F\u6301\uFF0C\u4E0D\u53EF\u6D4F\u89C8",
|
|
207
|
+
filterSessionsPlaceholder: "\u8FC7\u6EE4\uFF1A\u6807\u9898 / \u76EE\u5F55 / id\u2026",
|
|
208
|
+
filterSessionsAria: "\u5916\u90E8\u4F1A\u8BDD\u5373\u65F6\u8FC7\u6EE4\uFF08\u5339\u914D\u6807\u9898\u3001\u76EE\u5F55\u6216 id\uFF0C\u6E05\u7A7A\u5373\u6062\u590D\u5168\u90E8\uFF09",
|
|
209
|
+
takeoverBtn: "\u63A5\u7BA1",
|
|
210
|
+
takeoverTitle: "\u4E00\u952E\u6295\u9012\u5230\u65B0\u4F1A\u8BDD\uFF08\u5931\u8D25\u81EA\u52A8\u9000\u56DE\u590D\u5236\u6307\u4EE4\uFF09",
|
|
211
|
+
depositBtn: "\u63A5\u7BA1\u5E76\u5BC4\u5B58",
|
|
212
|
+
depositTitle: "\u63A5\u7BA1\u5230\u65B0\u4F1A\u8BDD\uFF0C\u5E76\u8BA9\u5B83\u5728\u5B8C\u6210\u540E\u628A\u4EA4\u63A5\u5361\u5BC4\u5B58\u8FDB\u6536\u4EF6\u7BB1\uFF08\u7ED9\u4E0B\u4E00\u68D2\uFF09\u3002",
|
|
213
|
+
deliveringBtn: "\u6295\u9012\u4E2D\u2026",
|
|
214
|
+
takeoverBusyBtn: "\u63A5\u7BA1\u4E2D\u2026",
|
|
215
|
+
takeoverDoneBtn: "\u5DF2\u63A5\u7BA1 \u2713",
|
|
216
|
+
inboxBusyBtn: "\u53D6\u4EF6\u4E2D\u2026",
|
|
217
|
+
deliveredBtn: "\u5DF2\u6295\u9012 \u2713",
|
|
218
|
+
fallbackCopyBtn: "\u6295\u9012\u5931\u8D25\uFF0C\u5DF2\u590D\u5236\u6307\u4EE4",
|
|
219
|
+
fallbackNotice: "\u6295\u9012\u5931\u8D25\uFF08{reason}\uFF09\uFF1A\u6307\u4EE4\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F\uFF0C\u7C98\u8FDB\u8F93\u5165\u6846\u5373\u53EF\u7EE7\u7EED\u3002",
|
|
220
|
+
copiedBtn: "\u5DF2\u590D\u5236 \u2713",
|
|
221
|
+
copyIdTitle: "\u70B9\u51FB\u590D\u5236\u5B8C\u6574\u4F1A\u8BDD id",
|
|
222
|
+
previewTurns: "\u8F6E\u6570 {n}\uFF08\u7528\u6237 {u}\uFF09",
|
|
223
|
+
previewFirst: "\u9996\u6761\u7528\u6237\u8BF7\u6C42",
|
|
224
|
+
previewTail: "\u5C3E\u90E8\u8FDB\u5C55",
|
|
225
|
+
previewStop: "\u505C\u5728\u54EA",
|
|
226
|
+
previewLoadFail: "\u9884\u89C8\u5931\u8D25",
|
|
227
|
+
deliveredNotice: "\u5DF2\u521B\u5EFA\u4F1A\u8BDD\u300C{title}\u300D\u5E76\u6295\u9012\u2014\u2014\u53BB\u4F1A\u8BDD\u6811\u70B9\u5B83\u67E5\u770B\u63A5\u7BA1\u8FDB\u5EA6",
|
|
228
|
+
deliveredNoticeNav: "\u5DF2\u521B\u5EFA\u4F1A\u8BDD\u300C{title}\u300D\u5E76\u6295\u9012\uFF0C\u5DF2\u4E3A\u4F60\u5207\u6362\u2014\u2014\u5173\u6389\u672C\u9762\u677F\u5373\u53EF\u770B\u63A5\u7BA1\u8FDB\u5EA6",
|
|
229
|
+
inboxTakeBtn: "\u4E00\u952E\u53D6\u4EF6",
|
|
230
|
+
inboxTakeTitle: "\u65B0\u5EFA\u4F1A\u8BDD\u5E76\u6295\u9012 /inbox\uFF08\u6D88\u8D39\u5373\u5F03\uFF09",
|
|
231
|
+
chainBadge: "\u2190 \u63A5\u529B\u81EA {id}",
|
|
232
|
+
chainBadgeTitle: "\u672C\u5361\u63A5\u66FF\u524D\u7F6E\u5361 {id}\uFF08\u63A5\u529B\u94FE\uFF09",
|
|
233
|
+
chainFilterBtn: "\u53EA\u770B\u6B64\u94FE",
|
|
234
|
+
chainFilterTitle: "\u628A\u8FC7\u6EE4\u8BCD\u8BBE\u4E3A {id}\uFF0C\u53EA\u770B\u8FD9\u6761\u63A5\u529B\u94FE\u7684\u76F8\u5173\u5361",
|
|
235
|
+
subagentBadge: "\u5B50\u4EE3\u7406",
|
|
236
|
+
subagentGroup: "\u5B50\u4EE3\u7406\u4F1A\u8BDD\uFF08{n}\uFF09",
|
|
237
|
+
facetCwdAria: "\u6309\u9879\u76EE\u7B5B\u9009\u4F1A\u8BDD",
|
|
238
|
+
sessionsCount: "{n} \u4E2A\u4F1A\u8BDD",
|
|
239
|
+
sessionsProbeFail: "\u4F1A\u8BDD\u6570\u63A2\u6D4B\u5931\u8D25",
|
|
240
|
+
unsupported: "\u672C\u673A\u4E0D\u652F\u6301",
|
|
241
|
+
unsupportedNote: "\u672C\u673A\u4E0D\u652F\u6301\uFF1A{note}",
|
|
242
|
+
pillOk: "\u652F\u6301",
|
|
243
|
+
pillNo: "\u4E0D\u53EF\u7528",
|
|
244
|
+
// 黄=待确认(DESIGN.md §2 状态三色纪律):目录存在但 0 会话(假 0 哨兵)/ 会话数探测失败
|
|
245
|
+
pillPending: "\u5F85\u786E\u8BA4",
|
|
246
|
+
toggleDisable: "\u70B9\u51FB\u505C\u7528 {label}\uFF08foreign_session_read \u5C06\u8FD4\u56DE\u300C\u5DF2\u505C\u7528\u300D\uFF09",
|
|
247
|
+
toggleEnable: "\u70B9\u51FB\u542F\u7528 {label}",
|
|
248
|
+
toggleAria: "{label}\uFF08{id}\uFF09\u8BFB\u53D6\u5F00\u5173",
|
|
249
|
+
// 设置卡三段页签(DESIGN.md §4 设置卡页签)
|
|
250
|
+
tabsAria: "\u8BBE\u7F6E\u5361\u5206\u533A\uFF1A\u547D\u4EE4\u901F\u89C8 / \u652F\u6301\u77E9\u9635 / \u5F00\u5173\u8BED\u4E49",
|
|
251
|
+
tabCmds: "\u547D\u4EE4\u901F\u89C8",
|
|
252
|
+
tabMatrix: "\u652F\u6301\u77E9\u9635",
|
|
253
|
+
tabSemantics: "\u5F00\u5173\u8BED\u4E49",
|
|
254
|
+
noteSummary: "\u{1F4A1} \u5F00\u5173\u8BED\u4E49\u8BF4\u660E",
|
|
255
|
+
noteBody: "\u5173\u6389\u7684 provider\uFF1Aforeign_session_read \u5BF9\u8BE5\u5BB6\u8FD4\u56DE\u89C4\u8303\u9519\u8BEF\u503C\u300C\u5DF2\u505C\u7528\u300D\uFF1B/resume-* \u5BF9\u5E94 skill \u7684\u6307\u5F15\u6587\u672C\u4E3A\u9759\u6001\u5185\u5BB9\uFF0C\u505C\u7528\u72B6\u6001\u7531\u5DE5\u5177\u62A5\u9519\u515C\u4F4F\uFF0C\u6A21\u578B\u53EF\u89C1\u3002\u4F1A\u8BDD\u6570\u4E3A 0 \u7684\u7070\u8272\u884C\u8868\u793A\u8BE5\u5BB6\u672C\u673A\u672A\u88C5\u6216\u6682\u65E0\u4F1A\u8BDD\uFF0C\u5F00\u5173\u4FDD\u7559\u4F46\u65E0\u6570\u636E\u53EF\u8BFB\u3002",
|
|
256
|
+
noteBodyPending: "\u72B6\u6001 pill\uFF1A\u7EFF\u300C\u652F\u6301\u300D= \u8BFB\u53D6\u5668\u53EF\u7528\u4E14\u53D1\u73B0\u4E86\u4F1A\u8BDD\uFF1B\u9EC4\u300C\u5F85\u786E\u8BA4\u300D= \u5B58\u50A8\u76EE\u5F55\u5B58\u5728\u4F46\u672A\u53D1\u73B0\u4F1A\u8BDD\uFF08\u4E0A\u6E38\u53EF\u80FD\u8FC1\u79FB\u4E86\u5B58\u50A8\u5E03\u5C40\uFF09\u6216\u4F1A\u8BDD\u6570\u63A2\u6D4B\u5931\u8D25\u2014\u2014\u4E0D\u7B49\u4E8E\u6545\u969C\uFF0C\u60AC\u6D6E\u8BE5\u884C\u770B\u63D0\u793A\uFF1B\u9EC4\u300C\u4E0D\u53EF\u7528\u300D= \u672C\u673A\u4E0D\u652F\u6301\u8BE5\u8BFB\u53D6\u5668\u3002",
|
|
257
|
+
loading: "\u52A0\u8F7D\u4E2D\u2026",
|
|
258
|
+
noTime: "\uFF08\u65E0\u65F6\u95F4\uFF09",
|
|
259
|
+
renderErrorTitle: "dsh-takeover \u6E32\u67D3\u51FA\u9519\uFF08\u628A\u4E0B\u9762\u8FD9\u6BB5\u53D1\u7ED9\u7EF4\u62A4\u8005\uFF09",
|
|
260
|
+
reportTitle: "dsh-takeover \u4EA4\u63A5\u62A5\u544A",
|
|
261
|
+
reportSubtitle: "\u4F1A\u8BDD\u63A5\u7BA1\u6536\u4EF6\u7BB1\u5FEB\u7167\uFF08\u4E5D\u5BB6\u8BFB\u53D6\u5668 \xB7 \u5F85\u53D6\u4EF6\u5361\u7247 \xB7 \u5DF2\u6D88\u8D39\u8BA1\u6570\uFF09",
|
|
262
|
+
reportGenerated: "\u751F\u6210\u4E8E {n}",
|
|
263
|
+
reportNote: "\u672C\u62A5\u544A\u7531 dsh-takeover \u8BBE\u7F6E\u5361\u5BFC\u51FA\uFF0C\u4E3A\u81EA\u5305\u542B\u5355\u6587\u4EF6 HTML\uFF0C\u5185\u5BB9\u4EC5\u6765\u81EA /dsh-takeover/state \u5F53\u524D\u8FD4\u56DE\uFF1A\u5F85\u53D6\u4EF6\u5361\u7247\uFF08\u7F16\u53F7 / \u6765\u6E90 / \u6807\u9898 / \u9879\u76EE / \u63A8\u9001\u65F6\u95F4\u4E0E\u300C\u76EE\u6807\u300D\u6BB5\u9884\u89C8\uFF09\u3001\u4E5D\u5BB6\u652F\u6301\u77E9\u9635\u4E0E\u5DF2\u6D88\u8D39\u8BA1\u6570\u3002\u5361\u7247\u5176\u4F59\u4E94\u6BB5\u5168\u6587\u3001\u6765\u6E90\u4F1A\u8BDD\u4E0E git \u5FEB\u7167\u4E0D\u5728 state \u5185\uFF0C\u672A\u4F5C\u81C6\u9020\u2014\u2014\u5B8C\u6574\u5361\u7247\u8BF7\u56DE\u4F1A\u8BDD\u7528 /inbox \u53D6\u4EF6\u3002",
|
|
264
|
+
reportStatPending: "\u5F85\u53D6\u4EF6",
|
|
265
|
+
reportStatArchived: "\u5DF2\u5B58\u6863",
|
|
266
|
+
reportStatProviders: "\u8BFB\u53D6\u5668\uFF08\u5DF2\u542F\u7528/\u603B\u6570\uFF09",
|
|
267
|
+
reportPendingEmpty: "\u6536\u4EF6\u7BB1\u4E3A\u7A7A\u2014\u2014\u5F53\u524D\u6CA1\u6709\u5F85\u53D6\u4EF6\u5361\u7247\u3002",
|
|
268
|
+
reportSkipped: "\u53E6\u6709 {n} \u5F20\u65E0\u6CD5\u89E3\u6790\u7684\u5361\u7247\u88AB\u8DF3\u8FC7\uFF08\u4E0D\u8BA1\u5165\u4E0B\u65B9\u5217\u8868\uFF09",
|
|
269
|
+
reportLabelFrom: "\u6765\u6E90",
|
|
270
|
+
reportLabelProject: "\u9879\u76EE",
|
|
271
|
+
reportLabelTime: "\u63A8\u9001\u65F6\u95F4",
|
|
272
|
+
reportLabelPreview: "\u76EE\u6807\u9884\u89C8",
|
|
273
|
+
reportDisabled: "\u5DF2\u505C\u7528",
|
|
274
|
+
// 交接出去(outbound)
|
|
275
|
+
sendTitle: "\u4EA4\u63A5\u51FA\u53BB",
|
|
276
|
+
sendHint: "\u628A\u5F53\u524D\u4F1A\u8BDD\u4EA4\u7ED9\u522B\u7684 agent \u7EE7\u7EED\u5E72\uFF1A\u70B9\u4E00\u4E0B\uFF0C\u5BC4\u5B58\u6307\u4EE4\u9001\u8FDB\u672C\u4F1A\u8BDD\uFF0C\u5361\u7247\u843D\u5171\u4EAB\u6536\u4EF6\u7BB1\uFF0C\u5BF9\u9762\u7167\u53D6\u4EF6\u6307\u4EE4\u63A5\u624B\u3002",
|
|
277
|
+
sendHintCopy: "\u628A\u5F53\u524D\u4F1A\u8BDD\u4EA4\u7ED9\u522B\u7684 agent \u7EE7\u7EED\u5E72\uFF1A\u590D\u5236\u5BC4\u5B58\u6307\u4EE4\u7C98\u8FDB\u5F53\u524D\u4F1A\u8BDD\u8F93\u5165\u6846\uFF0C\u5361\u7247\u843D\u5171\u4EAB\u6536\u4EF6\u7BB1\uFF0C\u5BF9\u9762\u7167\u53D6\u4EF6\u6307\u4EE4\u63A5\u624B\u3002",
|
|
278
|
+
sendBtn: "\u4EA4\u63A5\u51FA\u53BB",
|
|
279
|
+
sendBtnTitle: "\u70B9\u51FB\u540E\u628A\u5BC4\u5B58\u6307\u4EE4\u6392\u8FDB\u672C\u4F1A\u8BDD\u961F\u5217\uFF0C\u672C\u8F6E\u56DE\u590D\u7ED3\u675F\u540E\u7531 agent \u6267\u884C\u5BC4\u5B58\u3002",
|
|
280
|
+
sendBusy: "\u6295\u9012\u4E2D\u2026",
|
|
281
|
+
sentNotice: "\u5DF2\u6295\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF1Aagent \u6B63\u5728\u84B8\u998F\u5BC4\u5B58\uFF0C\u5361\u7247\u7A0D\u540E\u51FA\u73B0\u5728\u6536\u4EF6\u7BB1\u3002",
|
|
282
|
+
sendCopiedNotice: "\u5BC4\u5B58\u6307\u4EE4\u5DF2\u590D\u5236\uFF1A\u7C98\u8FDB\u5F53\u524D\u4F1A\u8BDD\u8F93\u5165\u6846\u5373\u53EF\u5BC4\u5B58\u3002",
|
|
283
|
+
sendFallbackNotice: "\u4E00\u952E\u6295\u9012\u5931\u8D25\uFF0C\u5BC4\u5B58\u6307\u4EE4\u5DF2\u590D\u5236\uFF08\u7C98\u8FDB\u8F93\u5165\u6846\u6548\u679C\u76F8\u540C\uFF09",
|
|
284
|
+
pickupGuideTitle: "\u5BF9\u9762\u600E\u4E48\u63A5\uFF1F\uFF08\u53D6\u4EF6\u6307\u5F15\uFF09",
|
|
285
|
+
pickupGuideIntro: "\u5728 {label} \u7684\u8F93\u5165\u6846\u91CC\u7C98\u8D34\u4E0B\u9762\u8FD9\u53E5\uFF08\u628A\u300C\u5361\u7247\u7F16\u53F7\u300D\u6362\u6210\u65B0\u5361\u7684\u7F16\u53F7\uFF09\uFF1A",
|
|
286
|
+
pickupGuideDsh: "\u5BF9\u9762\u82E5\u662F\u88C5\u4E86\u672C\u63D2\u4EF6\u7684 DSH\uFF1A\u76F4\u63A5\u5728\u5DE5\u4F5C\u53F0\u6536\u4EF6\u7BB1\u70B9\u300C\u4E00\u952E\u53D6\u4EF6\u300D\u3002",
|
|
287
|
+
// 记忆快照
|
|
288
|
+
memoryTitle: "\u8BB0\u5FC6\u5FEB\u7167",
|
|
289
|
+
memoryHint: "\u628A\u5404 agent \u7684\u8BB0\u5FC6\u6587\u4EF6\uFF08CLAUDE.md / AGENTS.md\u2026\uFF09\u6253\u5305\u6210\u4E00\u5F20\u4EA4\u63A5\u5361\u2014\u2014\u4F1A\u8BDD\u80FD\u4EA4\u63A5\uFF0C\u8BB0\u5FC6\u4E5F\u80FD\u3002\u5BF9\u65B9\u53D6\u4EF6\u540E\uFF0C\u7167\u5361\u91CC\u7684\u300C\u5EFA\u8BAE\u52A0\u8F7D\u300D\u5E76\u5165\u81EA\u5DF1\u7684\u8BB0\u5FC6\u6587\u4EF6\u3002",
|
|
290
|
+
memoryExpandHint: "\u5C55\u5F00\u81EA\u52A8\u626B\u63CF\u672C\u673A\u8BB0\u5FC6\u6587\u4EF6\u2026",
|
|
291
|
+
memoryScanning: "\u626B\u63CF\u4E2D\u2026",
|
|
292
|
+
memoryNone: "\u6CA1\u53D1\u73B0\u5DF2\u5B58\u5728\u7684\u8BB0\u5FC6\u6587\u4EF6\uFF08\u8DEF\u5F84\u65E0\u516C\u5F00\u60EF\u4F8B\u7684\u5BB6\u4E0D\u626B\uFF0C\u4E0D\u4EE3\u8868\u4E0D\u652F\u6301\uFF09\u3002",
|
|
293
|
+
memoryMissingNote: "\u53E6\u6709 {n} \u5904\u5E38\u89C1\u8BB0\u5FC6\u8DEF\u5F84\u672C\u673A\u6CA1\u6709\u6587\u4EF6\uFF0C\u672A\u663E\u793A\u3002",
|
|
294
|
+
memoryPushBtn: "\u751F\u6210\u8BB0\u5FC6\u4EA4\u63A5\u5361\uFF08{n} \u4EFD\uFF09",
|
|
295
|
+
memoryPushBtnTitle: "\u52FE\u9009\u7684\u8BB0\u5FC6\u6253\u5305\u6210\u4E00\u5F20\u4EA4\u63A5\u5361\u5BC4\u5B58\u8FDB\u6536\u4EF6\u7BB1\uFF08\u654F\u611F\u4FE1\u606F\u68C0\u67E5\u4E0E\u8FDB\u5C55\u6807\u6CE8\u89C4\u5219\u4E0E\u4F1A\u8BDD\u5361\u76F8\u540C\uFF09",
|
|
296
|
+
memoryPushing: "\u51FA\u5361\u4E2D\u2026",
|
|
297
|
+
memoryPushedNotice: "\u8BB0\u5FC6\u4EA4\u63A5\u5361\u5DF2\u8FDB\u6536\u4EF6\u7BB1\uFF08{n} \u4EFD\u6765\u6E90\uFF09\u3002",
|
|
298
|
+
// 新手帮助 / FAQ
|
|
299
|
+
helpTitle: "\u65B0\u624B\u5E2E\u52A9 / FAQ",
|
|
300
|
+
qa1q: "\u8FD9\u662F\u5E72\u4EC0\u4E48\u7684\uFF1F",
|
|
301
|
+
qa1a: "\u63A5\u529B\uFF1A\u628A\u4E00\u4E2A agent \u5E72\u5230\u4E00\u534A\u7684\u6D3B\u4EA4\u7ED9\u53E6\u4E00\u4E2A\u7EE7\u7EED\u2014\u2014\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u90FD\u80FD\u4EA4\u3002\u65B9\u5411\u968F\u610F\uFF1A\u5916\u90E8 agent \u63A5\u8FDB DSH\uFF0CDSH \u4E5F\u80FD\u4EA4\u63A5\u51FA\u53BB\u7ED9\u5916\u90E8\u3002",
|
|
302
|
+
qa2q: "\u6536\u4EF6\u7BB1\u662F\u4EC0\u4E48\uFF1F",
|
|
303
|
+
qa2a: "\u4EA4\u63A5\u5361\u7684\u5B58\u653E\u5904\uFF08~/.handoff/pending/\uFF0C\u653E\u540C\u6B65\u76D8\u53EF\u8DE8\u673A\uFF09\u3002\u5BC4\u5B58 = \u653E\u5361\u8FDB\u53BB\uFF1B\u53D6\u4EF6 = \u6D88\u8D39\u5373\u53D6\uFF08\u5361\u79FB\u5165 archived\uFF0C\u4E0D\u91CD\u590D\u6D88\u8D39\uFF09\u3002",
|
|
304
|
+
qa3q: "\u300C\u63A5\u7BA1 / \u63A5\u7BA1\u5E76\u5BC4\u5B58 / \u4E00\u952E\u53D6\u4EF6\u300D\u5DEE\u5728\u54EA\uFF1F",
|
|
305
|
+
qa3a: "\u63A5\u7BA1 = \u5916\u90E8\u4F1A\u8BDD\u76F4\u63A5\u5728 DSH \u65B0\u4F1A\u8BDD\u91CC\u7EE7\u7EED\uFF1B\u63A5\u7BA1\u5E76\u5BC4\u5B58 = \u7EE7\u7EED\u4E4B\u4F59\u628A\u4EA4\u63A5\u5361\u7559\u8FDB\u6536\u4EF6\u7BB1\uFF08\u7ED9\u7B2C\u4E09\u68D2\uFF09\uFF1B\u4E00\u952E\u53D6\u4EF6 = \u4ECE\u6536\u4EF6\u7BB1\u62FF\u4E00\u5F20\u5361\u5F00\u5DE5\u3002",
|
|
306
|
+
qa4q: "\u300C\u53EF\u67E5\u8BC1 12/14\u300D\u662F\u4EC0\u4E48\u610F\u601D\uFF1F",
|
|
307
|
+
qa4a: "\u5361\u91CC 14 \u6761\u8FDB\u5C55\u9648\u8FF0\u4E2D 12 \u6761\u6807\u4E86\u8BC1\u636E\u72B6\u6001\uFF08\u5F53\u4E0B\u4E8B\u5B9E / \u5386\u53F2\u6C47\u62A5 / \u4E0D\u7B26 / \u4E0D\u53EF\u7528\uFF09\u3002\u6BD4\u4F8B\u8D8A\u9AD8\u8D8A\u53EF\u4FE1\uFF1B\u6309\u7EAA\u5F8B\uFF0C\u300C\u5386\u53F2\u6C47\u62A5\u300D\u6C38\u8FDC\u5EFA\u8BAE\u5148\u6838\u5BF9\u518D\u6267\u884C\u3002",
|
|
308
|
+
qa5q: "\u300C\u673A\u5668\u4FE1\u5C01\u300D\u662F\u4EC0\u4E48\uFF1F",
|
|
309
|
+
qa5a: "\u968F\u5361\u5F52\u6863\u7684\u5C0F\u9644\u4EF6\uFF08JSON\uFF09\uFF1A\u6E90\u673A\u5668\u4FE1\u606F\u3001\u672A\u8DDF\u8E2A\u6587\u4EF6\u6E05\u5355\u3001\u6D4B\u8BD5\u63D0\u793A\u3002\u53D6\u4EF6\u65F6\u5E2E\u4F60\u6838\u5BF9\u73AF\u5883\uFF0C\u4E0D\u8FDB\u5165\u6A21\u578B\u4E0A\u4E0B\u6587\u3002",
|
|
310
|
+
qa6q: "\u300C\u2190 \u63A5\u529B\u81EA\u300D\u662F\u4EC0\u4E48\uFF1F",
|
|
311
|
+
qa6a: "\u63A5\u529B\u94FE\u6807\u8BB0\uFF1A\u8FD9\u5F20\u5361\u63A5\u66FF\u81EA\u524D\u4E00\u5F20\u5361\u3002\u70B9\u300C\u53EA\u770B\u6B64\u94FE\u300D\u53EF\u8FC7\u6EE4\u51FA\u540C\u4E00\u6761\u94FE\u4E0A\u7684\u76F8\u5173\u5361\uFF0C\u770B\u6E05\u4EFB\u52A1\u7684\u63A5\u529B\u5386\u53F2\u3002",
|
|
312
|
+
qa7q: "\u9690\u79C1\u600E\u4E48\u529E\uFF1F",
|
|
313
|
+
qa7a: "\u5168\u7A0B\u53EA\u8BFB\u672C\u673A\u6587\u4EF6\uFF1B\u6570\u636E\u53EA\u843D\u5728\u672C\u673A ~/.handoff/ \u76EE\u5F55\uFF08\u662F\u5426\u653E\u540C\u6B65\u76D8\u7531\u4F60\u51B3\u5B9A\uFF09\uFF0C\u4E0D\u4E0A\u4F20\u4EFB\u4F55\u670D\u52A1\u5668\u3002\u9762\u677F API \u53EA\u63A5\u53D7\u672C\u673A\u56DE\u73AF\u8FDE\u63A5\u3002",
|
|
314
|
+
qa8q: "\u4E09\u6B65\u4E0A\u624B\uFF1F",
|
|
315
|
+
qa8a: "\u2460 \u53F3\u680F\u70B9\u4E00\u5BB6\u5916\u90E8 agent\uFF08\u5982 Claude Code\uFF09\u770B\u5B83\u7684\u4F1A\u8BDD\uFF1B\u2461 \u70B9\u300C\u63A5\u7BA1\u300D\uFF0C\u65B0\u4F1A\u8BDD\u81EA\u52A8\u63A5\u7EED\uFF1B\u2462 \u5E72\u5B8C\u70B9\u300C\u4EA4\u63A5\u51FA\u53BB\u300D\uFF0C\u628A\u6D3B\u5BC4\u5B58\u7ED9\u4E0B\u4E00\u68D2\u3002"
|
|
316
|
+
};
|
|
317
|
+
var en = {
|
|
318
|
+
appTitle: "dsh-takeover Session Takeover",
|
|
319
|
+
appSubtitle: 'Commands \xB7 reader switches \xB7 the workbench lives behind the "Relay" chip inside the session composer',
|
|
320
|
+
refresh: "\u27F3 Refresh",
|
|
321
|
+
cmdTitle: "Commands",
|
|
322
|
+
cmdBadge: "Run in sessions \u2014 this card is read-only",
|
|
323
|
+
cmdHandoffDesc: "Park this session \u2192 inbox",
|
|
324
|
+
cmdInboxDesc: "Pick up at start (consumed once)",
|
|
325
|
+
cmdResumeDesc: "Pull {name} sessions",
|
|
326
|
+
cmdOffTitle: '{label} is off in the matrix; the command returns "disabled"',
|
|
327
|
+
inboxTitle: "Inbox overview",
|
|
328
|
+
badgePending: "Pending {n}",
|
|
329
|
+
badgeArchived: "{n} archived",
|
|
330
|
+
pendingDupChip: "Dup {n}",
|
|
331
|
+
rejectionsBadge: "Rejected {n}",
|
|
332
|
+
rejectionsTitle: "write=gate rejected at deposit, read=bad card skipped, pickup=verification failed",
|
|
333
|
+
pendingDupTitle: "Same-id duplicates deduped to first seen \u2014 multi-writer defensive count",
|
|
334
|
+
pendingDirHint: "maps to ~/.handoff/pending/",
|
|
335
|
+
archivedDirHint: "consumed cards archive to ~/.handoff/archived/ (rolling keep of the latest 50; older ones are pruned automatically)",
|
|
336
|
+
clearArchived: "Clear consumed",
|
|
337
|
+
clearConfirm: "Clear {n}?",
|
|
338
|
+
clearArchivedTitle: "Delete every consumed card under archived/ (irreversible)",
|
|
339
|
+
dismissBtn: "Dismiss",
|
|
340
|
+
dismissingBtn: "Dismissing\u2026",
|
|
341
|
+
dismissTitle: "Not picking this one up: moved as-is into archived/ (kept for audit, not counted as consumed)",
|
|
342
|
+
dismissedNotice: "Dismissed {id} \u2014 card and envelope moved as-is into archived/",
|
|
343
|
+
emptyInbox: "Inbox is empty \u2014 no pending handoff cards yet. Deposited cards will appear here; click Pick up on a card to start, or run /inbox in a session.",
|
|
344
|
+
from: "from {name}",
|
|
345
|
+
project: "project {name}",
|
|
346
|
+
idLabel: "id {id}",
|
|
347
|
+
previewEmpty: "(card body is empty)",
|
|
348
|
+
previewHint: "\u2014 Preview is excerpted from the card body (falls back to the done section when goal is empty); run /inbox in a session to view the full card.",
|
|
349
|
+
filterPlaceholder: "Filter: title / source / id\u2026",
|
|
350
|
+
filterAria: "Instant inbox filter (matches title, source name, or id; clear to restore)",
|
|
351
|
+
filterShortcut: "Shortcut: / or Ctrl/\u2318+K to focus; Esc clears when non-empty",
|
|
352
|
+
chipAll: "All",
|
|
353
|
+
newOnlyChip: "New only",
|
|
354
|
+
newOnlyAria: "Show only cards never opened",
|
|
355
|
+
chipSourceAria: "Filter pending cards by source",
|
|
356
|
+
filterEmpty: "No matching cards \u2014 clear the filter to restore the full list",
|
|
357
|
+
newBadge: "NEW",
|
|
358
|
+
groupCount: "{n} cards",
|
|
359
|
+
groupAria: "{title}, {n} cards",
|
|
360
|
+
unknownSource: "(unknown source)",
|
|
361
|
+
lowInfoGroup: "Suspiciously empty cards ({n}) \u2014 placeholder templates only, likely accidental",
|
|
362
|
+
lowInfoBadge: "empty?",
|
|
363
|
+
exportCard: "Export .md",
|
|
364
|
+
exportCardTitle: "Download this card as .md (frontmatter + 6 sections; sections not in state are noted in place, never invented)",
|
|
365
|
+
exportAll: "Export all",
|
|
366
|
+
exportAllTitle: "Download every pending card as one .md (zero-dependency, generated in the browser)",
|
|
367
|
+
exportMenu: "Export \u25BE",
|
|
368
|
+
exportMenuAria: "Export menu: all cards as .md, or the HTML report",
|
|
369
|
+
exportNoteTop: '> Exported by the dsh-takeover settings card. Contains only the fields provided by the inbox state: id / source / title / project / push time, plus the "goal" section preview (server-truncated to 240 chars; falls back to the "done" section when the goal is empty). The source session, cwd, git snapshot, tasks and the other five sections are not in state and are not invented \u2014 pick up the full card with /inbox in a session.',
|
|
370
|
+
exportSectionMissing: "(The full text of this section is not in this file: the settings-card state does not provide it. Pick up the full card with /inbox in a session.)",
|
|
371
|
+
exportHtml: "Export HTML report",
|
|
372
|
+
exportHtmlTitle: "Build a self-contained single-file HTML report and download it (9-reader support matrix + every pending card + consumed count; zero-dependency, generated in the browser, field-for-field faithful to state)",
|
|
373
|
+
envelopeArchived: "Envelope {v}",
|
|
374
|
+
envelopeArchivedTitle: "Card attachment: machine envelope ({n} chars total) \u2014 source machine and untracked-file manifest, used at pickup to verify the environment",
|
|
375
|
+
coverageBadge: "Evidence {v}",
|
|
376
|
+
coverageBadgeTitle: "Ledger coverage: share of done-section statements carrying a ledger state (x/y). Four states: current-observed / history-reported / mismatch / unavailable \u2014 history-reported statements should always be verified before acting",
|
|
377
|
+
matrixTitle: "Support matrix (9 readers)",
|
|
378
|
+
browserTitle: "External session browser",
|
|
379
|
+
sidebarTabTitle: "Relay",
|
|
380
|
+
sidebarTabDesc: "Browse nine agents' sessions, one-click takeover, and the session inbox \u2014 pass context between agents and continue",
|
|
381
|
+
popoverTitle: "Relay workbench",
|
|
382
|
+
popoverSubtitle: "Relay work across agents: take over external sessions, send the current one out, and pass handoff cards through the inbox.",
|
|
383
|
+
onboard1: "Click an agent on the right to browse its recent sessions",
|
|
384
|
+
onboard2: "Click Take over \u2014 a new session continues the work",
|
|
385
|
+
onboard3: "When done, click Send out to deposit it for the next runner",
|
|
386
|
+
onboardDone: "Got it",
|
|
387
|
+
closeBtn: "Close",
|
|
388
|
+
// Workbench relayout (nav rail + four views, DESIGN.md §5)
|
|
389
|
+
navAria: "Workbench views",
|
|
390
|
+
navInbox: "Inbox",
|
|
391
|
+
navBrowser: "Sessions",
|
|
392
|
+
navGuide: "Getting started",
|
|
393
|
+
navBrowserBadgeTitle: "Sessions of the auto-fronted reader ({label}); switch readers inside the view",
|
|
394
|
+
tilePending: "Pending",
|
|
395
|
+
tileArchived: "Archived",
|
|
396
|
+
tileCoverage: "Evidence",
|
|
397
|
+
tileEnvelope: "Envelope",
|
|
398
|
+
tileRejected: "Rejected",
|
|
399
|
+
tileDup: "Dup",
|
|
400
|
+
viewInboxSub: "{n} pending \xB7 consumed once \xB7 ledger-verifiable",
|
|
401
|
+
viewMemorySub: "Bundle long-term memory into the handoff card for the other side",
|
|
402
|
+
versionTitle: "Plugin version (injected from package.json at build)",
|
|
403
|
+
targetGroupLabel: "Relay to:",
|
|
404
|
+
browserGroupLabel: "Whose sessions to browse:",
|
|
405
|
+
sendBtnTo: "Send to {label}",
|
|
406
|
+
settingsPointer: 'Browsing & one-click takeover live inside the session composer: click the "Relay" chip to unfold the workbench.',
|
|
407
|
+
browserHint: 'Browse + one-click takeover: click a reader to list recent local sessions; "Take over" delivers the command to a new session (falls back to copy on failure) \u2014 cards are distilled by the model, so quality follows model capability.',
|
|
408
|
+
actionSegAria: "Relay actions: browse sessions / send out / memory snapshot",
|
|
409
|
+
browserPick: "Click a reader above to start (the 9 readers are not scanned automatically)",
|
|
410
|
+
browserEmpty: "No sessions found for this reader on this machine",
|
|
411
|
+
browserTotal: "{m} total, showing the {n} most recent",
|
|
412
|
+
browserNote: "Note: {note}",
|
|
413
|
+
browserChipAria: "Choose a reader to browse",
|
|
414
|
+
browserFilterEmpty: "No matching sessions \u2014 clear the filter to restore the full list",
|
|
415
|
+
browserDisabledTitle: "{label} is disabled or unsupported; browsing unavailable",
|
|
416
|
+
filterSessionsPlaceholder: "Filter: title / cwd / id\u2026",
|
|
417
|
+
filterSessionsAria: "Instant session filter (matches title, cwd, or id; clear to restore)",
|
|
418
|
+
takeoverBtn: "Take over",
|
|
419
|
+
takeoverTitle: "Delivers the command to a new session (falls back to copy on failure)",
|
|
420
|
+
depositBtn: "Take over + deposit",
|
|
421
|
+
depositTitle: "Delivers the two-line command: the card is deposited after takeover (falls back to copy on failure)",
|
|
422
|
+
takeoverBusyBtn: "Taking over\u2026",
|
|
423
|
+
takeoverDoneBtn: "Taken over \u2713",
|
|
424
|
+
inboxBusyBtn: "Picking up\u2026",
|
|
425
|
+
deliveringBtn: "Delivering\u2026",
|
|
426
|
+
deliveredBtn: "Delivered \u2713",
|
|
427
|
+
fallbackCopyBtn: "Delivery failed \u2014 instruction copied",
|
|
428
|
+
fallbackNotice: "Delivery failed ({reason}); fell back to copying the command",
|
|
429
|
+
copiedBtn: "Copied \u2713",
|
|
430
|
+
copyIdTitle: "Click to copy the full session id",
|
|
431
|
+
previewTurns: "{n} turns ({u} user)",
|
|
432
|
+
previewFirst: "First user request",
|
|
433
|
+
previewTail: "Recent progress",
|
|
434
|
+
previewStop: "Stopped at",
|
|
435
|
+
previewLoadFail: "Preview failed",
|
|
436
|
+
deliveredNotice: 'Created session "{title}" and delivered the prompt \u2014 click it in the session tree to watch the takeover',
|
|
437
|
+
deliveredNoticeNav: 'Created "{title}" and delivered \u2014 switched you there; close settings to watch the takeover',
|
|
438
|
+
inboxTakeBtn: "Take in new session",
|
|
439
|
+
inboxTakeTitle: "Creates a new session and delivers /inbox (consumed once)",
|
|
440
|
+
chainBadge: "\u2190 supersedes {id}",
|
|
441
|
+
chainBadgeTitle: "This card supersedes {id} (relay chain)",
|
|
442
|
+
chainFilterBtn: "Filter this chain",
|
|
443
|
+
chainFilterTitle: "Sets the filter to {id} to show cards in this relay chain",
|
|
444
|
+
subagentBadge: "subagent",
|
|
445
|
+
subagentGroup: "Subagent sessions ({n})",
|
|
446
|
+
facetCwdAria: "Filter sessions by project",
|
|
447
|
+
sessionsCount: "{n} sessions",
|
|
448
|
+
sessionsProbeFail: "session count probe failed",
|
|
449
|
+
unsupported: "not supported on this machine",
|
|
450
|
+
unsupportedNote: "not supported on this machine: {note}",
|
|
451
|
+
pillOk: "OK",
|
|
452
|
+
pillNo: "N/A",
|
|
453
|
+
// Yellow = unconfirmed (DESIGN.md §2 status discipline): store dir exists but 0 sessions (fake-zero sentinel) / probe failed
|
|
454
|
+
pillPending: "Unconfirmed",
|
|
455
|
+
toggleDisable: 'Disable {label} (foreign_session_read will return "disabled")',
|
|
456
|
+
toggleEnable: "Enable {label}",
|
|
457
|
+
toggleAria: "{label} ({id}) reader switch",
|
|
458
|
+
// Settings card tabs (DESIGN.md §4)
|
|
459
|
+
tabsAria: "Settings sections: commands / support matrix / switch semantics",
|
|
460
|
+
tabCmds: "Commands",
|
|
461
|
+
tabMatrix: "Support matrix",
|
|
462
|
+
tabSemantics: "Switch semantics",
|
|
463
|
+
noteSummary: "\u{1F4A1} Switch semantics",
|
|
464
|
+
noteBody: 'Disabled providers: foreign_session_read returns the canonical "disabled" error for that vendor. The /resume-* skill guidance is static text; the disabled state is surfaced through the tool error, visible to the model. A greyed row with 0 sessions means the vendor is not installed locally (or has no sessions yet) \u2014 the switch stays but there is nothing to read.',
|
|
465
|
+
noteBodyPending: 'Status pills: green "OK" = the reader works and found sessions; yellow "Unconfirmed" = the store directory exists but no sessions were found (upstream may have migrated its storage layout) or the session probe failed \u2014 not a fault, hover the row for the note; yellow "N/A" = the reader is not supported on this machine.',
|
|
466
|
+
loading: "Loading\u2026",
|
|
467
|
+
noTime: "(no time)",
|
|
468
|
+
renderErrorTitle: "dsh-takeover render error (paste the trace below to the maintainer)",
|
|
469
|
+
reportTitle: "dsh-takeover Handoff Report",
|
|
470
|
+
reportSubtitle: "Session takeover inbox snapshot (9 readers \xB7 pending cards \xB7 consumed count)",
|
|
471
|
+
reportGenerated: "Generated at {n}",
|
|
472
|
+
reportNote: 'Exported by the dsh-takeover settings card as a self-contained single-file HTML. Contains only what /dsh-takeover/state returns right now: pending cards (id / source / title / project / push time and the "goal" section preview), the 9-reader support matrix and the consumed count. The other five card sections, the source session and git snapshots are not in state and are not invented \u2014 pick up full cards with /inbox in a session.',
|
|
473
|
+
reportStatPending: "Pending",
|
|
474
|
+
reportStatArchived: "Archived",
|
|
475
|
+
reportStatProviders: "Readers (enabled/total)",
|
|
476
|
+
reportPendingEmpty: "Inbox is empty \u2014 no pending cards right now.",
|
|
477
|
+
reportSkipped: "{n} unparseable cards were skipped (not listed below)",
|
|
478
|
+
reportLabelFrom: "Source",
|
|
479
|
+
reportLabelProject: "Project",
|
|
480
|
+
reportLabelTime: "Pushed at",
|
|
481
|
+
reportLabelPreview: "Goal preview",
|
|
482
|
+
reportDisabled: "disabled",
|
|
483
|
+
// Send out (outbound)
|
|
484
|
+
sendTitle: "Send out",
|
|
485
|
+
sendHint: "Hand this session to another agent: one click queues the deposit instruction into this session; the card lands in the shared inbox and the other side picks it up.",
|
|
486
|
+
sendHintCopy: "Hand this session to another agent: copy the deposit instruction into this session's composer; the card lands in the shared inbox and the other side picks it up.",
|
|
487
|
+
sendBtn: "Send out",
|
|
488
|
+
sendBtnTitle: "Queue the /handoff deposit instruction into the current session (runs after the current turn)",
|
|
489
|
+
sendBusy: "Sending\u2026",
|
|
490
|
+
sentNotice: "Queued into this session: the agent is distilling and depositing \u2014 the card will appear in the inbox shortly.",
|
|
491
|
+
sendCopiedNotice: "Deposit instruction copied: paste it into this session's composer to deposit.",
|
|
492
|
+
sendFallbackNotice: "One-click send failed; instruction copied (pasting it works the same)",
|
|
493
|
+
pickupGuideTitle: "How does the other side pick up?",
|
|
494
|
+
pickupGuideIntro: "Paste into {label}'s input (implementations with this plugin swap the id for the real card id):",
|
|
495
|
+
pickupGuideDsh: 'If the other side is DSH with this plugin: click "Pick up" in its workbench inbox directly.',
|
|
496
|
+
// Memory snapshot
|
|
497
|
+
memoryTitle: "Memory snapshot",
|
|
498
|
+
memoryHint: `Bundle each agent's memory files (CLAUDE.md / AGENTS.md / .cursorrules\u2026) into one handoff card \u2014 sessions hand over, and so does memory. The picker absorbs the "suggested" section into its own memory files.`,
|
|
499
|
+
memoryExpandHint: "Expand to scan local memory files\u2026",
|
|
500
|
+
memoryScanning: "Scanning\u2026",
|
|
501
|
+
memoryNone: 'No existing memory files found (vendors without a documented convention are not scanned \u2014 that is not "unsupported").',
|
|
502
|
+
memoryMissingNote: "{n} other known memory paths had no files on this machine \u2014 omitted.",
|
|
503
|
+
memoryPushBtn: "Create memory card ({n} sources)",
|
|
504
|
+
memoryPushBtnTitle: "Pack the selected memories into one handoff card in the inbox (secret gate and coverage discipline apply, same as session cards)",
|
|
505
|
+
memoryPushing: "Packing\u2026",
|
|
506
|
+
memoryPushedNotice: "Memory card is in the inbox ({n} sources).",
|
|
507
|
+
// Help / FAQ
|
|
508
|
+
helpTitle: "Help / FAQ",
|
|
509
|
+
qa1q: "What is this?",
|
|
510
|
+
qa1a: "Relay: hand half-finished work from one agent to another \u2014 sessions and memory both. Either direction: external agents into DSH, or DSH out to external agents.",
|
|
511
|
+
qa2q: "What is the inbox?",
|
|
512
|
+
qa2a: "Where handoff cards live (~/.handoff/pending/; put it on a synced drive to go cross-machine). Deposit = put a card in; pickup = consume once (the card moves to archived).",
|
|
513
|
+
qa3q: 'Difference between "Take over" / "Take over + deposit" / "Pick up"?',
|
|
514
|
+
qa3a: "Take over = continue an external session in a new DSH session; Take over + deposit = also leave a card in the inbox (for a third runner); Pick up = start from a card in the inbox.",
|
|
515
|
+
qa4q: 'What does "Evidence 12/14" mean?',
|
|
516
|
+
qa4a: '12 of 14 progress statements on the card carry a ledger state (current-observed / history-reported / mismatch / unavailable). Higher is more trustworthy; by discipline, "history-reported" items should be verified before acting.',
|
|
517
|
+
qa5q: 'What is the "machine envelope"?',
|
|
518
|
+
qa5a: "A small JSON attachment archived with the card: source machine info, untracked-file manifest, test hints. It helps verify the environment at pickup and never enters model context.",
|
|
519
|
+
qa6q: 'What does "\u2190 relayed from" mean?',
|
|
520
|
+
qa6a: `Relay chain marker: this card supersedes a previous card. "Only this chain" filters related cards so you can see the task's relay history.`,
|
|
521
|
+
qa7q: "What about privacy?",
|
|
522
|
+
qa7a: "Everything reads local files only; data stays in ~/.handoff/ (synced drive is your choice). Nothing is uploaded to any server, and the panel API accepts loopback connections only.",
|
|
523
|
+
qa8q: "Three steps to start?",
|
|
524
|
+
qa8a: '\u2460 Click a vendor (e.g. Claude Code) in the right column to browse its sessions; \u2461 click "Take over" \u2014 a new session continues it; \u2462 when done, click "Send out" to hand it to the next runner.'
|
|
525
|
+
};
|
|
526
|
+
var DICTS = { zh, en };
|
|
527
|
+
function interpolate(template, params) {
|
|
528
|
+
if (params === void 0) return template;
|
|
529
|
+
return template.replace(/\{(\w+)\}/g, (raw, key) => {
|
|
530
|
+
const v = params[key];
|
|
531
|
+
return v === void 0 ? raw : String(v);
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// src/inbox-view.ts
|
|
536
|
+
function filterPending(rows, query, labelOf, source, newOnlyIds) {
|
|
537
|
+
let out = rows;
|
|
538
|
+
if (source) out = out.filter((p) => p.agent === source);
|
|
539
|
+
if (newOnlyIds) out = out.filter((p) => newOnlyIds.has(p.id));
|
|
540
|
+
const q = query.trim().toLowerCase();
|
|
541
|
+
if (q === "") return out;
|
|
542
|
+
return out.filter((p) => {
|
|
543
|
+
const title = typeof p.title === "string" ? p.title : "";
|
|
544
|
+
const id = typeof p.id === "string" ? p.id : "";
|
|
545
|
+
const agent = typeof p.agent === "string" ? p.agent : "";
|
|
546
|
+
const supersedes = typeof p.supersedes === "string" ? p.supersedes.toLowerCase() : "";
|
|
547
|
+
return title.toLowerCase().includes(q) || id.toLowerCase().includes(q) || agent.toLowerCase().includes(q) || supersedes.includes(q) || labelOf(p.agent ?? "").toLowerCase().includes(q);
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
function sourceFacets(rows) {
|
|
551
|
+
const counts = /* @__PURE__ */ new Map();
|
|
552
|
+
for (const r of rows) counts.set(r.agent, (counts.get(r.agent) ?? 0) + 1);
|
|
553
|
+
return [...counts.entries()].map(([agent, count]) => ({ agent, count }));
|
|
554
|
+
}
|
|
555
|
+
function groupAdjacent(rows) {
|
|
556
|
+
const groups = [];
|
|
557
|
+
let cur = null;
|
|
558
|
+
for (const p of rows) {
|
|
559
|
+
if (cur !== null && p.title !== "" && p.agent === cur.agent && p.title === cur.title) {
|
|
560
|
+
cur.rows.push(p);
|
|
561
|
+
} else {
|
|
562
|
+
cur = { key: `g-${groups.length}-${p.id}`, agent: p.agent, title: p.title, rows: [p] };
|
|
563
|
+
groups.push(cur);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return groups;
|
|
567
|
+
}
|
|
568
|
+
function fnv1a(text) {
|
|
569
|
+
let h = 2166136261;
|
|
570
|
+
for (let i = 0; i < text.length; i++) {
|
|
571
|
+
h ^= text.charCodeAt(i);
|
|
572
|
+
h = Math.imul(h, 16777619);
|
|
573
|
+
}
|
|
574
|
+
return (h >>> 0).toString(16).padStart(8, "0");
|
|
575
|
+
}
|
|
576
|
+
function seenStorageKey(home) {
|
|
577
|
+
return `dsh-takeover.seen.v1.${fnv1a(home)}`;
|
|
578
|
+
}
|
|
579
|
+
var SEEN_CAP = 1e3;
|
|
580
|
+
function loadSeenSet(store, key) {
|
|
581
|
+
if (store === null) return /* @__PURE__ */ new Set();
|
|
582
|
+
try {
|
|
583
|
+
const raw = store.getItem(key);
|
|
584
|
+
if (raw === null) return /* @__PURE__ */ new Set();
|
|
585
|
+
const parsed = JSON.parse(raw);
|
|
586
|
+
if (!Array.isArray(parsed)) return /* @__PURE__ */ new Set();
|
|
587
|
+
return new Set(parsed.filter((x) => typeof x === "string"));
|
|
588
|
+
} catch {
|
|
589
|
+
return /* @__PURE__ */ new Set();
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function saveSeenSet(store, key, ids) {
|
|
593
|
+
if (store === null) return;
|
|
594
|
+
try {
|
|
595
|
+
const list = [...ids];
|
|
596
|
+
store.setItem(key, JSON.stringify(list.length > SEEN_CAP ? list.slice(list.length - SEEN_CAP) : list));
|
|
597
|
+
} catch {
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
function newIdsOf(rows, seen) {
|
|
601
|
+
return rows.filter((p) => !seen.has(p.id)).map((p) => p.id);
|
|
602
|
+
}
|
|
603
|
+
var SECTION_HEADINGS = [
|
|
604
|
+
["goal", "\u76EE\u6807"],
|
|
605
|
+
["files", "\u6D89\u53CA\u6587\u4EF6"],
|
|
606
|
+
["done", "\u505A\u5230\u54EA"],
|
|
607
|
+
["remaining", "\u8FD8\u5DEE\u4EC0\u4E48"],
|
|
608
|
+
["stopped", "\u505C\u5728\u54EA"],
|
|
609
|
+
["warnings", "\u8BFB\u8005\u8B66\u544A"]
|
|
610
|
+
];
|
|
611
|
+
function yamlQuote(value) {
|
|
612
|
+
const stripped = value.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F\r]/g, "");
|
|
613
|
+
const escaped = stripped.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\t/g, "\\t");
|
|
614
|
+
return `"${escaped}"`;
|
|
615
|
+
}
|
|
616
|
+
function cardMarkdown(p, notes) {
|
|
617
|
+
const lines = [
|
|
618
|
+
"---",
|
|
619
|
+
"handoff: 1",
|
|
620
|
+
`id: ${yamlQuote(p.id)}`,
|
|
621
|
+
"from:",
|
|
622
|
+
` agent: ${yamlQuote(p.agent)}`,
|
|
623
|
+
` title: ${yamlQuote(p.title)}`,
|
|
624
|
+
`project: ${yamlQuote(p.project)}`,
|
|
625
|
+
`pushed_at: ${yamlQuote(p.pushedAt)}`,
|
|
626
|
+
"---",
|
|
627
|
+
"",
|
|
628
|
+
notes.top,
|
|
629
|
+
""
|
|
630
|
+
];
|
|
631
|
+
for (const [key, heading] of SECTION_HEADINGS) {
|
|
632
|
+
let body = notes.missing;
|
|
633
|
+
if (key === "goal" && !p.previewFromDone && p.preview !== "") body = p.preview;
|
|
634
|
+
if (key === "done" && p.previewFromDone && p.preview !== "") body = p.preview;
|
|
635
|
+
lines.push(`## ${heading}`, "", body, "");
|
|
636
|
+
}
|
|
637
|
+
return lines.join("\n");
|
|
638
|
+
}
|
|
639
|
+
function pendingListMarkdown(rows, notes) {
|
|
640
|
+
if (rows.length === 0) return "";
|
|
641
|
+
return rows.map((p) => cardMarkdown(p, notes).trimEnd()).join("\n\n---\n\n") + "\n";
|
|
642
|
+
}
|
|
643
|
+
function displayTitleOf(p) {
|
|
644
|
+
const t = p.title.trim();
|
|
645
|
+
const idStem = p.id.replace(/\.md$/, "");
|
|
646
|
+
if (t !== "" && t !== idStem) return t;
|
|
647
|
+
const lines = p.preview.split("\n").map((l) => l.trim());
|
|
648
|
+
const line = lines.find((l) => l !== "" && !l.startsWith("#")) ?? "";
|
|
649
|
+
const cleaned = line.replace(/^[-*\d.、\s]+/, "").trim();
|
|
650
|
+
if (cleaned === "") return idStem;
|
|
651
|
+
return cleaned.length > 48 ? `${cleaned.slice(0, 48)}\u2026` : cleaned;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// src/browser-view.ts
|
|
655
|
+
function filterSessions(rows, query) {
|
|
656
|
+
const q = query.trim().toLowerCase();
|
|
657
|
+
if (q === "") return rows;
|
|
658
|
+
return rows.filter(
|
|
659
|
+
(r) => r.title.toLowerCase().includes(q) || r.cwd.toLowerCase().includes(q) || r.id.toLowerCase().includes(q)
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
function relTime(ts, nowMs, lang) {
|
|
663
|
+
if (ts === "") return lang === "en" ? "(no time)" : "\uFF08\u65E0\u65F6\u95F4\uFF09";
|
|
664
|
+
const ms = new Date(ts).getTime();
|
|
665
|
+
if (!Number.isFinite(ms)) return ts;
|
|
666
|
+
const diff = nowMs - ms;
|
|
667
|
+
if (diff < 0) return lang === "en" ? "just now" : "\u521A\u521A";
|
|
668
|
+
const min = Math.floor(diff / 6e4);
|
|
669
|
+
if (min < 1) return lang === "en" ? "just now" : "\u521A\u521A";
|
|
670
|
+
if (min < 60) return lang === "en" ? `${min}m ago` : `${min}\u5206\u949F\u524D`;
|
|
671
|
+
const h = Math.floor(min / 60);
|
|
672
|
+
if (h < 24) return lang === "en" ? `${h}h ago` : `${h}\u5C0F\u65F6\u524D`;
|
|
673
|
+
const d = Math.floor(h / 24);
|
|
674
|
+
if (d < 30) return lang === "en" ? `${d}d ago` : `${d}\u5929\u524D`;
|
|
675
|
+
const dt = new Date(ms);
|
|
676
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
677
|
+
return `${dt.getFullYear()}-${pad(dt.getMonth() + 1)}-${pad(dt.getDate())}`;
|
|
678
|
+
}
|
|
679
|
+
function takeoverCommand(provider, id) {
|
|
680
|
+
return `/resume-${provider} ${id}`;
|
|
681
|
+
}
|
|
682
|
+
function depositTail(lang) {
|
|
683
|
+
return lang === "en" ? "When the takeover is done, deposit the six-section handoff card into the shared inbox." : "\u63A5\u7BA1\u5B8C\u6210\u540E\uFF0C\u628A\u516D\u6BB5\u4EA4\u63A5\u5361\u5BC4\u5B58\u8FDB\u5171\u4EAB\u6536\u4EF6\u7BB1\u3002";
|
|
684
|
+
}
|
|
685
|
+
var OUTBOUND_TARGETS = ["any", "claude", "codex", "opencode", "zcode", "pi", "workbuddy", "cursor", "grok"];
|
|
686
|
+
var OUTBOUND_LABELS = {
|
|
687
|
+
any: { zh: "\u4EFB\u610F agent", en: "Any agent" },
|
|
688
|
+
claude: { zh: "Claude Code", en: "Claude Code" },
|
|
689
|
+
codex: { zh: "Codex CLI", en: "Codex CLI" },
|
|
690
|
+
opencode: { zh: "OpenCode", en: "OpenCode" },
|
|
691
|
+
zcode: { zh: "ZCode", en: "ZCode" },
|
|
692
|
+
pi: { zh: "Pi", en: "Pi" },
|
|
693
|
+
workbuddy: { zh: "WorkBuddy", en: "WorkBuddy" },
|
|
694
|
+
cursor: { zh: "Cursor", en: "Cursor" },
|
|
695
|
+
grok: { zh: "Grok CLI", en: "Grok CLI" }
|
|
696
|
+
};
|
|
697
|
+
function outboundCommand(lang, targetLabel) {
|
|
698
|
+
const head = "/handoff";
|
|
699
|
+
const receiver = targetLabel !== void 0 && targetLabel !== "" && targetLabel !== "any" ? lang === "en" ? `Receiver: ${targetLabel}. ` : `\u63A5\u6536\u65B9\uFF1A${targetLabel}\u3002` : "";
|
|
700
|
+
const tail = lang === "en" ? `${receiver}When the deposit is done, tell me the card id.` : `${receiver}\u5BC4\u5B58\u5B8C\u6210\u540E\uFF0C\u628A\u5361\u7247\u7F16\u53F7\u53D1\u7ED9\u6211\u3002`;
|
|
701
|
+
return `${head}
|
|
702
|
+
${tail}`;
|
|
703
|
+
}
|
|
704
|
+
function pickupCommand(target, id, lang) {
|
|
705
|
+
const card = `~/.handoff/pending/${id}.md`;
|
|
706
|
+
const zhSentence = `\u8BFB ${card}\uFF0C\u6309\u5361\u63A5\u624B\u3002`;
|
|
707
|
+
const enSentence = `Read ${card} and continue per the card.`;
|
|
708
|
+
const sentence = lang === "en" ? enSentence : zhSentence;
|
|
709
|
+
switch (target) {
|
|
710
|
+
case "claude":
|
|
711
|
+
return lang === "en" ? `claude "${enSentence}"` : `claude "${zhSentence}"`;
|
|
712
|
+
case "codex":
|
|
713
|
+
return lang === "en" ? `codex "${enSentence}"` : `codex "${zhSentence}"`;
|
|
714
|
+
case "opencode":
|
|
715
|
+
return lang === "en" ? `opencode "${enSentence}"` : `opencode "${zhSentence}"`;
|
|
716
|
+
case "grok":
|
|
717
|
+
return lang === "en" ? `grok "${enSentence}"` : `grok "${zhSentence}"`;
|
|
718
|
+
default:
|
|
719
|
+
return sentence;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
function humanChars(n) {
|
|
723
|
+
if (!Number.isFinite(n) || n < 0) return String(n);
|
|
724
|
+
if (n < 1e3) return String(n);
|
|
725
|
+
if (n < 1e6) return `${(n / 1e3).toFixed(1).replace(/\.0$/, "")}K`;
|
|
726
|
+
return `${(n / 1e6).toFixed(1).replace(/\.0$/, "")}M`;
|
|
727
|
+
}
|
|
728
|
+
function depositCommand(provider, id, lang) {
|
|
729
|
+
return takeoverCommand(provider, id) + "\n" + depositTail(lang);
|
|
730
|
+
}
|
|
731
|
+
function shortId(row) {
|
|
732
|
+
if (row.kind === "file") {
|
|
733
|
+
const base = row.id.split(/[\\/]/).pop() ?? row.id;
|
|
734
|
+
return base !== "" ? base : row.id;
|
|
735
|
+
}
|
|
736
|
+
return row.id;
|
|
737
|
+
}
|
|
738
|
+
function isSubagentSession(row) {
|
|
739
|
+
if (row.id.startsWith("sess_subagent_")) return true;
|
|
740
|
+
if (/^sess_dwf-/.test(row.id)) return true;
|
|
741
|
+
return /^workflow subagent/i.test(row.title);
|
|
742
|
+
}
|
|
743
|
+
function cwdFacets(rows) {
|
|
744
|
+
const freq = /* @__PURE__ */ new Map();
|
|
745
|
+
for (const r of rows) {
|
|
746
|
+
const label = r.cwd === "" ? "\u2014" : r.cwd.split(/[\\/]/).filter(Boolean).pop() ?? r.cwd;
|
|
747
|
+
const hit = freq.get(r.cwd);
|
|
748
|
+
if (hit !== void 0) hit.count += 1;
|
|
749
|
+
else freq.set(r.cwd, { label, count: 1 });
|
|
750
|
+
}
|
|
751
|
+
return [...freq.entries()].map(([cwd, v]) => ({ cwd, label: v.label, count: v.count })).sort((a, b) => b.count - a.count || a.label.localeCompare(b.label));
|
|
752
|
+
}
|
|
753
|
+
function filterByCwd(rows, cwd) {
|
|
754
|
+
if (cwd === null) return rows;
|
|
755
|
+
return rows.filter((r) => r.cwd === cwd);
|
|
756
|
+
}
|
|
757
|
+
var PROJECT_PALETTE = [
|
|
758
|
+
{ hex: "#818cf8", rgb: "129,140,248" },
|
|
759
|
+
// indigo
|
|
760
|
+
{ hex: "#38bdf8", rgb: "56,189,248" },
|
|
761
|
+
// sky
|
|
762
|
+
{ hex: "#34d399", rgb: "52,211,153" },
|
|
763
|
+
// emerald
|
|
764
|
+
{ hex: "#fbbf24", rgb: "251,191,36" },
|
|
765
|
+
// amber
|
|
766
|
+
{ hex: "#fb7185", rgb: "251,113,133" },
|
|
767
|
+
// rose
|
|
768
|
+
{ hex: "#a78bfa", rgb: "167,139,250" },
|
|
769
|
+
// violet
|
|
770
|
+
{ hex: "#22d3ee", rgb: "34,211,238" },
|
|
771
|
+
// cyan
|
|
772
|
+
{ hex: "#fb923c", rgb: "251,146,60" },
|
|
773
|
+
// orange
|
|
774
|
+
{ hex: "#a3e635", rgb: "163,230,53" },
|
|
775
|
+
// lime
|
|
776
|
+
{ hex: "#e879f9", rgb: "232,121,249" }
|
|
777
|
+
// fuchsia
|
|
778
|
+
];
|
|
779
|
+
var PROJECT_NEUTRAL = { hex: "#94a3b8", rgb: "148,163,184" };
|
|
780
|
+
function projectColor(cwd) {
|
|
781
|
+
if (cwd === "") return PROJECT_NEUTRAL;
|
|
782
|
+
let h = 2166136261;
|
|
783
|
+
for (let i = 0; i < cwd.length; i++) {
|
|
784
|
+
h ^= cwd.charCodeAt(i);
|
|
785
|
+
h = Math.imul(h, 16777619);
|
|
786
|
+
}
|
|
787
|
+
return PROJECT_PALETTE[(h >>> 0) % PROJECT_PALETTE.length] ?? PROJECT_NEUTRAL;
|
|
788
|
+
}
|
|
789
|
+
function uiNavigatorOf(ctx) {
|
|
790
|
+
return (sessionId) => {
|
|
791
|
+
try {
|
|
792
|
+
const nav = ctx.get?.("uiWorkspace");
|
|
793
|
+
if (nav === null || typeof nav !== "object") return false;
|
|
794
|
+
if (typeof nav.openSession !== "function") return false;
|
|
795
|
+
nav.openSession(sessionId);
|
|
796
|
+
return true;
|
|
797
|
+
} catch {
|
|
798
|
+
return false;
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
// src/client.ts
|
|
804
|
+
var tCache = /* @__PURE__ */ new WeakMap();
|
|
805
|
+
function resolveLocale(ctx) {
|
|
806
|
+
try {
|
|
807
|
+
const l = ctx.locale;
|
|
808
|
+
return l !== null && typeof l === "object" ? l : void 0;
|
|
809
|
+
} catch {
|
|
810
|
+
return void 0;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
function makeT(ctx) {
|
|
814
|
+
const hit = tCache.get(ctx);
|
|
815
|
+
if (hit !== void 0) return hit;
|
|
816
|
+
const locale = resolveLocale(ctx);
|
|
817
|
+
let t;
|
|
818
|
+
if (locale !== void 0 && typeof locale.register === "function" && typeof locale.bind === "function") {
|
|
819
|
+
try {
|
|
820
|
+
locale.register(NS, "zh", DICTS.zh);
|
|
821
|
+
locale.register(NS, "en", DICTS.en);
|
|
822
|
+
t = locale.bind(NS);
|
|
823
|
+
} catch (e) {
|
|
824
|
+
console.warn("[dsh-takeover] locale register/bind \u5931\u8D25\uFF0C\u56DE\u9000\u9759\u6001\u8BCD\u5178\uFF1A", e);
|
|
825
|
+
t = (key, params) => interpolate(DICTS.zh[String(key)] ?? String(key), params);
|
|
826
|
+
}
|
|
827
|
+
} else {
|
|
828
|
+
t = (key, params) => interpolate(DICTS.zh[String(key)] ?? String(key), params);
|
|
829
|
+
}
|
|
830
|
+
tCache.set(ctx, t);
|
|
831
|
+
return t;
|
|
832
|
+
}
|
|
833
|
+
function langOf(locale) {
|
|
834
|
+
try {
|
|
835
|
+
return locale?.getLocale().active === "en" ? "en" : "zh";
|
|
836
|
+
} catch {
|
|
837
|
+
return "zh";
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
function themeVars(forceDark = false) {
|
|
841
|
+
let dark = true;
|
|
842
|
+
try {
|
|
843
|
+
if (forceDark) return darkVars();
|
|
844
|
+
let bg = getComputedStyle(document.body).backgroundColor;
|
|
845
|
+
if (bg === "" || /rgba?\([^)]*\/\s*0\s*\)/.test(bg) || bg === "transparent") {
|
|
846
|
+
bg = getComputedStyle(document.documentElement).backgroundColor;
|
|
847
|
+
}
|
|
848
|
+
const modern = /^(oklch|oklab|lab|lch)\(\s*([\d.]+)(%?)/.exec(bg);
|
|
849
|
+
if (modern) {
|
|
850
|
+
const l = Number(modern[2]) * (modern[3] === "%" ? 0.01 : 1);
|
|
851
|
+
dark = l <= 0.5;
|
|
852
|
+
} else {
|
|
853
|
+
const m = bg.match(/\d+/g);
|
|
854
|
+
if (m && m.length >= 3) {
|
|
855
|
+
const [r = 0, g = 0, b = 0] = m.map(Number);
|
|
856
|
+
dark = (0.299 * r + 0.587 * g + 0.114 * b) / 255 <= 0.5;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
} catch {
|
|
860
|
+
}
|
|
861
|
+
return dark ? darkVars() : {
|
|
862
|
+
"--bt-a-text": "#4f46e5",
|
|
863
|
+
"--bt-mut": "rgba(30,41,59,.72)",
|
|
864
|
+
"--bt-ok": "#15803d",
|
|
865
|
+
"--bt-warn": "#b45309",
|
|
866
|
+
"--bt-err": "#d93025",
|
|
867
|
+
"--bt-card": "rgba(15,23,42,.04)",
|
|
868
|
+
"--bt-line": "rgba(15,23,42,.12)",
|
|
869
|
+
"--bt-id": "rgba(30,41,59,.55)",
|
|
870
|
+
"--bt-inset": "inset 0 1px 0 rgba(255,255,255,.7)",
|
|
871
|
+
// 壳层亮轴:白阶渐变
|
|
872
|
+
"--bt-shell-bg": "linear-gradient(180deg, #ffffff, #f4f5f7)",
|
|
873
|
+
"--bt-shell-border": "rgba(15,23,42,.12)",
|
|
874
|
+
"--bt-shell-edge": "linear-gradient(90deg, #6366F1, #8B5CF6, #6366F1)"
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
function darkVars() {
|
|
878
|
+
return {
|
|
879
|
+
"--bt-a-text": "#c7cdfd",
|
|
880
|
+
"--bt-mut": "#9aa3b5",
|
|
881
|
+
"--bt-ok": "#34d399",
|
|
882
|
+
"--bt-warn": "#fbbf24",
|
|
883
|
+
"--bt-err": "#fb7185",
|
|
884
|
+
// 三级表面:canvas(浮层壳/面板自身,不另铺色)→ 卡(透明/极淡底+描边)
|
|
885
|
+
// → 嵌套面(--bt-card,比卡再抬一档,预览块/输入框/会话行用)
|
|
886
|
+
"--bt-card": "rgba(255,255,255,.032)",
|
|
887
|
+
"--bt-line": "rgba(255,255,255,.075)",
|
|
888
|
+
"--bt-id": "#6b7386",
|
|
889
|
+
"--bt-hover": "rgba(255,255,255,.055)",
|
|
890
|
+
// 壳层(浮层模态本体):近黑画布 + 发光描边——与宿主页立即拉开层次
|
|
891
|
+
"--bt-shell-bg": "linear-gradient(180deg, #0e0f13, #08090a)",
|
|
892
|
+
"--bt-shell-border": "rgba(255,255,255,.12)",
|
|
893
|
+
"--bt-shell-edge": "linear-gradient(90deg, #6366F1, #8B5CF6, #6366F1)",
|
|
894
|
+
// 顶部 1px 内发光(描边浮现卡的内高光,随明暗轴换色)
|
|
895
|
+
"--bt-inset": "inset 0 1px 0 rgba(255,255,255,.06)"
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
var inject = ["slots", "locale"];
|
|
899
|
+
var HELP_SVG = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg>';
|
|
900
|
+
var MEMORY_SVG = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/></svg>';
|
|
901
|
+
var ICON_SVG = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="100%" height="100%" role="img" aria-label="dsh-takeover"><defs><linearGradient id="bt-bg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#6366F1"/><stop offset="1" stop-color="#8B5CF6"/></linearGradient><linearGradient id="bt-sheen" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffffff" stop-opacity=".26"/><stop offset=".55" stop-color="#ffffff" stop-opacity="0"/></linearGradient></defs><rect x="2" y="2" width="60" height="60" rx="15" fill="url(#bt-bg)"/><rect x="2" y="2" width="60" height="60" rx="15" fill="url(#bt-sheen)"/><rect x="2.75" y="2.75" width="58.5" height="58.5" rx="14.25" fill="none" stroke="#ffffff" stroke-opacity=".22" stroke-width="1.5"/><g fill="none" stroke="#ffffff" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"><path d="M15 19 L27 32 L15 45"/><path d="M29 19 L41 32 L29 45"/></g><rect x="46.5" y="17" width="6" height="30" rx="3" fill="#ffffff" opacity=".9"/></svg>';
|
|
902
|
+
function providerMark(name) {
|
|
903
|
+
const m = BRAND_MARKS[name];
|
|
904
|
+
return m ?? null;
|
|
905
|
+
}
|
|
906
|
+
function FolderIcon({ color, size = 13 }) {
|
|
907
|
+
return (0, import_react.createElement)(
|
|
908
|
+
"svg",
|
|
909
|
+
{
|
|
910
|
+
viewBox: "0 0 16 16",
|
|
911
|
+
width: size,
|
|
912
|
+
height: size,
|
|
913
|
+
"aria-hidden": true,
|
|
914
|
+
style: { flex: "none", display: "block" }
|
|
915
|
+
},
|
|
916
|
+
(0, import_react.createElement)("path", {
|
|
917
|
+
d: "M1.5 4A1.5 1.5 0 0 1 3 2.5h3.1c.44 0 .86.2 1.14.53l.9 1.07H13A1.5 1.5 0 0 1 14.5 5.6V12A1.5 1.5 0 0 1 13 13.5H3A1.5 1.5 0 0 1 1.5 12V4Z",
|
|
918
|
+
fill: color
|
|
919
|
+
})
|
|
920
|
+
);
|
|
921
|
+
}
|
|
922
|
+
function ProviderIcon({ name, size = 20 }) {
|
|
923
|
+
const full = BRAND_FULL_SVG[name];
|
|
924
|
+
if (full !== void 0) {
|
|
925
|
+
return (0, import_react.createElement)("span", {
|
|
926
|
+
className: "bt-icon bt-icon-full",
|
|
927
|
+
style: { width: size, height: size },
|
|
928
|
+
title: PROVIDER_LABEL[name] ?? name,
|
|
929
|
+
dangerouslySetInnerHTML: { __html: full }
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
const mark = providerMark(name);
|
|
933
|
+
if (mark === null) {
|
|
934
|
+
return (0, import_react.createElement)("span", {
|
|
935
|
+
className: "bt-icon",
|
|
936
|
+
style: { background: "linear-gradient(135deg, #6366F1, #8B5CF6)", width: size, height: size },
|
|
937
|
+
title: PROVIDER_LABEL[name] ?? name,
|
|
938
|
+
dangerouslySetInnerHTML: { __html: '<svg viewBox="0 0 64 64" width="100%" height="100%"><g fill="none" stroke="#fff" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"><path d="M15 19 L27 32 L15 45"/><path d="M29 19 L41 32 L29 45"/></g></svg>' }
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
return (0, import_react.createElement)(
|
|
942
|
+
"span",
|
|
943
|
+
{
|
|
944
|
+
className: "bt-icon",
|
|
945
|
+
style: { background: mark.tile, width: size, height: size },
|
|
946
|
+
title: PROVIDER_LABEL[name] ?? name
|
|
947
|
+
},
|
|
948
|
+
(0, import_react.createElement)(
|
|
949
|
+
"svg",
|
|
950
|
+
{ viewBox: mark.viewBox, width: Math.round(size * 0.64), height: Math.round(size * 0.64), "aria-hidden": true },
|
|
951
|
+
...mark.paths.map((p, i) => (0, import_react.createElement)("path", { key: i, d: p.d, fill: p.fill }))
|
|
952
|
+
)
|
|
953
|
+
);
|
|
954
|
+
}
|
|
955
|
+
var TK_TOKENS = {
|
|
956
|
+
// canvas:近黑画布 + 顶部品牌径向辉光(§2);壳与内嵌工作台共用一份背景
|
|
957
|
+
"--tk-canvas": "#0a0c11",
|
|
958
|
+
"--tk-canvas-bg": "radial-gradient(900px 340px at 22% -8%, rgba(99,102,241,.16), transparent 60%), radial-gradient(700px 300px at 90% -12%, rgba(167,139,250,.10), transparent 60%), var(--tk-canvas)",
|
|
959
|
+
// surface 两级 + 导航轨微底
|
|
960
|
+
"--tk-surface": "rgba(255,255,255,.032)",
|
|
961
|
+
"--tk-surface-2": "rgba(255,255,255,.055)",
|
|
962
|
+
"--tk-rail": "rgba(255,255,255,.018)",
|
|
963
|
+
// line 两级
|
|
964
|
+
"--tk-line": "rgba(255,255,255,.075)",
|
|
965
|
+
"--tk-line-2": "rgba(255,255,255,.13)",
|
|
966
|
+
// text 三级
|
|
967
|
+
"--tk-text": "#e7eaf2",
|
|
968
|
+
"--tk-mut": "#9aa3b5",
|
|
969
|
+
"--tk-dim": "#6b7386",
|
|
970
|
+
// 唯一 accent 渐变(§2:logo/主按钮/导航选中/win 顶条)+ 选中态文字/软底
|
|
971
|
+
"--tk-a": "#818cf8",
|
|
972
|
+
"--tk-a2": "#a78bfa",
|
|
973
|
+
"--tk-a-text": "#c7cdfd",
|
|
974
|
+
"--tk-a-soft": "rgba(129,140,248,.14)",
|
|
975
|
+
"--tk-a-line": "rgba(129,140,248,.5)",
|
|
976
|
+
"--tk-grad": "linear-gradient(135deg, #6366F1, #8B5CF6)",
|
|
977
|
+
"--tk-edge-grad": "linear-gradient(90deg, #6366F1, #a78bfa, #6366F1)",
|
|
978
|
+
// 渐变上的文字/滑块色(§2 on-accent)——规则里不再写 #fff
|
|
979
|
+
"--tk-on-accent": "#fff",
|
|
980
|
+
// 品牌辉光投影闭集(§2/§6):glow = logo + primary 按钮;glow-ctl = 选中页签等紧凑控件
|
|
981
|
+
"--tk-glow": "0 4px 14px rgba(99,102,241,.4)",
|
|
982
|
+
"--tk-glow-ctl": "0 2px 10px rgba(99,102,241,.3)",
|
|
983
|
+
// 状态三色(闭集,§2)
|
|
984
|
+
"--tk-ok": "#34d399",
|
|
985
|
+
"--tk-warn": "#fbbf24",
|
|
986
|
+
"--tk-err": "#fb7185",
|
|
987
|
+
// 状态 pill 底纹/描边(§4:ok/warn 两色底纹+描边)——tint 也只在这里定义一次
|
|
988
|
+
"--tk-ok-soft": "rgba(52,211,153,.1)",
|
|
989
|
+
"--tk-ok-line": "rgba(52,211,153,.3)",
|
|
990
|
+
"--tk-warn-soft": "rgba(251,191,36,.1)",
|
|
991
|
+
"--tk-warn-line": "rgba(251,191,36,.3)",
|
|
992
|
+
// 唯一投影:浮层本体(§6)
|
|
993
|
+
"--tk-shadow": "0 24px 70px rgba(0,0,0,.5)"
|
|
994
|
+
};
|
|
995
|
+
var TK_DECLS = Object.entries(TK_TOKENS).map(([k, v]) => `${k}: ${v};`).join(" ");
|
|
996
|
+
var NAV_ICONS = {
|
|
997
|
+
inbox: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/></svg>',
|
|
998
|
+
browser: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19.07 4.93A10 10 0 0 0 6.99 3.34"/><path d="M4 6h.01"/><path d="M2.29 9.62A10 10 0 1 0 21.31 8.35"/><path d="M16.24 7.76A6 6 0 1 0 8.23 16.67"/><path d="M12 18h.01"/><path d="M17.99 11.66A6 6 0 0 1 15.77 16.67"/><circle cx="12" cy="12" r="2"/><path d="m13.41 10.59 5.66-5.66"/></svg>',
|
|
999
|
+
send: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"/><path d="M6 12h16"/></svg>',
|
|
1000
|
+
memory: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/></svg>'
|
|
1001
|
+
};
|
|
1002
|
+
var CSS = `
|
|
1003
|
+
.bt-panel { display: flex; flex-direction: column; gap: 16px; padding: 4px 0 10px;
|
|
1004
|
+
container-type: inline-size;
|
|
1005
|
+
--bt-a: var(--accent, #6366f1); --bt-ok: #15803d; --bt-warn: #b45309; --bt-err: #d93025;
|
|
1006
|
+
--bt-line: var(--border, rgba(127,127,127,.2)); --bt-mut: rgba(30,41,59,.72); --bt-pulse-dur: 1.2s;
|
|
1007
|
+
--bt-card: var(--bg, rgba(127,127,127,.05)); --bt-hover: rgba(127,127,127,.07);
|
|
1008
|
+
--bt-shadow: 0 1px 2px rgba(16,24,40,.05), 0 12px 32px -18px rgba(16,24,40,.16);
|
|
1009
|
+
/* \u52A8\u6548 token\uFF1A\u5168\u5957 transition/animation \u53EA\u5403\u8FD9\u4E24\u4E2A\u503C\uFF08D \u6279\u6536\u655B\uFF0C\u4E0D\u518D\u96F6\u6563\u8C03\u53C2\uFF09 */
|
|
1010
|
+
--bt-ease: cubic-bezier(.4,0,.2,1); --bt-dur: 160ms;
|
|
1011
|
+
/* \u9876\u90E8 1px \u5185\u53D1\u5149\uFF08\u660E\u8F74\u9ED8\u8BA4\uFF1B\u6697\u8F74\u7531 themeVars \u6309 body \u4EAE\u5EA6\u8986\u5199\uFF09 */
|
|
1012
|
+
--bt-inset: inset 0 1px 0 rgba(255,255,255,.7);
|
|
1013
|
+
/* DESIGN.md \xA72/\xA76 \u8BED\u4E49 token\uFF08\u552F\u4E00\u5B9A\u4E49\u89C1 TK_TOKENS\uFF09 */
|
|
1014
|
+
${TK_DECLS} }
|
|
1015
|
+
/* ===== \u5DE5\u4F5C\u53F0\u91CD\u6392\uFF08DESIGN.md \xA75\uFF09\uFF1A\u5DE6\u5BFC\u822A\u8F68 148px + \u53F3\u4FA7\u5168\u5BBD\u89C6\u56FE\uFF0C\u4E24\u680F\u62FC\u76D8\u5E9F\u9664 ===== */
|
|
1016
|
+
/* \u6D6E\u5C42\u6302\u8F7D\uFF08bt-bounded\uFF09\uFF1A\u9762\u677F\u5403\u6EE1\u6D6E\u5C42\u5269\u4F59\u9AD8\u3001\u8D34\u58F3\u96F6\u5185\u8DDD\uFF1B\u6EDA\u52A8\u8D23\u4EFB\u4E0B\u6C89\u5230 .tk-scroll */
|
|
1017
|
+
.bt-bounded { flex: 1 1 auto; min-height: 0; overflow: hidden; gap: 0; padding: 0; }
|
|
1018
|
+
/* \u5C4F\u5E55\u9605\u8BFB\u5668\u4E13\u7528\uFF08\u6D6E\u5C42\u6807\u9898\uFF1A\u58F3\u5185\u552F\u4E00\u53EF\u89C1\u6587\u5B57\u662F\u5BFC\u822A\u8F68\uFF0Cdialog \u53EF\u53CA\u540D\u8D70\u8FD9\u91CC\uFF09 */
|
|
1019
|
+
.tk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
1020
|
+
.tk-body { display: flex; flex: 1 1 auto; min-height: 0; color: var(--tk-text); }
|
|
1021
|
+
/* \u8BBE\u7F6E\u5361\u5185\u5D4C\uFF08\u8001\u5BBF\u4E3B\u964D\u7EA7\uFF0C\u65E0\u6D6E\u5C42\u58F3\uFF09\uFF1A\u5DE5\u4F5C\u53F0\u81EA\u94FA canvas+\u8F89\u5149\uFF0C\u6210\u4E3A\u9875\u5185\u4E00\u5757\u6DF1\u8272\u6307\u6325\u53F0 */
|
|
1022
|
+
.bt-panel:not(.bt-bounded) .tk-body { background: var(--tk-canvas-bg); border: 1px solid var(--tk-line);
|
|
1023
|
+
border-radius: 16px; overflow: hidden; min-height: 480px; }
|
|
1024
|
+
/* \u5BFC\u822A\u8F68\uFF1A164px\uFF08148 \u4F1A\u622A\u65AD\u300C\u4F1A\u8BDD\u6D4F\u89C8\u5668\u300D\u2014\u2014\u771F\u5BBF\u4E3B\u9A8C\u6536 11-02 \u6293\u7684\uFF09\uFF0Clogo+\u56DB\u89C6\u56FE+\u4E0A\u624B\u6307\u5357+\u7248\u672C\u5FBD\u6807\uFF08\xA74 \u5BFC\u822A\u8F68\u9879 / \xA75 \u5E03\u5C40\uFF09 */
|
|
1025
|
+
.tk-rail { width: 164px; flex: none; box-sizing: border-box; border-right: 1px solid var(--tk-line);
|
|
1026
|
+
background: var(--tk-rail); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
|
|
1027
|
+
.tk-brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px 14px; min-width: 0; }
|
|
1028
|
+
.tk-brand-logo { width: 26px; height: 26px; flex: none; display: block; overflow: hidden; border-radius: 8px;
|
|
1029
|
+
filter: drop-shadow(var(--tk-glow)); }
|
|
1030
|
+
.tk-brand-logo svg { display: block; }
|
|
1031
|
+
.tk-brand b { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--tk-text); }
|
|
1032
|
+
.tk-navitem { display: flex; align-items: center; gap: 9px; width: 100%; box-sizing: border-box;
|
|
1033
|
+
border: 0; background: transparent; color: var(--tk-mut); padding: 9px 10px; border-radius: 9px;
|
|
1034
|
+
font-size: 12.5px; font-weight: 500; font-family: inherit; cursor: pointer; text-align: left;
|
|
1035
|
+
position: relative; transition: background var(--bt-dur) var(--bt-ease), color var(--bt-dur) var(--bt-ease); }
|
|
1036
|
+
.tk-navitem:hover { background: var(--tk-surface); color: var(--tk-text); }
|
|
1037
|
+
.tk-navitem:focus-visible { outline: 2px solid var(--tk-a); outline-offset: -2px; }
|
|
1038
|
+
/* \u58F3\u5C42\u5173\u95ED\u94AE\uFF1A\u53F3\u4E0A\u89D2\u60AC\u6D6E\uFF08\u89C6\u56FE\u5934\u52A8\u4F5C\u8BA9\u51FA\u53F3\u7F18\uFF0C\u89C1 .bt-bounded .tk-head\uFF09 */
|
|
1039
|
+
.tk-close { position: absolute; top: 11px; right: 12px; z-index: 2; width: 26px; height: 26px;
|
|
1040
|
+
display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--tk-line-2);
|
|
1041
|
+
background: var(--tk-surface); color: var(--tk-mut); font-size: 12px; font-family: inherit; cursor: pointer;
|
|
1042
|
+
transition: color var(--bt-dur, 160ms) var(--bt-ease, ease), border-color var(--bt-dur, 160ms) var(--bt-ease, ease); }
|
|
1043
|
+
.tk-close:hover { color: var(--tk-text); border-color: var(--tk-a-line); }
|
|
1044
|
+
.tk-close:focus-visible { outline: 2px solid var(--tk-a); outline-offset: 2px; }
|
|
1045
|
+
/* \u9009\u4E2D\u6001\uFF1A\u54C1\u724C\u6E10\u53D8\u5DE6\u7F18\u5149\u6761 + --tk-a-soft \u5E95\uFF08\xA74\uFF09 */
|
|
1046
|
+
.tk-navitem[aria-pressed="true"] { background: var(--tk-a-soft); color: var(--tk-a-text); font-weight: 600; }
|
|
1047
|
+
.tk-navitem[aria-pressed="true"]::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px;
|
|
1048
|
+
width: 3px; border-radius: 0 3px 3px 0; background: var(--tk-grad); }
|
|
1049
|
+
.tk-navitem .tk-ic { width: 15px; height: 15px; flex: none; display: inline-flex; }
|
|
1050
|
+
.tk-navitem .tk-ic svg { width: 15px; height: 15px; display: block; }
|
|
1051
|
+
.tk-navlabel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1052
|
+
.tk-badge { margin-left: auto; flex: none; font-size: 10px; font-weight: 600; min-width: 17px; text-align: center;
|
|
1053
|
+
padding: 1px 5px; border-radius: 999px; box-sizing: border-box; background: var(--tk-a-soft); color: var(--tk-a-text);
|
|
1054
|
+
font-variant-numeric: tabular-nums; }
|
|
1055
|
+
.tk-badge-hot { background: var(--tk-grad); color: var(--tk-on-accent); }
|
|
1056
|
+
.tk-rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
|
|
1057
|
+
.tk-ver { margin: 8px 8px 0; font-size: 10px; color: var(--tk-dim); font-family: ui-monospace, monospace;
|
|
1058
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1059
|
+
/* \u4E3B\u533A\uFF1A\u89C6\u56FE\u5934\uFF0815px \u6807\u9898+\u4E00\u53E5\u526F\u6807+\u89C6\u56FE\u7EA7\u52A8\u4F5C\uFF0C\xA75\uFF09+ \u89C6\u56FE\u4F53\u5185\u6EDA\uFF0C\u5934\u90E8\u4E0E\u8F68\u5E38\u9A7B */
|
|
1060
|
+
.tk-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
|
|
1061
|
+
.tk-view { display: none; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0; }
|
|
1062
|
+
.tk-view-on { display: flex; }
|
|
1063
|
+
.tk-head { flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
|
|
1064
|
+
padding: 15px 20px 13px; border-bottom: 1px solid var(--tk-line); }
|
|
1065
|
+
.bt-bounded .tk-head { padding-right: 50px; }
|
|
1066
|
+
/* \u6307\u5357\u5C5E\u5C55\u5F00\u4F53\uFF08\xA76\uFF09\uFF1A\u865A\u7EBF\u9876\u8FB9\u5206\u9694\uFF0C\u4E0D\u5D4C\u5361\u7247\u5E95\u8272 */
|
|
1067
|
+
.tk-view-guide .tk-head { border-bottom-style: dashed; }
|
|
1068
|
+
.tk-view-guide .tk-scroll > .bt-card { background: transparent; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
|
|
1069
|
+
.tk-head-text { min-width: 0; }
|
|
1070
|
+
.tk-h { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
|
|
1071
|
+
.tk-p { margin: 2px 0 0; font-size: 11px; color: var(--tk-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1072
|
+
.tk-head-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
|
|
1073
|
+
.tk-head .bt-filter { flex: 0 1 220px; min-width: 150px; height: 30px; }
|
|
1074
|
+
.tk-scroll { flex: 1 1 auto; min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 13px;
|
|
1075
|
+
padding: 16px 20px 20px; }
|
|
1076
|
+
.bt-bounded .tk-scroll { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
|
|
1077
|
+
.bt-bounded .tk-scroll::-webkit-scrollbar { width: 8px; }
|
|
1078
|
+
.bt-bounded .tk-scroll::-webkit-scrollbar-thumb { background: var(--tk-line-2); border-radius: 999px; }
|
|
1079
|
+
.bt-bounded .tk-scroll::-webkit-scrollbar-track { background: transparent; }
|
|
1080
|
+
.tk-strips { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 20px 0; }
|
|
1081
|
+
/* \u6536\u4EF6\u7BB1\u6982\u89C8\u74E6\u7247\uFF08\xA74\uFF09\uFF1A\u5927\u6570\u5B57 19px tabular + \u5C0F\u6807\u7B7E + \u5DE6\u7F18 3px \u8BED\u4E49\u8272\u6761\uFF1B\u7A84\u5BB9\u5668\u4E24\u884C\uFF08\xA78\uFF09\u3002
|
|
1082
|
+
DOM \u987A\u5E8F=\u6807\u7B7E\u5728\u524D\u6570\u5B57\u5728\u540E\uFF08\u8BFB\u5C4F\u5FF5\u300C\u5F85\u53D6\u4EF6 3\u300D\u800C\u975E\u300C3 \u5F85\u53D6\u4EF6\u300D\uFF09\uFF0Ccolumn-reverse \u8D1F\u8D23\u89C6\u89C9\u4E0A\u6570\u5B57\u5728\u4E0A */
|
|
1083
|
+
.tk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
|
|
1084
|
+
.tk-tile { background: var(--tk-surface); border: 1px solid var(--tk-line); border-radius: 12px;
|
|
1085
|
+
padding: 11px 13px 10px; position: relative; overflow: hidden; box-sizing: border-box; min-width: 0;
|
|
1086
|
+
display: flex; flex-direction: column-reverse; gap: 2px; }
|
|
1087
|
+
.tk-tile::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
|
|
1088
|
+
background: var(--tk-tc, var(--tk-a)); opacity: .85; }
|
|
1089
|
+
.tk-tile-num { font-size: 19px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15;
|
|
1090
|
+
font-variant-numeric: tabular-nums; }
|
|
1091
|
+
.tk-tile-lab { font-size: 11px; color: var(--tk-mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1092
|
+
.tk-tile-ok .tk-tile-num { color: var(--tk-ok); }
|
|
1093
|
+
.tk-tile-warn .tk-tile-num { color: var(--tk-warn); }
|
|
1094
|
+
.tk-tile-err .tk-tile-num { color: var(--tk-err); }
|
|
1095
|
+
@container (max-width: 975px) {
|
|
1096
|
+
.tk-tiles { grid-template-columns: repeat(3, 1fr); }
|
|
1097
|
+
.tk-head { padding: 13px 16px 11px; }
|
|
1098
|
+
.tk-scroll { padding: 13px 16px 16px; }
|
|
1099
|
+
.tk-strips { padding: 10px 16px 0; }
|
|
1100
|
+
}
|
|
1101
|
+
/* \u7B5B\u9009\u884C\uFF1A\u672A\u8BFB\u5F00\u5173\u5C45\u5DE6\u3001\u6765\u6E90 chips \u9760\u53F3\u968F\u6298\u884C */
|
|
1102
|
+
.bt-filterrow { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; }
|
|
1103
|
+
.bt-filterrow .bt-chips { margin: 0; }
|
|
1104
|
+
/* \u53EA\u770B\u65B0\u5361\uFF1A\u72EC\u7ACB\u590D\u9009\u6846\u5F00\u5173\uFF08\u672A\u8BFB\u6570\u968F\u663E\uFF09 */
|
|
1105
|
+
.bt-newonly { display: inline-flex; align-items: center; gap: 6px; width: fit-content;
|
|
1106
|
+
font-size: 12px; color: var(--bt-mut); cursor: pointer; user-select: none; margin: 0; }
|
|
1107
|
+
.bt-newonly:hover { color: var(--bt-a); }
|
|
1108
|
+
.bt-newonly input { appearance: none; width: 14px; height: 14px; border-radius: 4px;
|
|
1109
|
+
border: 1px solid var(--bt-line); background: var(--bt-card); cursor: pointer; margin: 0;
|
|
1110
|
+
display: grid; place-content: center; transition: border-color var(--bt-dur) var(--bt-ease); }
|
|
1111
|
+
.bt-newonly input::after { content: ''; width: 8px; height: 8px; transform: scale(0);
|
|
1112
|
+
background: var(--bt-a); border-radius: 2px; transition: transform var(--bt-dur) var(--bt-ease); }
|
|
1113
|
+
.bt-newonly input:checked { border-color: var(--bt-a); }
|
|
1114
|
+
.bt-newonly input:checked::after { transform: scale(1); }
|
|
1115
|
+
/* \u5BFC\u51FA\u25BE\u83DC\u5355\uFF1A\u5DE5\u5177\u884C\u53F3\u4FA7\u951A\u5B9A\u7684\u5C0F\u6D6E\u5C42 */
|
|
1116
|
+
.bt-export-wrap { position: relative; display: inline-flex; }
|
|
1117
|
+
.bt-export-mask { position: fixed; inset: 0; z-index: 30; background: transparent; }
|
|
1118
|
+
.bt-export-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 31;
|
|
1119
|
+
display: flex; flex-direction: column; min-width: 168px; padding: 4px;
|
|
1120
|
+
background: var(--dsw-specific-input-major, var(--bt-card, #171717));
|
|
1121
|
+
border: 1px solid var(--bt-line); border-radius: 10px;
|
|
1122
|
+
box-shadow: 0 8px 28px rgba(0,0,0,.4); }
|
|
1123
|
+
.bt-export-item { display: block; width: 100%; text-align: left; border: none; background: transparent;
|
|
1124
|
+
color: inherit; font-size: 12px; font-family: inherit; padding: 7px 10px; border-radius: 7px;
|
|
1125
|
+
cursor: pointer; white-space: nowrap; }
|
|
1126
|
+
.bt-export-item:hover { background: var(--bt-hover); }
|
|
1127
|
+
.bt-export-item:disabled { opacity: .45; cursor: default; }
|
|
1128
|
+
/* \u6D6E\u73B0\u5361\uFF08A \u6279\uFF09\uFF1Acanvas \u4E0A\u4E0D\u94FA\u5B9E\u8272\u5E95\u2014\u2014\u6781\u6DE1\u5E95 + 1px \u63CF\u8FB9 + \u9876\u90E8 1px \u5185\u53D1\u5149\uFF0C
|
|
1129
|
+
\u5C42\u7EA7\u9760\u63CF\u8FB9\u4E0E\u5185\u6D6E\u73B0\u8868\u8FBE\uFF0C\u66FF\u6362\u7070\u5E95\u5757\u89C2\u611F */
|
|
1130
|
+
.bt-card { background: rgba(127,127,127,.03); border: 1px solid var(--bt-line); border-radius: 12px;
|
|
1131
|
+
padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
|
|
1132
|
+
box-shadow: var(--bt-inset), var(--bt-shadow); }
|
|
1133
|
+
.bt-head { display: flex; align-items: center; gap: 12px; }
|
|
1134
|
+
.bt-logo { width: 40px; height: 40px; border-radius: 11px; flex: none; overflow: hidden;
|
|
1135
|
+
box-shadow: 0 2px 8px rgba(99,102,241,.35), inset 0 0 0 1px rgba(255,255,255,.18); }
|
|
1136
|
+
.bt-logo svg { display: block; }
|
|
1137
|
+
/* \u4E24\u7EA7\u6807\u9898\u9636\u68AF\uFF08\u5B57\u4F53\u7EAA\u5F8B\uFF09\uFF1A.bt-title 14px \u5361\u4E3B\u6807\u9898\uFF08\u6700\u9AD8\u4E00\u7EA7\uFF09\uFF0C.bt-title-sec
|
|
1138
|
+
13px \u5361\u5185\u8282\u6807\u9898\u2014\u2014\u8282\u6807\u9898\u4E00\u5F8B\u8D70\u540E\u8005\uFF0C\u7981\u6B62\u884C\u5185 fontSize \u8986\u5199 */
|
|
1139
|
+
.bt-title { font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
|
|
1140
|
+
.bt-title-sec { font-weight: 700; font-size: 13px; letter-spacing: -.01em; }
|
|
1141
|
+
.bt-sub { font-size: 12px; color: var(--bt-mut); line-height: 1.55; }
|
|
1142
|
+
.bt-spacer { flex: 1; }
|
|
1143
|
+
.bt-badge { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
|
|
1144
|
+
color: var(--bt-mut); background: rgba(127,127,127,.1); border: 1px solid var(--bt-line);
|
|
1145
|
+
font-variant-numeric: tabular-nums; }
|
|
1146
|
+
.bt-badge-hot { color: var(--bt-a); background: rgba(99,102,241,.1); border-color: rgba(99,102,241,.3); }
|
|
1147
|
+
/* bare \u6839\uFF08SendCard / ForeignBrowser / MemoryCard \u5D4C\u5165\u89C6\u56FE\u4F53\u65F6\u7684\u65E0\u58F3\u5BB9\u5668\uFF09 */
|
|
1148
|
+
.bt-bare { min-width: 0; }
|
|
1149
|
+
.bt-btn { cursor: pointer; border-radius: 10px; font-size: 12px; font-weight: 500; padding: 6px 16px;
|
|
1150
|
+
border: 1px solid var(--bt-line); background: transparent; color: inherit; white-space: nowrap;
|
|
1151
|
+
transition: border-color var(--bt-dur) var(--bt-ease), color var(--bt-dur) var(--bt-ease), background var(--bt-dur) var(--bt-ease), transform var(--bt-dur) var(--bt-ease); }
|
|
1152
|
+
.bt-btn:disabled { opacity: .5; cursor: default; }
|
|
1153
|
+
.bt-btn:not(:disabled):hover { border-color: var(--bt-a); color: var(--bt-a); transform: translateY(-1px); }
|
|
1154
|
+
.bt-btn:not(:disabled):active { transform: translateY(0); }
|
|
1155
|
+
.bt-btn-danger:not(:disabled):hover { border-color: var(--bt-err); color: var(--bt-err); }
|
|
1156
|
+
.bt-btn-confirm { background: var(--bt-err); border-color: transparent; color: #fff; }
|
|
1157
|
+
.bt-btn-confirm:not(:disabled):hover { color: #fff; transform: none; }
|
|
1158
|
+
.bt-banner { font-size: 12px; line-height: 1.6; border-radius: 10px; padding: 8px 12px; }
|
|
1159
|
+
.bt-banner-info { color: var(--bt-mut); background: rgba(127,127,127,.08); }
|
|
1160
|
+
.bt-banner-err { color: var(--bt-err); background: rgba(211,47,47,.08); }
|
|
1161
|
+
/* \u5361\u884C\uFF1A\u63CF\u8FB9\u6D6E\u73B0\u884C\u2014\u2014\u884C\u5C42\u63CF\u8FB9\u9ED8\u8BA4\u900F\u660E\uFF08\u5360\u4F4D\u4E0D\u753B\u6846\uFF09\uFF0Chover \u624D\u6D6E\u73B0 1px \u63CF\u8FB9\uFF1B
|
|
1162
|
+
\u672A\u8BFB\u884C\u5E38\u9A7B\u54C1\u724C\u63CF\u8FB9\uFF0C\u957F\u5217\u8868\u91CC\u4E0D hover \u4E5F\u80FD\u4E00\u773C\u5206\u8FA8\u3002\u5E38\u9A7B\u63CF\u8FB9\u53EA\u7559\u7ED9\u5361\u4E0E\u5D4C\u5957
|
|
1163
|
+
\u9884\u89C8\u4E24\u7EA7\uFF0C\u884C\u5C42\u4E0D\u53C2\u4E0E\u2014\u201430s \u8F6E\u8BE2\u6574\u8868\u5237\u65B0\u7684\u957F\u5217\u8868\u4E0D\u6210\u5361\u6D77\u3002\u884C\u5165\u573A\u65E0\u52A8\u753B
|
|
1164
|
+
\uFF08\u5237\u65B0\u4E0D\u95EA\uFF09\uFF0C\u52A8\u6548\u53EA\u6302\u5728 hover/\u72B6\u6001\u53D8\u5316\u4E0A\uFF08token\uFF1A--bt-ease/--bt-dur\uFF09 */
|
|
1165
|
+
.bt-rows { display: flex; flex-direction: column; gap: 4px; }
|
|
1166
|
+
.bt-pending { line-height: 1.45; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: flex-start;
|
|
1167
|
+
border-radius: 12px; padding: 10px 12px; font-size: 12px;
|
|
1168
|
+
border: 1px solid transparent; position: relative; box-shadow: var(--bt-inset);
|
|
1169
|
+
cursor: pointer; transition: background var(--bt-dur) var(--bt-ease), border-color var(--bt-dur) var(--bt-ease); }
|
|
1170
|
+
.bt-pending:hover { background: var(--bt-hover); border-color: var(--bt-line); }
|
|
1171
|
+
.bt-pending:focus-visible { outline: 2px solid var(--bt-a); outline-offset: -2px; }
|
|
1172
|
+
.bt-pending-open { background: var(--bt-hover); }
|
|
1173
|
+
.bt-pending-unread { background: rgba(99,102,241,.07); border-color: rgba(99,102,241,.3); }
|
|
1174
|
+
.bt-pending-unread:hover { background: rgba(99,102,241,.11); border-color: rgba(99,102,241,.45); }
|
|
1175
|
+
.bt-pending-unread::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px;
|
|
1176
|
+
width: 3px; border-radius: 999px; background: linear-gradient(180deg, #6366F1, #8B5CF6);
|
|
1177
|
+
transform-origin: top; animation: bt-bar-in var(--bt-dur) var(--bt-ease); }
|
|
1178
|
+
@keyframes bt-bar-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
|
|
1179
|
+
.bt-pending-unread.bt-pending-open::before { top: 10px; }
|
|
1180
|
+
.bt-pend-icon { flex: none; margin-top: 1px; }
|
|
1181
|
+
.bt-pend-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
1182
|
+
.bt-pend-line1 { display: flex; align-items: baseline; gap: 8px; }
|
|
1183
|
+
.bt-pending-title { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1184
|
+
.bt-pend-time { flex: none; font-size: 11px; color: var(--bt-mut); font-variant-numeric: tabular-nums; }
|
|
1185
|
+
.bt-pending-chev { flex: none; font-size: 10px; color: var(--bt-mut); align-self: flex-start; margin-top: 3px; transition: transform var(--bt-dur) var(--bt-ease); }
|
|
1186
|
+
.bt-pending-open .bt-pending-chev { transform: rotate(90deg); }
|
|
1187
|
+
.bt-pend-meta { display: flex; gap: 6px; align-items: baseline; font-size: 11px; color: var(--bt-mut);
|
|
1188
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
1189
|
+
.bt-pend-src { font-weight: 500; }
|
|
1190
|
+
.bt-pend-dot { opacity: .45; }
|
|
1191
|
+
.bt-pend-id { font-family: ui-monospace, monospace; font-size: 11px; color: var(--bt-id); }
|
|
1192
|
+
/* \u5C55\u5F00\u9884\u89C8\uFF1A\u5185\u5D4C\u8F6F\u9762\u677F\uFF08\u5706\u89D2 + \u63CF\u8FB9 + \u54C1\u724C\u5DE6\u7F18\uFF09\uFF0C\u4E0E\u884C\u4F53\u6709\u660E\u786E\u4ECE\u5C5E\u5173\u7CFB */
|
|
1193
|
+
.bt-preview { flex-basis: 100%; font-size: 12px; line-height: 1.65; color: inherit;
|
|
1194
|
+
background: var(--bt-card); border: 1px solid var(--bt-line); border-left: 2px solid var(--bt-a);
|
|
1195
|
+
border-radius: 10px;
|
|
1196
|
+
padding: 9px 12px; margin: 6px 0 2px 2px; white-space: pre-wrap;
|
|
1197
|
+
word-break: break-word; display: flex; flex-direction: column; gap: 4px; }
|
|
1198
|
+
.bt-preview-hint { font-size: 11px; color: var(--bt-mut); }
|
|
1199
|
+
/* \u5C55\u5F00\u6001\u52A8\u4F5C\u884C\uFF1A\u9884\u89C8\u63D0\u793A + \u5355\u5361\u5BFC\u51FA\u6309\u94AE */
|
|
1200
|
+
.bt-preview-actions { display: flex; align-items: center; gap: 8px; justify-content: space-between;
|
|
1201
|
+
white-space: normal; }
|
|
1202
|
+
/* \u6536\u4EF6\u7BB1\u5DE5\u5177\u884C\uFF1A\u5373\u65F6\u8FC7\u6EE4\u8F93\u5165 + \u5BFC\u51FA\u5168\u90E8\uFF08\u8FC7\u6EE4\u8BCD\u7A7A = \u5168\u91CF\uFF09 */
|
|
1203
|
+
.bt-inbox-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: -2px; }
|
|
1204
|
+
.bt-inbox-toolbar .bt-filter { flex: 1 1 180px; }
|
|
1205
|
+
.bt-filter { flex: 1; min-width: 0; height: 32px; box-sizing: border-box;
|
|
1206
|
+
border: 1px solid var(--bt-line); border-radius: 10px; background: var(--bt-card);
|
|
1207
|
+
color: inherit; font-size: 12px; padding: 0 10px; outline: none;
|
|
1208
|
+
transition: border-color var(--bt-dur) var(--bt-ease), box-shadow var(--bt-dur) var(--bt-ease); }
|
|
1209
|
+
.bt-filter:focus { border-color: var(--bt-a); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
|
|
1210
|
+
.bt-filter::placeholder { color: var(--bt-mut); opacity: .75; }
|
|
1211
|
+
/* \u884C\u5185\u5C0F\u5FBD\u6807\uFF1A\u300C\u65B0\u300D\uFF08\u672A\u5C55\u5F00\u8FC7\u7684\u5361\uFF09\u4E0E\u5206\u7EC4\u8BA1\u6570\uFF0C\u540C\u4E00\u57FA\u5EA7\u3002
|
|
1212
|
+
C \u6279\u964D\u9971\u548C\uFF1A\u4F4E\u9971\u548C\u5E95 + 1px \u540C\u8272\u63CF\u8FB9\uFF0C\u89C6\u89C9\u6743\u91CD\u964D\u4E00\u6863\uFF1B\u5B57\u53F7 11px\u2014\u2014\u6587\u6848\u662F\u4E2D\u6587\uFF08\xA73 \u4E0B\u9650\uFF0C\u4E0E .tk-pill \u540C\u88C1\u51B3\uFF09 */
|
|
1213
|
+
.bt-tag { font-size: 11px; font-weight: 600; line-height: 1.5; padding: 1px 8px;
|
|
1214
|
+
border-radius: 999px; flex: none; white-space: nowrap; box-sizing: border-box; letter-spacing: .01em; }
|
|
1215
|
+
.bt-tag-new { color: var(--bt-warn); background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.32); }
|
|
1216
|
+
.bt-tag-lowinfo { color: var(--bt-mut); background: rgba(127,127,127,.06); border: 1px solid var(--bt-line); }
|
|
1217
|
+
.bt-tag-group { color: var(--bt-a); background: rgba(99,102,241,.08); border: 1px solid rgba(99,102,241,.3); }
|
|
1218
|
+
/* \u7EC4\u5185\u6210\u5458\u884C\uFF1A\u6574\u4F53\u53F3\u7F29\u8FDB\uFF0C\u89C6\u89C9\u4E0A\u6302\u5728\u7EC4\u5934\u4E0B */
|
|
1219
|
+
.bt-pending-member { margin-left: 20px; }
|
|
1220
|
+
/* \u884C\u5916\u58F3\uFF08\u4E2D\u6027\u5BB9\u5668\uFF0C\u5185\u542B role=button \u884C + \u5144\u5F1F\u9884\u89C8\u5757\uFF09\uFF1A\u5EF6\u7EED\u539F\u5148\u884C\u5185 flex-wrap \u5E03\u5C40 */
|
|
1221
|
+
.bt-pending-wrap { display: flex; flex-wrap: wrap; }
|
|
1222
|
+
/* ===== \u8BBE\u7F6E\u5361\uFF08DESIGN.md \xA74 \u8BBE\u7F6E\u5361\u9875\u7B7E / \u539F\u578B\u7A97\u53E3 2\uFF09=====
|
|
1223
|
+
\u81EA\u94FA canvas \u7684\u6DF1\u8272\u6307\u6325\u53F0\u5757\uFF08--bt-* \u884C\u5185\u6052\u8D70\u6697\u8F74\uFF0C\u6D45\u8272\u5BBF\u4E3B\u9875\u91CC\u4E0D\u7FFB\u767D\uFF0C\u540C\u5DE5\u4F5C\u53F0\u5185\u5D4C\u5904\u7406\uFF09\uFF1A
|
|
1224
|
+
\u5934\u884C\uFF08logo+\u6807\u9898+\u5206\u6BB5\u5668+\u52A8\u4F5C\uFF09+ \u4E09\u6BB5\u9875\u7B7E\u9762\u677F\uFF08\u547D\u4EE4\u901F\u89C8 / \u652F\u6301\u77E9\u9635 / \u5F00\u5173\u8BED\u4E49\uFF09\uFF0C\u7981\u6B62\u957F\u6EDA\u52A8\u4E00\u5C4F\u5230\u5E95 */
|
|
1225
|
+
.tk-set { position: relative; overflow: hidden; box-sizing: border-box; min-width: 0;
|
|
1226
|
+
background: var(--tk-canvas-bg); color: var(--tk-text); border: 1px solid var(--tk-line); border-radius: 16px;
|
|
1227
|
+
padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 13px;
|
|
1228
|
+
box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
|
|
1229
|
+
/* \u9876\u8FB9 3px \u54C1\u724C\u6E10\u53D8\u6761\uFF08\xA72\uFF1Aaccent \u6E10\u53D8\u7528\u4E8E win \u9876\u6761\uFF09 */
|
|
1230
|
+
.tk-set::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
|
|
1231
|
+
background: var(--tk-edge-grad); opacity: .9; }
|
|
1232
|
+
.tk-set-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
|
|
1233
|
+
.tk-set-logo { width: 26px; height: 26px; flex: none; display: block; overflow: hidden; border-radius: 8px;
|
|
1234
|
+
filter: drop-shadow(var(--tk-glow)); }
|
|
1235
|
+
.tk-set-logo svg { display: block; }
|
|
1236
|
+
.tk-set-text { min-width: 0; flex: 0 1 auto; }
|
|
1237
|
+
.tk-set-title { font-size: 13px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; color: var(--tk-text); }
|
|
1238
|
+
.tk-set-sub { font-size: 11px; color: var(--tk-dim); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1239
|
+
.tk-set-acts { display: flex; align-items: center; gap: 8px; flex: none; }
|
|
1240
|
+
/* \u5206\u6BB5\u5668\uFF1A3px \u5185\u8DDD\u5BB9\u5668 + 7px \u5706\u89D2\u9875\u7B7E\uFF0C\u9009\u4E2D\u9875\u7B7E\u54C1\u724C\u6E10\u53D8\uFF08\xA74\uFF09\uFF1Bbutton+aria-selected \u8BED\u4E49 */
|
|
1241
|
+
.tk-tabs { display: flex; gap: 3px; padding: 3px; width: fit-content; max-width: 100%; box-sizing: border-box;
|
|
1242
|
+
background: var(--tk-surface); border: 1px solid var(--tk-line); border-radius: 9px; margin-left: auto; }
|
|
1243
|
+
.tk-tab { border: 0; background: transparent; color: var(--tk-mut); font-family: inherit; font-size: 12px; font-weight: 500;
|
|
1244
|
+
line-height: 1.3; padding: 6px 15px; border-radius: 7px; cursor: pointer; white-space: nowrap;
|
|
1245
|
+
transition: background var(--bt-dur) var(--bt-ease), color var(--bt-dur) var(--bt-ease); }
|
|
1246
|
+
.tk-tab:hover { color: var(--tk-text); background: var(--tk-surface-2); }
|
|
1247
|
+
.tk-tab:focus-visible { outline: 2px solid var(--tk-a); outline-offset: 2px; }
|
|
1248
|
+
.tk-tab[aria-selected="true"] { background: var(--tk-grad); color: var(--tk-on-accent); font-weight: 600;
|
|
1249
|
+
box-shadow: var(--tk-glow-ctl); }
|
|
1250
|
+
/* \u9762\u677F\uFF1A\u4E09\u5757\u5E38\u9A7B\u6302\u8F7D\uFF0Chidden \u5207\u6362\uFF08\u4E0E\u5DE5\u4F5C\u53F0\u89C6\u56FE\u540C\u4E00\u624B\u6CD5\uFF1Adisplay \u7531\u7C7B\u63A7\u5236\uFF0Chidden \u5C5E\u6027\u7ED9\u8BED\u4E49\uFF09 */
|
|
1251
|
+
.tk-pane { display: none; flex-direction: column; gap: 10px; min-width: 0; }
|
|
1252
|
+
.tk-pane-on { display: flex; }
|
|
1253
|
+
.tk-pane[hidden] { display: none; }
|
|
1254
|
+
.tk-pane-lead { font-size: 11px; color: var(--tk-dim); }
|
|
1255
|
+
/* \u547D\u4EE4\u901F\u89C8\u7F51\u683C\uFF1Amono \u952E + \u8BF4\u660E\u6587\u6848\uFF08\xA73 \u4EE3\u7801 ui-monospace\uFF09\uFF1B\u6570\u636E\u6E90\u4E0D\u53D8\uFF08/handoff \xB7 /inbox \xB7 /resume-*\uFF09 */
|
|
1256
|
+
.tk-cmds { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px; }
|
|
1257
|
+
.tk-cmd { display: flex; align-items: center; gap: 9px; min-width: 0; box-sizing: border-box;
|
|
1258
|
+
border: 1px solid var(--tk-line); border-radius: 9px; padding: 9px 12px; background: var(--tk-surface);
|
|
1259
|
+
transition: border-color var(--bt-dur) var(--bt-ease), opacity var(--bt-dur) var(--bt-ease); }
|
|
1260
|
+
.tk-cmd:hover { border-color: var(--tk-a-line); }
|
|
1261
|
+
.tk-cmd .bt-icon { width: 16px; height: 16px; flex: none; border-radius: 5px; }
|
|
1262
|
+
.tk-cmd-key { font-family: ui-monospace, monospace; font-size: 11px; font-weight: 600; color: var(--tk-text); flex: none; }
|
|
1263
|
+
.tk-cmd-key-primary { color: var(--tk-a-text); }
|
|
1264
|
+
.tk-cmd-desc { font-size: 11px; color: var(--tk-mut); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1265
|
+
.tk-cmd-off { opacity: .42; }
|
|
1266
|
+
.bt-icon { display: inline-flex; align-items: center; justify-content: center; border-radius: 6px;
|
|
1267
|
+
flex: none; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.16); }
|
|
1268
|
+
.bt-icon svg { display: block; }
|
|
1269
|
+
.bt-icon-full { border-radius: 50%; }
|
|
1270
|
+
.bt-icon-full svg { width: 100%; height: 100%; }
|
|
1271
|
+
.bt-icon-letter { color: #fff; font-weight: 700; font-size: 11px; line-height: 1; letter-spacing: -.02em; user-select: none; }
|
|
1272
|
+
/* \u652F\u6301\u77E9\u9635\uFF08\u4E5D\u5BB6\uFF09\uFF1A\u540D\u79F0\u5217\uFF08\u54C1\u724C\u56FE\u6807+\u89C4\u8303\u540D+mono id+\u54E8\u5175\u63D0\u793A\uFF09/ \u4F1A\u8BDD\u6570 / \u72B6\u6001 pill / \u5F00\u5173 */
|
|
1273
|
+
.tk-mx { display: flex; flex-direction: column; }
|
|
1274
|
+
.tk-mxr { display: grid; grid-template-columns: minmax(170px, auto) 1fr auto auto; gap: 11px; align-items: center;
|
|
1275
|
+
padding: 8px 4px; border-bottom: 1px solid var(--tk-line); border-radius: 8px;
|
|
1276
|
+
transition: opacity var(--bt-dur) var(--bt-ease), background var(--bt-dur) var(--bt-ease); }
|
|
1277
|
+
.tk-mxr:hover { background: var(--tk-surface); }
|
|
1278
|
+
.tk-mxr:last-child { border-bottom: 0; }
|
|
1279
|
+
/* \u7070\u884C = \u672C\u673A\u672A\u88C5\u6216\u6682\u65E0\u4F1A\u8BDD\uFF08note \u4E3A\u7A7A\uFF09\uFF1B\u5F85\u786E\u8BA4\u884C\u4FDD\u6301\u5168\u4EAE\uFF0C\u9EC4 pill \u7B2C\u4E00\u773C\u53EF\u8FA8 */
|
|
1280
|
+
.tk-mxr-idle { opacity: .5; }
|
|
1281
|
+
.tk-mxr-idle:hover { opacity: .85; }
|
|
1282
|
+
.tk-mname-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
|
|
1283
|
+
.tk-mname-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
|
1284
|
+
.tk-mname { font-size: 13px; font-weight: 600; letter-spacing: -.01em; color: var(--tk-text); white-space: nowrap; }
|
|
1285
|
+
.tk-mid { font-family: ui-monospace, monospace; font-size: 11px; color: var(--tk-dim); }
|
|
1286
|
+
/* \u5047 0 \u54E8\u5175\u6D6E\u51FA\uFF1Asupported \u4E14 note \u975E\u7A7A\u65F6\u884C\u5185\u9EC4\u8272\u5C0F\u5B57\uFF08\u4E0D\u53EA\u653E title\uFF09\uFF0C\u4E0E pill \u540C\u8F74 */
|
|
1287
|
+
.tk-mnote { font-size: 11px; line-height: 1.5; color: var(--tk-warn); max-width: 360px; overflow-wrap: anywhere; }
|
|
1288
|
+
.tk-mstat { font-size: 11px; color: var(--tk-mut); text-align: right; overflow: hidden; text-overflow: ellipsis;
|
|
1289
|
+
white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
1290
|
+
/* \u72B6\u6001 pill\uFF08\xA74\uFF09\uFF1A11px/600 \u80F6\u56CA\uFF08\xA73 \u4E2D\u6587\u4E0B\u9650 11px \u4F18\u5148\u4E8E\u539F\u578B\u7684 10px\u2014\u2014\u6587\u6848\u662F\u4E2D\u6587\uFF09\uFF0C
|
|
1291
|
+
ok/warn \u4E24\u8272\u5E95\u7EB9+\u63CF\u8FB9\uFF0C\u6587\u6848\u95ED\u96C6\uFF08\u652F\u6301 / \u5F85\u786E\u8BA4 / \u4E0D\u53EF\u7528\uFF09 */
|
|
1292
|
+
.tk-pill { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; flex: none;
|
|
1293
|
+
min-width: 34px; text-align: center; box-sizing: border-box; letter-spacing: .01em; white-space: nowrap; }
|
|
1294
|
+
.tk-pill-ok { color: var(--tk-ok); background: var(--tk-ok-soft); border: 1px solid var(--tk-ok-line); }
|
|
1295
|
+
.tk-pill-warn { color: var(--tk-warn); background: var(--tk-warn-soft); border: 1px solid var(--tk-warn-line); }
|
|
1296
|
+
/* \u5F00\u5173\uFF08\xA74\uFF09\uFF1A34\xD719 \u5706\u89D2\u8F68\uFF08\u89C6\u89C9\uFF09\uFF0C\u9009\u4E2D\u54C1\u724C\u6E10\u53D8\uFF0C\u767D\u8272\u6ED1\u5757\u5E26\u6295\u5F71\uFF1B\u6ED1\u5757\u53EA\u52A8 transform\uFF08\xA77\uFF09\u3002
|
|
1297
|
+
\u547D\u4E2D\u533A\uFF1A\u900F\u660E ::before \u4E0A\u4E0B\u5404\u6269 3px \u2192 25px \u9AD8\uFF0C\u6EE1\u8DB3 \xA78 \u53EF\u70B9\u76EE\u6807 \u226524px\uFF0C\u8F68\u5C3A\u5BF8\u4E0D\u53D8 */
|
|
1298
|
+
.tk-switch { cursor: pointer; width: 34px; height: 19px; border-radius: 999px; border: 0; padding: 0;
|
|
1299
|
+
background: var(--tk-line-2); position: relative; justify-self: end; flex: none;
|
|
1300
|
+
transition: background var(--bt-dur) var(--bt-ease); }
|
|
1301
|
+
.tk-switch::before { content: ''; position: absolute; left: 0; right: 0; top: -3px; bottom: -3px; }
|
|
1302
|
+
.tk-switch:disabled { opacity: .45; cursor: default; }
|
|
1303
|
+
.tk-switch:focus-visible { outline: 2px solid var(--tk-a); outline-offset: 2px; }
|
|
1304
|
+
.tk-switch::after { content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 14px; height: 14px; border-radius: 50%;
|
|
1305
|
+
background: var(--tk-on-accent); box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform var(--bt-dur) var(--bt-ease); }
|
|
1306
|
+
.tk-switch-on { background: var(--tk-grad); }
|
|
1307
|
+
.tk-switch-on::after { transform: translateX(15px); }
|
|
1308
|
+
/* \u5F00\u5173\u8BED\u4E49\uFF1A\u865A\u7EBF\u63CF\u8FB9\u900F\u660E\u9762\uFF08\xA76 \u4E0D\u5D4C\u5957\u5361\u7247\u5E95\u8272\uFF09\uFF0C\u4E24\u6BB5\u8BF4\u660E */
|
|
1309
|
+
.tk-sem { border: 1px dashed var(--tk-line); border-radius: 12px; padding: 13px 16px;
|
|
1310
|
+
font-size: 12px; color: var(--tk-mut); line-height: 1.7; display: flex; flex-direction: column; gap: 8px; }
|
|
1311
|
+
.tk-sem p { margin: 0; }
|
|
1312
|
+
.bt-note { font-size: 12px; color: var(--bt-mut); line-height: 1.6; border-left: 2px solid var(--bt-line);
|
|
1313
|
+
padding-left: 10px; }
|
|
1314
|
+
.bt-note summary { cursor: pointer; user-select: none; list-style: none; display: flex; align-items: center; gap: 6px; }
|
|
1315
|
+
.bt-note summary::-webkit-details-marker { display: none; }
|
|
1316
|
+
.bt-note summary::before { content: '\u25B8'; font-size: 10px; transition: transform var(--bt-dur) var(--bt-ease); }
|
|
1317
|
+
.bt-note[open] summary::before { transform: rotate(90deg); }
|
|
1318
|
+
.bt-note-body { margin-top: 6px; }
|
|
1319
|
+
/* \u7A84\u5BB9\u5668\uFF08\u4FA7\u680F\u6536\u7A84\uFF09\uFF1A\u77E9\u9635\u884C\u6536\u6389\u4F1A\u8BDD\u6570\u5217\uFF0C\u907F\u514D\u6324\u538B\u6362\u884C\uFF08\u547D\u4EE4\u7F51\u683C\u8D70 auto-fill \u81EA\u7136\u5355\u5217\uFF09\uFF1B\u89C4\u5219\u89C1\u6587\u672B @container */
|
|
1320
|
+
/* \u6765\u6E90\u7B5B\u9009 chips\uFF1A\u5168\u90E8/\u5404\u5BB6/\u53EA\u770B\u65B0\u5361\uFF0Cpill \u57FA\u5EA7 + \u9009\u4E2D\u6001\u54C1\u724C\u63CF\u8FB9 */
|
|
1321
|
+
.bt-chips { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 2px 0 8px; }
|
|
1322
|
+
.bt-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid var(--bt-line); border-radius: 999px; padding: 3px 12px;
|
|
1323
|
+
background: transparent; color: var(--bt-mut); font-size: 11px; font-weight: 500;
|
|
1324
|
+
font-variant-numeric: tabular-nums;
|
|
1325
|
+
transition: border-color var(--bt-dur) var(--bt-ease), color var(--bt-dur) var(--bt-ease), background var(--bt-dur) var(--bt-ease); }
|
|
1326
|
+
.bt-chip:hover { border-color: var(--bt-a); color: var(--bt-a); }
|
|
1327
|
+
.bt-chip-on { color: var(--bt-a-text); background: rgba(99,102,241,.12);
|
|
1328
|
+
border-color: rgba(99,102,241,.45); font-weight: 600; }
|
|
1329
|
+
.bt-chip-count { font-size: 10px; opacity: .75; }
|
|
1330
|
+
/* chips \u5185\u54C1\u724C\u56FE\u6807\uFF08\u6765\u6E90\u7B5B\u9009 / \u63A5\u6536\u65B9\u9009\u62E9 / \u5916\u90E8\u4F1A\u8BDD\u6D4F\u89C8\u5668 pills \u540C\u6B3E\uFF09 */
|
|
1331
|
+
.bt-chip svg { width: 13px; height: 13px; display: block; }
|
|
1332
|
+
/* \u5916\u90E8\u4F1A\u8BDD\u6D4F\u89C8\u5668\uFF1A\u884C + \u9884\u89C8\u5C55\u5F00\u4F53\u3002\u63A5\u7BA1/\u5BC4\u5B58\u4E00\u952E\u6295\u9012\u2014\u2014\u9762\u677F\u4E0D\u4EA7\u5361\uFF0C
|
|
1333
|
+
* \u84B8\u998F\u90FD\u5728\u4F1A\u8BDD\u91CC\u7531\u6A21\u578B\u5B8C\u6210\uFF08\u5361\u7247\u8D28\u91CF\u8DDF\u6A21\u578B\u80FD\u529B\u8D70\uFF09\u3002
|
|
1334
|
+
* \u6837\u5F0F\uFF1A\u4E3B\u64CD\u4F5C\u300C\u63A5\u7BA1\u300D\u6709\u4E3B\u6309\u94AE\u6743\u91CD\uFF1B\u52A8\u4F5C\u6309\u94AE\u5B9A\u5BBD\u9632\u72B6\u6001\u6587\u6848\u5207\u6362\u8DF3\u52A8\uFF1B
|
|
1335
|
+
* chips \u4E0E\u6309\u94AE\u8865\u952E\u76D8\u7126\u70B9\u73AF\u3002 */
|
|
1336
|
+
/* primary \u6309\u94AE\uFF08\xA74/\xA76\uFF09\uFF1A\u54C1\u724C\u6E10\u53D8\u5E95 + on-accent \u6587\u5B57 + \u54C1\u724C\u6295\u5F71 --tk-glow\uFF08\u539F\u578B tk-btn.primary \u540C\u6CD5\uFF09\uFF1B
|
|
1337
|
+
\u60AC\u6D6E\u53EA\u63D0\u4EAE\uFF08brightness\uFF09\u4E0D\u6362\u8272\uFF0C\u57FA\u7C7B hover \u7684\u63CF\u8FB9/\u6587\u5B57\u6362\u8272\u5728\u6B64\u8986\u76D6\uFF1B\u5168\u90E8\u8D70 --tk-* token */
|
|
1338
|
+
.bt-btn-primary { color: var(--tk-on-accent); border-color: transparent; background: var(--tk-grad); font-weight: 600;
|
|
1339
|
+
box-shadow: var(--tk-glow); transition: filter var(--bt-dur) var(--bt-ease), transform var(--bt-dur) var(--bt-ease); }
|
|
1340
|
+
.bt-btn-primary:not(:disabled):hover { background: var(--tk-grad); border-color: transparent; color: var(--tk-on-accent);
|
|
1341
|
+
filter: brightness(1.12); transform: translateY(-1px); }
|
|
1342
|
+
.bt-fsess-act .bt-btn-xs { min-width: 4.5em; }
|
|
1343
|
+
.bt-chip:focus-visible, .bt-btn:focus-visible { outline: 2px solid var(--bt-a); outline-offset: 2px; }
|
|
1344
|
+
.bt-chip-off { opacity: .4; }
|
|
1345
|
+
.bt-chip-off:hover { border-color: var(--bt-line); color: var(--bt-mut); }
|
|
1346
|
+
.bt-btn-xs { font-size: 11px; padding: 2px 8px; border-radius: 8px; }
|
|
1347
|
+
.bt-fsess { min-width: 0; border: 1px solid var(--bt-line); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; background: var(--bt-card); }
|
|
1348
|
+
.bt-fsess-line1 { display: flex; gap: 8px; align-items: baseline; }
|
|
1349
|
+
.bt-fsess-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden;
|
|
1350
|
+
text-overflow: ellipsis; white-space: nowrap; cursor: pointer; border-radius: 4px; }
|
|
1351
|
+
.bt-fsess-title:hover { color: var(--bt-a); }
|
|
1352
|
+
.bt-fsess-title:focus-visible { outline: 2px solid var(--bt-a); outline-offset: 2px; }
|
|
1353
|
+
.bt-fsess-time { flex: none; font-size: 11px; color: var(--bt-mut); font-variant-numeric: tabular-nums; }
|
|
1354
|
+
.bt-fsess-line2 { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
|
|
1355
|
+
.bt-fsess-src { display: inline-flex; align-items: center; gap: 5px; flex: none; max-width: 32%;
|
|
1356
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
|
|
1357
|
+
.bt-fsess-src svg { flex: none; }
|
|
1358
|
+
.bt-fsess-id { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
1359
|
+
font-size: 11px; color: var(--bt-mut); cursor: pointer; font-variant-numeric: tabular-nums; }
|
|
1360
|
+
.bt-fsess-id:hover { color: var(--bt-a); }
|
|
1361
|
+
.bt-fsess-id:focus-visible { outline: 2px solid var(--bt-a); outline-offset: 2px; }
|
|
1362
|
+
.bt-fsess-act { flex: none; display: flex; gap: 4px; }
|
|
1363
|
+
.bt-fsprev { margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--bt-line); display: grid;
|
|
1364
|
+
gap: 3px; font-size: 11px; }
|
|
1365
|
+
.bt-fsprev-line { display: flex; gap: 6px; min-width: 0; }
|
|
1366
|
+
.bt-fsprev-label { flex: none; color: var(--bt-mut); }
|
|
1367
|
+
.bt-fsprev-text { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3;
|
|
1368
|
+
-webkit-box-orient: vertical; word-break: break-word; }
|
|
1369
|
+
.bt-fsprev-warn { color: var(--bt-warn); }
|
|
1370
|
+
.bt-fs-empty { padding: 8px 2px; }
|
|
1371
|
+
.bt-fs-count { margin: 8px 0 6px; }
|
|
1372
|
+
/* \u9AA8\u67B6\u5C4F\uFF08E \u6279\uFF09\uFF1Astate \u672A\u5230\u4F4D\u65F6\u6536\u4EF6\u7BB1\u6982\u89C8\u7684\u5360\u4F4D\u2014\u20143 \u6761\u8109\u51B2\u6761\u66FF\u4EE3\u300C\u52A0\u8F7D\u300D\u7EAF\u6587\u5B57\uFF0C
|
|
1373
|
+
\u8109\u51B2\u53EA\u52A8 opacity\uFF08\u4E0D\u89E6\u53D1\u5E03\u5C40\uFF09\uFF0C\u5BBD\u5DEE 100/70/45% \u7531\u884C\u5185\u6837\u5F0F\u7ED9 */
|
|
1374
|
+
.bt-skeleton { height: 12px; border-radius: 6px; background: var(--bt-hover);
|
|
1375
|
+
animation: bt-pulse var(--bt-pulse-dur) var(--bt-ease) infinite; }
|
|
1376
|
+
@keyframes bt-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
|
|
1377
|
+
/* \u52A8\u6548\u964D\u7EA7\uFF1A\u7CFB\u7EDF\u58F0\u660E\u51CF\u5C11\u52A8\u6548\u65F6\uFF0C\u8109\u51B2/\u5F3A\u8C03\u6761\u5C55\u5F00\u5168\u90E8\u505C\u7528\uFF08\u5168\u4ED3\u9996\u6279 @keyframes \u7684\u5B88\u536B\uFF09 */
|
|
1378
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1379
|
+
.bt-skeleton { animation: none; opacity: .55; }
|
|
1380
|
+
.bt-pending-unread::before { animation: none; }
|
|
1381
|
+
}
|
|
1382
|
+
@container (max-width: 430px) {
|
|
1383
|
+
.bt-fsess-act { flex-wrap: wrap; }
|
|
1384
|
+
}
|
|
1385
|
+
@container (max-width: 430px) {
|
|
1386
|
+
.tk-mxr { grid-template-columns: minmax(0, auto) auto auto; }
|
|
1387
|
+
.tk-mstat { display: none; }
|
|
1388
|
+
}
|
|
1389
|
+
`;
|
|
1390
|
+
async function getState() {
|
|
1391
|
+
const res = await fetch("/dsh-takeover/state", { cache: "no-store" });
|
|
1392
|
+
const body = await res.json();
|
|
1393
|
+
if (!res.ok || "error" in body) throw new Error("error" in body ? body.error : `HTTP ${res.status}`);
|
|
1394
|
+
return body;
|
|
1395
|
+
}
|
|
1396
|
+
async function post(path, body) {
|
|
1397
|
+
const res = await fetch(path, {
|
|
1398
|
+
method: "POST",
|
|
1399
|
+
headers: { "content-type": "application/json" },
|
|
1400
|
+
body: JSON.stringify(body)
|
|
1401
|
+
});
|
|
1402
|
+
const data = await res.json();
|
|
1403
|
+
if (!res.ok || "error" in data) throw new Error("error" in data ? data.error : `HTTP ${res.status}`);
|
|
1404
|
+
return data;
|
|
1405
|
+
}
|
|
1406
|
+
async function getJson(url) {
|
|
1407
|
+
const res = await fetch(url, { cache: "no-store" });
|
|
1408
|
+
if (!res.ok) {
|
|
1409
|
+
let msg = `HTTP ${res.status}`;
|
|
1410
|
+
try {
|
|
1411
|
+
const b = await res.json();
|
|
1412
|
+
if (typeof b.error === "string" && b.error !== "") msg = b.error;
|
|
1413
|
+
} catch {
|
|
1414
|
+
}
|
|
1415
|
+
throw new Error(msg);
|
|
1416
|
+
}
|
|
1417
|
+
return await res.json();
|
|
1418
|
+
}
|
|
1419
|
+
function copyText(text) {
|
|
1420
|
+
const nav = globalThis.navigator;
|
|
1421
|
+
if (nav?.clipboard?.writeText !== void 0) return nav.clipboard.writeText(text);
|
|
1422
|
+
return new Promise((resolve, reject) => {
|
|
1423
|
+
try {
|
|
1424
|
+
const ta = document.createElement("textarea");
|
|
1425
|
+
ta.value = text;
|
|
1426
|
+
ta.style.position = "fixed";
|
|
1427
|
+
ta.style.opacity = "0";
|
|
1428
|
+
document.body.appendChild(ta);
|
|
1429
|
+
ta.select();
|
|
1430
|
+
const ok = document.execCommand("copy");
|
|
1431
|
+
ta.remove();
|
|
1432
|
+
if (ok) resolve();
|
|
1433
|
+
else reject(new Error("execCommand copy failed"));
|
|
1434
|
+
} catch (e) {
|
|
1435
|
+
reject(e);
|
|
1436
|
+
}
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
function fmtTime(iso, lang) {
|
|
1440
|
+
const d = new Date(iso);
|
|
1441
|
+
if (Number.isNaN(d.getTime())) return iso;
|
|
1442
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
1443
|
+
const hm = `${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
1444
|
+
const now = /* @__PURE__ */ new Date();
|
|
1445
|
+
const sameDay = d.getFullYear() === now.getFullYear() && d.getMonth() === now.getMonth() && d.getDate() === now.getDate();
|
|
1446
|
+
if (sameDay) return hm;
|
|
1447
|
+
return lang === "en" ? `${d.getMonth() + 1}/${d.getDate()} ${hm}` : `${d.getMonth() + 1}\u6708${d.getDate()}\u65E5 ${hm}`;
|
|
1448
|
+
}
|
|
1449
|
+
function safeLocalStorage() {
|
|
1450
|
+
try {
|
|
1451
|
+
const s = globalThis.localStorage;
|
|
1452
|
+
if (s === null || typeof s !== "object") return null;
|
|
1453
|
+
const store = s;
|
|
1454
|
+
const probe = "__dsh_takeover_probe__";
|
|
1455
|
+
store.setItem(probe, probe);
|
|
1456
|
+
store.removeItem(probe);
|
|
1457
|
+
return store;
|
|
1458
|
+
} catch {
|
|
1459
|
+
return null;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
function downloadText(filename, text, mime = "text/markdown;charset=utf-8") {
|
|
1463
|
+
const blob = new Blob([text], { type: mime });
|
|
1464
|
+
const url = URL.createObjectURL(blob);
|
|
1465
|
+
const a = document.createElement("a");
|
|
1466
|
+
a.href = url;
|
|
1467
|
+
a.download = filename;
|
|
1468
|
+
document.body.appendChild(a);
|
|
1469
|
+
a.click();
|
|
1470
|
+
a.remove();
|
|
1471
|
+
window.setTimeout(() => {
|
|
1472
|
+
URL.revokeObjectURL(url);
|
|
1473
|
+
}, 1e3);
|
|
1474
|
+
}
|
|
1475
|
+
function exportStamp(d = /* @__PURE__ */ new Date()) {
|
|
1476
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
1477
|
+
return `${d.getFullYear()}${pad(d.getMonth() + 1)}${pad(d.getDate())}-${pad(d.getHours())}${pad(d.getMinutes())}`;
|
|
1478
|
+
}
|
|
1479
|
+
function isCount(v) {
|
|
1480
|
+
return typeof v === "number" && Number.isFinite(v) && v >= 0;
|
|
1481
|
+
}
|
|
1482
|
+
function extrasOf(state) {
|
|
1483
|
+
const v = state.extras;
|
|
1484
|
+
return v !== null && typeof v === "object" ? v : {};
|
|
1485
|
+
}
|
|
1486
|
+
function rejectionCount(state) {
|
|
1487
|
+
const r = state?.rejections;
|
|
1488
|
+
if (!r) return 0;
|
|
1489
|
+
return r.live.length + (r.persistedTotal || 0);
|
|
1490
|
+
}
|
|
1491
|
+
function rejectionTitle(state) {
|
|
1492
|
+
const r = state?.rejections;
|
|
1493
|
+
if (!r) return "";
|
|
1494
|
+
const byStage = /* @__PURE__ */ new Map();
|
|
1495
|
+
for (const e of r.persisted) byStage.set(`${e.stage}/${e.reason}`, (byStage.get(`${e.stage}/${e.reason}`) ?? 0) + 1);
|
|
1496
|
+
for (const l of r.live) byStage.set(`read/${l.reason}`, (byStage.get(`read/${l.reason}`) ?? 0) + 1);
|
|
1497
|
+
const parts = [...byStage.entries()].sort((a, b) => b[1] - a[1]).slice(0, 6).map(([k, n]) => `${k}\xD7${n}`);
|
|
1498
|
+
return parts.join("\u3001");
|
|
1499
|
+
}
|
|
1500
|
+
function envelopeCharsOf(state) {
|
|
1501
|
+
const top = state;
|
|
1502
|
+
const extra = extrasOf(state);
|
|
1503
|
+
for (const c of [extra.envelopeChars, top.envelopeChars]) {
|
|
1504
|
+
if (isCount(c)) return c;
|
|
1505
|
+
}
|
|
1506
|
+
for (const env of [extra.envelope, top.envelope]) {
|
|
1507
|
+
if (env !== null && typeof env === "object") {
|
|
1508
|
+
const chars = env.chars;
|
|
1509
|
+
if (isCount(chars)) return chars;
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
return null;
|
|
1513
|
+
}
|
|
1514
|
+
function coverageTextOf(state) {
|
|
1515
|
+
const top = state;
|
|
1516
|
+
const extra = extrasOf(state);
|
|
1517
|
+
for (const c of [extra.coverage, top.coverage]) {
|
|
1518
|
+
if (typeof c === "string") {
|
|
1519
|
+
const s = c.trim();
|
|
1520
|
+
if (s !== "") return s;
|
|
1521
|
+
} else if (c !== null && typeof c === "object") {
|
|
1522
|
+
const o = c;
|
|
1523
|
+
if (isCount(o.statements) && isCount(o.marked) && isCount(o.unmarked)) {
|
|
1524
|
+
return `${o.marked}/${o.statements}`;
|
|
1525
|
+
}
|
|
1526
|
+
const x = isCount(o.done) ? o.done : isCount(o.x) ? o.x : null;
|
|
1527
|
+
const y = isCount(o.total) ? o.total : isCount(o.y) ? o.y : null;
|
|
1528
|
+
if (x !== null && y !== null) return `${x}/${y}`;
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
return null;
|
|
1532
|
+
}
|
|
1533
|
+
function escHtml(v) {
|
|
1534
|
+
return v.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1535
|
+
}
|
|
1536
|
+
function absTime(iso) {
|
|
1537
|
+
const d = new Date(iso);
|
|
1538
|
+
if (Number.isNaN(d.getTime())) return iso;
|
|
1539
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
1540
|
+
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
1541
|
+
}
|
|
1542
|
+
function reportWords(lang) {
|
|
1543
|
+
const d = DICTS[lang];
|
|
1544
|
+
const w = (key) => d[key] ?? key;
|
|
1545
|
+
return {
|
|
1546
|
+
title: w("reportTitle"),
|
|
1547
|
+
subtitle: w("reportSubtitle"),
|
|
1548
|
+
generated: w("reportGenerated"),
|
|
1549
|
+
note: w("reportNote"),
|
|
1550
|
+
statPending: w("reportStatPending"),
|
|
1551
|
+
statArchived: w("reportStatArchived"),
|
|
1552
|
+
statProviders: w("reportStatProviders"),
|
|
1553
|
+
sectionInbox: w("inboxTitle"),
|
|
1554
|
+
sectionMatrix: w("matrixTitle"),
|
|
1555
|
+
pendingEmpty: w("reportPendingEmpty"),
|
|
1556
|
+
skipped: w("reportSkipped"),
|
|
1557
|
+
labelFrom: w("reportLabelFrom"),
|
|
1558
|
+
labelProject: w("reportLabelProject"),
|
|
1559
|
+
labelTime: w("reportLabelTime"),
|
|
1560
|
+
labelPreview: w("reportLabelPreview"),
|
|
1561
|
+
previewEmpty: w("previewEmpty"),
|
|
1562
|
+
sessionsCount: w("sessionsCount"),
|
|
1563
|
+
sessionsProbeFail: w("sessionsProbeFail"),
|
|
1564
|
+
unsupported: w("unsupported"),
|
|
1565
|
+
unsupportedNote: w("unsupportedNote"),
|
|
1566
|
+
pillOk: w("pillOk"),
|
|
1567
|
+
pillNo: w("pillNo"),
|
|
1568
|
+
disabled: w("reportDisabled"),
|
|
1569
|
+
unknownSource: w("unknownSource")
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
var REPORT_CSS = `
|
|
1573
|
+
:root { color-scheme: light; }
|
|
1574
|
+
* { box-sizing: border-box; }
|
|
1575
|
+
body { margin: 0; background: #f4f5fb; color: #1e293b;
|
|
1576
|
+
font: 14px/1.65 system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
|
|
1577
|
+
.rt-hero { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #fff; padding: 34px 28px 28px; }
|
|
1578
|
+
.rt-hero h1 { margin: 0; font-size: 22px; letter-spacing: .01em; overflow-wrap: anywhere; }
|
|
1579
|
+
.rt-sub { margin: 6px 0 0; font-size: 13.5px; opacity: .85; }
|
|
1580
|
+
.rt-meta { margin: 14px 0 0; font-size: 12px; opacity: .78; }
|
|
1581
|
+
.rt-main { max-width: 860px; margin: 0 auto; padding: 22px 20px 8px; display: flex; flex-direction: column; gap: 16px; }
|
|
1582
|
+
.rt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
|
|
1583
|
+
.rt-stat { background: #fff; border: 1px solid rgba(99,102,241,.18); border-radius: 12px; padding: 14px 16px;
|
|
1584
|
+
display: flex; flex-direction: column; gap: 2px; box-shadow: 0 1px 2px rgba(30,41,59,.06); }
|
|
1585
|
+
.rt-stat-n { font-size: 24px; font-weight: 700; color: #4f46e5; }
|
|
1586
|
+
.rt-stat-label { font-size: 12px; color: #64748b; }
|
|
1587
|
+
.rt-note { margin: 0; font-size: 12px; line-height: 1.7; color: #64748b; background: rgba(99,102,241,.06);
|
|
1588
|
+
border: 1px solid rgba(99,102,241,.16); border-radius: 10px; padding: 10px 14px; }
|
|
1589
|
+
.rt-card { background: #fff; border: 1px solid rgba(30,41,59,.08); border-radius: 12px; padding: 16px 18px; }
|
|
1590
|
+
.rt-card h2 { margin: 0 0 12px; font-size: 15px; color: #312e81; }
|
|
1591
|
+
.rt-empty { color: #64748b; font-size: 13px; background: rgba(127,127,127,.07); border-radius: 8px; padding: 12px 14px; }
|
|
1592
|
+
.rt-warn { color: #b45309; font-size: 12.5px; line-height: 1.6; background: rgba(251,191,36,.13);
|
|
1593
|
+
border-radius: 8px; padding: 10px 14px; margin: 0 0 10px; overflow-wrap: anywhere; }
|
|
1594
|
+
.rt-pcard { border: 1px solid rgba(30,41,59,.08); border-radius: 10px; padding: 12px 14px; }
|
|
1595
|
+
.rt-pcard + .rt-pcard { margin-top: 10px; }
|
|
1596
|
+
.rt-ptitle { margin: 0 0 4px; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
|
|
1597
|
+
.rt-pid { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px;
|
|
1598
|
+
font-weight: 500; color: #6366F1; background: rgba(99,102,241,.08); border-radius: 6px; padding: 1px 7px; margin-left: 6px; }
|
|
1599
|
+
.rt-pmeta { margin: 0 0 8px; font-size: 12px; color: #64748b; display: flex; flex-wrap: wrap; gap: 2px 14px; }
|
|
1600
|
+
.rt-plabel { font-size: 11px; opacity: .82; margin-right: 3px; }
|
|
1601
|
+
.rt-preview { margin-top: 2px; padding: 8px 12px; border-left: 3px solid #6366F1; background: #f8f9ff;
|
|
1602
|
+
border-radius: 0 8px 8px 0; }
|
|
1603
|
+
.rt-preview-body { font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
1604
|
+
.rt-mrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 2px;
|
|
1605
|
+
border-bottom: 1px dashed rgba(30,41,59,.1); font-size: 13px; }
|
|
1606
|
+
.rt-mrow:last-child { border-bottom: none; }
|
|
1607
|
+
.rt-mrow-off { opacity: .55; }
|
|
1608
|
+
.rt-mname { font-weight: 600; min-width: 140px; }
|
|
1609
|
+
.rt-mid { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; color: #94a3b8; }
|
|
1610
|
+
.rt-pill { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 10px; white-space: nowrap; }
|
|
1611
|
+
.rt-pill-ok { color: #15803d; background: rgba(21,128,61,.1); border: 1px solid rgba(21,128,61,.35); }
|
|
1612
|
+
.rt-pill-no { color: #b45309; background: rgba(180,83,9,.1); border: 1px solid rgba(180,83,9,.35); }
|
|
1613
|
+
.rt-mstat { color: #64748b; font-size: 12px; }
|
|
1614
|
+
.rt-mnote { flex-basis: 100%; color: #b45309; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
|
|
1615
|
+
.rt-foot { text-align: center; color: #94a3b8; font-size: 11.5px; padding: 14px 0 30px; }
|
|
1616
|
+
@media (max-width: 560px) { .rt-stats { grid-template-columns: 1fr; } }
|
|
1617
|
+
`;
|
|
1618
|
+
function buildReportHtml(state, words, lang, generatedAt) {
|
|
1619
|
+
const esc = escHtml;
|
|
1620
|
+
const enabled = state.providers.filter((p) => p.enabled).length;
|
|
1621
|
+
const statCards = `<div class="rt-stat"><span class="rt-stat-n">${state.pending.length}</span><span class="rt-stat-label">${esc(words.statPending)}</span></div><div class="rt-stat"><span class="rt-stat-n">${state.archivedCount}</span><span class="rt-stat-label">${esc(words.statArchived)}</span></div><div class="rt-stat"><span class="rt-stat-n">${enabled}/${state.providers.length}</span><span class="rt-stat-label">${esc(words.statProviders)}</span></div>`;
|
|
1622
|
+
const inboxFlags = (state.inboxError !== void 0 && state.inboxError !== "" ? `<div class="rt-warn">${esc(state.inboxError)}</div>` : "") + (state.pendingSkipped > 0 ? `<div class="rt-warn">${esc(interpolate(words.skipped, { n: state.pendingSkipped }))}</div>` : "");
|
|
1623
|
+
const pendingCards = state.pending.map((p) => {
|
|
1624
|
+
const title = displayTitleOf(p);
|
|
1625
|
+
const idChip = `<span class="rt-pid">${esc(p.id)}</span>`;
|
|
1626
|
+
const project = p.project !== "" ? `<span><span class="rt-plabel">${esc(words.labelProject)}</span>${esc(p.project)}</span>` : "";
|
|
1627
|
+
const previewBody = p.preview !== "" ? p.preview : words.previewEmpty;
|
|
1628
|
+
return `<div class="rt-pcard"><p class="rt-ptitle">${esc(title)}${idChip}</p><p class="rt-pmeta"><span><span class="rt-plabel">${esc(words.labelFrom)}</span>${esc(PROVIDER_LABEL[p.agent] ?? (p.agent === "" ? words.unknownSource : p.agent))}</span>` + project + `<span><span class="rt-plabel">${esc(words.labelTime)}</span>${esc(absTime(p.pushedAt))}</span></p><div class="rt-preview"><span class="rt-plabel">${esc(words.labelPreview)}</span><div class="rt-preview-body">${esc(previewBody)}</div></div></div>`;
|
|
1629
|
+
}).join("");
|
|
1630
|
+
const inboxBody = state.pending.length === 0 ? `<div class="rt-empty">${esc(words.pendingEmpty)}</div>` : pendingCards;
|
|
1631
|
+
const matrixRows = state.providers.map((r) => {
|
|
1632
|
+
const label = PROVIDER_LABEL[r.name] ?? r.name;
|
|
1633
|
+
const stat = r.supported ? r.sessions >= 0 ? interpolate(words.sessionsCount, { n: r.sessions }) : words.sessionsProbeFail : r.note !== "" ? interpolate(words.unsupportedNote, { note: r.note }) : words.unsupported;
|
|
1634
|
+
const note = r.supported && r.note !== "" ? `<span class="rt-mnote">${esc(r.note)}</span>` : "";
|
|
1635
|
+
return `<div class="rt-mrow${r.enabled ? "" : " rt-mrow-off"}"><span class="rt-mname">${esc(label)}</span><span class="rt-mid">${esc(r.name)}</span><span class="rt-pill ${r.supported ? "rt-pill-ok" : "rt-pill-no"}">${esc(r.supported ? words.pillOk : words.pillNo)}</span><span class="rt-mstat">${esc(stat)}${r.enabled ? "" : ` \xB7 ${esc(words.disabled)}`}</span>` + note + `</div>`;
|
|
1636
|
+
}).join("");
|
|
1637
|
+
return `<!DOCTYPE html>
|
|
1638
|
+
<html lang="${lang}">
|
|
1639
|
+
<head>
|
|
1640
|
+
<meta charset="utf-8">
|
|
1641
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
1642
|
+
<title>${esc(words.title)} \xB7 ${esc(generatedAt)}</title>
|
|
1643
|
+
<style>${REPORT_CSS}</style>
|
|
1644
|
+
</head>
|
|
1645
|
+
<body>
|
|
1646
|
+
<header class="rt-hero">
|
|
1647
|
+
<h1>${esc(words.title)}</h1>
|
|
1648
|
+
<p class="rt-sub">${esc(words.subtitle)}</p>
|
|
1649
|
+
<p class="rt-meta">${esc(interpolate(words.generated, { n: generatedAt }))} \xB7 dsh-takeover</p>
|
|
1650
|
+
</header>
|
|
1651
|
+
<main class="rt-main">
|
|
1652
|
+
<div class="rt-stats">${statCards}</div>
|
|
1653
|
+
<p class="rt-note">${esc(words.note)}</p>
|
|
1654
|
+
<section class="rt-card">
|
|
1655
|
+
<h2>${esc(words.sectionInbox)}</h2>
|
|
1656
|
+
${inboxFlags}
|
|
1657
|
+
${inboxBody}
|
|
1658
|
+
</section>
|
|
1659
|
+
<section class="rt-card">
|
|
1660
|
+
<h2>${esc(words.sectionMatrix)}</h2>
|
|
1661
|
+
${matrixRows}
|
|
1662
|
+
</section>
|
|
1663
|
+
</main>
|
|
1664
|
+
<footer class="rt-foot">dsh-takeover \xB7 handoff: 1</footer>
|
|
1665
|
+
</body>
|
|
1666
|
+
</html>
|
|
1667
|
+
`;
|
|
1668
|
+
}
|
|
1669
|
+
function PendingList({ rows, query, home, t, lang, onExport, onChainFilter, onTakeInbox, takeBusyId, onDismiss, dismissBusyId }) {
|
|
1670
|
+
const [store] = (0, import_react.useState)(safeLocalStorage);
|
|
1671
|
+
const [seen, setSeen] = (0, import_react.useState)(() => loadSeenSet(store, seenStorageKey(home)));
|
|
1672
|
+
const [openIds, setOpenIds] = (0, import_react.useState)(/* @__PURE__ */ new Set());
|
|
1673
|
+
(0, import_react.useEffect)(() => {
|
|
1674
|
+
setSeen(loadSeenSet(store, seenStorageKey(home)));
|
|
1675
|
+
}, [store, home]);
|
|
1676
|
+
const markSeen = (ids) => {
|
|
1677
|
+
setSeen((prev) => {
|
|
1678
|
+
const fresh = ids.filter((id) => !prev.has(id));
|
|
1679
|
+
if (fresh.length === 0) return prev;
|
|
1680
|
+
const next = new Set(prev);
|
|
1681
|
+
for (const id of fresh) next.add(id);
|
|
1682
|
+
queueMicrotask(() => saveSeenSet(store, seenStorageKey(home), next));
|
|
1683
|
+
return next;
|
|
1684
|
+
});
|
|
1685
|
+
};
|
|
1686
|
+
const toggleOpen = (id) => {
|
|
1687
|
+
setOpenIds((prev) => {
|
|
1688
|
+
const next = new Set(prev);
|
|
1689
|
+
if (next.has(id)) next.delete(id);
|
|
1690
|
+
else next.add(id);
|
|
1691
|
+
return next;
|
|
1692
|
+
});
|
|
1693
|
+
markSeen([id]);
|
|
1694
|
+
};
|
|
1695
|
+
const toggleGroup = (g) => {
|
|
1696
|
+
const willOpen = !openIds.has(g.key);
|
|
1697
|
+
setOpenIds((prev) => {
|
|
1698
|
+
const next = new Set(prev);
|
|
1699
|
+
if (next.has(g.key)) next.delete(g.key);
|
|
1700
|
+
else next.add(g.key);
|
|
1701
|
+
return next;
|
|
1702
|
+
});
|
|
1703
|
+
if (willOpen) markSeen(g.rows.map((r) => r.id));
|
|
1704
|
+
};
|
|
1705
|
+
const [sourceSel, setSourceSel] = (0, import_react.useState)(null);
|
|
1706
|
+
const [newOnly, setNewOnly] = (0, import_react.useState)(false);
|
|
1707
|
+
const newIds = new Set(newIdsOf(rows, seen));
|
|
1708
|
+
const newOrOpen = /* @__PURE__ */ new Set([...newIds, ...openIds]);
|
|
1709
|
+
const visible = filterPending(
|
|
1710
|
+
rows,
|
|
1711
|
+
query,
|
|
1712
|
+
(a) => PROVIDER_LABEL[a] ?? (a === "" ? t("unknownSource") : a),
|
|
1713
|
+
sourceSel,
|
|
1714
|
+
newOnly ? newOrOpen : null
|
|
1715
|
+
);
|
|
1716
|
+
const lowRows = visible.filter((r) => r.lowInfo === true);
|
|
1717
|
+
const mainRows = visible.filter((r) => r.lowInfo !== true);
|
|
1718
|
+
const groups = groupAdjacent(mainRows);
|
|
1719
|
+
const facets = sourceFacets(rows);
|
|
1720
|
+
const chip = (label, count, on, onClick, key) => (0, import_react.createElement)(
|
|
1721
|
+
"button",
|
|
1722
|
+
{
|
|
1723
|
+
key,
|
|
1724
|
+
className: `bt-chip${on ? " bt-chip-on" : ""}`,
|
|
1725
|
+
"aria-pressed": on,
|
|
1726
|
+
onClick,
|
|
1727
|
+
type: "button"
|
|
1728
|
+
},
|
|
1729
|
+
(0, import_react.createElement)("span", { className: "bt-chip-label" }, label),
|
|
1730
|
+
(0, import_react.createElement)("span", { className: "bt-chip-count" }, String(count))
|
|
1731
|
+
);
|
|
1732
|
+
const agentLabel = (a) => PROVIDER_LABEL[a] ?? (a === "" ? t("unknownSource") : a);
|
|
1733
|
+
const chipBar = (0, import_react.createElement)(
|
|
1734
|
+
"div",
|
|
1735
|
+
{ className: "bt-chips", role: "group", "aria-label": t("chipSourceAria") },
|
|
1736
|
+
chip(t("chipAll"), rows.length, sourceSel === null, () => setSourceSel(null), "chip-all"),
|
|
1737
|
+
...facets.map((f) => chip(
|
|
1738
|
+
agentLabel(f.agent),
|
|
1739
|
+
f.count,
|
|
1740
|
+
sourceSel === f.agent,
|
|
1741
|
+
() => setSourceSel(sourceSel === f.agent ? null : f.agent),
|
|
1742
|
+
"chip-" + f.agent
|
|
1743
|
+
))
|
|
1744
|
+
);
|
|
1745
|
+
const lowInfoNode = (low) => {
|
|
1746
|
+
const key = "bt-lowinfo";
|
|
1747
|
+
const open = openIds.has(key);
|
|
1748
|
+
const hasNew = low.some((r) => !seen.has(r.id));
|
|
1749
|
+
const toggle = () => {
|
|
1750
|
+
setOpenIds((prev) => {
|
|
1751
|
+
const nx = new Set(prev);
|
|
1752
|
+
if (nx.has(key)) nx.delete(key);
|
|
1753
|
+
else nx.add(key);
|
|
1754
|
+
return nx;
|
|
1755
|
+
});
|
|
1756
|
+
if (!open) markSeen(low.map((r) => r.id));
|
|
1757
|
+
};
|
|
1758
|
+
return (0, import_react.createElement)(
|
|
1759
|
+
"div",
|
|
1760
|
+
{ key, className: "bt-group" },
|
|
1761
|
+
(0, import_react.createElement)(
|
|
1762
|
+
"div",
|
|
1763
|
+
{
|
|
1764
|
+
className: `bt-pending${open ? " bt-pending-open" : ""}`,
|
|
1765
|
+
role: "button",
|
|
1766
|
+
tabIndex: 0,
|
|
1767
|
+
"aria-expanded": open,
|
|
1768
|
+
"aria-label": t("groupAria", { title: t("lowInfoGroup", { n: low.length }), n: low.length }),
|
|
1769
|
+
onClick: toggle,
|
|
1770
|
+
onKeyDown: (e) => {
|
|
1771
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1772
|
+
e.preventDefault();
|
|
1773
|
+
toggle();
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1777
|
+
(0, import_react.createElement)("span", { className: "bt-tag bt-tag-lowinfo" }, t("lowInfoBadge")),
|
|
1778
|
+
(0, import_react.createElement)("span", { className: "bt-pending-title" }, t("lowInfoGroup", { n: low.length })),
|
|
1779
|
+
hasNew ? (0, import_react.createElement)("span", { className: "bt-tag bt-tag-new" }, t("newBadge")) : null,
|
|
1780
|
+
(0, import_react.createElement)("span", { className: "bt-pending-chev", "aria-hidden": true }, "\u25B8")
|
|
1781
|
+
),
|
|
1782
|
+
open ? low.map((r) => rowNode(r, true)) : null
|
|
1783
|
+
);
|
|
1784
|
+
};
|
|
1785
|
+
const rowNode = (p, inGroup) => {
|
|
1786
|
+
const open = openIds.has(p.id);
|
|
1787
|
+
const isNew = !seen.has(p.id);
|
|
1788
|
+
return (0, import_react.createElement)(
|
|
1789
|
+
"div",
|
|
1790
|
+
{ key: p.id, className: inGroup ? "bt-pending-member" : void 0 },
|
|
1791
|
+
(0, import_react.createElement)(
|
|
1792
|
+
"div",
|
|
1793
|
+
{
|
|
1794
|
+
className: `bt-pending${open ? " bt-pending-open" : ""}${isNew ? " bt-pending-unread" : ""}`,
|
|
1795
|
+
title: p.id,
|
|
1796
|
+
role: "button",
|
|
1797
|
+
tabIndex: 0,
|
|
1798
|
+
"aria-expanded": open,
|
|
1799
|
+
onClick: () => {
|
|
1800
|
+
toggleOpen(p.id);
|
|
1801
|
+
},
|
|
1802
|
+
onKeyDown: (e) => {
|
|
1803
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1804
|
+
e.preventDefault();
|
|
1805
|
+
toggleOpen(p.id);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
},
|
|
1809
|
+
(0, import_react.createElement)("span", { className: "bt-pend-icon" }, (0, import_react.createElement)(ProviderIcon, { name: p.agent, size: 22 })),
|
|
1810
|
+
(0, import_react.createElement)(
|
|
1811
|
+
"span",
|
|
1812
|
+
{ className: "bt-pend-main" },
|
|
1813
|
+
(0, import_react.createElement)(
|
|
1814
|
+
"span",
|
|
1815
|
+
{ className: "bt-pend-line1" },
|
|
1816
|
+
(0, import_react.createElement)("span", { className: "bt-pending-title", title: p.id }, displayTitleOf(p)),
|
|
1817
|
+
// 未读态已由行首强调条表达;「新」徽标只留给 1 小时内的新卡(防满屏 amber 噪音)
|
|
1818
|
+
isNew && Date.now() - Date.parse(p.pushedAt) < 36e5 ? (0, import_react.createElement)("span", { className: "bt-tag bt-tag-new" }, t("newBadge")) : null,
|
|
1819
|
+
p.lowInfo === true ? (0, import_react.createElement)("span", { className: "bt-tag bt-tag-lowinfo" }, t("lowInfoBadge")) : null,
|
|
1820
|
+
// 接力链徽标(展示位;过滤入口在展开态「只看此链」——行内不嵌交互,ARIA 禁则同前)
|
|
1821
|
+
p.supersedes !== void 0 ? (0, import_react.createElement)("span", {
|
|
1822
|
+
className: "bt-tag bt-tag-group",
|
|
1823
|
+
title: t("chainBadgeTitle", { id: p.supersedes })
|
|
1824
|
+
}, t("chainBadge", { id: p.supersedes.length > 16 ? `${p.supersedes.slice(0, 16)}\u2026` : p.supersedes })) : null,
|
|
1825
|
+
(0, import_react.createElement)("span", { className: "bt-pend-time" }, p.pushedAt === "" ? t("noTime") : fmtTime(p.pushedAt, lang))
|
|
1826
|
+
),
|
|
1827
|
+
(0, import_react.createElement)(
|
|
1828
|
+
"span",
|
|
1829
|
+
{
|
|
1830
|
+
className: "bt-pend-meta",
|
|
1831
|
+
title: `${t("from", { name: "" }).trim()} \xB7 ${t("project", { name: "" }).trim()} \xB7 ${t("idLabel", { id: "" }).trim()}`
|
|
1832
|
+
},
|
|
1833
|
+
(0, import_react.createElement)("span", { className: "bt-pend-src" }, agentLabel(p.agent)),
|
|
1834
|
+
p.project !== "" ? (0, import_react.createElement)("span", { className: "bt-pend-dot" }, "\xB7") : null,
|
|
1835
|
+
p.project !== "" ? (0, import_react.createElement)("span", null, p.project) : null,
|
|
1836
|
+
(0, import_react.createElement)("span", { className: "bt-pend-dot" }, "\xB7"),
|
|
1837
|
+
(0, import_react.createElement)("span", { className: "bt-pend-id" }, p.id)
|
|
1838
|
+
)
|
|
1839
|
+
),
|
|
1840
|
+
(0, import_react.createElement)("span", { className: "bt-pending-chev", "aria-hidden": true }, "\u25B8")
|
|
1841
|
+
),
|
|
1842
|
+
open ? (0, import_react.createElement)(
|
|
1843
|
+
"div",
|
|
1844
|
+
{ className: "bt-preview", onClick: (e) => e.stopPropagation() },
|
|
1845
|
+
(0, import_react.createElement)("span", null, p.preview !== "" ? p.preview : t("previewEmpty")),
|
|
1846
|
+
(0, import_react.createElement)(
|
|
1847
|
+
"span",
|
|
1848
|
+
{ className: "bt-preview-actions" },
|
|
1849
|
+
(0, import_react.createElement)("span", { className: "bt-preview-hint" }, t("previewHint")),
|
|
1850
|
+
p.supersedes !== void 0 ? (0, import_react.createElement)("button", {
|
|
1851
|
+
className: "bt-btn",
|
|
1852
|
+
onClick: () => {
|
|
1853
|
+
setSourceSel(null);
|
|
1854
|
+
setNewOnly(false);
|
|
1855
|
+
onChainFilter(p.supersedes);
|
|
1856
|
+
},
|
|
1857
|
+
title: t("chainFilterTitle", { id: p.supersedes })
|
|
1858
|
+
}, t("chainFilterBtn")) : null,
|
|
1859
|
+
(0, import_react.createElement)("button", {
|
|
1860
|
+
className: "bt-btn",
|
|
1861
|
+
disabled: takeBusyId !== null,
|
|
1862
|
+
onClick: () => {
|
|
1863
|
+
onTakeInbox(p);
|
|
1864
|
+
},
|
|
1865
|
+
title: t("inboxTakeTitle")
|
|
1866
|
+
}, takeBusyId === p.id ? t("deliveringBtn") : t("inboxTakeBtn")),
|
|
1867
|
+
(0, import_react.createElement)("button", {
|
|
1868
|
+
className: "bt-btn",
|
|
1869
|
+
onClick: () => {
|
|
1870
|
+
onExport(p);
|
|
1871
|
+
},
|
|
1872
|
+
title: t("exportCardTitle")
|
|
1873
|
+
}, t("exportCard")),
|
|
1874
|
+
(0, import_react.createElement)("button", {
|
|
1875
|
+
className: "bt-btn",
|
|
1876
|
+
disabled: dismissBusyId !== null,
|
|
1877
|
+
onClick: () => {
|
|
1878
|
+
onDismiss(p);
|
|
1879
|
+
},
|
|
1880
|
+
title: t("dismissTitle")
|
|
1881
|
+
}, dismissBusyId === p.id ? t("dismissingBtn") : t("dismissBtn"))
|
|
1882
|
+
)
|
|
1883
|
+
) : null
|
|
1884
|
+
);
|
|
1885
|
+
};
|
|
1886
|
+
const groupNode = (g) => {
|
|
1887
|
+
const open = openIds.has(g.key);
|
|
1888
|
+
const hasNew = g.rows.some((r) => !seen.has(r.id));
|
|
1889
|
+
const head = g.rows[0];
|
|
1890
|
+
return (0, import_react.createElement)(
|
|
1891
|
+
"div",
|
|
1892
|
+
{ key: g.key, className: "bt-group" },
|
|
1893
|
+
(0, import_react.createElement)(
|
|
1894
|
+
"div",
|
|
1895
|
+
{
|
|
1896
|
+
className: `bt-pending${open ? " bt-pending-open" : ""}`,
|
|
1897
|
+
title: g.rows.map((r) => r.id).join(" \xB7 "),
|
|
1898
|
+
role: "button",
|
|
1899
|
+
tabIndex: 0,
|
|
1900
|
+
"aria-expanded": open,
|
|
1901
|
+
"aria-label": t("groupAria", { title: g.title, n: g.rows.length }),
|
|
1902
|
+
onClick: () => {
|
|
1903
|
+
toggleGroup(g);
|
|
1904
|
+
},
|
|
1905
|
+
onKeyDown: (e) => {
|
|
1906
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1907
|
+
e.preventDefault();
|
|
1908
|
+
toggleGroup(g);
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
},
|
|
1912
|
+
(0, import_react.createElement)("span", { className: "bt-pend-icon" }, (0, import_react.createElement)(ProviderIcon, { name: g.agent, size: 22 })),
|
|
1913
|
+
(0, import_react.createElement)(
|
|
1914
|
+
"span",
|
|
1915
|
+
{ className: "bt-pend-main" },
|
|
1916
|
+
(0, import_react.createElement)(
|
|
1917
|
+
"span",
|
|
1918
|
+
{ className: "bt-pend-line1" },
|
|
1919
|
+
(0, import_react.createElement)("span", { className: "bt-pending-title" }, g.title),
|
|
1920
|
+
(0, import_react.createElement)("span", { className: "bt-tag bt-tag-group" }, t("groupCount", { n: g.rows.length })),
|
|
1921
|
+
hasNew ? (0, import_react.createElement)("span", { className: "bt-tag bt-tag-new" }, t("newBadge")) : null,
|
|
1922
|
+
head !== void 0 ? (0, import_react.createElement)("span", { className: "bt-pend-time" }, head.pushedAt === "" ? t("noTime") : fmtTime(head.pushedAt, lang)) : null
|
|
1923
|
+
),
|
|
1924
|
+
(0, import_react.createElement)(
|
|
1925
|
+
"span",
|
|
1926
|
+
{
|
|
1927
|
+
className: "bt-pend-meta",
|
|
1928
|
+
title: t("from", { name: "" }).trim()
|
|
1929
|
+
},
|
|
1930
|
+
(0, import_react.createElement)("span", { className: "bt-pend-src" }, agentLabel(g.agent))
|
|
1931
|
+
)
|
|
1932
|
+
),
|
|
1933
|
+
(0, import_react.createElement)("span", { className: "bt-pending-chev", "aria-hidden": true }, "\u25B8")
|
|
1934
|
+
),
|
|
1935
|
+
open ? g.rows.map((r) => rowNode(r, true)) : null
|
|
1936
|
+
);
|
|
1937
|
+
};
|
|
1938
|
+
return (0, import_react.createElement)(
|
|
1939
|
+
"div",
|
|
1940
|
+
{ className: "bt-rows" },
|
|
1941
|
+
// 筛选行:未读开关(复选框,独立语义)与来源 chips 同行排布——省一行竖向空间
|
|
1942
|
+
(0, import_react.createElement)(
|
|
1943
|
+
"div",
|
|
1944
|
+
{ className: "bt-filterrow" },
|
|
1945
|
+
(0, import_react.createElement)(
|
|
1946
|
+
"label",
|
|
1947
|
+
{ className: "bt-newonly" },
|
|
1948
|
+
(0, import_react.createElement)("input", {
|
|
1949
|
+
type: "checkbox",
|
|
1950
|
+
checked: newOnly,
|
|
1951
|
+
"aria-label": t("newOnlyAria"),
|
|
1952
|
+
onChange: () => setNewOnly((v) => !v)
|
|
1953
|
+
}),
|
|
1954
|
+
(0, import_react.createElement)("span", null, t("newOnlyChip")),
|
|
1955
|
+
(0, import_react.createElement)("span", { className: "bt-chip-count" }, String(newIds.size))
|
|
1956
|
+
),
|
|
1957
|
+
chipBar
|
|
1958
|
+
),
|
|
1959
|
+
rows.length === 0 ? (0, import_react.createElement)("div", { className: "bt-banner bt-banner-info" }, t("emptyInbox")) : visible.length === 0 ? (0, import_react.createElement)("div", { className: "bt-banner bt-banner-info" }, t("filterEmpty")) : mainRows.length === 0 && lowRows.length > 0 ? lowInfoNode(lowRows) : [
|
|
1960
|
+
...groups.map((g) => g.rows.length > 1 ? groupNode(g) : rowNode(g.rows[0], false)),
|
|
1961
|
+
lowRows.length > 0 ? lowInfoNode(lowRows) : null
|
|
1962
|
+
]
|
|
1963
|
+
);
|
|
1964
|
+
}
|
|
1965
|
+
function ProviderMatrix({ rows, busy, onToggle, t }) {
|
|
1966
|
+
return (0, import_react.createElement)(
|
|
1967
|
+
"div",
|
|
1968
|
+
{ className: "tk-mx" },
|
|
1969
|
+
...rows.map((r) => {
|
|
1970
|
+
const label = PROVIDER_LABEL[r.name] ?? r.name;
|
|
1971
|
+
const showNote = r.supported && r.note !== "";
|
|
1972
|
+
const noteId = `bt-mnote-${r.name}`;
|
|
1973
|
+
const pending = r.supported && (r.sessions === 0 && r.note !== "" || r.sessions < 0);
|
|
1974
|
+
const idle = !r.supported || r.sessions === 0 && r.note === "";
|
|
1975
|
+
const pillClass = r.supported && !pending ? "tk-pill tk-pill-ok" : "tk-pill tk-pill-warn";
|
|
1976
|
+
const pillText = !r.supported ? t("pillNo") : pending ? t("pillPending") : t("pillOk");
|
|
1977
|
+
return (0, import_react.createElement)(
|
|
1978
|
+
"div",
|
|
1979
|
+
{
|
|
1980
|
+
key: r.name,
|
|
1981
|
+
className: `tk-mxr${idle ? " tk-mxr-idle" : ""}`,
|
|
1982
|
+
title: r.note !== "" ? r.note : void 0,
|
|
1983
|
+
// aria-description 不是有效 ARIA 属性(读屏不识别)——改 aria-describedby 指向可见 note 节点
|
|
1984
|
+
"aria-describedby": showNote ? noteId : void 0
|
|
1985
|
+
},
|
|
1986
|
+
(0, import_react.createElement)(
|
|
1987
|
+
"span",
|
|
1988
|
+
{ className: "tk-mname-col" },
|
|
1989
|
+
(0, import_react.createElement)(
|
|
1990
|
+
"span",
|
|
1991
|
+
{ className: "tk-mname-wrap" },
|
|
1992
|
+
(0, import_react.createElement)(ProviderIcon, { name: r.name }),
|
|
1993
|
+
(0, import_react.createElement)("span", { className: "tk-mname" }, label),
|
|
1994
|
+
(0, import_react.createElement)("span", { className: "tk-mid" }, r.name)
|
|
1995
|
+
),
|
|
1996
|
+
showNote ? (0, import_react.createElement)("span", { className: "tk-mnote", id: noteId }, r.note) : null
|
|
1997
|
+
),
|
|
1998
|
+
(0, import_react.createElement)(
|
|
1999
|
+
"span",
|
|
2000
|
+
{ className: "tk-mstat" },
|
|
2001
|
+
r.supported ? r.sessions >= 0 ? t("sessionsCount", { n: r.sessions }) : t("sessionsProbeFail") : r.note !== "" ? t("unsupportedNote", { note: r.note }) : t("unsupported")
|
|
2002
|
+
),
|
|
2003
|
+
(0, import_react.createElement)("span", { className: pillClass }, pillText),
|
|
2004
|
+
(0, import_react.createElement)("button", {
|
|
2005
|
+
className: `tk-switch${r.enabled ? " tk-switch-on" : ""}`,
|
|
2006
|
+
type: "button",
|
|
2007
|
+
role: "switch",
|
|
2008
|
+
"aria-checked": r.enabled,
|
|
2009
|
+
"aria-label": t("toggleAria", { label, id: r.name }),
|
|
2010
|
+
disabled: busy !== null,
|
|
2011
|
+
title: r.enabled ? t("toggleDisable", { label }) : t("toggleEnable", { label }),
|
|
2012
|
+
onClick: () => {
|
|
2013
|
+
onToggle(r.name, !r.enabled);
|
|
2014
|
+
}
|
|
2015
|
+
})
|
|
2016
|
+
);
|
|
2017
|
+
})
|
|
2018
|
+
);
|
|
2019
|
+
}
|
|
2020
|
+
function TargetChips({ sel, lang, onSelect, ariaLabel }) {
|
|
2021
|
+
return (0, import_react.createElement)(
|
|
2022
|
+
"div",
|
|
2023
|
+
{ className: "bt-chips", role: "group", "aria-label": ariaLabel, style: { marginTop: 8 } },
|
|
2024
|
+
...OUTBOUND_TARGETS.map((tg) => (0, import_react.createElement)(
|
|
2025
|
+
"button",
|
|
2026
|
+
{
|
|
2027
|
+
key: tg,
|
|
2028
|
+
className: `bt-chip${sel === tg ? " bt-chip-on" : ""}`,
|
|
2029
|
+
"aria-pressed": sel === tg,
|
|
2030
|
+
type: "button",
|
|
2031
|
+
onClick: () => onSelect(tg)
|
|
2032
|
+
},
|
|
2033
|
+
// 与左侧来源 pills 同款品牌图标——「交接给谁」不再是裸文字钮(any 用本插件品牌小标)
|
|
2034
|
+
tg === "any" ? (0, import_react.createElement)("span", { className: "bt-icon", style: { width: 13, height: 13, background: "linear-gradient(135deg, #6366F1, #8B5CF6)" }, dangerouslySetInnerHTML: { __html: '<svg viewBox="0 0 64 64" width="100%" height="100%"><g fill="none" stroke="#fff" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"><path d="M15 19 L27 32 L15 45"/><path d="M29 19 L41 32 L29 45"/></g></svg>' } }) : (0, import_react.createElement)(ProviderIcon, { name: tg, size: 13 }),
|
|
2035
|
+
(0, import_react.createElement)("span", { className: "bt-chip-label" }, OUTBOUND_LABELS[tg][lang])
|
|
2036
|
+
))
|
|
2037
|
+
);
|
|
2038
|
+
}
|
|
2039
|
+
function PickupGuide({ target, lang, t }) {
|
|
2040
|
+
const sample = pickupCommand(target, "<\u5361\u7247\u7F16\u53F7>", lang);
|
|
2041
|
+
const lines = [
|
|
2042
|
+
(0, import_react.createElement)("div", { className: "bt-sub", key: "g0" }, t("pickupGuideIntro", { label: OUTBOUND_LABELS[target][lang] })),
|
|
2043
|
+
(0, import_react.createElement)(
|
|
2044
|
+
"div",
|
|
2045
|
+
{ className: "bt-fsprev-line", key: "g1" },
|
|
2046
|
+
(0, import_react.createElement)("span", { className: "bt-fsprev-text", style: { fontFamily: "monospace", fontSize: 11 } }, sample)
|
|
2047
|
+
),
|
|
2048
|
+
(0, import_react.createElement)("div", { className: "bt-sub", key: "g2" }, t("pickupGuideDsh"))
|
|
2049
|
+
];
|
|
2050
|
+
return (0, import_react.createElement)("div", { className: "bt-fsprev", style: { marginTop: 8 } }, ...lines);
|
|
2051
|
+
}
|
|
2052
|
+
function SendCard({ sessionId, t, lang, onError, onNotice, bare }) {
|
|
2053
|
+
const [target, setTarget] = (0, import_react.useState)("any");
|
|
2054
|
+
const [busy, setBusy] = (0, import_react.useState)(false);
|
|
2055
|
+
const [sent, setSent] = (0, import_react.useState)(false);
|
|
2056
|
+
const [copied, setCopied] = (0, import_react.useState)(false);
|
|
2057
|
+
const copyTimer = (0, import_react.useRef)(void 0);
|
|
2058
|
+
const copyInstruction = (text, notice) => {
|
|
2059
|
+
void copyText(text).then(() => {
|
|
2060
|
+
setCopied(true);
|
|
2061
|
+
window.clearTimeout(copyTimer.current);
|
|
2062
|
+
copyTimer.current = window.setTimeout(() => setCopied(false), 2400);
|
|
2063
|
+
onNotice(notice);
|
|
2064
|
+
}).catch((e) => onError(e instanceof Error ? e.message : String(e)));
|
|
2065
|
+
};
|
|
2066
|
+
const targetLabelText = OUTBOUND_LABELS[target][lang];
|
|
2067
|
+
const send = () => {
|
|
2068
|
+
if (busy) return;
|
|
2069
|
+
const instruction = outboundCommand(lang, target === "any" ? void 0 : targetLabelText);
|
|
2070
|
+
if (sessionId === void 0 || sessionId === "") {
|
|
2071
|
+
copyInstruction(instruction, t("sendCopiedNotice"));
|
|
2072
|
+
return;
|
|
2073
|
+
}
|
|
2074
|
+
setBusy(true);
|
|
2075
|
+
void post("/dsh-takeover/send", { sessionId, lang, target }).then((r) => {
|
|
2076
|
+
if (r.ok) {
|
|
2077
|
+
setSent(true);
|
|
2078
|
+
onNotice(t("sentNotice"));
|
|
2079
|
+
return void 0;
|
|
2080
|
+
}
|
|
2081
|
+
if (typeof r.instruction === "string" && r.instruction !== "") {
|
|
2082
|
+
copyInstruction(r.instruction, `${t("sendFallbackNotice")}\uFF1A${r.error}`);
|
|
2083
|
+
return void 0;
|
|
2084
|
+
}
|
|
2085
|
+
throw new Error(r.error);
|
|
2086
|
+
}).catch((e) => onError(e instanceof Error ? e.message : String(e))).finally(() => setBusy(false));
|
|
2087
|
+
};
|
|
2088
|
+
return (0, import_react.createElement)(
|
|
2089
|
+
"div",
|
|
2090
|
+
{ className: bare === true ? "bt-bare" : "bt-card" },
|
|
2091
|
+
bare === true ? null : (0, import_react.createElement)(
|
|
2092
|
+
"div",
|
|
2093
|
+
{ className: "bt-head" },
|
|
2094
|
+
(0, import_react.createElement)("span", { className: "bt-title-sec" }, t("sendTitle"))
|
|
2095
|
+
),
|
|
2096
|
+
bare === true ? null : (0, import_react.createElement)("div", { className: "bt-sub" }, sessionId !== void 0 && sessionId !== "" ? t("sendHint") : t("sendHintCopy")),
|
|
2097
|
+
(0, import_react.createElement)("div", { className: "bt-sub", style: { marginTop: 6, fontWeight: 600 } }, t("targetGroupLabel")),
|
|
2098
|
+
(0, import_react.createElement)(TargetChips, { sel: target, lang, onSelect: setTarget, ariaLabel: t("targetGroupLabel") }),
|
|
2099
|
+
(0, import_react.createElement)(
|
|
2100
|
+
"div",
|
|
2101
|
+
{ style: { display: "flex", gap: 8, alignItems: "center", marginTop: 8 } },
|
|
2102
|
+
(0, import_react.createElement)(
|
|
2103
|
+
"button",
|
|
2104
|
+
{
|
|
2105
|
+
className: "bt-btn bt-btn-primary",
|
|
2106
|
+
type: "button",
|
|
2107
|
+
disabled: busy,
|
|
2108
|
+
onClick: send,
|
|
2109
|
+
title: t("sendBtnTitle")
|
|
2110
|
+
},
|
|
2111
|
+
copied ? t("copiedBtn") : busy ? t("sendBusy") : target === "any" ? t("sendBtn") : t("sendBtnTo", { label: targetLabelText })
|
|
2112
|
+
)
|
|
2113
|
+
),
|
|
2114
|
+
(0, import_react.createElement)(
|
|
2115
|
+
"details",
|
|
2116
|
+
{ className: "bt-note", open: sent, style: { marginTop: 8 } },
|
|
2117
|
+
(0, import_react.createElement)("summary", null, t("pickupGuideTitle")),
|
|
2118
|
+
(0, import_react.createElement)(
|
|
2119
|
+
"div",
|
|
2120
|
+
{ className: "bt-note-body" },
|
|
2121
|
+
(0, import_react.createElement)(PickupGuide, { target, lang, t })
|
|
2122
|
+
)
|
|
2123
|
+
)
|
|
2124
|
+
);
|
|
2125
|
+
}
|
|
2126
|
+
function MemoryCard({ t, lang, onError, onNotice, onPushed, defaultOpen, active, bare }) {
|
|
2127
|
+
const [open, setOpen] = (0, import_react.useState)(defaultOpen === true || bare === true);
|
|
2128
|
+
const [scanned, setScanned] = (0, import_react.useState)(false);
|
|
2129
|
+
const [rows, setRows] = (0, import_react.useState)(null);
|
|
2130
|
+
const [picked, setPicked] = (0, import_react.useState)(/* @__PURE__ */ new Set());
|
|
2131
|
+
const [target, setTarget] = (0, import_react.useState)("any");
|
|
2132
|
+
const [busy, setBusy] = (0, import_react.useState)(false);
|
|
2133
|
+
const scan = () => {
|
|
2134
|
+
setScanned(true);
|
|
2135
|
+
setRows(null);
|
|
2136
|
+
void getJson("/dsh-takeover/memory-scan").then((b) => {
|
|
2137
|
+
setRows(b.sources);
|
|
2138
|
+
setPicked(new Set(b.sources.filter((r) => r.exists).map((r) => r.key)));
|
|
2139
|
+
}).catch((e) => onError(e instanceof Error ? e.message : String(e)));
|
|
2140
|
+
};
|
|
2141
|
+
(0, import_react.useEffect)(() => {
|
|
2142
|
+
if ((open || bare === true && active === true) && !scanned) scan();
|
|
2143
|
+
}, [open, scanned]);
|
|
2144
|
+
const toggle = (key) => {
|
|
2145
|
+
setPicked((prev) => {
|
|
2146
|
+
const next = new Set(prev);
|
|
2147
|
+
if (next.has(key)) next.delete(key);
|
|
2148
|
+
else next.add(key);
|
|
2149
|
+
return next;
|
|
2150
|
+
});
|
|
2151
|
+
};
|
|
2152
|
+
const push = () => {
|
|
2153
|
+
if (busy || picked.size === 0) return;
|
|
2154
|
+
setBusy(true);
|
|
2155
|
+
void post("/dsh-takeover/memory-push", { keys: [...picked], target }).then((r) => {
|
|
2156
|
+
if (!r.ok) throw new Error(r.error);
|
|
2157
|
+
onNotice(t("memoryPushedNotice", { n: r.sources }));
|
|
2158
|
+
onPushed();
|
|
2159
|
+
}).catch((e) => onError(e instanceof Error ? e.message : String(e))).finally(() => setBusy(false));
|
|
2160
|
+
};
|
|
2161
|
+
const kb = (n) => n >= 1024 ? `${Math.max(1, Math.round(n / 1024))} KB` : `${n} B`;
|
|
2162
|
+
const existing = rows?.filter((r) => r.exists) ?? [];
|
|
2163
|
+
const missing = rows?.filter((r) => !r.exists).length ?? 0;
|
|
2164
|
+
if (bare === true) {
|
|
2165
|
+
return (0, import_react.createElement)(
|
|
2166
|
+
"div",
|
|
2167
|
+
{ className: "bt-bare" },
|
|
2168
|
+
(0, import_react.createElement)(
|
|
2169
|
+
"div",
|
|
2170
|
+
{ className: "bt-sub", style: { margin: "2px 0 8px" } },
|
|
2171
|
+
rows === null ? (0, import_react.createElement)("span", { className: "bt-sub bt-fs-empty" }, scanned ? t("memoryScanning") : "") : null
|
|
2172
|
+
),
|
|
2173
|
+
rows === null ? null : existing.length === 0 ? (0, import_react.createElement)("div", { className: "bt-sub bt-fs-empty" }, t("memoryNone")) : [
|
|
2174
|
+
(0, import_react.createElement)(
|
|
2175
|
+
"div",
|
|
2176
|
+
{ key: "rows", style: { display: "grid", gap: 4, marginTop: 4 } },
|
|
2177
|
+
...existing.map((r) => (0, import_react.createElement)(
|
|
2178
|
+
"label",
|
|
2179
|
+
{
|
|
2180
|
+
key: r.key,
|
|
2181
|
+
style: {
|
|
2182
|
+
display: "flex",
|
|
2183
|
+
gap: 8,
|
|
2184
|
+
alignItems: "center",
|
|
2185
|
+
fontSize: 12,
|
|
2186
|
+
cursor: "pointer"
|
|
2187
|
+
},
|
|
2188
|
+
title: r.preview !== "" ? r.preview : r.path
|
|
2189
|
+
},
|
|
2190
|
+
(0, import_react.createElement)("input", {
|
|
2191
|
+
type: "checkbox",
|
|
2192
|
+
checked: picked.has(r.key),
|
|
2193
|
+
onChange: () => {
|
|
2194
|
+
toggle(r.key);
|
|
2195
|
+
}
|
|
2196
|
+
}),
|
|
2197
|
+
(0, import_react.createElement)("span", { style: { flex: "0 0 auto", fontWeight: 600 } }, r.agent),
|
|
2198
|
+
(0, import_react.createElement)("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", opacity: 0.75 } }, r.path),
|
|
2199
|
+
(0, import_react.createElement)("span", { style: { flex: "0 0 auto", opacity: 0.6 } }, kb(r.bytes))
|
|
2200
|
+
))
|
|
2201
|
+
),
|
|
2202
|
+
missing > 0 ? (0, import_react.createElement)("div", { key: "missing", className: "bt-sub", style: { marginTop: 4, opacity: 0.6 } }, t("memoryMissingNote", { n: missing })) : null,
|
|
2203
|
+
(0, import_react.createElement)(TargetChips, { key: "targets", sel: target, lang, onSelect: setTarget, ariaLabel: t("targetGroupLabel") }),
|
|
2204
|
+
(0, import_react.createElement)(
|
|
2205
|
+
"div",
|
|
2206
|
+
{ key: "act", style: { display: "flex", gap: 8, alignItems: "center", marginTop: 8 } },
|
|
2207
|
+
(0, import_react.createElement)("button", {
|
|
2208
|
+
className: "bt-btn bt-btn-primary",
|
|
2209
|
+
type: "button",
|
|
2210
|
+
disabled: busy || picked.size === 0,
|
|
2211
|
+
onClick: push,
|
|
2212
|
+
title: t("memoryPushBtnTitle")
|
|
2213
|
+
}, busy ? t("memoryPushing") : t("memoryPushBtn", { n: picked.size }))
|
|
2214
|
+
)
|
|
2215
|
+
]
|
|
2216
|
+
);
|
|
2217
|
+
}
|
|
2218
|
+
return (0, import_react.createElement)(
|
|
2219
|
+
"details",
|
|
2220
|
+
{
|
|
2221
|
+
className: "bt-group",
|
|
2222
|
+
open,
|
|
2223
|
+
onToggle: (e) => {
|
|
2224
|
+
const now = e.target?.open === true;
|
|
2225
|
+
setOpen(now);
|
|
2226
|
+
if (now && !scanned) scan();
|
|
2227
|
+
}
|
|
2228
|
+
},
|
|
2229
|
+
(0, import_react.createElement)(
|
|
2230
|
+
"summary",
|
|
2231
|
+
{ className: "bt-pending", style: { listStyle: "none", cursor: "pointer" } },
|
|
2232
|
+
(0, import_react.createElement)("span", {
|
|
2233
|
+
className: "bt-logo",
|
|
2234
|
+
style: { width: 13, height: 13, display: "inline-block", opacity: 0.9 },
|
|
2235
|
+
dangerouslySetInnerHTML: { __html: MEMORY_SVG }
|
|
2236
|
+
}),
|
|
2237
|
+
(0, import_react.createElement)("span", { className: "bt-title-sec" }, `${t("memoryTitle")}`),
|
|
2238
|
+
(0, import_react.createElement)("span", { className: "bt-spacer" }),
|
|
2239
|
+
(0, import_react.createElement)("span", { className: "bt-pending-chev", "aria-hidden": true }, "\u25B8")
|
|
2240
|
+
),
|
|
2241
|
+
(0, import_react.createElement)(
|
|
2242
|
+
"div",
|
|
2243
|
+
{ style: { padding: "8px 2px 2px" } },
|
|
2244
|
+
(0, import_react.createElement)("div", { className: "bt-sub" }, t("memoryHint")),
|
|
2245
|
+
rows === null ? (0, import_react.createElement)("div", { className: "bt-sub bt-fs-empty" }, scanned ? t("memoryScanning") : t("memoryExpandHint")) : existing.length === 0 ? (0, import_react.createElement)("div", { className: "bt-sub bt-fs-empty" }, t("memoryNone")) : [
|
|
2246
|
+
(0, import_react.createElement)(
|
|
2247
|
+
"div",
|
|
2248
|
+
{ key: "rows", style: { display: "grid", gap: 4, marginTop: 8 } },
|
|
2249
|
+
...existing.map((r) => (0, import_react.createElement)(
|
|
2250
|
+
"label",
|
|
2251
|
+
{
|
|
2252
|
+
key: r.key,
|
|
2253
|
+
style: {
|
|
2254
|
+
display: "flex",
|
|
2255
|
+
gap: 8,
|
|
2256
|
+
alignItems: "center",
|
|
2257
|
+
fontSize: 12,
|
|
2258
|
+
cursor: "pointer"
|
|
2259
|
+
},
|
|
2260
|
+
title: r.preview !== "" ? r.preview : r.path
|
|
2261
|
+
},
|
|
2262
|
+
(0, import_react.createElement)("input", {
|
|
2263
|
+
type: "checkbox",
|
|
2264
|
+
checked: picked.has(r.key),
|
|
2265
|
+
onChange: () => {
|
|
2266
|
+
toggle(r.key);
|
|
2267
|
+
}
|
|
2268
|
+
}),
|
|
2269
|
+
(0, import_react.createElement)("span", { style: { flex: "0 0 auto", fontWeight: 600 } }, r.agent),
|
|
2270
|
+
(0, import_react.createElement)("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", opacity: 0.75 } }, r.path),
|
|
2271
|
+
(0, import_react.createElement)("span", { style: { flex: "0 0 auto", opacity: 0.6 } }, kb(r.bytes))
|
|
2272
|
+
))
|
|
2273
|
+
),
|
|
2274
|
+
missing > 0 ? (0, import_react.createElement)("div", { key: "missing", className: "bt-sub", style: { marginTop: 4, opacity: 0.6 } }, t("memoryMissingNote", { n: missing })) : null,
|
|
2275
|
+
(0, import_react.createElement)(TargetChips, { key: "targets", sel: target, lang, onSelect: setTarget, ariaLabel: t("targetGroupLabel") }),
|
|
2276
|
+
(0, import_react.createElement)(
|
|
2277
|
+
"div",
|
|
2278
|
+
{ key: "act", style: { display: "flex", gap: 8, alignItems: "center", marginTop: 8 } },
|
|
2279
|
+
(0, import_react.createElement)("button", {
|
|
2280
|
+
className: "bt-btn bt-btn-primary",
|
|
2281
|
+
type: "button",
|
|
2282
|
+
disabled: busy || picked.size === 0,
|
|
2283
|
+
onClick: push,
|
|
2284
|
+
title: t("memoryPushBtnTitle")
|
|
2285
|
+
}, busy ? t("memoryPushing") : t("memoryPushBtn", { n: picked.size }))
|
|
2286
|
+
)
|
|
2287
|
+
]
|
|
2288
|
+
)
|
|
2289
|
+
);
|
|
2290
|
+
}
|
|
2291
|
+
function HelpCard({ t }) {
|
|
2292
|
+
const entries = [1, 2, 3, 4, 5, 6, 7, 8].map((i) => ({
|
|
2293
|
+
q: t(`qa${i}q`),
|
|
2294
|
+
a: t(`qa${i}a`)
|
|
2295
|
+
}));
|
|
2296
|
+
return (0, import_react.createElement)(
|
|
2297
|
+
"div",
|
|
2298
|
+
{ className: "bt-card", "data-help-card": "1" },
|
|
2299
|
+
(0, import_react.createElement)(
|
|
2300
|
+
"div",
|
|
2301
|
+
{ className: "bt-head" },
|
|
2302
|
+
(0, import_react.createElement)("span", {
|
|
2303
|
+
className: "bt-logo",
|
|
2304
|
+
style: { width: 13, height: 13, display: "inline-block", opacity: 0.9 },
|
|
2305
|
+
dangerouslySetInnerHTML: { __html: HELP_SVG }
|
|
2306
|
+
}),
|
|
2307
|
+
(0, import_react.createElement)("span", { className: "bt-title-sec" }, t("helpTitle"))
|
|
2308
|
+
),
|
|
2309
|
+
// 三步上手(复用引导条文案——引导条消失后的唯一常驻指南)
|
|
2310
|
+
(0, import_react.createElement)(
|
|
2311
|
+
"div",
|
|
2312
|
+
{ style: { display: "grid", gap: 4, fontSize: 12, marginBottom: 10 } },
|
|
2313
|
+
(0, import_react.createElement)("span", { style: { fontWeight: 600 } }, t("popoverSubtitle")),
|
|
2314
|
+
(0, import_react.createElement)("span", { style: { opacity: 0.85 } }, `\u2460 ${t("onboard1")}`),
|
|
2315
|
+
(0, import_react.createElement)("span", { style: { opacity: 0.85 } }, `\u2461 ${t("onboard2")}`),
|
|
2316
|
+
(0, import_react.createElement)("span", { style: { opacity: 0.85 } }, `\u2462 ${t("onboard3")}`)
|
|
2317
|
+
),
|
|
2318
|
+
(0, import_react.createElement)(
|
|
2319
|
+
"div",
|
|
2320
|
+
{ style: { display: "grid", gap: 8 } },
|
|
2321
|
+
...entries.map((e, i) => (0, import_react.createElement)(
|
|
2322
|
+
"div",
|
|
2323
|
+
{ key: i, style: { marginBottom: 8 } },
|
|
2324
|
+
(0, import_react.createElement)("div", { style: { fontWeight: 600, marginBottom: 2 } }, e.q),
|
|
2325
|
+
(0, import_react.createElement)("div", { style: { opacity: 0.85 } }, e.a)
|
|
2326
|
+
))
|
|
2327
|
+
)
|
|
2328
|
+
);
|
|
2329
|
+
}
|
|
2330
|
+
function ForeignBrowser({ state, t, lang, onError, onNotice, navigate, bare, active }) {
|
|
2331
|
+
const providers = state?.providers ?? [];
|
|
2332
|
+
const [sel, setSel] = (0, import_react.useState)(null);
|
|
2333
|
+
const [lists, setLists] = (0, import_react.useState)({});
|
|
2334
|
+
const [loading, setLoading] = (0, import_react.useState)({});
|
|
2335
|
+
const [query, setQuery] = (0, import_react.useState)("");
|
|
2336
|
+
const [cwdSel, setCwdSel] = (0, import_react.useState)(null);
|
|
2337
|
+
const [subOpen, setSubOpen] = (0, import_react.useState)(false);
|
|
2338
|
+
const [busyKey, setBusyKey] = (0, import_react.useState)(null);
|
|
2339
|
+
const [deliveredKey, setDeliveredKey] = (0, import_react.useState)(null);
|
|
2340
|
+
const [openId, setOpenId] = (0, import_react.useState)(null);
|
|
2341
|
+
const [previews, setPreviews] = (0, import_react.useState)({});
|
|
2342
|
+
const [copied, setCopied] = (0, import_react.useState)(null);
|
|
2343
|
+
const copyTimer = (0, import_react.useRef)(void 0);
|
|
2344
|
+
const load = (provider2) => {
|
|
2345
|
+
setLoading((prev) => ({ ...prev, [provider2]: true }));
|
|
2346
|
+
void getJson(`/dsh-takeover/sessions?provider=${encodeURIComponent(provider2)}`).then((b) => {
|
|
2347
|
+
if (b.ok !== true) throw new Error(b.error);
|
|
2348
|
+
setLists((prev) => ({ ...prev, [provider2]: b }));
|
|
2349
|
+
}).catch((e) => onError(e instanceof Error ? e.message : String(e))).finally(() => setLoading((cur) => {
|
|
2350
|
+
if (cur[provider2] !== true) return cur;
|
|
2351
|
+
const next = { ...cur };
|
|
2352
|
+
delete next[provider2];
|
|
2353
|
+
return next;
|
|
2354
|
+
}));
|
|
2355
|
+
};
|
|
2356
|
+
(0, import_react.useEffect)(() => {
|
|
2357
|
+
if (bare !== true || active !== true || sel !== null) return;
|
|
2358
|
+
const best = [...providers].filter((p) => p.supported && p.enabled && p.sessions > 0).sort((a, b) => b.sessions - a.sessions)[0];
|
|
2359
|
+
if (best !== void 0) {
|
|
2360
|
+
setSel(best.name);
|
|
2361
|
+
load(best.name);
|
|
2362
|
+
}
|
|
2363
|
+
}, [bare, active, providers, sel]);
|
|
2364
|
+
const loadPreview = (provider2, id) => {
|
|
2365
|
+
setPreviews((prev) => ({ ...prev, [id]: { loading: true, data: prev[id]?.data ?? null, error: null } }));
|
|
2366
|
+
void getJson(
|
|
2367
|
+
`/dsh-takeover/session-preview?provider=${encodeURIComponent(provider2)}&reference=${encodeURIComponent(id)}`
|
|
2368
|
+
).then((b) => {
|
|
2369
|
+
if (b.ok !== true) throw new Error(b.error);
|
|
2370
|
+
setPreviews((prev) => ({ ...prev, [id]: { loading: false, data: b, error: null } }));
|
|
2371
|
+
}).catch((e) => {
|
|
2372
|
+
setPreviews((prev) => ({ ...prev, [id]: { loading: false, data: null, error: e instanceof Error ? e.message : String(e) } }));
|
|
2373
|
+
});
|
|
2374
|
+
};
|
|
2375
|
+
const copy = (key, text) => {
|
|
2376
|
+
void copyText(text).then(() => {
|
|
2377
|
+
setCopied(key);
|
|
2378
|
+
window.clearTimeout(copyTimer.current);
|
|
2379
|
+
copyTimer.current = window.setTimeout(() => setCopied(null), 1600);
|
|
2380
|
+
}).catch((e) => onError(e instanceof Error ? e.message : String(e)));
|
|
2381
|
+
};
|
|
2382
|
+
const now = Date.now();
|
|
2383
|
+
const list = sel !== null ? lists[sel] : void 0;
|
|
2384
|
+
const provider = sel ?? "";
|
|
2385
|
+
const clip = (s, n = 260) => s.length > n ? `${s.slice(0, n)}\u2026` : s;
|
|
2386
|
+
const runTakeover = (key, mode, id) => {
|
|
2387
|
+
if (busyKey !== null) return;
|
|
2388
|
+
const fallback = mode === "take_deposit" ? depositCommand(provider, id, lang) : takeoverCommand(provider, id);
|
|
2389
|
+
setBusyKey(key);
|
|
2390
|
+
void post(
|
|
2391
|
+
"/dsh-takeover/takeover",
|
|
2392
|
+
{ mode, provider, reference: id, lang }
|
|
2393
|
+
).then((r) => {
|
|
2394
|
+
if (!r.ok) throw new Error(r.error);
|
|
2395
|
+
setDeliveredKey(key);
|
|
2396
|
+
const switched = navigate(r.sessionId);
|
|
2397
|
+
onNotice(t(switched ? "deliveredNoticeNav" : "deliveredNotice", { title: r.title }));
|
|
2398
|
+
return void 0;
|
|
2399
|
+
}).catch((e) => {
|
|
2400
|
+
const reason = e instanceof Error ? e.message : String(e);
|
|
2401
|
+
copyText(fallback).then(() => {
|
|
2402
|
+
setCopied(key);
|
|
2403
|
+
window.clearTimeout(copyTimer.current);
|
|
2404
|
+
copyTimer.current = window.setTimeout(() => setCopied(null), 2400);
|
|
2405
|
+
onNotice(t("fallbackNotice", { reason }));
|
|
2406
|
+
}).catch((ce) => onError(ce instanceof Error ? ce.message : String(ce)));
|
|
2407
|
+
}).finally(() => setBusyKey(null));
|
|
2408
|
+
};
|
|
2409
|
+
const line = (label, text, key) => (0, import_react.createElement)(
|
|
2410
|
+
"div",
|
|
2411
|
+
{ className: "bt-fsprev-line", key },
|
|
2412
|
+
label !== "" ? (0, import_react.createElement)("span", { className: "bt-fsprev-label" }, label) : null,
|
|
2413
|
+
(0, import_react.createElement)("span", { className: "bt-fsprev-text" }, text)
|
|
2414
|
+
);
|
|
2415
|
+
const previewNode = (id) => {
|
|
2416
|
+
const pv = previews[id];
|
|
2417
|
+
if (pv === void 0 || pv.loading) return (0, import_react.createElement)("div", { className: "bt-fsprev" }, t("loading"));
|
|
2418
|
+
if (pv.error !== null) {
|
|
2419
|
+
return (0, import_react.createElement)("div", { className: "bt-fsprev bt-fsprev-warn" }, `${t("previewLoadFail")}\uFF1A${pv.error}`);
|
|
2420
|
+
}
|
|
2421
|
+
const d = pv.data;
|
|
2422
|
+
if (d === null) return null;
|
|
2423
|
+
const warns = d.skeleton.warnings.split("\n").map((s) => s.trim()).filter((s) => s !== "").slice(0, 3);
|
|
2424
|
+
return (0, import_react.createElement)(
|
|
2425
|
+
"div",
|
|
2426
|
+
{ className: "bt-fsprev" },
|
|
2427
|
+
(0, import_react.createElement)(
|
|
2428
|
+
"div",
|
|
2429
|
+
{ className: "bt-fsprev-line" },
|
|
2430
|
+
(0, import_react.createElement)(
|
|
2431
|
+
"span",
|
|
2432
|
+
{ className: "bt-fsprev-label" },
|
|
2433
|
+
t("previewTurns", { n: d.summary.turnCount, u: d.summary.userTurns })
|
|
2434
|
+
),
|
|
2435
|
+
d.note !== void 0 ? (0, import_react.createElement)("span", { className: "bt-fsprev-warn" }, d.note) : null
|
|
2436
|
+
),
|
|
2437
|
+
d.summary.firstUserMessage !== "" ? line(t("previewFirst"), clip(d.summary.firstUserMessage), "pv-first") : null,
|
|
2438
|
+
...d.summary.tailProgress.slice(0, 2).map((s, i) => line(i === 0 ? t("previewTail") : "", clip(s, 200), `pv-tail-${i}`)),
|
|
2439
|
+
line(t("previewStop"), clip(d.skeleton.stopped), "pv-stop"),
|
|
2440
|
+
...warns.map((w, i) => (0, import_react.createElement)("div", { className: "bt-fsprev-line bt-fsprev-warn", key: `pv-warn-${i}` }, `\u26A0 ${clip(w, 200)}`))
|
|
2441
|
+
);
|
|
2442
|
+
};
|
|
2443
|
+
const toggleRow = (r, open) => {
|
|
2444
|
+
setOpenId(open ? null : r.id);
|
|
2445
|
+
if (!open && previews[r.id] === void 0 && sel !== null) loadPreview(sel, r.id);
|
|
2446
|
+
};
|
|
2447
|
+
const fsessDisplayTitle = (raw, idShown) => {
|
|
2448
|
+
const trimmed = raw.trim();
|
|
2449
|
+
if (trimmed === "") return idShown;
|
|
2450
|
+
const cleaned = trimmed.replace(/<local-command-[a-z-]+>[\s\S]*?<\/local-command-[a-z-]+>/gi, "").replace(/<local-command-[a-z-]+>/gi, "").replace(/^Reply only with[^\n]*\n?/i, "").trim();
|
|
2451
|
+
return cleaned !== "" ? (cleaned.split("\n")[0] ?? idShown).slice(0, 200) : idShown;
|
|
2452
|
+
};
|
|
2453
|
+
const rowNode = (r) => {
|
|
2454
|
+
const open = openId === r.id;
|
|
2455
|
+
const idShown = shortId(r);
|
|
2456
|
+
const idKey = `id:${r.id}`;
|
|
2457
|
+
const rowCol = projectColor(r.cwd);
|
|
2458
|
+
return (0, import_react.createElement)(
|
|
2459
|
+
"div",
|
|
2460
|
+
{
|
|
2461
|
+
key: r.id,
|
|
2462
|
+
className: "bt-fsess",
|
|
2463
|
+
// 项目色左缘条:整个列表按项目着色——滚动里扫一眼就知道哪片是哪个项目
|
|
2464
|
+
style: { borderLeft: `3px solid ${rowCol.hex}` }
|
|
2465
|
+
},
|
|
2466
|
+
(0, import_react.createElement)(
|
|
2467
|
+
"div",
|
|
2468
|
+
{ className: "bt-fsess-line1" },
|
|
2469
|
+
(0, import_react.createElement)("span", {
|
|
2470
|
+
className: "bt-fsess-title",
|
|
2471
|
+
role: "button",
|
|
2472
|
+
tabIndex: 0,
|
|
2473
|
+
"aria-expanded": open,
|
|
2474
|
+
title: fsessDisplayTitle(r.title, r.id),
|
|
2475
|
+
onClick: () => toggleRow(r, open),
|
|
2476
|
+
onKeyDown: (e) => {
|
|
2477
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2478
|
+
e.preventDefault();
|
|
2479
|
+
toggleRow(r, open);
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
}, fsessDisplayTitle(r.title, idShown)),
|
|
2483
|
+
(0, import_react.createElement)("span", { className: "bt-fsess-time" }, relTime(r.updatedAt, now, lang))
|
|
2484
|
+
),
|
|
2485
|
+
(0, import_react.createElement)(
|
|
2486
|
+
"div",
|
|
2487
|
+
{ className: "bt-fsess-line2" },
|
|
2488
|
+
(() => {
|
|
2489
|
+
const col = projectColor(r.cwd);
|
|
2490
|
+
const label = r.cwd === "" ? "\u2014" : r.cwd.split(/[\\/]/).filter(Boolean).pop() ?? r.cwd;
|
|
2491
|
+
return (0, import_react.createElement)("span", {
|
|
2492
|
+
className: "bt-fsess-src",
|
|
2493
|
+
title: r.cwd !== "" ? r.cwd : void 0,
|
|
2494
|
+
style: r.cwd === "" ? void 0 : { color: col.hex }
|
|
2495
|
+
}, (0, import_react.createElement)(FolderIcon, { color: col.hex }), label);
|
|
2496
|
+
})(),
|
|
2497
|
+
(0, import_react.createElement)("span", {
|
|
2498
|
+
className: "bt-fsess-id",
|
|
2499
|
+
role: "button",
|
|
2500
|
+
tabIndex: 0,
|
|
2501
|
+
title: t("copyIdTitle"),
|
|
2502
|
+
onClick: () => copy(idKey, r.id),
|
|
2503
|
+
onKeyDown: (e) => {
|
|
2504
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2505
|
+
e.preventDefault();
|
|
2506
|
+
copy(idKey, r.id);
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
}, copied === idKey ? t("copiedBtn") : idShown),
|
|
2510
|
+
(0, import_react.createElement)(
|
|
2511
|
+
"span",
|
|
2512
|
+
{ className: "bt-fsess-act" },
|
|
2513
|
+
(0, import_react.createElement)(
|
|
2514
|
+
"button",
|
|
2515
|
+
{
|
|
2516
|
+
className: "bt-btn bt-btn-xs bt-btn-primary",
|
|
2517
|
+
type: "button",
|
|
2518
|
+
disabled: busyKey !== null,
|
|
2519
|
+
title: t("takeoverTitle"),
|
|
2520
|
+
onClick: () => runTakeover(`take:${r.id}`, "take", r.id)
|
|
2521
|
+
},
|
|
2522
|
+
deliveredKey === `take:${r.id}` ? t("deliveredBtn") : busyKey === `take:${r.id}` ? t("deliveringBtn") : copied === `take:${r.id}` ? t("fallbackCopyBtn") : t("takeoverBtn")
|
|
2523
|
+
),
|
|
2524
|
+
(0, import_react.createElement)(
|
|
2525
|
+
"button",
|
|
2526
|
+
{
|
|
2527
|
+
className: "bt-btn bt-btn-xs",
|
|
2528
|
+
type: "button",
|
|
2529
|
+
disabled: busyKey !== null,
|
|
2530
|
+
title: t("depositTitle"),
|
|
2531
|
+
onClick: () => runTakeover(`dep:${r.id}`, "take_deposit", r.id)
|
|
2532
|
+
},
|
|
2533
|
+
deliveredKey === `dep:${r.id}` ? t("deliveredBtn") : busyKey === `dep:${r.id}` ? t("deliveringBtn") : copied === `dep:${r.id}` ? t("fallbackCopyBtn") : t("depositBtn")
|
|
2534
|
+
)
|
|
2535
|
+
)
|
|
2536
|
+
),
|
|
2537
|
+
open ? previewNode(r.id) : null
|
|
2538
|
+
);
|
|
2539
|
+
};
|
|
2540
|
+
const matched = list !== void 0 ? filterSessions(list.sessions, query) : [];
|
|
2541
|
+
const facets = list !== void 0 ? cwdFacets(matched) : [];
|
|
2542
|
+
const cwdEffective = facets.some((f) => f.cwd === cwdSel) ? cwdSel : null;
|
|
2543
|
+
const visible = filterByCwd(matched, cwdEffective).filter((r) => !isSubagentSession(r));
|
|
2544
|
+
const subRows = filterByCwd(matched, cwdEffective).filter(isSubagentSession);
|
|
2545
|
+
const subGroupNode = subRows.length > 0 ? (0, import_react.createElement)(
|
|
2546
|
+
"div",
|
|
2547
|
+
{ className: "bt-group", key: "fs-sub" },
|
|
2548
|
+
(0, import_react.createElement)(
|
|
2549
|
+
"div",
|
|
2550
|
+
{
|
|
2551
|
+
className: `bt-pending${subOpen ? " bt-pending-open" : ""}`,
|
|
2552
|
+
role: "button",
|
|
2553
|
+
tabIndex: 0,
|
|
2554
|
+
"aria-expanded": subOpen,
|
|
2555
|
+
"aria-label": t("subagentGroup", { n: subRows.length }),
|
|
2556
|
+
onClick: () => setSubOpen(!subOpen),
|
|
2557
|
+
onKeyDown: (e) => {
|
|
2558
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
2559
|
+
e.preventDefault();
|
|
2560
|
+
setSubOpen(!subOpen);
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
},
|
|
2564
|
+
(0, import_react.createElement)("span", { className: "bt-tag bt-tag-lowinfo" }, t("subagentBadge")),
|
|
2565
|
+
(0, import_react.createElement)("span", { className: "bt-pending-title" }, t("subagentGroup", { n: subRows.length })),
|
|
2566
|
+
(0, import_react.createElement)("span", { className: "bt-pending-chev", "aria-hidden": true }, "\u25B8")
|
|
2567
|
+
),
|
|
2568
|
+
subOpen ? subRows.map(rowNode) : null
|
|
2569
|
+
) : null;
|
|
2570
|
+
return (0, import_react.createElement)(
|
|
2571
|
+
"div",
|
|
2572
|
+
{ className: bare === true ? "bt-bare" : "bt-card" },
|
|
2573
|
+
bare === true ? null : (0, import_react.createElement)(
|
|
2574
|
+
"div",
|
|
2575
|
+
{ className: "bt-head" },
|
|
2576
|
+
(0, import_react.createElement)("span", { className: "bt-title-sec" }, t("browserTitle"))
|
|
2577
|
+
),
|
|
2578
|
+
bare === true ? null : (0, import_react.createElement)("div", { className: "bt-sub" }, t("browserHint")),
|
|
2579
|
+
bare === true ? null : (0, import_react.createElement)("div", { className: "bt-sub", style: { marginTop: 8, fontWeight: 600 } }, t("browserGroupLabel")),
|
|
2580
|
+
(0, import_react.createElement)(
|
|
2581
|
+
"div",
|
|
2582
|
+
{ className: "bt-chips", role: "group", "aria-label": t("browserChipAria"), style: { marginTop: 8 } },
|
|
2583
|
+
...providers.map((p) => {
|
|
2584
|
+
const usable = p.supported && p.enabled;
|
|
2585
|
+
return (0, import_react.createElement)(
|
|
2586
|
+
"button",
|
|
2587
|
+
{
|
|
2588
|
+
key: p.name,
|
|
2589
|
+
className: `bt-chip${sel === p.name ? " bt-chip-on" : ""}${usable ? "" : " bt-chip-off"}`,
|
|
2590
|
+
disabled: !usable,
|
|
2591
|
+
"aria-pressed": sel === p.name,
|
|
2592
|
+
type: "button",
|
|
2593
|
+
title: !usable ? t("browserDisabledTitle", { label: PROVIDER_LABEL[p.name] ?? p.name }) : p.supported && p.note !== "" ? p.note : void 0,
|
|
2594
|
+
onClick: () => {
|
|
2595
|
+
setSel(p.name);
|
|
2596
|
+
setOpenId(null);
|
|
2597
|
+
setCwdSel(null);
|
|
2598
|
+
if (lists[p.name] === void 0 && loading[p.name] !== true) load(p.name);
|
|
2599
|
+
}
|
|
2600
|
+
},
|
|
2601
|
+
(0, import_react.createElement)(ProviderIcon, { name: p.name, size: 13 }),
|
|
2602
|
+
(0, import_react.createElement)("span", { className: "bt-chip-label" }, PROVIDER_LABEL[p.name] ?? p.name),
|
|
2603
|
+
(0, import_react.createElement)("span", { className: "bt-chip-count" }, p.sessions >= 0 ? String(p.sessions) : "\u2026")
|
|
2604
|
+
);
|
|
2605
|
+
})
|
|
2606
|
+
),
|
|
2607
|
+
sel === null || list === void 0 ? (0, import_react.createElement)("div", { className: "bt-sub bt-fs-empty" }, sel === null ? t("browserPick") : t("loading")) : [
|
|
2608
|
+
(0, import_react.createElement)(
|
|
2609
|
+
"div",
|
|
2610
|
+
{ className: "bt-inbox-toolbar", key: "fs-bar" },
|
|
2611
|
+
(0, import_react.createElement)("input", {
|
|
2612
|
+
className: "bt-filter",
|
|
2613
|
+
type: "search",
|
|
2614
|
+
value: query,
|
|
2615
|
+
placeholder: t("filterSessionsPlaceholder"),
|
|
2616
|
+
"aria-label": t("filterSessionsAria"),
|
|
2617
|
+
title: t("filterSessionsAria"),
|
|
2618
|
+
onChange: (e) => {
|
|
2619
|
+
setQuery(e.target.value);
|
|
2620
|
+
}
|
|
2621
|
+
}),
|
|
2622
|
+
(0, import_react.createElement)("button", {
|
|
2623
|
+
className: "bt-btn",
|
|
2624
|
+
type: "button",
|
|
2625
|
+
disabled: loading[provider] === true,
|
|
2626
|
+
onClick: () => {
|
|
2627
|
+
setOpenId(null);
|
|
2628
|
+
load(provider);
|
|
2629
|
+
}
|
|
2630
|
+
}, loading[provider] === true ? t("loading") : t("refresh"))
|
|
2631
|
+
),
|
|
2632
|
+
(0, import_react.createElement)(
|
|
2633
|
+
"div",
|
|
2634
|
+
{ className: "bt-sub bt-fs-count", key: "fs-count" },
|
|
2635
|
+
list.total === 0 ? t("browserEmpty") : t("browserTotal", { m: list.total, n: list.sessions.length }),
|
|
2636
|
+
list.note !== void 0 ? ` \xB7 ${t("browserNote", { note: list.note })}` : ""
|
|
2637
|
+
),
|
|
2638
|
+
list.total > 0 && facets.length > 1 ? (0, import_react.createElement)(
|
|
2639
|
+
"div",
|
|
2640
|
+
{ className: "bt-chips", key: "fs-cwd", role: "group", "aria-label": t("facetCwdAria"), style: { marginTop: 6 } },
|
|
2641
|
+
...facets.map((f) => {
|
|
2642
|
+
const col = projectColor(f.cwd);
|
|
2643
|
+
const on = cwdEffective === f.cwd;
|
|
2644
|
+
return (0, import_react.createElement)(
|
|
2645
|
+
"button",
|
|
2646
|
+
{
|
|
2647
|
+
key: f.cwd === "" ? "(empty)" : f.cwd,
|
|
2648
|
+
className: `bt-chip${on ? " bt-chip-on" : ""}`,
|
|
2649
|
+
style: on ? { borderColor: `rgba(${col.rgb},.55)`, background: `rgba(${col.rgb},.14)`, color: col.hex } : void 0,
|
|
2650
|
+
"aria-pressed": on,
|
|
2651
|
+
type: "button",
|
|
2652
|
+
title: f.cwd === "" ? void 0 : f.cwd,
|
|
2653
|
+
onClick: () => setCwdSel(on ? null : f.cwd)
|
|
2654
|
+
},
|
|
2655
|
+
(0, import_react.createElement)(FolderIcon, { color: col.hex }),
|
|
2656
|
+
(0, import_react.createElement)("span", { className: "bt-chip-label" }, f.label),
|
|
2657
|
+
(0, import_react.createElement)("span", { className: "bt-chip-count" }, String(f.count))
|
|
2658
|
+
);
|
|
2659
|
+
})
|
|
2660
|
+
) : null,
|
|
2661
|
+
list.total > 0 && matched.length === 0 ? (0, import_react.createElement)("div", { className: "bt-banner bt-banner-info", key: "fs-nomatch" }, t("browserFilterEmpty")) : (0, import_react.createElement)("div", { key: "fs-rows" }, visible.map(rowNode), subGroupNode)
|
|
2662
|
+
]
|
|
2663
|
+
);
|
|
2664
|
+
}
|
|
2665
|
+
var RESUME_PROVIDERS = ["claude", "codex", "opencode", "zcode", "pi", "workbuddy", "cursor", "grok", "gemini"];
|
|
2666
|
+
function CommandsGrid({ state, t }) {
|
|
2667
|
+
const disabled = new Set(
|
|
2668
|
+
(state?.providers ?? []).filter((p) => !p.enabled).map((p) => p.name)
|
|
2669
|
+
);
|
|
2670
|
+
const chip = (cmd, desc, provider, primary = false) => {
|
|
2671
|
+
const off = provider !== void 0 && disabled.has(provider);
|
|
2672
|
+
const label = provider !== void 0 ? PROVIDER_LABEL[provider] ?? provider : void 0;
|
|
2673
|
+
return (0, import_react.createElement)(
|
|
2674
|
+
"div",
|
|
2675
|
+
{
|
|
2676
|
+
key: cmd,
|
|
2677
|
+
className: `tk-cmd${off ? " tk-cmd-off" : ""}`,
|
|
2678
|
+
title: off && label !== void 0 ? t("cmdOffTitle", { label }) : void 0
|
|
2679
|
+
},
|
|
2680
|
+
provider !== void 0 ? (0, import_react.createElement)(ProviderIcon, { name: provider }) : (0, import_react.createElement)(
|
|
2681
|
+
"span",
|
|
2682
|
+
{ className: "bt-icon", style: { width: 16, height: 16, background: "var(--tk-grad)" } },
|
|
2683
|
+
(0, import_react.createElement)(
|
|
2684
|
+
"svg",
|
|
2685
|
+
{ viewBox: "0 0 64 64", width: 10, height: 10, "aria-hidden": true },
|
|
2686
|
+
(0, import_react.createElement)("rect", { x: 12, y: 26.5, width: 40, height: 11, rx: 5.5, fill: "#fff", transform: "rotate(-45 32 32)" })
|
|
2687
|
+
)
|
|
2688
|
+
),
|
|
2689
|
+
(0, import_react.createElement)("span", { className: `tk-cmd-key${primary ? " tk-cmd-key-primary" : ""}` }, cmd),
|
|
2690
|
+
(0, import_react.createElement)("span", { className: "tk-cmd-desc" }, desc)
|
|
2691
|
+
);
|
|
2692
|
+
};
|
|
2693
|
+
return (0, import_react.createElement)(
|
|
2694
|
+
"div",
|
|
2695
|
+
{ className: "tk-cmds" },
|
|
2696
|
+
chip("/handoff", t("cmdHandoffDesc"), void 0, true),
|
|
2697
|
+
chip("/inbox", t("cmdInboxDesc"), void 0, true),
|
|
2698
|
+
...RESUME_PROVIDERS.map((p) => chip(`/resume-${p}`, t("cmdResumeDesc", { name: PROVIDER_LABEL[p] ?? p }), p))
|
|
2699
|
+
);
|
|
2700
|
+
}
|
|
2701
|
+
var PanelBoundary = class extends import_react.Component {
|
|
2702
|
+
state = { err: null };
|
|
2703
|
+
static getDerivedStateFromError(err) {
|
|
2704
|
+
return { err };
|
|
2705
|
+
}
|
|
2706
|
+
render() {
|
|
2707
|
+
if (this.state.err !== null) {
|
|
2708
|
+
const e = this.state.err;
|
|
2709
|
+
return (0, import_react.createElement)(
|
|
2710
|
+
"div",
|
|
2711
|
+
{ className: "bt-panel", style: themeVars() },
|
|
2712
|
+
(0, import_react.createElement)("style", null, CSS),
|
|
2713
|
+
(0, import_react.createElement)(
|
|
2714
|
+
"div",
|
|
2715
|
+
{ className: "bt-card" },
|
|
2716
|
+
(0, import_react.createElement)("div", { className: "bt-title" }, this.props.t("renderErrorTitle")),
|
|
2717
|
+
(0, import_react.createElement)(
|
|
2718
|
+
"pre",
|
|
2719
|
+
{ style: { fontSize: 11, whiteSpace: "pre-wrap", wordBreak: "break-word", margin: 0, lineHeight: 1.5 } },
|
|
2720
|
+
e.stack ?? e.message ?? String(this.state.err)
|
|
2721
|
+
)
|
|
2722
|
+
)
|
|
2723
|
+
);
|
|
2724
|
+
}
|
|
2725
|
+
return this.props.children;
|
|
2726
|
+
}
|
|
2727
|
+
};
|
|
2728
|
+
function useLocaleSync(locale) {
|
|
2729
|
+
(0, import_react.useSyncExternalStore)(
|
|
2730
|
+
(cb) => {
|
|
2731
|
+
try {
|
|
2732
|
+
return locale?.subscribe(cb) ?? (() => {
|
|
2733
|
+
});
|
|
2734
|
+
} catch {
|
|
2735
|
+
return (() => {
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
},
|
|
2739
|
+
() => {
|
|
2740
|
+
try {
|
|
2741
|
+
return locale?.getSnapshot().revision ?? 0;
|
|
2742
|
+
} catch {
|
|
2743
|
+
return 0;
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
);
|
|
2747
|
+
}
|
|
2748
|
+
function useTakeoverPolling() {
|
|
2749
|
+
const [state, setState] = (0, import_react.useState)(null);
|
|
2750
|
+
const [error, setError] = (0, import_react.useState)(null);
|
|
2751
|
+
const generationRef = (0, import_react.useRef)(0);
|
|
2752
|
+
const reload = () => {
|
|
2753
|
+
const gen = ++generationRef.current;
|
|
2754
|
+
void getState().then(
|
|
2755
|
+
(s) => {
|
|
2756
|
+
if (gen !== generationRef.current) return;
|
|
2757
|
+
setState(s);
|
|
2758
|
+
setError(null);
|
|
2759
|
+
},
|
|
2760
|
+
(e) => {
|
|
2761
|
+
if (gen !== generationRef.current) return;
|
|
2762
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
2763
|
+
}
|
|
2764
|
+
);
|
|
2765
|
+
};
|
|
2766
|
+
(0, import_react.useEffect)(reload, []);
|
|
2767
|
+
(0, import_react.useEffect)(() => {
|
|
2768
|
+
const timer = window.setInterval(() => {
|
|
2769
|
+
try {
|
|
2770
|
+
if (document.visibilityState === "visible") reload();
|
|
2771
|
+
} catch {
|
|
2772
|
+
}
|
|
2773
|
+
}, 3e4);
|
|
2774
|
+
return () => {
|
|
2775
|
+
window.clearInterval(timer);
|
|
2776
|
+
};
|
|
2777
|
+
}, []);
|
|
2778
|
+
return { state, setState, error, setError, reload, generationRef };
|
|
2779
|
+
}
|
|
2780
|
+
var PANEL_VERSION = true ? "v0.1.0" : "v?";
|
|
2781
|
+
function WorkspaceBody({ t, locale, navigate, chrome, sessionId, showHelp, bounded }) {
|
|
2782
|
+
useLocaleSync(locale);
|
|
2783
|
+
const { state, error, setError, reload } = useTakeoverPolling();
|
|
2784
|
+
const lang = langOf(locale);
|
|
2785
|
+
const [onboardGone, setOnboardGone] = (0, import_react.useState)(() => {
|
|
2786
|
+
try {
|
|
2787
|
+
return localStorage.getItem("dsh-takeover-onboard") === "1";
|
|
2788
|
+
} catch {
|
|
2789
|
+
return true;
|
|
2790
|
+
}
|
|
2791
|
+
});
|
|
2792
|
+
const [query, setQuery] = (0, import_react.useState)("");
|
|
2793
|
+
const [confirmClear, setConfirmClear] = (0, import_react.useState)(false);
|
|
2794
|
+
const [exportMenu, setExportMenu] = (0, import_react.useState)(false);
|
|
2795
|
+
const [takeBusyId, setTakeBusyId] = (0, import_react.useState)(null);
|
|
2796
|
+
const [view, setView] = (0, import_react.useState)(showHelp === true ? "guide" : "inbox");
|
|
2797
|
+
(0, import_react.useEffect)(() => {
|
|
2798
|
+
if (showHelp === true) setView("guide");
|
|
2799
|
+
}, [showHelp]);
|
|
2800
|
+
const uid = (0, import_react.useId)();
|
|
2801
|
+
const headId = (k) => `${uid}h-${k}`;
|
|
2802
|
+
const rootRef = (0, import_react.useRef)(null);
|
|
2803
|
+
const railRef = (0, import_react.useRef)(null);
|
|
2804
|
+
const filterRef = (0, import_react.useRef)(null);
|
|
2805
|
+
const focusFilter = () => {
|
|
2806
|
+
if (view === "inbox") {
|
|
2807
|
+
filterRef.current?.focus();
|
|
2808
|
+
filterRef.current?.select();
|
|
2809
|
+
return;
|
|
2810
|
+
}
|
|
2811
|
+
setView("inbox");
|
|
2812
|
+
window.setTimeout(() => {
|
|
2813
|
+
filterRef.current?.focus();
|
|
2814
|
+
filterRef.current?.select();
|
|
2815
|
+
}, 0);
|
|
2816
|
+
};
|
|
2817
|
+
const onRootKeyDown = (e) => {
|
|
2818
|
+
const cmdK = (e.metaKey || e.ctrlKey) && !e.altKey && (e.key === "k" || e.key === "K");
|
|
2819
|
+
if (cmdK) {
|
|
2820
|
+
e.preventDefault();
|
|
2821
|
+
e.stopPropagation();
|
|
2822
|
+
focusFilter();
|
|
2823
|
+
return;
|
|
2824
|
+
}
|
|
2825
|
+
if (e.key !== "/" || e.metaKey || e.ctrlKey || e.altKey) return;
|
|
2826
|
+
const el = e.target;
|
|
2827
|
+
const tag = el?.tagName ?? "";
|
|
2828
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || el?.isContentEditable === true) return;
|
|
2829
|
+
e.preventDefault();
|
|
2830
|
+
focusFilter();
|
|
2831
|
+
};
|
|
2832
|
+
const [clearBusy, setClearBusy] = (0, import_react.useState)(false);
|
|
2833
|
+
const [notice, setNotice] = (0, import_react.useState)(null);
|
|
2834
|
+
const noticeTimer = (0, import_react.useRef)(void 0);
|
|
2835
|
+
const showNotice = (msg) => {
|
|
2836
|
+
setNotice(msg);
|
|
2837
|
+
window.clearTimeout(noticeTimer.current);
|
|
2838
|
+
noticeTimer.current = window.setTimeout(() => setNotice(null), 8e3);
|
|
2839
|
+
};
|
|
2840
|
+
const takeInbox = (p) => {
|
|
2841
|
+
if (takeBusyId !== null) return;
|
|
2842
|
+
setTakeBusyId(p.id);
|
|
2843
|
+
void post("/dsh-takeover/takeover", { mode: "inbox", reference: p.id }).then((r) => {
|
|
2844
|
+
if (!r.ok) throw new Error(r.error);
|
|
2845
|
+
const switched = navigate(r.sessionId);
|
|
2846
|
+
showNotice(t(switched ? "deliveredNoticeNav" : "deliveredNotice", { title: r.title }));
|
|
2847
|
+
return void 0;
|
|
2848
|
+
}).catch((e) => setError(e instanceof Error ? e.message : String(e))).finally(() => setTakeBusyId(null));
|
|
2849
|
+
};
|
|
2850
|
+
const clear = () => {
|
|
2851
|
+
if (!confirmClear) {
|
|
2852
|
+
setConfirmClear(true);
|
|
2853
|
+
setTimeout(() => {
|
|
2854
|
+
setConfirmClear(false);
|
|
2855
|
+
}, 6e3);
|
|
2856
|
+
return;
|
|
2857
|
+
}
|
|
2858
|
+
setConfirmClear(false);
|
|
2859
|
+
setClearBusy(true);
|
|
2860
|
+
void post("/dsh-takeover/clear-archived", {}).then(() => {
|
|
2861
|
+
reload();
|
|
2862
|
+
}).catch((e) => {
|
|
2863
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
2864
|
+
}).finally(() => {
|
|
2865
|
+
setClearBusy(false);
|
|
2866
|
+
});
|
|
2867
|
+
};
|
|
2868
|
+
const [dismissBusyId, setDismissBusyId] = (0, import_react.useState)(null);
|
|
2869
|
+
const dismiss = (p) => {
|
|
2870
|
+
if (dismissBusyId !== null) return;
|
|
2871
|
+
setDismissBusyId(p.id);
|
|
2872
|
+
void post("/dsh-takeover/dismiss-pending", { id: p.id }).then((r) => {
|
|
2873
|
+
if (!r.ok) throw new Error(r.error);
|
|
2874
|
+
showNotice(t("dismissedNotice", { id: p.id }));
|
|
2875
|
+
reload();
|
|
2876
|
+
return void 0;
|
|
2877
|
+
}).catch((e) => setError(e instanceof Error ? e.message : String(e))).finally(() => setDismissBusyId(null));
|
|
2878
|
+
};
|
|
2879
|
+
const archivedCount = state?.archivedCount ?? 0;
|
|
2880
|
+
const envelopeChars = state !== null ? envelopeCharsOf(state) : null;
|
|
2881
|
+
const coverage = state !== null ? coverageTextOf(state) : null;
|
|
2882
|
+
const exportNotes = () => ({
|
|
2883
|
+
top: t("exportNoteTop"),
|
|
2884
|
+
missing: t("exportSectionMissing")
|
|
2885
|
+
});
|
|
2886
|
+
const exportOne = (p) => {
|
|
2887
|
+
try {
|
|
2888
|
+
downloadText(`${p.id}.md`, cardMarkdown(p, exportNotes()));
|
|
2889
|
+
} catch (e) {
|
|
2890
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
2891
|
+
}
|
|
2892
|
+
};
|
|
2893
|
+
const exportAll = () => {
|
|
2894
|
+
if (state === null || state.pending.length === 0) return;
|
|
2895
|
+
try {
|
|
2896
|
+
downloadText(`handoff-pending-${exportStamp()}.md`, pendingListMarkdown(state.pending, exportNotes()));
|
|
2897
|
+
} catch (e) {
|
|
2898
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
2899
|
+
}
|
|
2900
|
+
};
|
|
2901
|
+
const exportHtmlReport = () => {
|
|
2902
|
+
if (state === null) return;
|
|
2903
|
+
try {
|
|
2904
|
+
const d = /* @__PURE__ */ new Date();
|
|
2905
|
+
downloadText(
|
|
2906
|
+
`handoff-report-${exportStamp(d)}.html`,
|
|
2907
|
+
buildReportHtml(state, reportWords(lang), lang, absTime(d.toISOString())),
|
|
2908
|
+
"text/html;charset=utf-8"
|
|
2909
|
+
);
|
|
2910
|
+
} catch (e) {
|
|
2911
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
2912
|
+
}
|
|
2913
|
+
};
|
|
2914
|
+
const pendingCount = state?.pending.length ?? 0;
|
|
2915
|
+
const frontHome = state === null ? void 0 : [...state.providers].filter((p) => p.supported && p.enabled && p.sessions > 0).sort((a, b) => b.sessions - a.sessions)[0];
|
|
2916
|
+
const navItems = [
|
|
2917
|
+
{ k: "inbox", label: t("navInbox"), icon: NAV_ICONS.inbox, badge: state !== null ? pendingCount : void 0, hot: pendingCount > 0, badgeTitle: t("pendingDirHint") },
|
|
2918
|
+
{
|
|
2919
|
+
k: "browse",
|
|
2920
|
+
label: t("navBrowser"),
|
|
2921
|
+
icon: NAV_ICONS.browser,
|
|
2922
|
+
badge: frontHome?.sessions,
|
|
2923
|
+
badgeTitle: frontHome !== void 0 ? t("navBrowserBadgeTitle", { label: PROVIDER_LABEL[frontHome.name] ?? frontHome.name }) : void 0
|
|
2924
|
+
},
|
|
2925
|
+
{ k: "send", label: t("sendTitle"), icon: NAV_ICONS.send },
|
|
2926
|
+
{ k: "memory", label: t("memoryTitle"), icon: NAV_ICONS.memory }
|
|
2927
|
+
];
|
|
2928
|
+
const RAIL_ORDER = ["inbox", "browse", "send", "memory", "guide"];
|
|
2929
|
+
const onRailKeyDown = (e) => {
|
|
2930
|
+
const i = RAIL_ORDER.indexOf(view);
|
|
2931
|
+
const n = RAIL_ORDER.length;
|
|
2932
|
+
const next = e.key === "ArrowDown" ? RAIL_ORDER[(i + 1) % n] : e.key === "ArrowUp" ? RAIL_ORDER[(i - 1 + n) % n] : e.key === "Home" ? RAIL_ORDER[0] : e.key === "End" ? RAIL_ORDER[n - 1] : void 0;
|
|
2933
|
+
if (next === void 0) return;
|
|
2934
|
+
e.preventDefault();
|
|
2935
|
+
setView(next);
|
|
2936
|
+
railRef.current?.querySelector(`[data-view="${next}"]`)?.focus();
|
|
2937
|
+
};
|
|
2938
|
+
const navButton = (item) => (0, import_react.createElement)(
|
|
2939
|
+
"button",
|
|
2940
|
+
{
|
|
2941
|
+
key: item.k,
|
|
2942
|
+
className: "tk-navitem",
|
|
2943
|
+
type: "button",
|
|
2944
|
+
"data-view": item.k,
|
|
2945
|
+
"aria-pressed": view === item.k,
|
|
2946
|
+
onClick: () => setView(item.k)
|
|
2947
|
+
},
|
|
2948
|
+
(0, import_react.createElement)("span", { className: "tk-ic", "aria-hidden": true, dangerouslySetInnerHTML: { __html: item.icon } }),
|
|
2949
|
+
(0, import_react.createElement)("span", { className: "tk-navlabel" }, item.label),
|
|
2950
|
+
item.badge !== void 0 ? (0, import_react.createElement)("span", { className: `tk-badge${item.hot === true ? " tk-badge-hot" : ""}`, title: item.badgeTitle }, String(item.badge)) : null
|
|
2951
|
+
);
|
|
2952
|
+
const head = (k, title, sub, actions) => (0, import_react.createElement)(
|
|
2953
|
+
"div",
|
|
2954
|
+
{ className: "tk-head" },
|
|
2955
|
+
(0, import_react.createElement)(
|
|
2956
|
+
"div",
|
|
2957
|
+
{ className: "tk-head-text" },
|
|
2958
|
+
(0, import_react.createElement)("h2", { className: "tk-h", id: headId(k) }, title),
|
|
2959
|
+
(0, import_react.createElement)("p", { className: "tk-p" }, sub)
|
|
2960
|
+
),
|
|
2961
|
+
actions.some((a) => a !== null) ? (0, import_react.createElement)("div", { className: "tk-head-acts" }, ...actions) : null
|
|
2962
|
+
);
|
|
2963
|
+
const stripNodes = [
|
|
2964
|
+
error !== null ? (0, import_react.createElement)("div", { key: "err", className: "bt-banner bt-banner-err" }, error) : null,
|
|
2965
|
+
notice !== null ? (0, import_react.createElement)("div", { key: "notice", className: "bt-banner bt-banner-info" }, notice) : null,
|
|
2966
|
+
// 新手三步引导条(仅浮层挂载;「知道了」后 localStorage 记住不再出现)
|
|
2967
|
+
bounded === true && onboardGone === false ? (0, import_react.createElement)(
|
|
2968
|
+
"div",
|
|
2969
|
+
{ key: "onboard", className: "bt-card", style: { borderColor: "var(--bt-a)" } },
|
|
2970
|
+
(0, import_react.createElement)(
|
|
2971
|
+
"div",
|
|
2972
|
+
{ style: { display: "grid", gap: 4, fontSize: 12 } },
|
|
2973
|
+
(0, import_react.createElement)("span", { style: { fontWeight: 600 } }, t("popoverSubtitle")),
|
|
2974
|
+
(0, import_react.createElement)("span", null, `\u2460 ${t("onboard1")} \u2192 \u2461 ${t("onboard2")} \u2192 \u2462 ${t("onboard3")}`)
|
|
2975
|
+
),
|
|
2976
|
+
(0, import_react.createElement)(
|
|
2977
|
+
"div",
|
|
2978
|
+
{ style: { display: "flex", justifyContent: "flex-end", marginTop: 6 } },
|
|
2979
|
+
(0, import_react.createElement)("button", {
|
|
2980
|
+
className: "bt-btn bt-btn-xs",
|
|
2981
|
+
onClick: () => {
|
|
2982
|
+
setOnboardGone(true);
|
|
2983
|
+
try {
|
|
2984
|
+
localStorage.setItem("dsh-takeover-onboard", "1");
|
|
2985
|
+
} catch {
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
}, t("onboardDone"))
|
|
2989
|
+
)
|
|
2990
|
+
) : null
|
|
2991
|
+
];
|
|
2992
|
+
const strips = stripNodes.some((n) => n !== null) ? (0, import_react.createElement)("div", { className: "tk-strips" }, ...stripNodes) : null;
|
|
2993
|
+
const section = (k, title, sub, actions, body) => (0, import_react.createElement)(
|
|
2994
|
+
"section",
|
|
2995
|
+
{
|
|
2996
|
+
key: k,
|
|
2997
|
+
className: `tk-view${view === k ? " tk-view-on" : ""}${k === "guide" ? " tk-view-guide" : ""}`,
|
|
2998
|
+
"data-v": k,
|
|
2999
|
+
"aria-labelledby": headId(k),
|
|
3000
|
+
hidden: view !== k
|
|
3001
|
+
},
|
|
3002
|
+
head(k, title, sub, actions),
|
|
3003
|
+
view === k ? strips : null,
|
|
3004
|
+
(0, import_react.createElement)("div", { className: "tk-scroll" }, ...body)
|
|
3005
|
+
);
|
|
3006
|
+
const tile = (key, value, label, color, tone, title) => (0, import_react.createElement)(
|
|
3007
|
+
"div",
|
|
3008
|
+
{ key, className: `tk-tile${tone !== "" ? ` tk-tile-${tone}` : ""}`, style: { "--tk-tc": color }, title },
|
|
3009
|
+
(0, import_react.createElement)("span", { className: "tk-tile-lab" }, label),
|
|
3010
|
+
" ",
|
|
3011
|
+
(0, import_react.createElement)("b", { className: "tk-tile-num" }, value)
|
|
3012
|
+
);
|
|
3013
|
+
const rejected = rejectionCount(state);
|
|
3014
|
+
const tiles = state === null ? null : (0, import_react.createElement)(
|
|
3015
|
+
"div",
|
|
3016
|
+
{ className: "tk-tiles" },
|
|
3017
|
+
tile("pending", String(state.pending.length), t("tilePending"), "var(--tk-a)", "", t("pendingDirHint")),
|
|
3018
|
+
tile("archived", String(archivedCount), t("tileArchived"), "var(--tk-ok)", "", t("archivedDirHint")),
|
|
3019
|
+
coverage !== null ? tile("coverage", coverage, t("tileCoverage"), "var(--tk-ok)", "ok", t("coverageBadgeTitle")) : null,
|
|
3020
|
+
envelopeChars !== null ? tile("envelope", humanChars(envelopeChars), t("tileEnvelope"), "var(--tk-a2)", "", t("envelopeArchivedTitle", { n: envelopeChars })) : null,
|
|
3021
|
+
tile(
|
|
3022
|
+
"rejected",
|
|
3023
|
+
String(rejected),
|
|
3024
|
+
t("tileRejected"),
|
|
3025
|
+
"var(--tk-err)",
|
|
3026
|
+
rejected > 0 ? "err" : "",
|
|
3027
|
+
rejected > 0 ? `${t("rejectionsTitle")}\uFF1B${rejectionTitle(state)}` : t("rejectionsTitle")
|
|
3028
|
+
),
|
|
3029
|
+
(state.pendingDuplicates ?? 0) > 0 ? tile("dup", String(state.pendingDuplicates), t("tileDup"), "var(--tk-warn)", "warn", t("pendingDupTitle")) : null
|
|
3030
|
+
);
|
|
3031
|
+
const inboxActions = [
|
|
3032
|
+
state !== null ? (0, import_react.createElement)("input", {
|
|
3033
|
+
key: "filter",
|
|
3034
|
+
ref: filterRef,
|
|
3035
|
+
className: "bt-filter",
|
|
3036
|
+
type: "search",
|
|
3037
|
+
value: query,
|
|
3038
|
+
placeholder: t("filterPlaceholder"),
|
|
3039
|
+
"aria-label": t("filterAria"),
|
|
3040
|
+
// 快捷键写进 title(可发现性,§7 DON'T「为极简砍可发现性」)
|
|
3041
|
+
title: `${t("filterAria")} \xB7 ${t("filterShortcut")}`,
|
|
3042
|
+
onChange: (e) => {
|
|
3043
|
+
setQuery(e.target.value);
|
|
3044
|
+
},
|
|
3045
|
+
// 有字时 Escape 先清空并截断(各浏览器一致,不靠 Chrome 的 search 原生清空);
|
|
3046
|
+
// 清空后再按 Escape 才冒泡到浮层壳去关闭(DESIGN.md §5 模态契约)
|
|
3047
|
+
onKeyDown: (e) => {
|
|
3048
|
+
if (e.key === "Escape" && query !== "") {
|
|
3049
|
+
e.preventDefault();
|
|
3050
|
+
e.stopPropagation();
|
|
3051
|
+
setQuery("");
|
|
3052
|
+
}
|
|
3053
|
+
}
|
|
3054
|
+
}) : null,
|
|
3055
|
+
(0, import_react.createElement)("button", {
|
|
3056
|
+
key: "clear",
|
|
3057
|
+
className: `bt-btn bt-btn-danger${confirmClear ? " bt-btn-confirm" : ""}`,
|
|
3058
|
+
disabled: clearBusy || takeBusyId !== null || archivedCount === 0,
|
|
3059
|
+
onClick: clear,
|
|
3060
|
+
title: t("clearArchivedTitle")
|
|
3061
|
+
}, confirmClear ? t("clearConfirm", { n: archivedCount }) : t("clearArchived")),
|
|
3062
|
+
state !== null ? (0, import_react.createElement)(
|
|
3063
|
+
"div",
|
|
3064
|
+
{ key: "export", className: "bt-export-wrap" },
|
|
3065
|
+
(0, import_react.createElement)("button", {
|
|
3066
|
+
className: "bt-btn",
|
|
3067
|
+
disabled: state.pending.length === 0,
|
|
3068
|
+
"aria-haspopup": "menu",
|
|
3069
|
+
"aria-expanded": exportMenu,
|
|
3070
|
+
onClick: () => setExportMenu((v) => !v),
|
|
3071
|
+
title: t("exportMenuAria")
|
|
3072
|
+
}, t("exportMenu")),
|
|
3073
|
+
exportMenu ? (0, import_react.createElement)("div", {
|
|
3074
|
+
className: "bt-export-mask",
|
|
3075
|
+
onClick: () => setExportMenu(false)
|
|
3076
|
+
}) : null,
|
|
3077
|
+
exportMenu ? (0, import_react.createElement)(
|
|
3078
|
+
"div",
|
|
3079
|
+
{ className: "bt-export-menu", role: "menu" },
|
|
3080
|
+
(0, import_react.createElement)("button", {
|
|
3081
|
+
className: "bt-export-item",
|
|
3082
|
+
role: "menuitem",
|
|
3083
|
+
disabled: state.pending.length === 0,
|
|
3084
|
+
onClick: () => {
|
|
3085
|
+
setExportMenu(false);
|
|
3086
|
+
exportAll();
|
|
3087
|
+
},
|
|
3088
|
+
title: t("exportAllTitle")
|
|
3089
|
+
}, t("exportAll")),
|
|
3090
|
+
(0, import_react.createElement)("button", {
|
|
3091
|
+
className: "bt-export-item",
|
|
3092
|
+
role: "menuitem",
|
|
3093
|
+
onClick: () => {
|
|
3094
|
+
setExportMenu(false);
|
|
3095
|
+
exportHtmlReport();
|
|
3096
|
+
},
|
|
3097
|
+
title: t("exportHtmlTitle")
|
|
3098
|
+
}, t("exportHtml"))
|
|
3099
|
+
) : null
|
|
3100
|
+
) : null
|
|
3101
|
+
];
|
|
3102
|
+
const inboxBody = [
|
|
3103
|
+
tiles,
|
|
3104
|
+
state !== null ? (0, import_react.createElement)(PendingList, {
|
|
3105
|
+
rows: state.pending,
|
|
3106
|
+
query,
|
|
3107
|
+
home: state.home,
|
|
3108
|
+
t,
|
|
3109
|
+
lang,
|
|
3110
|
+
onExport: exportOne,
|
|
3111
|
+
onChainFilter: (id) => {
|
|
3112
|
+
setQuery(id);
|
|
3113
|
+
},
|
|
3114
|
+
onTakeInbox: takeInbox,
|
|
3115
|
+
takeBusyId,
|
|
3116
|
+
onDismiss: dismiss,
|
|
3117
|
+
dismissBusyId
|
|
3118
|
+
}) : (0, import_react.createElement)(
|
|
3119
|
+
"div",
|
|
3120
|
+
{ style: { display: "grid", gap: 8, padding: "4px 0" } },
|
|
3121
|
+
(0, import_react.createElement)("div", { className: "bt-skeleton", style: { width: "100%" } }),
|
|
3122
|
+
(0, import_react.createElement)("div", { className: "bt-skeleton", style: { width: "70%" } }),
|
|
3123
|
+
(0, import_react.createElement)("div", { className: "bt-skeleton", style: { width: "45%" } })
|
|
3124
|
+
)
|
|
3125
|
+
];
|
|
3126
|
+
return (0, import_react.createElement)(
|
|
3127
|
+
"div",
|
|
3128
|
+
{ className: `bt-panel${bounded === true ? " bt-bounded" : ""}`, style: themeVars(true), ref: rootRef, onKeyDown: onRootKeyDown },
|
|
3129
|
+
(0, import_react.createElement)("style", null, CSS),
|
|
3130
|
+
// 右侧栏挂载时的 slim 头卡:标识 + 手动刷新(设置卡内嵌时头卡由 Panel 提供)
|
|
3131
|
+
chrome ? (0, import_react.createElement)(
|
|
3132
|
+
"div",
|
|
3133
|
+
{ className: "bt-card" },
|
|
3134
|
+
(0, import_react.createElement)(
|
|
3135
|
+
"div",
|
|
3136
|
+
{ className: "bt-head" },
|
|
3137
|
+
(0, import_react.createElement)("span", { className: "bt-logo", dangerouslySetInnerHTML: { __html: ICON_SVG } }),
|
|
3138
|
+
(0, import_react.createElement)("span", { className: "bt-title-sec" }, t("sidebarTabTitle")),
|
|
3139
|
+
(0, import_react.createElement)("span", { className: "bt-spacer" }),
|
|
3140
|
+
(0, import_react.createElement)("button", { className: "bt-btn", onClick: reload }, t("refresh"))
|
|
3141
|
+
)
|
|
3142
|
+
) : null,
|
|
3143
|
+
// 工作台本体:左导航轨 148px + 右侧全宽视图(DESIGN.md §5,两栏拼盘废除)
|
|
3144
|
+
(0, import_react.createElement)(
|
|
3145
|
+
"div",
|
|
3146
|
+
{ className: "tk-body" },
|
|
3147
|
+
(0, import_react.createElement)(
|
|
3148
|
+
"nav",
|
|
3149
|
+
{ className: "tk-rail", "aria-label": t("navAria"), ref: railRef, onKeyDown: onRailKeyDown },
|
|
3150
|
+
(0, import_react.createElement)(
|
|
3151
|
+
"div",
|
|
3152
|
+
{ className: "tk-brand" },
|
|
3153
|
+
(0, import_react.createElement)("span", { className: "tk-brand-logo", "aria-hidden": true, dangerouslySetInnerHTML: { __html: ICON_SVG } }),
|
|
3154
|
+
(0, import_react.createElement)("b", null, t("sidebarTabTitle"))
|
|
3155
|
+
),
|
|
3156
|
+
...navItems.map(navButton),
|
|
3157
|
+
(0, import_react.createElement)(
|
|
3158
|
+
"div",
|
|
3159
|
+
{ className: "tk-rail-foot" },
|
|
3160
|
+
(0, import_react.createElement)(
|
|
3161
|
+
"button",
|
|
3162
|
+
{
|
|
3163
|
+
className: "tk-navitem",
|
|
3164
|
+
type: "button",
|
|
3165
|
+
"data-view": "guide",
|
|
3166
|
+
"aria-pressed": view === "guide",
|
|
3167
|
+
onClick: () => setView("guide"),
|
|
3168
|
+
title: t("helpTitle")
|
|
3169
|
+
},
|
|
3170
|
+
(0, import_react.createElement)("span", { className: "tk-ic", "aria-hidden": true, dangerouslySetInnerHTML: { __html: HELP_SVG } }),
|
|
3171
|
+
(0, import_react.createElement)("span", { className: "tk-navlabel" }, t("navGuide"))
|
|
3172
|
+
),
|
|
3173
|
+
(0, import_react.createElement)("div", { className: "tk-ver", title: t("versionTitle") }, `dsh-takeover ${PANEL_VERSION}`)
|
|
3174
|
+
)
|
|
3175
|
+
),
|
|
3176
|
+
(0, import_react.createElement)(
|
|
3177
|
+
"div",
|
|
3178
|
+
{ className: "tk-main" },
|
|
3179
|
+
section("inbox", t("inboxTitle"), t("viewInboxSub", { n: state?.pending.length ?? "\u2026" }), inboxActions, inboxBody),
|
|
3180
|
+
// 浏览窗格 bare+active 自动前置会话最多的可用家(内容默认可见,空态从此不存在)
|
|
3181
|
+
section("browse", t("browserTitle"), t("browserHint"), [], [
|
|
3182
|
+
(0, import_react.createElement)(ForeignBrowser, { state, t, lang, onError: (msg) => setError(msg), onNotice: showNotice, navigate, bare: true, active: view === "browse" })
|
|
3183
|
+
]),
|
|
3184
|
+
section("send", t("sendTitle"), sessionId !== void 0 && sessionId !== "" ? t("sendHint") : t("sendHintCopy"), [], [
|
|
3185
|
+
(0, import_react.createElement)(SendCard, { sessionId, t, lang, onError: (msg) => setError(msg), onNotice: showNotice, bare: true })
|
|
3186
|
+
]),
|
|
3187
|
+
section("memory", t("memoryTitle"), t("viewMemorySub"), [], [
|
|
3188
|
+
(0, import_react.createElement)(MemoryCard, { t, lang, onError: (msg) => setError(msg), onNotice: showNotice, onPushed: reload, bare: true, defaultOpen: true, active: view === "memory" })
|
|
3189
|
+
]),
|
|
3190
|
+
// 上手指南:轨底按钮唤出的第五视图(无状态,按需渲染;展开体不嵌卡片底色,见 .tk-view-guide)
|
|
3191
|
+
view === "guide" ? section("guide", t("helpTitle"), t("popoverSubtitle"), [], [(0, import_react.createElement)(HelpCard, { t })]) : null
|
|
3192
|
+
)
|
|
3193
|
+
)
|
|
3194
|
+
);
|
|
3195
|
+
}
|
|
3196
|
+
function ComposerChip({ t, locale, navigate, sessionId }) {
|
|
3197
|
+
useLocaleSync(locale);
|
|
3198
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
3199
|
+
const chipRef = (0, import_react.useRef)(null);
|
|
3200
|
+
const dialogRef = (0, import_react.useRef)(null);
|
|
3201
|
+
const [pos, setPos] = (0, import_react.useState)(null);
|
|
3202
|
+
const measure = () => {
|
|
3203
|
+
if (typeof window === "undefined" || typeof window.innerHeight !== "number") return;
|
|
3204
|
+
const vw = window.innerWidth;
|
|
3205
|
+
const vh = window.innerHeight;
|
|
3206
|
+
const width = vw >= 1600 ? Math.min(1180, vw - 48) : vw >= 1200 ? Math.min(1040, vw - 48) : Math.max(360, Math.min(720, vw - 16));
|
|
3207
|
+
setPos({ width, maxH: Math.max(240, vh - 32) });
|
|
3208
|
+
};
|
|
3209
|
+
(0, import_react.useEffect)(() => {
|
|
3210
|
+
if (!open) return;
|
|
3211
|
+
const onRe = () => {
|
|
3212
|
+
measure();
|
|
3213
|
+
};
|
|
3214
|
+
window.addEventListener("resize", onRe);
|
|
3215
|
+
return () => {
|
|
3216
|
+
window.removeEventListener("resize", onRe);
|
|
3217
|
+
};
|
|
3218
|
+
}, [open]);
|
|
3219
|
+
(0, import_react.useEffect)(() => {
|
|
3220
|
+
if (!open) return;
|
|
3221
|
+
const dlg = dialogRef.current;
|
|
3222
|
+
if (dlg === null) return;
|
|
3223
|
+
const focusables = () => [...dlg.querySelectorAll("a[href], button, input, select, textarea, [tabindex]")].filter((el) => !el.disabled && el.getAttribute("tabindex") !== "-1" && el.closest("[hidden]") === null);
|
|
3224
|
+
const t0 = window.setTimeout(() => {
|
|
3225
|
+
const first = dlg.querySelector('.tk-navitem[aria-pressed="true"]') ?? dlg.querySelector(".tk-close");
|
|
3226
|
+
first?.focus();
|
|
3227
|
+
}, 0);
|
|
3228
|
+
const onKey = (e) => {
|
|
3229
|
+
if (e.key === "Escape") {
|
|
3230
|
+
if (e.defaultPrevented) return;
|
|
3231
|
+
e.preventDefault();
|
|
3232
|
+
setOpen(false);
|
|
3233
|
+
return;
|
|
3234
|
+
}
|
|
3235
|
+
if (e.key !== "Tab") return;
|
|
3236
|
+
const list = focusables();
|
|
3237
|
+
if (list.length === 0) return;
|
|
3238
|
+
const first = list[0];
|
|
3239
|
+
const last = list[list.length - 1];
|
|
3240
|
+
const active = document.activeElement;
|
|
3241
|
+
const inside = active !== null && dlg.contains(active);
|
|
3242
|
+
if (e.shiftKey) {
|
|
3243
|
+
if (!inside || active === first) {
|
|
3244
|
+
e.preventDefault();
|
|
3245
|
+
last.focus();
|
|
3246
|
+
}
|
|
3247
|
+
} else if (!inside || active === last) {
|
|
3248
|
+
e.preventDefault();
|
|
3249
|
+
first.focus();
|
|
3250
|
+
}
|
|
3251
|
+
};
|
|
3252
|
+
document.addEventListener("keydown", onKey);
|
|
3253
|
+
return () => {
|
|
3254
|
+
window.clearTimeout(t0);
|
|
3255
|
+
document.removeEventListener("keydown", onKey);
|
|
3256
|
+
chipRef.current?.focus();
|
|
3257
|
+
};
|
|
3258
|
+
}, [open]);
|
|
3259
|
+
return (0, import_react.createElement)(
|
|
3260
|
+
"div",
|
|
3261
|
+
{ style: { position: "relative", display: "inline-flex" } },
|
|
3262
|
+
// ghost 样式对齐宿主 composer 原生控件(无边框/次级标签色/悬停浅底),
|
|
3263
|
+
// 颜色直接吃宿主 dsw alias 变量;<style> 就地注入——chip 挂载点在
|
|
3264
|
+
// WorkspaceBody 之外,收起态没有面板的 style 块可用
|
|
3265
|
+
(0, import_react.createElement)("style", null, '.bt-chip{display:inline-flex;align-items:center;gap:5px;background:transparent;color:var(--dsw-alias-label-secondary,inherit);border:none;cursor:pointer;font-size:13px;font-family:inherit;padding:5px 8px;border-radius:8px;transition:background-color .1s;line-height:1}.bt-chip:hover,.bt-chip[data-open="true"]{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.14))}.bt-chip svg{width:13px;height:13px;display:block}'),
|
|
3266
|
+
(0, import_react.createElement)(
|
|
3267
|
+
"button",
|
|
3268
|
+
{
|
|
3269
|
+
className: "bt-chip",
|
|
3270
|
+
"data-open": String(open),
|
|
3271
|
+
ref: chipRef,
|
|
3272
|
+
onClick: () => {
|
|
3273
|
+
if (!open) measure();
|
|
3274
|
+
setOpen((v) => !v);
|
|
3275
|
+
},
|
|
3276
|
+
title: t("sidebarTabDesc")
|
|
3277
|
+
},
|
|
3278
|
+
(0, import_react.createElement)("span", {
|
|
3279
|
+
style: { width: 13, height: 13, display: "inline-block", opacity: 0.9 },
|
|
3280
|
+
dangerouslySetInnerHTML: { __html: ICON_SVG }
|
|
3281
|
+
}),
|
|
3282
|
+
t("sidebarTabTitle")
|
|
3283
|
+
),
|
|
3284
|
+
open ? (0, import_react.createElement)("div", {
|
|
3285
|
+
style: { position: "fixed", inset: 0, zIndex: 9998, background: "rgba(0,0,0,.32)" },
|
|
3286
|
+
onClick: () => setOpen(false)
|
|
3287
|
+
}) : null,
|
|
3288
|
+
open ? (0, import_react.createElement)(
|
|
3289
|
+
"div",
|
|
3290
|
+
{
|
|
3291
|
+
ref: dialogRef,
|
|
3292
|
+
role: "dialog",
|
|
3293
|
+
"aria-modal": true,
|
|
3294
|
+
"aria-label": t("popoverTitle"),
|
|
3295
|
+
style: {
|
|
3296
|
+
// DESIGN.md §2/§6 token 行内展开:壳在 .bt-panel 的 <style> 作用域之外,
|
|
3297
|
+
// var(--tk-*) 要在这一层可解析(同一份 TK_TOKENS,不另写色值)
|
|
3298
|
+
...TK_TOKENS,
|
|
3299
|
+
position: "fixed",
|
|
3300
|
+
zIndex: 9999,
|
|
3301
|
+
boxSizing: "border-box",
|
|
3302
|
+
// maxHeight 必须含 padding+border,否则矮窗仍溢出视口(实测 583>568)
|
|
3303
|
+
// 视口居中模态(inset:0 + margin:auto + fit-content:双轴居中,maxHeight
|
|
3304
|
+
// 受尊重且与宿主滚动完全解耦——不再锚定 chip 位置)
|
|
3305
|
+
inset: 0,
|
|
3306
|
+
margin: "auto",
|
|
3307
|
+
height: "fit-content",
|
|
3308
|
+
// 整体不滚(overflow hidden):滚动责任下沉到 .bt-bounded/.tk-scroll——
|
|
3309
|
+
// 导航轨与视图头常驻,视图体内滚
|
|
3310
|
+
display: "flex",
|
|
3311
|
+
flexDirection: "column",
|
|
3312
|
+
overflow: "hidden",
|
|
3313
|
+
...pos !== null ? { width: pos.width, maxHeight: pos.maxH } : { width: "min(1040px, calc(100vw - 16px))", maxHeight: "70vh" },
|
|
3314
|
+
// 壳 = canvas 近黑画布 + 顶部品牌径向辉光(§2);line 描边;唯一投影(§6)
|
|
3315
|
+
background: "var(--tk-canvas-bg)",
|
|
3316
|
+
color: "var(--tk-text)",
|
|
3317
|
+
border: "1px solid var(--tk-line)",
|
|
3318
|
+
borderRadius: 16,
|
|
3319
|
+
boxShadow: "var(--tk-shadow), inset 0 1px 0 rgba(255,255,255,.05)",
|
|
3320
|
+
padding: 0
|
|
3321
|
+
}
|
|
3322
|
+
},
|
|
3323
|
+
// 顶边 3px 品牌渐变条(模态身份标识,保留)
|
|
3324
|
+
(0, import_react.createElement)("div", { "aria-hidden": true, style: { height: 3, flex: "none", background: "var(--tk-edge-grad)", opacity: 0.9 } }),
|
|
3325
|
+
// dialog 可及名的可见落点:壳内可见文字只剩导航轨「接力」,完整标题走读屏专用节点
|
|
3326
|
+
(0, import_react.createElement)("h2", { className: "tk-sr" }, t("popoverTitle")),
|
|
3327
|
+
(0, import_react.createElement)("button", {
|
|
3328
|
+
className: "tk-close",
|
|
3329
|
+
type: "button",
|
|
3330
|
+
onClick: () => setOpen(false),
|
|
3331
|
+
"aria-label": "close",
|
|
3332
|
+
title: t("closeBtn")
|
|
3333
|
+
}, "\u2715"),
|
|
3334
|
+
(0, import_react.createElement)(PanelBoundary, {
|
|
3335
|
+
t,
|
|
3336
|
+
// 这层包装是壳与 bt-bounded 之间的 flex 中继:不给 flex:1/minHeight:0 的话
|
|
3337
|
+
// 默认 min-height:auto 挡住收缩链,bt-bounded 撑到内容高,视图体内滚失效(真机实测)
|
|
3338
|
+
children: (0, import_react.createElement)(
|
|
3339
|
+
"div",
|
|
3340
|
+
{ style: { display: "flex", flexDirection: "column", flex: "1 1 auto", minHeight: 0, overflow: "hidden" } },
|
|
3341
|
+
(0, import_react.createElement)(WorkspaceBody, { t, locale, navigate, chrome: false, sessionId, bounded: true })
|
|
3342
|
+
)
|
|
3343
|
+
})
|
|
3344
|
+
) : null
|
|
3345
|
+
);
|
|
3346
|
+
}
|
|
3347
|
+
var SETTINGS_TABS = ["cmds", "matrix", "sem"];
|
|
3348
|
+
function Panel({ t, locale, navigate, slim }) {
|
|
3349
|
+
useLocaleSync(locale);
|
|
3350
|
+
const { state, setState, error, setError, reload, generationRef } = useTakeoverPolling();
|
|
3351
|
+
const [busy, setBusy] = (0, import_react.useState)(null);
|
|
3352
|
+
const [showHelp, setShowHelp] = (0, import_react.useState)(false);
|
|
3353
|
+
const [tab, setTab] = (0, import_react.useState)("cmds");
|
|
3354
|
+
const uid = (0, import_react.useId)();
|
|
3355
|
+
const panelRef = (0, import_react.useRef)(null);
|
|
3356
|
+
const tabsRef = (0, import_react.useRef)(null);
|
|
3357
|
+
const toggle = (name, enabled) => {
|
|
3358
|
+
setBusy(name);
|
|
3359
|
+
const gen = ++generationRef.current;
|
|
3360
|
+
void post("/dsh-takeover/provider", { provider: name, enabled }).then((r) => {
|
|
3361
|
+
if (gen !== generationRef.current) return;
|
|
3362
|
+
setState(r.state);
|
|
3363
|
+
setError(null);
|
|
3364
|
+
}).catch((e) => {
|
|
3365
|
+
if (gen !== generationRef.current) return;
|
|
3366
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
3367
|
+
}).finally(() => {
|
|
3368
|
+
setBusy(null);
|
|
3369
|
+
});
|
|
3370
|
+
};
|
|
3371
|
+
const tabId = (k) => `${uid}tab-${k}`;
|
|
3372
|
+
const paneId = (k) => `${uid}pane-${k}`;
|
|
3373
|
+
const tabLabel = { cmds: t("tabCmds"), matrix: t("tabMatrix"), sem: t("tabSemantics") };
|
|
3374
|
+
const onTabsKeyDown = (e) => {
|
|
3375
|
+
const i = SETTINGS_TABS.indexOf(tab);
|
|
3376
|
+
const n = SETTINGS_TABS.length;
|
|
3377
|
+
const next = e.key === "ArrowRight" ? SETTINGS_TABS[(i + 1) % n] : e.key === "ArrowLeft" ? SETTINGS_TABS[(i - 1 + n) % n] : e.key === "Home" ? SETTINGS_TABS[0] : e.key === "End" ? SETTINGS_TABS[n - 1] : void 0;
|
|
3378
|
+
if (next === void 0) return;
|
|
3379
|
+
e.preventDefault();
|
|
3380
|
+
setTab(next);
|
|
3381
|
+
tabsRef.current?.querySelector(`[data-tab="${next}"]`)?.focus();
|
|
3382
|
+
};
|
|
3383
|
+
const pane = (k, ...body) => (0, import_react.createElement)("div", {
|
|
3384
|
+
key: k,
|
|
3385
|
+
id: paneId(k),
|
|
3386
|
+
className: `tk-pane${tab === k ? " tk-pane-on" : ""}`,
|
|
3387
|
+
role: "tabpanel",
|
|
3388
|
+
"aria-labelledby": tabId(k),
|
|
3389
|
+
hidden: tab !== k
|
|
3390
|
+
}, ...body);
|
|
3391
|
+
return (0, import_react.createElement)(
|
|
3392
|
+
"div",
|
|
3393
|
+
{ className: "bt-panel", ref: panelRef, style: themeVars() },
|
|
3394
|
+
(0, import_react.createElement)("style", null, CSS),
|
|
3395
|
+
// 设置卡本体(DESIGN.md §4 / 原型窗口 2):自铺近黑画布的指挥台块;--bt-* 行内恒走暗轴
|
|
3396
|
+
// (浅色宿主页里不翻白,同工作台内嵌处理)。头行 = 标识 + 分段器 + [?]/刷新;下接三段页签面板
|
|
3397
|
+
(0, import_react.createElement)(
|
|
3398
|
+
"div",
|
|
3399
|
+
{ className: "tk-set", style: themeVars(true) },
|
|
3400
|
+
(0, import_react.createElement)(
|
|
3401
|
+
"div",
|
|
3402
|
+
{ className: "tk-set-head" },
|
|
3403
|
+
(0, import_react.createElement)("span", { className: "tk-set-logo", "aria-hidden": true, dangerouslySetInnerHTML: { __html: ICON_SVG } }),
|
|
3404
|
+
(0, import_react.createElement)(
|
|
3405
|
+
"span",
|
|
3406
|
+
{ className: "tk-set-text" },
|
|
3407
|
+
(0, import_react.createElement)("div", { className: "tk-set-title" }, t("appTitle")),
|
|
3408
|
+
(0, import_react.createElement)("div", { className: "tk-set-sub", title: t("appSubtitle") }, t("appSubtitle"))
|
|
3409
|
+
),
|
|
3410
|
+
// 分段器(3px 内距容器 + 7px 圆角页签,选中品牌渐变):button[role=tab] + aria-selected/aria-controls
|
|
3411
|
+
(0, import_react.createElement)(
|
|
3412
|
+
"div",
|
|
3413
|
+
{ className: "tk-tabs", role: "tablist", "aria-label": t("tabsAria"), ref: tabsRef, onKeyDown: onTabsKeyDown },
|
|
3414
|
+
...SETTINGS_TABS.map((k) => (0, import_react.createElement)("button", {
|
|
3415
|
+
key: k,
|
|
3416
|
+
id: tabId(k),
|
|
3417
|
+
className: "tk-tab",
|
|
3418
|
+
type: "button",
|
|
3419
|
+
role: "tab",
|
|
3420
|
+
"data-tab": k,
|
|
3421
|
+
"aria-selected": tab === k,
|
|
3422
|
+
"aria-controls": paneId(k),
|
|
3423
|
+
tabIndex: tab === k ? 0 : -1,
|
|
3424
|
+
onClick: () => {
|
|
3425
|
+
setTab(k);
|
|
3426
|
+
}
|
|
3427
|
+
}, tabLabel[k]))
|
|
3428
|
+
),
|
|
3429
|
+
(0, import_react.createElement)(
|
|
3430
|
+
"span",
|
|
3431
|
+
{ className: "tk-set-acts" },
|
|
3432
|
+
(0, import_react.createElement)("button", {
|
|
3433
|
+
className: `bt-btn bt-btn-xs${showHelp ? " bt-chip-on" : ""}`,
|
|
3434
|
+
type: "button",
|
|
3435
|
+
// 同浮层 [?]:打开时把帮助卡滚进视口,长页面里否则看不见变化
|
|
3436
|
+
onClick: () => {
|
|
3437
|
+
const next = !showHelp;
|
|
3438
|
+
setShowHelp(next);
|
|
3439
|
+
if (next) {
|
|
3440
|
+
window.setTimeout(() => {
|
|
3441
|
+
panelRef.current?.querySelector("[data-help-card]")?.scrollIntoView({ block: "start" });
|
|
3442
|
+
}, 0);
|
|
3443
|
+
}
|
|
3444
|
+
},
|
|
3445
|
+
"aria-label": "help",
|
|
3446
|
+
title: t("helpTitle"),
|
|
3447
|
+
style: { minWidth: 26 }
|
|
3448
|
+
}, "?"),
|
|
3449
|
+
(0, import_react.createElement)("button", { className: "bt-btn", type: "button", onClick: reload, disabled: busy !== null }, t("refresh"))
|
|
3450
|
+
)
|
|
3451
|
+
),
|
|
3452
|
+
error !== null ? (0, import_react.createElement)("div", { className: "bt-banner bt-banner-err" }, error) : null,
|
|
3453
|
+
// 命令速览:数据源不变(/handoff · /inbox · /resume-*),mono 键 + 说明文案
|
|
3454
|
+
pane(
|
|
3455
|
+
"cmds",
|
|
3456
|
+
(0, import_react.createElement)("div", { className: "tk-pane-lead" }, t("cmdBadge")),
|
|
3457
|
+
(0, import_react.createElement)(CommandsGrid, { state, t })
|
|
3458
|
+
),
|
|
3459
|
+
// 支持矩阵(九家读取器)
|
|
3460
|
+
pane(
|
|
3461
|
+
"matrix",
|
|
3462
|
+
state !== null ? (0, import_react.createElement)(ProviderMatrix, { rows: state.providers, busy, onToggle: toggle, t }) : (0, import_react.createElement)("div", { className: "bt-sub" }, t("loading"))
|
|
3463
|
+
),
|
|
3464
|
+
// 开关语义:开关行为 + 状态 pill 口径(绿支持 / 黄待确认 / 黄不可用)
|
|
3465
|
+
pane(
|
|
3466
|
+
"sem",
|
|
3467
|
+
(0, import_react.createElement)(
|
|
3468
|
+
"div",
|
|
3469
|
+
{ className: "tk-sem" },
|
|
3470
|
+
(0, import_react.createElement)("p", null, t("noteBody")),
|
|
3471
|
+
(0, import_react.createElement)("p", null, t("noteBodyPending"))
|
|
3472
|
+
)
|
|
3473
|
+
)
|
|
3474
|
+
),
|
|
3475
|
+
// 工作台去留(页签外常驻,不留死入口):宿主 0.2 右侧栏/composer 挂载时(slim)一行指引指向
|
|
3476
|
+
// 输入框「接力」按钮;老宿主(座位缺席)降级内嵌工作台——收件箱概览在其收件箱视图,行为与旧版一致
|
|
3477
|
+
slim ? (0, import_react.createElement)(
|
|
3478
|
+
"div",
|
|
3479
|
+
{ className: "bt-card" },
|
|
3480
|
+
(0, import_react.createElement)("div", { className: "bt-sub" }, t("settingsPointer"))
|
|
3481
|
+
) : (0, import_react.createElement)(WorkspaceBody, { t, locale, navigate, chrome: false }),
|
|
3482
|
+
// 新手帮助 / FAQ(头行 [?] 按钮切换,默认隐藏不占行)
|
|
3483
|
+
showHelp ? (0, import_react.createElement)(HelpCard, { t }) : null
|
|
3484
|
+
);
|
|
3485
|
+
}
|
|
3486
|
+
function apply(ctx) {
|
|
3487
|
+
const slots = ctx.slots;
|
|
3488
|
+
if (slots === null || typeof slots !== "object" || typeof slots.inject !== "function" || typeof slots.register !== "function") {
|
|
3489
|
+
console.warn("[dsh-takeover] \u5BBF\u4E3B\u672A\u63D0\u4F9B\u53EF\u7528\u7684 slots \u670D\u52A1\uFF08\u9700\u8981 @deepseek-ai/dsh-client-ui-renderer\uFF09\uFF0C\u8BBE\u7F6E\u5361\u8DF3\u8FC7\u6302\u8F7D");
|
|
3490
|
+
return;
|
|
3491
|
+
}
|
|
3492
|
+
let chipReady = false;
|
|
3493
|
+
const registerChip = () => {
|
|
3494
|
+
if (chipReady) return;
|
|
3495
|
+
try {
|
|
3496
|
+
const injectSeat = ctx.slots.inject.bind(ctx.slots);
|
|
3497
|
+
const registerSeat = ctx.slots.register.bind(ctx.slots);
|
|
3498
|
+
const sessionIdOf = (arg) => {
|
|
3499
|
+
if (typeof arg === "string" && arg !== "") return arg;
|
|
3500
|
+
if (arg !== null && typeof arg === "object") {
|
|
3501
|
+
const v = arg.sessionId;
|
|
3502
|
+
if (typeof v === "string" && v !== "") return v;
|
|
3503
|
+
}
|
|
3504
|
+
return void 0;
|
|
3505
|
+
};
|
|
3506
|
+
injectSeat("conversation.input.activity", (injectSession) => registerSeat(
|
|
3507
|
+
{ name: "conversation.input.activity", id: "dsh-takeover" },
|
|
3508
|
+
(...seatArgs) => {
|
|
3509
|
+
const chipT = makeT(ctx);
|
|
3510
|
+
const sessionId = sessionIdOf(seatArgs[0]) ?? sessionIdOf(injectSession);
|
|
3511
|
+
return (0, import_react.createElement)(ComposerChip, { t: chipT, locale: resolveLocale(ctx), navigate: uiNavigatorOf(ctx), sessionId });
|
|
3512
|
+
}
|
|
3513
|
+
), "dsh-takeover: takeover composer chip");
|
|
3514
|
+
chipReady = true;
|
|
3515
|
+
} catch (e) {
|
|
3516
|
+
const msg = e instanceof Error ? e.stack ?? e.message : String(e);
|
|
3517
|
+
console.warn("[dsh-takeover] takeover chip registration failed; settings card keeps the work zones", e);
|
|
3518
|
+
}
|
|
3519
|
+
};
|
|
3520
|
+
const effectFn = ctx.effect;
|
|
3521
|
+
const registerChipWithRetry = () => {
|
|
3522
|
+
registerChip();
|
|
3523
|
+
if (!chipReady) globalThis.setTimeout?.(() => registerChip(), 3e3);
|
|
3524
|
+
};
|
|
3525
|
+
if (typeof effectFn === "function") {
|
|
3526
|
+
effectFn.call(ctx, registerChipWithRetry, "dsh-takeover: takeover chip registration");
|
|
3527
|
+
} else {
|
|
3528
|
+
registerChipWithRetry();
|
|
3529
|
+
}
|
|
3530
|
+
ctx.slots.inject("settings.section", () => ctx.slots.register(
|
|
3531
|
+
{ name: "settings.section", id: "dsh-takeover", order: 42, label: "dsh-takeover" },
|
|
3532
|
+
() => {
|
|
3533
|
+
const t = makeT(ctx);
|
|
3534
|
+
return (0, import_react.createElement)(PanelBoundary, {
|
|
3535
|
+
t,
|
|
3536
|
+
children: (0, import_react.createElement)(Panel, { t, locale: resolveLocale(ctx), navigate: uiNavigatorOf(ctx), slim: chipReady })
|
|
3537
|
+
});
|
|
3538
|
+
}
|
|
3539
|
+
));
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
return module.exports;
|
|
3543
|
+
}
|
|
3544
|
+
});
|