Write
Author a script in Kotlin with direct, typed access to platform services — content, collections, metadata, search — and a context carrying its input and the caller's identity.
Bosca Scripts
Scripts are real Kotlin that runs inside Bosca — with typed, direct access to your content and services. Write one and run it however you need: by hand, on an event, behind an HTTP endpoint, or as a tool your AI agents can call.
How it works
Author a script in Kotlin with direct, typed access to platform services — content, collections, metadata, search — and a context carrying its input and the caller's identity.
Before it ever runs, the source is checked for dangerous calls and compiled — errors surfaced up front — then cached, so the next run starts instantly.
Trigger it on an event, publish it as an HTTP endpoint, register it as a tool your AI agents can call, or run it by hand. One script, many entry points.
What makes it powerful
Everything you'd want from server-side code — a real language, typed service access, and version control — running safely inside the platform it extends.
Scripts are Kotlin, compiled to JVM bytecode — a real language, not a limited expression DSL.
Call content, collection, metadata, and search services directly, wired in the same way the platform wires itself.
Source is checked for dangerous calls, the classpath is allowlisted, and every run has a hard timeout.
Run a script on any platform event — through a triggered pipeline — asynchronously, with the event's payload as its input.
Publish a script at a URL — GET or POST, JSON in and out, public or permission-gated.
Register a script as a tool, with a JSON-schema input, that your AI agents can call to act on your behalf.
Attach a script to a file in a repo; a push syncs the source, so scripts live in version control.
Each edit bumps the version and recompiles once; compiled scripts are cached in memory and the database.
One script, five ways
A script's type decides how it's invoked — nothing about the code changes. The same logic can be a manual utility today and an HTTP endpoint or an AI tool tomorrow, just by how you register it.
Go deeper
Real Kotlin with typed access to everything Bosca holds — validated, compiled, cached, and reachable by hand, by event, by URL, or by an agent. Automation that lives where your data does.