dsh-manage-session 0.5.7 → 2.0.4

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.
Files changed (67) hide show
  1. package/CHANGELOG.ja.md +33 -229
  2. package/CHANGELOG.ko.md +33 -229
  3. package/CHANGELOG.md +33 -363
  4. package/INSTALL.ja.md +164 -164
  5. package/INSTALL.ko.md +164 -164
  6. package/INSTALL.md +164 -164
  7. package/INSTALL.zh.md +164 -164
  8. package/LICENSE +21 -21
  9. package/README.en.md +41 -46
  10. package/README.ja.md +33 -57
  11. package/README.ko.md +32 -55
  12. package/README.md +64 -64
  13. package/cordis.patch.yml +19 -16
  14. package/dsh.plugin.json +4 -4
  15. package/lib/client.js +661 -3082
  16. package/lib/index.d.ts +79 -970
  17. package/lib/index.js +249 -2669
  18. package/locale/de.json +2 -2
  19. package/locale/en.json +2 -2
  20. package/locale/es.json +2 -2
  21. package/locale/fr.json +2 -2
  22. package/locale/it.json +2 -2
  23. package/locale/ja.json +2 -2
  24. package/locale/ko.json +2 -2
  25. package/locale/ru.json +2 -2
  26. package/locale/zh.json +2 -2
  27. package/package.json +15 -25
  28. package/screenshots.json +3 -3
  29. package/src/client/bridge-scope.ts +202 -213
  30. package/src/client/card.tsx +154 -154
  31. package/src/client/health-panel.tsx +49 -49
  32. package/src/client/host-api.ts +72 -6
  33. package/src/client/index.ts +594 -503
  34. package/src/client/locales.ts +893 -893
  35. package/src/client/manage-locales.ts +178 -0
  36. package/src/client/{search/manage.tsx → manage.tsx} +430 -404
  37. package/src/client/panel.tsx +131 -129
  38. package/src/client/session-menu-legacy.ts +2 -3
  39. package/src/client/session-menu.tsx +5 -5
  40. package/src/config.ts +43 -99
  41. package/src/host/health/attribution.ts +118 -118
  42. package/src/host/health/lossless.ts +128 -128
  43. package/src/host/health/repair.ts +2 -2
  44. package/src/host/health/source-kind.ts +350 -350
  45. package/src/host/history/archive-source.ts +250 -250
  46. package/src/host/history/archive.ts +249 -249
  47. package/src/host/history/favorites.ts +71 -71
  48. package/src/host/history/purge.ts +370 -370
  49. package/src/host/history/tombstones.ts +3 -3
  50. package/src/host/registry/archive-registry.ts +317 -317
  51. package/src/host/settings-bridge.ts +222 -264
  52. package/src/index.ts +66 -694
  53. package/src/client/search/card.tsx +0 -563
  54. package/src/client/search/host-api.ts +0 -213
  55. package/src/client/search/locales.ts +0 -861
  56. package/src/client/search/locate.ts +0 -330
  57. package/src/client/search/panel.tsx +0 -940
  58. package/src/client/search/platform.ts +0 -136
  59. package/src/host/index/archive-source.ts +0 -90
  60. package/src/host/index/drs-source.ts +0 -211
  61. package/src/host/index/engine.ts +0 -699
  62. package/src/host/index/extract.ts +0 -272
  63. package/src/host/index/peers.ts +0 -62
  64. package/src/host/index/rebuild.ts +0 -432
  65. package/src/host/index/schema.ts +0 -136
  66. package/src/host/index/snapshot.ts +0 -135
  67. package/src/host/index/sync.ts +0 -413
@@ -0,0 +1,178 @@
1
+ /**
2
+ * 会话管理(dsh-manage-session)client dictionaries —— 只含管理台用到的键集
3
+ * (zh / en / ja / ko / fr / de / it / ru / es)。
4
+ *
5
+ * 从合并包的搜索字典里**裁出管理台专属键**(keys 不变、文案不变),搜索子域
6
+ * 已拆回 dsh-search-index,本包不再持有搜索面板的文案。
7
+ */
8
+
9
+ /** Dictionary namespace owned by this plugin. */
10
+ export const NS = 'dsh-manage-session'
11
+
12
+ /** Simplified Chinese dictionary (the key-set source of truth). */
13
+ export const zh = {
14
+ 'domain.all': "全部",
15
+ 'filter.favorites': "收藏",
16
+ 'group.collapse': "收拢/展开本组",
17
+ 'group.collapseAll': "全部收拢",
18
+ 'group.expandAll': "全部展开",
19
+ 'manage.batch.archive': "归档",
20
+ 'manage.batch.confirm': "确认删除",
21
+ 'manage.batch.delete': "删除",
22
+ 'manage.batch.unarchive': "取消归档",
23
+ 'manage.batch.working': "执行中…",
24
+ 'manage.done.archive': "已归档 {n} 个会话。",
25
+ 'manage.done.error': "操作失败:{error}",
26
+ 'manage.done.purge': "已清理 {n} 个会话。",
27
+ 'manage.done.restart': "需重启 DSH 后在侧栏完全生效。",
28
+ 'manage.done.unarchive': "已取消归档 {n} 个会话。",
29
+ 'manage.group.nocwd': "(未分组)",
30
+ 'manage.hint': "按工作区分组,勾选后批量操作;删除不可撤销。",
31
+ 'manage.restartHint': "优先走宿主内存 API 即时生效(0.1.7+ 归档/取消归档免重启);不可用时直写存储文件,重启后侧栏生效。",
32
+ 'manage.search': "搜索会话…",
33
+ 'manage.selected': "已选 {n}",
34
+ 'manage.selectGroup': "全选/取消本组",
35
+ 'panel.loadingSessions': "正在读取会话列表…",
36
+ 'panel.noMatch': "没有匹配的会话。",
37
+ 'panel.noSessions': "暂无会话",
38
+ 'panel.untitled': "(未命名)",
39
+ 'tag.archived': "归档",
40
+ 'workspace.label': "工作区",
41
+ 'workspace.less': "收起",
42
+ 'workspace.more': "还有 {n} 个",
43
+ 'star.on': "已收藏",
44
+ 'star.off': "未收藏",
45
+ 'domain.active': "活跃",
46
+ 'domain.archived': "归档",
47
+ }
48
+
49
+ /** Key union derived from the zh dictionary. */
50
+ export type LocaleKey = keyof typeof zh
51
+ /** Full dictionary shape (all locales fill it from zh). */
52
+ export type Dict = Record<LocaleKey, string>
53
+
54
+ /** English dictionary (complete). */
55
+ export const en: Dict = {
56
+ 'domain.all': "All",
57
+ 'filter.favorites': "Favorites",
58
+ 'group.collapse': "Collapse/expand group",
59
+ 'group.collapseAll': "Collapse all",
60
+ 'group.expandAll': "Expand all",
61
+ 'manage.batch.archive': "Archive",
62
+ 'manage.batch.confirm': "Confirm delete",
63
+ 'manage.batch.delete': "Delete",
64
+ 'manage.batch.unarchive': "Unarchive",
65
+ 'manage.batch.working': "Working…",
66
+ 'manage.done.archive': "Archived {n} sessions.",
67
+ 'manage.done.error': "Operation failed: {error}",
68
+ 'manage.done.purge': "Purged {n} sessions.",
69
+ 'manage.done.restart': "Restart DSH for the sidebar to fully reflect this.",
70
+ 'manage.done.unarchive': "Unarchived {n} sessions.",
71
+ 'manage.group.nocwd': "(no workspace)",
72
+ 'manage.hint': "Grouped by workspace; tick rows then batch-operate. Deletion is irreversible.",
73
+ 'manage.restartHint': "Prefers host in-memory APIs (0.1.7+ archive/unarchive apply instantly); falls back to direct storage-file edits, which need a restart.",
74
+ 'manage.search': "Search sessions…",
75
+ 'manage.selected': "{n} selected",
76
+ 'manage.selectGroup': "Toggle the whole group",
77
+ 'panel.loadingSessions': "Loading sessions…",
78
+ 'panel.noMatch': "No matching sessions.",
79
+ 'panel.noSessions': "No sessions",
80
+ 'panel.untitled': "(untitled)",
81
+ 'tag.archived': "Archived",
82
+ 'workspace.label': "Workspace",
83
+ 'workspace.less': "Collapse",
84
+ 'workspace.more': "{n} more",
85
+ 'star.on': "Favorited",
86
+ 'star.off': "Not favorited",
87
+ 'domain.active': "Active",
88
+ 'domain.archived': "Archived",
89
+ }
90
+
91
+ export const ja: Partial<Dict> = {
92
+ 'panel.loadingSessions': "セッション一覧を読み込み中…",
93
+ 'panel.noMatch': "一致するセッションがありません。",
94
+ 'panel.noSessions': "セッションなし",
95
+ 'panel.untitled': "(無題)",
96
+ 'star.on': "お気に入り済み",
97
+ 'star.off': "未お気に入り",
98
+ 'domain.active': "活跃",
99
+ 'domain.archived': "归档",
100
+ }
101
+
102
+ export const ko: Partial<Dict> = {
103
+ 'panel.loadingSessions': "세션 목록 읽는 중…",
104
+ 'panel.noMatch': "일치하는 세션이 없습니다.",
105
+ 'panel.noSessions': "세션 없음",
106
+ 'panel.untitled': "(제목 없음)",
107
+ 'star.on': "즐겨찾기됨",
108
+ 'star.off': "즐겨찾기 안 됨",
109
+ 'domain.active': "活跃",
110
+ 'domain.archived': "归档",
111
+ }
112
+
113
+ export const fr: Partial<Dict> = {
114
+ 'panel.loadingSessions': "Chargement des sessions…",
115
+ 'panel.noMatch': "Aucune session correspondante.",
116
+ 'panel.noSessions': "Aucune session",
117
+ 'panel.untitled': "(sans titre)",
118
+ 'star.on': "En favori",
119
+ 'star.off': "Pas en favori",
120
+ 'domain.active': "活跃",
121
+ 'domain.archived': "归档",
122
+ }
123
+
124
+ export const de: Partial<Dict> = {
125
+ 'panel.loadingSessions': "Sitzungen werden geladen…",
126
+ 'panel.noMatch': "Keine passenden Sitzungen.",
127
+ 'panel.noSessions': "Keine Sitzungen",
128
+ 'panel.untitled': "(unbenannt)",
129
+ 'star.on': "Favorit",
130
+ 'star.off': "Kein Favorit",
131
+ 'domain.active': "活跃",
132
+ 'domain.archived': "归档",
133
+ }
134
+
135
+ export const it: Partial<Dict> = {
136
+ 'panel.loadingSessions': "Caricamento sessioni…",
137
+ 'panel.noMatch': "Nessuna sessione corrispondente.",
138
+ 'panel.noSessions': "Nessuna sessione",
139
+ 'panel.untitled': "(senza titolo)",
140
+ 'star.on': "Nei preferiti",
141
+ 'star.off': "Non nei preferiti",
142
+ 'domain.active': "活跃",
143
+ 'domain.archived': "归档",
144
+ }
145
+
146
+ export const ru: Partial<Dict> = {
147
+ 'panel.loadingSessions': "Загрузка сессий…",
148
+ 'panel.noMatch': "Нет подходящих сессий.",
149
+ 'panel.noSessions': "Нет сессий",
150
+ 'panel.untitled': "(без названия)",
151
+ 'star.on': "В избранном",
152
+ 'star.off': "Не в избранном",
153
+ 'domain.active': "活跃",
154
+ 'domain.archived': "归档",
155
+ }
156
+
157
+ export const es: Partial<Dict> = {
158
+ 'panel.loadingSessions': "Cargando sesiones…",
159
+ 'panel.noMatch': "Sin sesiones coincidentes.",
160
+ 'panel.noSessions': "Sin sesiones",
161
+ 'panel.untitled': "(sin título)",
162
+ 'star.on': "En favoritos",
163
+ 'star.off': "No en favoritos",
164
+ 'domain.active': "活跃",
165
+ 'domain.archived': "归档",
166
+ }
167
+
168
+ /** All shipped dictionaries by locale id. */
169
+ export const dictionaries: Record<string, Record<string, string>> = { zh, en, ja, ko, fr, de, it, ru, es }
170
+
171
+ /** Translate with {param} interpolation; falls back to zh, then the key itself. */
172
+ export function translate(locale: ((key: LocaleKey, params?: Record<string, unknown>) => string) | undefined, key: LocaleKey, params?: Record<string, unknown>): string {
173
+ const raw = locale?.(key, params)
174
+ if (typeof raw === 'string' && raw !== '' && raw !== key) return raw
175
+ const template = (dictionaries.zh[key] ?? key) as string
176
+ if (params === undefined) return template
177
+ return template.replace(/\{(\w+)\}/gu, (_, name: string) => String(params[name] ?? `{${name}}`))
178
+ }