Skip to content

Gateway

Gateway என்பது Triggerfish இன் மத்திய control plane -- ஒரே WebSocket endpoint மூலம் sessions, channels, tools, events மற்றும் agent processes ஐ ஒருங்கிணைக்கும் நீண்ட நேரம் இயங்கும் உள்ளூர் service. Triggerfish இல் நடக்கும் எல்லாமே Gateway வழியாக ஓடுகிறது.

Architecture

Gateway architecture: channels on the left connect through the central Gateway to services on the right

Gateway கட்டமைக்கக்கூடிய port இல் கேட்கிறது (இயல்புநிலை 18789) மற்றும் channel adapters, CLI கட்டளைகள், companion apps மற்றும் உள் services இலிருந்து connections ஏற்கிறது. அனைத்து communication ம் WebSocket மூலம் JSON-RPC பயன்படுத்துகிறது.

Gateway Services

Gateway அதன் WebSocket மற்றும் HTTP endpoints மூலம் இந்த services வழங்குகிறது:

Serviceவிளக்கம்பாதுகாப்பு Integration
Sessionsஉருவாக்கு, பட்டியலிடு, வரலாறு பெறு, sessions இடையே அனுப்பு, background tasks spawnSession taint per-session கண்காணிக்கப்படுகிறது
Channelsசெய்திகளை route செய், connections நிர்வகி, தோல்வியடைந்த deliveries மீண்டும் முயற்சிஅனைத்து output இல் வகைப்படுத்தல் சரிபார்ப்பு
Cronமீண்டும் வரும் tasks திட்டமிட்டு TRIGGER.md இலிருந்து trigger wakeupsCron செயல்கள் policy hooks வழியாக செல்கின்றன
WebhooksPOST /webhooks/:sourceId மூலம் வெளிப்புற services இலிருந்து inbound events ஏற்குInbound தரவு ingestion இல் வகைப்படுத்தப்படுகிறது
RippleChannels முழுவதும் online நிலை மற்றும் typing indicators கண்காணிமுக்கியமான தரவு வெளிப்படுத்தப்படவில்லை
ConfigRestart இல்லாமல் settings hot-reloadEnterprise இல் Admin-only
Control UIGateway health மற்றும் management க்கான web dashboardToken-authenticated
Tide PoolAgent-driven A2UI visual workspace host செய்உள்ளடக்கம் output hooks க்கு உட்பட்டது
NotificationsPriority routing உடன் cross-channel notification deliveryவகைப்படுத்தல் விதிகள் பொருந்தும்

WebSocket JSON-RPC Protocol

Clients Gateway உடன் WebSocket மூலம் இணைந்து JSON-RPC 2.0 செய்திகளை பரிமாறுகின்றன. ஒவ்வொரு செய்தியும் typed parameters மற்றும் typed response உடன் method அழைப்பு.

typescript
// Client அனுப்புகிறது:
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sessions.list",
  "params": { "filter": "active" }
}

// Gateway பதில் அனுப்புகிறது:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    { "id": "sess_abc", "taint": "CONFIDENTIAL", "channel": "telegram" },
    { "id": "sess_def", "taint": "PUBLIC", "channel": "cli" }
  ]
}

Gateway webhook ingestion க்காக HTTP endpoints ம் serve செய்கிறது. SchedulerService இணைக்கப்பட்டிருக்கும்போது, inbound webhook events க்காக POST /webhooks/:sourceId routes கிடைக்கும்.

Authentication

Gateway connections ஒரு token உடன் authenticated ஆகின்றன. Token setup போது உருவாக்கப்படுகிறது (triggerfish dive) மற்றும் உள்ளூரில் சேமிக்கப்படுகிறது.

SECURITY Gateway இயல்பாக 127.0.0.1 க்கு bind ஆகிறது மற்றும் network க்கு வெளிப்படுத்தப்படவில்லை. Remote அணுகல் வெளிப்படையான tunnel கட்டமைப்பு தேவைப்படுகிறது. authentication இல்லாமல் Gateway WebSocket ஐ ஒருபோதும் public internet க்கு வெளிப்படுத்தாதீர்கள். :::

Session நிர்வாகம்

Gateway sessions இன் முழு lifecycle ஐ நிர்வகிக்கிறது. Sessions என்பது உரையாடல் நிலையின் அடிப்படை அலகு, ஒவ்வொன்றும் சுயாதீன taint கண்காணிப்புடன்.

Session வகைகள்

வகைவிசை Patternவிளக்கம்
MainmainOwner உடன் முதன்மை நேரடி உரையாடல். Restarts முழுவதும் நிலைத்திருக்கும்.
Channelchannel:<type>:<id>இணைக்கப்பட்ட சேனலுக்கு ஒன்று. சேனலுக்கு per தனிமைப்படுத்தப்பட்ட taint.
Backgroundbg:<task_id>Cron jobs மற்றும் webhook-triggered tasks க்கு spawn. PUBLIC taint இல் தொடங்கும்.
Agentagent:<agent_id>Multi-agent routing க்கான Per-agent sessions.
Groupgroup:<channel>:<group_id>Group chat sessions.

Notification Service

Gateway ஒரு first-class notification service ஐ ஒருங்கிணைக்கிறது, இது தளம் முழுவதும் ad-hoc "notify owner" patterns ஐ மாற்றுகிறது. அனைத்து notifications ம் ஒரே NotificationService மூலம் ஓடுகின்றன.

Priority Routing

Priorityநடத்தை
CRITICALQuiet hours bypass செய், உடனடியாக அனைத்து connected channels க்கும் deliver
HIGHPreferred channel க்கு உடனடியாக deliver, offline என்றால் queue
NORMALActive session க்கு deliver, அல்லது அடுத்த session start க்காக queue
LOWQueue செய், active sessions போது batches இல் deliver

Notification மூலங்கள்

மூலம்வகைஇயல்புநிலை Priority
Policy violationssecurityCRITICAL
Threat intelligence alertssecurityCRITICAL
Skill approval requestsapprovalHIGH
Cron job failuressystemHIGH
System health warningssystemHIGH
Webhook event triggersinfoNORMAL
The Reef updates availableinfoLOW

Scheduler Integration

Gateway scheduler service ஐ host செய்கிறது, இது நிர்வகிக்கிறது:

  • Cron tick loop: திட்டமிட்ட tasks இன் periodic மதிப்பீடு
  • Trigger wakeups: TRIGGER.md இல் வரையறுக்கப்பட்ட agent wakeups
  • Webhook HTTP endpoints: Inbound events க்காக POST /webhooks/:sourceId
  • Orchestrator தனிமைப்படுத்தல்: ஒவ்வொரு திட்டமிட்ட task அதன் சொந்த OrchestratorFactory இல் தனிமைப்படுத்தப்பட்ட session நிலையுடன் இயங்குகிறது

Cron-triggered மற்றும் webhook-triggered tasks புதிய PUBLIC taint உடன் background sessions spawn செய்கின்றன. அவை ஏதோ ஒரு session இன் taint ஐ வாரிசாக பெறுவதில்லை, சுயாதீன tasks சுத்தமான வகைப்படுத்தல் நிலையில் தொடங்குவதை உறுதிப்படுத்துகிறது. :::

Health மற்றும் Diagnostics

triggerfish patrol கட்டளை Gateway உடன் இணைந்து diagnostic health checks இயக்குகிறது, சரிபார்க்கிறது:

  • Gateway இயங்குகிறது மற்றும் பதில் அளிக்கிறது
  • அனைத்து கட்டமைக்கப்பட்ட channels இணைக்கப்பட்டுள்ளன
  • Storage அணுக்கூடியது
  • திட்டமிட்ட tasks நேரத்தில் செயல்படுகின்றன
  • Deliver செய்யப்படாத critical notifications queue இல் சிக்கவில்லை