@aku11i/phantom 2.1.1 → 2.2.0
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/package.json +1 -1
- package/phantom.js +58 -8
package/package.json
CHANGED
package/phantom.js
CHANGED
|
@@ -9726,6 +9726,22 @@ async function githubCheckoutHandler(args2) {
|
|
|
9726
9726
|
options: {
|
|
9727
9727
|
base: {
|
|
9728
9728
|
type: "string"
|
|
9729
|
+
},
|
|
9730
|
+
tmux: {
|
|
9731
|
+
type: "boolean",
|
|
9732
|
+
short: "t"
|
|
9733
|
+
},
|
|
9734
|
+
"tmux-vertical": {
|
|
9735
|
+
type: "boolean"
|
|
9736
|
+
},
|
|
9737
|
+
"tmux-v": {
|
|
9738
|
+
type: "boolean"
|
|
9739
|
+
},
|
|
9740
|
+
"tmux-horizontal": {
|
|
9741
|
+
type: "boolean"
|
|
9742
|
+
},
|
|
9743
|
+
"tmux-h": {
|
|
9744
|
+
type: "boolean"
|
|
9729
9745
|
}
|
|
9730
9746
|
},
|
|
9731
9747
|
allowPositionals: true
|
|
@@ -9737,11 +9753,45 @@ async function githubCheckoutHandler(args2) {
|
|
|
9737
9753
|
exitCodes.validationError
|
|
9738
9754
|
);
|
|
9739
9755
|
}
|
|
9756
|
+
const tmuxOption = values.tmux || values["tmux-vertical"] || values["tmux-v"] || values["tmux-horizontal"] || values["tmux-h"];
|
|
9757
|
+
let tmuxDirection;
|
|
9758
|
+
if (values.tmux) {
|
|
9759
|
+
tmuxDirection = "new";
|
|
9760
|
+
} else if (values["tmux-vertical"] || values["tmux-v"]) {
|
|
9761
|
+
tmuxDirection = "vertical";
|
|
9762
|
+
} else if (values["tmux-horizontal"] || values["tmux-h"]) {
|
|
9763
|
+
tmuxDirection = "horizontal";
|
|
9764
|
+
}
|
|
9765
|
+
if (tmuxOption && !await isInsideTmux()) {
|
|
9766
|
+
exitWithError(
|
|
9767
|
+
"The --tmux option can only be used inside a tmux session",
|
|
9768
|
+
exitCodes.validationError
|
|
9769
|
+
);
|
|
9770
|
+
}
|
|
9740
9771
|
const result = await githubCheckout({ number, base: values.base });
|
|
9741
9772
|
if (isErr(result)) {
|
|
9742
9773
|
exitWithError(result.error.message, exitCodes.generalError);
|
|
9743
9774
|
}
|
|
9744
9775
|
output.log(result.value.message);
|
|
9776
|
+
if (tmuxDirection) {
|
|
9777
|
+
output.log(
|
|
9778
|
+
`
|
|
9779
|
+
Opening worktree '${result.value.worktree}' in tmux ${tmuxDirection === "new" ? "window" : "pane"}...`
|
|
9780
|
+
);
|
|
9781
|
+
const shell = process.env.SHELL || "/bin/sh";
|
|
9782
|
+
const tmuxResult = await executeTmuxCommand({
|
|
9783
|
+
direction: tmuxDirection,
|
|
9784
|
+
command: shell,
|
|
9785
|
+
cwd: result.value.path,
|
|
9786
|
+
env: getPhantomEnv(result.value.worktree, result.value.path),
|
|
9787
|
+
windowName: tmuxDirection === "new" ? result.value.worktree : void 0
|
|
9788
|
+
});
|
|
9789
|
+
if (isErr(tmuxResult)) {
|
|
9790
|
+
output.error(tmuxResult.error.message);
|
|
9791
|
+
const exitCode = "exitCode" in tmuxResult.error ? tmuxResult.error.exitCode ?? exitCodes.generalError : exitCodes.generalError;
|
|
9792
|
+
exitWithError("", exitCode);
|
|
9793
|
+
}
|
|
9794
|
+
}
|
|
9745
9795
|
}
|
|
9746
9796
|
|
|
9747
9797
|
// src/help.ts
|
|
@@ -13298,7 +13348,7 @@ var StdioServerTransport = class {
|
|
|
13298
13348
|
// ../mcp/package.json
|
|
13299
13349
|
var package_default = {
|
|
13300
13350
|
name: "@aku11i/phantom-mcp",
|
|
13301
|
-
version: "2.
|
|
13351
|
+
version: "2.2.0",
|
|
13302
13352
|
private: true,
|
|
13303
13353
|
type: "module",
|
|
13304
13354
|
main: "./src/index.ts",
|
|
@@ -13641,9 +13691,9 @@ async function reviewHandler(args2) {
|
|
|
13641
13691
|
const baseRef = base ?? `origin/${context.config?.defaultBranch ?? "main"}`;
|
|
13642
13692
|
output.log(`Opening review for worktree '${worktreeName}'...`);
|
|
13643
13693
|
output.log(
|
|
13644
|
-
"powered by yoshiko-pg/
|
|
13694
|
+
"powered by yoshiko-pg/difit (https://github.com/yoshiko-pg/difit)"
|
|
13645
13695
|
);
|
|
13646
|
-
const command2 = ["
|
|
13696
|
+
const command2 = ["difit", "HEAD", baseRef];
|
|
13647
13697
|
const result = await execInWorktree(
|
|
13648
13698
|
context.gitRoot,
|
|
13649
13699
|
context.worktreesDirectory,
|
|
@@ -13796,7 +13846,7 @@ import { parseArgs as parseArgs10 } from "node:util";
|
|
|
13796
13846
|
// package.json
|
|
13797
13847
|
var package_default2 = {
|
|
13798
13848
|
name: "@aku11i/phantom-cli",
|
|
13799
|
-
version: "2.
|
|
13849
|
+
version: "2.2.0",
|
|
13800
13850
|
private: true,
|
|
13801
13851
|
type: "module",
|
|
13802
13852
|
scripts: {
|
|
@@ -14248,11 +14298,11 @@ var reviewHelp = {
|
|
|
14248
14298
|
],
|
|
14249
14299
|
notes: [
|
|
14250
14300
|
"\u26A0\uFE0F This is an experimental feature and may change in future versions",
|
|
14251
|
-
"Uses
|
|
14301
|
+
"Uses difit to provide a GitHub-like PR review interface locally",
|
|
14252
14302
|
"Default base is origin/<defaultBranch> where defaultBranch is from config or 'main'",
|
|
14253
|
-
"The --base value is passed directly to
|
|
14254
|
-
"Requires
|
|
14255
|
-
"powered by yoshiko-pg/
|
|
14303
|
+
"The --base value is passed directly to difit as the comparison reference",
|
|
14304
|
+
"Requires difit to be installed separately (e.g., npm install -g difit)",
|
|
14305
|
+
"powered by yoshiko-pg/difit (https://github.com/yoshiko-pg/difit)"
|
|
14256
14306
|
]
|
|
14257
14307
|
};
|
|
14258
14308
|
|