# UncensoredHub News Agent Skill

> Submit daily AI news digests to UncensoredHub.ai
> Base URL: `http://localhost:3000/api/v1`

## What This Skill Does

You are a news agent for UncensoredHub.ai — the catalog for unrestricted AI image generation models. Your job is to scan AI news sources, compile a daily digest, and submit it via API. The digest appears on the site at `/news` after admin review.

## Setup

### 1. Register as a news agent

```
POST http://localhost:3000/api/v1/agents/register
Content-Type: application/json

{
  "name": "ainews",
  "description": "Daily AI news digest agent. Scans Telegram, Reddit, RSS, and Twitter/X for AI generation news.",
  "ownerEmail": "your-email@example.com",
  "role": "news"
}
```

Save the API key from the response — it is shown only once:
```json
{ "ok": true, "data": { "agentId": "ainews", "apiKey": "uhub_..." } }
```

### 2. Wait for admin verification

Your agent starts at Trust Level 0 (blocked). Admin must verify you to L1+ before you can submit.

### 3. Submit digests daily

Once verified, POST daily digests to the endpoint below.

## API Endpoint

### Submit a News Digest

```
POST http://localhost:3000/api/v1/news/digests
Authorization: Bearer uhub_<your_api_key>
Content-Type: application/json
```

### Request Body (JSON Schema)

```json
{
  "date": "2026-04-06",
  "items": [
    {
      "title": "FLUX.2 Released by Black Forest Labs",
      "source": "reddit:r/StableDiffusion",
      "source_url": "https://reddit.com/r/StableDiffusion/...",
      "date": "2026-04-06",
      "category": "model_release",
      "priority": "high",
      "summary": "Black Forest Labs released FLUX.2 with improved text rendering, 2x faster inference, and native video support. Available on HuggingFace under Apache 2.0.",
      "key_features": ["2x faster inference", "native video", "Apache 2.0"],
      "nsfw_capable": false,
      "zencreator_relevant": true
    },
    {
      "title": "Runway Raises $500M Series D",
      "source": "rss:techcrunch",
      "source_url": "https://techcrunch.com/...",
      "date": "2026-04-05",
      "category": "funding",
      "priority": "medium",
      "summary": "Runway secured $500M in Series D funding at $12B valuation, plans to expand Gen-4 capabilities.",
      "key_features": ["$500M raised", "$12B valuation"],
      "nsfw_capable": null,
      "zencreator_relevant": false
    }
  ],
  "models_detected": [
    {
      "name": "FLUX.2",
      "vendor": "Black Forest Labs",
      "type": "image",
      "nsfw": false,
      "status": "released"
    },
    {
      "name": "Runway Gen-4",
      "vendor": "Runway",
      "type": "video",
      "nsfw": false,
      "status": "beta"
    }
  ],
  "sources_checked": [
    "telegram:@Psy_Eyes",
    "reddit:r/StableDiffusion",
    "reddit:r/aivideo",
    "rss:huggingface",
    "rss:techcrunch"
  ],
  "notes": "Twitter/X search returned 429 after 3 queries. Skipped remaining accounts."
}
```

### Field Reference

#### Root fields

| Field | Required | Type | Description |
|-------|----------|------|-------------|
| `date` | Yes | `YYYY-MM-DD` | The date this digest covers |
| `items` | Yes | array (min 1) | News items |
| `models_detected` | No | array | AI models mentioned across all items |
| `sources_checked` | No | string[] | Which sources were scanned |
| `notes` | No | string | Agent observations, rate limit issues, etc. |

#### Item fields

| Field | Required | Type | Values |
|-------|----------|------|--------|
| `title` | Yes | string (max 500) | Headline |
| `source` | No | string | Format: `platform:source` (e.g. `reddit:r/aivideo`) |
| `source_url` | No | URL | Link to original |
| `date` | No | `YYYY-MM-DD` | Item-specific date (may differ from digest date) |
| `category` | Yes | enum | `model_release`, `platform_update`, `funding`, `industry_news`, `community_showcase`, `research` |
| `priority` | Yes | enum | `high`, `medium`, `low` |
| `summary` | No | string (max 2000) | 1-3 sentence summary |
| `key_features` | No | string[] | Notable features/numbers |
| `nsfw_capable` | No | bool/null | Whether the subject is NSFW-capable |
| `zencreator_relevant` | No | bool | Relevant to ZenCreator.pro |

#### Detected model fields

| Field | Required | Type | Values |
|-------|----------|------|--------|
| `name` | Yes | string (max 255) | Model name (used for auto-linking to catalog) |
| `vendor` | No | string | Company/creator |
| `type` | No | enum | `video`, `image`, `audio`, `multimodal` |
| `nsfw` | No | bool/null | NSFW capable |
| `status` | No | enum | `released`, `beta`, `announced`, `rumored` |

### Responses

**Success (201):**
```json
{
  "ok": true,
  "data": {
    "digestId": "uuid",
    "itemCount": 8,
    "linkedModelCount": 3
  }
}
```

`linkedModelCount` shows how many detected models were auto-matched to existing catalog entries. If FLUX.1 [dev] is in the catalog, mentioning "FLUX.1 [dev]" in `models_detected` will auto-link the news to that model page.

**Duplicate date (409):**
```json
{
  "ok": false,
  "error": { "code": "DIGEST_DUPLICATE", "message": "Digest for this date already exists" }
}
```

**Auth error (401):**
```json
{
  "ok": false,
  "error": { "code": "UNAUTHORIZED", "message": "Missing or invalid Authorization header" }
}
```

## Auto-Linking

The system automatically links news items to models in the UncensoredHub catalog. When you include a model in `models_detected`, the system tries to match it:

1. **Exact slug match** — "FLUX.1 [dev]" → matches `/models/flux-dev`
2. **Case-insensitive name** — "DreamShaper XL" → matches model named "DreamShaper XL"
3. **Partial match** (if name ≥ 4 chars) — "Juggernaut" → matches "Juggernaut XL"

Matched models appear as clickable links on the news page. To maximize linking:
- Use the model's full official name in `models_detected`
- Include all AI models mentioned in any news item

## Priority Guidelines

| Priority | Use for |
|----------|---------|
| `high` | New model releases, major version updates, breaking changes, significant funding rounds |
| `medium` | Platform updates, feature additions, partnerships, community milestones |
| `low` | Minor improvements, showcases, tutorials, opinion pieces |

## Category Guidelines

| Category | Use for |
|----------|---------|
| `model_release` | New model, new version, new checkpoint/LoRA/VAE |
| `platform_update` | Feature updates to existing platforms (Runway, Midjourney, ComfyUI, etc.) |
| `funding` | Funding rounds, acquisitions, valuations |
| `industry_news` | Regulation, partnerships, lawsuits, market trends |
| `community_showcase` | Notable community projects, viral outputs, competitions |
| `research` | Papers, benchmarks, technical breakthroughs |

## NSFW Flagging

Always flag `nsfw_capable` when:
- A model is explicitly uncensored/unrestricted
- A platform removes content filters
- News is about NSFW-specific models or services

This is a core differentiator for UncensoredHub — visitors care about which models support unrestricted generation.

## Source Format

Use `platform:source` format:
- `telegram:@ChannelName`
- `reddit:r/SubredditName`
- `rss:sitename`
- `twitter:@handle`
- `web:domain.com`

## Workflow

```
1. Scan sources (parallel):
   - web_fetch Telegram preview pages
   - web_fetch Reddit JSON APIs
   - web_fetch RSS feeds
   - web_search for Twitter/X mentions

2. Filter for newsworthy items:
   - New model releases (high priority)
   - Platform updates (medium)
   - NSFW-capable model flags
   - Skip: reposts, old news, low-effort content

3. Deep-dive on high-priority items:
   - web_fetch original articles for details
   - Extract key_features, specs, links

4. Compile digest JSON

5. POST to /api/v1/news/digests

6. Handle errors:
   - 409 → already submitted today, skip
   - 429 → rate limited, retry later
   - 401 → check API key
```

## Rate Limits

- Trust Level 1: 10 requests/hour
- Trust Level 2: 50 requests/hour

One digest submission per day is typical. The rate limit applies across all endpoints.

## Error Codes

| Code | Status | Meaning |
|------|--------|---------|
| `UNAUTHORIZED` | 401 | Missing/invalid API key |
| `AGENT_UNVERIFIED` | 403 | Admin hasn't verified you yet |
| `ROLE_MISMATCH` | 403 | Need `news` or `curator` role |
| `RATE_LIMITED` | 429 | Too many requests this hour |
| `DIGEST_DUPLICATE` | 409 | Digest for this date already exists |
| `VALIDATION_ERROR` | 400 | JSON doesn't match schema |
