feat: surface codex app server hook governance

This commit is contained in:
AI Bot
2026-06-03 11:03:45 +08:00
parent 3c6a0c546b
commit 0071dec860
13 changed files with 154 additions and 13 deletions

View File

@@ -38,6 +38,7 @@ if (args[0] === "app-server" && args[1] === "generate-json-schema") {
{ properties: { method: { const: "thread/start" } } },
{ properties: { method: { const: "thread/inject_items" } } },
{ properties: { method: { const: "skills/extraRoots/set" } } },
{ properties: { method: { const: "hooks/list" } } },
{ properties: { method: { const: "turn/start" } } }
]
}, null, 2));
@@ -45,7 +46,7 @@ if (args[0] === "app-server" && args[1] === "generate-json-schema") {
}
if (args[0] === "app-server" && args[1] === "generate-ts") {
const out = args[args.indexOf("--out") + 1];
writeGenerated(out, "ClientRequest.ts", 'export type ClientRequest = { "method": "thread/start" } | { "method": "skills/extraRoots/set" } | { "method": "turn/start" };\\n');
writeGenerated(out, "ClientRequest.ts", 'export type ClientRequest = { "method": "thread/start" } | { "method": "skills/extraRoots/set" } | { "method": "hooks/list" } | { "method": "turn/start" };\\n');
process.exit(0);
}
console.error("unexpected args " + args.join(" "));
@@ -78,7 +79,14 @@ process.exit(2);
assert.equal(manifest.supports.unixTransport, true);
assert.equal(manifest.supports.threadInjectItems, true);
assert.equal(manifest.supports.skillsExtraRoots, true);
assert.deepEqual(manifest.methods, ["skills/extraRoots/set", "thread/inject_items", "thread/start", "turn/start"]);
assert.equal(manifest.supports.hooksList, true);
assert.deepEqual(manifest.methods, [
"hooks/list",
"skills/extraRoots/set",
"thread/inject_items",
"thread/start",
"turn/start",
]);
assert.match(
await readFile(path.join(outDir, "0.135.0-alpha.1", "app-server-help.txt"), "utf8"),
/ws:\/\/IP:PORT/,