staklink 0.4.14 → 0.4.16
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.
- package/dist/proxy-server.cjs +23 -7
- package/dist/staklink-cli.cjs +1 -1
- package/package.json +1 -1
package/dist/proxy-server.cjs
CHANGED
|
@@ -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.
|
|
60930
|
+
var VERSION = "0.4.16";
|
|
60931
60931
|
|
|
60932
60932
|
// node_modules/uuid/dist/esm/stringify.js
|
|
60933
60933
|
var byteToHex = [];
|
|
@@ -141651,16 +141651,18 @@ 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 needed. 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 (if there is code to push of course!).",
|
|
141655
141655
|
"",
|
|
141656
|
-
"
|
|
141657
|
-
"
|
|
141658
|
-
|
|
141656
|
+
"CRITICAL: Before doing anything, run `git status` and `git log origin/<current-branch>..HEAD` (if the remote branch exists) to check whether there are actually any changes to commit or push. If the working tree is clean AND there are no unpushed commits, STOP IMMEDIATELY. Do NOT create a commit, do NOT push, do NOT create a PR. Just output that there were no changes and exit.",
|
|
141657
|
+
"",
|
|
141658
|
+
`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.`,
|
|
141659
|
+
`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.`,
|
|
141660
|
+
"3. Push the current branch to origin ONLY if there are unpushed commits. If the branch is already up-to-date with origin, skip this step. 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
141661
|
];
|
|
141660
141662
|
if (opts.createPR) {
|
|
141661
141663
|
let step = 4;
|
|
141662
141664
|
lines.push(
|
|
141663
|
-
`${step}.
|
|
141665
|
+
`${step}. ONLY if you actually pushed commits in step 3, create a pull request from the current branch to "${opts.baseBranch}" using the gh CLI. The PR title should be derived from the commit message. If a PR already exists for this branch, or if there was nothing to push, skip creation.`
|
|
141664
141666
|
);
|
|
141665
141667
|
if (opts.label) {
|
|
141666
141668
|
step++;
|
|
@@ -141682,12 +141684,22 @@ function buildPushPrompt(opts) {
|
|
|
141682
141684
|
lines.push(
|
|
141683
141685
|
"",
|
|
141684
141686
|
"IMPORTANT:",
|
|
141687
|
+
"- If there are NO changes to commit and NO unpushed commits, do NOTHING. Do not commit, do not push, do not create a PR. Just report that there were no changes.",
|
|
141685
141688
|
"- Do NOT ask for confirmation. Just do it.",
|
|
141686
141689
|
"- If push fails, try pulling with rebase first. If that fails with conflicts, resolve them and continue.",
|
|
141687
141690
|
"- Output the PR URL if you created one.",
|
|
141688
141691
|
"- Output the branch name you ended up on.",
|
|
141689
141692
|
"- Output the commit hash after pushing."
|
|
141690
141693
|
);
|
|
141694
|
+
if (opts.commitName) {
|
|
141695
|
+
lines.push(
|
|
141696
|
+
"",
|
|
141697
|
+
"COMMIT MESSAGE (use this exactly with git commit -m, preserve the formatting):",
|
|
141698
|
+
"---",
|
|
141699
|
+
opts.commitName.replace(/[\\"`$]/g, "\\$&"),
|
|
141700
|
+
"---"
|
|
141701
|
+
);
|
|
141702
|
+
}
|
|
141691
141703
|
return lines.join("\n");
|
|
141692
141704
|
}
|
|
141693
141705
|
async function handleAgentPush(req, res) {
|
|
@@ -141720,6 +141732,8 @@ async function handleAgentPush(req, res) {
|
|
|
141720
141732
|
const repoPath = repo.printcwd();
|
|
141721
141733
|
const repoName = getRepoNameFromUrl(r.url);
|
|
141722
141734
|
const baseBranch = r.base_branch || "main";
|
|
141735
|
+
const commitName = r.commit_name;
|
|
141736
|
+
const branchName = r.branch_name;
|
|
141723
141737
|
const { env: credEnv, teardown } = await setupGlobalGitCredentials(
|
|
141724
141738
|
repoPath,
|
|
141725
141739
|
code.git_credentials
|
|
@@ -141730,7 +141744,9 @@ async function handleAgentPush(req, res) {
|
|
|
141730
141744
|
createPR,
|
|
141731
141745
|
autoMerge,
|
|
141732
141746
|
label,
|
|
141733
|
-
baseBranch
|
|
141747
|
+
baseBranch,
|
|
141748
|
+
commitName,
|
|
141749
|
+
branchName
|
|
141734
141750
|
});
|
|
141735
141751
|
log(`=> agent/push prompt for ${repoName}:
|
|
141736
141752
|
${prompt}`);
|
package/dist/staklink-cli.cjs
CHANGED
|
@@ -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.
|
|
11007
|
+
var VERSION = "0.4.16";
|
|
11008
11008
|
|
|
11009
11009
|
// src/deps.ts
|
|
11010
11010
|
var import_child_process = require("child_process");
|