repowisestage 0.0.44 → 0.0.46
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/bin/repowise.js +49 -21
- package/package.json +1 -1
package/dist/bin/repowise.js
CHANGED
|
@@ -5641,6 +5641,7 @@ function defaultMcpHome() {
|
|
|
5641
5641
|
|
|
5642
5642
|
// ../listener/dist/mcp/auto-config/index.js
|
|
5643
5643
|
import { homedir as homedir4 } from "os";
|
|
5644
|
+
import { basename as basename2 } from "path";
|
|
5644
5645
|
|
|
5645
5646
|
// ../listener/dist/mcp/auto-config/writers/claude-code.js
|
|
5646
5647
|
import { promises as fs3 } from "fs";
|
|
@@ -5728,15 +5729,18 @@ var claudeCodeWriter = {
|
|
|
5728
5729
|
},
|
|
5729
5730
|
async write(ctx) {
|
|
5730
5731
|
const path = join19(ctx.repoRoot, ".mcp.json");
|
|
5732
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5731
5733
|
const status2 = await writeMergedConfig({
|
|
5732
5734
|
path,
|
|
5733
|
-
serverName: `
|
|
5735
|
+
serverName: `RepoWise MCP for ${ctx.repoName}`,
|
|
5734
5736
|
spec: { command: ctx.shimCmd, args: ["mcp-shim", "--repo-id", ctx.repoId] }
|
|
5735
5737
|
});
|
|
5736
5738
|
return { status: status2, path };
|
|
5737
5739
|
},
|
|
5738
5740
|
async remove(ctx) {
|
|
5739
|
-
|
|
5741
|
+
const path = join19(ctx.repoRoot, ".mcp.json");
|
|
5742
|
+
await removeFromConfig(path, `RepoWise MCP for ${ctx.repoName}`);
|
|
5743
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5740
5744
|
}
|
|
5741
5745
|
};
|
|
5742
5746
|
async function fileExists2(path) {
|
|
@@ -5761,15 +5765,18 @@ var clineWriter = {
|
|
|
5761
5765
|
},
|
|
5762
5766
|
async write(ctx) {
|
|
5763
5767
|
const path = join20(ctx.home, ".cline", "mcp.json");
|
|
5768
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5764
5769
|
const status2 = await writeMergedConfig({
|
|
5765
5770
|
path,
|
|
5766
|
-
serverName: `
|
|
5771
|
+
serverName: `RepoWise MCP for ${ctx.repoName}`,
|
|
5767
5772
|
spec: { command: ctx.shimCmd, args: ["mcp-shim", "--repo-id", ctx.repoId] }
|
|
5768
5773
|
});
|
|
5769
5774
|
return { status: status2, path };
|
|
5770
5775
|
},
|
|
5771
5776
|
async remove(ctx) {
|
|
5772
|
-
|
|
5777
|
+
const path = join20(ctx.home, ".cline", "mcp.json");
|
|
5778
|
+
await removeFromConfig(path, `RepoWise MCP for ${ctx.repoName}`);
|
|
5779
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5773
5780
|
}
|
|
5774
5781
|
};
|
|
5775
5782
|
async function fileExists3(path) {
|
|
@@ -5791,15 +5798,18 @@ var codexWriter = {
|
|
|
5791
5798
|
},
|
|
5792
5799
|
async write(ctx) {
|
|
5793
5800
|
const path = join21(ctx.home, ".codex", "mcp.json");
|
|
5801
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5794
5802
|
const status2 = await writeMergedConfig({
|
|
5795
5803
|
path,
|
|
5796
|
-
serverName: `
|
|
5804
|
+
serverName: `RepoWise MCP for ${ctx.repoName}`,
|
|
5797
5805
|
spec: { command: ctx.shimCmd, args: ["mcp-shim", "--repo-id", ctx.repoId] }
|
|
5798
5806
|
});
|
|
5799
5807
|
return { status: status2, path };
|
|
5800
5808
|
},
|
|
5801
5809
|
async remove(ctx) {
|
|
5802
|
-
|
|
5810
|
+
const path = join21(ctx.home, ".codex", "mcp.json");
|
|
5811
|
+
await removeFromConfig(path, `RepoWise MCP for ${ctx.repoName}`);
|
|
5812
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5803
5813
|
}
|
|
5804
5814
|
};
|
|
5805
5815
|
async function fileExists4(path) {
|
|
@@ -5821,15 +5831,18 @@ var copilotWriter = {
|
|
|
5821
5831
|
},
|
|
5822
5832
|
async write(ctx) {
|
|
5823
5833
|
const path = join22(ctx.repoRoot, ".vscode", "mcp.json");
|
|
5834
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5824
5835
|
const status2 = await writeMergedConfig({
|
|
5825
5836
|
path,
|
|
5826
|
-
serverName: `
|
|
5837
|
+
serverName: `RepoWise MCP for ${ctx.repoName}`,
|
|
5827
5838
|
spec: { command: ctx.shimCmd, args: ["mcp-shim", "--repo-id", ctx.repoId] }
|
|
5828
5839
|
});
|
|
5829
5840
|
return { status: status2, path };
|
|
5830
5841
|
},
|
|
5831
5842
|
async remove(ctx) {
|
|
5832
|
-
|
|
5843
|
+
const path = join22(ctx.repoRoot, ".vscode", "mcp.json");
|
|
5844
|
+
await removeFromConfig(path, `RepoWise MCP for ${ctx.repoName}`);
|
|
5845
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5833
5846
|
}
|
|
5834
5847
|
};
|
|
5835
5848
|
async function fileExists5(path) {
|
|
@@ -5851,15 +5864,18 @@ var cursorWriter = {
|
|
|
5851
5864
|
},
|
|
5852
5865
|
async write(ctx) {
|
|
5853
5866
|
const path = join23(ctx.repoRoot, ".cursor", "mcp.json");
|
|
5867
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5854
5868
|
const status2 = await writeMergedConfig({
|
|
5855
5869
|
path,
|
|
5856
|
-
serverName: `
|
|
5870
|
+
serverName: `RepoWise MCP for ${ctx.repoName}`,
|
|
5857
5871
|
spec: { command: ctx.shimCmd, args: ["mcp-shim", "--repo-id", ctx.repoId] }
|
|
5858
5872
|
});
|
|
5859
5873
|
return { status: status2, path };
|
|
5860
5874
|
},
|
|
5861
5875
|
async remove(ctx) {
|
|
5862
|
-
|
|
5876
|
+
const path = join23(ctx.repoRoot, ".cursor", "mcp.json");
|
|
5877
|
+
await removeFromConfig(path, `RepoWise MCP for ${ctx.repoName}`);
|
|
5878
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5863
5879
|
}
|
|
5864
5880
|
};
|
|
5865
5881
|
async function fileExists6(path) {
|
|
@@ -5881,15 +5897,18 @@ var geminiCliWriter = {
|
|
|
5881
5897
|
},
|
|
5882
5898
|
async write(ctx) {
|
|
5883
5899
|
const path = join24(ctx.home, ".gemini", "settings.json");
|
|
5900
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5884
5901
|
const status2 = await writeMergedConfig({
|
|
5885
5902
|
path,
|
|
5886
|
-
serverName: `
|
|
5903
|
+
serverName: `RepoWise MCP for ${ctx.repoName}`,
|
|
5887
5904
|
spec: { command: ctx.shimCmd, args: ["mcp-shim", "--repo-id", ctx.repoId] }
|
|
5888
5905
|
});
|
|
5889
5906
|
return { status: status2, path };
|
|
5890
5907
|
},
|
|
5891
5908
|
async remove(ctx) {
|
|
5892
|
-
|
|
5909
|
+
const path = join24(ctx.home, ".gemini", "settings.json");
|
|
5910
|
+
await removeFromConfig(path, `RepoWise MCP for ${ctx.repoName}`);
|
|
5911
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5893
5912
|
}
|
|
5894
5913
|
};
|
|
5895
5914
|
async function fileExists7(path) {
|
|
@@ -5913,16 +5932,21 @@ var rooWriter = {
|
|
|
5913
5932
|
const repoConfig = join25(ctx.repoRoot, ".roo", "mcp.json");
|
|
5914
5933
|
const useRepoScope = await fileExists8(join25(ctx.repoRoot, ".roo"));
|
|
5915
5934
|
const path = useRepoScope ? repoConfig : join25(ctx.home, ".roo", "mcp.json");
|
|
5935
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5916
5936
|
const status2 = await writeMergedConfig({
|
|
5917
5937
|
path,
|
|
5918
|
-
serverName: `
|
|
5938
|
+
serverName: `RepoWise MCP for ${ctx.repoName}`,
|
|
5919
5939
|
spec: { command: ctx.shimCmd, args: ["mcp-shim", "--repo-id", ctx.repoId] }
|
|
5920
5940
|
});
|
|
5921
5941
|
return { status: status2, path };
|
|
5922
5942
|
},
|
|
5923
5943
|
async remove(ctx) {
|
|
5924
|
-
|
|
5925
|
-
|
|
5944
|
+
const repoConfig = join25(ctx.repoRoot, ".roo", "mcp.json");
|
|
5945
|
+
const homeConfig = join25(ctx.home, ".roo", "mcp.json");
|
|
5946
|
+
await removeFromConfig(repoConfig, `RepoWise MCP for ${ctx.repoName}`);
|
|
5947
|
+
await removeFromConfig(repoConfig, `repowise-${ctx.repoId}`);
|
|
5948
|
+
await removeFromConfig(homeConfig, `RepoWise MCP for ${ctx.repoName}`);
|
|
5949
|
+
await removeFromConfig(homeConfig, `repowise-${ctx.repoId}`);
|
|
5926
5950
|
}
|
|
5927
5951
|
};
|
|
5928
5952
|
async function fileExists8(path) {
|
|
@@ -5944,15 +5968,18 @@ var windsurfWriter = {
|
|
|
5944
5968
|
},
|
|
5945
5969
|
async write(ctx) {
|
|
5946
5970
|
const path = join26(ctx.home, ".codeium", "windsurf", "mcp_config.json");
|
|
5971
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5947
5972
|
const status2 = await writeMergedConfig({
|
|
5948
5973
|
path,
|
|
5949
|
-
serverName: `
|
|
5974
|
+
serverName: `RepoWise MCP for ${ctx.repoName}`,
|
|
5950
5975
|
spec: { command: ctx.shimCmd, args: ["mcp-shim", "--repo-id", ctx.repoId] }
|
|
5951
5976
|
});
|
|
5952
5977
|
return { status: status2, path };
|
|
5953
5978
|
},
|
|
5954
5979
|
async remove(ctx) {
|
|
5955
|
-
|
|
5980
|
+
const path = join26(ctx.home, ".codeium", "windsurf", "mcp_config.json");
|
|
5981
|
+
await removeFromConfig(path, `RepoWise MCP for ${ctx.repoName}`);
|
|
5982
|
+
await removeFromConfig(path, `repowise-${ctx.repoId}`);
|
|
5956
5983
|
}
|
|
5957
5984
|
};
|
|
5958
5985
|
async function fileExists9(path) {
|
|
@@ -6000,6 +6027,7 @@ async function runAutoConfig(opts) {
|
|
|
6000
6027
|
try {
|
|
6001
6028
|
const outcome = await writer.write({
|
|
6002
6029
|
repoRoot: opts.repoRoot,
|
|
6030
|
+
repoName: basename2(opts.repoRoot),
|
|
6003
6031
|
repoId: opts.repoId,
|
|
6004
6032
|
shimCmd: opts.shimCmd,
|
|
6005
6033
|
home
|
|
@@ -9032,7 +9060,7 @@ async function logout() {
|
|
|
9032
9060
|
|
|
9033
9061
|
// src/commands/status.ts
|
|
9034
9062
|
import { readFile as readFile16 } from "fs/promises";
|
|
9035
|
-
import { basename as
|
|
9063
|
+
import { basename as basename3, join as join36 } from "path";
|
|
9036
9064
|
async function status() {
|
|
9037
9065
|
const configDir = getConfigDir2();
|
|
9038
9066
|
const STATE_PATH = join36(configDir, "listener-state.json");
|
|
@@ -9068,7 +9096,7 @@ async function status() {
|
|
|
9068
9096
|
const configData = await readFile16(CONFIG_PATH, "utf-8");
|
|
9069
9097
|
const config2 = JSON.parse(configData);
|
|
9070
9098
|
for (const repo of config2.repos ?? []) {
|
|
9071
|
-
repoNames.set(repo.repoId,
|
|
9099
|
+
repoNames.set(repo.repoId, basename3(repo.localPath));
|
|
9072
9100
|
}
|
|
9073
9101
|
} catch {
|
|
9074
9102
|
}
|
|
@@ -10481,13 +10509,13 @@ Done \u2014 ${report.removed.length} removed, ${report.skipped.length} skipped.
|
|
|
10481
10509
|
}
|
|
10482
10510
|
|
|
10483
10511
|
// src/commands/mcp-shim.ts
|
|
10512
|
+
init_config_dir();
|
|
10484
10513
|
import { promises as fs17 } from "fs";
|
|
10485
10514
|
import { createInterface as createInterface2 } from "readline";
|
|
10486
|
-
import { homedir as homedir9 } from "os";
|
|
10487
10515
|
import { join as join44 } from "path";
|
|
10488
10516
|
var DEFAULT_MAX = 200 * 1024;
|
|
10489
10517
|
async function mcpShim(opts) {
|
|
10490
|
-
const endpointPath = opts.endpointFile ?? join44(
|
|
10518
|
+
const endpointPath = opts.endpointFile ?? join44(getConfigDir(), "listener.endpoint");
|
|
10491
10519
|
const stdin = opts.stdin ?? process.stdin;
|
|
10492
10520
|
const stdout = opts.stdout ?? process.stdout;
|
|
10493
10521
|
const stderr = opts.stderr ?? process.stderr;
|