staklink 0.4.13 → 0.4.15

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.
@@ -60927,7 +60927,7 @@ var SSEManager = class {
60927
60927
  var sseManager = new SSEManager();
60928
60928
 
60929
60929
  // src/proxy/version.ts
60930
- var VERSION = "0.4.13";
60930
+ var VERSION = "0.4.15";
60931
60931
 
60932
60932
  // node_modules/uuid/dist/esm/stringify.js
60933
60933
  var byteToHex = [];
@@ -141651,10 +141651,10 @@ function buildPushPrompt(opts) {
141651
141651
  const lines = [
141652
141652
  `You are in the git repo at: ${opts.repoPath}`,
141653
141653
  "",
141654
- "Perform the following git operations. If any step fails, diagnose the problem and fix it (resolve merge conflicts, pull and rebase, etc). Be resilient - the goal is to get code pushed successfully.",
141654
+ "Perform the following git operations. If any step fails, diagnose the problem and fix it (resolve merge conflicts, pull and rebase, etc). Be resilient - the goal is to get code pushed successfully. BUT its possible everything has already been pushed! In that case you dont have to do anything of course.",
141655
141655
  "",
141656
- "1. Check the current branch. If you are on main or master, create a new feature branch and switch to it. Otherwise stay on the current branch.",
141657
- "2. Check git status. If there are uncommitted changes, stage them (git add .) and commit with a short descriptive message. If everything is already committed, skip this step.",
141656
+ `1. Check the current branch. If you are on main or master, create a new feature branch${opts.branchName ? ` named "${opts.branchName}"` : ""} and switch to it. Otherwise stay on the current branch.`,
141657
+ `2. Check git status. If there are uncommitted changes, stage them (git add .) and commit${opts.commitName ? " using the exact commit message provided below" : " with a short descriptive message"}. If everything is already committed, skip this step.`,
141658
141658
  "3. Push the current branch to origin. If the push is rejected (non-fast-forward, remote has new work, etc), pull with rebase and try again. If there are merge conflicts during rebase, resolve them sensibly and continue."
141659
141659
  ];
141660
141660
  if (opts.createPR) {
@@ -141688,6 +141688,15 @@ function buildPushPrompt(opts) {
141688
141688
  "- Output the branch name you ended up on.",
141689
141689
  "- Output the commit hash after pushing."
141690
141690
  );
141691
+ if (opts.commitName) {
141692
+ lines.push(
141693
+ "",
141694
+ "COMMIT MESSAGE (use this exactly with git commit -m, preserve the formatting):",
141695
+ "---",
141696
+ opts.commitName.replace(/[\\"`$]/g, "\\$&"),
141697
+ "---"
141698
+ );
141699
+ }
141691
141700
  return lines.join("\n");
141692
141701
  }
141693
141702
  async function handleAgentPush(req, res) {
@@ -141720,6 +141729,8 @@ async function handleAgentPush(req, res) {
141720
141729
  const repoPath = repo.printcwd();
141721
141730
  const repoName = getRepoNameFromUrl(r.url);
141722
141731
  const baseBranch = r.base_branch || "main";
141732
+ const commitName = r.commit_name;
141733
+ const branchName = r.branch_name;
141723
141734
  const { env: credEnv, teardown } = await setupGlobalGitCredentials(
141724
141735
  repoPath,
141725
141736
  code.git_credentials
@@ -141730,7 +141741,9 @@ async function handleAgentPush(req, res) {
141730
141741
  createPR,
141731
141742
  autoMerge,
141732
141743
  label,
141733
- baseBranch
141744
+ baseBranch,
141745
+ commitName,
141746
+ branchName
141734
141747
  });
141735
141748
  log(`=> agent/push prompt for ${repoName}:
141736
141749
  ${prompt}`);
@@ -141769,7 +141782,7 @@ ${prompt}`);
141769
141782
  results.branches[repoName] = branchMatch[1];
141770
141783
  }
141771
141784
  const prMatch = output.match(
141772
- /https:\/\/github\.com\/[^\s]+\/pull\/\d+/
141785
+ /https:\/\/github\.com\/[^\s\])"'>]+\/pull\/\d+/
141773
141786
  );
141774
141787
  if (prMatch) {
141775
141788
  results.prs[repoName] = prMatch[0];
@@ -11004,7 +11004,7 @@ var glob = Object.assign(glob_, {
11004
11004
  glob.glob = glob;
11005
11005
 
11006
11006
  // src/proxy/version.ts
11007
- var VERSION = "0.4.13";
11007
+ var VERSION = "0.4.15";
11008
11008
 
11009
11009
  // src/deps.ts
11010
11010
  var import_child_process = require("child_process");
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.4.13",
5
+ "version": "0.4.15",
6
6
  "type": "module",
7
7
  "publisher": "stakwork",
8
8
  "engines": {