offsite 0.0.5 → 0.0.6

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.
@@ -85,15 +85,18 @@ function lock() {
85
85
  if (!hasCode(error, "EEXIST")) throw error;
86
86
  }
87
87
  let content;
88
+ let modified;
88
89
  try {
89
90
  content = readFileSync(lockFile, "utf8");
91
+ modified = statSync(lockFile).mtimeMs;
90
92
  } catch (error) {
91
93
  if (hasCode(error, "ENOENT")) return lock();
92
94
  throw error;
93
95
  }
94
96
  const pid = Number(content);
95
- if (!Number.isInteger(pid) || pid < 1) throw new Error(`invalid pid ${JSON.stringify(content)} in ${lockFile}`);
96
- if (pid !== process.pid && isRunning(pid)) {
97
+ const validPid = Number.isInteger(pid) && pid > 0;
98
+ const writtenThisBoot = modified > Date.now() - os.uptime() * 1e3;
99
+ if (validPid && writtenThisBoot && pid !== process.pid && isRunning(pid)) {
97
100
  consola.error(`offsite is already running for ${home} (pid ${pid})`);
98
101
  process.exit(1);
99
102
  }
@@ -3787,7 +3790,7 @@ var Run = class {
3787
3790
  return;
3788
3791
  }
3789
3792
  case "result": {
3790
- if (message.subtype !== "success") this.add(notice(message.errors.join("\n") || message.subtype));
3793
+ if (message.subtype !== "success" && message.terminal_reason !== "aborted_streaming" && message.terminal_reason !== "aborted_tools") this.add(notice(message.errors.filter((error) => !error.startsWith("[ede_diagnostic]")).join("\n") || message.subtype));
3791
3794
  this.finishTurn();
3792
3795
  const usage = this.model === null ? void 0 : message.modelUsage[this.model];
3793
3796
  if (this.context !== null && usage !== void 0) this.context = {