Gateway

Gateway क्या है?

Gateway Neotask का heart है, एक single long-running service जो सभी agent sessions, messaging channels, tool execution, और device connections manage करती है। सब कुछ Gateway के माध्यम से होता है।

यह एक WebSocket server है जो clients (desktop app, mobile apps, web dashboard) से connections के लिए listen करता है और पूरे AI assistant lifecycle को manage करता है।

Architecture

Components

Binding Modes

Mode विवरण
Loopback Default। केवल localhost (127.0.0.1) से accessible
LAN आपके local network पर accessible। Bonjour/mDNS के माध्यम से Auto-discoverable
Tailnet MagicDNS के साथ Tailscale VPN के माध्यम से accessible
Custom एक specific address पर Bind करें

Authentication

Method विवरण
Token WebSocket bearer token (UUID या custom string)
Password Password-based auth (bcrypt hashed)
Trusted Proxy Pre-auth headers वाले reverse proxies के लिए
Local Trust Loopback connections auto-approved

Configuration

Gateway neotask.json (JSON5 format) के माध्यम से configure होता है। Key sections:

Section Controls
agents Agent list, defaults, workspaces
gateway Port, bind mode, auth, reload behavior
channels Per-channel config और credentials
tools Tool permissions, profiles, security
plugins Plugin loading, enabling, per-plugin config
models Provider auth, fallbacks, provider settings
skills Skill directories, per-skill configuration
browser Browser profiles, ports, headless mode
cron Scheduler configuration
session Reset rules, compaction thresholds
messages TTS settings, media policies
memory Memory indexing configuration
security Sandboxing, elevated mode, approvals

Hot Reload

Configuration changes बिना restart किए apply की जा सकती हैं:

Mode Behavior
Hybrid (default) Safe changes hot-apply करें, बाकियों के लिए restart
Hot केवल hot-safe changes apply करें, बाकियों को ignore करें
Restart किसी भी reload-required change पर restart
Off कोई automatic reload नहीं

Remote Access

Tailscale secure, zero-config remote access provide करता है:

SSH Tunnel

SSH के माध्यम से Gateway port forward करें:

Security Rules

Health Monitoring

Health Endpoint

/health HTTP endpoint return करता है:

Probes

Discovery

Bonjour/mDNS

LAN से bound होने पर, Gateway multicast DNS के माध्यम से खुद को advertise करता है:

Wide-Area Discovery

Configurable timeouts के साथ अपने network में gateways discover करें। Local Bonjour और Tailscale DNS discovery दोनों support करता है।

Multiple Gateways

आप profiles का उपयोग करके same machine पर multiple Gateway instances run कर सकते हैं:

Diagnostics

Doctor

Built-in diagnostic tool check करता है:

यह permission दिए जाने पर कई issues automatically fix कर सकता है।

Logging

Gateway logs daily JSONL files में लिखे जाते हैं: