opencode-gitlab-dap 1.1.1 → 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 +0 -10
- package/dist/index.cjs +0 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -27
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -80,16 +80,6 @@ For PAT-based auth on self-hosted instances, set:
|
|
|
80
80
|
export GITLAB_INSTANCE_URL=https://your-instance.com
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
## Logging
|
|
84
|
-
|
|
85
|
-
The plugin writes debug logs to:
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
~/.local/share/opencode/log/gitlab-dap.log
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Useful for debugging agent discovery issues.
|
|
92
|
-
|
|
93
83
|
## Architecture
|
|
94
84
|
|
|
95
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
|
};
|