@wrongstack/tools 0.7.2 → 0.7.3
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/builtin.js +45 -3
- package/dist/builtin.js.map +1 -1
- package/dist/git.d.ts +9 -1
- package/dist/git.js +45 -3
- package/dist/git.js.map +1 -1
- package/dist/index.js +45 -3
- package/dist/index.js.map +1 -1
- package/dist/pack.js +45 -3
- package/dist/pack.js.map +1 -1
- package/package.json +2 -2
package/dist/builtin.js
CHANGED
|
@@ -1910,7 +1910,7 @@ var MAX_OUTPUT3 = 1e5;
|
|
|
1910
1910
|
var gitTool = {
|
|
1911
1911
|
name: "git",
|
|
1912
1912
|
category: "Git",
|
|
1913
|
-
description: "Run git commands. Wraps common operations: status, log, diff, commit, branch, checkout, stash, push, pull, fetch, reset.",
|
|
1913
|
+
description: "Run git commands. Wraps common operations: status, log, diff, commit, branch, checkout, stash, push, pull, fetch, reset, worktree.",
|
|
1914
1914
|
usageHint: "Prefer built-in subcommands over raw args. `command` is required. `message` for commits. `branch` for checkout/branch. `files` for status/diff. `format` for log.",
|
|
1915
1915
|
permission: "confirm",
|
|
1916
1916
|
// Conservative: any of these may mutate. The non-mutating commands
|
|
@@ -1934,7 +1934,8 @@ var gitTool = {
|
|
|
1934
1934
|
"push",
|
|
1935
1935
|
"pull",
|
|
1936
1936
|
"fetch",
|
|
1937
|
-
"reset"
|
|
1937
|
+
"reset",
|
|
1938
|
+
"worktree"
|
|
1938
1939
|
],
|
|
1939
1940
|
description: "Git subcommand"
|
|
1940
1941
|
},
|
|
@@ -1950,7 +1951,24 @@ var gitTool = {
|
|
|
1950
1951
|
description: "Log format (default: short)"
|
|
1951
1952
|
},
|
|
1952
1953
|
limit: { type: "integer", description: "Limit for log (default: 20)" },
|
|
1953
|
-
dry_run: { type: "boolean", description: "For commit: show what would be committed" }
|
|
1954
|
+
dry_run: { type: "boolean", description: "For commit: show what would be committed" },
|
|
1955
|
+
worktreeAction: {
|
|
1956
|
+
type: "string",
|
|
1957
|
+
enum: ["list", "add", "remove", "prune"],
|
|
1958
|
+
description: "Worktree action: list, add, remove, prune"
|
|
1959
|
+
},
|
|
1960
|
+
worktreePath: {
|
|
1961
|
+
type: "string",
|
|
1962
|
+
description: 'Path for worktree add/remove (e.g. "../wt-feature-xyz")'
|
|
1963
|
+
},
|
|
1964
|
+
newBranch: {
|
|
1965
|
+
type: "boolean",
|
|
1966
|
+
description: "Create new branch when adding worktree"
|
|
1967
|
+
},
|
|
1968
|
+
force: {
|
|
1969
|
+
type: "boolean",
|
|
1970
|
+
description: "Force operation (e.g. worktree remove --force)"
|
|
1971
|
+
}
|
|
1954
1972
|
},
|
|
1955
1973
|
required: ["command"]
|
|
1956
1974
|
},
|
|
@@ -2037,6 +2055,30 @@ function buildArgs(input) {
|
|
|
2037
2055
|
return ["fetch", ...input.branch ? [input.branch] : ["--all"]];
|
|
2038
2056
|
case "reset":
|
|
2039
2057
|
return ["reset"];
|
|
2058
|
+
case "worktree":
|
|
2059
|
+
switch (input.worktreeAction) {
|
|
2060
|
+
case "list":
|
|
2061
|
+
return ["worktree", "list"];
|
|
2062
|
+
case "add":
|
|
2063
|
+
return [
|
|
2064
|
+
"worktree",
|
|
2065
|
+
"add",
|
|
2066
|
+
...input.newBranch ? ["-b"] : [],
|
|
2067
|
+
...input.branch ? [input.branch] : [],
|
|
2068
|
+
input.worktreePath ?? ""
|
|
2069
|
+
].filter(Boolean);
|
|
2070
|
+
case "remove":
|
|
2071
|
+
return [
|
|
2072
|
+
"worktree",
|
|
2073
|
+
"remove",
|
|
2074
|
+
...input.force ? ["--force"] : [],
|
|
2075
|
+
input.worktreePath ?? ""
|
|
2076
|
+
].filter(Boolean);
|
|
2077
|
+
case "prune":
|
|
2078
|
+
return ["worktree", "prune"];
|
|
2079
|
+
default:
|
|
2080
|
+
return ["worktree", "list"];
|
|
2081
|
+
}
|
|
2040
2082
|
default:
|
|
2041
2083
|
return [input.command];
|
|
2042
2084
|
}
|