<?xml version="1.0"?>
<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>com.top-logic</groupId>
		<artifactId>tl-ai-parent</artifactId>
		<version>1.0.12</version>
	</parent>
	
	<artifactId>tl-ai-core</artifactId>

	<licenses>
	  <license>
	    <name>LicenseRef-BOS-TopLogic-1.0</name>
	    <url>https://github.com/top-logic/.github/blob/main/LICENSES/LicenseRef-BOS-TopLogic-1.0.md</url>
	  </license>
	</licenses>
	
	<properties>
		<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
		<msgbuf.version>1.2.2</msgbuf.version>
		<maven.compiler.source>17</maven.compiler.source>
		<maven.compiler.target>17</maven.compiler.target>
	</properties>

	<dependencies>
		<!-- Using TopLogic OpenSource Edition. AGPL license conditions apply. -->
		<!-- To switch to TopLogic Professional Edition, uncomment the following dependency: -->
		
		<dependency>
		    <groupId>com.top-logic</groupId>
		    <artifactId>tl-license-professional</artifactId>
		</dependency>
		

		<!-- TopLogic -->

		<!-- msgbuf JSON streaming (JsonWriter/JsonReader) -->
		<dependency>
			<groupId>de.haumacher.msgbuf</groupId>
			<artifactId>msgbuf-api</artifactId>
			</dependency>

		<!-- TopLogic kernel (KB transactions, locking, security) -->
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-ai-tool-api</artifactId>
			<version>${project.version}</version>
		</dependency>

		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-contact</artifactId>
		</dependency>

		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-element</artifactId>
		</dependency>

		<dependency>
			<groupId>com.vladsch.flexmark</groupId>
			<artifactId>flexmark-html2md-converter</artifactId>
			<version>0.64.8</version>
		</dependency>

		<!-- HTML parsing / text extraction for web_fetch (version managed by parent) -->
		<dependency>
			<groupId>org.jsoup</groupId>
			<artifactId>jsoup</artifactId>
		</dependency>

		<!-- MCP SDK (client for connecting to external MCP servers) -->
		<dependency>
			<groupId>io.modelcontextprotocol.sdk</groupId>
			<artifactId>mcp-core</artifactId>
			<version>1.1.3</version>
		</dependency>

		<!-- Tests -->
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-basic</artifactId>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.top-logic</groupId>
			<artifactId>tl-core</artifactId>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<parameters>true</parameters>
				</configuration>
			</plugin>
			<plugin>
				<groupId>de.haumacher.msgbuf</groupId>
				<artifactId>msgbuf-generator-maven-plugin</artifactId>
				<version>${msgbuf.version}</version>

				<executions>
					<execution>
						<id>generate-protocols</id>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>generate-binding</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.top-logic</groupId>
						<artifactId>tl-maven-plugin</artifactId>
						<version>${tl.version}</version>
						<executions>
							<execution>
								<id>generate-binding</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>generate-java</goal>
								</goals>
								<configuration>
									<modules>tl.ai.core,tl.ai.htmlpages,tl.ai.agent</modules>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>integration-test</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<includes>
								<include>**/TestAnthropicProvider.java</include>
								<include>**/VisualStreamTest.java</include>
								<include>**/TestSubagentJobRegistry.java</include>
								<include>**/TestAsyncDelegationIntegration.java</include>
							</includes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
