Skip to content

Latest commit

 

History

History
51 lines (39 loc) · 1.29 KB

File metadata and controls

51 lines (39 loc) · 1.29 KB

Effect SDK

xfetch-effect-api provides the public types and helpers that effect authors are expected to use.

Core Types

  • EffectArgs
  • EffectFrame
  • EffectRequest
  • EffectResponse

Entrypoints

  • read_effect_request()
  • write_effect_frames()

Error Handling

The crate exposes EffectApiError for invalid protocol versions, unexpected effect kinds, invalid typed arguments, and empty frame responses.

Effects should write these errors to stderr and exit with a non-zero code.

Design Notes

  • The crate owns the shared wire protocol, not end-user config files.
  • Higher-level helpers validate requests before effect logic runs.
  • Effects must keep ANSI escape sequences intact when transforming lines (see xfetch-effects-lib in the effects repository).

Reference Implementations

Official effects live in xfetch-cli/effects: decrypt and glitch, both built on xfetch-effect-api.