Module: OmnifocusMcp::Parsers::AppleScriptEnvelope

Defined in:
lib/omnifocus_mcp/parsers/apple_script_envelope.rb

Overview

Parses the ‘true|false, …` JSON envelope the AppleScript primitives return on stdout. The block runs only on a success: true envelope; it receives the parsed Hash and must itself return a Result (typically wrapping a typed Data payload).

Constant Summary collapse

STDOUT_PREVIEW_LIMIT =

Max characters of raw stdout to include in a JSON-parse error message. Keeps logs/error reporters from being swamped by multi-page AppleScript dumps.

200

Class Method Summary collapse

Class Method Details

.parse(stdout:, default_error:) ⇒ Object



18
19
20
21
# File 'lib/omnifocus_mcp/parsers/apple_script_envelope.rb', line 18

def parse(stdout:, default_error:, &)
  parse_json(stdout).and_then { |hash| from_envelope(hash, default_error: default_error) }
                    .and_then(&)
end