Skip to main content

Ruby SDK

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

Installation

gem install zeq-os

Or use Ruby's built-in net/http — no gem needed for REST calls.

Authentication

require 'net/http'
require 'json'

BASE = 'http://localhost'

def login(equation)
uri = URI("#{BASE}/api/users/login")
Net::HTTP.post(uri, { equation: equation }.to_json,
'Content-Type' => 'application/json').then do |resp|
JSON.parse(resp.body)['token']
end
end

token = login('x^2 + sin(y*pi) + phi')

Quick Start

require 'net/http'
require 'json'

BASE = 'http://localhost'
TOKEN = 'your-jwt-token'

# 1. Browse operators — public, no auth
ops_data = JSON.parse(Net::HTTP.get(URI("#{BASE}/api/zeq/operators")))
ops_data['operators'].first(3).each do |op|
puts "#{op['id'].ljust(6)} #{op['name'].ljust(30)} #{op['equation']}"
end
# QM1 Schrödinger Equation iℏ ∂ψ/∂t = −ℏ²/2m ∂²ψ/∂x² + Vψ
# NM18 Newton's Second Law F = ma
# GR31 Einstein Field Equations G_μν + Λg_μν = 8πT_μν

# 2. HulyaPulse phase — no auth
phase = JSON.parse(Net::HTTP.get(URI("#{BASE}/api/zeq/phase")))
puts "Phase: #{phase['phase'].round(4)} KO42: #{phase['ko42'].round(6)}"

# 3. Execute operator — requires account
def api_post(path, body, token: nil)
uri = URI("#{BASE}#{path}")
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
req['Authorization'] = "Bearer #{token}" if token
req.body = body.to_json
Net::HTTP.start(uri.host, uri.port) { |h| h.request(req) }.then { |r| JSON.parse(r.body) }
end

result = api_post('/api/zeq/operators/execute?operator=NM21',
{ params: { G: 6.674e-11, m1: 5.97e24, m2: 7.35e22, r: 3.84e8 } },
token: TOKEN)
puts "F = #{result['value']} N"

# 4. 7-Step Wizard — requires account
state = api_post('/api/7step/run',
{ query: 'gravitational time dilation near Earth', operators: ['KO42', 'GR37'], mode: 'basic' },
token: TOKEN)
puts "Operators: #{state['selected_operators']}"
puts "Master sum: #{state['master_sum']}"

HulyaSync (Local)

require 'zeq_os'

sync = ZeqOS::HulyaSync.new

# All local — no server, no auth
puts "Phase: #{sync.current_phase.round(4)}"
puts "Zeqond: #{sync.get_zeqond}"
puts "KO42: #{sync.ko42_automatic.round(6)}"

# Zeq Equation: R(t) = S(t) × [1 + α·sin(2πft)]
puts "g mod: #{sync.modulate(9.80665).round(6)}"
puts sync.daemon_tick

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