@lesliechan721/aw 0.1.0-beta.89 → 0.1.0-beta.90
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/dist/src/commands/aw-capabilities.d.ts +1 -1
- package/dist/src/commands/aw-capabilities.js +4 -1
- package/dist/src/commands/aw-capabilities.js.map +1 -1
- package/dist/src/commands/plugin-capabilities.js +4 -1
- package/dist/src/commands/plugin-capabilities.js.map +1 -1
- package/dist/src/commands/public-lifecycle-result.d.ts +3 -0
- package/dist/src/commands/public-lifecycle-result.js +30 -5
- package/dist/src/commands/public-lifecycle-result.js.map +1 -1
- package/dist/src/commands/public-lifecycle.js +8 -0
- package/dist/src/commands/public-lifecycle.js.map +1 -1
- package/dist/src/commands/public-plugin-query.js +6 -2
- package/dist/src/commands/public-plugin-query.js.map +1 -1
- package/dist/src/commands/rebuild-command.js +28 -17
- package/dist/src/commands/rebuild-command.js.map +1 -1
- package/dist/src/commands/rebuild-platform-integration.js +23 -3
- package/dist/src/commands/rebuild-platform-integration.js.map +1 -1
- package/dist/src/commands/reconcile-operation-plan.d.ts +3 -0
- package/dist/src/commands/reconcile-operation-plan.js +1 -0
- package/dist/src/commands/reconcile-operation-plan.js.map +1 -1
- package/dist/src/commands/status-v6.js +61 -9
- package/dist/src/commands/status-v6.js.map +1 -1
- package/dist/src/index.js +122 -28
- package/dist/src/index.js.map +1 -1
- package/dist/src/output/public-result.d.ts +1 -0
- package/dist/src/output/public-result.js +21 -3
- package/dist/src/output/public-result.js.map +1 -1
- package/dist/src/output/receipt-projection.js +19 -5
- package/dist/src/output/receipt-projection.js.map +1 -1
- package/dist/src/portable/recovery.d.ts +2 -7
- package/dist/src/portable/recovery.js +10 -0
- package/dist/src/portable/recovery.js.map +1 -1
- package/dist/src/recovery/coordinator.js +5 -0
- package/dist/src/recovery/coordinator.js.map +1 -1
- package/dist/src/recovery/joint-coordinator.js +12 -0
- package/dist/src/recovery/joint-coordinator.js.map +1 -1
- package/dist/src/recovery/status.d.ts +1 -0
- package/dist/src/recovery/status.js +151 -44
- package/dist/src/recovery/status.js.map +1 -1
- package/dist/src/review/source-binding.js +7 -4
- package/dist/src/review/source-binding.js.map +1 -1
- package/dist/src/tui/components.js +1 -0
- package/dist/src/tui/components.js.map +1 -1
- package/dist/src/tui/config-object-suggestions.d.ts +15 -0
- package/dist/src/tui/config-object-suggestions.js +71 -0
- package/dist/src/tui/config-object-suggestions.js.map +1 -0
- package/dist/src/tui/config-suggestions.d.ts +7 -2
- package/dist/src/tui/config-suggestions.js +22 -14
- package/dist/src/tui/config-suggestions.js.map +1 -1
- package/dist/src/tui/console-app-v4.js +569 -102
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +14 -16
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/tui/controller.d.ts +6 -4
- package/dist/src/tui/controller.js +59 -12
- package/dist/src/tui/controller.js.map +1 -1
- package/dist/src/tui/guided-setup.d.ts +25 -0
- package/dist/src/tui/guided-setup.js +101 -0
- package/dist/src/tui/guided-setup.js.map +1 -0
- package/dist/src/tui/model.d.ts +5 -0
- package/dist/src/tui/model.js +120 -49
- package/dist/src/tui/model.js.map +1 -1
- package/dist/src/tui/router.d.ts +5 -3
- package/dist/src/tui/router.js.map +1 -1
- package/dist/src/tui/scoped-flow.d.ts +2 -0
- package/dist/src/tui/scoped-flow.js.map +1 -1
- package/dist/src/tui/scoped-inventory.d.ts +1 -0
- package/dist/src/tui/screen-registry.d.ts +3 -2
- package/dist/src/utils/config-platforms.d.ts +21 -0
- package/dist/src/utils/config-platforms.js +51 -0
- package/dist/src/utils/config-platforms.js.map +1 -0
- package/dist/src/utils/managed-command-materialization.d.ts +1 -0
- package/dist/src/utils/managed-command-materialization.js +8 -3
- package/dist/src/utils/managed-command-materialization.js.map +1 -1
- package/dist/src/utils/plugin-config-command-apply.js +7 -1
- package/dist/src/utils/plugin-config-command-apply.js.map +1 -1
- package/dist/src/utils/plugin-config-diagnostics.d.ts +16 -0
- package/dist/src/utils/plugin-config-diagnostics.js +44 -0
- package/dist/src/utils/plugin-config-diagnostics.js.map +1 -0
- package/dist/src/utils/plugin-config-impact.js +46 -18
- package/dist/src/utils/plugin-config-impact.js.map +1 -1
- package/dist/src/utils/plugin-config-references.d.ts +5 -0
- package/dist/src/utils/plugin-config-references.js +19 -7
- package/dist/src/utils/plugin-config-references.js.map +1 -1
- package/dist/src/utils/plugin-config-suggestion-runner.d.ts +45 -12
- package/dist/src/utils/plugin-config-suggestion-runner.js +174 -33
- package/dist/src/utils/plugin-config-suggestion-runner.js.map +1 -1
- package/dist/src/utils/plugin-config-suggestions.d.ts +10 -7
- package/dist/src/utils/plugin-config-suggestions.js +41 -13
- package/dist/src/utils/plugin-config-suggestions.js.map +1 -1
- package/dist/src/utils/plugin-config-write.d.ts +2 -0
- package/dist/src/utils/plugin-config-write.js +44 -4
- package/dist/src/utils/plugin-config-write.js.map +1 -1
- package/dist/src/utils/plugin-config.d.ts +1 -0
- package/dist/src/utils/plugin-config.js +33 -8
- package/dist/src/utils/plugin-config.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type PluginConfigValue } from '@lesliechan721/aw-plugin-core';
|
|
2
|
+
import type { RecoveryPlan } from '../recovery/coordinator.js';
|
|
3
|
+
import type { RecoveryTarget } from '../recovery/receipt.js';
|
|
4
|
+
import type { ConfigSuggestionsResponseV2 } from '../utils/plugin-config-suggestions.js';
|
|
5
|
+
import type { Scope } from '../types.js';
|
|
6
|
+
import type { ConfigFieldViewModel, ConfigProfileKey } from './model.js';
|
|
7
|
+
export interface GuidedConfigTarget {
|
|
8
|
+
pluginId: string;
|
|
9
|
+
profile: ConfigProfileKey;
|
|
10
|
+
context: Scope;
|
|
11
|
+
fieldKeys: string[];
|
|
12
|
+
}
|
|
13
|
+
type Position = Pick<RecoveryTarget, 'pluginId' | 'agent' | 'scope'>;
|
|
14
|
+
export interface GuidedSetupPreflight {
|
|
15
|
+
targets: GuidedConfigTarget[];
|
|
16
|
+
readyTargets: Position[];
|
|
17
|
+
}
|
|
18
|
+
export declare function guidedSetupPreflight(plan: RecoveryPlan): GuidedSetupPreflight;
|
|
19
|
+
export declare function guidedSkipWarning(targets: readonly GuidedConfigTarget[]): string;
|
|
20
|
+
export declare function guidedFieldAvailable(field: ConfigFieldViewModel): boolean;
|
|
21
|
+
export declare function guidedSuggestionValue(field: ConfigFieldViewModel, response: ConfigSuggestionsResponseV2, allowHostDefault: boolean): {
|
|
22
|
+
value: PluginConfigValue;
|
|
23
|
+
badge: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { isPlatformTarget, resolvePluginConfigObjectProperties, validatePluginConfigValue } from '@lesliechan721/aw-plugin-core';
|
|
2
|
+
import { publicDiagnostic } from '../commands/public-lifecycle-result.js';
|
|
3
|
+
import { mergeObjectSuggestionPatches } from '../utils/plugin-config-suggestion-runner.js';
|
|
4
|
+
import { isInstallConfigBlocked } from '../utils/plugin-config-diagnostics.js';
|
|
5
|
+
import { agentLabel } from './glossary.js';
|
|
6
|
+
function guidedTargetKey(target) {
|
|
7
|
+
return [target.pluginId, target.profile, target.context].join('\0');
|
|
8
|
+
}
|
|
9
|
+
// Consume the actual recovery preview, not the global status summary: a plugin
|
|
10
|
+
// without any saved Intent can still introduce missing configuration via dependencies.
|
|
11
|
+
export function guidedSetupPreflight(plan) {
|
|
12
|
+
if ((plan.command !== 'install' && plan.command !== 'sync' && plan.command !== 'reinstall')
|
|
13
|
+
|| (plan.blockExecution && !isInstallConfigBlocked(plan.receipt))
|
|
14
|
+
|| (plan.sourceRefreshes?.length ?? 0) > 0)
|
|
15
|
+
return { targets: [], readyTargets: [] };
|
|
16
|
+
const required = new Map();
|
|
17
|
+
const rows = plan.receipt.targetResults;
|
|
18
|
+
const add = (row, raw) => {
|
|
19
|
+
if (raw.code !== 'requiredConfigMissing')
|
|
20
|
+
return;
|
|
21
|
+
const diagnostic = publicDiagnostic(raw);
|
|
22
|
+
const candidate = {
|
|
23
|
+
pluginId: diagnostic.subject?.pluginId ?? row.pluginId,
|
|
24
|
+
profile: isPlatformTarget(diagnostic.subject?.target) ? diagnostic.subject.target : row.agent,
|
|
25
|
+
context: diagnostic.subject?.scope ?? row.scope,
|
|
26
|
+
fieldKeys: diagnostic.detail?.fieldKeys ?? [],
|
|
27
|
+
};
|
|
28
|
+
const key = guidedTargetKey(candidate);
|
|
29
|
+
const previous = required.get(key);
|
|
30
|
+
required.set(key, { ...candidate, fieldKeys: [...new Set([...previous?.fieldKeys ?? [], ...candidate.fieldKeys])] });
|
|
31
|
+
};
|
|
32
|
+
for (const row of rows)
|
|
33
|
+
for (const blocker of row.blockers)
|
|
34
|
+
add(row, blocker);
|
|
35
|
+
// Dependency paths are root → provider. Longer paths must be initialized first.
|
|
36
|
+
const depth = (target) => Math.max(0, ...(plan.joint?.demand.placements ?? []).flatMap((placement) => placement.pluginId === target.pluginId && placement.target === target.profile
|
|
37
|
+
? placement.contributions.map((entry) => entry.path.length) : []), ...rows.flatMap((row) => row.pluginId === target.pluginId && row.agent === target.profile
|
|
38
|
+
? row.contributions?.map((entry) => entry.path.length) ?? [] : []));
|
|
39
|
+
const targets = [...required.values()].sort((left, right) => depth(right) - depth(left)
|
|
40
|
+
|| left.pluginId.localeCompare(right.pluginId) || left.profile.localeCompare(right.profile));
|
|
41
|
+
if (!targets.length)
|
|
42
|
+
return { targets, readyTargets: [] };
|
|
43
|
+
// Exact selection still names the original requested roots (not merely the
|
|
44
|
+
// successfully prepared dependencies). The coordinator preserves global Intent.
|
|
45
|
+
const selected = [...plan.joint?.selectedContributions ?? []];
|
|
46
|
+
const candidateRoots = plan.options.exactTargets?.map(({ pluginId, agent, scope }) => ({
|
|
47
|
+
pluginId, agent, scope: scope ?? plan.options.scope,
|
|
48
|
+
})) ?? (plan.joint ? selected.flatMap(([placement, contributions]) => contributions.flatMap((contribution) => contribution.path.filter((id) => plan.receipt.requestedRoots.includes(id))
|
|
49
|
+
.map((pluginId) => ({ pluginId, agent: placement.target, scope: contribution.scope }))))
|
|
50
|
+
: rows.filter((row) => plan.receipt.requestedRoots.includes(row.pluginId))
|
|
51
|
+
.map(({ pluginId, agent, scope }) => ({ pluginId, agent, scope })));
|
|
52
|
+
const readyTargets = [...new Map(candidateRoots.map((target) => [
|
|
53
|
+
[target.pluginId, target.agent, target.scope].join('\0'), target,
|
|
54
|
+
])).values()].filter((candidate) => {
|
|
55
|
+
const related = rows.filter((row) => row.agent === candidate.agent && (row.pluginId === candidate.pluginId && row.scope === candidate.scope
|
|
56
|
+
|| row.contributions?.some((entry) => entry.path.includes(candidate.pluginId) && entry.scope === candidate.scope)
|
|
57
|
+
|| selected.some(([placement, contributions]) => placement.pluginId === row.pluginId && placement.target === row.agent && placement.scope === row.scope
|
|
58
|
+
&& contributions.some((entry) => entry.path.includes(candidate.pluginId) && entry.scope === candidate.scope))
|
|
59
|
+
|| !plan.joint && row.scope === candidate.scope && row.requiredBy.includes(candidate.pluginId)));
|
|
60
|
+
return related.length > 0 && related.every((row) => row.blockers.length === 0
|
|
61
|
+
&& row.satisfaction !== 'excluded' && row.satisfaction !== 'unsupported' && row.delivery !== null);
|
|
62
|
+
});
|
|
63
|
+
return { targets, readyTargets };
|
|
64
|
+
}
|
|
65
|
+
export function guidedSkipWarning(targets) {
|
|
66
|
+
return `跳过未配置平台:${targets.map(({ pluginId, profile }) => `${pluginId} · ${profile === 'common' ? '公共设置' : agentLabel(profile)}`).join('、')}。保留 requiredConfigMissing 待配置告警,可在状态问题页补齐;不修改平台排除设置。`;
|
|
67
|
+
}
|
|
68
|
+
export function guidedFieldAvailable(field) {
|
|
69
|
+
return !field.configured && !field.invalidOverrideIssue && field.canSet
|
|
70
|
+
&& !field.sensitive && field.effectiveValue === undefined;
|
|
71
|
+
}
|
|
72
|
+
export function guidedSuggestionValue(field, response, allowHostDefault) {
|
|
73
|
+
const definition = field.definition;
|
|
74
|
+
const nativeExecutor = definition.type === 'object'
|
|
75
|
+
&& Object.hasOwn(resolvePluginConfigObjectProperties(definition, { executor: 'native' }).properties, 'executor');
|
|
76
|
+
for (const item of response.items) {
|
|
77
|
+
if ('value' in item) {
|
|
78
|
+
if (item.recommended && validatePluginConfigValue(definition, item.value).length === 0) {
|
|
79
|
+
return { value: item.value, badge: '推荐预选 · 待确认' };
|
|
80
|
+
}
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (definition.type !== 'object')
|
|
84
|
+
continue;
|
|
85
|
+
const child = item.children?.items.find((candidate) => candidate.recommended);
|
|
86
|
+
if (!child && (item.children || !item.recommended))
|
|
87
|
+
continue;
|
|
88
|
+
const patch = child ? mergeObjectSuggestionPatches(item, child) : item;
|
|
89
|
+
const value = { ...(nativeExecutor ? { executor: 'native' } : {}), ...patch.set };
|
|
90
|
+
for (const key of patch.unset ?? [])
|
|
91
|
+
delete value[key];
|
|
92
|
+
if (validatePluginConfigValue(definition, value).length === 0) {
|
|
93
|
+
return { value, badge: '推荐预选 · 待确认' };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const fallback = { executor: 'native' };
|
|
97
|
+
if (allowHostDefault && nativeExecutor && validatePluginConfigValue(definition, fallback).length === 0) {
|
|
98
|
+
return { value: fallback, badge: '沿用宿主默认 · 待确认' };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=guided-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guided-setup.js","sourceRoot":"","sources":["../../../src/tui/guided-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,mCAAmC,EAAE,yBAAyB,EAA0B,MAAM,+BAA+B,CAAC;AACzJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAI1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,E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CAAC;YAAE,SAAS;QAC7D,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,MAAM,KAAK,GAAG,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;QAClF,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE;YAAE,OAAQ,KAAiC,CAAC,GAAG,CAAC,CAAC;QACpF,IAAI,yBAAyB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;QACxC,CAAC;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACxC,IAAI,gBAAgB,IAAI,cAAc,IAAI,yBAAyB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvG,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IACpD,CAAC;AACH,CAAC"}
|
package/dist/src/tui/model.d.ts
CHANGED
|
@@ -347,6 +347,11 @@ export interface ConfigReadOptions extends ConfigProfileOptions {
|
|
|
347
347
|
view?: 'stored' | 'effective';
|
|
348
348
|
}
|
|
349
349
|
export interface ConfigPageViewModel {
|
|
350
|
+
configurableLayers?: ConfigProfileKey[];
|
|
351
|
+
residualLayers?: {
|
|
352
|
+
profile: ConfigProfileKey;
|
|
353
|
+
keys: string[];
|
|
354
|
+
}[];
|
|
350
355
|
editEvidence?: ConfigEditEvidence;
|
|
351
356
|
pluginId: string;
|
|
352
357
|
profile: ConfigProfileKey;
|
package/dist/src/tui/model.js
CHANGED
|
@@ -2,7 +2,7 @@ import { agentLabel } from './glossary.js';
|
|
|
2
2
|
import { inventoryRecoveryActions, publicDiagnostic } from '../commands/public-lifecycle-result.js';
|
|
3
3
|
import { configObjectHasSensitiveChild, presentConfigValue, safeConfigText } from './config-value-presentation.js';
|
|
4
4
|
export { configObjectHasSensitiveChild } from './config-value-presentation.js';
|
|
5
|
-
import { matchPluginConfigPreset, NATIVE_PLATFORM_TARGETS, resolvePluginConfigObjectProperties, stablePluginConfigStringify, } from '@lesliechan721/aw-plugin-core/manifest';
|
|
5
|
+
import { matchPluginConfigPreset, NATIVE_PLATFORM_TARGETS, PLATFORM_TARGETS, resolvePluginConfigObjectProperties, stablePluginConfigStringify, } from '@lesliechan721/aw-plugin-core/manifest';
|
|
6
6
|
import { flattenStatusTargets, statusTargetActivation, statusTargetExtensions, statusTargetIntent, statusTargetOwnershipState, statusTargetSharedNative, } from '../commands/status-v6.js';
|
|
7
7
|
import { buildAllowedLifecycleActions } from '../commands/operation-planner.js';
|
|
8
8
|
import { safeDiagnosticCode, } from './diagnostics.js';
|
|
@@ -1020,7 +1020,7 @@ function targetIssues(payload, targetRevisions = []) {
|
|
|
1020
1020
|
scope: target.scope,
|
|
1021
1021
|
relationship: relationship.relationship,
|
|
1022
1022
|
}],
|
|
1023
|
-
title: `${target.pluginId} · ${target.platform
|
|
1023
|
+
title: `${target.pluginId} · ${agentLabel(target.platform)} · ${dependencyCategory ? `${target.scope === 'user' ? '所有项目' : '当前项目'} · ` : ''}${sharedNativeProjectionIssue ? '由平台共用的内容待同步' : root.category === 'artifactCollision' ? '输出冲突' : dependencyCategory ? {
|
|
1024
1024
|
dependencyMissing: '缺少依赖',
|
|
1025
1025
|
dependencyNotReady: '依赖安装不完整',
|
|
1026
1026
|
dependencyTargetUnsupported: '依赖目标不兼容',
|
|
@@ -1032,9 +1032,9 @@ function targetIssues(payload, targetRevisions = []) {
|
|
|
1032
1032
|
: dependencyCategory
|
|
1033
1033
|
? dependencyPluginId
|
|
1034
1034
|
? `依赖 ${dependencyPluginId}${dependencyPlatform && dependencyScope
|
|
1035
|
-
? `(${dependencyPlatform
|
|
1036
|
-
: ''}未就绪;影响 ${target.pluginId}(${target.platform
|
|
1037
|
-
: `依赖检查未通过;影响 ${target.pluginId}(${target.platform
|
|
1035
|
+
? `(${agentLabel(dependencyPlatform)} · ${dependencyScope === 'user' ? '所有项目' : '当前项目'})`
|
|
1036
|
+
: ''}未就绪;影响 ${target.pluginId}(${agentLabel(target.platform)} · ${target.scope === 'user' ? '所有项目' : '当前项目'})。`
|
|
1037
|
+
: `依赖检查未通过;影响 ${target.pluginId}(${agentLabel(target.platform)} · ${target.scope === 'user' ? '所有项目' : '当前项目'})。`
|
|
1038
1038
|
: sharedNativeDamaged
|
|
1039
1039
|
? 'Codex 平台由多个项目共用的生成内容缺失或损坏。'
|
|
1040
1040
|
: sharedNativeRenderDrift
|
|
@@ -1098,13 +1098,16 @@ function recoveryDiagnosticDetail(reason) {
|
|
|
1098
1098
|
...(detail ? [`Reason: ${detail.reasonCode}`] : []),
|
|
1099
1099
|
...(detail?.path ? [`Location: ${detail.path}`] : []),
|
|
1100
1100
|
...(detail?.configKey ? [`Config key: ${detail.configKey}`] : []),
|
|
1101
|
+
...(detail?.fieldKeys?.length ? [`Config fields: ${detail.fieldKeys.join(', ')}`] : []),
|
|
1101
1102
|
...inventoryRecoveryActions([reason]).flatMap((action) => action.kind === 'manual' ? [action.message] : []),
|
|
1102
1103
|
].join('\n') };
|
|
1103
1104
|
}
|
|
1104
1105
|
function statusIssues(payload, recoveryDiagnostics) {
|
|
1105
1106
|
const targetCodes = new Set(payload.targets.flatMap((target) => target.reasons.map((error) => error.code)));
|
|
1106
1107
|
const issues = new Map();
|
|
1107
|
-
for (const error of [...payload.errors, ...recoveryDiagnostics.filter((entry) => entry.detail
|
|
1108
|
+
for (const error of [...payload.errors, ...recoveryDiagnostics.filter((entry) => entry.detail
|
|
1109
|
+
&& !(entry.subject?.pluginId && entry.detail.fieldKeys?.length
|
|
1110
|
+
&& ['requiredConfigMissing', 'configInvalid', 'invalidConfig'].includes(entry.code)))]) {
|
|
1108
1111
|
if (issues.has(error.code) || targetCodes.has(error.code)
|
|
1109
1112
|
&& !recoveryDiagnostics.some((entry) => entry.code === error.code && entry.detail))
|
|
1110
1113
|
continue;
|
|
@@ -1148,8 +1151,42 @@ function statusIssues(payload, recoveryDiagnostics) {
|
|
|
1148
1151
|
}
|
|
1149
1152
|
return [...issues.values()];
|
|
1150
1153
|
}
|
|
1151
|
-
function configIssues(pluginSummaries) {
|
|
1152
|
-
|
|
1154
|
+
function configIssues(pluginSummaries, recoveryTargets, recoveryDiagnostics) {
|
|
1155
|
+
const summaries = new Map(pluginSummaries.map((summary) => [summary.pluginId, {
|
|
1156
|
+
...summary, configIssues: [...summary.configIssues ?? []],
|
|
1157
|
+
}]));
|
|
1158
|
+
const recovered = new Map();
|
|
1159
|
+
const collect = (entry, fallback) => {
|
|
1160
|
+
const diagnostic = publicDiagnostic(entry);
|
|
1161
|
+
if (diagnostic.code !== 'requiredConfigMissing' && diagnostic.code !== 'configInvalid' && diagnostic.code !== 'invalidConfig')
|
|
1162
|
+
return;
|
|
1163
|
+
const subject = diagnostic.subject;
|
|
1164
|
+
const pluginId = subject?.pluginId ?? entry.pluginId ?? fallback?.pluginId;
|
|
1165
|
+
const platform = subject?.target ?? fallback?.agent;
|
|
1166
|
+
const scope = subject?.scope ?? fallback?.scope;
|
|
1167
|
+
if (!pluginId || !scope || !PLATFORM_TARGETS.includes(platform))
|
|
1168
|
+
return;
|
|
1169
|
+
const summary = summaries.get(pluginId);
|
|
1170
|
+
if (!summary)
|
|
1171
|
+
return;
|
|
1172
|
+
const type = diagnostic.code === 'requiredConfigMissing' ? 'missing-required' : 'invalid-config';
|
|
1173
|
+
const evidenceKey = [pluginId, platform, scope, type].join('\0');
|
|
1174
|
+
const evidence = recovered.get(evidenceKey) ?? [];
|
|
1175
|
+
if (!evidence.some((previous) => JSON.stringify(previous) === JSON.stringify(diagnostic))) {
|
|
1176
|
+
evidence.push(diagnostic);
|
|
1177
|
+
recovered.set(evidenceKey, evidence);
|
|
1178
|
+
}
|
|
1179
|
+
for (const key of diagnostic.detail?.fieldKeys ?? []) {
|
|
1180
|
+
if (summary.configIssues.some((field) => field.key === key && field.platform === platform && field.scope === scope && field.type === type))
|
|
1181
|
+
continue;
|
|
1182
|
+
summary.configIssues.push({ type, key, title: key, scope, platform: platform,
|
|
1183
|
+
source: type === 'missing-required' ? 'missing' : 'platform' });
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
for (const target of recoveryTargets)
|
|
1187
|
+
target.blockers.forEach((entry) => collect(entry, target));
|
|
1188
|
+
recoveryDiagnostics.forEach((entry) => collect(entry));
|
|
1189
|
+
return [...summaries.values()].flatMap((summary) => {
|
|
1153
1190
|
const sourceId = summary.pluginId.slice(0, summary.pluginId.indexOf('/'));
|
|
1154
1191
|
const issues = [];
|
|
1155
1192
|
if (summary.configDiagnostic) {
|
|
@@ -1196,42 +1233,59 @@ function configIssues(pluginSummaries) {
|
|
|
1196
1233
|
})),
|
|
1197
1234
|
});
|
|
1198
1235
|
}
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
{
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1236
|
+
const grouped = new Map();
|
|
1237
|
+
for (const entry of summary.configIssues) {
|
|
1238
|
+
if (entry.type === 'configLayerUnsupported')
|
|
1239
|
+
continue;
|
|
1240
|
+
const invalid = entry.type !== 'missing-required';
|
|
1241
|
+
// Missing platform settings must remain individually reachable, even if
|
|
1242
|
+
// several platforms have the same missing field.
|
|
1243
|
+
const profile = entry.platform ?? 'common';
|
|
1244
|
+
const layer = entry.source === 'common' ? 'common' : profile;
|
|
1245
|
+
const context = entry.scope ?? 'user';
|
|
1246
|
+
const key = [layer, context, invalid ? 'invalid' : 'required'].join(':');
|
|
1247
|
+
const group = grouped.get(key) ?? { profile: layer, context, invalid, fields: [] };
|
|
1248
|
+
group.fields.push(entry);
|
|
1249
|
+
grouped.set(key, group);
|
|
1250
|
+
}
|
|
1251
|
+
for (const [key, { profile, context, invalid, fields }] of grouped) {
|
|
1252
|
+
const configLayer = { profile, context };
|
|
1253
|
+
const positions = [...new Set(fields.flatMap((entry) => entry.platform ? [entry.platform] : []))];
|
|
1254
|
+
const platform = positions.length === 1 ? positions[0] : undefined;
|
|
1255
|
+
const affectedTargets = platform && platform !== 'generic' ? [...new Map(recoveryTargets.filter((target) => target.agent === platform && target.scope === context && target.pluginId === summary.pluginId)
|
|
1256
|
+
.flatMap((target) => [
|
|
1257
|
+
{ pluginId: target.pluginId, platform, scope: target.scope, relationship: 'direct' },
|
|
1258
|
+
...(target.contributions ?? []).filter((contribution) => contribution.root !== target.pluginId)
|
|
1259
|
+
.map((contribution) => ({ pluginId: contribution.root, platform, scope: contribution.scope, relationship: 'consumer' })),
|
|
1260
|
+
]).map((target) => [[target.pluginId, target.platform, target.scope].join('\0'), target])).values()] : [];
|
|
1261
|
+
issues.push({
|
|
1262
|
+
issueId: `config:${summary.pluginId}:${profile === 'common' && context === 'user' ? invalid ? 'invalid' : 'required' : key}`,
|
|
1263
|
+
category: 'requiredConfigMissing',
|
|
1264
|
+
title: `${summary.displayName ?? summary.pluginName} · ${profile === 'common' ? '' : `${agentLabel(profile)} · `}${invalid ? '设置值无效' : '缺少必填设置'}`,
|
|
1265
|
+
explanation: invalid
|
|
1266
|
+
? '已有设置值不符合当前字段规则。'
|
|
1267
|
+
: '插件缺少必填设置,写操作会在预检时被阻止。',
|
|
1268
|
+
impact: [invalid ? '修正所列字段后才能稳定生成插件内容。' : '完成所列字段后才能稳定生成插件内容。'],
|
|
1269
|
+
entity: { kind: 'plugin', id: summary.pluginId },
|
|
1270
|
+
pluginId: summary.pluginId,
|
|
1271
|
+
sourceId,
|
|
1272
|
+
...(platform && platform !== 'generic' ? { platform, scope: context } : {}),
|
|
1273
|
+
...(affectedTargets.length ? { affectedTargets } : {}),
|
|
1274
|
+
requiredFields: fields.map(({ key, title, type, source, scope, platform }) => ({
|
|
1275
|
+
key, title, type, source, scope, platform,
|
|
1276
|
+
})),
|
|
1277
|
+
configLayer,
|
|
1278
|
+
actions: [
|
|
1279
|
+
{ id: 'openConfig', label: invalid ? '修正设置' : '完成设置', description: '进入相关用户配置' },
|
|
1280
|
+
{ id: 'viewTechnical', label: '查看字段详情' },
|
|
1281
|
+
],
|
|
1282
|
+
technicalDetails: fields.map((entry) => ({
|
|
1283
|
+
code: entry.type,
|
|
1284
|
+
message: `${entry.title} · ${entry.scope} · ${entry.source}`,
|
|
1285
|
+
})),
|
|
1286
|
+
recoveryDiagnostics: [...new Set(fields.flatMap((entry) => recovered.get([summary.pluginId, entry.platform, entry.scope, entry.type].join('\0')) ?? []))],
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1235
1289
|
return issues;
|
|
1236
1290
|
});
|
|
1237
1291
|
}
|
|
@@ -1317,10 +1371,10 @@ function issueDiagnostic(issue, sourceDetails) {
|
|
|
1317
1371
|
: []),
|
|
1318
1372
|
...(issue.platform ? [{ key: 'platform', value: issue.platform }] : []),
|
|
1319
1373
|
...(issue.scope ? [{ key: 'scope', value: issue.scope }] : []),
|
|
1320
|
-
...(issue.requiredFields?.
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1374
|
+
...(issue.requiredFields?.length ? [{
|
|
1375
|
+
key: 'field',
|
|
1376
|
+
value: [...new Set(issue.requiredFields.map((field) => field.title))].join('、'),
|
|
1377
|
+
}] : []),
|
|
1324
1378
|
];
|
|
1325
1379
|
const checks = issue.category === 'legacyState'
|
|
1326
1380
|
? [
|
|
@@ -1478,6 +1532,9 @@ function recoveryTargetIssues(targets) {
|
|
|
1478
1532
|
if (target.agent === 'generic' || (target.content === 'satisfied' || target.satisfaction === 'not-applicable')
|
|
1479
1533
|
&& target.blockers.length === 0)
|
|
1480
1534
|
return [];
|
|
1535
|
+
if (target.blockers.length > 0 && target.blockers.every((entry) => ['requiredConfigMissing', 'configInvalid', 'invalidConfig'].includes(entry.code))
|
|
1536
|
+
&& target.blockers.some((entry) => entry.detail?.fieldKeys?.length))
|
|
1537
|
+
return [];
|
|
1481
1538
|
const platform = target.agent;
|
|
1482
1539
|
const entity = { pluginId: target.pluginId, platform, scope: target.scope };
|
|
1483
1540
|
const consumers = [...new Map((target.contributions ?? []).flatMap((contribution) => {
|
|
@@ -1708,7 +1765,7 @@ export function buildTuiViewModel(options) {
|
|
|
1708
1765
|
...allTargetIssues.filter((issue) => !issue.mergeEligible
|
|
1709
1766
|
|| !issue.sourceId || !sourceRootIds.has(issue.sourceId)),
|
|
1710
1767
|
...statusIssues(options.status, options.recoveryDiagnostics ?? []),
|
|
1711
|
-
...configIssues(options.pluginSummaries),
|
|
1768
|
+
...configIssues(options.pluginSummaries, currentTargets, options.recoveryDiagnostics ?? []),
|
|
1712
1769
|
...dependencyOverviewIssues(options.dependencyOverviews ?? [], options.pluginSummaries, options.status),
|
|
1713
1770
|
...[...(options.sourceHealth?.values() ?? [])].flatMap((health) => sourceIssue(health, mergedTargetIssues.get(health.sourceId) ?? []) ?? []),
|
|
1714
1771
|
];
|
|
@@ -2062,6 +2119,20 @@ export function buildConfigGroups(options) {
|
|
|
2062
2119
|
});
|
|
2063
2120
|
}
|
|
2064
2121
|
}
|
|
2122
|
+
const obsolete = options.read.fields.filter((field) => !Object.hasOwn(options.schema.fields, field.key) && field.canUnset);
|
|
2123
|
+
if (obsolete.length > 0 && !effectivePage) {
|
|
2124
|
+
groups.push({
|
|
2125
|
+
id: syntheticGroupId('obsolete'), title: '旧设置 · 仅可删除', advanced: false,
|
|
2126
|
+
fields: obsolete.map((field) => ({
|
|
2127
|
+
key: field.key, title: field.title, type: 'string', definition: { type: 'string', sensitive: true },
|
|
2128
|
+
description: '此键不再属于当前设置定义,可单独删除。',
|
|
2129
|
+
displayValue: '[redacted]', effectiveDisplayValue: '[redacted]',
|
|
2130
|
+
sourceLabel: '本层已设置', effectiveSourceLabel: '不适用',
|
|
2131
|
+
required: false, sensitive: true, writable: false, canSet: false, canUnset: true,
|
|
2132
|
+
dirty: false, inherited: false, configured: true, advanced: false, allowCustom: false,
|
|
2133
|
+
})),
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2065
2136
|
return groups;
|
|
2066
2137
|
}
|
|
2067
2138
|
export function buildConfigPage(options) {
|