Skip to main content

C#/.NET SDK

.NET 8.0+ integration for Zeq OS. Use HulyaSync for local temporal synchronization; call the REST API for operator computation.

Installation

dotnet add package ZeqOS.SDK --version 1.287.5

Or integrate directly with HttpClient — no extra dependency needed.

Authentication

using System.Net.Http;
using System.Text;
using System.Text.Json;

var client = new HttpClient();
var BASE = "http://localhost";

// Register (first time)
var regBody = JsonSerializer.Serialize(new { displayName = "Alice", equation = "x^2 + sin(y*pi) + phi" });
var regResp = await client.PostAsync($"{BASE}/api/users/register",
new StringContent(regBody, Encoding.UTF8, "application/json"));
var regData = JsonSerializer.Deserialize<Dictionary<string, object>>(await regResp.Content.ReadAsStringAsync());
var token = regData!["token"].ToString();

// Login (same equation = same identity)
var loginBody = JsonSerializer.Serialize(new { equation = "x^2 + sin(y*pi) + phi" });
var loginResp = await client.PostAsync($"{BASE}/api/users/login",
new StringContent(loginBody, Encoding.UTF8, "application/json"));
var loginData = JsonSerializer.Deserialize<Dictionary<string, object>>(await loginResp.Content.ReadAsStringAsync());
var jwt = loginData!["token"].ToString();
client.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", jwt);

Quick Start

// 1. Browse operators — public, no auth needed
var opsResp = await new HttpClient().GetStringAsync($"{BASE}/api/zeq/operators");
Console.WriteLine($"Operators: {opsResp.Substring(0, 100)}...");

// 2. Get HulyaPulse phase — no auth
var phaseJson = await new HttpClient().GetStringAsync($"{BASE}/api/zeq/phase");
Console.WriteLine($"Phase: {phaseJson}");

// 3. Execute operator — requires account
var execBody = JsonSerializer.Serialize(new {
@params = new { G = 6.674e-11, m1 = 5.97e24, m2 = 7.35e22, r = 3.84e8 }
});
var execResp = await client.PostAsync(
$"{BASE}/api/zeq/operators/execute?operator=NM21",
new StringContent(execBody, Encoding.UTF8, "application/json"));
Console.WriteLine($"Result: {await execResp.Content.ReadAsStringAsync()}");

// 4. 7-Step Wizard — requires account
var wizBody = JsonSerializer.Serialize(new {
query = "gravitational time dilation near Earth",
operators = new[] { "KO42", "GR37" },
mode = "basic"
});
var wizResp = await client.PostAsync($"{BASE}/api/7step/run",
new StringContent(wizBody, Encoding.UTF8, "application/json"));
var state = JsonSerializer.Deserialize<Dictionary<string, object>>(
await wizResp.Content.ReadAsStringAsync());
Console.WriteLine($"Operators: {state!["selected_operators"]}");
Console.WriteLine($"Master sum: {state["master_sum"]}");

HulyaSync (Local)

using ZeqOS.SDK;

var sync = new HulyaSync();

// All local — no server, no auth
Console.WriteLine($"Phase: {sync.CurrentPhase():F4}");
Console.WriteLine($"Zeqond: {sync.GetZeqond()}");
Console.WriteLine($"KO42: {sync.Ko42Automatic():F6}");

// Zeq Equation: R(t) = S(t) × [1 + α·sin(2πft)]
Console.WriteLine($"g mod: {sync.Modulate(9.80665):F6}");
Console.WriteLine(sync.DaemonTick());

Framework Equations

Zeq Equation:   R(t) = S(t) × [1 + α × sin(2π × 1.287 × t)]
KO42: α × sin(2π × 1.287 × t)
HULYAS: □(φ) − μ²(r)φ − λφ³ − exp(−φ/φ_c) + φ₄₂ × Σ(Cₖ(φ)) = T^μ_μ + βF·F + J_ext

REST API Reference

EndpointAuthDescription
POST /api/users/loginLogin with equation
GET /api/zeq/phaseHulyaPulse phase + KO42
GET /api/zeq/operatorsAll operators + equations (public)
POST /api/zeq/operators/execute?operator=IDRequiredExecute operator
POST /api/7step/runRequired7-Step Wizard

Architecture

sdk/csharp/
├── ZeqOS.SDK.csproj
└── src/
├── HulyaSync.cs # Local 1.287 Hz engine
├── ZeqClient.cs # REST API client
└── ZeqState.cs # Computation result record

Testing

cd sdk/csharp && dotnet test