@aku11i/phantom 2.1.1 → 2.2.3-rc.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 +63 -9
package/package.json
CHANGED
package/phantom.js
CHANGED
|
@@ -9521,7 +9521,11 @@ async function getGitHubToken() {
|
|
|
9521
9521
|
}
|
|
9522
9522
|
async function createGitHubClient() {
|
|
9523
9523
|
const token = await getGitHubToken();
|
|
9524
|
-
|
|
9524
|
+
const options = { auth: token };
|
|
9525
|
+
if (process.env.GH_HOST) {
|
|
9526
|
+
options.baseUrl = `https://${process.env.GH_HOST}/api/v3`;
|
|
9527
|
+
}
|
|
9528
|
+
return new Octokit2(options);
|
|
9525
9529
|
}
|
|
9526
9530
|
|
|
9527
9531
|
// ../github/src/api/pull-request.ts
|
|
@@ -9726,6 +9730,22 @@ async function githubCheckoutHandler(args2) {
|
|
|
9726
9730
|
options: {
|
|
9727
9731
|
base: {
|
|
9728
9732
|
type: "string"
|
|
9733
|
+
},
|
|
9734
|
+
tmux: {
|
|
9735
|
+
type: "boolean",
|
|
9736
|
+
short: "t"
|
|
9737
|
+
},
|
|
9738
|
+
"tmux-vertical": {
|
|
9739
|
+
type: "boolean"
|
|
9740
|
+
},
|
|
9741
|
+
"tmux-v": {
|
|
9742
|
+
type: "boolean"
|
|
9743
|
+
},
|
|
9744
|
+
"tmux-horizontal": {
|
|
9745
|
+
type: "boolean"
|
|
9746
|
+
},
|
|
9747
|
+
"tmux-h": {
|
|
9748
|
+
type: "boolean"
|
|
9729
9749
|
}
|
|
9730
9750
|
},
|
|
9731
9751
|
allowPositionals: true
|
|
@@ -9737,11 +9757,45 @@ async function githubCheckoutHandler(args2) {
|
|
|
9737
9757
|
exitCodes.validationError
|
|
9738
9758
|
);
|
|
9739
9759
|
}
|
|
9760
|
+
const tmuxOption = values.tmux || values["tmux-vertical"] || values["tmux-v"] || values["tmux-horizontal"] || values["tmux-h"];
|
|
9761
|
+
let tmuxDirection;
|
|
9762
|
+
if (values.tmux) {
|
|
9763
|
+
tmuxDirection = "new";
|
|
9764
|
+
} else if (values["tmux-vertical"] || values["tmux-v"]) {
|
|
9765
|
+
tmuxDirection = "vertical";
|
|
9766
|
+
} else if (values["tmux-horizontal"] || values["tmux-h"]) {
|
|
9767
|
+
tmuxDirection = "horizontal";
|
|
9768
|
+
}
|
|
9769
|
+
if (tmuxOption && !await isInsideTmux()) {
|
|
9770
|
+
exitWithError(
|
|
9771
|
+
"The --tmux option can only be used inside a tmux session",
|
|
9772
|
+
exitCodes.validationError
|
|
9773
|
+
);
|
|
9774
|
+
}
|
|
9740
9775
|
const result = await githubCheckout({ number, base: values.base });
|
|
9741
9776
|
if (isErr(result)) {
|
|
9742
9777
|
exitWithError(result.error.message, exitCodes.generalError);
|
|
9743
9778
|
}
|
|
9744
9779
|
output.log(result.value.message);
|
|
9780
|
+
if (tmuxDirection) {
|
|
9781
|
+
output.log(
|
|
9782
|
+
`
|
|
9783
|
+
Opening worktree '${result.value.worktree}' in tmux ${tmuxDirection === "new" ? "window" : "pane"}...`
|
|
9784
|
+
);
|
|
9785
|
+
const shell = process.env.SHELL || "/bin/sh";
|
|
9786
|
+
const tmuxResult = await executeTmuxCommand({
|
|
9787
|
+
direction: tmuxDirection,
|
|
9788
|
+
command: shell,
|
|
9789
|
+
cwd: result.value.path,
|
|
9790
|
+
env: getPhantomEnv(result.value.worktree, result.value.path),
|
|
9791
|
+
windowName: tmuxDirection === "new" ? result.value.worktree : void 0
|
|
9792
|
+
});
|
|
9793
|
+
if (isErr(tmuxResult)) {
|
|
9794
|
+
output.error(tmuxResult.error.message);
|
|
9795
|
+
const exitCode = "exitCode" in tmuxResult.error ? tmuxResult.error.exitCode ?? exitCodes.generalError : exitCodes.generalError;
|
|
9796
|
+
exitWithError("", exitCode);
|
|
9797
|
+
}
|
|
9798
|
+
}
|
|
9745
9799
|
}
|
|
9746
9800
|
|
|
9747
9801
|
// src/help.ts
|
|
@@ -13298,7 +13352,7 @@ var StdioServerTransport = class {
|
|
|
13298
13352
|
// ../mcp/package.json
|
|
13299
13353
|
var package_default = {
|
|
13300
13354
|
name: "@aku11i/phantom-mcp",
|
|
13301
|
-
version: "2.
|
|
13355
|
+
version: "2.2.3-rc.0",
|
|
13302
13356
|
private: true,
|
|
13303
13357
|
type: "module",
|
|
13304
13358
|
main: "./src/index.ts",
|
|
@@ -13641,9 +13695,9 @@ async function reviewHandler(args2) {
|
|
|
13641
13695
|
const baseRef = base ?? `origin/${context.config?.defaultBranch ?? "main"}`;
|
|
13642
13696
|
output.log(`Opening review for worktree '${worktreeName}'...`);
|
|
13643
13697
|
output.log(
|
|
13644
|
-
"powered by yoshiko-pg/
|
|
13698
|
+
"powered by yoshiko-pg/difit (https://github.com/yoshiko-pg/difit)"
|
|
13645
13699
|
);
|
|
13646
|
-
const command2 = ["
|
|
13700
|
+
const command2 = ["difit", "HEAD", baseRef];
|
|
13647
13701
|
const result = await execInWorktree(
|
|
13648
13702
|
context.gitRoot,
|
|
13649
13703
|
context.worktreesDirectory,
|
|
@@ -13796,7 +13850,7 @@ import { parseArgs as parseArgs10 } from "node:util";
|
|
|
13796
13850
|
// package.json
|
|
13797
13851
|
var package_default2 = {
|
|
13798
13852
|
name: "@aku11i/phantom-cli",
|
|
13799
|
-
version: "2.
|
|
13853
|
+
version: "2.2.3-rc.0",
|
|
13800
13854
|
private: true,
|
|
13801
13855
|
type: "module",
|
|
13802
13856
|
scripts: {
|
|
@@ -14248,11 +14302,11 @@ var reviewHelp = {
|
|
|
14248
14302
|
],
|
|
14249
14303
|
notes: [
|
|
14250
14304
|
"\u26A0\uFE0F This is an experimental feature and may change in future versions",
|
|
14251
|
-
"Uses
|
|
14305
|
+
"Uses difit to provide a GitHub-like PR review interface locally",
|
|
14252
14306
|
"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/
|
|
14307
|
+
"The --base value is passed directly to difit as the comparison reference",
|
|
14308
|
+
"Requires difit to be installed separately (e.g., npm install -g difit)",
|
|
14309
|
+
"powered by yoshiko-pg/difit (https://github.com/yoshiko-pg/difit)"
|
|
14256
14310
|
]
|
|
14257
14311
|
};
|
|
14258
14312
|
|