New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@alexar76/dioscuri

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alexar76/dioscuri

DIOSCURI — one mind, two heavens. Twin community agents for the AICOM ecosystem: CASTOR rides Telegram, POLLUX holds Discord. Shared self-updating knowledge base (MNEMOSYNE, synced from GitHub) behind a prompt-injection firewall and moderation shield (AEG

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

DIOSCURI — one mind, two heavens

npm Release CI License: MIT Node TypeScript

Русская версия: README-ru.md · Операторский раннбук (RU): docs/runbook-ru.md

In the myth, the twins split one immortality between two skies, forever pointing at each other's world. CASTOR, the mortal twin, rides Telegram — fast, grounded, practical. POLLUX, the immortal twin, holds Discord — deep, calm, structured. One shared memory — MNEMOSYNE, self-syncing from GitHub; one shared shield — AEGIS.

Landing: alexar76.github.io/dioscuri · mirror: modeldev.modelmarket.dev/dioscuri

Source of truth: landing/index.html — mirrored to repo root index.html on publish for Settings → Pages → Deploy from branch → main / (root).

Why it exists

DIOSCURI are the community agents of the AICOM ecosystem — AI Factory, AIMarket agent economy, verifiable oracles, the ARGUS agent. They answer questions from a continuously synced knowledge base, moderate with strict ceilings, and announce releases across both platforms — while serving as a reference deployment of the ecosystem's security practices on a public, hostile input surface: every message and every synced document is treated as a potential prompt-injection attempt.

Features

FeatureWhat it means
Twin personas + cross-promotionOne process, two voices; each twin naturally points at his brother's channel (rotating promo lines, release fan-out)
Self-updating knowledge baseMNEMOSYNE syncs READMEs, releases, repo metadata and a 14-day recent-commits digest per repo from GitHub with ETag-aware fetching and poisoned-document filtering on ingestion — the twins discuss what shipped yesterday, not just what made a release
Live project showcaseRead-only polling of the ecosystem's public demo endpoints feeds minutes-old LIVE status snapshots into the knowledge base — "what's running right now?" is answered with facts (config-driven showcase.sources; secret-looking JSON keys never ingested)
Tool-less Q&A brainRetrieval is deterministic and happens before the model call; the model can only produce text — the public path executes nothing by construction
Layered injection firewall (EN + RU)NFKC normalisation, control/zero-width stripping, marker neutralisation, bilingual signature detection, fenced-data prompting, output guard
Deterministic-first moderationHard rules decide; the LLM classifier is advisory-only. Action ceiling: warn / delete / timeout (≤10 min default) / escalate — no automatic bans, ever
Hash-chained auditEvery consequential act is appended to audit.jsonl; each entry commits to its predecessor via SHA-256; verify() pinpoints the first tampered line
Cost & rate guardsPer-user and per-channel rate limits plus a daily LLM call budget
Language mirroringReplies in the language of the question (Russian → Russian); defaults to English when unsure
Docker-hardenedNon-root, read-only rootfs, cap_drop: ALL, no-new-privileges, memory/CPU limits, healthcheck
KERYX syndication (post-only)Release announcements fan out to Bluesky / Mastodon (free, bot-friendly) and optionally X (explicit pay-per-use opt-in); monthly digest article on dev.to; Discord announcements auto-publish so other servers can Follow them; DISBOARD bump reminder for mods (never auto-bumps). No engagement automation anywhere — publishing to own accounts only

Quick start (npm)

npm install -g @alexar76/dioscuri
cp dioscuri.config.example.json dioscuri.config.json
cp .env.example .env
dioscuri

No tokens yet? DIOSCURI_DRY_RUN=1 dioscuri boots KB + health with adapters off.

Quick start (Docker)

cp dioscuri.config.example.json dioscuri.config.json   # then edit to taste
cp .env.example .env                                    # add your secrets
docker compose up -d --build

Then check http://localhost:8790/health. Either platform token may be left empty — the corresponding twin simply stays asleep.

Quick start (local dev)

npm ci
cp dioscuri.config.example.json dioscuri.config.json
cp .env.example .env
npm run dev

No tokens yet? DIOSCURI_DRY_RUN=1 npm run dev boots the whole service with zero tokens: adapters stay off, the knowledge base and the health endpoint run.

Configuration

Secrets live in the environment (.env); non-secret tuning lives in dioscuri.config.json (mounted read-only in Docker). Secrets never go in the JSON file.

Environment variables (.env.example)

VariablePurposeDefault
TELEGRAM_BOT_TOKENCastor's bot token; empty = Telegram twin asleep—
TELEGRAM_CHAT_IDMain Telegram chat/channel for announcements—
DISCORD_BOT_TOKENPollux's bot token; empty = Discord twin asleep—
DISCORD_GUILD_IDThe Discord server (guild) to operate in—
DISCORD_MOD_LOG_CHANNEL_IDChannel receiving moderation-action logs—
DISCORD_ANNOUNCE_CHANNEL_IDChannel for releases and promo posts—
DIOSCURI_LLM_PROVIDERdeepseek | anthropic | openai-compatibledeepseek
DEEPSEEK_API_KEYAPI key when provider is deepseek—
ANTHROPIC_API_KEYAPI key when provider is anthropic—
DIOSCURI_LLM_API_KEYAPI key for openai-compatible endpoints—
DIOSCURI_LLM_MODELModel overrideper provider
DIOSCURI_LLM_BASE_URLEndpoint overrideper provider
DIOSCURI_LLM_TIMEOUT_MSLLM request timeout30000
GITHUB_TOKENOptional read-only PAT; raises GitHub API limits 60/h → 5000/h—
DIOSCURI_HTTP_PORTHealth endpoint port8790
DIOSCURI_DATA_DIRWritable state dir (audit chain, KB cache)./data (/data in Docker)
DIOSCURI_LOG_LEVELdebug | info | warn | errorinfo
DIOSCURI_CONFIGPath to the tuning JSONdioscuri.config.json
DIOSCURI_DRY_RUN1 = no tokens needed; KB + health onlyoff
TELEGRAM_DISABLED / DISCORD_DISABLED1 = force one twin asleepoff

Tuning file (dioscuri.config.json)

KeyPurposeDefault
githubOwnerGitHub owner whose repos feed MNEMOSYNEalexar76
githubReposExplicit repo allowlist; empty = all public repos of the owner[]
kbSyncIntervalMinMinutes between knowledge-base sync passes30
promoIntervalHoursHours between cross-promo posts (jittered ±20%); 0 disables12
maxLlmCallsPerDayMax Q&A LLM calls per UTC day (cost guard)2000
userRatePerMinPer-user Q&A messages per minute4
channelRatePerMinPer-channel Q&A messages per minute (global flood valve)20
moderation.enabledMaster switch for moderationtrue
moderation.llmClassifierRun the LLM classifier (only after deterministic risk signals fire)true
moderation.deleteConfidenceClassifier confidence floor before a delete is allowed0.8
moderation.maxTimeoutMsHard ceiling for automatic timeouts600000 (10 min)
moderation.linkAllowlistDomains allowed in links; empty = allow all except denylist[]
moderation.linkDenylistDomains always treated as hostileshorteners/loggers
links.discordInviteOfficial Discord invite (the only one the twins may post)—
links.telegramChannelOfficial Telegram channel link—
links.siteUrlEcosystem sitehttps://magic-ai-factory.com
links.githubOrgEcosystem GitHubhttps://github.com/alexar76

Architecture

flowchart TD
    TG["Telegram (grammY)"] --> CA["CASTOR adapter"]
    DS["Discord (discord.js)"] --> PX["POLLUX adapter"]
    CA -- "raw messages = UNTRUSTED" --> CORE["MODERATION — deterministic rules first, LLM advisory-only<br/>BRAIN — tool-less Q&A"]
    PX -- "raw messages = UNTRUSTED" --> CORE
    CORE --> AE["AEGIS — sanitize + firewall"]
    CORE --> KB["MNEMOSYNE — KB self-synced from GitHub"]
    AE -- "fenced DATA prompt" --> LLM["LLM client — deepseek / anthropic / openai-compat"]
    KB -- "fenced DATA prompt" --> LLM
    subgraph RAILS["Side rails"]
        HL["HEALTH — GET /health :8790 (liveness + KB stats)"]
        AU["AUDIT — /data/audit.jsonl (SHA-256 hash chain + verify)"]
    end
    CORE -.-> AU

All modules talk through the interfaces in src/types.ts and are wired together by dependency injection in src/index.ts. Details: docs/architecture.md.

Documentation

DocumentWhat it covers
docs/runbook.mdOperator runbook — 10-minute quick start, tokens, day-2 operations, troubleshooting (RU version)
docs/setup.mdFull setup & deployment — tokens, environment, Docker, first boot
docs/usage.mdOperator's manual — day-to-day operation, commands, tuning
docs/use-cases.mdScenarios — what the twins handle in practice
docs/architecture.mdModule graph, DI wiring, the five data flows, boot sequence, deployment topology
docs/security.mdThreat model, the ten defense layers, honest residual risks
docs/content-plan.mdTHEOXENIA content & marketing plan — positioning, pillars, calendar

Security model

Ten layers, from Unicode scrubbing to container hardening — the short version:

  • Every untrusted text (chat message, GitHub doc) is sanitised (NFKC, control/zero-width strip, marker neutralisation).
  • A bilingual (EN+RU) signature firewall rejects known injection phrasings before any model call.
  • What survives is fenced as DATA in the prompt — the system prompt forbids obeying it.
  • The public Q&A path has no tools; the model can only produce text.
  • Moderation actions have a hard ceiling — warn/delete/timeout/escalate; ban is not in the action space.
  • Everything consequential lands in a hash-chained, tamper-evident audit log.

Full threat model, layer-by-layer mapping to code and honest residual risks: docs/security.md.

Ecosystem: Landing · magic-ai-factory.com · Alien Monitor (DIOSCURI graph node) · github.com/alexar76/dioscuri · integration guide

Part of the AICOM ecosystem — magic-ai-factory.com · github.com/alexar76

Keywords

discord-bot

FAQs

Package last updated on 06 Jul 2026

Related posts