opencode-gitlab-dap 1.4.3 → 1.5.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/README.md +101 -43
- package/dist/index.cjs +453 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +453 -63
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,30 +49,69 @@ Type `@Flow Name` followed by your goal to execute a flow:
|
|
|
49
49
|
|
|
50
50
|
The plugin:
|
|
51
51
|
|
|
52
|
-
1.
|
|
53
|
-
2.
|
|
54
|
-
3.
|
|
55
|
-
4.
|
|
56
|
-
5.
|
|
57
|
-
6.
|
|
58
|
-
|
|
59
|
-
###
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
52
|
+
1. Registers the flow as a subagent with a built-in prompt containing flow execution instructions
|
|
53
|
+
2. The subagent fetches the flow definition and parses what `context:goal` maps to (e.g., `merge_request_iid`, `pipeline_url`)
|
|
54
|
+
3. Resolves the goal to the exact value the flow expects (e.g., just `14` for an MR IID, not a sentence)
|
|
55
|
+
4. Gathers required additional inputs using available GitLab tools
|
|
56
|
+
5. Executes the flow via `POST /api/v4/ai/duo_workflows/workflows`
|
|
57
|
+
6. Monitors workflow status and reports the workflow URL for tracking in GitLab UI
|
|
58
|
+
|
|
59
|
+
### Parallel Multi-Flow Dispatch
|
|
60
|
+
|
|
61
|
+
Mention multiple flows in a single message to execute them simultaneously:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
@AppSec Security MR Reviewer @Code Review 🦊 review all open MRs
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
When multiple flows are mentioned:
|
|
68
|
+
|
|
69
|
+
1. The `chat.message` hook detects multiple `@` mentions and produces a single combined dispatch instruction
|
|
70
|
+
2. A single `general` subagent is dispatched via the Task tool
|
|
71
|
+
3. The subagent executes all flows concurrently — it calls `gitlab_get_flow_definition` for all flows at once, then `gitlab_execute_project_flow` for all flow+resource combinations, then polls all statuses
|
|
72
|
+
4. For batch operations ("for each MR", "all open MRs"), the main agent lists resources first, then the subagent dispatches N flows × M resources in parallel
|
|
73
|
+
|
|
74
|
+
The `experimental.chat.system.transform` hook injects system prompt guidelines that instruct the main agent on how to handle multi-flow and batch dispatch scenarios.
|
|
75
|
+
|
|
76
|
+
### Custom Agent Creation
|
|
77
|
+
|
|
78
|
+
Create custom agents interactively:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Create an agent that responds to prompts in the form of poems
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The plugin guides you through an interactive workflow:
|
|
85
|
+
|
|
86
|
+
1. Discovers available built-in tools (`gitlab_list_builtin_tools`) and MCP servers (`gitlab_list_project_mcp_servers`)
|
|
87
|
+
2. Asks for agent name, visibility, tool categories, and MCP servers via the question tool
|
|
88
|
+
3. Generates a system prompt and shows the full configuration for approval
|
|
89
|
+
4. Creates the agent via `gitlab_create_agent` (with `confirmed` gate to prevent accidental creation)
|
|
90
|
+
5. Offers to enable the agent on the current project
|
|
91
|
+
|
|
92
|
+
The `confirmed` parameter on `gitlab_create_agent` enforces the interactive workflow — the tool returns instructions instead of creating the agent when called without explicit confirmation.
|
|
93
|
+
|
|
94
|
+
### 17 DAP Tools
|
|
95
|
+
|
|
96
|
+
| Tool | Description |
|
|
97
|
+
| --------------------------------- | ------------------------------------------------------- |
|
|
98
|
+
| `gitlab_list_agents` | Search agents in the global AI Catalog |
|
|
99
|
+
| `gitlab_get_agent` | Get agent details by ID |
|
|
100
|
+
| `gitlab_list_project_agents` | List agents enabled for a project |
|
|
101
|
+
| `gitlab_enable_project_agent` | Enable an agent in a project |
|
|
102
|
+
| `gitlab_disable_project_agent` | Disable an agent in a project |
|
|
103
|
+
| `gitlab_create_agent` | Create a custom agent (interactive, confirmation-gated) |
|
|
104
|
+
| `gitlab_update_agent` | Update an existing custom agent |
|
|
105
|
+
| `gitlab_list_builtin_tools` | List available built-in tools for agent configuration |
|
|
106
|
+
| `gitlab_list_flows` | Search flows in the global AI Catalog |
|
|
107
|
+
| `gitlab_get_flow` | Get flow details by ID |
|
|
108
|
+
| `gitlab_list_project_flows` | List flows enabled for a project |
|
|
109
|
+
| `gitlab_enable_project_flow` | Enable a flow in a project |
|
|
110
|
+
| `gitlab_disable_project_flow` | Disable a flow in a project |
|
|
111
|
+
| `gitlab_execute_project_flow` | Execute a flow via DWS REST API |
|
|
112
|
+
| `gitlab_get_flow_definition` | Get flow YAML config (inputs, components) |
|
|
113
|
+
| `gitlab_get_workflow_status` | Monitor workflow execution status and logs |
|
|
114
|
+
| `gitlab_list_project_mcp_servers` | List MCP servers available for project agents |
|
|
76
115
|
|
|
77
116
|
### Dynamic Refresh
|
|
78
117
|
|
|
@@ -97,7 +136,7 @@ User-defined agents from the AI Catalog. Appear in `/agents` with `[GitLab Custo
|
|
|
97
136
|
|
|
98
137
|
### Flows (Foundational & Custom)
|
|
99
138
|
|
|
100
|
-
Multi-step workflows. Appear in `@` menu with `[GitLab Flow]` label.
|
|
139
|
+
Multi-step workflows. Appear in `@` menu with `[GitLab Flow]` label. Each flow is registered as a subagent with a built-in prompt that handles flow definition parsing, goal resolution, and execution. Single flows dispatch natively; multiple flows are batched into a single `general` subagent for parallel execution.
|
|
101
140
|
|
|
102
141
|
### External Agents
|
|
103
142
|
|
|
@@ -128,7 +167,7 @@ export GITLAB_INSTANCE_URL=https://your-instance.com
|
|
|
128
167
|
|
|
129
168
|
```bash
|
|
130
169
|
npm install
|
|
131
|
-
npm test # Run tests (
|
|
170
|
+
npm test # Run tests (62 tests)
|
|
132
171
|
npm run build # Build (auto-runs vendor:generate)
|
|
133
172
|
npm run type-check
|
|
134
173
|
```
|
|
@@ -154,26 +193,45 @@ git commit -m "chore: update vendored foundational flow definitions"
|
|
|
154
193
|
|
|
155
194
|
```
|
|
156
195
|
Plugin init
|
|
157
|
-
├─ readAuth()
|
|
158
|
-
├─ GitLabModelCache
|
|
196
|
+
├─ readAuth() reads ~/.local/share/opencode/auth.json
|
|
197
|
+
├─ GitLabModelCache reads model cache (no network call)
|
|
159
198
|
├─ fetchCatalogAgents()
|
|
160
|
-
│ ├─ aiFoundationalChatAgents (GraphQL)
|
|
161
|
-
│ └─ aiCatalogConfiguredItems
|
|
162
|
-
│ └─ aiCatalogAgentFlowConfig
|
|
163
|
-
├─ config hook
|
|
164
|
-
├─ chat.message hook
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
├─
|
|
170
|
-
├─
|
|
171
|
-
├─
|
|
172
|
-
├─
|
|
173
|
-
|
|
199
|
+
│ ├─ aiFoundationalChatAgents foundational agents (GraphQL)
|
|
200
|
+
│ └─ aiCatalogConfiguredItems custom agents + flows (GraphQL)
|
|
201
|
+
│ └─ aiCatalogAgentFlowConfig flow config YAML (GraphQL)
|
|
202
|
+
├─ config hook injects agents (primary) + flows (subagent with prompt)
|
|
203
|
+
├─ chat.message hook intercepts @flow → general subagent dispatch
|
|
204
|
+
├─ experimental.chat.system.transform injects flow dispatch + agent creation guidelines
|
|
205
|
+
└─ tool hook 17 DAP tools
|
|
206
|
+
|
|
207
|
+
Single flow execution (@FlowName goal):
|
|
208
|
+
├─ chat.message hook rewrites @mention → Task tool with general subagent
|
|
209
|
+
├─ General subagent Step 1 gitlab_get_flow_definition → parse context:goal mapping
|
|
210
|
+
├─ General subagent Step 2 Resolve goal to exact value (MR IID, URL, etc.)
|
|
211
|
+
├─ General subagent Step 3 Gather additional_context inputs via GitLab tools
|
|
212
|
+
├─ General subagent Step 4 gitlab_execute_project_flow → POST to DWS
|
|
213
|
+
└─ General subagent Step 5 gitlab_get_workflow_status → report status + URL
|
|
214
|
+
|
|
215
|
+
Multi-flow execution (@Flow1 @Flow2 goal):
|
|
216
|
+
├─ chat.message hook detects multiple @mentions → combined dispatch
|
|
217
|
+
├─ Primary agent dispatches ONE general subagent via Task tool
|
|
218
|
+
├─ General subagent calls gitlab_get_flow_definition for all flows (concurrent)
|
|
219
|
+
├─ (if batch) lists resources via GitLab API
|
|
220
|
+
├─ General subagent calls gitlab_execute_project_flow × N (concurrent)
|
|
221
|
+
├─ General subagent calls gitlab_get_workflow_status × N (concurrent)
|
|
222
|
+
└─ General subagent presents summary table
|
|
223
|
+
|
|
224
|
+
Agent creation (interactive):
|
|
225
|
+
├─ gitlab_create_agent called without confirmed → returns instructions
|
|
226
|
+
├─ gitlab_list_builtin_tools discover available tools
|
|
227
|
+
├─ gitlab_list_project_mcp_servers discover MCP servers
|
|
228
|
+
├─ question tool ask user for name, visibility, tools, MCP servers
|
|
229
|
+
├─ LLM generates system prompt → user confirms
|
|
230
|
+
├─ gitlab_create_agent called with confirmed=true → creates agent
|
|
231
|
+
└─ gitlab_enable_project_agent optionally enable on project
|
|
174
232
|
|
|
175
233
|
Enable/disable:
|
|
176
|
-
└─ refreshAgents()
|
|
234
|
+
└─ refreshAgents() clears cache, re-fetches, updates cfg.agent
|
|
177
235
|
```
|
|
178
236
|
|
|
179
237
|
## License
|