Skip to content

Releases

v0.1.8 — PyPI + Homebrew installable

Choose a tag to compare

@dahai80 dahai80 released this 02 Dec 11:03

What's new

fusion-channel is now installable from PyPI and Homebrew (#9).

  • PyPI: pip install fusion-channel — published automatically on v* tags via GitHub Actions (lint + full-test gate, python -m build, twine check, Trusted Publishing). Full package metadata (readme, classifiers, urls) on the PyPI page. Extras: ,fastapi for the webhook router.
  • Homebrew: brew install dahai80/tap/fusion-channel — formula at dahai80/homebrew-tap, generated by scripts/gen_homebrew_formula.py (pinned sdist resources, virtualenv_install_with_resources, Rust build for cryptography/pydantic-core). Installs into an isolated venv.
  • New diagnostics CLI (fusion-channel): version, check-config <yaml> (load-time credential validation), test-connection <yaml> <channel_id>. No new dependencies.
  • __version__ now resolves from installed dist metadata (was a stale hardcode).

Verification: 206 tests passing (10 new CLI tests), ruff clean; sdist/wheel twine check PASSED; wheel smoke-tested in a clean venv; publish run green; formula ruby -c clean.

🤖 Generated with Claude Code

v0.1.7 — README Python prerequisite note

Choose a tag to compare

@dahai80 dahai80 released this 27 Nov 06:02

What's new

Docs release closing the 2026-11-26 audit findings (#7 / PR #8):

  • Audit finding "no README.md": stale — README.md / README_CN.md have been on main since 2026-10-25 (commit 4de0ef3) and cover purpose, architecture position, install, config, and test commands.
  • Real gap fixed: both READMEs' Install sections now state the Python prerequisite — requires-python = ">=3.12" from pyproject.toml, matching the workspace .python-version pin.
  • Docs-only change: CI skipped by design (paths-ignore for **.md); verified locally — 196 tests passing, ruff check + format clean.

🤖 Generated with Claude Code

v0.1.6 — CI bootstrap

Choose a tag to compare

@dahai80 dahai80 released this 16 Nov 06:19

What's new

CI bootstrap per the fusion#2 checklist (issue #5) — the repo previously had zero GitHub Actions workflows and no CI runs at all.

  • Workflow: .github/workflows/ci.yml — lint (ruff check + ruff format --check) + full pytest suite on Python 3.12, install via pip install -e ".[test,fastapi]".
  • Concurrency: ci-<ref> group with cancel-in-progress: true from day one.
  • Dependency cache: actions/setup-python@v5 with cache: pip.
  • paths-ignore: markdown / docs/ / examples/-only changes skip CI.
  • Tiered gate assessment: suite runs ~15–25s (196 tests), far under the ~5 min threshold — single job, no tiering.
  • Run minutes: before = 0 (no workflows existed); after = ~29s per run (job wall time, run 43815475644; the badge/docs runs are similar or skipped by paths-ignore).
  • CI badge added to both READMEs. The new lint gate immediately caught one real defect (an unformatted Python code block in docs/consumer-integration.md) — fixed in this cycle.

No behavior changes: 196 tests passing, ruff clean.

🤖 Generated with Claude Code

v0.1.5 — consumer integration guide

Choose a tag to compare

@dahai80 dahai80 released this 02 Nov 03:36

What's new

Documentation release answering the ai-booking-agent M3 integration questions (#4) — new docs/consumer-integration.md, linked from both READMEs:

  • Outbound pattern: registry.send() returns the outbox record id (persist it for correlation); long-running services should use the owned worker registry.start_outbox() (cancelled by close()) instead of a manual flush_once() loop; on_permanent_failure maps to consumer alerting; provider_message_id (Twilio MessageSid) stored on successful sends.
  • Delivery status: provider status callbacks land as archived Receipts (store.save_receipt), never dispatched as messages — Postgres notifications writeback by subclassing ChannelStore.save_receipt, with the CAS/dedup return-value contracts spelled out.
  • Store choice: SqliteStore for single-process; Postgres-backed ChannelStore recommended for a long-running FastAPI service, claim_outbox must stay a true CAS.
  • Credential refs: full resolution priority (env: → provider key → {channel_id}:{field} default → literal) plus multi-consumer isolation caveats (the literal fallback typo trap; channel id as the in-process isolation unit).
  • SMS/10DLC: US long codes work out of the box (E.164 from_number); 10DLC registration is Twilio-account-side — the adapter neither blocks nor requires it.

No behavior changes: 196 tests passing, ruff clean.

🤖 Generated with Claude Code

v0.1.4 — gmail_api adapter (Gmail / Google Workspace)

Choose a tag to compare

@dahai80 dahai80 released this 30 Oct 09:05

What's new

New gmail_api adapter (#3): pull-mode Gmail / Google Workspace ingestion via the Gmail API with OAuth2 (refresh-token grant).

  • Auth: OAuth2 refresh token (client_id / client_secret / refresh_token / user_id); token cached with one-shot 401 refresh. env: credential refs supported; missing creds fail with ConfigError at load.
  • Poll: historyId incremental sync when a previous poll (or the history_id config seed) recorded one, with automatic fallback to the full label_ids + optional query list when the history window has expired. Per-message format=full fetch (attachment ids live in the payload parts), then modifyLabels strips UNREAD so re-poll dedup matches email_imap semantics; label-strip failure falls back to Message-ID dedup.
  • Resilience: 429 on the list backs off to the next poll cycle; 429 on a single message skips it. Poll failures are isolated per channel by the registry.
  • Threading: Gmail threadId and In-Reply-To both surface (conversation.thread_id + raw.gmail_thread_id).
  • Attachments: adapter.download_attachment(gmail_message_id, attachment_id) returns real bytes — the document-pipeline path for emailed PDFs.
  • Outbound: messages.send with raw MIME; draft_mode: true switches to drafts.create (human-approval flow). Subject rules match email_imap.
  • Config: label_ids (default INBOX, UNREAD), query, poll_batch_limit (default 25), history_id, draft_mode.

12 adapters total. 196 tests passing (20 new mocked-Gmail tests), ruff clean.

🤖 Generated with Claude Code

v0.1.3

Choose a tag to compare

@dahai80 dahai80 released this 30 Oct 07:27

What's new

graph_mail adapter — Microsoft 365 / Exchange Online mail ingestion (#2)

New 11th adapter for consumers that need to ingest mail from M365 shared
mailboxes (e.g. AI agents processing emailed PDF purchase orders). M365 has
basic auth disabled, so the IMAP/password path of email_imap cannot connect
there — graph_mail polls via Microsoft Graph with OAuth2 client credentials.

  • Credentials: tenant_id / client_id / client_secret / mailbox
    (register an Entra ID app with the Mail.ReadWrite application permission
    on the shared mailbox). Values support the standard env:VAR refs; empty
    refs fail at registry load with a clear ConfigError.
  • Poll semantics match email_imap: list unread in the configured folder
    (folder, default INBOX), fetch the full MIME, mark as read, batch limit
    poll_batch_limit (default 20). Polled requests flow through the identical
    handle_inbound pipeline (dedup, archive, commands, identity gate).
  • Attachments: Graph attachment refs land in MediaRef with provider ids
    and download URLs; adapter.download_attachment(graph_message_id, attachment_id) returns the real bytes for document pipelines.
  • Outbound: POST /users/{mailbox}/sendMail through the same outbox;
    subject rules match email_imap (meta={"subject": ...} or first line,
    Re: prefix on replies).
  • Token handling: client-credentials grant with monotonic-clock cache and
    one-shot 401 refresh; all error strings secret-redacted.

Other

  • Capability matrix extended to 11 adapters (graph_mail mirrors
    email_imap: receive/send/media/threads, cards degrade to fallback text).
  • 17 new mocked-Graph tests (token fetch/cache/refresh, mark-read verified,
    dedup on re-poll, mark-read-failure dedup fallback, attachment download
    bytes, sendMail payload shape, error paths). 176 tests total, ruff clean.
  • README / README_CN / CLAUDE.md updated for the 11-adapter table.

Full changelog: v0.1.2...v0.1.3

🤖 Generated with Claude Code

v0.1.2

Choose a tag to compare

@dahai80 dahai80 released this 28 Oct 12:16

Patch release over v0.1.1.

What's in this patch

  • QQ Mail live integration E2E (tests/test_integration_email.py, integration marker, skipped by default): real IMAP login + UNSEEN fetch against imap.qq.com:993, full inbound pipeline with re-poll dedup, and SMTP send-to-self loopback via smtp.qq.com:587 STARTTLS (verified received back in INBOX within 15s). Credentials are env-based only (FUSION_CHANNEL_QQ_EMAIL / FUSION_CHANNEL_QQ_AUTH_CODE).
  • Docs: README / README_CN updated with live-provider integration test coverage.
  • Issue #1 (config Phase 2.2 — adopt fusion_core.config single-point resolution) closed as verified: this repo has no hand-rolled service-key resolution to migrate (check-env.py: 0 findings; no _resolve functions; library has no port / data dir / MLX-gateway call sites). Evidence posted on the issue.

Verification

  • 159/159 default tests pass; ruff check + format clean.
  • Live QQ Mail integration suite 3/3 pass against a real mailbox.

🤖 Generated with Claude Code

v0.1.1 — email channel + pull-mode poll pipeline

Choose a tag to compare

@dahai80 dahai80 released this 26 Oct 08:18

What's new

Email channel (email_imap) — the first pull-mode adapter:

  • Inbound: IMAP UNSEEN fetch (batch-limited). Adapters that override ChannelAdapter.poll() fetch their own messages; ChannelRegistry.poll() / start_polling(interval) run them through the exact same handle_inbound pipeline as webhooks — dedup, archive, command parsing, identity gate.
  • Verification: no webhook signature exists for email — TLS + account login are the trust boundary; verify_request always passes (logged).
  • MIME handling stays thin: text/plain extraction, attachments as MediaRef, In-Reply-To mapped to conversation.thread_id.
  • Outbound: same outbox semantics (backoff, CAS claim, token bucket), SMTP + STARTTLS. Subject via meta={"subject": ...}, defaults to the first line of the text; reply_to sets In-Reply-To/References.
  • Testability: config["imap_fetch"] / config["smtp_send"] injection — the full suite runs without network.

Also: capability matrix entry for email_imap (CAN_THREADS, cards none), start_polling worker cancelled by close(), example channel config.

Tests

159 tests (14 new), ruff clean.

Install

cd /Users/dahai/fusion && source .venv/bin/activate
pip install -e ".[test]"        # add ,fastapi for the webhook router

🤖 Generated with Claude Code

v0.1.0

Choose a tag to compare

@dahai80 dahai80 released this 25 Oct 23:00

First release of fusion-channel — the Fusion ecosystem's unified messaging channel access layer.

Scope (M1–M3)

  • Core abstractions: ChannelAdapter SPI (abstract verify_request — an adapter without it cannot register), ChannelRegistry facade (verify → reject-archive → parse → dedup → archive → dispatch), pydantic models.
  • 9 adapters: Twilio SMS, Aliyun SMS, Tencent SMS, WeCom self-built app, Feishu/Lark app, DingTalk group robot, Slack Events API, WhatsApp Cloud API, Telegram Bot API.
  • Outbox: enqueue-first sends, [30, 120, 600]s backoff, 3 attempts, CAS claim (pending → sending lease) so two workers never double-send, stale-lease crash recovery, per-channel token-bucket rate limits, on_permanent_failure hook.
  • Cards: per-CAN_CARDS degradation (full / partial / text fallback); text commands and card buttons converge on the same Interaction.
  • Storage: MemoryStore / SqliteStore (aiosqlite); swap in your own DB by subclassing.
  • Credentials: CredentialProvider interface, AES-256-GCM file-backed default (0600 key, atomic writes), env/memory/chained providers; reads return masked values.
  • Identity: IdentityMapper external-id ↔ fusion-identity mapping, assert_bound_identity() two-factor primitive, optional per-channel identity gate.
  • FastAPI router: one-line webhook integration, GET handshakes (WeCom echostr, WhatsApp hub.challenge), 1 MiB body cap, fail-closed (never 500).

Hard rules baked in

Verification mandatory at SPI level · archive-first inbound · rejected requests archived · degradation is rendering, not business · credentials never persist in the library · official APIs only (no personal-WeChat reverse protocols).

Review hardening

Two full review batches landed before this tag (commits a3ee4b5, ac2b3cf): dedup-key collision fixes (Slack block_actions trigger_id, DingTalk sessionId, WeCom CreateTime), Aliyun RFC3986 percent-encoding, Tencent phone normalization, WeCom XML/query-param callbacks, Twilio/WhatsApp delivery receipts, Telegram UTF-16 mention offsets, Feishu card.action.trigger, outbox CAS claim, FastAPI catch-all.

Tests: 145 passed, ruff clean. Live-provider tests marked integration (excluded by default).

Install

cd /path/to/fusion && source .venv/bin/activate
pip install -e ".[test]"        # add ,fastapi for the webhook router

🤖 Generated with Claude Code