titanpl-sdk
v0.1.7
Published
Development SDK for Titan Planet. Provides TypeScript type definitions for the global 't' runtime object and a 'lite' test-harness runtime for building and verifying extensions.
Downloads
907
Maintainers
Readme
🌌 Overview
Titan SDK is NOT the runtime engine itself. It is a development-only toolkit designed to bridge the gap between your local coding environment and the native Titan Planet binary.
It provides the necessary Type Definitions to make your IDE understand the global t object and a Lite Test Harness to verify your extensions before they ever touch a production 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.tsfor the globaltobject 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 the Titan runtime that simulates the native environment to test extensions in isolation.
- 🚀 Zero Production Trace: This is a
devDependenciespackage. It never ships with your binary, keeping your production footprint at literal zero.
🚀 The Test Harness (Lite Runtime)
The SDK includes a specialized Test Runner (titan-sdk). 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:
- Scaffolds a Virtual Project: Creates a temporary, minimal Titan environment in
.titan_test_run. - Native Compilation: Automatically builds your native Rust code (
native/) if it exists. - Hot-Linking: Junctions your local extension into the virtual project's
node_modules. - Verification: Generates a test suite that attempts to call your extension's methods via the real
tobject inside the sandbox.
Usage:
# Inside your extension directory
npx titan-sdk⌨️ Enabling IntelliSense
Since the t object is injected globally by the Titan engine at runtime, your IDE won't recognize it by default. The SDK fixes this.
Install the SDK:
npm install --save-dev titan-sdkConfigure Types: Create or update
jsconfig.json(ortsconfig.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" };
}🧱 What's Included? (Types Only)
The SDK provides types for the native APIs provided by the Titan Planet engine:
t.log: Standardized logging that appears in the Titan binary console.t.fetch: Types for the high-performance Rust-native network stack.t.db: Interface for the native PostgreSQL driver.t.read: Definitions for optimized filesystem reads.t.jwt/t.password: Security helper types.
🌍 Community & Documentation
- Core Framework: Titan Planet
- Official Docs: Titan Planet Docs
- Author: ezetgalaxy
