mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 03:03:24 -04:00
fix(gateway): complete two-phase exec approval wiring
This commit is contained in:
@@ -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 },
|
||||
);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -67,6 +67,7 @@ describe("exec approval handlers", () => {
|
||||
cwd: "/tmp",
|
||||
host: "node",
|
||||
timeoutMs: 2000,
|
||||
twoPhase: true,
|
||||
},
|
||||
respond,
|
||||
context: context as unknown as Parameters<
|
||||
|
||||
Reference in New Issue
Block a user