agent-first-http 0.2.0

Persistent HTTP client for AI agents — one request, one JSON line
{
  "id": "agent-first-http",
  "name": "Agent-First HTTP",
  "domain": "cmn.dev",
  "synopsis": "Persistent HTTP client for AI agents — JSONL in, JSONL out, connections managed transparently so agents never think about transport",
  "intent": [
    "Give AI agents a persistent HTTP client that maintains connection pools per host, reuses TCP+TLS connections across requests, and multiplexes concurrent streams over HTTP/2 — the agent writes JSON requests to stdin and reads JSON responses from stdout, never managing sockets, TLS handshakes, or connection lifecycles",
    "Bridge the gap between curl (one connection per invocation, human-oriented output) and MCP (protocol-locked, requires JSON-RPC framing) — afh is transport-only, works with any HTTP API, and uses AFD suffix conventions for self-describing fields in every request and response",
    "Provide first-class SSE streaming support where server-sent events arrive as individual JSONL lines on stdout, enabling agents to process streaming responses (LLM tokens, progress updates, real-time feeds) without buffering the entire response"
  ],
  "changes": [
    "Replace --pipe and --mcp boolean flags with a unified --mode <cli|pipe|mcp|curl> enum flag, consolidating mode selection into a single unambiguous entry point and removing symlink-based curl detection",
    "Fix config rollback: when a config update causes client rebuild to fail, the previous config is atomically restored in both CLI and MCP modes, preventing the client from entering an inconsistent state",
    "Fix MCP http_request to skip intermediate log events and return only the terminal response or error, ensuring agents receive a complete result rather than a partial log event",
    "Improve graceful shutdown in pipe mode: cancel all in-flight requests, wait up to 5 seconds for completion, then emit cancelled terminal events for any remaining requests before exiting",
    "Suppress all stderr output — startup errors and parse errors now emit JSON to stdout; help text goes to stdout — ensuring stderr is never part of the protocol channel",
    "Add 100+ unit tests across all modules covering config merge logic, retry/backoff, multipart mutual-exclusivity, WebSocket handling, chunked download progress, and curl flag compatibility",
    "Emit a final progress event when a chunked download completes without previously reaching a progress threshold, ensuring agents always receive at least one progress update per download",
    "Upgrade agent-first-data dependency to 0.4.0"
  ],
  "license": "MIT",
  "references": [
    {
      "uri": "cmn://cmn.dev/spore/blake3_5964f09fc2b8a9c8035cd823f431d6a7bcb81d2480f9ddee74beca0b2859020c",
      "relation": "follows",
      "reason": "All request/response fields use AFD suffix conventions, and runtime protocol/log events are emitted on stdout only"
    },
    {
      "uri": "cmn://cmn.dev/spore/blake3_ad385f58fad7cb6abfa5c576170043ddcfbbf87ffb5a30f66b8b25ffb35e5be0",
      "relation": "spawned_from"
    }
  ],
  "tree": {
    "algorithm": "blob_tree_blake3_nfc",
    "excludes": [
      ".git"
    ],
    "ignore_rules": [
      ".gitignore"
    ]
  }
}