@agimon-ai/po-git 0.0.0-alpha.65 → 0.0.0-alpha.67

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.
@@ -1,4 +1,4 @@
1
- import { C as READ_TIMEOUT_MS, E as runGit, S as NETWORK_TIMEOUT_MS, T as createWorktreeGit, a as GIT_WORKTREE_LIFECYCLE_EVENT, c as isWorktreeLifecycleEvent, d as registryFile, f as readJson, g as invalidRequest, h as PoGitExpectedError, i as GIT_SESSION_CHANGED_EVENT, l as credentialsFile, m as HubUnavailableError, n as createWorktreeRegistry, o as createWorktreeMessageInbox, p as writeJsonAtomic, r as validRefName, s as isSessionChangedEvent, t as createWorktreeOperations, u as poGitRoot, w as REBASE_TIMEOUT_MS } from "../worktreeOperations-CP2lYxrI.mjs";
1
+ import { C as READ_TIMEOUT_MS, E as runGit, S as NETWORK_TIMEOUT_MS, T as createWorktreeGit, a as GIT_WORKTREE_LIFECYCLE_EVENT, c as isWorktreeLifecycleEvent, d as registryFile, f as readJson, g as invalidRequest, h as PoGitExpectedError, i as GIT_SESSION_CHANGED_EVENT, l as credentialsFile, m as HubUnavailableError, n as createWorktreeRegistry, o as createWorktreeMessageInbox, p as writeJsonAtomic, r as validRefName, s as isSessionChangedEvent, t as createWorktreeOperations, u as poGitRoot, w as REBASE_TIMEOUT_MS } from "../worktreeOperations-B3E4JY4H.mjs";
2
2
  import fs from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import os from "node:os";
@@ -1999,11 +1999,15 @@ function sameList(left, right) {
1999
1999
  return other !== void 0 && entry.id === other.id && entry.branch === other.branch && entry.sessionId === other.sessionId && entry.orphaned === other.orphaned && entry.unowned === other.unowned;
2000
2000
  });
2001
2001
  }
2002
- function errorTargetFor(command) {
2003
- return command.action === "create" ? { action: "create" } : {
2002
+ function errorTargetFor(command, error) {
2003
+ if (command.action === "close") return {
2004
2004
  action: "close",
2005
2005
  id: command.id
2006
2006
  };
2007
+ return error instanceof PoGitExpectedError && error.code === "rift_missing" ? {
2008
+ action: "create",
2009
+ riftMissing: true
2010
+ } : { action: "create" };
2007
2011
  }
2008
2012
  /** A command the page sent, or undefined when the frame was not one. */
2009
2013
  function parseCommand(payload) {
@@ -2191,7 +2195,7 @@ function createWorktreesChannel(options = {}) {
2191
2195
  }).catch((error) => {
2192
2196
  if (generations.get(scope.sessionId) !== generation) return;
2193
2197
  host.onNotice(`worktree command failed for ${scope.sessionId} (${failureText(error)})`);
2194
- mark(scope, void 0, failureText(error), errorTargetFor(command));
2198
+ mark(scope, void 0, failureText(error), errorTargetFor(command, error));
2195
2199
  }).finally(() => {
2196
2200
  if (generations.get(scope.sessionId) === generation) busy.delete(scope.sessionId);
2197
2201
  });