@cold777/dsh-takeover 0.1.0 → 0.2.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 +152 -133
- package/LICENSE +21 -21
- package/README.en.md +27 -6
- package/README.md +27 -6
- package/assets/icon.svg +22 -22
- package/cordis.patch.yml +9 -9
- package/cordis.yml +5 -5
- package/lib/client.js +504 -60
- package/lib/index.d.ts +576 -82
- package/lib/index.js +2611 -212
- package/package.json +119 -119
package/lib/client.js
CHANGED
|
@@ -52,54 +52,202 @@ window.__ModuleLoader__.load({
|
|
|
52
52
|
module.exports = __toCommonJS(client_exports);
|
|
53
53
|
var import_react = require("react");
|
|
54
54
|
|
|
55
|
-
// src/
|
|
56
|
-
var
|
|
57
|
-
claude
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
// src/providers.ts
|
|
56
|
+
var PROVIDERS = [
|
|
57
|
+
// claude / codex / cursor:simple-icons(CC0,官方 path 收录)
|
|
58
|
+
{
|
|
59
|
+
name: "claude",
|
|
60
|
+
adapter: "claude-code",
|
|
61
|
+
label: "Claude Code",
|
|
62
|
+
outboundEligible: true,
|
|
63
|
+
icon: {
|
|
64
|
+
kind: "mark",
|
|
65
|
+
mark: { 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" }] }
|
|
66
|
+
},
|
|
67
|
+
resume: {
|
|
68
|
+
id: "resume-claude",
|
|
69
|
+
product: "Claude Code",
|
|
70
|
+
description: "\u628A\u4E00\u6761 Claude Code \u4F1A\u8BDD\u62C9\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF0C\u751F\u6210\u516D\u6BB5\u4EA4\u63A5\u5361\u63A5\u624B\u5DE5\u4F5C\uFF1B\u53EF\u9644\u4F1A\u8BDD id\u3001\u8BB0\u5F55\u8DEF\u5F84\u6216\u6807\u9898\u5173\u952E\u8BCD\u3002",
|
|
71
|
+
recoveryBoundary: "\u8BFB\u53D6\u5668\u5168\u91CF\u8BFB\u53D6\u672C\u5730\u8BB0\u5F55\uFF08\u542B\u88AB\u66FF\u6362/\u653E\u5F03\u5206\u652F\u7684\u6761\u76EE\uFF0Cthinking \u5757\u4EE5 [thinking] \u6807\u8BB0\u4FDD\u7559\uFF09\uFF1B\u4E0D\u590D\u6D3B CLI\u3001\u4E0D\u56DE\u653E\u5DE5\u5177\u8C03\u7528\u3002"
|
|
72
|
+
}
|
|
68
73
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
{
|
|
75
|
+
name: "codex",
|
|
76
|
+
adapter: "codex",
|
|
77
|
+
label: "Codex CLI",
|
|
78
|
+
outboundEligible: true,
|
|
79
|
+
icon: {
|
|
80
|
+
kind: "mark",
|
|
81
|
+
mark: { 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" }] }
|
|
82
|
+
},
|
|
83
|
+
resume: {
|
|
84
|
+
id: "resume-codex",
|
|
85
|
+
product: "Codex",
|
|
86
|
+
description: "\u628A\u4E00\u6761 Codex \u4F1A\u8BDD\u62C9\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF0C\u751F\u6210\u516D\u6BB5\u4EA4\u63A5\u5361\u63A5\u624B\u5DE5\u4F5C\uFF1B\u53EF\u9644\u4F1A\u8BDD id\u3001\u8BB0\u5F55\u8DEF\u5F84\u6216\u6807\u9898\u5173\u952E\u8BCD\u3002",
|
|
87
|
+
recoveryBoundary: "\u8BFB\u53D6\u5668\u6392\u9664 Codex \u7684 system / developer / reasoning / world-state / \u8DE8 agent \u8BB0\u5F55\u3002"
|
|
88
|
+
}
|
|
77
89
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
{
|
|
91
|
+
name: "opencode",
|
|
92
|
+
adapter: "opencode",
|
|
93
|
+
label: "OpenCode",
|
|
94
|
+
outboundEligible: true,
|
|
95
|
+
icon: {
|
|
96
|
+
kind: "mark",
|
|
97
|
+
mark: {
|
|
98
|
+
// opencode:opencode.ai 官方 favicon(环形 #fff,双色原样保留)
|
|
99
|
+
viewBox: "0 0 512 512",
|
|
100
|
+
tile: "#131010",
|
|
101
|
+
paths: [
|
|
102
|
+
// 白色方环即 opencode favicon 的全部可见形态(曾误塞一条 d="#5A5858" 的颜色串当「芯」,
|
|
103
|
+
// 浏览器对非法 path data 静默忽略——删掉让代码与渲染一致)
|
|
104
|
+
{ d: "M384 416H128V96H384V416ZM320 160H192V352H320V160Z", fill: "#fff" }
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
resume: {
|
|
109
|
+
id: "resume-opencode",
|
|
110
|
+
product: "OpenCode",
|
|
111
|
+
description: "\u628A\u4E00\u6761 OpenCode \u4F1A\u8BDD\u62C9\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF0C\u751F\u6210\u516D\u6BB5\u4EA4\u63A5\u5361\u63A5\u624B\u5DE5\u4F5C\uFF1B\u53EF\u9644\u4F1A\u8BDD id \u6216\u6807\u9898\u5173\u952E\u8BCD\u3002",
|
|
112
|
+
recoveryBoundary: "\u8BFB\u53D6\u5668\u53EA\u8BFB OpenCode \u672C\u5730\u5B58\u50A8\u7684\u4F1A\u8BDD\u8BB0\u5F55\uFF1B\u4E0D\u590D\u6D3B\u8FDB\u7A0B\u3001\u4E0D\u56DE\u653E\u5B58\u50A8\u7684\u8C03\u7528\u3002"
|
|
113
|
+
}
|
|
86
114
|
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
115
|
+
{
|
|
116
|
+
name: "zcode",
|
|
117
|
+
adapter: "zcode",
|
|
118
|
+
label: "ZCode",
|
|
119
|
+
outboundEligible: true,
|
|
120
|
+
icon: {
|
|
121
|
+
kind: "mark",
|
|
122
|
+
mark: {
|
|
123
|
+
// zcode:docs.z.ai 官方 favicon 的 Z 标志(白色三块,#2D2D2D 底)
|
|
124
|
+
viewBox: "0 0 30 30",
|
|
125
|
+
tile: "#2D2D2D",
|
|
126
|
+
paths: [
|
|
127
|
+
{ 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" },
|
|
128
|
+
{ d: "M24.3 7.1L13.14 22.91L5.7 22.91L16.86 7.1Z", fill: "#fff" },
|
|
129
|
+
{ d: "M14.53,22.91l1.31-1.86c0.2-0.29,0.54-0.47,0.9-0.47h7.09v2.33H14.53z", fill: "#fff" }
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
resume: {
|
|
134
|
+
id: "resume-zcode",
|
|
135
|
+
product: "ZCode",
|
|
136
|
+
description: "\u628A\u4E00\u6761 ZCode \u4F1A\u8BDD\u62C9\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF0C\u751F\u6210\u516D\u6BB5\u4EA4\u63A5\u5361\u63A5\u624B\u5DE5\u4F5C\uFF1B\u53EF\u9644\u4F1A\u8BDD id\uFF08\u652F\u6301\u77ED\u524D\u7F00\uFF09\u6216\u6807\u9898\u5173\u952E\u8BCD\u3002",
|
|
137
|
+
recoveryBoundary: "\u8BFB\u53D6\u5668\u53EA\u8BFB ZCode \u7684 sqlite \u5E93\uFF08readonly\u3001\u968F\u5F00\u968F\u5173\uFF0C\u9700 Node \u226522\uFF09\uFF1B\u4E0D\u56DE\u653E\u8C03\u7528\u3001\u4E0D\u590D\u6D3B CLI\uFF1B\u538B\u7F29\u6BB5\u53EA\u662F\u6458\u8981\u6807\u8BB0\uFF0C\u4ECD\u5728\u5E93\u91CC\u7684\u65E7\u884C\u4FDD\u7559\u3002"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "pi",
|
|
142
|
+
adapter: "pi",
|
|
143
|
+
label: "Pi",
|
|
144
|
+
outboundEligible: true,
|
|
145
|
+
icon: {
|
|
146
|
+
kind: "mark",
|
|
147
|
+
mark: {
|
|
148
|
+
// pi:earendil-works/pi 仓库 pi-logo.ts 的官方像素定义(珊瑚/蓝/黄,1:1 复刻)
|
|
149
|
+
viewBox: "0 0 800 800",
|
|
150
|
+
tile: "#27272a",
|
|
151
|
+
paths: [
|
|
152
|
+
{ d: "M165.29 165.29H517.36V400H400V282.65H165.29Z", fill: "#F09082" },
|
|
153
|
+
{ d: "M165.29 282.65H282.65V400H400V517.36H282.65V634.72H165.29Z", fill: "#4D9ABF" },
|
|
154
|
+
{ d: "M517.36 400H634.72V634.72H517.36Z", fill: "#F1BE58" }
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
resume: {
|
|
159
|
+
id: "resume-pi",
|
|
160
|
+
product: "Pi",
|
|
161
|
+
description: "\u628A\u4E00\u6761 Pi \u4F1A\u8BDD\u62C9\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF0C\u751F\u6210\u516D\u6BB5\u4EA4\u63A5\u5361\u63A5\u624B\u5DE5\u4F5C\uFF1B\u53EF\u9644\u4F1A\u8BDD id\u3001JSONL \u8DEF\u5F84\u6216\u6807\u9898\u5173\u952E\u8BCD\u3002",
|
|
162
|
+
recoveryBoundary: "\u8BFB\u53D6\u5668\u53EA\u6CBF Pi \u5F53\u524D\u6D3B\u8DC3\u53F6\u5B50\u8BFB\u53D6\uFF0C\u6392\u9664 thinking\u3001hooks\u3001system \u6D88\u606F\u4E0E\u6269\u5C55\u6CE8\u5165\u7684\u8BB0\u5F55\u3002"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "workbuddy",
|
|
167
|
+
adapter: "workbuddy",
|
|
168
|
+
label: "WorkBuddy",
|
|
169
|
+
outboundEligible: true,
|
|
170
|
+
icon: {
|
|
171
|
+
// workbuddy:workbuddy.cn 官方 logo.svg 整体内嵌(自带渐变圆底,不走 tile)
|
|
172
|
+
kind: "full",
|
|
173
|
+
svg: '<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>'
|
|
174
|
+
},
|
|
175
|
+
resume: {
|
|
176
|
+
id: "resume-workbuddy",
|
|
177
|
+
product: "WorkBuddy",
|
|
178
|
+
description: "\u628A\u4E00\u6761 WorkBuddy \u4F1A\u8BDD\u62C9\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF0C\u751F\u6210\u516D\u6BB5\u4EA4\u63A5\u5361\u63A5\u624B\u5DE5\u4F5C\uFF1B\u53EF\u9644\u4F1A\u8BDD id\u3001\u8BB0\u5F55\u8DEF\u5F84\u6216\u6807\u9898\u5173\u952E\u8BCD\u3002",
|
|
179
|
+
recoveryBoundary: "\u8BFB\u53D6\u5668\u53EA\u5BFC\u5165\u53D7\u652F\u6301\u7684 WorkBuddy transcript / \u5B58\u50A8\u8BB0\u5F55\uFF0C\u6C38\u4E0D\u56DE\u653E\u5B58\u50A8\u7684\u8C03\u7528\u3002"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "cursor",
|
|
184
|
+
adapter: "cursor",
|
|
185
|
+
label: "Cursor",
|
|
186
|
+
outboundEligible: true,
|
|
187
|
+
icon: {
|
|
188
|
+
kind: "mark",
|
|
189
|
+
mark: { 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" }] }
|
|
190
|
+
},
|
|
191
|
+
resume: {
|
|
192
|
+
id: "resume-cursor",
|
|
193
|
+
product: "Cursor",
|
|
194
|
+
description: "\u628A\u4E00\u6761 Cursor \u4F1A\u8BDD\u62C9\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF0C\u751F\u6210\u516D\u6BB5\u4EA4\u63A5\u5361\u63A5\u624B\u5DE5\u4F5C\uFF1B\u53EF\u9644\u4F1A\u8BDD id\u3001\u8BB0\u5F55\u8DEF\u5F84\u6216\u6807\u9898\u5173\u952E\u8BCD\u3002",
|
|
195
|
+
recoveryBoundary: "\u8BFB\u53D6\u5668\u53EA\u5BFC\u5165\u53D7\u652F\u6301\u7684 Cursor transcript / store \u8BB0\u5F55\uFF0C\u6C38\u4E0D\u56DE\u653E\u5B58\u50A8\u7684\u8C03\u7528\u3002"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "grok",
|
|
200
|
+
adapter: "grok",
|
|
201
|
+
label: "Grok CLI",
|
|
202
|
+
outboundEligible: true,
|
|
203
|
+
icon: {
|
|
204
|
+
kind: "mark",
|
|
205
|
+
mark: {
|
|
206
|
+
// grok:xAI 官方 logomark(gilbarbara/logos 收录的官方矢量,256×246 单 path)
|
|
207
|
+
viewBox: "0 0 256 246",
|
|
208
|
+
tile: "#111111",
|
|
209
|
+
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" }]
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
resume: {
|
|
213
|
+
id: "resume-grok",
|
|
214
|
+
product: "Grok",
|
|
215
|
+
description: "\u628A\u4E00\u6761 Grok \u4F1A\u8BDD\u62C9\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF0C\u751F\u6210\u516D\u6BB5\u4EA4\u63A5\u5361\u63A5\u624B\u5DE5\u4F5C\uFF1B\u53EF\u9644\u4F1A\u8BDD id\u3001\u4F1A\u8BDD\u76EE\u5F55\u3001\u8BB0\u5F55\u8DEF\u5F84\u6216\u6807\u9898\u5173\u952E\u8BCD\u3002",
|
|
216
|
+
recoveryBoundary: "\u8BFB\u53D6\u5668\u53EA\u7528 Grok \u53EF\u89C1\u7684 updates.jsonl \u6D41\uFF0C\u6C38\u4E0D\u8BFB chat_history.jsonl \u539F\u59CB\u6A21\u578B\u4E0A\u4E0B\u6587\u3002"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "gemini",
|
|
221
|
+
adapter: "gemini",
|
|
222
|
+
label: "Gemini CLI",
|
|
223
|
+
// 双轴独立:gemini 是第 9 家读取器(进 FOREIGN_PROVIDERS),但交接目标轴不收——
|
|
224
|
+
// 「把会话交接给 Gemini CLI」与「读取 Gemini CLI 的会话」是两个方向。
|
|
225
|
+
outboundEligible: false,
|
|
226
|
+
// 暂无官方矢量在册:图标走 ProviderIcon 中性兜底——未经核实的「官方 path」不入表
|
|
227
|
+
icon: { kind: "none" },
|
|
228
|
+
resume: {
|
|
229
|
+
id: "resume-gemini",
|
|
230
|
+
product: "Gemini CLI",
|
|
231
|
+
description: "\u628A\u4E00\u6761 Gemini CLI \u4F1A\u8BDD\u62C9\u8FDB\u5F53\u524D\u4F1A\u8BDD\uFF0C\u751F\u6210\u516D\u6BB5\u4EA4\u63A5\u5361\u63A5\u624B\u5DE5\u4F5C\uFF1B\u672C\u5730\u8BB0\u5F55\u662F\u65B0\u65E7\u53CC\u683C\u5F0F JSONL/JSON\uFF0C\u5B50\u4EE3\u7406\u4F1A\u8BDD\u5355\u72EC\u5B58\u76D8\uFF0C\u53EF\u9644\u4F1A\u8BDD id\uFF08\u8BB0\u5F55\u8DEF\u5F84\uFF09\u3001\u8BB0\u5F55\u8DEF\u5F84\u6216\u6807\u9898\u5173\u952E\u8BCD\u3002",
|
|
232
|
+
recoveryBoundary: "\u8BFB\u53D6\u5668\u53EA\u8BFB Gemini CLI \u672C\u5730 chats/ \u4E0B\u7684\u4F1A\u8BDD\u6587\u4EF6\uFF08JSONL \u65B0\u683C\u5F0F / \u6574\u5757 JSON \u65E7\u683C\u5F0F\uFF0C\u542B\u5B50\u4EE3\u7406\u4F1A\u8BDD\u76EE\u5F55\uFF09\uFF1Binfo/error/warning CLI \u63D0\u793A\u4E0E\u659C\u6760\u547D\u4EE4\u884C\u4E0D\u8FDB\u5BF9\u8BDD\u6D41\uFF1B\u53EA\u8BFB\u4E0D\u5199\u3001\u4E0D\u590D\u6D3B Gemini CLI \u8FDB\u7A0B\u3002"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
];
|
|
236
|
+
var RESUME_PROVIDERS = PROVIDERS.map((p) => p.name);
|
|
237
|
+
|
|
238
|
+
// src/brand-icons.ts
|
|
239
|
+
var DSH_MARK = { 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" }] };
|
|
240
|
+
var BRAND_MARKS = {
|
|
241
|
+
...Object.fromEntries(
|
|
242
|
+
PROVIDERS.flatMap((p) => p.icon.kind === "mark" ? [[p.name, p.icon.mark]] : [])
|
|
243
|
+
),
|
|
244
|
+
dsh: DSH_MARK
|
|
92
245
|
};
|
|
246
|
+
var BRAND_FULL_SVG = Object.fromEntries(
|
|
247
|
+
PROVIDERS.flatMap((p) => p.icon.kind === "full" ? [[p.name, p.icon.svg]] : [])
|
|
248
|
+
);
|
|
93
249
|
var PROVIDER_LABEL = {
|
|
94
|
-
|
|
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",
|
|
250
|
+
...Object.fromEntries(PROVIDERS.map((p) => [p.name, p.label])),
|
|
103
251
|
dsh: "DeepSeek Harness"
|
|
104
252
|
};
|
|
105
253
|
|
|
@@ -295,6 +443,13 @@ window.__ModuleLoader__.load({
|
|
|
295
443
|
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
444
|
memoryPushing: "\u51FA\u5361\u4E2D\u2026",
|
|
297
445
|
memoryPushedNotice: "\u8BB0\u5FC6\u4EA4\u63A5\u5361\u5DF2\u8FDB\u6536\u4EF6\u7BB1\uFF08{n} \u4EFD\u6765\u6E90\uFF09\u3002",
|
|
446
|
+
// 救生艇(lifeboat):不经模型把当前会话运行态抢出成卡(收件箱工具行;有 sessionId 座位才渲染)
|
|
447
|
+
lifeboatBtn: "\u{1F6DF} \u6551\u751F\u8247",
|
|
448
|
+
lifeboatBusy: "\u62A2\u51FA\u4E2D\u2026",
|
|
449
|
+
lifeboatTitle: "\u4E0A\u4E0B\u6587\u70B8\u4E86\u4E5F\u4E0D\u6015\uFF1A\u4E0D\u7ECF\u6A21\u578B\uFF0C\u628A\u5F53\u524D\u4F1A\u8BDD\u7684\u4E8B\u4EF6\u6D41\u786E\u5B9A\u6027\u84B8\u998F\u6210\u4E00\u5F20\u4EA4\u63A5\u5361\u5BC4\u5B58\u8FDB\u6536\u4EF6\u7BB1\uFF08\u4E8B\u4EF6\u6D41\u8BFB\u4E0D\u51FA\u65F6\u5BC4\u515C\u5E95\u9AA8\u67B6\u5361\uFF09",
|
|
450
|
+
lifeboatNotice: "\u{1F6DF} \u5DF2\u62A2\u51FA\uFF1A\u5F53\u524D\u4F1A\u8BDD\u5DF2\u5BC4\u5B58\u6210\u5361 {id}\uFF08\u89C1\u6536\u4EF6\u7BB1\uFF09",
|
|
451
|
+
lifeboatSynced: "\uFF1B\u6362\u673A\u540C\u6B65\u5DF2\u5B8C\u6210",
|
|
452
|
+
lifeboatSyncFail: "\u6362\u673A\u540C\u6B65\u5931\u8D25",
|
|
298
453
|
// 新手帮助 / FAQ
|
|
299
454
|
helpTitle: "\u65B0\u624B\u5E2E\u52A9 / FAQ",
|
|
300
455
|
qa1q: "\u8FD9\u662F\u5E72\u4EC0\u4E48\u7684\uFF1F",
|
|
@@ -312,7 +467,43 @@ window.__ModuleLoader__.load({
|
|
|
312
467
|
qa7q: "\u9690\u79C1\u600E\u4E48\u529E\uFF1F",
|
|
313
468
|
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
469
|
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"
|
|
470
|
+
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",
|
|
471
|
+
// 换机同步(0.2.0):设置卡第四页签 + 概览瓦片
|
|
472
|
+
tabSync: "\u6362\u673A",
|
|
473
|
+
syncLead: "\u628A\u6536\u53D1\u4EF6\u7BB1\uFF08\u5F85\u53D6\u4EF6/\u5DF2\u5F52\u6863\u5361\u4E0E\u7B7E\u540D\u5BC6\u94A5\uFF09\u7ECF git \u4ED3\u5E93\u8DE8\u673A\u642C\u8FD0\uFF1A\u65E7\u673A\u5668\u5BC4\u5B58\u540E\u300C\u7ACB\u5373\u540C\u6B65\u300D\uFF0C\u65B0\u673A\u5668\u542F\u7528\u540C\u4E00\u4ED3\u5E93\u5730\u5740\u540E\u300C\u7ACB\u5373\u540C\u6B65\u300D\uFF0C\u5361\u5C31\u51FA\u73B0\u5728\u6536\u4EF6\u7BB1\u91CC\u3002",
|
|
474
|
+
syncNotConfigured: "\u5C1A\u672A\u542F\u7528\uFF1A\u586B\u4E00\u4E2A git \u4ED3\u5E93\u5730\u5740\uFF08\u79C1\u6709\u4ED3\u5E93\uFF1B\u51ED\u636E\u8D70\u7CFB\u7EDF git\uFF0C\u4E0D\u8FDB\u63D2\u4EF6\uFF09\u3002",
|
|
475
|
+
syncRemoteLabel: "\u4ED3\u5E93\u5730\u5740",
|
|
476
|
+
syncRemotePlaceholder: "https://github.com/you/handoff.git \xB7 git@host:path \xB7 \u672C\u5730\u8DEF\u5F84",
|
|
477
|
+
syncEnable: "\u542F\u7528\u540C\u6B65",
|
|
478
|
+
syncUpdate: "\u66F4\u65B0\u5730\u5740",
|
|
479
|
+
syncNowLabel: "\u7ACB\u5373\u540C\u6B65",
|
|
480
|
+
syncBusy: "\u540C\u6B65\u4E2D\u2026\uFF08git \u7F51\u7EDC\u64CD\u4F5C\uFF0C\u6700\u957F\u7EA6 1 \u5206\u949F\uFF09",
|
|
481
|
+
syncScopeNote: "\u540C\u6B65\u8303\u56F4\uFF1Apending/ \u4E0E archived/ \u5168\u90E8\u5361\u4E0E\u673A\u5668\u4FE1\u5C01 + \u7B7E\u540D\u5BC6\u94A5\uFF1B\u673A\u5668\u672C\u5730\u8BB0\u5F55\uFF08\u751F\u547D\u5468\u671F\u65E5\u5FD7/\u53D6\u4EF6\u6EAF\u6E90/\u63D2\u4EF6\u5F00\u5173\uFF09\u4E0D\u53C2\u4E0E\u3002\u5DF2\u6D88\u8D39\u7684\u5361\u7ECF\u5F52\u6863 tombstone \u4E0D\u5728\u53E6\u4E00\u53F0\u673A\u5668\u91CD\u653E\u3002",
|
|
482
|
+
syncStateUpToDate: "\u5DF2\u4E0E\u8FDC\u7AEF\u5BF9\u9F50",
|
|
483
|
+
syncStateBehind: "\u843D\u540E {n} \u4E2A\u63D0\u4EA4",
|
|
484
|
+
syncStateAhead: "\u9886\u5148 {n} \u4E2A\u63D0\u4EA4",
|
|
485
|
+
syncStateDirty: "{n} \u4E2A\u6587\u4EF6\u5F85\u63D0\u4EA4",
|
|
486
|
+
syncLastSync: "\u4E0A\u6B21\u540C\u6B65 {at}",
|
|
487
|
+
syncLastError: "\u4E0A\u6B21\u540C\u6B65\u51FA\u9519",
|
|
488
|
+
syncRemoteNow: "\u8FDC\u7AEF {remote}",
|
|
489
|
+
tileSync: "\u540C\u6B65",
|
|
490
|
+
tileSyncTitle: "\u6362\u673A\u540C\u6B65\u72B6\u6001\uFF1A\u70B9\u8BBE\u7F6E\u5361\u300C\u6362\u673A\u300D\u9875\u67E5\u770B\u4E0E\u64CD\u4F5C",
|
|
491
|
+
// 环境备份(0.2.0 wave2):设置卡第五页签
|
|
492
|
+
tabEnv: "\u73AF\u5883",
|
|
493
|
+
envLead: "\u628A DSH \u5168\u5BB6\u6876\uFF08\u8BBE\u7F6E/\u63D2\u4EF6\u767B\u8BB0/\u4F1A\u8BDD\u5E93/\u7528\u6237 skills/\u5DE5\u4F5C\u533A\u767B\u8BB0\uFF09\u6253\u5305\u6210\u5355\u4E2A\u52A0\u5BC6\u6587\u4EF6\uFF0C\u968F\u300C\u6362\u673A\u300D\u540C\u6B65\u8D70\uFF1A\u65E7\u673A\u5668\u5907\u4EFD\uFF0C\u65B0\u673A\u5668\u9884\u6F14\u540E\u8FD8\u539F\uFF0C\u53EF\u56DE\u6EDA\u3002",
|
|
494
|
+
envPassLabel: "\u52A0\u5BC6\u53E3\u4EE4",
|
|
495
|
+
envPassPlaceholder: "\u22658 \u4F4D\uFF0C\u6C38\u4E0D\u843D\u76D8\uFF1B\u5FD8\u4E86\u6551\u4E0D\u56DE\u5907\u4EFD",
|
|
496
|
+
envBackupNow: "\u7ACB\u5373\u5907\u4EFD",
|
|
497
|
+
envBusy: "\u5904\u7406\u4E2D\u2026\uFF08\u6253\u5305+\u52A0\u5BC6\uFF09",
|
|
498
|
+
envBackupsTitle: "\u5907\u4EFD\uFF08\u4FDD\u7559\u6700\u65B0 3 \u4E2A\uFF09",
|
|
499
|
+
envNoBackups: "\u8FD8\u6CA1\u6709\u5907\u4EFD\u3002\u586B\u597D\u53E3\u4EE4\u70B9\u300C\u7ACB\u5373\u5907\u4EFD\u300D\u3002",
|
|
500
|
+
envDry: "\u9884\u6F14",
|
|
501
|
+
envDrySummary: "\u5C06\u65B0\u5EFA {n1} / \u8986\u76D6 {n2} / \u76F8\u540C {n3}",
|
|
502
|
+
envApply: "\u786E\u8BA4\u8FD8\u539F",
|
|
503
|
+
envCancel: "\u53D6\u6D88",
|
|
504
|
+
envRollback: "\u56DE\u6EDA\u6B64\u8FD8\u539F",
|
|
505
|
+
envScopeNote: "\u8303\u56F4\uFF1ADSH settings/\u63D2\u4EF6\u767B\u8BB0/\u4F1A\u8BDD\u5E93/\u767B\u8BB0 + ~/.agents/skills + ZCode \u7528\u6237\u5C42\uFF1Bnode_modules/\u7F13\u5B58/\u65E5\u5FD7\u4E0D\u5907\uFF08\u53EF\u91CD\u690D\uFF09\u3002\u51ED\u636E\u7C7B\u6587\u4EF6\u53EA\u5B58\u5728\u4E8E\u52A0\u5BC6\u5305\u5185\uFF1B\u53E3\u4EE4\u6C38\u4E0D\u843D\u76D8\uFF0C\u5FD8\u4E86\u5C31\u6551\u4E0D\u56DE\u3002\u5907\u4EFD\u5305\u968F\u6362\u673A\u540C\u6B65\uFF08\u4FDD\u7559\u6700\u65B0 3 \u4E2A\uFF09\u3002",
|
|
506
|
+
envSize: "\u5927\u5C0F {n} MB"
|
|
316
507
|
};
|
|
317
508
|
var en = {
|
|
318
509
|
appTitle: "dsh-takeover Session Takeover",
|
|
@@ -504,6 +695,13 @@ window.__ModuleLoader__.load({
|
|
|
504
695
|
memoryPushBtnTitle: "Pack the selected memories into one handoff card in the inbox (secret gate and coverage discipline apply, same as session cards)",
|
|
505
696
|
memoryPushing: "Packing\u2026",
|
|
506
697
|
memoryPushedNotice: "Memory card is in the inbox ({n} sources).",
|
|
698
|
+
// Lifeboat: salvage the running session state without the model (inbox toolbar; rendered only with a sessionId seat)
|
|
699
|
+
lifeboatBtn: "\u{1F6DF} Lifeboat",
|
|
700
|
+
lifeboatBusy: "Salvaging\u2026",
|
|
701
|
+
lifeboatTitle: "Context blown? Salvage without the model: distill this session's event stream deterministically into one handoff card and deposit it to the inbox (a fallback skeleton card is deposited when the event stream is unreadable)",
|
|
702
|
+
lifeboatNotice: "\u{1F6DF} Salvaged: this session is deposited as card {id} (see inbox)",
|
|
703
|
+
lifeboatSynced: "; cross-machine sync done",
|
|
704
|
+
lifeboatSyncFail: "cross-machine sync failed",
|
|
507
705
|
// Help / FAQ
|
|
508
706
|
helpTitle: "Help / FAQ",
|
|
509
707
|
qa1q: "What is this?",
|
|
@@ -521,7 +719,43 @@ window.__ModuleLoader__.load({
|
|
|
521
719
|
qa7q: "What about privacy?",
|
|
522
720
|
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
721
|
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.'
|
|
722
|
+
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.',
|
|
723
|
+
// Machine switching (0.2.0): settings card fourth tab + overview tile
|
|
724
|
+
tabSync: "Switch",
|
|
725
|
+
syncLead: 'Move the inbox (pending/archived cards plus the signing key) across machines via a git repository: deposit on the old machine and hit "Sync now"; enable the same repo URL on the new machine and hit "Sync now" \u2014 the cards appear in its inbox.',
|
|
726
|
+
syncNotConfigured: "Not enabled yet: enter a git repository URL (private repo; credentials stay with system git, never inside the plugin).",
|
|
727
|
+
syncRemoteLabel: "Repository URL",
|
|
728
|
+
syncRemotePlaceholder: "https://github.com/you/handoff.git \xB7 git@host:path \xB7 local path",
|
|
729
|
+
syncEnable: "Enable sync",
|
|
730
|
+
syncUpdate: "Update URL",
|
|
731
|
+
syncNowLabel: "Sync now",
|
|
732
|
+
syncBusy: "Syncing\u2026 (git network operations, up to ~1 minute)",
|
|
733
|
+
syncScopeNote: "Scope: every card and machine envelope in pending/ and archived/ plus the signing key; machine-local records (lifecycle log, relay provenance, plugin switches) never sync. Consumed cards do not replay on the other machine \u2014 archived/ acts as the tombstone.",
|
|
734
|
+
syncStateUpToDate: "Up to date with remote",
|
|
735
|
+
syncStateBehind: "{n} commits behind",
|
|
736
|
+
syncStateAhead: "{n} commits ahead",
|
|
737
|
+
syncStateDirty: "{n} files to commit",
|
|
738
|
+
syncLastSync: "Last sync {at}",
|
|
739
|
+
syncLastError: "Last sync failed",
|
|
740
|
+
syncRemoteNow: "Remote {remote}",
|
|
741
|
+
tileSync: "Sync",
|
|
742
|
+
tileSyncTitle: 'Machine-switch sync status: open the "Switch" tab to act on it',
|
|
743
|
+
// Environment backup (0.2.0 wave2): settings card fifth tab
|
|
744
|
+
tabEnv: "Env",
|
|
745
|
+
envLead: "Pack the whole DSH family (settings / plugin registrations / session library / user skills / workspace registries) into one encrypted file that rides machine-switch sync: back up on the old machine, preview-then-restore on the new one, rollback if unhappy.",
|
|
746
|
+
envPassLabel: "Encryption passphrase",
|
|
747
|
+
envPassPlaceholder: "\u22658 chars, never stored; if forgotten the backup is unrecoverable",
|
|
748
|
+
envBackupNow: "Back up now",
|
|
749
|
+
envBusy: "Working\u2026 (pack + encrypt)",
|
|
750
|
+
envBackupsTitle: "Backups (latest 3 kept)",
|
|
751
|
+
envNoBackups: 'No backups yet. Enter a passphrase and hit "Back up now".',
|
|
752
|
+
envDry: "Preview",
|
|
753
|
+
envDrySummary: "Would create {n1} / overwrite {n2} / identical {n3}",
|
|
754
|
+
envApply: "Restore",
|
|
755
|
+
envCancel: "Cancel",
|
|
756
|
+
envRollback: "Roll back this restore",
|
|
757
|
+
envScopeNote: "Scope: DSH settings/plugin registrations/session library/registries + ~/.agents/skills + ZCode user layer; node_modules/caches/logs excluded (replantable). Credential files exist only inside the encrypted archive; the passphrase is never stored \u2014 forget it and the backup is unrecoverable. Archives ride machine-switch sync (latest 3 kept).",
|
|
758
|
+
envSize: "{n} MB"
|
|
525
759
|
};
|
|
526
760
|
var DICTS = { zh, en };
|
|
527
761
|
function interpolate(template, params) {
|
|
@@ -682,17 +916,15 @@ window.__ModuleLoader__.load({
|
|
|
682
916
|
function depositTail(lang) {
|
|
683
917
|
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
918
|
}
|
|
685
|
-
var OUTBOUND_TARGETS = [
|
|
919
|
+
var OUTBOUND_TARGETS = [
|
|
920
|
+
"any",
|
|
921
|
+
...PROVIDERS.filter((p) => p.outboundEligible).map((p) => p.name)
|
|
922
|
+
];
|
|
686
923
|
var OUTBOUND_LABELS = {
|
|
687
924
|
any: { zh: "\u4EFB\u610F agent", en: "Any agent" },
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
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" }
|
|
925
|
+
...Object.fromEntries(
|
|
926
|
+
PROVIDERS.filter((p) => p.outboundEligible).map((p) => [p.name, { zh: p.label, en: p.label }])
|
|
927
|
+
)
|
|
696
928
|
};
|
|
697
929
|
function outboundCommand(lang, targetLabel) {
|
|
698
930
|
const head = "/handoff";
|
|
@@ -2662,7 +2894,6 @@ window.__ModuleLoader__.load({
|
|
|
2662
2894
|
]
|
|
2663
2895
|
);
|
|
2664
2896
|
}
|
|
2665
|
-
var RESUME_PROVIDERS = ["claude", "codex", "opencode", "zcode", "pi", "workbuddy", "cursor", "grok", "gemini"];
|
|
2666
2897
|
function CommandsGrid({ state, t }) {
|
|
2667
2898
|
const disabled = new Set(
|
|
2668
2899
|
(state?.providers ?? []).filter((p) => !p.enabled).map((p) => p.name)
|
|
@@ -2777,10 +3008,10 @@ window.__ModuleLoader__.load({
|
|
|
2777
3008
|
}, []);
|
|
2778
3009
|
return { state, setState, error, setError, reload, generationRef };
|
|
2779
3010
|
}
|
|
2780
|
-
var PANEL_VERSION = true ? "v0.
|
|
3011
|
+
var PANEL_VERSION = true ? "v0.2.0" : "v?";
|
|
2781
3012
|
function WorkspaceBody({ t, locale, navigate, chrome, sessionId, showHelp, bounded }) {
|
|
2782
3013
|
useLocaleSync(locale);
|
|
2783
|
-
const { state, error, setError, reload } = useTakeoverPolling();
|
|
3014
|
+
const { state, setState, error, setError, reload, generationRef } = useTakeoverPolling();
|
|
2784
3015
|
const lang = langOf(locale);
|
|
2785
3016
|
const [onboardGone, setOnboardGone] = (0, import_react.useState)(() => {
|
|
2786
3017
|
try {
|
|
@@ -2847,6 +3078,30 @@ window.__ModuleLoader__.load({
|
|
|
2847
3078
|
return void 0;
|
|
2848
3079
|
}).catch((e) => setError(e instanceof Error ? e.message : String(e))).finally(() => setTakeBusyId(null));
|
|
2849
3080
|
};
|
|
3081
|
+
const [lifeboatBusy, setLifeboatBusy] = (0, import_react.useState)(false);
|
|
3082
|
+
const lifeboat = () => {
|
|
3083
|
+
if (lifeboatBusy || sessionId === void 0 || sessionId === "") return;
|
|
3084
|
+
setLifeboatBusy(true);
|
|
3085
|
+
const gen = ++generationRef.current;
|
|
3086
|
+
void post(
|
|
3087
|
+
"/dsh-takeover/lifeboat",
|
|
3088
|
+
{ sessionId }
|
|
3089
|
+
).then((r) => {
|
|
3090
|
+
if (gen !== generationRef.current) return;
|
|
3091
|
+
if (!r.ok) throw new Error(r.error);
|
|
3092
|
+
if (r.state !== void 0) {
|
|
3093
|
+
setState(r.state);
|
|
3094
|
+
setError(null);
|
|
3095
|
+
}
|
|
3096
|
+
showNotice(
|
|
3097
|
+
t("lifeboatNotice", { id: r.id }) + (r.synced !== void 0 ? r.synced.ok === true ? t("lifeboatSynced") : `\uFF1B${t("lifeboatSyncFail")}\uFF1A${r.synced.error ?? ""}` : "")
|
|
3098
|
+
);
|
|
3099
|
+
return void 0;
|
|
3100
|
+
}).catch((e) => {
|
|
3101
|
+
if (gen !== generationRef.current) return;
|
|
3102
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
3103
|
+
}).finally(() => setLifeboatBusy(false));
|
|
3104
|
+
};
|
|
2850
3105
|
const clear = () => {
|
|
2851
3106
|
if (!confirmClear) {
|
|
2852
3107
|
setConfirmClear(true);
|
|
@@ -3026,7 +3281,20 @@ window.__ModuleLoader__.load({
|
|
|
3026
3281
|
rejected > 0 ? "err" : "",
|
|
3027
3282
|
rejected > 0 ? `${t("rejectionsTitle")}\uFF1B${rejectionTitle(state)}` : t("rejectionsTitle")
|
|
3028
3283
|
),
|
|
3029
|
-
(state.pendingDuplicates ?? 0) > 0 ? tile("dup", String(state.pendingDuplicates), t("tileDup"), "var(--tk-warn)", "warn", t("pendingDupTitle")) : null
|
|
3284
|
+
(state.pendingDuplicates ?? 0) > 0 ? tile("dup", String(state.pendingDuplicates), t("tileDup"), "var(--tk-warn)", "warn", t("pendingDupTitle")) : null,
|
|
3285
|
+
// 换机同步瓦片(0.2.0):仅启用时出现——落后数即待办(点设置卡「换机」页处理)
|
|
3286
|
+
state.syncStatus !== void 0 ? (() => {
|
|
3287
|
+
const sy = state.syncStatus;
|
|
3288
|
+
const tone = sy.lastError !== void 0 ? "err" : sy.behind > 0 ? "warn" : "ok";
|
|
3289
|
+
return tile(
|
|
3290
|
+
"sync",
|
|
3291
|
+
sy.behind > 0 ? String(sy.behind) : "\u2713",
|
|
3292
|
+
t("tileSync"),
|
|
3293
|
+
tone === "err" ? "var(--tk-err)" : tone === "warn" ? "var(--tk-warn)" : "var(--tk-ok)",
|
|
3294
|
+
tone,
|
|
3295
|
+
sy.lastError !== void 0 ? `${t("syncLastError")}\uFF1A${sy.lastError}` : t("tileSyncTitle")
|
|
3296
|
+
);
|
|
3297
|
+
})() : null
|
|
3030
3298
|
);
|
|
3031
3299
|
const inboxActions = [
|
|
3032
3300
|
state !== null ? (0, import_react.createElement)("input", {
|
|
@@ -3052,6 +3320,16 @@ window.__ModuleLoader__.load({
|
|
|
3052
3320
|
}
|
|
3053
3321
|
}
|
|
3054
3322
|
}) : null,
|
|
3323
|
+
// 🛟 救生艇:只挂有 sessionId 座位的工作台(composer 浮层)——设置卡/老宿主内嵌无座位,
|
|
3324
|
+
// 救生艇要的就是「当前会话」,没有座位即没有语义,整钮不渲染
|
|
3325
|
+
sessionId !== void 0 && sessionId !== "" ? (0, import_react.createElement)("button", {
|
|
3326
|
+
key: "lifeboat",
|
|
3327
|
+
className: "bt-btn",
|
|
3328
|
+
type: "button",
|
|
3329
|
+
disabled: lifeboatBusy,
|
|
3330
|
+
onClick: lifeboat,
|
|
3331
|
+
title: t("lifeboatTitle")
|
|
3332
|
+
}, lifeboatBusy ? t("lifeboatBusy") : t("lifeboatBtn")) : null,
|
|
3055
3333
|
(0, import_react.createElement)("button", {
|
|
3056
3334
|
key: "clear",
|
|
3057
3335
|
className: `bt-btn bt-btn-danger${confirmClear ? " bt-btn-confirm" : ""}`,
|
|
@@ -3344,7 +3622,163 @@ window.__ModuleLoader__.load({
|
|
|
3344
3622
|
) : null
|
|
3345
3623
|
);
|
|
3346
3624
|
}
|
|
3347
|
-
|
|
3625
|
+
function EnvPane({ t, backups, reload, setError }) {
|
|
3626
|
+
const [pass, setPass] = (0, import_react.useState)("");
|
|
3627
|
+
const [busy, setBusy] = (0, import_react.useState)("");
|
|
3628
|
+
const [notice, setNotice] = (0, import_react.useState)(null);
|
|
3629
|
+
const [dry, setDry] = (0, import_react.useState)(null);
|
|
3630
|
+
const act = (action, extra) => {
|
|
3631
|
+
setBusy(action);
|
|
3632
|
+
void post(
|
|
3633
|
+
"/dsh-takeover/env-backup",
|
|
3634
|
+
{ action, passphrase: pass, ...extra }
|
|
3635
|
+
).then((r) => {
|
|
3636
|
+
if (!r.ok) {
|
|
3637
|
+
setError(r.error ?? t("syncLastError"));
|
|
3638
|
+
return;
|
|
3639
|
+
}
|
|
3640
|
+
setError(null);
|
|
3641
|
+
if (action === "dry" && typeof r.creates === "number") {
|
|
3642
|
+
setDry({ file: String(extra?.["file"] ?? ""), creates: r.creates, overwrites: r.overwrites ?? 0, same: r.same ?? 0 });
|
|
3643
|
+
setNotice(r.detail ?? null);
|
|
3644
|
+
} else {
|
|
3645
|
+
if (action === "apply" || action === "rollback" || action === "create") setDry(null);
|
|
3646
|
+
setNotice(r.detail ?? null);
|
|
3647
|
+
}
|
|
3648
|
+
reload();
|
|
3649
|
+
}).catch((e) => {
|
|
3650
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
3651
|
+
}).finally(() => {
|
|
3652
|
+
setBusy("");
|
|
3653
|
+
});
|
|
3654
|
+
};
|
|
3655
|
+
return (0, import_react.createElement)(
|
|
3656
|
+
"div",
|
|
3657
|
+
{ className: "tk-sem" },
|
|
3658
|
+
(0, import_react.createElement)("p", null, t("envLead")),
|
|
3659
|
+
(0, import_react.createElement)(
|
|
3660
|
+
"div",
|
|
3661
|
+
{ style: { display: "flex", gap: 8, alignItems: "center", flexWrap: "wrap" } },
|
|
3662
|
+
(0, import_react.createElement)("input", {
|
|
3663
|
+
className: "bt-filter",
|
|
3664
|
+
type: "password",
|
|
3665
|
+
value: pass,
|
|
3666
|
+
placeholder: t("envPassPlaceholder"),
|
|
3667
|
+
"aria-label": t("envPassLabel"),
|
|
3668
|
+
onChange: (e) => {
|
|
3669
|
+
setPass(e.target.value);
|
|
3670
|
+
},
|
|
3671
|
+
style: { flex: "1 1 260px" }
|
|
3672
|
+
}),
|
|
3673
|
+
(0, import_react.createElement)("button", {
|
|
3674
|
+
className: "bt-btn bt-btn-primary",
|
|
3675
|
+
type: "button",
|
|
3676
|
+
disabled: busy !== "" || pass.length < 8,
|
|
3677
|
+
title: pass.length < 8 ? t("envPassPlaceholder") : void 0,
|
|
3678
|
+
onClick: () => {
|
|
3679
|
+
setNotice(null);
|
|
3680
|
+
setDry(null);
|
|
3681
|
+
act("create");
|
|
3682
|
+
}
|
|
3683
|
+
}, busy !== "" ? t("envBusy") : t("envBackupNow"))
|
|
3684
|
+
),
|
|
3685
|
+
notice !== null ? (0, import_react.createElement)("div", { className: "bt-banner", style: { marginTop: 8 } }, notice) : null,
|
|
3686
|
+
(0, import_react.createElement)("div", { className: "tk-pane-lead", style: { marginTop: 10 } }, t("envBackupsTitle")),
|
|
3687
|
+
backups.length === 0 ? (0, import_react.createElement)("p", { className: "bt-sub" }, t("envNoBackups")) : backups.map((b) => (0, import_react.createElement)(
|
|
3688
|
+
"div",
|
|
3689
|
+
{ key: b.file, style: { display: "flex", gap: 8, alignItems: "center", padding: "3px 0", flexWrap: "wrap" } },
|
|
3690
|
+
(0, import_react.createElement)(
|
|
3691
|
+
"span",
|
|
3692
|
+
{ style: { flex: "1 1 220px", fontVariantNumeric: "tabular-nums" } },
|
|
3693
|
+
`${b.at} \xB7 ${t("envSize", { n: (b.bytes / 1024 / 1024).toFixed(1) })}`
|
|
3694
|
+
),
|
|
3695
|
+
dry !== null && dry.file === b.file ? (0, import_react.createElement)("span", { className: "bt-sub" }, t("envDrySummary", { n1: dry.creates, n2: dry.overwrites, n3: dry.same })) : null,
|
|
3696
|
+
dry !== null && dry.file === b.file ? (0, import_react.createElement)("button", { className: "bt-btn bt-btn-danger bt-btn-confirm", type: "button", disabled: busy !== "", onClick: () => {
|
|
3697
|
+
setNotice(null);
|
|
3698
|
+
act("apply", { file: b.file, confirm: true });
|
|
3699
|
+
} }, busy === "apply" ? t("envBusy") : t("envApply")) : (0, import_react.createElement)("button", { className: "bt-btn", type: "button", disabled: busy !== "" || pass.length < 8, onClick: () => {
|
|
3700
|
+
setNotice(null);
|
|
3701
|
+
setDry(null);
|
|
3702
|
+
act("dry", { file: b.file });
|
|
3703
|
+
} }, busy === "dry" ? t("envBusy") : t("envDry")),
|
|
3704
|
+
dry !== null && dry.file === b.file ? (0, import_react.createElement)("button", { className: "bt-btn", type: "button", disabled: busy !== "", onClick: () => setDry(null) }, t("envCancel")) : null
|
|
3705
|
+
)),
|
|
3706
|
+
(0, import_react.createElement)("p", { className: "bt-sub", style: { marginTop: 8 } }, t("envScopeNote"))
|
|
3707
|
+
);
|
|
3708
|
+
}
|
|
3709
|
+
function SyncCard({ t, status, setState, setError, generationRef }) {
|
|
3710
|
+
const [url, setUrl] = (0, import_react.useState)("");
|
|
3711
|
+
const [busy, setBusy] = (0, import_react.useState)("");
|
|
3712
|
+
const [notice, setNotice] = (0, import_react.useState)(null);
|
|
3713
|
+
const act = (action) => {
|
|
3714
|
+
setBusy(action);
|
|
3715
|
+
const gen = ++generationRef.current;
|
|
3716
|
+
void post("/dsh-takeover/sync", { action, url: url.trim() }).then((r) => {
|
|
3717
|
+
if (gen !== generationRef.current) return;
|
|
3718
|
+
setState(r.state);
|
|
3719
|
+
if (r.ok) {
|
|
3720
|
+
setNotice(r.detail ?? t("syncStateUpToDate"));
|
|
3721
|
+
setError(null);
|
|
3722
|
+
} else {
|
|
3723
|
+
setNotice(null);
|
|
3724
|
+
setError(r.error ?? t("syncLastError"));
|
|
3725
|
+
}
|
|
3726
|
+
}).catch((e) => {
|
|
3727
|
+
if (gen !== generationRef.current) return;
|
|
3728
|
+
setNotice(null);
|
|
3729
|
+
setError(e instanceof Error ? e.message : String(e));
|
|
3730
|
+
}).finally(() => {
|
|
3731
|
+
setBusy("");
|
|
3732
|
+
});
|
|
3733
|
+
};
|
|
3734
|
+
const stateLine = [];
|
|
3735
|
+
if (status !== void 0) {
|
|
3736
|
+
if (status.behind > 0) stateLine.push(t("syncStateBehind", { n: status.behind }));
|
|
3737
|
+
if (status.ahead > 0) stateLine.push(t("syncStateAhead", { n: status.ahead }));
|
|
3738
|
+
if (status.dirtyFiles > 0) stateLine.push(t("syncStateDirty", { n: status.dirtyFiles }));
|
|
3739
|
+
if (stateLine.length === 0 && status.lastError === void 0) stateLine.push(t("syncStateUpToDate"));
|
|
3740
|
+
if (status.lastError !== void 0) stateLine.push(`${t("syncLastError")}\uFF1A${status.lastError}`);
|
|
3741
|
+
if (status.lastSyncAt !== void 0) stateLine.push(t("syncLastSync", { at: status.lastSyncAt.slice(0, 16).replace("T", " ") }));
|
|
3742
|
+
}
|
|
3743
|
+
return (0, import_react.createElement)(
|
|
3744
|
+
"div",
|
|
3745
|
+
{ className: "tk-sem" },
|
|
3746
|
+
(0, import_react.createElement)("p", null, t("syncLead")),
|
|
3747
|
+
status === void 0 ? (0, import_react.createElement)("p", { className: "bt-sub" }, t("syncNotConfigured")) : (0, import_react.createElement)(
|
|
3748
|
+
"div",
|
|
3749
|
+
{ className: "tk-tiles", style: { margin: "8px 0" } },
|
|
3750
|
+
(0, import_react.createElement)(
|
|
3751
|
+
"div",
|
|
3752
|
+
{ className: "tk-tile tk-tile-ok", style: { "--tk-tc": "var(--tk-a)" } },
|
|
3753
|
+
(0, import_react.createElement)("span", { className: "tk-tile-lab" }, t("syncRemoteNow", { remote: status.remote }))
|
|
3754
|
+
),
|
|
3755
|
+
...stateLine.map((s, i) => (0, import_react.createElement)("div", { key: i, className: "bt-sub", style: { margin: "2px 0" } }, s))
|
|
3756
|
+
),
|
|
3757
|
+
(0, import_react.createElement)(
|
|
3758
|
+
"div",
|
|
3759
|
+
{ style: { display: "flex", gap: 8, alignItems: "center", flexWrap: "wrap" } },
|
|
3760
|
+
(0, import_react.createElement)("input", {
|
|
3761
|
+
className: "bt-filter",
|
|
3762
|
+
type: "text",
|
|
3763
|
+
value: url,
|
|
3764
|
+
placeholder: t("syncRemotePlaceholder"),
|
|
3765
|
+
onChange: (e) => {
|
|
3766
|
+
setUrl(e.target.value);
|
|
3767
|
+
},
|
|
3768
|
+
style: { flex: "1 1 260px" },
|
|
3769
|
+
"aria-label": t("syncRemoteLabel")
|
|
3770
|
+
}),
|
|
3771
|
+
status === void 0 ? (0, import_react.createElement)("button", { className: "bt-btn bt-btn-primary", type: "button", disabled: busy !== "" || url.trim() === "", onClick: () => act("setup") }, busy === "setup" ? t("syncBusy") : t("syncEnable")) : (0, import_react.createElement)("button", { className: "bt-btn", type: "button", disabled: busy !== "" || url.trim() === "", onClick: () => act("setup") }, busy === "setup" ? t("syncBusy") : t("syncUpdate")),
|
|
3772
|
+
status !== void 0 ? (0, import_react.createElement)("button", { className: "bt-btn bt-btn-primary", type: "button", disabled: busy !== "", onClick: () => {
|
|
3773
|
+
setNotice(null);
|
|
3774
|
+
act("now");
|
|
3775
|
+
} }, busy === "now" ? t("syncBusy") : t("syncNowLabel")) : null
|
|
3776
|
+
),
|
|
3777
|
+
notice !== null ? (0, import_react.createElement)("div", { className: "bt-banner", style: { marginTop: 8 } }, notice) : null,
|
|
3778
|
+
(0, import_react.createElement)("p", { className: "bt-sub", style: { marginTop: 8 } }, t("syncScopeNote"))
|
|
3779
|
+
);
|
|
3780
|
+
}
|
|
3781
|
+
var SETTINGS_TABS = ["cmds", "matrix", "sem", "sync", "env"];
|
|
3348
3782
|
function Panel({ t, locale, navigate, slim }) {
|
|
3349
3783
|
useLocaleSync(locale);
|
|
3350
3784
|
const { state, setState, error, setError, reload, generationRef } = useTakeoverPolling();
|
|
@@ -3370,7 +3804,7 @@ window.__ModuleLoader__.load({
|
|
|
3370
3804
|
};
|
|
3371
3805
|
const tabId = (k) => `${uid}tab-${k}`;
|
|
3372
3806
|
const paneId = (k) => `${uid}pane-${k}`;
|
|
3373
|
-
const tabLabel = { cmds: t("tabCmds"), matrix: t("tabMatrix"), sem: t("tabSemantics") };
|
|
3807
|
+
const tabLabel = { cmds: t("tabCmds"), matrix: t("tabMatrix"), sem: t("tabSemantics"), sync: t("tabSync"), env: t("tabEnv") };
|
|
3374
3808
|
const onTabsKeyDown = (e) => {
|
|
3375
3809
|
const i = SETTINGS_TABS.indexOf(tab);
|
|
3376
3810
|
const n = SETTINGS_TABS.length;
|
|
@@ -3470,6 +3904,16 @@ window.__ModuleLoader__.load({
|
|
|
3470
3904
|
(0, import_react.createElement)("p", null, t("noteBody")),
|
|
3471
3905
|
(0, import_react.createElement)("p", null, t("noteBodyPending"))
|
|
3472
3906
|
)
|
|
3907
|
+
),
|
|
3908
|
+
// 换机(0.2.0):卡同步状态一目了然 + 仓库地址启用 + 立即同步
|
|
3909
|
+
pane(
|
|
3910
|
+
"sync",
|
|
3911
|
+
(0, import_react.createElement)(SyncCard, { t, status: state?.syncStatus, setState, setError, generationRef })
|
|
3912
|
+
),
|
|
3913
|
+
// 环境备份(0.2.0 wave2):全家桶加密备份 + 预演还原 + 回滚
|
|
3914
|
+
pane(
|
|
3915
|
+
"env",
|
|
3916
|
+
(0, import_react.createElement)(EnvPane, { t, backups: state?.envBackup?.backups ?? [], reload, setError })
|
|
3473
3917
|
)
|
|
3474
3918
|
),
|
|
3475
3919
|
// 工作台去留(页签外常驻,不留死入口):宿主 0.2 右侧栏/composer 挂载时(slim)一行指引指向
|