"use strict";
/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.RetrieveActionResponseBody$outboundSchema = exports.RetrieveActionResponseBody$inboundSchema = exports.State$outboundSchema = exports.State$inboundSchema = exports.Review$outboundSchema = exports.Review$inboundSchema = exports.Tool$outboundSchema = exports.Tool$inboundSchema = exports.RetrieveActionRequest$outboundSchema = exports.RetrieveActionRequest$inboundSchema = exports.Review = void 0;
exports.retrieveActionRequestToJSON = retrieveActionRequestToJSON;
exports.retrieveActionRequestFromJSON = retrieveActionRequestFromJSON;
exports.toolToJSON = toolToJSON;
exports.toolFromJSON = toolFromJSON;
exports.stateToJSON = stateToJSON;
exports.stateFromJSON = stateFromJSON;
exports.retrieveActionResponseBodyToJSON = retrieveActionResponseBodyToJSON;
exports.retrieveActionResponseBodyFromJSON = retrieveActionResponseBodyFromJSON;
const z = __importStar(require("zod/v3"));
const primitives_js_1 = require("../../lib/primitives.js");
const schemas_js_1 = require("../../lib/schemas.js");
/**
 * Review status of the tool call
 */
exports.Review = {
    Approved: "approved",
    Rejected: "rejected",
};
/** @internal */
exports.RetrieveActionRequest$inboundSchema = z.object({
    agent_key: z.string(),
    task_id: z.string(),
    action_id: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "agent_key": "agentKey",
        "task_id": "taskId",
        "action_id": "actionId",
    });
});
/** @internal */
exports.RetrieveActionRequest$outboundSchema = z.object({
    agentKey: z.string(),
    taskId: z.string(),
    actionId: z.string(),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        agentKey: "agent_key",
        taskId: "task_id",
        actionId: "action_id",
    });
});
function retrieveActionRequestToJSON(retrieveActionRequest) {
    return JSON.stringify(exports.RetrieveActionRequest$outboundSchema.parse(retrieveActionRequest));
}
function retrieveActionRequestFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RetrieveActionRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RetrieveActionRequest' from JSON`);
}
/** @internal */
exports.Tool$inboundSchema = z
    .object({
    id: z.string(),
    display_name: z.string(),
    requires_approval: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "display_name": "displayName",
        "requires_approval": "requiresApproval",
    });
});
/** @internal */
exports.Tool$outboundSchema = z.object({
    id: z.string(),
    displayName: z.string(),
    requiresApproval: z.boolean().default(false),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        displayName: "display_name",
        requiresApproval: "requires_approval",
    });
});
function toolToJSON(tool) {
    return JSON.stringify(exports.Tool$outboundSchema.parse(tool));
}
function toolFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.Tool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Tool' from JSON`);
}
/** @internal */
exports.Review$inboundSchema = z
    .nativeEnum(exports.Review);
/** @internal */
exports.Review$outboundSchema = exports.Review$inboundSchema;
/** @internal */
exports.State$inboundSchema = z
    .object({
    review: z.nullable(exports.Review$inboundSchema).default(null),
    review_source: z.string().optional(),
    reviewed_by_id: z.string().optional(),
    executed: z.boolean().default(false),
    error: z.string().optional(),
    input: z.record(z.any()),
    output: z.record(z.any()),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "review_source": "reviewSource",
        "reviewed_by_id": "reviewedById",
    });
});
/** @internal */
exports.State$outboundSchema = z.object({
    review: z.nullable(exports.Review$outboundSchema).default(null),
    reviewSource: z.string().optional(),
    reviewedById: z.string().optional(),
    executed: z.boolean().default(false),
    error: z.string().optional(),
    input: z.record(z.any()),
    output: z.record(z.any()),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        reviewSource: "review_source",
        reviewedById: "reviewed_by_id",
    });
});
function stateToJSON(state) {
    return JSON.stringify(exports.State$outboundSchema.parse(state));
}
function stateFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.State$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'State' from JSON`);
}
/** @internal */
exports.RetrieveActionResponseBody$inboundSchema = z.object({
    _id: z.string(),
    agent_tool_call_id: z.string(),
    tool: z.lazy(() => exports.Tool$inboundSchema),
    created: z.string(),
    updated: z.string(),
    started: z.string().optional(),
    finished: z.string().optional(),
    agent_id: z.string(),
    action_type: z.string(),
    agent_execution_id: z.string(),
    workspace_id: z.string(),
    state: z.lazy(() => exports.State$inboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        "_id": "id",
        "agent_tool_call_id": "agentToolCallId",
        "agent_id": "agentId",
        "action_type": "actionType",
        "agent_execution_id": "agentExecutionId",
        "workspace_id": "workspaceId",
    });
});
/** @internal */
exports.RetrieveActionResponseBody$outboundSchema = z.object({
    id: z.string(),
    agentToolCallId: z.string(),
    tool: z.lazy(() => exports.Tool$outboundSchema),
    created: z.string(),
    updated: z.string(),
    started: z.string().optional(),
    finished: z.string().optional(),
    agentId: z.string(),
    actionType: z.string(),
    agentExecutionId: z.string(),
    workspaceId: z.string(),
    state: z.lazy(() => exports.State$outboundSchema),
}).transform((v) => {
    return (0, primitives_js_1.remap)(v, {
        id: "_id",
        agentToolCallId: "agent_tool_call_id",
        agentId: "agent_id",
        actionType: "action_type",
        agentExecutionId: "agent_execution_id",
        workspaceId: "workspace_id",
    });
});
function retrieveActionResponseBodyToJSON(retrieveActionResponseBody) {
    return JSON.stringify(exports.RetrieveActionResponseBody$outboundSchema.parse(retrieveActionResponseBody));
}
function retrieveActionResponseBodyFromJSON(jsonString) {
    return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.RetrieveActionResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'RetrieveActionResponseBody' from JSON`);
}
//# sourceMappingURL=retrieveaction.js.map