opencode-gitlab-duo-agentic 0.1.12 → 0.1.14
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/dist/index.js +8 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ function normalizeInstanceUrl(value) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// src/plugin/config.ts
|
|
28
|
-
function applyRuntimeConfig(config
|
|
28
|
+
function applyRuntimeConfig(config) {
|
|
29
29
|
config.provider ??= {};
|
|
30
30
|
const current = config.provider[PROVIDER_ID] ?? {};
|
|
31
31
|
const options = current.options ?? {};
|
|
@@ -33,32 +33,25 @@ function applyRuntimeConfig(config, moduleUrl) {
|
|
|
33
33
|
const instanceUrl = normalizeInstanceUrl(options.instanceUrl ?? envInstanceUrl());
|
|
34
34
|
config.provider[PROVIDER_ID] = {
|
|
35
35
|
...current,
|
|
36
|
-
|
|
37
|
-
npm: current.npm ?? moduleUrl,
|
|
38
|
-
env: current.env ?? ["GITLAB_TOKEN", "GITLAB_INSTANCE_URL"],
|
|
36
|
+
whitelist: [MODEL_ID],
|
|
39
37
|
options: {
|
|
40
38
|
...options,
|
|
41
39
|
instanceUrl
|
|
42
40
|
},
|
|
43
|
-
models:
|
|
41
|
+
models: {
|
|
42
|
+
...models,
|
|
44
43
|
[MODEL_ID]: {
|
|
45
44
|
id: MODEL_ID,
|
|
46
|
-
name: "GitLab Duo Agentic
|
|
45
|
+
name: "GitLab Duo Agentic"
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
|
-
if (Array.isArray(config.disabled_providers)) {
|
|
51
|
-
config.disabled_providers = config.disabled_providers.filter((id) => id !== PROVIDER_ID);
|
|
52
|
-
}
|
|
53
|
-
if (Array.isArray(config.enabled_providers) && !config.enabled_providers.includes(PROVIDER_ID)) {
|
|
54
|
-
config.enabled_providers = [...config.enabled_providers, PROVIDER_ID];
|
|
55
|
-
}
|
|
56
49
|
}
|
|
57
50
|
|
|
58
51
|
// src/plugin/hooks.ts
|
|
59
|
-
async function createPluginHooks(_input
|
|
52
|
+
async function createPluginHooks(_input) {
|
|
60
53
|
return {
|
|
61
|
-
config: async (config) => applyRuntimeConfig(config
|
|
54
|
+
config: async (config) => applyRuntimeConfig(config)
|
|
62
55
|
};
|
|
63
56
|
}
|
|
64
57
|
|
|
@@ -109,7 +102,7 @@ function isPluginInput(value) {
|
|
|
109
102
|
}
|
|
110
103
|
var entry = (input) => {
|
|
111
104
|
if (isPluginInput(input)) {
|
|
112
|
-
return createPluginHooks(input
|
|
105
|
+
return createPluginHooks(input);
|
|
113
106
|
}
|
|
114
107
|
return createFallbackProvider();
|
|
115
108
|
};
|