cycles-spring-ai-starter
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>io.runcycles</groupId>
<artifactId>cycles-spring-ai-starter</artifactId>
<version>0.3.1</version>
</dependency><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
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.runcycles</groupId>
<artifactId>cycles-spring-ai-starter</artifactId>
<version>0.3.1</version>
<packaging>jar</packaging>
<name>Cycles Spring AI Starter — runtime authority for Spring AI agents</name>
<description>Spring AI starter for AI agent runtime governance with Cycles. Adds budget enforcement on Spring AI ChatClient invocations via call and streaming advisors with reserve / call / commit / release lifecycle against the Cycles server, auto-attached via ChatClientCustomizer. Per-call estimate from prompt size, real ChatResponse.Usage extraction on commit, ToolCallback decoration via CyclesToolGate, and a chat-client ObservationConvention for Cycles attribution on traces. Multi-tenant LLM cost control with per-subject attribution for production Spring AI agents. Compatible with Spring Boot 3.5+ and Spring AI 1.0+.</description>
<url>https://github.com/runcycles/cycles-spring-ai-starter</url>
<developers>
<developer>
<id>albertmavashev</id>
<name>Albert Mavashev</name>
<email>amavashev@k2n.io</email>
<organization>RunCycles</organization>
<organizationUrl>https://github.com/runcycles</organizationUrl>
</developer>
</developers>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:https://github.com/runcycles/cycles-spring-ai-starter.git</connection>
<developerConnection>scm:git:ssh://git@github.com/runcycles/cycles-spring-ai-starter.git</developerConnection>
<url>https://github.com/runcycles/cycles-spring-ai-starter</url>
<tag>HEAD</tag>
</scm>
<properties>
<!-- Single source of truth for the project version is .mvn/maven.config at the
repo root (-Drevision=...). The CLI value always wins. The default below is
ONLY a fallback for IDE imports that don't pick up .mvn/maven.config; keep
it in lockstep with .mvn/maven.config so the flattened pom that ships to
Maven Central doesn't carry stale <revision> metadata (the flatten plugin's
resolveCiFriendliesOnly mode resolves <version> but preserves the
<properties> block as-is). -->
<revision>0.3.1</revision>
<java.version>21</java.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.parameters>true</maven.compiler.parameters>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring.boot.version>3.5.14</spring.boot.version>
<spring.ai.version>1.1.6</spring.ai.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- spring-boot-dependencies first so any explicit downstream pins win. Manages
reactor-core / reactor-test versions (needed for the streaming advisor's tests). -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-bom</artifactId>
<version>${spring.ai.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- Spring Boot auto-configuration glue -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<!-- Spring AI core (provides ChatClient, advisors, observations, tool callbacks) -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-client-chat</artifactId>
<optional>true</optional>
</dependency>
<!-- Cycles SDK — depend on the existing Spring Boot starter for the runtime client. -->
<dependency>
<groupId>io.runcycles</groupId>
<artifactId>cycles-client-java-spring</artifactId>
<version>0.2.2</version>
</dependency>
<!-- Spring Boot configuration metadata generator — gives IDE autocomplete
on cycles.spring-ai.* properties in application.yml / application.properties.
optional=true so consumers don't pull it transitively. The processor runs
at compile time and emits META-INF/spring-configuration-metadata.json
into the produced jar. -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>${spring.boot.version}</version>
<optional>true</optional>
</dependency>
<!-- jtokkit: pure-Java OpenAI BPE tokenizer. optional=true so consumers don't
pull it transitively — only users who opt in to JtokkitPromptTokenEstimator
(via cycles.spring-ai.token-estimator-encoding=cl100k_base / o200k_base)
need it on their classpath. ConditionalOnClass guards the auto-config so the
starter still works when jtokkit isn't present. -->
<dependency>
<groupId>com.knuddels</groupId>
<artifactId>jtokkit</artifactId>
<version>1.1.0</version>
<optional>true</optional>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.boot.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>5.3.2</version>
<scope>test</scope>
</dependency>
<!-- Reactor StepVerifier for testing the streaming advisor's Flux lifecycle. -->
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Resolve 0.3.1 in the published pom. Sonatype Central rejects
unresolved placeholders in pom <version> fields, and Maven's default
install/deploy ships the source pom as-is. flatten-maven-plugin in
resolveCiFriendliesOnly mode substitutes 0.3.1 (and ${sha1} /
${changelist} if we ever use them) and leaves the rest of the pom
untouched — much safer than the default mode which strips a lot of
build-only sections. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.7.3</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals><goal>flatten</goal></goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals><goal>clean</goal></goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<parameters>true</parameters>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.4.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.12.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<source>21</source>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.5</version>
<configuration>
<!-- Silence JDK 21+ warning about Mockito's dynamic agent self-attach.
Future fix: load Byte Buddy as an explicit -javaagent. -->
<argLine>@{argLine} -XX:+EnableDynamicAgentLoading</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.14</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>INSTRUCTION</counter>
<value>COVEREDRATIO</value>
<minimum>0.95</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.8</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.10.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>validated</waitUntil>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>