Connector authoring
Custom connectors can now be authored in two ways:
- Rust implementations that implement
harn_vm::connectors::Connector .harnmodules loaded through[[providers]]manifest entries
The initial surface lives in crates/harn-vm/src/connectors/ because the
supporting abstractions it depends on today already live in harn-vm:
EventLogfor audit and durable event plumbingSecretProviderfor signing secrets and outbound tokensTriggerEventfor the normalized inbound envelope
If the connector ecosystem grows large enough, the module can be extracted into a dedicated crate later without changing the core trait contract.
Provider catalog
Connectors should treat the runtime ProviderCatalog as the authoritative
discovery surface for provider metadata. Each provider entry carries:
- the normalized payload schema name exposed through
std/triggers - supported trigger kinds such as
webhookorcron - outbound method names (empty today for the built-in providers)
- required secrets, including the namespace each secret must live under
- signature verification strategy metadata
- runtime connector metadata indicating whether the provider is backed by a built-in connector or a placeholder implementation
Harn also exposes that same catalog to scripts through
import "std/triggers" and list_providers(), so connector metadata has one
runtime-facing source instead of separate registry and docs tables.
External connector repository guidance
This page is the canonical authoring guide for first-party connector package
repositories. Repo-local CLAUDE.md and AGENTS.md files should stay as thin
pointers plus provider-specific notes.
Keep repo-local guidance limited to details that differ by provider:
- webhook header names, signature schemes, and replay windows
- auth token shapes, API base URLs, and host-specific endpoint caveats
- polling caveats, if the provider has a poll-based surface
- dependency boundaries such as a sibling SDK package that owns outbound API definitions
Do not copy shared Harn syntax, package layout, connector export contracts, fixture schema, effect-policy rules, or test command matrices into connector repos. If a shared instruction is missing, add it here first and point external repos at this page.
Each connector repo should run a cheap guidance guard in CI before expensive Harn setup:
- name: Check connector guidance is canonical
shell: bash
run: |
set -euo pipefail
guidance_files=()
for file in CLAUDE.md AGENTS.md; do
if [[ -f "${file}" ]]; then
guidance_files+=("${file}")
fi
done
if [[ "${#guidance_files[@]}" -eq 0 ]]; then
echo "Add CLAUDE.md or AGENTS.md with a pointer to the canonical connector authoring guide." >&2
exit 1
fi
copied_guidance='(^## (Quick repo conventions|How to test|Reference Rust impl|Upstream conventions|Harn module connectors|Connector package gate|Rust connectors|Testing|Development)$|File extension:|Entry point:|Tests live under|Run targeted checks|Run checks|cargo install harn-cli|harn --version|harn install|harn (check|lint|fmt|connector (check|test))|for test in tests/\*\.harn)'
for file in "${guidance_files[@]}"; do
if ! grep -Eq 'docs/src/connectors/authoring\.md|docs\.harnlang\.com/connectors/authoring\.html' "${file}"; then
echo "${file} must link to docs/src/connectors/authoring.md instead of restating it." >&2
exit 1
fi
if grep -Eiq "${copied_guidance}" "${file}"; then
echo "${file} is re-implementing canonical Harn authoring guidance; keep only provider-specific notes." >&2
exit 1
fi
done
if [[ -f CLAUDE.md ]] && ! grep -Eq '^## Provider Notes