dsh-plugin-update-doctor 0.5.0 → 0.5.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.
- package/README.md +65 -65
- package/client.js +337 -32
- package/docs/DETAIL.md +65 -22
- package/docs/PUBLICATION.md +36 -15
- package/docs/RELEASE_NOTES_0_5_1.md +80 -0
- package/docs/RELEASE_REVIEW_0_5_1.md +54 -0
- package/docs/SELF_UPDATE.md +7 -1
- package/docs/UNION_GENERATION_0_5_2.md +32 -0
- package/docs/V0_3_DESIGN.md +2 -0
- package/docs/VERIFICATION.md +168 -81
- package/docs/WINDOWS_REQUIREMENTS.md +48 -0
- package/docs/WINDOWS_SUPPORT.md +82 -0
- package/docs/WSL_STRUCTURAL_0_5_3.md +30 -0
- package/index.js +15 -2
- package/lib/dependency-policy.js +89 -0
- package/lib/history.js +2 -2
- package/lib/http.js +5 -1
- package/lib/identity.js +22 -3
- package/lib/online.js +44 -18
- package/lib/self-update-policy.js +90 -25
- package/lib/self-update-store.js +25 -9
- package/lib/self-update.js +92 -29
- package/lib/service.js +437 -58
- package/lib/source.js +29 -0
- package/lib/staging.js +128 -30
- package/lib/union-generation.js +376 -0
- package/lib/union-service.js +83 -0
- package/lib/union-staging.js +325 -0
- package/lib/wsl-outcome.js +15 -0
- package/lib/wsl-policy.js +71 -5
- package/lib/wsl-proof.js +85 -0
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -148,14 +148,16 @@ window.__ModuleLoader__.load({
|
|
|
148
148
|
'reason.wsl-version-not-yet-verified': 'This WSL version has not yet passed runtime-generation verification.',
|
|
149
149
|
'reason.wsl-archive-requires-new-review': 'The WSL archive bytes differ from the verified build.',
|
|
150
150
|
'reason.high-impact': 'High-impact plugin: confirm task handling and verify activation afterward.',
|
|
151
|
-
safety: 'DSH stays open. Wait for current tasks by default,
|
|
151
|
+
safety: 'DSH stays open. Wait for current tasks by default; stopping requires separate consent. WSL candidates are checked against public archives and the generation contract, not a fixed version list. The 0.26.2 → 0.29.0 path passed isolated Host tests. Existing sessions may retain their prior presets.'
|
|
152
152
|
});
|
|
153
153
|
Object.assign(ZH, {
|
|
154
154
|
'reason.wsl-version-not-yet-verified': '此 WSL 版本尚未通过代际更新验证。',
|
|
155
155
|
'reason.wsl-archive-requires-new-review': 'WSL 归档字节与已验证构建不同,需要重新检查。',
|
|
156
156
|
'reason.high-impact': '高影响插件,请确认任务处理方式并核对更新后的加载结果。',
|
|
157
|
-
safety: 'DSH
|
|
157
|
+
safety: 'DSH 保持打开:默认等待当前任务,停止任务需额外确认。WSL 新版按公开原包与代际契约检查,不再只限固定版本名单;0.26.2 → 0.29.0 已通过隔离宿主验证。已有会话可能保留旧预设。'
|
|
158
158
|
});
|
|
159
|
+
Object.assign(EN, {"reason.wsl-version-format-unsupported":"The WSL target is not a supported stable version identity.","reason.wsl-archive-preflight-unavailable":"The WSL archive inspector is unavailable; verify updater activation.","reason.wsl-archive-preflight-failed":"WSL archive preflight failed before any installation; review diagnostics.","reason.wsl-provider-contract-changed":"The WSL service/preset declaration differs from the generation contract; this is not a version allowlist.","reason.wsl-runtime-dependency-contract-changed":"The WSL candidate introduces a different runtime dependency contract.","reason.wsl-client-contract-changed":"The WSL Client injection contract changed.","reason.wsl-peer-contract-changed":"The WSL Host peer contract changed.","reason.wsl-export-contract-changed":"WSL exports or resource targets do not match generation packaging constraints.","reason.wsl-native-resource-contract-changed":"The WSL archive contains an unsupported native resource path; it was not installed.","reason.wsl-package-resolution-contract-changed":"WSL package resolution or install declarations changed; no installation was performed.","reason.wsl-candidate-archive-changed":"The WSL candidate digest changed after inspection; check again.","reason.wsl-retained-generation-limit":"Retained WSL generations reached the safety limit; old resources are not silently deleted.","reason.wsl-generation-outcome-unknown":"The prior WSL update/recovery outcome is unknown; do not resend or recover automatically. Inspect the official manager."});
|
|
160
|
+
Object.assign(ZH, {"reason.wsl-version-format-unsupported":"WSL 目标不是支持的正式版本格式。","reason.wsl-archive-preflight-unavailable":"WSL 原包检查服务不可用,请确认更新器已加载。","reason.wsl-archive-preflight-failed":"WSL 原包预检查未通过,尚未尝试安装;请查看具体诊断。","reason.wsl-provider-contract-changed":"新版 WSL 的服务/预设声明发生变化,未通过代际契约检查。不是版本号不在名单。","reason.wsl-runtime-dependency-contract-changed":"新版 WSL 引入了不同运行依赖,需要单独核对。","reason.wsl-client-contract-changed":"新版 WSL 客户端注入声明发生变化,需要单独核对。","reason.wsl-peer-contract-changed":"新版 WSL 的宿主依赖声明发生变化,需要单独核对。","reason.wsl-export-contract-changed":"WSL 导出或对应资源不符合代际包装条件。","reason.wsl-native-resource-contract-changed":"WSL 存在未获准的原生资源路径,未执行安装。","reason.wsl-package-resolution-contract-changed":"WSL 包解析或安装声明发生变化,未执行安装。","reason.wsl-candidate-archive-changed":"检查后 WSL 原包摘要变化,请重新检查,不复用旧确认。","reason.wsl-retained-generation-limit":"保留的 WSL 旧代达到安全上限;不会自动删除仍可能使用的旧资源。","reason.wsl-generation-outcome-unknown":"上次 WSL 更新/恢复结果未知,不能自动重发或恢复,请先核对官方管理器状态。"});
|
|
159
161
|
Object.assign(EN, {
|
|
160
162
|
restore: 'Review previous-version recovery', recoveryTarget: 'Recorded recovery version', recoveryRequired: 'Recovery requires your review', recoveryHelp: 'Only the previous package recorded for this failed operation can be restored. Review its version and task policy; no arbitrary downgrade is accepted.',
|
|
161
163
|
confirmRestoreTitle: 'Confirm recorded previous-version recovery', confirmRestoreImpact: 'Restore only the previous package from this failed operation. This affects the whole profile; waiting for current Agent tasks is the default.',
|
|
@@ -276,6 +278,152 @@ window.__ModuleLoader__.load({
|
|
|
276
278
|
'reason.self-github-object-mismatch': '无法核验 GitHub 对象摘要,禁止更新。',
|
|
277
279
|
'reason.self-installed-original-unverified': '已安装文件与原包或固定 GitHub 提交不一致,已阻止自身升级。'
|
|
278
280
|
});
|
|
281
|
+
Object.assign(EN, {
|
|
282
|
+
latestVersion: 'Checked version', taskPolicy: 'Tasks before updating', reasonTitle: 'Online update conditions',
|
|
283
|
+
versionCheck: 'Version check', onlineUpdate: 'Online update', querySource: 'Version query source',
|
|
284
|
+
querySourceUnknown: 'Source not verified', querySourceScope: 'This version result applies only to this query source, not every source.',
|
|
285
|
+
queryGithubSource: 'This updater’s fixed GitHub repository · main HEAD, not a release',
|
|
286
|
+
'version.available': 'Newer compatible stable version found', 'version.up-to-date': 'No newer stable version found on the current query source',
|
|
287
|
+
'version.no-compatible-version': 'Newer published version found, but no eligible stable update candidate', 'version.unknown': 'Could not determine whether a compatible newer version exists',
|
|
288
|
+
'version.error': 'Version check failed', 'version.not-checked': 'Not checked',
|
|
289
|
+
'update.available': 'Available after confirmation', 'update.blocked': 'Conditions not met', 'update.no-update': 'No selectable newer version', 'update.not-checked': 'Not checked',
|
|
290
|
+
installedVersionShown: 'Installed version', compatibleVersionShown: 'Compatible update candidate', publishedVersionShown: 'Newer published version',
|
|
291
|
+
notCompatibleCandidate: 'No eligible stable candidate: it may be incompatible, deprecated or not a plugin bundle', candidateUnconfirmed: 'Published version found; the update candidate remains unconfirmed',
|
|
292
|
+
selfCheckHelp: 'The updater has a separate update path. Click Check all updates to review its version and source; never mix it into a normal batch.',
|
|
293
|
+
'reason.self-update-blocked': 'The updater is excluded from ordinary batches; review its independent self-update path.',
|
|
294
|
+
'reason.host-runtime-dependencies': 'Declares @deepseek-ai runtime dependencies; this path is not yet verified. This is not proof that it replaces the Host.',
|
|
295
|
+
'reason.registry-origin-unsupported': 'This query source is not admitted for online replacement; no source is silently migrated.',
|
|
296
|
+
'reason.registry-origin-unverified': 'The actual query source could not be verified; online replacement remains blocked.',
|
|
297
|
+
'reason.self-update-public-origin-required': 'Self-update requires a verified public npm query source; a mirror or other source is not silently migrated.',
|
|
298
|
+
'reason.self-query-origin-unverified': 'The actual public npm query source could not be verified; self-update remains blocked.',
|
|
299
|
+
'reason.registry-origin-changed': 'The effective query source changed during the check. Recheck before preparing any update.',
|
|
300
|
+
'reason.version-metadata-incomplete': 'Version metadata is incomplete or the lookup window omits candidates. No latest-version or safe-update conclusion is inferred.',
|
|
301
|
+
registrySourceVerification:'npm source and official update eligibility',
|
|
302
|
+
'registryCheck.verified':'Registry installation preserved', 'registryCheck.failed':'Registry installation not verified', 'registryCheck.unknown':'Registry source unknown',
|
|
303
|
+
'reason.legacy-archive-source-requires-migration':'An older Doctor update installed this plugin from a local archive. Automatic source migration is refused; review migration with the official manager.',
|
|
304
|
+
'reason.registry-update-outcome-unknown':'A registry update or recovery has no verified final result. Check the official manager; do not resend it automatically.',
|
|
305
|
+
'reason.registry-handoff-unavailable':'The public Host exact-version registry update path is unavailable.',
|
|
306
|
+
'reason.dependency-runtime-reload-unverified':'Safe no-restart updating is not supported on this stock Host path. This updater blocks the risk; it does not fix Host reload or automatically restart DSH.',
|
|
307
|
+
'reason.identity-store-unverified':'Installation/recovery records cannot be verified. Stop management attempts and inspect the official manager; do not overwrite the records.',
|
|
308
|
+
unionGenerationSafety:'Union uses a reviewed complete-dependency generation archive while DSH stays open. The original code is preserved, but installation becomes a Doctor-owned local archive, not an npm installation; built-in Versions eligibility is not preserved. The plugin temporarily unloads and recovery may fail. Only reviewed exact versions are supported.',
|
|
309
|
+
acknowledgeUnionGeneration:'I accept the derived local generation source, temporary plugin unload, and separately verified recovery risk.',
|
|
310
|
+
'reason.union-version-not-reviewed':'This Union version pair has no reviewed complete-dependency generation path.',
|
|
311
|
+
'reason.union-generation-outcome-unknown':'The Union generation update or recovery has no verified final outcome; do not resend it.',
|
|
312
|
+
'reason.union-generation-confirmation-required':'The derived local Union generation source requires an additional acknowledgement.',
|
|
313
|
+
unionSourceVerification:'Derived local dependency generation source', 'unionSource.verified':'Local generation source verified; built-in Versions not preserved', 'unionSource.failed':'Local generation source not verified', 'unionSource.unknown':'Local generation source unknown',
|
|
314
|
+
unionRuntimeVerification:'Exact running dependency generation', 'runtime.verified':'Generation verified', 'runtime.unknown':'Running generation unverified', 'runtime.disabled':'Disabled; generation code not executed',
|
|
315
|
+
unionGenerationSource:'Doctor-owned local dependency generation · original npm bytes verified',
|
|
316
|
+
registryHandoffSafety:'Normal npm updates preserve registry installation through the official Host updater. Prepared archives are preflight evidence: the Host downloads again using its existing fallback settings, and installation/rollback may fail. WSL generation packages remain local archives.'
|
|
317
|
+
});
|
|
318
|
+
Object.assign(ZH, {
|
|
319
|
+
latestVersion: '版本检查结果', taskPolicy: '更新前任务处理', reasonTitle: '在线更新条件',
|
|
320
|
+
versionCheck: '版本检查', onlineUpdate: '在线更新', querySource: '版本查询源',
|
|
321
|
+
querySourceUnknown: '来源未确认', querySourceScope: '版本检查结果仅针对该查询源,不代表所有来源。',
|
|
322
|
+
queryGithubSource: '更新器固定 GitHub 仓库 · 主分支 HEAD,非 Release',
|
|
323
|
+
'version.available': '发现较新的兼容正式版', 'version.up-to-date': '当前查询源未发现较新的正式版本',
|
|
324
|
+
'version.no-compatible-version': '已发现新版,但没有可选的正式版更新候选', 'version.unknown': '未能确定是否存在兼容新版',
|
|
325
|
+
'version.error': '版本检查失败', 'version.not-checked': '尚未检查',
|
|
326
|
+
'update.available': '可在确认后更新', 'update.blocked': '条件不满足', 'update.no-update': '无可选新版', 'update.not-checked': '尚未检查',
|
|
327
|
+
installedVersionShown: '当前已装版本', compatibleVersionShown: '兼容更新候选', publishedVersionShown: '较新发布版本',
|
|
328
|
+
notCompatibleCandidate: '没有可选正式版候选:可能不兼容、已弃用或未声明插件包', candidateUnconfirmed: '已发现发布版本,更新候选仍未确定',
|
|
329
|
+
selfCheckHelp: '更新器支持独立检查;点击“检查全部更新”后核对版本及来源,不与普通批次混合。',
|
|
330
|
+
'reason.self-update-blocked': '更新器不参与普通批次,请核对独立的自身升级路径。',
|
|
331
|
+
'reason.host-runtime-dependencies': '声明了 @deepseek-ai 范围的运行依赖,当前路径尚未验证;这不是已确认会替换宿主。',
|
|
332
|
+
'reason.registry-origin-unsupported': '当前查询源未获准用于在线替换,不会静默迁移来源。',
|
|
333
|
+
'reason.registry-origin-unverified': '无法核验实际版本查询源,在线替换仍被阻止。',
|
|
334
|
+
'reason.self-update-public-origin-required': '自身升级要求已核验的公共 npm 查询源,不会静默迁移镜像或其它来源。',
|
|
335
|
+
'reason.self-query-origin-unverified': '无法核验实际公共 npm 查询源,自身升级仍被阻止。',
|
|
336
|
+
'reason.registry-origin-changed': '检查期间实际查询源发生变化,请重新检查后再准备更新。',
|
|
337
|
+
'reason.version-metadata-incomplete': '版本元数据不完整或查询窗口遗漏候选,不能据此认定已是最新或可安全更新。',
|
|
338
|
+
registrySourceVerification:'npm 来源与官方更新资格',
|
|
339
|
+
'registryCheck.verified':'保留 npm 安装来源', 'registryCheck.failed':'npm 来源未通过核验', 'registryCheck.unknown':'npm 来源未知',
|
|
340
|
+
'reason.legacy-archive-source-requires-migration':'此前的更新器将此插件安装为本地归档;不会自动迁移来源,请通过官方管理器核对迁移方式。',
|
|
341
|
+
'reason.registry-update-outcome-unknown':'npm 更新或恢复没有已核验的最终结果,请核对官方管理器,不要自动重发。',
|
|
342
|
+
'reason.registry-handoff-unavailable':'宿主公开的按精确版本 npm 更新路径不可用。',
|
|
343
|
+
'reason.dependency-runtime-reload-unverified':'当前原版宿主的这条路径不支持安全无重启更新。本更新器只拦截风险,不修复宿主热加载,也不会自动重启 DSH。',
|
|
344
|
+
'reason.identity-store-unverified':'安装/恢复记录无法核验,已停止管理操作;请核对官方管理器,不要覆盖未知记录。',
|
|
345
|
+
unionGenerationSafety:'Union 使用已审查的完整依赖代际归档,在 DSH 保持打开时替换。原始代码不改,但安装来源会变为更新器管理的本地归档,不再是 npm 安装,宿主内置 Versions 资格不保留。插件会短暂卸载,恢复也可能失败;只支持已审查的精确版本。',
|
|
346
|
+
acknowledgeUnionGeneration:'我接受完整依赖代际的本地归档来源、插件短暂卸载,以及分别核验的恢复风险。',
|
|
347
|
+
'reason.union-version-not-reviewed':'此 Union 版本组合尚未获得完整依赖代际更新准入。',
|
|
348
|
+
'reason.union-generation-outcome-unknown':'Union 代际更新或恢复没有已核验的最终结果,请勿重发。',
|
|
349
|
+
'reason.union-generation-confirmation-required':'Union 完整依赖代际的本地来源需要额外确认。',
|
|
350
|
+
unionSourceVerification:'完整依赖代际的本地来源核验', 'unionSource.verified':'本地代际来源已核验;内置 Versions 资格不保留', 'unionSource.failed':'本地代际来源未核验', 'unionSource.unknown':'本地代际来源未知',
|
|
351
|
+
unionRuntimeVerification:'实际运行的完整依赖代际', 'runtime.verified':'已核验运行代际', 'runtime.unknown':'运行代际未核验', 'runtime.disabled':'已停用;未执行代际代码',
|
|
352
|
+
unionGenerationSource:'更新器本地依赖代际 · 已核验原始 npm 字节',
|
|
353
|
+
registryHandoffSafety:'普通 npm 更新通过官方管理器保留 npm 安装来源。准备的归档仅作预检证据,宿主会沿用现有 fallback 重新下载;安装和恢复均可能失败。WSL 代际包装仍使用本地归档。'
|
|
354
|
+
});
|
|
355
|
+
Object.assign(EN, {
|
|
356
|
+
migrateSource: 'Review migration back to npm', migrationResults: 'Source migration results', migratingSource: 'Migrating source', reviewingMigration: 'Reviewing source migration…', 'status.migrated': 'Source migrated',
|
|
357
|
+
confirmMigrationTitle: 'Confirm migration from archive to npm', confirmMigrationImpact: 'Reinstall this same plugin version from npm, not an upgrade. The change affects all sessions in this profile and may temporarily unload the plugin.',
|
|
358
|
+
migrationSafety: 'Only a verified earlier Doctor archive installation can be migrated. The version stays the same; its saved installation source becomes an npm spec so official version checks can resume. Failed installation may require restoring the old archive. Existing settings and tasks still need review.',
|
|
359
|
+
acknowledgeMigration: 'I reviewed the same version, the archive-to-npm source change, and the possible temporary unload or archive recovery.',
|
|
360
|
+
confirmMigrationWait: 'Confirm migration and wait for idle', confirmMigrationStop: 'Confirm task stopping and migrate', migrationHelp: 'Migration is separate from batch updates. It changes the installation source, not the version, and requires independent confirmation.',
|
|
361
|
+
publicFallbackSafety: 'Official npm is the version query source. The unchanged displayed Host plan can use public fallback registries. Potential mirror updater archives are compared with canonical npm, but the Host downloads again, so installation and recovery are not atomic byte replacements. No global registry setting is changed.',
|
|
362
|
+
acknowledgePublicFallback: 'I accept this displayed public fallback plan, mirror/refetch and recovery risks without changing my source settings.',
|
|
363
|
+
'info.public-fallback-may-use-mirror': 'The configured public fallback plan can use the fixed mirror; additional acknowledgement is required.',
|
|
364
|
+
'reason.self-host-registry-plan-unsupported': 'The Host source plan contains a private, unknown or unsupported source; only verified official npm and the fixed public mirror are admitted.',
|
|
365
|
+
mirrorSafety: 'This operation uses the fixed public npm mirror. Mirror versions can lag. Review the prepared package and canonical npm comparison evidence separately: the Host refetches using its registry plan, which is shown only when provided, not an atomic byte replacement. Installation/recovery may fail. No source configuration is silently changed.',
|
|
366
|
+
acknowledgeMirror: 'I explicitly accept this public-mirror source and its displayed fallback/refetch and recovery risks.',
|
|
367
|
+
mirrorRegistryPlan: 'Confirmed Host registry plan', mirrorPlanPrimary: 'Configured first source', mirrorPlanResolved: 'pnpm resolved source', mirrorPlanFallback: 'Fallback source',
|
|
368
|
+
'reason.self-public-mirror-confirmation-required': 'Public-mirror self-update requires its additional source-risk acknowledgement.',
|
|
369
|
+
detailDoctorTitle: 'Plugin online updates · independent check', detailDoctorHelp: 'This section is provided by the community updater, not the Host’s built-in Versions list. It can inspect Doctor-managed archive installations without pretending they are npm sources.',
|
|
370
|
+
detailDoctorProbe: 'Check updater records and versions', detailDoctorOpen: 'Handle in Plugin online updates', detailDoctorManual: 'Open Plugin online updates from the left sidebar to review and confirm; this section cannot install or migrate a plugin.',
|
|
371
|
+
detailDoctorUnmanaged: 'No matching Doctor-managed archive record was verified. Use the official manager to inspect this installation source.',
|
|
372
|
+
detailDoctorReadOnly: 'Checking is read-only. Updating or source migration is reviewed and confirmed separately in Plugin online updates.',
|
|
373
|
+
sourcePublicOnly: 'Normal updates use verified public npm sources, including explicitly confirmed public mirrors where supported. Archive provenance, source migration, and update confirmation are checked separately.'
|
|
374
|
+
});
|
|
375
|
+
Object.assign(ZH, {
|
|
376
|
+
migrateSource: '核对迁回 npm 来源', migrationResults: '来源迁移结果', migratingSource: '正在迁移来源', reviewingMigration: '正在核对来源迁移…', 'status.migrated': '来源已迁移',
|
|
377
|
+
confirmMigrationTitle: '确认从归档迁回 npm 来源', confirmMigrationImpact: '从 npm 重新安装此插件的同一版本,不是升级。变更影响当前配置的所有会话,期间可能暂时卸载插件。',
|
|
378
|
+
migrationSafety: '只迁移已核验的旧更新器归档安装。版本号不变,保存来源改为 npm 规格,以恢复官方版本检查资格。安装失败可能需要恢复旧归档;仍需核对现有配置和任务影响。',
|
|
379
|
+
acknowledgeMigration: '我已核对同一版本、从归档迁回 npm 的来源变化,以及临时卸载或恢复旧归档的风险。',
|
|
380
|
+
confirmMigrationWait: '确认迁移并等待空闲', confirmMigrationStop: '确认停止任务并迁移', migrationHelp: '来源迁移不与批量更新混合,只改变安装来源、不升级版本,需要单独确认。',
|
|
381
|
+
publicFallbackSafety: '版本查询来自官方 npm;下方原有宿主计划仍可能使用公共备用源。已核对可能使用的镜像更新器归档与官方 npm 一致,但宿主会重新下载,安装和恢复并非原子字节替换。不会改动你的全局源设置。',
|
|
382
|
+
acknowledgePublicFallback: '我接受下方公共备用源计划、镜像/重新下载和恢复风险,不要求更改我的源设置。',
|
|
383
|
+
'info.public-fallback-may-use-mirror': '原有公共备用源计划可能使用固定镜像,需要额外确认。',
|
|
384
|
+
'reason.self-host-registry-plan-unsupported': '宿主源计划包含私有、未知或不支持的来源;仅接纳已核验的官方 npm 和固定公共镜像。',
|
|
385
|
+
mirrorSafety: '本次使用固定公共 npm 镜像,镜像版本可能延迟。请分别核对准备的包和官方 npm 对照证据;宿主按其安装源计划重新下载,提供时才展示该计划,并非原子字节替换。安装和恢复可能失败,不会偷偷修改来源配置。',
|
|
386
|
+
acknowledgeMirror: '我明确接受本次公共镜像来源,以及显示的 fallback、重新下载和恢复风险。',
|
|
387
|
+
mirrorRegistryPlan: '已确认宿主安装源计划', mirrorPlanPrimary: '配置的首选来源', mirrorPlanResolved: 'pnpm 实际来源', mirrorPlanFallback: '备用来源',
|
|
388
|
+
'reason.self-public-mirror-confirmation-required': '公共镜像自身升级需要额外确认来源风险。',
|
|
389
|
+
detailDoctorTitle: '插件在线更新 · 独立检查', detailDoctorHelp: '此区由社区更新器提供,不是宿主内置 Versions 列表。它检查更新器管理的归档安装,不伪装成 npm 来源。',
|
|
390
|
+
detailDoctorProbe: '检查更新器记录与版本', detailDoctorOpen: '在插件在线更新中处理', detailDoctorManual: '请从左侧打开“插件在线更新”核对并确认;此区不能安装或迁移插件。',
|
|
391
|
+
detailDoctorUnmanaged: '没有核验到匹配的更新器归档记录,请通过官方管理器核对安装来源。',
|
|
392
|
+
detailDoctorReadOnly: '检查只读;更新或迁移来源需要到“插件在线更新”分别核对并确认。',
|
|
393
|
+
sourcePublicOnly: '普通更新使用已核验的公共 npm 来源,支持时公共镜像需明确确认;归档身份、来源迁移和更新确认分别核验。'
|
|
394
|
+
});
|
|
395
|
+
Object.assign(EN, {
|
|
396
|
+
acknowledgeMirror: 'I explicitly accept this public-mirror source, possible Host fallback/refetch, and installation/recovery risks. This does not confirm an undisclosed transport plan.',
|
|
397
|
+
mirrorRegistryPlan: 'Prepared Host registry-plan evidence', mirrorPlanUnavailable: 'No complete Host registry plan was provided or bound for this operation. The Host manages fallback and refetch; only the selected source and available observations are shown.',
|
|
398
|
+
mirrorFallbackConfigured: 'Host fallback observed as configured', mirrorFallbackNotConfigured: 'No Host fallback observed at preparation', mirrorFallbackUnknown: 'Host fallback configuration was not verified',
|
|
399
|
+
archiveSourceIdentity: 'Local archive · verified npm provenance',
|
|
400
|
+
'info.public-mirror-may-lag': 'The public mirror may lag behind official npm; this version result applies to the mirror only.',
|
|
401
|
+
'reason.dependency-graph-changed': 'The dependency declarations or installed graph changed. Recheck and review the dependency update separately before replacement.',
|
|
402
|
+
'reason.dependency-source-unsupported': 'A dependency uses an unreviewed source or Host/runtime package. Use an independently reviewed installation path.',
|
|
403
|
+
'reason.dependency-not-resolved': 'An installed dependency could not be located for read-only verification. Inspect the package state in the official manager before retrying.',
|
|
404
|
+
'reason.dependency-graph-limit': 'The dependency graph exceeded the bounded verification budget. This is not proof of corruption; it requires separate review.',
|
|
405
|
+
'reason.dependency-path-unsupported': 'A dependency contains an unsupported linked or unsafe path. Its graph cannot be verified by this update path.',
|
|
406
|
+
'reason.dependency-graph-update-requires-separate-review': 'This dependency layout or change has not been admitted. It requires separate review; merely having dependencies is not an incompatibility finding.',
|
|
407
|
+
'reason.migration-not-admitted': 'Migration requires an identified earlier ordinary Doctor archive with no unresolved operation. Other sources must be reviewed in the official manager.',
|
|
408
|
+
'reason.migration-state-changed': 'The archive installation changed during migration preparation. Refresh and review the same-version migration again.',
|
|
409
|
+
'reason.migration-outcome-unknown': 'The migration has no verified final result. Inspect installed state and the official manager; do not automatically repeat it.'
|
|
410
|
+
});
|
|
411
|
+
Object.assign(ZH, {
|
|
412
|
+
acknowledgeMirror: '我明确接受本次公共镜像来源、宿主可能使用 fallback 重新下载,以及安装/恢复风险;这不表示确认未披露的传输计划。',
|
|
413
|
+
mirrorRegistryPlan: '准备时的宿主安装源计划证据', mirrorPlanUnavailable: '本次未提供或绑定完整宿主安装源计划。fallback 和重新下载由宿主管理;这里仅显示所选来源及已有观察,不能视为完整计划已确认。',
|
|
414
|
+
mirrorFallbackConfigured: '准备时观察到宿主已配置备用来源', mirrorFallbackNotConfigured: '准备时未观察到宿主备用来源', mirrorFallbackUnknown: '宿主备用来源配置未核验',
|
|
415
|
+
archiveSourceIdentity: '本地归档 · 已核验 npm 出处',
|
|
416
|
+
'info.public-mirror-may-lag': '公共镜像可能落后于官方 npm;此版本结果仅针对镜像来源。',
|
|
417
|
+
'reason.dependency-graph-changed': '依赖声明或实际依赖图发生变化,请重新检查,并单独审查依赖更新后再替换。',
|
|
418
|
+
'reason.dependency-source-unsupported': '依赖使用了未审查来源或宿主/运行时包,需要独立审查的安装路径。',
|
|
419
|
+
'reason.dependency-not-resolved': '无法定位某项已安装依赖进行只读核验,请先通过官方管理器核对包状态再重试。',
|
|
420
|
+
'reason.dependency-graph-limit': '依赖图超过有界核验预算;这不证明包损坏,需要单独审查。',
|
|
421
|
+
'reason.dependency-path-unsupported': '依赖包含不支持的链接或不安全路径,当前更新路径无法核验该依赖图。',
|
|
422
|
+
'reason.dependency-graph-update-requires-separate-review': '此依赖布局或变化尚未准入,需单独审查;仅有依赖不代表插件不兼容。',
|
|
423
|
+
'reason.migration-not-admitted': '迁移仅接受已识别的旧普通更新器归档且无未解决操作,其它来源需通过官方管理器核对。',
|
|
424
|
+
'reason.migration-state-changed': '准备迁移期间归档安装已变化,请刷新并重新核对同版本来源迁移。',
|
|
425
|
+
'reason.migration-outcome-unknown': '来源迁移没有已核验的最终结果,请核对实际安装和官方管理器,不要自动重复操作。'
|
|
426
|
+
});
|
|
279
427
|
const githubReasonAliases = {
|
|
280
428
|
'self-github-tree-mode-unsupported': 'self-github-tree-unsupported', 'self-github-tree-path-unsupported': 'self-github-tree-unsupported',
|
|
281
429
|
'self-github-tree-size-unsupported': 'self-github-tree-unsupported', 'self-github-tree-invalid': 'self-github-tree-unsupported',
|
|
@@ -306,10 +454,69 @@ window.__ModuleLoader__.load({
|
|
|
306
454
|
const raw = string(step?.step); const prefix = ['preparing', 'updating', 'installing', 'restoring', 'verifying'].find(name => raw.startsWith(name + '-'));
|
|
307
455
|
return prefix ? localText(t, 'step.' + prefix, prefix) + ' · ' + raw.slice(prefix.length + 1) : localText(t, 'step.' + raw, raw || t('unknown'));
|
|
308
456
|
};
|
|
309
|
-
const
|
|
457
|
+
const hasVersionStates = item => !!item && (Object.hasOwn(item, 'versionStatus') || Object.hasOwn(item, 'updateStatus'));
|
|
458
|
+
const versionStates = item => {
|
|
459
|
+
if (hasVersionStates(item)) return {
|
|
460
|
+
version: ['available', 'up-to-date', 'no-compatible-version', 'unknown', 'error', 'not-checked'].includes(item.versionStatus) ? item.versionStatus : 'unknown',
|
|
461
|
+
update: ['available', 'blocked', 'no-update', 'not-checked'].includes(item.updateStatus) ? item.updateStatus : 'blocked',
|
|
462
|
+
};
|
|
463
|
+
const version = item?.status === 'not-checked' ? 'not-checked' : item?.status === 'error' ? 'error'
|
|
464
|
+
: string(item?.latestVersion) ? 'available' : item?.status === 'up-to-date' ? 'up-to-date' : 'unknown';
|
|
465
|
+
return { version, update: item?.status === 'not-checked' ? 'not-checked' : item?.status === 'available' && item?.canUpdate === true ? 'available'
|
|
466
|
+
: item?.status === 'blocked' || array(item?.reasons).length ? 'blocked' : 'no-update' };
|
|
467
|
+
};
|
|
468
|
+
const eligible = item => item?.canUpdate === true && !!string(item.latestVersion) && (hasVersionStates(item)
|
|
469
|
+
? item.versionStatus === 'available' && item.updateStatus === 'available' : item.status === 'available');
|
|
470
|
+
const initialVersionItem = item => ({ ...item, canUpdate: false, latestVersion: null, latestPublishedVersion: null,
|
|
471
|
+
versionStatus: 'not-checked', updateStatus: 'not-checked', status: 'not-checked',
|
|
472
|
+
...(item?.name === 'dsh-plugin-update-doctor' ? { mode: 'host-self-update', reasons: array(item.reasons).filter(reason => reason !== 'self-update-blocked') } : {}) });
|
|
473
|
+
const safeQueryOrigin = value => {
|
|
474
|
+
if (!string(value) || value.length > 512) return '';
|
|
475
|
+
try {
|
|
476
|
+
const url = new URL(value);
|
|
477
|
+
return ['https:', 'http:'].includes(url.protocol) && !url.username && !url.password && !url.search && !url.hash && url.pathname === '/' ? url.origin : '';
|
|
478
|
+
} catch { return ''; }
|
|
479
|
+
};
|
|
480
|
+
const versionDisplay = item => {
|
|
481
|
+
const { version } = versionStates(item);
|
|
482
|
+
if (version === 'not-checked') return { value: '', label: 'notChecked' };
|
|
483
|
+
if (version === 'up-to-date') return { value: string(item?.version), label: 'installedVersionShown' };
|
|
484
|
+
if (string(item?.latestVersion) && version === 'available') return { value: item.latestVersion, label: 'compatibleVersionShown' };
|
|
485
|
+
if (string(item?.latestPublishedVersion)) return { value: item.latestPublishedVersion, label: 'publishedVersionShown', note: version === 'no-compatible-version' ? 'notCompatibleCandidate' : 'candidateUnconfirmed' };
|
|
486
|
+
return { value: '', label: version === 'error' ? 'version.error' : 'unknown' };
|
|
487
|
+
};
|
|
310
488
|
const recoveryEligible = item => item?.canRestore === true && !!string(item.restoreVersion) && !!string(item.recoveryId);
|
|
311
489
|
const isSelf = operation => operation === 'host-self-update';
|
|
312
490
|
const isRestore = operation => operation === 'batch-restore';
|
|
491
|
+
const isMigration = operation => operation === 'source-migration';
|
|
492
|
+
const migrationEligible = item => item?.canMigrate === true && item.name !== 'dsh-plugin-update-doctor' && item.name !== 'dsh-plugin-wsl-env';
|
|
493
|
+
const mirrorAcknowledgementRequired = plan => plan?.mirrorRiskRequiresAcknowledgement === true || array(plan?.items).some(item => item?.mirrorRiskRequiresAcknowledgement === true || item?.publicMirror === true || item?.publicFallback === true || item?.sourceMode === 'public-mirror' || item?.sourceMode === 'public-fallback' || safeQueryOrigin(item?.registry) === 'https://registry.npmmirror.com');
|
|
494
|
+
const operationResultTitle = operation => isMigration(operation) ? 'migrationResults' : isRestore(operation) ? 'restoreResults' : 'batchResults';
|
|
495
|
+
const resultStatus = item => item?.installMode === 'registry-migration' && item.status === 'updated' ? 'migrated' : string(item?.status) || 'unknown';
|
|
496
|
+
const mirrorPlanRows = plan => {
|
|
497
|
+
const value = plan?.hostRegistryPlan ?? array(plan?.items).find(item => item?.hostRegistryPlan)?.hostRegistryPlan;
|
|
498
|
+
if (!value || typeof value !== 'object') return [];
|
|
499
|
+
const rows = [
|
|
500
|
+
{ label: 'mirrorPlanPrimary', origin: safeQueryOrigin(value.registry ?? value.resolved) },
|
|
501
|
+
{ label: 'mirrorPlanResolved', origin: safeQueryOrigin(value.resolved) },
|
|
502
|
+
...array(value.fallbackRegistries).slice(0, 8).map(origin => ({ label: 'mirrorPlanFallback', origin: safeQueryOrigin(origin) })),
|
|
503
|
+
];
|
|
504
|
+
return rows;
|
|
505
|
+
};
|
|
506
|
+
const mirrorPlanEvidence = plan => {
|
|
507
|
+
const rows = mirrorPlanRows(plan);
|
|
508
|
+
const observation = plan?.hostRegistryTransport ?? array(plan?.items).find(item => item?.hostRegistryTransport)?.hostRegistryTransport;
|
|
509
|
+
return { rows, complete: rows.length > 0, fallbackLabel: observation?.fallbackConfigured === true ? 'mirrorFallbackConfigured' : observation?.fallbackConfigured === false ? 'mirrorFallbackNotConfigured' : 'mirrorFallbackUnknown' };
|
|
510
|
+
};
|
|
511
|
+
const informationWarnings = item => array(item?.infoWarnings).filter(value => typeof value === 'string').slice(0, 12);
|
|
512
|
+
const highImpactWarning = item => item?.highImpact === true || array(item?.reasons).includes('high-impact');
|
|
513
|
+
const installedSourceLabel = item => item?.runtimePackaging==='union-dependency-generation' ? 'unionGenerationSource' : item?.doctorArchive === true ? 'archiveSourceIdentity' : 'source.' + string(item?.sourceKind);
|
|
514
|
+
const detailSubjectCandidate = subject => subject?.kind === 'bundle' && subject.pkg?.installed === true && (subject.pkg.name === 'dsh-plugin-wsl-env' || subject.pkg.name !== 'dsh-plugin-update-doctor' && string(subject.pkg.source).startsWith('file:'));
|
|
515
|
+
const verifiedDetailRecord = (subject, snapshot) => {
|
|
516
|
+
if (!detailSubjectCandidate(subject)) return null;
|
|
517
|
+
const record = array(snapshot?.bundles).find(item => item?.name === subject.pkg.name && item?.installed === true && item.version === subject.pkg.version);
|
|
518
|
+
return record?.doctorArchive === true ? record : null;
|
|
519
|
+
};
|
|
313
520
|
const boundedText = (value, limit = 12000) => string(value).slice(-limit);
|
|
314
521
|
const boundedLogs = value => array(value).slice(-60).map(chunk => ({ name: boundedText(chunk?.name, 200), stream: boundedText(chunk?.stream, 16), text: boundedText(chunk?.text, 1000) }));
|
|
315
522
|
const request = async (action, params = {}, method = 'GET', signal, timeoutMs = 45000) => {
|
|
@@ -340,6 +547,30 @@ window.__ModuleLoader__.load({
|
|
|
340
547
|
const text = localText(t, prefix + '.' + (string(value) || 'unknown'), t('unknown'));
|
|
341
548
|
return h('span', { className: 'pud-status', 'data-state': value }, text);
|
|
342
549
|
}
|
|
550
|
+
function VersionState({ item, t }) {
|
|
551
|
+
const states = versionStates(item), origin = safeQueryOrigin(item?.registry);
|
|
552
|
+
const github = item?.sourceKind === 'git' && item?.mode === 'host-self-update';
|
|
553
|
+
return h('div', { className: 'pud-small pud-break', 'data-testid': 'pud-version-state' },
|
|
554
|
+
h('p', { style: { margin: '0 0 5px' }, 'data-version-status': states.version },
|
|
555
|
+
h('strong', null, t('versionCheck') + ': '), h('span', { className: states.version === 'error' ? 'pud-error' : states.version === 'unknown' ? 'pud-muted' : '' }, localText(t, 'version.' + states.version, t('unknown')))),
|
|
556
|
+
h('p', { style: { margin: 0 }, 'data-update-status': states.update },
|
|
557
|
+
h('strong', null, t('onlineUpdate') + ': '), h('span', { className: states.update === 'blocked' ? 'pud-impact' : '' }, localText(t, 'update.' + states.update, t('unknown')))),
|
|
558
|
+
states.version !== 'not-checked' ? h('p', { className: 'pud-muted pud-small pud-break', style: { margin: '5px 0 0' }, 'data-testid': 'pud-query-source' },
|
|
559
|
+
t('querySource') + ': ', github ? t('queryGithubSource') : origin || t('querySourceUnknown'), ' · ', t('querySourceScope')) : null,
|
|
560
|
+
item?.status === 'recovery-required' ? h(Badge, { value: 'recovery-required', t }) : null);
|
|
561
|
+
}
|
|
562
|
+
function InformationWarnings({ item, t }) {
|
|
563
|
+
const warnings = informationWarnings(item);
|
|
564
|
+
return warnings.length ? h('ul', { className: 'pud-list pud-muted pud-small', 'data-testid': 'pud-information-warnings' },
|
|
565
|
+
...warnings.map((warning, i) => h('li', { key: i }, localText(t, 'info.' + warning, warning)))) : null;
|
|
566
|
+
}
|
|
567
|
+
function VersionValue({ item, t }) {
|
|
568
|
+
const shown = versionDisplay(item);
|
|
569
|
+
return h('div', { className: 'pud-break', 'data-testid': 'pud-version-value' },
|
|
570
|
+
shown.value ? h('span', null, shown.value) : t(shown.label),
|
|
571
|
+
shown.value ? h('p', { className: 'pud-muted pud-small', style: { margin: '4px 0 0' } }, t(shown.label)) : null,
|
|
572
|
+
shown.note ? h('p', { className: 'pud-muted pud-small', style: { margin: '4px 0 0' } }, t(shown.note)) : null);
|
|
573
|
+
}
|
|
343
574
|
function SourceDetails({ value, t }) {
|
|
344
575
|
const raw = jsonOf(value), preview = raw.length > 24000 ? raw.slice(0, 24000) : raw;
|
|
345
576
|
const [copied, setCopied] = useState(false), [error, setError] = useState('');
|
|
@@ -350,6 +581,38 @@ window.__ModuleLoader__.load({
|
|
|
350
581
|
raw.length > preview.length ? h('p', { className: 'pud-muted pud-small' }, t('detailTruncated')) : null,
|
|
351
582
|
h('pre', { className: 'pud-json', tabIndex: 0 }, preview));
|
|
352
583
|
}
|
|
584
|
+
function DetailArchiveCheck({ subject, t, openPanel }) {
|
|
585
|
+
const [item, setItem] = useState(null), [pending, setPending] = useState(false), [notice, setNotice] = useState('');
|
|
586
|
+
const current = useRef(null), mounted = useRef(true);
|
|
587
|
+
useEffect(() => { mounted.current = true; setItem(null); setNotice(''); setPending(false); return () => { mounted.current = false; current.current?.abort(); }; }, [subject.pkg.name, subject.pkg.version]);
|
|
588
|
+
const check = async () => {
|
|
589
|
+
if (pending) return;
|
|
590
|
+
current.current?.abort();
|
|
591
|
+
const controller = new AbortController(); current.current = controller; setPending(true); setNotice(''); setItem(null);
|
|
592
|
+
const acceptsResult = () => mounted.current && current.current === controller && !controller.signal.aborted;
|
|
593
|
+
try {
|
|
594
|
+
const snapshot = await request('list', {}, 'GET', controller.signal, 45000);
|
|
595
|
+
controller.signal.throwIfAborted();
|
|
596
|
+
const record = verifiedDetailRecord(subject, snapshot);
|
|
597
|
+
if (!record) { if (acceptsResult()) setNotice('detailDoctorUnmanaged'); return; }
|
|
598
|
+
const answer = await request('scan', {}, 'GET', controller.signal, 180000);
|
|
599
|
+
const checked = array(answer?.items).find(row => row?.name === record.name && row.version === record.version);
|
|
600
|
+
if (!checked) throw new Error('No matching version result');
|
|
601
|
+
if (acceptsResult()) setItem(checked);
|
|
602
|
+
} catch (error) { if (acceptsResult()) setNotice('requestFailed'); }
|
|
603
|
+
finally { const active = acceptsResult(); if (current.current === controller) current.current = null; if (active) setPending(false); }
|
|
604
|
+
};
|
|
605
|
+
return h('section', { className: 'pud-card', 'data-testid': 'pud-official-archive-check' }, h('style', null, CSS),
|
|
606
|
+
h('h2', null, t('detailDoctorTitle')), h('p', { className: 'pud-muted pud-small' }, t('detailDoctorHelp')),
|
|
607
|
+
h('p', { className: 'pud-muted pud-small' }, t('detailDoctorReadOnly')),
|
|
608
|
+
h('div', { className: 'pud-inline' }, h('button', { type: 'button', className: 'pud-btn', disabled: pending, 'aria-busy': pending, onClick: () => { void check(); }, 'data-testid': 'pud-detail-doctor-check' }, t(pending ? 'scanning' : 'detailDoctorProbe')),
|
|
609
|
+
typeof openPanel === 'function' ? h('button', { type: 'button', className: 'pud-btn', onClick: openPanel, 'data-testid': 'pud-detail-doctor-open' }, t('detailDoctorOpen')) : null),
|
|
610
|
+
item ? h('div', { className: 'pud-note' }, h(VersionValue, { item, t }), h(VersionState, { item, t }),
|
|
611
|
+
array(item.reasons).length ? h('ul', { className: 'pud-list' }, ...item.reasons.map((reason, i) => h('li', { key: i }, localText(t, 'reason.' + string(reason), string(reason) || t('unknown'))))) : null,
|
|
612
|
+
h(InformationWarnings, { item, t })) : null,
|
|
613
|
+
notice ? h('p', { className: notice === 'requestFailed' ? 'pud-error' : 'pud-muted', role: 'status' }, t(notice)) : null,
|
|
614
|
+
h('p', { className: 'pud-muted pud-small' }, t('detailDoctorManual')));
|
|
615
|
+
}
|
|
353
616
|
function Finding({ finding, t }) {
|
|
354
617
|
if (!finding) return null;
|
|
355
618
|
const code = string(finding.code) || 'unknown';
|
|
@@ -378,7 +641,8 @@ window.__ModuleLoader__.load({
|
|
|
378
641
|
h('dt', null, t('packageVerification')), h('dd', null, h(Badge, { value: string(pack?.status) || 'unknown', prefix: 'package', t }), pack?.version ? h('span', null, ' · ', pack.version) : null),
|
|
379
642
|
h('dt', null, t('hostVerification')), h('dd', null, h(Badge, { value: string(host?.status) || 'unknown', prefix: 'host', t }),
|
|
380
643
|
typeof host?.activeRows === 'number' && typeof host?.totalRows === 'number' ? h('span', null, ' · ', host.activeRows + ' / ' + host.totalRows) : null),
|
|
381
|
-
verification?.source ? h(React.Fragment, null, h('dt', null, t('sourceVerification')), h('dd', null, h(Badge, { value: string(verification.source.status) || 'unknown', prefix: 'sourceCheck', t }))) : null
|
|
644
|
+
verification?.source ? h(React.Fragment, null, h('dt', null, t(verification.source.expectedKind==='derived-local-union-generation'?'unionSourceVerification':verification.source.expectedKind === 'registry' || verification.source.kind === 'registry' ? 'registrySourceVerification' : 'sourceVerification')), h('dd', null, h(Badge, { value: string(verification.source.status) || 'unknown', prefix: verification.source.expectedKind==='derived-local-union-generation'?'unionSource':verification.source.expectedKind === 'registry' || verification.source.kind === 'registry' ? 'registryCheck' : 'sourceCheck', t }))) : null,
|
|
645
|
+
verification?.runtime ? h(React.Fragment,null,h('dt',null,t('unionRuntimeVerification')),h('dd',null,h(Badge,{value:string(verification.runtime.status)||'unknown',prefix:'runtime',t}))) : null);
|
|
382
646
|
}
|
|
383
647
|
function ClientSync({ state, retryClient, t }) {
|
|
384
648
|
const failures = array(state?.failures), [retrying, setRetrying] = useState(false), [retryError, setRetryError] = useState('');
|
|
@@ -402,7 +666,7 @@ window.__ModuleLoader__.load({
|
|
|
402
666
|
return h('tr', { key: string(item.name) || i },
|
|
403
667
|
h('td', { className: 'pud-break pud-package-cell' }, valueOf(item.name, t('noValue'))),
|
|
404
668
|
h('td', null, valueOf(item.from, t('noValue'))), h('td', null, valueOf(item.to, t('noValue'))),
|
|
405
|
-
h('td', null, h(Badge, { value:
|
|
669
|
+
h('td', null, h(Badge, { value: resultStatus(item), t })),
|
|
406
670
|
h('td', null, h(Verification, { verification: item.verification, t }),
|
|
407
671
|
item.restore ? h('div', { className: 'pud-note pud-small' }, t('recoveryOutcome'), ' · ', h(Badge, { value: string(item.restore.application) || 'unknown', prefix: 'outcome', t }), h(Verification, { verification: item.restoreVerification, t })) : null),
|
|
408
672
|
h('td', null, canRecover && typeof onRestore === 'function' ? h('button', { type: 'button', className: 'pud-btn pud-btn-compact', disabled: busy, onClick: () => onRestore(item.name), 'data-testid': 'pud-item-restore' }, t('restore')) : null,
|
|
@@ -415,7 +679,7 @@ window.__ModuleLoader__.load({
|
|
|
415
679
|
function Record({ record, t, locale, onRestore, busy, recoveries }) {
|
|
416
680
|
const result = record?.result ?? record?.event ?? {}; const items = array(record?.items); const outcome = string(result.application) || string(record?.outcome) || 'unknown';
|
|
417
681
|
return h('details', { className: 'pud-record' }, h('summary', null,
|
|
418
|
-
h('span', { className: 'pud-record-heading pud-break' }, valueOf(record?.package ?? record?.target, items.length ? t(
|
|
682
|
+
h('span', { className: 'pud-record-heading pud-break' }, valueOf(record?.package ?? record?.target, items.length ? t(operationResultTitle(record?.operation)) + ' · ' + items.length : t('noValue'))),
|
|
419
683
|
h(Badge, { value: outcome, prefix: 'outcome', t }), h('span', { className: 'pud-muted pud-small' }, dateText(record?.finishedAt ?? record?.time ?? record?.startedAt, locale, t))),
|
|
420
684
|
h('p', { className: 'pud-muted pud-small' }, t(record?.origin === 'official-event' ? 'officialHistory' : 'ownHistory')),
|
|
421
685
|
items.length ? h(BatchTable, { items, t, onRestore, busy, recoveries }) : h('dl', { className: 'pud-definition pud-small' },
|
|
@@ -425,10 +689,13 @@ window.__ModuleLoader__.load({
|
|
|
425
689
|
h(Finding, { finding: record?.classification, t }), h(SourceDetails, { value: record, t }));
|
|
426
690
|
}
|
|
427
691
|
function ConfirmDialog({ plan, t, locale, onCancel, onConfirm }) {
|
|
428
|
-
const restoring = isRestore(plan.operation), selfUpdating = isSelf(plan.operation);
|
|
692
|
+
const restoring = isRestore(plan.operation), selfUpdating = isSelf(plan.operation), migrating = isMigration(plan.operation);
|
|
429
693
|
const githubUpdating = selfUpdating && array(plan.items).some(item => item.sourceKind === 'git');
|
|
694
|
+
const publicMirror = mirrorAcknowledgementRequired(plan);
|
|
695
|
+
const publicFallback = selfUpdating && array(plan.items).some(item => item.sourceMode === 'public-fallback');
|
|
696
|
+
const unionGeneration=array(plan.items).some(item=>item.installMode==='union-generation');
|
|
430
697
|
const ref = useRef(null), cancel = useRef(null); const [ack, setAck] = useState(false), [now, setNow] = useState(Date.now());
|
|
431
|
-
const [taskPolicy, setTaskPolicy] = useState('wait-for-idle'), [confirmCancel, setConfirmCancel] = useState(false);
|
|
698
|
+
const [taskPolicy, setTaskPolicy] = useState('wait-for-idle'), [confirmCancel, setConfirmCancel] = useState(false), [confirmPublicMirror, setConfirmPublicMirror] = useState(false), [confirmUnionGeneration,setConfirmUnionGeneration]=useState(false);
|
|
432
699
|
useEffect(() => {
|
|
433
700
|
const previous = document.activeElement, dialog = ref.current;
|
|
434
701
|
if (dialog && !dialog.open) dialog.showModal(); cancel.current?.focus();
|
|
@@ -440,7 +707,8 @@ window.__ModuleLoader__.load({
|
|
|
440
707
|
h('strong', { className: 'pud-break' }, item.name),
|
|
441
708
|
h('div', { className: 'pud-muted' }, valueOf(item.from, t('noValue')), ' → ', valueOf(item.to, t('noValue'))),
|
|
442
709
|
selfUpdating ? h(CommitDetails, { value: item, t }) : null,
|
|
443
|
-
|
|
710
|
+
highImpactWarning(item) ? h('p', { className: 'pud-impact pud-small' }, t('highImpact')) : null,
|
|
711
|
+
h(InformationWarnings, { item, t })));
|
|
444
712
|
const warningDetails = array(plan.warnings).length ? h('details', { className: 'pud-small' },
|
|
445
713
|
h('summary', null, t('detail')), h('ul', { className: 'pud-list' }, ...plan.warnings.map((text, i) => h('li', { key: i }, string(text))))) : null;
|
|
446
714
|
return h('dialog', {
|
|
@@ -454,13 +722,23 @@ window.__ModuleLoader__.load({
|
|
|
454
722
|
else if (!event.shiftKey && document.activeElement === last) { event.preventDefault(); first?.focus(); }
|
|
455
723
|
},
|
|
456
724
|
},
|
|
457
|
-
h('h2', { id: 'pud-confirm-title' }, selfUpdating ? t('confirmSelfTitle') : t(restoring ? 'confirmRestoreTitle' : 'confirmTitle')),
|
|
458
|
-
h('p', { id: 'pud-confirm-impact', className: 'pud-muted' }, selfUpdating ? t('confirmSelfImpact') : t(restoring ? 'confirmRestoreImpact' : 'confirmImpact')),
|
|
725
|
+
h('h2', { id: 'pud-confirm-title' }, selfUpdating ? t('confirmSelfTitle') : migrating ? t('confirmMigrationTitle') : t(restoring ? 'confirmRestoreTitle' : 'confirmTitle')),
|
|
726
|
+
h('p', { id: 'pud-confirm-impact', className: 'pud-muted' }, selfUpdating ? t('confirmSelfImpact') : migrating ? t('confirmMigrationImpact') : t(restoring ? 'confirmRestoreImpact' : 'confirmImpact')),
|
|
459
727
|
h('dl', { className: 'pud-definition' },
|
|
460
728
|
h('dt', null, t('profile')), h('dd', null, valueOf(plan.profile, t('noValue'))),
|
|
461
729
|
h('dt', null, t('taskPolicy')), h('dd', null, t(taskPolicy === 'cancel-active' ? 'stopPolicy' : 'waitPolicy')),
|
|
462
730
|
h('dt', null, t('expires')), h('dd', null, dateText(plan.expiresAt, locale, t))),
|
|
463
|
-
h('ul', { className: 'pud-dialog-list', 'aria-label': t(
|
|
731
|
+
h('ul', { className: 'pud-dialog-list', 'aria-label': t(operationResultTitle(plan.operation)) }, ...reviewItems),
|
|
732
|
+
migrating ? h('p', { className: 'pud-note pud-warning', 'data-testid': 'pud-migration-safety' }, t('migrationSafety')) : null,
|
|
733
|
+
publicMirror ? h('div', { className: 'pud-note pud-warning', 'data-testid': 'pud-public-mirror-safety' },
|
|
734
|
+
h('p', { className: 'pud-small' }, t(publicFallback ? 'publicFallbackSafety' : 'mirrorSafety')),
|
|
735
|
+
mirrorPlanEvidence(plan).complete ? h(React.Fragment, null,
|
|
736
|
+
h('strong', null, t('mirrorRegistryPlan')),
|
|
737
|
+
h('dl', { className: 'pud-definition pud-small' }, ...mirrorPlanEvidence(plan).rows.map((row, i) => h(React.Fragment, { key: i }, h('dt', null, t(row.label)), h('dd', null, row.origin || t('querySourceUnknown')))))) : h(React.Fragment, null,
|
|
738
|
+
h('p', { className: 'pud-muted pud-small', 'data-testid': 'pud-mirror-plan-unavailable' }, t('mirrorPlanUnavailable')),
|
|
739
|
+
h('p', { className: 'pud-muted pud-small' }, t(mirrorPlanEvidence(plan).fallbackLabel))),
|
|
740
|
+
h('ul', { className: 'pud-list pud-small' }, ...array(plan.items).filter(item => item?.publicMirror || item?.publicFallback || item?.sourceMode === 'public-mirror' || item?.sourceMode === 'public-fallback' || safeQueryOrigin(item?.registry) === 'https://registry.npmmirror.com').map((item, i) => h('li', { key: i }, string(item.name), ' · ', safeQueryOrigin(item.registry) || t('querySourceUnknown')))),
|
|
741
|
+
h('label', { className: 'pud-ack' }, h('input', { type: 'checkbox', className: 'pud-check', checked: confirmPublicMirror, onChange: event => setConfirmPublicMirror(event.target.checked), 'data-testid': 'pud-confirm-public-mirror' }), h('span', null, t(publicFallback ? 'acknowledgePublicFallback' : 'acknowledgeMirror')))) : null,
|
|
464
742
|
githubUpdating ? h('p', { className: 'pud-note pud-warning', 'data-testid': 'pud-github-safety' }, t('githubConfirmSafety')) : null,
|
|
465
743
|
h('fieldset', { className: 'pud-policy' }, h('legend', null, t('taskPolicy')),
|
|
466
744
|
h('label', { className: 'pud-policy-choice' }, h('input', { type: 'radio', name: 'pud-task-policy', value: 'wait-for-idle', checked: taskPolicy === 'wait-for-idle', onChange: () => { setTaskPolicy('wait-for-idle'); setConfirmCancel(false); } }),
|
|
@@ -470,14 +748,17 @@ window.__ModuleLoader__.load({
|
|
|
470
748
|
taskPolicy === 'cancel-active' ? h('label', { className: 'pud-note pud-ack pud-stop-confirm' },
|
|
471
749
|
h('input', { type: 'checkbox', className: 'pud-check', checked: confirmCancel, onChange: event => setConfirmCancel(event.target.checked), 'data-testid': 'pud-confirm-cancel' }),
|
|
472
750
|
h('span', null, t('stopConsent'))) : null,
|
|
473
|
-
h('p', { className: 'pud-note pud-warning' }, t(selfUpdating ? 'selfGateHelp' : 'confirmSafety')),
|
|
751
|
+
h('p', { className: 'pud-note pud-warning' }, t(selfUpdating ? 'selfGateHelp' : 'confirmSafety')),
|
|
752
|
+
!selfUpdating && array(plan.items).some(item=>item.installMode==='registry-spec') ? h('p',{className:'pud-note pud-warning','data-testid':'pud-registry-handoff-safety'},t('registryHandoffSafety')) : null,
|
|
753
|
+
unionGeneration ? h('div',{className:'pud-note pud-warning','data-testid':'pud-union-generation-safety'},h('p',null,t('unionGenerationSafety')),h('label',{className:'pud-ack'},h('input',{type:'checkbox',className:'pud-check',checked:confirmUnionGeneration,onChange:event=>setConfirmUnionGeneration(event.target.checked),'data-testid':'pud-confirm-union-generation'}),h('span',null,t('acknowledgeUnionGeneration')))) : null,
|
|
754
|
+
warningDetails,
|
|
474
755
|
h('label', { className: 'pud-ack' },
|
|
475
756
|
h('input', { type: 'checkbox', className: 'pud-check', checked: ack, onChange: event => setAck(event.target.checked) }),
|
|
476
|
-
h('span', null, githubUpdating ? t('acknowledgeGithubSelf') : selfUpdating ? t('acknowledgeSelf') : t(restoring ? 'acknowledgeRestore' : 'acknowledge'))),
|
|
757
|
+
h('span', null, githubUpdating ? t('acknowledgeGithubSelf') : selfUpdating ? t('acknowledgeSelf') : migrating ? t('acknowledgeMigration') : t(restoring ? 'acknowledgeRestore' : 'acknowledge'))),
|
|
477
758
|
expired ? h('p', { className: 'pud-error', role: 'alert' }, t('expired')) : null,
|
|
478
759
|
h('div', { className: 'pud-dialog-actions' },
|
|
479
760
|
h('button', { ref: cancel, type: 'button', className: 'pud-btn', onClick: onCancel }, t('cancel')),
|
|
480
|
-
h('button', { type: 'button', className: 'pud-btn pud-btn-primary', disabled: !ack || expired || !array(plan.items).length || (taskPolicy === 'cancel-active' && !confirmCancel), onClick: () => onConfirm({ taskPolicy, ...(taskPolicy === 'cancel-active' ? { confirmCancel: true } : {}) }) }, selfUpdating ? t(taskPolicy === 'cancel-active' ? 'selfStop' : 'selfWait') : t(restoring ? taskPolicy === 'cancel-active' ? 'confirmRestoreStop' : 'confirmRestoreWait' : taskPolicy === 'cancel-active' ? 'confirmStop' : 'confirmWait'))));
|
|
761
|
+
h('button', { type: 'button', className: 'pud-btn pud-btn-primary', disabled: !ack || expired || !array(plan.items).length || (taskPolicy === 'cancel-active' && !confirmCancel) || (publicMirror && !confirmPublicMirror) || (unionGeneration && !confirmUnionGeneration), onClick: () => onConfirm({ taskPolicy, ...(taskPolicy === 'cancel-active' ? { confirmCancel: true } : {}), ...(publicMirror && confirmPublicMirror ? { confirmPublicMirror: true } : {}), ...(unionGeneration && confirmUnionGeneration ? {confirmUnionGeneration:true} : {}) }) }, selfUpdating ? t(taskPolicy === 'cancel-active' ? 'selfStop' : 'selfWait') : migrating ? t(taskPolicy === 'cancel-active' ? 'confirmMigrationStop' : 'confirmMigrationWait') : t(restoring ? taskPolicy === 'cancel-active' ? 'confirmRestoreStop' : 'confirmRestoreWait' : taskPolicy === 'cancel-active' ? 'confirmStop' : 'confirmWait'))));
|
|
481
762
|
}
|
|
482
763
|
class PanelBoundary extends React.Component {
|
|
483
764
|
constructor(props) { super(props); this.state = { failed: false }; }
|
|
@@ -513,10 +794,10 @@ window.__ModuleLoader__.load({
|
|
|
513
794
|
const currentItems = new Map(initialItems.map(item => [item.name, item]));
|
|
514
795
|
const scannedItems = scanResult ? array(scanResult.items).map(item => {
|
|
515
796
|
const current = currentItems.get(item.name);
|
|
516
|
-
return { ...item, ...(current ? Object.fromEntries(['canRestore', 'restoreVersion', 'recoveryId'].map(key => [key, Object.hasOwn(item, key) ? item[key] : current[key]])) : {}) };
|
|
797
|
+
return { ...item, ...(current ? Object.fromEntries(['canRestore', 'restoreVersion', 'recoveryId', 'canMigrate', 'doctorArchive'].map(key => [key, Object.hasOwn(item, key) ? item[key] : current[key]])) : {}) };
|
|
517
798
|
}) : [];
|
|
518
799
|
const baseItems = scanResult ? [...scannedItems, ...initialItems.filter(item => recoveryEligible(item) && !scannedItems.some(scanned => scanned.name === item.name))
|
|
519
|
-
.map(item => ({ ...item,
|
|
800
|
+
.map(item => ({ ...initialVersionItem(item), status: 'recovery-required' }))] : initialItems.map(initialVersionItem);
|
|
520
801
|
const byName = new Map(baseItems.map(item => [item.name, item]));
|
|
521
802
|
const selected = baseItems.filter(item => checked.has(item.name) && eligible(item));
|
|
522
803
|
const available = baseItems.filter(eligible);
|
|
@@ -602,10 +883,21 @@ window.__ModuleLoader__.load({
|
|
|
602
883
|
else setError({ code: 'state-changed', diagnostic: array(answer.reasons).join('; ') });
|
|
603
884
|
} catch (issue) { if (mounted.current) setError(errorInfo(issue)); } finally { if (mounted.current) setPending(''); }
|
|
604
885
|
};
|
|
605
|
-
const
|
|
886
|
+
const prepareMigration = async name => {
|
|
887
|
+
const target = currentItems.get(name) ?? byName.get(name);
|
|
888
|
+
if (pending || busy || checked.size || !migrationEligible(target)) return;
|
|
889
|
+
setPending('prepare-migration'); setError(null); setPlan(null);
|
|
890
|
+
try {
|
|
891
|
+
const answer = await read('prepare-migration', { name }, 'POST', 180000);
|
|
892
|
+
if (!mounted.current) return;
|
|
893
|
+
if (typeof answer.ticket === 'string' && !answer.blocked && isMigration(answer.operation) && array(answer.items).length === 1 && answer.items[0].name === name && answer.items[0].from === answer.items[0].to && answer.items[0].installMode === 'registry-migration') setPlan(answer);
|
|
894
|
+
else setError({ code: 'state-changed', diagnostic: array(answer.reasons).join('; ') });
|
|
895
|
+
} catch (issue) { if (mounted.current) setError(errorInfo(issue)); } finally { if (mounted.current) setPending(''); }
|
|
896
|
+
};
|
|
897
|
+
const commit = async ({ taskPolicy = 'wait-for-idle', confirmCancel, confirmPublicMirror, confirmUnionGeneration } = {}) => {
|
|
606
898
|
if (!plan || pending) return; const ticket = plan.ticket; setPlan(null); setPending('commit'); setError(null); setOperation(null);
|
|
607
899
|
try {
|
|
608
|
-
const answer = await read('commit', { ticket, taskPolicy, ...(taskPolicy === 'cancel-active' && confirmCancel === true ? { confirmCancel: true } : {}) }, 'POST', 45000);
|
|
900
|
+
const answer = await read('commit', { ticket, taskPolicy, ...(taskPolicy === 'cancel-active' && confirmCancel === true ? { confirmCancel: true } : {}), ...(mirrorAcknowledgementRequired(plan) && confirmPublicMirror === true ? { confirmPublicMirror: true } : {}), ...(array(plan.items).some(item=>item.installMode==='union-generation')&&confirmUnionGeneration===true?{confirmUnionGeneration:true}:{}) }, 'POST', 45000);
|
|
609
901
|
if (!mounted.current) return;
|
|
610
902
|
if (typeof answer.operationId !== 'string') { setPollNotice('unknownOperation'); await load(); return; }
|
|
611
903
|
if (isSelf(answer.operation)) {
|
|
@@ -650,15 +942,19 @@ window.__ModuleLoader__.load({
|
|
|
650
942
|
return h('tr', { key: item.name, 'data-open': item.name === openName, 'data-package': item.name },
|
|
651
943
|
h('td', null, h('input', { type: 'checkbox', className: 'pud-check', checked: checked.has(item.name) && eligible(item), disabled: !eligible(item) || !!pending || busy,
|
|
652
944
|
'aria-label': t('select') + ' ' + item.name, onChange: event => toggle(item, event.target.checked) })),
|
|
653
|
-
h('td', { className: 'pud-package-cell pud-break' }, h('strong', null, item.name)
|
|
654
|
-
|
|
655
|
-
h('td', null,
|
|
656
|
-
|
|
945
|
+
h('td', { className: 'pud-package-cell pud-break' }, h('strong', null, item.name),
|
|
946
|
+
item.runtimePackaging==='union-dependency-generation' ? h('p',{className:'pud-muted pud-small'},t('unionGenerationSource')) : item.doctorArchive === true ? h('p', { className: 'pud-muted pud-small' }, t('archiveSourceIdentity')) : null),
|
|
947
|
+
h('td', null, valueOf(item.version, t('noValue'))), h('td', null, h(VersionValue, { item, t })),
|
|
948
|
+
h('td', null, h(VersionState, { item, t }),
|
|
949
|
+
item.mode === 'host-self-update' ? h('p', { className: versionStates(item).version === 'not-checked' ? 'pud-muted pud-small' : 'pud-impact pud-small' },
|
|
950
|
+
versionStates(item).version === 'not-checked' ? t('selfCheckHelp') : [t('selfMode'), ' · ', t('selfHelp')]) : null,
|
|
657
951
|
item.mode === 'host-self-update' && item.sourceKind === 'git' ? h('details', { className: 'pud-small' }, h('summary', null, t('githubHead')), h(CommitDetails, { value: item, t })) : null,
|
|
658
|
-
|
|
952
|
+
highImpactWarning(item) ? h('p', { className: 'pud-impact pud-small' }, t('highImpact')) : null,
|
|
953
|
+
h(InformationWarnings, { item, t }), reasons),
|
|
659
954
|
h('td', null, h('div', { className: 'pud-inline' }, h('button', { type: 'button', className: 'pud-btn pud-btn-compact', disabled: !!pending,
|
|
660
955
|
onClick: () => setOpenName(current => current === item.name ? '' : item.name), 'aria-expanded': openName === item.name }, t('diagnosis')),
|
|
661
|
-
recoveryEligible(item) ? h('button', { type: 'button', className: 'pud-btn pud-btn-compact', disabled: !!pending || busy, onClick: () => { void prepareRestore(item.name); }, 'data-testid': 'pud-restore' }, t('restore')) : null
|
|
956
|
+
recoveryEligible(item) ? h('button', { type: 'button', className: 'pud-btn pud-btn-compact', disabled: !!pending || busy, onClick: () => { void prepareRestore(item.name); }, 'data-testid': 'pud-restore' }, t('restore')) : null,
|
|
957
|
+
migrationEligible(item) ? h('button', { type: 'button', className: 'pud-btn pud-btn-compact', disabled: !!pending || busy || !!checked.size, onClick: () => { void prepareMigration(item.name); }, 'data-testid': 'pud-migrate' }, t('migrateSource')) : null)));
|
|
662
958
|
});
|
|
663
959
|
const pluginTable = !snapshot ? null : !baseItems.length ? h('p', { className: 'pud-muted' }, t('empty')) : h('div', { className: 'pud-table-wrap' },
|
|
664
960
|
h('table', { className: 'pud-table', 'data-testid': 'pud-plugin-table' },
|
|
@@ -698,16 +994,18 @@ window.__ModuleLoader__.load({
|
|
|
698
994
|
detailBundle ? h('dl', { className: 'pud-definition pud-small', style: { marginTop: 14 } },
|
|
699
995
|
h('dt', null, t('hostState')), h('dd', null, h(Badge, { value: string(detailBundle.state) || 'unknown', prefix: 'state', t })),
|
|
700
996
|
h('dt', null, t('rows')), h('dd', null, valueOf(detailBundle.activeRows, 0) + ' / ' + valueOf(detailBundle.totalRows, 0)),
|
|
701
|
-
h('dt', null, t('source')), h('dd', null, localText(t,
|
|
997
|
+
h('dt', null, t('source')), h('dd', null, localText(t, installedSourceLabel(detailBundle), t('noValue')))) : null,
|
|
702
998
|
h('div', { className: 'pud-toolbar', style: { marginTop: 14 } }, h('button', { type: 'button', className: 'pud-btn', disabled: !!pending || busy || !detailBundle?.installed,
|
|
703
|
-
onClick: () => { void runLocks(); } }, t('locks')), recoveryEligible(detailBundle) ? h('button', { type: 'button', className: 'pud-btn', disabled: !!pending || busy, onClick: () => { void prepareRestore(openName); }, 'data-testid': 'pud-detail-restore' }, t('restore')) : null
|
|
999
|
+
onClick: () => { void runLocks(); } }, t('locks')), recoveryEligible(detailBundle) ? h('button', { type: 'button', className: 'pud-btn', disabled: !!pending || busy, onClick: () => { void prepareRestore(openName); }, 'data-testid': 'pud-detail-restore' }, t('restore')) : null,
|
|
1000
|
+
migrationEligible(detailBundle) ? h('button', { type: 'button', className: 'pud-btn', disabled: !!pending || busy || !!checked.size, onClick: () => { void prepareMigration(openName); }, 'data-testid': 'pud-detail-migrate' }, t('migrateSource')) : null),
|
|
1001
|
+
migrationEligible(detailBundle) ? h('p', { className: 'pud-note pud-warning' }, t('migrationHelp')) : null,
|
|
704
1002
|
recoveryEligible(detailBundle) ? h('div', { className: 'pud-note pud-warning' }, h('strong', null, t('recoveryTarget') + ': ', detailBundle.restoreVersion), h('p', { className: 'pud-muted pud-small' }, t('recoveryHelp'))) : null,
|
|
705
1003
|
h(Finding, { finding: diagnosis?.classification, t }), lockView,
|
|
706
1004
|
h('details', { className: 'pud-small', style: { marginTop: 14 } }, h('summary', null, t('detail')), h(SourceDetails, { value: diagnosis, t }))) : null;
|
|
707
1005
|
const observedSteps = array(operation?.steps).length ? h('details', null, h('summary', null, t('steps')),
|
|
708
1006
|
h('ol', { className: 'pud-list' }, ...operation.steps.map((step, i) => h('li', { key: i },
|
|
709
1007
|
stepText(step, t), step.name ? h('span', { className: 'pud-break' }, ' · ', step.name) : null)))) : null;
|
|
710
|
-
const recovering = isRestore(operation?.record?.operation);
|
|
1008
|
+
const recovering = isRestore(operation?.record?.operation), migrating = isMigration(operation?.record?.operation);
|
|
711
1009
|
const installProgress = operation?.installProgress;
|
|
712
1010
|
const logChunks = boundedLogs(operation?.boundedlogs ?? operation?.boundedLogs ?? operation?.logs);
|
|
713
1011
|
const installView = installProgress ? h('p', { className: 'pud-inline' }, t('installProgress') + ': ',
|
|
@@ -716,7 +1014,7 @@ window.__ModuleLoader__.load({
|
|
|
716
1014
|
h('p', { className: 'pud-muted pud-small' }, t('logBound')), h('pre', { className: 'pud-json', tabIndex: 0 },
|
|
717
1015
|
logChunks.map(chunk => [chunk.name, chunk.stream, chunk.text].filter(Boolean).join(' · ')).join('\n'))) : null;
|
|
718
1016
|
const progress = !selfPending && normalBusy || pollNotice ? h('section', { className: 'pud-card', 'aria-live': 'polite' },
|
|
719
|
-
h('h2', null, t(pollNotice || ['unknown','interrupted'].includes(currentPhase) ? 'progressUnknown' : snapshot?.externalBusy && !operationId ? 'externalBusy' : staging ? 'staging' : currentPhase === 'waiting' ? 'waiting' : recovering ? 'restoring' : 'running')),
|
|
1017
|
+
h('h2', null, t(pollNotice || ['unknown','interrupted'].includes(currentPhase) ? 'progressUnknown' : snapshot?.externalBusy && !operationId ? 'externalBusy' : staging ? 'staging' : currentPhase === 'waiting' ? 'waiting' : migrating ? 'migratingSource' : recovering ? 'restoring' : 'running')),
|
|
720
1018
|
h('p', { className: 'pud-muted' }, t(pollNotice || ['unknown','interrupted'].includes(currentPhase) ? 'progressUnknownDetail' : staging ? 'stagingDetail' : currentPhase === 'waiting' ? 'waitingDetail' : 'runningDetail')),
|
|
721
1019
|
h('p', { className: 'pud-muted pud-small' }, t('continuing')),
|
|
722
1020
|
operation?.waiting ? h('p', { className: 'pud-muted pud-small' }, t('activeTasks') + ': ' + valueOf(operation.waiting.runningAgents, t('unknown'))) : null,
|
|
@@ -728,7 +1026,7 @@ window.__ModuleLoader__.load({
|
|
|
728
1026
|
h('div', { style: { marginTop: 8 } }, h('button', { type: 'button', className: 'pud-btn', disabled: !!pending,
|
|
729
1027
|
onClick: () => { setPollNotice(''); setPollEpoch(value => value + 1); void refresh(); } }, t('checkProgress')))) : null) : null;
|
|
730
1028
|
const results = operation?.record ? h('section', { className: 'pud-card' },
|
|
731
|
-
h('h2', null, t(isRestore(operation.record.operation) ? 'restoreResults' : terminalPhase(operation.phase) ? 'finished' : 'batchResults')),
|
|
1029
|
+
h('h2', null, t(isMigration(operation.record.operation) ? 'migrationResults' : isRestore(operation.record.operation) ? 'restoreResults' : terminalPhase(operation.phase) ? 'finished' : 'batchResults')),
|
|
732
1030
|
terminalPhase(operation.phase) ? h('p', { className: 'pud-muted' }, t(operation.phase === 'finished' ? 'finishedDetail' : 'unknownOperation')) : null,
|
|
733
1031
|
operationItems.length ? h(BatchTable, { items: operationItems, t, onRestore: prepareRestore, busy: busy || !!pending, recoveries: currentItems }) : h('p', { className: 'pud-muted' }, t('noResults')),
|
|
734
1032
|
h('details', { className: 'pud-small', style: { marginTop: 12 } }, h('summary', null, t('detail')), h(SourceDetails, { value: operation, t }))) : null;
|
|
@@ -746,7 +1044,7 @@ window.__ModuleLoader__.load({
|
|
|
746
1044
|
selfState.phase === 'waiting' ? h('button', { type: 'button', className: 'pud-btn', disabled: !!pending, onClick: () => { void cancelSelfWait(); } }, t('cancelWait')) : null,
|
|
747
1045
|
h('details', null, h('summary', null, t('detail')), h(SourceDetails, { value: selfState, t }))) : null;
|
|
748
1046
|
const header = h('header', { className: 'pud-header' },
|
|
749
|
-
h('div', null, h('h1', null, t('title'), h('span', {className:'pud-muted',style:{fontSize:12,marginInlineStart:10,fontWeight:400}}, 'v0.5.
|
|
1047
|
+
h('div', null, h('h1', null, t('title'), h('span', {className:'pud-muted',style:{fontSize:12,marginInlineStart:10,fontWeight:400}}, 'v0.5.4')), h('p', { className: 'pud-subtitle pud-muted' }, t('intro')),
|
|
750
1048
|
h('div', { className: 'pud-meta pud-muted' }, h('span', null, t('profile') + ': ', valueOf(snapshot?.profile, t('noValue'))), h('span', null, t('runtime') + ': ', valueOf(snapshot?.runtimeVersion, t('noValue'))))),
|
|
751
1049
|
h('div', { className: 'pud-toolbar' },
|
|
752
1050
|
h('button', { type: 'button', className: 'pud-btn', disabled: !!pending, onClick: () => { void refresh(); }, 'data-testid': 'pud-refresh' }, t('refresh')),
|
|
@@ -763,7 +1061,7 @@ window.__ModuleLoader__.load({
|
|
|
763
1061
|
h('div', { className: 'pud-wrap' }, header, h('div', { className: 'pud-note pud-muted', role: 'note' }, t('safety')), failure,
|
|
764
1062
|
snapshot?.persistenceWarning ? h('div', { className: 'pud-note pud-warning', role: 'status' }, t('persistence') + ': ', string(snapshot.persistenceWarning)) : null,
|
|
765
1063
|
snapshot?.truncationWarning ? h('div', { className: 'pud-note pud-muted', role: 'status' }, t('historyTruncated')) : null,
|
|
766
|
-
pending ? h('div', { className: 'pud-inline pud-muted', role: 'status', 'aria-live': 'polite' }, h('span', { className: 'pud-spinner', 'aria-hidden': true }), t(pending === 'scan' ? 'scanning' : pending === 'prepare-restore' ? 'reviewingRestore' : 'loading')) : null,
|
|
1064
|
+
pending ? h('div', { className: 'pud-inline pud-muted', role: 'status', 'aria-live': 'polite' }, h('span', { className: 'pud-spinner', 'aria-hidden': true }), t(pending === 'scan' ? 'scanning' : pending === 'prepare-migration' ? 'reviewingMigration' : pending === 'prepare-restore' ? 'reviewingRestore' : 'loading')) : null,
|
|
767
1065
|
h(ClientSync, { state: clientSync, retryClient, t }), selfView, progress, results, mainList, detailView, history, limits),
|
|
768
1066
|
plan ? h(ConfirmDialog, { plan, t, locale, onCancel: () => setPlan(null), onConfirm: policy => { void commit(policy); } }) : null);
|
|
769
1067
|
}
|
|
@@ -776,6 +1074,13 @@ window.__ModuleLoader__.load({
|
|
|
776
1074
|
scope.slots.inject('sidebar.panellist', function* () {
|
|
777
1075
|
yield scope.slots.register({ name: 'sidebar.panellist', id: PANEL_ID, order: 35, label: () => t('panel'), locale: NS }, ({ size }) => h(DoctorIcon, { size }));
|
|
778
1076
|
});
|
|
1077
|
+
scope.slots.inject('plugins.detail.section', function* () {
|
|
1078
|
+
yield scope.slots.register({ name: 'plugins.detail.section', id: 'plugin-update-doctor-archive-versions', order: 35, locale: NS,
|
|
1079
|
+
inject: () => {
|
|
1080
|
+
const layout = scope.get('layout');
|
|
1081
|
+
return { openPanel: typeof layout?.selectPanel === 'function' ? () => layout.selectPanel(PANEL_ID) : undefined };
|
|
1082
|
+
} }, props => detailSubjectCandidate(props.subject) ? h(DetailArchiveCheck, { subject: props.subject, t: props.t, openPanel: props.openPanel }) : null);
|
|
1083
|
+
});
|
|
779
1084
|
scope.slots.inject('main', function* () {
|
|
780
1085
|
yield scope.slots.register({ name: 'main', key: PANEL_ID, locale: NS, inject: () => ({
|
|
781
1086
|
hooks: { locale: scope.locale, clientSync: scope.modules.entries.state },
|