@arvoretech/hub 0.17.1 → 0.17.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.
@@ -117,7 +117,7 @@ async function checkAndAutoRegenerate(hubDir) {
117
117
  return;
118
118
  }
119
119
  console.log(chalk.yellow("\n Detected outdated configs, auto-regenerating..."));
120
- const { generators: generators2 } = await import("./generate-6CIWB5FN.js");
120
+ const { generators: generators2 } = await import("./generate-MZP6TEFI.js");
121
121
  const generator = generators2[result.editor];
122
122
  if (!generator) {
123
123
  console.log(chalk.red(` Unknown editor '${result.editor}' in cache. Run 'hub generate' manually.`));
@@ -994,10 +994,6 @@ async function generateCursor(config, hubDir) {
994
994
  mcpConfig[mcp.name] = buildCursorMcpEntry(mcp);
995
995
  }
996
996
  }
997
- const sandbox = getSandboxService(config);
998
- if (sandbox && !mcpConfig["sandbox"]) {
999
- mcpConfig["sandbox"] = buildSandboxMcpEntry(sandbox.port);
1000
- }
1001
997
  await writeFile4(
1002
998
  join4(cursorDir, "mcp.json"),
1003
999
  JSON.stringify({ mcpServers: mcpConfig }, null, 2) + "\n",
@@ -1043,7 +1039,7 @@ ${content}`;
1043
1039
  try {
1044
1040
  const agentFiles = await readdir2(agentsDir);
1045
1041
  const mdFiles = agentFiles.filter((f) => f.endsWith(".md"));
1046
- const sandboxSvc = getSandboxService(config);
1042
+ const sandboxSvc = getSandboxMcp(config);
1047
1043
  for (const file of mdFiles) {
1048
1044
  if (sandboxSvc) {
1049
1045
  const agentName = file.replace(/\.md$/, "");
@@ -1100,13 +1096,11 @@ ${content}`;
1100
1096
  await generateEditorCommands(config, hubDir, cursorDir, ".cursor/commands/");
1101
1097
  await generateVSCodeSettings(config, hubDir);
1102
1098
  }
1103
- function buildSandboxMcpEntry(port) {
1104
- return { url: `http://localhost:${port}/mcp` };
1105
- }
1106
- function getSandboxService(config) {
1107
- const svc = config.services?.find((s) => s.type === "sandbox");
1108
- if (!svc) return null;
1109
- return { port: svc.port ?? 8080 };
1099
+ function getSandboxMcp(config) {
1100
+ const sandboxMcp = config.mcps?.find((m) => m.name === "sandbox" && m.url);
1101
+ if (!sandboxMcp?.url) return null;
1102
+ const match = sandboxMcp.url.match(/:(\d+)/);
1103
+ return match ? { port: parseInt(match[1], 10) } : { port: 8080 };
1110
1104
  }
1111
1105
  function buildProxyUpstreams(proxyMcp, allMcps) {
1112
1106
  const upstreamNames = new Set(proxyMcp.upstreams || []);
@@ -2713,7 +2707,7 @@ async function generateKiro(config, hubDir) {
2713
2707
  for (const file of mdFiles) {
2714
2708
  const agentContent = await readFile4(join4(agentsDir, file), "utf-8");
2715
2709
  const agentName = file.replace(/\.md$/, "");
2716
- const sandboxSvc = getSandboxService(config);
2710
+ const sandboxSvc = getSandboxMcp(config);
2717
2711
  const withSandbox = sandboxSvc ? injectSandboxContext(agentName, agentContent, sandboxSvc.port) : agentContent;
2718
2712
  const kiroAgent = buildKiroAgentContent(withSandbox);
2719
2713
  await writeFile4(join4(kiroAgentsDir, file), kiroAgent, "utf-8");
@@ -2762,10 +2756,6 @@ async function generateKiro(config, hubDir) {
2762
2756
  mcpConfig[mcp.name] = buildKiroMcpEntry(mcp, mode);
2763
2757
  }
2764
2758
  }
2765
- const sandbox = getSandboxService(config);
2766
- if (sandbox && !mcpConfig["sandbox"]) {
2767
- mcpConfig["sandbox"] = buildSandboxMcpEntry(sandbox.port);
2768
- }
2769
2759
  const mcpJsonPath = join4(settingsDir, "mcp.json");
2770
2760
  const disabledState = await readExistingMcpDisabledState(mcpJsonPath);
2771
2761
  applyDisabledState(mcpConfig, disabledState);
@@ -199,6 +199,7 @@ declare const mcp: {
199
199
  agentTeamsLead(overrides?: MCPOverrides): MCPConfig;
200
200
  agentTeamsChat(overrides?: MCPOverrides): MCPConfig;
201
201
  kanban(overrides?: MCPOverrides): MCPConfig;
202
+ sandbox(port?: number, overrides?: MCPOverrides): MCPConfig;
202
203
  proxy(name: string, overrides: MCPOverrides & {
203
204
  upstreams: string[];
204
205
  }): MCPConfig;
@@ -218,6 +218,13 @@ var mcp = {
218
218
  env: { ...overrides?.env }
219
219
  };
220
220
  },
221
+ sandbox(port = 8080, overrides) {
222
+ return {
223
+ name: "sandbox",
224
+ url: `http://localhost:${port}/mcp`,
225
+ ...overrides
226
+ };
227
+ },
221
228
  proxy(name, overrides) {
222
229
  return {
223
230
  name,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generateCommand,
3
3
  generators
4
- } from "./chunk-JYQ26DXR.js";
4
+ } from "./chunk-UAJWXUMU.js";
5
5
  import "./chunk-VMN4KGAK.js";
6
6
  export {
7
7
  generateCommand,
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  horizontalLine,
7
7
  personaCommand,
8
8
  symbols
9
- } from "./chunk-JYQ26DXR.js";
9
+ } from "./chunk-UAJWXUMU.js";
10
10
  import {
11
11
  loadHubConfig,
12
12
  resolveConfigPath
@@ -3889,16 +3889,36 @@ async function getLatestVersion() {
3889
3889
  return data.version;
3890
3890
  }
3891
3891
  function detectPackageManager() {
3892
+ const userAgent = process.env.npm_config_user_agent ?? "";
3893
+ if (userAgent.startsWith("pnpm")) return "pnpm";
3894
+ if (userAgent.startsWith("yarn")) return "yarn";
3895
+ if (userAgent.startsWith("npm")) return "npm";
3892
3896
  try {
3893
- execSync12("pnpm --version", { stdio: "pipe" });
3894
- return "pnpm";
3897
+ const binPath = execSync12("which hub", { stdio: "pipe", encoding: "utf-8" }).trim();
3898
+ if (binPath.includes("/pnpm/")) return "pnpm";
3899
+ if (binPath.includes("/yarn/")) return "yarn";
3895
3900
  } catch {
3896
- try {
3897
- execSync12("yarn --version", { stdio: "pipe" });
3898
- return "yarn";
3899
- } catch {
3900
- return "npm";
3901
- }
3901
+ }
3902
+ try {
3903
+ const out = execSync12(`pnpm list -g --depth=0 ${PACKAGE_NAME}`, { stdio: "pipe", encoding: "utf-8" });
3904
+ if (out.includes(PACKAGE_NAME)) return "pnpm";
3905
+ } catch {
3906
+ }
3907
+ try {
3908
+ const out = execSync12(`yarn global list --depth=0`, { stdio: "pipe", encoding: "utf-8" });
3909
+ if (out.includes(PACKAGE_NAME)) return "yarn";
3910
+ } catch {
3911
+ }
3912
+ return "npm";
3913
+ }
3914
+ function buildInstallCommand(pm) {
3915
+ switch (pm) {
3916
+ case "pnpm":
3917
+ return `pnpm add -g ${PACKAGE_NAME}@latest`;
3918
+ case "yarn":
3919
+ return `yarn global add ${PACKAGE_NAME}@latest`;
3920
+ case "npm":
3921
+ return `npm install -g ${PACKAGE_NAME}@latest`;
3902
3922
  }
3903
3923
  }
3904
3924
  var updateCommand = new Command16("update").description("Update hub CLI to the latest version").option("--check", "Only check for updates without installing").action(async (opts) => {
@@ -3920,15 +3940,14 @@ var updateCommand = new Command16("update").description("Update hub CLI to the l
3920
3940
  }
3921
3941
  console.log(chalk15.yellow(`
3922
3942
  Update available: ${currentVersion} \u2192 ${latestVersion}`));
3943
+ const pm = detectPackageManager();
3923
3944
  if (opts.check) {
3924
- const pm2 = detectPackageManager();
3925
3945
  console.log(chalk15.dim(`
3926
- Run 'hub update' or '${pm2} install -g ${PACKAGE_NAME}@latest' to update.
3946
+ Run 'hub update' or '${buildInstallCommand(pm)}' to update.
3927
3947
  `));
3928
3948
  return;
3929
3949
  }
3930
- const pm = detectPackageManager();
3931
- const installCmd = pm === "pnpm" ? `pnpm install -g ${PACKAGE_NAME}@latest` : pm === "yarn" ? `yarn global add ${PACKAGE_NAME}@latest` : `npm install -g ${PACKAGE_NAME}@latest`;
3950
+ const installCmd = buildInstallCommand(pm);
3932
3951
  console.log(chalk15.cyan(`
3933
3952
  Updating with ${pm}...
3934
3953
  `));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arvoretech/hub",
3
- "version": "0.17.1",
3
+ "version": "0.17.3",
4
4
  "description": "CLI for managing AI-aware multi-repository workspaces",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",