packages feed

shikumi-cache-0.1.1.0: shikumi-cache.cabal

cabal-version:   3.4
name:            shikumi-cache
version:         0.1.1.0
synopsis:        Content-addressed response caching for shikumi (EP-6)
category:        AI
description:
  The caching subsystem for shikumi: a content-addressed cache key (a BLAKE3
  digest over a canonical request serialization — the contract EP-7's replay
  reproduces), a provider-neutral @Cache@ effect, an in-memory backend, and the
  @cachedLLM@ memoizing interpreter that wraps EP-1's @LLM@ effect so identical
  requests contact the provider once.

license:         BSD-3-Clause
author:          Nadeem Bitar
maintainer:      nadeem@gmail.com
build-type:      Simple
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

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

library
  import:          common-options
  hs-source-dirs:  src
  exposed-modules:
    Shikumi.Cache
    Shikumi.Cache.Backend.Memory
    Shikumi.Cache.Backend.SQLite
    Shikumi.Cache.Key
    Shikumi.Cache.ResponseJSON
    Shikumi.Cache.Types

  build-depends:
    , aeson
    , baikai         >=0.2      && <0.3
    , base           >=4.20     && <5
    , blake3
    , bytestring
    , containers
    , direct-sqlite
    , effectful
    , generic-lens
    , lens           ^>=5.3
    , scientific
    , shikumi        ^>=0.2.0.0
    , stm
    , text           ^>=2.1
    , time
    , vector

test-suite shikumi-cache-test
  import:         common-options
  type:           exitcode-stdio-1.0
  hs-source-dirs: test
  main-is:        Main.hs
  ghc-options:    -threaded -with-rtsopts=-N
  build-depends:
    , aeson
    , baikai         >=0.2      && <0.3
    , base
    , bytestring
    , containers
    , directory
    , effectful
    , filepath
    , generic-lens
    , lens
    , process
    , shikumi        ^>=0.2.0.0
    , shikumi-cache  ^>=0.1.1.0
    , stm
    , tasty
    , tasty-hunit
    , temporary
    , text
    , time
    , vector