osborn 0.9.18 → 0.9.19
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/dist/index.js +25 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -187,8 +187,32 @@ function startApiServer(workingDir, port) {
|
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
189
|
if (req.method === 'GET' && url.pathname === '/health') {
|
|
190
|
+
// Include osborn version — primary signal used by machines.readInstalledOsbornVersion()
|
|
191
|
+
// to detect which agent version is running. Without this the consumer falls back to
|
|
192
|
+
// parsing the Docker image tag (e.g. ":latest" → rejected) and returns null, which
|
|
193
|
+
// breaks the dashboard's version badge + the upgrade-needed comparison.
|
|
194
|
+
// Read once at module load? No — package.json is small and resolveFromPackage() handles
|
|
195
|
+
// both `dist/` (installed) and `src/` (local dev) layouts.
|
|
196
|
+
let version;
|
|
197
|
+
try {
|
|
198
|
+
// Walk up from this file's dirname to find package.json. Works whether running
|
|
199
|
+
// from src/ (tsx local dev) or dist/ (compiled npm install).
|
|
200
|
+
const { readFileSync } = await import('node:fs');
|
|
201
|
+
const { join } = await import('node:path');
|
|
202
|
+
for (const rel of ['../package.json', '../../package.json']) {
|
|
203
|
+
try {
|
|
204
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, rel), 'utf8'));
|
|
205
|
+
if (pkg.name === 'osborn' && pkg.version) {
|
|
206
|
+
version = pkg.version;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
catch { /* try next */ }
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
catch { /* version optional */ }
|
|
190
214
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
191
|
-
res.end(JSON.stringify({ status: 'ok', workingDir }));
|
|
215
|
+
res.end(JSON.stringify({ status: 'ok', workingDir, version }));
|
|
192
216
|
return;
|
|
193
217
|
}
|
|
194
218
|
// POST /webhook/recall — Recall.ai real-time transcript webhooks
|