feat: expose codex thread action capabilities

This commit is contained in:
AI Bot
2026-06-03 11:14:12 +08:00
parent 0071dec860
commit b0526215c5
12 changed files with 113 additions and 6 deletions

View File

@@ -1245,6 +1245,31 @@ function normalizeDiscoveryHookSummary(result) {
};
}
function normalizeDiscoveryThreadActionSummary() {
const actions = [
{ label: "归档", group: "lifecycle" },
{ label: "恢复", group: "lifecycle" },
{ label: "分叉", group: "lifecycle" },
{ label: "压缩", group: "lifecycle" },
{ label: "回滚", group: "lifecycle" },
{ label: "改名", group: "metadata" },
{ label: "元数据", group: "metadata" },
{ label: "活跃干预", group: "liveTurn" },
{ label: "中断", group: "liveTurn" },
{ label: "Shell", group: "shell" },
{ label: "取消订阅", group: "subscription" },
];
return {
actionCount: actions.length,
lifecycleActionCount: actions.filter((action) => action.group === "lifecycle").length,
metadataActionCount: actions.filter((action) => action.group === "metadata").length,
liveTurnActionCount: actions.filter((action) => action.group === "liveTurn").length,
shellActionAvailable: actions.some((action) => action.group === "shell"),
userInitiatedOnly: true,
labels: actions.map((action) => action.label),
};
}
function normalizeDiscoveryPlugins(result) {
return asArray(result?.marketplaces)
.flatMap((marketplace) => asArray(marketplace?.plugins))
@@ -1727,6 +1752,7 @@ export async function discoverCodexAppServerCapabilities(runnerConfig) {
hookSummary: normalizeDiscoveryHookSummary(hooksResult),
threadSummary,
threadTurnSummary: normalizeDiscoveryThreadTurnSummary(threadTurnResults, limit),
threadActionSummary: normalizeDiscoveryThreadActionSummary(),
errors: [
modelResult?.__bossError ? `model/list:${safeRuntimeDiagnosticText(modelResult.__bossError)}` : undefined,
providerCapabilities?.__bossError