opencode-gitlab-dap 1.4.2 → 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 +52 -25
- package/dist/index.cjs +469 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +469 -63
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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.
|
|
53
|
-
2.
|
|
54
|
-
3.
|
|
55
|
-
4.
|
|
56
|
-
5.
|
|
57
|
-
6.
|
|
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.
|
|
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 (
|
|
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()
|
|
158
|
-
├─ GitLabModelCache
|
|
174
|
+
├─ readAuth() reads ~/.local/share/opencode/auth.json
|
|
175
|
+
├─ GitLabModelCache reads model cache (no network call)
|
|
159
176
|
├─ fetchCatalogAgents()
|
|
160
|
-
│ ├─ aiFoundationalChatAgents (GraphQL)
|
|
161
|
-
│ └─ aiCatalogConfiguredItems
|
|
162
|
-
│ └─ aiCatalogAgentFlowConfig
|
|
163
|
-
├─ config hook
|
|
164
|
-
├─ chat.message hook
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
├─
|
|
170
|
-
├─ Subagent Step 1
|
|
171
|
-
├─ Subagent Step 2
|
|
172
|
-
├─ Subagent Step 3
|
|
173
|
-
|
|
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_flow → POST 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()
|
|
203
|
+
└─ refreshAgents() clears cache, re-fetches, updates cfg.agent
|
|
177
204
|
```
|
|
178
205
|
|
|
179
206
|
## License
|