<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.jaiclaw</groupId>
        <artifactId>jaiclaw-extensions</artifactId>
        <version>0.9.0</version>
    </parent>

    <artifactId>jaiclaw-agentmind-memory</artifactId>
    <name>JaiClaw :: AgentMind :: Memory</name>
    <description>AgentMind-style bounded markdown memory spliced into the system prompt at session start. Three scopes (TENANT, AGENT, PEER) with overflow-as-error semantics. Opt-in via jaiclaw.agentmind.memory.enabled.</description>

    <dependencies>
        <!-- Core JaiClaw -->
        <dependency>
            <groupId>io.jaiclaw</groupId>
            <artifactId>jaiclaw-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.jaiclaw</groupId>
            <artifactId>jaiclaw-tools</artifactId>
        </dependency>

        <!-- Required at compile time for the JaiClawPlugin SPI used by
             MemoryPromptInjector and MemorySessionListener. -->
        <dependency>
            <groupId>io.jaiclaw</groupId>
            <artifactId>jaiclaw-plugin-sdk</artifactId>
        </dependency>

        <!-- Optional. Memory can run standalone; the soul module is only
             consulted if a deployment also enables it. The per-user key
             resolver lives inside the soul module today — when
             AgentMindUserKeyResolver is on the classpath the memory
             module uses it; otherwise the memory module falls back to
             a deterministic hash internally.

             MarkdownSectionEditor is duplicated below into this module
             (io.jaiclaw.agentmind.memory.markdown) rather than depending
             on the soul module for compile-time access. A third Phase 3
             copy (Tendencies) is the trigger to lift it to a shared
             location — likely jaiclaw-tools. -->
        <dependency>
            <groupId>io.jaiclaw</groupId>
            <artifactId>jaiclaw-agentmind-soul</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Optional jaiclaw-identity for user-key resolution. Falls back
             to a deterministic hash when the resolver bean is absent. -->
        <dependency>
            <groupId>io.jaiclaw</groupId>
            <artifactId>jaiclaw-identity</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- JSON serialisation of the MemoryDocument record on disk. -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>

        <!-- Spring Boot autoconfig — all gated by @ConditionalOnProperty. -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Optional: enables Actuator counters. -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-core</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Optional: enables MemoryDebugController + TenantMemoryController. -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- Test stack -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-spring</artifactId>
            <version>${spock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
