shin-engine 1.0.2 → 1.0.3
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/bin/ee.js +13 -13
- package/package.json +1 -1
package/bin/ee.js
CHANGED
|
@@ -51,7 +51,7 @@ function isRunning() {
|
|
|
51
51
|
async function ensureSetup() {
|
|
52
52
|
if (existsSync(JAR)) return true;
|
|
53
53
|
|
|
54
|
-
step("
|
|
54
|
+
step("SHIN first-time setup");
|
|
55
55
|
|
|
56
56
|
// Check Java
|
|
57
57
|
try {
|
|
@@ -67,7 +67,7 @@ async function ensureSetup() {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Download EE
|
|
70
|
-
step("Downloading
|
|
70
|
+
step("Downloading SHIN (" + RELEASE_URL + ")");
|
|
71
71
|
if (!existsSync(EE_HOME)) mkdirSync(EE_HOME, { recursive: true });
|
|
72
72
|
const zipPath = join(os.tmpdir(), "ee.zip");
|
|
73
73
|
try {
|
|
@@ -113,11 +113,11 @@ async function ensureSetup() {
|
|
|
113
113
|
|
|
114
114
|
async function main() {
|
|
115
115
|
if (!cmd || cmd === "start") {
|
|
116
|
-
if (isRunning()) { log("
|
|
116
|
+
if (isRunning()) { log("SHIN is already running on port " + PORT); return; }
|
|
117
117
|
const setup = await ensureSetup();
|
|
118
118
|
if (!setup) { process.exit(1); }
|
|
119
119
|
|
|
120
|
-
step("Starting
|
|
120
|
+
step("Starting SHIN backend...");
|
|
121
121
|
const env = { ...process.env, ENGINEERING_BRAIN_PATH: BRAIN_DIR };
|
|
122
122
|
const child = spawn("java", [
|
|
123
123
|
"-jar", JAR,
|
|
@@ -128,7 +128,7 @@ async function main() {
|
|
|
128
128
|
for (let i = 0; i < 30; i++) {
|
|
129
129
|
await sleep(1000);
|
|
130
130
|
if (isRunning()) {
|
|
131
|
-
log("
|
|
131
|
+
log("SHIN ready on port " + PORT);
|
|
132
132
|
log("\nTell your OpenCode agent: 'load the engineering-experience-engine skill'");
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
@@ -143,16 +143,16 @@ async function main() {
|
|
|
143
143
|
`powershell -Command "$conn = Get-NetTCPConnection -LocalPort ${PORT} -ErrorAction SilentlyContinue; if ($conn) { $pids = $conn.OwningProcess; $pids | ForEach-Object { Stop-Process -Id $_ -Force -ErrorAction SilentlyContinue }; Write-Output 'stopped' } else { Write-Output 'not running' }"`,
|
|
144
144
|
{ encoding: "utf-8", timeout: 10000 }
|
|
145
145
|
);
|
|
146
|
-
log("
|
|
147
|
-
} catch { log("
|
|
146
|
+
log("SHIN stopped");
|
|
147
|
+
} catch { log("SHIN not running"); }
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
if (cmd === "status") {
|
|
152
152
|
if (isRunning()) {
|
|
153
|
-
log("
|
|
153
|
+
log("SHIN is running on port " + PORT);
|
|
154
154
|
} else {
|
|
155
|
-
log("
|
|
155
|
+
log("SHIN is not running");
|
|
156
156
|
}
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
@@ -161,14 +161,14 @@ async function main() {
|
|
|
161
161
|
log("Usage: shin <command>");
|
|
162
162
|
log("");
|
|
163
163
|
log("Commands:");
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
log(" shin start Start the SHIN backend (first run downloads + installs)");
|
|
165
|
+
log(" shin stop Stop the SHIN backend");
|
|
166
|
+
log(" shin status Check if SHIN is running");
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
log("Unknown command: " + cmd);
|
|
171
|
-
log("Run '
|
|
171
|
+
log("Run 'shin --help' for usage");
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
main().catch(e => { console.error(e); process.exit(1); });
|