Mastra Headless API Types (headless/types.ts)

mastra · mastracode/sdk/src/headless/types.ts · typescript · Apache-2.0
ai, integration, dev-tools, lang:typescript

Shared TypeScript definitions for programmatic Mastra API interactions, including run modes and thinking levels for AI agents. Use this to ensure type safety across core runners and CLI adapters.

// Source: https://github.com/mastra-ai/mastra | License: Apache-2.0 | Copyright 2025 Kepler Software, Inc
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Shared types for the headless / programmatic MastraCode API.
 *
 * These types are consumed by the core runner (`runMC`), the resolution policy,
 * the output formatters, and the CLI adapter. They are intentionally free of any
 * `process.*` access so the core API is usable from CI / Node code.
 */
import type { AgentController, AgentControllerEvent, Session } from '@mastra/core/agent-controller';

import type { GoalManager } from '../goal-manager.js';
import type { PackSelection } from '../onboarding/pack-activation.js';

export type RunMode = 'build' | 'plan' | 'fast';
export type ThinkingLevel = 'off' | 'low' |

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key