dsh-config-manager 0.4.0 → 0.4.1
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/client.d.ts +21 -2
- package/lib/client.js +558 -550
- package/lib/core/messages-core.d.ts +1 -0
- package/lib/core/messages-core.js +2 -0
- package/lib/core/migration-history.d.ts +18 -2
- package/lib/core/migration-history.js +19 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -3
- package/lib/sync/autosync-scheduler.js +6 -2
- package/lib/sync/baseline-heal.d.ts +35 -0
- package/lib/sync/baseline-heal.js +39 -0
- package/lib/sync/push-precheck.d.ts +35 -0
- package/lib/sync/push-precheck.js +58 -0
- package/lib/sync/sync-engine.d.ts +9 -12
- package/lib/sync/sync-engine.js +24 -43
- package/lib/ui/history-model.js +3 -2
- package/lib/ui/overview-view.d.ts +3 -3
- package/lib/ui/overview-view.js +9 -1
- package/package.json +1 -1
- package/src/client/history/history-locales.ts +2 -0
- package/src/client/home/HomePanel.tsx +9 -3
- package/src/client/locales.ts +2 -0
- package/src/client/sync/history-model.ts +3 -0
- package/src/client/sync/sync-locales.ts +2 -0
- package/src/core/messages-core.ts +2 -0
- package/src/core/migration-history.test.ts +19 -0
- package/src/core/migration-history.ts +28 -5
- package/src/index.ts +3 -3
- package/src/sync/autosync-scheduler.test.ts +23 -0
- package/src/sync/autosync-scheduler.ts +6 -2
- package/src/sync/baseline-heal.ts +74 -0
- package/src/sync/push-precheck.ts +75 -0
- package/src/sync/sync-engine.test.ts +88 -0
- package/src/sync/sync-engine.ts +33 -43
- package/src/ui/history-model.test.ts +2 -1
- package/src/ui/history-model.ts +3 -2
- package/src/ui/overview-view.test.ts +12 -0
- package/src/ui/overview-view.ts +12 -4
package/lib/client.d.ts
CHANGED
|
@@ -2938,6 +2938,15 @@ interface SyncPushReport {
|
|
|
2938
2938
|
* 而不是记成「同步失败」。
|
|
2939
2939
|
*/
|
|
2940
2940
|
conflict?: boolean;
|
|
2941
|
+
/**
|
|
2942
|
+
* 本次推送前**收养了本机自己推上去的远端最新快照**(0.4.1 自愈):该值 = 被收养的快照 id。
|
|
2943
|
+
*
|
|
2944
|
+
* 触发场景:上次推送在上传成功、写基线之前被打断(进程退出/崩溃/断电),远端已前进而本机
|
|
2945
|
+
* `lastSnapshotId` 仍是上一版 → 前置检测会永久拒绝推送(每次都说「远端被别人推进了」),
|
|
2946
|
+
* 单设备用户因此被自己的快照锁死。判据只看「远端最新快照的 manifest.deviceId == 本机
|
|
2947
|
+
* deviceId」,别的设备推进过就仍然按冲突返回,绝不越过。
|
|
2948
|
+
*/
|
|
2949
|
+
adoptedBase?: string;
|
|
2941
2950
|
}
|
|
2942
2951
|
/** 差异报告中的单个变更项(PlanItem 摘要,不含敏感细节) */
|
|
2943
2952
|
interface PullChange {
|
|
@@ -4810,8 +4819,16 @@ declare class RecoveryApi implements RecoveryPort, RollbackPointPort {
|
|
|
4810
4819
|
declare const MIGRATION_KINDS: readonly ['import', 'restore', 'rollback', 'profile-create', 'profile-select', 'profile-switch', 'profile-delete', 'profile-rename', 'profile-save', 'profile-import', 'sync-apply', 'autosync', 'recovery', 'backup', 'backup-manual', 'snapshot-delete', 'snapshot-prune'];
|
|
4811
4820
|
/** §5 覆盖的操作 kind(COMPLETE 不变量;常量枚举,天然非敏感)。 */
|
|
4812
4821
|
type MigrationKind = (typeof MIGRATION_KINDS)[number];
|
|
4813
|
-
/**
|
|
4814
|
-
|
|
4822
|
+
/**
|
|
4823
|
+
* 操作结果。
|
|
4824
|
+
*
|
|
4825
|
+
* 'pending'(0.4.1):操作**跑完了但仍有待裁决项**(自动同步上传成功、下行冲突未裁决;
|
|
4826
|
+
* 合并已应用一部分)。它不是 failed —— 网络/凭据/repo 都是好的;也不是 skipped ——
|
|
4827
|
+
* 那一轮确实做了事。旧实现把 partial 直接折成 'failed',用户看到「自动同步 失败」而
|
|
4828
|
+
* 实际只需要在同步页确认一次冲突。读侧(parseEntry / query 解析)必须接受该值,
|
|
4829
|
+
* 否则含 pending 的历史条目会被整条丢弃。
|
|
4830
|
+
*/
|
|
4831
|
+
type MigrationResult = 'success' | 'failed' | 'skipped' | 'pending';
|
|
4815
4832
|
/** 触发来源(常量)。 */
|
|
4816
4833
|
type MigrationSource = 'api' | 'autosync' | 'backup-scheduler' | 'recovery' | 'cli' | 'internal';
|
|
4817
4834
|
/** 一条不可变的迁移历史记录(磁盘形态;schemaVersion 内联)。 */
|
|
@@ -5640,6 +5657,7 @@ declare const zh$4: {
|
|
|
5640
5657
|
readonly 'overview.result.success': '成功';
|
|
5641
5658
|
readonly 'overview.result.failed': '失败';
|
|
5642
5659
|
readonly 'overview.result.skipped': '跳过';
|
|
5660
|
+
readonly 'overview.result.pending': '待裁决';
|
|
5643
5661
|
readonly 'overview.activity.copy': '复制';
|
|
5644
5662
|
readonly 'overview.activity.redacted': '(文件名已脱敏)';
|
|
5645
5663
|
readonly 'overview.sections.entries': '{count} 项';
|
|
@@ -6083,6 +6101,7 @@ declare const zh$3: {
|
|
|
6083
6101
|
readonly 'history.autosyncPush': '上传';
|
|
6084
6102
|
readonly 'history.autosyncBoth': '双向';
|
|
6085
6103
|
readonly 'history.autosyncReasonConflict': '冲突';
|
|
6104
|
+
readonly 'history.autosyncReasonBaselineAdopted': '基线已自动收养(上次推送在记录基线前被打断)';
|
|
6086
6105
|
readonly 'history.autosyncReasonNoRemote': '无远端快照';
|
|
6087
6106
|
readonly 'history.autosyncReasonNotConfigured': '未配置仓库';
|
|
6088
6107
|
readonly 'history.autosyncReasonNetwork': '网络问题';
|