praxo-core 0.10.0 → 0.11.0
raw patch · 8 files changed
+100/−27 lines, 8 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +3/−3
- REGISTRY.md +7/−7
- llms.md +5/−5
- llms.txt +5/−5
- praxo-core.cabal +3/−1
- src/Praxo/PluginProcess.hs +45/−2
- src/Praxo/Wire.hs +1/−1
- tests/Main.hs +31/−3
README.md view
@@ -7,7 +7,7 @@ middleware, JSON Schema validation, plugin manifest parsing, and runtime helpers. - Implementation type: Core.-- Source version: `0.10.0` (unreleased, untagged); Hackage remains `0.9.0`.+- Source version: `0.11.0`; Hackage publishes `0.10.0`. - Supported `SPEC_VERSION`: `0.2.0`. Migrating from `0.9.0` requires binding `pathChecker`, `pathCheck`, and `pathAllowed` in `IO`; see [CHANGELOG.md](CHANGELOG.md). - Local gate: all eleven shared vector groups, native regression tests, and@@ -27,7 +27,7 @@ - Registry introduction: [REGISTRY.md](https://github.com/axisvela/praxo-core/blob/main/language/haskell/REGISTRY.md) - Machine-readable entry: [llms.txt](https://github.com/axisvela/praxo-core/blob/main/language/haskell/llms.txt) and [llms.md](https://github.com/axisvela/praxo-core/blob/main/language/haskell/llms.md) - Coding-agent contract: [docs/getting-started/coding-agents.md](https://github.com/axisvela/praxo-core/blob/main/docs/getting-started/coding-agents.md)-- Registry: [Hackage](https://hackage.haskell.org/package/praxo-core-0.9.0)+- Registry: [Hackage](https://hackage.haskell.org/package/praxo-core-0.10.0) - Community: [X](https://x.com/axisvela) · [Weibo](https://weibo.com/u/1936025761) · [LinkedIn](https://www.linkedin.com/company/axisvela/) · [Facebook](https://www.facebook.com/profile.php?id=61596905732406) · [YouTube](https://www.youtube.com/@axisvela) · [Discord](https://discord.com/channels/1575163993767809064/1575164343148875977) · [GitHub Discussions](https://github.com/axisvela/praxo-core/discussions) · [GitHub Issues](https://github.com/axisvela/praxo-core/issues) · [Documentation](https://axisvela.github.io/praxo-core/) · [Architect](https://axisvela.architect.pub) ## Get started@@ -35,7 +35,7 @@ Install the published package: ```bash-cabal install --lib praxo-core-0.9.0+cabal install --lib praxo-core-0.10.0 ``` Then run the smallest deterministic example:
REGISTRY.md view
@@ -4,8 +4,8 @@ PRAXO-CORE (also written praxocore) provides an embeddable, MIT-licensed agent framework for Haskell, with tool calling, policy hooks, human-in-the-loop approval, checkpoints, and execution events. Use the language-specific scope and verification evidence below; a package listing does not establish Go feature parity or production readiness. -**Status:** published 0.9.0; source 0.10.0 is unreleased and untagged. Source version `0.10.0`, source-tag `not tagged`. Published registry version: `0.9.0`. Registry+**Status:** published 0.10.0 on Hackage; source tag haskell/v0.11.0. Source version `0.11.0`, source+tag `haskell/v0.11.0`. Published registry version: `0.10.0`. Registry pages are release snapshots; verify the published version before relying on a feature. ## Package@@ -13,12 +13,12 @@ | Field | Value | | --- | --- | | Package | `praxo-core` |-| Registry | [Hackage](https://hackage.haskell.org/package/praxo-core-0.9.0) |-| Source version | `0.10.0` |-| Published registry version | `0.9.0` |-| Install (published) | `cabal install --lib praxo-core-0.9.0` |+| Registry | [Hackage](https://hackage.haskell.org/package/praxo-core-0.10.0) |+| Source version | `0.11.0` |+| Published registry version | `0.10.0` |+| Install (published) | `cabal install --lib praxo-core-0.10.0` | | Install (source/release prepared) | `cabal build --project-dir=language/haskell` |-| Source tag | `not tagged` |+| Source tag | `haskell/v0.11.0` | | Tier | Core | | Contract | `SPEC_VERSION` `0.2.0` | | Documentation | https://axisvela.github.io/praxo-core/languages/haskell/ |
llms.md view
@@ -7,12 +7,12 @@ ## Package - package: `praxo-core`-- registry: [Hackage](https://hackage.haskell.org/package/praxo-core-0.9.0)-- source_version: `0.10.0`-- published_version: `0.9.0`-- install_published: `cabal install --lib praxo-core-0.9.0`+- registry: [Hackage](https://hackage.haskell.org/package/praxo-core-0.10.0)+- source_version: `0.11.0`+- published_version: `0.10.0`+- install_published: `cabal install --lib praxo-core-0.10.0` - install_source: `cabal build --project-dir=language/haskell`-- source_tag: `not tagged`+- source_tag: `haskell/v0.11.0` - tier: Core - contract: `SPEC_VERSION` `0.2.0` - documentation: https://axisvela.github.io/praxo-core/languages/haskell/
llms.txt view
@@ -7,12 +7,12 @@ # Package - package: `praxo-core`-- registry: [Hackage](https://hackage.haskell.org/package/praxo-core-0.9.0)-- source_version: `0.10.0`-- published_version: `0.9.0`-- install_published: `cabal install --lib praxo-core-0.9.0`+- registry: [Hackage](https://hackage.haskell.org/package/praxo-core-0.10.0)+- source_version: `0.11.0`+- published_version: `0.10.0`+- install_published: `cabal install --lib praxo-core-0.10.0` - install_source: `cabal build --project-dir=language/haskell`-- source_tag: `not tagged`+- source_tag: `haskell/v0.11.0` - tier: Core - contract: `SPEC_VERSION` `0.2.0` - documentation: https://axisvela.github.io/praxo-core/languages/haskell/
praxo-core.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: praxo-core-version: 0.10.0+version: 0.11.0 synopsis: Embeddable MIT-licensed AI agent framework for Haskell description: PRAXO-CORE (praxocore) is a native Haskell agent framework with tools, policy hooks, typed events, memory, checkpoints, context budgets, middleware, JSON Schema validation,@@ -26,6 +26,8 @@ build-depends: base >=4.14 && <5, containers >=0.6 && <0.9, directory >=1.3 && <2, filepath >=1.4 && <2, process >=1.6, process >=1.6 default-language: Haskell2010 ghc-options: -Wall+ if os(windows)+ extra-libraries: advapi32 executable praxo-haskell-conformance hs-source-dirs: conformance
src/Praxo/PluginProcess.hs view
@@ -1,4 +1,6 @@ {-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE ForeignFunctionInterface #-} module Praxo.PluginProcess ( PluginProcessConfig(..) , PluginProcessError(..)@@ -10,9 +12,15 @@ import Control.Concurrent (forkIO) import Control.Exception (SomeException, try)+import Control.Monad (when) import Data.Char (chr, digitToInt, intToDigit, isSpace) import Data.IORef import Data.List (dropWhileEnd)+import Data.Word (Word8)+import Foreign.C.Types (CInt(..))+import Foreign.Marshal.Alloc (allocaBytes)+import Foreign.Marshal.Array (peekArray)+import Foreign.Ptr (Ptr, plusPtr) import System.Environment (getEnvironment) import System.IO import System.Process@@ -21,6 +29,41 @@ import Praxo.Agent (AgentError(..)) import Praxo.Json (Json(..), asString, encodeJson, field, parseJson) +#ifdef mingw32_HOST_OS+foreign import stdcall unsafe "SystemFunction036"+ c_SystemFunction036 :: Ptr Word8 -> CInt -> IO Word8+#endif++randomToken :: IO String+randomToken = allocaBytes tokenBytes $ \buffer -> do+ fillRandom buffer+ bytes <- peekArray tokenBytes buffer+ pure (concatMap hexPair (bytes :: [Word8]))+ where+ tokenBytes = 32+ fillRandom buffer =+#ifdef mingw32_HOST_OS+ do+ ok <- c_SystemFunction036 buffer (fromIntegral tokenBytes)+ when (ok == 0) $ ioError (userError "plugin: secure random unavailable")+#else+ do+ handle <- openBinaryFile "/dev/urandom" ReadMode+ let loop offset+ | offset >= tokenBytes = pure ()+ | otherwise = do+ got <- hGetBuf handle (buffer `plusPtr` offset) (tokenBytes - offset)+ if got <= 0+ then ioError (userError "plugin: secure random unavailable")+ else loop (offset + got)+ loop 0+ hClose handle+#endif+ hexPair byte = [hexDigit (fromIntegral byte `div` 16), hexDigit (fromIntegral byte `mod` 16)]+ hexDigit value+ | value < 10 = chr (fromEnum '0' + value)+ | otherwise = chr (fromEnum 'a' + value - 10)+ data PluginProcessConfig = PluginProcessConfig { pluginId :: String , pluginPath :: String@@ -55,8 +98,8 @@ | null (pluginPath config) = pure (Left (err "INVALID_REQUEST" "plugin: path is required")) | otherwise = do env0 <- maybe getEnvironment pure (pluginEnv config)+ token <- if null (pluginToken config) then randomToken else pure (pluginToken config) let tokenEnv = if null (pluginTokenEnvVar config) then "PRAXOVELA_PLUGIN_TOKEN" else pluginTokenEnvVar config- token = if null (pluginToken config) then "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" else pluginToken config env = (tokenEnv, token) : filter ((/= tokenEnv) . fst) env0 result <- try $ createProcess (proc (pluginPath config) (pluginArgs config)) { cwd = pluginDir config@@ -121,7 +164,7 @@ readResponse :: Handle -> String -> Int -> IO (Either PluginProcessError String) readResponse output requestId timeoutMs = do- line <- timeout timeoutMs (hGetLine output)+ line <- timeout (timeoutMs * 1000) (hGetLine output) case line of Nothing -> pure (Left (err "TIMEOUT" "plugin: invocation timed out")) Just raw -> case parseJson raw of
src/Praxo/Wire.hs view
@@ -4,4 +4,4 @@ specVersion = "0.2.0" sdkVersion :: String-sdkVersion = "0.10.0"+sdkVersion = "0.11.0"
tests/Main.hs view
@@ -2,7 +2,7 @@ import Control.Exception (IOException, try) import Control.Monad (forM_, unless)-import Data.Either (isLeft)+import Data.Either (isLeft, isRight) import Data.List (isInfixOf) import Data.Ratio ((%)) import Data.IORef@@ -20,10 +20,11 @@ import qualified Praxo.Delegation as D import Praxo.Pattern import Praxo.Plugin+import qualified Praxo.PluginProcess as PP import Praxo.Runtime import Praxo.ToolCall import Praxo.Wire-import System.Directory (createDirectory, createDirectoryLink, createFileLink, getTemporaryDirectory, removeFile, removePathForcibly)+import System.Directory (createDirectory, createDirectoryLink, createFileLink, findExecutable, getTemporaryDirectory, removeFile, removePathForcibly) import System.FilePath ((</>)) import System.Info (os) import System.IO (hClose, openTempFile)@@ -40,7 +41,8 @@ harmovelaTests mcpTests seamTests- assert "contract version" (specVersion == "0.2.0" && sdkVersion == "0.10.0")+ pluginProcessTests+ assert "contract version" (specVersion == "0.2.0" && sdkVersion == "0.11.0") forM_ ["", "01", "1.", "+1", "NaN", "1e", "[1,]", "{\"a\":1,}", "{}{}", "\"\\q\"", "\"\\ud800\"", "\"\\udc00\"", "\"\\ud800\\u0041\"", "\"line\nbreak\"", "true garbage"] $ \raw -> assert ("invalid JSON " ++ show raw) (isLeft (parseJson raw)) assert "unicode escape" (parseJson "\"\\u00e9\\ud83d\\ude00\"" == Right (JString "\x00e9\x1f600"))@@ -830,6 +832,32 @@ assert :: String -> Bool -> IO () assert label condition = unless condition (fail label)++pluginProcessTests :: IO ()+pluginProcessTests = do+ python <- findExecutable "python"+ case python of+ Nothing -> putStrLn "plugin process: python not found, skipping"+ Just interpreter -> do+ let config = PP.PluginProcessConfig+ { PP.pluginId = "com.example.echo"+ , PP.pluginPath = interpreter+ , PP.pluginArgs = ["tests/fixtures/process_plugin.py"]+ , PP.pluginDir = Nothing+ , PP.pluginEnv = Nothing+ , PP.pluginToken = ""+ , PP.pluginTokenEnvVar = ""+ , PP.pluginStartTimeout = 2000+ , PP.pluginInvokeTimeout = 5000+ , PP.pluginGracePeriod = 1000+ }+ started <- PP.startPluginProcess config+ case started of+ Left err -> fail ("plugin process start: " ++ PP.processMessage err)+ Right host -> do+ slow <- PP.invokePluginProcess config host "tool.provider" "slow" ""+ assert "plugin slow completes within millisecond timeout" (isRight slow)+ PP.stopPluginProcess config host json :: String -> Json json = either error id . parseJson