Skip to content

Variable: ScopedToolApprovalSchema

Makaio Framework


Makaio Framework / ai-adapters-core / ScopedToolApprovalSchema

const ScopedToolApprovalSchema: object

Defined in: ../../../adapters/core/src/utils/tool-approval.ts:222

Scoped tool approval schema for adapter connector buses.

sessionId is optional here because the connector emits the approval request before the agent layer has enriched it. The agent’s wireToolApprovalRpc (or equivalent) injects sessionId from its own context before forwarding to the global AgentSubjects.toolApprove subject, where sessionId is required.

Adapters with a genuinely different wire format (e.g., gemini-sdk’s callId/name) should define their own schema rather than extending this one.

request: ZodObject<{ adapterId: ZodString; adapterName: ZodString; adapterSessionId: ZodString; agentId: ZodString; args: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; clientId: ZodOptional<ZodString>; messageId: ZodOptional<ZodString>; occurredAt: ZodOptional<ZodNumber>; providerConfigId: ZodOptional<ZodString>; reasoning: ZodOptional<ZodString>; sessionId: ZodOptional<ZodString>; toolCallId: ZodString; toolName: ZodOptional<ZodString>; turnId: ZodOptional<ZodString>; }, $strip>

response: ZodDiscriminatedUnion<[ZodObject<{ action: ZodLiteral<"allow">; updatedInput: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; updatedPermissions: ZodOptional<ZodArray<ZodUnknown>>; }, $strip>, ZodObject<{ action: ZodLiteral<"deny">; message: ZodString; shouldAbort: ZodOptional<ZodBoolean>; }, $strip>], "action"> = AgentToolApproveSchema.response