gitlab-ai-provider 6.16.0 → 6.17.1
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 +10 -0
- package/dist/index.d.mts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/dist/gitlab-ai-provider-6.16.0.tgz +0 -0
package/dist/index.mjs
CHANGED
|
@@ -2694,7 +2694,7 @@ import { AsyncResource } from "async_hooks";
|
|
|
2694
2694
|
import WebSocket from "isomorphic-ws";
|
|
2695
2695
|
|
|
2696
2696
|
// src/version.ts
|
|
2697
|
-
var VERSION = true ? "6.
|
|
2697
|
+
var VERSION = true ? "6.17.1" : "0.0.0-dev";
|
|
2698
2698
|
|
|
2699
2699
|
// src/gitlab-workflow-client.ts
|
|
2700
2700
|
var WS_CONNECT_TIMEOUT_MS = 3e4;
|
|
@@ -3577,16 +3577,23 @@ function getCacheFilePath() {
|
|
|
3577
3577
|
const cacheHome = process.env.XDG_CACHE_HOME || path3.join(os.homedir(), ".cache");
|
|
3578
3578
|
return path3.join(cacheHome, "opencode", "gitlab-workflow-model-cache.json");
|
|
3579
3579
|
}
|
|
3580
|
-
function computeCacheKey(workDir, instanceUrl) {
|
|
3580
|
+
function computeCacheKey(workDir, instanceUrl, scope) {
|
|
3581
3581
|
const normalizedUrl = (instanceUrl || "https://gitlab.com").replace(/\/$/, "");
|
|
3582
|
-
|
|
3582
|
+
const input = scope ? `${workDir}\0${normalizedUrl}\0${scope}` : `${workDir}\0${normalizedUrl}`;
|
|
3583
|
+
return crypto.createHash("sha256").update(input).digest("hex").slice(0, 12);
|
|
3583
3584
|
}
|
|
3584
3585
|
var GitLabModelCache = class {
|
|
3585
3586
|
filePath;
|
|
3586
3587
|
key;
|
|
3587
|
-
|
|
3588
|
+
/**
|
|
3589
|
+
* @param workDir - Workspace directory the cache entry belongs to
|
|
3590
|
+
* @param instanceUrl - GitLab instance URL
|
|
3591
|
+
* @param scope - Optional extra key component (e.g. an account identifier) that keeps
|
|
3592
|
+
* entries for different accounts on the same workspace and instance apart
|
|
3593
|
+
*/
|
|
3594
|
+
constructor(workDir, instanceUrl, scope) {
|
|
3588
3595
|
this.filePath = getCacheFilePath();
|
|
3589
|
-
this.key = computeCacheKey(workDir, instanceUrl);
|
|
3596
|
+
this.key = computeCacheKey(workDir, instanceUrl, scope);
|
|
3590
3597
|
}
|
|
3591
3598
|
readAll() {
|
|
3592
3599
|
try {
|
|
@@ -5854,7 +5861,11 @@ async function buildModels(discovered, project) {
|
|
|
5854
5861
|
return { models, project };
|
|
5855
5862
|
}
|
|
5856
5863
|
async function discoverWorkflowModels(config, options) {
|
|
5857
|
-
const cache = new GitLabModelCache(
|
|
5864
|
+
const cache = new GitLabModelCache(
|
|
5865
|
+
options.workingDirectory,
|
|
5866
|
+
config.instanceUrl,
|
|
5867
|
+
options.cacheKey
|
|
5868
|
+
);
|
|
5858
5869
|
if (!cache.isDiscoveryExpired()) {
|
|
5859
5870
|
const entry = cache.load();
|
|
5860
5871
|
if (entry?.discovery) {
|