@polterware/polter 0.1.1 → 0.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/dist/api.js +1 -1
- package/dist/{chunk-TWWRDI3Q.js → chunk-2OZZNSKW.js} +48 -68
- package/dist/index.js +500 -194
- package/dist/mcp.js +129 -6
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -377,6 +377,18 @@ var ghCommands = [
|
|
|
377
377
|
label: "pr checkout",
|
|
378
378
|
hint: "Check out a pull request"
|
|
379
379
|
},
|
|
380
|
+
{
|
|
381
|
+
id: "gh:pr:review",
|
|
382
|
+
tool: "gh",
|
|
383
|
+
base: ["pr", "review"],
|
|
384
|
+
label: "pr review",
|
|
385
|
+
hint: "Review a pull request",
|
|
386
|
+
suggestedArgs: [
|
|
387
|
+
{ value: "approve", label: "Approve", hint: "Approve the PR", args: ["--approve"] },
|
|
388
|
+
{ value: "comment", label: "Comment", hint: "Leave a comment", args: ["--comment"] },
|
|
389
|
+
{ value: "request-changes", label: "Request Changes", hint: "Request changes", args: ["--request-changes"] }
|
|
390
|
+
]
|
|
391
|
+
},
|
|
380
392
|
// Issues
|
|
381
393
|
{
|
|
382
394
|
id: "gh:issue:create",
|
|
@@ -638,33 +650,19 @@ var vercelCommands = [
|
|
|
638
650
|
}
|
|
639
651
|
];
|
|
640
652
|
|
|
641
|
-
// src/data/commands/
|
|
642
|
-
var
|
|
643
|
-
|
|
644
|
-
{ id: "
|
|
645
|
-
{ id: "
|
|
646
|
-
{ id: "
|
|
647
|
-
{ id: "
|
|
648
|
-
{ id: "
|
|
649
|
-
|
|
650
|
-
{ id: "
|
|
651
|
-
{ id: "
|
|
652
|
-
{ id: "
|
|
653
|
-
{ id: "
|
|
654
|
-
// Config
|
|
655
|
-
{ id: "pulumi:config:set", tool: "pulumi", base: ["config", "set"], label: "config set", hint: "Set a config value" },
|
|
656
|
-
{ id: "pulumi:config:get", tool: "pulumi", base: ["config", "get"], label: "config get", hint: "Get a config value" },
|
|
657
|
-
{ id: "pulumi:config:ls", tool: "pulumi", base: ["config"], label: "config", hint: "List config key-value pairs" },
|
|
658
|
-
// Import & State
|
|
659
|
-
{ id: "pulumi:import", tool: "pulumi", base: ["import"], label: "import", hint: "Import existing resources" },
|
|
660
|
-
{ id: "pulumi:state:delete", tool: "pulumi", base: ["state", "delete"], label: "state delete", hint: "Remove resource from state" },
|
|
661
|
-
// Auth & Setup
|
|
662
|
-
{ id: "pulumi:login", tool: "pulumi", base: ["login"], label: "login", hint: "Log in to Pulumi Cloud" },
|
|
663
|
-
{ id: "pulumi:whoami", tool: "pulumi", base: ["whoami"], label: "whoami", hint: "Show current user" },
|
|
664
|
-
{ id: "pulumi:new", tool: "pulumi", base: ["new"], label: "new", hint: "Create a new project from template" },
|
|
665
|
-
// Editor-backed commands
|
|
666
|
-
{ id: "pulumi:edit:config", tool: "pulumi", base: ["__editor__"], label: "edit config", hint: "Open Pulumi.yaml in editor", editorTarget: "config" },
|
|
667
|
-
{ id: "pulumi:edit:code", tool: "pulumi", base: ["__editor__"], label: "edit code", hint: "Open IaC source file in editor", editorTarget: "code" }
|
|
653
|
+
// src/data/commands/git.ts
|
|
654
|
+
var gitCommands = [
|
|
655
|
+
{ id: "git:status", tool: "git", base: ["status"], label: "status", hint: "Show working tree status" },
|
|
656
|
+
{ id: "git:add", tool: "git", base: ["add"], label: "add", hint: "Stage changes" },
|
|
657
|
+
{ id: "git:commit", tool: "git", base: ["commit"], label: "commit", hint: "Create a commit" },
|
|
658
|
+
{ id: "git:push", tool: "git", base: ["push"], label: "push", hint: "Push to remote" },
|
|
659
|
+
{ id: "git:pull", tool: "git", base: ["pull"], label: "pull", hint: "Pull from remote" },
|
|
660
|
+
{ id: "git:checkout", tool: "git", base: ["checkout"], label: "checkout", hint: "Switch branches" },
|
|
661
|
+
{ id: "git:branch", tool: "git", base: ["branch"], label: "branch", hint: "List or create branches" },
|
|
662
|
+
{ id: "git:stash", tool: "git", base: ["stash"], label: "stash", hint: "Stash changes" },
|
|
663
|
+
{ id: "git:diff", tool: "git", base: ["diff"], label: "diff", hint: "Show changes" },
|
|
664
|
+
{ id: "git:log", tool: "git", base: ["log"], label: "log", hint: "View commit history" },
|
|
665
|
+
{ id: "git:merge", tool: "git", base: ["merge"], label: "merge", hint: "Merge branches" }
|
|
668
666
|
];
|
|
669
667
|
|
|
670
668
|
// src/data/commands/index.ts
|
|
@@ -672,7 +670,7 @@ var allCommands = [
|
|
|
672
670
|
...supabaseCommands,
|
|
673
671
|
...ghCommands,
|
|
674
672
|
...vercelCommands,
|
|
675
|
-
...
|
|
673
|
+
...gitCommands
|
|
676
674
|
];
|
|
677
675
|
var commandById = new Map(allCommands.map((cmd) => [cmd.id, cmd]));
|
|
678
676
|
var commandByValue = new Map(
|
|
@@ -699,14 +697,14 @@ function findCommandByValue(value) {
|
|
|
699
697
|
// src/data/features.ts
|
|
700
698
|
function pick(ids) {
|
|
701
699
|
const idSet = new Set(ids);
|
|
702
|
-
return [...supabaseCommands, ...ghCommands, ...vercelCommands, ...
|
|
700
|
+
return [...supabaseCommands, ...ghCommands, ...vercelCommands, ...gitCommands].filter(
|
|
703
701
|
(cmd) => idSet.has(cmd.id)
|
|
704
702
|
);
|
|
705
703
|
}
|
|
706
704
|
var features = [
|
|
707
705
|
{
|
|
708
706
|
id: "database",
|
|
709
|
-
icon: "\u{1F5C4}",
|
|
707
|
+
icon: "\u{1F5C4}\uFE0F",
|
|
710
708
|
label: "Database",
|
|
711
709
|
commands: pick([
|
|
712
710
|
"supabase:db",
|
|
@@ -734,8 +732,8 @@ var features = [
|
|
|
734
732
|
"vercel:deploy:prod",
|
|
735
733
|
"vercel:promote",
|
|
736
734
|
"vercel:rollback",
|
|
737
|
-
"
|
|
738
|
-
"
|
|
735
|
+
"git:commit",
|
|
736
|
+
"git:push"
|
|
739
737
|
])
|
|
740
738
|
},
|
|
741
739
|
{
|
|
@@ -743,6 +741,17 @@ var features = [
|
|
|
743
741
|
icon: "\u{1F4E6}",
|
|
744
742
|
label: "Repo",
|
|
745
743
|
commands: pick([
|
|
744
|
+
"git:status",
|
|
745
|
+
"git:add",
|
|
746
|
+
"git:commit",
|
|
747
|
+
"git:push",
|
|
748
|
+
"git:pull",
|
|
749
|
+
"git:branch",
|
|
750
|
+
"git:checkout",
|
|
751
|
+
"git:log",
|
|
752
|
+
"git:diff",
|
|
753
|
+
"git:merge",
|
|
754
|
+
"git:stash",
|
|
746
755
|
"gh:repo:clone",
|
|
747
756
|
"gh:repo:create",
|
|
748
757
|
"gh:repo:view",
|
|
@@ -752,6 +761,7 @@ var features = [
|
|
|
752
761
|
"gh:pr:view",
|
|
753
762
|
"gh:pr:merge",
|
|
754
763
|
"gh:pr:checkout",
|
|
764
|
+
"gh:pr:review",
|
|
755
765
|
"gh:issue:create",
|
|
756
766
|
"gh:issue:list",
|
|
757
767
|
"gh:issue:view",
|
|
@@ -775,9 +785,7 @@ var features = [
|
|
|
775
785
|
"gh:workflow:view",
|
|
776
786
|
"gh:run:list",
|
|
777
787
|
"gh:run:view",
|
|
778
|
-
"gh:run:watch"
|
|
779
|
-
"pulumi:preview",
|
|
780
|
-
"pulumi:up"
|
|
788
|
+
"gh:run:watch"
|
|
781
789
|
])
|
|
782
790
|
},
|
|
783
791
|
{
|
|
@@ -806,27 +814,6 @@ var features = [
|
|
|
806
814
|
"vercel:domains:rm"
|
|
807
815
|
])
|
|
808
816
|
},
|
|
809
|
-
{
|
|
810
|
-
id: "infrastructure",
|
|
811
|
-
icon: "\u{1F3D7}",
|
|
812
|
-
label: "Infrastructure",
|
|
813
|
-
commands: pick([
|
|
814
|
-
"pulumi:up",
|
|
815
|
-
"pulumi:preview",
|
|
816
|
-
"pulumi:destroy",
|
|
817
|
-
"pulumi:refresh",
|
|
818
|
-
"pulumi:stack:ls",
|
|
819
|
-
"pulumi:stack:select",
|
|
820
|
-
"pulumi:stack:init",
|
|
821
|
-
"pulumi:config:set",
|
|
822
|
-
"pulumi:config:get",
|
|
823
|
-
"pulumi:config:ls",
|
|
824
|
-
"pulumi:import",
|
|
825
|
-
"pulumi:state:delete",
|
|
826
|
-
"pulumi:edit:config",
|
|
827
|
-
"pulumi:edit:code"
|
|
828
|
-
])
|
|
829
|
-
},
|
|
830
817
|
{
|
|
831
818
|
id: "setup",
|
|
832
819
|
icon: "\u2699\uFE0F",
|
|
@@ -838,10 +825,7 @@ var features = [
|
|
|
838
825
|
"vercel:link",
|
|
839
826
|
"vercel:login",
|
|
840
827
|
"gh:auth:login",
|
|
841
|
-
"gh:auth:status"
|
|
842
|
-
"pulumi:login",
|
|
843
|
-
"pulumi:whoami",
|
|
844
|
-
"pulumi:new"
|
|
828
|
+
"gh:auth:status"
|
|
845
829
|
])
|
|
846
830
|
}
|
|
847
831
|
];
|
|
@@ -872,11 +856,7 @@ var toolFlags = {
|
|
|
872
856
|
{ value: "--yes", label: "--yes", hint: "Skip confirmation prompts" },
|
|
873
857
|
{ value: "--debug", label: "--debug", hint: "Debug mode" }
|
|
874
858
|
],
|
|
875
|
-
|
|
876
|
-
{ value: "--yes", label: "--yes", hint: "Skip confirmation prompts" },
|
|
877
|
-
{ value: "--debug", label: "--debug", hint: "Debug mode" },
|
|
878
|
-
{ value: "--stack", label: "--stack", hint: "Target a specific stack" }
|
|
879
|
-
]
|
|
859
|
+
git: []
|
|
880
860
|
};
|
|
881
861
|
function getFlagsForTool(toolId) {
|
|
882
862
|
return toolFlags[toolId] ?? globalFlags;
|
|
@@ -1016,8 +996,8 @@ function getToolVersion(toolId) {
|
|
|
1016
996
|
return execCapture("gh --version").split("\n")[0]?.replace(/^gh\s+version\s+/i, "").split(" ")[0];
|
|
1017
997
|
case "vercel":
|
|
1018
998
|
return execCapture("vercel --version").split("\n")[0]?.trim();
|
|
1019
|
-
case "
|
|
1020
|
-
return execCapture("
|
|
999
|
+
case "git":
|
|
1000
|
+
return execCapture("git --version").replace(/^git version\s+/i, "").trim();
|
|
1021
1001
|
default:
|
|
1022
1002
|
return void 0;
|
|
1023
1003
|
}
|
|
@@ -1033,7 +1013,7 @@ function getToolInfo(toolId) {
|
|
|
1033
1013
|
supabase: "Supabase CLI",
|
|
1034
1014
|
gh: "GitHub CLI",
|
|
1035
1015
|
vercel: "Vercel CLI",
|
|
1036
|
-
|
|
1016
|
+
git: "Git"
|
|
1037
1017
|
};
|
|
1038
1018
|
const installed = commandExists(toolId === "supabase" ? "supabase" : toolId);
|
|
1039
1019
|
const version = installed ? getToolVersion(toolId) : void 0;
|