Titan Planet Logo

TitanPl SDK

The developer toolkit for Titan Planet with type safety and IntelliSense.

Titan SDK is a development-only toolkit designed to bridge the gap between your local coding environment and the native Titan Planet binary.

Note: The actual implementation of t.log, t.fetch, and other APIs are embedded directly into the Titan Planet Binary. This SDK simply provides the "blueprints" (types) and a "sandbox" (test runner).


✨ Features

  • πŸ’Ž Blueprint Types (IntelliSense): Provides the full TypeScript index.d.ts for the global t object so you get autocomplete in VS Code and other editors.
  • πŸ›‘οΈ Static Validation: Catch parameter mismatches and typos in t.log, t.fetch, t.db, etc., during development.
  • πŸ”Œ Extension Test Harness: A "lite" version of Gravity that simulates the native environment to test extensions in isolation.
  • πŸš€ Zero Production Trace: This is a devDependencies package. It never ships with your binary, keeping your production footprint at literal zero.

πŸš€ The Test Harness (Lite Gravity)

The SDK includes a specialized Test Runner. This is a "lite" version of the Titan ecosystem that acts as a bridge for developers.

How it works:

When you run the SDK in an extension folder, it:

  1. Scaffolds a Virtual Project: Creates a temporary, minimal Titan environment in .titan_test_run.
  2. Native Compilation: Automatically builds your native Rust code (native/) if it exists.
  3. Hot-Linking: Junctions your local extension into the virtual project's node_modules.
  4. Verification: Generates a test suite that attempts to call your extension's methods via the real t object inside the sandbox.

Usage:

# Inside your extension directory
titan run ext

⌨️ Enabling IntelliSense

Since the t object is injected globally by Gravity at runtime, your IDE won't recognize it by default. The SDK fixes this.

  1. Install the SDK:

    npm install --save-dev titanpl-sdk
  2. Configure Types: Create or update jsconfig.json (or tsconfig.json) in your project root:

    {
      "compilerOptions": {
        "types": ["titan-sdk"]
      }
    }

Now your editor will treat t as a first-class citizen:

export function myAction(req) {
  t.log.info("Request received", req.path); // Autocomplete works!
  return { status: "ok" };
}

🌍 Community & Documentation

On this page