opencode-gitlab-dap 1.1.0 → 1.1.2

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
@@ -13,20 +13,18 @@ native agents into the opencode agent picker.
13
13
 
14
14
  ## Install
15
15
 
16
- Add to your `~/.config/opencode/opencode.json`:
16
+ ```bash
17
+ opencode plugin opencode-gitlab-dap
18
+ ```
19
+
20
+ Or add to your `~/.config/opencode/opencode.json`:
17
21
 
18
22
  ```json
19
23
  {
20
- "plugin": ["/path/to/opencode-gitlab-dap"]
24
+ "plugin": ["opencode-gitlab-dap"]
21
25
  }
22
26
  ```
23
27
 
24
- Or once published to npm:
25
-
26
- ```bash
27
- opencode plugin opencode-gitlab-dap
28
- ```
29
-
30
28
  No further configuration needed. The plugin reads GitLab auth and model cache automatically.
31
29
 
32
30
  ## How it works
@@ -82,16 +80,6 @@ For PAT-based auth on self-hosted instances, set:
82
80
  export GITLAB_INSTANCE_URL=https://your-instance.com
83
81
  ```
84
82
 
85
- ## Logging
86
-
87
- The plugin writes debug logs to:
88
-
89
- ```
90
- ~/.local/share/opencode/log/gitlab-dap.log
91
- ```
92
-
93
- Useful for debugging agent discovery issues.
94
-
95
83
  ## Architecture
96
84
 
97
85
  ```
package/dist/index.cjs CHANGED
@@ -2751,20 +2751,6 @@ function resolveModelId(entry) {
2751
2751
  var import_fs = require("fs");
2752
2752
  var import_path = require("path");
2753
2753
  var import_os = __toESM(require("os"), 1);
2754
- var logFile = (0, import_path.join)(
2755
- process.env.XDG_DATA_HOME ?? (0, import_path.join)(import_os.default.homedir(), ".local", "share"),
2756
- "opencode",
2757
- "log",
2758
- "gitlab-dap.log"
2759
- );
2760
- function log(...args) {
2761
- const line = `${(/* @__PURE__ */ new Date()).toISOString()} ${args.map(String).join(" ")}
2762
- `;
2763
- try {
2764
- (0, import_fs.appendFileSync)(logFile, line);
2765
- } catch {
2766
- }
2767
- }
2768
2754
  function readAuth() {
2769
2755
  try {
2770
2756
  const authPath = (0, import_path.join)(import_os.default.homedir(), ".local", "share", "opencode", "auth.json");
@@ -2781,32 +2767,23 @@ function readAuth() {
2781
2767
  }
2782
2768
  var memo = /* @__PURE__ */ new Map();
2783
2769
  var plugin = async (input) => {
2784
- log("plugin init, directory:", input.directory);
2785
2770
  async function load2() {
2786
2771
  const auth = readAuth();
2787
- log("readAuth result:", auth ? `instanceUrl=${auth.instanceUrl}` : "null");
2788
2772
  if (!auth) return null;
2789
2773
  const { token, instanceUrl } = auth;
2790
- log("instanceUrl:", instanceUrl);
2791
2774
  const cache = new import_gitlab_ai_provider.GitLabModelCache(input.directory, instanceUrl);
2792
2775
  const entry = cache.load();
2793
- log(
2794
- "cache entry:",
2795
- entry ? `discovery=${!!entry.discovery} projectId=${entry.project?.id}` : "null"
2796
- );
2797
2776
  if (!entry?.discovery) return null;
2798
2777
  const projectId = entry.project?.id;
2799
2778
  if (!projectId) return null;
2800
2779
  const key = `${input.directory}\0${instanceUrl}`;
2801
2780
  const cached = memo.get(key);
2802
2781
  const agents = cached ?? await fetchCatalogAgents(instanceUrl, token, `gid://gitlab/Project/${projectId}`);
2803
- log("agents fetched:", agents.length);
2804
2782
  if (!cached) memo.set(key, agents);
2805
2783
  return { agents, entry };
2806
2784
  }
2807
2785
  return {
2808
2786
  async config(cfg) {
2809
- log("config hook called");
2810
2787
  const result = await load2();
2811
2788
  if (!result?.agents.length) return;
2812
2789
  const baseModelId = resolveModelId(result.entry);
@@ -2821,14 +2798,11 @@ var plugin = async (input) => {
2821
2798
  workflowDefinition: agent.workflowDefinition,
2822
2799
  flowConfig: agent.flowConfig,
2823
2800
  flowConfigSchemaVersion: agent.flowConfigSchemaVersion,
2824
- // numeric version ID passed as ai_catalog_item_version_id in createWorkflow
2825
- // so GitLab UI links the session to the correct custom agent page
2826
2801
  aiCatalogItemVersionId: agent.catalogItemVersionId
2827
2802
  },
2828
2803
  permission: { "*": "allow" }
2829
2804
  };
2830
2805
  }
2831
- log("config hook injected:", result.agents.map((a) => a.name).join(", "));
2832
2806
  }
2833
2807
  };
2834
2808
  };