@takboo/dsh-coopanion 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/desktop/main.cjs +19 -15
- package/desktop/tray-state.cjs +10 -5
- package/dist/bridge.js +4 -1
- package/dist/bridge.js.map +2 -2
- package/dist/client.js +371 -7
- package/dist/index.js +333 -8
- package/dist/index.js.map +4 -4
- package/docs/release-notes.md +13 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +5 -4
- package/scripts/check-package.mjs +1 -1
- package/src/bridge.ts +4 -1
- package/src/client/index.ts +21 -3
- package/src/client/locale-sync.ts +34 -0
- package/src/client/notification-copy.ts +3 -2
- package/src/index.ts +32 -4
- package/tests/desktop.mjs +15 -3
- package/tests/install.mjs +8 -0
- package/tests/locale-client.mjs +25 -0
- package/tests/locale-sync.test.ts +36 -0
- package/tests/locale-ui.mjs +79 -0
- package/tests/plugin.test.ts +27 -1
- package/tests/presentation.test.js +16 -1
- package/tests/session-replies-ui.mjs +1 -1
- package/tests/ui.mjs +1 -1
- package/web/index.html +42 -42
- package/web/locale.d.ts +6 -0
- package/web/locale.js +76 -0
- package/web/notification-ui.js +3 -2
- package/web/pet.js +102 -50
- package/web/session-ui.js +3 -2
- package/web/style.css +2 -0
package/dist/client.js
CHANGED
|
@@ -20112,8 +20112,307 @@ var notificationRequests = {
|
|
|
20112
20112
|
snooze: external_exports.object({ interactionId: id, generation: counter }).strict()
|
|
20113
20113
|
};
|
|
20114
20114
|
|
|
20115
|
-
//
|
|
20115
|
+
// web/locale.js
|
|
20116
|
+
function petLanguage(locale = "en") {
|
|
20117
|
+
return /^zh(?:-|$)/i.test(locale) ? "zh" : "en";
|
|
20118
|
+
}
|
|
20116
20119
|
var zh2 = {
|
|
20120
|
+
defaultName: "DeepSeek \u5927\u80A5\u9C7C",
|
|
20121
|
+
title: "DeepSeek \u5927\u80A5\u9C7C \xB7 Harness",
|
|
20122
|
+
words: { neutral: "\u5E73\u9759", happy: "\u5F00\u5FC3", wink: "\u7728\u773C", love: "\u559C\u6B22", shy: "\u5BB3\u7F9E", surprised: "\u60CA\u8BB6", angry: "\u751F\u6C14", sad: "\u96BE\u8FC7", sleepy: "\u72AF\u56F0", thinking: "\u601D\u8003", smug: "\u5F97\u610F", pout: "\u561F\u5634", worried: "\u62C5\u5FC3", determined: "\u8BA4\u771F", flustered: "\u614C\u5F20", scared: "\u5BB3\u6015", excited: "\u671F\u5F85", cry: "\u5927\u54ED", confused: "\u7591\u60D1", stand: "\u7AD9\u8D77", jump: "\u8DF3", hop: "\u5C0F\u8DF3", look: "\u5F20\u671B", turn: "\u8F6C\u8EAB", nod: "\u70B9\u5934", shake: "\u6447\u5934", spin: "\u8F6C\u5708", sit: "\u5750\u4E0B", sleep: "\u7761\u89C9", dizzy: "\u6655", walk: "\u6563\u6B65", run: "\u8DD1", wave: "\u62DB\u624B", bow: "\u97A0\u8EAC", shiver: "\u53D1\u6296", flap: "\u6251\u817E", dance: "\u8DF3\u821E" },
|
|
20123
|
+
settingFailed: "\u8BBE\u7F6E\u672A\u80FD\u4FDD\u5B58",
|
|
20124
|
+
settingFailedBody: "\u8BF7\u56DE\u5230 Harness \u68C0\u67E5\u63D2\u4EF6\u8BBE\u7F6E\u3002",
|
|
20125
|
+
sessionUnavailable: "\u4F1A\u8BDD\u5C1A\u672A\u5C31\u7EEA",
|
|
20126
|
+
sessionUnavailableBody: "\u8BF7\u5148\u56DE\u5230 Harness \u6253\u5F00\u8FD9\u4E2A\u4F1A\u8BDD\uFF0C\u7136\u540E\u518D\u53D1\u9001\u6D88\u606F\u3002",
|
|
20127
|
+
messageFailed: "\u6D88\u606F\u672A\u80FD\u53D1\u9001",
|
|
20128
|
+
messageFailedBody: "\u8BF7\u56DE\u5230 Harness \u68C0\u67E5\u4F1A\u8BDD\u72B6\u6001\u3002",
|
|
20129
|
+
stoppedBody: "\u5148\u505C\u5728\u8FD9\u91CC\uFF0C\u968F\u65F6\u7EE7\u7EED\u3002",
|
|
20130
|
+
interruptedBody: "\u8FD9\u6BB5\u4EFB\u52A1\u4E2D\u65AD\u4E86\uFF0C\u966A\u4F60\u56DE\u53BB\u770B\u770B\u3002",
|
|
20131
|
+
demoTitle: "\u5DE5\u4F5C\u7684\u65F6\u5019\uFF0C\n\u5927\u80A5\u9C7C\u966A\u7740\u3002",
|
|
20132
|
+
demoIntro: "\u4F4F\u5728\u684C\u9762\u4E0A\u7684 DeepSeek \u5927\u80A5\u9C7C\u3002\n\u70B9\u70B9\u5979\u3001\u62D6\u7740\u5979\u8D70\uFF0C\u6216\u548C\u5979\u8BF4\u53E5\u8BDD\u3002",
|
|
20133
|
+
demoStatus: "\u6D4F\u89C8\u5668\u6F14\u793A \xB7 \u6A21\u62DF Harness \u4E8B\u4EF6",
|
|
20134
|
+
demoHint: "\u684C\u9762\u63D2\u4EF6\u4F1A\u8BA2\u9605\u771F\u5B9E\u4EFB\u52A1\uFF0C\u65E0\u9700\u53E6\u586B API Key\u3002",
|
|
20135
|
+
demoButtons: { thinking: "\u601D\u8003", talking: "\u56DE\u590D", working: "\u5DE5\u4F5C", waiting: "\u7B49\u4F60\u786E\u8BA4", happy: "\u4EFB\u52A1\u5B8C\u6210", error: "\u9047\u5230\u95EE\u9898", idle: "\u7A7A\u95F2", long: "\u957F\u56DE\u590D", background: "\u540E\u53F0\u5B8C\u6210" },
|
|
20136
|
+
demoSession: "\u6F14\u793A\u4F1A\u8BDD",
|
|
20137
|
+
demoOther: "\u53E6\u4E00\u4E2A\u60F3\u6CD5",
|
|
20138
|
+
demoPrompt: "\u8BA9\u89D2\u8272\u5728\u601D\u8003\u4E0E\u56DE\u590D\u65F6\u505A\u51FA\u5BF9\u5E94\u7684\u52A8\u4F5C",
|
|
20139
|
+
demoOtherPrompt: "\u91CD\u505A\u89D2\u8272\u83DC\u5355\u4E0E\u4F1A\u8BDD\u9009\u62E9\uFF0C\u8BA9\u5B83\u66F4\u50CF\u4F19\u4F34",
|
|
20140
|
+
demoTexts: { thinking: "\u8BA9\u6211\u60F3\u4E00\u60F3\uFF0C\u600E\u6837\u628A\u8FD9\u4E2A\u529F\u80FD\u505A\u597D\u2026", talking: "\u6211\u60F3\u5230\u4E86\u3002\u8BA9\u601D\u8003\u3001\u8BF4\u8BDD\u4E0E\u5DE5\u4F5C\u5404\u6709\u81EA\u5DF1\u7684\u52A8\u4F5C\uFF0C\u5C31\u80FD\u4E00\u773C\u770B\u51FA\u8FD9\u6BB5\u5BF9\u8BDD\u5728\u505A\u4EC0\u4E48\u3002", working: "\u6B63\u5728\u770B\u6587\u4EF6 \xB7 src/index.ts", waiting: "\u4E0B\u4E00\u6B65\u9700\u8981\u4F60\u786E\u8BA4\u3002\u771F\u5B9E\u63D2\u4EF6\u4F1A\u5F15\u5BFC\u4F60\u56DE\u5230 Harness\u3002", happy: "\u4EFB\u52A1\u5B8C\u6210\u5566\uFF01\u8981\u4E0D\u8981\u4F11\u606F\u4E00\u4E0B\uFF1F\u{1F433}", error: "\u4EFB\u52A1\u9047\u5230\u4E86\u95EE\u9898\uFF0C\u8BF7\u56DE\u5230 Harness \u67E5\u770B\u8BE6\u60C5\u3002" },
|
|
20141
|
+
demoLong: "\u52A8\u753B\u3001\u6C14\u6CE1\u548C\u4F1A\u8BDD\u7684\u5C55\u793A\u5DF2\u7ECF\u5206\u5F00\u4E86\u3002\n\n" + "\u601D\u8003\u548C\u5DE5\u5177\u8C03\u7528\u7531\u52A8\u4F5C\u8868\u8FBE\uFF0C\u6700\u7EC8\u56DE\u590D\u53EF\u4EE5\u5C55\u5F00\u9605\u8BFB\u3002\u957F\u5185\u5BB9\u4F1A\u5B8C\u6574\u4FDD\u7559\uFF0C\u4E0D\u4F1A\u5728\u4E00\u5343\u4E8C\u767E\u5B57\u5904\u622A\u65AD\u3002\n\n".repeat(35) + "\u6700\u540E\u4E00\u53E5\uFF1A\u8FD9\u4EFD\u56DE\u590D\u5B8C\u6574\u5730\u4FDD\u7559\u4E0B\u6765\u4E86\u3002",
|
|
20142
|
+
demoBackground: "\u540E\u53F0\u4F1A\u8BDD\u5DF2\u7ECF\u5B8C\u6210\uFF0C\u8FD9\u662F\u5B83\u7684\u6700\u7EC8\u56DE\u590D\u3002",
|
|
20143
|
+
demoReply: (text) => `\u6536\u5230\u300C${text}\u300D\uFF01\u8FD9\u662F\u6F14\u793A\u56DE\u590D\u3002\u771F\u5B9E\u63D2\u4EF6\u4F1A\u4F7F\u7528 Harness \u7684\u6A21\u578B\u3002`,
|
|
20144
|
+
labels: { idle: "\u5728\u8FD9\u91CC\u966A\u4F60", thinking: "\u6B63\u5728\u601D\u8003", talking: "\u6B63\u5728\u56DE\u590D", working: "\u6B63\u5728\u5FD9", waiting: "\u7B49\u4F60\u786E\u8BA4", happy: "\u5B8C\u6210\u5566", error: "\u9700\u8981\u5173\u6CE8", sleeping: "\u4F11\u606F\u4E2D" },
|
|
20145
|
+
stage: "\u684C\u5BA0\u6D3B\u52A8\u533A\u57DF",
|
|
20146
|
+
dismiss: "\u6536\u8D77\u6C14\u6CE1",
|
|
20147
|
+
reveal: "\u7ACB\u5373\u663E\u793A",
|
|
20148
|
+
expand: "\u5C55\u5F00\u5B8C\u6574\u56DE\u590D \u2197",
|
|
20149
|
+
back: "\u56DE\u5230\u4F1A\u8BDD \u2197",
|
|
20150
|
+
readerClose: "\u6536\u8D77\u5B8C\u6574\u56DE\u590D",
|
|
20151
|
+
conversationsCaption: "\u4E00\u8D77\u5DE5\u4F5C\u7684\u7247\u6BB5",
|
|
20152
|
+
conversationsTitle: "\u8FD9\u6B21\uFF0C\u966A\u54EA\u4E00\u6BB5\uFF1F",
|
|
20153
|
+
conversationsClose: "\u6536\u8D77\u5BF9\u8BDD\u6C14\u6CE1",
|
|
20154
|
+
conversationsIntro: "\u56FA\u5B9A\u966A\u7740\u4F60\u9009\u7684\u8FD9\u6BB5\u3002\u540E\u53F0\u7EE7\u7EED\u5DE5\u4F5C\uFF0C\u56DE\u590D\u7559\u5728\u8FD9\u91CC\uFF0C\u9047\u5230\u8981\u7D27\u4E8B\u5C31\u53EB\u4F60\u3002",
|
|
20155
|
+
all: "\u5168\u90E8",
|
|
20156
|
+
pending: "\u5F85\u67E5\u770B",
|
|
20157
|
+
searchPlaceholder: "\u627E\u63D0\u95EE\u3001\u9879\u76EE\u6216\u7F16\u53F7\u2026",
|
|
20158
|
+
searchLabel: "\u641C\u7D22\u4F1A\u8BDD",
|
|
20159
|
+
switchConversation: "\u5207\u6362\u5F53\u524D\u5BF9\u8BDD",
|
|
20160
|
+
openCurrent: "\u6253\u5F00\u5F53\u524D\u4F1A\u8BDD \u2197",
|
|
20161
|
+
chatTitle: "\u6211\u5728\uFF0C\u6162\u6162\u8BF4\u3002",
|
|
20162
|
+
chatClose: "\u5173\u95ED\u804A\u5929",
|
|
20163
|
+
changeConversation: "\u6362\u4E00\u6BB5 \u203A",
|
|
20164
|
+
readFull: "\u8BFB\u5B8C\u6574\u56DE\u590D \u2197",
|
|
20165
|
+
interact: "\u548C\u89D2\u8272\u4E92\u52A8",
|
|
20166
|
+
wave: "\u6253\u4E2A\u62DB\u547C",
|
|
20167
|
+
cheer: "\u7ED9\u6211\u6253\u6C14",
|
|
20168
|
+
messagePlaceholder: "\u63A5\u7740\u8FD9\u6BB5\u5BF9\u8BDD\u8BF4\u70B9\u4EC0\u4E48\u2026",
|
|
20169
|
+
messageLabel: "\u6D88\u606F",
|
|
20170
|
+
sendHint: "\u2318 / Ctrl + Enter \u53D1\u9001",
|
|
20171
|
+
send: "\u634E\u7ED9\u8FD9\u6BB5\u5BF9\u8BDD \u2197",
|
|
20172
|
+
companion: "\u684C\u4E0A\u7684\u5C0F\u4F19\u4F34",
|
|
20173
|
+
menuClose: "\u6536\u8D77\u4F19\u4F34\u83DC\u5355",
|
|
20174
|
+
appearance: "\u6362\u4E2A\u6A21\u6837",
|
|
20175
|
+
appearanceHint: "\u89D2\u8272 \xB7 \u914D\u8272 \xB7 \u52A8\u4F5C",
|
|
20176
|
+
say: "\u8BF4\u53E5\u8BDD",
|
|
20177
|
+
sayHint: "\u63A5\u7740\u4F60\u7684\u4F1A\u8BDD\u804A",
|
|
20178
|
+
roam: "\u6563\u6563\u6B65",
|
|
20179
|
+
roamHint: "\u81EA\u5728\u8D70\u52A8",
|
|
20180
|
+
sleep: "\u6B47\u4E00\u4F1A",
|
|
20181
|
+
sleepHint: "\u5FD9\u8D77\u6765\u4F1A\u9192",
|
|
20182
|
+
notices: "\u63D0\u9192\u6211",
|
|
20183
|
+
noticesHint: "\u8981\u7D27\u4E8B\u4E0D\u6F0F\u6389",
|
|
20184
|
+
sound: "\u5C0F\u5C0F\u58F0",
|
|
20185
|
+
soundHint: "\u52A8\u4F5C\u4E0E\u8BF4\u8BDD\u97F3\u6548",
|
|
20186
|
+
hide: "\u6682\u65F6\u85CF\u8D77\u6765",
|
|
20187
|
+
source: "\u6E90\u7801 \xB7 AGPL \u2197",
|
|
20188
|
+
sourceHint: "\u4E0B\u8F7D\u5F53\u524D\u7248\u672C\u5B8C\u6574\u5BF9\u5E94\u6E90\u7801",
|
|
20189
|
+
characters: "\u89D2\u8272\u4E0E\u52A8\u753B",
|
|
20190
|
+
charactersClose: "\u5173\u95ED\u89D2\u8272\u9762\u677F",
|
|
20191
|
+
selectCharacter: "\u9009\u62E9\u89D2\u8272",
|
|
20192
|
+
character: "\u89D2\u8272",
|
|
20193
|
+
outfit: "\u914D\u8272 / \u6362\u88C5",
|
|
20194
|
+
characterScheme: "\u89D2\u8272\u914D\u8272",
|
|
20195
|
+
preview: "\u89D2\u8272\u52A8\u753B\u9884\u89C8",
|
|
20196
|
+
previewAction: "\u9884\u89C8\u52A8\u4F5C",
|
|
20197
|
+
play: "\u64AD\u653E\u52A8\u4F5C",
|
|
20198
|
+
useCharacter: "\u4F7F\u7528\u89D2\u8272",
|
|
20199
|
+
import: "\u5BFC\u5165\u89D2\u8272\u5305",
|
|
20200
|
+
remove: "\u5220\u9664",
|
|
20201
|
+
characterHint: "\u652F\u6301 Coopanion API 2 ZIP \u89D2\u8272\u5305\uFF1B\u89D2\u8272\u548C\u914D\u8272\u4F1A\u5728\u91CD\u542F\u540E\u4FDD\u7559\u3002",
|
|
20202
|
+
using: "\u6B63\u5728\u4F7F\u7528",
|
|
20203
|
+
useScheme: "\u4F7F\u7528\u8FD9\u4E2A\u914D\u8272",
|
|
20204
|
+
useOutfit: "\u4F7F\u7528\u8FD9\u4E2A\u642D\u914D",
|
|
20205
|
+
customOutfit: "\u81EA\u5B9A\u4E49\u642D\u914D",
|
|
20206
|
+
defaultScheme: "\u9ED8\u8BA4",
|
|
20207
|
+
imported: "\u5DF2\u5BFC\u5165\u3002\u9884\u89C8\u6EE1\u610F\u540E\u70B9\u51FB\u4F7F\u7528\u89D2\u8272\u3002",
|
|
20208
|
+
switched: "\u5DF2\u5207\u6362\uFF0C\u91CD\u542F\u540E\u4F1A\u4FDD\u7559\u8FD9\u4E2A\u89D2\u8272\u548C\u914D\u8272\u3002",
|
|
20209
|
+
removed: "\u5DF2\u5220\u9664\u672C\u5730\u89D2\u8272\u5305\u3002",
|
|
20210
|
+
packTooLarge: "\u89D2\u8272\u5305\u4E0D\u80FD\u8D85\u8FC7 128 MiB",
|
|
20211
|
+
noSession: "\u8FD8\u6CA1\u6709\u5BF9\u8BDD",
|
|
20212
|
+
noConversation: "\u8FD8\u6CA1\u6709\u4F1A\u8BDD",
|
|
20213
|
+
session: "\u4F1A\u8BDD",
|
|
20214
|
+
sessionReply: "\u4F1A\u8BDD\u56DE\u590D",
|
|
20215
|
+
focused: "\u5173\u6CE8",
|
|
20216
|
+
unread: "1 \u4EFD\u672A\u8BFB",
|
|
20217
|
+
notOpen: "\u672A\u6253\u5F00",
|
|
20218
|
+
connected: "\u6709\u4F1A\u8BDD\u76F8\u4F34",
|
|
20219
|
+
emptySearch: "\u6CA1\u627E\u5230\u8FD9\u6BB5\u5BF9\u8BDD\u3002\u8BD5\u8BD5\u63D0\u95EE\u91CC\u7684\u8BCD\u6216\u9879\u76EE\u540D\uFF1F",
|
|
20220
|
+
emptyPending: "\u90FD\u770B\u8FC7\u5566\uFF0C\u5B89\u5FC3\u505A\u624B\u8FB9\u7684\u4E8B\u3002",
|
|
20221
|
+
emptySessions: "\u8FD8\u6CA1\u6709\u53EF\u7528\u7684\u5BF9\u8BDD\u3002\u5148\u5728 Harness \u4E2D\u6253\u5F00\u4E00\u6BB5\u5BF9\u8BDD\uFF0C\u6211\u5C31\u80FD\u542C\u89C1\u5B83\u3002",
|
|
20222
|
+
noChat: "\u5148\u5728 Harness \u4E2D\u6253\u5F00\u4E00\u6BB5\u5BF9\u8BDD\uFF0C\u5C31\u53EF\u4EE5\u4ECE\u8FD9\u91CC\u548C\u6211\u8BF4\u8BDD\u3002",
|
|
20223
|
+
unavailableChat: "\u8FD9\u6BB5\u5BF9\u8BDD\u5C1A\u672A\u5728 Harness \u4E2D\u6253\u5F00\uFF0C\u8BF7\u5148\u56DE\u53BB\u6253\u5F00\u5B83\u3002",
|
|
20224
|
+
sleepBusy: "\u6B63\u5728\u5FD9\uFF0C\u5B8C\u6210\u540E\u518D\u4F11\u606F",
|
|
20225
|
+
sleepWake: "\u6709\u65B0\u7684\u4EFB\u52A1\u4F1A\u81EA\u52A8\u9192\u6765",
|
|
20226
|
+
issueError: "\u4EFB\u52A1\u9047\u5230\u4E86\u95EE\u9898\uFF0C\u8BF7\u56DE\u5230 Harness \u67E5\u770B\u8BE6\u60C5\u3002",
|
|
20227
|
+
issueWaiting: "\u4EFB\u52A1\u6682\u65F6\u505C\u4E0B\u4E86\uFF0C\u8BF7\u56DE\u5230 Harness \u770B\u770B\u3002",
|
|
20228
|
+
timeUnknown: "\u65F6\u95F4\u672A\u8BB0\u5F55",
|
|
20229
|
+
petLabel: (name) => `${name}\uFF0C\u70B9\u51FB\u4E92\u52A8\uFF0C\u53CC\u51FB\u804A\u5929\uFF0C\u53F3\u952E\u83DC\u5355\uFF0C\u62D6\u52A8\u79FB\u52A8`,
|
|
20230
|
+
finalReply: (name) => `${name}\u7684\u6700\u7EC8\u56DE\u590D`,
|
|
20231
|
+
recent: (text) => `\u6700\u8FD1\uFF1A${text}`,
|
|
20232
|
+
chatTarget: (label) => `\u5F53\u524D\u5BF9\u8BDD\uFF1A${label}\u3002\u70B9\u51FB\u5207\u6362`,
|
|
20233
|
+
chatHelp: (label) => `\u6D88\u606F\u4EA4\u7ED9\u300C${label}\u300D\uFF0C\u5B8C\u6210\u540E\u53EA\u5C55\u793A\u6700\u7EC8\u56DE\u590D\u3002`,
|
|
20234
|
+
activity: (busy, unread) => `${busy} \u6BB5\u8FDB\u884C\u4E2D \xB7 ${unread} \u4EFD\u672A\u8BFB\u56DE\u590D`,
|
|
20235
|
+
authorCredit: (author, credits, license) => `\u4F5C\u8005\uFF1A${author} \xB7 ${credits} \xB7 \u8BB8\u53EF\uFF1A${license}`,
|
|
20236
|
+
unknownAuthor: "\u672A\u6CE8\u660E",
|
|
20237
|
+
builtinLicense: "\u4EE3\u7801 AGPL-3.0-or-later\uFF1B\u7D20\u6750\u89C1\u6743\u5229\u58F0\u660E",
|
|
20238
|
+
authorLicense: "\u7531\u89D2\u8272\u4F5C\u8005\u6CE8\u660E",
|
|
20239
|
+
operationError: (detail) => `\u64CD\u4F5C\u672A\u5B8C\u6210\uFF1A${detail}`,
|
|
20240
|
+
bodyError: (detail) => `\u89D2\u8272\u8FD0\u884C\u5931\u8D25\uFF1A${detail}`,
|
|
20241
|
+
builtinError: (detail) => `\u65E0\u6CD5\u52A0\u8F7D\u5185\u7F6E\u89D2\u8272\uFF1A${detail}`,
|
|
20242
|
+
previewError: (detail) => `\u9884\u89C8\u5931\u8D25\uFF1A${detail}`,
|
|
20243
|
+
restoreError: (detail) => `\u5DF2\u6062\u590D\u5185\u7F6E\u5927\u80A5\u9C7C\uFF1A${detail}`,
|
|
20244
|
+
loadError: (detail) => `\u89D2\u8272\u52A0\u8F7D\u5931\u8D25\uFF1A${detail}`,
|
|
20245
|
+
trayOpen: "\u56DE\u5230\u5F53\u524D\u4F1A\u8BDD",
|
|
20246
|
+
traySwitch: "\u5207\u6362\u966A\u4F34\u4F1A\u8BDD",
|
|
20247
|
+
trayChat: "\u8BF4\u53E5\u8BDD",
|
|
20248
|
+
trayCharacters: "\u89D2\u8272\u4E0E\u914D\u8272",
|
|
20249
|
+
trayRoam: "\u81EA\u5728\u8D70\u52A8",
|
|
20250
|
+
traySleep: "\u4F11\u606F\u4E00\u4E0B\uFF08\u65B0\u4EFB\u52A1\u4F1A\u5524\u9192\uFF09",
|
|
20251
|
+
trayNotices: "\u4EFB\u52A1\u63D0\u9192",
|
|
20252
|
+
traySound: "\u52A8\u4F5C\u4E0E\u8BF4\u8BDD\u97F3\u6548",
|
|
20253
|
+
trayShow: "\u663E\u793A\u4F19\u4F34",
|
|
20254
|
+
trayQuit: "\u5173\u95ED\u684C\u5BA0",
|
|
20255
|
+
trayNeeds: " \xB7 \u9700\u8981\u4F60",
|
|
20256
|
+
trayUnread: (n) => ` \xB7 ${n} \u4EFD\u672A\u8BFB`,
|
|
20257
|
+
trayPending: (unread, pending) => `\u5F85\u67E5\u770B \xB7 ${unread} \u4EFD\u56DE\u590D \xB7 ${pending} \u6BB5\u9700\u8981\u4F60`,
|
|
20258
|
+
trayTooltip: (name, mood, label, busy, pending, unread) => `${name} \xB7 ${mood}
|
|
20259
|
+
\u5173\u6CE8\uFF1A${label}
|
|
20260
|
+
${busy} \u6BB5\u8FDB\u884C\u4E2D \xB7 ${pending} \u6BB5\u9700\u8981\u4F60 \xB7 ${unread} \u4EFD\u672A\u8BFB\u56DE\u590D`
|
|
20261
|
+
};
|
|
20262
|
+
var en2 = {
|
|
20263
|
+
defaultName: "DeepSeek Whale",
|
|
20264
|
+
title: "DeepSeek Whale \xB7 Harness",
|
|
20265
|
+
words: { neutral: "Neutral", happy: "Happy", wink: "Wink", love: "Love", shy: "Shy", surprised: "Surprised", angry: "Angry", sad: "Sad", sleepy: "Sleepy", thinking: "Thinking", smug: "Smug", pout: "Pout", worried: "Worried", determined: "Determined", flustered: "Flustered", scared: "Scared", excited: "Excited", cry: "Cry", confused: "Confused", stand: "Stand", jump: "Jump", hop: "Hop", look: "Look around", turn: "Turn", nod: "Nod", shake: "Shake head", spin: "Spin", sit: "Sit", sleep: "Sleep", dizzy: "Dizzy", walk: "Walk", run: "Run", wave: "Wave", bow: "Bow", shiver: "Shiver", flap: "Flap", dance: "Dance" },
|
|
20266
|
+
settingFailed: "Settings were not saved",
|
|
20267
|
+
settingFailedBody: "Open Harness to check the plugin settings.",
|
|
20268
|
+
sessionUnavailable: "Conversation not ready",
|
|
20269
|
+
sessionUnavailableBody: "Open this conversation in Harness before sending a message.",
|
|
20270
|
+
messageFailed: "Message was not sent",
|
|
20271
|
+
messageFailedBody: "Open Harness to check the conversation state.",
|
|
20272
|
+
stoppedBody: "Paused here. Continue whenever you are ready.",
|
|
20273
|
+
interruptedBody: "This task was interrupted. Open the conversation to check it.",
|
|
20274
|
+
demoTitle: "While you work,\nWhale keeps you company.",
|
|
20275
|
+
demoIntro: "Your DeepSeek Whale desktop companion.\nSay hello, drag her around, or continue a conversation.",
|
|
20276
|
+
demoStatus: "Browser demo \xB7 Simulated Harness events",
|
|
20277
|
+
demoHint: "The desktop plugin follows real tasks. No extra API key is needed.",
|
|
20278
|
+
demoButtons: { thinking: "Think", talking: "Reply", working: "Work", waiting: "Approval", happy: "Finished", error: "Error", idle: "Idle", long: "Long reply", background: "Background reply" },
|
|
20279
|
+
demoSession: "Demo conversation",
|
|
20280
|
+
demoOther: "Another idea",
|
|
20281
|
+
demoPrompt: "Match the character\u2019s actions to thinking and replying",
|
|
20282
|
+
demoOtherPrompt: "Make the character menu and conversation picker feel like a companion",
|
|
20283
|
+
demoTexts: { thinking: "Let me think about how to do this\u2026", talking: "Thinking, replying and working each have their own actions, so you can see what this conversation is doing.", working: "Reading files \xB7 src/index.ts", waiting: "The next step needs your approval. The installed plugin opens Harness.", happy: "Finished! Shall we take a rest? \u{1F433}", error: "This task needs attention. Open Harness for details." },
|
|
20284
|
+
demoLong: "Animation, bubbles and conversations are presented separately.\n\n" + "Actions show thinking and tool use. Final replies open in full and remain complete, including long content.\n\n".repeat(35) + "The complete reply has been preserved.",
|
|
20285
|
+
demoBackground: "The background conversation finished. Here is its final reply.",
|
|
20286
|
+
demoReply: (text) => `Received \u201C${text}\u201D! This is a demo reply. The installed plugin uses the Harness model.`,
|
|
20287
|
+
labels: { idle: "Here for you", thinking: "Thinking", talking: "Replying", working: "Working", waiting: "Waiting for you", happy: "Finished", error: "Needs attention", sleeping: "Resting" },
|
|
20288
|
+
stage: "Desktop pet activity area",
|
|
20289
|
+
dismiss: "Dismiss bubble",
|
|
20290
|
+
reveal: "Show now",
|
|
20291
|
+
expand: "Read full reply \u2197",
|
|
20292
|
+
back: "Back to conversation \u2197",
|
|
20293
|
+
readerClose: "Close full reply",
|
|
20294
|
+
conversationsCaption: "Working together",
|
|
20295
|
+
conversationsTitle: "Which conversation shall we join?",
|
|
20296
|
+
conversationsClose: "Close conversations",
|
|
20297
|
+
conversationsIntro: "Stay with the conversation you choose. Background work continues, replies stay here, and important requests get your attention.",
|
|
20298
|
+
all: "All",
|
|
20299
|
+
pending: "Inbox",
|
|
20300
|
+
searchPlaceholder: "Find a prompt, project or ID\u2026",
|
|
20301
|
+
searchLabel: "Search conversations",
|
|
20302
|
+
switchConversation: "Switch current conversation",
|
|
20303
|
+
openCurrent: "Open current conversation \u2197",
|
|
20304
|
+
chatTitle: "I\u2019m here. Take your time.",
|
|
20305
|
+
chatClose: "Close chat",
|
|
20306
|
+
changeConversation: "Switch \u203A",
|
|
20307
|
+
readFull: "Read full reply \u2197",
|
|
20308
|
+
interact: "Interact with the character",
|
|
20309
|
+
wave: "Say hello",
|
|
20310
|
+
cheer: "Cheer me on",
|
|
20311
|
+
messagePlaceholder: "Continue this conversation\u2026",
|
|
20312
|
+
messageLabel: "Message",
|
|
20313
|
+
sendHint: "\u2318 / Ctrl + Enter to send",
|
|
20314
|
+
send: "Send to this conversation \u2197",
|
|
20315
|
+
companion: "Your desktop companion",
|
|
20316
|
+
menuClose: "Close companion menu",
|
|
20317
|
+
appearance: "Change appearance",
|
|
20318
|
+
appearanceHint: "Character \xB7 Colours \xB7 Actions",
|
|
20319
|
+
say: "Say something",
|
|
20320
|
+
sayHint: "Continue your conversation",
|
|
20321
|
+
roam: "Take a walk",
|
|
20322
|
+
roamHint: "Roam freely",
|
|
20323
|
+
sleep: "Take a rest",
|
|
20324
|
+
sleepHint: "Wake when work starts",
|
|
20325
|
+
notices: "Keep me posted",
|
|
20326
|
+
noticesHint: "Remember important requests",
|
|
20327
|
+
sound: "A little sound",
|
|
20328
|
+
soundHint: "Action and reply sounds",
|
|
20329
|
+
hide: "Hide for now",
|
|
20330
|
+
source: "Source \xB7 AGPL \u2197",
|
|
20331
|
+
sourceHint: "Download the complete source for this version",
|
|
20332
|
+
characters: "Characters and animation",
|
|
20333
|
+
charactersClose: "Close character panel",
|
|
20334
|
+
selectCharacter: "Select character",
|
|
20335
|
+
character: "Character",
|
|
20336
|
+
outfit: "Colours / Outfit",
|
|
20337
|
+
characterScheme: "Character colours",
|
|
20338
|
+
preview: "Character animation preview",
|
|
20339
|
+
previewAction: "Preview action",
|
|
20340
|
+
play: "Play action",
|
|
20341
|
+
useCharacter: "Use character",
|
|
20342
|
+
import: "Import character pack",
|
|
20343
|
+
remove: "Delete",
|
|
20344
|
+
characterHint: "Coopanion API 2 ZIP packs. Characters and colours survive restarts.",
|
|
20345
|
+
using: "In use",
|
|
20346
|
+
useScheme: "Use these colours",
|
|
20347
|
+
useOutfit: "Use this outfit",
|
|
20348
|
+
customOutfit: "Custom outfit",
|
|
20349
|
+
defaultScheme: "Default",
|
|
20350
|
+
imported: "Imported. Preview the character, then choose Use character.",
|
|
20351
|
+
switched: "Changed. This character and its colours will survive restarts.",
|
|
20352
|
+
removed: "Local character pack deleted.",
|
|
20353
|
+
packTooLarge: "Character packs cannot exceed 128 MiB",
|
|
20354
|
+
noSession: "No conversation yet",
|
|
20355
|
+
noConversation: "No conversation yet",
|
|
20356
|
+
session: "Conversation",
|
|
20357
|
+
sessionReply: "Conversation reply",
|
|
20358
|
+
focused: "Focused",
|
|
20359
|
+
unread: "1 unread reply",
|
|
20360
|
+
notOpen: "Not open",
|
|
20361
|
+
connected: "Conversation connected",
|
|
20362
|
+
emptySearch: "No matching conversation. Try a word from the prompt or project name.",
|
|
20363
|
+
emptyPending: "All read. Carry on with your work.",
|
|
20364
|
+
emptySessions: "No conversation is available. Open one in Harness to get started.",
|
|
20365
|
+
noChat: "Open a conversation in Harness to chat here.",
|
|
20366
|
+
unavailableChat: "This conversation is not open in Harness. Open it there first.",
|
|
20367
|
+
sleepBusy: "Working now. Rest when it is done.",
|
|
20368
|
+
sleepWake: "Wake automatically when new work starts.",
|
|
20369
|
+
issueError: "The task needs attention. Open Harness for details.",
|
|
20370
|
+
issueWaiting: "The task paused. Open Harness to check the next step.",
|
|
20371
|
+
timeUnknown: "Time not recorded",
|
|
20372
|
+
petLabel: (name) => `${name}, click to interact, double-click to chat, right-click for the menu, drag to move`,
|
|
20373
|
+
finalReply: (name) => `Final reply from ${name}`,
|
|
20374
|
+
recent: (text) => `Recent: ${text}`,
|
|
20375
|
+
chatTarget: (label) => `Current conversation: ${label}. Click to switch`,
|
|
20376
|
+
chatHelp: (label) => `Send to \u201C${label}\u201D. Only the final reply is shown when the task completes.`,
|
|
20377
|
+
activity: (busy, unread) => `${busy} active \xB7 ${unread} unread replies`,
|
|
20378
|
+
authorCredit: (author, credits, license) => `Author: ${author} \xB7 ${credits} \xB7 License: ${license}`,
|
|
20379
|
+
unknownAuthor: "Not specified",
|
|
20380
|
+
builtinLicense: "Code: AGPL-3.0-or-later; see artwork rights notice",
|
|
20381
|
+
authorLicense: "Specified by the character author",
|
|
20382
|
+
operationError: (detail) => `Operation failed: ${detail}`,
|
|
20383
|
+
bodyError: (detail) => `Character runtime failed: ${detail}`,
|
|
20384
|
+
builtinError: (detail) => `Cannot load the built-in character: ${detail}`,
|
|
20385
|
+
previewError: (detail) => `Preview failed: ${detail}`,
|
|
20386
|
+
restoreError: (detail) => `Built-in Whale restored: ${detail}`,
|
|
20387
|
+
loadError: (detail) => `Character failed to load: ${detail}`,
|
|
20388
|
+
trayOpen: "Open current conversation",
|
|
20389
|
+
traySwitch: "Choose companion conversation",
|
|
20390
|
+
trayChat: "Say something",
|
|
20391
|
+
trayCharacters: "Characters and colours",
|
|
20392
|
+
trayRoam: "Roam freely",
|
|
20393
|
+
traySleep: "Rest (new work wakes the pet)",
|
|
20394
|
+
trayNotices: "Task reminders",
|
|
20395
|
+
traySound: "Action and reply sounds",
|
|
20396
|
+
trayShow: "Show companion",
|
|
20397
|
+
trayQuit: "Close desktop pet",
|
|
20398
|
+
trayNeeds: " \xB7 Needs attention",
|
|
20399
|
+
trayUnread: (n) => ` \xB7 ${n} unread`,
|
|
20400
|
+
trayPending: (unread, pending) => `Inbox \xB7 ${unread} replies \xB7 ${pending} need attention`,
|
|
20401
|
+
trayTooltip: (name, mood, label, busy, pending, unread) => `${name} \xB7 ${mood}
|
|
20402
|
+
Focused: ${label}
|
|
20403
|
+
${busy} active \xB7 ${pending} need attention \xB7 ${unread} unread replies`
|
|
20404
|
+
};
|
|
20405
|
+
function petCopy(locale) {
|
|
20406
|
+
return petLanguage(locale) === "zh" ? zh2 : en2;
|
|
20407
|
+
}
|
|
20408
|
+
function appStatusBody(notice, locale) {
|
|
20409
|
+
const key = { error: "issueError", blocked: "issueWaiting", "max-tokens": "issueWaiting", stopped: "stoppedBody", interrupted: "interruptedBody" }[notice.category];
|
|
20410
|
+
if (!key || notice.body !== zh2[key] && notice.body !== en2[key]) return notice.body;
|
|
20411
|
+
return petCopy(locale)[key];
|
|
20412
|
+
}
|
|
20413
|
+
|
|
20414
|
+
// src/client/notification-copy.ts
|
|
20415
|
+
var zh3 = {
|
|
20117
20416
|
completed: "\u4EFB\u52A1\u5B8C\u6210\u5566",
|
|
20118
20417
|
approval: "\u4E0B\u4E00\u6B65\u9700\u8981\u4F60\u786E\u8BA4",
|
|
20119
20418
|
question: "\u6709\u4E2A\u95EE\u9898\u60F3\u95EE\u4F60",
|
|
@@ -20125,7 +20424,7 @@ var zh2 = {
|
|
|
20125
20424
|
reminder: "\u521A\u624D\u90A3\u4EF6\u4E8B\uFF0C\u8FD8\u7B49\u4F60\u770B\u770B",
|
|
20126
20425
|
grouped: (count) => `\u6709 ${count} \u4EF6\u4E8B\uFF0C\u8FD8\u7B49\u4F60\u770B\u770B`
|
|
20127
20426
|
};
|
|
20128
|
-
var
|
|
20427
|
+
var en3 = {
|
|
20129
20428
|
completed: "Task completed",
|
|
20130
20429
|
approval: "The next step needs your approval",
|
|
20131
20430
|
question: "There is a question for you",
|
|
@@ -20138,14 +20437,14 @@ var en2 = {
|
|
|
20138
20437
|
grouped: (count) => `${count} requests are still waiting for you`
|
|
20139
20438
|
};
|
|
20140
20439
|
function systemNotificationCopy(notice, locale = "zh") {
|
|
20141
|
-
const copy =
|
|
20440
|
+
const copy = petLanguage(locale) === "zh" ? zh3 : en3;
|
|
20142
20441
|
if (notice.stage === "reminder") {
|
|
20143
20442
|
const summary = notice.requestIds.length > 1 ? copy.grouped(notice.requestIds.length) : copy.reminder;
|
|
20144
20443
|
return { ...notice, title: summary, body: summary };
|
|
20145
20444
|
}
|
|
20146
20445
|
const title = copy[notice.category];
|
|
20147
20446
|
const short = ["stopped", "interrupted", "blocked", "max-tokens"].includes(notice.category);
|
|
20148
|
-
return { ...notice, title, body: short ? title : notice
|
|
20447
|
+
return { ...notice, title, body: short ? title : appStatusBody(notice, locale) };
|
|
20149
20448
|
}
|
|
20150
20449
|
|
|
20151
20450
|
// src/client/system-notifications.ts
|
|
@@ -20413,10 +20712,75 @@ var NotificationClient = class {
|
|
|
20413
20712
|
}
|
|
20414
20713
|
};
|
|
20415
20714
|
|
|
20715
|
+
// src/client/locale-sync.ts
|
|
20716
|
+
function syncPetLocale({ current, subscribe, send, retryMs = 750, timeoutMs = 5e3 }) {
|
|
20717
|
+
let stopped = false, accepted, pending;
|
|
20718
|
+
let controller, retry;
|
|
20719
|
+
const sync = (force = false) => {
|
|
20720
|
+
if (stopped) return;
|
|
20721
|
+
const locale = petLanguage(current());
|
|
20722
|
+
if (!force && (locale === pending || locale === accepted && !pending)) return;
|
|
20723
|
+
clearTimeout(retry);
|
|
20724
|
+
controller?.abort();
|
|
20725
|
+
const request = new AbortController();
|
|
20726
|
+
controller = request;
|
|
20727
|
+
pending = locale;
|
|
20728
|
+
const deadline = setTimeout(() => request.abort(), timeoutMs);
|
|
20729
|
+
const aborted2 = new Promise((_, reject) => request.signal.addEventListener("abort", () => reject(new Error("Locale request cancelled")), { once: true }));
|
|
20730
|
+
void Promise.race([Promise.resolve().then(() => {
|
|
20731
|
+
if (request.signal.aborted) throw new Error("Locale request cancelled");
|
|
20732
|
+
return send(locale, request.signal);
|
|
20733
|
+
}), aborted2]).then(() => {
|
|
20734
|
+
if (controller === request && !request.signal.aborted) accepted = locale;
|
|
20735
|
+
}).catch(() => {
|
|
20736
|
+
if (controller === request && !stopped) retry = setTimeout(sync, retryMs);
|
|
20737
|
+
}).finally(() => {
|
|
20738
|
+
clearTimeout(deadline);
|
|
20739
|
+
if (controller === request) {
|
|
20740
|
+
pending = void 0;
|
|
20741
|
+
controller = void 0;
|
|
20742
|
+
}
|
|
20743
|
+
});
|
|
20744
|
+
};
|
|
20745
|
+
const unsubscribe = subscribe(sync);
|
|
20746
|
+
sync();
|
|
20747
|
+
return () => {
|
|
20748
|
+
stopped = true;
|
|
20749
|
+
unsubscribe();
|
|
20750
|
+
clearTimeout(retry);
|
|
20751
|
+
controller?.abort();
|
|
20752
|
+
};
|
|
20753
|
+
}
|
|
20754
|
+
|
|
20416
20755
|
// src/client/index.ts
|
|
20417
20756
|
var inject = ["slots", "locale", "configForms", "connection"];
|
|
20418
20757
|
function apply(ctx) {
|
|
20758
|
+
const currentLocale = () => ctx.locale.resolveText({ zh: "zh", en: "en" });
|
|
20419
20759
|
ctx.effect(() => ctx.locale.register("coopanion", { zh, en }));
|
|
20760
|
+
ctx.effect(() => {
|
|
20761
|
+
if (!ctx.connection.isLoopback) return () => {
|
|
20762
|
+
};
|
|
20763
|
+
return syncPetLocale({
|
|
20764
|
+
current: currentLocale,
|
|
20765
|
+
subscribe: (listener) => {
|
|
20766
|
+
const unsubscribe = ctx.locale.subscribe(() => listener());
|
|
20767
|
+
const focus = () => {
|
|
20768
|
+
if (document.visibilityState !== "hidden") listener(true);
|
|
20769
|
+
};
|
|
20770
|
+
window.addEventListener("focus", focus);
|
|
20771
|
+
document.addEventListener("visibilitychange", focus);
|
|
20772
|
+
return () => {
|
|
20773
|
+
unsubscribe();
|
|
20774
|
+
window.removeEventListener("focus", focus);
|
|
20775
|
+
document.removeEventListener("visibilitychange", focus);
|
|
20776
|
+
};
|
|
20777
|
+
},
|
|
20778
|
+
send: async (locale, signal) => {
|
|
20779
|
+
const response = await ctx.connection.rpc.call("/api", "coopanion/locale", { locale }, signal);
|
|
20780
|
+
if (!response.ok) throw new Error(response.error.message);
|
|
20781
|
+
}
|
|
20782
|
+
});
|
|
20783
|
+
});
|
|
20420
20784
|
ctx.effect(() => {
|
|
20421
20785
|
const tag = document.createElement("style");
|
|
20422
20786
|
tag.dataset.plugin = "dsh-coopanion";
|
|
@@ -20452,10 +20816,10 @@ function apply(ctx) {
|
|
|
20452
20816
|
return reply.value;
|
|
20453
20817
|
};
|
|
20454
20818
|
const client = new NotificationClient({
|
|
20455
|
-
locale:
|
|
20819
|
+
locale: currentLocale,
|
|
20456
20820
|
api: globalThis.Notification,
|
|
20457
20821
|
transport: {
|
|
20458
|
-
state: (signal) => request("notification-state", {
|
|
20822
|
+
state: (signal) => request("notification-state", {}, signal),
|
|
20459
20823
|
claim: (payload, signal) => request("notification-claim", payload, signal),
|
|
20460
20824
|
receipt: (payload, signal) => request("notification-receipt", payload, signal),
|
|
20461
20825
|
snooze: (payload, signal) => request("notification-snooze", payload, signal)
|
|
@@ -20469,7 +20833,7 @@ function apply(ctx) {
|
|
|
20469
20833
|
window.focus();
|
|
20470
20834
|
},
|
|
20471
20835
|
testClaim: async (clientId, signal) => {
|
|
20472
|
-
const state = await request("notification-state", {
|
|
20836
|
+
const state = await request("notification-state", {}, signal);
|
|
20473
20837
|
return request("notification-test", { clientId, generation: state.runtime.generation }, signal);
|
|
20474
20838
|
}
|
|
20475
20839
|
});
|