packages feed

baikai-claude-0.7.1.0: baikai-claude.cabal

cabal-version: 3.4
name: baikai-claude
version: 0.7.1.0
synopsis: Anthropic Claude providers for the baikai abstraction
description:
  Anthropic backends for baikai: the Messages API over SSE, the claude -p batch
  provider, a launcher for interactive Claude Code sessions, and the renderer for
  unattended claude runs driven by baikai-agent.

category: AI
license: BSD-3-Clause
license-file: LICENSE
author: Nadeem Bitar
maintainer: nadeem@gmail.com
copyright: (c) 2026 Nadeem Bitar
build-type: Simple
tested-with: ghc ==9.12.4
extra-doc-files: CHANGELOG.md

common common-options
  ghc-options:
    -Wall
    -Wcompat
    -Widentities
    -Wincomplete-uni-patterns
    -Wincomplete-record-updates
    -Wredundant-constraints
    -fhide-source-paths
    -Wmissing-export-lists
    -Wpartial-fields
    -Wmissing-deriving-strategies

  -- Exhaustiveness is an error, not a warning. A non-exhaustive match
  -- is a crash the compiler already found: it fails at runtime, on
  -- whichever input reaches the missing branch, usually in front of a
  -- user. This is not hypothetical here — adding a constructor to
  -- AgentRunFailure left `failureExitCode` non-exhaustive and shipped a
  -- pattern-match failure on `baikai agent run --require-evidence`,
  -- because the warning scrolled past in a build log.
  --
  -- Promoted individually rather than through -Werror, which would also
  -- fail the build on warnings that are stylistic or that a future GHC
  -- invents, and would push people toward blanket suppression.
  ghc-options:
    -Werror=incomplete-patterns
    -Werror=incomplete-uni-patterns
    -Werror=incomplete-record-updates

  default-language: GHC2024
  default-extensions:
    DeriveAnyClass
    DuplicateRecordFields
    OverloadedLabels
    OverloadedStrings

library
  import: common-options
  hs-source-dirs: src
  exposed-modules:
    Baikai.Provider.Claude.Agent
    Baikai.Provider.Claude.Api
    Baikai.Provider.Claude.Cli
    Baikai.Provider.Claude.Interactive
    Baikai.Provider.Claude.Internal.ErrorClass
    Baikai.Provider.Claude.Internal.Request
    Baikai.Provider.Claude.Internal.Stream
    Baikai.Provider.Claude.Shape
    Baikai.Provider.Claude.Sse
    Baikai.Provider.Claude.Transport

  other-modules: Paths_baikai_claude
  autogen-modules: Paths_baikai_claude
  build-depends:
    aeson ^>=2.2,
    baikai ^>=0.7.2,
    base >=4.20 && <5,
    base16-bytestring ^>=1.0,
    base64-bytestring ^>=1.2,
    bytestring ^>=0.12,
    case-insensitive ^>=1.2,
    claude ^>=1.5,
    containers ^>=0.7,
    cradle ^>=0.0,
    cryptohash-sha256 ^>=0.11,
    crypton >=1.0 && <1.2,
    generic-lens ^>=2.3,
    http-client ^>=0.7,
    http-client-tls >=0.3 && <0.5,
    http-types ^>=0.12,
    lens ^>=5.3,
    servant-client ^>=0.20,
    streamly >=0.11 && <0.13,
    streamly-core >=0.3 && <0.5,
    text ^>=2.1,
    time ^>=1.14,
    vector ^>=0.13,

test-suite baikai-claude-test
  import: common-options
  type: exitcode-stdio-1.0
  hs-source-dirs: test
  main-is: Main.hs
  other-modules:
    CliEvidenceSpec
    Contract
    ErrorClassSpec
    EvidenceSpec
    FableContractsSpec
    LifecycleSpec
    MidStreamSpec
    PublicSurfaceSpec
    ShapeSpec
    SseSpec
    StructuredCliSpec
    ThinkingSpec
    TransportSpec

  -- cradle (used by Baikai.Provider.Claude.Interactive) requires the threaded RTS.
  ghc-options:
    -threaded
    -with-rtsopts=-N

  build-depends:
    aeson,
    baikai ^>=0.7.2,
    baikai-claude,
    base >=4.20 && <5,
    bytestring,
    case-insensitive,
    claude,
    containers,
    directory,
    filepath,
    generic-lens,
    http-client,
    http-types,
    lens ^>=5.3,
    network,
    servant-client,
    stm,
    streamly,
    streamly-core >=0.3 && <0.5,
    tasty,
    tasty-hunit,
    temporary,
    text ^>=2.1,
    time,
    tls,
    vector,