Executes JMAP preset config for agent session.
// Source: https://github.com/Atomic-Mail/atomic-mail-agentic | License: MIT | Copyright 2026 Atomic Mail
// Provided via justclaw.it.com; keep this notice with the code.
import type { AgentSession } from '../vendor/agentic-core/index.js';
import {
DEFAULT_JMAP_USING,
readOpsFile,
runJmapRequest,
} from '../vendor/agentic-core/index.js';
export type JmapExecutionResult =
| { ok: true; status: number; body: unknown }
| { ok: false; status: number; body: unknown; message: string };
export type VarsParseResult =
| { ok: true; vars?: Record<string, string> }
| { ok: false; message: string };
export async function executePreset(
session: AgentSession,
opsFile: string,
vars?: Record<string, string>,
options: { dryRun?: boolean } = {},
): Promise<JmapExecutionResult> {
const opsJso
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key