fix(gateway): complete two-phase exec approval wiring

This commit is contained in:
Peter Steinberger
2026-02-13 19:36:19 +01:00
parent ef8b40a4f1
commit fbdfe0c993
4 changed files with 8 additions and 1 deletions

View File

@@ -99,6 +99,7 @@ export const ExecApprovalRequestParamsSchema = Type.Object(
resolvedPath: Type.Optional(Type.Union([Type.String(), Type.Null()])),
sessionKey: Type.Optional(Type.Union([Type.String(), Type.Null()])),
timeoutMs: Type.Optional(Type.Integer({ minimum: 1 })),
twoPhase: Type.Optional(Type.Boolean()),
},
{ additionalProperties: false },
);

View File

@@ -24,6 +24,7 @@ const BASE_METHODS = [
"exec.approvals.node.get",
"exec.approvals.node.set",
"exec.approval.request",
"exec.approval.waitDecision",
"exec.approval.resolve",
"wizard.start",
"wizard.next",

View File

@@ -32,7 +32,11 @@ const WRITE_SCOPE = "operator.write";
const APPROVALS_SCOPE = "operator.approvals";
const PAIRING_SCOPE = "operator.pairing";
const APPROVAL_METHODS = new Set(["exec.approval.request", "exec.approval.resolve"]);
const APPROVAL_METHODS = new Set([
"exec.approval.request",
"exec.approval.waitDecision",
"exec.approval.resolve",
]);
const NODE_ROLE_METHODS = new Set(["node.invoke.result", "node.event", "skills.bins"]);
const PAIRING_METHODS = new Set([
"node.pair.request",

View File

@@ -67,6 +67,7 @@ describe("exec approval handlers", () => {
cwd: "/tmp",
host: "node",
timeoutMs: 2000,
twoPhase: true,
},
respond,
context: context as unknown as Parameters<