osgi-run 0.0.0-stage → 0.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/README.md CHANGED
@@ -1,3 +1,29 @@
1
- # Temporary Holding Version
1
+ # osgi-run
2
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.
3
+ Build, run, inspect and drive an Eclipse Equinox OSGi application without the IDE, from a terminal or from an AI coding agent (MCP server for opencode, Claude Code and other MCP clients).
4
+
5
+ Requires **Node 18+** (only to install) and **Java 8+** (a JDK for Eclipse plug-in projects without a build tool). Projects are built with Maven or Gradle, or with Eclipse plug-in projects that use no build tool.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g osgi-run
11
+ osgi-run install # registers the MCP server in opencode / Claude Code
12
+ ```
13
+
14
+ ## Use
15
+
16
+ In the root of your workspace:
17
+
18
+ ```bash
19
+ osgi-run init # finds projects, framework jar, config.ini -> osgi-run.json
20
+ osgi-run start # build, start in background, print bundle status
21
+ osgi-run status # bundle states + why a bundle is not working
22
+ osgi-run gui tree # Swing windows and components
23
+ osgi-run gui type nameField "Ali"
24
+ osgi-run gui click "OK"
25
+ osgi-run stop
26
+ ```
27
+
28
+ From an MCP client, ask the agent, for example: "start the app and click OK".
29
+ The tools are `init`, `start`, `status`, `stop`, `logs`, `build`, and `gui_tree`, `gui_click`, `gui_type`, `gui_text`, `gui_screenshot`.
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ // Thin launcher: osgi-run is written in Java; this runs the bundled jar with the local JDK.
3
+ "use strict";
4
+ const { spawn, spawnSync } = require("child_process");
5
+ const fs = require("fs");
6
+ const path = require("path");
7
+
8
+ const jar = path.join(__dirname, "..", "osgi-run.jar");
9
+ const exe = process.platform === "win32" ? "java.exe" : "java";
10
+ let java = "java";
11
+ if (process.env.JAVA_HOME) {
12
+ const candidate = path.join(process.env.JAVA_HOME, "bin", exe);
13
+ if (fs.existsSync(candidate)) java = candidate;
14
+ }
15
+
16
+ // osgi-run needs Java 8+. An older java on PATH would only print
17
+ // "UnsupportedClassVersionError", so check first and say what to do.
18
+ const probe = spawnSync(java, ["-version"], { encoding: "utf8" });
19
+ if (!probe.error) {
20
+ const m = /version "(\d+)(?:\.(\d+))?/.exec(`${probe.stderr || ""}${probe.stdout || ""}`);
21
+ if (m) {
22
+ const major = m[1] === "1" ? Number(m[2]) : Number(m[1]);
23
+ if (major < 8) {
24
+ console.error(`osgi-run: ${java} is Java ${major}; osgi-run needs Java 8 or newer.`);
25
+ console.error("Set JAVA_HOME to Java 8+ (a JDK if you have Eclipse PDE projects).");
26
+ process.exit(1);
27
+ }
28
+ }
29
+ }
30
+
31
+ const child = spawn(java, ["-jar", jar, ...process.argv.slice(2)], {
32
+ stdio: "inherit",
33
+ env: { ...process.env, OSGIRUN_LAUNCHER: "npm" },
34
+ });
35
+ child.on("error", (err) => {
36
+ console.error(`osgi-run: could not start Java (${java}): ${err.message}`);
37
+ console.error("osgi-run needs Java 8 or newer: put java on PATH or set JAVA_HOME.");
38
+ process.exit(1);
39
+ });
40
+ for (const sig of ["SIGINT", "SIGTERM"]) {
41
+ process.on(sig, () => child.kill(sig));
42
+ }
43
+ child.on("exit", (code, signal) => process.exit(code ?? (signal ? 1 : 0)));
package/osgi-run.jar ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,18 @@
1
1
  {
2
2
  "name": "osgi-run",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Build, run, inspect and drive Eclipse Equinox OSGi applications without the IDE. CLI and MCP server for AI coding agents (opencode, Claude Code).",
5
+ "bin": {
6
+ "osgi-run": "bin/osgi-run.js"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ "osgi-run.jar",
11
+ "README.md"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18"
15
+ },
16
+ "keywords": ["osgi", "equinox", "eclipse", "mcp", "maven", "gradle", "pde", "swing", "ai-agent"],
17
+ "license": "UNLICENSED"
18
+ }