diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66bfb3c..aaa4cc9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,14 +65,18 @@ jobs: run: ./scripts/build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/arcade-engine-java' + if: |- + github.repository == 'stainless-sdks/arcade-engine-java' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Build and upload Maven artifacts - if: github.repository == 'stainless-sdks/arcade-engine-java' + if: |- + github.repository == 'stainless-sdks/arcade-engine-java' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f14b480..aaf968a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.2" + ".": "0.1.0-alpha.3" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 60fe4f5..ff7d0be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## 0.1.0-alpha.3 (2026-03-09) + +Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/ArcadeAI/arcade-java/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) + +### Features + +* **api:** api update ([4a4a38b](https://github.com/ArcadeAI/arcade-java/commit/4a4a38bd6eb8848183c7a553ab23d28f44a7ca6e)) +* **api:** api update ([b62bebe](https://github.com/ArcadeAI/arcade-java/commit/b62bebeaa3c5341aed692f28cdb76c24ef4588d7)) +* **api:** api update ([ab083dc](https://github.com/ArcadeAI/arcade-java/commit/ab083dc5b22c66bd1a216107ed5d427270f7535f)) +* **api:** api update ([a9067a6](https://github.com/ArcadeAI/arcade-java/commit/a9067a6b9e05ec27d0a4c3bd5a50b5fd568a617f)) +* **api:** Enable publishing for Java SDK ([4e1dd23](https://github.com/ArcadeAI/arcade-java/commit/4e1dd23facb1daf92135fde91bbeb1fefc9e1b76)) + + +### Chores + +* **ci:** skip uploading artifacts on stainless-internal branches ([e37cb5d](https://github.com/ArcadeAI/arcade-java/commit/e37cb5d7f6f23e6be986ae5e3784898e3854a79c)) +* **internal:** bump palantir-java-format ([b1ebae8](https://github.com/ArcadeAI/arcade-java/commit/b1ebae8ff127b1402785df354f2687408ff248b0)) +* **internal:** codegen related update ([8837560](https://github.com/ArcadeAI/arcade-java/commit/883756053127934e8dc3d1ee90148f51c0a48f28)) +* **test:** do not count install time for mock server timeout ([4432b39](https://github.com/ArcadeAI/arcade-java/commit/4432b393c3ce20da89bb217f019dbf3221d41d0e)) + ## 0.1.0-alpha.2 (2026-02-28) Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/ArcadeAI/arcade-java/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) diff --git a/README.md b/README.md index ba7b7af..1e76d79 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/dev.arcade/arcade-java)](https://central.sonatype.com/artifact/dev.arcade/arcade-java/0.1.0-alpha.2) -[![javadoc](https://javadoc.io/badge2/dev.arcade/arcade-java/0.1.0-alpha.2/javadoc.svg)](https://javadoc.io/doc/dev.arcade/arcade-java/0.1.0-alpha.2) +[![Maven Central](https://img.shields.io/maven-central/v/dev.arcade/arcade-java)](https://central.sonatype.com/artifact/dev.arcade/arcade-java/0.1.0-alpha.3) +[![javadoc](https://javadoc.io/badge2/dev.arcade/arcade-java/0.1.0-alpha.3/javadoc.svg)](https://javadoc.io/doc/dev.arcade/arcade-java/0.1.0-alpha.3) @@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [docs.arcade.dev](https://docs.arcade.dev). Javadocs are available on [javadoc.io](https://javadoc.io/doc/dev.arcade/arcade-java/0.1.0-alpha.2). +The REST API documentation can be found on [docs.arcade.dev](https://docs.arcade.dev). Javadocs are available on [javadoc.io](https://javadoc.io/doc/dev.arcade/arcade-java/0.1.0-alpha.3). @@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.arcade.dev](https://docs.arcade ### Gradle ```kotlin -implementation("dev.arcade:arcade-java:0.1.0-alpha.2") +implementation("dev.arcade:arcade-java:0.1.0-alpha.3") ``` ### Maven @@ -33,7 +33,7 @@ implementation("dev.arcade:arcade-java:0.1.0-alpha.2") dev.arcade arcade-java - 0.1.0-alpha.2 + 0.1.0-alpha.3 ``` diff --git a/arcade-java-core/src/main/kotlin/dev/arcade/core/http/RetryingHttpClient.kt b/arcade-java-core/src/main/kotlin/dev/arcade/core/http/RetryingHttpClient.kt index 6fe3c03..d1b6f0c 100644 --- a/arcade-java-core/src/main/kotlin/dev/arcade/core/http/RetryingHttpClient.kt +++ b/arcade-java-core/src/main/kotlin/dev/arcade/core/http/RetryingHttpClient.kt @@ -214,13 +214,8 @@ private constructor( } } ?.let { retryAfterNanos -> - // If the API asks us to wait a certain amount of time (and it's a reasonable - // amount), just - // do what it says. - val retryAfter = Duration.ofNanos(retryAfterNanos.toLong()) - if (retryAfter in Duration.ofNanos(0)..Duration.ofMinutes(1)) { - return retryAfter - } + // If the API asks us to wait a certain amount of time, do what it says. + return Duration.ofNanos(retryAfterNanos.toLong()) } // Apply exponential backoff, but not more than the max. diff --git a/arcade-java-example/src/main/java/dev/arcade/example/QuickStartExample.java b/arcade-java-example/src/main/java/dev/arcade/example/QuickStartExample.java index 4bad391..a866c60 100644 --- a/arcade-java-example/src/main/java/dev/arcade/example/QuickStartExample.java +++ b/arcade-java-example/src/main/java/dev/arcade/example/QuickStartExample.java @@ -67,19 +67,16 @@ public static void main(String[] args) { userId); // Print the response from the tool call - logger.info( - """ - Success! Check your email at {} - - You just chained 3 tools together: - 1. Searched Google News for stories about MCP URL mode elicitation - 2. Created a Google Doc with the results - 3. Sent yourself an email with the document link - - Email metadata: {} - """, - userId, - sendEmailResult); + logger.info(""" + Success! Check your email at {} + + You just chained 3 tools together: + 1. Searched Google News for stories about MCP URL mode elicitation + 2. Created a Google Doc with the results + 3. Sent yourself an email with the document link + + Email metadata: {} + """, userId, sendEmailResult); } /** @@ -101,14 +98,11 @@ public static Map authorizeAndRunTool( .status() .filter(status -> status != AuthorizationResponse.Status.COMPLETED) .flatMap(status -> authResponse.url()) - .ifPresent(url -> logger.info( - """ - Click this link to authorize {}: - {}. - The process will continue once you have authorized the app. - """, - toolName, - url)); + .ifPresent(url -> logger.info(""" + Click this link to authorize {}: + {}. + The process will continue once you have authorized the app. + """, toolName, url)); client.auth().waitForCompletion(authResponse); // Execute the tool and extract the output as a Map diff --git a/arcade-java-example/src/main/java/dev/arcade/example/springai/SpringAIExample.java b/arcade-java-example/src/main/java/dev/arcade/example/springai/SpringAIExample.java index 2b4a6b7..aec82cf 100644 --- a/arcade-java-example/src/main/java/dev/arcade/example/springai/SpringAIExample.java +++ b/arcade-java-example/src/main/java/dev/arcade/example/springai/SpringAIExample.java @@ -22,8 +22,7 @@ @SpringBootApplication public class SpringAIExample { - private static final String SYSTEM_PROMPT = - """ + private static final String SYSTEM_PROMPT = """ You are a specialized Music Assistant with access to two MCP tools: get_spotify_state and play_song. Your goal is to provide a seamless, proactive audio experience. Follow these operational guidelines: Context Awareness: Before playing any music, always use get_spotify_state to see if music is already playing. If it is, acknowledge what is currently playing before switching to the new track. @@ -86,14 +85,11 @@ String play(@ToolParam(description = "The name of the artist to play") String na * * @return A string object of the playback state. */ - @Tool( - name = "get_spotify_state", - description = - """ - Get information about the user's current playback state, - including track or episode, and active device. - This tool does not perform any actions. Use other tools to control playback. - """) + @Tool(name = "get_spotify_state", description = """ + Get information about the user's current playback state, + including track or episode, and active device. + This tool does not perform any actions. Use other tools to control playback. + """) String playbackState() { return executeTool("Spotify.GetPlaybackState", Map.of()); } diff --git a/build.gradle.kts b/build.gradle.kts index 7316284..33d4c61 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ repositories { allprojects { group = "dev.arcade" - version = "0.1.0-alpha.2" // x-release-please-version + version = "0.1.0-alpha.3" // x-release-please-version } subprojects { diff --git a/buildSrc/src/main/kotlin/arcade.java.gradle.kts b/buildSrc/src/main/kotlin/arcade.java.gradle.kts index 81d5d32..a3cfe28 100644 --- a/buildSrc/src/main/kotlin/arcade.java.gradle.kts +++ b/buildSrc/src/main/kotlin/arcade.java.gradle.kts @@ -54,7 +54,7 @@ tasks.withType().configureEach { val palantir by configurations.creating dependencies { - palantir("com.palantir.javaformat:palantir-java-format:2.73.0") + palantir("com.palantir.javaformat:palantir-java-format:2.89.0") } fun registerPalantir( diff --git a/scripts/mock b/scripts/mock index 0b28f6e..bcf3b39 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - # Wait for server to come online + # Wait for server to come online (max 30s) echo -n "Waiting for server" + attempts=0 while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Prism server to start" + cat .prism.log + exit 1 + fi echo -n "." sleep 0.1 done