gitlab-ai-provider 6.9.1 → 6.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
4
4
 
5
+ ## <small>6.9.2 (2026-06-10)</small>
6
+
7
+ - Merge branch 'fix/auth-json-api-token-handling' into 'main' ([19a6e58](https://gitlab.com/vglafirov/gitlab-ai-provider/commit/19a6e58))
8
+ - fix(auth): use PAT and enterpriseUrl-less OAuth tokens from auth.json ([6feeb58](https://gitlab.com/vglafirov/gitlab-ai-provider/commit/6feeb58))
9
+
5
10
  ## <small>6.9.1 (2026-06-10)</small>
6
11
 
7
12
  - Merge branch 'fix-security-review-hardening' into 'main' ([81e627b](https://gitlab.com/vglafirov/gitlab-ai-provider/commit/81e627b))
package/dist/index.js CHANGED
@@ -2496,7 +2496,7 @@ var import_node_async_hooks = require("async_hooks");
2496
2496
  var import_isomorphic_ws = __toESM(require("isomorphic-ws"));
2497
2497
 
2498
2498
  // src/version.ts
2499
- var VERSION = true ? "6.9.0" : "0.0.0-dev";
2499
+ var VERSION = true ? "6.9.1" : "0.0.0-dev";
2500
2500
 
2501
2501
  // src/gitlab-workflow-client.ts
2502
2502
  var WS_CONNECT_TIMEOUT_MS = 3e4;
@@ -5048,12 +5048,15 @@ async function loadOpenCodeAuth(instanceUrl) {
5048
5048
  }
5049
5049
  const authData = JSON.parse(fs3.readFileSync(authPath, "utf-8"));
5050
5050
  const normalizedUrl = instanceUrl.replace(/\/$/, "");
5051
- if (authData.gitlab?.type === "oauth") {
5052
- const gitlabAuth = authData.gitlab;
5053
- const normalizedEnterpriseUrl = typeof gitlabAuth.enterpriseUrl === "string" ? gitlabAuth.enterpriseUrl.replace(/\/$/, "") : gitlabAuth.enterpriseUrl;
5054
- if (normalizedEnterpriseUrl === normalizedUrl) {
5051
+ const gitlabAuth = authData.gitlab;
5052
+ if (gitlabAuth?.type === "oauth") {
5053
+ const normalizedEnterpriseUrl = typeof gitlabAuth.enterpriseUrl === "string" ? gitlabAuth.enterpriseUrl.replace(/\/$/, "") : void 0;
5054
+ const matchesInstance = normalizedEnterpriseUrl === normalizedUrl || normalizedEnterpriseUrl === void 0 && normalizedUrl === GITLAB_COM_URL;
5055
+ if (matchesInstance) {
5055
5056
  return gitlabAuth;
5056
5057
  }
5058
+ } else if (gitlabAuth?.type === "api" && typeof gitlabAuth.key === "string") {
5059
+ return gitlabAuth;
5057
5060
  }
5058
5061
  const auth = authData[normalizedUrl] || authData[`${normalizedUrl}/`];
5059
5062
  return auth;
@@ -5066,6 +5069,9 @@ async function loadApiKey(options, instanceUrl, clientId) {
5066
5069
  return options.apiKey;
5067
5070
  }
5068
5071
  const auth = await loadOpenCodeAuth(instanceUrl);
5072
+ if (auth?.type === "api") {
5073
+ return auth.key;
5074
+ }
5069
5075
  if (auth?.type === "oauth") {
5070
5076
  const oauthManager = new GitLabOAuthManager();
5071
5077
  if (oauthManager.needsRefresh(auth.expires)) {