@jurislm/woodpecker-ci-plugin 2.1.0 → 2.1.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/.codex-plugin/plugin.json +1 -1
- package/.mcp.json +2 -2
- package/.mcp.json.example +2 -2
- package/README.md +10 -3
- package/dist/config.d.ts +1 -0
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/plugin-env.d.ts +6 -0
- package/dist/plugin-env.js +67 -0
- package/dist/plugin-env.js.map +1 -0
- package/dist/transports/stdio.js +3 -2
- package/dist/transports/stdio.js.map +1 -1
- package/docs/plugin-architecture.md +2 -2
- package/launchers/woodpecker-desktop.zsh +1 -1
- package/mcp.json +2 -2
- package/package.json +1 -1
- package/plugin.json +1 -1
package/.mcp.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"woodpecker-ci": {
|
|
4
4
|
"type": "stdio",
|
|
5
|
-
"command": "
|
|
6
|
-
"args": ["
|
|
5
|
+
"command": "bun",
|
|
6
|
+
"args": ["x", "@jurislm/woodpecker-ci-plugin@latest"],
|
|
7
7
|
"env_vars": ["WOODPECKER_URL", "WOODPECKER_API_TOKEN"]
|
|
8
8
|
}
|
|
9
9
|
}
|
package/.mcp.json.example
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"woodpecker-ci": {
|
|
4
|
-
"command": "
|
|
5
|
-
"args": ["
|
|
4
|
+
"command": "bun",
|
|
5
|
+
"args": ["x", "@jurislm/woodpecker-ci-plugin@latest"],
|
|
6
6
|
"env": {
|
|
7
7
|
"WOODPECKER_URL": "https://ci.example.com/api",
|
|
8
8
|
"WOODPECKER_API_TOKEN": "<set-in-host-environment>"
|
package/README.md
CHANGED
|
@@ -26,8 +26,8 @@ The server does not read `DRONE_TOKEN`.
|
|
|
26
26
|
{
|
|
27
27
|
"mcpServers": {
|
|
28
28
|
"woodpecker-ci": {
|
|
29
|
-
"command": "
|
|
30
|
-
"args": ["
|
|
29
|
+
"command": "bun",
|
|
30
|
+
"args": ["x", "@jurislm/woodpecker-ci-plugin@latest"],
|
|
31
31
|
"env": {
|
|
32
32
|
"WOODPECKER_URL": "https://ci.example.com/api",
|
|
33
33
|
"WOODPECKER_API_TOKEN": "..."
|
|
@@ -37,6 +37,13 @@ The server does not read `DRONE_TOKEN`.
|
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
Launch with `bun x` rather than the separate `bunx` executable, which some
|
|
41
|
+
package-manager shims break. When `WOODPECKER_URL` or `WOODPECKER_API_TOKEN` is
|
|
42
|
+
missing, empty, or an unsubstituted `${...}` placeholder, the server fills it
|
|
43
|
+
from `~/.config/jurislm/plugin.env` (`KEY=value` or `export KEY=value` lines;
|
|
44
|
+
override the path with `JURISLM_PLUGIN_ENV`). Host values always take
|
|
45
|
+
precedence and values are never logged.
|
|
46
|
+
|
|
40
47
|
The server exposes generated OpenAPI operations plus a focused pipeline
|
|
41
48
|
inspection tool. It excludes `/user/token`, `/version`, and `/debug/pprof` plus
|
|
42
49
|
its subpaths. The OpenAPI snapshot describes `/version` as JSON, but this
|
|
@@ -119,7 +126,7 @@ WOODPECKER_URL = "https://ci.example.com/api"
|
|
|
119
126
|
enabled = false
|
|
120
127
|
```
|
|
121
128
|
|
|
122
|
-
The launcher requires Bun at `$HOME/.bun/bin/
|
|
129
|
+
The launcher requires Bun at `$HOME/.bun/bin/bun`, runs `bun x`, and continues to use
|
|
123
130
|
`@latest`. Read `initialize.serverInfo.version` and match the intended release;
|
|
124
131
|
a marketplace cache version is not the resolved running package version.
|
|
125
132
|
`codex mcp get` reads a user registration; it does not prove a plugin-provided
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,CAAU,CAAC;AAQvF,MAAM,UAAU,UAAU,CAAC,MAA0C,OAAO,CAAC,GAAG;IAC9E,MAAM,OAAO,GAAG,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAChE,MAAM,KAAK,GAAG,GAAG,CAAC,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAC/C,OAAO;QACL,OAAO,EAAE,OAAO,IAAI,SAAS;QAC7B,KAAK,EAAE,KAAK,IAAI,SAAS;QACzB,SAAS,EAAE,MAAM;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type Environment = Record<string, string | undefined>;
|
|
2
|
+
export type CredentialGroups = readonly (readonly string[])[];
|
|
3
|
+
export declare const PLUGIN_ENV_PATH_VARIABLE = "JURISLM_PLUGIN_ENV";
|
|
4
|
+
export declare function parsePluginEnv(text: string): Record<string, string>;
|
|
5
|
+
export declare function pluginEnvPath(env: Environment): string;
|
|
6
|
+
export declare function withPluginEnv(env: Environment, groups: CredentialGroups, readText?: (path: string) => string, warn?: (message: string) => void): Environment;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join, resolve } from "node:path";
|
|
4
|
+
export const PLUGIN_ENV_PATH_VARIABLE = "JURISLM_PLUGIN_ENV";
|
|
5
|
+
const PLACEHOLDER = /^\$\{[^}]*\}$/u;
|
|
6
|
+
const ASSIGNMENT = /^(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/u;
|
|
7
|
+
function isUnset(value) {
|
|
8
|
+
const trimmed = value?.trim();
|
|
9
|
+
return !trimmed || PLACEHOLDER.test(trimmed);
|
|
10
|
+
}
|
|
11
|
+
export function parsePluginEnv(text) {
|
|
12
|
+
const values = {};
|
|
13
|
+
for (const rawLine of text.split(/\r?\n/u)) {
|
|
14
|
+
const match = ASSIGNMENT.exec(rawLine.trim());
|
|
15
|
+
if (!match)
|
|
16
|
+
continue;
|
|
17
|
+
const [, name, rawValue] = match;
|
|
18
|
+
const quote = rawValue[0];
|
|
19
|
+
if (quote === '"' || quote === "'") {
|
|
20
|
+
const end = rawValue.indexOf(quote, 1);
|
|
21
|
+
if (end > 0)
|
|
22
|
+
values[name] = rawValue.slice(1, end);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
values[name] = rawValue.replace(/\s+#.*$/u, "").trim();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return values;
|
|
29
|
+
}
|
|
30
|
+
export function pluginEnvPath(env) {
|
|
31
|
+
const home = env.HOME?.trim() || homedir();
|
|
32
|
+
const override = env[PLUGIN_ENV_PATH_VARIABLE];
|
|
33
|
+
if (!override || isUnset(override))
|
|
34
|
+
return join(home, ".config", "jurislm", "plugin.env");
|
|
35
|
+
const path = override.trim();
|
|
36
|
+
return resolve(path === "~" || path.startsWith("~/") ? join(home, path.slice(1)) : path);
|
|
37
|
+
}
|
|
38
|
+
function readPluginEnv(path, readText, warn) {
|
|
39
|
+
try {
|
|
40
|
+
return parsePluginEnv(readText(path));
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
const code = error.code;
|
|
44
|
+
if (code !== "ENOENT")
|
|
45
|
+
warn(`Could not read plugin env file ${path} (${code ?? "unknown error"})`);
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function withPluginEnv(env, groups, readText = (path) => readFileSync(path, "utf8"), warn = (message) => console.error(message)) {
|
|
50
|
+
if (groups.every((group) => group.every((name) => !isUnset(env[name]))))
|
|
51
|
+
return env;
|
|
52
|
+
const fileValues = groups.some((group) => group.every((name) => isUnset(env[name]))) ? readPluginEnv(pluginEnvPath(env), readText, warn) : {};
|
|
53
|
+
const resolved = { ...env };
|
|
54
|
+
for (const group of groups) {
|
|
55
|
+
const fillFromFile = group.every((name) => isUnset(env[name]));
|
|
56
|
+
for (const name of group) {
|
|
57
|
+
if (!isUnset(env[name]))
|
|
58
|
+
continue;
|
|
59
|
+
if (fillFromFile && !isUnset(fileValues[name]))
|
|
60
|
+
resolved[name] = fileValues[name];
|
|
61
|
+
else
|
|
62
|
+
delete resolved[name];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return resolved;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=plugin-env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-env.js","sourceRoot":"","sources":["../src/plugin-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAK1C,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE7D,MAAM,WAAW,GAAG,gBAAgB,CAAC;AACrC,MAAM,UAAU,GAAG,sDAAsD,CAAC;AAE1E,SAAS,OAAO,CAAC,KAAyB;IACxC,MAAM,OAAO,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC;IAC9B,OAAO,CAAC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,I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CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC/D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAAE,SAAS;YAClC,IAAI,YAAY,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;gBAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;;gBAC7E,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/transports/stdio.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
2
2
|
import { createServer } from "../server.js";
|
|
3
|
-
import { loadConfig } from "../config.js";
|
|
3
|
+
import { CREDENTIAL_GROUPS, loadConfig } from "../config.js";
|
|
4
|
+
import { withPluginEnv } from "../plugin-env.js";
|
|
4
5
|
export async function runStdioServer(env = process.env) {
|
|
5
|
-
const server = createServer(loadConfig(env));
|
|
6
|
+
const server = createServer(loadConfig(withPluginEnv(env, CREDENTIAL_GROUPS)));
|
|
6
7
|
await server.connect(new StdioServerTransport());
|
|
7
8
|
}
|
|
8
9
|
//# sourceMappingURL=stdio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/transports/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["../../src/transports/stdio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAA0C,OAAO,CAAC,GAAG;IAErD,MAAM,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC/E,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -40,7 +40,7 @@ pagination and partial-failure semantics, and binary/stream output behavior.
|
|
|
40
40
|
Each local server ships `launchers/<provider>-desktop.zsh`. The host invokes it
|
|
41
41
|
with `/bin/zsh -f`. It explicitly sources `${ZDOTDIR:-$HOME}/.zshenv`, suppresses
|
|
42
42
|
startup stdout, preserves stderr, checks required credentials, and execs the
|
|
43
|
-
absolute `$HOME/.bun/bin/
|
|
43
|
+
absolute `$HOME/.bun/bin/bun x` path. Preflight startup syntax; reject syntax
|
|
44
44
|
errors and source status greater than 1. Status 1 may be a benign final
|
|
45
45
|
optional-file guard; credential completeness still gates execution. Startup
|
|
46
46
|
values may override inherited values, matching ordinary zsh source behavior.
|
|
@@ -51,7 +51,7 @@ variables. Hetzner also retains SSH_AUTH_SOCK. Fix PATH to
|
|
|
51
51
|
Woodpecker's URL is supplied by the user MCP `env` setting or existing shell
|
|
52
52
|
environment; the launcher does not parse global Codex configuration.
|
|
53
53
|
|
|
54
|
-
Installing this launcher is opt-in. Keep the portable
|
|
54
|
+
Installing this launcher is opt-in. Keep the portable `bun x` manifest unchanged,
|
|
55
55
|
disable only the selected plugin's bundled server, and use a user MCP
|
|
56
56
|
registration with startup_timeout_sec=30. Keep skills enabled. Preserve
|
|
57
57
|
unrelated plugin registrations and existing credential sources.
|
package/mcp.json
CHANGED
package/package.json
CHANGED
package/plugin.json
CHANGED