-
Notifications
You must be signed in to change notification settings - Fork 151
example/kotlin #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
drorIvry
wants to merge
4
commits into
main
Choose a base branch
from
example/kotlin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
example/kotlin #156
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,3 +93,7 @@ bin/ | |
|
|
||
| # Go TUI | ||
| packages/tui/cmd/rogue/__debug* | ||
|
|
||
| # Gradle / Kotlin | ||
| .gradle/ | ||
| **/build/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| .PHONY: dev build clean | ||
|
|
||
| dev: | ||
| ./gradlew run --args="server src/main/resources/config.yml" | ||
|
|
||
| build: | ||
| ./gradlew shadowJar | ||
|
|
||
| clean: | ||
| ./gradlew clean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| # Shirtify T-Shirt Store Agent (Kotlin + LangChain4j + Dropwizard) | ||
|
|
||
| A Kotlin implementation of the Shirtify t-shirt store agent using LangChain4j | ||
| with Dropwizard and the A2A (Agent-to-Agent) protocol. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - JDK 25 or higher | ||
| - Gradle 9.x (wrapper included) | ||
| - OpenAI API key | ||
|
|
||
| ## Quick Start | ||
|
|
||
| 1. Set your OpenAI API key: | ||
| ```bash | ||
| export OPENAI_API_KEY="your-api-key" | ||
| ``` | ||
|
|
||
| 2. Build the project: | ||
| ```bash | ||
| ./gradlew shadowJar | ||
| ``` | ||
|
|
||
| 3. Run the agent: | ||
| ```bash | ||
| java -jar build/libs/shirtify-dropwizard.jar server src/main/resources/config.yml | ||
| ``` | ||
|
|
||
| Or using Gradle: | ||
| ```bash | ||
| ./gradlew run --args="server src/main/resources/config.yml" | ||
| ``` | ||
|
|
||
| 4. The agent will be available at: | ||
| - Agent Card: `http://localhost:10004/.well-known/agent.json` | ||
| - A2A Endpoint: `http://localhost:10004/` | ||
| - Admin/Health: `http://localhost:10005/healthcheck` | ||
|
|
||
| ## Testing with Rogue | ||
|
|
||
| Run a red team scan against this agent: | ||
|
|
||
| ```bash | ||
| rogue-ai red-team --agent-url http://localhost:10004 --protocol a2a | ||
| ``` | ||
|
|
||
| ## Project Structure | ||
|
|
||
| - `ShirtifyApplication.kt` - Dropwizard Application entry point | ||
| - `ShirtifyConfiguration.kt` - YAML configuration mapping | ||
| - `ShirtifyAgentService.kt` - LangChain4j AI Service (manual wiring) | ||
| - `ShirtifyTools.kt` - Tool definitions (inventory, email) | ||
| - `A2AResource.kt` - Jersey JAX-RS A2A endpoints | ||
| - `AgentHealthCheck.kt` - Dropwizard health check | ||
|
|
||
| ## Tech Stack | ||
|
|
||
| - Kotlin 2.3 | ||
| - Dropwizard 4.0 | ||
| - LangChain4j 1.11.0 | ||
| - Jersey (JAX-RS) | ||
| - Jetty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| plugins { | ||
| kotlin("jvm") version "2.3.0" | ||
| application | ||
| id("com.gradleup.shadow") version "9.0.0-beta12" | ||
| } | ||
|
|
||
| group = "com.shirtify" | ||
| version = "1.0.0" | ||
|
|
||
| application { | ||
| mainClass.set("com.shirtify.agent.ShirtifyApplicationKt") | ||
| } | ||
|
|
||
| java { | ||
| toolchain { | ||
| languageVersion = JavaLanguageVersion.of(25) | ||
| } | ||
| } | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| val dropwizardVersion = "4.0.7" | ||
| val langchain4jVersion = "1.11.0" | ||
|
|
||
| dependencies { | ||
| // Dropwizard | ||
| implementation("io.dropwizard:dropwizard-core:$dropwizardVersion") | ||
|
|
||
| // LangChain4j (core, no Spring Boot starters) | ||
| implementation("dev.langchain4j:langchain4j:$langchain4jVersion") | ||
| implementation("dev.langchain4j:langchain4j-open-ai:$langchain4jVersion") | ||
|
|
||
|
|
||
| // dotenv | ||
| implementation("io.github.cdimascio:dotenv-java:3.1.0") | ||
|
|
||
| // Kotlin | ||
| implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.2") | ||
| implementation("org.jetbrains.kotlin:kotlin-reflect") | ||
|
|
||
| // Test | ||
| testImplementation("io.dropwizard:dropwizard-testing:$dropwizardVersion") | ||
| testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") | ||
| } | ||
|
|
||
| kotlin { | ||
| compilerOptions { | ||
| freeCompilerArgs.addAll("-Xjsr305=strict") | ||
| javaParameters = true // Required for LangChain4j tool parameter names | ||
| } | ||
| } | ||
|
|
||
| tasks.withType<Test> { | ||
| useJUnitPlatform() | ||
| } | ||
|
|
||
| tasks.named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") { | ||
| isZip64 = true | ||
| archiveBaseName.set("shirtify-dropwizard") | ||
| archiveClassifier.set("") | ||
| archiveVersion.set("") | ||
| mergeServiceFiles() | ||
| manifest { | ||
| attributes["Main-Class"] = "com.shirtify.agent.ShirtifyApplicationKt" | ||
| } | ||
| } | ||
Binary file added
BIN
+42.6 KB
examples/kotlin/shirtify-dropwizard/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions
7
examples/kotlin/shirtify-dropwizard/gradle/wrapper/gradle-wrapper.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip | ||
| networkTimeout=10000 | ||
| validateDistributionUrl=true | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Dropwizard 4.0.7 latest version security advisories 2025💡 Result:
What security advisories in 2025 matter for Dropwizard 4.0.7?
Dropwizard 4.0.7 itself (released Mar 6, 2024) doesn’t have a widely-cited “Dropwizard-core” CVE issued in 2025; the main 2025 risk comes from transitive dependencies you may be pulling in.
Notable 2025 advisories that can impact typical Dropwizard apps
Dropwizard-specific advisory (not 2025, but often flagged)
“Latest version” context (so you can patch effectively)
Practical takeaway: for “2025 security advisories” affecting a 4.0.7-based app, you generally need to (1) check the resolved versions of Jersey/BouncyCastle/etc. in your dependency tree, and (2) upgrade Dropwizard (preferably) or override those dependencies to patched versions.
Sources: [1] [2] [3] [4] [5] [6]
🌐 Web query:
LangChain4j 1.11.0 latest stable version security updates 2025💡 Result:
Sources: GitHub Releases (langchain4j/langchain4j) [1], INCIBE CVE-2025-21604 (LangChain4j-AIDeepin) [2], LangChain4j docs “Latest Release Notes” [3].
🌐 Web query:
Kotlin 1.9.25 JVM plugin latest version Java 17 compatibility💡 Result:
1.9.25is published on the Gradle Plugin Portal (created July 19, 2024). [1]org.jetbrains.kotlin.jvmplugin on the Gradle Plugin Portal (as of Feb 4, 2026) is2.3.20-Beta1(created Jan 8, 2026). [2]Java 17 compatibility (with Kotlin 1.9.25 / KGP 1.9.25):
jvmTarget = 17(the Kotlin compiler’s-jvm-targetsupports values including 17). [3]kotlin { jvmToolchain(17) }). [4]Sources:
[1] Gradle Plugin Portal –
org.jetbrains.kotlin.jvmversion 1.9.25 page.[2] Gradle Plugin Portal –
org.jetbrains.kotlin.jvm(latest) page.[3] Kotlin docs – compiler option
-jvm-target.[4] Kotlin docs – Gradle toolchain configuration.
[5] Gradle docs – Java/Gradle compatibility matrix.
🌐 Web query:
jackson-module-kotlin 2.17.2 security advisories latest version💡 Result:
com.fasterxml.jackson.module:jackson-module-kotlin2.17.2: Jackson’s Kotlin module repo currently shows no published security advisories. [1]jackson-module-kotlinpulls injackson-databind(and annotations) as dependencies, so most real-world Jackson CVEs typically apply via those core components rather than the Kotlin module itself. [2]com.fasterxml.jackson.module:jackson-module-kotlindirectory version is 2.20.1 (dated 2025-10-31). [2]Sources:
[1] GitHub Security overview for FasterXML/jackson-module-kotlin (“There aren’t any published security advisories”) (github.com)
[2] Maven Central repository directory listing for
jackson-module-kotlin(shows latest as 2.20.1) (repo1.maven.org)[3] FasterXML Jackson Wiki: “Jackson Release 2.17.2” (released July 5, 2024) (github.com)
Citations:
🌐 Web query:
JUnit Jupiter 5.10.2 latest stable version 2025💡 Result:
JUnit Jupiter 5.10.2 is not the latest stable in 2025.
The latest stable (GA) JUnit Jupiter version released in 2025 was 5.14.1, released October 31, 2025. [1]
(Just before that: 5.14.0, released September 30, 2025.) [2]
Maven/Gradle coordinate:
org.junit.jupiter:junit-jupiter:5.14.1[1]Sources
[1] (docs.junit.org)
[2] (docs.junit.org)
Citations:
Upgrade Dropwizard and dependencies immediately: 4.0.7 is end-of-life (Jan 31, 2026) and has unpatched transitive dependency vulnerabilities.
Dropwizard 4.0.7 (Mar 6, 2024) is at or past EOL with no further support. Additionally, 2025 advisories affect libraries it typically pulls in: CVE-2025-12383 (Eclipse Jersey — SSL configuration bypass) and CVE-2025-8885 (Bouncy Castle — DoS). Upgrade to Dropwizard 5.0.1 (Jan 27, 2026) or at minimum 4.0.17, or manually override Jersey and Bouncy Castle to patched versions.
Other outdated dependencies worth upgrading:
LangChain4j 1.11.0 is the current stable version (no issues).
🤖 Prompt for AI Agents