TypeScript SDK
Type definitions for Zeq OS — use alongside the JavaScript SDK for type-safe development. All runtime implementations live in @zeq-os/sdk; this package is a type layer only.
Installation
npm install @zeq-os/types
Core Types
// Physical constants
export const HULYA_FREQUENCY = 1.287; // Hz
export const ZEQOND_PERIOD = 0.777; // seconds
export const ALPHA = 0.00129; // modulation depth
// Operator — returned from GET /api/zeq/operators
export interface Operator {
id: string;
name: string;
category: string;
equation: string; // fully public — standard physics formula
description: string;
tier: number; // 1 = Core Physics, 2 = Applied, 3 = Computational, 4 = Experimental
tierLabel: string;
founder: string;
}
// ZeqState — returned from POST /api/7step/run
export interface ZeqState {
query: string;
zeqond: number;
phase: number;
domains: string[];
selected_operators: string[];
operator_count: number;
master_sum: number;
phase_coherence: number;
precision: string;
}
// Phase response — GET /api/zeq/phase
export interface HulyaPhase {
phase: number; // [0, 1)
frequency: number; // 1.287
ko42: number; // current KO42 value
zeqond: number; // Zeqond count since epoch
timestamp: number;
}
// Auth response — POST /api/users/login or /register
export interface AuthResponse {
zid: string; // "zeq-abc123"
token: string; // JWT
displayName: string;
}
Wizard Protocol Types
export type WizardMode = 'basic' | 'advanced' | 'mathematical_state';
export interface WizardRequest {
query: string;
operators?: string[]; // e.g. ["KO42", "QM1", "NM21"]
mode?: WizardMode;
}
// The 7 mandatory steps
export const WIZARD_STEPS = [
{ step: 1, name: 'PRIME_DIRECTIVE', description: 'KO42 is mandatory' },
{ step: 2, name: 'OPERATOR_LIMIT', description: '1–3 additional + KO42 (total ≤ 4)' },
{ step: 3, name: 'SCALE_PRINCIPLE', description: 'Match operators to domain' },
{ step: 4, name: 'PRECISION', description: 'Target ≤ 0.1% mean error' },
{ step: 5, name: 'COMPILE', description: 'Assemble Master Equation' },
{ step: 6, name: 'EXECUTE', description: 'Run with HulyaPulse modulation' },
{ step: 7, name: 'VERIFY', description: 'Confirm precision ≤ 0.1%' },
] as const;
Usage with JavaScript SDK
import type { ZeqState, Operator, HulyaPhase, AuthResponse } from '@zeq-os/types';
import { ZeqSDK, ZeqondClock } from '@zeq-os/sdk';
const BASE = "http://localhost";
// Typed REST calls
const phase: HulyaPhase = await fetch(`${BASE}/api/zeq/phase`).then(r => r.json());
console.log(`Phase: ${phase.phase.toFixed(4)}`);
const { operators }: { operators: Operator[] } =
await fetch(`${BASE}/api/zeq/operators`).then(r => r.json());
operators.forEach((op: Operator) => console.log(`${op.id}: ${op.equation}`));
// SDK with types
const sdk = new ZeqSDK({ token: "your-jwt" });
const result: ZeqState = await sdk.execute("quantum tunneling");
console.log(`Precision: ${result.precision}`); // TypeScript knows this is a string
Architecture
sdk/typescript/
├── package.json
├── tsconfig.json
└── src/
├── constants.ts # Physical constants
└── core/
└── types.ts # All interfaces