feat: expose codex migration marketplace governance

This commit is contained in:
AI Bot
2026-06-03 11:55:48 +08:00
parent 0fdee4bcf7
commit ca64a4c498
12 changed files with 169 additions and 7 deletions

View File

@@ -1373,6 +1373,51 @@ function normalizeDiscoveryCommandSessionSummary() {
};
}
function normalizeDiscoveryExternalAgentGovernanceSummary() {
const actions = [
{ label: "迁移检测", group: "detect", detect: true },
{ label: "迁移导入", group: "import" },
{ label: "导入完成", group: "notify" },
];
return {
actionCount: actions.length,
importActionCount: actions.filter((action) => action.group === "import").length,
notificationActionCount: actions.filter((action) => action.group === "notify").length,
detectActionAvailable: actions.some((action) => action.detect === true),
userInitiatedOnly: true,
labels: actions.map((action) => action.label),
};
}
function normalizeDiscoveryMarketplaceGovernanceSummary() {
const actions = [
{ label: "添加市场", group: "write" },
{ label: "移除市场", group: "write" },
{ label: "升级市场", group: "write", upgrade: true },
];
return {
actionCount: actions.length,
writeActionCount: actions.filter((action) => action.group === "write").length,
upgradeAvailable: actions.some((action) => action.upgrade === true),
userInitiatedOnly: true,
labels: actions.map((action) => action.label),
};
}
function normalizeDiscoveryExperimentalFeatureGovernanceSummary() {
const actions = [
{ label: "实验列表", group: "read", list: true },
{ label: "启用设置", group: "write" },
];
return {
actionCount: actions.length,
writeActionCount: actions.filter((action) => action.group === "write").length,
listAvailable: actions.some((action) => action.list === true),
userInitiatedOnly: true,
labels: actions.map((action) => action.label),
};
}
function normalizeDiscoveryPlugins(result) {
return asArray(result?.marketplaces)
.flatMap((marketplace) => asArray(marketplace?.plugins))
@@ -1861,6 +1906,9 @@ export async function discoverCodexAppServerCapabilities(runnerConfig) {
configGovernanceSummary: normalizeDiscoveryConfigGovernanceSummary(),
fileSystemGovernanceSummary: normalizeDiscoveryFileSystemGovernanceSummary(),
commandSessionSummary: normalizeDiscoveryCommandSessionSummary(),
externalAgentGovernanceSummary: normalizeDiscoveryExternalAgentGovernanceSummary(),
marketplaceGovernanceSummary: normalizeDiscoveryMarketplaceGovernanceSummary(),
experimentalFeatureGovernanceSummary: normalizeDiscoveryExperimentalFeatureGovernanceSummary(),
errors: [
modelResult?.__bossError ? `model/list:${safeRuntimeDiagnosticText(modelResult.__bossError)}` : undefined,
providerCapabilities?.__bossError