[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81264":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":10,"openIssues":11,"contributorsCount":11,"subscribersCount":11,"size":11,"stars1d":11,"stars7d":11,"stars30d":11,"stars90d":11,"forks30d":11,"starsTrendScore":11,"compositeScore":12,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":13,"fork":13,"defaultBranch":14,"hasWiki":15,"hasPages":13,"topics":16,"createdAt":8,"pushedAt":8,"updatedAt":17,"readmeContent":18,"aiSummary":19,"trendingCount":11,"starSnapshotCount":11,"syncStatus":20,"lastSyncTime":21,"discoverSource":22},81264,"hantanet","loganbuilds7\u002Fhantanet","loganbuilds7",null,"TypeScript",50,0,34,false,"main",true,[],"2026-06-12 04:01:32","# HantaNet\n\nHantaNet is an ElizaOS agent that watches for hantavirus-related signals, generates public-health style risk analysis, posts recurring global heatmap updates, and replies to Twitter\u002FX mentions with location-specific hantavirus forecasts.\n\nThe project combines an OpenAI-backed character, the ElizaOS Twitter runtime, a custom `hantavirus` plugin, and an Obsidian Markdown persistence plugin for durable surveillance notes.\n\n## What It Does\n\n- Runs a HantaNet agent persona focused only on hantavirus, rodent reservoirs, outbreak surveillance, and DeSci disease monitoring.\n- Periodically synthesizes hantavirus research context with OpenAI.\n- Generates region-level risk data for a global hantavirus heatmap.\n- Creates a heatmap image with OpenAI image generation.\n- Uploads the generated image to Twitter\u002FX and publishes a scheduled risk-map tweet.\n- Watches Twitter\u002FX mentions, detects locations, and replies with short location-specific risk forecasts.\n- Feeds detected mention locations back into the next heatmap as live public-interest signals.\n- Accepts user-submitted `report:` field reports as unverified ecological signals.\n- Publishes a compact DeSci signal leaderboard in heatmap posts.\n- Stores mention signals and field reports in an Obsidian-compatible Markdown vault.\n- Keeps replies under tweet length and deduplicates mention responses through the Eliza runtime cache.\n\n## Core Pipeline\n\n```text\nElizaOS runtime\n  |\n  | loads src\u002Findex.ts project\n  v\nHantaNet character + plugins\n  |\n  | built-in plugins\n  | - SQL storage\n  | - OpenAI model provider\n  | - Bootstrap runtime\n  | - Twitter\u002FX integration\n  | - Obsidian Markdown persistence\n  |\n  | custom plugin\n  v\nsrc\u002Fplugins\u002Fhantavirus\n  |\n  | research provider\n  | - refreshes research context every 5 minutes\n  | - injects recent context into agent generations\n  |\n  | heatmap cron\n  | - generates region risk data\n  | - creates image with OpenAI image API\n  | - uploads media to Twitter\u002FX\n  | - publishes scheduled heatmap post\n  |\n  | mention diagnostics\n  | - searches for @HantaNet mentions\n  | - filters out self-authored tweets\n  | - detects locations with lists and GPT fallback\n  | - records mention locations for the next heatmap loop\n  | - parses \"report:\" submissions as unverified field reports\n  | - generates a location-specific risk reply\n  | - caches replied tweet IDs\n  |\n  | surveillance signals\n  | - writes mention-to-map location signals to Obsidian daily notes\n  | - writes unverified user field reports to Obsidian daily notes\n  | - generates DeSci signal leaderboard context for map tweets\n```\n\n## Project Structure\n\n```text\ncharacters\u002Fhantanet.json\n  HantaNet persona, voice, knowledge, topics, and response style.\n\nsrc\u002Findex.ts\n  ElizaOS project export. Registers SQL, OpenAI, Bootstrap, Twitter, Obsidian persistence, and the custom hantavirus plugin.\n\nsrc\u002Fcharacter.ts\n  Loads the HantaNet character JSON for the runtime.\n\nsrc\u002Fplugins\u002Fhantavirus\u002Findex.ts\n  Custom plugin registration. Wires actions, providers, and startup hooks.\n\nsrc\u002Fplugins\u002Fhantavirus\u002Fproviders\u002FresearchProvider.ts\n  Injects fresh hantavirus research context into the agent.\n\nsrc\u002Fplugins\u002Fhantavirus\u002Fservices\u002FresearchService.ts\n  Maintains the in-memory research cache and generates research\u002Frisk summaries with OpenAI.\n\nsrc\u002Fplugins\u002Fhantavirus\u002Fservices\u002FimageGeneration.ts\n  Generates the global heatmap image from region risk data.\n\nsrc\u002Fplugins\u002Fhantavirus\u002Factions\u002FheatmapTweet.ts\n  Runs the scheduled heatmap pipeline and posts the image tweet.\n\nsrc\u002Fplugins\u002Fhantavirus\u002Factions\u002FmentionResponder.ts\n  Detects locations in mentions and generates location-specific reply forecasts.\n\nsrc\u002Fplugins\u002Fhantavirus\u002Fservices\u002FtwitterMentionDiagnostics.ts\n  Polls Twitter\u002FX mentions, logs diagnostics, deduplicates replies, and sends direct replies.\n\nsrc\u002Fplugins\u002Fhantavirus\u002Fservices\u002FsurveillanceSignals.ts\n  Routes mention-to-map signals, user-submitted field reports, and leaderboard summaries through Obsidian persistence, with runtime cache fallback.\n\nsrc\u002Fplugins\u002FobsidianPersistence\u002Findex.ts\n  ElizaOS plugin and service for writing HantaNet surveillance entries into Obsidian-compatible Markdown daily notes.\n\necosystem.config.cjs\n  PM2 process definition for running the ElizaOS agent on a VM.\n```\n\n## Custom Plugin\n\nThe custom plugin lives in `src\u002Fplugins\u002Fhantavirus` and is registered as:\n\n```ts\nexport const hantavirusPlugin: Plugin = {\n  name: \"hantavirus\",\n  actions: [heatmapTweetAction, mentionResponderAction],\n  providers: [researchProvider],\n  init: async (_config, runtime) => {\n    void startHeatmapCron(runtime);\n    startTwitterMentionDiagnostics(runtime);\n  },\n};\n```\n\nThe project registers `obsidianPersistencePlugin` before `hantavirusPlugin` so surveillance data is written to Markdown as the durable source of truth.\n\n### Obsidian Persistence\n\nBy default, surveillance notes are stored in:\n\n```text\nobsidian-vault\u002FHantaNet\u002FSurveillance\u002FYYYY-MM-DD.md\n```\n\nEach daily note contains human-readable entries plus machine-readable JSON blocks for mention signals and field reports. The default `obsidian-vault\u002F` directory is ignored by git because it contains live operational data.\n\nSet a different vault path with:\n\n```bash\nOBSIDIAN_VAULT_PATH=.\u002Fobsidian-vault\n```\n\nIf the Obsidian service is unavailable, HantaNet logs a warning and falls back to runtime cache.\n\n### Research Provider\n\n`researchProvider` refreshes synthesized hantavirus research every five minutes and injects the latest context into the agent. The prompt biases generation toward concrete mechanisms like reservoir movement, seasonal exposure, rodent ecology, surveillance lag, and DeSci monitoring.\n\n### Heatmap Tweet Action\n\nThe heatmap pipeline:\n\n1. Generates current region-level risk data with OpenAI.\n2. Pulls mention-to-map hotspots, unverified field reports, and the DeSci signal leaderboard from Obsidian daily notes.\n3. Sends research context plus live signal context into the risk-data prompt.\n4. Sends that risk data into the image-generation prompt.\n5. Uploads the image through Twitter\u002FX OAuth 1.0a media upload.\n6. Posts a tweet with the uploaded media ID and compact DeSci signal leaderboard.\n7. Repeats on `HEATMAP_INTERVAL_MINUTES`.\n\n### Mention-To-Map Loop\n\nEvery mention with a detected location is stored as a public-interest signal. The next heatmap generation includes the highest-frequency mention locations so repeated questions about a region can slightly raise map attention without being treated as confirmed case data.\n\n### User Field Reports\n\nUsers can submit unverified ecological observations with:\n\n```text\n@HantaNet report: rodent droppings in a shed near Boulder, Colorado\n```\n\nHantaNet records the report in the current Obsidian daily note, replies with an acknowledgement, and feeds the signal into the next heatmap and leaderboard. Field reports are explicitly labeled as unverified and must not be interpreted as confirmed cases.\n\n### DeSci Signal Leaderboard\n\nThe leaderboard ranks locations by live mentions and field reports. Field reports receive extra weight because they describe direct environmental observations, but the generated copy labels them as unverified ecological signals.\n\n### Mention Responder\n\nThe mention pipeline:\n\n1. Reads incoming mention text.\n2. Looks for known US states, state abbreviations, countries, and major cities.\n3. Falls back to OpenAI location extraction if no quick match is found.\n4. Generates a short risk forecast for that location.\n5. Replies through the Twitter plugin callback or diagnostic service.\n\n### Mention Diagnostics\n\n`twitterMentionDiagnostics` polls for `@username` mentions, prints useful runtime logs, filters out the bot's own tweets, and stores `hantanet\u002Ftwitter\u002Fmention-replied\u002F\u003CtweetId>` cache keys so the same tweet is not answered repeatedly.\n\n## Environment\n\nCreate a `.env` from the template:\n\n```bash\ncp .env.example .env\n```\n\nRequired values:\n\n```bash\nOPENAI_API_KEY=\nOPENAI_LARGE_MODEL=gpt-5.5\nOPENAI_SMALL_MODEL=gpt-5.5\n\nTWITTER_API_KEY=\nTWITTER_API_SECRET_KEY=\nTWITTER_ACCESS_TOKEN=\nTWITTER_ACCESS_TOKEN_SECRET=\n```\n\nRuntime controls:\n\n```bash\nTWITTER_ENABLE_POST=true\nTWITTER_POST_INTERVAL_MIN=15\nTWITTER_POST_INTERVAL_MAX=30\nTWITTER_SEARCH_ENABLE=true\nTWITTER_AUTO_RESPOND_MENTIONS=true\nTWITTER_POLL_INTERVAL=30\nTWITTER_DRY_RUN=false\n\nHEATMAP_INTERVAL_MINUTES=60\nHANTANET_MENTION_DIAGNOSTIC_INTERVAL_MS=60000\nOBSIDIAN_VAULT_PATH=.\u002Fobsidian-vault\n```\n\nNever commit `.env`. The repository intentionally tracks `.env.example` only.\n\n## Local Development\n\nInstall dependencies:\n\n```bash\nnpm install\n```\n\nBuild TypeScript:\n\n```bash\nnpm run build\n```\n\nRun the Obsidian persistence checks:\n\n```bash\nnpm run test:obsidian\n```\n\nRun through ElizaOS:\n\n```bash\n.\u002Fnode_modules\u002F.bin\u002Felizaos start\n```\n\nIf the CLI was installed with a Bun shebang, this also works:\n\n```bash\n\u002Fhome\u002Fubuntu\u002F.bun\u002Fbin\u002Fbun .\u002Fnode_modules\u002F.bin\u002Felizaos start\n```\n\n## VM Deployment With PM2\n\nThe production process should run the ElizaOS CLI, not `node dist\u002Findex.js`. The compiled `dist\u002Findex.js` exports the ElizaOS project; the ElizaOS runtime is what actually starts the agent.\n\nRecommended PM2 config:\n\n```js\nmodule.exports = {\n  apps: [\n    {\n      name: \"hantanet\",\n      cwd: \"\u002Fhome\u002Fubuntu\u002Fhantanet\",\n      script: \"\u002Fhome\u002Fubuntu\u002F.bun\u002Fbin\u002Fbun\",\n      args: \".\u002Fnode_modules\u002F.bin\u002Felizaos start\",\n      interpreter: \"none\",\n      exec_mode: \"fork\",\n      instances: 1,\n      autorestart: true,\n      max_memory_restart: \"500M\",\n      env: {\n        NODE_ENV: \"production\",\n        PATH: \"\u002Fhome\u002Fubuntu\u002F.bun\u002Fbin:\u002Fusr\u002Flocal\u002Fbin:\u002Fusr\u002Fbin:\u002Fbin\",\n      },\n      error_file: \"logs\u002Ferror.log\",\n      out_file: \"logs\u002Fout.log\",\n      log_date_format: \"YYYY-MM-DD HH:mm:ss\",\n    },\n  ],\n};\n```\n\nStart or restart:\n\n```bash\nmkdir -p logs\npm2 delete hantanet\npm2 start ecosystem.config.cjs --update-env\npm2 logs hantanet --lines 100\n```\n\nPersist across reboot:\n\n```bash\npm2 save\npm2 startup\n```\n\nRun the command printed by `pm2 startup`, then:\n\n```bash\npm2 save\n```\n\n## Expected Logs\n\nWhen the runtime is wired correctly, logs should include messages like:\n\n```text\n[HantaNet:Research] Refreshing hantavirus research data...\n[HantaNet:Heatmap] Starting heatmap cron...\n[HantaNet:Heatmap] Generating hourly heatmap...\n[HantaNet:MentionDiag] Checking Twitter mentions...\n```\n\nIf PM2 shows the process as online but logs stay empty, confirm PM2 is running the ElizaOS CLI through Bun instead of running `dist\u002Findex.js` directly.\n\n## Operational Notes\n\n- Use Node 22 on the VM.\n- Use Bun when running the ElizaOS CLI if the installed binary has a Bun shebang.\n- Keep `.env` off GitHub.\n- Rotate API keys immediately if they are pasted into logs, chats, screenshots, or issue trackers.\n- Use `TWITTER_DRY_RUN=true` while testing credentials and startup behavior.\n- Watch `pm2 logs hantanet` after every deploy to confirm the Twitter client becomes ready before mention polling starts.\n\n## Commands\n\n```bash\nnpm run build\npm2 start ecosystem.config.cjs --update-env\npm2 restart hantanet --update-env\npm2 logs hantanet --lines 100\npm2 status hantanet\npm2 save\n```\n","HantaNet 是一个专注于汉坦病毒监测与预警的ElizaOS代理。它能够监控与汉坦病毒相关的信号，生成公共卫生风格的风险分析，并定期更新全球热图。此外，HantaNet还能回应Twitter\u002FX上的提及，提供基于地理位置的汉坦病毒预测。该项目利用了OpenAI支持的角色、ElizaOS Twitter运行时、自定义`hantavirus`插件以及Obsidian Markdown持久化插件来存储监控笔记。适用于需要进行疾病监测尤其是汉坦病毒感染风险评估的公共卫生场景，以及对科学研究感兴趣的公众参与活动。",2,"2026-06-01 03:54:09","CREATED_QUERY"]