@agimon-ai/po-git 0.0.0-alpha.25 → 0.0.0-alpha.26

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.
@@ -1860,11 +1860,15 @@ function parseCommand(payload) {
1860
1860
  /**
1861
1861
  * What the reader is told when a command fails.
1862
1862
  *
1863
- * An expected failure explains itself. Anything else is summarised, never
1864
- * echoed: a git error can carry a remote URL with a token in it.
1863
+ * An expected failure explains itself, minus the `[code]` tag and recovery line
1864
+ * written for the agent's tool result. A dirty close is said in the person's
1865
+ * terms, because its message tells the agent to pass `force`. Anything else is
1866
+ * summarised, never echoed: a git error can carry a remote URL with a token in it.
1865
1867
  */
1866
1868
  function failureText(error) {
1867
- return error instanceof require_worktreeOperations.PoGitExpectedError ? error.message : "The worktree operation failed.";
1869
+ if (!(error instanceof require_worktreeOperations.PoGitExpectedError)) return "The worktree operation failed.";
1870
+ if (error.code === "worktree_dirty") return "The worktree has uncommitted changes.";
1871
+ return error.message.replace(/^\[[a-z_]+\] /u, "").split("\nRecovery:")[0] ?? error.message;
1868
1872
  }
1869
1873
  /** Starts one direct-event subscription per managed session. */
1870
1874
  function createWorktreesChannel(options = {}) {