opencode-gitlab-dap 1.10.0 → 1.10.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/dist/index.cjs +5 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -61
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2082,18 +2082,6 @@ var FLOW_DISPATCH_GUIDELINES = [
|
|
|
2082
2082
|
`resources yourself using GitLab API tools, then dispatch ONE general subagent whose prompt`,
|
|
2083
2083
|
`includes all flow executions (N flows x M resources) to run in parallel.`
|
|
2084
2084
|
].join("\n");
|
|
2085
|
-
var AGENT_CREATION_GUIDELINES = `## Creating Custom GitLab Agents
|
|
2086
|
-
|
|
2087
|
-
Before calling gitlab_create_agent, you MUST:
|
|
2088
|
-
1. Call gitlab_list_builtin_tools and gitlab_list_project_mcp_servers.
|
|
2089
|
-
2. Ask the user 4 questions using the question tool (one call, all 4 questions):
|
|
2090
|
-
- Agent name (suggest one, allow custom)
|
|
2091
|
-
- Visibility: Public or Private
|
|
2092
|
-
- Tools: show tools grouped by category as multi-select (Search, Issues, MRs, Epics, Files, Git, CI/CD, Security, Audit, Planning, Wiki, API)
|
|
2093
|
-
- MCP servers: multi-select from available servers
|
|
2094
|
-
3. Show the generated system prompt and ask for confirmation.
|
|
2095
|
-
4. Only then call gitlab_create_agent. Use full tool GIDs like "gid://gitlab/Ai::Catalog::BuiltInTool/1".
|
|
2096
|
-
5. Ask if the user wants to enable it on the current project.`;
|
|
2097
2085
|
var FLOW_SCHEMA_REFERENCE = `## Flow YAML Schema Reference
|
|
2098
2086
|
|
|
2099
2087
|
### Top-level structure (all required unless noted):
|
|
@@ -2254,52 +2242,6 @@ prompts:
|
|
|
2254
2242
|
user: "Fix this vulnerability: {{vuln_data}}"
|
|
2255
2243
|
placeholder: history
|
|
2256
2244
|
\`\`\``;
|
|
2257
|
-
var PROJECT_KNOWLEDGE_HINT = `## Project Knowledge
|
|
2258
|
-
This project may have persistent memory and skills available via knowledge tools.
|
|
2259
|
-
Use gitlab_memory_load to check for existing project context (facts, decisions, patterns).
|
|
2260
|
-
Use gitlab_skill_list to discover available task-specific skills.
|
|
2261
|
-
When you learn something new about the project, use gitlab_memory_record to preserve it.
|
|
2262
|
-
When you complete a significant task, consider using gitlab_memory_log_session to log learnings.
|
|
2263
|
-
|
|
2264
|
-
### Bootstrap Project Memory
|
|
2265
|
-
When the user says "bootstrap project memory", "initialize memory", or "build project knowledge":
|
|
2266
|
-
1. FIRST: Determine the project path by running \`run_git_command("remote", ["-v"])\` and extracting the path from the git remote URL (e.g., "git@gitlab.com:my-group/my-project.git" \u2192 "my-group/my-project"). NEVER guess the project path.
|
|
2267
|
-
2. Call gitlab_memory_load with the extracted project path to check if memory already exists.
|
|
2268
|
-
3. **If memory is empty** \u2014 do a full bootstrap:
|
|
2269
|
-
a. Gather project knowledge:
|
|
2270
|
-
- Read the project README, key config files, and codebase structure (use file/repo tools).
|
|
2271
|
-
- Fetch project details via gitlab_get_project.
|
|
2272
|
-
- List open issues (gitlab_list_issues, state=opened, limit=20).
|
|
2273
|
-
- List open merge requests (gitlab_list_merge_requests, state=opened, limit=10).
|
|
2274
|
-
- Check recent pipelines (gitlab_list_pipelines, limit=5).
|
|
2275
|
-
- List project members (gitlab_list_project_members).
|
|
2276
|
-
b. Record each category as separate memory entries using gitlab_memory_record:
|
|
2277
|
-
- fact: project overview (name, purpose, tech stack, language, dependencies)
|
|
2278
|
-
- fact: architecture and codebase structure (key files, modules, patterns)
|
|
2279
|
-
- fact: CI/CD pipeline configuration (stages, jobs, deployment targets)
|
|
2280
|
-
- fact: open issues summary (count, key issues, labels)
|
|
2281
|
-
- fact: open MRs summary (count, key MRs, review status)
|
|
2282
|
-
- fact: team and contributors
|
|
2283
|
-
- pattern: development workflow observations (branching, review process, release cycle)
|
|
2284
|
-
c. Log a session with gitlab_memory_log_session summarizing the bootstrap.
|
|
2285
|
-
4. **If memory exists** \u2014 do a smart refresh:
|
|
2286
|
-
a. Show a brief summary of existing memory to the user (how many facts, decisions, patterns, date range).
|
|
2287
|
-
b. Gather CURRENT project state (same data as step 3a).
|
|
2288
|
-
c. Compare current state with each stored fact. For each record:
|
|
2289
|
-
- If the fact is still accurate \u2192 keep it (no action).
|
|
2290
|
-
- If the fact is outdated \u2192 call gitlab_memory_update(slug, corrected_content).
|
|
2291
|
-
- If the fact is no longer relevant (e.g., closed issue) \u2192 call gitlab_memory_archive(slug, reason).
|
|
2292
|
-
- If something new is found that's not in memory \u2192 call gitlab_memory_record.
|
|
2293
|
-
d. Log a session with gitlab_memory_log_session summarizing the refresh (what was updated, archived, added).
|
|
2294
|
-
|
|
2295
|
-
### Memory Consolidation
|
|
2296
|
-
When the user says "consolidate memory", "clean up memory", or "review memory":
|
|
2297
|
-
1. Call gitlab_memory_consolidate to load all records with review instructions.
|
|
2298
|
-
2. Follow the returned instructions to identify stale, duplicate, or contradictory entries.
|
|
2299
|
-
3. Use gitlab_memory_update, gitlab_memory_archive, and gitlab_memory_record as needed.
|
|
2300
|
-
4. Log a consolidation session.
|
|
2301
|
-
|
|
2302
|
-
IMPORTANT: Always extract the project path from git remote \u2014 never guess it. Fire multiple gitlab_memory_record calls in parallel \u2014 each creates its own page, so parallel writes are safe.`;
|
|
2303
2245
|
|
|
2304
2246
|
// src/hooks.ts
|
|
2305
2247
|
function buildFlowSubagentPrompt(flow, projectPath, projectUrl) {
|
|
@@ -2458,8 +2400,10 @@ function makeSystemTransformHook(flowAgents, getAuthCache) {
|
|
|
2458
2400
|
output.system.push(FLOW_DISPATCH_GUIDELINES);
|
|
2459
2401
|
}
|
|
2460
2402
|
if (getAuthCache()) {
|
|
2461
|
-
output.system.push(
|
|
2462
|
-
|
|
2403
|
+
output.system.push(
|
|
2404
|
+
`## Project Knowledge
|
|
2405
|
+
Project memory tools are available (gitlab_memory_load, gitlab_memory_record, gitlab_memory_recall). Say "bootstrap project memory" to initialize or refresh project knowledge.`
|
|
2406
|
+
);
|
|
2463
2407
|
}
|
|
2464
2408
|
};
|
|
2465
2409
|
}
|
|
@@ -3698,7 +3642,7 @@ function makeMemoryTools(ctx) {
|
|
|
3698
3642
|
}
|
|
3699
3643
|
return {
|
|
3700
3644
|
gitlab_memory_load: (0, import_plugin5.tool)({
|
|
3701
|
-
description: "Load project memory to understand context, known facts, past decisions, and observed patterns.\nUse this at the start of complex tasks to check what is already known about the project.\nReturns accumulated knowledge from previous sessions.\nEach entry includes its slug (page path) which can be used with gitlab_memory_update or gitlab_memory_archive.",
|
|
3645
|
+
description: "Load project memory to understand context, known facts, past decisions, and observed patterns.\nUse this at the start of complex tasks to check what is already known about the project.\nReturns accumulated knowledge from previous sessions.\nEach entry includes its slug (page path) which can be used with gitlab_memory_update or gitlab_memory_archive.\n\nBOOTSTRAP WORKFLOW \u2014 when user says 'bootstrap project memory':\n1. Get project path from run_git_command('remote', ['-v']) \u2014 NEVER guess.\n2. Call this tool to check if memory exists.\n3. If empty: gather knowledge (README, gitlab_get_project, gitlab_list_issues, gitlab_list_merge_requests, gitlab_list_pipelines, gitlab_list_project_members), then fire parallel gitlab_memory_record calls.\n4. If exists: show summary, gather current state, compare with stored facts, use gitlab_memory_update for stale, gitlab_memory_archive for outdated, gitlab_memory_record for new.\n5. Log session with gitlab_memory_log_session.",
|
|
3702
3646
|
args: {
|
|
3703
3647
|
project_id: z5.string().describe(PROJECT_ID_DESC),
|
|
3704
3648
|
type: z5.enum(["all", "facts", "decisions", "patterns", "archive"]).optional().describe(
|