From df9be74e9177579935e429d40c1c2574fd7f45e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 18:37:25 +0000 Subject: [PATCH 01/14] feat(api): manual updates --- .github/workflows/publish-sonatype.yml | 41 ++++++++++++ .github/workflows/release-doctor.yml | 24 +++++++ .release-please-manifest.json | 3 + .stats.yml | 2 +- README.md | 14 +++- bin/check-release-environment | 33 +++++++++ build.gradle.kts | 2 +- .../main/kotlin/stagehand.publish.gradle.kts | 6 +- release-please-config.json | 67 +++++++++++++++++++ .../kotlin/com/stagehand/api/core/Check.kt | 2 +- 10 files changed, 187 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/publish-sonatype.yml create mode 100644 .github/workflows/release-doctor.yml create mode 100644 .release-please-manifest.json create mode 100644 bin/check-release-environment create mode 100644 release-please-config.json diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml new file mode 100644 index 0000000..6a27d98 --- /dev/null +++ b/.github/workflows/publish-sonatype.yml @@ -0,0 +1,41 @@ +# This workflow is triggered when a GitHub release is created. +# It can also be run manually to re-publish to Sonatype in case it failed for some reason. +# You can run this workflow by navigating to https://www.github.com/browserbase/stagehand-java/actions/workflows/publish-sonatype.yml +name: Publish Sonatype +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: | + 8 + 21 + cache: gradle + + - name: Set up Gradle + uses: gradle/gradle-build-action@v2 + + - name: Publish to Sonatype + run: |- + export -- GPG_SIGNING_KEY_ID + printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD" + GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')" + ./gradlew publish --no-configuration-cache + env: + SONATYPE_USERNAME: ${{ secrets.STAGEHAND_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} + GPG_SIGNING_KEY: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} + GPG_SIGNING_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 0000000..a6e0235 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,24 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'browserbase/stagehand-java' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + SONATYPE_USERNAME: ${{ secrets.STAGEHAND_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} + GPG_SIGNING_KEY: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} + GPG_SIGNING_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..1332969 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1" +} \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index acffb05..67a8e43 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-0c12f985340be2a9287e8e01ff8733f7f2d02e019149d1ae95f1a8f8798c6690.yml openapi_spec_hash: efb79934e1dc63763dd4e8493b825273 -config_hash: 5f3345d1d825e49f896f3b0e493e6938 +config_hash: cb2b1795c195a63201c8ef7a617934d1 diff --git a/README.md b/README.md index 02a29e4..e2377af 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,26 @@ # Stagehand Java API Library + + [![Maven Central](https://img.shields.io/maven-central/v/com.stagehand.api/stagehand-java)](https://central.sonatype.com/artifact/com.stagehand.api/stagehand-java/0.0.1) [![javadoc](https://javadoc.io/badge2/com.stagehand.api/stagehand-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.stagehand.api/stagehand-java/0.0.1) + + The Stagehand Java SDK provides convenient access to the [Stagehand REST API](https://browserbase.com) from applications written in Java. It is generated with [Stainless](https://www.stainless.com/). + + The REST API documentation can be found on [browserbase.com](https://browserbase.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.stagehand.api/stagehand-java/0.0.1). + + ## Installation + + ### Gradle ```kotlin @@ -27,6 +37,8 @@ implementation("com.stagehand.api:stagehand-java:0.0.1") ``` + + ## Requirements This library requires Java 8 or later. @@ -632,4 +644,4 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. -We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/stagehand-java/issues) with questions, bugs, or suggestions. +We are keen for your feedback; please open an [issue](https://www.github.com/browserbase/stagehand-java/issues) with questions, bugs, or suggestions. diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 0000000..3a6a7b4 --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${SONATYPE_USERNAME}" ]; then + errors+=("The SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +if [ -z "${SONATYPE_PASSWORD}" ]; then + errors+=("The SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +if [ -z "${GPG_SIGNING_KEY}" ]; then + errors+=("The GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +if [ -z "${GPG_SIGNING_PASSWORD}" ]; then + errors+=("The GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/build.gradle.kts b/build.gradle.kts index cca6e8a..5703c44 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ repositories { allprojects { group = "com.stagehand.api" - version = "0.0.1" + version = "0.0.1" // x-release-please-version } subprojects { diff --git a/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts b/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts index df771cd..326eeea 100644 --- a/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts @@ -26,9 +26,9 @@ configure { } scm { - connection.set("scm:git:git://github.com/stainless-sdks/stagehand-java.git") - developerConnection.set("scm:git:git://github.com/stainless-sdks/stagehand-java.git") - url.set("https://github.com/stainless-sdks/stagehand-java") + connection.set("scm:git:git://github.com/browserbase/stagehand-java.git") + developerConnection.set("scm:git:git://github.com/browserbase/stagehand-java.git") + url.set("https://github.com/browserbase/stagehand-java") } versionMapping { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..8f98719 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,67 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "simple", + "extra-files": [ + "README.md", + "build.gradle.kts" + ] +} \ No newline at end of file diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt b/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt index e61fae8..21ef979 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt +++ b/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt @@ -77,7 +77,7 @@ This can happen if you are either: Double-check that you are depending on compatible Jackson versions. -See https://www.github.com/stainless-sdks/stagehand-java#jackson for more information. +See https://www.github.com/browserbase/stagehand-java#jackson for more information. """ .trimIndent() } From 051317bb6932ec86f0a990e181ffdce23c674785 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:02:53 +0000 Subject: [PATCH 02/14] feat(api): tweak branding and fix some config fields --- .github/workflows/publish-sonatype.yml | 8 +- .github/workflows/release-doctor.yml | 8 +- .stats.yml | 2 +- LICENSE | 2 +- README.md | 195 +++++++++--------- SECURITY.md | 2 +- .../build.gradle.kts | 6 +- .../client/okhttp/BrowserbaseOkHttpClient.kt | 37 ++-- .../okhttp/BrowserbaseOkHttpClientAsync.kt | 37 ++-- .../api/client/okhttp/OkHttpClient.kt | 8 +- .../api/client/okhttp/OkHttpClientTest.kt | 0 .../build.gradle.kts | 6 +- .../stagehand/api/client/BrowserbaseClient.kt | 14 +- .../api/client/BrowserbaseClientAsync.kt | 13 +- .../api/client/BrowserbaseClientAsyncImpl.kt | 21 +- .../api/client/BrowserbaseClientImpl.kt | 20 +- .../stagehand/api/core/BaseDeserializer.kt | 0 .../com/stagehand/api/core/BaseSerializer.kt | 0 .../kotlin/com/stagehand/api/core/Check.kt | 0 .../com/stagehand/api/core/ClientOptions.kt | 60 +++--- .../com/stagehand/api/core/DefaultSleeper.kt | 0 .../com/stagehand/api/core/ObjectMappers.kt | 0 .../kotlin/com/stagehand/api/core/Params.kt | 0 .../stagehand/api/core/PhantomReachable.kt | 4 +- .../core/PhantomReachableExecutorService.kt | 0 .../api/core/PhantomReachableSleeper.kt | 0 .../com/stagehand/api/core/PrepareRequest.kt | 0 .../com/stagehand/api/core/Properties.kt | 4 +- .../com/stagehand/api/core/RequestOptions.kt | 0 .../kotlin/com/stagehand/api/core/Sleeper.kt | 0 .../kotlin/com/stagehand/api/core/Timeout.kt | 0 .../kotlin/com/stagehand/api/core/Utils.kt | 4 +- .../kotlin/com/stagehand/api/core/Values.kt | 12 +- .../api/core/handlers/ErrorHandler.kt | 0 .../api/core/handlers/JsonHandler.kt | 4 +- .../api/core/handlers/StringHandler.kt | 0 .../api/core/http/AsyncStreamResponse.kt | 0 .../com/stagehand/api/core/http/Headers.kt | 0 .../com/stagehand/api/core/http/HttpClient.kt | 0 .../com/stagehand/api/core/http/HttpMethod.kt | 0 .../stagehand/api/core/http/HttpRequest.kt | 0 .../api/core/http/HttpRequestBodies.kt | 6 +- .../api/core/http/HttpRequestBody.kt | 0 .../stagehand/api/core/http/HttpResponse.kt | 0 .../api/core/http/HttpResponseFor.kt | 0 ...ntomReachableClosingAsyncStreamResponse.kt | 0 .../http/PhantomReachableClosingHttpClient.kt | 0 .../PhantomReachableClosingStreamResponse.kt | 0 .../stagehand/api/core/http/QueryParams.kt | 0 .../api/core/http/RetryingHttpClient.kt | 8 +- .../stagehand/api/core/http/StreamResponse.kt | 0 .../api/errors/BadRequestException.kt | 2 +- .../api/errors/BrowserbaseException.kt | 2 +- .../errors/BrowserbaseInvalidDataException.kt | 5 +- .../api/errors/BrowserbaseIoException.kt | 5 +- .../errors/BrowserbaseRetryableException.kt | 5 +- .../api/errors/BrowserbaseServiceException.kt | 4 +- .../api/errors/InternalServerException.kt | 2 +- .../stagehand/api/errors/NotFoundException.kt | 2 +- .../api/errors/PermissionDeniedException.kt | 2 +- .../api/errors/RateLimitException.kt | 2 +- .../api/errors/UnauthorizedException.kt | 2 +- .../errors/UnexpectedStatusCodeException.kt | 2 +- .../errors/UnprocessableEntityException.kt | 2 +- .../stagehand/api/models/sessions/Action.kt | 14 +- .../api/models/sessions/ModelConfig.kt | 22 +- .../api/models/sessions/SessionActParams.kt | 42 ++-- .../api/models/sessions/SessionActResponse.kt | 10 +- .../api/models/sessions/SessionEndParams.kt | 0 .../api/models/sessions/SessionEndResponse.kt | 6 +- .../sessions/SessionExecuteAgentParams.kt | 62 +++--- .../sessions/SessionExecuteAgentResponse.kt | 8 +- .../models/sessions/SessionExtractParams.kt | 40 ++-- .../models/sessions/SessionExtractResponse.kt | 14 +- .../models/sessions/SessionNavigateParams.kt | 42 ++-- .../sessions/SessionNavigateResponse.kt | 10 +- .../models/sessions/SessionObserveParams.kt | 34 +-- .../api/models/sessions/SessionStartParams.kt | 54 ++--- .../models/sessions/SessionStartResponse.kt | 8 +- .../api/services/async/SessionServiceAsync.kt | 0 .../services/async/SessionServiceAsyncImpl.kt | 0 .../api/services/blocking/SessionService.kt | 0 .../services/blocking/SessionServiceImpl.kt | 0 .../proguard/browserbase-java-core.pro | 0 .../com/stagehand/api/TestServerExtension.kt | 0 .../stagehand/api/core/ClientOptionsTest.kt | 0 .../stagehand/api/core/ObjectMappersTest.kt | 0 .../api/core/PhantomReachableTest.kt | 0 .../com/stagehand/api/core/UtilsTest.kt | 0 .../com/stagehand/api/core/ValuesTest.kt | 0 .../api/core/http/AsyncStreamResponseTest.kt | 0 .../stagehand/api/core/http/HeadersTest.kt | 0 .../api/core/http/QueryParamsTest.kt | 0 .../api/core/http/RetryingHttpClientTest.kt | 6 +- .../api/models/sessions/ActionTest.kt | 0 .../api/models/sessions/ModelConfigTest.kt | 0 .../models/sessions/SessionActParamsTest.kt | 0 .../models/sessions/SessionActResponseTest.kt | 0 .../models/sessions/SessionEndParamsTest.kt | 0 .../models/sessions/SessionEndResponseTest.kt | 0 .../sessions/SessionExecuteAgentParamsTest.kt | 0 .../SessionExecuteAgentResponseTest.kt | 0 .../sessions/SessionExtractParamsTest.kt | 0 .../sessions/SessionExtractResponseTest.kt | 4 +- .../sessions/SessionNavigateParamsTest.kt | 0 .../sessions/SessionNavigateResponseTest.kt | 0 .../sessions/SessionObserveParamsTest.kt | 0 .../models/sessions/SessionStartParamsTest.kt | 0 .../sessions/SessionStartResponseTest.kt | 0 .../api/services/ErrorHandlingTest.kt | 12 +- .../api/services/ServiceParamsTest.kt | 8 +- .../services/async/SessionServiceAsyncTest.kt | 16 +- .../services/blocking/SessionServiceTest.kt | 16 +- browserbase-java-example/build.gradle.kts | 28 +++ browserbase-java-lib/.keep | 4 + .../build.gradle.kts | 8 +- .../api/proguard/ProGuardCompatibilityTest.kt | 6 +- .../test.pro | 0 .../build.gradle.kts | 6 +- build.gradle.kts | 2 +- ...gradle.kts => browserbase.java.gradle.kts} | 0 ...adle.kts => browserbase.kotlin.gradle.kts} | 2 +- ...dle.kts => browserbase.publish.gradle.kts} | 2 +- settings.gradle.kts | 4 +- 124 files changed, 527 insertions(+), 481 deletions(-) rename {stagehand-java-client-okhttp => browserbase-java-client-okhttp}/build.gradle.kts (76%) rename stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClient.kt => browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt (91%) rename stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClientAsync.kt => browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt (90%) rename {stagehand-java-client-okhttp => browserbase-java-client-okhttp}/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt (96%) rename {stagehand-java-client-okhttp => browserbase-java-client-okhttp}/src/test/kotlin/com/stagehand/api/client/okhttp/OkHttpClientTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/build.gradle.kts (93%) rename stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClient.kt => browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClient.kt (85%) rename stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsync.kt => browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsync.kt (87%) rename stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsyncImpl.kt => browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt (69%) rename stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientImpl.kt => browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt (69%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/BaseDeserializer.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/BaseSerializer.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/Check.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt (88%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/DefaultSleeper.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/ObjectMappers.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/Params.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt (92%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/PhantomReachableExecutorService.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/PhantomReachableSleeper.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/PrepareRequest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/Properties.kt (88%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/RequestOptions.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/Sleeper.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/Timeout.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/Utils.kt (96%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/Values.kt (97%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/handlers/ErrorHandler.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt (80%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/handlers/StringHandler.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/AsyncStreamResponse.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/Headers.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/HttpMethod.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/HttpRequest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt (96%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBody.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/HttpResponse.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/HttpResponseFor.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingHttpClient.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingStreamResponse.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/QueryParams.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt (97%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/core/http/StreamResponse.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt (97%) rename stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandException.kt => browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseException.kt (82%) rename stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandInvalidDataException.kt => browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt (58%) rename stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandIoException.kt => browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseIoException.kt (61%) rename stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandRetryableException.kt => browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseRetryableException.kt (85%) rename stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandServiceException.kt => browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseServiceException.kt (80%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt (97%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt (97%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt (97%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt (97%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt (97%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt (97%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt (97%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt (93%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt (96%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndParams.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt (96%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt (94%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt (94%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsync.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsyncImpl.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/services/blocking/SessionService.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/main/kotlin/com/stagehand/api/services/blocking/SessionServiceImpl.kt (100%) rename stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro => browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/TestServerExtension.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/core/ClientOptionsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/core/ObjectMappersTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/core/PhantomReachableTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/core/UtilsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/core/ValuesTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/core/http/AsyncStreamResponseTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/core/http/HeadersTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/core/http/QueryParamsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt (98%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/ActionTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/ModelConfigTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionActParamsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionActResponseTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndParamsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndResponseTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParamsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponseTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractParamsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateParamsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponseTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionObserveParamsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartParamsTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartResponseTest.kt (100%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt (98%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt (92%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt (95%) rename {stagehand-java-core => browserbase-java-core}/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt (95%) create mode 100644 browserbase-java-example/build.gradle.kts create mode 100644 browserbase-java-lib/.keep rename {stagehand-java-proguard-test => browserbase-java-proguard-test}/build.gradle.kts (90%) rename {stagehand-java-proguard-test => browserbase-java-proguard-test}/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt (93%) rename {stagehand-java-proguard-test => browserbase-java-proguard-test}/test.pro (100%) rename {stagehand-java => browserbase-java}/build.gradle.kts (85%) rename buildSrc/src/main/kotlin/{stagehand.java.gradle.kts => browserbase.java.gradle.kts} (100%) rename buildSrc/src/main/kotlin/{stagehand.kotlin.gradle.kts => browserbase.kotlin.gradle.kts} (99%) rename buildSrc/src/main/kotlin/{stagehand.publish.gradle.kts => browserbase.publish.gradle.kts} (97%) diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml index 6a27d98..f40e546 100644 --- a/.github/workflows/publish-sonatype.yml +++ b/.github/workflows/publish-sonatype.yml @@ -35,7 +35,7 @@ jobs: GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')" ./gradlew publish --no-configuration-cache env: - SONATYPE_USERNAME: ${{ secrets.STAGEHAND_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} - GPG_SIGNING_KEY: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} - GPG_SIGNING_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} \ No newline at end of file + SONATYPE_USERNAME: ${{ secrets.BROWSERBASE_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.BROWSERBASE_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} + GPG_SIGNING_KEY: ${{ secrets.BROWSERBASE_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} + GPG_SIGNING_PASSWORD: ${{ secrets.BROWSERBASE_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index a6e0235..aac0446 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -18,7 +18,7 @@ jobs: run: | bash ./bin/check-release-environment env: - SONATYPE_USERNAME: ${{ secrets.STAGEHAND_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} - GPG_SIGNING_KEY: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} - GPG_SIGNING_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.BROWSERBASE_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.BROWSERBASE_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} + GPG_SIGNING_KEY: ${{ secrets.BROWSERBASE_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} + GPG_SIGNING_PASSWORD: ${{ secrets.BROWSERBASE_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} diff --git a/.stats.yml b/.stats.yml index 67a8e43..18b7af8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-0c12f985340be2a9287e8e01ff8733f7f2d02e019149d1ae95f1a8f8798c6690.yml openapi_spec_hash: efb79934e1dc63763dd4e8493b825273 -config_hash: cb2b1795c195a63201c8ef7a617934d1 +config_hash: 1548ab91b7e8621f7fa79e8cff0c3f93 diff --git a/LICENSE b/LICENSE index 6b24314..2cec9d4 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Stagehand + Copyright 2025 Browserbase Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index e2377af..9c68b67 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -# Stagehand Java API Library +# Browserbase Java API Library -[![Maven Central](https://img.shields.io/maven-central/v/com.stagehand.api/stagehand-java)](https://central.sonatype.com/artifact/com.stagehand.api/stagehand-java/0.0.1) -[![javadoc](https://javadoc.io/badge2/com.stagehand.api/stagehand-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.stagehand.api/stagehand-java/0.0.1) +[![Maven Central](https://img.shields.io/maven-central/v/com.stagehand.api/browserbase-java)](https://central.sonatype.com/artifact/com.stagehand.api/browserbase-java/0.0.1) +[![javadoc](https://javadoc.io/badge2/com.stagehand.api/browserbase-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.stagehand.api/browserbase-java/0.0.1) -The Stagehand Java SDK provides convenient access to the [Stagehand REST API](https://browserbase.com) from applications written in Java. +The Browserbase Java SDK provides convenient access to the [Browserbase REST API](https://browserbase.com) from applications written in Java. It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [browserbase.com](https://browserbase.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.stagehand.api/stagehand-java/0.0.1). +The REST API documentation can be found on [browserbase.com](https://browserbase.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.stagehand.api/browserbase-java/0.0.1). @@ -24,7 +24,7 @@ The REST API documentation can be found on [browserbase.com](https://browserbase ### Gradle ```kotlin -implementation("com.stagehand.api:stagehand-java:0.0.1") +implementation("com.stagehand.api:browserbase-java:0.0.1") ``` ### Maven @@ -32,7 +32,7 @@ implementation("com.stagehand.api:stagehand-java:0.0.1") ```xml com.stagehand.api - stagehand-java + browserbase-java 0.0.1 ``` @@ -46,14 +46,14 @@ This library requires Java 8 or later. ## Usage ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; import com.stagehand.api.models.sessions.SessionStartParams; import com.stagehand.api.models.sessions.SessionStartResponse; -// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables -StagehandClient client = StagehandOkHttpClient.fromEnv(); +// Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties +// Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables +BrowserbaseClient client = BrowserbaseOkHttpClient.fromEnv(); SessionStartParams params = SessionStartParams.builder() .env(SessionStartParams.Env.LOCAL) @@ -66,21 +66,21 @@ SessionStartResponse response = client.sessions().start(params); Configure the client using system properties or environment variables: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; -// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables -StagehandClient client = StagehandOkHttpClient.fromEnv(); +// Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties +// Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables +BrowserbaseClient client = BrowserbaseOkHttpClient.fromEnv(); ``` Or manually: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; -StagehandClient client = StagehandOkHttpClient.builder() +BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .apiKey("My API Key") .build(); ``` @@ -88,12 +88,12 @@ StagehandClient client = StagehandOkHttpClient.builder() Or using a combination of the two approaches: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; -StagehandClient client = StagehandOkHttpClient.builder() - // Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties - // Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables +BrowserbaseClient client = BrowserbaseOkHttpClient.builder() + // Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties + // Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables .fromEnv() .apiKey("My API Key") .build(); @@ -101,10 +101,10 @@ StagehandClient client = StagehandOkHttpClient.builder() See this table for the available options: -| Setter | System property | Environment variable | Required | Default value | -| --------- | ------------------- | -------------------- | -------- | ---------------------------- | -| `apiKey` | `stagehand.apiKey` | `STAGEHAND_API_KEY` | false | - | -| `baseUrl` | `stagehand.baseUrl` | `STAGEHAND_BASE_URL` | true | `"http://localhost:3000/v1"` | +| Setter | System property | Environment variable | Required | Default value | +| --------- | ----------------------------- | ---------------------- | -------- | -------------------------------------------- | +| `apiKey` | `browserbase.stagehandApiKey` | `STAGEHAND_API_KEY` | true | - | +| `baseUrl` | `browserbase.baseUrl` | `BROWSERBASE_BASE_URL` | true | `"https://api.stagehand.browserbase.com/v1"` | System properties take precedence over environment variables. @@ -117,9 +117,9 @@ System properties take precedence over environment variables. To temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service: ```java -import com.stagehand.api.client.StagehandClient; +import com.stagehand.api.client.BrowserbaseClient; -StagehandClient clientWithOptions = client.withOptions(optionsBuilder -> { +BrowserbaseClient clientWithOptions = client.withOptions(optionsBuilder -> { optionsBuilder.baseUrl("https://example.com"); optionsBuilder.maxRetries(42); }); @@ -129,7 +129,7 @@ The `withOptions()` method does not affect the original client or service. ## Requests and responses -To send a request to the Stagehand API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class. +To send a request to the Browserbase API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class. For example, `client.sessions().start(...)` should be called with an instance of `SessionStartParams`, and it will return an instance of `SessionStartResponse`. @@ -146,15 +146,15 @@ Because each class is immutable, builder modification will _never_ affect alread The default client is synchronous. To switch to asynchronous execution, call the `async()` method: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; import com.stagehand.api.models.sessions.SessionStartParams; import com.stagehand.api.models.sessions.SessionStartResponse; import java.util.concurrent.CompletableFuture; -// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables -StagehandClient client = StagehandOkHttpClient.fromEnv(); +// Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties +// Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables +BrowserbaseClient client = BrowserbaseOkHttpClient.fromEnv(); SessionStartParams params = SessionStartParams.builder() .env(SessionStartParams.Env.LOCAL) @@ -165,15 +165,15 @@ CompletableFuture response = client.async().sessions().sta Or create an asynchronous client from the beginning: ```java -import com.stagehand.api.client.StagehandClientAsync; -import com.stagehand.api.client.okhttp.StagehandOkHttpClientAsync; +import com.stagehand.api.client.BrowserbaseClientAsync; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClientAsync; import com.stagehand.api.models.sessions.SessionStartParams; import com.stagehand.api.models.sessions.SessionStartResponse; import java.util.concurrent.CompletableFuture; -// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables -StagehandClientAsync client = StagehandOkHttpClientAsync.fromEnv(); +// Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties +// Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables +BrowserbaseClientAsync client = BrowserbaseOkHttpClientAsync.fromEnv(); SessionStartParams params = SessionStartParams.builder() .env(SessionStartParams.Env.LOCAL) @@ -216,46 +216,46 @@ SessionStartResponse parsedResponse = response.parse(); The SDK throws custom unchecked exception types: -- [`StagehandServiceException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code: +- [`BrowserbaseServiceException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code: - | Status | Exception | - | ------ | -------------------------------------------------------------------------------------------------------------------------------- | - | 400 | [`BadRequestException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt) | - | 401 | [`UnauthorizedException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt) | - | 403 | [`PermissionDeniedException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt) | - | 404 | [`NotFoundException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt) | - | 422 | [`UnprocessableEntityException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt) | - | 429 | [`RateLimitException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt) | - | 5xx | [`InternalServerException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt) | - | others | [`UnexpectedStatusCodeException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt) | + | Status | Exception | + | ------ | ---------------------------------------------------------------------------------------------------------------------------------- | + | 400 | [`BadRequestException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt) | + | 401 | [`UnauthorizedException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt) | + | 403 | [`PermissionDeniedException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt) | + | 404 | [`NotFoundException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt) | + | 422 | [`UnprocessableEntityException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt) | + | 429 | [`RateLimitException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt) | + | 5xx | [`InternalServerException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt) | + | others | [`UnexpectedStatusCodeException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt) | -- [`StagehandIoException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandIoException.kt): I/O networking errors. +- [`BrowserbaseIoException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseIoException.kt): I/O networking errors. -- [`StagehandRetryableException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandRetryableException.kt): Generic error indicating a failure that could be retried by the client. +- [`BrowserbaseRetryableException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseRetryableException.kt): Generic error indicating a failure that could be retried by the client. -- [`StagehandInvalidDataException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. +- [`BrowserbaseInvalidDataException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. -- [`StagehandException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. +- [`BrowserbaseException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. ## Logging The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor). -Enable logging by setting the `STAGEHAND_LOG` environment variable to `info`: +Enable logging by setting the `BROWSERBASE_LOG` environment variable to `info`: ```sh -export STAGEHAND_LOG=info +export BROWSERBASE_LOG=info ``` Or to `debug` for more verbose logging: ```sh -export STAGEHAND_LOG=debug +export BROWSERBASE_LOG=debug ``` ## ProGuard and R8 -Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `stagehand-java-core` is published with a [configuration file](stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage). +Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `browserbase-java-core` is published with a [configuration file](browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage). ProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary. @@ -265,7 +265,7 @@ The SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON seri The SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config). -If the SDK threw an exception, but you're _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`StagehandOkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClient.kt) or [`StagehandOkHttpClientAsync`](stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClientAsync.kt). +If the SDK threw an exception, but you're _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt). > [!CAUTION] > We make no guarantee that the SDK works correctly when the Jackson version check is disabled. @@ -289,10 +289,10 @@ The API may also explicitly instruct the SDK to retry or not retry a request. To set a custom number of retries, configure the client using the `maxRetries` method: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; -StagehandClient client = StagehandOkHttpClient.builder() +BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() .maxRetries(4) .build(); @@ -315,11 +315,11 @@ SessionStartResponse response = client.sessions().start( Or configure the default for all method calls at the client level: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; import java.time.Duration; -StagehandClient client = StagehandOkHttpClient.builder() +BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() .timeout(Duration.ofSeconds(30)) .build(); @@ -330,12 +330,12 @@ StagehandClient client = StagehandOkHttpClient.builder() To route requests through a proxy, configure the client using the `proxy` method: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; import java.net.InetSocketAddress; import java.net.Proxy; -StagehandClient client = StagehandOkHttpClient.builder() +BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() .proxy(new Proxy( Proxy.Type.HTTP, new InetSocketAddress( @@ -354,10 +354,10 @@ StagehandClient client = StagehandOkHttpClient.builder() To configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; -StagehandClient client = StagehandOkHttpClient.builder() +BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa. .sslSocketFactory(yourSSLSocketFactory) @@ -371,12 +371,13 @@ StagehandClient client = StagehandOkHttpClient.builder() The SDK sends requests to the production by default. To send requests to a different environment, configure the client like so: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; -StagehandClient client = StagehandOkHttpClient.builder() +BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() - .environment1() + // Other options include `local` + .dev() .build(); ``` @@ -384,15 +385,15 @@ StagehandClient client = StagehandOkHttpClient.builder() The SDK consists of three artifacts: -- `stagehand-java-core` +- `browserbase-java-core` - Contains core SDK logic - Does not depend on [OkHttp](https://square.github.io/okhttp) - - Exposes [`StagehandClient`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClient.kt), [`StagehandClientAsync`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsync.kt), [`StagehandClientImpl`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientImpl.kt), and [`StagehandClientAsyncImpl`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsyncImpl.kt), all of which can work with any HTTP client -- `stagehand-java-client-okhttp` + - Exposes [`BrowserbaseClient`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClient.kt), [`BrowserbaseClientAsync`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsync.kt), [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt), and [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt), all of which can work with any HTTP client +- `browserbase-java-client-okhttp` - Depends on [OkHttp](https://square.github.io/okhttp) - - Exposes [`StagehandOkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClient.kt) and [`StagehandOkHttpClientAsync`](stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClientAsync.kt), which provide a way to construct [`StagehandClientImpl`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientImpl.kt) and [`StagehandClientAsyncImpl`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsyncImpl.kt), respectively, using OkHttp -- `stagehand-java` - - Depends on and exposes the APIs of both `stagehand-java-core` and `stagehand-java-client-okhttp` + - Exposes [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt) and [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), which provide a way to construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt) and [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt), respectively, using OkHttp +- `browserbase-java` + - Depends on and exposes the APIs of both `browserbase-java-core` and `browserbase-java-client-okhttp` - Does not have its own logic This structure allows replacing the SDK's default HTTP client without pulling in unnecessary dependencies. @@ -404,17 +405,17 @@ This structure allows replacing the SDK's default HTTP client without pulling in To use a customized `OkHttpClient`: -1. Replace your [`stagehand-java` dependency](#installation) with `stagehand-java-core` -2. Copy `stagehand-java-client-okhttp`'s [`OkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt) class into your code and customize it -3. Construct [`StagehandClientImpl`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientImpl.kt) or [`StagehandClientAsyncImpl`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsyncImpl.kt), similarly to [`StagehandOkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClient.kt) or [`StagehandOkHttpClientAsync`](stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClientAsync.kt), using your customized client +1. Replace your [`browserbase-java` dependency](#installation) with `browserbase-java-core` +2. Copy `browserbase-java-client-okhttp`'s [`OkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt) class into your code and customize it +3. Construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt) or [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt), similarly to [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), using your customized client ### Completely custom HTTP client To use a completely custom HTTP client: -1. Replace your [`stagehand-java` dependency](#installation) with `stagehand-java-core` -2. Write a class that implements the [`HttpClient`](stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt) interface -3. Construct [`StagehandClientImpl`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientImpl.kt) or [`StagehandClientAsyncImpl`](stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsyncImpl.kt), similarly to [`StagehandOkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClient.kt) or [`StagehandOkHttpClientAsync`](stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClientAsync.kt), using your new client class +1. Replace your [`browserbase-java` dependency](#installation) with `browserbase-java-core` +2. Write a class that implements the [`HttpClient`](browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt) interface +3. Construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt) or [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt), similarly to [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), using your new client class ## Undocumented API functionality @@ -452,7 +453,7 @@ SessionStartParams params = SessionStartParams.builder() These properties can be accessed on the nested built object later using the `_additionalProperties()` method. -To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt) object to its setter: +To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt) object to its setter: ```java import com.stagehand.api.core.JsonValue; @@ -463,7 +464,7 @@ SessionStartParams params = SessionStartParams.builder() .build(); ``` -The most straightforward way to create a [`JsonValue`](stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt) is using its `from(...)` method: +The most straightforward way to create a [`JsonValue`](browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt) is using its `from(...)` method: ```java import com.stagehand.api.core.JsonValue; @@ -504,7 +505,7 @@ JsonValue complexValue = JsonValue.from(Map.of( Normally a `Builder` class's `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset. -To forcibly omit a required parameter or property, pass [`JsonMissing`](stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt): +To forcibly omit a required parameter or property, pass [`JsonMissing`](browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt): ```java import com.stagehand.api.core.JsonMissing; @@ -574,7 +575,7 @@ if (env.isMissing()) { In rare cases, the API may return a response that doesn't match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else. -By default, the SDK will not throw an exception in this case. It will throw [`StagehandInvalidDataException`](stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandInvalidDataException.kt) only if you directly access the property. +By default, the SDK will not throw an exception in this case. It will throw [`BrowserbaseInvalidDataException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt) only if you directly access the property. If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`: @@ -597,10 +598,10 @@ SessionStartResponse response = client.sessions().start( Or configure the default for all method calls at the client level: ```java -import com.stagehand.api.client.StagehandClient; -import com.stagehand.api.client.okhttp.StagehandOkHttpClient; +import com.stagehand.api.client.BrowserbaseClient; +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; -StagehandClient client = StagehandOkHttpClient.builder() +BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() .responseValidation(true) .build(); diff --git a/SECURITY.md b/SECURITY.md index dcfc419..be1c2db 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,7 +16,7 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Stagehand, please follow the respective company's security reporting guidelines. +or products provided by Browserbase, please follow the respective company's security reporting guidelines. --- diff --git a/stagehand-java-client-okhttp/build.gradle.kts b/browserbase-java-client-okhttp/build.gradle.kts similarity index 76% rename from stagehand-java-client-okhttp/build.gradle.kts rename to browserbase-java-client-okhttp/build.gradle.kts index cb49933..d5f5cb0 100644 --- a/stagehand-java-client-okhttp/build.gradle.kts +++ b/browserbase-java-client-okhttp/build.gradle.kts @@ -1,10 +1,10 @@ plugins { - id("stagehand.kotlin") - id("stagehand.publish") + id("browserbase.kotlin") + id("browserbase.publish") } dependencies { - api(project(":stagehand-java-core")) + api(project(":browserbase-java-core")) implementation("com.squareup.okhttp3:okhttp:4.12.0") implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClient.kt b/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt similarity index 91% rename from stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClient.kt rename to browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt index 4b6805e..5113c2c 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClient.kt +++ b/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt @@ -3,8 +3,8 @@ package com.stagehand.api.client.okhttp import com.fasterxml.jackson.databind.json.JsonMapper -import com.stagehand.api.client.StagehandClient -import com.stagehand.api.client.StagehandClientImpl +import com.stagehand.api.client.BrowserbaseClient +import com.stagehand.api.client.BrowserbaseClientImpl import com.stagehand.api.core.ClientOptions import com.stagehand.api.core.Sleeper import com.stagehand.api.core.Timeout @@ -22,14 +22,14 @@ import javax.net.ssl.X509TrustManager import kotlin.jvm.optionals.getOrNull /** - * A class that allows building an instance of [StagehandClient] with [OkHttpClient] as the + * A class that allows building an instance of [BrowserbaseClient] with [OkHttpClient] as the * underlying [HttpClient]. */ -class StagehandOkHttpClient private constructor() { +class BrowserbaseOkHttpClient private constructor() { companion object { - /** Returns a mutable builder for constructing an instance of [StagehandClient]. */ + /** Returns a mutable builder for constructing an instance of [BrowserbaseClient]. */ @JvmStatic fun builder() = Builder() /** @@ -37,10 +37,10 @@ class StagehandOkHttpClient private constructor() { * * @see ClientOptions.Builder.fromEnv */ - @JvmStatic fun fromEnv(): StagehandClient = builder().fromEnv().build() + @JvmStatic fun fromEnv(): BrowserbaseClient = builder().fromEnv().build() } - /** A builder for [StagehandOkHttpClient]. */ + /** A builder for [BrowserbaseOkHttpClient]. */ class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() @@ -144,18 +144,22 @@ class StagehandOkHttpClient private constructor() { /** * The base URL to use for every request. * - * Defaults to the production environment: `http://localhost:3000/v1`. + * Defaults to the production environment: `https://api.stagehand.browserbase.com/v1`. * * The following other environments, with dedicated builder methods, are available: - * - environment_1: `https://api.stagehand.browserbase.com/v1` + * - dev: `https://api.stagehand.dev.browserbase.com/v1` + * - local: `http://localhost:5000/v1` */ fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) } /** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */ fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull()) - /** Sets [baseUrl] to `https://api.stagehand.browserbase.com/v1`. */ - fun environment1() = apply { clientOptions.environment1() } + /** Sets [baseUrl] to `https://api.stagehand.dev.browserbase.com/v1`. */ + fun dev() = apply { clientOptions.dev() } + + /** Sets [baseUrl] to `http://localhost:5000/v1`. */ + fun local() = apply { clientOptions.local() } /** * Whether to call `validate` on every response before returning it. @@ -201,10 +205,7 @@ class StagehandOkHttpClient private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } - fun apiKey(apiKey: String?) = apply { clientOptions.apiKey(apiKey) } - - /** Alias for calling [Builder.apiKey] with `apiKey.orElse(null)`. */ - fun apiKey(apiKey: Optional) = apiKey(apiKey.getOrNull()) + fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } fun headers(headers: Headers) = apply { clientOptions.headers(headers) } @@ -294,12 +295,12 @@ class StagehandOkHttpClient private constructor() { fun fromEnv() = apply { clientOptions.fromEnv() } /** - * Returns an immutable instance of [StagehandClient]. + * Returns an immutable instance of [BrowserbaseClient]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): StagehandClient = - StagehandClientImpl( + fun build(): BrowserbaseClient = + BrowserbaseClientImpl( clientOptions .httpClient( OkHttpClient.builder() diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClientAsync.kt b/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt similarity index 90% rename from stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClientAsync.kt rename to browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt index e7a4c24..bf6ef08 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/StagehandOkHttpClientAsync.kt +++ b/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt @@ -3,8 +3,8 @@ package com.stagehand.api.client.okhttp import com.fasterxml.jackson.databind.json.JsonMapper -import com.stagehand.api.client.StagehandClientAsync -import com.stagehand.api.client.StagehandClientAsyncImpl +import com.stagehand.api.client.BrowserbaseClientAsync +import com.stagehand.api.client.BrowserbaseClientAsyncImpl import com.stagehand.api.core.ClientOptions import com.stagehand.api.core.Sleeper import com.stagehand.api.core.Timeout @@ -22,14 +22,14 @@ import javax.net.ssl.X509TrustManager import kotlin.jvm.optionals.getOrNull /** - * A class that allows building an instance of [StagehandClientAsync] with [OkHttpClient] as the + * A class that allows building an instance of [BrowserbaseClientAsync] with [OkHttpClient] as the * underlying [HttpClient]. */ -class StagehandOkHttpClientAsync private constructor() { +class BrowserbaseOkHttpClientAsync private constructor() { companion object { - /** Returns a mutable builder for constructing an instance of [StagehandClientAsync]. */ + /** Returns a mutable builder for constructing an instance of [BrowserbaseClientAsync]. */ @JvmStatic fun builder() = Builder() /** @@ -37,10 +37,10 @@ class StagehandOkHttpClientAsync private constructor() { * * @see ClientOptions.Builder.fromEnv */ - @JvmStatic fun fromEnv(): StagehandClientAsync = builder().fromEnv().build() + @JvmStatic fun fromEnv(): BrowserbaseClientAsync = builder().fromEnv().build() } - /** A builder for [StagehandOkHttpClientAsync]. */ + /** A builder for [BrowserbaseOkHttpClientAsync]. */ class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() @@ -144,18 +144,22 @@ class StagehandOkHttpClientAsync private constructor() { /** * The base URL to use for every request. * - * Defaults to the production environment: `http://localhost:3000/v1`. + * Defaults to the production environment: `https://api.stagehand.browserbase.com/v1`. * * The following other environments, with dedicated builder methods, are available: - * - environment_1: `https://api.stagehand.browserbase.com/v1` + * - dev: `https://api.stagehand.dev.browserbase.com/v1` + * - local: `http://localhost:5000/v1` */ fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) } /** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */ fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull()) - /** Sets [baseUrl] to `https://api.stagehand.browserbase.com/v1`. */ - fun environment1() = apply { clientOptions.environment1() } + /** Sets [baseUrl] to `https://api.stagehand.dev.browserbase.com/v1`. */ + fun dev() = apply { clientOptions.dev() } + + /** Sets [baseUrl] to `http://localhost:5000/v1`. */ + fun local() = apply { clientOptions.local() } /** * Whether to call `validate` on every response before returning it. @@ -201,10 +205,7 @@ class StagehandOkHttpClientAsync private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } - fun apiKey(apiKey: String?) = apply { clientOptions.apiKey(apiKey) } - - /** Alias for calling [Builder.apiKey] with `apiKey.orElse(null)`. */ - fun apiKey(apiKey: Optional) = apiKey(apiKey.getOrNull()) + fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } fun headers(headers: Headers) = apply { clientOptions.headers(headers) } @@ -294,12 +295,12 @@ class StagehandOkHttpClientAsync private constructor() { fun fromEnv() = apply { clientOptions.fromEnv() } /** - * Returns an immutable instance of [StagehandClientAsync]. + * Returns an immutable instance of [BrowserbaseClientAsync]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): StagehandClientAsync = - StagehandClientAsyncImpl( + fun build(): BrowserbaseClientAsync = + BrowserbaseClientAsyncImpl( clientOptions .httpClient( OkHttpClient.builder() diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt b/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt similarity index 96% rename from stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt rename to browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt index 7db7941..14cfe6c 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt +++ b/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt @@ -8,7 +8,7 @@ import com.stagehand.api.core.http.HttpMethod import com.stagehand.api.core.http.HttpRequest import com.stagehand.api.core.http.HttpRequestBody import com.stagehand.api.core.http.HttpResponse -import com.stagehand.api.errors.StagehandIoException +import com.stagehand.api.errors.BrowserbaseIoException import java.io.IOException import java.io.InputStream import java.net.Proxy @@ -39,7 +39,7 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien return try { call.execute().toResponse() } catch (e: IOException) { - throw StagehandIoException("Request failed", e) + throw BrowserbaseIoException("Request failed", e) } finally { request.body?.close() } @@ -59,7 +59,7 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien } override fun onFailure(call: Call, e: IOException) { - future.completeExceptionally(StagehandIoException("Request failed", e)) + future.completeExceptionally(BrowserbaseIoException("Request failed", e)) } } ) @@ -84,7 +84,7 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien val clientBuilder = okHttpClient.newBuilder() val logLevel = - when (System.getenv("STAGEHAND_LOG")?.lowercase()) { + when (System.getenv("BROWSERBASE_LOG")?.lowercase()) { "info" -> HttpLoggingInterceptor.Level.BASIC "debug" -> HttpLoggingInterceptor.Level.BODY else -> null diff --git a/stagehand-java-client-okhttp/src/test/kotlin/com/stagehand/api/client/okhttp/OkHttpClientTest.kt b/browserbase-java-client-okhttp/src/test/kotlin/com/stagehand/api/client/okhttp/OkHttpClientTest.kt similarity index 100% rename from stagehand-java-client-okhttp/src/test/kotlin/com/stagehand/api/client/okhttp/OkHttpClientTest.kt rename to browserbase-java-client-okhttp/src/test/kotlin/com/stagehand/api/client/okhttp/OkHttpClientTest.kt diff --git a/stagehand-java-core/build.gradle.kts b/browserbase-java-core/build.gradle.kts similarity index 93% rename from stagehand-java-core/build.gradle.kts rename to browserbase-java-core/build.gradle.kts index 38bcf47..ca10c97 100644 --- a/stagehand-java-core/build.gradle.kts +++ b/browserbase-java-core/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id("stagehand.kotlin") - id("stagehand.publish") + id("browserbase.kotlin") + id("browserbase.publish") } configurations.all { @@ -29,7 +29,7 @@ dependencies { implementation("org.apache.httpcomponents.client5:httpclient5:5.3.1") testImplementation(kotlin("test")) - testImplementation(project(":stagehand-java-client-okhttp")) + testImplementation(project(":browserbase-java-client-okhttp")) testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") testImplementation("org.assertj:assertj-core:3.25.3") testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClient.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClient.kt similarity index 85% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClient.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClient.kt index bd37148..6e2b6a0 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClient.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClient.kt @@ -7,7 +7,7 @@ import com.stagehand.api.services.blocking.SessionService import java.util.function.Consumer /** - * A client for interacting with the Stagehand REST API synchronously. You can also switch to + * A client for interacting with the Browserbase REST API synchronously. You can also switch to * asynchronous execution via the [async] method. * * This client performs best when you create a single instance and reuse it for all interactions @@ -20,7 +20,7 @@ import java.util.function.Consumer * if you are writing an application that needs to aggressively release unused resources, then you * may call [close]. */ -interface StagehandClient { +interface BrowserbaseClient { /** * Returns a version of this client that uses asynchronous execution. @@ -28,7 +28,7 @@ interface StagehandClient { * The returned client shares its resources, like its connection pool and thread pools, with * this client. */ - fun async(): StagehandClientAsync + fun async(): BrowserbaseClientAsync /** * Returns a view of this service that provides access to raw HTTP responses for each method. @@ -40,7 +40,7 @@ interface StagehandClient { * * The original service is not modified. */ - fun withOptions(modifier: Consumer): StagehandClient + fun withOptions(modifier: Consumer): BrowserbaseClient fun sessions(): SessionService @@ -57,7 +57,7 @@ interface StagehandClient { */ fun close() - /** A view of [StagehandClient] that provides access to raw HTTP responses for each method. */ + /** A view of [BrowserbaseClient] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { /** @@ -65,7 +65,9 @@ interface StagehandClient { * * The original service is not modified. */ - fun withOptions(modifier: Consumer): StagehandClient.WithRawResponse + fun withOptions( + modifier: Consumer + ): BrowserbaseClient.WithRawResponse fun sessions(): SessionService.WithRawResponse } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsync.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsync.kt similarity index 87% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsync.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsync.kt index 078550d..aef1082 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsync.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsync.kt @@ -7,7 +7,7 @@ import com.stagehand.api.services.async.SessionServiceAsync import java.util.function.Consumer /** - * A client for interacting with the Stagehand REST API asynchronously. You can also switch to + * A client for interacting with the Browserbase REST API asynchronously. You can also switch to * synchronous execution via the [sync] method. * * This client performs best when you create a single instance and reuse it for all interactions @@ -20,7 +20,7 @@ import java.util.function.Consumer * if you are writing an application that needs to aggressively release unused resources, then you * may call [close]. */ -interface StagehandClientAsync { +interface BrowserbaseClientAsync { /** * Returns a version of this client that uses synchronous execution. @@ -28,7 +28,7 @@ interface StagehandClientAsync { * The returned client shares its resources, like its connection pool and thread pools, with * this client. */ - fun sync(): StagehandClient + fun sync(): BrowserbaseClient /** * Returns a view of this service that provides access to raw HTTP responses for each method. @@ -40,7 +40,7 @@ interface StagehandClientAsync { * * The original service is not modified. */ - fun withOptions(modifier: Consumer): StagehandClientAsync + fun withOptions(modifier: Consumer): BrowserbaseClientAsync fun sessions(): SessionServiceAsync @@ -58,7 +58,8 @@ interface StagehandClientAsync { fun close() /** - * A view of [StagehandClientAsync] that provides access to raw HTTP responses for each method. + * A view of [BrowserbaseClientAsync] that provides access to raw HTTP responses for each + * method. */ interface WithRawResponse { @@ -69,7 +70,7 @@ interface StagehandClientAsync { */ fun withOptions( modifier: Consumer - ): StagehandClientAsync.WithRawResponse + ): BrowserbaseClientAsync.WithRawResponse fun sessions(): SessionServiceAsync.WithRawResponse } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsyncImpl.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt similarity index 69% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsyncImpl.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt index 60cbec7..a7281d2 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientAsyncImpl.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt @@ -8,7 +8,8 @@ import com.stagehand.api.services.async.SessionServiceAsync import com.stagehand.api.services.async.SessionServiceAsyncImpl import java.util.function.Consumer -class StagehandClientAsyncImpl(private val clientOptions: ClientOptions) : StagehandClientAsync { +class BrowserbaseClientAsyncImpl(private val clientOptions: ClientOptions) : + BrowserbaseClientAsync { private val clientOptionsWithUserAgent = if (clientOptions.headers.names().contains("User-Agent")) clientOptions @@ -19,9 +20,9 @@ class StagehandClientAsyncImpl(private val clientOptions: ClientOptions) : Stage .build() // Pass the original clientOptions so that this client sets its own User-Agent. - private val sync: StagehandClient by lazy { StagehandClientImpl(clientOptions) } + private val sync: BrowserbaseClient by lazy { BrowserbaseClientImpl(clientOptions) } - private val withRawResponse: StagehandClientAsync.WithRawResponse by lazy { + private val withRawResponse: BrowserbaseClientAsync.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } @@ -29,19 +30,19 @@ class StagehandClientAsyncImpl(private val clientOptions: ClientOptions) : Stage SessionServiceAsyncImpl(clientOptionsWithUserAgent) } - override fun sync(): StagehandClient = sync + override fun sync(): BrowserbaseClient = sync - override fun withRawResponse(): StagehandClientAsync.WithRawResponse = withRawResponse + override fun withRawResponse(): BrowserbaseClientAsync.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): StagehandClientAsync = - StagehandClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): BrowserbaseClientAsync = + BrowserbaseClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) override fun sessions(): SessionServiceAsync = sessions override fun close() = clientOptions.close() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - StagehandClientAsync.WithRawResponse { + BrowserbaseClientAsync.WithRawResponse { private val sessions: SessionServiceAsync.WithRawResponse by lazy { SessionServiceAsyncImpl.WithRawResponseImpl(clientOptions) @@ -49,8 +50,8 @@ class StagehandClientAsyncImpl(private val clientOptions: ClientOptions) : Stage override fun withOptions( modifier: Consumer - ): StagehandClientAsync.WithRawResponse = - StagehandClientAsyncImpl.WithRawResponseImpl( + ): BrowserbaseClientAsync.WithRawResponse = + BrowserbaseClientAsyncImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientImpl.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt similarity index 69% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientImpl.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt index 39ff1e2..afe65db 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/client/StagehandClientImpl.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt @@ -8,7 +8,7 @@ import com.stagehand.api.services.blocking.SessionService import com.stagehand.api.services.blocking.SessionServiceImpl import java.util.function.Consumer -class StagehandClientImpl(private val clientOptions: ClientOptions) : StagehandClient { +class BrowserbaseClientImpl(private val clientOptions: ClientOptions) : BrowserbaseClient { private val clientOptionsWithUserAgent = if (clientOptions.headers.names().contains("User-Agent")) clientOptions @@ -19,27 +19,27 @@ class StagehandClientImpl(private val clientOptions: ClientOptions) : StagehandC .build() // Pass the original clientOptions so that this client sets its own User-Agent. - private val async: StagehandClientAsync by lazy { StagehandClientAsyncImpl(clientOptions) } + private val async: BrowserbaseClientAsync by lazy { BrowserbaseClientAsyncImpl(clientOptions) } - private val withRawResponse: StagehandClient.WithRawResponse by lazy { + private val withRawResponse: BrowserbaseClient.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } private val sessions: SessionService by lazy { SessionServiceImpl(clientOptionsWithUserAgent) } - override fun async(): StagehandClientAsync = async + override fun async(): BrowserbaseClientAsync = async - override fun withRawResponse(): StagehandClient.WithRawResponse = withRawResponse + override fun withRawResponse(): BrowserbaseClient.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): StagehandClient = - StagehandClientImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): BrowserbaseClient = + BrowserbaseClientImpl(clientOptions.toBuilder().apply(modifier::accept).build()) override fun sessions(): SessionService = sessions override fun close() = clientOptions.close() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - StagehandClient.WithRawResponse { + BrowserbaseClient.WithRawResponse { private val sessions: SessionService.WithRawResponse by lazy { SessionServiceImpl.WithRawResponseImpl(clientOptions) @@ -47,8 +47,8 @@ class StagehandClientImpl(private val clientOptions: ClientOptions) : StagehandC override fun withOptions( modifier: Consumer - ): StagehandClient.WithRawResponse = - StagehandClientImpl.WithRawResponseImpl( + ): BrowserbaseClient.WithRawResponse = + BrowserbaseClientImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/BaseDeserializer.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseDeserializer.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/BaseDeserializer.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseDeserializer.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/BaseSerializer.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseSerializer.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/BaseSerializer.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseSerializer.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt similarity index 88% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt index 50b2df9..3cbfa6e 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt @@ -20,7 +20,7 @@ private constructor( /** * The HTTP client to use in the SDK. * - * Use the one published in `stagehand-java-client-okhttp` or implement your own. + * Use the one published in `browserbase-java-client-okhttp` or implement your own. * * This class takes ownership of the client and closes it when closed. */ @@ -93,7 +93,7 @@ private constructor( * Defaults to 2. */ @get:JvmName("maxRetries") val maxRetries: Int, - private val apiKey: String?, + @get:JvmName("apiKey") val apiKey: String, ) { init { @@ -105,22 +105,23 @@ private constructor( /** * The base URL to use for every request. * - * Defaults to the production environment: `http://localhost:3000/v1`. + * Defaults to the production environment: `https://api.stagehand.browserbase.com/v1`. * * The following other environments, with dedicated builder methods, are available: - * - environment_1: `https://api.stagehand.browserbase.com/v1` + * - dev: `https://api.stagehand.dev.browserbase.com/v1` + * - local: `http://localhost:5000/v1` */ fun baseUrl(): String = baseUrl ?: PRODUCTION_URL - fun apiKey(): Optional = Optional.ofNullable(apiKey) - fun toBuilder() = Builder().from(this) companion object { - const val PRODUCTION_URL = "http://localhost:3000/v1" + const val PRODUCTION_URL = "https://api.stagehand.browserbase.com/v1" + + const val DEV_URL = "https://api.stagehand.dev.browserbase.com/v1" - const val ENVIRONMENT_1_URL = "https://api.stagehand.browserbase.com/v1" + const val LOCAL_URL = "http://localhost:5000/v1" /** * Returns a mutable builder for constructing an instance of [ClientOptions]. @@ -128,6 +129,7 @@ private constructor( * The following fields are required: * ```java * .httpClient() + * .apiKey() * ``` */ @JvmStatic fun builder() = Builder() @@ -175,7 +177,7 @@ private constructor( /** * The HTTP client to use in the SDK. * - * Use the one published in `stagehand-java-client-okhttp` or implement your own. + * Use the one published in `browserbase-java-client-okhttp` or implement your own. * * This class takes ownership of the client and closes it when closed. */ @@ -225,18 +227,22 @@ private constructor( /** * The base URL to use for every request. * - * Defaults to the production environment: `http://localhost:3000/v1`. + * Defaults to the production environment: `https://api.stagehand.browserbase.com/v1`. * * The following other environments, with dedicated builder methods, are available: - * - environment_1: `https://api.stagehand.browserbase.com/v1` + * - dev: `https://api.stagehand.dev.browserbase.com/v1` + * - local: `http://localhost:5000/v1` */ fun baseUrl(baseUrl: String?) = apply { this.baseUrl = baseUrl } /** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */ fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull()) - /** Sets [baseUrl] to `https://api.stagehand.browserbase.com/v1`. */ - fun environment1() = baseUrl(ENVIRONMENT_1_URL) + /** Sets [baseUrl] to `https://api.stagehand.dev.browserbase.com/v1`. */ + fun dev() = baseUrl(DEV_URL) + + /** Sets [baseUrl] to `http://localhost:5000/v1`. */ + fun local() = baseUrl(LOCAL_URL) /** * Whether to call `validate` on every response before returning it. @@ -282,10 +288,7 @@ private constructor( */ fun maxRetries(maxRetries: Int) = apply { this.maxRetries = maxRetries } - fun apiKey(apiKey: String?) = apply { this.apiKey = apiKey } - - /** Alias for calling [Builder.apiKey] with `apiKey.orElse(null)`. */ - fun apiKey(apiKey: Optional) = apiKey(apiKey.getOrNull()) + fun apiKey(apiKey: String) = apply { this.apiKey = apiKey } fun headers(headers: Headers) = apply { this.headers.clear() @@ -374,20 +377,19 @@ private constructor( * * See this table for the available options: * - * |Setter |System property |Environment variable|Required|Default value | - * |---------|-------------------|--------------------|--------|----------------------------| - * |`apiKey` |`stagehand.apiKey` |`STAGEHAND_API_KEY` |false |- | - * |`baseUrl`|`stagehand.baseUrl`|`STAGEHAND_BASE_URL`|true |`"http://localhost:3000/v1"`| + * |Setter |System property |Environment variable |Required|Default value | + * |---------|-----------------------------|----------------------|--------|--------------------------------------------| + * |`apiKey` |`browserbase.stagehandApiKey`|`STAGEHAND_API_KEY` |true |- | + * |`baseUrl`|`browserbase.baseUrl` |`BROWSERBASE_BASE_URL`|true |`"https://api.stagehand.browserbase.com/v1"`| * * System properties take precedence over environment variables. */ fun fromEnv() = apply { - (System.getProperty("stagehand.baseUrl") ?: System.getenv("STAGEHAND_BASE_URL"))?.let { - baseUrl(it) - } - (System.getProperty("stagehand.apiKey") ?: System.getenv("STAGEHAND_API_KEY"))?.let { - apiKey(it) - } + (System.getProperty("browserbase.baseUrl") ?: System.getenv("BROWSERBASE_BASE_URL")) + ?.let { baseUrl(it) } + (System.getProperty("browserbase.stagehandApiKey") + ?: System.getenv("STAGEHAND_API_KEY")) + ?.let { apiKey(it) } } /** @@ -398,6 +400,7 @@ private constructor( * The following fields are required: * ```java * .httpClient() + * .apiKey() * ``` * * @throws IllegalStateException if any required field is unset. @@ -405,6 +408,7 @@ private constructor( fun build(): ClientOptions { val httpClient = checkRequired("httpClient", httpClient) val sleeper = sleeper ?: PhantomReachableSleeper(DefaultSleeper()) + val apiKey = checkRequired("apiKey", apiKey) val headers = Headers.builder() val queryParams = QueryParams.builder() @@ -415,7 +419,7 @@ private constructor( headers.put("X-Stainless-Package-Version", getPackageVersion()) headers.put("X-Stainless-Runtime", "JRE") headers.put("X-Stainless-Runtime-Version", getJavaVersion()) - apiKey?.let { + apiKey.let { if (!it.isEmpty()) { headers.put("Authorization", "Bearer $it") } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/DefaultSleeper.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/DefaultSleeper.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/DefaultSleeper.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/DefaultSleeper.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/ObjectMappers.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ObjectMappers.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/ObjectMappers.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ObjectMappers.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Params.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Params.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Params.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Params.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt similarity index 92% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt index 48c4eb3..648e916 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt @@ -2,7 +2,7 @@ package com.stagehand.api.core -import com.stagehand.api.errors.StagehandException +import com.stagehand.api.errors.BrowserbaseException import java.lang.reflect.InvocationTargetException /** @@ -46,7 +46,7 @@ private val closeWhenPhantomReachable: ((Any, () -> Unit) -> Unit)? by lazy { is Error -> throw cause } } - throw StagehandException("Unexpected reflective invocation failure", e) + throw BrowserbaseException("Unexpected reflective invocation failure", e) } } } catch (e: ReflectiveOperationException) { diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableExecutorService.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableExecutorService.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableExecutorService.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableExecutorService.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableSleeper.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableSleeper.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableSleeper.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableSleeper.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/PrepareRequest.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PrepareRequest.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/PrepareRequest.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PrepareRequest.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Properties.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Properties.kt similarity index 88% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Properties.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Properties.kt index f2e9de2..d24ffbe 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Properties.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Properties.kt @@ -2,7 +2,7 @@ package com.stagehand.api.core -import com.stagehand.api.client.StagehandClient +import com.stagehand.api.client.BrowserbaseClient fun getOsArch(): String { val osArch = System.getProperty("os.arch") @@ -37,6 +37,6 @@ fun getOsName(): String { fun getOsVersion(): String = System.getProperty("os.version", "unknown") fun getPackageVersion(): String = - StagehandClient::class.java.`package`.implementationVersion ?: "unknown" + BrowserbaseClient::class.java.`package`.implementationVersion ?: "unknown" fun getJavaVersion(): String = System.getProperty("java.version", "unknown") diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/RequestOptions.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/RequestOptions.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/RequestOptions.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/RequestOptions.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Sleeper.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Sleeper.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Sleeper.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Sleeper.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Timeout.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Timeout.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Timeout.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Timeout.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Utils.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Utils.kt similarity index 96% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Utils.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Utils.kt index 7e8118b..1e35e53 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Utils.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Utils.kt @@ -2,7 +2,7 @@ package com.stagehand.api.core -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.SortedMap import java.util.concurrent.CompletableFuture @@ -10,7 +10,7 @@ import java.util.concurrent.locks.Lock @JvmSynthetic internal fun T?.getOrThrow(name: String): T = - this ?: throw StagehandInvalidDataException("`${name}` is not present") + this ?: throw BrowserbaseInvalidDataException("`${name}` is not present") @JvmSynthetic internal fun List.toImmutable(): List = diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt index 8410d97..e772b85 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt @@ -24,7 +24,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeType.OBJECT import com.fasterxml.jackson.databind.node.JsonNodeType.POJO import com.fasterxml.jackson.databind.node.JsonNodeType.STRING import com.fasterxml.jackson.databind.ser.std.NullSerializer -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.io.InputStream import java.util.Objects import java.util.Optional @@ -108,7 +108,7 @@ sealed class JsonField { } fun asStringOrThrow(): String = - asString().orElseThrow { StagehandInvalidDataException("Value is not a string") } + asString().orElseThrow { BrowserbaseInvalidDataException("Value is not a string") } /** * Returns an [Optional] containing this field's list value, or an empty [Optional] if it @@ -171,9 +171,9 @@ sealed class JsonField { internal fun getRequired(name: String): T = when (this) { is KnownValue -> value - is JsonMissing -> throw StagehandInvalidDataException("`$name` is not set") - is JsonNull -> throw StagehandInvalidDataException("`$name` is null") - else -> throw StagehandInvalidDataException("`$name` is invalid, received $this") + is JsonMissing -> throw BrowserbaseInvalidDataException("`$name` is not set") + is JsonNull -> throw BrowserbaseInvalidDataException("`$name` is null") + else -> throw BrowserbaseInvalidDataException("`$name` is invalid, received $this") } @JvmSynthetic @@ -188,7 +188,7 @@ sealed class JsonField { is KnownValue -> Optional.of(value) is JsonMissing, is JsonNull -> Optional.empty() - else -> throw StagehandInvalidDataException("`$name` is invalid, received $this") + else -> throw BrowserbaseInvalidDataException("`$name` is invalid, received $this") } @JvmSynthetic diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/handlers/ErrorHandler.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/ErrorHandler.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/handlers/ErrorHandler.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/ErrorHandler.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt similarity index 80% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt index dc8d9e5..5ab311e 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt @@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.stagehand.api.core.http.HttpResponse import com.stagehand.api.core.http.HttpResponse.Handler -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException @JvmSynthetic internal inline fun jsonHandler(jsonMapper: JsonMapper): Handler = @@ -15,6 +15,6 @@ internal inline fun jsonHandler(jsonMapper: JsonMapper): Handler try { jsonMapper.readValue(response.body(), jacksonTypeRef()) } catch (e: Exception) { - throw StagehandInvalidDataException("Error reading response", e) + throw BrowserbaseInvalidDataException("Error reading response", e) } } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/handlers/StringHandler.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/StringHandler.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/handlers/StringHandler.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/StringHandler.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/AsyncStreamResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/AsyncStreamResponse.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/AsyncStreamResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/AsyncStreamResponse.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/Headers.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/Headers.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/Headers.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/Headers.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpMethod.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpMethod.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpMethod.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpMethod.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequest.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequest.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequest.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequest.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt similarity index 96% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt index 98811cc..0066e15 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt @@ -8,7 +8,7 @@ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.databind.node.JsonNodeType import com.stagehand.api.core.MultipartField -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.io.InputStream import java.io.OutputStream import kotlin.jvm.optionals.getOrNull @@ -97,7 +97,7 @@ internal fun multipartFormData( JsonNodeType.ARRAY, JsonNodeType.OBJECT, JsonNodeType.POJO -> - throw StagehandInvalidDataException( + throw BrowserbaseInvalidDataException( "Unexpected JsonNode type in array: ${node.nodeType}" ) } @@ -111,7 +111,7 @@ internal fun multipartFormData( } JsonNodeType.POJO, null -> - throw StagehandInvalidDataException( + throw BrowserbaseInvalidDataException( "Unexpected JsonNode type: ${node.nodeType}" ) } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBody.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBody.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBody.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBody.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponse.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponse.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponseFor.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponseFor.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponseFor.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponseFor.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingHttpClient.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingHttpClient.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingHttpClient.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingHttpClient.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingStreamResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingStreamResponse.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingStreamResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingStreamResponse.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/QueryParams.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/QueryParams.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/QueryParams.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/QueryParams.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt index c23a398..688ae4f 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt @@ -4,8 +4,8 @@ import com.stagehand.api.core.DefaultSleeper import com.stagehand.api.core.RequestOptions import com.stagehand.api.core.Sleeper import com.stagehand.api.core.checkRequired -import com.stagehand.api.errors.StagehandIoException -import com.stagehand.api.errors.StagehandRetryableException +import com.stagehand.api.errors.BrowserbaseIoException +import com.stagehand.api.errors.BrowserbaseRetryableException import java.io.IOException import java.time.Clock import java.time.Duration @@ -182,8 +182,8 @@ private constructor( private fun shouldRetry(throwable: Throwable): Boolean = // Only retry known retryable exceptions, other exceptions are not intended to be retried. throwable is IOException || - throwable is StagehandIoException || - throwable is StagehandRetryableException + throwable is BrowserbaseIoException || + throwable is BrowserbaseRetryableException private fun getRetryBackoffDuration(retries: Int, response: HttpResponse?): Duration { // About the Retry-After header: diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/StreamResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/StreamResponse.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/core/http/StreamResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/StreamResponse.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt index 3e34a60..0df8b4a 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class BadRequestException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - StagehandServiceException("400: $body", cause) { + BrowserbaseServiceException("400: $body", cause) { override fun statusCode(): Int = 400 diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseException.kt similarity index 82% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseException.kt index 0d0087f..eb7f6e5 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseException.kt @@ -1,5 +1,5 @@ package com.stagehand.api.errors -open class StagehandException +open class BrowserbaseException @JvmOverloads constructor(message: String? = null, cause: Throwable? = null) : RuntimeException(message, cause) diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandInvalidDataException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt similarity index 58% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandInvalidDataException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt index 3d7fb03..8e9730d 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandInvalidDataException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt @@ -1,5 +1,6 @@ package com.stagehand.api.errors -class StagehandInvalidDataException +class BrowserbaseInvalidDataException @JvmOverloads -constructor(message: String? = null, cause: Throwable? = null) : StagehandException(message, cause) +constructor(message: String? = null, cause: Throwable? = null) : + BrowserbaseException(message, cause) diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandIoException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseIoException.kt similarity index 61% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandIoException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseIoException.kt index 4080af1..aa9c0de 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandIoException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseIoException.kt @@ -1,5 +1,6 @@ package com.stagehand.api.errors -class StagehandIoException +class BrowserbaseIoException @JvmOverloads -constructor(message: String? = null, cause: Throwable? = null) : StagehandException(message, cause) +constructor(message: String? = null, cause: Throwable? = null) : + BrowserbaseException(message, cause) diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandRetryableException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseRetryableException.kt similarity index 85% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandRetryableException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseRetryableException.kt index 252b6c6..8984d2e 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandRetryableException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseRetryableException.kt @@ -9,6 +9,7 @@ package com.stagehand.api.errors * @param message A descriptive error message * @param cause The underlying cause of this exception, if any */ -class StagehandRetryableException +class BrowserbaseRetryableException @JvmOverloads -constructor(message: String? = null, cause: Throwable? = null) : StagehandException(message, cause) +constructor(message: String? = null, cause: Throwable? = null) : + BrowserbaseException(message, cause) diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandServiceException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseServiceException.kt similarity index 80% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandServiceException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseServiceException.kt index af4ad3b..d88ef6f 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/StagehandServiceException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseServiceException.kt @@ -5,9 +5,9 @@ package com.stagehand.api.errors import com.stagehand.api.core.JsonValue import com.stagehand.api.core.http.Headers -abstract class StagehandServiceException +abstract class BrowserbaseServiceException protected constructor(message: String, cause: Throwable? = null) : - StagehandException(message, cause) { + BrowserbaseException(message, cause) { abstract fun statusCode(): Int diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt index e44477e..6682cbf 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt @@ -14,7 +14,7 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : StagehandServiceException("$statusCode: $body", cause) { +) : BrowserbaseServiceException("$statusCode: $body", cause) { override fun statusCode(): Int = statusCode diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt index 55d282f..cf2a3dc 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class NotFoundException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - StagehandServiceException("404: $body", cause) { + BrowserbaseServiceException("404: $body", cause) { override fun statusCode(): Int = 404 diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt index f79f40a..882f883 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class PermissionDeniedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - StagehandServiceException("403: $body", cause) { + BrowserbaseServiceException("403: $body", cause) { override fun statusCode(): Int = 403 diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt index 1119740..aedc3cf 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class RateLimitException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - StagehandServiceException("429: $body", cause) { + BrowserbaseServiceException("429: $body", cause) { override fun statusCode(): Int = 429 diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt index d3fa413..5eff55d 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class UnauthorizedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - StagehandServiceException("401: $body", cause) { + BrowserbaseServiceException("401: $body", cause) { override fun statusCode(): Int = 401 diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt index 042ec74..fa6913f 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt @@ -14,7 +14,7 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : StagehandServiceException("$statusCode: $body", cause) { +) : BrowserbaseServiceException("$statusCode: $body", cause) { override fun statusCode(): Int = statusCode diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt similarity index 97% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt index eb3482b..1085120 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class UnprocessableEntityException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - StagehandServiceException("422: $body", cause) { + BrowserbaseServiceException("422: $body", cause) { override fun statusCode(): Int = 422 diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt similarity index 95% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt index 3d159b8..f071b0a 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt @@ -13,7 +13,7 @@ import com.stagehand.api.core.JsonValue import com.stagehand.api.core.checkKnown import com.stagehand.api.core.checkRequired import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -48,7 +48,7 @@ private constructor( /** * Arguments for the method * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun arguments(): List = arguments.getRequired("arguments") @@ -56,7 +56,7 @@ private constructor( /** * Human-readable description of the action * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun description(): String = description.getRequired("description") @@ -64,7 +64,7 @@ private constructor( /** * Method to execute (e.g., "click", "fill") * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun method(): String = method.getRequired("method") @@ -72,7 +72,7 @@ private constructor( /** * CSS or XPath selector for the element * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun selector(): String = selector.getRequired("selector") @@ -80,7 +80,7 @@ private constructor( /** * CDP backend node ID * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun backendNodeId(): Optional = backendNodeId.getOptional("backendNodeId") @@ -308,7 +308,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt similarity index 93% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt index 577bfbd..2d21ed5 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt @@ -11,7 +11,7 @@ import com.stagehand.api.core.ExcludeMissing import com.stagehand.api.core.JsonField import com.stagehand.api.core.JsonMissing import com.stagehand.api.core.JsonValue -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -38,7 +38,7 @@ private constructor( /** * API key for the model provider * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun apiKey(): Optional = apiKey.getOptional("apiKey") @@ -46,7 +46,7 @@ private constructor( /** * Custom base URL for API * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun baseUrl(): Optional = baseUrl.getOptional("baseURL") @@ -54,13 +54,13 @@ private constructor( /** * Model name * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun provider(): Optional = provider.getOptional("provider") @@ -219,7 +219,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -303,7 +303,7 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws StagehandInvalidDataException if this class instance's value is a not a known + * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = @@ -311,7 +311,7 @@ private constructor( OPENAI -> Known.OPENAI ANTHROPIC -> Known.ANTHROPIC GOOGLE -> Known.GOOGLE - else -> throw StagehandInvalidDataException("Unknown Provider: $value") + else -> throw BrowserbaseInvalidDataException("Unknown Provider: $value") } /** @@ -320,12 +320,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws StagehandInvalidDataException if this class instance's value does not have the + * @throws BrowserbaseInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") + BrowserbaseInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -343,7 +343,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt similarity index 96% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt index 8631b64..eff4104 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt @@ -27,7 +27,7 @@ import com.stagehand.api.core.getOrThrow import com.stagehand.api.core.http.Headers import com.stagehand.api.core.http.QueryParams import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -53,7 +53,7 @@ private constructor( /** * Natural language instruction * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun input(): Input = body.input() @@ -61,13 +61,13 @@ private constructor( /** * Frame ID to act on (optional) * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun options(): Optional = body.options() @@ -372,7 +372,7 @@ private constructor( /** * Natural language instruction * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun input(): Input = input.getRequired("input") @@ -380,13 +380,13 @@ private constructor( /** * Frame ID to act on (optional) * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun options(): Optional = options.getOptional("options") @@ -551,7 +551,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -645,7 +645,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -709,10 +709,10 @@ private constructor( * version than the API, then the API may respond with new variants that the SDK is * unaware of. * - * @throws StagehandInvalidDataException in the default implementation. + * @throws BrowserbaseInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw StagehandInvalidDataException("Unknown Input: $json") + throw BrowserbaseInvalidDataException("Unknown Input: $json") } } @@ -782,7 +782,7 @@ private constructor( ) : this(model, timeout, variables, mutableMapOf()) /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") @@ -790,7 +790,7 @@ private constructor( /** * Timeout in milliseconds * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun timeout(): Optional = timeout.getOptional("timeout") @@ -798,7 +798,7 @@ private constructor( /** * Template variables for instruction * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun variables(): Optional = variables.getOptional("variables") @@ -940,7 +940,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -1030,7 +1030,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -1148,14 +1148,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws StagehandInvalidDataException if this class instance's value is a not a known + * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") + else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -1164,12 +1164,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws StagehandInvalidDataException if this class instance's value does not have the + * @throws BrowserbaseInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") + BrowserbaseInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1187,7 +1187,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt similarity index 95% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt index dca978d..f0d6751 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt @@ -13,7 +13,7 @@ import com.stagehand.api.core.JsonValue import com.stagehand.api.core.checkKnown import com.stagehand.api.core.checkRequired import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import kotlin.jvm.optionals.getOrNull @@ -39,7 +39,7 @@ private constructor( /** * Actions that were executed * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun actions(): List = actions.getRequired("actions") @@ -47,7 +47,7 @@ private constructor( /** * Result message * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun message(): String = message.getRequired("message") @@ -55,7 +55,7 @@ private constructor( /** * Whether the action succeeded * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun success(): Boolean = success.getRequired("success") @@ -231,7 +231,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndParams.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndParams.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndParams.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndParams.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt similarity index 95% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt index 3a162e7..59b3dc9 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt @@ -10,7 +10,7 @@ import com.stagehand.api.core.ExcludeMissing import com.stagehand.api.core.JsonField import com.stagehand.api.core.JsonMissing import com.stagehand.api.core.JsonValue -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -28,7 +28,7 @@ private constructor( ) : this(success, mutableMapOf()) /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun success(): Optional = success.getOptional("success") @@ -123,7 +123,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt similarity index 95% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt index 5d77b26..de2624a 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt @@ -26,7 +26,7 @@ import com.stagehand.api.core.checkRequired import com.stagehand.api.core.getOrThrow import com.stagehand.api.core.http.Headers import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -47,19 +47,19 @@ private constructor( fun xStreamResponse(): Optional = Optional.ofNullable(xStreamResponse) /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun agentConfig(): AgentConfig = body.agentConfig() /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun executeOptions(): ExecuteOptions = body.executeOptions() /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() @@ -368,19 +368,19 @@ private constructor( ) : this(agentConfig, executeOptions, frameId, mutableMapOf()) /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun agentConfig(): AgentConfig = agentConfig.getRequired("agentConfig") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun executeOptions(): ExecuteOptions = executeOptions.getRequired("executeOptions") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") @@ -549,7 +549,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -612,25 +612,25 @@ private constructor( /** * Enable Computer Use Agent mode * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun cua(): Optional = cua.getOptional("cua") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun provider(): Optional = provider.getOptional("provider") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun systemPrompt(): Optional = systemPrompt.getOptional("systemPrompt") @@ -801,7 +801,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -871,7 +871,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -935,10 +935,10 @@ private constructor( * version than the API, then the API may respond with new variants that the SDK is * unaware of. * - * @throws StagehandInvalidDataException in the default implementation. + * @throws BrowserbaseInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw StagehandInvalidDataException("Unknown Model: $json") + throw BrowserbaseInvalidDataException("Unknown Model: $json") } } @@ -1060,15 +1060,15 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and * don't want to throw for the unknown case. * - * @throws StagehandInvalidDataException if this class instance's value is a not a known - * member. + * @throws BrowserbaseInvalidDataException if this class instance's value is a not a + * known member. */ fun known(): Known = when (this) { OPENAI -> Known.OPENAI ANTHROPIC -> Known.ANTHROPIC GOOGLE -> Known.GOOGLE - else -> throw StagehandInvalidDataException("Unknown Provider: $value") + else -> throw BrowserbaseInvalidDataException("Unknown Provider: $value") } /** @@ -1077,12 +1077,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for * debugging and generally doesn't throw. * - * @throws StagehandInvalidDataException if this class instance's value does not have + * @throws BrowserbaseInvalidDataException if this class instance's value does not have * the expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") + BrowserbaseInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1100,7 +1100,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -1171,7 +1171,7 @@ private constructor( /** * Task for the agent to complete * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun instruction(): String = instruction.getRequired("instruction") @@ -1179,7 +1179,7 @@ private constructor( /** * Visually highlight the cursor during actions * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun highlightCursor(): Optional = highlightCursor.getOptional("highlightCursor") @@ -1187,7 +1187,7 @@ private constructor( /** * Maximum number of steps the agent can take * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun maxSteps(): Optional = maxSteps.getOptional("maxSteps") @@ -1357,7 +1357,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -1462,14 +1462,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws StagehandInvalidDataException if this class instance's value is a not a known + * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") + else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -1478,12 +1478,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws StagehandInvalidDataException if this class instance's value does not have the + * @throws BrowserbaseInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") + BrowserbaseInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1501,7 +1501,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt similarity index 95% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt index 6fdda9d..861033b 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt @@ -12,7 +12,7 @@ import com.stagehand.api.core.JsonMissing import com.stagehand.api.core.JsonValue import com.stagehand.api.core.checkKnown import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -35,7 +35,7 @@ private constructor( /** * Final message from the agent * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun message(): Optional = message.getOptional("message") @@ -43,7 +43,7 @@ private constructor( /** * Steps taken by the agent * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun steps(): Optional> = steps.getOptional("steps") @@ -179,7 +179,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt similarity index 95% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt index 7d0c9a4..c6cd822 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt @@ -15,7 +15,7 @@ import com.stagehand.api.core.Params import com.stagehand.api.core.http.Headers import com.stagehand.api.core.http.QueryParams import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -41,7 +41,7 @@ private constructor( /** * Frame ID to extract from * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() @@ -49,13 +49,13 @@ private constructor( /** * Natural language instruction for extraction * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun instruction(): Optional = body.instruction() /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun options(): Optional = body.options() @@ -63,7 +63,7 @@ private constructor( /** * JSON Schema for structured output * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun schema(): Optional = body.schema() @@ -374,7 +374,7 @@ private constructor( /** * Frame ID to extract from * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") @@ -382,13 +382,13 @@ private constructor( /** * Natural language instruction for extraction * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun instruction(): Optional = instruction.getOptional("instruction") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun options(): Optional = options.getOptional("options") @@ -396,7 +396,7 @@ private constructor( /** * JSON Schema for structured output * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun schema(): Optional = schema.getOptional("schema") @@ -562,7 +562,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -621,7 +621,7 @@ private constructor( ) : this(model, selector, timeout, mutableMapOf()) /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") @@ -629,13 +629,13 @@ private constructor( /** * Extract only from elements matching this selector * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun selector(): Optional = selector.getOptional("selector") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun timeout(): Optional = timeout.getOptional("timeout") @@ -774,7 +774,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -883,7 +883,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -979,14 +979,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws StagehandInvalidDataException if this class instance's value is a not a known + * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") + else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -995,12 +995,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws StagehandInvalidDataException if this class instance's value does not have the + * @throws BrowserbaseInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") + BrowserbaseInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1018,7 +1018,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt similarity index 96% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt index 3126a4c..912bbcb 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt @@ -22,7 +22,7 @@ import com.stagehand.api.core.JsonValue import com.stagehand.api.core.allMaxBy import com.stagehand.api.core.getOrThrow import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -87,7 +87,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -160,10 +160,10 @@ private constructor( * on an older version than the API, then the API may respond with new variants that the SDK * is unaware of. * - * @throws StagehandInvalidDataException in the default implementation. + * @throws BrowserbaseInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw StagehandInvalidDataException("Unknown SessionExtractResponse: $json") + throw BrowserbaseInvalidDataException("Unknown SessionExtractResponse: $json") } } @@ -230,7 +230,7 @@ private constructor( ) : this(extraction, mutableMapOf()) /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun extraction(): Optional = extraction.getOptional("extraction") @@ -327,7 +327,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -428,7 +428,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt similarity index 95% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt index 634a032..bb111b3 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt @@ -15,7 +15,7 @@ import com.stagehand.api.core.Params import com.stagehand.api.core.checkRequired import com.stagehand.api.core.http.Headers import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -38,19 +38,19 @@ private constructor( /** * URL to navigate to * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun url(): String = body.url() /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun options(): Optional = body.options() @@ -348,19 +348,19 @@ private constructor( /** * URL to navigate to * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun url(): String = url.getRequired("url") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun options(): Optional = options.getOptional("options") @@ -518,7 +518,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -573,7 +573,7 @@ private constructor( /** * When to consider navigation complete * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun waitUntil(): Optional = waitUntil.getOptional("waitUntil") @@ -671,7 +671,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -757,15 +757,15 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and * don't want to throw for the unknown case. * - * @throws StagehandInvalidDataException if this class instance's value is a not a known - * member. + * @throws BrowserbaseInvalidDataException if this class instance's value is a not a + * known member. */ fun known(): Known = when (this) { LOAD -> Known.LOAD DOMCONTENTLOADED -> Known.DOMCONTENTLOADED NETWORKIDLE -> Known.NETWORKIDLE - else -> throw StagehandInvalidDataException("Unknown WaitUntil: $value") + else -> throw BrowserbaseInvalidDataException("Unknown WaitUntil: $value") } /** @@ -774,12 +774,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for * debugging and generally doesn't throw. * - * @throws StagehandInvalidDataException if this class instance's value does not have + * @throws BrowserbaseInvalidDataException if this class instance's value does not have * the expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") + BrowserbaseInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -797,7 +797,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -907,14 +907,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws StagehandInvalidDataException if this class instance's value is a not a known + * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") + else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -923,12 +923,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws StagehandInvalidDataException if this class instance's value does not have the + * @throws BrowserbaseInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") + BrowserbaseInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -946,7 +946,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt similarity index 94% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt index b6a5d86..e570e58 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt @@ -10,7 +10,7 @@ import com.stagehand.api.core.ExcludeMissing import com.stagehand.api.core.JsonField import com.stagehand.api.core.JsonMissing import com.stagehand.api.core.JsonValue -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -33,19 +33,19 @@ private constructor( ) : this(ok, status, url, mutableMapOf()) /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun ok(): Optional = ok.getOptional("ok") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun status(): Optional = status.getOptional("status") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun url(): Optional = url.getOptional("url") @@ -180,7 +180,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt similarity index 95% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt index e3d18de..84d197c 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt @@ -14,7 +14,7 @@ import com.stagehand.api.core.JsonValue import com.stagehand.api.core.Params import com.stagehand.api.core.http.Headers import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -40,7 +40,7 @@ private constructor( /** * Frame ID to observe * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() @@ -48,13 +48,13 @@ private constructor( /** * Natural language instruction to filter actions * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun instruction(): Optional = body.instruction() /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun options(): Optional = body.options() @@ -344,7 +344,7 @@ private constructor( /** * Frame ID to observe * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") @@ -352,13 +352,13 @@ private constructor( /** * Natural language instruction to filter actions * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun instruction(): Optional = instruction.getOptional("instruction") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun options(): Optional = options.getOptional("options") @@ -502,7 +502,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -559,7 +559,7 @@ private constructor( ) : this(model, selector, timeout, mutableMapOf()) /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") @@ -567,13 +567,13 @@ private constructor( /** * Observe only elements matching this selector * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun selector(): Optional = selector.getOptional("selector") /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun timeout(): Optional = timeout.getOptional("timeout") @@ -712,7 +712,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -817,14 +817,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws StagehandInvalidDataException if this class instance's value is a not a known + * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") + else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -833,12 +833,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws StagehandInvalidDataException if this class instance's value does not have the + * @throws BrowserbaseInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") + BrowserbaseInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -856,7 +856,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt similarity index 94% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt index 4b7050c..0a52ee0 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt @@ -15,7 +15,7 @@ import com.stagehand.api.core.Params import com.stagehand.api.core.checkRequired import com.stagehand.api.core.http.Headers import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional @@ -35,7 +35,7 @@ private constructor( /** * Environment to run the browser in * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun env(): Env = body.env() @@ -43,7 +43,7 @@ private constructor( /** * API key for Browserbase (required when env=BROWSERBASE) * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun apiKey(): Optional = body.apiKey() @@ -51,7 +51,7 @@ private constructor( /** * Timeout in ms to wait for DOM to settle * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun domSettleTimeout(): Optional = body.domSettleTimeout() @@ -59,7 +59,7 @@ private constructor( /** * Options for local browser launch * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun localBrowserLaunchOptions(): Optional = @@ -68,7 +68,7 @@ private constructor( /** * AI model to use for actions * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun model(): Optional = body.model() @@ -76,7 +76,7 @@ private constructor( /** * Project ID for Browserbase (required when env=BROWSERBASE) * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun projectId(): Optional = body.projectId() @@ -84,7 +84,7 @@ private constructor( /** * Enable self-healing for failed actions * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun selfHeal(): Optional = body.selfHeal() @@ -92,7 +92,7 @@ private constructor( /** * Custom system prompt for AI actions * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun systemPrompt(): Optional = body.systemPrompt() @@ -100,7 +100,7 @@ private constructor( /** * Logging verbosity level * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun verbose(): Optional = body.verbose() @@ -532,7 +532,7 @@ private constructor( /** * Environment to run the browser in * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun env(): Env = env.getRequired("env") @@ -540,7 +540,7 @@ private constructor( /** * API key for Browserbase (required when env=BROWSERBASE) * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun apiKey(): Optional = apiKey.getOptional("apiKey") @@ -548,7 +548,7 @@ private constructor( /** * Timeout in ms to wait for DOM to settle * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun domSettleTimeout(): Optional = domSettleTimeout.getOptional("domSettleTimeout") @@ -556,7 +556,7 @@ private constructor( /** * Options for local browser launch * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun localBrowserLaunchOptions(): Optional = @@ -565,7 +565,7 @@ private constructor( /** * AI model to use for actions * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") @@ -573,7 +573,7 @@ private constructor( /** * Project ID for Browserbase (required when env=BROWSERBASE) * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun projectId(): Optional = projectId.getOptional("projectId") @@ -581,7 +581,7 @@ private constructor( /** * Enable self-healing for failed actions * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun selfHeal(): Optional = selfHeal.getOptional("selfHeal") @@ -589,7 +589,7 @@ private constructor( /** * Custom system prompt for AI actions * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun systemPrompt(): Optional = systemPrompt.getOptional("systemPrompt") @@ -597,7 +597,7 @@ private constructor( /** * Logging verbosity level * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun verbose(): Optional = verbose.getOptional("verbose") @@ -914,7 +914,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -1039,14 +1039,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws StagehandInvalidDataException if this class instance's value is a not a known + * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { LOCAL -> Known.LOCAL BROWSERBASE -> Known.BROWSERBASE - else -> throw StagehandInvalidDataException("Unknown Env: $value") + else -> throw BrowserbaseInvalidDataException("Unknown Env: $value") } /** @@ -1055,12 +1055,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws StagehandInvalidDataException if this class instance's value does not have the + * @throws BrowserbaseInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") + BrowserbaseInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1078,7 +1078,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } @@ -1119,7 +1119,7 @@ private constructor( ) : this(headless, mutableMapOf()) /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun headless(): Optional = headless.getOptional("headless") @@ -1218,7 +1218,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt similarity index 95% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt index b8bc8da..e78188e 100644 --- a/stagehand-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt @@ -11,7 +11,7 @@ import com.stagehand.api.core.JsonField import com.stagehand.api.core.JsonMissing import com.stagehand.api.core.JsonValue import com.stagehand.api.core.checkRequired -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects @@ -32,7 +32,7 @@ private constructor( /** * Whether the session is ready to use * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun available(): Boolean = available.getRequired("available") @@ -40,7 +40,7 @@ private constructor( /** * Unique identifier for the session * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun sessionId(): String = sessionId.getRequired("sessionId") @@ -179,7 +179,7 @@ private constructor( try { validate() true - } catch (e: StagehandInvalidDataException) { + } catch (e: BrowserbaseInvalidDataException) { false } diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsync.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsync.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsync.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsync.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsyncImpl.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsyncImpl.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsyncImpl.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsyncImpl.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionService.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionService.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionService.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionService.kt diff --git a/stagehand-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionServiceImpl.kt b/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionServiceImpl.kt similarity index 100% rename from stagehand-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionServiceImpl.kt rename to browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionServiceImpl.kt diff --git a/stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro b/browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro similarity index 100% rename from stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro rename to browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/TestServerExtension.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/TestServerExtension.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/TestServerExtension.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/TestServerExtension.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/ClientOptionsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ClientOptionsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/core/ClientOptionsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ClientOptionsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/ObjectMappersTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ObjectMappersTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/core/ObjectMappersTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ObjectMappersTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/PhantomReachableTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/PhantomReachableTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/core/PhantomReachableTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/core/PhantomReachableTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/UtilsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/UtilsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/core/UtilsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/core/UtilsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/ValuesTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ValuesTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/core/ValuesTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ValuesTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/http/AsyncStreamResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/AsyncStreamResponseTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/core/http/AsyncStreamResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/AsyncStreamResponseTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/http/HeadersTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/HeadersTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/core/http/HeadersTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/HeadersTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/http/QueryParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/QueryParamsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/core/http/QueryParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/QueryParamsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt similarity index 98% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt index 380321a..46bbd9f 100644 --- a/stagehand-java-core/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt @@ -7,7 +7,7 @@ import com.github.tomakehurst.wiremock.stubbing.Scenario import com.stagehand.api.client.okhttp.OkHttpClient import com.stagehand.api.core.RequestOptions import com.stagehand.api.core.Sleeper -import com.stagehand.api.errors.StagehandRetryableException +import com.stagehand.api.errors.BrowserbaseRetryableException import java.io.InputStream import java.time.Duration import java.util.concurrent.CompletableFuture @@ -267,7 +267,7 @@ internal class RetryingHttpClientTest { ): HttpResponse { callCount++ if (callCount == 1) { - throw StagehandRetryableException("Simulated retryable failure") + throw BrowserbaseRetryableException("Simulated retryable failure") } return httpClient.execute(request, requestOptions) } @@ -280,7 +280,7 @@ internal class RetryingHttpClientTest { if (callCount == 1) { val future = CompletableFuture() future.completeExceptionally( - StagehandRetryableException("Simulated retryable failure") + BrowserbaseRetryableException("Simulated retryable failure") ) return future } diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ActionTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ActionTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ActionTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ActionTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ModelConfigTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ModelConfigTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ModelConfigTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ModelConfigTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActParamsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActParamsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActResponseTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActResponseTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndParamsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndParamsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndResponseTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndResponseTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParamsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParamsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponseTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponseTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractParamsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractParamsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt similarity index 95% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt index 22f62ea..9615580 100644 --- a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt @@ -5,7 +5,7 @@ package com.stagehand.api.models.sessions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import com.stagehand.api.core.JsonValue import com.stagehand.api.core.jsonMapper -import com.stagehand.api.errors.StagehandInvalidDataException +import com.stagehand.api.errors.BrowserbaseInvalidDataException import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows @@ -88,7 +88,7 @@ internal class SessionExtractResponseTest { val sessionExtractResponse = jsonMapper().convertValue(testCase.value, jacksonTypeRef()) - val e = assertThrows { sessionExtractResponse.validate() } + val e = assertThrows { sessionExtractResponse.validate() } assertThat(e).hasMessageStartingWith("Unknown ") } } diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateParamsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateParamsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponseTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponseTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionObserveParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionObserveParamsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionObserveParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionObserveParamsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartParamsTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartParamsTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartResponseTest.kt similarity index 100% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartResponseTest.kt diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt similarity index 98% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt index f35e2ad..8fc0701 100644 --- a/stagehand-java-core/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt @@ -8,17 +8,17 @@ import com.github.tomakehurst.wiremock.client.WireMock.status import com.github.tomakehurst.wiremock.client.WireMock.stubFor import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest -import com.stagehand.api.client.StagehandClient -import com.stagehand.api.client.okhttp.StagehandOkHttpClient +import com.stagehand.api.client.BrowserbaseClient +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient import com.stagehand.api.core.JsonValue import com.stagehand.api.core.http.Headers import com.stagehand.api.core.jsonMapper import com.stagehand.api.errors.BadRequestException +import com.stagehand.api.errors.BrowserbaseException import com.stagehand.api.errors.InternalServerException import com.stagehand.api.errors.NotFoundException import com.stagehand.api.errors.PermissionDeniedException import com.stagehand.api.errors.RateLimitException -import com.stagehand.api.errors.StagehandException import com.stagehand.api.errors.UnauthorizedException import com.stagehand.api.errors.UnexpectedStatusCodeException import com.stagehand.api.errors.UnprocessableEntityException @@ -47,12 +47,12 @@ internal class ErrorHandlingTest { private const val NOT_JSON: String = "Not JSON" } - private lateinit var client: StagehandClient + private lateinit var client: BrowserbaseClient @BeforeEach fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { client = - StagehandOkHttpClient.builder() + BrowserbaseOkHttpClient.builder() .baseUrl(wmRuntimeInfo.httpBaseUrl) .apiKey("My API Key") .build() @@ -643,7 +643,7 @@ internal class ErrorHandlingTest { ) val e = - assertThrows { + assertThrows { sessionService.start( SessionStartParams.builder() .env(SessionStartParams.Env.LOCAL) diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt similarity index 92% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt index 801d8ff..76f9dd5 100644 --- a/stagehand-java-core/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt @@ -12,8 +12,8 @@ import com.github.tomakehurst.wiremock.client.WireMock.stubFor import com.github.tomakehurst.wiremock.client.WireMock.verify import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest -import com.stagehand.api.client.StagehandClient -import com.stagehand.api.client.okhttp.StagehandOkHttpClient +import com.stagehand.api.client.BrowserbaseClient +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient import com.stagehand.api.core.JsonValue import com.stagehand.api.models.sessions.SessionStartParams import org.junit.jupiter.api.BeforeEach @@ -25,12 +25,12 @@ import org.junit.jupiter.api.parallel.ResourceLock @ResourceLock("https://github.com/wiremock/wiremock/issues/169") internal class ServiceParamsTest { - private lateinit var client: StagehandClient + private lateinit var client: BrowserbaseClient @BeforeEach fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { client = - StagehandOkHttpClient.builder() + BrowserbaseOkHttpClient.builder() .baseUrl(wmRuntimeInfo.httpBaseUrl) .apiKey("My API Key") .build() diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt similarity index 95% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt index 49b568d..e01497b 100644 --- a/stagehand-java-core/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt @@ -3,7 +3,7 @@ package com.stagehand.api.services.async import com.stagehand.api.TestServerExtension -import com.stagehand.api.client.okhttp.StagehandOkHttpClientAsync +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClientAsync import com.stagehand.api.core.JsonValue import com.stagehand.api.models.sessions.ModelConfig import com.stagehand.api.models.sessions.SessionActParams @@ -24,7 +24,7 @@ internal class SessionServiceAsyncTest { @Test fun act() { val client = - StagehandOkHttpClientAsync.builder() + BrowserbaseOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -66,7 +66,7 @@ internal class SessionServiceAsyncTest { @Test fun end() { val client = - StagehandOkHttpClientAsync.builder() + BrowserbaseOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -82,7 +82,7 @@ internal class SessionServiceAsyncTest { @Test fun executeAgent() { val client = - StagehandOkHttpClientAsync.builder() + BrowserbaseOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -120,7 +120,7 @@ internal class SessionServiceAsyncTest { @Test fun extract() { val client = - StagehandOkHttpClientAsync.builder() + BrowserbaseOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -163,7 +163,7 @@ internal class SessionServiceAsyncTest { @Test fun navigate() { val client = - StagehandOkHttpClientAsync.builder() + BrowserbaseOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -193,7 +193,7 @@ internal class SessionServiceAsyncTest { @Test fun observe() { val client = - StagehandOkHttpClientAsync.builder() + BrowserbaseOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -231,7 +231,7 @@ internal class SessionServiceAsyncTest { @Test fun start() { val client = - StagehandOkHttpClientAsync.builder() + BrowserbaseOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() diff --git a/stagehand-java-core/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt b/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt similarity index 95% rename from stagehand-java-core/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt rename to browserbase-java-core/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt index 8b92fe7..e0d7f43 100644 --- a/stagehand-java-core/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt @@ -3,7 +3,7 @@ package com.stagehand.api.services.blocking import com.stagehand.api.TestServerExtension -import com.stagehand.api.client.okhttp.StagehandOkHttpClient +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient import com.stagehand.api.core.JsonValue import com.stagehand.api.models.sessions.ModelConfig import com.stagehand.api.models.sessions.SessionActParams @@ -24,7 +24,7 @@ internal class SessionServiceTest { @Test fun act() { val client = - StagehandOkHttpClient.builder() + BrowserbaseOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -65,7 +65,7 @@ internal class SessionServiceTest { @Test fun end() { val client = - StagehandOkHttpClient.builder() + BrowserbaseOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -80,7 +80,7 @@ internal class SessionServiceTest { @Test fun executeAgent() { val client = - StagehandOkHttpClient.builder() + BrowserbaseOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -117,7 +117,7 @@ internal class SessionServiceTest { @Test fun extract() { val client = - StagehandOkHttpClient.builder() + BrowserbaseOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -159,7 +159,7 @@ internal class SessionServiceTest { @Test fun navigate() { val client = - StagehandOkHttpClient.builder() + BrowserbaseOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -188,7 +188,7 @@ internal class SessionServiceTest { @Test fun observe() { val client = - StagehandOkHttpClient.builder() + BrowserbaseOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -225,7 +225,7 @@ internal class SessionServiceTest { @Test fun start() { val client = - StagehandOkHttpClient.builder() + BrowserbaseOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() diff --git a/browserbase-java-example/build.gradle.kts b/browserbase-java-example/build.gradle.kts new file mode 100644 index 0000000..61df3c5 --- /dev/null +++ b/browserbase-java-example/build.gradle.kts @@ -0,0 +1,28 @@ +plugins { + id("browserbase.java") + application +} + +repositories { + mavenCentral() +} + +dependencies { + implementation(project(":browserbase-java")) +} + +tasks.withType().configureEach { + // Allow using more modern APIs, like `List.of` and `Map.of`, in examples. + options.release.set(9) +} + +application { + // Use `./gradlew :browserbase-java-example:run` to run `Main` + // Use `./gradlew :browserbase-java-example:run -Pexample=Something` to run `SomethingExample` + mainClass = "com.stagehand.api.example.${ + if (project.hasProperty("example")) + "${project.property("example")}Example" + else + "Main" + }" +} diff --git a/browserbase-java-lib/.keep b/browserbase-java-lib/.keep new file mode 100644 index 0000000..5e2c99f --- /dev/null +++ b/browserbase-java-lib/.keep @@ -0,0 +1,4 @@ +File generated from our OpenAPI spec by Stainless. + +This directory can be used to store custom files to expand the SDK. +It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/stagehand-java-proguard-test/build.gradle.kts b/browserbase-java-proguard-test/build.gradle.kts similarity index 90% rename from stagehand-java-proguard-test/build.gradle.kts rename to browserbase-java-proguard-test/build.gradle.kts index a4cde75..4d0189d 100644 --- a/stagehand-java-proguard-test/build.gradle.kts +++ b/browserbase-java-proguard-test/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("stagehand.kotlin") + id("browserbase.kotlin") id("com.gradleup.shadow") version "8.3.8" } @@ -15,7 +15,7 @@ buildscript { } dependencies { - testImplementation(project(":stagehand-java")) + testImplementation(project(":browserbase-java")) testImplementation(kotlin("test")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") testImplementation("org.assertj:assertj-core:3.25.3") @@ -51,7 +51,7 @@ val proguardJar by tasks.registering(proguard.gradle.ProGuardTask::class) { } configuration("./test.pro") - configuration("../stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro") + configuration("../browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro") } val testProGuard by tasks.registering(JavaExec::class) { @@ -78,7 +78,7 @@ val r8Jar by tasks.registering(JavaExec::class) { "--output", r8JarPath, "--lib", System.getProperty("java.home"), "--pg-conf", "./test.pro", - "--pg-conf", "../stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro", + "--pg-conf", "../browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro", "--pg-map-output", "${layout.buildDirectory.get()}/r8-mapping.txt", tasks.shadowJar.get().archiveFile.get().asFile.absolutePath, ) diff --git a/stagehand-java-proguard-test/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt b/browserbase-java-proguard-test/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt similarity index 93% rename from stagehand-java-proguard-test/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt rename to browserbase-java-proguard-test/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt index 13ad08e..82fd595 100644 --- a/stagehand-java-proguard-test/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt +++ b/browserbase-java-proguard-test/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt @@ -3,7 +3,7 @@ package com.stagehand.api.proguard import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.client.okhttp.StagehandOkHttpClient +import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient import com.stagehand.api.core.jsonMapper import com.stagehand.api.models.sessions.Action import com.stagehand.api.models.sessions.SessionExtractResponse @@ -38,14 +38,14 @@ internal class ProGuardCompatibilityTest { @Test fun proguardRules() { val rulesFile = - javaClass.classLoader.getResourceAsStream("META-INF/proguard/stagehand-java-core.pro") + javaClass.classLoader.getResourceAsStream("META-INF/proguard/browserbase-java-core.pro") assertThat(rulesFile).isNotNull() } @Test fun client() { - val client = StagehandOkHttpClient.builder().apiKey("My API Key").build() + val client = BrowserbaseOkHttpClient.builder().apiKey("My API Key").build() assertThat(client).isNotNull() assertThat(client.sessions()).isNotNull() diff --git a/stagehand-java-proguard-test/test.pro b/browserbase-java-proguard-test/test.pro similarity index 100% rename from stagehand-java-proguard-test/test.pro rename to browserbase-java-proguard-test/test.pro diff --git a/stagehand-java/build.gradle.kts b/browserbase-java/build.gradle.kts similarity index 85% rename from stagehand-java/build.gradle.kts rename to browserbase-java/build.gradle.kts index 6d32486..86b7f8c 100644 --- a/stagehand-java/build.gradle.kts +++ b/browserbase-java/build.gradle.kts @@ -1,10 +1,10 @@ plugins { - id("stagehand.kotlin") - id("stagehand.publish") + id("browserbase.kotlin") + id("browserbase.publish") } dependencies { - api(project(":stagehand-java-client-okhttp")) + api(project(":browserbase-java-client-okhttp")) } // Redefine `dokkaJavadoc` to: diff --git a/build.gradle.kts b/build.gradle.kts index 5703c44..2fffcae 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,7 +32,7 @@ subprojects { // Avoid race conditions between `dokkaJavadocCollector` and `dokkaJavadocJar` tasks tasks.named("dokkaJavadocCollector").configure { subprojects.flatMap { it.tasks } - .filter { it.project.name != "stagehand-java" && it.name == "dokkaJavadocJar" } + .filter { it.project.name != "browserbase-java" && it.name == "dokkaJavadocJar" } .forEach { mustRunAfter(it) } } diff --git a/buildSrc/src/main/kotlin/stagehand.java.gradle.kts b/buildSrc/src/main/kotlin/browserbase.java.gradle.kts similarity index 100% rename from buildSrc/src/main/kotlin/stagehand.java.gradle.kts rename to buildSrc/src/main/kotlin/browserbase.java.gradle.kts diff --git a/buildSrc/src/main/kotlin/stagehand.kotlin.gradle.kts b/buildSrc/src/main/kotlin/browserbase.kotlin.gradle.kts similarity index 99% rename from buildSrc/src/main/kotlin/stagehand.kotlin.gradle.kts rename to buildSrc/src/main/kotlin/browserbase.kotlin.gradle.kts index f3f48d1..08574e8 100644 --- a/buildSrc/src/main/kotlin/stagehand.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/browserbase.kotlin.gradle.kts @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion plugins { - id("stagehand.java") + id("browserbase.java") kotlin("jvm") } diff --git a/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts b/buildSrc/src/main/kotlin/browserbase.publish.gradle.kts similarity index 97% rename from buildSrc/src/main/kotlin/stagehand.publish.gradle.kts rename to buildSrc/src/main/kotlin/browserbase.publish.gradle.kts index 326eeea..6822ae8 100644 --- a/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/browserbase.publish.gradle.kts @@ -21,7 +21,7 @@ configure { developers { developer { - name.set("Stagehand") + name.set("Browserbase") } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 02623dd..53191ab 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,11 +1,11 @@ -rootProject.name = "stagehand-java-root" +rootProject.name = "browserbase-java-root" val projectNames = rootDir.listFiles() ?.asSequence() .orEmpty() .filter { file -> file.isDirectory && - file.name.startsWith("stagehand-java") && + file.name.startsWith("browserbase-java") && file.listFiles()?.asSequence().orEmpty().any { it.name == "build.gradle.kts" } } .map { it.name } From c6de1b76dc1deb1355c2e119740d4f494679e1ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:13:53 +0000 Subject: [PATCH 03/14] feat(api): manual updates --- .stats.yml | 2 +- README.md | 164 +++++++++--------- .../client/okhttp/BrowserbaseOkHttpClient.kt | 24 +-- .../okhttp/BrowserbaseOkHttpClientAsync.kt | 24 +-- .../api/client/okhttp/OkHttpClient.kt | 22 +-- .../api/client/okhttp/OkHttpClientTest.kt | 6 +- .../api/client/BrowserbaseClient.kt | 6 +- .../api/client/BrowserbaseClientAsync.kt | 6 +- .../api/client/BrowserbaseClientAsyncImpl.kt | 10 +- .../api/client/BrowserbaseClientImpl.kt | 10 +- .../api/core/BaseDeserializer.kt | 2 +- .../api/core/BaseSerializer.kt | 2 +- .../api/core/Check.kt | 2 +- .../api/core/ClientOptions.kt | 18 +- .../api/core/DefaultSleeper.kt | 2 +- .../api/core/ObjectMappers.kt | 2 +- .../api/core/Params.kt | 6 +- .../api/core/PhantomReachable.kt | 4 +- .../core/PhantomReachableExecutorService.kt | 2 +- .../api/core/PhantomReachableSleeper.kt | 2 +- .../api/core/PrepareRequest.kt | 4 +- .../api/core/Properties.kt | 4 +- .../api/core/RequestOptions.kt | 2 +- .../api/core/Sleeper.kt | 2 +- .../api/core/Timeout.kt | 2 +- .../api/core/Utils.kt | 4 +- .../api/core/Values.kt | 4 +- .../api/core/handlers/ErrorHandler.kt | 26 +-- .../api/core/handlers/JsonHandler.kt | 8 +- .../api/core/handlers/StringHandler.kt | 6 +- .../api/core/http/AsyncStreamResponse.kt | 4 +- .../api/core/http/Headers.kt | 22 +-- .../api/core/http/HttpClient.kt | 4 +- .../api/core/http/HttpMethod.kt | 2 +- .../api/core/http/HttpRequest.kt | 6 +- .../api/core/http/HttpRequestBodies.kt | 6 +- .../api/core/http/HttpRequestBody.kt | 2 +- .../api/core/http/HttpResponse.kt | 2 +- .../api/core/http/HttpResponseFor.kt | 2 +- ...ntomReachableClosingAsyncStreamResponse.kt | 6 +- .../http/PhantomReachableClosingHttpClient.kt | 6 +- .../PhantomReachableClosingStreamResponse.kt | 4 +- .../api/core/http/QueryParams.kt | 22 +-- .../api/core/http/RetryingHttpClient.kt | 16 +- .../api/core/http/StreamResponse.kt | 2 +- .../api/errors/BadRequestException.kt | 8 +- .../api/errors/BrowserbaseException.kt | 2 +- .../errors/BrowserbaseInvalidDataException.kt | 2 +- .../api/errors/BrowserbaseIoException.kt | 2 +- .../errors/BrowserbaseRetryableException.kt | 2 +- .../api/errors/BrowserbaseServiceException.kt | 6 +- .../api/errors/InternalServerException.kt | 8 +- .../api/errors/NotFoundException.kt | 8 +- .../api/errors/PermissionDeniedException.kt | 8 +- .../api/errors/RateLimitException.kt | 8 +- .../api/errors/UnauthorizedException.kt | 8 +- .../errors/UnexpectedStatusCodeException.kt | 8 +- .../errors/UnprocessableEntityException.kt | 8 +- .../api/models/sessions/Action.kt | 20 +-- .../api/models/sessions/ModelConfig.kt | 16 +- .../api/models/sessions/SessionActParams.kt | 34 ++-- .../api/models/sessions/SessionActResponse.kt | 20 +-- .../api/models/sessions/SessionEndParams.kt | 12 +- .../api/models/sessions/SessionEndResponse.kt | 12 +- .../sessions/SessionExecuteAgentParams.kt | 32 ++-- .../sessions/SessionExecuteAgentResponse.kt | 18 +- .../models/sessions/SessionExtractParams.kt | 24 +-- .../models/sessions/SessionExtractResponse.kt | 24 +-- .../models/sessions/SessionNavigateParams.kt | 24 +-- .../sessions/SessionNavigateResponse.kt | 12 +- .../models/sessions/SessionObserveParams.kt | 22 +-- .../api/models/sessions/SessionStartParams.kt | 24 +-- .../models/sessions/SessionStartResponse.kt | 16 +- .../api/services/async/SessionServiceAsync.kt | 38 ++-- .../services/async/SessionServiceAsyncImpl.kt | 58 +++---- .../api/services/blocking/SessionService.kt | 38 ++-- .../services/blocking/SessionServiceImpl.kt | 58 +++---- .../proguard/browserbase-java-core.pro | 6 +- .../api/TestServerExtension.kt | 2 +- .../api/core/ClientOptionsTest.kt | 4 +- .../api/core/ObjectMappersTest.kt | 2 +- .../api/core/PhantomReachableTest.kt | 2 +- .../api/core/UtilsTest.kt | 2 +- .../api/core/ValuesTest.kt | 2 +- .../api/core/http/AsyncStreamResponseTest.kt | 2 +- .../api/core/http/HeadersTest.kt | 2 +- .../api/core/http/QueryParamsTest.kt | 2 +- .../api/core/http/RetryingHttpClientTest.kt | 10 +- .../api/models/sessions/ActionTest.kt | 4 +- .../api/models/sessions/ModelConfigTest.kt | 4 +- .../models/sessions/SessionActParamsTest.kt | 6 +- .../models/sessions/SessionActResponseTest.kt | 4 +- .../models/sessions/SessionEndParamsTest.kt | 2 +- .../models/sessions/SessionEndResponseTest.kt | 4 +- .../sessions/SessionExecuteAgentParamsTest.kt | 4 +- .../SessionExecuteAgentResponseTest.kt | 6 +- .../sessions/SessionExtractParamsTest.kt | 6 +- .../sessions/SessionExtractResponseTest.kt | 8 +- .../sessions/SessionNavigateParamsTest.kt | 4 +- .../sessions/SessionNavigateResponseTest.kt | 4 +- .../sessions/SessionObserveParamsTest.kt | 4 +- .../models/sessions/SessionStartParamsTest.kt | 2 +- .../sessions/SessionStartResponseTest.kt | 4 +- .../api/services/ErrorHandlingTest.kt | 34 ++-- .../api/services/ServiceParamsTest.kt | 10 +- .../services/async/SessionServiceAsyncTest.kt | 22 +-- .../services/blocking/SessionServiceTest.kt | 24 +-- .../build.gradle.kts | 4 +- .../api/proguard/ProGuardCompatibilityTest.kt | 10 +- browserbase-java-proguard-test/test.pro | 2 +- build.gradle.kts | 2 +- 111 files changed, 637 insertions(+), 637 deletions(-) rename browserbase-java-client-okhttp/src/main/kotlin/com/{stagehand => browserbase}/api/client/okhttp/BrowserbaseOkHttpClient.kt (95%) rename browserbase-java-client-okhttp/src/main/kotlin/com/{stagehand => browserbase}/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt (95%) rename browserbase-java-client-okhttp/src/main/kotlin/com/{stagehand => browserbase}/api/client/okhttp/OkHttpClient.kt (94%) rename browserbase-java-client-okhttp/src/test/kotlin/com/{stagehand => browserbase}/api/client/okhttp/OkHttpClientTest.kt (90%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/client/BrowserbaseClient.kt (95%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/client/BrowserbaseClientAsync.kt (95%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/client/BrowserbaseClientAsyncImpl.kt (88%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/client/BrowserbaseClientImpl.kt (88%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/BaseDeserializer.kt (97%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/BaseSerializer.kt (84%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/Check.kt (99%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/ClientOptions.kt (97%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/DefaultSleeper.kt (95%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/ObjectMappers.kt (99%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/Params.kt (75%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/PhantomReachable.kt (95%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/PhantomReachableExecutorService.kt (98%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/PhantomReachableSleeper.kt (95%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/PrepareRequest.kt (90%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/Properties.kt (92%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/RequestOptions.kt (97%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/Sleeper.kt (94%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/Timeout.kt (99%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/Utils.kt (97%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/Values.kt (99%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/handlers/ErrorHandler.kt (80%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/handlers/JsonHandler.kt (71%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/handlers/StringHandler.kt (66%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/AsyncStreamResponse.kt (98%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/Headers.kt (87%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/HttpClient.kt (89%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/HttpMethod.kt (76%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/HttpRequest.kt (97%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/HttpRequestBodies.kt (97%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/HttpRequestBody.kt (94%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/HttpResponse.kt (91%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/HttpResponseFor.kt (93%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt (91%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/PhantomReachableClosingHttpClient.kt (84%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/PhantomReachableClosingStreamResponse.kt (85%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/QueryParams.kt (90%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/RetryingHttpClient.kt (96%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/core/http/StreamResponse.kt (92%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/BadRequestException.kt (93%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/BrowserbaseException.kt (80%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/BrowserbaseInvalidDataException.kt (81%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/BrowserbaseIoException.kt (81%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/BrowserbaseRetryableException.kt (93%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/BrowserbaseServiceException.kt (72%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/InternalServerException.kt (94%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/NotFoundException.kt (92%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/PermissionDeniedException.kt (93%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/RateLimitException.kt (93%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/UnauthorizedException.kt (93%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/UnexpectedStatusCodeException.kt (94%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/errors/UnprocessableEntityException.kt (93%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/Action.kt (96%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/ModelConfig.kt (97%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionActParams.kt (98%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionActResponse.kt (95%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionEndParams.kt (97%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionEndResponse.kt (94%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionExecuteAgentParams.kt (98%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionExecuteAgentResponse.kt (95%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionExtractParams.kt (98%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionExtractResponse.kt (96%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionNavigateParams.kt (98%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionNavigateResponse.kt (96%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionObserveParams.kt (98%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionStartParams.kt (98%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionStartResponse.kt (95%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/services/async/SessionServiceAsync.kt (94%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/services/async/SessionServiceAsyncImpl.kt (89%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/services/blocking/SessionService.kt (93%) rename browserbase-java-core/src/main/kotlin/com/{stagehand => browserbase}/api/services/blocking/SessionServiceImpl.kt (88%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/TestServerExtension.kt (98%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/core/ClientOptionsTest.kt (93%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/core/ObjectMappersTest.kt (99%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/core/PhantomReachableTest.kt (95%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/core/UtilsTest.kt (97%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/core/ValuesTest.kt (99%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/core/http/AsyncStreamResponseTest.kt (99%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/core/http/HeadersTest.kt (99%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/core/http/QueryParamsTest.kt (99%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/core/http/RetryingHttpClientTest.kt (98%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/ActionTest.kt (94%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/ModelConfigTest.kt (94%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionActParamsTest.kt (97%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionActResponseTest.kt (96%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionEndParamsTest.kt (93%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionEndResponseTest.kt (91%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionExecuteAgentParamsTest.kt (98%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionExecuteAgentResponseTest.kt (91%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionExtractParamsTest.kt (97%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionExtractResponseTest.kt (94%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionNavigateParamsTest.kt (97%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionNavigateResponseTest.kt (92%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionObserveParamsTest.kt (98%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionStartParamsTest.kt (98%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/models/sessions/SessionStartResponseTest.kt (93%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/services/ErrorHandlingTest.kt (96%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/services/ServiceParamsTest.kt (90%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/services/async/SessionServiceAsyncTest.kt (93%) rename browserbase-java-core/src/test/kotlin/com/{stagehand => browserbase}/api/services/blocking/SessionServiceTest.kt (93%) rename browserbase-java-proguard-test/src/test/kotlin/com/{stagehand => browserbase}/api/proguard/ProGuardCompatibilityTest.kt (91%) diff --git a/.stats.yml b/.stats.yml index 18b7af8..ae2d02d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-0c12f985340be2a9287e8e01ff8733f7f2d02e019149d1ae95f1a8f8798c6690.yml openapi_spec_hash: efb79934e1dc63763dd4e8493b825273 -config_hash: 1548ab91b7e8621f7fa79e8cff0c3f93 +config_hash: 905fc70fd4344c8631aab6754bffd883 diff --git a/README.md b/README.md index 9c68b67..390f269 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.stagehand.api/browserbase-java)](https://central.sonatype.com/artifact/com.stagehand.api/browserbase-java/0.0.1) -[![javadoc](https://javadoc.io/badge2/com.stagehand.api/browserbase-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.stagehand.api/browserbase-java/0.0.1) +[![Maven Central](https://img.shields.io/maven-central/v/com.browserbase.api/browserbase-java)](https://central.sonatype.com/artifact/com.browserbase.api/browserbase-java/0.0.1) +[![javadoc](https://javadoc.io/badge2/com.browserbase.api/browserbase-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.browserbase.api/browserbase-java/0.0.1) @@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [browserbase.com](https://browserbase.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.stagehand.api/browserbase-java/0.0.1). +The REST API documentation can be found on [browserbase.com](https://browserbase.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.browserbase.api/browserbase-java/0.0.1). @@ -24,14 +24,14 @@ The REST API documentation can be found on [browserbase.com](https://browserbase ### Gradle ```kotlin -implementation("com.stagehand.api:browserbase-java:0.0.1") +implementation("com.browserbase.api:browserbase-java:0.0.1") ``` ### Maven ```xml - com.stagehand.api + com.browserbase.api browserbase-java 0.0.1 @@ -46,10 +46,10 @@ This library requires Java 8 or later. ## Usage ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; -import com.stagehand.api.models.sessions.SessionStartParams; -import com.stagehand.api.models.sessions.SessionStartResponse; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.models.sessions.SessionStartParams; +import com.browserbase.api.models.sessions.SessionStartResponse; // Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties // Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables @@ -66,8 +66,8 @@ SessionStartResponse response = client.sessions().start(params); Configure the client using system properties or environment variables: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; // Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties // Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables @@ -77,8 +77,8 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.fromEnv(); Or manually: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .apiKey("My API Key") @@ -88,8 +88,8 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() Or using a combination of the two approaches: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; BrowserbaseClient client = BrowserbaseOkHttpClient.builder() // Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties @@ -117,7 +117,7 @@ System properties take precedence over environment variables. To temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service: ```java -import com.stagehand.api.client.BrowserbaseClient; +import com.browserbase.api.client.BrowserbaseClient; BrowserbaseClient clientWithOptions = client.withOptions(optionsBuilder -> { optionsBuilder.baseUrl("https://example.com"); @@ -146,10 +146,10 @@ Because each class is immutable, builder modification will _never_ affect alread The default client is synchronous. To switch to asynchronous execution, call the `async()` method: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; -import com.stagehand.api.models.sessions.SessionStartParams; -import com.stagehand.api.models.sessions.SessionStartResponse; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.models.sessions.SessionStartParams; +import com.browserbase.api.models.sessions.SessionStartResponse; import java.util.concurrent.CompletableFuture; // Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties @@ -165,10 +165,10 @@ CompletableFuture response = client.async().sessions().sta Or create an asynchronous client from the beginning: ```java -import com.stagehand.api.client.BrowserbaseClientAsync; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClientAsync; -import com.stagehand.api.models.sessions.SessionStartParams; -import com.stagehand.api.models.sessions.SessionStartResponse; +import com.browserbase.api.client.BrowserbaseClientAsync; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClientAsync; +import com.browserbase.api.models.sessions.SessionStartParams; +import com.browserbase.api.models.sessions.SessionStartResponse; import java.util.concurrent.CompletableFuture; // Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties @@ -190,10 +190,10 @@ The SDK defines methods that deserialize responses into instances of Java classe To access this data, prefix any HTTP method call on a client or service with `withRawResponse()`: ```java -import com.stagehand.api.core.http.Headers; -import com.stagehand.api.core.http.HttpResponseFor; -import com.stagehand.api.models.sessions.SessionStartParams; -import com.stagehand.api.models.sessions.SessionStartResponse; +import com.browserbase.api.core.http.Headers; +import com.browserbase.api.core.http.HttpResponseFor; +import com.browserbase.api.models.sessions.SessionStartParams; +import com.browserbase.api.models.sessions.SessionStartResponse; SessionStartParams params = SessionStartParams.builder() .env(SessionStartParams.Env.LOCAL) @@ -207,7 +207,7 @@ Headers headers = response.headers(); You can still deserialize the response into an instance of a Java class if needed: ```java -import com.stagehand.api.models.sessions.SessionStartResponse; +import com.browserbase.api.models.sessions.SessionStartResponse; SessionStartResponse parsedResponse = response.parse(); ``` @@ -216,26 +216,26 @@ SessionStartResponse parsedResponse = response.parse(); The SDK throws custom unchecked exception types: -- [`BrowserbaseServiceException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code: +- [`BrowserbaseServiceException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code: - | Status | Exception | - | ------ | ---------------------------------------------------------------------------------------------------------------------------------- | - | 400 | [`BadRequestException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt) | - | 401 | [`UnauthorizedException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt) | - | 403 | [`PermissionDeniedException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt) | - | 404 | [`NotFoundException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt) | - | 422 | [`UnprocessableEntityException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt) | - | 429 | [`RateLimitException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt) | - | 5xx | [`InternalServerException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt) | - | others | [`UnexpectedStatusCodeException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt) | + | Status | Exception | + | ------ | ------------------------------------------------------------------------------------------------------------------------------------ | + | 400 | [`BadRequestException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt) | + | 401 | [`UnauthorizedException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt) | + | 403 | [`PermissionDeniedException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt) | + | 404 | [`NotFoundException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt) | + | 422 | [`UnprocessableEntityException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt) | + | 429 | [`RateLimitException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt) | + | 5xx | [`InternalServerException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt) | + | others | [`UnexpectedStatusCodeException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt) | -- [`BrowserbaseIoException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseIoException.kt): I/O networking errors. +- [`BrowserbaseIoException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseIoException.kt): I/O networking errors. -- [`BrowserbaseRetryableException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseRetryableException.kt): Generic error indicating a failure that could be retried by the client. +- [`BrowserbaseRetryableException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseRetryableException.kt): Generic error indicating a failure that could be retried by the client. -- [`BrowserbaseInvalidDataException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. +- [`BrowserbaseInvalidDataException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. -- [`BrowserbaseException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. +- [`BrowserbaseException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. ## Logging @@ -265,7 +265,7 @@ The SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON seri The SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config). -If the SDK threw an exception, but you're _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt). +If the SDK threw an exception, but you're _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt). > [!CAUTION] > We make no guarantee that the SDK works correctly when the Jackson version check is disabled. @@ -289,8 +289,8 @@ The API may also explicitly instruct the SDK to retry or not retry a request. To set a custom number of retries, configure the client using the `maxRetries` method: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() @@ -305,7 +305,7 @@ Requests time out after 1 minute by default. To set a custom timeout, configure the method call using the `timeout` method: ```java -import com.stagehand.api.models.sessions.SessionStartResponse; +import com.browserbase.api.models.sessions.SessionStartResponse; SessionStartResponse response = client.sessions().start( params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build() @@ -315,8 +315,8 @@ SessionStartResponse response = client.sessions().start( Or configure the default for all method calls at the client level: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; import java.time.Duration; BrowserbaseClient client = BrowserbaseOkHttpClient.builder() @@ -330,8 +330,8 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() To route requests through a proxy, configure the client using the `proxy` method: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; import java.net.InetSocketAddress; import java.net.Proxy; @@ -354,8 +354,8 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() To configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() @@ -371,8 +371,8 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() The SDK sends requests to the production by default. To send requests to a different environment, configure the client like so: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() @@ -388,10 +388,10 @@ The SDK consists of three artifacts: - `browserbase-java-core` - Contains core SDK logic - Does not depend on [OkHttp](https://square.github.io/okhttp) - - Exposes [`BrowserbaseClient`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClient.kt), [`BrowserbaseClientAsync`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsync.kt), [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt), and [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt), all of which can work with any HTTP client + - Exposes [`BrowserbaseClient`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClient.kt), [`BrowserbaseClientAsync`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsync.kt), [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt), and [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt), all of which can work with any HTTP client - `browserbase-java-client-okhttp` - Depends on [OkHttp](https://square.github.io/okhttp) - - Exposes [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt) and [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), which provide a way to construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt) and [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt), respectively, using OkHttp + - Exposes [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt) and [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), which provide a way to construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt) and [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt), respectively, using OkHttp - `browserbase-java` - Depends on and exposes the APIs of both `browserbase-java-core` and `browserbase-java-client-okhttp` - Does not have its own logic @@ -406,16 +406,16 @@ This structure allows replacing the SDK's default HTTP client without pulling in To use a customized `OkHttpClient`: 1. Replace your [`browserbase-java` dependency](#installation) with `browserbase-java-core` -2. Copy `browserbase-java-client-okhttp`'s [`OkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt) class into your code and customize it -3. Construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt) or [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt), similarly to [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), using your customized client +2. Copy `browserbase-java-client-okhttp`'s [`OkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt) class into your code and customize it +3. Construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt) or [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt), similarly to [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), using your customized client ### Completely custom HTTP client To use a completely custom HTTP client: 1. Replace your [`browserbase-java` dependency](#installation) with `browserbase-java-core` -2. Write a class that implements the [`HttpClient`](browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt) interface -3. Construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt) or [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt), similarly to [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), using your new client class +2. Write a class that implements the [`HttpClient`](browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt) interface +3. Construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt) or [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt), similarly to [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), using your new client class ## Undocumented API functionality @@ -426,8 +426,8 @@ The SDK is typed for convenient usage of the documented API. However, it also su To set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class: ```java -import com.stagehand.api.core.JsonValue; -import com.stagehand.api.models.sessions.SessionStartParams; +import com.browserbase.api.core.JsonValue; +import com.browserbase.api.models.sessions.SessionStartParams; SessionStartParams params = SessionStartParams.builder() .putAdditionalHeader("Secret-Header", "42") @@ -441,8 +441,8 @@ These can be accessed on the built object later using the `_additionalHeaders()` To set undocumented parameters on _nested_ headers, query params, or body classes, call the `putAdditionalProperty` method on the nested class: ```java -import com.stagehand.api.core.JsonValue; -import com.stagehand.api.models.sessions.SessionStartParams; +import com.browserbase.api.core.JsonValue; +import com.browserbase.api.models.sessions.SessionStartParams; SessionStartParams params = SessionStartParams.builder() .localBrowserLaunchOptions(SessionStartParams.LocalBrowserLaunchOptions.builder() @@ -453,21 +453,21 @@ SessionStartParams params = SessionStartParams.builder() These properties can be accessed on the nested built object later using the `_additionalProperties()` method. -To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt) object to its setter: +To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt) object to its setter: ```java -import com.stagehand.api.core.JsonValue; -import com.stagehand.api.models.sessions.SessionStartParams; +import com.browserbase.api.core.JsonValue; +import com.browserbase.api.models.sessions.SessionStartParams; SessionStartParams params = SessionStartParams.builder() .env(JsonValue.from(42)) .build(); ``` -The most straightforward way to create a [`JsonValue`](browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt) is using its `from(...)` method: +The most straightforward way to create a [`JsonValue`](browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt) is using its `from(...)` method: ```java -import com.stagehand.api.core.JsonValue; +import com.browserbase.api.core.JsonValue; import java.util.List; import java.util.Map; @@ -505,11 +505,11 @@ JsonValue complexValue = JsonValue.from(Map.of( Normally a `Builder` class's `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset. -To forcibly omit a required parameter or property, pass [`JsonMissing`](browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt): +To forcibly omit a required parameter or property, pass [`JsonMissing`](browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt): ```java -import com.stagehand.api.core.JsonMissing; -import com.stagehand.api.models.sessions.SessionStartParams; +import com.browserbase.api.core.JsonMissing; +import com.browserbase.api.models.sessions.SessionStartParams; SessionStartParams params = SessionStartParams.builder() .env(JsonMissing.of()) @@ -521,7 +521,7 @@ SessionStartParams params = SessionStartParams.builder() To access undocumented response properties, call the `_additionalProperties()` method: ```java -import com.stagehand.api.core.JsonValue; +import com.browserbase.api.core.JsonValue; import java.util.Map; Map additionalProperties = client.sessions().start(params)._additionalProperties(); @@ -551,8 +551,8 @@ String result = secretPropertyValue.accept(new JsonValue.Visitor<>() { To access a property's raw JSON value, which may be undocumented, call its `_` prefixed method: ```java -import com.stagehand.api.core.JsonField; -import com.stagehand.api.models.sessions.SessionStartParams; +import com.browserbase.api.core.JsonField; +import com.browserbase.api.models.sessions.SessionStartParams; import java.util.Optional; JsonField env = client.sessions().start(params)._env(); @@ -575,12 +575,12 @@ if (env.isMissing()) { In rare cases, the API may return a response that doesn't match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else. -By default, the SDK will not throw an exception in this case. It will throw [`BrowserbaseInvalidDataException`](browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt) only if you directly access the property. +By default, the SDK will not throw an exception in this case. It will throw [`BrowserbaseInvalidDataException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt) only if you directly access the property. If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`: ```java -import com.stagehand.api.models.sessions.SessionStartResponse; +import com.browserbase.api.models.sessions.SessionStartResponse; SessionStartResponse response = client.sessions().start(params).validate(); ``` @@ -588,7 +588,7 @@ SessionStartResponse response = client.sessions().start(params).validate(); Or configure the method call to validate the response using the `responseValidation` method: ```java -import com.stagehand.api.models.sessions.SessionStartResponse; +import com.browserbase.api.models.sessions.SessionStartResponse; SessionStartResponse response = client.sessions().start( params, RequestOptions.builder().responseValidation(true).build() @@ -598,8 +598,8 @@ SessionStartResponse response = client.sessions().start( Or configure the default for all method calls at the client level: ```java -import com.stagehand.api.client.BrowserbaseClient; -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; BrowserbaseClient client = BrowserbaseOkHttpClient.builder() .fromEnv() diff --git a/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt b/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt similarity index 95% rename from browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt rename to browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt index 5113c2c..dee001e 100644 --- a/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClient.kt +++ b/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.client.okhttp - +package com.browserbase.api.client.okhttp + +import com.browserbase.api.client.BrowserbaseClient +import com.browserbase.api.client.BrowserbaseClientImpl +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.core.Sleeper +import com.browserbase.api.core.Timeout +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.HttpClient +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.core.jsonMapper import com.fasterxml.jackson.databind.json.JsonMapper -import com.stagehand.api.client.BrowserbaseClient -import com.stagehand.api.client.BrowserbaseClientImpl -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.core.Sleeper -import com.stagehand.api.core.Timeout -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.HttpClient -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.core.jsonMapper import java.net.Proxy import java.time.Clock import java.time.Duration @@ -116,7 +116,7 @@ class BrowserbaseOkHttpClient private constructor() { /** * The Jackson JSON mapper to use for serializing and deserializing JSON. * - * Defaults to [com.stagehand.api.core.jsonMapper]. The default is usually sufficient and + * Defaults to [com.browserbase.api.core.jsonMapper]. The default is usually sufficient and * rarely needs to be overridden. */ fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) } diff --git a/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt b/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt similarity index 95% rename from browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt rename to browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt index bf6ef08..924eb97 100644 --- a/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt +++ b/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.client.okhttp - +package com.browserbase.api.client.okhttp + +import com.browserbase.api.client.BrowserbaseClientAsync +import com.browserbase.api.client.BrowserbaseClientAsyncImpl +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.core.Sleeper +import com.browserbase.api.core.Timeout +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.HttpClient +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.core.jsonMapper import com.fasterxml.jackson.databind.json.JsonMapper -import com.stagehand.api.client.BrowserbaseClientAsync -import com.stagehand.api.client.BrowserbaseClientAsyncImpl -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.core.Sleeper -import com.stagehand.api.core.Timeout -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.HttpClient -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.core.jsonMapper import java.net.Proxy import java.time.Clock import java.time.Duration @@ -116,7 +116,7 @@ class BrowserbaseOkHttpClientAsync private constructor() { /** * The Jackson JSON mapper to use for serializing and deserializing JSON. * - * Defaults to [com.stagehand.api.core.jsonMapper]. The default is usually sufficient and + * Defaults to [com.browserbase.api.core.jsonMapper]. The default is usually sufficient and * rarely needs to be overridden. */ fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) } diff --git a/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt b/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt similarity index 94% rename from browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt rename to browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt index 14cfe6c..433919c 100644 --- a/browserbase-java-client-okhttp/src/main/kotlin/com/stagehand/api/client/okhttp/OkHttpClient.kt +++ b/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt @@ -1,14 +1,14 @@ -package com.stagehand.api.client.okhttp - -import com.stagehand.api.core.RequestOptions -import com.stagehand.api.core.Timeout -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.HttpClient -import com.stagehand.api.core.http.HttpMethod -import com.stagehand.api.core.http.HttpRequest -import com.stagehand.api.core.http.HttpRequestBody -import com.stagehand.api.core.http.HttpResponse -import com.stagehand.api.errors.BrowserbaseIoException +package com.browserbase.api.client.okhttp + +import com.browserbase.api.core.RequestOptions +import com.browserbase.api.core.Timeout +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.HttpClient +import com.browserbase.api.core.http.HttpMethod +import com.browserbase.api.core.http.HttpRequest +import com.browserbase.api.core.http.HttpRequestBody +import com.browserbase.api.core.http.HttpResponse +import com.browserbase.api.errors.BrowserbaseIoException import java.io.IOException import java.io.InputStream import java.net.Proxy diff --git a/browserbase-java-client-okhttp/src/test/kotlin/com/stagehand/api/client/okhttp/OkHttpClientTest.kt b/browserbase-java-client-okhttp/src/test/kotlin/com/browserbase/api/client/okhttp/OkHttpClientTest.kt similarity index 90% rename from browserbase-java-client-okhttp/src/test/kotlin/com/stagehand/api/client/okhttp/OkHttpClientTest.kt rename to browserbase-java-client-okhttp/src/test/kotlin/com/browserbase/api/client/okhttp/OkHttpClientTest.kt index 950e323..3a39e9e 100644 --- a/browserbase-java-client-okhttp/src/test/kotlin/com/stagehand/api/client/okhttp/OkHttpClientTest.kt +++ b/browserbase-java-client-okhttp/src/test/kotlin/com/browserbase/api/client/okhttp/OkHttpClientTest.kt @@ -1,10 +1,10 @@ -package com.stagehand.api.client.okhttp +package com.browserbase.api.client.okhttp +import com.browserbase.api.core.http.HttpMethod +import com.browserbase.api.core.http.HttpRequest import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest -import com.stagehand.api.core.http.HttpMethod -import com.stagehand.api.core.http.HttpRequest import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClient.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClient.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClient.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClient.kt index 6e2b6a0..e77d3b1 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClient.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClient.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.client +package com.browserbase.api.client -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.services.blocking.SessionService +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.services.blocking.SessionService import java.util.function.Consumer /** diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsync.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsync.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsync.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsync.kt index aef1082..85a8cd5 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsync.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsync.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.client +package com.browserbase.api.client -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.services.async.SessionServiceAsync +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.services.async.SessionServiceAsync import java.util.function.Consumer /** diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt similarity index 88% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt index a7281d2..78e60db 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientAsyncImpl.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.client +package com.browserbase.api.client -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.core.getPackageVersion -import com.stagehand.api.services.async.SessionServiceAsync -import com.stagehand.api.services.async.SessionServiceAsyncImpl +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.core.getPackageVersion +import com.browserbase.api.services.async.SessionServiceAsync +import com.browserbase.api.services.async.SessionServiceAsyncImpl import java.util.function.Consumer class BrowserbaseClientAsyncImpl(private val clientOptions: ClientOptions) : diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt similarity index 88% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt index afe65db..3df8a4f 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/client/BrowserbaseClientImpl.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.client +package com.browserbase.api.client -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.core.getPackageVersion -import com.stagehand.api.services.blocking.SessionService -import com.stagehand.api.services.blocking.SessionServiceImpl +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.core.getPackageVersion +import com.browserbase.api.services.blocking.SessionService +import com.browserbase.api.services.blocking.SessionServiceImpl import java.util.function.Consumer class BrowserbaseClientImpl(private val clientOptions: ClientOptions) : BrowserbaseClient { diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseDeserializer.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseDeserializer.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseDeserializer.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseDeserializer.kt index 98c91bd..dc07be5 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseDeserializer.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseDeserializer.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.core.ObjectCodec diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseSerializer.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseSerializer.kt similarity index 84% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseSerializer.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseSerializer.kt index 929a990..9142bfe 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/BaseSerializer.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseSerializer.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import com.fasterxml.jackson.databind.ser.std.StdSerializer import kotlin.reflect.KClass diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Check.kt similarity index 99% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Check.kt index 21ef979..0eb0c57 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Check.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Check.kt @@ -1,6 +1,6 @@ @file:JvmName("Check") -package com.stagehand.api.core +package com.browserbase.api.core import com.fasterxml.jackson.core.Version import com.fasterxml.jackson.core.util.VersionUtil diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt index 3cbfa6e..0032ba1 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ClientOptions.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.core +package com.browserbase.api.core +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.HttpClient +import com.browserbase.api.core.http.PhantomReachableClosingHttpClient +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.core.http.RetryingHttpClient import com.fasterxml.jackson.databind.json.JsonMapper -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.HttpClient -import com.stagehand.api.core.http.PhantomReachableClosingHttpClient -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.core.http.RetryingHttpClient import java.time.Clock import java.time.Duration import java.util.Optional @@ -36,8 +36,8 @@ private constructor( /** * The Jackson JSON mapper to use for serializing and deserializing JSON. * - * Defaults to [com.stagehand.api.core.jsonMapper]. The default is usually sufficient and rarely - * needs to be overridden. + * Defaults to [com.browserbase.api.core.jsonMapper]. The default is usually sufficient and + * rarely needs to be overridden. */ @get:JvmName("jsonMapper") val jsonMapper: JsonMapper, /** @@ -199,7 +199,7 @@ private constructor( /** * The Jackson JSON mapper to use for serializing and deserializing JSON. * - * Defaults to [com.stagehand.api.core.jsonMapper]. The default is usually sufficient and + * Defaults to [com.browserbase.api.core.jsonMapper]. The default is usually sufficient and * rarely needs to be overridden. */ fun jsonMapper(jsonMapper: JsonMapper) = apply { this.jsonMapper = jsonMapper } diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/DefaultSleeper.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/DefaultSleeper.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/DefaultSleeper.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/DefaultSleeper.kt index 039a60c..7ea0449 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/DefaultSleeper.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/DefaultSleeper.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import java.time.Duration import java.util.Timer diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ObjectMappers.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ObjectMappers.kt similarity index 99% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ObjectMappers.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ObjectMappers.kt index 29d99af..9ed574e 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/ObjectMappers.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ObjectMappers.kt @@ -1,6 +1,6 @@ @file:JvmName("ObjectMappers") -package com.stagehand.api.core +package com.browserbase.api.core import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.core.JsonGenerator diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Params.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Params.kt similarity index 75% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Params.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Params.kt index 7f5a2f1..74e0357 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Params.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Params.kt @@ -1,7 +1,7 @@ -package com.stagehand.api.core +package com.browserbase.api.core -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.QueryParams +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.QueryParams /** An interface representing parameters passed to a service method. */ interface Params { diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt index 648e916..5c5bb35 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachable.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt @@ -1,8 +1,8 @@ @file:JvmName("PhantomReachable") -package com.stagehand.api.core +package com.browserbase.api.core -import com.stagehand.api.errors.BrowserbaseException +import com.browserbase.api.errors.BrowserbaseException import java.lang.reflect.InvocationTargetException /** diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableExecutorService.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableExecutorService.kt similarity index 98% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableExecutorService.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableExecutorService.kt index cc3cebb..7fb24a5 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableExecutorService.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableExecutorService.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import java.util.concurrent.Callable import java.util.concurrent.ExecutorService diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableSleeper.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableSleeper.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableSleeper.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableSleeper.kt index 8d82484..172760d 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PhantomReachableSleeper.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableSleeper.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import java.time.Duration import java.util.concurrent.CompletableFuture diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PrepareRequest.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PrepareRequest.kt similarity index 90% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PrepareRequest.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PrepareRequest.kt index 0da40de..89ffa2d 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/PrepareRequest.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PrepareRequest.kt @@ -1,8 +1,8 @@ @file:JvmName("PrepareRequest") -package com.stagehand.api.core +package com.browserbase.api.core -import com.stagehand.api.core.http.HttpRequest +import com.browserbase.api.core.http.HttpRequest import java.util.concurrent.CompletableFuture @JvmSynthetic diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Properties.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Properties.kt similarity index 92% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Properties.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Properties.kt index d24ffbe..bbd1121 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Properties.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Properties.kt @@ -1,8 +1,8 @@ @file:JvmName("Properties") -package com.stagehand.api.core +package com.browserbase.api.core -import com.stagehand.api.client.BrowserbaseClient +import com.browserbase.api.client.BrowserbaseClient fun getOsArch(): String { val osArch = System.getProperty("os.arch") diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/RequestOptions.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/RequestOptions.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/RequestOptions.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/RequestOptions.kt index 10fb92a..9674a09 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/RequestOptions.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/RequestOptions.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import java.time.Duration diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Sleeper.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Sleeper.kt similarity index 94% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Sleeper.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Sleeper.kt index bccd778..7c5e93a 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Sleeper.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Sleeper.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import java.time.Duration import java.util.concurrent.CompletableFuture diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Timeout.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Timeout.kt similarity index 99% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Timeout.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Timeout.kt index 23d9885..d5618ce 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Timeout.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Timeout.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.core +package com.browserbase.api.core import java.time.Duration import java.util.Objects diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Utils.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Utils.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Utils.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Utils.kt index 1e35e53..c772038 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Utils.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Utils.kt @@ -1,8 +1,8 @@ @file:JvmName("Utils") -package com.stagehand.api.core +package com.browserbase.api.core -import com.stagehand.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.SortedMap import java.util.concurrent.CompletableFuture diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt similarity index 99% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt index e772b85..3eb4836 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/Values.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt @@ -1,5 +1,6 @@ -package com.stagehand.api.core +package com.browserbase.api.core +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JacksonAnnotationsInside import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonInclude @@ -24,7 +25,6 @@ import com.fasterxml.jackson.databind.node.JsonNodeType.OBJECT import com.fasterxml.jackson.databind.node.JsonNodeType.POJO import com.fasterxml.jackson.databind.node.JsonNodeType.STRING import com.fasterxml.jackson.databind.ser.std.NullSerializer -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.io.InputStream import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/ErrorHandler.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/ErrorHandler.kt similarity index 80% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/ErrorHandler.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/ErrorHandler.kt index 08b3c7f..bd5fff6 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/ErrorHandler.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/ErrorHandler.kt @@ -2,21 +2,21 @@ @file:JvmName("ErrorHandler") -package com.stagehand.api.core.handlers +package com.browserbase.api.core.handlers +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.http.HttpResponse +import com.browserbase.api.core.http.HttpResponse.Handler +import com.browserbase.api.errors.BadRequestException +import com.browserbase.api.errors.InternalServerException +import com.browserbase.api.errors.NotFoundException +import com.browserbase.api.errors.PermissionDeniedException +import com.browserbase.api.errors.RateLimitException +import com.browserbase.api.errors.UnauthorizedException +import com.browserbase.api.errors.UnexpectedStatusCodeException +import com.browserbase.api.errors.UnprocessableEntityException import com.fasterxml.jackson.databind.json.JsonMapper -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.http.HttpResponse -import com.stagehand.api.core.http.HttpResponse.Handler -import com.stagehand.api.errors.BadRequestException -import com.stagehand.api.errors.InternalServerException -import com.stagehand.api.errors.NotFoundException -import com.stagehand.api.errors.PermissionDeniedException -import com.stagehand.api.errors.RateLimitException -import com.stagehand.api.errors.UnauthorizedException -import com.stagehand.api.errors.UnexpectedStatusCodeException -import com.stagehand.api.errors.UnprocessableEntityException @JvmSynthetic internal fun errorBodyHandler(jsonMapper: JsonMapper): Handler { diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt similarity index 71% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt index 5ab311e..994a55e 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/JsonHandler.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt @@ -1,12 +1,12 @@ @file:JvmName("JsonHandler") -package com.stagehand.api.core.handlers +package com.browserbase.api.core.handlers +import com.browserbase.api.core.http.HttpResponse +import com.browserbase.api.core.http.HttpResponse.Handler +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.http.HttpResponse -import com.stagehand.api.core.http.HttpResponse.Handler -import com.stagehand.api.errors.BrowserbaseInvalidDataException @JvmSynthetic internal inline fun jsonHandler(jsonMapper: JsonMapper): Handler = diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/StringHandler.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/StringHandler.kt similarity index 66% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/StringHandler.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/StringHandler.kt index 9f7fb80..044de72 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/handlers/StringHandler.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/StringHandler.kt @@ -1,9 +1,9 @@ @file:JvmName("StringHandler") -package com.stagehand.api.core.handlers +package com.browserbase.api.core.handlers -import com.stagehand.api.core.http.HttpResponse -import com.stagehand.api.core.http.HttpResponse.Handler +import com.browserbase.api.core.http.HttpResponse +import com.browserbase.api.core.http.HttpResponse.Handler @JvmSynthetic internal fun stringHandler(): Handler = StringHandlerInternal diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/AsyncStreamResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/AsyncStreamResponse.kt similarity index 98% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/AsyncStreamResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/AsyncStreamResponse.kt index 23948e6..ccc5d24 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/AsyncStreamResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/AsyncStreamResponse.kt @@ -1,6 +1,6 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http -import com.stagehand.api.core.http.AsyncStreamResponse.Handler +import com.browserbase.api.core.http.AsyncStreamResponse.Handler import java.util.Optional import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/Headers.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/Headers.kt similarity index 87% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/Headers.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/Headers.kt index a6bfeb9..edb40c4 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/Headers.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/Headers.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.core.http - -import com.stagehand.api.core.JsonArray -import com.stagehand.api.core.JsonBoolean -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonNull -import com.stagehand.api.core.JsonNumber -import com.stagehand.api.core.JsonObject -import com.stagehand.api.core.JsonString -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.toImmutable +package com.browserbase.api.core.http + +import com.browserbase.api.core.JsonArray +import com.browserbase.api.core.JsonBoolean +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonNull +import com.browserbase.api.core.JsonNumber +import com.browserbase.api.core.JsonObject +import com.browserbase.api.core.JsonString +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.toImmutable import java.util.TreeMap class Headers diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt similarity index 89% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt index 45d1240..d5a84ec 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpClient.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt @@ -1,6 +1,6 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http -import com.stagehand.api.core.RequestOptions +import com.browserbase.api.core.RequestOptions import java.lang.AutoCloseable import java.util.concurrent.CompletableFuture diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpMethod.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpMethod.kt similarity index 76% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpMethod.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpMethod.kt index 243d075..fa2868d 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpMethod.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpMethod.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http enum class HttpMethod { GET, diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequest.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequest.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequest.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequest.kt index e262cfa..f42f44a 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequest.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequest.kt @@ -1,7 +1,7 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.toImmutable +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.toImmutable class HttpRequest private constructor( diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt index 0066e15..05a1d50 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBodies.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt @@ -2,13 +2,13 @@ @file:JvmName("HttpRequestBodies") -package com.stagehand.api.core.http +package com.browserbase.api.core.http +import com.browserbase.api.core.MultipartField +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.databind.node.JsonNodeType -import com.stagehand.api.core.MultipartField -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.io.InputStream import java.io.OutputStream import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBody.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBody.kt similarity index 94% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBody.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBody.kt index 2b3f90a..57c20f4 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpRequestBody.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBody.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http import java.io.OutputStream import java.lang.AutoCloseable diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponse.kt similarity index 91% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponse.kt index 0fa2e44..045efac 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponse.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.core.http +package com.browserbase.api.core.http import java.io.InputStream diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponseFor.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponseFor.kt similarity index 93% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponseFor.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponseFor.kt index 82b8717..91ba762 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/HttpResponseFor.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponseFor.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http import java.io.InputStream diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt similarity index 91% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt index 11f2997..13f1198 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt @@ -1,7 +1,7 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http -import com.stagehand.api.core.closeWhenPhantomReachable -import com.stagehand.api.core.http.AsyncStreamResponse.Handler +import com.browserbase.api.core.closeWhenPhantomReachable +import com.browserbase.api.core.http.AsyncStreamResponse.Handler import java.util.Optional import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingHttpClient.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingHttpClient.kt similarity index 84% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingHttpClient.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingHttpClient.kt index 52da985..54e1c00 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingHttpClient.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingHttpClient.kt @@ -1,7 +1,7 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http -import com.stagehand.api.core.RequestOptions -import com.stagehand.api.core.closeWhenPhantomReachable +import com.browserbase.api.core.RequestOptions +import com.browserbase.api.core.closeWhenPhantomReachable import java.util.concurrent.CompletableFuture /** diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingStreamResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingStreamResponse.kt similarity index 85% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingStreamResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingStreamResponse.kt index b2f75a4..b977aab 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/PhantomReachableClosingStreamResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingStreamResponse.kt @@ -1,6 +1,6 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http -import com.stagehand.api.core.closeWhenPhantomReachable +import com.browserbase.api.core.closeWhenPhantomReachable import java.util.stream.Stream /** diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/QueryParams.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/QueryParams.kt similarity index 90% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/QueryParams.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/QueryParams.kt index 114b89b..e394ad0 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/QueryParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/QueryParams.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.core.http - -import com.stagehand.api.core.JsonArray -import com.stagehand.api.core.JsonBoolean -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonNull -import com.stagehand.api.core.JsonNumber -import com.stagehand.api.core.JsonObject -import com.stagehand.api.core.JsonString -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.toImmutable +package com.browserbase.api.core.http + +import com.browserbase.api.core.JsonArray +import com.browserbase.api.core.JsonBoolean +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonNull +import com.browserbase.api.core.JsonNumber +import com.browserbase.api.core.JsonObject +import com.browserbase.api.core.JsonString +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.toImmutable class QueryParams private constructor( diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt similarity index 96% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt index 688ae4f..358057c 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/RetryingHttpClient.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt @@ -1,11 +1,11 @@ -package com.stagehand.api.core.http - -import com.stagehand.api.core.DefaultSleeper -import com.stagehand.api.core.RequestOptions -import com.stagehand.api.core.Sleeper -import com.stagehand.api.core.checkRequired -import com.stagehand.api.errors.BrowserbaseIoException -import com.stagehand.api.errors.BrowserbaseRetryableException +package com.browserbase.api.core.http + +import com.browserbase.api.core.DefaultSleeper +import com.browserbase.api.core.RequestOptions +import com.browserbase.api.core.Sleeper +import com.browserbase.api.core.checkRequired +import com.browserbase.api.errors.BrowserbaseIoException +import com.browserbase.api.errors.BrowserbaseRetryableException import java.io.IOException import java.time.Clock import java.time.Duration diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/StreamResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/StreamResponse.kt similarity index 92% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/StreamResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/StreamResponse.kt index ace181d..603e8bb 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/core/http/StreamResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/StreamResponse.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http import java.util.stream.Stream diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt similarity index 93% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt index 0df8b4a..8281e6d 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BadRequestException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.errors +package com.browserbase.api.errors -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseException.kt similarity index 80% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseException.kt index eb7f6e5..2b49c25 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseException.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.errors +package com.browserbase.api.errors open class BrowserbaseException @JvmOverloads diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt similarity index 81% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt index 8e9730d..28a9644 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseInvalidDataException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.errors +package com.browserbase.api.errors class BrowserbaseInvalidDataException @JvmOverloads diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseIoException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseIoException.kt similarity index 81% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseIoException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseIoException.kt index aa9c0de..6d8a71c 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseIoException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseIoException.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.errors +package com.browserbase.api.errors class BrowserbaseIoException @JvmOverloads diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseRetryableException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseRetryableException.kt similarity index 93% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseRetryableException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseRetryableException.kt index 8984d2e..1754ee9 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseRetryableException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseRetryableException.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.errors +package com.browserbase.api.errors /** * Exception that indicates a transient error that can be retried. diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseServiceException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseServiceException.kt similarity index 72% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseServiceException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseServiceException.kt index d88ef6f..bb5c849 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/BrowserbaseServiceException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseServiceException.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.errors +package com.browserbase.api.errors -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.http.Headers abstract class BrowserbaseServiceException protected constructor(message: String, cause: Throwable? = null) : diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt similarity index 94% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt index 6682cbf..3728e7d 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/InternalServerException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.errors +package com.browserbase.api.errors -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt similarity index 92% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt index cf2a3dc..5fe3abd 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/NotFoundException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.errors +package com.browserbase.api.errors -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt similarity index 93% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt index 882f883..b161cb7 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/PermissionDeniedException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.errors +package com.browserbase.api.errors -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt similarity index 93% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt index aedc3cf..cc270eb 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/RateLimitException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.errors +package com.browserbase.api.errors -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt similarity index 93% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt index 5eff55d..bdbd3ef 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnauthorizedException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.errors +package com.browserbase.api.errors -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt similarity index 94% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt index fa6913f..8b1a465 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnexpectedStatusCodeException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.errors +package com.browserbase.api.errors -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt similarity index 93% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt index 1085120..6fc0a4c 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/errors/UnprocessableEntityException.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.errors +package com.browserbase.api.errors -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt similarity index 96% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt index f071b0a..fd113b6 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/Action.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkKnown +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.toImmutable +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkKnown -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt index 2d21ed5..51355b2 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/ModelConfig.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.Enum +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.Enum -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt similarity index 98% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt index eff4104..37b2123 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt @@ -1,7 +1,22 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.BaseDeserializer +import com.browserbase.api.core.BaseSerializer +import com.browserbase.api.core.Enum +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.Params +import com.browserbase.api.core.allMaxBy +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.getOrThrow +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.core.toImmutable +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -13,21 +28,6 @@ import com.fasterxml.jackson.databind.SerializerProvider import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.fasterxml.jackson.databind.annotation.JsonSerialize import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.BaseDeserializer -import com.stagehand.api.core.BaseSerializer -import com.stagehand.api.core.Enum -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.Params -import com.stagehand.api.core.allMaxBy -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.getOrThrow -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt index f0d6751..f07a16d 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionActResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt @@ -1,19 +1,19 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkKnown +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.toImmutable +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkKnown -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndParams.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndParams.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndParams.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndParams.kt index c559008..a3bb3fe 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndParams.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.Params -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.core.toImmutable +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.Params +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.core.toImmutable import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt similarity index 94% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt index 59b3dc9..dd40544 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionEndResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt similarity index 98% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt index de2624a..570576f 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt @@ -1,7 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.BaseDeserializer +import com.browserbase.api.core.BaseSerializer +import com.browserbase.api.core.Enum +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.Params +import com.browserbase.api.core.allMaxBy +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.getOrThrow +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -13,20 +27,6 @@ import com.fasterxml.jackson.databind.SerializerProvider import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.fasterxml.jackson.databind.annotation.JsonSerialize import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.BaseDeserializer -import com.stagehand.api.core.BaseSerializer -import com.stagehand.api.core.Enum -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.Params -import com.stagehand.api.core.allMaxBy -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.getOrThrow -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt index 861033b..e126222 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt @@ -1,18 +1,18 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkKnown +import com.browserbase.api.core.toImmutable +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkKnown -import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt similarity index 98% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt index c6cd822..652ea48 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt @@ -1,21 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.Enum +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.Params +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.core.toImmutable +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.Enum -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.Params -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt similarity index 96% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt index 912bbcb..2a8b52c 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionExtractResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt @@ -1,7 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.BaseDeserializer +import com.browserbase.api.core.BaseSerializer +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.allMaxBy +import com.browserbase.api.core.getOrThrow +import com.browserbase.api.core.toImmutable +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -13,16 +23,6 @@ import com.fasterxml.jackson.databind.SerializerProvider import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.fasterxml.jackson.databind.annotation.JsonSerialize import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.BaseDeserializer -import com.stagehand.api.core.BaseSerializer -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.allMaxBy -import com.stagehand.api.core.getOrThrow -import com.stagehand.api.core.toImmutable -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt similarity index 98% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt index bb111b3..f8dd95b 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt @@ -1,21 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.Enum +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.Params +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.Enum -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.Params -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt similarity index 96% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt index e570e58..28a15c2 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt @@ -1,16 +1,16 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt similarity index 98% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt index 84d197c..802e3ea 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionObserveParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt @@ -1,20 +1,20 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.Enum +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.Params +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.Enum -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.Params -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt similarity index 98% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt index 0a52ee0..22ad279 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartParams.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt @@ -1,21 +1,21 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.Enum +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.Params +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.http.QueryParams +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.Enum -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.Params -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.http.QueryParams -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects import java.util.Optional diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt index e78188e..152fc44 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/models/sessions/SessionStartResponse.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions - +package com.browserbase.api.models.sessions + +import com.browserbase.api.core.ExcludeMissing +import com.browserbase.api.core.JsonField +import com.browserbase.api.core.JsonMissing +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.checkRequired +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import com.stagehand.api.core.ExcludeMissing -import com.stagehand.api.core.JsonField -import com.stagehand.api.core.JsonMissing -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.checkRequired -import com.stagehand.api.errors.BrowserbaseInvalidDataException import java.util.Collections import java.util.Objects diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsync.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsync.kt similarity index 94% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsync.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsync.kt index 12589d9..5c78924 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsync.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsync.kt @@ -1,24 +1,24 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.services.async - -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.core.RequestOptions -import com.stagehand.api.core.http.HttpResponseFor -import com.stagehand.api.models.sessions.Action -import com.stagehand.api.models.sessions.SessionActParams -import com.stagehand.api.models.sessions.SessionActResponse -import com.stagehand.api.models.sessions.SessionEndParams -import com.stagehand.api.models.sessions.SessionEndResponse -import com.stagehand.api.models.sessions.SessionExecuteAgentParams -import com.stagehand.api.models.sessions.SessionExecuteAgentResponse -import com.stagehand.api.models.sessions.SessionExtractParams -import com.stagehand.api.models.sessions.SessionExtractResponse -import com.stagehand.api.models.sessions.SessionNavigateParams -import com.stagehand.api.models.sessions.SessionNavigateResponse -import com.stagehand.api.models.sessions.SessionObserveParams -import com.stagehand.api.models.sessions.SessionStartParams -import com.stagehand.api.models.sessions.SessionStartResponse +package com.browserbase.api.services.async + +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.core.RequestOptions +import com.browserbase.api.core.http.HttpResponseFor +import com.browserbase.api.models.sessions.Action +import com.browserbase.api.models.sessions.SessionActParams +import com.browserbase.api.models.sessions.SessionActResponse +import com.browserbase.api.models.sessions.SessionEndParams +import com.browserbase.api.models.sessions.SessionEndResponse +import com.browserbase.api.models.sessions.SessionExecuteAgentParams +import com.browserbase.api.models.sessions.SessionExecuteAgentResponse +import com.browserbase.api.models.sessions.SessionExtractParams +import com.browserbase.api.models.sessions.SessionExtractResponse +import com.browserbase.api.models.sessions.SessionNavigateParams +import com.browserbase.api.models.sessions.SessionNavigateResponse +import com.browserbase.api.models.sessions.SessionObserveParams +import com.browserbase.api.models.sessions.SessionStartParams +import com.browserbase.api.models.sessions.SessionStartResponse import java.util.Optional import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsyncImpl.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsyncImpl.kt similarity index 89% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsyncImpl.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsyncImpl.kt index a103a22..baa7114 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/async/SessionServiceAsyncImpl.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsyncImpl.kt @@ -1,35 +1,35 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.services.async +package com.browserbase.api.services.async -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.core.RequestOptions -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.handlers.errorBodyHandler -import com.stagehand.api.core.handlers.errorHandler -import com.stagehand.api.core.handlers.jsonHandler -import com.stagehand.api.core.http.HttpMethod -import com.stagehand.api.core.http.HttpRequest -import com.stagehand.api.core.http.HttpResponse -import com.stagehand.api.core.http.HttpResponse.Handler -import com.stagehand.api.core.http.HttpResponseFor -import com.stagehand.api.core.http.json -import com.stagehand.api.core.http.parseable -import com.stagehand.api.core.prepareAsync -import com.stagehand.api.models.sessions.Action -import com.stagehand.api.models.sessions.SessionActParams -import com.stagehand.api.models.sessions.SessionActResponse -import com.stagehand.api.models.sessions.SessionEndParams -import com.stagehand.api.models.sessions.SessionEndResponse -import com.stagehand.api.models.sessions.SessionExecuteAgentParams -import com.stagehand.api.models.sessions.SessionExecuteAgentResponse -import com.stagehand.api.models.sessions.SessionExtractParams -import com.stagehand.api.models.sessions.SessionExtractResponse -import com.stagehand.api.models.sessions.SessionNavigateParams -import com.stagehand.api.models.sessions.SessionNavigateResponse -import com.stagehand.api.models.sessions.SessionObserveParams -import com.stagehand.api.models.sessions.SessionStartParams -import com.stagehand.api.models.sessions.SessionStartResponse +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.core.RequestOptions +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.handlers.errorBodyHandler +import com.browserbase.api.core.handlers.errorHandler +import com.browserbase.api.core.handlers.jsonHandler +import com.browserbase.api.core.http.HttpMethod +import com.browserbase.api.core.http.HttpRequest +import com.browserbase.api.core.http.HttpResponse +import com.browserbase.api.core.http.HttpResponse.Handler +import com.browserbase.api.core.http.HttpResponseFor +import com.browserbase.api.core.http.json +import com.browserbase.api.core.http.parseable +import com.browserbase.api.core.prepareAsync +import com.browserbase.api.models.sessions.Action +import com.browserbase.api.models.sessions.SessionActParams +import com.browserbase.api.models.sessions.SessionActResponse +import com.browserbase.api.models.sessions.SessionEndParams +import com.browserbase.api.models.sessions.SessionEndResponse +import com.browserbase.api.models.sessions.SessionExecuteAgentParams +import com.browserbase.api.models.sessions.SessionExecuteAgentResponse +import com.browserbase.api.models.sessions.SessionExtractParams +import com.browserbase.api.models.sessions.SessionExtractResponse +import com.browserbase.api.models.sessions.SessionNavigateParams +import com.browserbase.api.models.sessions.SessionNavigateResponse +import com.browserbase.api.models.sessions.SessionObserveParams +import com.browserbase.api.models.sessions.SessionStartParams +import com.browserbase.api.models.sessions.SessionStartResponse import java.util.Optional import java.util.concurrent.CompletableFuture import java.util.function.Consumer diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionService.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionService.kt similarity index 93% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionService.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionService.kt index b605953..aac24dc 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionService.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionService.kt @@ -1,25 +1,25 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.services.blocking - +package com.browserbase.api.services.blocking + +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.core.RequestOptions +import com.browserbase.api.core.http.HttpResponseFor +import com.browserbase.api.models.sessions.Action +import com.browserbase.api.models.sessions.SessionActParams +import com.browserbase.api.models.sessions.SessionActResponse +import com.browserbase.api.models.sessions.SessionEndParams +import com.browserbase.api.models.sessions.SessionEndResponse +import com.browserbase.api.models.sessions.SessionExecuteAgentParams +import com.browserbase.api.models.sessions.SessionExecuteAgentResponse +import com.browserbase.api.models.sessions.SessionExtractParams +import com.browserbase.api.models.sessions.SessionExtractResponse +import com.browserbase.api.models.sessions.SessionNavigateParams +import com.browserbase.api.models.sessions.SessionNavigateResponse +import com.browserbase.api.models.sessions.SessionObserveParams +import com.browserbase.api.models.sessions.SessionStartParams +import com.browserbase.api.models.sessions.SessionStartResponse import com.google.errorprone.annotations.MustBeClosed -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.core.RequestOptions -import com.stagehand.api.core.http.HttpResponseFor -import com.stagehand.api.models.sessions.Action -import com.stagehand.api.models.sessions.SessionActParams -import com.stagehand.api.models.sessions.SessionActResponse -import com.stagehand.api.models.sessions.SessionEndParams -import com.stagehand.api.models.sessions.SessionEndResponse -import com.stagehand.api.models.sessions.SessionExecuteAgentParams -import com.stagehand.api.models.sessions.SessionExecuteAgentResponse -import com.stagehand.api.models.sessions.SessionExtractParams -import com.stagehand.api.models.sessions.SessionExtractResponse -import com.stagehand.api.models.sessions.SessionNavigateParams -import com.stagehand.api.models.sessions.SessionNavigateResponse -import com.stagehand.api.models.sessions.SessionObserveParams -import com.stagehand.api.models.sessions.SessionStartParams -import com.stagehand.api.models.sessions.SessionStartResponse import java.util.Optional import java.util.function.Consumer diff --git a/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionServiceImpl.kt b/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionServiceImpl.kt similarity index 88% rename from browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionServiceImpl.kt rename to browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionServiceImpl.kt index f154a4a..6c09595 100644 --- a/browserbase-java-core/src/main/kotlin/com/stagehand/api/services/blocking/SessionServiceImpl.kt +++ b/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionServiceImpl.kt @@ -1,35 +1,35 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.services.blocking +package com.browserbase.api.services.blocking -import com.stagehand.api.core.ClientOptions -import com.stagehand.api.core.RequestOptions -import com.stagehand.api.core.checkRequired -import com.stagehand.api.core.handlers.errorBodyHandler -import com.stagehand.api.core.handlers.errorHandler -import com.stagehand.api.core.handlers.jsonHandler -import com.stagehand.api.core.http.HttpMethod -import com.stagehand.api.core.http.HttpRequest -import com.stagehand.api.core.http.HttpResponse -import com.stagehand.api.core.http.HttpResponse.Handler -import com.stagehand.api.core.http.HttpResponseFor -import com.stagehand.api.core.http.json -import com.stagehand.api.core.http.parseable -import com.stagehand.api.core.prepare -import com.stagehand.api.models.sessions.Action -import com.stagehand.api.models.sessions.SessionActParams -import com.stagehand.api.models.sessions.SessionActResponse -import com.stagehand.api.models.sessions.SessionEndParams -import com.stagehand.api.models.sessions.SessionEndResponse -import com.stagehand.api.models.sessions.SessionExecuteAgentParams -import com.stagehand.api.models.sessions.SessionExecuteAgentResponse -import com.stagehand.api.models.sessions.SessionExtractParams -import com.stagehand.api.models.sessions.SessionExtractResponse -import com.stagehand.api.models.sessions.SessionNavigateParams -import com.stagehand.api.models.sessions.SessionNavigateResponse -import com.stagehand.api.models.sessions.SessionObserveParams -import com.stagehand.api.models.sessions.SessionStartParams -import com.stagehand.api.models.sessions.SessionStartResponse +import com.browserbase.api.core.ClientOptions +import com.browserbase.api.core.RequestOptions +import com.browserbase.api.core.checkRequired +import com.browserbase.api.core.handlers.errorBodyHandler +import com.browserbase.api.core.handlers.errorHandler +import com.browserbase.api.core.handlers.jsonHandler +import com.browserbase.api.core.http.HttpMethod +import com.browserbase.api.core.http.HttpRequest +import com.browserbase.api.core.http.HttpResponse +import com.browserbase.api.core.http.HttpResponse.Handler +import com.browserbase.api.core.http.HttpResponseFor +import com.browserbase.api.core.http.json +import com.browserbase.api.core.http.parseable +import com.browserbase.api.core.prepare +import com.browserbase.api.models.sessions.Action +import com.browserbase.api.models.sessions.SessionActParams +import com.browserbase.api.models.sessions.SessionActResponse +import com.browserbase.api.models.sessions.SessionEndParams +import com.browserbase.api.models.sessions.SessionEndResponse +import com.browserbase.api.models.sessions.SessionExecuteAgentParams +import com.browserbase.api.models.sessions.SessionExecuteAgentResponse +import com.browserbase.api.models.sessions.SessionExtractParams +import com.browserbase.api.models.sessions.SessionExtractResponse +import com.browserbase.api.models.sessions.SessionNavigateParams +import com.browserbase.api.models.sessions.SessionNavigateResponse +import com.browserbase.api.models.sessions.SessionObserveParams +import com.browserbase.api.models.sessions.SessionStartParams +import com.browserbase.api.models.sessions.SessionStartResponse import java.util.Optional import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull diff --git a/browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro b/browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro index 246b6fe..474257e 100644 --- a/browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro +++ b/browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro @@ -22,11 +22,11 @@ -keep class * extends com.fasterxml.jackson.core.type.TypeReference { *; } # Jackson uses reflection to access our class serializers and deserializers. --keep @com.fasterxml.jackson.databind.annotation.JsonSerialize class com.stagehand.api.** { *; } --keep @com.fasterxml.jackson.databind.annotation.JsonDeserialize class com.stagehand.api.** { *; } +-keep @com.fasterxml.jackson.databind.annotation.JsonSerialize class com.browserbase.api.** { *; } +-keep @com.fasterxml.jackson.databind.annotation.JsonDeserialize class com.browserbase.api.** { *; } # Jackson uses reflection to serialize and deserialize our classes based on their constructors and annotated members. --keepclassmembers class com.stagehand.api.** { +-keepclassmembers class com.browserbase.api.** { (...); @com.fasterxml.jackson.annotation.* *; } \ No newline at end of file diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/TestServerExtension.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/TestServerExtension.kt similarity index 98% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/TestServerExtension.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/TestServerExtension.kt index 47f81ce..d83abd1 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/TestServerExtension.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/TestServerExtension.kt @@ -1,4 +1,4 @@ -package com.stagehand.api +package com.browserbase.api import java.lang.RuntimeException import java.net.URL diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ClientOptionsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt similarity index 93% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ClientOptionsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt index 153fd8f..e73f724 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ClientOptionsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.core +package com.browserbase.api.core -import com.stagehand.api.core.http.HttpClient +import com.browserbase.api.core.http.HttpClient import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ObjectMappersTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ObjectMappersTest.kt similarity index 99% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ObjectMappersTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ObjectMappersTest.kt index d4a23d2..d405053 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ObjectMappersTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ObjectMappersTest.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.databind.exc.MismatchedInputException diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/PhantomReachableTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/PhantomReachableTest.kt similarity index 95% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/core/PhantomReachableTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/core/PhantomReachableTest.kt index f5cf23d..b1d98ae 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/PhantomReachableTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/PhantomReachableTest.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/UtilsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/UtilsTest.kt similarity index 97% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/core/UtilsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/core/UtilsTest.kt index b452f98..163e1a2 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/UtilsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/UtilsTest.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ValuesTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ValuesTest.kt similarity index 99% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ValuesTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ValuesTest.kt index 4d5b67c..d098377 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/ValuesTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ValuesTest.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core +package com.browserbase.api.core import java.util.Optional import org.assertj.core.api.Assertions.assertThat diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/AsyncStreamResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/AsyncStreamResponseTest.kt similarity index 99% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/AsyncStreamResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/AsyncStreamResponseTest.kt index f30d55c..c5d8e71 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/AsyncStreamResponseTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/AsyncStreamResponseTest.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http import java.util.* import java.util.concurrent.CompletableFuture diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/HeadersTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/HeadersTest.kt similarity index 99% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/HeadersTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/HeadersTest.kt index dae2b71..81b7261 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/HeadersTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/HeadersTest.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.params.ParameterizedTest diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/QueryParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/QueryParamsTest.kt similarity index 99% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/QueryParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/QueryParamsTest.kt index 1210beb..8d98e38 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/QueryParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/QueryParamsTest.kt @@ -1,4 +1,4 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.params.ParameterizedTest diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt similarity index 98% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt index 46bbd9f..3275b09 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/core/http/RetryingHttpClientTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt @@ -1,13 +1,13 @@ -package com.stagehand.api.core.http +package com.browserbase.api.core.http +import com.browserbase.api.client.okhttp.OkHttpClient +import com.browserbase.api.core.RequestOptions +import com.browserbase.api.core.Sleeper +import com.browserbase.api.errors.BrowserbaseRetryableException import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest import com.github.tomakehurst.wiremock.stubbing.Scenario -import com.stagehand.api.client.okhttp.OkHttpClient -import com.stagehand.api.core.RequestOptions -import com.stagehand.api.core.Sleeper -import com.stagehand.api.errors.BrowserbaseRetryableException import java.io.InputStream import java.time.Duration import java.util.concurrent.CompletableFuture diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ActionTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ActionTest.kt similarity index 94% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ActionTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ActionTest.kt index 6928e9f..fcd120c 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ActionTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ActionTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ModelConfigTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ModelConfigTest.kt similarity index 94% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ModelConfigTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ModelConfigTest.kt index a1f75ab..0430aec 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/ModelConfigTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ModelConfigTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActParamsTest.kt similarity index 97% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActParamsTest.kt index 921e718..fbcca00 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActParamsTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.http.Headers import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActResponseTest.kt similarity index 96% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActResponseTest.kt index 7723433..7f4d8c8 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionActResponseTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActResponseTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndParamsTest.kt similarity index 93% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndParamsTest.kt index 914b7d4..ab839e5 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndResponseTest.kt similarity index 91% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndResponseTest.kt index a5119d5..b52414c 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionEndResponseTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndResponseTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParamsTest.kt similarity index 98% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParamsTest.kt index 532b194..6d0d59b 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.http.Headers import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponseTest.kt similarity index 91% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponseTest.kt index 9da3901..3fb7223 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExecuteAgentResponseTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponseTest.kt @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.jsonMapper import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractParamsTest.kt similarity index 97% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractParamsTest.kt index 67cdf9e..7df72a7 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractParamsTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.http.Headers import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt similarity index 94% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt index 9615580..c11f3f5 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionExtractResponseTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt @@ -1,11 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.jsonMapper +import com.browserbase.api.errors.BrowserbaseInvalidDataException import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.jsonMapper -import com.stagehand.api.errors.BrowserbaseInvalidDataException import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateParamsTest.kt similarity index 97% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateParamsTest.kt index 6550c8e..fe762db 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.http.Headers import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponseTest.kt similarity index 92% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponseTest.kt index 2ba7257..1385964 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionNavigateResponseTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponseTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionObserveParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionObserveParamsTest.kt similarity index 98% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionObserveParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionObserveParamsTest.kt index 6a3347f..a8ab677 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionObserveParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionObserveParamsTest.kt @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions -import com.stagehand.api.core.http.Headers +import com.browserbase.api.core.http.Headers import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt similarity index 98% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt index 9c70b5b..1c7e4d8 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartResponseTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartResponseTest.kt similarity index 93% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartResponseTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartResponseTest.kt index 0ddd138..714c73d 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/models/sessions/SessionStartResponseTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartResponseTest.kt @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.models.sessions +package com.browserbase.api.models.sessions +import com.browserbase.api.core.jsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt similarity index 96% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt index 8fc0701..d9c176d 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ErrorHandlingTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt @@ -1,28 +1,28 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.services - +package com.browserbase.api.services + +import com.browserbase.api.client.BrowserbaseClient +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient +import com.browserbase.api.core.JsonValue +import com.browserbase.api.core.http.Headers +import com.browserbase.api.core.jsonMapper +import com.browserbase.api.errors.BadRequestException +import com.browserbase.api.errors.BrowserbaseException +import com.browserbase.api.errors.InternalServerException +import com.browserbase.api.errors.NotFoundException +import com.browserbase.api.errors.PermissionDeniedException +import com.browserbase.api.errors.RateLimitException +import com.browserbase.api.errors.UnauthorizedException +import com.browserbase.api.errors.UnexpectedStatusCodeException +import com.browserbase.api.errors.UnprocessableEntityException +import com.browserbase.api.models.sessions.SessionStartParams import com.github.tomakehurst.wiremock.client.WireMock.anyUrl import com.github.tomakehurst.wiremock.client.WireMock.post import com.github.tomakehurst.wiremock.client.WireMock.status import com.github.tomakehurst.wiremock.client.WireMock.stubFor import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest -import com.stagehand.api.client.BrowserbaseClient -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient -import com.stagehand.api.core.JsonValue -import com.stagehand.api.core.http.Headers -import com.stagehand.api.core.jsonMapper -import com.stagehand.api.errors.BadRequestException -import com.stagehand.api.errors.BrowserbaseException -import com.stagehand.api.errors.InternalServerException -import com.stagehand.api.errors.NotFoundException -import com.stagehand.api.errors.PermissionDeniedException -import com.stagehand.api.errors.RateLimitException -import com.stagehand.api.errors.UnauthorizedException -import com.stagehand.api.errors.UnexpectedStatusCodeException -import com.stagehand.api.errors.UnprocessableEntityException -import com.stagehand.api.models.sessions.SessionStartParams import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.entry import org.junit.jupiter.api.BeforeEach diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt similarity index 90% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt index 76f9dd5..1fdec72 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/ServiceParamsTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt @@ -1,7 +1,11 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.services +package com.browserbase.api.services +import com.browserbase.api.client.BrowserbaseClient +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient +import com.browserbase.api.core.JsonValue +import com.browserbase.api.models.sessions.SessionStartParams import com.github.tomakehurst.wiremock.client.WireMock.anyUrl import com.github.tomakehurst.wiremock.client.WireMock.equalTo import com.github.tomakehurst.wiremock.client.WireMock.matchingJsonPath @@ -12,10 +16,6 @@ import com.github.tomakehurst.wiremock.client.WireMock.stubFor import com.github.tomakehurst.wiremock.client.WireMock.verify import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest -import com.stagehand.api.client.BrowserbaseClient -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient -import com.stagehand.api.core.JsonValue -import com.stagehand.api.models.sessions.SessionStartParams import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt similarity index 93% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt index e01497b..64260cb 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/async/SessionServiceAsyncTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.services.async +package com.browserbase.api.services.async -import com.stagehand.api.TestServerExtension -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClientAsync -import com.stagehand.api.core.JsonValue -import com.stagehand.api.models.sessions.ModelConfig -import com.stagehand.api.models.sessions.SessionActParams -import com.stagehand.api.models.sessions.SessionExecuteAgentParams -import com.stagehand.api.models.sessions.SessionExtractParams -import com.stagehand.api.models.sessions.SessionNavigateParams -import com.stagehand.api.models.sessions.SessionObserveParams -import com.stagehand.api.models.sessions.SessionStartParams +import com.browserbase.api.TestServerExtension +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClientAsync +import com.browserbase.api.core.JsonValue +import com.browserbase.api.models.sessions.ModelConfig +import com.browserbase.api.models.sessions.SessionActParams +import com.browserbase.api.models.sessions.SessionExecuteAgentParams +import com.browserbase.api.models.sessions.SessionExtractParams +import com.browserbase.api.models.sessions.SessionNavigateParams +import com.browserbase.api.models.sessions.SessionObserveParams +import com.browserbase.api.models.sessions.SessionStartParams import kotlin.jvm.optionals.getOrNull import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt b/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt similarity index 93% rename from browserbase-java-core/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt rename to browserbase-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt index e0d7f43..cbd77b3 100644 --- a/browserbase-java-core/src/test/kotlin/com/stagehand/api/services/blocking/SessionServiceTest.kt +++ b/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt @@ -1,17 +1,17 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.services.blocking - -import com.stagehand.api.TestServerExtension -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient -import com.stagehand.api.core.JsonValue -import com.stagehand.api.models.sessions.ModelConfig -import com.stagehand.api.models.sessions.SessionActParams -import com.stagehand.api.models.sessions.SessionExecuteAgentParams -import com.stagehand.api.models.sessions.SessionExtractParams -import com.stagehand.api.models.sessions.SessionNavigateParams -import com.stagehand.api.models.sessions.SessionObserveParams -import com.stagehand.api.models.sessions.SessionStartParams +package com.browserbase.api.services.blocking + +import com.browserbase.api.TestServerExtension +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient +import com.browserbase.api.core.JsonValue +import com.browserbase.api.models.sessions.ModelConfig +import com.browserbase.api.models.sessions.SessionActParams +import com.browserbase.api.models.sessions.SessionExecuteAgentParams +import com.browserbase.api.models.sessions.SessionExtractParams +import com.browserbase.api.models.sessions.SessionNavigateParams +import com.browserbase.api.models.sessions.SessionObserveParams +import com.browserbase.api.models.sessions.SessionStartParams import kotlin.jvm.optionals.getOrNull import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test diff --git a/browserbase-java-proguard-test/build.gradle.kts b/browserbase-java-proguard-test/build.gradle.kts index 4d0189d..4226829 100644 --- a/browserbase-java-proguard-test/build.gradle.kts +++ b/browserbase-java-proguard-test/build.gradle.kts @@ -59,7 +59,7 @@ val testProGuard by tasks.registering(JavaExec::class) { dependsOn(proguardJar) notCompatibleWithConfigurationCache("ProGuard") - mainClass.set("com.stagehand.api.proguard.ProGuardCompatibilityTest") + mainClass.set("com.browserbase.api.proguard.ProGuardCompatibilityTest") classpath = files(proguardJarPath) } @@ -89,7 +89,7 @@ val testR8 by tasks.registering(JavaExec::class) { dependsOn(r8Jar) notCompatibleWithConfigurationCache("R8") - mainClass.set("com.stagehand.api.proguard.ProGuardCompatibilityTest") + mainClass.set("com.browserbase.api.proguard.ProGuardCompatibilityTest") classpath = files(r8JarPath) } diff --git a/browserbase-java-proguard-test/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt b/browserbase-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt similarity index 91% rename from browserbase-java-proguard-test/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt rename to browserbase-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt index 82fd595..73126fc 100644 --- a/browserbase-java-proguard-test/src/test/kotlin/com/stagehand/api/proguard/ProGuardCompatibilityTest.kt +++ b/browserbase-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt @@ -1,12 +1,12 @@ // File generated from our OpenAPI spec by Stainless. -package com.stagehand.api.proguard +package com.browserbase.api.proguard +import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient +import com.browserbase.api.core.jsonMapper +import com.browserbase.api.models.sessions.Action +import com.browserbase.api.models.sessions.SessionExtractResponse import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.stagehand.api.client.okhttp.BrowserbaseOkHttpClient -import com.stagehand.api.core.jsonMapper -import com.stagehand.api.models.sessions.Action -import com.stagehand.api.models.sessions.SessionExtractResponse import kotlin.reflect.full.memberFunctions import kotlin.reflect.jvm.javaMethod import org.assertj.core.api.Assertions.assertThat diff --git a/browserbase-java-proguard-test/test.pro b/browserbase-java-proguard-test/test.pro index 3db213a..47be604 100644 --- a/browserbase-java-proguard-test/test.pro +++ b/browserbase-java-proguard-test/test.pro @@ -1,5 +1,5 @@ # Specify the entrypoint where ProGuard starts to determine what's reachable. --keep class com.stagehand.api.proguard.** { *; } +-keep class com.browserbase.api.proguard.** { *; } # For the testing framework. -keep class org.junit.** { *; } diff --git a/build.gradle.kts b/build.gradle.kts index 2fffcae..471d362 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { } allprojects { - group = "com.stagehand.api" + group = "com.browserbase.api" version = "0.0.1" // x-release-please-version } From 40e95ede73876583760706e7315f3621af2f8433 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:18:22 +0000 Subject: [PATCH 04/14] feat(api): manual updates --- .github/workflows/publish-sonatype.yml | 8 +- .github/workflows/release-doctor.yml | 8 +- .stats.yml | 2 +- LICENSE | 2 +- README.md | 192 +++++++++--------- SECURITY.md | 2 +- build.gradle.kts | 2 +- ...a.gradle.kts => stagehand.java.gradle.kts} | 0 ...gradle.kts => stagehand.kotlin.gradle.kts} | 2 +- ...radle.kts => stagehand.publish.gradle.kts} | 4 +- settings.gradle.kts | 4 +- .../build.gradle.kts | 6 +- .../api/client/okhttp/OkHttpClient.kt | 8 +- .../client/okhttp/StagehandOkHttpClient.kt | 20 +- .../okhttp/StagehandOkHttpClientAsync.kt | 20 +- .../api/client/okhttp/OkHttpClientTest.kt | 0 .../build.gradle.kts | 6 +- .../browserbase/api/client/StagehandClient.kt | 14 +- .../api/client/StagehandClientAsync.kt | 13 +- .../api/client/StagehandClientAsyncImpl.kt | 21 +- .../api/client/StagehandClientImpl.kt | 20 +- .../browserbase/api/core/BaseDeserializer.kt | 0 .../browserbase/api/core/BaseSerializer.kt | 0 .../kotlin/com/browserbase/api/core/Check.kt | 0 .../com/browserbase/api/core/ClientOptions.kt | 23 ++- .../browserbase/api/core/DefaultSleeper.kt | 0 .../com/browserbase/api/core/ObjectMappers.kt | 0 .../kotlin/com/browserbase/api/core/Params.kt | 0 .../browserbase/api/core/PhantomReachable.kt | 4 +- .../core/PhantomReachableExecutorService.kt | 0 .../api/core/PhantomReachableSleeper.kt | 0 .../browserbase/api/core/PrepareRequest.kt | 0 .../com/browserbase/api/core/Properties.kt | 4 +- .../browserbase/api/core/RequestOptions.kt | 0 .../com/browserbase/api/core/Sleeper.kt | 0 .../com/browserbase/api/core/Timeout.kt | 0 .../kotlin/com/browserbase/api/core/Utils.kt | 4 +- .../kotlin/com/browserbase/api/core/Values.kt | 12 +- .../api/core/handlers/ErrorHandler.kt | 0 .../api/core/handlers/JsonHandler.kt | 4 +- .../api/core/handlers/StringHandler.kt | 0 .../api/core/http/AsyncStreamResponse.kt | 0 .../com/browserbase/api/core/http/Headers.kt | 0 .../browserbase/api/core/http/HttpClient.kt | 0 .../browserbase/api/core/http/HttpMethod.kt | 0 .../browserbase/api/core/http/HttpRequest.kt | 0 .../api/core/http/HttpRequestBodies.kt | 6 +- .../api/core/http/HttpRequestBody.kt | 0 .../browserbase/api/core/http/HttpResponse.kt | 0 .../api/core/http/HttpResponseFor.kt | 0 ...ntomReachableClosingAsyncStreamResponse.kt | 0 .../http/PhantomReachableClosingHttpClient.kt | 0 .../PhantomReachableClosingStreamResponse.kt | 0 .../browserbase/api/core/http/QueryParams.kt | 0 .../api/core/http/RetryingHttpClient.kt | 8 +- .../api/core/http/StreamResponse.kt | 0 .../api/errors/BadRequestException.kt | 2 +- .../api/errors/InternalServerException.kt | 2 +- .../api/errors/NotFoundException.kt | 2 +- .../api/errors/PermissionDeniedException.kt | 2 +- .../api/errors/RateLimitException.kt | 2 +- .../api/errors/StagehandException.kt | 2 +- .../errors/StagehandInvalidDataException.kt | 5 +- .../api/errors/StagehandIoException.kt | 5 +- .../api/errors/StagehandRetryableException.kt | 5 +- .../api/errors/StagehandServiceException.kt | 4 +- .../api/errors/UnauthorizedException.kt | 2 +- .../errors/UnexpectedStatusCodeException.kt | 2 +- .../errors/UnprocessableEntityException.kt | 2 +- .../browserbase/api/models/sessions/Action.kt | 14 +- .../api/models/sessions/ModelConfig.kt | 22 +- .../api/models/sessions/SessionActParams.kt | 42 ++-- .../api/models/sessions/SessionActResponse.kt | 10 +- .../api/models/sessions/SessionEndParams.kt | 0 .../api/models/sessions/SessionEndResponse.kt | 6 +- .../sessions/SessionExecuteAgentParams.kt | 62 +++--- .../sessions/SessionExecuteAgentResponse.kt | 8 +- .../models/sessions/SessionExtractParams.kt | 40 ++-- .../models/sessions/SessionExtractResponse.kt | 14 +- .../models/sessions/SessionNavigateParams.kt | 42 ++-- .../sessions/SessionNavigateResponse.kt | 10 +- .../models/sessions/SessionObserveParams.kt | 34 ++-- .../api/models/sessions/SessionStartParams.kt | 54 ++--- .../models/sessions/SessionStartResponse.kt | 8 +- .../api/services/async/SessionServiceAsync.kt | 0 .../services/async/SessionServiceAsyncImpl.kt | 0 .../api/services/blocking/SessionService.kt | 0 .../services/blocking/SessionServiceImpl.kt | 0 .../META-INF/proguard/stagehand-java-core.pro | 0 .../browserbase/api/TestServerExtension.kt | 0 .../browserbase/api/core/ClientOptionsTest.kt | 0 .../browserbase/api/core/ObjectMappersTest.kt | 0 .../api/core/PhantomReachableTest.kt | 0 .../com/browserbase/api/core/UtilsTest.kt | 0 .../com/browserbase/api/core/ValuesTest.kt | 0 .../api/core/http/AsyncStreamResponseTest.kt | 0 .../browserbase/api/core/http/HeadersTest.kt | 0 .../api/core/http/QueryParamsTest.kt | 0 .../api/core/http/RetryingHttpClientTest.kt | 6 +- .../api/models/sessions/ActionTest.kt | 0 .../api/models/sessions/ModelConfigTest.kt | 0 .../models/sessions/SessionActParamsTest.kt | 0 .../models/sessions/SessionActResponseTest.kt | 0 .../models/sessions/SessionEndParamsTest.kt | 0 .../models/sessions/SessionEndResponseTest.kt | 0 .../sessions/SessionExecuteAgentParamsTest.kt | 0 .../SessionExecuteAgentResponseTest.kt | 0 .../sessions/SessionExtractParamsTest.kt | 0 .../sessions/SessionExtractResponseTest.kt | 4 +- .../sessions/SessionNavigateParamsTest.kt | 0 .../sessions/SessionNavigateResponseTest.kt | 0 .../sessions/SessionObserveParamsTest.kt | 0 .../models/sessions/SessionStartParamsTest.kt | 0 .../sessions/SessionStartResponseTest.kt | 0 .../api/services/ErrorHandlingTest.kt | 12 +- .../api/services/ServiceParamsTest.kt | 8 +- .../services/async/SessionServiceAsyncTest.kt | 16 +- .../services/blocking/SessionServiceTest.kt | 16 +- .../build.gradle.kts | 8 +- .../api/proguard/ProGuardCompatibilityTest.kt | 6 +- .../test.pro | 0 .../build.gradle.kts | 6 +- 122 files changed, 449 insertions(+), 455 deletions(-) rename buildSrc/src/main/kotlin/{browserbase.java.gradle.kts => stagehand.java.gradle.kts} (100%) rename buildSrc/src/main/kotlin/{browserbase.kotlin.gradle.kts => stagehand.kotlin.gradle.kts} (99%) rename buildSrc/src/main/kotlin/{browserbase.publish.gradle.kts => stagehand.publish.gradle.kts} (95%) rename {browserbase-java-client-okhttp => stagehand-java-client-okhttp}/build.gradle.kts (76%) rename {browserbase-java-client-okhttp => stagehand-java-client-okhttp}/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt (96%) rename browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt => stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt (95%) rename browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt => stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt (95%) rename {browserbase-java-client-okhttp => stagehand-java-client-okhttp}/src/test/kotlin/com/browserbase/api/client/okhttp/OkHttpClientTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/build.gradle.kts (93%) rename browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClient.kt => stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClient.kt (85%) rename browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsync.kt => stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsync.kt (87%) rename browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt => stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsyncImpl.kt (69%) rename browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt => stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientImpl.kt (69%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/BaseDeserializer.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/BaseSerializer.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/Check.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt (94%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/DefaultSleeper.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/ObjectMappers.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/Params.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt (92%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/PhantomReachableExecutorService.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/PhantomReachableSleeper.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/PrepareRequest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/Properties.kt (88%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/RequestOptions.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/Sleeper.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/Timeout.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/Utils.kt (96%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/Values.kt (97%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/handlers/ErrorHandler.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt (80%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/handlers/StringHandler.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/AsyncStreamResponse.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/Headers.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/HttpMethod.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/HttpRequest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt (96%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBody.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/HttpResponse.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/HttpResponseFor.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingHttpClient.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingStreamResponse.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/QueryParams.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt (97%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/core/http/StreamResponse.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt (97%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt (97%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt (97%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt (97%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt (97%) rename browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseException.kt => stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandException.kt (82%) rename browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt => stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandInvalidDataException.kt (58%) rename browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseIoException.kt => stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandIoException.kt (61%) rename browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseRetryableException.kt => stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandRetryableException.kt (85%) rename browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseServiceException.kt => stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandServiceException.kt (80%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt (97%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt (97%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt (97%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt (93%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt (96%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndParams.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt (96%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt (94%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt (94%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsync.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsyncImpl.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/services/blocking/SessionService.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/main/kotlin/com/browserbase/api/services/blocking/SessionServiceImpl.kt (100%) rename browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro => stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/TestServerExtension.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/core/ObjectMappersTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/core/PhantomReachableTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/core/UtilsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/core/ValuesTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/core/http/AsyncStreamResponseTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/core/http/HeadersTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/core/http/QueryParamsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt (98%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/ActionTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/ModelConfigTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionActParamsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionActResponseTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndParamsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndResponseTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParamsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponseTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractParamsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateParamsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponseTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionObserveParamsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartResponseTest.kt (100%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt (98%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt (92%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt (95%) rename {browserbase-java-core => stagehand-java-core}/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt (95%) rename {browserbase-java-proguard-test => stagehand-java-proguard-test}/build.gradle.kts (90%) rename {browserbase-java-proguard-test => stagehand-java-proguard-test}/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt (93%) rename {browserbase-java-proguard-test => stagehand-java-proguard-test}/test.pro (100%) rename {browserbase-java => stagehand-java}/build.gradle.kts (85%) diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml index f40e546..6a27d98 100644 --- a/.github/workflows/publish-sonatype.yml +++ b/.github/workflows/publish-sonatype.yml @@ -35,7 +35,7 @@ jobs: GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')" ./gradlew publish --no-configuration-cache env: - SONATYPE_USERNAME: ${{ secrets.BROWSERBASE_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.BROWSERBASE_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} - GPG_SIGNING_KEY: ${{ secrets.BROWSERBASE_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} - GPG_SIGNING_PASSWORD: ${{ secrets.BROWSERBASE_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} \ No newline at end of file + SONATYPE_USERNAME: ${{ secrets.STAGEHAND_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} + GPG_SIGNING_KEY: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} + GPG_SIGNING_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index aac0446..a6e0235 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -18,7 +18,7 @@ jobs: run: | bash ./bin/check-release-environment env: - SONATYPE_USERNAME: ${{ secrets.BROWSERBASE_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.BROWSERBASE_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} - GPG_SIGNING_KEY: ${{ secrets.BROWSERBASE_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} - GPG_SIGNING_PASSWORD: ${{ secrets.BROWSERBASE_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.STAGEHAND_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }} + GPG_SIGNING_KEY: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }} + GPG_SIGNING_PASSWORD: ${{ secrets.STAGEHAND_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }} diff --git a/.stats.yml b/.stats.yml index ae2d02d..8741890 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-0c12f985340be2a9287e8e01ff8733f7f2d02e019149d1ae95f1a8f8798c6690.yml openapi_spec_hash: efb79934e1dc63763dd4e8493b825273 -config_hash: 905fc70fd4344c8631aab6754bffd883 +config_hash: 1de7cb9bd4dc46fe3e20b637bc534908 diff --git a/LICENSE b/LICENSE index 2cec9d4..6b24314 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Browserbase + Copyright 2025 Stagehand Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 390f269..8453788 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -# Browserbase Java API Library +# Stagehand Java API Library -[![Maven Central](https://img.shields.io/maven-central/v/com.browserbase.api/browserbase-java)](https://central.sonatype.com/artifact/com.browserbase.api/browserbase-java/0.0.1) -[![javadoc](https://javadoc.io/badge2/com.browserbase.api/browserbase-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.browserbase.api/browserbase-java/0.0.1) +[![Maven Central](https://img.shields.io/maven-central/v/com.browserbase.api/stagehand-java)](https://central.sonatype.com/artifact/com.browserbase.api/stagehand-java/0.0.1) +[![javadoc](https://javadoc.io/badge2/com.browserbase.api/stagehand-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.browserbase.api/stagehand-java/0.0.1) -The Browserbase Java SDK provides convenient access to the [Browserbase REST API](https://browserbase.com) from applications written in Java. +The Stagehand Java SDK provides convenient access to the [Stagehand REST API](https://docs.stagehand.dev) from applications written in Java. It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [browserbase.com](https://browserbase.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.browserbase.api/browserbase-java/0.0.1). +The REST API documentation can be found on [docs.stagehand.dev](https://docs.stagehand.dev). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.browserbase.api/stagehand-java/0.0.1). @@ -24,7 +24,7 @@ The REST API documentation can be found on [browserbase.com](https://browserbase ### Gradle ```kotlin -implementation("com.browserbase.api:browserbase-java:0.0.1") +implementation("com.browserbase.api:stagehand-java:0.0.1") ``` ### Maven @@ -32,7 +32,7 @@ implementation("com.browserbase.api:browserbase-java:0.0.1") ```xml com.browserbase.api - browserbase-java + stagehand-java 0.0.1 ``` @@ -46,14 +46,14 @@ This library requires Java 8 or later. ## Usage ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; import com.browserbase.api.models.sessions.SessionStartParams; import com.browserbase.api.models.sessions.SessionStartResponse; -// Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables -BrowserbaseClient client = BrowserbaseOkHttpClient.fromEnv(); +// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties +// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables +StagehandClient client = StagehandOkHttpClient.fromEnv(); SessionStartParams params = SessionStartParams.builder() .env(SessionStartParams.Env.LOCAL) @@ -66,21 +66,21 @@ SessionStartResponse response = client.sessions().start(params); Configure the client using system properties or environment variables: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -// Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables -BrowserbaseClient client = BrowserbaseOkHttpClient.fromEnv(); +// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties +// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables +StagehandClient client = StagehandOkHttpClient.fromEnv(); ``` Or manually: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -BrowserbaseClient client = BrowserbaseOkHttpClient.builder() +StagehandClient client = StagehandOkHttpClient.builder() .apiKey("My API Key") .build(); ``` @@ -88,12 +88,12 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() Or using a combination of the two approaches: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -BrowserbaseClient client = BrowserbaseOkHttpClient.builder() - // Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties - // Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables +StagehandClient client = StagehandOkHttpClient.builder() + // Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties + // Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables .fromEnv() .apiKey("My API Key") .build(); @@ -101,10 +101,10 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() See this table for the available options: -| Setter | System property | Environment variable | Required | Default value | -| --------- | ----------------------------- | ---------------------- | -------- | -------------------------------------------- | -| `apiKey` | `browserbase.stagehandApiKey` | `STAGEHAND_API_KEY` | true | - | -| `baseUrl` | `browserbase.baseUrl` | `BROWSERBASE_BASE_URL` | true | `"https://api.stagehand.browserbase.com/v1"` | +| Setter | System property | Environment variable | Required | Default value | +| --------- | ------------------- | -------------------- | -------- | -------------------------------------------- | +| `apiKey` | `stagehand.apiKey` | `STAGEHAND_API_KEY` | true | - | +| `baseUrl` | `stagehand.baseUrl` | `STAGEHAND_BASE_URL` | true | `"https://api.stagehand.browserbase.com/v1"` | System properties take precedence over environment variables. @@ -117,9 +117,9 @@ System properties take precedence over environment variables. To temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service: ```java -import com.browserbase.api.client.BrowserbaseClient; +import com.browserbase.api.client.StagehandClient; -BrowserbaseClient clientWithOptions = client.withOptions(optionsBuilder -> { +StagehandClient clientWithOptions = client.withOptions(optionsBuilder -> { optionsBuilder.baseUrl("https://example.com"); optionsBuilder.maxRetries(42); }); @@ -129,7 +129,7 @@ The `withOptions()` method does not affect the original client or service. ## Requests and responses -To send a request to the Browserbase API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class. +To send a request to the Stagehand API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class. For example, `client.sessions().start(...)` should be called with an instance of `SessionStartParams`, and it will return an instance of `SessionStartResponse`. @@ -146,15 +146,15 @@ Because each class is immutable, builder modification will _never_ affect alread The default client is synchronous. To switch to asynchronous execution, call the `async()` method: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; import com.browserbase.api.models.sessions.SessionStartParams; import com.browserbase.api.models.sessions.SessionStartResponse; import java.util.concurrent.CompletableFuture; -// Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables -BrowserbaseClient client = BrowserbaseOkHttpClient.fromEnv(); +// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties +// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables +StagehandClient client = StagehandOkHttpClient.fromEnv(); SessionStartParams params = SessionStartParams.builder() .env(SessionStartParams.Env.LOCAL) @@ -165,15 +165,15 @@ CompletableFuture response = client.async().sessions().sta Or create an asynchronous client from the beginning: ```java -import com.browserbase.api.client.BrowserbaseClientAsync; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClientAsync; +import com.browserbase.api.client.StagehandClientAsync; +import com.browserbase.api.client.okhttp.StagehandOkHttpClientAsync; import com.browserbase.api.models.sessions.SessionStartParams; import com.browserbase.api.models.sessions.SessionStartResponse; import java.util.concurrent.CompletableFuture; -// Configures using the `browserbase.stagehandApiKey` and `browserbase.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `BROWSERBASE_BASE_URL` environment variables -BrowserbaseClientAsync client = BrowserbaseOkHttpClientAsync.fromEnv(); +// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties +// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables +StagehandClientAsync client = StagehandOkHttpClientAsync.fromEnv(); SessionStartParams params = SessionStartParams.builder() .env(SessionStartParams.Env.LOCAL) @@ -216,46 +216,46 @@ SessionStartResponse parsedResponse = response.parse(); The SDK throws custom unchecked exception types: -- [`BrowserbaseServiceException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code: +- [`StagehandServiceException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code: - | Status | Exception | - | ------ | ------------------------------------------------------------------------------------------------------------------------------------ | - | 400 | [`BadRequestException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt) | - | 401 | [`UnauthorizedException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt) | - | 403 | [`PermissionDeniedException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt) | - | 404 | [`NotFoundException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt) | - | 422 | [`UnprocessableEntityException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt) | - | 429 | [`RateLimitException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt) | - | 5xx | [`InternalServerException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt) | - | others | [`UnexpectedStatusCodeException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt) | + | Status | Exception | + | ------ | ---------------------------------------------------------------------------------------------------------------------------------- | + | 400 | [`BadRequestException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt) | + | 401 | [`UnauthorizedException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt) | + | 403 | [`PermissionDeniedException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt) | + | 404 | [`NotFoundException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt) | + | 422 | [`UnprocessableEntityException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt) | + | 429 | [`RateLimitException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt) | + | 5xx | [`InternalServerException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt) | + | others | [`UnexpectedStatusCodeException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt) | -- [`BrowserbaseIoException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseIoException.kt): I/O networking errors. +- [`StagehandIoException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandIoException.kt): I/O networking errors. -- [`BrowserbaseRetryableException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseRetryableException.kt): Generic error indicating a failure that could be retried by the client. +- [`StagehandRetryableException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandRetryableException.kt): Generic error indicating a failure that could be retried by the client. -- [`BrowserbaseInvalidDataException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. +- [`StagehandInvalidDataException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. -- [`BrowserbaseException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. +- [`StagehandException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. ## Logging The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor). -Enable logging by setting the `BROWSERBASE_LOG` environment variable to `info`: +Enable logging by setting the `STAGEHAND_LOG` environment variable to `info`: ```sh -export BROWSERBASE_LOG=info +export STAGEHAND_LOG=info ``` Or to `debug` for more verbose logging: ```sh -export BROWSERBASE_LOG=debug +export STAGEHAND_LOG=debug ``` ## ProGuard and R8 -Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `browserbase-java-core` is published with a [configuration file](browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage). +Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `stagehand-java-core` is published with a [configuration file](stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage). ProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary. @@ -265,7 +265,7 @@ The SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON seri The SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config). -If the SDK threw an exception, but you're _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt). +If the SDK threw an exception, but you're _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`StagehandOkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt) or [`StagehandOkHttpClientAsync`](stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt). > [!CAUTION] > We make no guarantee that the SDK works correctly when the Jackson version check is disabled. @@ -289,10 +289,10 @@ The API may also explicitly instruct the SDK to retry or not retry a request. To set a custom number of retries, configure the client using the `maxRetries` method: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -BrowserbaseClient client = BrowserbaseOkHttpClient.builder() +StagehandClient client = StagehandOkHttpClient.builder() .fromEnv() .maxRetries(4) .build(); @@ -315,11 +315,11 @@ SessionStartResponse response = client.sessions().start( Or configure the default for all method calls at the client level: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; import java.time.Duration; -BrowserbaseClient client = BrowserbaseOkHttpClient.builder() +StagehandClient client = StagehandOkHttpClient.builder() .fromEnv() .timeout(Duration.ofSeconds(30)) .build(); @@ -330,12 +330,12 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() To route requests through a proxy, configure the client using the `proxy` method: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; import java.net.InetSocketAddress; import java.net.Proxy; -BrowserbaseClient client = BrowserbaseOkHttpClient.builder() +StagehandClient client = StagehandOkHttpClient.builder() .fromEnv() .proxy(new Proxy( Proxy.Type.HTTP, new InetSocketAddress( @@ -354,10 +354,10 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() To configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -BrowserbaseClient client = BrowserbaseOkHttpClient.builder() +StagehandClient client = StagehandOkHttpClient.builder() .fromEnv() // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa. .sslSocketFactory(yourSSLSocketFactory) @@ -371,10 +371,10 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() The SDK sends requests to the production by default. To send requests to a different environment, configure the client like so: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -BrowserbaseClient client = BrowserbaseOkHttpClient.builder() +StagehandClient client = StagehandOkHttpClient.builder() .fromEnv() // Other options include `local` .dev() @@ -385,15 +385,15 @@ BrowserbaseClient client = BrowserbaseOkHttpClient.builder() The SDK consists of three artifacts: -- `browserbase-java-core` +- `stagehand-java-core` - Contains core SDK logic - Does not depend on [OkHttp](https://square.github.io/okhttp) - - Exposes [`BrowserbaseClient`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClient.kt), [`BrowserbaseClientAsync`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsync.kt), [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt), and [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt), all of which can work with any HTTP client -- `browserbase-java-client-okhttp` + - Exposes [`StagehandClient`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClient.kt), [`StagehandClientAsync`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsync.kt), [`StagehandClientImpl`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientImpl.kt), and [`StagehandClientAsyncImpl`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsyncImpl.kt), all of which can work with any HTTP client +- `stagehand-java-client-okhttp` - Depends on [OkHttp](https://square.github.io/okhttp) - - Exposes [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt) and [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), which provide a way to construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt) and [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt), respectively, using OkHttp -- `browserbase-java` - - Depends on and exposes the APIs of both `browserbase-java-core` and `browserbase-java-client-okhttp` + - Exposes [`StagehandOkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt) and [`StagehandOkHttpClientAsync`](stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt), which provide a way to construct [`StagehandClientImpl`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientImpl.kt) and [`StagehandClientAsyncImpl`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsyncImpl.kt), respectively, using OkHttp +- `stagehand-java` + - Depends on and exposes the APIs of both `stagehand-java-core` and `stagehand-java-client-okhttp` - Does not have its own logic This structure allows replacing the SDK's default HTTP client without pulling in unnecessary dependencies. @@ -405,17 +405,17 @@ This structure allows replacing the SDK's default HTTP client without pulling in To use a customized `OkHttpClient`: -1. Replace your [`browserbase-java` dependency](#installation) with `browserbase-java-core` -2. Copy `browserbase-java-client-okhttp`'s [`OkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt) class into your code and customize it -3. Construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt) or [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt), similarly to [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), using your customized client +1. Replace your [`stagehand-java` dependency](#installation) with `stagehand-java-core` +2. Copy `stagehand-java-client-okhttp`'s [`OkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt) class into your code and customize it +3. Construct [`StagehandClientImpl`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientImpl.kt) or [`StagehandClientAsyncImpl`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsyncImpl.kt), similarly to [`StagehandOkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt) or [`StagehandOkHttpClientAsync`](stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt), using your customized client ### Completely custom HTTP client To use a completely custom HTTP client: -1. Replace your [`browserbase-java` dependency](#installation) with `browserbase-java-core` -2. Write a class that implements the [`HttpClient`](browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt) interface -3. Construct [`BrowserbaseClientImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt) or [`BrowserbaseClientAsyncImpl`](browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt), similarly to [`BrowserbaseOkHttpClient`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt) or [`BrowserbaseOkHttpClientAsync`](browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt), using your new client class +1. Replace your [`stagehand-java` dependency](#installation) with `stagehand-java-core` +2. Write a class that implements the [`HttpClient`](stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt) interface +3. Construct [`StagehandClientImpl`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientImpl.kt) or [`StagehandClientAsyncImpl`](stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsyncImpl.kt), similarly to [`StagehandOkHttpClient`](stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt) or [`StagehandOkHttpClientAsync`](stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt), using your new client class ## Undocumented API functionality @@ -453,7 +453,7 @@ SessionStartParams params = SessionStartParams.builder() These properties can be accessed on the nested built object later using the `_additionalProperties()` method. -To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt) object to its setter: +To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt) object to its setter: ```java import com.browserbase.api.core.JsonValue; @@ -464,7 +464,7 @@ SessionStartParams params = SessionStartParams.builder() .build(); ``` -The most straightforward way to create a [`JsonValue`](browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt) is using its `from(...)` method: +The most straightforward way to create a [`JsonValue`](stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt) is using its `from(...)` method: ```java import com.browserbase.api.core.JsonValue; @@ -505,7 +505,7 @@ JsonValue complexValue = JsonValue.from(Map.of( Normally a `Builder` class's `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset. -To forcibly omit a required parameter or property, pass [`JsonMissing`](browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt): +To forcibly omit a required parameter or property, pass [`JsonMissing`](stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt): ```java import com.browserbase.api.core.JsonMissing; @@ -575,7 +575,7 @@ if (env.isMissing()) { In rare cases, the API may return a response that doesn't match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else. -By default, the SDK will not throw an exception in this case. It will throw [`BrowserbaseInvalidDataException`](browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt) only if you directly access the property. +By default, the SDK will not throw an exception in this case. It will throw [`StagehandInvalidDataException`](stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandInvalidDataException.kt) only if you directly access the property. If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`: @@ -598,10 +598,10 @@ SessionStartResponse response = client.sessions().start( Or configure the default for all method calls at the client level: ```java -import com.browserbase.api.client.BrowserbaseClient; -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient; +import com.browserbase.api.client.StagehandClient; +import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -BrowserbaseClient client = BrowserbaseOkHttpClient.builder() +StagehandClient client = StagehandOkHttpClient.builder() .fromEnv() .responseValidation(true) .build(); diff --git a/SECURITY.md b/SECURITY.md index be1c2db..dcfc419 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,7 +16,7 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Browserbase, please follow the respective company's security reporting guidelines. +or products provided by Stagehand, please follow the respective company's security reporting guidelines. --- diff --git a/build.gradle.kts b/build.gradle.kts index 471d362..0913290 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,7 +32,7 @@ subprojects { // Avoid race conditions between `dokkaJavadocCollector` and `dokkaJavadocJar` tasks tasks.named("dokkaJavadocCollector").configure { subprojects.flatMap { it.tasks } - .filter { it.project.name != "browserbase-java" && it.name == "dokkaJavadocJar" } + .filter { it.project.name != "stagehand-java" && it.name == "dokkaJavadocJar" } .forEach { mustRunAfter(it) } } diff --git a/buildSrc/src/main/kotlin/browserbase.java.gradle.kts b/buildSrc/src/main/kotlin/stagehand.java.gradle.kts similarity index 100% rename from buildSrc/src/main/kotlin/browserbase.java.gradle.kts rename to buildSrc/src/main/kotlin/stagehand.java.gradle.kts diff --git a/buildSrc/src/main/kotlin/browserbase.kotlin.gradle.kts b/buildSrc/src/main/kotlin/stagehand.kotlin.gradle.kts similarity index 99% rename from buildSrc/src/main/kotlin/browserbase.kotlin.gradle.kts rename to buildSrc/src/main/kotlin/stagehand.kotlin.gradle.kts index 08574e8..f3f48d1 100644 --- a/buildSrc/src/main/kotlin/browserbase.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/stagehand.kotlin.gradle.kts @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion plugins { - id("browserbase.java") + id("stagehand.java") kotlin("jvm") } diff --git a/buildSrc/src/main/kotlin/browserbase.publish.gradle.kts b/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts similarity index 95% rename from buildSrc/src/main/kotlin/browserbase.publish.gradle.kts rename to buildSrc/src/main/kotlin/stagehand.publish.gradle.kts index 6822ae8..9f64944 100644 --- a/buildSrc/src/main/kotlin/browserbase.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts @@ -11,7 +11,7 @@ configure { pom { name.set("Stagehand P2P Server API") description.set("HTTP API for remote Stagehand browser automation. This API allows clients to\nconnect to a Stagehand server and execute browser automation tasks remotely.\n\nAll endpoints except /sessions/start require an active session ID. Responses are\nstreamed using Server-Sent Events (SSE) when the `x-stream-response: true`\nheader is provided.") - url.set("https://browserbase.com") + url.set("https://docs.stagehand.dev") licenses { license { @@ -21,7 +21,7 @@ configure { developers { developer { - name.set("Browserbase") + name.set("Stagehand") } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 53191ab..02623dd 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,11 +1,11 @@ -rootProject.name = "browserbase-java-root" +rootProject.name = "stagehand-java-root" val projectNames = rootDir.listFiles() ?.asSequence() .orEmpty() .filter { file -> file.isDirectory && - file.name.startsWith("browserbase-java") && + file.name.startsWith("stagehand-java") && file.listFiles()?.asSequence().orEmpty().any { it.name == "build.gradle.kts" } } .map { it.name } diff --git a/browserbase-java-client-okhttp/build.gradle.kts b/stagehand-java-client-okhttp/build.gradle.kts similarity index 76% rename from browserbase-java-client-okhttp/build.gradle.kts rename to stagehand-java-client-okhttp/build.gradle.kts index d5f5cb0..cb49933 100644 --- a/browserbase-java-client-okhttp/build.gradle.kts +++ b/stagehand-java-client-okhttp/build.gradle.kts @@ -1,10 +1,10 @@ plugins { - id("browserbase.kotlin") - id("browserbase.publish") + id("stagehand.kotlin") + id("stagehand.publish") } dependencies { - api(project(":browserbase-java-core")) + api(project(":stagehand-java-core")) implementation("com.squareup.okhttp3:okhttp:4.12.0") implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") diff --git a/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt similarity index 96% rename from browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt rename to stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt index 433919c..a624630 100644 --- a/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt @@ -8,7 +8,7 @@ import com.browserbase.api.core.http.HttpMethod import com.browserbase.api.core.http.HttpRequest import com.browserbase.api.core.http.HttpRequestBody import com.browserbase.api.core.http.HttpResponse -import com.browserbase.api.errors.BrowserbaseIoException +import com.browserbase.api.errors.StagehandIoException import java.io.IOException import java.io.InputStream import java.net.Proxy @@ -39,7 +39,7 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien return try { call.execute().toResponse() } catch (e: IOException) { - throw BrowserbaseIoException("Request failed", e) + throw StagehandIoException("Request failed", e) } finally { request.body?.close() } @@ -59,7 +59,7 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien } override fun onFailure(call: Call, e: IOException) { - future.completeExceptionally(BrowserbaseIoException("Request failed", e)) + future.completeExceptionally(StagehandIoException("Request failed", e)) } } ) @@ -84,7 +84,7 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien val clientBuilder = okHttpClient.newBuilder() val logLevel = - when (System.getenv("BROWSERBASE_LOG")?.lowercase()) { + when (System.getenv("STAGEHAND_LOG")?.lowercase()) { "info" -> HttpLoggingInterceptor.Level.BASIC "debug" -> HttpLoggingInterceptor.Level.BODY else -> null diff --git a/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt similarity index 95% rename from browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt rename to stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt index dee001e..9114eb5 100644 --- a/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClient.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt @@ -2,8 +2,8 @@ package com.browserbase.api.client.okhttp -import com.browserbase.api.client.BrowserbaseClient -import com.browserbase.api.client.BrowserbaseClientImpl +import com.browserbase.api.client.StagehandClient +import com.browserbase.api.client.StagehandClientImpl import com.browserbase.api.core.ClientOptions import com.browserbase.api.core.Sleeper import com.browserbase.api.core.Timeout @@ -22,14 +22,14 @@ import javax.net.ssl.X509TrustManager import kotlin.jvm.optionals.getOrNull /** - * A class that allows building an instance of [BrowserbaseClient] with [OkHttpClient] as the + * A class that allows building an instance of [StagehandClient] with [OkHttpClient] as the * underlying [HttpClient]. */ -class BrowserbaseOkHttpClient private constructor() { +class StagehandOkHttpClient private constructor() { companion object { - /** Returns a mutable builder for constructing an instance of [BrowserbaseClient]. */ + /** Returns a mutable builder for constructing an instance of [StagehandClient]. */ @JvmStatic fun builder() = Builder() /** @@ -37,10 +37,10 @@ class BrowserbaseOkHttpClient private constructor() { * * @see ClientOptions.Builder.fromEnv */ - @JvmStatic fun fromEnv(): BrowserbaseClient = builder().fromEnv().build() + @JvmStatic fun fromEnv(): StagehandClient = builder().fromEnv().build() } - /** A builder for [BrowserbaseOkHttpClient]. */ + /** A builder for [StagehandOkHttpClient]. */ class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() @@ -295,12 +295,12 @@ class BrowserbaseOkHttpClient private constructor() { fun fromEnv() = apply { clientOptions.fromEnv() } /** - * Returns an immutable instance of [BrowserbaseClient]. + * Returns an immutable instance of [StagehandClient]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): BrowserbaseClient = - BrowserbaseClientImpl( + fun build(): StagehandClient = + StagehandClientImpl( clientOptions .httpClient( OkHttpClient.builder() diff --git a/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt similarity index 95% rename from browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt rename to stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt index 924eb97..f16e2f8 100644 --- a/browserbase-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/BrowserbaseOkHttpClientAsync.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt @@ -2,8 +2,8 @@ package com.browserbase.api.client.okhttp -import com.browserbase.api.client.BrowserbaseClientAsync -import com.browserbase.api.client.BrowserbaseClientAsyncImpl +import com.browserbase.api.client.StagehandClientAsync +import com.browserbase.api.client.StagehandClientAsyncImpl import com.browserbase.api.core.ClientOptions import com.browserbase.api.core.Sleeper import com.browserbase.api.core.Timeout @@ -22,14 +22,14 @@ import javax.net.ssl.X509TrustManager import kotlin.jvm.optionals.getOrNull /** - * A class that allows building an instance of [BrowserbaseClientAsync] with [OkHttpClient] as the + * A class that allows building an instance of [StagehandClientAsync] with [OkHttpClient] as the * underlying [HttpClient]. */ -class BrowserbaseOkHttpClientAsync private constructor() { +class StagehandOkHttpClientAsync private constructor() { companion object { - /** Returns a mutable builder for constructing an instance of [BrowserbaseClientAsync]. */ + /** Returns a mutable builder for constructing an instance of [StagehandClientAsync]. */ @JvmStatic fun builder() = Builder() /** @@ -37,10 +37,10 @@ class BrowserbaseOkHttpClientAsync private constructor() { * * @see ClientOptions.Builder.fromEnv */ - @JvmStatic fun fromEnv(): BrowserbaseClientAsync = builder().fromEnv().build() + @JvmStatic fun fromEnv(): StagehandClientAsync = builder().fromEnv().build() } - /** A builder for [BrowserbaseOkHttpClientAsync]. */ + /** A builder for [StagehandOkHttpClientAsync]. */ class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() @@ -295,12 +295,12 @@ class BrowserbaseOkHttpClientAsync private constructor() { fun fromEnv() = apply { clientOptions.fromEnv() } /** - * Returns an immutable instance of [BrowserbaseClientAsync]. + * Returns an immutable instance of [StagehandClientAsync]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): BrowserbaseClientAsync = - BrowserbaseClientAsyncImpl( + fun build(): StagehandClientAsync = + StagehandClientAsyncImpl( clientOptions .httpClient( OkHttpClient.builder() diff --git a/browserbase-java-client-okhttp/src/test/kotlin/com/browserbase/api/client/okhttp/OkHttpClientTest.kt b/stagehand-java-client-okhttp/src/test/kotlin/com/browserbase/api/client/okhttp/OkHttpClientTest.kt similarity index 100% rename from browserbase-java-client-okhttp/src/test/kotlin/com/browserbase/api/client/okhttp/OkHttpClientTest.kt rename to stagehand-java-client-okhttp/src/test/kotlin/com/browserbase/api/client/okhttp/OkHttpClientTest.kt diff --git a/browserbase-java-core/build.gradle.kts b/stagehand-java-core/build.gradle.kts similarity index 93% rename from browserbase-java-core/build.gradle.kts rename to stagehand-java-core/build.gradle.kts index ca10c97..38bcf47 100644 --- a/browserbase-java-core/build.gradle.kts +++ b/stagehand-java-core/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id("browserbase.kotlin") - id("browserbase.publish") + id("stagehand.kotlin") + id("stagehand.publish") } configurations.all { @@ -29,7 +29,7 @@ dependencies { implementation("org.apache.httpcomponents.client5:httpclient5:5.3.1") testImplementation(kotlin("test")) - testImplementation(project(":browserbase-java-client-okhttp")) + testImplementation(project(":stagehand-java-client-okhttp")) testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") testImplementation("org.assertj:assertj-core:3.25.3") testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClient.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClient.kt similarity index 85% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClient.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClient.kt index e77d3b1..a5c8c6c 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClient.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClient.kt @@ -7,7 +7,7 @@ import com.browserbase.api.services.blocking.SessionService import java.util.function.Consumer /** - * A client for interacting with the Browserbase REST API synchronously. You can also switch to + * A client for interacting with the Stagehand REST API synchronously. You can also switch to * asynchronous execution via the [async] method. * * This client performs best when you create a single instance and reuse it for all interactions @@ -20,7 +20,7 @@ import java.util.function.Consumer * if you are writing an application that needs to aggressively release unused resources, then you * may call [close]. */ -interface BrowserbaseClient { +interface StagehandClient { /** * Returns a version of this client that uses asynchronous execution. @@ -28,7 +28,7 @@ interface BrowserbaseClient { * The returned client shares its resources, like its connection pool and thread pools, with * this client. */ - fun async(): BrowserbaseClientAsync + fun async(): StagehandClientAsync /** * Returns a view of this service that provides access to raw HTTP responses for each method. @@ -40,7 +40,7 @@ interface BrowserbaseClient { * * The original service is not modified. */ - fun withOptions(modifier: Consumer): BrowserbaseClient + fun withOptions(modifier: Consumer): StagehandClient fun sessions(): SessionService @@ -57,7 +57,7 @@ interface BrowserbaseClient { */ fun close() - /** A view of [BrowserbaseClient] that provides access to raw HTTP responses for each method. */ + /** A view of [StagehandClient] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { /** @@ -65,9 +65,7 @@ interface BrowserbaseClient { * * The original service is not modified. */ - fun withOptions( - modifier: Consumer - ): BrowserbaseClient.WithRawResponse + fun withOptions(modifier: Consumer): StagehandClient.WithRawResponse fun sessions(): SessionService.WithRawResponse } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsync.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsync.kt similarity index 87% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsync.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsync.kt index 85a8cd5..27fd2a9 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsync.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsync.kt @@ -7,7 +7,7 @@ import com.browserbase.api.services.async.SessionServiceAsync import java.util.function.Consumer /** - * A client for interacting with the Browserbase REST API asynchronously. You can also switch to + * A client for interacting with the Stagehand REST API asynchronously. You can also switch to * synchronous execution via the [sync] method. * * This client performs best when you create a single instance and reuse it for all interactions @@ -20,7 +20,7 @@ import java.util.function.Consumer * if you are writing an application that needs to aggressively release unused resources, then you * may call [close]. */ -interface BrowserbaseClientAsync { +interface StagehandClientAsync { /** * Returns a version of this client that uses synchronous execution. @@ -28,7 +28,7 @@ interface BrowserbaseClientAsync { * The returned client shares its resources, like its connection pool and thread pools, with * this client. */ - fun sync(): BrowserbaseClient + fun sync(): StagehandClient /** * Returns a view of this service that provides access to raw HTTP responses for each method. @@ -40,7 +40,7 @@ interface BrowserbaseClientAsync { * * The original service is not modified. */ - fun withOptions(modifier: Consumer): BrowserbaseClientAsync + fun withOptions(modifier: Consumer): StagehandClientAsync fun sessions(): SessionServiceAsync @@ -58,8 +58,7 @@ interface BrowserbaseClientAsync { fun close() /** - * A view of [BrowserbaseClientAsync] that provides access to raw HTTP responses for each - * method. + * A view of [StagehandClientAsync] that provides access to raw HTTP responses for each method. */ interface WithRawResponse { @@ -70,7 +69,7 @@ interface BrowserbaseClientAsync { */ fun withOptions( modifier: Consumer - ): BrowserbaseClientAsync.WithRawResponse + ): StagehandClientAsync.WithRawResponse fun sessions(): SessionServiceAsync.WithRawResponse } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsyncImpl.kt similarity index 69% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsyncImpl.kt index 78e60db..2a0b813 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientAsyncImpl.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientAsyncImpl.kt @@ -8,8 +8,7 @@ import com.browserbase.api.services.async.SessionServiceAsync import com.browserbase.api.services.async.SessionServiceAsyncImpl import java.util.function.Consumer -class BrowserbaseClientAsyncImpl(private val clientOptions: ClientOptions) : - BrowserbaseClientAsync { +class StagehandClientAsyncImpl(private val clientOptions: ClientOptions) : StagehandClientAsync { private val clientOptionsWithUserAgent = if (clientOptions.headers.names().contains("User-Agent")) clientOptions @@ -20,9 +19,9 @@ class BrowserbaseClientAsyncImpl(private val clientOptions: ClientOptions) : .build() // Pass the original clientOptions so that this client sets its own User-Agent. - private val sync: BrowserbaseClient by lazy { BrowserbaseClientImpl(clientOptions) } + private val sync: StagehandClient by lazy { StagehandClientImpl(clientOptions) } - private val withRawResponse: BrowserbaseClientAsync.WithRawResponse by lazy { + private val withRawResponse: StagehandClientAsync.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } @@ -30,19 +29,19 @@ class BrowserbaseClientAsyncImpl(private val clientOptions: ClientOptions) : SessionServiceAsyncImpl(clientOptionsWithUserAgent) } - override fun sync(): BrowserbaseClient = sync + override fun sync(): StagehandClient = sync - override fun withRawResponse(): BrowserbaseClientAsync.WithRawResponse = withRawResponse + override fun withRawResponse(): StagehandClientAsync.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): BrowserbaseClientAsync = - BrowserbaseClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): StagehandClientAsync = + StagehandClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) override fun sessions(): SessionServiceAsync = sessions override fun close() = clientOptions.close() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - BrowserbaseClientAsync.WithRawResponse { + StagehandClientAsync.WithRawResponse { private val sessions: SessionServiceAsync.WithRawResponse by lazy { SessionServiceAsyncImpl.WithRawResponseImpl(clientOptions) @@ -50,8 +49,8 @@ class BrowserbaseClientAsyncImpl(private val clientOptions: ClientOptions) : override fun withOptions( modifier: Consumer - ): BrowserbaseClientAsync.WithRawResponse = - BrowserbaseClientAsyncImpl.WithRawResponseImpl( + ): StagehandClientAsync.WithRawResponse = + StagehandClientAsyncImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientImpl.kt similarity index 69% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientImpl.kt index 3df8a4f..8ea5907 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/client/BrowserbaseClientImpl.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/client/StagehandClientImpl.kt @@ -8,7 +8,7 @@ import com.browserbase.api.services.blocking.SessionService import com.browserbase.api.services.blocking.SessionServiceImpl import java.util.function.Consumer -class BrowserbaseClientImpl(private val clientOptions: ClientOptions) : BrowserbaseClient { +class StagehandClientImpl(private val clientOptions: ClientOptions) : StagehandClient { private val clientOptionsWithUserAgent = if (clientOptions.headers.names().contains("User-Agent")) clientOptions @@ -19,27 +19,27 @@ class BrowserbaseClientImpl(private val clientOptions: ClientOptions) : Browserb .build() // Pass the original clientOptions so that this client sets its own User-Agent. - private val async: BrowserbaseClientAsync by lazy { BrowserbaseClientAsyncImpl(clientOptions) } + private val async: StagehandClientAsync by lazy { StagehandClientAsyncImpl(clientOptions) } - private val withRawResponse: BrowserbaseClient.WithRawResponse by lazy { + private val withRawResponse: StagehandClient.WithRawResponse by lazy { WithRawResponseImpl(clientOptions) } private val sessions: SessionService by lazy { SessionServiceImpl(clientOptionsWithUserAgent) } - override fun async(): BrowserbaseClientAsync = async + override fun async(): StagehandClientAsync = async - override fun withRawResponse(): BrowserbaseClient.WithRawResponse = withRawResponse + override fun withRawResponse(): StagehandClient.WithRawResponse = withRawResponse - override fun withOptions(modifier: Consumer): BrowserbaseClient = - BrowserbaseClientImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + override fun withOptions(modifier: Consumer): StagehandClient = + StagehandClientImpl(clientOptions.toBuilder().apply(modifier::accept).build()) override fun sessions(): SessionService = sessions override fun close() = clientOptions.close() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : - BrowserbaseClient.WithRawResponse { + StagehandClient.WithRawResponse { private val sessions: SessionService.WithRawResponse by lazy { SessionServiceImpl.WithRawResponseImpl(clientOptions) @@ -47,8 +47,8 @@ class BrowserbaseClientImpl(private val clientOptions: ClientOptions) : Browserb override fun withOptions( modifier: Consumer - ): BrowserbaseClient.WithRawResponse = - BrowserbaseClientImpl.WithRawResponseImpl( + ): StagehandClient.WithRawResponse = + StagehandClientImpl.WithRawResponseImpl( clientOptions.toBuilder().apply(modifier::accept).build() ) diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseDeserializer.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/BaseDeserializer.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseDeserializer.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/BaseDeserializer.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseSerializer.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/BaseSerializer.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/BaseSerializer.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/BaseSerializer.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Check.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Check.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Check.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Check.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt similarity index 94% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt index 0032ba1..967f4dc 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt @@ -20,7 +20,7 @@ private constructor( /** * The HTTP client to use in the SDK. * - * Use the one published in `browserbase-java-client-okhttp` or implement your own. + * Use the one published in `stagehand-java-client-okhttp` or implement your own. * * This class takes ownership of the client and closes it when closed. */ @@ -177,7 +177,7 @@ private constructor( /** * The HTTP client to use in the SDK. * - * Use the one published in `browserbase-java-client-okhttp` or implement your own. + * Use the one published in `stagehand-java-client-okhttp` or implement your own. * * This class takes ownership of the client and closes it when closed. */ @@ -377,19 +377,20 @@ private constructor( * * See this table for the available options: * - * |Setter |System property |Environment variable |Required|Default value | - * |---------|-----------------------------|----------------------|--------|--------------------------------------------| - * |`apiKey` |`browserbase.stagehandApiKey`|`STAGEHAND_API_KEY` |true |- | - * |`baseUrl`|`browserbase.baseUrl` |`BROWSERBASE_BASE_URL`|true |`"https://api.stagehand.browserbase.com/v1"`| + * |Setter |System property |Environment variable|Required|Default value | + * |---------|-------------------|--------------------|--------|--------------------------------------------| + * |`apiKey` |`stagehand.apiKey` |`STAGEHAND_API_KEY` |true |- | + * |`baseUrl`|`stagehand.baseUrl`|`STAGEHAND_BASE_URL`|true |`"https://api.stagehand.browserbase.com/v1"`| * * System properties take precedence over environment variables. */ fun fromEnv() = apply { - (System.getProperty("browserbase.baseUrl") ?: System.getenv("BROWSERBASE_BASE_URL")) - ?.let { baseUrl(it) } - (System.getProperty("browserbase.stagehandApiKey") - ?: System.getenv("STAGEHAND_API_KEY")) - ?.let { apiKey(it) } + (System.getProperty("stagehand.baseUrl") ?: System.getenv("STAGEHAND_BASE_URL"))?.let { + baseUrl(it) + } + (System.getProperty("stagehand.apiKey") ?: System.getenv("STAGEHAND_API_KEY"))?.let { + apiKey(it) + } } /** diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/DefaultSleeper.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/DefaultSleeper.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/DefaultSleeper.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/DefaultSleeper.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ObjectMappers.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ObjectMappers.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/ObjectMappers.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ObjectMappers.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Params.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Params.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Params.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Params.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt similarity index 92% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt index 5c5bb35..12cba3f 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachable.kt @@ -2,7 +2,7 @@ package com.browserbase.api.core -import com.browserbase.api.errors.BrowserbaseException +import com.browserbase.api.errors.StagehandException import java.lang.reflect.InvocationTargetException /** @@ -46,7 +46,7 @@ private val closeWhenPhantomReachable: ((Any, () -> Unit) -> Unit)? by lazy { is Error -> throw cause } } - throw BrowserbaseException("Unexpected reflective invocation failure", e) + throw StagehandException("Unexpected reflective invocation failure", e) } } } catch (e: ReflectiveOperationException) { diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableExecutorService.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableExecutorService.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableExecutorService.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableExecutorService.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableSleeper.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableSleeper.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableSleeper.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/PhantomReachableSleeper.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PrepareRequest.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/PrepareRequest.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/PrepareRequest.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/PrepareRequest.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Properties.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Properties.kt similarity index 88% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Properties.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Properties.kt index bbd1121..c14d552 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Properties.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Properties.kt @@ -2,7 +2,7 @@ package com.browserbase.api.core -import com.browserbase.api.client.BrowserbaseClient +import com.browserbase.api.client.StagehandClient fun getOsArch(): String { val osArch = System.getProperty("os.arch") @@ -37,6 +37,6 @@ fun getOsName(): String { fun getOsVersion(): String = System.getProperty("os.version", "unknown") fun getPackageVersion(): String = - BrowserbaseClient::class.java.`package`.implementationVersion ?: "unknown" + StagehandClient::class.java.`package`.implementationVersion ?: "unknown" fun getJavaVersion(): String = System.getProperty("java.version", "unknown") diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/RequestOptions.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/RequestOptions.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/RequestOptions.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/RequestOptions.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Sleeper.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Sleeper.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Sleeper.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Sleeper.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Timeout.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Timeout.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Timeout.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Timeout.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Utils.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Utils.kt similarity index 96% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Utils.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Utils.kt index c772038..c24f648 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Utils.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Utils.kt @@ -2,7 +2,7 @@ package com.browserbase.api.core -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import java.util.Collections import java.util.SortedMap import java.util.concurrent.CompletableFuture @@ -10,7 +10,7 @@ import java.util.concurrent.locks.Lock @JvmSynthetic internal fun T?.getOrThrow(name: String): T = - this ?: throw BrowserbaseInvalidDataException("`${name}` is not present") + this ?: throw StagehandInvalidDataException("`${name}` is not present") @JvmSynthetic internal fun List.toImmutable(): List = diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt index 3eb4836..db0102a 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt @@ -1,6 +1,6 @@ package com.browserbase.api.core -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JacksonAnnotationsInside import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonInclude @@ -108,7 +108,7 @@ sealed class JsonField { } fun asStringOrThrow(): String = - asString().orElseThrow { BrowserbaseInvalidDataException("Value is not a string") } + asString().orElseThrow { StagehandInvalidDataException("Value is not a string") } /** * Returns an [Optional] containing this field's list value, or an empty [Optional] if it @@ -171,9 +171,9 @@ sealed class JsonField { internal fun getRequired(name: String): T = when (this) { is KnownValue -> value - is JsonMissing -> throw BrowserbaseInvalidDataException("`$name` is not set") - is JsonNull -> throw BrowserbaseInvalidDataException("`$name` is null") - else -> throw BrowserbaseInvalidDataException("`$name` is invalid, received $this") + is JsonMissing -> throw StagehandInvalidDataException("`$name` is not set") + is JsonNull -> throw StagehandInvalidDataException("`$name` is null") + else -> throw StagehandInvalidDataException("`$name` is invalid, received $this") } @JvmSynthetic @@ -188,7 +188,7 @@ sealed class JsonField { is KnownValue -> Optional.of(value) is JsonMissing, is JsonNull -> Optional.empty() - else -> throw BrowserbaseInvalidDataException("`$name` is invalid, received $this") + else -> throw StagehandInvalidDataException("`$name` is invalid, received $this") } @JvmSynthetic diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/ErrorHandler.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/handlers/ErrorHandler.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/ErrorHandler.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/handlers/ErrorHandler.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt similarity index 80% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt index 994a55e..28b3462 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/handlers/JsonHandler.kt @@ -4,7 +4,7 @@ package com.browserbase.api.core.handlers import com.browserbase.api.core.http.HttpResponse import com.browserbase.api.core.http.HttpResponse.Handler -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef @@ -15,6 +15,6 @@ internal inline fun jsonHandler(jsonMapper: JsonMapper): Handler try { jsonMapper.readValue(response.body(), jacksonTypeRef()) } catch (e: Exception) { - throw BrowserbaseInvalidDataException("Error reading response", e) + throw StagehandInvalidDataException("Error reading response", e) } } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/StringHandler.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/handlers/StringHandler.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/handlers/StringHandler.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/handlers/StringHandler.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/AsyncStreamResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/AsyncStreamResponse.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/AsyncStreamResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/AsyncStreamResponse.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/Headers.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/Headers.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/Headers.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/Headers.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpClient.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpMethod.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpMethod.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpMethod.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpMethod.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequest.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequest.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequest.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequest.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt similarity index 96% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt index 05a1d50..499197e 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBodies.kt @@ -5,7 +5,7 @@ package com.browserbase.api.core.http import com.browserbase.api.core.MultipartField -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.json.JsonMapper import com.fasterxml.jackson.databind.node.JsonNodeType @@ -97,7 +97,7 @@ internal fun multipartFormData( JsonNodeType.ARRAY, JsonNodeType.OBJECT, JsonNodeType.POJO -> - throw BrowserbaseInvalidDataException( + throw StagehandInvalidDataException( "Unexpected JsonNode type in array: ${node.nodeType}" ) } @@ -111,7 +111,7 @@ internal fun multipartFormData( } JsonNodeType.POJO, null -> - throw BrowserbaseInvalidDataException( + throw StagehandInvalidDataException( "Unexpected JsonNode type: ${node.nodeType}" ) } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBody.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBody.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBody.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpRequestBody.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponse.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponse.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponseFor.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponseFor.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponseFor.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/HttpResponseFor.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingAsyncStreamResponse.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingHttpClient.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingHttpClient.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingHttpClient.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingHttpClient.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingStreamResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingStreamResponse.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingStreamResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/PhantomReachableClosingStreamResponse.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/QueryParams.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/QueryParams.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/QueryParams.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/QueryParams.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt index 358057c..7e1a7aa 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/RetryingHttpClient.kt @@ -4,8 +4,8 @@ import com.browserbase.api.core.DefaultSleeper import com.browserbase.api.core.RequestOptions import com.browserbase.api.core.Sleeper import com.browserbase.api.core.checkRequired -import com.browserbase.api.errors.BrowserbaseIoException -import com.browserbase.api.errors.BrowserbaseRetryableException +import com.browserbase.api.errors.StagehandIoException +import com.browserbase.api.errors.StagehandRetryableException import java.io.IOException import java.time.Clock import java.time.Duration @@ -182,8 +182,8 @@ private constructor( private fun shouldRetry(throwable: Throwable): Boolean = // Only retry known retryable exceptions, other exceptions are not intended to be retried. throwable is IOException || - throwable is BrowserbaseIoException || - throwable is BrowserbaseRetryableException + throwable is StagehandIoException || + throwable is StagehandRetryableException private fun getRetryBackoffDuration(retries: Int, response: HttpResponse?): Duration { // About the Retry-After header: diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/StreamResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/StreamResponse.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/core/http/StreamResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/core/http/StreamResponse.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt index 8281e6d..c56095d 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/BadRequestException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class BadRequestException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - BrowserbaseServiceException("400: $body", cause) { + StagehandServiceException("400: $body", cause) { override fun statusCode(): Int = 400 diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt index 3728e7d..c2b0d58 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/InternalServerException.kt @@ -14,7 +14,7 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : BrowserbaseServiceException("$statusCode: $body", cause) { +) : StagehandServiceException("$statusCode: $body", cause) { override fun statusCode(): Int = statusCode diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt index 5fe3abd..b8dcbd2 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/NotFoundException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class NotFoundException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - BrowserbaseServiceException("404: $body", cause) { + StagehandServiceException("404: $body", cause) { override fun statusCode(): Int = 404 diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt index b161cb7..4c37a8a 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/PermissionDeniedException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class PermissionDeniedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - BrowserbaseServiceException("403: $body", cause) { + StagehandServiceException("403: $body", cause) { override fun statusCode(): Int = 403 diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt index cc270eb..b72ef4f 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/RateLimitException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class RateLimitException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - BrowserbaseServiceException("429: $body", cause) { + StagehandServiceException("429: $body", cause) { override fun statusCode(): Int = 429 diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandException.kt similarity index 82% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandException.kt index 2b49c25..214a6a8 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandException.kt @@ -1,5 +1,5 @@ package com.browserbase.api.errors -open class BrowserbaseException +open class StagehandException @JvmOverloads constructor(message: String? = null, cause: Throwable? = null) : RuntimeException(message, cause) diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandInvalidDataException.kt similarity index 58% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandInvalidDataException.kt index 28a9644..87fe2d4 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseInvalidDataException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandInvalidDataException.kt @@ -1,6 +1,5 @@ package com.browserbase.api.errors -class BrowserbaseInvalidDataException +class StagehandInvalidDataException @JvmOverloads -constructor(message: String? = null, cause: Throwable? = null) : - BrowserbaseException(message, cause) +constructor(message: String? = null, cause: Throwable? = null) : StagehandException(message, cause) diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseIoException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandIoException.kt similarity index 61% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseIoException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandIoException.kt index 6d8a71c..216ae66 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseIoException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandIoException.kt @@ -1,6 +1,5 @@ package com.browserbase.api.errors -class BrowserbaseIoException +class StagehandIoException @JvmOverloads -constructor(message: String? = null, cause: Throwable? = null) : - BrowserbaseException(message, cause) +constructor(message: String? = null, cause: Throwable? = null) : StagehandException(message, cause) diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseRetryableException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandRetryableException.kt similarity index 85% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseRetryableException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandRetryableException.kt index 1754ee9..18b8aca 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseRetryableException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandRetryableException.kt @@ -9,7 +9,6 @@ package com.browserbase.api.errors * @param message A descriptive error message * @param cause The underlying cause of this exception, if any */ -class BrowserbaseRetryableException +class StagehandRetryableException @JvmOverloads -constructor(message: String? = null, cause: Throwable? = null) : - BrowserbaseException(message, cause) +constructor(message: String? = null, cause: Throwable? = null) : StagehandException(message, cause) diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseServiceException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandServiceException.kt similarity index 80% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseServiceException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandServiceException.kt index bb5c849..71ce4fa 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/BrowserbaseServiceException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/StagehandServiceException.kt @@ -5,9 +5,9 @@ package com.browserbase.api.errors import com.browserbase.api.core.JsonValue import com.browserbase.api.core.http.Headers -abstract class BrowserbaseServiceException +abstract class StagehandServiceException protected constructor(message: String, cause: Throwable? = null) : - BrowserbaseException(message, cause) { + StagehandException(message, cause) { abstract fun statusCode(): Int diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt index bdbd3ef..23ed90e 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnauthorizedException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class UnauthorizedException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - BrowserbaseServiceException("401: $body", cause) { + StagehandServiceException("401: $body", cause) { override fun statusCode(): Int = 401 diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt index 8b1a465..c375faa 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnexpectedStatusCodeException.kt @@ -14,7 +14,7 @@ private constructor( private val headers: Headers, private val body: JsonValue, cause: Throwable?, -) : BrowserbaseServiceException("$statusCode: $body", cause) { +) : StagehandServiceException("$statusCode: $body", cause) { override fun statusCode(): Int = statusCode diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt similarity index 97% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt index 6fc0a4c..a162609 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/errors/UnprocessableEntityException.kt @@ -10,7 +10,7 @@ import kotlin.jvm.optionals.getOrNull class UnprocessableEntityException private constructor(private val headers: Headers, private val body: JsonValue, cause: Throwable?) : - BrowserbaseServiceException("422: $body", cause) { + StagehandServiceException("422: $body", cause) { override fun statusCode(): Int = 422 diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt index fd113b6..d30a40b 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/Action.kt @@ -9,7 +9,7 @@ import com.browserbase.api.core.JsonValue import com.browserbase.api.core.checkKnown import com.browserbase.api.core.checkRequired import com.browserbase.api.core.toImmutable -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -48,7 +48,7 @@ private constructor( /** * Arguments for the method * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun arguments(): List = arguments.getRequired("arguments") @@ -56,7 +56,7 @@ private constructor( /** * Human-readable description of the action * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun description(): String = description.getRequired("description") @@ -64,7 +64,7 @@ private constructor( /** * Method to execute (e.g., "click", "fill") * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun method(): String = method.getRequired("method") @@ -72,7 +72,7 @@ private constructor( /** * CSS or XPath selector for the element * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun selector(): String = selector.getRequired("selector") @@ -80,7 +80,7 @@ private constructor( /** * CDP backend node ID * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun backendNodeId(): Optional = backendNodeId.getOptional("backendNodeId") @@ -308,7 +308,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt similarity index 93% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt index 51355b2..e08ebfa 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/ModelConfig.kt @@ -7,7 +7,7 @@ import com.browserbase.api.core.ExcludeMissing import com.browserbase.api.core.JsonField import com.browserbase.api.core.JsonMissing import com.browserbase.api.core.JsonValue -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -38,7 +38,7 @@ private constructor( /** * API key for the model provider * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun apiKey(): Optional = apiKey.getOptional("apiKey") @@ -46,7 +46,7 @@ private constructor( /** * Custom base URL for API * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun baseUrl(): Optional = baseUrl.getOptional("baseURL") @@ -54,13 +54,13 @@ private constructor( /** * Model name * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun provider(): Optional = provider.getOptional("provider") @@ -219,7 +219,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -303,7 +303,7 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known + * @throws StagehandInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = @@ -311,7 +311,7 @@ private constructor( OPENAI -> Known.OPENAI ANTHROPIC -> Known.ANTHROPIC GOOGLE -> Known.GOOGLE - else -> throw BrowserbaseInvalidDataException("Unknown Provider: $value") + else -> throw StagehandInvalidDataException("Unknown Provider: $value") } /** @@ -320,12 +320,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws BrowserbaseInvalidDataException if this class instance's value does not have the + * @throws StagehandInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - BrowserbaseInvalidDataException("Value is not a String") + StagehandInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -343,7 +343,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt similarity index 96% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt index 37b2123..34cae33 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActParams.kt @@ -16,7 +16,7 @@ import com.browserbase.api.core.getOrThrow import com.browserbase.api.core.http.Headers import com.browserbase.api.core.http.QueryParams import com.browserbase.api.core.toImmutable -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -53,7 +53,7 @@ private constructor( /** * Natural language instruction * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun input(): Input = body.input() @@ -61,13 +61,13 @@ private constructor( /** * Frame ID to act on (optional) * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun options(): Optional = body.options() @@ -372,7 +372,7 @@ private constructor( /** * Natural language instruction * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun input(): Input = input.getRequired("input") @@ -380,13 +380,13 @@ private constructor( /** * Frame ID to act on (optional) * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun options(): Optional = options.getOptional("options") @@ -551,7 +551,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -645,7 +645,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -709,10 +709,10 @@ private constructor( * version than the API, then the API may respond with new variants that the SDK is * unaware of. * - * @throws BrowserbaseInvalidDataException in the default implementation. + * @throws StagehandInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw BrowserbaseInvalidDataException("Unknown Input: $json") + throw StagehandInvalidDataException("Unknown Input: $json") } } @@ -782,7 +782,7 @@ private constructor( ) : this(model, timeout, variables, mutableMapOf()) /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") @@ -790,7 +790,7 @@ private constructor( /** * Timeout in milliseconds * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun timeout(): Optional = timeout.getOptional("timeout") @@ -798,7 +798,7 @@ private constructor( /** * Template variables for instruction * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun variables(): Optional = variables.getOptional("variables") @@ -940,7 +940,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -1030,7 +1030,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -1148,14 +1148,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known + * @throws StagehandInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") + else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -1164,12 +1164,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws BrowserbaseInvalidDataException if this class instance's value does not have the + * @throws StagehandInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - BrowserbaseInvalidDataException("Value is not a String") + StagehandInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1187,7 +1187,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt index f07a16d..69dfcab 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionActResponse.kt @@ -9,7 +9,7 @@ import com.browserbase.api.core.JsonValue import com.browserbase.api.core.checkKnown import com.browserbase.api.core.checkRequired import com.browserbase.api.core.toImmutable -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -39,7 +39,7 @@ private constructor( /** * Actions that were executed * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun actions(): List = actions.getRequired("actions") @@ -47,7 +47,7 @@ private constructor( /** * Result message * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun message(): String = message.getRequired("message") @@ -55,7 +55,7 @@ private constructor( /** * Whether the action succeeded * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun success(): Boolean = success.getRequired("success") @@ -231,7 +231,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndParams.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndParams.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndParams.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndParams.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt index dd40544..feba7d7 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionEndResponse.kt @@ -6,7 +6,7 @@ import com.browserbase.api.core.ExcludeMissing import com.browserbase.api.core.JsonField import com.browserbase.api.core.JsonMissing import com.browserbase.api.core.JsonValue -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -28,7 +28,7 @@ private constructor( ) : this(success, mutableMapOf()) /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun success(): Optional = success.getOptional("success") @@ -123,7 +123,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt index 570576f..d2c5c47 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParams.kt @@ -15,7 +15,7 @@ import com.browserbase.api.core.checkRequired import com.browserbase.api.core.getOrThrow import com.browserbase.api.core.http.Headers import com.browserbase.api.core.http.QueryParams -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -47,19 +47,19 @@ private constructor( fun xStreamResponse(): Optional = Optional.ofNullable(xStreamResponse) /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun agentConfig(): AgentConfig = body.agentConfig() /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun executeOptions(): ExecuteOptions = body.executeOptions() /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() @@ -368,19 +368,19 @@ private constructor( ) : this(agentConfig, executeOptions, frameId, mutableMapOf()) /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun agentConfig(): AgentConfig = agentConfig.getRequired("agentConfig") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun executeOptions(): ExecuteOptions = executeOptions.getRequired("executeOptions") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") @@ -549,7 +549,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -612,25 +612,25 @@ private constructor( /** * Enable Computer Use Agent mode * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun cua(): Optional = cua.getOptional("cua") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun provider(): Optional = provider.getOptional("provider") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun systemPrompt(): Optional = systemPrompt.getOptional("systemPrompt") @@ -801,7 +801,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -871,7 +871,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -935,10 +935,10 @@ private constructor( * version than the API, then the API may respond with new variants that the SDK is * unaware of. * - * @throws BrowserbaseInvalidDataException in the default implementation. + * @throws StagehandInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw BrowserbaseInvalidDataException("Unknown Model: $json") + throw StagehandInvalidDataException("Unknown Model: $json") } } @@ -1060,15 +1060,15 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and * don't want to throw for the unknown case. * - * @throws BrowserbaseInvalidDataException if this class instance's value is a not a - * known member. + * @throws StagehandInvalidDataException if this class instance's value is a not a known + * member. */ fun known(): Known = when (this) { OPENAI -> Known.OPENAI ANTHROPIC -> Known.ANTHROPIC GOOGLE -> Known.GOOGLE - else -> throw BrowserbaseInvalidDataException("Unknown Provider: $value") + else -> throw StagehandInvalidDataException("Unknown Provider: $value") } /** @@ -1077,12 +1077,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for * debugging and generally doesn't throw. * - * @throws BrowserbaseInvalidDataException if this class instance's value does not have + * @throws StagehandInvalidDataException if this class instance's value does not have * the expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - BrowserbaseInvalidDataException("Value is not a String") + StagehandInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1100,7 +1100,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -1171,7 +1171,7 @@ private constructor( /** * Task for the agent to complete * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun instruction(): String = instruction.getRequired("instruction") @@ -1179,7 +1179,7 @@ private constructor( /** * Visually highlight the cursor during actions * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun highlightCursor(): Optional = highlightCursor.getOptional("highlightCursor") @@ -1187,7 +1187,7 @@ private constructor( /** * Maximum number of steps the agent can take * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun maxSteps(): Optional = maxSteps.getOptional("maxSteps") @@ -1357,7 +1357,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -1462,14 +1462,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known + * @throws StagehandInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") + else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -1478,12 +1478,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws BrowserbaseInvalidDataException if this class instance's value does not have the + * @throws StagehandInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - BrowserbaseInvalidDataException("Value is not a String") + StagehandInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1501,7 +1501,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt index e126222..08afed9 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponse.kt @@ -8,7 +8,7 @@ import com.browserbase.api.core.JsonMissing import com.browserbase.api.core.JsonValue import com.browserbase.api.core.checkKnown import com.browserbase.api.core.toImmutable -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -35,7 +35,7 @@ private constructor( /** * Final message from the agent * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun message(): Optional = message.getOptional("message") @@ -43,7 +43,7 @@ private constructor( /** * Steps taken by the agent * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun steps(): Optional> = steps.getOptional("steps") @@ -179,7 +179,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt index 652ea48..3833673 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractParams.kt @@ -11,7 +11,7 @@ import com.browserbase.api.core.Params import com.browserbase.api.core.http.Headers import com.browserbase.api.core.http.QueryParams import com.browserbase.api.core.toImmutable -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -41,7 +41,7 @@ private constructor( /** * Frame ID to extract from * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() @@ -49,13 +49,13 @@ private constructor( /** * Natural language instruction for extraction * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun instruction(): Optional = body.instruction() /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun options(): Optional = body.options() @@ -63,7 +63,7 @@ private constructor( /** * JSON Schema for structured output * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun schema(): Optional = body.schema() @@ -374,7 +374,7 @@ private constructor( /** * Frame ID to extract from * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") @@ -382,13 +382,13 @@ private constructor( /** * Natural language instruction for extraction * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun instruction(): Optional = instruction.getOptional("instruction") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun options(): Optional = options.getOptional("options") @@ -396,7 +396,7 @@ private constructor( /** * JSON Schema for structured output * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun schema(): Optional = schema.getOptional("schema") @@ -562,7 +562,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -621,7 +621,7 @@ private constructor( ) : this(model, selector, timeout, mutableMapOf()) /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") @@ -629,13 +629,13 @@ private constructor( /** * Extract only from elements matching this selector * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun selector(): Optional = selector.getOptional("selector") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun timeout(): Optional = timeout.getOptional("timeout") @@ -774,7 +774,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -883,7 +883,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -979,14 +979,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known + * @throws StagehandInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") + else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -995,12 +995,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws BrowserbaseInvalidDataException if this class instance's value does not have the + * @throws StagehandInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - BrowserbaseInvalidDataException("Value is not a String") + StagehandInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1018,7 +1018,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt similarity index 96% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt index 2a8b52c..322d090 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt @@ -11,7 +11,7 @@ import com.browserbase.api.core.JsonValue import com.browserbase.api.core.allMaxBy import com.browserbase.api.core.getOrThrow import com.browserbase.api.core.toImmutable -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -87,7 +87,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -160,10 +160,10 @@ private constructor( * on an older version than the API, then the API may respond with new variants that the SDK * is unaware of. * - * @throws BrowserbaseInvalidDataException in the default implementation. + * @throws StagehandInvalidDataException in the default implementation. */ fun unknown(json: JsonValue?): T { - throw BrowserbaseInvalidDataException("Unknown SessionExtractResponse: $json") + throw StagehandInvalidDataException("Unknown SessionExtractResponse: $json") } } @@ -230,7 +230,7 @@ private constructor( ) : this(extraction, mutableMapOf()) /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun extraction(): Optional = extraction.getOptional("extraction") @@ -327,7 +327,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -428,7 +428,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt index f8dd95b..e57efd3 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateParams.kt @@ -11,7 +11,7 @@ import com.browserbase.api.core.Params import com.browserbase.api.core.checkRequired import com.browserbase.api.core.http.Headers import com.browserbase.api.core.http.QueryParams -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -38,19 +38,19 @@ private constructor( /** * URL to navigate to * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun url(): String = body.url() /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun options(): Optional = body.options() @@ -348,19 +348,19 @@ private constructor( /** * URL to navigate to * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun url(): String = url.getRequired("url") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun options(): Optional = options.getOptional("options") @@ -518,7 +518,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -573,7 +573,7 @@ private constructor( /** * When to consider navigation complete * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun waitUntil(): Optional = waitUntil.getOptional("waitUntil") @@ -671,7 +671,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -757,15 +757,15 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and * don't want to throw for the unknown case. * - * @throws BrowserbaseInvalidDataException if this class instance's value is a not a - * known member. + * @throws StagehandInvalidDataException if this class instance's value is a not a known + * member. */ fun known(): Known = when (this) { LOAD -> Known.LOAD DOMCONTENTLOADED -> Known.DOMCONTENTLOADED NETWORKIDLE -> Known.NETWORKIDLE - else -> throw BrowserbaseInvalidDataException("Unknown WaitUntil: $value") + else -> throw StagehandInvalidDataException("Unknown WaitUntil: $value") } /** @@ -774,12 +774,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for * debugging and generally doesn't throw. * - * @throws BrowserbaseInvalidDataException if this class instance's value does not have + * @throws StagehandInvalidDataException if this class instance's value does not have * the expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - BrowserbaseInvalidDataException("Value is not a String") + StagehandInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -797,7 +797,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -907,14 +907,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known + * @throws StagehandInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") + else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -923,12 +923,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws BrowserbaseInvalidDataException if this class instance's value does not have the + * @throws StagehandInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - BrowserbaseInvalidDataException("Value is not a String") + StagehandInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -946,7 +946,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt similarity index 94% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt index 28a15c2..50422bd 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponse.kt @@ -6,7 +6,7 @@ import com.browserbase.api.core.ExcludeMissing import com.browserbase.api.core.JsonField import com.browserbase.api.core.JsonMissing import com.browserbase.api.core.JsonValue -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -33,19 +33,19 @@ private constructor( ) : this(ok, status, url, mutableMapOf()) /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun ok(): Optional = ok.getOptional("ok") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun status(): Optional = status.getOptional("status") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun url(): Optional = url.getOptional("url") @@ -180,7 +180,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt index 802e3ea..0d67973 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionObserveParams.kt @@ -10,7 +10,7 @@ import com.browserbase.api.core.JsonValue import com.browserbase.api.core.Params import com.browserbase.api.core.http.Headers import com.browserbase.api.core.http.QueryParams -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -40,7 +40,7 @@ private constructor( /** * Frame ID to observe * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun frameId(): Optional = body.frameId() @@ -48,13 +48,13 @@ private constructor( /** * Natural language instruction to filter actions * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun instruction(): Optional = body.instruction() /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun options(): Optional = body.options() @@ -344,7 +344,7 @@ private constructor( /** * Frame ID to observe * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun frameId(): Optional = frameId.getOptional("frameId") @@ -352,13 +352,13 @@ private constructor( /** * Natural language instruction to filter actions * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun instruction(): Optional = instruction.getOptional("instruction") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun options(): Optional = options.getOptional("options") @@ -502,7 +502,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -559,7 +559,7 @@ private constructor( ) : this(model, selector, timeout, mutableMapOf()) /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") @@ -567,13 +567,13 @@ private constructor( /** * Observe only elements matching this selector * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun selector(): Optional = selector.getOptional("selector") /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun timeout(): Optional = timeout.getOptional("timeout") @@ -712,7 +712,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -817,14 +817,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known + * @throws StagehandInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { TRUE -> Known.TRUE FALSE -> Known.FALSE - else -> throw BrowserbaseInvalidDataException("Unknown XStreamResponse: $value") + else -> throw StagehandInvalidDataException("Unknown XStreamResponse: $value") } /** @@ -833,12 +833,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws BrowserbaseInvalidDataException if this class instance's value does not have the + * @throws StagehandInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - BrowserbaseInvalidDataException("Value is not a String") + StagehandInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -856,7 +856,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt similarity index 94% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt index 22ad279..011f19c 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt @@ -11,7 +11,7 @@ import com.browserbase.api.core.Params import com.browserbase.api.core.checkRequired import com.browserbase.api.core.http.Headers import com.browserbase.api.core.http.QueryParams -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -35,7 +35,7 @@ private constructor( /** * Environment to run the browser in * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun env(): Env = body.env() @@ -43,7 +43,7 @@ private constructor( /** * API key for Browserbase (required when env=BROWSERBASE) * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun apiKey(): Optional = body.apiKey() @@ -51,7 +51,7 @@ private constructor( /** * Timeout in ms to wait for DOM to settle * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun domSettleTimeout(): Optional = body.domSettleTimeout() @@ -59,7 +59,7 @@ private constructor( /** * Options for local browser launch * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun localBrowserLaunchOptions(): Optional = @@ -68,7 +68,7 @@ private constructor( /** * AI model to use for actions * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun model(): Optional = body.model() @@ -76,7 +76,7 @@ private constructor( /** * Project ID for Browserbase (required when env=BROWSERBASE) * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun projectId(): Optional = body.projectId() @@ -84,7 +84,7 @@ private constructor( /** * Enable self-healing for failed actions * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun selfHeal(): Optional = body.selfHeal() @@ -92,7 +92,7 @@ private constructor( /** * Custom system prompt for AI actions * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun systemPrompt(): Optional = body.systemPrompt() @@ -100,7 +100,7 @@ private constructor( /** * Logging verbosity level * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun verbose(): Optional = body.verbose() @@ -532,7 +532,7 @@ private constructor( /** * Environment to run the browser in * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun env(): Env = env.getRequired("env") @@ -540,7 +540,7 @@ private constructor( /** * API key for Browserbase (required when env=BROWSERBASE) * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun apiKey(): Optional = apiKey.getOptional("apiKey") @@ -548,7 +548,7 @@ private constructor( /** * Timeout in ms to wait for DOM to settle * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun domSettleTimeout(): Optional = domSettleTimeout.getOptional("domSettleTimeout") @@ -556,7 +556,7 @@ private constructor( /** * Options for local browser launch * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun localBrowserLaunchOptions(): Optional = @@ -565,7 +565,7 @@ private constructor( /** * AI model to use for actions * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") @@ -573,7 +573,7 @@ private constructor( /** * Project ID for Browserbase (required when env=BROWSERBASE) * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun projectId(): Optional = projectId.getOptional("projectId") @@ -581,7 +581,7 @@ private constructor( /** * Enable self-healing for failed actions * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun selfHeal(): Optional = selfHeal.getOptional("selfHeal") @@ -589,7 +589,7 @@ private constructor( /** * Custom system prompt for AI actions * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun systemPrompt(): Optional = systemPrompt.getOptional("systemPrompt") @@ -597,7 +597,7 @@ private constructor( /** * Logging verbosity level * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun verbose(): Optional = verbose.getOptional("verbose") @@ -914,7 +914,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -1039,14 +1039,14 @@ private constructor( * Use the [value] method instead if you're uncertain the value is always known and don't * want to throw for the unknown case. * - * @throws BrowserbaseInvalidDataException if this class instance's value is a not a known + * @throws StagehandInvalidDataException if this class instance's value is a not a known * member. */ fun known(): Known = when (this) { LOCAL -> Known.LOCAL BROWSERBASE -> Known.BROWSERBASE - else -> throw BrowserbaseInvalidDataException("Unknown Env: $value") + else -> throw StagehandInvalidDataException("Unknown Env: $value") } /** @@ -1055,12 +1055,12 @@ private constructor( * This differs from the [toString] method because that method is primarily for debugging * and generally doesn't throw. * - * @throws BrowserbaseInvalidDataException if this class instance's value does not have the + * @throws StagehandInvalidDataException if this class instance's value does not have the * expected primitive type. */ fun asString(): String = _value().asString().orElseThrow { - BrowserbaseInvalidDataException("Value is not a String") + StagehandInvalidDataException("Value is not a String") } private var validated: Boolean = false @@ -1078,7 +1078,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } @@ -1119,7 +1119,7 @@ private constructor( ) : this(headless, mutableMapOf()) /** - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun headless(): Optional = headless.getOptional("headless") @@ -1218,7 +1218,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt similarity index 95% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt index 152fc44..2e71372 100644 --- a/browserbase-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartResponse.kt @@ -7,7 +7,7 @@ import com.browserbase.api.core.JsonField import com.browserbase.api.core.JsonMissing import com.browserbase.api.core.JsonValue import com.browserbase.api.core.checkRequired -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.annotation.JsonAnyGetter import com.fasterxml.jackson.annotation.JsonAnySetter import com.fasterxml.jackson.annotation.JsonCreator @@ -32,7 +32,7 @@ private constructor( /** * Whether the session is ready to use * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun available(): Boolean = available.getRequired("available") @@ -40,7 +40,7 @@ private constructor( /** * Unique identifier for the session * - * @throws BrowserbaseInvalidDataException if the JSON field has an unexpected type or is + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ fun sessionId(): String = sessionId.getRequired("sessionId") @@ -179,7 +179,7 @@ private constructor( try { validate() true - } catch (e: BrowserbaseInvalidDataException) { + } catch (e: StagehandInvalidDataException) { false } diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsync.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsync.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsync.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsync.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsyncImpl.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsyncImpl.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsyncImpl.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/services/async/SessionServiceAsyncImpl.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionService.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionService.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionService.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionService.kt diff --git a/browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionServiceImpl.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionServiceImpl.kt similarity index 100% rename from browserbase-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionServiceImpl.kt rename to stagehand-java-core/src/main/kotlin/com/browserbase/api/services/blocking/SessionServiceImpl.kt diff --git a/browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro b/stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro similarity index 100% rename from browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro rename to stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/TestServerExtension.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/TestServerExtension.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/TestServerExtension.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/TestServerExtension.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ObjectMappersTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ObjectMappersTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ObjectMappersTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ObjectMappersTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/PhantomReachableTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/PhantomReachableTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/core/PhantomReachableTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/core/PhantomReachableTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/UtilsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/UtilsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/core/UtilsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/core/UtilsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ValuesTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ValuesTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/core/ValuesTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ValuesTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/AsyncStreamResponseTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/http/AsyncStreamResponseTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/AsyncStreamResponseTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/core/http/AsyncStreamResponseTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/HeadersTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/http/HeadersTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/HeadersTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/core/http/HeadersTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/QueryParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/http/QueryParamsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/QueryParamsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/core/http/QueryParamsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt similarity index 98% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt index 3275b09..b3fbe9b 100644 --- a/browserbase-java-core/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/http/RetryingHttpClientTest.kt @@ -3,7 +3,7 @@ package com.browserbase.api.core.http import com.browserbase.api.client.okhttp.OkHttpClient import com.browserbase.api.core.RequestOptions import com.browserbase.api.core.Sleeper -import com.browserbase.api.errors.BrowserbaseRetryableException +import com.browserbase.api.errors.StagehandRetryableException import com.github.tomakehurst.wiremock.client.WireMock.* import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest @@ -267,7 +267,7 @@ internal class RetryingHttpClientTest { ): HttpResponse { callCount++ if (callCount == 1) { - throw BrowserbaseRetryableException("Simulated retryable failure") + throw StagehandRetryableException("Simulated retryable failure") } return httpClient.execute(request, requestOptions) } @@ -280,7 +280,7 @@ internal class RetryingHttpClientTest { if (callCount == 1) { val future = CompletableFuture() future.completeExceptionally( - BrowserbaseRetryableException("Simulated retryable failure") + StagehandRetryableException("Simulated retryable failure") ) return future } diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ActionTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ActionTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ActionTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ActionTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ModelConfigTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ModelConfigTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ModelConfigTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/ModelConfigTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActParamsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActParamsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActParamsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActResponseTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActResponseTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActResponseTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionActResponseTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndParamsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndParamsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndParamsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndResponseTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndResponseTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndResponseTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionEndResponseTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParamsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParamsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentParamsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponseTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponseTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponseTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExecuteAgentResponseTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractParamsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractParamsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractParamsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt similarity index 95% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt index c11f3f5..2bd928d 100644 --- a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt @@ -4,7 +4,7 @@ package com.browserbase.api.models.sessions import com.browserbase.api.core.JsonValue import com.browserbase.api.core.jsonMapper -import com.browserbase.api.errors.BrowserbaseInvalidDataException +import com.browserbase.api.errors.StagehandInvalidDataException import com.fasterxml.jackson.module.kotlin.jacksonTypeRef import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -88,7 +88,7 @@ internal class SessionExtractResponseTest { val sessionExtractResponse = jsonMapper().convertValue(testCase.value, jacksonTypeRef()) - val e = assertThrows { sessionExtractResponse.validate() } + val e = assertThrows { sessionExtractResponse.validate() } assertThat(e).hasMessageStartingWith("Unknown ") } } diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateParamsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateParamsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateParamsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponseTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponseTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponseTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionNavigateResponseTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionObserveParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionObserveParamsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionObserveParamsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionObserveParamsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartResponseTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartResponseTest.kt similarity index 100% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartResponseTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartResponseTest.kt diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt similarity index 98% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt index d9c176d..1a59424 100644 --- a/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt @@ -2,17 +2,17 @@ package com.browserbase.api.services -import com.browserbase.api.client.BrowserbaseClient -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient +import com.browserbase.api.client.StagehandClient +import com.browserbase.api.client.okhttp.StagehandOkHttpClient import com.browserbase.api.core.JsonValue import com.browserbase.api.core.http.Headers import com.browserbase.api.core.jsonMapper import com.browserbase.api.errors.BadRequestException -import com.browserbase.api.errors.BrowserbaseException import com.browserbase.api.errors.InternalServerException import com.browserbase.api.errors.NotFoundException import com.browserbase.api.errors.PermissionDeniedException import com.browserbase.api.errors.RateLimitException +import com.browserbase.api.errors.StagehandException import com.browserbase.api.errors.UnauthorizedException import com.browserbase.api.errors.UnexpectedStatusCodeException import com.browserbase.api.errors.UnprocessableEntityException @@ -47,12 +47,12 @@ internal class ErrorHandlingTest { private const val NOT_JSON: String = "Not JSON" } - private lateinit var client: BrowserbaseClient + private lateinit var client: StagehandClient @BeforeEach fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { client = - BrowserbaseOkHttpClient.builder() + StagehandOkHttpClient.builder() .baseUrl(wmRuntimeInfo.httpBaseUrl) .apiKey("My API Key") .build() @@ -643,7 +643,7 @@ internal class ErrorHandlingTest { ) val e = - assertThrows { + assertThrows { sessionService.start( SessionStartParams.builder() .env(SessionStartParams.Env.LOCAL) diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt similarity index 92% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt index 1fdec72..d02d7c6 100644 --- a/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt @@ -2,8 +2,8 @@ package com.browserbase.api.services -import com.browserbase.api.client.BrowserbaseClient -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient +import com.browserbase.api.client.StagehandClient +import com.browserbase.api.client.okhttp.StagehandOkHttpClient import com.browserbase.api.core.JsonValue import com.browserbase.api.models.sessions.SessionStartParams import com.github.tomakehurst.wiremock.client.WireMock.anyUrl @@ -25,12 +25,12 @@ import org.junit.jupiter.api.parallel.ResourceLock @ResourceLock("https://github.com/wiremock/wiremock/issues/169") internal class ServiceParamsTest { - private lateinit var client: BrowserbaseClient + private lateinit var client: StagehandClient @BeforeEach fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { client = - BrowserbaseOkHttpClient.builder() + StagehandOkHttpClient.builder() .baseUrl(wmRuntimeInfo.httpBaseUrl) .apiKey("My API Key") .build() diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt similarity index 95% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt index 64260cb..12cedb1 100644 --- a/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt @@ -3,7 +3,7 @@ package com.browserbase.api.services.async import com.browserbase.api.TestServerExtension -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClientAsync +import com.browserbase.api.client.okhttp.StagehandOkHttpClientAsync import com.browserbase.api.core.JsonValue import com.browserbase.api.models.sessions.ModelConfig import com.browserbase.api.models.sessions.SessionActParams @@ -24,7 +24,7 @@ internal class SessionServiceAsyncTest { @Test fun act() { val client = - BrowserbaseOkHttpClientAsync.builder() + StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -66,7 +66,7 @@ internal class SessionServiceAsyncTest { @Test fun end() { val client = - BrowserbaseOkHttpClientAsync.builder() + StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -82,7 +82,7 @@ internal class SessionServiceAsyncTest { @Test fun executeAgent() { val client = - BrowserbaseOkHttpClientAsync.builder() + StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -120,7 +120,7 @@ internal class SessionServiceAsyncTest { @Test fun extract() { val client = - BrowserbaseOkHttpClientAsync.builder() + StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -163,7 +163,7 @@ internal class SessionServiceAsyncTest { @Test fun navigate() { val client = - BrowserbaseOkHttpClientAsync.builder() + StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -193,7 +193,7 @@ internal class SessionServiceAsyncTest { @Test fun observe() { val client = - BrowserbaseOkHttpClientAsync.builder() + StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -231,7 +231,7 @@ internal class SessionServiceAsyncTest { @Test fun start() { val client = - BrowserbaseOkHttpClientAsync.builder() + StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() diff --git a/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt similarity index 95% rename from browserbase-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt rename to stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt index cbd77b3..bc2c422 100644 --- a/browserbase-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt @@ -3,7 +3,7 @@ package com.browserbase.api.services.blocking import com.browserbase.api.TestServerExtension -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient +import com.browserbase.api.client.okhttp.StagehandOkHttpClient import com.browserbase.api.core.JsonValue import com.browserbase.api.models.sessions.ModelConfig import com.browserbase.api.models.sessions.SessionActParams @@ -24,7 +24,7 @@ internal class SessionServiceTest { @Test fun act() { val client = - BrowserbaseOkHttpClient.builder() + StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -65,7 +65,7 @@ internal class SessionServiceTest { @Test fun end() { val client = - BrowserbaseOkHttpClient.builder() + StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -80,7 +80,7 @@ internal class SessionServiceTest { @Test fun executeAgent() { val client = - BrowserbaseOkHttpClient.builder() + StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -117,7 +117,7 @@ internal class SessionServiceTest { @Test fun extract() { val client = - BrowserbaseOkHttpClient.builder() + StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -159,7 +159,7 @@ internal class SessionServiceTest { @Test fun navigate() { val client = - BrowserbaseOkHttpClient.builder() + StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -188,7 +188,7 @@ internal class SessionServiceTest { @Test fun observe() { val client = - BrowserbaseOkHttpClient.builder() + StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() @@ -225,7 +225,7 @@ internal class SessionServiceTest { @Test fun start() { val client = - BrowserbaseOkHttpClient.builder() + StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) .apiKey("My API Key") .build() diff --git a/browserbase-java-proguard-test/build.gradle.kts b/stagehand-java-proguard-test/build.gradle.kts similarity index 90% rename from browserbase-java-proguard-test/build.gradle.kts rename to stagehand-java-proguard-test/build.gradle.kts index 4226829..9641bb2 100644 --- a/browserbase-java-proguard-test/build.gradle.kts +++ b/stagehand-java-proguard-test/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("browserbase.kotlin") + id("stagehand.kotlin") id("com.gradleup.shadow") version "8.3.8" } @@ -15,7 +15,7 @@ buildscript { } dependencies { - testImplementation(project(":browserbase-java")) + testImplementation(project(":stagehand-java")) testImplementation(kotlin("test")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") testImplementation("org.assertj:assertj-core:3.25.3") @@ -51,7 +51,7 @@ val proguardJar by tasks.registering(proguard.gradle.ProGuardTask::class) { } configuration("./test.pro") - configuration("../browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro") + configuration("../stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro") } val testProGuard by tasks.registering(JavaExec::class) { @@ -78,7 +78,7 @@ val r8Jar by tasks.registering(JavaExec::class) { "--output", r8JarPath, "--lib", System.getProperty("java.home"), "--pg-conf", "./test.pro", - "--pg-conf", "../browserbase-java-core/src/main/resources/META-INF/proguard/browserbase-java-core.pro", + "--pg-conf", "../stagehand-java-core/src/main/resources/META-INF/proguard/stagehand-java-core.pro", "--pg-map-output", "${layout.buildDirectory.get()}/r8-mapping.txt", tasks.shadowJar.get().archiveFile.get().asFile.absolutePath, ) diff --git a/browserbase-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt b/stagehand-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt similarity index 93% rename from browserbase-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt rename to stagehand-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt index 73126fc..2ac121d 100644 --- a/browserbase-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt +++ b/stagehand-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt @@ -2,7 +2,7 @@ package com.browserbase.api.proguard -import com.browserbase.api.client.okhttp.BrowserbaseOkHttpClient +import com.browserbase.api.client.okhttp.StagehandOkHttpClient import com.browserbase.api.core.jsonMapper import com.browserbase.api.models.sessions.Action import com.browserbase.api.models.sessions.SessionExtractResponse @@ -38,14 +38,14 @@ internal class ProGuardCompatibilityTest { @Test fun proguardRules() { val rulesFile = - javaClass.classLoader.getResourceAsStream("META-INF/proguard/browserbase-java-core.pro") + javaClass.classLoader.getResourceAsStream("META-INF/proguard/stagehand-java-core.pro") assertThat(rulesFile).isNotNull() } @Test fun client() { - val client = BrowserbaseOkHttpClient.builder().apiKey("My API Key").build() + val client = StagehandOkHttpClient.builder().apiKey("My API Key").build() assertThat(client).isNotNull() assertThat(client.sessions()).isNotNull() diff --git a/browserbase-java-proguard-test/test.pro b/stagehand-java-proguard-test/test.pro similarity index 100% rename from browserbase-java-proguard-test/test.pro rename to stagehand-java-proguard-test/test.pro diff --git a/browserbase-java/build.gradle.kts b/stagehand-java/build.gradle.kts similarity index 85% rename from browserbase-java/build.gradle.kts rename to stagehand-java/build.gradle.kts index 86b7f8c..6d32486 100644 --- a/browserbase-java/build.gradle.kts +++ b/stagehand-java/build.gradle.kts @@ -1,10 +1,10 @@ plugins { - id("browserbase.kotlin") - id("browserbase.publish") + id("stagehand.kotlin") + id("stagehand.publish") } dependencies { - api(project(":browserbase-java-client-okhttp")) + api(project(":stagehand-java-client-okhttp")) } // Redefine `dokkaJavadoc` to: From 5787da654a785904d9629e20baa9dc90739a35a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:21:27 +0000 Subject: [PATCH 05/14] feat(api): manual updates --- .stats.yml | 6 +++--- buildSrc/src/main/kotlin/stagehand.publish.gradle.kts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8741890..c128648 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-0c12f985340be2a9287e8e01ff8733f7f2d02e019149d1ae95f1a8f8798c6690.yml -openapi_spec_hash: efb79934e1dc63763dd4e8493b825273 -config_hash: 1de7cb9bd4dc46fe3e20b637bc534908 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-cacb08bfd03b2d325b80318fc3f12bc7da16f229c21e9bd86050fff4ef7c67f7.yml +openapi_spec_hash: 21dc2123dc758a738591bf914410041a +config_hash: bb7561632c1f66c2b9efca06f438f904 diff --git a/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts b/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts index 9f64944..97e7bfb 100644 --- a/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts @@ -9,8 +9,8 @@ configure { from(components["java"]) pom { - name.set("Stagehand P2P Server API") - description.set("HTTP API for remote Stagehand browser automation. This API allows clients to\nconnect to a Stagehand server and execute browser automation tasks remotely.\n\nAll endpoints except /sessions/start require an active session ID. Responses are\nstreamed using Server-Sent Events (SSE) when the `x-stream-response: true`\nheader is provided.") + name.set("Stagehand API") + description.set("Stagehand SDK for AI browser automation. This API allows clients to execute\nbrowser automation tasks remotely on the Browserbase cloud.\n\nAll endpoints except /sessions/start require an active session ID. Responses are\nstreamed using Server-Sent Events (SSE) when the `x-stream-response: true`\nheader is provided.") url.set("https://docs.stagehand.dev") licenses { From afa389f483845081daf43d102094e902c847efa5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:28:09 +0000 Subject: [PATCH 06/14] feat(api): manual updates --- .stats.yml | 4 ++-- buildSrc/src/main/kotlin/stagehand.publish.gradle.kts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index c128648..a06fa53 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-cacb08bfd03b2d325b80318fc3f12bc7da16f229c21e9bd86050fff4ef7c67f7.yml -openapi_spec_hash: 21dc2123dc758a738591bf914410041a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-09064f4021f94fb1b1bd86ce496d998318276b61bbc24de4728ecdb5763847ef.yml +openapi_spec_hash: 911d0631010b372890f98545a038cfb5 config_hash: bb7561632c1f66c2b9efca06f438f904 diff --git a/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts b/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts index 97e7bfb..7b0ce3f 100644 --- a/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/stagehand.publish.gradle.kts @@ -10,7 +10,7 @@ configure { pom { name.set("Stagehand API") - description.set("Stagehand SDK for AI browser automation. This API allows clients to execute\nbrowser automation tasks remotely on the Browserbase cloud.\n\nAll endpoints except /sessions/start require an active session ID. Responses are\nstreamed using Server-Sent Events (SSE) when the `x-stream-response: true`\nheader is provided.") + description.set("Stagehand SDK for AI browser automation [ALPHA]. This API allows clients to\nexecute browser automation tasks remotely on the Browserbase cloud.\n\nAll endpoints except /sessions/start require an active session ID. Responses are\nstreamed using Server-Sent Events (SSE) when the `x-stream-response: true`\nheader is provided.\n\nThis SDK is currently ALPHA software and is not production ready! Please try it\nand give us your feedback, stay tuned for upcoming release announcements!") url.set("https://docs.stagehand.dev") licenses { From 2262f19462ce4e79f80df49c7652e3144c11c9c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:39:07 +0000 Subject: [PATCH 07/14] feat(api): manual updates --- .stats.yml | 6 +- README.md | 83 +-- .../api/models/sessions/SessionStartParams.kt | 621 ++++-------------- .../models/sessions/SessionStartParamsTest.kt | 32 +- .../api/services/ErrorHandlingTest.kt | 170 +---- .../api/services/ServiceParamsTest.kt | 54 +- .../services/async/SessionServiceAsyncTest.kt | 10 +- .../services/blocking/SessionServiceTest.kt | 10 +- 8 files changed, 261 insertions(+), 725 deletions(-) diff --git a/.stats.yml b/.stats.yml index a06fa53..4664845 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-09064f4021f94fb1b1bd86ce496d998318276b61bbc24de4728ecdb5763847ef.yml -openapi_spec_hash: 911d0631010b372890f98545a038cfb5 -config_hash: bb7561632c1f66c2b9efca06f438f904 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-6a22863a7da4fa45f904657a4cb8fc1a28e236925f03dc94fca25fd8271ca6db.yml +openapi_spec_hash: d5c6108942ad79f39ea4ff1bee9b7996 +config_hash: 2f1ec44e7e07906e07bdc6e075763da9 diff --git a/README.md b/README.md index 8453788..a71554c 100644 --- a/README.md +++ b/README.md @@ -48,17 +48,18 @@ This library requires Java 8 or later. ```java import com.browserbase.api.client.StagehandClient; import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -import com.browserbase.api.models.sessions.SessionStartParams; -import com.browserbase.api.models.sessions.SessionStartResponse; +import com.browserbase.api.models.sessions.SessionActParams; +import com.browserbase.api.models.sessions.SessionActResponse; // Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties // Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables StagehandClient client = StagehandOkHttpClient.fromEnv(); -SessionStartParams params = SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) +SessionActParams params = SessionActParams.builder() + .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .input("click the first link on the page") .build(); -SessionStartResponse response = client.sessions().start(params); +SessionActResponse response = client.sessions().act(params); ``` ## Client configuration @@ -131,7 +132,7 @@ The `withOptions()` method does not affect the original client or service. To send a request to the Stagehand API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class. -For example, `client.sessions().start(...)` should be called with an instance of `SessionStartParams`, and it will return an instance of `SessionStartResponse`. +For example, `client.sessions().act(...)` should be called with an instance of `SessionActParams`, and it will return an instance of `SessionActResponse`. ## Immutability @@ -148,18 +149,19 @@ The default client is synchronous. To switch to asynchronous execution, call the ```java import com.browserbase.api.client.StagehandClient; import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -import com.browserbase.api.models.sessions.SessionStartParams; -import com.browserbase.api.models.sessions.SessionStartResponse; +import com.browserbase.api.models.sessions.SessionActParams; +import com.browserbase.api.models.sessions.SessionActResponse; import java.util.concurrent.CompletableFuture; // Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties // Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables StagehandClient client = StagehandOkHttpClient.fromEnv(); -SessionStartParams params = SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) +SessionActParams params = SessionActParams.builder() + .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .input("click the first link on the page") .build(); -CompletableFuture response = client.async().sessions().start(params); +CompletableFuture response = client.async().sessions().act(params); ``` Or create an asynchronous client from the beginning: @@ -167,18 +169,19 @@ Or create an asynchronous client from the beginning: ```java import com.browserbase.api.client.StagehandClientAsync; import com.browserbase.api.client.okhttp.StagehandOkHttpClientAsync; -import com.browserbase.api.models.sessions.SessionStartParams; -import com.browserbase.api.models.sessions.SessionStartResponse; +import com.browserbase.api.models.sessions.SessionActParams; +import com.browserbase.api.models.sessions.SessionActResponse; import java.util.concurrent.CompletableFuture; // Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties // Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables StagehandClientAsync client = StagehandOkHttpClientAsync.fromEnv(); -SessionStartParams params = SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) +SessionActParams params = SessionActParams.builder() + .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .input("click the first link on the page") .build(); -CompletableFuture response = client.sessions().start(params); +CompletableFuture response = client.sessions().act(params); ``` The asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s. @@ -196,7 +199,8 @@ import com.browserbase.api.models.sessions.SessionStartParams; import com.browserbase.api.models.sessions.SessionStartResponse; SessionStartParams params = SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .build(); HttpResponseFor response = client.sessions().withRawResponse().start(params); @@ -427,9 +431,9 @@ To set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQu ```java import com.browserbase.api.core.JsonValue; -import com.browserbase.api.models.sessions.SessionStartParams; +import com.browserbase.api.models.sessions.SessionActParams; -SessionStartParams params = SessionStartParams.builder() +SessionActParams params = SessionActParams.builder() .putAdditionalHeader("Secret-Header", "42") .putAdditionalQueryParam("secret_query_param", "42") .putAdditionalBodyProperty("secretProperty", JsonValue.from("42")) @@ -442,10 +446,10 @@ To set undocumented parameters on _nested_ headers, query params, or body classe ```java import com.browserbase.api.core.JsonValue; -import com.browserbase.api.models.sessions.SessionStartParams; +import com.browserbase.api.models.sessions.SessionActParams; -SessionStartParams params = SessionStartParams.builder() - .localBrowserLaunchOptions(SessionStartParams.LocalBrowserLaunchOptions.builder() +SessionActParams params = SessionActParams.builder() + .options(SessionActParams.Options.builder() .putAdditionalProperty("secretProperty", JsonValue.from("42")) .build()) .build(); @@ -457,10 +461,10 @@ To set a documented parameter or property to an undocumented or not yet supporte ```java import com.browserbase.api.core.JsonValue; -import com.browserbase.api.models.sessions.SessionStartParams; +import com.browserbase.api.models.sessions.SessionActParams; -SessionStartParams params = SessionStartParams.builder() - .env(JsonValue.from(42)) +SessionActParams params = SessionActParams.builder() + .input(JsonValue.from(42)) .build(); ``` @@ -509,10 +513,11 @@ To forcibly omit a required parameter or property, pass [`JsonMissing`](stagehan ```java import com.browserbase.api.core.JsonMissing; -import com.browserbase.api.models.sessions.SessionStartParams; +import com.browserbase.api.models.sessions.SessionActParams; -SessionStartParams params = SessionStartParams.builder() - .env(JsonMissing.of()) +SessionActParams params = SessionActParams.builder() + .input("click the sign in button") + .sessionId(JsonMissing.of()) .build(); ``` @@ -524,7 +529,7 @@ To access undocumented response properties, call the `_additionalProperties()` m import com.browserbase.api.core.JsonValue; import java.util.Map; -Map additionalProperties = client.sessions().start(params)._additionalProperties(); +Map additionalProperties = client.sessions().act(params)._additionalProperties(); JsonValue secretPropertyValue = additionalProperties.get("secretProperty"); String result = secretPropertyValue.accept(new JsonValue.Visitor<>() { @@ -552,22 +557,22 @@ To access a property's raw JSON value, which may be undocumented, call its `_` p ```java import com.browserbase.api.core.JsonField; -import com.browserbase.api.models.sessions.SessionStartParams; +import com.browserbase.api.models.sessions.SessionActParams; import java.util.Optional; -JsonField env = client.sessions().start(params)._env(); +JsonField input = client.sessions().act(params)._input(); -if (env.isMissing()) { +if (input.isMissing()) { // The property is absent from the JSON response -} else if (env.isNull()) { +} else if (input.isNull()) { // The property was set to literal null } else { // Check if value was provided as a string // Other methods include `asNumber()`, `asBoolean()`, etc. - Optional jsonString = env.asString(); + Optional jsonString = input.asString(); // Try to deserialize into a custom type - MyClass myObject = env.asUnknown().orElseThrow().convert(MyClass.class); + MyClass myObject = input.asUnknown().orElseThrow().convert(MyClass.class); } ``` @@ -580,17 +585,17 @@ By default, the SDK will not throw an exception in this case. It will throw [`St If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`: ```java -import com.browserbase.api.models.sessions.SessionStartResponse; +import com.browserbase.api.models.sessions.SessionActResponse; -SessionStartResponse response = client.sessions().start(params).validate(); +SessionActResponse response = client.sessions().act(params).validate(); ``` Or configure the method call to validate the response using the `responseValidation` method: ```java -import com.browserbase.api.models.sessions.SessionStartResponse; +import com.browserbase.api.models.sessions.SessionActResponse; -SessionStartResponse response = client.sessions().start( +SessionActResponse response = client.sessions().act( params, RequestOptions.builder().responseValidation(true).build() ); ``` diff --git a/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt index 011f19c..cda3e99 100644 --- a/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionStartParams.kt @@ -2,7 +2,6 @@ package com.browserbase.api.models.sessions -import com.browserbase.api.core.Enum import com.browserbase.api.core.ExcludeMissing import com.browserbase.api.core.JsonField import com.browserbase.api.core.JsonMissing @@ -19,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import java.util.Collections import java.util.Objects import java.util.Optional -import kotlin.jvm.optionals.getOrNull /** * Initializes a new Stagehand session with a browser instance. Returns a session ID that must be @@ -33,20 +31,20 @@ private constructor( ) : Params { /** - * Environment to run the browser in + * API key for Browserbase Cloud * * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun env(): Env = body.env() + fun browserbaseApiKey(): String = body.browserbaseApiKey() /** - * API key for Browserbase (required when env=BROWSERBASE) + * Project ID for Browserbase * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun apiKey(): Optional = body.apiKey() + fun browserbaseProjectId(): String = body.browserbaseProjectId() /** * Timeout in ms to wait for DOM to settle @@ -57,30 +55,13 @@ private constructor( fun domSettleTimeout(): Optional = body.domSettleTimeout() /** - * Options for local browser launch - * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun localBrowserLaunchOptions(): Optional = - body.localBrowserLaunchOptions() - - /** - * AI model to use for actions + * AI model to use for actions (must be prefixed with provider/) * * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ fun model(): Optional = body.model() - /** - * Project ID for Browserbase (required when env=BROWSERBASE) - * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun projectId(): Optional = body.projectId() - /** * Enable self-healing for failed actions * @@ -106,18 +87,20 @@ private constructor( fun verbose(): Optional = body.verbose() /** - * Returns the raw JSON value of [env]. + * Returns the raw JSON value of [browserbaseApiKey]. * - * Unlike [env], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [browserbaseApiKey], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun _env(): JsonField = body._env() + fun _browserbaseApiKey(): JsonField = body._browserbaseApiKey() /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [browserbaseProjectId]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [browserbaseProjectId], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun _apiKey(): JsonField = body._apiKey() + fun _browserbaseProjectId(): JsonField = body._browserbaseProjectId() /** * Returns the raw JSON value of [domSettleTimeout]. @@ -127,15 +110,6 @@ private constructor( */ fun _domSettleTimeout(): JsonField = body._domSettleTimeout() - /** - * Returns the raw JSON value of [localBrowserLaunchOptions]. - * - * Unlike [localBrowserLaunchOptions], this method doesn't throw if the JSON field has an - * unexpected type. - */ - fun _localBrowserLaunchOptions(): JsonField = - body._localBrowserLaunchOptions() - /** * Returns the raw JSON value of [model]. * @@ -143,13 +117,6 @@ private constructor( */ fun _model(): JsonField = body._model() - /** - * Returns the raw JSON value of [projectId]. - * - * Unlike [projectId], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _projectId(): JsonField = body._projectId() - /** * Returns the raw JSON value of [selfHeal]. * @@ -188,7 +155,8 @@ private constructor( * * The following fields are required: * ```java - * .env() + * .browserbaseApiKey() + * .browserbaseProjectId() * ``` */ @JvmStatic fun builder() = Builder() @@ -213,36 +181,46 @@ private constructor( * * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: - * - [env] - * - [apiKey] + * - [browserbaseApiKey] + * - [browserbaseProjectId] * - [domSettleTimeout] - * - [localBrowserLaunchOptions] * - [model] + * - [selfHeal] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } - /** Environment to run the browser in */ - fun env(env: Env) = apply { body.env(env) } + /** API key for Browserbase Cloud */ + fun browserbaseApiKey(browserbaseApiKey: String) = apply { + body.browserbaseApiKey(browserbaseApiKey) + } /** - * Sets [Builder.env] to an arbitrary JSON value. + * Sets [Builder.browserbaseApiKey] to an arbitrary JSON value. * - * You should usually call [Builder.env] with a well-typed [Env] value instead. This method - * is primarily for setting the field to an undocumented or not yet supported value. + * You should usually call [Builder.browserbaseApiKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun env(env: JsonField) = apply { body.env(env) } + fun browserbaseApiKey(browserbaseApiKey: JsonField) = apply { + body.browserbaseApiKey(browserbaseApiKey) + } - /** API key for Browserbase (required when env=BROWSERBASE) */ - fun apiKey(apiKey: String) = apply { body.apiKey(apiKey) } + /** Project ID for Browserbase */ + fun browserbaseProjectId(browserbaseProjectId: String) = apply { + body.browserbaseProjectId(browserbaseProjectId) + } /** - * Sets [Builder.apiKey] to an arbitrary JSON value. + * Sets [Builder.browserbaseProjectId] to an arbitrary JSON value. * - * You should usually call [Builder.apiKey] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. + * You should usually call [Builder.browserbaseProjectId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun apiKey(apiKey: JsonField) = apply { body.apiKey(apiKey) } + fun browserbaseProjectId(browserbaseProjectId: JsonField) = apply { + body.browserbaseProjectId(browserbaseProjectId) + } /** Timeout in ms to wait for DOM to settle */ fun domSettleTimeout(domSettleTimeout: Long) = apply { @@ -260,24 +238,7 @@ private constructor( body.domSettleTimeout(domSettleTimeout) } - /** Options for local browser launch */ - fun localBrowserLaunchOptions(localBrowserLaunchOptions: LocalBrowserLaunchOptions) = - apply { - body.localBrowserLaunchOptions(localBrowserLaunchOptions) - } - - /** - * Sets [Builder.localBrowserLaunchOptions] to an arbitrary JSON value. - * - * You should usually call [Builder.localBrowserLaunchOptions] with a well-typed - * [LocalBrowserLaunchOptions] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun localBrowserLaunchOptions( - localBrowserLaunchOptions: JsonField - ) = apply { body.localBrowserLaunchOptions(localBrowserLaunchOptions) } - - /** AI model to use for actions */ + /** AI model to use for actions (must be prefixed with provider/) */ fun model(model: String) = apply { body.model(model) } /** @@ -288,18 +249,6 @@ private constructor( */ fun model(model: JsonField) = apply { body.model(model) } - /** Project ID for Browserbase (required when env=BROWSERBASE) */ - fun projectId(projectId: String) = apply { body.projectId(projectId) } - - /** - * Sets [Builder.projectId] to an arbitrary JSON value. - * - * You should usually call [Builder.projectId] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun projectId(projectId: JsonField) = apply { body.projectId(projectId) } - /** Enable self-healing for failed actions */ fun selfHeal(selfHeal: Boolean) = apply { body.selfHeal(selfHeal) } @@ -461,7 +410,8 @@ private constructor( * * The following fields are required: * ```java - * .env() + * .browserbaseApiKey() + * .browserbaseProjectId() * ``` * * @throws IllegalStateException if any required field is unset. @@ -483,12 +433,10 @@ private constructor( class Body @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val env: JsonField, - private val apiKey: JsonField, + private val browserbaseApiKey: JsonField, + private val browserbaseProjectId: JsonField, private val domSettleTimeout: JsonField, - private val localBrowserLaunchOptions: JsonField, private val model: JsonField, - private val projectId: JsonField, private val selfHeal: JsonField, private val systemPrompt: JsonField, private val verbose: JsonField, @@ -497,18 +445,16 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("env") @ExcludeMissing env: JsonField = JsonMissing.of(), - @JsonProperty("apiKey") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), + @JsonProperty("BROWSERBASE_API_KEY") + @ExcludeMissing + browserbaseApiKey: JsonField = JsonMissing.of(), + @JsonProperty("BROWSERBASE_PROJECT_ID") + @ExcludeMissing + browserbaseProjectId: JsonField = JsonMissing.of(), @JsonProperty("domSettleTimeout") @ExcludeMissing domSettleTimeout: JsonField = JsonMissing.of(), - @JsonProperty("localBrowserLaunchOptions") - @ExcludeMissing - localBrowserLaunchOptions: JsonField = JsonMissing.of(), @JsonProperty("model") @ExcludeMissing model: JsonField = JsonMissing.of(), - @JsonProperty("projectId") - @ExcludeMissing - projectId: JsonField = JsonMissing.of(), @JsonProperty("selfHeal") @ExcludeMissing selfHeal: JsonField = JsonMissing.of(), @@ -517,12 +463,10 @@ private constructor( systemPrompt: JsonField = JsonMissing.of(), @JsonProperty("verbose") @ExcludeMissing verbose: JsonField = JsonMissing.of(), ) : this( - env, - apiKey, + browserbaseApiKey, + browserbaseProjectId, domSettleTimeout, - localBrowserLaunchOptions, model, - projectId, selfHeal, systemPrompt, verbose, @@ -530,20 +474,21 @@ private constructor( ) /** - * Environment to run the browser in + * API key for Browserbase Cloud * * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun env(): Env = env.getRequired("env") + fun browserbaseApiKey(): String = browserbaseApiKey.getRequired("BROWSERBASE_API_KEY") /** - * API key for Browserbase (required when env=BROWSERBASE) + * Project ID for Browserbase * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). + * @throws StagehandInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun apiKey(): Optional = apiKey.getOptional("apiKey") + fun browserbaseProjectId(): String = + browserbaseProjectId.getRequired("BROWSERBASE_PROJECT_ID") /** * Timeout in ms to wait for DOM to settle @@ -554,30 +499,13 @@ private constructor( fun domSettleTimeout(): Optional = domSettleTimeout.getOptional("domSettleTimeout") /** - * Options for local browser launch - * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun localBrowserLaunchOptions(): Optional = - localBrowserLaunchOptions.getOptional("localBrowserLaunchOptions") - - /** - * AI model to use for actions + * AI model to use for actions (must be prefixed with provider/) * * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ fun model(): Optional = model.getOptional("model") - /** - * Project ID for Browserbase (required when env=BROWSERBASE) - * - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun projectId(): Optional = projectId.getOptional("projectId") - /** * Enable self-healing for failed actions * @@ -603,18 +531,24 @@ private constructor( fun verbose(): Optional = verbose.getOptional("verbose") /** - * Returns the raw JSON value of [env]. + * Returns the raw JSON value of [browserbaseApiKey]. * - * Unlike [env], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [browserbaseApiKey], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("env") @ExcludeMissing fun _env(): JsonField = env + @JsonProperty("BROWSERBASE_API_KEY") + @ExcludeMissing + fun _browserbaseApiKey(): JsonField = browserbaseApiKey /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [browserbaseProjectId]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [browserbaseProjectId], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("apiKey") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("BROWSERBASE_PROJECT_ID") + @ExcludeMissing + fun _browserbaseProjectId(): JsonField = browserbaseProjectId /** * Returns the raw JSON value of [domSettleTimeout]. @@ -626,17 +560,6 @@ private constructor( @ExcludeMissing fun _domSettleTimeout(): JsonField = domSettleTimeout - /** - * Returns the raw JSON value of [localBrowserLaunchOptions]. - * - * Unlike [localBrowserLaunchOptions], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("localBrowserLaunchOptions") - @ExcludeMissing - fun _localBrowserLaunchOptions(): JsonField = - localBrowserLaunchOptions - /** * Returns the raw JSON value of [model]. * @@ -644,13 +567,6 @@ private constructor( */ @JsonProperty("model") @ExcludeMissing fun _model(): JsonField = model - /** - * Returns the raw JSON value of [projectId]. - * - * Unlike [projectId], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("projectId") @ExcludeMissing fun _projectId(): JsonField = projectId - /** * Returns the raw JSON value of [selfHeal]. * @@ -694,7 +610,8 @@ private constructor( * * The following fields are required: * ```java - * .env() + * .browserbaseApiKey() + * .browserbaseProjectId() * ``` */ @JvmStatic fun builder() = Builder() @@ -703,13 +620,10 @@ private constructor( /** A builder for [Body]. */ class Builder internal constructor() { - private var env: JsonField? = null - private var apiKey: JsonField = JsonMissing.of() + private var browserbaseApiKey: JsonField? = null + private var browserbaseProjectId: JsonField? = null private var domSettleTimeout: JsonField = JsonMissing.of() - private var localBrowserLaunchOptions: JsonField = - JsonMissing.of() private var model: JsonField = JsonMissing.of() - private var projectId: JsonField = JsonMissing.of() private var selfHeal: JsonField = JsonMissing.of() private var systemPrompt: JsonField = JsonMissing.of() private var verbose: JsonField = JsonMissing.of() @@ -717,41 +631,45 @@ private constructor( @JvmSynthetic internal fun from(body: Body) = apply { - env = body.env - apiKey = body.apiKey + browserbaseApiKey = body.browserbaseApiKey + browserbaseProjectId = body.browserbaseProjectId domSettleTimeout = body.domSettleTimeout - localBrowserLaunchOptions = body.localBrowserLaunchOptions model = body.model - projectId = body.projectId selfHeal = body.selfHeal systemPrompt = body.systemPrompt verbose = body.verbose additionalProperties = body.additionalProperties.toMutableMap() } - /** Environment to run the browser in */ - fun env(env: Env) = env(JsonField.of(env)) + /** API key for Browserbase Cloud */ + fun browserbaseApiKey(browserbaseApiKey: String) = + browserbaseApiKey(JsonField.of(browserbaseApiKey)) /** - * Sets [Builder.env] to an arbitrary JSON value. + * Sets [Builder.browserbaseApiKey] to an arbitrary JSON value. * - * You should usually call [Builder.env] with a well-typed [Env] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. + * You should usually call [Builder.browserbaseApiKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun env(env: JsonField) = apply { this.env = env } + fun browserbaseApiKey(browserbaseApiKey: JsonField) = apply { + this.browserbaseApiKey = browserbaseApiKey + } - /** API key for Browserbase (required when env=BROWSERBASE) */ - fun apiKey(apiKey: String) = apiKey(JsonField.of(apiKey)) + /** Project ID for Browserbase */ + fun browserbaseProjectId(browserbaseProjectId: String) = + browserbaseProjectId(JsonField.of(browserbaseProjectId)) /** - * Sets [Builder.apiKey] to an arbitrary JSON value. + * Sets [Builder.browserbaseProjectId] to an arbitrary JSON value. * - * You should usually call [Builder.apiKey] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. + * You should usually call [Builder.browserbaseProjectId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. */ - fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } + fun browserbaseProjectId(browserbaseProjectId: JsonField) = apply { + this.browserbaseProjectId = browserbaseProjectId + } /** Timeout in ms to wait for DOM to settle */ fun domSettleTimeout(domSettleTimeout: Long) = @@ -768,22 +686,7 @@ private constructor( this.domSettleTimeout = domSettleTimeout } - /** Options for local browser launch */ - fun localBrowserLaunchOptions(localBrowserLaunchOptions: LocalBrowserLaunchOptions) = - localBrowserLaunchOptions(JsonField.of(localBrowserLaunchOptions)) - - /** - * Sets [Builder.localBrowserLaunchOptions] to an arbitrary JSON value. - * - * You should usually call [Builder.localBrowserLaunchOptions] with a well-typed - * [LocalBrowserLaunchOptions] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun localBrowserLaunchOptions( - localBrowserLaunchOptions: JsonField - ) = apply { this.localBrowserLaunchOptions = localBrowserLaunchOptions } - - /** AI model to use for actions */ + /** AI model to use for actions (must be prefixed with provider/) */ fun model(model: String) = model(JsonField.of(model)) /** @@ -795,18 +698,6 @@ private constructor( */ fun model(model: JsonField) = apply { this.model = model } - /** Project ID for Browserbase (required when env=BROWSERBASE) */ - fun projectId(projectId: String) = projectId(JsonField.of(projectId)) - - /** - * Sets [Builder.projectId] to an arbitrary JSON value. - * - * You should usually call [Builder.projectId] with a well-typed [String] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun projectId(projectId: JsonField) = apply { this.projectId = projectId } - /** Enable self-healing for failed actions */ fun selfHeal(selfHeal: Boolean) = selfHeal(JsonField.of(selfHeal)) @@ -871,19 +762,18 @@ private constructor( * * The following fields are required: * ```java - * .env() + * .browserbaseApiKey() + * .browserbaseProjectId() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): Body = Body( - checkRequired("env", env), - apiKey, + checkRequired("browserbaseApiKey", browserbaseApiKey), + checkRequired("browserbaseProjectId", browserbaseProjectId), domSettleTimeout, - localBrowserLaunchOptions, model, - projectId, selfHeal, systemPrompt, verbose, @@ -898,12 +788,10 @@ private constructor( return@apply } - env().validate() - apiKey() + browserbaseApiKey() + browserbaseProjectId() domSettleTimeout() - localBrowserLaunchOptions().ifPresent { it.validate() } model() - projectId() selfHeal() systemPrompt() verbose() @@ -926,12 +814,10 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (env.asKnown().getOrNull()?.validity() ?: 0) + - (if (apiKey.asKnown().isPresent) 1 else 0) + + (if (browserbaseApiKey.asKnown().isPresent) 1 else 0) + + (if (browserbaseProjectId.asKnown().isPresent) 1 else 0) + (if (domSettleTimeout.asKnown().isPresent) 1 else 0) + - (localBrowserLaunchOptions.asKnown().getOrNull()?.validity() ?: 0) + (if (model.asKnown().isPresent) 1 else 0) + - (if (projectId.asKnown().isPresent) 1 else 0) + (if (selfHeal.asKnown().isPresent) 1 else 0) + (if (systemPrompt.asKnown().isPresent) 1 else 0) + (if (verbose.asKnown().isPresent) 1 else 0) @@ -942,12 +828,10 @@ private constructor( } return other is Body && - env == other.env && - apiKey == other.apiKey && + browserbaseApiKey == other.browserbaseApiKey && + browserbaseProjectId == other.browserbaseProjectId && domSettleTimeout == other.domSettleTimeout && - localBrowserLaunchOptions == other.localBrowserLaunchOptions && model == other.model && - projectId == other.projectId && selfHeal == other.selfHeal && systemPrompt == other.systemPrompt && verbose == other.verbose && @@ -956,12 +840,10 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( - env, - apiKey, + browserbaseApiKey, + browserbaseProjectId, domSettleTimeout, - localBrowserLaunchOptions, model, - projectId, selfHeal, systemPrompt, verbose, @@ -972,280 +854,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{env=$env, apiKey=$apiKey, domSettleTimeout=$domSettleTimeout, localBrowserLaunchOptions=$localBrowserLaunchOptions, model=$model, projectId=$projectId, selfHeal=$selfHeal, systemPrompt=$systemPrompt, verbose=$verbose, additionalProperties=$additionalProperties}" - } - - /** Environment to run the browser in */ - class Env @JsonCreator private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is on an - * older version than the API, then the API may respond with new members that the SDK is - * unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val LOCAL = of("LOCAL") - - @JvmField val BROWSERBASE = of("BROWSERBASE") - - @JvmStatic fun of(value: String) = Env(JsonField.of(value)) - } - - /** An enum containing [Env]'s known values. */ - enum class Known { - LOCAL, - BROWSERBASE, - } - - /** - * An enum containing [Env]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Env] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if the - * SDK is on an older version than the API, then the API may respond with new members that - * the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - LOCAL, - BROWSERBASE, - /** An enum member indicating that [Env] was instantiated with an unknown value. */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] - * if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you want - * to throw for the unknown case. - */ - fun value(): Value = - when (this) { - LOCAL -> Value.LOCAL - BROWSERBASE -> Value.BROWSERBASE - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and don't - * want to throw for the unknown case. - * - * @throws StagehandInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - LOCAL -> Known.LOCAL - BROWSERBASE -> Known.BROWSERBASE - else -> throw StagehandInvalidDataException("Unknown Env: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for debugging - * and generally doesn't throw. - * - * @throws StagehandInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - StagehandInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Env = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: StagehandInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Env && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - /** Options for local browser launch */ - class LocalBrowserLaunchOptions - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val headless: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("headless") - @ExcludeMissing - headless: JsonField = JsonMissing.of() - ) : this(headless, mutableMapOf()) - - /** - * @throws StagehandInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun headless(): Optional = headless.getOptional("headless") - - /** - * Returns the raw JSON value of [headless]. - * - * Unlike [headless], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("headless") @ExcludeMissing fun _headless(): JsonField = headless - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of - * [LocalBrowserLaunchOptions]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [LocalBrowserLaunchOptions]. */ - class Builder internal constructor() { - - private var headless: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(localBrowserLaunchOptions: LocalBrowserLaunchOptions) = apply { - headless = localBrowserLaunchOptions.headless - additionalProperties = localBrowserLaunchOptions.additionalProperties.toMutableMap() - } - - fun headless(headless: Boolean) = headless(JsonField.of(headless)) - - /** - * Sets [Builder.headless] to an arbitrary JSON value. - * - * You should usually call [Builder.headless] with a well-typed [Boolean] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun headless(headless: JsonField) = apply { this.headless = headless } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [LocalBrowserLaunchOptions]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): LocalBrowserLaunchOptions = - LocalBrowserLaunchOptions(headless, additionalProperties.toMutableMap()) - } - - private var validated: Boolean = false - - fun validate(): LocalBrowserLaunchOptions = apply { - if (validated) { - return@apply - } - - headless() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: StagehandInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = (if (headless.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is LocalBrowserLaunchOptions && - headless == other.headless && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(headless, additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "LocalBrowserLaunchOptions{headless=$headless, additionalProperties=$additionalProperties}" + "Body{browserbaseApiKey=$browserbaseApiKey, browserbaseProjectId=$browserbaseProjectId, domSettleTimeout=$domSettleTimeout, model=$model, selfHeal=$selfHeal, systemPrompt=$systemPrompt, verbose=$verbose, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt index 1c7e4d8..9454bf3 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionStartParamsTest.kt @@ -10,14 +10,10 @@ internal class SessionStartParamsTest { @Test fun create() { SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder().headless(true).build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -28,14 +24,10 @@ internal class SessionStartParamsTest { fun body() { val params = SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder().headless(true).build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -43,13 +35,10 @@ internal class SessionStartParamsTest { val body = params._body() - assertThat(body.env()).isEqualTo(SessionStartParams.Env.LOCAL) - assertThat(body.apiKey()).contains("apiKey") + assertThat(body.browserbaseApiKey()).isEqualTo("BROWSERBASE_API_KEY") + assertThat(body.browserbaseProjectId()).isEqualTo("BROWSERBASE_PROJECT_ID") assertThat(body.domSettleTimeout()).contains(0L) - assertThat(body.localBrowserLaunchOptions()) - .contains(SessionStartParams.LocalBrowserLaunchOptions.builder().headless(true).build()) assertThat(body.model()).contains("openai/gpt-4o") - assertThat(body.projectId()).contains("projectId") assertThat(body.selfHeal()).contains(true) assertThat(body.systemPrompt()).contains("systemPrompt") assertThat(body.verbose()).contains(1L) @@ -57,10 +46,15 @@ internal class SessionStartParamsTest { @Test fun bodyWithoutOptionalFields() { - val params = SessionStartParams.builder().env(SessionStartParams.Env.LOCAL).build() + val params = + SessionStartParams.builder() + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") + .build() val body = params._body() - assertThat(body.env()).isEqualTo(SessionStartParams.Env.LOCAL) + assertThat(body.browserbaseApiKey()).isEqualTo("BROWSERBASE_API_KEY") + assertThat(body.browserbaseProjectId()).isEqualTo("BROWSERBASE_PROJECT_ID") } } diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt index 1a59424..fb35d34 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt @@ -72,16 +72,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -108,16 +102,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -144,16 +132,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -180,16 +162,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -216,16 +192,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -252,16 +222,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -288,16 +252,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -324,16 +282,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -360,16 +312,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -396,16 +342,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -432,16 +372,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -468,16 +402,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -504,16 +432,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -540,16 +462,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -576,16 +492,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -612,16 +522,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -646,16 +550,10 @@ internal class ErrorHandlingTest { assertThrows { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt index d02d7c6..af106c9 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt @@ -5,6 +5,8 @@ package com.browserbase.api.services import com.browserbase.api.client.StagehandClient import com.browserbase.api.client.okhttp.StagehandOkHttpClient import com.browserbase.api.core.JsonValue +import com.browserbase.api.models.sessions.ModelConfig +import com.browserbase.api.models.sessions.SessionActParams import com.browserbase.api.models.sessions.SessionStartParams import com.github.tomakehurst.wiremock.client.WireMock.anyUrl import com.github.tomakehurst.wiremock.client.WireMock.equalTo @@ -44,14 +46,10 @@ internal class ServiceParamsTest { sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder().headless(true).build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) @@ -68,4 +66,48 @@ internal class ServiceParamsTest { .withRequestBody(matchingJsonPath("$.secretProperty", equalTo("42"))) ) } + + @Disabled("Prism tests are disabled") + @Test + fun act() { + val sessionService = client.sessions() + stubFor(post(anyUrl()).willReturn(ok("{}"))) + + sessionService.act( + SessionActParams.builder() + .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .xStreamResponse(SessionActParams.XStreamResponse.TRUE) + .input("click the sign in button") + .frameId("frameId") + .options( + SessionActParams.Options.builder() + .model( + ModelConfig.builder() + .apiKey("apiKey") + .baseUrl("https://example.com") + .model("model") + .provider(ModelConfig.Provider.OPENAI) + .build() + ) + .timeout(0L) + .variables( + SessionActParams.Options.Variables.builder() + .putAdditionalProperty("foo", JsonValue.from("string")) + .build() + ) + .build() + ) + .putAdditionalHeader("Secret-Header", "42") + .putAdditionalQueryParam("secret_query_param", "42") + .putAdditionalBodyProperty("secretProperty", JsonValue.from("42")) + .build() + ) + + verify( + postRequestedFor(anyUrl()) + .withHeader("Secret-Header", equalTo("42")) + .withQueryParam("secret_query_param", equalTo("42")) + .withRequestBody(matchingJsonPath("$.secretProperty", equalTo("42"))) + ) + } } diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt index 12cedb1..351ad55 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt @@ -240,16 +240,10 @@ internal class SessionServiceAsyncTest { val responseFuture = sessionServiceAsync.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt index bc2c422..3a6781e 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt @@ -234,16 +234,10 @@ internal class SessionServiceTest { val response = sessionService.start( SessionStartParams.builder() - .env(SessionStartParams.Env.LOCAL) - .apiKey("apiKey") + .browserbaseApiKey("BROWSERBASE_API_KEY") + .browserbaseProjectId("BROWSERBASE_PROJECT_ID") .domSettleTimeout(0L) - .localBrowserLaunchOptions( - SessionStartParams.LocalBrowserLaunchOptions.builder() - .headless(true) - .build() - ) .model("openai/gpt-4o") - .projectId("projectId") .selfHeal(true) .systemPrompt("systemPrompt") .verbose(1L) From 5d55cd0023694ed48862fa1737cce1cc67ec6a3f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:40:05 +0000 Subject: [PATCH 08/14] feat(api): manual updates --- .stats.yml | 4 +- .../models/sessions/SessionExtractResponse.kt | 54 +++++++++---------- .../sessions/SessionExtractResponseTest.kt | 18 +++---- 3 files changed, 37 insertions(+), 39 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4664845..54cc978 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-6a22863a7da4fa45f904657a4cb8fc1a28e236925f03dc94fca25fd8271ca6db.yml -openapi_spec_hash: d5c6108942ad79f39ea4ff1bee9b7996 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-3607b588cab78536eb7de9f6acffe8ddda1d34aebe5910c2147421aa6c16bf22.yml +openapi_spec_hash: fb507e8d38b4978a5717fbb144197868 config_hash: 2f1ec44e7e07906e07bdc6e075763da9 diff --git a/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt index 322d090..6816259 100644 --- a/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/models/sessions/SessionExtractResponse.kt @@ -33,7 +33,7 @@ import java.util.Optional class SessionExtractResponse private constructor( private val extraction: Extraction? = null, - private val unionMember1: UnionMember1? = null, + private val custom: Custom? = null, private val _json: JsonValue? = null, ) { @@ -41,24 +41,24 @@ private constructor( fun extraction(): Optional = Optional.ofNullable(extraction) /** Structured data matching provided schema */ - fun unionMember1(): Optional = Optional.ofNullable(unionMember1) + fun custom(): Optional = Optional.ofNullable(custom) fun isExtraction(): Boolean = extraction != null - fun isUnionMember1(): Boolean = unionMember1 != null + fun isCustom(): Boolean = custom != null /** Default extraction result */ fun asExtraction(): Extraction = extraction.getOrThrow("extraction") /** Structured data matching provided schema */ - fun asUnionMember1(): UnionMember1 = unionMember1.getOrThrow("unionMember1") + fun asCustom(): Custom = custom.getOrThrow("custom") fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T = when { extraction != null -> visitor.visitExtraction(extraction) - unionMember1 != null -> visitor.visitUnionMember1(unionMember1) + custom != null -> visitor.visitCustom(custom) else -> visitor.unknown(_json) } @@ -75,8 +75,8 @@ private constructor( extraction.validate() } - override fun visitUnionMember1(unionMember1: UnionMember1) { - unionMember1.validate() + override fun visitCustom(custom: Custom) { + custom.validate() } } ) @@ -102,7 +102,7 @@ private constructor( object : Visitor { override fun visitExtraction(extraction: Extraction) = extraction.validity() - override fun visitUnionMember1(unionMember1: UnionMember1) = unionMember1.validity() + override fun visitCustom(custom: Custom) = custom.validity() override fun unknown(json: JsonValue?) = 0 } @@ -115,15 +115,15 @@ private constructor( return other is SessionExtractResponse && extraction == other.extraction && - unionMember1 == other.unionMember1 + custom == other.custom } - override fun hashCode(): Int = Objects.hash(extraction, unionMember1) + override fun hashCode(): Int = Objects.hash(extraction, custom) override fun toString(): String = when { extraction != null -> "SessionExtractResponse{extraction=$extraction}" - unionMember1 != null -> "SessionExtractResponse{unionMember1=$unionMember1}" + custom != null -> "SessionExtractResponse{custom=$custom}" _json != null -> "SessionExtractResponse{_unknown=$_json}" else -> throw IllegalStateException("Invalid SessionExtractResponse") } @@ -135,9 +135,7 @@ private constructor( fun ofExtraction(extraction: Extraction) = SessionExtractResponse(extraction = extraction) /** Structured data matching provided schema */ - @JvmStatic - fun ofUnionMember1(unionMember1: UnionMember1) = - SessionExtractResponse(unionMember1 = unionMember1) + @JvmStatic fun ofCustom(custom: Custom) = SessionExtractResponse(custom = custom) } /** @@ -150,7 +148,7 @@ private constructor( fun visitExtraction(extraction: Extraction): T /** Structured data matching provided schema */ - fun visitUnionMember1(unionMember1: UnionMember1): T + fun visitCustom(custom: Custom): T /** * Maps an unknown variant of [SessionExtractResponse] to a value of type [T]. @@ -178,8 +176,8 @@ private constructor( tryDeserialize(node, jacksonTypeRef())?.let { SessionExtractResponse(extraction = it, _json = json) }, - tryDeserialize(node, jacksonTypeRef())?.let { - SessionExtractResponse(unionMember1 = it, _json = json) + tryDeserialize(node, jacksonTypeRef())?.let { + SessionExtractResponse(custom = it, _json = json) }, ) .filterNotNull() @@ -207,7 +205,7 @@ private constructor( ) { when { value.extraction != null -> generator.writeObject(value.extraction) - value.unionMember1 != null -> generator.writeObject(value.unionMember1) + value.custom != null -> generator.writeObject(value.custom) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid SessionExtractResponse") } @@ -358,7 +356,7 @@ private constructor( } /** Structured data matching provided schema */ - class UnionMember1 + class Custom @JsonCreator private constructor( @com.fasterxml.jackson.annotation.JsonValue @@ -373,18 +371,18 @@ private constructor( companion object { - /** Returns a mutable builder for constructing an instance of [UnionMember1]. */ + /** Returns a mutable builder for constructing an instance of [Custom]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [UnionMember1]. */ + /** A builder for [Custom]. */ class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unionMember1: UnionMember1) = apply { - additionalProperties = unionMember1.additionalProperties.toMutableMap() + internal fun from(custom: Custom) = apply { + additionalProperties = custom.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -407,16 +405,16 @@ private constructor( } /** - * Returns an immutable instance of [UnionMember1]. + * Returns an immutable instance of [Custom]. * * Further updates to this [Builder] will not mutate the returned instance. */ - fun build(): UnionMember1 = UnionMember1(additionalProperties.toImmutable()) + fun build(): Custom = Custom(additionalProperties.toImmutable()) } private var validated: Boolean = false - fun validate(): UnionMember1 = apply { + fun validate(): Custom = apply { if (validated) { return@apply } @@ -447,13 +445,13 @@ private constructor( return true } - return other is UnionMember1 && additionalProperties == other.additionalProperties + return other is Custom && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode - override fun toString() = "UnionMember1{additionalProperties=$additionalProperties}" + override fun toString() = "Custom{additionalProperties=$additionalProperties}" } } diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt index 2bd928d..42022d5 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/models/sessions/SessionExtractResponseTest.kt @@ -22,7 +22,7 @@ internal class SessionExtractResponseTest { val sessionExtractResponse = SessionExtractResponse.ofExtraction(extraction) assertThat(sessionExtractResponse.extraction()).contains(extraction) - assertThat(sessionExtractResponse.unionMember1()).isEmpty + assertThat(sessionExtractResponse.custom()).isEmpty } @Test @@ -43,24 +43,24 @@ internal class SessionExtractResponseTest { } @Test - fun ofUnionMember1() { - val unionMember1 = - SessionExtractResponse.UnionMember1.builder() + fun ofCustom() { + val custom = + SessionExtractResponse.Custom.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() - val sessionExtractResponse = SessionExtractResponse.ofUnionMember1(unionMember1) + val sessionExtractResponse = SessionExtractResponse.ofCustom(custom) assertThat(sessionExtractResponse.extraction()).isEmpty - assertThat(sessionExtractResponse.unionMember1()).contains(unionMember1) + assertThat(sessionExtractResponse.custom()).contains(custom) } @Test - fun ofUnionMember1Roundtrip() { + fun ofCustomRoundtrip() { val jsonMapper = jsonMapper() val sessionExtractResponse = - SessionExtractResponse.ofUnionMember1( - SessionExtractResponse.UnionMember1.builder() + SessionExtractResponse.ofCustom( + SessionExtractResponse.Custom.builder() .putAdditionalProperty("foo", JsonValue.from("bar")) .build() ) From daa8c1cbe7c3e67400d8661cbd511f47b61de91f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 20:08:15 +0000 Subject: [PATCH 09/14] feat(api): manual updates --- .stats.yml | 2 +- README.md | 51 ++++------ .../api/client/okhttp/OkHttpClient.kt | 6 +- .../client/okhttp/StagehandOkHttpClient.kt | 23 ++--- .../okhttp/StagehandOkHttpClientAsync.kt | 23 ++--- .../com/browserbase/api/core/ClientOptions.kt | 92 ++++++++++++------- .../browserbase/api/core/ClientOptionsTest.kt | 7 +- .../api/services/ErrorHandlingTest.kt | 4 +- .../api/services/ServiceParamsTest.kt | 4 +- .../services/async/SessionServiceAsyncTest.kt | 28 ++++-- .../services/blocking/SessionServiceTest.kt | 28 ++++-- .../api/proguard/ProGuardCompatibilityTest.kt | 7 +- 12 files changed, 168 insertions(+), 107 deletions(-) diff --git a/.stats.yml b/.stats.yml index 54cc978..1e16065 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-3607b588cab78536eb7de9f6acffe8ddda1d34aebe5910c2147421aa6c16bf22.yml openapi_spec_hash: fb507e8d38b4978a5717fbb144197868 -config_hash: 2f1ec44e7e07906e07bdc6e075763da9 +config_hash: fc6606301b5142487a69d296f154b265 diff --git a/README.md b/README.md index a71554c..0097606 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ import com.browserbase.api.client.okhttp.StagehandOkHttpClient; import com.browserbase.api.models.sessions.SessionActParams; import com.browserbase.api.models.sessions.SessionActResponse; -// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables +// Configures using the `stagehand.browserbaseApiKey`, `stagehand.browserbaseProjectId`, `stagehand.modelApiKey` and `stagehand.baseUrl` system properties +// Or configures using the `BROWSERBASE_API_KEY`, `BROWSERBASE_PROJECT_ID`, `MODEL_API_KEY` and `STAGEHAND_BASE_URL` environment variables StagehandClient client = StagehandOkHttpClient.fromEnv(); SessionActParams params = SessionActParams.builder() @@ -70,8 +70,8 @@ Configure the client using system properties or environment variables: import com.browserbase.api.client.StagehandClient; import com.browserbase.api.client.okhttp.StagehandOkHttpClient; -// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables +// Configures using the `stagehand.browserbaseApiKey`, `stagehand.browserbaseProjectId`, `stagehand.modelApiKey` and `stagehand.baseUrl` system properties +// Or configures using the `BROWSERBASE_API_KEY`, `BROWSERBASE_PROJECT_ID`, `MODEL_API_KEY` and `STAGEHAND_BASE_URL` environment variables StagehandClient client = StagehandOkHttpClient.fromEnv(); ``` @@ -82,7 +82,9 @@ import com.browserbase.api.client.StagehandClient; import com.browserbase.api.client.okhttp.StagehandOkHttpClient; StagehandClient client = StagehandOkHttpClient.builder() - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build(); ``` @@ -93,19 +95,21 @@ import com.browserbase.api.client.StagehandClient; import com.browserbase.api.client.okhttp.StagehandOkHttpClient; StagehandClient client = StagehandOkHttpClient.builder() - // Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties - // Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables + // Configures using the `stagehand.browserbaseApiKey`, `stagehand.browserbaseProjectId`, `stagehand.modelApiKey` and `stagehand.baseUrl` system properties + // Or configures using the `BROWSERBASE_API_KEY`, `BROWSERBASE_PROJECT_ID`, `MODEL_API_KEY` and `STAGEHAND_BASE_URL` environment variables .fromEnv() - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") .build(); ``` See this table for the available options: -| Setter | System property | Environment variable | Required | Default value | -| --------- | ------------------- | -------------------- | -------- | -------------------------------------------- | -| `apiKey` | `stagehand.apiKey` | `STAGEHAND_API_KEY` | true | - | -| `baseUrl` | `stagehand.baseUrl` | `STAGEHAND_BASE_URL` | true | `"https://api.stagehand.browserbase.com/v1"` | +| Setter | System property | Environment variable | Required | Default value | +| ---------------------- | -------------------------------- | ------------------------ | -------- | -------------------------------------------- | +| `browserbaseApiKey` | `stagehand.browserbaseApiKey` | `BROWSERBASE_API_KEY` | true | - | +| `browserbaseProjectId` | `stagehand.browserbaseProjectId` | `BROWSERBASE_PROJECT_ID` | true | - | +| `modelApiKey` | `stagehand.modelApiKey` | `MODEL_API_KEY` | false | - | +| `baseUrl` | `stagehand.baseUrl` | `STAGEHAND_BASE_URL` | true | `"https://api.stagehand.browserbase.com/v1"` | System properties take precedence over environment variables. @@ -153,8 +157,8 @@ import com.browserbase.api.models.sessions.SessionActParams; import com.browserbase.api.models.sessions.SessionActResponse; import java.util.concurrent.CompletableFuture; -// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables +// Configures using the `stagehand.browserbaseApiKey`, `stagehand.browserbaseProjectId`, `stagehand.modelApiKey` and `stagehand.baseUrl` system properties +// Or configures using the `BROWSERBASE_API_KEY`, `BROWSERBASE_PROJECT_ID`, `MODEL_API_KEY` and `STAGEHAND_BASE_URL` environment variables StagehandClient client = StagehandOkHttpClient.fromEnv(); SessionActParams params = SessionActParams.builder() @@ -173,8 +177,8 @@ import com.browserbase.api.models.sessions.SessionActParams; import com.browserbase.api.models.sessions.SessionActResponse; import java.util.concurrent.CompletableFuture; -// Configures using the `stagehand.apiKey` and `stagehand.baseUrl` system properties -// Or configures using the `STAGEHAND_API_KEY` and `STAGEHAND_BASE_URL` environment variables +// Configures using the `stagehand.browserbaseApiKey`, `stagehand.browserbaseProjectId`, `stagehand.modelApiKey` and `stagehand.baseUrl` system properties +// Or configures using the `BROWSERBASE_API_KEY`, `BROWSERBASE_PROJECT_ID`, `MODEL_API_KEY` and `STAGEHAND_BASE_URL` environment variables StagehandClientAsync client = StagehandOkHttpClientAsync.fromEnv(); SessionActParams params = SessionActParams.builder() @@ -370,21 +374,6 @@ StagehandClient client = StagehandOkHttpClient.builder() .build(); ``` -### Environments - -The SDK sends requests to the production by default. To send requests to a different environment, configure the client like so: - -```java -import com.browserbase.api.client.StagehandClient; -import com.browserbase.api.client.okhttp.StagehandOkHttpClient; - -StagehandClient client = StagehandOkHttpClient.builder() - .fromEnv() - // Other options include `local` - .dev() - .build(); -``` - ### Custom HTTP client The SDK consists of three artifacts: diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt index a624630..c03dd12 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/OkHttpClient.kt @@ -91,7 +91,11 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien } if (logLevel != null) { clientBuilder.addNetworkInterceptor( - HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") } + HttpLoggingInterceptor().setLevel(logLevel).apply { + redactHeader("x-bb-api-key") + redactHeader("x-bb-project-id") + redactHeader("x-model-api-key") + } ) } diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt index 9114eb5..ced0665 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt @@ -145,22 +145,12 @@ class StagehandOkHttpClient private constructor() { * The base URL to use for every request. * * Defaults to the production environment: `https://api.stagehand.browserbase.com/v1`. - * - * The following other environments, with dedicated builder methods, are available: - * - dev: `https://api.stagehand.dev.browserbase.com/v1` - * - local: `http://localhost:5000/v1` */ fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) } /** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */ fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull()) - /** Sets [baseUrl] to `https://api.stagehand.dev.browserbase.com/v1`. */ - fun dev() = apply { clientOptions.dev() } - - /** Sets [baseUrl] to `http://localhost:5000/v1`. */ - fun local() = apply { clientOptions.local() } - /** * Whether to call `validate` on every response before returning it. * @@ -205,7 +195,18 @@ class StagehandOkHttpClient private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } - fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } + fun browserbaseApiKey(browserbaseApiKey: String) = apply { + clientOptions.browserbaseApiKey(browserbaseApiKey) + } + + fun browserbaseProjectId(browserbaseProjectId: String) = apply { + clientOptions.browserbaseProjectId(browserbaseProjectId) + } + + fun modelApiKey(modelApiKey: String?) = apply { clientOptions.modelApiKey(modelApiKey) } + + /** Alias for calling [Builder.modelApiKey] with `modelApiKey.orElse(null)`. */ + fun modelApiKey(modelApiKey: Optional) = modelApiKey(modelApiKey.getOrNull()) fun headers(headers: Headers) = apply { clientOptions.headers(headers) } diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt index f16e2f8..e996038 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt @@ -145,22 +145,12 @@ class StagehandOkHttpClientAsync private constructor() { * The base URL to use for every request. * * Defaults to the production environment: `https://api.stagehand.browserbase.com/v1`. - * - * The following other environments, with dedicated builder methods, are available: - * - dev: `https://api.stagehand.dev.browserbase.com/v1` - * - local: `http://localhost:5000/v1` */ fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) } /** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */ fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull()) - /** Sets [baseUrl] to `https://api.stagehand.dev.browserbase.com/v1`. */ - fun dev() = apply { clientOptions.dev() } - - /** Sets [baseUrl] to `http://localhost:5000/v1`. */ - fun local() = apply { clientOptions.local() } - /** * Whether to call `validate` on every response before returning it. * @@ -205,7 +195,18 @@ class StagehandOkHttpClientAsync private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } - fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) } + fun browserbaseApiKey(browserbaseApiKey: String) = apply { + clientOptions.browserbaseApiKey(browserbaseApiKey) + } + + fun browserbaseProjectId(browserbaseProjectId: String) = apply { + clientOptions.browserbaseProjectId(browserbaseProjectId) + } + + fun modelApiKey(modelApiKey: String?) = apply { clientOptions.modelApiKey(modelApiKey) } + + /** Alias for calling [Builder.modelApiKey] with `modelApiKey.orElse(null)`. */ + fun modelApiKey(modelApiKey: Optional) = modelApiKey(modelApiKey.getOrNull()) fun headers(headers: Headers) = apply { clientOptions.headers(headers) } diff --git a/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt index 967f4dc..4731cef 100644 --- a/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt @@ -93,7 +93,9 @@ private constructor( * Defaults to 2. */ @get:JvmName("maxRetries") val maxRetries: Int, - @get:JvmName("apiKey") val apiKey: String, + @get:JvmName("browserbaseApiKey") val browserbaseApiKey: String, + @get:JvmName("browserbaseProjectId") val browserbaseProjectId: String, + private val modelApiKey: String?, ) { init { @@ -106,30 +108,25 @@ private constructor( * The base URL to use for every request. * * Defaults to the production environment: `https://api.stagehand.browserbase.com/v1`. - * - * The following other environments, with dedicated builder methods, are available: - * - dev: `https://api.stagehand.dev.browserbase.com/v1` - * - local: `http://localhost:5000/v1` */ fun baseUrl(): String = baseUrl ?: PRODUCTION_URL + fun modelApiKey(): Optional = Optional.ofNullable(modelApiKey) + fun toBuilder() = Builder().from(this) companion object { const val PRODUCTION_URL = "https://api.stagehand.browserbase.com/v1" - const val DEV_URL = "https://api.stagehand.dev.browserbase.com/v1" - - const val LOCAL_URL = "http://localhost:5000/v1" - /** * Returns a mutable builder for constructing an instance of [ClientOptions]. * * The following fields are required: * ```java * .httpClient() - * .apiKey() + * .browserbaseApiKey() + * .browserbaseProjectId() * ``` */ @JvmStatic fun builder() = Builder() @@ -156,7 +153,9 @@ private constructor( private var responseValidation: Boolean = false private var timeout: Timeout = Timeout.default() private var maxRetries: Int = 2 - private var apiKey: String? = null + private var browserbaseApiKey: String? = null + private var browserbaseProjectId: String? = null + private var modelApiKey: String? = null @JvmSynthetic internal fun from(clientOptions: ClientOptions) = apply { @@ -171,7 +170,9 @@ private constructor( responseValidation = clientOptions.responseValidation timeout = clientOptions.timeout maxRetries = clientOptions.maxRetries - apiKey = clientOptions.apiKey + browserbaseApiKey = clientOptions.browserbaseApiKey + browserbaseProjectId = clientOptions.browserbaseProjectId + modelApiKey = clientOptions.modelApiKey } /** @@ -228,22 +229,12 @@ private constructor( * The base URL to use for every request. * * Defaults to the production environment: `https://api.stagehand.browserbase.com/v1`. - * - * The following other environments, with dedicated builder methods, are available: - * - dev: `https://api.stagehand.dev.browserbase.com/v1` - * - local: `http://localhost:5000/v1` */ fun baseUrl(baseUrl: String?) = apply { this.baseUrl = baseUrl } /** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */ fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull()) - /** Sets [baseUrl] to `https://api.stagehand.dev.browserbase.com/v1`. */ - fun dev() = baseUrl(DEV_URL) - - /** Sets [baseUrl] to `http://localhost:5000/v1`. */ - fun local() = baseUrl(LOCAL_URL) - /** * Whether to call `validate` on every response before returning it. * @@ -288,7 +279,18 @@ private constructor( */ fun maxRetries(maxRetries: Int) = apply { this.maxRetries = maxRetries } - fun apiKey(apiKey: String) = apply { this.apiKey = apiKey } + fun browserbaseApiKey(browserbaseApiKey: String) = apply { + this.browserbaseApiKey = browserbaseApiKey + } + + fun browserbaseProjectId(browserbaseProjectId: String) = apply { + this.browserbaseProjectId = browserbaseProjectId + } + + fun modelApiKey(modelApiKey: String?) = apply { this.modelApiKey = modelApiKey } + + /** Alias for calling [Builder.modelApiKey] with `modelApiKey.orElse(null)`. */ + fun modelApiKey(modelApiKey: Optional) = modelApiKey(modelApiKey.getOrNull()) fun headers(headers: Headers) = apply { this.headers.clear() @@ -377,10 +379,12 @@ private constructor( * * See this table for the available options: * - * |Setter |System property |Environment variable|Required|Default value | - * |---------|-------------------|--------------------|--------|--------------------------------------------| - * |`apiKey` |`stagehand.apiKey` |`STAGEHAND_API_KEY` |true |- | - * |`baseUrl`|`stagehand.baseUrl`|`STAGEHAND_BASE_URL`|true |`"https://api.stagehand.browserbase.com/v1"`| + * |Setter |System property |Environment variable |Required|Default value | + * |----------------------|--------------------------------|------------------------|--------|--------------------------------------------| + * |`browserbaseApiKey` |`stagehand.browserbaseApiKey` |`BROWSERBASE_API_KEY` |true |- | + * |`browserbaseProjectId`|`stagehand.browserbaseProjectId`|`BROWSERBASE_PROJECT_ID`|true |- | + * |`modelApiKey` |`stagehand.modelApiKey` |`MODEL_API_KEY` |false |- | + * |`baseUrl` |`stagehand.baseUrl` |`STAGEHAND_BASE_URL` |true |`"https://api.stagehand.browserbase.com/v1"`| * * System properties take precedence over environment variables. */ @@ -388,8 +392,14 @@ private constructor( (System.getProperty("stagehand.baseUrl") ?: System.getenv("STAGEHAND_BASE_URL"))?.let { baseUrl(it) } - (System.getProperty("stagehand.apiKey") ?: System.getenv("STAGEHAND_API_KEY"))?.let { - apiKey(it) + (System.getProperty("stagehand.browserbaseApiKey") + ?: System.getenv("BROWSERBASE_API_KEY")) + ?.let { browserbaseApiKey(it) } + (System.getProperty("stagehand.browserbaseProjectId") + ?: System.getenv("BROWSERBASE_PROJECT_ID")) + ?.let { browserbaseProjectId(it) } + (System.getProperty("stagehand.modelApiKey") ?: System.getenv("MODEL_API_KEY"))?.let { + modelApiKey(it) } } @@ -401,7 +411,8 @@ private constructor( * The following fields are required: * ```java * .httpClient() - * .apiKey() + * .browserbaseApiKey() + * .browserbaseProjectId() * ``` * * @throws IllegalStateException if any required field is unset. @@ -409,7 +420,8 @@ private constructor( fun build(): ClientOptions { val httpClient = checkRequired("httpClient", httpClient) val sleeper = sleeper ?: PhantomReachableSleeper(DefaultSleeper()) - val apiKey = checkRequired("apiKey", apiKey) + val browserbaseApiKey = checkRequired("browserbaseApiKey", browserbaseApiKey) + val browserbaseProjectId = checkRequired("browserbaseProjectId", browserbaseProjectId) val headers = Headers.builder() val queryParams = QueryParams.builder() @@ -420,9 +432,19 @@ private constructor( headers.put("X-Stainless-Package-Version", getPackageVersion()) headers.put("X-Stainless-Runtime", "JRE") headers.put("X-Stainless-Runtime-Version", getJavaVersion()) - apiKey.let { + browserbaseApiKey.let { + if (!it.isEmpty()) { + headers.put("x-bb-api-key", it) + } + } + browserbaseProjectId.let { + if (!it.isEmpty()) { + headers.put("x-bb-project-id", it) + } + } + modelApiKey?.let { if (!it.isEmpty()) { - headers.put("Authorization", "Bearer $it") + headers.put("x-model-api-key", it) } } headers.replaceAll(this.headers.build()) @@ -446,7 +468,9 @@ private constructor( responseValidation, timeout, maxRetries, - apiKey, + browserbaseApiKey, + browserbaseProjectId, + modelApiKey, ) } } diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt index e73f724..75d56e8 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/core/ClientOptionsTest.kt @@ -19,7 +19,12 @@ internal class ClientOptionsTest { @Test fun toBuilder_whenOriginalClientOptionsGarbageCollected_doesNotCloseOriginalClient() { var clientOptions = - ClientOptions.builder().httpClient(httpClient).apiKey("My API Key").build() + ClientOptions.builder() + .httpClient(httpClient) + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") + .build() verify(httpClient, never()).close() // Overwrite the `clientOptions` variable so that the original `ClientOptions` is GC'd. diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt index fb35d34..509b889 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ErrorHandlingTest.kt @@ -54,7 +54,9 @@ internal class ErrorHandlingTest { client = StagehandOkHttpClient.builder() .baseUrl(wmRuntimeInfo.httpBaseUrl) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() } diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt index af106c9..aa39440 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/ServiceParamsTest.kt @@ -34,7 +34,9 @@ internal class ServiceParamsTest { client = StagehandOkHttpClient.builder() .baseUrl(wmRuntimeInfo.httpBaseUrl) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() } diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt index 351ad55..d041842 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/async/SessionServiceAsyncTest.kt @@ -26,7 +26,9 @@ internal class SessionServiceAsyncTest { val client = StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionServiceAsync = client.sessions() @@ -68,7 +70,9 @@ internal class SessionServiceAsyncTest { val client = StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionServiceAsync = client.sessions() @@ -84,7 +88,9 @@ internal class SessionServiceAsyncTest { val client = StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionServiceAsync = client.sessions() @@ -122,7 +128,9 @@ internal class SessionServiceAsyncTest { val client = StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionServiceAsync = client.sessions() @@ -165,7 +173,9 @@ internal class SessionServiceAsyncTest { val client = StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionServiceAsync = client.sessions() @@ -195,7 +205,9 @@ internal class SessionServiceAsyncTest { val client = StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionServiceAsync = client.sessions() @@ -233,7 +245,9 @@ internal class SessionServiceAsyncTest { val client = StagehandOkHttpClientAsync.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionServiceAsync = client.sessions() diff --git a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt index 3a6781e..10177a3 100644 --- a/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt +++ b/stagehand-java-core/src/test/kotlin/com/browserbase/api/services/blocking/SessionServiceTest.kt @@ -26,7 +26,9 @@ internal class SessionServiceTest { val client = StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionService = client.sessions() @@ -67,7 +69,9 @@ internal class SessionServiceTest { val client = StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionService = client.sessions() @@ -82,7 +86,9 @@ internal class SessionServiceTest { val client = StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionService = client.sessions() @@ -119,7 +125,9 @@ internal class SessionServiceTest { val client = StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionService = client.sessions() @@ -161,7 +169,9 @@ internal class SessionServiceTest { val client = StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionService = client.sessions() @@ -190,7 +200,9 @@ internal class SessionServiceTest { val client = StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionService = client.sessions() @@ -227,7 +239,9 @@ internal class SessionServiceTest { val client = StagehandOkHttpClient.builder() .baseUrl(TestServerExtension.BASE_URL) - .apiKey("My API Key") + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") .build() val sessionService = client.sessions() diff --git a/stagehand-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt b/stagehand-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt index 2ac121d..3960aa2 100644 --- a/stagehand-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt +++ b/stagehand-java-proguard-test/src/test/kotlin/com/browserbase/api/proguard/ProGuardCompatibilityTest.kt @@ -45,7 +45,12 @@ internal class ProGuardCompatibilityTest { @Test fun client() { - val client = StagehandOkHttpClient.builder().apiKey("My API Key").build() + val client = + StagehandOkHttpClient.builder() + .browserbaseApiKey("My Browserbase API Key") + .browserbaseProjectId("My Browserbase Project ID") + .modelApiKey("My Model API Key") + .build() assertThat(client).isNotNull() assertThat(client.sessions()).isNotNull() From 48825eac78b9dd280020359253465ec0ab9d7405 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 20:12:02 +0000 Subject: [PATCH 10/14] feat(api): manual updates --- .stats.yml | 2 +- README.md | 2 +- .../api/client/okhttp/StagehandOkHttpClient.kt | 5 +---- .../client/okhttp/StagehandOkHttpClientAsync.kt | 5 +---- .../com/browserbase/api/core/ClientOptions.kt | 16 +++++++--------- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1e16065..44d6d13 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-3607b588cab78536eb7de9f6acffe8ddda1d34aebe5910c2147421aa6c16bf22.yml openapi_spec_hash: fb507e8d38b4978a5717fbb144197868 -config_hash: fc6606301b5142487a69d296f154b265 +config_hash: 9d54b9fd851ec7ac25b85f579be64425 diff --git a/README.md b/README.md index 0097606..273c14d 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ See this table for the available options: | ---------------------- | -------------------------------- | ------------------------ | -------- | -------------------------------------------- | | `browserbaseApiKey` | `stagehand.browserbaseApiKey` | `BROWSERBASE_API_KEY` | true | - | | `browserbaseProjectId` | `stagehand.browserbaseProjectId` | `BROWSERBASE_PROJECT_ID` | true | - | -| `modelApiKey` | `stagehand.modelApiKey` | `MODEL_API_KEY` | false | - | +| `modelApiKey` | `stagehand.modelApiKey` | `MODEL_API_KEY` | true | - | | `baseUrl` | `stagehand.baseUrl` | `STAGEHAND_BASE_URL` | true | `"https://api.stagehand.browserbase.com/v1"` | System properties take precedence over environment variables. diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt index ced0665..eef8cff 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt @@ -203,10 +203,7 @@ class StagehandOkHttpClient private constructor() { clientOptions.browserbaseProjectId(browserbaseProjectId) } - fun modelApiKey(modelApiKey: String?) = apply { clientOptions.modelApiKey(modelApiKey) } - - /** Alias for calling [Builder.modelApiKey] with `modelApiKey.orElse(null)`. */ - fun modelApiKey(modelApiKey: Optional) = modelApiKey(modelApiKey.getOrNull()) + fun modelApiKey(modelApiKey: String) = apply { clientOptions.modelApiKey(modelApiKey) } fun headers(headers: Headers) = apply { clientOptions.headers(headers) } diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt index e996038..53cda9d 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt @@ -203,10 +203,7 @@ class StagehandOkHttpClientAsync private constructor() { clientOptions.browserbaseProjectId(browserbaseProjectId) } - fun modelApiKey(modelApiKey: String?) = apply { clientOptions.modelApiKey(modelApiKey) } - - /** Alias for calling [Builder.modelApiKey] with `modelApiKey.orElse(null)`. */ - fun modelApiKey(modelApiKey: Optional) = modelApiKey(modelApiKey.getOrNull()) + fun modelApiKey(modelApiKey: String) = apply { clientOptions.modelApiKey(modelApiKey) } fun headers(headers: Headers) = apply { clientOptions.headers(headers) } diff --git a/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt index 4731cef..46107c5 100644 --- a/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt @@ -95,7 +95,7 @@ private constructor( @get:JvmName("maxRetries") val maxRetries: Int, @get:JvmName("browserbaseApiKey") val browserbaseApiKey: String, @get:JvmName("browserbaseProjectId") val browserbaseProjectId: String, - private val modelApiKey: String?, + @get:JvmName("modelApiKey") val modelApiKey: String, ) { init { @@ -111,8 +111,6 @@ private constructor( */ fun baseUrl(): String = baseUrl ?: PRODUCTION_URL - fun modelApiKey(): Optional = Optional.ofNullable(modelApiKey) - fun toBuilder() = Builder().from(this) companion object { @@ -127,6 +125,7 @@ private constructor( * .httpClient() * .browserbaseApiKey() * .browserbaseProjectId() + * .modelApiKey() * ``` */ @JvmStatic fun builder() = Builder() @@ -287,10 +286,7 @@ private constructor( this.browserbaseProjectId = browserbaseProjectId } - fun modelApiKey(modelApiKey: String?) = apply { this.modelApiKey = modelApiKey } - - /** Alias for calling [Builder.modelApiKey] with `modelApiKey.orElse(null)`. */ - fun modelApiKey(modelApiKey: Optional) = modelApiKey(modelApiKey.getOrNull()) + fun modelApiKey(modelApiKey: String) = apply { this.modelApiKey = modelApiKey } fun headers(headers: Headers) = apply { this.headers.clear() @@ -383,7 +379,7 @@ private constructor( * |----------------------|--------------------------------|------------------------|--------|--------------------------------------------| * |`browserbaseApiKey` |`stagehand.browserbaseApiKey` |`BROWSERBASE_API_KEY` |true |- | * |`browserbaseProjectId`|`stagehand.browserbaseProjectId`|`BROWSERBASE_PROJECT_ID`|true |- | - * |`modelApiKey` |`stagehand.modelApiKey` |`MODEL_API_KEY` |false |- | + * |`modelApiKey` |`stagehand.modelApiKey` |`MODEL_API_KEY` |true |- | * |`baseUrl` |`stagehand.baseUrl` |`STAGEHAND_BASE_URL` |true |`"https://api.stagehand.browserbase.com/v1"`| * * System properties take precedence over environment variables. @@ -413,6 +409,7 @@ private constructor( * .httpClient() * .browserbaseApiKey() * .browserbaseProjectId() + * .modelApiKey() * ``` * * @throws IllegalStateException if any required field is unset. @@ -422,6 +419,7 @@ private constructor( val sleeper = sleeper ?: PhantomReachableSleeper(DefaultSleeper()) val browserbaseApiKey = checkRequired("browserbaseApiKey", browserbaseApiKey) val browserbaseProjectId = checkRequired("browserbaseProjectId", browserbaseProjectId) + val modelApiKey = checkRequired("modelApiKey", modelApiKey) val headers = Headers.builder() val queryParams = QueryParams.builder() @@ -442,7 +440,7 @@ private constructor( headers.put("x-bb-project-id", it) } } - modelApiKey?.let { + modelApiKey.let { if (!it.isEmpty()) { headers.put("x-model-api-key", it) } From f2d0690f93415cafad61334d8eeb8c90d9ae2e43 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 20:23:56 +0000 Subject: [PATCH 11/14] feat(api): manual updates --- .stats.yml | 6 +++--- .../browserbase/api/client/okhttp/StagehandOkHttpClient.kt | 3 +++ .../api/client/okhttp/StagehandOkHttpClientAsync.kt | 3 +++ .../main/kotlin/com/browserbase/api/core/ClientOptions.kt | 6 ++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 44d6d13..91b86f3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-3607b588cab78536eb7de9f6acffe8ddda1d34aebe5910c2147421aa6c16bf22.yml -openapi_spec_hash: fb507e8d38b4978a5717fbb144197868 -config_hash: 9d54b9fd851ec7ac25b85f579be64425 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-2c88c6d890406ff8a5f1bca692264fb9af4bc4fe64df0986e06d3386fc6d6fcb.yml +openapi_spec_hash: dc6ea17f8152708dc0a390c7f86b1a5d +config_hash: b01f15c540ab2c92808c2bba96368631 diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt index eef8cff..8955635 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClient.kt @@ -195,14 +195,17 @@ class StagehandOkHttpClient private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } + /** Your [Browserbase API Key](https://www.browserbase.com/settings) */ fun browserbaseApiKey(browserbaseApiKey: String) = apply { clientOptions.browserbaseApiKey(browserbaseApiKey) } + /** Your [Browserbase Project ID](https://www.browserbase.com/settings) */ fun browserbaseProjectId(browserbaseProjectId: String) = apply { clientOptions.browserbaseProjectId(browserbaseProjectId) } + /** Your LLM provider API key (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) */ fun modelApiKey(modelApiKey: String) = apply { clientOptions.modelApiKey(modelApiKey) } fun headers(headers: Headers) = apply { clientOptions.headers(headers) } diff --git a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt index 53cda9d..2cb208d 100644 --- a/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt +++ b/stagehand-java-client-okhttp/src/main/kotlin/com/browserbase/api/client/okhttp/StagehandOkHttpClientAsync.kt @@ -195,14 +195,17 @@ class StagehandOkHttpClientAsync private constructor() { */ fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) } + /** Your [Browserbase API Key](https://www.browserbase.com/settings) */ fun browserbaseApiKey(browserbaseApiKey: String) = apply { clientOptions.browserbaseApiKey(browserbaseApiKey) } + /** Your [Browserbase Project ID](https://www.browserbase.com/settings) */ fun browserbaseProjectId(browserbaseProjectId: String) = apply { clientOptions.browserbaseProjectId(browserbaseProjectId) } + /** Your LLM provider API key (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) */ fun modelApiKey(modelApiKey: String) = apply { clientOptions.modelApiKey(modelApiKey) } fun headers(headers: Headers) = apply { clientOptions.headers(headers) } diff --git a/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt index 46107c5..8692cb0 100644 --- a/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt +++ b/stagehand-java-core/src/main/kotlin/com/browserbase/api/core/ClientOptions.kt @@ -93,8 +93,11 @@ private constructor( * Defaults to 2. */ @get:JvmName("maxRetries") val maxRetries: Int, + /** Your [Browserbase API Key](https://www.browserbase.com/settings) */ @get:JvmName("browserbaseApiKey") val browserbaseApiKey: String, + /** Your [Browserbase Project ID](https://www.browserbase.com/settings) */ @get:JvmName("browserbaseProjectId") val browserbaseProjectId: String, + /** Your LLM provider API key (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) */ @get:JvmName("modelApiKey") val modelApiKey: String, ) { @@ -278,14 +281,17 @@ private constructor( */ fun maxRetries(maxRetries: Int) = apply { this.maxRetries = maxRetries } + /** Your [Browserbase API Key](https://www.browserbase.com/settings) */ fun browserbaseApiKey(browserbaseApiKey: String) = apply { this.browserbaseApiKey = browserbaseApiKey } + /** Your [Browserbase Project ID](https://www.browserbase.com/settings) */ fun browserbaseProjectId(browserbaseProjectId: String) = apply { this.browserbaseProjectId = browserbaseProjectId } + /** Your LLM provider API key (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) */ fun modelApiKey(modelApiKey: String) = apply { this.modelApiKey = modelApiKey } fun headers(headers: Headers) = apply { From 143d677a548f9b67f6d1960588d3d79e9c7647fe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 20:33:37 +0000 Subject: [PATCH 12/14] feat(api): manual updates --- .stats.yml | 2 +- README.md | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 91b86f3..35f1aef 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-2c88c6d890406ff8a5f1bca692264fb9af4bc4fe64df0986e06d3386fc6d6fcb.yml openapi_spec_hash: dc6ea17f8152708dc0a390c7f86b1a5d -config_hash: b01f15c540ab2c92808c2bba96368631 +config_hash: bdeeac521c2cf3846aec9f75cb681d97 diff --git a/README.md b/README.md index 273c14d..9c78d27 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ import com.browserbase.api.models.sessions.SessionActResponse; StagehandClient client = StagehandOkHttpClient.fromEnv(); SessionActParams params = SessionActParams.builder() - .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .sessionId("00000000-your-session-id-000000000000") .input("click the first link on the page") .build(); SessionActResponse response = client.sessions().act(params); @@ -162,7 +162,7 @@ import java.util.concurrent.CompletableFuture; StagehandClient client = StagehandOkHttpClient.fromEnv(); SessionActParams params = SessionActParams.builder() - .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .sessionId("00000000-your-session-id-000000000000") .input("click the first link on the page") .build(); CompletableFuture response = client.async().sessions().act(params); @@ -182,7 +182,7 @@ import java.util.concurrent.CompletableFuture; StagehandClientAsync client = StagehandOkHttpClientAsync.fromEnv(); SessionActParams params = SessionActParams.builder() - .sessionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .sessionId("00000000-your-session-id-000000000000") .input("click the first link on the page") .build(); CompletableFuture response = client.sessions().act(params); @@ -203,8 +203,8 @@ import com.browserbase.api.models.sessions.SessionStartParams; import com.browserbase.api.models.sessions.SessionStartResponse; SessionStartParams params = SessionStartParams.builder() - .browserbaseApiKey("BROWSERBASE_API_KEY") - .browserbaseProjectId("BROWSERBASE_PROJECT_ID") + .browserbaseApiKey("") + .browserbaseProjectId("") .build(); HttpResponseFor response = client.sessions().withRawResponse().start(params); From fc727a5b31266f49cd0e5e43df3b070d5fe0768a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 21:15:46 +0000 Subject: [PATCH 13/14] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 35f1aef..d9fd06e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-2c88c6d890406ff8a5f1bca692264fb9af4bc4fe64df0986e06d3386fc6d6fcb.yml openapi_spec_hash: dc6ea17f8152708dc0a390c7f86b1a5d -config_hash: bdeeac521c2cf3846aec9f75cb681d97 +config_hash: a17b6052ac65237b7b8e145f4f692d3c From 9065bb23112d8f28ebdae88c42e447e81388fa6c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 21:16:02 +0000 Subject: [PATCH 14/14] release: 0.1.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 25 +++++++++++++++++++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1332969..3d2ac0b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1" + ".": "0.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1edbced --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,25 @@ +# Changelog + +## 0.1.0 (2025-12-16) + +Full Changelog: [v0.0.1...v0.1.0](https://github.com/browserbase/stagehand-java/compare/v0.0.1...v0.1.0) + +### Features + +* **api:** manual updates ([143d677](https://github.com/browserbase/stagehand-java/commit/143d677a548f9b67f6d1960588d3d79e9c7647fe)) +* **api:** manual updates ([f2d0690](https://github.com/browserbase/stagehand-java/commit/f2d0690f93415cafad61334d8eeb8c90d9ae2e43)) +* **api:** manual updates ([48825ea](https://github.com/browserbase/stagehand-java/commit/48825eac78b9dd280020359253465ec0ab9d7405)) +* **api:** manual updates ([daa8c1c](https://github.com/browserbase/stagehand-java/commit/daa8c1cbe7c3e67400d8661cbd511f47b61de91f)) +* **api:** manual updates ([5d55cd0](https://github.com/browserbase/stagehand-java/commit/5d55cd0023694ed48862fa1737cce1cc67ec6a3f)) +* **api:** manual updates ([2262f19](https://github.com/browserbase/stagehand-java/commit/2262f19462ce4e79f80df49c7652e3144c11c9c6)) +* **api:** manual updates ([afa389f](https://github.com/browserbase/stagehand-java/commit/afa389f483845081daf43d102094e902c847efa5)) +* **api:** manual updates ([5787da6](https://github.com/browserbase/stagehand-java/commit/5787da654a785904d9629e20baa9dc90739a35a5)) +* **api:** manual updates ([40e95ed](https://github.com/browserbase/stagehand-java/commit/40e95ede73876583760706e7315f3621af2f8433)) +* **api:** manual updates ([c6de1b7](https://github.com/browserbase/stagehand-java/commit/c6de1b76dc1deb1355c2e119740d4f494679e1ed)) +* **api:** manual updates ([df9be74](https://github.com/browserbase/stagehand-java/commit/df9be74e9177579935e429d40c1c2574fd7f45e5)) +* **api:** tweak branding and fix some config fields ([051317b](https://github.com/browserbase/stagehand-java/commit/051317bb6932ec86f0a990e181ffdce23c674785)) + + +### Chores + +* configure new SDK language ([7dcaca9](https://github.com/browserbase/stagehand-java/commit/7dcaca9445c9adcf6b88d7fc6393e974dae2b56e)) diff --git a/README.md b/README.md index 9c78d27..54118d3 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.browserbase.api/stagehand-java)](https://central.sonatype.com/artifact/com.browserbase.api/stagehand-java/0.0.1) -[![javadoc](https://javadoc.io/badge2/com.browserbase.api/stagehand-java/0.0.1/javadoc.svg)](https://javadoc.io/doc/com.browserbase.api/stagehand-java/0.0.1) +[![Maven Central](https://img.shields.io/maven-central/v/com.browserbase.api/stagehand-java)](https://central.sonatype.com/artifact/com.browserbase.api/stagehand-java/0.1.0) +[![javadoc](https://javadoc.io/badge2/com.browserbase.api/stagehand-java/0.1.0/javadoc.svg)](https://javadoc.io/doc/com.browserbase.api/stagehand-java/0.1.0) @@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [docs.stagehand.dev](https://docs.stagehand.dev). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.browserbase.api/stagehand-java/0.0.1). +The REST API documentation can be found on [docs.stagehand.dev](https://docs.stagehand.dev). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.browserbase.api/stagehand-java/0.1.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.stagehand.dev](https://docs.sta ### Gradle ```kotlin -implementation("com.browserbase.api:stagehand-java:0.0.1") +implementation("com.browserbase.api:stagehand-java:0.1.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.browserbase.api:stagehand-java:0.0.1") com.browserbase.api stagehand-java - 0.0.1 + 0.1.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 0913290..a32fb45 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ repositories { allprojects { group = "com.browserbase.api" - version = "0.0.1" // x-release-please-version + version = "0.1.0" // x-release-please-version } subprojects {