API Reference@helix-hq/code-executor

@helix-hq/code-executor

Public API of @helix-hq/code-executor.

The complete public surface of @helix-hq/code-executor, generated from the published type declarations. Anything absent here is not part of the package's contract.

import { JSONSchema } from 'zod/v4/core';

// @public
export const DEFAULT_LIMITS: {
    readonly memoryBytes: number;
    readonly cpuMs: 5000;
    readonly wallClockMs: 45000;
    readonly maxCalls: 40;
    readonly maxLogs: 100;
};

// @public
export const describeEnvironment: (input: {
    inputSchema?: JSONSchema._JSONSchema;
    functions?: HostFunctions;
}) => string;

// @public
export const executeCode: <T = unknown>(code: string, options?: ExecutionOptions) => Promise<ExecutionResult<T>>;

// @public
export type ExecutionLimits = {
    memoryBytes?: number;
    cpuMs?: number;
    wallClockMs?: number;
    maxCalls?: number;
    maxLogs?: number;
};

// @public (undocumented)
export type ExecutionOptions = {
    input?: unknown;
    inputSchema?: JSONSchema._JSONSchema;
    outputSchema?: JSONSchema._JSONSchema;
    functions?: HostFunctions;
    limits?: ExecutionLimits;
};

// @public (undocumented)
export type ExecutionResult<T = unknown> = {
    success: boolean;
    data?: T;
    error?: string;
    logs: string[];
    calls: number;
    durationMs: number;
};

// @public
export type HostFunction = {
    handler: (argument: unknown) => unknown;
    description?: string;
    parameters?: JSONSchema._JSONSchema;
    returns?: JSONSchema._JSONSchema;
};

// @public (undocumented)
export type HostFunctions = Record<string, HostFunction>;

// (No @packageDocumentation comment for this package)

On this page

No Headings