feat: expose codex thread action capabilities
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user