Tarotscript Layer 4 · Compass fol. v
Plate I wealth, business, leadership, security, abundance

For the operator three doors open.

You integrate at the surface closest to your agent. Copilots and conversational agents use the MCP tools. Servers and workers use the REST API. Authors who extend the language use the deck authoring SDK. All three doors open onto the same runtime.

The quickstart snippets below are production code. Copy them, run them, adapt them. The reference at the bottom is canonical.

mcp
tool-shaped · stateful
rest
bearer auth · hosted
authoring
file-based · local
Plate II avoiding conflict, compromise, inner conflict, suppressed aggression
i.

MCP tools

for agents

Expose the runtime to Claude, Cursor, or any MCP-capable agent as tools.

// .mcp.json entry
{
  "mcpServers": {
    "tarotscript": {
      "url": "https://tarotscript-worker.blue-pine-edf6.workers.dev/mcp",
      "headers": {
        "Authorization": "Bearer $API_KEY"
      }
    }
  }
}

// call from the agent:
tarot_cast({
  source: "spread Triad { ... }",
  seed: 42,
  inscribe: true
})
tools tarot_cast tarot_classify tarot_validate_bundle
ii.

REST API

for servers

Call the runtime directly. Bearer auth, JSON in, JSON out. Service-bindable from Cloudflare Workers.

# first cast
curl -X POST https://tarotscript-worker.blue-pine-edf6.workers.dev/run \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "spread T { positions: a, b, c\n flow: a -> b -> c }\nritual cast { using T\n shuffle\n draw a\n draw b\n draw c\n speak \"{a.name}\" }",
    "seed": 42,
    "inscribe": true
  }'
endpoints /run /agents/run /receipt/:hash
iii.

Deck authoring

for authors

Compose a custom agent from four deck files. No runtime change; just files the hosted runtime loads.

// decks/agents/ciso.manifest.json
{
  "role": "ciso",
  "persona":    "ciso-persona.deck",
  "domain":     "ciso-domain.deck",
  "governance": "ciso-governance.deck",
  "actions":    "ciso-actions.deck"
}

// ciso-persona.deck — one card:
card Threat_Watcher {
  element: water
  properties:
    communication_style: "probing"
    decision_pattern: "principle-first"
}
contracts @stackbilt/contracts bootstrap POST /agents/bootstrap
Plate III stuck in past, naivety, unrealistic, leaving home
i.

MCP — tool-shaped.

The runtime appears as tools the agent may call. Names are imperative (tarot_cast, tarot_classify). State lives in the conversation context — the tool returns a receipt, the agent holds it. Best for: conversational agents, IDE copilots, ambient assistants.

ii.

REST — endpoint-shaped.

The runtime appears as HTTP verbs on paths. POST /run for generic casts, POST /agents/run for agent consultations. State is externalised — you persist the receipt hash, query it later. Best for: backend services, Cloudflare Workers (service-bindable), batch jobs.

iii.

SDK — file-shaped.

The runtime loads your files. Author four deck files and a manifest; the hosted runtime picks them up. No code you write runs on the runtime — only data. Best for: domain experts, agent authors, anyone calibrating behavior by editing cards rather than prompts.

Plate IV fantasy, illusion, wishful thinking, choices, daydreaming

REST endpoints

Method Path Purpose Returns
POST /run Execute a .tarot source. The universal cast endpoint. output, facts, spread, analysis, receipt
POST /agents/run Consult a registered agent with an intention. Returns a 5-position cast. role, response, analysis, symbolicResponse, receipt
POST /agents/bootstrap Research pipeline for a new agent's domain deck. signals, spread, cardCandidates, synthesis
GET /receipt/:hash Resolve a content-addressable receipt. verified, receipt (or verified: false)
GET /telemetry/agents Aggregated agent-cast telemetry: confidence, tension rates, top cards. count, metrics, recent
POST /sim/* Simulation endpoints (create, tick, decide, state, history, stream). session state, generation, narrative

MCP tools

Tool Args Returns
tarot_cast source, seed?, inscribe?, querent? output lines, receipt hash
tarot_classify intention trait vector, stack match, confidence
tarot_validate_bundle manifest, decks[] valid, violations, coherence score

Descend

  1. II. The Language rituals, spreads, cards, readings — with a live in-browser runtime
  2. III. The Agents classification, scaffolding, decisions, simulation — one abstraction, four vocabularies
  3. IV. The Ecosystem AEGIS, Stackbilder, production rituals — references that compile