@jurislm/woodpecker-ci-plugin 2.1.1 → 2.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
|
@@ -107,6 +107,7 @@ stop before the provider starts. No token is copied into Codex configuration.
|
|
|
107
107
|
```bash
|
|
108
108
|
mkdir -p "$HOME/.codex/bin"
|
|
109
109
|
cp launchers/woodpecker-desktop.zsh "$HOME/.codex/bin/woodpecker-mcp.zsh"
|
|
110
|
+
cp launchers/validate-woodpecker-runtime.mjs "$HOME/.codex/bin/validate-woodpecker-runtime.mjs"
|
|
110
111
|
```
|
|
111
112
|
|
|
112
113
|
Configure the absolute launcher path in `~/.codex/config.toml`, preserve your
|
|
@@ -126,8 +127,7 @@ WOODPECKER_URL = "https://ci.example.com/api"
|
|
|
126
127
|
enabled = false
|
|
127
128
|
```
|
|
128
129
|
|
|
129
|
-
The launcher requires Bun at `$HOME/.bun/bin/bun`, runs
|
|
130
|
-
`@latest`. Read `initialize.serverInfo.version` and match the intended release;
|
|
130
|
+
The launcher requires Bun at `$HOME/.bun/bin/bun`, runs the validated [installed desktop runtime](#installed-desktop-runtime) with `--no-env-file --no-install`, without resolving `@latest`. Read `initialize.serverInfo.version` and match the intended release;
|
|
131
131
|
a marketplace cache version is not the resolved running package version.
|
|
132
132
|
`codex mcp get` reads a user registration; it does not prove a plugin-provided
|
|
133
133
|
instance received that environment.
|
|
@@ -193,3 +193,14 @@ The configured API token is sent only as bearer authentication and is not
|
|
|
193
193
|
included in logs or tool request metadata. Credential fields are removed from
|
|
194
194
|
response schemas and tool results. Mutation requests are not retried
|
|
195
195
|
automatically.
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
### Installed desktop runtime
|
|
199
|
+
|
|
200
|
+
The desktop launcher requires Bun 1.4.3 or newer and a complete normal installation at `~/.local/share/jurislm/mcp/woodpecker-ci-plugin`. Copy `launchers/woodpecker-desktop.zsh` and its owner-specific `launchers/validate-woodpecker-runtime.mjs` together to the same launcher directory. Keep the existing launcher destination and registration; do not change required-server or tool-approval settings.
|
|
201
|
+
|
|
202
|
+
Prepare each installation or update in a separate staging directory with `bun add --exact @jurislm/woodpecker-ci-plugin@<approved-version>`, then verify `bun install --frozen-lockfile`. The installation's `package.json` and `bun.lock` are the only version authority. Startup validates the declared and resolved source, installed identity and binary path, then executes the installed entry with `--no-env-file --no-install`. It never resolves `@latest`, installs dependencies or loads a working-directory `.env`.
|
|
203
|
+
|
|
204
|
+
For offline recovery, retain a verified released tarball inside the runtime, for example `artifacts/woodpecker-ci-plugin-<version>.tgz`, and declare `file:artifacts/woodpecker-ci-plugin-<version>.tgz`. A complete same-platform Bun dependency cache, including transitive dependencies, is required; a release tarball alone is insufficient. First run `bun install --offline` to generate the lock, then verify a clean `bun install --offline --frozen-lockfile` rebuild. Existing locked installations use the frozen command directly. Absolute or escaping tarball paths, mutable versions, identity mismatches and tarball SHA512 drift are rejected before startup.
|
|
205
|
+
|
|
206
|
+
Before selecting a replacement, run the shipped validator against its staging directory with package name `@jurislm/woodpecker-ci-plugin` and binary name `woodpecker-ci-plugin`, verify published package contents, and perform an offline stdio initialize with dummy credentials. Move the verified complete directory to the runtime path only while this MCP is stopped. Keep the previous installation for rollback. Never copy credentials into the runtime. A successful standalone initialize is not evidence of a desktop reload or provider API access; verify those separately after deployment.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { readFileSync, realpathSync, statSync } from "node:fs";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { normalize, resolve, sep } from "node:path";
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
const [directory, name, binary] = process.argv.slice(2);
|
|
7
|
+
const root = realpathSync(directory);
|
|
8
|
+
const inside = (path) => {
|
|
9
|
+
const actual = realpathSync(path);
|
|
10
|
+
if (!actual.startsWith(root + sep)) throw new Error();
|
|
11
|
+
return actual;
|
|
12
|
+
};
|
|
13
|
+
const manifest = JSON.parse(readFileSync(inside(resolve(root, "package.json")), "utf8"));
|
|
14
|
+
const lock = Bun.JSONC.parse(readFileSync(inside(resolve(root, "bun.lock")), "utf8"));
|
|
15
|
+
const spec = manifest.dependencies?.[name];
|
|
16
|
+
if (typeof spec !== "string" || lock.workspaces?.[""]?.dependencies?.[name] !== spec) throw new Error();
|
|
17
|
+
const locked = lock.packages?.[name];
|
|
18
|
+
if (!Array.isArray(locked)) throw new Error();
|
|
19
|
+
let version = spec;
|
|
20
|
+
let resolved = spec;
|
|
21
|
+
if (spec.startsWith("file:")) {
|
|
22
|
+
const relative = spec.slice(5);
|
|
23
|
+
if (relative.startsWith("/") || !relative.endsWith(".tgz")) throw new Error();
|
|
24
|
+
const archive = inside(resolve(root, relative));
|
|
25
|
+
resolved = normalize(relative);
|
|
26
|
+
const integrity = "sha512-" + createHash("sha512").update(readFileSync(archive)).digest("base64");
|
|
27
|
+
if (locked.at(-1) !== integrity) throw new Error();
|
|
28
|
+
const packed = Bun.spawnSync(["tar", "-xOf", archive, "package/package.json"], { stdout: "pipe", stderr: "pipe", env: { PATH: "/usr/bin:/bin" } });
|
|
29
|
+
if (packed.exitCode !== 0) throw new Error();
|
|
30
|
+
const metadata = JSON.parse(new TextDecoder().decode(packed.stdout));
|
|
31
|
+
if (metadata.name !== name) throw new Error();
|
|
32
|
+
version = metadata.version;
|
|
33
|
+
}
|
|
34
|
+
if (typeof version !== "string" || !/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(version)) throw new Error();
|
|
35
|
+
if (locked[0] !== `${name}@${resolved}`) throw new Error();
|
|
36
|
+
const packageRoot = inside(resolve(root, "node_modules", name));
|
|
37
|
+
const installed = JSON.parse(readFileSync(inside(resolve(packageRoot, "package.json")), "utf8"));
|
|
38
|
+
if (installed.name !== name || installed.version !== version || installed.bin?.[binary] !== "dist/index.js") throw new Error();
|
|
39
|
+
const entry = inside(resolve(packageRoot, installed.bin[binary]));
|
|
40
|
+
if (!entry.startsWith(packageRoot + sep) || !statSync(entry).isFile() || inside(resolve(root, "node_modules/.bin", binary)) !== entry) throw new Error();
|
|
41
|
+
} catch {
|
|
42
|
+
console.error("Desktop MCP runtime is missing or inconsistent; reinstall the pinned runtime before starting.");
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
@@ -27,4 +27,6 @@ for name in ${(k)parameters}; do
|
|
|
27
27
|
;;
|
|
28
28
|
esac
|
|
29
29
|
done
|
|
30
|
-
|
|
30
|
+
runtime="$HOME/.local/share/jurislm/mcp/woodpecker-ci-plugin"
|
|
31
|
+
"$HOME/.bun/bin/bun" --no-env-file --no-install "${${(%):-%x}:A:h}/validate-woodpecker-runtime.mjs" "$runtime" @jurislm/woodpecker-ci-plugin woodpecker-ci-plugin || exit $?
|
|
32
|
+
exec "$HOME/.bun/bin/bun" --no-env-file --no-install "$runtime/node_modules/@jurislm/woodpecker-ci-plugin/dist/index.js"
|
package/package.json
CHANGED
package/plugin.json
CHANGED