packages feed

ai-agent-diff-patch-0.0.2.0: ai-agent-diff-patch.cabal

cabal-version:      3.0
name:               ai-agent-diff-patch
version:            0.0.2.0
synopsis:           Unified diff generation and fuzzy patch application for AI agents
description:
  A Haskell library for unified diff generation and patch application,
  designed for use with AI agents and automated file-editing tools.
  .
  Key features:
  .
  * Myers O(ND) diff algorithm for minimal edit scripts
  * Fuzzy patch application with configurable search range (default: ±5 lines)
  * CRLF / LF line-ending detection and restoration (Windows compatible)
  * Rich failure diagnostics for patch errors (hunk index, header, nearest mismatch)
  .
  See the README for usage examples and known limitations.
homepage:           https://github.com/phoityne/ai-agent-diff-patch
bug-reports:        https://github.com/phoityne/ai-agent-diff-patch/issues
license:            MIT
license-file:       LICENSE
author:             phoityne.hs@gmail.com
maintainer:         phoityne.hs@gmail.com
category:           Text
build-type:         Simple
extra-doc-files:
    CHANGELOG.md
  , README.md

common warnings
    ghc-options: -Wall

library
    import:           warnings

    -- Public API: only AIAgent.DiffPatch.Unified is exposed
    exposed-modules:
        AIAgent.DiffPatch.Unified
      , AIAgent.DiffPatch.Unified.ProjectedContext.Context
      , AIAgent.DiffPatch.Unified.ProjectedContext.Algorithm
      , AIAgent.DiffPatch.Unified.ProjectedContext.Parser
      , AIAgent.DiffPatch.Unified.CoreModel.Type
      , AIAgent.DiffPatch.Unified.CoreModel.Constant
      , AIAgent.DiffPatch.Unified.ApplicationBase.Control
      , AIAgent.DiffPatch.Unified.Interface.FileIO
      , AIAgent.DiffPatch.Unified.Interface.StdIO

    build-depends:
        base              ^>=4.18.0.0
      , text
      , bytestring
      , megaparsec        ^>=9.7
      , vector
      , array
      , lens
      , mtl
      , data-default
      , transformers
      , safe-exceptions

    hs-source-dirs:   src
    default-language: Haskell2010

executable aa-diff
    import:           warnings
    default-language: Haskell2010
    main-is:          AiAgentDiff.hs
    hs-source-dirs:   app
    other-modules:    Paths_ai_agent_diff_patch
    autogen-modules:  Paths_ai_agent_diff_patch
    build-depends:
        base                 ^>=4.18.0.0
      , text
      , bytestring
      , optparse-applicative
      , safe-exceptions
      , ai-agent-diff-patch

executable aa-patch
    import:           warnings
    default-language: Haskell2010
    main-is:          AiAgentPatch.hs
    hs-source-dirs:   app
    other-modules:    Paths_ai_agent_diff_patch
    autogen-modules:  Paths_ai_agent_diff_patch
    build-depends:
        base                 ^>=4.18.0.0
      , text
      , bytestring
      , optparse-applicative
      , safe-exceptions
      , ai-agent-diff-patch

test-suite ai-agent-diff-patch-test
    import:           warnings
    default-language: Haskell2010
    type:             exitcode-stdio-1.0
    hs-source-dirs:   test
    main-is:          Spec.hs

    other-modules:
        AIAgent.DiffPatch.Unified.ApplicationBase.ControlSpec
      , AIAgent.DiffPatch.Unified.ProjectedContext.ContextSpec
      , AIAgent.DiffPatch.Unified.UnifiedSpec

    build-depends:
        base         ^>=4.18.0.0
      , text
      , bytestring
      , hspec
      , hspec-discover
      , QuickCheck
      , data-default
      , temporary
      , ai-agent-diff-patch

    build-tool-depends:
        hspec-discover:hspec-discover