staklink 0.3.72 → 0.3.73

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.
@@ -61136,16 +61136,40 @@ var Repo = class {
61136
61136
  await this.unsetUserConfig();
61137
61137
  }
61138
61138
  // Enhanced push method that accepts user credentials
61139
+ // Automatically handles the case where remote has new commits (e.g., from GitHub rebase)
61140
+ // by pulling with rebase and pushing again
61139
61141
  async pushCurrentBranchWithCredentials(credentials) {
61140
61142
  const currentBranch = (await this.printCurrentBranch()).trim();
61141
61143
  try {
61142
61144
  if (credentials) {
61143
61145
  await this.setUserCredentials(credentials);
61144
61146
  }
61145
- const result = await this.push(currentBranch);
61146
- return result;
61147
- } catch (e) {
61148
- throw e;
61147
+ try {
61148
+ const result = await this.push(currentBranch);
61149
+ return result;
61150
+ } catch (pushError) {
61151
+ const errorMessage = pushError instanceof Error ? pushError.message : String(pushError);
61152
+ const isRejectedDueToRemoteChanges = errorMessage.includes("[rejected]") || errorMessage.includes("non-fast-forward") || errorMessage.includes("Updates were rejected");
61153
+ if (isRejectedDueToRemoteChanges) {
61154
+ try {
61155
+ await this.execCommand(
61156
+ `git pull --rebase origin ${currentBranch}`
61157
+ );
61158
+ } catch (pullError) {
61159
+ const status = await this.execCommand("git status");
61160
+ if (status.includes("rebase in progress") || status.includes("Unmerged") || status.includes("both modified")) {
61161
+ await this.execCommand("git rebase --abort");
61162
+ throw new Error(
61163
+ `Push failed: Remote has conflicting changes that cannot be automatically rebased. Please resolve conflicts manually.`
61164
+ );
61165
+ }
61166
+ throw pullError;
61167
+ }
61168
+ const result = await this.push(currentBranch);
61169
+ return result;
61170
+ }
61171
+ throw pushError;
61172
+ }
61149
61173
  } finally {
61150
61174
  if (credentials) {
61151
61175
  await this.restoreOriginalCredentials();
@@ -61229,7 +61253,7 @@ var SSEManager = class {
61229
61253
  var sseManager = new SSEManager();
61230
61254
 
61231
61255
  // src/proxy/version.ts
61232
- var VERSION = "0.3.72";
61256
+ var VERSION = "0.3.73";
61233
61257
 
61234
61258
  // node_modules/uuid/dist/esm/stringify.js
61235
61259
  var byteToHex = [];
@@ -10967,7 +10967,7 @@ var glob = Object.assign(glob_, {
10967
10967
  glob.glob = glob;
10968
10968
 
10969
10969
  // src/proxy/version.ts
10970
- var VERSION = "0.3.72";
10970
+ var VERSION = "0.3.73";
10971
10971
 
10972
10972
  // src/cli.ts
10973
10973
  var STAKLINK_PROXY = "staklink-proxy";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "staklink",
3
3
  "displayName": "staklink",
4
4
  "description": "staklink process manager",
5
- "version": "0.3.72",
5
+ "version": "0.3.73",
6
6
  "type": "module",
7
7
  "publisher": "stakwork",
8
8
  "engines": {