@lmzhen/dsh-evolution-commands 0.43.2-rc.1 → 0.45.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/index.js +168 -21
- package/lib/types/diagnostics-route.d.ts +16 -1
- package/lib/types/doctor-view.d.ts +24 -0
- package/lib/types/generated/host-commands.d.ts +4 -4
- package/locale/de.json +6 -0
- package/locale/en.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +9 -7
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
import { DEFAULT_SKILL_LIMITS, DIAGNOSTICS_FACT_KEYS, DIAGNOSTICS_RUNTIME_KEYS, DIAGNOSTICS_VIEW_SCHEMA_VERSION, EVOLUTION_PRESET_IDS, HOST_LOCALES, MAINTAINER_PRESET_ID, MAX_TIMER_DELAY_MS, PARAM_EXPOSURE, PARAM_GROUP_LABELS, PARAM_NAMESPACES, PLATFORM_LINE, REVIEWER_PRESET_ID, absentHostServices, appendEvolutionEvent, applyNamespaceMigration, asRecord, atomicWriteFiles, authorityFrom, buildExtractPlanFromLibrary, buildLearnPrompt, clampedNumber, classifyNamespaceMigration, classifySessionEvent, createSubagentChannel, errorText, errorTextIn, eventsFile, evolutionHome, evolutionRoot, hostSurface, isDeprecatedParamId, isPresent, isRecord, isUnknown, liveBool, mutationLockFrom, newRunRegistry, ownerDecisionText, paramSettingsId, planNamespaceMigration, policyStageLimits, probeMtime, probeText, proposalFromPlan, readProposalReport,
|
|
2
|
+
import { DEFAULT_SKILL_LIMITS, DIAGNOSTICS_FACT_KEYS, DIAGNOSTICS_RUNTIME_KEYS, DIAGNOSTICS_VIEW_SCHEMA_VERSION, EVOLUTION_PRESET_IDS, HOST_LOCALES, MAINTAINER_PRESET_ID, MAX_TIMER_DELAY_MS, PARAM_EXPOSURE, PARAM_GROUP_LABELS, PARAM_NAMESPACES, PLATFORM_LINE, REVIEWER_PRESET_ID, absentHostServices, appendEvolutionEvent, applyNamespaceMigration, asRecord, atomicWriteFiles, authorityFrom, buildExtractPlanFromLibrary, buildLearnPrompt, clampedNumber, classifyNamespaceMigration, classifySessionEvent, createSubagentChannel, errorText, errorTextIn, eventsFile, evolutionHome, evolutionRoot, hostSurface, isDeprecatedParamId, isPresent, isRecord, isUnknown, liveBool, mutationLockFrom, newRunRegistry, ownerDecisionText, paramSettingsId, planNamespaceMigration, policyStageLimits, probeMtime, probeText, proposalFromPlan, readProposalReport, reportsSweepLockTarget, resolveParamId, scopedPackageName, scopedProbeReport, sweepReports, transactIo, unwrapLive, writeProposalReport } from "@lmzhen/dsh-evolution-core";
|
|
3
3
|
import { HOST_ROUTES, json, methodNotAllowed, registerHostRoutes } from "@lmzhen/dsh-evolution-core/http-routes";
|
|
4
4
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
@@ -10,7 +10,7 @@ import { createUserMessage } from "@lmzhen/dsh-evolution-core/platform";
|
|
|
10
10
|
import { assertSkillsRootAliasRetired, elapsedSince, newSkillLibrary, partitionVersions, resolveRootConfig } from "@lmzhen/dsh-evolution-core/skills";
|
|
11
11
|
import { buildEnrichment, buildMaintainFacts, enrichmentSnapshotOptions, runMaintain, snapshotFromLibrary } from "@lmzhen/dsh-evolution-maintenance";
|
|
12
12
|
import { composePresetEntry, presetRowBlock, presetRowBody, presetRowId, resolveBasePresetPatch } from "@lmzhen/dsh-evolution-core/composition";
|
|
13
|
-
import { processScopeViolations } from "@lmzhen/dsh-evolution-state
|
|
13
|
+
import { processScopeViolations } from "@lmzhen/dsh-evolution-state";
|
|
14
14
|
//#region lib/types/command-fallback.js
|
|
15
15
|
/**
|
|
16
16
|
* G6/W8: the command-face fallback for every Host data-plane surface.
|
|
@@ -173,6 +173,62 @@ function hostRow(host, count) {
|
|
|
173
173
|
detail: mounted + ";" + remote
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Compare two platform versions, prerelease suffixes included (`0.2.2-rc.0 < 0.2.2-rc.1 <
|
|
178
|
+
* 0.2.2`). Returns null when either side cannot be read as a version: an unreadable version is
|
|
179
|
+
* UNKNOWN, never "compatible".
|
|
180
|
+
*/
|
|
181
|
+
function compareVersionText(left, right) {
|
|
182
|
+
const parse = (text) => {
|
|
183
|
+
const match = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/.exec(text.trim());
|
|
184
|
+
if (match === null) return null;
|
|
185
|
+
return {
|
|
186
|
+
core: [
|
|
187
|
+
Number(match[1]),
|
|
188
|
+
Number(match[2]),
|
|
189
|
+
Number(match[3])
|
|
190
|
+
],
|
|
191
|
+
pre: match[4] === void 0 ? [] : match[4].split(".")
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
const a = parse(left);
|
|
195
|
+
const b = parse(right);
|
|
196
|
+
if (a === null || b === null) return null;
|
|
197
|
+
for (let index = 0; index < 3; index += 1) {
|
|
198
|
+
const leftCore = a.core[index] ?? 0;
|
|
199
|
+
const rightCore = b.core[index] ?? 0;
|
|
200
|
+
if (leftCore !== rightCore) return leftCore - rightCore;
|
|
201
|
+
}
|
|
202
|
+
if (a.pre.length === 0 && b.pre.length === 0) return 0;
|
|
203
|
+
if (a.pre.length === 0) return 1;
|
|
204
|
+
if (b.pre.length === 0) return -1;
|
|
205
|
+
for (let index = 0; index < Math.max(a.pre.length, b.pre.length); index += 1) {
|
|
206
|
+
const leftPart = a.pre[index];
|
|
207
|
+
const rightPart = b.pre[index];
|
|
208
|
+
if (leftPart === void 0) return -1;
|
|
209
|
+
if (rightPart === void 0) return 1;
|
|
210
|
+
if (leftPart === rightPart) continue;
|
|
211
|
+
const leftNumber = Number(leftPart);
|
|
212
|
+
const rightNumber = Number(rightPart);
|
|
213
|
+
return Number.isFinite(leftNumber) && Number.isFinite(rightNumber) ? leftNumber - rightNumber : leftPart < rightPart ? -1 : 1;
|
|
214
|
+
}
|
|
215
|
+
return 0;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* The version verdict against the frozen platform line: below the floor is out-of-window (the host
|
|
219
|
+
* is too old, the plugin cannot be made to work), above the declared line is host-newer, and the
|
|
220
|
+
* window between them is in-window. The old code compared equality only, so every older host read
|
|
221
|
+
* as "the host is newer" and `out-of-window` was unreachable.
|
|
222
|
+
*/
|
|
223
|
+
function pairingOf(version, line) {
|
|
224
|
+
if (version === void 0) return "unknown";
|
|
225
|
+
const againstFloor = compareVersionText(version, line.floor);
|
|
226
|
+
const againstVersion = compareVersionText(version, line.version);
|
|
227
|
+
if (againstFloor === null || againstVersion === null) return "unknown";
|
|
228
|
+
if (againstFloor < 0) return "out-of-window";
|
|
229
|
+
if (againstVersion > 0) return "host-newer";
|
|
230
|
+
return "in-window";
|
|
231
|
+
}
|
|
176
232
|
function pairingRow(inputs) {
|
|
177
233
|
switch (inputs.platformPairing ?? "unknown") {
|
|
178
234
|
case "in-window": return {
|
|
@@ -329,8 +385,38 @@ function hostRuntimeVersion() {
|
|
|
329
385
|
if (typeof parsed.version === "string" && parsed.version !== "") return parsed.version;
|
|
330
386
|
} catch {}
|
|
331
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* The family's bundle names, read from the profile's own two manifests.
|
|
390
|
+
*
|
|
391
|
+
* `pluginManager.listBundles()` resolves plugin metadata for EVERY bundle on every call (~10 module
|
|
392
|
+
* resolutions each; 108 packages on an ordinary profile) and nothing caches it — measured 19 s per
|
|
393
|
+
* diagnostics read, and the same uncached call is what makes the plugin inventory take a minute. The
|
|
394
|
+
* doctor needs only the family's names, and `readBundles()` starts from exactly these two files, so
|
|
395
|
+
* read them directly. `undefined` means "cannot answer here", never "no bundles installed".
|
|
396
|
+
* @param ctx - the host context.
|
|
397
|
+
* @returns the family bundle names, or undefined when the profile context is unavailable.
|
|
398
|
+
*/
|
|
399
|
+
function familyBundlesFromProfile(ctx) {
|
|
400
|
+
const profile = ctx.profileContext;
|
|
401
|
+
if (typeof profile?.dir !== "string" || typeof profile?.installAnchor !== "string") return void 0;
|
|
402
|
+
try {
|
|
403
|
+
const manifest = JSON.parse(readFileSync(join(profile.dir, "package.json"), "utf8"));
|
|
404
|
+
const selected = (manifest.dsh?.profile?.bundles ?? []).filter((name) => typeof name === "string");
|
|
405
|
+
const installation = JSON.parse(readFileSync(profile.installAnchor, "utf8"));
|
|
406
|
+
const names = [
|
|
407
|
+
...selected,
|
|
408
|
+
...Object.keys(manifest.dependencies ?? {}),
|
|
409
|
+
...Object.keys(installation.dependencies ?? {})
|
|
410
|
+
];
|
|
411
|
+
return [...new Set(names)].filter((name) => name.includes("dsh-evolution-"));
|
|
412
|
+
} catch {
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
332
416
|
/** The family bundles the platform reports (soft probe: a host without the manager answers []). */
|
|
333
417
|
async function installedFamilyBundles(ctx) {
|
|
418
|
+
const fromProfile = familyBundlesFromProfile(ctx);
|
|
419
|
+
if (fromProfile !== void 0) return fromProfile;
|
|
334
420
|
const listed = await ctx.get("pluginManager")?.listBundles?.();
|
|
335
421
|
if (!Array.isArray(listed)) return [];
|
|
336
422
|
const names = [];
|
|
@@ -350,6 +436,22 @@ async function installedFamilyBundles(ctx) {
|
|
|
350
436
|
* @param ctx - the host context.
|
|
351
437
|
* @param extras - call-site facts the context cannot answer (runs, host version, install form).
|
|
352
438
|
*/
|
|
439
|
+
/**
|
|
440
|
+
* Services that exist but answer `degraded`: they are reported in the SAME platform-services row as
|
|
441
|
+
* a missing one, with the reason attached. A registered service whose reads are silently empty (the
|
|
442
|
+
* old projection-port fallback) looked healthy on this row while every projection unit was blank.
|
|
443
|
+
* @param get - the host's service lookup.
|
|
444
|
+
* @returns one `name (reason)` note per degraded family service.
|
|
445
|
+
*/
|
|
446
|
+
function degradedServiceNotes(get) {
|
|
447
|
+
const notes = [];
|
|
448
|
+
const projections = get("evolutionProjections");
|
|
449
|
+
if (projections !== void 0 && typeof projections.status === "function" && projections.status() === "degraded") {
|
|
450
|
+
const reason = typeof projections.reason === "function" ? projections.reason() : void 0;
|
|
451
|
+
notes.push("evolutionProjections" + (reason === void 0 ? "" : " (" + reason + ")"));
|
|
452
|
+
}
|
|
453
|
+
return notes;
|
|
454
|
+
}
|
|
353
455
|
async function assembleDoctorInputs(ctx, extras = {}) {
|
|
354
456
|
const get = (name) => ctx.get(name);
|
|
355
457
|
const channel = createSubagentChannel(ctx);
|
|
@@ -413,7 +515,7 @@ async function assembleDoctorInputs(ctx, extras = {}) {
|
|
|
413
515
|
confidence: "inferred"
|
|
414
516
|
};
|
|
415
517
|
const platformVersion = hostRuntimeVersion();
|
|
416
|
-
const missingServices = SERVICES_PROBED.filter((name) => get(name) === void 0);
|
|
518
|
+
const missingServices = [...SERVICES_PROBED.filter((name) => get(name) === void 0), ...degradedServiceNotes((name) => get(name))];
|
|
417
519
|
const host = hostSurface(ctx);
|
|
418
520
|
const hostMounted = host.available;
|
|
419
521
|
return {
|
|
@@ -448,7 +550,7 @@ async function assembleDoctorInputs(ctx, extras = {}) {
|
|
|
448
550
|
},
|
|
449
551
|
missingServices,
|
|
450
552
|
sessionFoldClassifierPresent: typeof classifySessionEvent === "function",
|
|
451
|
-
platformPairing: extras.platformPairing ?? (
|
|
553
|
+
platformPairing: extras.platformPairing ?? pairingOf(extras.hostVersion ?? platformVersion, PLATFORM_LINE)
|
|
452
554
|
};
|
|
453
555
|
}
|
|
454
556
|
//#endregion
|
|
@@ -459,34 +561,80 @@ async function assembleDoctorInputs(ctx, extras = {}) {
|
|
|
459
561
|
* Registration belongs to W6 (`registerHostRoutes` is called by the commands plugin's apply), so
|
|
460
562
|
* this module only supplies the handler. A failed input assembly is NOT a transport error: the
|
|
461
563
|
* handler answers an all-unknown view naming the failure, because doctor must never throw (W8 §6).
|
|
564
|
+
*
|
|
565
|
+
* W9-g5: the assembly is expensive (soft probes plus platform queries; measured 19-37 s on a real
|
|
566
|
+
* profile) and several tabs may poll it. The handler therefore owns a read cache: ONE in-flight
|
|
567
|
+
* assembly shared by every concurrent caller, a short TTL for reuse, and a budget after which the
|
|
568
|
+
* request answers "not decided" instead of waiting forever. Without a cancel signal from the
|
|
569
|
+
* platform a timed-out assembly still finishes; it then populates the cache for the next read.
|
|
462
570
|
* @module @lmzhen/dsh-evolution-commands/diagnostics-route
|
|
463
571
|
*/
|
|
572
|
+
const DEFAULT_TTL_MS = 5e3;
|
|
573
|
+
const DEFAULT_TIMEOUT_MS = 6e4;
|
|
464
574
|
/**
|
|
465
575
|
* Build the diagnostics route over one input producer.
|
|
466
576
|
* @param getInputs - assembles the live view inputs (soft probes; may reject).
|
|
577
|
+
* @param options - TTL, budget and clock (defaults: 5 s each, wall clock).
|
|
467
578
|
* @returns the exact Fetch route for `HOST_ROUTES.diagnostics.view`.
|
|
468
579
|
*/
|
|
469
|
-
function makeDiagnosticsRoutes(getInputs) {
|
|
580
|
+
function makeDiagnosticsRoutes(getInputs, options = {}) {
|
|
581
|
+
const ttlMs = options.ttlMs ?? DEFAULT_TTL_MS;
|
|
582
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
583
|
+
const now = options.now ?? (() => Date.now());
|
|
584
|
+
let cached = null;
|
|
585
|
+
let inflight = null;
|
|
586
|
+
const assemble = () => {
|
|
587
|
+
if (cached !== null && now() - cached.at < ttlMs) return Promise.resolve(cached.view);
|
|
588
|
+
if (inflight !== null) return inflight;
|
|
589
|
+
inflight = (async () => {
|
|
590
|
+
try {
|
|
591
|
+
const view = buildDoctorView(await getInputs());
|
|
592
|
+
cached = {
|
|
593
|
+
at: now(),
|
|
594
|
+
view
|
|
595
|
+
};
|
|
596
|
+
return view;
|
|
597
|
+
} catch (error) {
|
|
598
|
+
return unavailableDoctorView(/* @__PURE__ */ new Date(), error instanceof Error ? error.message : String(error));
|
|
599
|
+
} finally {
|
|
600
|
+
inflight = null;
|
|
601
|
+
}
|
|
602
|
+
})();
|
|
603
|
+
return inflight;
|
|
604
|
+
};
|
|
470
605
|
return [{
|
|
471
606
|
path: HOST_ROUTES.diagnostics.view,
|
|
472
607
|
methods: ["GET"],
|
|
473
608
|
requestBody: "buffered",
|
|
474
609
|
fetch: async (request) => {
|
|
475
610
|
if (request.method !== "GET") return methodNotAllowed(["GET"]);
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
});
|
|
481
|
-
} catch (error) {
|
|
482
|
-
return json(200, {
|
|
483
|
-
ok: true,
|
|
484
|
-
data: unavailableDoctorView(/* @__PURE__ */ new Date(), error instanceof Error ? error.message : String(error))
|
|
485
|
-
});
|
|
486
|
-
}
|
|
611
|
+
return json(200, {
|
|
612
|
+
ok: true,
|
|
613
|
+
data: await withBudget(assemble(), timeoutMs, () => unavailableDoctorView(/* @__PURE__ */ new Date(), "the diagnostics assembly exceeded its " + String(timeoutMs) + " ms budget; retry in a moment"))
|
|
614
|
+
});
|
|
487
615
|
}
|
|
488
616
|
}];
|
|
489
617
|
}
|
|
618
|
+
/**
|
|
619
|
+
* Race one promise against a budget without rejecting: an expired assembly answers the fallback.
|
|
620
|
+
* The timer is always cleared, so a fast result leaves no pending timeout behind.
|
|
621
|
+
* @param pending - the assembly in progress.
|
|
622
|
+
* @param timeoutMs - how long the caller may wait.
|
|
623
|
+
* @param fallback - the view to answer when the budget expires.
|
|
624
|
+
* @returns the assembly result or the fallback.
|
|
625
|
+
*/
|
|
626
|
+
async function withBudget(pending, timeoutMs, fallback) {
|
|
627
|
+
let timer;
|
|
628
|
+
try {
|
|
629
|
+
return await Promise.race([pending, new Promise((resolve) => {
|
|
630
|
+
timer = setTimeout(() => {
|
|
631
|
+
resolve(fallback());
|
|
632
|
+
}, timeoutMs);
|
|
633
|
+
})]);
|
|
634
|
+
} finally {
|
|
635
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
490
638
|
//#endregion
|
|
491
639
|
//#region lib/types/settings-route.js
|
|
492
640
|
/**
|
|
@@ -868,8 +1016,8 @@ const HOST_COMMANDS = {
|
|
|
868
1016
|
"pt": "Parar a varredura de manutenção em andamento (omita o id só se a última execução for a que roda neste processo)"
|
|
869
1017
|
},
|
|
870
1018
|
"summary.migrate": {
|
|
871
|
-
"zh": "
|
|
872
|
-
"en": "Move the family's old namespaces from the legacy settings document into the current
|
|
1019
|
+
"zh": "把旧设置文档里家族的旧分区迁进现在的设置(幂等;已迁移过就报「已一致」)",
|
|
1020
|
+
"en": "Move the family's old namespaces from the legacy settings document into the current settings (idempotent; reports 'already aligned' when migrated)",
|
|
873
1021
|
"ja": "旧設定ドキュメントにあるファミリーの旧名前空間を現在の行へ移す(冪等。移行済みなら「整合済み」と報告)",
|
|
874
1022
|
"es": "Mover los espacios de nombres antiguos de la familia del documento de ajustes heredado a las filas actuales (idempotente; si ya se migró, informa de que «ya está alineado»)",
|
|
875
1023
|
"fr": "Déplacer les anciens espaces de noms de la famille du document de paramètres hérité vers les lignes actuelles (idempotent ; signale « déjà aligné » si la migration a déjà eu lieu)",
|
|
@@ -1128,8 +1276,8 @@ const HOST_COMMANDS = {
|
|
|
1128
1276
|
"pt": "\n(as escritas pendentes expiram após {ttl} ms: ao expirar são encerradas como REJECTED e nunca são executadas; prepare novamente se ainda precisar)"
|
|
1129
1277
|
},
|
|
1130
1278
|
"command.pending.neverExpires": {
|
|
1131
|
-
"zh": "
|
|
1132
|
-
"en": "
|
|
1279
|
+
"zh": "(暂存写入不会过期 —— 窗口一直等决定;可在「设置 → 能力进化」的审批卡里设置 pendingTtlMs 来限定)",
|
|
1280
|
+
"en": "(staged writes never expire — the window waits for a decision; set pendingTtlMs on the approval card under Settings → Capability evolution to bound it)",
|
|
1133
1281
|
"ja": "\n(ステージ済みの書き込みは期限切れになりません。判断があるまで待機します。evolution-approval 行の pendingTtlMs で上限を設定できます)",
|
|
1134
1282
|
"es": "\n(las escrituras en espera no caducan: la ventana espera una decisión; define pendingTtlMs en la fila evolution-approval para limitarla)",
|
|
1135
1283
|
"fr": "\n(les écritures en attente n’expirent jamais : la fenêtre attend une décision ; définissez pendingTtlMs sur la ligne evolution-approval pour la borner)",
|
|
@@ -3304,7 +3452,6 @@ async function readRunReport(io, record) {
|
|
|
3304
3452
|
}
|
|
3305
3453
|
}
|
|
3306
3454
|
function apply(ctx, rawConfig = {}) {
|
|
3307
|
-
registerOwnerSettings(ctx, "evolution-commands", Config);
|
|
3308
3455
|
const config = rawConfig;
|
|
3309
3456
|
assertSkillsRootAliasRetired(rawConfig);
|
|
3310
3457
|
const skillsRootValue = resolveRootConfig(rawConfig).root;
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import type { ConnectionFetchRouteLike } from '@lmzhen/dsh-evolution-core/http-routes';
|
|
2
2
|
import { type DoctorInputs } from './doctor-view.ts';
|
|
3
|
+
/** Read-lifecycle knobs; every one has a production default and none reads the environment. */
|
|
4
|
+
export interface DiagnosticsRouteOptions {
|
|
5
|
+
/** Reuse one successful view for this long (default 5 s). */
|
|
6
|
+
readonly ttlMs?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Answer "not decided" when one assembly runs longer than this (default 60 s). The bound exists to
|
|
9
|
+
* stop an unbounded wait, not to promise latency: the measured assembly takes 19-37 s on a real
|
|
10
|
+
* profile, so a 5 s budget would answer unknown forever. It can drop to 5 s once the second form
|
|
11
|
+
* derivation is removed (audit F9, tracked under G3).
|
|
12
|
+
*/
|
|
13
|
+
readonly timeoutMs?: number;
|
|
14
|
+
/** Clock seam for tests. */
|
|
15
|
+
readonly now?: () => number;
|
|
16
|
+
}
|
|
3
17
|
/**
|
|
4
18
|
* Build the diagnostics route over one input producer.
|
|
5
19
|
* @param getInputs - assembles the live view inputs (soft probes; may reject).
|
|
20
|
+
* @param options - TTL, budget and clock (defaults: 5 s each, wall clock).
|
|
6
21
|
* @returns the exact Fetch route for `HOST_ROUTES.diagnostics.view`.
|
|
7
22
|
*/
|
|
8
|
-
export declare function makeDiagnosticsRoutes(getInputs: () => Promise<DoctorInputs
|
|
23
|
+
export declare function makeDiagnosticsRoutes(getInputs: () => Promise<DoctorInputs>, options?: DiagnosticsRouteOptions): ConnectionFetchRouteLike[];
|
|
9
24
|
//# sourceMappingURL=diagnostics-route.d.ts.map
|
|
@@ -67,6 +67,22 @@ export interface DoctorInputs {
|
|
|
67
67
|
readonly total: number;
|
|
68
68
|
} | undefined;
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Compare two platform versions, prerelease suffixes included (`0.2.2-rc.0 < 0.2.2-rc.1 <
|
|
72
|
+
* 0.2.2`). Returns null when either side cannot be read as a version: an unreadable version is
|
|
73
|
+
* UNKNOWN, never "compatible".
|
|
74
|
+
*/
|
|
75
|
+
export declare function compareVersionText(left: string, right: string): number | null;
|
|
76
|
+
/**
|
|
77
|
+
* The version verdict against the frozen platform line: below the floor is out-of-window (the host
|
|
78
|
+
* is too old, the plugin cannot be made to work), above the declared line is host-newer, and the
|
|
79
|
+
* window between them is in-window. The old code compared equality only, so every older host read
|
|
80
|
+
* as "the host is newer" and `out-of-window` was unreachable.
|
|
81
|
+
*/
|
|
82
|
+
export declare function pairingOf(version: string | undefined, line: {
|
|
83
|
+
readonly version: string;
|
|
84
|
+
readonly floor: string;
|
|
85
|
+
}): PlatformPairing;
|
|
70
86
|
/**
|
|
71
87
|
* Build the frozen DiagnosticsView. Pure; never throws.
|
|
72
88
|
* @param inputs - everything the 7+8 rows read (assembleDoctorInputs probes the live host).
|
|
@@ -85,6 +101,14 @@ export declare function familyVersion(): string;
|
|
|
85
101
|
* @param ctx - the host context.
|
|
86
102
|
* @param extras - call-site facts the context cannot answer (runs, host version, install form).
|
|
87
103
|
*/
|
|
104
|
+
/**
|
|
105
|
+
* Services that exist but answer `degraded`: they are reported in the SAME platform-services row as
|
|
106
|
+
* a missing one, with the reason attached. A registered service whose reads are silently empty (the
|
|
107
|
+
* old projection-port fallback) looked healthy on this row while every projection unit was blank.
|
|
108
|
+
* @param get - the host's service lookup.
|
|
109
|
+
* @returns one `name (reason)` note per degraded family service.
|
|
110
|
+
*/
|
|
111
|
+
export declare function degradedServiceNotes(get: (name: string) => unknown): string[];
|
|
88
112
|
export declare function assembleDoctorInputs(ctx: Context, extras?: {
|
|
89
113
|
readonly runs?: {
|
|
90
114
|
readonly running: number;
|
|
@@ -233,8 +233,8 @@ export declare const HOST_COMMANDS: {
|
|
|
233
233
|
readonly pt: "Parar a varredura de manutenção em andamento (omita o id só se a última execução for a que roda neste processo)";
|
|
234
234
|
};
|
|
235
235
|
readonly "summary.migrate": {
|
|
236
|
-
readonly zh: "
|
|
237
|
-
readonly en: "Move the family's old namespaces from the legacy settings document into the current
|
|
236
|
+
readonly zh: "把旧设置文档里家族的旧分区迁进现在的设置(幂等;已迁移过就报「已一致」)";
|
|
237
|
+
readonly en: "Move the family's old namespaces from the legacy settings document into the current settings (idempotent; reports 'already aligned' when migrated)";
|
|
238
238
|
readonly ja: "旧設定ドキュメントにあるファミリーの旧名前空間を現在の行へ移す(冪等。移行済みなら「整合済み」と報告)";
|
|
239
239
|
readonly es: "Mover los espacios de nombres antiguos de la familia del documento de ajustes heredado a las filas actuales (idempotente; si ya se migró, informa de que «ya está alineado»)";
|
|
240
240
|
readonly fr: "Déplacer les anciens espaces de noms de la famille du document de paramètres hérité vers les lignes actuelles (idempotent ; signale « déjà aligné » si la migration a déjà eu lieu)";
|
|
@@ -493,8 +493,8 @@ export declare const HOST_COMMANDS: {
|
|
|
493
493
|
readonly pt: "\n(as escritas pendentes expiram após {ttl} ms: ao expirar são encerradas como REJECTED e nunca são executadas; prepare novamente se ainda precisar)";
|
|
494
494
|
};
|
|
495
495
|
readonly "command.pending.neverExpires": {
|
|
496
|
-
readonly zh: "
|
|
497
|
-
readonly en: "
|
|
496
|
+
readonly zh: "(暂存写入不会过期 —— 窗口一直等决定;可在「设置 → 能力进化」的审批卡里设置 pendingTtlMs 来限定)";
|
|
497
|
+
readonly en: "(staged writes never expire — the window waits for a decision; set pendingTtlMs on the approval card under Settings → Capability evolution to bound it)";
|
|
498
498
|
readonly ja: "\n(ステージ済みの書き込みは期限切れになりません。判断があるまで待機します。evolution-approval 行の pendingTtlMs で上限を設定できます)";
|
|
499
499
|
readonly es: "\n(las escrituras en espera no caducan: la ventana espera una decisión; define pendingTtlMs en la fila evolution-approval para limitarla)";
|
|
500
500
|
readonly fr: "\n(les écritures en attente n’expirent jamais : la fenêtre attend une décision ; définissez pendingTtlMs sur la ligne evolution-approval pour la borner)";
|
package/locale/de.json
ADDED
package/locale/en.json
ADDED
package/locale/es.json
ADDED
package/locale/fr.json
ADDED
package/locale/ja.json
ADDED
package/locale/pt.json
ADDED
package/locale/ru.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-commands",
|
|
3
3
|
"description": "Human commands for the evolution family (/evolution pending|curator|maintain|doctor) (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.45.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,22 +18,24 @@
|
|
|
18
18
|
"types": "./lib/types/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
|
-
"./package.json": "./package.json"
|
|
21
|
+
"./package.json": "./package.json",
|
|
22
|
+
"./locale/*.json": "./locale/*.json"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
25
|
+
"locale/*.json",
|
|
24
26
|
"lib/*.js",
|
|
25
27
|
"lib/types/**/*.d.ts"
|
|
26
28
|
],
|
|
27
29
|
"license": "MIT",
|
|
28
30
|
"dependencies": {
|
|
29
31
|
"@deepseek-ai/schemastery": "^3.18.5",
|
|
30
|
-
"@lmzhen/dsh-evolution-approval": "^0.
|
|
31
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
32
|
-
"@lmzhen/dsh-evolution-maintenance": "^0.
|
|
33
|
-
"@lmzhen/dsh-evolution-state
|
|
32
|
+
"@lmzhen/dsh-evolution-approval": "^0.45.0",
|
|
33
|
+
"@lmzhen/dsh-evolution-core": "^0.45.0",
|
|
34
|
+
"@lmzhen/dsh-evolution-maintenance": "^0.45.0",
|
|
35
|
+
"@lmzhen/dsh-evolution-state": "^0.45.0"
|
|
34
36
|
},
|
|
35
37
|
"optionalDependencies": {
|
|
36
|
-
"@lmzhen/dsh-evolution-agent-preset": "^0.
|
|
38
|
+
"@lmzhen/dsh-evolution-agent-preset": "^0.45.0"
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
41
|
"@deepseek-ai/cordis": "^4.0.5",
|