manifest: qloops.loop/v1

# Condense a source feed into a readable update so the user does not need to review every item manually.
# OpenRouter example: configure the model explicitly. CLI acceptance uses the caller interface.

id: content-feed
name: "Content feed: the morning digest"
version: 1.1.0
description: >
  Reads a feed every morning, writes a short digest, and sends it.
  No human gate. Repeated runs can redeliver; receiver-side deduplication must be configured separately.
owner: oleg
enabled: true

triggers:
  - kind: schedule
    cron: "30 6 * * *"
  - kind: manual

settings:

  budgetUsd: 0.10

steps:
  - id: cf-fetch
    kind: fetch
    config:
      name: "Fetch feed"
      url: "{{env.QLOOP_SOURCE_URL}}"
      format: rss
      limit: "8"
      timeoutSec: "30"

  - id: cf-digest
    kind: llm-call
    config:
      name: "Write digest"
      role: editor
      maxTokens: "700"
      instructions: |
        You are given a JSON bundle whose `entries` array holds feed items, each
        with a title, a link and a summary.

        Write a short morning digest in plain text:
          • one opening line saying how many items there are;
          • then one line per item worth reading — "— <title> · <link>";
          • skip anything that is pure noise, and say how many you skipped.

        No markdown, no preamble, no sign-off. Keep it under 3000 characters:
        that is the limit of a single Telegram message.

        Do not append a generated-by or cost signature.

  - id: cf-send
    kind: api-request
    config:
      name: "Send to Telegram"
      method: POST
      url: "https://api.telegram.org/bot{{env.TELEGRAM_BOT_TOKEN}}/sendMessage"
      expect: "2xx"
      timeoutSec: "30"
      body: '{"chat_id":"{{env.TELEGRAM_CHAT_ID}}","text":"{{steps.Write digest.output.text}}","disable_web_page_preview":true}'
