opencode-gitlab-dap 1.4.1 → 1.4.3
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.cjs +16 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4469,6 +4469,7 @@ var plugin = async (input) => {
|
|
|
4469
4469
|
let projectPath;
|
|
4470
4470
|
let namespaceId;
|
|
4471
4471
|
const flowAgents = /* @__PURE__ */ new Map();
|
|
4472
|
+
const gitlabAgentNames = /* @__PURE__ */ new Set();
|
|
4472
4473
|
let cfgRef = null;
|
|
4473
4474
|
let baseModelIdRef;
|
|
4474
4475
|
async function load2() {
|
|
@@ -4503,6 +4504,7 @@ var plugin = async (input) => {
|
|
|
4503
4504
|
})
|
|
4504
4505
|
]);
|
|
4505
4506
|
flowAgents.clear();
|
|
4507
|
+
gitlabAgentNames.clear();
|
|
4506
4508
|
const currentNames = /* @__PURE__ */ new Set();
|
|
4507
4509
|
for (const agent of result.agents) {
|
|
4508
4510
|
const isFlow = agent.itemType === "FLOW";
|
|
@@ -4517,6 +4519,7 @@ var plugin = async (input) => {
|
|
|
4517
4519
|
mode: "subagent"
|
|
4518
4520
|
};
|
|
4519
4521
|
} else {
|
|
4522
|
+
gitlabAgentNames.add(dName);
|
|
4520
4523
|
cfgRef.agent[dName] = {
|
|
4521
4524
|
name: dName,
|
|
4522
4525
|
description: agent.foundational ? "[GitLab Foundational Agent]" : "[GitLab Custom Agent]",
|
|
@@ -4559,6 +4562,7 @@ var plugin = async (input) => {
|
|
|
4559
4562
|
};
|
|
4560
4563
|
} else {
|
|
4561
4564
|
const displayName = `${agent.name}${icon}`;
|
|
4565
|
+
gitlabAgentNames.add(displayName);
|
|
4562
4566
|
cfg.agent[displayName] = {
|
|
4563
4567
|
name: displayName,
|
|
4564
4568
|
description: agent.foundational ? "[GitLab Foundational Agent]" : "[GitLab Custom Agent]",
|
|
@@ -4657,6 +4661,18 @@ var plugin = async (input) => {
|
|
|
4657
4661
|
output.parts.splice(idx, 1);
|
|
4658
4662
|
}
|
|
4659
4663
|
},
|
|
4664
|
+
"chat.params": async (input2, _output) => {
|
|
4665
|
+
if (!gitlabAgentNames.has(input2.agent)) return;
|
|
4666
|
+
const model = input2.model;
|
|
4667
|
+
const modelId = model?.modelID ?? model?.id ?? "";
|
|
4668
|
+
const isDWS = modelId.includes("duo-workflow");
|
|
4669
|
+
if (!isDWS) {
|
|
4670
|
+
const name = model?.name ?? modelId ?? "unknown";
|
|
4671
|
+
throw new Error(
|
|
4672
|
+
`GitLab agent "${input2.agent}" requires an Agent Platform model but the current model is "${name}". Please switch to an Agent Platform model (duo-workflow-*) in the model picker to use GitLab agents.`
|
|
4673
|
+
);
|
|
4674
|
+
}
|
|
4675
|
+
},
|
|
4660
4676
|
tool: {
|
|
4661
4677
|
gitlab_execute_project_flow: (0, import_plugin.tool)({
|
|
4662
4678
|
description: "Execute a GitLab DAP flow on a project.\nTriggers a flow via the Duo Workflow Service REST API.\nThe flow runs asynchronously and is visible in the GitLab UI.\nReturns the workflow record with ID and status.\nThe additional_context parameter accepts flow-specific inputs as a JSON array of {Category, Content} objects.",
|