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