Bosca / Scripts

Bosca Scripts

Extend the platform
with real Kotlin.

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

Write, validate, run.

01

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.

02

Validate

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.

03

Run it your way

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

A real runtime, not a macro language

Everything you'd want from server-side code — a real language, typed service access, and version control — running safely inside the platform it extends.

Real Kotlin

Scripts are Kotlin, compiled to JVM bytecode — a real language, not a limited expression DSL.

Typed platform access

Call content, collection, metadata, and search services directly, wired in the same way the platform wires itself.

Validated & guarded

Source is checked for dangerous calls, the classpath is allowlisted, and every run has a hard timeout.

Run on events

Run a script on any platform event — through a triggered pipeline — asynchronously, with the event's payload as its input.

HTTP endpoints

Publish a script at a URL — GET or POST, JSON in and out, public or permission-gated.

AI agent tools

Register a script as a tool, with a JSON-schema input, that your AI agents can call to act on your behalf.

Sourced from Git

Attach a script to a file in a repo; a push syncs the source, so scripts live in version control.

Versioned & cached

Each edit bumps the version and recompiles once; compiled scripts are cached in memory and the database.

One script, five ways

Write once, run it however

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.

  • The script is the unit; its type is just how it's entered.
  • Move logic from a hand-run job to an endpoint without rewriting it.
  • Every path runs the same validated, compiled, cached code.
entry points
By handRun it on demand for a one-off task.
On an eventFire it asynchronously when something happens.
As an endpointExpose it at an HTTP URL for anything to call.
As an AI toolLet your agents invoke it with a typed input.
As a throwawayRun an ephemeral script that cleans itself up.

Your logic, inside the platform

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.