opencode-gitlab-duo-agentic-custom-tools 0.3.4 → 0.3.5

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.
Files changed (2) hide show
  1. package/dist/index.js +62 -18
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1873,29 +1873,73 @@ var TOOL_ALLOWLIST = [
1873
1873
  "mkdir",
1874
1874
  "run_command"
1875
1875
  ];
1876
- var TODO_BRIDGE_INSTRUCTIONS = [
1877
- "Todo planning and execution (required):",
1878
- "- For complex or multi-step work (3+ steps), create and maintain a todo list.",
1879
- "- Keep exactly one task as in_progress at a time.",
1880
- "- Mark tasks completed immediately after finishing them.",
1881
- "- Update the todo list whenever scope changes or new requirements appear.",
1882
- "- Skip todo planning for trivial one-step requests.",
1883
- "- To read the current todo list, call run_command with command: __todo_read__",
1884
- "- To create or update the todo list, call run_command with command:",
1876
+ var BRIDGE_WHEN_TO_USE = [
1877
+ "Bridge tools \u2014 when to use:",
1878
+ "",
1879
+ "Todo (__todo_read__, __todo_write__):",
1880
+ "- Use for planning and tracking when the task has 3+ steps, multiple files, or multiple user requirements.",
1881
+ "- Keep exactly one todo in_progress at a time.",
1882
+ "- Mark tasks completed immediately after finishing each step.",
1883
+ "- Update the todo list when scope changes or new requirements appear.",
1884
+ "- Skip for trivial one-step requests.",
1885
+ "",
1886
+ "Web fetch (__webfetch__):",
1887
+ "- Use only when external URL content is needed and repo/local context is insufficient.",
1888
+ "- Prefer targeted URLs and the minimum needed format.",
1889
+ "- Do not use for local files or codebase exploration.",
1890
+ "",
1891
+ "Question (__question__):",
1892
+ "- Use only when blocked by missing user input that materially changes the implementation.",
1893
+ "- Complete all non-blocked work first, then ask.",
1894
+ "- Ask exactly one targeted question unless multiple answers are strictly required together.",
1895
+ "- If a safe low-risk default exists, proceed without asking and state the assumption.",
1896
+ "- Must ask for: credentials/secrets, destructive/irreversible actions, production/billing/security impact, ambiguity where different answers produce different implementations.",
1897
+ '- Do not ask for: permission-style prompts ("Should I proceed?"), trivial preferences, questions answerable from repo/docs/context.',
1898
+ "",
1899
+ "Skill (__skill__):",
1900
+ "- Use when the task clearly matches an available skill and specialized instructions are needed.",
1901
+ "- Load the matching skill once, then follow its workflow.",
1902
+ "- Do not use if no available skill clearly matches."
1903
+ ].join("\n");
1904
+ var BRIDGE_HOW_TO_USE = [
1905
+ "Bridge tools \u2014 how to use:",
1906
+ "",
1907
+ "All bridge tools are called via run_command with a single command string.",
1908
+ "",
1909
+ "Read todos:",
1910
+ " __todo_read__",
1911
+ "Write/update todos:",
1885
1912
  ' __todo_write__ {"todos":[{"content":"...","status":"pending|in_progress|completed|cancelled","priority":"high|medium|low"}]}',
1886
- "- To fetch web content, call run_command with command:",
1913
+ "Fetch web content:",
1887
1914
  ' __webfetch__ {"url":"https://example.com","format":"markdown","timeout":30}',
1888
- "- To ask the user questions, call run_command with command:",
1915
+ "Ask user question(s):",
1889
1916
  ' __question__ {"questions":[{"question":"...","header":"...","options":[{"label":"Option A","description":"..."}],"multiple":false}]}',
1890
- "- To load a skill, call run_command with command:",
1891
- ' __skill__ {"name":"skill-name"}',
1892
- "- Use strict JSON with double quotes in all bridge payloads.",
1893
- "- For __question__, custom is enabled by default; do not add generic Other options.",
1894
- "- If payload validation fails, correct the JSON and retry.",
1895
- "- For todo, webfetch, question, and skill operations, only use __todo_read__, __todo_write__, __webfetch__, __question__, and __skill__."
1917
+ "Load a skill:",
1918
+ ' __skill__ {"name":"skill-name"}'
1919
+ ].join("\n");
1920
+ var BRIDGE_FORMATTING_RULES = [
1921
+ "Bridge tools \u2014 formatting and validation:",
1922
+ "",
1923
+ "Payloads:",
1924
+ "- Use strict JSON with double quotes in all payloads.",
1925
+ "- If validation fails, correct the JSON and retry.",
1926
+ "- Do not use regular shell commands for bridge operations.",
1927
+ "",
1928
+ "Question formatting:",
1929
+ "- Provide 2-5 concrete options.",
1930
+ "- Labels: 1-5 words, concise.",
1931
+ "- Header: max 30 chars.",
1932
+ '- Put recommended option first; append "(Recommended)" to its label.',
1933
+ "- Set multiple=true only when selecting more than one is valid.",
1934
+ '- Custom free-text is enabled by default; do not add generic "Other" options.'
1896
1935
  ].join("\n");
1897
1936
  function buildFlowConfig(systemPrompt) {
1898
- const bridgedPrompt = [systemPrompt.trim(), TODO_BRIDGE_INSTRUCTIONS].filter(Boolean).join("\n\n");
1937
+ const bridgedPrompt = [
1938
+ systemPrompt.trim(),
1939
+ BRIDGE_WHEN_TO_USE,
1940
+ BRIDGE_HOW_TO_USE,
1941
+ BRIDGE_FORMATTING_RULES
1942
+ ].filter(Boolean).join("\n\n");
1899
1943
  return {
1900
1944
  version: "v1",
1901
1945
  environment: "chat-partial",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-gitlab-duo-agentic-custom-tools",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "OpenCode plugin and provider for GitLab Duo Agentic workflows",
5
5
  "license": "MIT",
6
6
  "type": "module",