osgi-run 0.1.0 → 0.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
@@ -2,7 +2,7 @@
2
2
 
3
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
4
 
5
- Requires **Node 18+** (only to install) and a **JDK 17+**. Projects are built with Maven or Gradle, or with Eclipse plug-in projects that use no build tool.
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
6
 
7
7
  ## Install
8
8
 
@@ -13,10 +13,9 @@ osgi-run install # registers the MCP server in opencode / Claude Code
13
13
 
14
14
  ## Use
15
15
 
16
- In the root of your workspace:
16
+ Register the MCP server once (`osgi-run install`), open the workspace in your agent and ask it to start the application: the agent writes `osgi-run.json` (`init`) and fixes it until the application runs. After that, in the root of your workspace:
17
17
 
18
18
  ```bash
19
- osgi-run init # finds projects, framework jar, config.ini -> osgi-run.json
20
19
  osgi-run start # build, start in background, print bundle status
21
20
  osgi-run status # bundle states + why a bundle is not working
22
21
  osgi-run gui tree # Swing windows and components
package/bin/osgi-run.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  // Thin launcher: osgi-run is written in Java; this runs the bundled jar with the local JDK.
3
3
  "use strict";
4
- const { spawn } = require("child_process");
4
+ const { spawn, spawnSync } = require("child_process");
5
5
  const fs = require("fs");
6
6
  const path = require("path");
7
7
 
@@ -13,13 +13,28 @@ if (process.env.JAVA_HOME) {
13
13
  if (fs.existsSync(candidate)) java = candidate;
14
14
  }
15
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
+
16
31
  const child = spawn(java, ["-jar", jar, ...process.argv.slice(2)], {
17
32
  stdio: "inherit",
18
33
  env: { ...process.env, OSGIRUN_LAUNCHER: "npm" },
19
34
  });
20
35
  child.on("error", (err) => {
21
36
  console.error(`osgi-run: could not start Java (${java}): ${err.message}`);
22
- console.error("osgi-run needs a JDK 17 or newer: put java on PATH or set JAVA_HOME.");
37
+ console.error("osgi-run needs Java 8 or newer: put java on PATH or set JAVA_HOME.");
23
38
  process.exit(1);
24
39
  });
25
40
  for (const sig of ["SIGINT", "SIGTERM"]) {
package/osgi-run.jar CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "osgi-run",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
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
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/Ykanber/osgi-build.git",
8
+ "directory": "osgi-run/npm"
9
+ },
5
10
  "bin": {
6
11
  "osgi-run": "bin/osgi-run.js"
7
12
  },
@@ -13,6 +18,16 @@
13
18
  "engines": {
14
19
  "node": ">=18"
15
20
  },
16
- "keywords": ["osgi", "equinox", "eclipse", "mcp", "maven", "gradle", "pde", "swing", "ai-agent"],
21
+ "keywords": [
22
+ "osgi",
23
+ "equinox",
24
+ "eclipse",
25
+ "mcp",
26
+ "maven",
27
+ "gradle",
28
+ "pde",
29
+ "swing",
30
+ "ai-agent"
31
+ ],
17
32
  "license": "UNLICENSED"
18
33
  }