opencode-gitlab-dap 1.4.3 → 1.5.0

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 CHANGED
@@ -49,12 +49,29 @@ Type `@Flow Name` followed by your goal to execute a flow:
49
49
 
50
50
  The plugin:
51
51
 
52
- 1. Intercepts the `@` mention via `chat.message` hook
53
- 2. Dispatches a subagent that fetches the flow definition
54
- 3. Gathers required inputs using available GitLab tools
55
- 4. Executes the flow via `POST /api/v4/ai/duo_workflows/workflows`
56
- 5. Monitors workflow status until it starts running
57
- 6. Reports the workflow URL for tracking in GitLab UI
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.
58
75
 
59
76
  ### 13 DAP Tools
60
77
 
@@ -97,7 +114,7 @@ User-defined agents from the AI Catalog. Appear in `/agents` with `[GitLab Custo
97
114
 
98
115
  ### Flows (Foundational & Custom)
99
116
 
100
- Multi-step workflows. Appear in `@` menu with `[GitLab Flow]` label. Executed via subagent dispatch.
117
+ 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
118
 
102
119
  ### External Agents
103
120
 
@@ -128,7 +145,7 @@ export GITLAB_INSTANCE_URL=https://your-instance.com
128
145
 
129
146
  ```bash
130
147
  npm install
131
- npm test # Run tests (48 tests)
148
+ npm test # Run tests (58 tests)
132
149
  npm run build # Build (auto-runs vendor:generate)
133
150
  npm run type-check
134
151
  ```
@@ -154,26 +171,36 @@ git commit -m "chore: update vendored foundational flow definitions"
154
171
 
155
172
  ```
156
173
  Plugin init
157
- ├─ readAuth() reads ~/.local/share/opencode/auth.json
158
- ├─ GitLabModelCache reads model cache (no network call)
174
+ ├─ readAuth() reads ~/.local/share/opencode/auth.json
175
+ ├─ GitLabModelCache reads model cache (no network call)
159
176
  ├─ fetchCatalogAgents()
160
- │ ├─ aiFoundationalChatAgents (GraphQL) → foundational agents
161
- │ └─ aiCatalogConfiguredItems (GraphQL) → custom agents + flows
162
- │ └─ aiCatalogAgentFlowConfig (GraphQL) → flow config YAML
163
- ├─ config hook injects agents (primary) + flows (subagent)
164
- ├─ chat.message hook intercepts @flow mentions subagent dispatch
165
- └─ tool hook 13 DAP tools
166
-
167
- Flow execution (@FlowName):
168
- ├─ chat.message hook replaces AgentPart with subagent instructions
169
- ├─ Primary agent dispatches Task subagent
170
- ├─ Subagent Step 1 gitlab_get_flow_definition → read inputs
171
- ├─ Subagent Step 2 GitLab tools gather input values
172
- ├─ Subagent Step 3 gitlab_execute_project_flow POST to DWS
173
- └─ Subagent Step 4 gitlab_get_workflow_statusconfirm started
177
+ │ ├─ aiFoundationalChatAgents foundational agents (GraphQL)
178
+ │ └─ aiCatalogConfiguredItems custom agents + flows (GraphQL)
179
+ │ └─ aiCatalogAgentFlowConfig flow config YAML (GraphQL)
180
+ ├─ config hook injects agents (primary) + flows (subagent with prompt)
181
+ ├─ chat.message hook intercepts multi-@flow → combined dispatch
182
+ ├─ experimental.chat.system.transform injects flow dispatch guidelines
183
+ └─ tool hook 13 DAP tools
184
+
185
+ Single flow execution (@FlowName goal):
186
+ ├─ Native subagent dispatch opencode routes to registered subagent
187
+ ├─ Subagent Step 1 gitlab_get_flow_definition → parse context:goal mapping
188
+ ├─ Subagent Step 2 Resolve goal to exact value (MR IID, URL, etc.)
189
+ ├─ Subagent Step 3 Gather additional_context inputs via GitLab tools
190
+ ├─ Subagent Step 4 gitlab_execute_project_flowPOST to DWS
191
+ └─ Subagent Step 5 gitlab_get_workflow_status → report status + URL
192
+
193
+ Multi-flow execution (@Flow1 @Flow2 goal):
194
+ ├─ chat.message hook detects multiple @mentions → combined dispatch
195
+ ├─ Primary agent dispatches ONE general subagent via Task tool
196
+ ├─ General subagent calls gitlab_get_flow_definition for all flows (concurrent)
197
+ ├─ (if batch) lists resources via GitLab API
198
+ ├─ General subagent calls gitlab_execute_project_flow × N (concurrent)
199
+ ├─ General subagent calls gitlab_get_workflow_status × N (concurrent)
200
+ └─ General subagent presents summary table
174
201
 
175
202
  Enable/disable:
176
- └─ refreshAgents() clears cache, re-fetches, updates cfg.agent
203
+ └─ refreshAgents() clears cache, re-fetches, updates cfg.agent
177
204
  ```
178
205
 
179
206
  ## License