From 9dc19597f95c98bc18d1f0a334c930cc982bf89f Mon Sep 17 00:00:00 2001 From: pritamsoni-hsr <23050213+pritamsoni-hsr@users.noreply.github.com> Date: Thu, 5 Mar 2026 12:58:01 +0530 Subject: [PATCH 1/3] auto select url based on env --- src/overmind-client.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/overmind-client.ts b/src/overmind-client.ts index 70f58f0..859c234 100644 --- a/src/overmind-client.ts +++ b/src/overmind-client.ts @@ -27,6 +27,10 @@ type OvermindClientConfig = { appName?: string; }; +const LOCAL_API_KEY_PREFIX = "ovr_core_"; +const LOCAL_BASE_URL = "http://localhost:8000"; +const DEFAULT_BASE_URL = "https://api.overmindlab.ai"; + export class OvermindClient { public readonly appName: string; private version: string = version; @@ -36,14 +40,16 @@ export class OvermindClient { public experimentSlug?: string; constructor(config: OvermindClientConfig) { + // biome-ignore lint/style/noNonNullAssertion: must always set api key + this.apiKey = config.apiKey || process.env.OVERMIND_API_KEY!; + this.baseUrl = config.baseUrl || process.env.OVERMIND_API_URL || process.env.OVERMIND_TRACES_URL || - "https://api.overmindlab.ai"; - - // biome-ignore lint/style/noNonNullAssertion: must always set api key - this.apiKey = config.apiKey || process.env.OVERMIND_API_KEY!; + this.apiKey.startsWith(LOCAL_API_KEY_PREFIX) + ? LOCAL_BASE_URL + : DEFAULT_BASE_URL; this.appName = config.appName || "overmind-js"; if (!this.apiKey) { @@ -73,7 +79,7 @@ export class OvermindClient { const traceExporter = this.baseUrl ? new OTLPTraceExporter({ headers: { "X-API-TOKEN": this.apiKey }, - url: `${this.baseUrl}/api/v1/traces/create`, + url: `${this.baseUrl}/api/v1/traces`, }) : new ConsoleSpanExporter(); From 052e68da02bcc566df3acc3a70cc908cd46495ac Mon Sep 17 00:00:00 2001 From: pritamsoni-hsr <23050213+pritamsoni-hsr@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:16:19 +0530 Subject: [PATCH 2/3] add github pr check --- .github/workflows/pr-checks.yml | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/pr-checks.yml diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 0000000..5a05701 --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,56 @@ +name: Pull Request Checks + +on: + pull_request: + branches: + - main + types: [opened, synchronize, reopened] + paths-ignore: + - 'docs/**' + - '*.md' + - 'README.md' + +jobs: + test_and_check_version: + name: Test and Check Version + runs-on: ubuntu-latest + + steps: + - name: Check out base branch + uses: actions/checkout@v4 + with: + ref: ${{ github.base_ref }} + path: 'main' + + - name: Check out PR branch + uses: actions/checkout@v4 + with: + path: 'pr' + + - name: Check for version increment + id: check_version + run: | + # Install jq, a tool for parsing JSON + sudo apt-get update && sudo apt-get install -y jq + + # Extract version from the main branch's package.json + main_version=$(jq -r .version main/package.json) + echo "Version on main: $main_version" + + # Extract version from the PR branch's package.json + pr_version=$(jq -r .version pr/package.json) + echo "Version on PR branch: $pr_version" + + if [ "$main_version" == "$pr_version" ]; then + echo "Version has not been incremented from main." + exit 1 + fi + + # The `sort -V` command handles version numbers correctly. + # It understands that 0.1.10 is greater than 0.1.9. + if [ "$(printf '%s\n' "$main_version" "$pr_version" | sort -V | head -n1)" != "$main_version" ]; then + echo "PR version ($pr_version) is not greater than main version ($main_version)." + exit 1 + fi + + echo "Version check passed!" From dc01795533a745ca0e5fcb9793fece89f9fce64b Mon Sep 17 00:00:00 2001 From: pritamsoni-hsr <23050213+pritamsoni-hsr@users.noreply.github.com> Date: Thu, 5 Mar 2026 13:19:16 +0530 Subject: [PATCH 3/3] bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 40ebe7a..e8ab64f 100644 --- a/package.json +++ b/package.json @@ -43,5 +43,5 @@ "dev": "tsx watch src/index.ts", "format": "biome format --write" }, - "version": "0.0.6" + "version": "0.0.7" }