Agents Index

This file contains the concatenated content of all cards to help LLMs understand the available documentation.


Spoof - User Developer Guide (/developer-guide.md)

Spoof - User Developer Guide

Welcome to Spoof, the "Hollywood OS" platform for creating and controlling Fantasy/Fake/Fictional User Interfaces (FUIs). This guide will help you create immersive, controllable screens for film and television productions.

The Ecosystem

Creating a FUI

A FUI in Spoof is essentially a web page. You can deliver it as:

The SDK

Include the Spoof SDK in your HTML to interact with the platform.

<script type="module">
  import spoof from 'https://spoof.3sln.com/s/sdk';
</script>

Configuration (spoof-config)

Define variables that the operator can customize (e.g., text, colors, images). Add a <script type="spoof-config"> block with a JSON array of field definitions.

Supported Types:

Example:

<script type="spoof-config">
[
  { "key": "com.example.corp.sys.name", "label": "System Name", "type": "text", "default": "MAIN FRAME" },
  { "key": "com.example.corp.sys.alert", "label": "Alert Level", "type": "select", "options": ["LOW", "HIGH"], "default": "LOW" }
]
</script>

Accessing Config:

spoof.config('com.example.corp.sys.name').subscribe(value => {
  document.getElementById('title').innerText = value;
});

Commands (spoof-commands)

Define actions the operator can trigger from the dashboard.

Definition:

<script type="spoof-commands">
[
  { "key": "com.example.corp.cmd.launch", "label": "Launch Missiles", "params": [] }
]
</script>

Implementation:

spoof.commands['com.example.corp.cmd.launch'] = () => {
  startLaunchSequence();
};

Signals (spoof-signals)

Define feedback sent from the FUI to the operator (e.g., for sound effects or automation).

Definition:

<script type="spoof-signals">
[
  { "key": "com.example.corp.sig.complete", "label": "Launch Complete", "info": "Fires when sequence ends" }
]
</script>

Usage:

function startLaunchSequence() {
  // ... animation ...
  spoof.signals['com.example.corp.sig.complete']({ status: 'success' });
}

Dashboard Widgets (spoof-widgets)

Automatically create buttons on the operator's dashboard.

<script type="spoof-widgets">
[
  { 
    "key": "com.example.corp.wig.launch", 
    "label": "LAUNCH", 
    "type": "button", 
    "commandKey": "com.example.corp.cmd.launch", 
    "params": {} 
  }
]
</script>

Lifecycle Management

Use spoof.signal (an AbortSignal) to clean up resources when your FUI is unloaded.

const timer = setInterval(updateClock, 1000);
spoof.signal.addEventListener('abort', () => clearInterval(timer));

Nested FUIs (Slots)

You can embed other FUIs inside your main FUI using "Slots". This is useful for "Picture-in-Picture" modes or multi-window OS simulations.

  1. Define a Slot Config:

    { "key": "com.example.corp.view.aux", "type": "slot", "label": "Aux View" }
    
  2. Render the Slot: The config value will be a slotId string. Create a <spoof-slot> element and set its slot-id attribute.

    spoof.config('com.example.corp.view.aux').subscribe(slotId => {
        const container = document.getElementById('aux-container');
        container.innerHTML = ''; 
        if (slotId) {
            const slot = document.createElement('spoof-slot');
            slot.slotId = slotId;
            // Style it to fill the container
            slot.style.width = '100%';
            slot.style.height = '100%';
            container.appendChild(slot);
        } else {
            container.innerText = "NO SIGNAL";
        }
    });
    

Controlling Navigation in Slots

Nested FUIs run in an iframe, but <spoof-slot> intercepts their history navigation events (pushState, replaceState, go, back, forward).

Intercepting Events

You can listen for nav:* events on the <spoof-slot> element to drive custom UI logic (like a URL bar) in your parent FUI.

Supported Events: nav:pushState, nav:replaceState, nav:go, nav:back, nav:forward.

const slot = document.querySelector('spoof-slot');
slot.addEventListener('nav:pushState', (e) => {
    console.log("Nested FUI navigating to:", e.detail.args[2]);
});

Hijacking History

If you want to completely disable the browser's default history behavior within the slot (e.g., to implement your own custom "Back" logic or prevent the user from actually navigating the iframe), use the spoof-options script block.

<script type="spoof-options">
{
    "hijackHistoryAndEnableBackEvent": true
}
</script>

When hijackHistoryAndEnableBackEvent is enabled:

  1. API Disabled: Any calls to window.history.back(), pushState(), etc., inside the FUI will throw an error and be blocked.
  2. 'back' Event: If the user triggers a hardware/browser "Back" action, the iframe's window object will receive a custom back event instead of performing a navigation.
// Inside your FUI
window.addEventListener('back', () => {
    if (myModal.isOpen) {
        myModal.close();
    } else {
        // Maybe tell the parent to close the slot
    }
});

User Scripts (Automation)

The Console App allows you to write persistent JavaScript to automate interactions across multiple screens.

API:

Example Script:

// Auto-trigger 'Access Granted' on all screens when 'Password Correct' signal is received
spoof.signal('com.example.corp.login.sig.success').subscribe(payload => {
    console.log('Login successful by:', payload.user);
    setTimeout(() => {
        spoof.command('com.example.corp.main.cmd.grant_access', {});
    }, 500);
});

Best Practices


Building FUIs with AI (/ai-guide.md)

Building FUIs with AI

Spoof is designed to be AI-friendly. Because it uses standard web technologies (HTML/CSS/JS) and a simple, declarative configuration system, modern Large Language Models (LLMs) are exceptionally good at generating high-quality interfaces for the platform.

Getting Started

To get an LLM (like ChatGPT, Claude, or Gemini) up to speed on Spoof's specific SDK and philosophy, you can provide it with our LLM Prelude. This document contains all the technical context the model needs to write correct code for the Spoof environment.

Direct Link to Prelude: https://spoof.3sln.com/llm

Simply copy the content from that page and paste it as the first message in your chat session.

Gemini Gems

For users of Google Gemini, we provide a pre-configured Gemini Gem. This allows you to start building immediately with all the Spoof context already baked into the model's instructions.

CLICK HERE TO USE THE SPOOF GEMINI GEM (Placeholder for custom Gem link)

Tips for AI Generation

When prompting an AI to build a FUI, keep these tips in mind to get the best results:

  1. Request Single-File Output: Ask the AI to generate a single index.html file with all CSS and JS inline. This makes it easy to test and upload to the Console.
  2. Use SVG Sprite Sheets: Instead of requesting Data URIs for every icon (which can clutter the code), instruct the AI to generate a single SVG sprite sheet at the top of the body (hidden) and use <use href="#icon-id"> references. This keeps the markup clean and efficient.
  3. Visuals Over Logic: Remind the AI that this is for a "movie prop." Ask for "technical typography," "glassmorphism (blur and transparency)," and "cyan/amber/red color schemes" to achieve that cinematic look.
  4. Define Commands First: Tell the AI exactly what actions the on-set operator needs to trigger (e.g., "Show Alert," "Start Countdown"). The AI will then correctly generate the <script type="spoof-commands"> and <script type="spoof-widgets"> blocks.
  5. Use Slots Liberally: Instruct the AI to use spoof-slot for any pluggable or swappable parts of the FUI. This offers a great deal of composability and flexibility, allowing the operator to nest other FUIs within your main interface.
  6. Lifecycle Management: Always ensure the AI uses spoof.signal to clean up intervals or animations when the FUI is unloaded.

Embedding the Demo Runner (/embedding-guide.md)

Embedding the Demo Runner

The Spoof Demo Runner is a powerful tool for embedding interactive Fictional User Interfaces (FUIs) directly into your own websites or documentation. It provides a sandboxed environment that can render any valid Spoof FUI without requiring a full console session.

The runner is hosted at: https://spoof.3sln.com/d

Method 1: URL Parameter

The simplest way to load a FUI is by passing a URL to the file via the u query parameter. This is ideal for static demos where the FUI file is hosted publicly.

Example:

<iframe 
  src="https://spoof.3sln.com/d?u=https://example.com/my-fui.html"
  width="100%" 
  height="600px" 
  style="border: none;">
</iframe>

Requirements:

Method 2: PostMessage API

For dynamic scenarios—such as live code editors, AI chat interfaces, or private content—you can programmatically inject the FUI content using the postMessage API.

This method allows you to push raw HTML or binary .3ui data directly into the runner iframe.

The Protocol

Send a message with the following structure to the iframe's window:

{
  type: 'load-fui',
  payload: <EncodedPayload>
}

The payload must be encoded using Spoof's JSON-Bin codec format. This format safely serializes binary data (like Zips) over JSON.

Encoding the Payload

Since the runner expects a specific binary-safe JSON format, you must structure your payload correctly. The payload must decode to a Blob.

For Raw HTML: Convert the HTML string to a Blob and send it.

const iframe = document.querySelector('iframe');
const htmlContent = "<html><body><h1>Hello World</h1></body></html>";
const blob = new Blob([htmlContent], { type: 'text/html' });

// Send message
iframe.contentWindow.postMessage({
    type: 'load-fui',
    payload: blob
}, '*'); 

For Binary Data (.3ui / Zip): If you have a binary blob (e.g., a generated .3ui file), you should wrap it in a Blob object.

// Example: Fetch a local zip and send it
const response = await fetch('./my-project.3ui');
const blob = await response.blob();

// The codec expects the Blob to be passed directly in the payload.
// The runner handles decoding and extraction.
iframe.contentWindow.postMessage({
    type: 'load-fui',
    payload: blob
}, '*');

Note: The runner automatically detects the content type from the Blob.

Full Example: Live Editor

Here is a conceptual example of a live HTML editor that updates the preview as you type:

const editor = document.getElementById('code-editor');
const preview = document.getElementById('spoof-preview');

editor.addEventListener('input', () => {
    const html = editor.value;
    const blob = new Blob([html], { type: 'text/html' });
    
    preview.contentWindow.postMessage({
        type: 'load-fui',
        payload: blob
    }, '*');
});

Introduction to Spoof (/introduction.md)

Introduction to Spoof

Spoof is a specialized platform designed for the unique needs of film and television production. It enables the creation, orchestration, and real-time control of Fictional User Interfaces (FUIs)—the "fake" computer screens seen on camera.

In the industry, these are often referred to as "playback" or "screen graphics." Spoof modernizes this workflow by turning any device with a web browser into a controllable prop.

The "Hollywood OS"

Imagine a scene where a hacker types furiously, a progress bar fills up, and 'ACCESS GRANTED' flashes across three different monitors simultaneously. Spoof is the operating system that makes that happen.

Key Concepts

AI-Native by Design

Because Spoof is built entirely on standard web technologies (HTML/CSS/JS), it is in a unique position to leverage the power of Generative AI.

Large Language Models (LLMs) are exceptionally proficient at writing code for the web. By combining this capability with Spoof's declarative configuration system, you can generate complex, cinematic interfaces in seconds rather than hours. This allows production teams to iterate rapidly and create customized graphics on the fly.

Check out our Building FUIs with AI guide to learn how to put an LLM to work on your production.

Getting Started

The Spoof Console & Sessions

To start a new project, visit https://spoof.3sln.com/c. Spoof will automatically create a unique Session and redirect you to your dedicated console URL (e.g., https://spoof.3sln.com/c/<session-id>).

Connecting Screens

Once your console is open, you can connect any device with a modern browser to your session.

  1. Open the Runner: Navigate to the Runner URL provided in your console (usually https://spoof.3sln.com/s/<session-id>) on the target device (e.g., a prop laptop or phone).
  2. Pair: Enter the 3-digit pairing code displayed on the console to authorize the device.
  3. Communication: Spoof establishes a direct peer-to-peer (WebRTC) connection between the console and the runner. This ensures near-instantaneous response times, critical for timing graphics to an actor's performance.

Live Control

The core power of Spoof is its ability to control screens in real-time.

The Demo Runner

For quick testing or standalone use, we provide the Demo Runner.

If you are a designer or developer looking to build screens for Spoof, check out the Developer Guide.