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.
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
Base64, hexadecimal and URL encoding/decoding are native transformations; they are not encryption.
Hashes
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.
Dates
| Call | Behavior |
|---|---|
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.
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.
Sleep and Post-Delays
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.
| Call / response | Contract |
|---|---|
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, url | Numeric status, 2xx flag, body string and final URL. |
headers | Lowercase names mapped to lists of repeated values. |
| Option | Default / boundary |
|---|---|
timeout, connect_timeout | 30s / 10s; positive finite seconds, request maximum 3600; parent budget still applies. |
headers | String-name/value dictionary; framing headers are managed by the client. |
max_body_bytes, max_header_bytes | 8 MiB / 64 KiB; maximum 64 MiB / 1 MiB. Limits are cumulative across redirects/interim responses. |
follow_redirects, max_redirects | false / 5; opt-in same-origin redirects only; redirect limit range 1–10. |
ca_file | Optional PEM trust bundle; verification remains enabled. |
proxy | Environment 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.
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.
| Configuration | Default / boundary |
|---|---|
driver, database | sqlite / :memory: for direct connect; both fields must be explicit in flow aliases. Paths use the working directory. |
name | Optional unique live-connection name; alias recipes do not reserve it. |
readonly, create, foreign_keys | false / true / true. |
busy_timeout | 5 seconds; positive finite lock-retry budget, maximum 3600. |
| API | Behavior |
|---|---|
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.
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.
| Value | Boundary |
|---|---|
null, bool, number, string | Maps to None, bool, int/float, str. Numbers must be finite; integers limited to ±(2^53−1). Strings must be valid UTF-8. |
list, dict | Recursive value copies; dictionary keys must be strings. No shared identity or cyclic containers. |
| Python tuple | Converts to an Axon list, including return a, b. |
| DataFrame, NumPy scalar/array, bytes, model, connection, class instance | Not 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 variable | Default / behavior |
|---|---|
AXON_PYTHON | python on Windows, python3 on Unix; one executable path, including a venv interpreter. No automatic pip installation. |
AXON_INTEROP_TIMEOUT | 0: inherited parent budget only. Optional local deadline cannot extend the parent. |
AXON_INTEROP_MAX_BYTES | 16 MiB serialized request/response; maximum 256 MiB. |
AXON_INTEROP_MAX_OUTPUT_BYTES | 4 MiB per stdout/stderr stream; maximum 256 MiB. |
AXON_INTEROP_MAX_DEPTH | 64 nested protocol/container levels; maximum 128. |