aisnitch 0.2.1 → 0.2.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/dist/cli/index.js CHANGED
@@ -8,7 +8,7 @@ import { Command, InvalidArgumentError } from "commander";
8
8
 
9
9
  // src/package-info.ts
10
10
  var AISNITCH_PACKAGE_NAME = "aisnitch";
11
- var AISNITCH_VERSION = "0.2.1";
11
+ var AISNITCH_VERSION = "0.2.2";
12
12
  var AISNITCH_DESCRIPTION = "Universal bridge for AI coding tool activity \u2014 capture, normalize, stream.";
13
13
 
14
14
  // src/core/events/schema.ts
@@ -11946,7 +11946,22 @@ function createCliRuntime(dependencies = {}) {
11946
11946
  if (!lastLine) {
11947
11947
  return null;
11948
11948
  }
11949
- return lastLine.startsWith("AISnitch CLI failed:") ? lastLine : `AISnitch daemon startup failed: ${lastLine}`;
11949
+ if (lastLine.startsWith("AISnitch CLI failed:")) {
11950
+ return lastLine;
11951
+ }
11952
+ const structuredFailure = parseStructuredDaemonFailure(lastLine);
11953
+ return structuredFailure === null ? null : `AISnitch daemon startup failed: ${structuredFailure}`;
11954
+ } catch {
11955
+ return null;
11956
+ }
11957
+ }
11958
+ function parseStructuredDaemonFailure(logLine) {
11959
+ try {
11960
+ const parsedLog = JSON.parse(logLine);
11961
+ if (typeof parsedLog.level !== "number" || parsedLog.level < 50) {
11962
+ return null;
11963
+ }
11964
+ return typeof parsedLog.msg === "string" && parsedLog.msg.length > 0 ? parsedLog.msg : logLine;
11950
11965
  } catch {
11951
11966
  return null;
11952
11967
  }