@adhdev/daemon-standalone 0.9.76-rc.20 → 0.9.76-rc.22

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 CHANGED
@@ -36057,6 +36057,7 @@ ${lastSnapshot}`;
36057
36057
  "dirty_index_required",
36058
36058
  "conflict",
36059
36059
  "invalid_args",
36060
+ "nothing_to_commit",
36060
36061
  "git_command_failed"
36061
36062
  ]);
36062
36063
  function failure(reason, error48) {
@@ -36301,7 +36302,10 @@ ${lastSnapshot}`;
36301
36302
  } catch (err) {
36302
36303
  const output = (err?.stdout || "") + (err?.stderr || "");
36303
36304
  if (/nothing to commit/i.test(output)) {
36304
- throw new GitCommandError("git_command_failed", "Nothing to commit");
36305
+ throw new GitCommandError("nothing_to_commit", "Nothing to commit \u2014 working tree is clean.", {
36306
+ stdout: err?.stdout,
36307
+ stderr: err?.stderr
36308
+ });
36305
36309
  }
36306
36310
  throw err;
36307
36311
  }
@@ -46714,10 +46718,26 @@ ${effect.notification.body || ""}`.trim();
46714
46718
  }
46715
46719
  mergeConversationMessages(parsedMessages) {
46716
46720
  if (this.runtimeMessages.length === 0) return normalizeChatMessages(parsedMessages);
46717
- return normalizeChatMessages([...parsedMessages, ...this.runtimeMessages.map((entry) => entry.message)].map((message, index) => ({ message, index })).sort((a, b2) => {
46718
- const aTime = a.message.receivedAt || a.message.timestamp || 0;
46719
- const bTime = b2.message.receivedAt || b2.message.timestamp || 0;
46720
- if (aTime !== bTime) return aTime - bTime;
46721
+ const parsedEntries = parsedMessages.map((message, index) => ({
46722
+ message,
46723
+ index,
46724
+ source: "parsed"
46725
+ }));
46726
+ const runtimeEntries = this.runtimeMessages.map((entry, index) => ({
46727
+ message: entry.message,
46728
+ index: parsedMessages.length + index,
46729
+ source: "runtime"
46730
+ }));
46731
+ const getTime = (message) => {
46732
+ const value = typeof message.receivedAt === "number" ? message.receivedAt : typeof message.timestamp === "number" ? message.timestamp : 0;
46733
+ return Number.isFinite(value) && value > 0 ? value : 0;
46734
+ };
46735
+ return normalizeChatMessages([...parsedEntries, ...runtimeEntries].sort((a, b2) => {
46736
+ const aTime = getTime(a.message);
46737
+ const bTime = getTime(b2.message);
46738
+ if (aTime && bTime && aTime !== bTime) return aTime - bTime;
46739
+ if (aTime && !bTime && a.source === "runtime" && b2.source === "parsed") return -1;
46740
+ if (!aTime && bTime && a.source === "parsed" && b2.source === "runtime") return 1;
46721
46741
  return a.index - b2.index;
46722
46742
  }).map((entry) => entry.message));
46723
46743
  }