Image Operations

Native stb-backed image operations accept paths or base64 depending on the operation. Supply input.png to run this example; returned resized/converted data is base64.

axon

Implemented calls: info(source), save(path, base64), resize(source, width, height, format="jpeg"), convert(source, format). Use ./ or an absolute path for file sources; the current image loader uses path separators to distinguish paths from base64. save writes decoded bytes without re-encoding; choose the output format in resize/convert first. Format/error coverage remains on the quality track.

Codecs

axon

Base64, hexadecimal and URL encoding/decoding are native transformations; they are not encryption.

Hashes

axon

SHA-256 and MD5 are implemented. SHA-1/SHA-512 produce explicit unsupported errors. MD5 is a compatibility hash, not a security integrity recommendation.

OCR

Tesseract and language data are external. Axon searches PATH/common locations; run the installed/languages calls before choosing a document pipeline.

bash
axon
Supply scan.png for extraction. OCR uses unique temporary directories, but native calls remain serialized across sibling interpreters. Failures may be [ocr] diagnostic strings or null, rather than structured exceptions. A PDF → image → OCR → retrieval workflow must be assembled and validated explicitly.

Dates

axon
CallBehavior
now(), timestamp()Local-process date / timestamp, without a timezone database guarantee.
unix()Epoch seconds.
format(date, format)Formatting tokens include YYYY YY MM DD HH mm SS.
parse(date)Date fields as a dictionary.
add(date, count, unit), sub(...)Date/time arithmetic.
diff(a, b, unit)Numeric difference.
before(a, b), after(a, b)Ordering checks.

This is not a timezone-aware calendar library. DST, malformed dates and all month/year boundaries need application-specific validation.

Shell Interoperability

Run source in the host shell: /bin/sh on Unix or COMSPEC/cmd.exe on Windows. Shell syntax and utilities are platform-specific. Axon does not implicitly inject its variables into shell source.

axon

A shell block publishes stdout, stderr and exit_code in context-local __result__. Nonzero exit status is returned as data; launch failures, limits and cancellation raise errors. shell->exec returns stdout directly while updating the structured result; shell.stdout and shell.exitcode remain available.

Configurable argv/env/stdin channels remain planned. Processes inherit host permissions; cancellation control and process isolation are not a security sandbox.

Sleep and Post-Delays

axon

sleep(seconds) waits in seconds. Task, whole-agent and selected-flow delay fields apply after successful completion and count toward deadlines. A direct task call does not incur its whole-agent post-delay.

HTTP and HTTPS

GET/POST return a response dictionary. http->json(url) fetches and decodes a successful response; http->json(response) decodes an existing body, including a JSON error response.

axon
Call / responseContract
get(url, options={})Structured response.
post(url, body, options={})String body sent unchanged; other values serialize as JSON.
json(url, options={}) / json(response)Strict JSON decoder; valid JSON null differs from a decode error.
status, ok, body, urlNumeric status, 2xx flag, body string and final URL.
headersLowercase names mapped to lists of repeated values.
OptionDefault / boundary
timeout, connect_timeout30s / 10s; positive finite seconds, request maximum 3600; parent budget still applies.
headersString-name/value dictionary; framing headers are managed by the client.
max_body_bytes, max_header_bytes8 MiB / 64 KiB; maximum 64 MiB / 1 MiB. Limits are cumulative across redirects/interim responses.
follow_redirects, max_redirectsfalse / 5; opt-in same-origin redirects only; redirect limit range 1–10.
ca_fileOptional PEM trust bundle; verification remains enabled.
proxyEnvironment proxy by default; empty string disables it for this call.

HTTPS verifies trust and hostname with TLS 1.2+. GET/POST preserve 4xx/5xx responses; transport/TLS/framing/limit errors are catchable HttpError values. json(url) also raises on non-2xx status. Bodies for POST are limited to 8 MiB. Unknown options and header injection are rejected.

This live example needs network access and is subject to GitHub rate limits. HTTP is not a scraping engine, MCP/gRPC client, browser renderer, streaming API or server framework. See the full HTTP contract.

Native SQL: SQLite

Open connections explicitly in main/functions from dictionaries, optionally declared in a flow. SQLite is the implemented driver; DuckDB then PostgreSQL are planned. GUI tools and database command-line executables are not required.

axon
ConfigurationDefault / boundary
driver, databasesqlite / :memory: for direct connect; both fields must be explicit in flow aliases. Paths use the working directory.
nameOptional unique live-connection name; alias recipes do not reserve it.
readonly, create, foreign_keysfalse / true / true.
busy_timeout5 seconds; positive finite lock-retry budget, maximum 3600.
APIBehavior
validate(config), connect(config)Pure schema validation / explicit open. Validation does not test filesystem availability.
connection(name), is_open(db), close(db)Named lookup and lifecycle; close rolls back an unfinished transaction.
query(db, statement, params=[], options={})List of row dictionaries.
execute(db, statement, params=[], options={})Metadata: rows, columns, changes, last_insert_id, in_transaction.
script(db, text, options={})Multiple statements, no implicit transaction.
begin(db), commit(db), rollback(db)Explicit transaction boundaries.
use(db), sql { ... }Select the connection for raw SQL blocks; rows in sql.result and __result__.
storage->query(db, statement, params, options)Alias for native SQL query; no implicit driver/connection.

Query/execute accept one statement and require exact parameter bindings (list for positional, dict for named). Cell values are null, text/bytes or finite numbers; bool parameters bind as 0/1. Large SQLite integers outside ±(2^53−1) return decimal strings. Nested objects require explicit serialization. Duplicate result column names are errors; alias them.

Options: timeout=30s (maximum 3600), max_rows=10000 (maximum 1000000), max_bytes=8 MiB (maximum 64 MiB). Results are materialized, not streamed. One connection serializes calls; transactions belong to the branch that began them. Independent :memory: opens are separate databases. Raw blocks/scripts do not interpolate parameters; use bound query/execute for external data.

Handles are process-local resources, not serializable Python connections. Use explicit rollback/cleanup; parallel failure does not undo autocommitted side effects. See the SQL contract for limits and ownership.

Python Interoperability

Python blocks are statements in global main or functions, including nested control blocks. They cannot be written directly in flow/agent/task declarations or agent main. Agents may call an ordinary function that performs Python work.

axon
ValueBoundary
null, bool, number, stringMaps to None, bool, int/float, str. Numbers must be finite; integers limited to ±(2^53−1). Strings must be valid UTF-8.
list, dictRecursive value copies; dictionary keys must be strings. No shared identity or cyclic containers.
Python tupleConverts to an Axon list, including return a, b.
DataFrame, NumPy scalar/array, bytes, model, connection, class instanceNot automatically supported. Convert to compatible built-ins or export a file deliberately.

Only explicit [name=expression] bindings cross the boundary, evaluated once in source order. Multiline headers and trailing commas are accepted. Use normal Python return; no return/None yields null. Print output is not the returned value. __result__ is read-only and context-local; save or return it before another Python/shell/SQL block overwrites it.

Each block starts a fresh external Python 3.9+ process. No globals/imports persist between blocks; code can import large user-owned .py modules, functions and ML libraries from the selected environment. Imports search the defining .axon file’s directory first; data-file paths still use the launch working directory. Axon wraps the block in a function and dedents it, preserving relative indentation.

Environment variableDefault / behavior
AXON_PYTHONpython on Windows, python3 on Unix; one executable path, including a venv interpreter. No automatic pip installation.
AXON_INTEROP_TIMEOUT0: inherited parent budget only. Optional local deadline cannot extend the parent.
AXON_INTEROP_MAX_BYTES16 MiB serialized request/response; maximum 256 MiB.
AXON_INTEROP_MAX_OUTPUT_BYTES4 MiB per stdout/stderr stream; maximum 256 MiB.
AXON_INTEROP_MAX_DEPTH64 nested protocol/container levels; maximum 128.
Requires an installed Python interpreter. Exceptions include a traceback and are catchable; failed execution/conversion clears __result__ to null. Streams are buffered and forwarded after exit. Cancellation controls the process group/job, but host permissions and external resources remain available. See the complete Python contract.