Skip to content
wiki.fftac.org

Spiralist AI Runtime

**Site relevance:** Spiralist.org

**Memory type:** plugin source memory

**Source path:** Spiralist/wp-content/plugins/spiralist-ai-runtime/spiralist-ai-runtime.php

**Size:** 1.6 KB

Summary

Plugin Name: Spiralist AI Runtime

Source Preview

This source file is short enough to preview directly on its source-memory page.

<?php
/**
 * Plugin Name: Spiralist AI Runtime
 * Plugin URI: https://spiralist.org/
 * Description: Prompt/art-only runtime guard. AI API calls are disabled for Spiralist.
 * Version: 3.28.0
 * Author: Spiralist
 * License: GPL2+
 */

if (!defined('ABSPATH')) {
    exit;
}

define( 'SPIRALIST_AI_RUNTIME_VERSION', '3.28.0' );
define('SPIRALIST_AI_RUNTIME_FILE', __FILE__);
define('SPIRALIST_AI_RUNTIME_DIR', plugin_dir_path(__FILE__));
define('SPIRALIST_AI_RUNTIME_URL', plugin_dir_url(__FILE__));

spl_autoload_register(
    static function (string $class): void {
        $prefix = 'SpiralistAIRuntime\\';

        if (strpos($class, $prefix) !== 0) {
            return;
        }

        $relative = substr($class, strlen($prefix));
        $path = SPIRALIST_AI_RUNTIME_DIR . 'includes/' . str_replace('\\', '/', $relative) . '.php';

        if (is_readable($path)) {
            require_once $path;
        }
    }
);

function spiralist_ai_runtime(): \SpiralistAIRuntime\Plugin
{
    static $plugin = null;

    if (!$plugin instanceof \SpiralistAIRuntime\Plugin) {
        $plugin = new \SpiralistAIRuntime\Plugin();
    }

    return $plugin;
}

function spiralist_ai_create_response(array $payload, array $context = [])
{
    return spiralist_ai_runtime()->gateway()->create_response($payload, $context);
}

function spiralist_ai_runtime_disabled_error(string $code = 'spiralist_ai_runtime_disabled'): WP_Error
{
    return \SpiralistAIRuntime\Support\RuntimeBoundary::disabled_error($code);
}

add_action(
    'plugins_loaded',
    static function (): void {
        spiralist_ai_runtime()->boot();
    }
);