dsh-config-manager 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/adapters/mcp.js +9 -2
- package/lib/adapters/plugins.js +65 -10
- package/lib/adapters/prompts.js +15 -4
- package/lib/adapters/test-helpers.d.ts +15 -1
- package/lib/adapters/test-helpers.js +11 -0
- package/lib/cli/help.d.ts +1 -1
- package/lib/cli/help.js +21 -14
- package/lib/cli/index.js +118 -104
- package/lib/cli/sessions-repair.js +58 -22
- package/lib/cli/web/client-script.d.ts +1 -1
- package/lib/cli/web/client-script.js +71 -5
- package/lib/cli/web/page.d.ts +9 -19
- package/lib/cli/web/page.js +277 -173
- package/lib/cli/web/routes.js +85 -25
- package/lib/client.d.ts +93 -27
- package/lib/client.js +11461 -11339
- package/lib/core/messages.d.ts +10 -0
- package/lib/core/messages.js +20 -0
- package/lib/core/model-tools.js +7 -1
- package/lib/core/patch-chain.d.ts +65 -0
- package/lib/core/patch-chain.js +100 -0
- package/lib/core/patch-document.d.ts +32 -4
- package/lib/core/patch-document.js +48 -17
- package/lib/core/patch-secret-guard.d.ts +1 -1
- package/lib/core/patch-secret-guard.js +1 -1
- package/lib/core/types.d.ts +16 -1
- package/lib/index.d.ts +9 -4
- package/lib/index.js +42 -47
- package/lib/routes/sync.js +6 -0
- package/lib/sync/autosync-scheduler.d.ts +13 -1
- package/lib/sync/autosync-scheduler.js +73 -17
- package/lib/sync/local-changes.d.ts +15 -0
- package/lib/sync/local-changes.js +39 -0
- package/lib/sync/merge-keyed.d.ts +68 -0
- package/lib/sync/merge-keyed.js +124 -0
- package/lib/sync/patch-line-identity.d.ts +19 -0
- package/lib/sync/patch-line-identity.js +99 -0
- package/lib/sync/pending-merge.d.ts +8 -1
- package/lib/sync/pending-merge.js +13 -5
- package/lib/sync/plugin-removals.d.ts +15 -15
- package/lib/sync/plugin-removals.js +134 -83
- package/lib/sync/push-skip.d.ts +55 -0
- package/lib/sync/push-skip.js +70 -0
- package/lib/sync/sync-engine.d.ts +22 -12
- package/lib/sync/sync-engine.js +53 -70
- package/lib/sync/workspace-merge.d.ts +8 -2
- package/lib/ui/artifact-view.d.ts +1 -1
- package/lib/ui/foreign-view.d.ts +14 -0
- package/lib/ui/foreign-view.js +34 -0
- package/lib/ui/i18n.d.ts +5 -0
- package/lib/ui/i18n.js +11 -0
- package/lib/ui/selection-model.d.ts +2 -2
- package/lib/ui/selection-model.js +7 -3
- package/lib/utils/async-once.d.ts +11 -0
- package/lib/utils/async-once.js +15 -0
- package/lib/utils/patch-chain-read.d.ts +51 -0
- package/lib/utils/patch-chain-read.js +240 -0
- package/package.json +2 -2
- package/src/adapters/mcp.ts +9 -2
- package/src/adapters/plugins.test.ts +115 -0
- package/src/adapters/plugins.ts +64 -11
- package/src/adapters/prompts.ts +15 -4
- package/src/adapters/test-helpers.ts +15 -1
- package/src/cli/help.ts +21 -14
- package/src/cli/index.ts +105 -107
- package/src/cli/sessions-repair.ts +55 -22
- package/src/cli/web/client-script.ts +71 -5
- package/src/cli/web/page.ts +327 -208
- package/src/cli/web/routes.ts +85 -25
- package/src/cli/web/web.test.ts +38 -0
- package/src/client/ConfigManagerSection.tsx +8 -4
- package/src/client/about/AboutPanel.tsx +2 -6
- package/src/client/api.ts +2 -1
- package/src/client/common/ContentPicker.tsx +11 -12
- package/src/client/common/plan-text-redaction.test.ts +2 -2
- package/src/client/config-manager.module.css +10 -0
- package/src/client/environment/EnvironmentPanel.tsx +2 -4
- package/src/client/environment/maintenance/DiskUsageCard.tsx +4 -5
- package/src/client/home/BackupScheduleCard.tsx +52 -49
- package/src/client/home/HomePanel.tsx +2 -2
- package/src/client/import/ForeignImportView.tsx +60 -3
- package/src/client/import/ImportWizardView.tsx +2 -1
- package/src/client/import/PathMappingForm.tsx +32 -5
- package/src/client/import/import-wizard-split.test.ts +1 -1
- package/src/client/library/BackupInspectView.tsx +4 -2
- package/src/client/library/LibraryActions.tsx +60 -12
- package/src/client/library/LibraryPanel.tsx +9 -10
- package/src/client/locales/backup.ts +5 -0
- package/src/client/locales/foreign.ts +2 -0
- package/src/client/locales/import.ts +2 -0
- package/src/client/locales/restore.ts +2 -0
- package/src/client/market/MarketImportReview.tsx +4 -4
- package/src/client/market/MarketPanel.tsx +20 -36
- package/src/client/market/MyConfigsView.tsx +3 -10
- package/src/client/recovery/RecoveryPanel.tsx +4 -6
- package/src/client/recovery/RollbackCard.tsx +74 -59
- package/src/client/recovery/rollback-enabled.ts +29 -0
- package/src/client/recovery/use-recovery-write.ts +5 -0
- package/src/client/sync/AutosyncCard.tsx +3 -1
- package/src/client/sync/MergePreviewView.tsx +2 -2
- package/src/client/sync/PushPreviewCard.tsx +2 -1
- package/src/client/sync/SyncConfirmView.tsx +127 -130
- package/src/client/sync/SyncLogList.tsx +14 -10
- package/src/client/sync/SyncPanel.tsx +37 -28
- package/src/client/sync/SyncSettingsDialog.tsx +10 -21
- package/src/client/sync/history-model.ts +2 -0
- package/src/client/sync/sync-api.ts +1 -1
- package/src/client/sync/sync-locales.ts +8 -0
- package/src/client/sync/sync-push-preview.test.ts +9 -0
- package/src/client/sync/sync-view.ts +34 -0
- package/src/core/messages.ts +20 -0
- package/src/core/model-tools.ts +7 -1
- package/src/core/patch-chain.test.ts +83 -0
- package/src/core/patch-chain.ts +150 -0
- package/src/core/patch-document.test.ts +48 -1
- package/src/core/patch-document.ts +66 -15
- package/src/core/patch-layers.test.ts +1 -1
- package/src/core/patch-secret-guard.ts +1 -1
- package/src/core/smoke.test.ts +2 -1
- package/src/core/types.ts +16 -1
- package/src/index.facade.test.ts +186 -6
- package/src/index.ts +53 -47
- package/src/routes/sync.ts +6 -0
- package/src/security/security.test.ts +1 -1
- package/src/sync/autosync-scheduler.test.ts +98 -0
- package/src/sync/autosync-scheduler.ts +78 -17
- package/src/sync/local-changes.ts +40 -0
- package/src/sync/merge-keyed.test.ts +167 -0
- package/src/sync/merge-keyed.ts +160 -0
- package/src/sync/messages.ts +1 -0
- package/src/sync/patch-line-identity.test.ts +73 -0
- package/src/sync/patch-line-identity.ts +105 -0
- package/src/sync/pending-merge.test.ts +41 -0
- package/src/sync/pending-merge.ts +13 -5
- package/src/sync/plugin-removals.test.ts +199 -39
- package/src/sync/plugin-removals.ts +150 -64
- package/src/sync/push-skip.test.ts +326 -0
- package/src/sync/push-skip.ts +102 -0
- package/src/sync/sync-engine.ts +68 -67
- package/src/sync/workspace-merge.ts +9 -2
- package/src/ui/artifact-view.ts +1 -1
- package/src/ui/foreign-view.test.ts +49 -0
- package/src/ui/foreign-view.ts +47 -0
- package/src/ui/i18n.ts +11 -0
- package/src/ui/selection-model.test.ts +14 -0
- package/src/ui/selection-model.ts +7 -4
- package/src/utils/async-once.ts +14 -0
- package/src/utils/patch-chain-read.test.ts +171 -0
- package/src/utils/patch-chain-read.ts +259 -0
- package/src/utils/patch-yaml.test.ts +8 -2
package/lib/cli/web/routes.js
CHANGED
|
@@ -117,40 +117,100 @@ export function buildConsoleRoutes(context) {
|
|
|
117
117
|
}),
|
|
118
118
|
consoleEndpoint({ path: '/', methods: ['GET'] }, async (_req, res) => {
|
|
119
119
|
const status = await readRescueStatus(paths);
|
|
120
|
-
const
|
|
120
|
+
const hasBlockedSafe = status.safeMode.some((r) => r.state === 'blocked');
|
|
121
|
+
const hasStaleLock = status.lock.present && status.lock.state === 'STALE_LOCK_DETECTED';
|
|
122
|
+
const hasEncrypted = status.backups.some((b) => b.containerType === 'encrypted');
|
|
123
|
+
const scored = [
|
|
121
124
|
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
score: hasStaleLock ? 100 : (status.lock.present ? 60 : 20),
|
|
126
|
+
card: {
|
|
127
|
+
id: 'recover-lock',
|
|
128
|
+
title: '环境锁 / 回收残留锁',
|
|
129
|
+
description: '查看锁状态;仅当持有进程被确证不存在时才允许回收(活锁一律拒绝)。',
|
|
130
|
+
when: '启动或写操作报环境锁冲突、怀疑上次异常退出残留锁文件时先点它。',
|
|
131
|
+
href: '/lock',
|
|
132
|
+
disabled: false,
|
|
133
|
+
},
|
|
127
134
|
},
|
|
128
135
|
{
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
score: hasBlockedSafe ? 95 : (status.snapshots.length > 0 ? 75 : 15),
|
|
137
|
+
card: {
|
|
138
|
+
id: 'restore',
|
|
139
|
+
title: '恢复快照',
|
|
140
|
+
description: '先看逐项恢复计划(零写入),确认后覆盖回滚到某个导入前快照。',
|
|
141
|
+
when: '刚导入配置或变更设置后 DSH 异常,需要按计划回滚到导入前安全快照时点它。',
|
|
142
|
+
href: '/restore',
|
|
143
|
+
disabled: false,
|
|
144
|
+
},
|
|
134
145
|
},
|
|
135
146
|
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
score: 85,
|
|
148
|
+
card: {
|
|
149
|
+
id: 'session-repair',
|
|
150
|
+
title: '会话布局修复',
|
|
151
|
+
description: '位置与 header cwd 不一致的会话按计划归位(前置:DSH 已停、无 SAFE MODE、无残留锁)。',
|
|
152
|
+
when: '会话打不开、报 cwd/路径不一致,或存在重放重复行需要零损失清理时点它。',
|
|
153
|
+
href: '/sessions',
|
|
154
|
+
disabled: false,
|
|
155
|
+
},
|
|
141
156
|
},
|
|
142
157
|
{
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
score: status.instances.length > 0 ? 70 : 65,
|
|
159
|
+
card: {
|
|
160
|
+
id: 'profiles',
|
|
161
|
+
title: '档案与实例',
|
|
162
|
+
description: '查看本机档案与在跑的实例,并把某个档案作为独立实例启动(DSH 起不来时最有用的一条路)。',
|
|
163
|
+
when: '想另起一个干净 profile 应急继续干活,或需要停掉阻塞写入的在跑实例时点它。',
|
|
164
|
+
href: '/profiles',
|
|
165
|
+
disabled: false,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
score: 55,
|
|
170
|
+
card: {
|
|
171
|
+
id: 'disk-cleanup',
|
|
172
|
+
title: '清理磁盘',
|
|
173
|
+
description: '可重建缓存与过期导出产物;导入前快照与同步数据永不在候选集内。',
|
|
174
|
+
when: '磁盘空间告急、怀疑缓存损坏,或要按保留期回收旧导出产物时点它。',
|
|
175
|
+
href: '/disk',
|
|
176
|
+
disabled: false,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
score: 45,
|
|
181
|
+
card: {
|
|
182
|
+
id: 'export',
|
|
183
|
+
title: '离线导出',
|
|
184
|
+
description: '把离线可读的文件类分区导出成与 GUI 同结构的 ZIP(落盘后自检)。',
|
|
185
|
+
when: '准备重装、迁移机器或大改配置前,需要先把当前可读文件备份出来时点它。',
|
|
186
|
+
href: '/export',
|
|
187
|
+
disabled: false,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
score: hasEncrypted ? 40 : 10,
|
|
192
|
+
card: {
|
|
193
|
+
id: 'unlock',
|
|
194
|
+
title: '解锁加密备份',
|
|
195
|
+
description: '用密码在内存里解出明文并查看条目清单;不写盘、不回传内容。',
|
|
196
|
+
when: '手里有加密容器备份,需用密码在内存里核对包含哪些配置条目时点它。',
|
|
197
|
+
href: '/unlock',
|
|
198
|
+
disabled: false,
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
score: 5,
|
|
203
|
+
card: {
|
|
204
|
+
id: 'reinstall',
|
|
205
|
+
title: '重装 DSH',
|
|
206
|
+
description: '最危险的动作:卸载并重装全局 DSH。需要终端里打印的 6 位确认码。',
|
|
207
|
+
when: '前几项排查都无效、怀疑全局 DSH 程序损坏须卸载重装时点它(需终端确认码)。',
|
|
208
|
+
href: '/reinstall',
|
|
209
|
+
disabled: false,
|
|
210
|
+
},
|
|
148
211
|
},
|
|
149
|
-
{ id: 'restore', title: '恢复快照', description: '先看逐项恢复计划(零写入),确认后覆盖回滚到某个导入前快照。', href: '/restore', disabled: false },
|
|
150
|
-
{ id: 'export', title: '离线导出', description: '把离线可读的文件类分区导出成与 GUI 同结构的 ZIP(落盘后自检)。', href: '/export', disabled: false },
|
|
151
|
-
{ id: 'unlock', title: '解锁加密备份', description: '用密码在内存里解出明文并查看条目清单;不写盘、不回传内容。', href: '/unlock', disabled: false },
|
|
152
|
-
{ id: 'reinstall', title: '重装 DSH', description: '最危险的动作:卸载并重装全局 DSH。需要终端里打印的 6 位确认码。', href: '/reinstall', disabled: false },
|
|
153
212
|
];
|
|
213
|
+
const actions = scored.sort((a, b) => b.score - a.score).map((item) => item.card);
|
|
154
214
|
writeHtml(res, 200, renderHomePage({ status, version, actions }));
|
|
155
215
|
}),
|
|
156
216
|
consoleEndpoint({ path: '/disk', methods: ['GET'] }, async (req, res) => {
|
package/lib/client.d.ts
CHANGED
|
@@ -1653,6 +1653,7 @@ declare const uiZh: {
|
|
|
1653
1653
|
readonly 'sync.pushFailed': '推送失败';
|
|
1654
1654
|
readonly 'sync.pushOk': '推送成功(快照 {id})';
|
|
1655
1655
|
readonly 'sync.pushSkipped': '内容未变化,已跳过(沿用远端快照 {id})';
|
|
1656
|
+
readonly 'sync.pushAllConflicted': '未推送任何分区:还有分区待冲突裁决(远端与基线都未改动)';
|
|
1656
1657
|
readonly 'sync.conflictUnresolved': '冲突项 {id} 必须先选择解决方式(保留当前 / 使用导入)';
|
|
1657
1658
|
readonly 'sync.pushPreviewHeadline': '将推送 {total} 个分区({changed} 个有变化)';
|
|
1658
1659
|
readonly 'sync.pushPreviewEncrypted': '加密快照:载荷将整体加密,各分区相对基线的变化不可比对。';
|
|
@@ -1934,6 +1935,10 @@ declare const uiZh: {
|
|
|
1934
1935
|
readonly 'foreign.lossy.entry-backslash.detail': 'ZIP 条目名里出现在中段的反斜杠不会被拒绝:同一个包在 Windows 目标上会被当作路径分隔符(落成多级目录),在 POSIX 目标上只是一个普通字符。本实现刻意不改这一格式行为;界面无法逐条检查条目名,跨平台导入后请核对这类文件是否落在预期位置。';
|
|
1935
1936
|
readonly 'foreign.lossy.prompt-persona-reshape.title': 'prompts 的 systemPrompt 形状变化';
|
|
1936
1937
|
readonly 'foreign.lossy.prompt-persona-reshape.detail': '源里的 systemPrompt 是字符串,导入落盘时写成带 persona 字段的对象:persona 文本无损,字段形状改变。兼容性评分不会为这一条给出原因 —— 它不改变内容,只改变形态。';
|
|
1938
|
+
readonly 'foreign.prompt.header': '请帮我将以下 {source} 配置/会话转换为 DSH 可导入的格式:';
|
|
1939
|
+
readonly 'foreign.prompt.paths': '检测路径:{paths}';
|
|
1940
|
+
readonly 'foreign.prompt.skips': '未自动迁移项:';
|
|
1941
|
+
readonly 'foreign.prompt.failure': '失败原因:{reason}';
|
|
1937
1942
|
readonly 'export.category.settings': 'DSH 全局设置(namespace 分区,redacted)';
|
|
1938
1943
|
readonly 'export.category.providers': 'LLM Provider / Model / 默认模型 / BaseURL';
|
|
1939
1944
|
readonly 'export.category.plugins': '已安装插件清单与启用状态(不含二进制)';
|
|
@@ -2435,6 +2440,80 @@ type NativePickResult = {
|
|
|
2435
2440
|
reason: NativePickReason;
|
|
2436
2441
|
detail?: string;
|
|
2437
2442
|
};
|
|
2443
|
+
/** 同步通道类型(由 SYNC_CHANNELS 派生;host 侧与 client 半统一引用)。 */
|
|
2444
|
+
type SyncTransportType$1 = (typeof SYNC_CHANNELS)[number];
|
|
2445
|
+
/** S3 兼容系通道的回传视图:**只带 secretStored 标记,绝不带密钥值**。 */
|
|
2446
|
+
interface CloudS3ChannelView {
|
|
2447
|
+
provider: S3CompatProvider;
|
|
2448
|
+
endpoint: string;
|
|
2449
|
+
region: string;
|
|
2450
|
+
bucket: string;
|
|
2451
|
+
prefix: string;
|
|
2452
|
+
accessKeyId: string;
|
|
2453
|
+
pathStyle: boolean;
|
|
2454
|
+
/** 密钥已在 credentials 里(只回布尔) */
|
|
2455
|
+
secretStored: boolean;
|
|
2456
|
+
}
|
|
2457
|
+
/** Gist 通道的回传视图:**只带 secretStored 标记,绝不带 token 值**。 */
|
|
2458
|
+
interface CloudGistChannelView {
|
|
2459
|
+
provider: GistProvider;
|
|
2460
|
+
gistId: string;
|
|
2461
|
+
apiBaseUrl: string;
|
|
2462
|
+
filePrefix: string;
|
|
2463
|
+
secretStored: boolean;
|
|
2464
|
+
}
|
|
2465
|
+
/** 推/拉请求体(与 client 的 SyncPushPayload / SyncPullPayload 同形)。 */
|
|
2466
|
+
interface SyncPushBody {
|
|
2467
|
+
/**
|
|
2468
|
+
* 请求体 transport:**宿主可接受的通道全集**(`SYNC_CHANNELS` = git/webdav/s3/gist)。
|
|
2469
|
+
*
|
|
2470
|
+
* 为什么是宽集合而不是上面的 `SyncChannelName`:client 的 `SyncPushPayload.transport`
|
|
2471
|
+
* 已是宽集合(云端通道并入 `SYNC_CHANNELS` 后由 `SyncTransportType` 派生),t42 组装器
|
|
2472
|
+
* 的产物会直接喂给 `saveQueueOnRequest` 等以 `SyncPushBody` 为参的纯函数;写窄会让
|
|
2473
|
+
* 「client 宽 → ui 窄」在 typecheck 阶段失败(T0 合并 origin/main 实测 3 条)。
|
|
2474
|
+
* transport 是**线上形状**,宿主按 `isSyncTransportType` 校验,宽集合才是正确口径。
|
|
2475
|
+
*/
|
|
2476
|
+
transport?: SyncTransportType$1;
|
|
2477
|
+
repoUrl?: string;
|
|
2478
|
+
/** git:仓库内子目录前缀(issue #131;空 / 缺省 = 仓库根,旧配置读出来即空) */
|
|
2479
|
+
subdir?: string;
|
|
2480
|
+
token?: string;
|
|
2481
|
+
url?: string;
|
|
2482
|
+
username?: string;
|
|
2483
|
+
password?: string;
|
|
2484
|
+
sections?: SectionId[];
|
|
2485
|
+
/**
|
|
2486
|
+
* sessions(可选分区)选项:**只有显式提供它**,会话才被允许进入同步通道
|
|
2487
|
+
* (Host 侧安全默认:未提供则按非 portable 分区跳过)。绝不悄悄携带。
|
|
2488
|
+
*/
|
|
2489
|
+
sessions?: {
|
|
2490
|
+
limit?: number;
|
|
2491
|
+
include?: string[];
|
|
2492
|
+
};
|
|
2493
|
+
/** s3:具体兼容商 */
|
|
2494
|
+
provider?: string;
|
|
2495
|
+
endpoint?: string;
|
|
2496
|
+
region?: string;
|
|
2497
|
+
bucket?: string;
|
|
2498
|
+
prefix?: string;
|
|
2499
|
+
accessKeyId?: string;
|
|
2500
|
+
pathStyle?: boolean;
|
|
2501
|
+
/** 显式覆盖签名方言(高级覆盖;宿主忽略非法值,回落兼容商变体默认) */
|
|
2502
|
+
dialectId?: 'aws4' | 'oss4';
|
|
2503
|
+
/** gist:目标 gist id */
|
|
2504
|
+
gistId?: string;
|
|
2505
|
+
apiBaseUrl?: string;
|
|
2506
|
+
filePrefix?: string;
|
|
2507
|
+
/**
|
|
2508
|
+
* 云端点密钥(s3 的 AccessKey Secret / gist 的 token):**只写**。
|
|
2509
|
+
* 仅请求体内存传输 → 宿主写入 DSH credentials 槽位(cloudSecretRef)后即丢弃;
|
|
2510
|
+
* 绝不落配置文件 / 日志 / 响应(凭据铁律)。
|
|
2511
|
+
*/
|
|
2512
|
+
secret?: string;
|
|
2513
|
+
encrypt?: boolean;
|
|
2514
|
+
encryptPassword?: string;
|
|
2515
|
+
includeSecrets?: boolean;
|
|
2516
|
+
}
|
|
2438
2517
|
/** 超时文案键(全部已存在于 ui/i18n.ts;本模块只做选键,不新增文案口径)。 */
|
|
2439
2518
|
type TimeoutMessageKey = 'error.requestTimeout' | 'error.fallback' | 'error.exportTimeout' | 'error.syncTimeout' | 'error.recoveryTimeout';
|
|
2440
2519
|
/** 请求选项:超时档位、超时文案键、调用方取消信号。 */
|
|
@@ -2895,7 +2974,7 @@ declare class ConfigManagerApi {
|
|
|
2895
2974
|
*/
|
|
2896
2975
|
applyUpdate(version: string): Promise<PluginUpdateApplyResult>;
|
|
2897
2976
|
/** 迁移前咨询(只读健康评分 + 建议):对 4 种可迁移源生成统一咨询报告。 */
|
|
2898
|
-
consult(input: {
|
|
2977
|
+
consult(input: SyncPushBody & {
|
|
2899
2978
|
type: 'export-zip' | 'local-snapshot' | 'remote-snapshot' | 'profile';
|
|
2900
2979
|
id: string;
|
|
2901
2980
|
snapshotId?: string;
|
|
@@ -2984,8 +3063,9 @@ interface SyncPushReport {
|
|
|
2984
3063
|
* 语义:`ok:true` + 本字段 = 「什么都没做,也不算失败」——未 upload、未建目录、未裁剪;
|
|
2985
3064
|
* 只是把基线指针**收养**到远端最新快照(`adoptedSnapshotId`),让下一轮判定有正确起点。
|
|
2986
3065
|
* GUI / 报告必须显式区分它(「内容未变化,已跳过」),不能显示成「已推送 xx」。
|
|
3066
|
+
* issue #146:`all-conflicted` = 一个分区都没推(`ok:true` + `snapshotId:''`,远端与基线都没动),不是失败,但绝不能显示成「已推送」。
|
|
2987
3067
|
*/
|
|
2988
|
-
skipped?: 'unchanged';
|
|
3068
|
+
skipped?: 'unchanged' | 'all-conflicted';
|
|
2989
3069
|
/** issue #140:`skipped='unchanged'` 时被收养的远端快照 id(= 本次报告里的 snapshotId) */
|
|
2990
3070
|
adoptedSnapshotId?: string;
|
|
2991
3071
|
}
|
|
@@ -3026,30 +3106,10 @@ interface SyncPushPreview {
|
|
|
3026
3106
|
encrypted: boolean;
|
|
3027
3107
|
/** 本次推送是否真的会带上凭据载荷(.credentials.yaml 可读且非空;issue #38) */
|
|
3028
3108
|
credentialsIncluded: boolean;
|
|
3109
|
+
/** issue #146:与 push 同口径的终态(全被冲突扣下 ⇒ 预览也是「什么都没得推」,不是错误) */
|
|
3110
|
+
skipped?: 'all-conflicted';
|
|
3029
3111
|
message?: string;
|
|
3030
3112
|
}
|
|
3031
|
-
/** 同步通道类型(由 SYNC_CHANNELS 派生;host 侧与 client 半统一引用)。 */
|
|
3032
|
-
type SyncTransportType$1 = (typeof SYNC_CHANNELS)[number];
|
|
3033
|
-
/** S3 兼容系通道的回传视图:**只带 secretStored 标记,绝不带密钥值**。 */
|
|
3034
|
-
interface CloudS3ChannelView {
|
|
3035
|
-
provider: S3CompatProvider;
|
|
3036
|
-
endpoint: string;
|
|
3037
|
-
region: string;
|
|
3038
|
-
bucket: string;
|
|
3039
|
-
prefix: string;
|
|
3040
|
-
accessKeyId: string;
|
|
3041
|
-
pathStyle: boolean;
|
|
3042
|
-
/** 密钥已在 credentials 里(只回布尔) */
|
|
3043
|
-
secretStored: boolean;
|
|
3044
|
-
}
|
|
3045
|
-
/** Gist 通道的回传视图:**只带 secretStored 标记,绝不带 token 值**。 */
|
|
3046
|
-
interface CloudGistChannelView {
|
|
3047
|
-
provider: GistProvider;
|
|
3048
|
-
gistId: string;
|
|
3049
|
-
apiBaseUrl: string;
|
|
3050
|
-
filePrefix: string;
|
|
3051
|
-
secretStored: boolean;
|
|
3052
|
-
}
|
|
3053
3113
|
/**
|
|
3054
3114
|
* 远程同步通道类型:git(默认)或 webdav。
|
|
3055
3115
|
* **唯一来源** = 宿主 src/sync/sync-config.ts 的 SYNC_CHANNELS(此处仅 type-only 别名:
|
|
@@ -3908,7 +3968,7 @@ declare class SyncApi {
|
|
|
3908
3968
|
*/
|
|
3909
3969
|
applyMerge(payload: MergeApplyPayload): Promise<MergeApplyResponse>;
|
|
3910
3970
|
/** Phase 7 迁移前咨询(只读健康评分 + 建议):对远端快照生成咨询报告。 */
|
|
3911
|
-
consult(input: {
|
|
3971
|
+
consult(input: SyncPushPayload & {
|
|
3912
3972
|
type: 'remote-snapshot';
|
|
3913
3973
|
id: string;
|
|
3914
3974
|
snapshotId?: string;
|
|
@@ -5304,6 +5364,7 @@ declare const zh$4: {
|
|
|
5304
5364
|
readonly 'import.paths.kind.homeMismatch': '基础路径不同';
|
|
5305
5365
|
readonly 'import.paths.unresolved': '还有 {count} 条路径未映射(留空将跳过该路径,可以继续)';
|
|
5306
5366
|
readonly 'import.paths.empty': '无需映射路径';
|
|
5367
|
+
readonly 'import.paths.applySuggested': '填入建议路径';
|
|
5307
5368
|
readonly 'import.paths.browse': '选择本机路径';
|
|
5308
5369
|
readonly 'import.paths.picker.title': '选择本机路径';
|
|
5309
5370
|
readonly 'import.paths.picker.up': '上一层';
|
|
@@ -5339,6 +5400,7 @@ declare const zh$4: {
|
|
|
5339
5400
|
readonly 'snapshots.manualHints': '需人工处理';
|
|
5340
5401
|
readonly 'snapshots.failed': '失败';
|
|
5341
5402
|
readonly 'snapshots.skipped': '跳过';
|
|
5403
|
+
readonly 'snapshots.preRestoreDir': '恢复前安全备份目录:{dir}';
|
|
5342
5404
|
readonly 'snapshots.plan.changed': '将被还原 {count}';
|
|
5343
5405
|
readonly 'snapshots.plan.added': '新增 {count}';
|
|
5344
5406
|
readonly 'snapshots.plan.deleted': '将被删除 {count}';
|
|
@@ -5406,6 +5468,7 @@ declare const zh$4: {
|
|
|
5406
5468
|
readonly 'backupSchedule.loading': '加载定时备份设置…';
|
|
5407
5469
|
readonly 'backupSchedule.error': '定时备份设置加载失败';
|
|
5408
5470
|
readonly 'retention.title': '保留策略';
|
|
5471
|
+
readonly 'retention.titleScoped': '保留策略(快照 + 定时备份)';
|
|
5409
5472
|
readonly 'retention.hint': '快照与定时备份共用;置顶快照与未收敛的恢复点恒豁免自动清理。';
|
|
5410
5473
|
readonly 'retention.keepLast': '最近保留';
|
|
5411
5474
|
readonly 'retention.keepLastHint': '按时间保留最近 N 份;0 = 不按「最近」保留';
|
|
@@ -5899,6 +5962,7 @@ declare const zh$4: {
|
|
|
5899
5962
|
readonly 'foreign.skip.trae-db-decrypt-failed': 'Trae 加密会话库无法解密:文件被截断、不是 SQLCipher 形态或读取失败,本次未读出任何会话';
|
|
5900
5963
|
readonly 'foreign.skip.trae-db-schema-mismatch': 'Trae 加密会话库解密成功但表结构不符(缺 chat_session / history_v2 或必需列):不猜字段,本次未读出任何会话';
|
|
5901
5964
|
readonly 'foreign.conflict.policy': '同 id 冲突不覆盖本机内容:跳过并逐条报告';
|
|
5965
|
+
readonly 'foreign.copyAgentPrompt': '复制转换提示词';
|
|
5902
5966
|
};
|
|
5903
5967
|
/** 字典键联合(注册处 compile-time 校验) */
|
|
5904
5968
|
type ConfigManagerKey = keyof typeof zh$4;
|
|
@@ -6109,6 +6173,7 @@ declare const zh$3: {
|
|
|
6109
6173
|
readonly 'mode.clearSavedPassword': '删除已保存密码';
|
|
6110
6174
|
readonly 'autosync.title': '自动同步';
|
|
6111
6175
|
readonly 'autosync.description': '开启后,DSH 在后台保持配置一致:本地配置有改动时自动上传,检测到远端有新快照时才自动拉取合并;定时器仅作兜底轮询,无变化不重复动作。仅在无冲突且无需人工干预时才自动写入本地。';
|
|
6176
|
+
readonly 'autosync.retentionNotice': '远端快照与定时备份共用同一份保留策略(会裁剪旧快照),在首页「定时备份」里设置。';
|
|
6112
6177
|
readonly 'autosync.enable': '启用';
|
|
6113
6178
|
readonly 'autosync.interval': '兜底轮询间隔';
|
|
6114
6179
|
readonly 'autosync.intervalHint': '兜底检查节奏:间隔到点 / DSH 启动时检查远端是否有新快照,有才拉取合并。启用「本地改动即时同步」后,保存配置会立刻触发一轮,不必等这里。';
|
|
@@ -6167,6 +6232,7 @@ declare const zh$3: {
|
|
|
6167
6232
|
readonly 'history.autosyncReasonUpToDate': '无变化(本地与远端一致)';
|
|
6168
6233
|
readonly 'history.autosyncReasonWarning': '部分内容未落地(详情见本轮告警)';
|
|
6169
6234
|
readonly 'history.autosyncReasonUnchanged': '远端无新快照,无需合并';
|
|
6235
|
+
readonly 'history.autosyncReasonAllConflicted': '有分区仍在等冲突裁决,本轮未上传(裁决后会照常推送)';
|
|
6170
6236
|
readonly 'history.autosyncConflicted': '跳过冲突分区:{sections}';
|
|
6171
6237
|
readonly 'history.autosyncApplied': '应用分区:{sections}';
|
|
6172
6238
|
readonly 'history.autosyncError': '错误:{error}';
|
|
@@ -6190,6 +6256,7 @@ declare const zh$3: {
|
|
|
6190
6256
|
readonly 'toast.pushFailed': '推送失败';
|
|
6191
6257
|
readonly 'toast.pushDone': '推送完成';
|
|
6192
6258
|
readonly 'toast.pushSkipped': '内容未变化,已跳过';
|
|
6259
|
+
readonly 'toast.pushAllConflicted': '未推送任何分区:还有分区待冲突裁决';
|
|
6193
6260
|
readonly 'toast.syncStartFailed': '从远端合并失败';
|
|
6194
6261
|
readonly 'toast.autosyncUpdateFailed': '自动同步设置更新失败';
|
|
6195
6262
|
readonly 'toast.autosyncUpdated': '自动同步设置已更新';
|
|
@@ -7236,5 +7303,4 @@ export type { AboutPanelProps, ChatKey, ConfigManagerApiError, ConfigManagerKey,
|
|
|
7236
7303
|
|
|
7237
7304
|
return module.exports;
|
|
7238
7305
|
}
|
|
7239
|
-
});
|
|
7240
|
-
//# sourceMappingURL=client.d.ts.map
|
|
7306
|
+
});
|