staklink 0.3.34 → 0.3.36

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.
@@ -56419,7 +56419,7 @@ var SSEManager = class {
56419
56419
  var sseManager = new SSEManager();
56420
56420
 
56421
56421
  // src/proxy/version.ts
56422
- var VERSION = "0.3.34";
56422
+ var VERSION = "0.3.36";
56423
56423
 
56424
56424
  // node_modules/uuid/dist/esm/stringify.js
56425
56425
  var byteToHex = [];
@@ -102344,6 +102344,9 @@ Stderr: ${error82.stderr}`
102344
102344
  getBranch() {
102345
102345
  return this.branch;
102346
102346
  }
102347
+ async addLabelToPR(prNumber, label) {
102348
+ await this.execGH(`pr edit ${prNumber} --add-label ${label}`);
102349
+ }
102347
102350
  };
102348
102351
 
102349
102352
  // src/proxy/playwright.ts
@@ -103219,9 +103222,11 @@ ${lines2.map((line) => "+" + line).join("\n")}`;
103219
103222
  const createPR = req.query.pr === "true";
103220
103223
  const shouldCommit = req.query.commit === "true";
103221
103224
  const autoMerge = req.query.automerge === "true";
103225
+ const label = req.query.label;
103222
103226
  const stayOnCurrentBranch = req.query.stayOnCurrentBranch === "true";
103223
103227
  const commits = [];
103224
103228
  const prs = {};
103229
+ const prErrors = {};
103225
103230
  const branches = {};
103226
103231
  console.log(`=> Commit requested: ${shouldCommit}`);
103227
103232
  console.log(`=> PR creation requested: ${createPR}`);
@@ -103288,7 +103293,7 @@ ${lines2.map((line) => "+" + line).join("\n")}`;
103288
103293
  if (createPR) {
103289
103294
  if (!code.git_credentials?.auth_data?.token) {
103290
103295
  console.error(`=> No GitHub token available for PR creation`);
103291
- prs[repoName] = "Error: GitHub token required for PR creation";
103296
+ prErrors[repoName] = "GitHub token required for PR creation";
103292
103297
  continue;
103293
103298
  }
103294
103299
  try {
@@ -103307,7 +103312,7 @@ ${lines2.map((line) => "+" + line).join("\n")}`;
103307
103312
  console.log(
103308
103313
  `=> Cannot create PR: currently on base branch (${baseBranch})`
103309
103314
  );
103310
- prs[repoName] = `Error: Cannot create PR - currently on base branch (${baseBranch}). Commit changes to a feature branch first.`;
103315
+ prErrors[repoName] = `Cannot create PR - currently on base branch (${baseBranch}). Commit changes to a feature branch first.`;
103311
103316
  continue;
103312
103317
  }
103313
103318
  try {
@@ -103318,7 +103323,7 @@ ${lines2.map((line) => "+" + line).join("\n")}`;
103318
103323
  console.log(
103319
103324
  `=> No commits between ${baseBranch} and ${currentBranch2}`
103320
103325
  );
103321
- prs[repoName] = `Error: No commits to create PR - ${currentBranch2} is up to date with ${baseBranch}`;
103326
+ prErrors[repoName] = `No commits to create PR - ${currentBranch2} is up to date with ${baseBranch}`;
103322
103327
  continue;
103323
103328
  }
103324
103329
  console.log(`=> Commits to include in PR:
@@ -103350,6 +103355,13 @@ ${diff.trim()}`);
103350
103355
  console.log(`=> PR created: ${pr.url}`);
103351
103356
  prs[repoName] = pr.url;
103352
103357
  prNumber = pr.number;
103358
+ if (label) {
103359
+ try {
103360
+ await gh.addLabelToPR(pr.number, label);
103361
+ } catch (e) {
103362
+ console.error(`=> PR failed to add label: ${e}`);
103363
+ }
103364
+ }
103353
103365
  }
103354
103366
  if (autoMerge) {
103355
103367
  try {
@@ -103375,14 +103387,16 @@ ${diff.trim()}`);
103375
103387
  }
103376
103388
  } catch (prError) {
103377
103389
  console.error(`=> Failed to create PR for ${r.url}:`, prError);
103378
- fail(res, prError);
103379
- return;
103390
+ prErrors[repoName] = prError instanceof Error ? prError.message : String(prError);
103380
103391
  }
103381
103392
  }
103382
103393
  }
103383
103394
  const response = { success: true, commits, branches };
103384
103395
  if (createPR) {
103385
103396
  response.prs = prs;
103397
+ if (Object.keys(prErrors).length > 0) {
103398
+ response.prErrors = prErrors;
103399
+ }
103386
103400
  }
103387
103401
  res.json(response);
103388
103402
  } catch (e) {
@@ -10906,7 +10906,7 @@ var glob = Object.assign(glob_, {
10906
10906
  glob.glob = glob;
10907
10907
 
10908
10908
  // src/proxy/version.ts
10909
- var VERSION = "0.3.34";
10909
+ var VERSION = "0.3.36";
10910
10910
 
10911
10911
  // src/cli.ts
10912
10912
  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.34",
5
+ "version": "0.3.36",
6
6
  "type": "module",
7
7
  "publisher": "stakwork",
8
8
  "engines": {