staklink 0.3.6 → 0.3.8

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.
@@ -33901,7 +33901,7 @@ var SSEManager = class {
33901
33901
  var sseManager = new SSEManager();
33902
33902
 
33903
33903
  // src/proxy/version.ts
33904
- var VERSION = "0.3.6";
33904
+ var VERSION = "0.3.8";
33905
33905
 
33906
33906
  // node_modules/uuid/dist/esm/stringify.js
33907
33907
  var byteToHex = [];
@@ -79588,9 +79588,11 @@ var GitHubCLI = class {
79588
79588
  branch;
79589
79589
  owner;
79590
79590
  repo;
79591
- constructor(token, branch) {
79591
+ cwd;
79592
+ constructor(token, branch, cwd) {
79592
79593
  this.token = token;
79593
79594
  this.branch = branch;
79595
+ this.cwd = cwd;
79594
79596
  }
79595
79597
  /**
79596
79598
  * Initialize and get repo info from git
@@ -79612,6 +79614,7 @@ var GitHubCLI = class {
79612
79614
  const fullCommand = `gh ${command}`;
79613
79615
  try {
79614
79616
  return await execAsync(fullCommand, {
79617
+ cwd: this.cwd,
79615
79618
  env: {
79616
79619
  ...process.env,
79617
79620
  GH_TOKEN: this.token,
@@ -79632,6 +79635,7 @@ Stderr: ${error82.stderr}`
79632
79635
  const fullCommand = `gh ${command}`;
79633
79636
  try {
79634
79637
  return (0, import_child_process4.execSync)(fullCommand, {
79638
+ cwd: this.cwd,
79635
79639
  encoding: "utf-8",
79636
79640
  env: {
79637
79641
  ...process.env,
@@ -80282,6 +80286,10 @@ async function startProxyServer() {
80282
80286
  const createPR = req.query.pr === "true";
80283
80287
  const commits = [];
80284
80288
  const prs = {};
80289
+ console.log(`=> PR creation requested: ${createPR}`);
80290
+ console.log(
80291
+ `=> Git credentials available: ${!!code.git_credentials?.auth_data?.token}`
80292
+ );
80285
80293
  for (const r of repos) {
80286
80294
  console.log(`=> PUSH to ${r.url}`);
80287
80295
  const repo = await NewRepo(r.url);
@@ -80292,13 +80300,23 @@ async function startProxyServer() {
80292
80300
  }
80293
80301
  const link = await repo.getLatestCommitLink();
80294
80302
  commits.push(link);
80295
- if (createPR && code.git_credentials?.auth_data?.token) {
80303
+ if (createPR) {
80304
+ const repoName = getRepoNameFromUrl(r.url);
80305
+ if (!code.git_credentials?.auth_data?.token) {
80306
+ console.error(`=> No GitHub token available for PR creation`);
80307
+ prs[repoName] = "Error: GitHub token required for PR creation";
80308
+ continue;
80309
+ }
80296
80310
  try {
80297
80311
  console.log(`=> Creating PR for ${r.url}`);
80298
- const repoName = getRepoNameFromUrl(r.url);
80312
+ console.log(`=> Branch: ${r.branch_name}`);
80313
+ console.log(`=> Base: ${r.base_branch || "main"}`);
80314
+ const repoLocation = repo.printcwd();
80315
+ console.log(`=> Repo location: ${repoLocation}`);
80299
80316
  const gh = new GitHubCLI(
80300
80317
  code.git_credentials.auth_data.token,
80301
- r.branch_name
80318
+ r.branch_name,
80319
+ repoLocation
80302
80320
  );
80303
80321
  await gh.init();
80304
80322
  const existingPR = await gh.findPRByBranch();
@@ -80317,7 +80335,6 @@ async function startProxyServer() {
80317
80335
  }
80318
80336
  } catch (prError) {
80319
80337
  console.error(`=> Failed to create PR for ${r.url}:`, prError);
80320
- const repoName = getRepoNameFromUrl(r.url);
80321
80338
  prs[repoName] = `Error: ${prError instanceof Error ? prError.message : String(prError)}`;
80322
80339
  }
80323
80340
  }
@@ -10905,7 +10905,7 @@ var glob = Object.assign(glob_, {
10905
10905
  glob.glob = glob;
10906
10906
 
10907
10907
  // src/proxy/version.ts
10908
- var VERSION = "0.3.6";
10908
+ var VERSION = "0.3.8";
10909
10909
 
10910
10910
  // src/cli.ts
10911
10911
  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.6",
5
+ "version": "0.3.8",
6
6
  "type": "module",
7
7
  "publisher": "stakwork",
8
8
  "engines": {