packages feed

shikumi-tools-0.4.1.0: shikumi-tools.cabal

cabal-version: 3.4
name: shikumi-tools
version: 0.4.1.0
synopsis:
  Typed tools and ReAct agents for shikumi LM programs (EP-11)

category: AI
description:
  Typed tools and multi-step ReAct agents for shikumi. A @Tool i o@ is an ordinary
  function over record types whose JSON-Schema argument shape is Generic-derived
  (reusing the schema generator from the signatures plan) and which lowers to
  baikai's untyped wire @Tool@ (MasterPlan integration point #8). A heterogeneous
  @ToolRegistry@ erases the per-tool @i@/@o@ behind an existential while retaining
  the decode/encode dictionaries, so a ReAct loop can dispatch by the name the model
  emits at run time. On top of typed tools, @react@/@reactWithTrajectory@ build a
  @Program i o@ whose embedded loop alternates propose -> dispatch -> observe until
  the model finishes or a bound is hit, then extracts the typed answer — recording a
  structured @Trajectory@ throughout. The whole agent is a first-class, composable,
  inspectable shikumi program. Every test runs against a deterministic mock LM with
  no network.

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
    OverloadedLabels
    OverloadedStrings

library
  import: common-options
  hs-source-dirs: src
  exposed-modules:
    Shikumi.Agent.History
    Shikumi.Agent.ReAct
    Shikumi.CodeExec.CodeAct
    Shikumi.CodeExec.Interpreter
    Shikumi.CodeExec.ProgramOfThought
    Shikumi.CodeExec.Prompt
    Shikumi.CodeExec.RLM
    Shikumi.CodeExec.Session
    Shikumi.Tool
    Shikumi.Tool.Builtin
    Shikumi.Tool.Builtin.Fs
    Shikumi.Tool.Builtin.Shell
    Shikumi.Tool.Builtin.Web
    Shikumi.Tool.Env
    Shikumi.Tool.Output
    Shikumi.Tool.Web

  build-depends:
    aeson >=2.2 && <2.3,
    baikai >=0.7.1.0 && <0.8,
    base >=4.20 && <5,
    bytestring >=0.11 && <0.13,
    containers >=0.6 && <0.9,
    directory >=1.3 && <1.4,
    effectful >=2.6 && <2.8,
    filepath >=1.4 && <1.6,
    generic-lens >=2.2 && <2.4,
    http-client >=0.7 && <0.8,
    http-client-tls >=0.3 && <0.5,
    http-types >=0.12 && <0.13,
    lens ^>=5.3,
    process >=1.6 && <1.7,
    regex-tdfa >=1.3 && <1.4,
    shikumi ^>=0.4.1.0,
    text ^>=2.1,
    vector >=0.13 && <0.14,

test-suite shikumi-tools-test
  import: common-options
  type: exitcode-stdio-1.0
  hs-source-dirs: test
  main-is: Main.hs
  ghc-options:
    -threaded
    -with-rtsopts=-N

  other-modules:
    AcceptanceSpec
    AgentHistorySpec
    BuiltinAcceptanceSpec
    CodeActSpec
    CompactionSpec
    EnvSpec
    Fixtures
    FsSpec
    ProgramOfThoughtSpec
    ProtocolSpec
    RLMExample
    RLMSpec
    ReActSessionExample
    ReActSpec
    ResponsesIntegrationSpec
    ResponsesSchemaSpec
    RestrictedSpec
    SchemaSpec
    SessionSpec
    ShellSpec
    ToolOutputSpec
    ToolSpec
    WebSpec

  build-depends:
    aeson,
    baikai >=0.7.1.0 && <0.8,
    base,
    bytestring,
    containers,
    directory,
    effectful,
    filepath,
    generic-lens,
    lens,
    shikumi ^>=0.4.1.0,
    shikumi-cache ^>=0.2.0.0,
    shikumi-testing ^>=0.1.0.0,
    shikumi-tools ^>=0.4.0.0,
    tasty,
    tasty-hunit,
    text,
    vector,