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.js
CHANGED
|
@@ -4435,6 +4435,7 @@ var plugin = async (input) => {
|
|
|
4435
4435
|
let projectPath;
|
|
4436
4436
|
let namespaceId;
|
|
4437
4437
|
const flowAgents = /* @__PURE__ */ new Map();
|
|
4438
|
+
const gitlabAgentNames = /* @__PURE__ */ new Set();
|
|
4438
4439
|
let cfgRef = null;
|
|
4439
4440
|
let baseModelIdRef;
|
|
4440
4441
|
async function load2() {
|
|
@@ -4469,6 +4470,7 @@ var plugin = async (input) => {
|
|
|
4469
4470
|
})
|
|
4470
4471
|
]);
|
|
4471
4472
|
flowAgents.clear();
|
|
4473
|
+
gitlabAgentNames.clear();
|
|
4472
4474
|
const currentNames = /* @__PURE__ */ new Set();
|
|
4473
4475
|
for (const agent of result.agents) {
|
|
4474
4476
|
const isFlow = agent.itemType === "FLOW";
|
|
@@ -4483,6 +4485,7 @@ var plugin = async (input) => {
|
|
|
4483
4485
|
mode: "subagent"
|
|
4484
4486
|
};
|
|
4485
4487
|
} else {
|
|
4488
|
+
gitlabAgentNames.add(dName);
|
|
4486
4489
|
cfgRef.agent[dName] = {
|
|
4487
4490
|
name: dName,
|
|
4488
4491
|
description: agent.foundational ? "[GitLab Foundational Agent]" : "[GitLab Custom Agent]",
|
|
@@ -4525,6 +4528,7 @@ var plugin = async (input) => {
|
|
|
4525
4528
|
};
|
|
4526
4529
|
} else {
|
|
4527
4530
|
const displayName = `${agent.name}${icon}`;
|
|
4531
|
+
gitlabAgentNames.add(displayName);
|
|
4528
4532
|
cfg.agent[displayName] = {
|
|
4529
4533
|
name: displayName,
|
|
4530
4534
|
description: agent.foundational ? "[GitLab Foundational Agent]" : "[GitLab Custom Agent]",
|
|
@@ -4623,6 +4627,18 @@ var plugin = async (input) => {
|
|
|
4623
4627
|
output.parts.splice(idx, 1);
|
|
4624
4628
|
}
|
|
4625
4629
|
},
|
|
4630
|
+
"chat.params": async (input2, _output) => {
|
|
4631
|
+
if (!gitlabAgentNames.has(input2.agent)) return;
|
|
4632
|
+
const model = input2.model;
|
|
4633
|
+
const modelId = model?.modelID ?? model?.id ?? "";
|
|
4634
|
+
const isDWS = modelId.includes("duo-workflow");
|
|
4635
|
+
if (!isDWS) {
|
|
4636
|
+
const name = model?.name ?? modelId ?? "unknown";
|
|
4637
|
+
throw new Error(
|
|
4638
|
+
`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.`
|
|
4639
|
+
);
|
|
4640
|
+
}
|
|
4641
|
+
},
|
|
4626
4642
|
tool: {
|
|
4627
4643
|
gitlab_execute_project_flow: tool({
|
|
4628
4644
|
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.",
|