@sentzunhat/zacatl
Version:
A modular, high-performance TypeScript microservice framework for Node.js, featuring layered architecture, dependency injection, and robust validation for building scalable APIs and distributed systems.
29 lines • 1.29 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.commandResultSchema = exports.runnerPolicySchema = exports.commandSpecSchema = void 0;
const zod_1 = require("../../third-party/zod.js");
exports.commandSpecSchema = zod_1.z.object({
cmd: zod_1.z.string().min(1, 'Command must not be empty'),
args: zod_1.z.array(zod_1.z.string()).default([]),
cwd: zod_1.z.string().optional(),
env: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
});
exports.runnerPolicySchema = zod_1.z.object({
timeoutMs: zod_1.z.number().int().positive().default(30_000),
maxOutputBytes: zod_1.z.number().int().positive().default(1_048_576),
maxConcurrency: zod_1.z.number().int().min(1).default(4),
allowlist: zod_1.z.array(zod_1.z.string()).optional(),
denyPatterns: zod_1.z.array(zod_1.z.string()).optional(),
cwdPrefix: zod_1.z.string().optional(),
inheritEnv: zod_1.z.boolean().default(false),
});
exports.commandResultSchema = zod_1.z.object({
cmd: zod_1.z.string(),
args: zod_1.z.array(zod_1.z.string()),
exitCode: zod_1.z.number().nullable(),
stdout: zod_1.z.string(),
stderr: zod_1.z.string(),
timedOut: zod_1.z.boolean(),
durationMs: zod_1.z.number(),
});
//# sourceMappingURL=types.js.map