@orkestrate/agent-webmcp 0.0.0-stage → 0.2.0

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.
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ // Run the platform binary installed as an optional dependency. npm installs
3
+ // only the optional dependency matching this machine, so exactly one exists.
4
+ import { spawnSync } from "node:child_process";
5
+ import { chmodSync } from "node:fs";
6
+ import { createRequire } from "node:module";
7
+ import { join } from "node:path";
8
+ import { pathToFileURL } from "node:url";
9
+
10
+ const pkgs = {
11
+ "linux-x64": "@orkestrate/agent-webmcp-linux-x64",
12
+ "linux-arm64": "@orkestrate/agent-webmcp-linux-arm64",
13
+ "darwin-arm64": "@orkestrate/agent-webmcp-darwin-arm64",
14
+ "darwin-x64": "@orkestrate/agent-webmcp-darwin-x64",
15
+ "win32-x64": "@orkestrate/agent-webmcp-win32-x64",
16
+ };
17
+ const key = `${process.platform}-${process.arch}`;
18
+ const name = pkgs[key];
19
+ if (!name) {
20
+ console.error(`agent-webmcp: no binary for ${key}`);
21
+ process.exit(1);
22
+ }
23
+ const subpath = `${name}/bin/agent-webmcp${process.platform === "win32" ? ".exe" : ""}`;
24
+
25
+ function tryResolve(base) {
26
+ try {
27
+ return createRequire(base).resolve(subpath);
28
+ } catch {
29
+ return null;
30
+ }
31
+ }
32
+
33
+ // A folder install (`npm i ./packages/...`) symlinks the wrapper, and Node
34
+ // resolves symlinks before looking for siblings. Fall back to the project
35
+ // the command runs in, which lists the same optional dependency.
36
+ const bin =
37
+ tryResolve(import.meta.url) ??
38
+ tryResolve(pathToFileURL(join(process.cwd(), "package.json")).href);
39
+ if (!bin) {
40
+ console.error(`agent-webmcp: optional dependency ${name} is missing; reinstall with npm i -g @orkestrate/agent-webmcp`);
41
+ process.exit(1);
42
+ }
43
+ function run(bin) {
44
+ return spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
45
+ }
46
+
47
+ let r = run(bin);
48
+ if (r.error?.code === "EACCES" && process.platform !== "win32") {
49
+ // actions/upload-artifact does not preserve the exec bit, so a binary
50
+ // that lost it in transit lands non-executable. Repair once and retry.
51
+ try {
52
+ chmodSync(bin, 0o755);
53
+ r = run(bin);
54
+ } catch (e) {
55
+ console.error(`agent-webmcp: cannot execute ${bin}: ${e.message}`);
56
+ process.exit(1);
57
+ }
58
+ }
59
+ if (r.error) {
60
+ console.error(`agent-webmcp: cannot execute ${bin}: ${r.error.message}`);
61
+ process.exit(1);
62
+ }
63
+ // A signal kill (SIGTERM, SIGINT, ...) must propagate, not masquerade as
64
+ // exit 1, so supervisors and shells see the real cause.
65
+ if (r.signal) process.kill(process.pid, r.signal);
66
+ process.exit(r.status ?? 1);
package/bin/check.js ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ // Postinstall: fail loudly when no platform binary landed, so `agent-webmcp`
3
+ // never silently does nothing.
4
+ import { createRequire } from "node:module";
5
+
6
+ const pkgs = {
7
+ "linux-x64": "@orkestrate/agent-webmcp-linux-x64",
8
+ "linux-arm64": "@orkestrate/agent-webmcp-linux-arm64",
9
+ "darwin-arm64": "@orkestrate/agent-webmcp-darwin-arm64",
10
+ "darwin-x64": "@orkestrate/agent-webmcp-darwin-x64",
11
+ "win32-x64": "@orkestrate/agent-webmcp-win32-x64",
12
+ };
13
+ const name = pkgs[`${process.platform}-${process.arch}`];
14
+ if (!name) {
15
+ console.warn(`agent-webmcp: no binary for ${process.platform}-${process.arch}; this platform is untested`);
16
+ process.exit(0);
17
+ }
18
+ try {
19
+ createRequire(import.meta.url).resolve(`${name}/package.json`);
20
+ } catch {
21
+ console.error(`agent-webmcp: ${name} did not install. Check your npm optional-dependency settings and reinstall.`);
22
+ process.exit(1);
23
+ }
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@orkestrate/agent-webmcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Check whether a site offers WebMCP tools before you open it, then use them with the browser driver you already use.",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/orkestrate-dot-space/agent-webmcp#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/orkestrate-dot-space/agent-webmcp.git"
10
+ },
11
+ "type": "module",
12
+ "bin": {
13
+ "agent-webmcp": "bin/agent-webmcp.js"
14
+ },
15
+ "files": ["bin"],
16
+ "optionalDependencies": {
17
+ "@orkestrate/agent-webmcp-linux-x64": "0.2.0",
18
+ "@orkestrate/agent-webmcp-linux-arm64": "0.2.0",
19
+ "@orkestrate/agent-webmcp-darwin-arm64": "0.2.0",
20
+ "@orkestrate/agent-webmcp-darwin-x64": "0.2.0",
21
+ "@orkestrate/agent-webmcp-win32-x64": "0.2.0"
22
+ },
23
+ "scripts": {
24
+ "postinstall": "node bin/check.js"
25
+ }
26
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.