@http-forge/cli 0.2.39 → 0.2.41

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/README.md CHANGED
@@ -174,9 +174,22 @@ http-forge launch --dev /path/to/workspace
174
174
 
175
175
  Use `http-forge launch` when you want the standalone HTTP Forge UI from terminal.
176
176
 
177
- The launcher auto-detects OS/shell and uses the matching script:
178
- - Linux/macOS: `scripts/http-forge.sh`
179
- - Windows: `scripts/http-forge.bat`
177
+ The launcher auto-detects OS/shell and picks the matching script:
178
+ - Linux/macOS: `scripts/http-forge.sh` via `/bin/bash`
179
+ - Windows Git Bash (MSYS/MinGW, `MSYSTEM`/`SHELL`/`BASH_VERSION`): `scripts/http-forge.sh` via `bash` (Windows path converted to `/c/...` for MSYS)
180
+ - Windows cmd / PowerShell: `scripts/http-forge.bat` via `cmd.exe /d /s /c call`
181
+
182
+ ## Workspace Modes & Config
183
+
184
+ HTTP Forge CLI uses the same workspace discovery as `@http-forge/core`. Two Git layouts are supported with **any folder name** for standalone:
185
+
186
+ **Integrated** — `workspace/.http-forge/assets/{collections,environments,suites}` (default). Config priority: `workspace/http-forge.config.json` **before** `workspace/.http-forge/http-forge.config.json`. All `storage.*` / `history` / `results` / `scripts.modulePaths` / cert paths are resolved relative to the config file that defines them (old ` "./.http-forge/assets"` inside `.http-forge` is auto-stripped).
187
+
188
+ **Standalone (any name)** — clone the forge repo as `my-standalone`, `http-forge-assets`, `acme-tests` and open that folder. `assets/` at root or bare `collections/` at root are both recognized (structural check, not name). `my-standalone/assets` opened directly as workspace → normalized to `my-standalone`; `my-project/.http-forge/assets` → normalized to `my-project`.
189
+
190
+ **Lazy creation:** opening an empty folder does **not** create `.http-forge` on CLI startup. First `import`, `create`, or `run` that needs persistence creates `assets/collections` and `AGENTS.md` once.
191
+
192
+ **All commands accept `--workspace <path>`** (default `cwd` or `$HTTP_FORGE_WORKSPACE`). The same priority/relative rules apply regardless of which command you run.
180
193
 
181
194
  ## Common Run Patterns
182
195
 
@@ -1,2 +1,12 @@
1
+ declare function isGitBashOnWindows(): boolean;
2
+ declare function isPowerShellOnWindows(): boolean;
3
+ declare function detectWindowsShell(): 'git-bash' | 'powershell' | 'cmd';
4
+ declare function toPosixForGitBash(winPath: string): string;
5
+ declare function resolveLauncherScript(): {
6
+ scriptPath: string;
7
+ platform: 'win32' | 'unix';
8
+ shell?: string;
9
+ };
10
+ export { isGitBashOnWindows, isPowerShellOnWindows, detectWindowsShell, resolveLauncherScript, toPosixForGitBash };
1
11
  export declare function handleLaunch(args: string[]): Promise<void>;
2
12
  //# sourceMappingURL=launch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../src/commands/launch.ts"],"names":[],"mappings":"AA2BA,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2DhE"}
1
+ {"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../../src/commands/launch.ts"],"names":[],"mappings":"AAIA,iBAAS,kBAAkB,IAAI,OAAO,CAYrC;AAED,iBAAS,qBAAqB,IAAI,OAAO,CAUxC;AAED,iBAAS,kBAAkB,IAAI,UAAU,GAAG,YAAY,GAAG,KAAK,CAI/D;AAID,iBAAS,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQlD;AAED,iBAAS,qBAAqB,IAAI;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAoBnG;AASD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,CAAC;AAEnH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA6DhE"}
@@ -3,20 +3,86 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isGitBashOnWindows = isGitBashOnWindows;
7
+ exports.isPowerShellOnWindows = isPowerShellOnWindows;
8
+ exports.detectWindowsShell = detectWindowsShell;
9
+ exports.resolveLauncherScript = resolveLauncherScript;
10
+ exports.toPosixForGitBash = toPosixForGitBash;
6
11
  exports.handleLaunch = handleLaunch;
7
12
  const node_child_process_1 = require("node:child_process");
8
13
  const node_fs_1 = require("node:fs");
9
14
  const node_path_1 = __importDefault(require("node:path"));
15
+ function isGitBashOnWindows() {
16
+ if (process.platform !== 'win32')
17
+ return false;
18
+ // Git Bash (MSYS2/MinGW) sets MSYSTEM=MINGW64|MINGW32|MSYS and SHELL=/usr/bin/bash.
19
+ // Also check BASH_VERSION, OSTYPE=msys, TERM_PROGRAM=mintty (MinTTY).
20
+ if (process.env.MSYSTEM)
21
+ return true;
22
+ if (process.env.MSYS)
23
+ return true;
24
+ if (process.env.SHELL && process.env.SHELL.includes('bash'))
25
+ return true;
26
+ if (process.env.BASH && process.env.BASH.includes('bash'))
27
+ return true;
28
+ if (process.env.BASH_VERSION)
29
+ return true;
30
+ if (process.env.OSTYPE && process.env.OSTYPE.includes('msys'))
31
+ return true;
32
+ if (process.env.TERM_PROGRAM === 'mintty')
33
+ return true;
34
+ return false;
35
+ }
36
+ function isPowerShellOnWindows() {
37
+ if (process.platform !== 'win32')
38
+ return false;
39
+ if (isGitBashOnWindows())
40
+ return false;
41
+ // PowerShell sets POWERSHELL_DISTRIBUTION_CHANNEL or PSExecutionPolicyPreference
42
+ // Note: PSModulePath exists in both cmd and PowerShell on modern Windows, so not reliable alone.
43
+ if (process.env.POWERSHELL_DISTRIBUTION_CHANNEL)
44
+ return true;
45
+ if (process.env.PSExecutionPolicyPreference)
46
+ return true;
47
+ // Fallback: check parent shell via ComSpec is still cmd.exe, so we treat
48
+ // non-Git-Bash as cmd/powershell which both use the .bat launcher.
49
+ return false;
50
+ }
51
+ function detectWindowsShell() {
52
+ if (isGitBashOnWindows())
53
+ return 'git-bash';
54
+ if (isPowerShellOnWindows())
55
+ return 'powershell';
56
+ return 'cmd';
57
+ }
58
+ // Convert Windows path (C:\foo\bar) to MSYS posix (/c/foo/bar) for Git Bash.
59
+ // Git Bash's bash handles Windows paths, but posix is more reliable for shebang.
60
+ function toPosixForGitBash(winPath) {
61
+ // Already posix
62
+ if (winPath.startsWith('/'))
63
+ return winPath;
64
+ const m = winPath.match(/^([a-zA-Z]):[\\/](.*)/);
65
+ if (!m)
66
+ return winPath.replace(/\\/g, '/');
67
+ const drive = m[1].toLowerCase();
68
+ const rest = m[2].replace(/\\/g, '/');
69
+ return `/${drive}/${rest}`;
70
+ }
10
71
  function resolveLauncherScript() {
11
72
  const root = node_path_1.default.resolve(__dirname, '..', '..');
12
73
  const isWindows = process.platform === 'win32';
13
- const scriptPath = isWindows
74
+ const isGitBash = isGitBashOnWindows();
75
+ // On Windows Git Bash we must run the .sh script via bash, not the .bat.
76
+ const scriptPath = isWindows && !isGitBash
14
77
  ? node_path_1.default.join(root, 'scripts', 'http-forge.bat')
15
78
  : node_path_1.default.join(root, 'scripts', 'http-forge.sh');
16
79
  if (!(0, node_fs_1.existsSync)(scriptPath)) {
17
80
  throw new Error(`Launcher script not found: ${scriptPath}. Reinstall @http-forge/cli or ensure scripts are packaged.`);
18
81
  }
19
- return { scriptPath, platform: isWindows ? 'win32' : 'unix' };
82
+ if (isWindows) {
83
+ return { scriptPath, platform: isGitBash ? 'unix' : 'win32', shell: isGitBash ? 'git-bash' : detectWindowsShell() };
84
+ }
85
+ return { scriptPath, platform: 'unix' };
20
86
  }
21
87
  function quoteForCmdArg(arg) {
22
88
  if (arg.length === 0)
@@ -26,7 +92,7 @@ function quoteForCmdArg(arg) {
26
92
  return needsQuotes ? `"${escaped}"` : escaped;
27
93
  }
28
94
  async function handleLaunch(args) {
29
- const { scriptPath, platform } = resolveLauncherScript();
95
+ const { scriptPath, platform, shell } = resolveLauncherScript();
30
96
  if (args.includes('--help') || args.includes('-h')) {
31
97
  console.log(`
32
98
  HTTP Forge Launcher (from CLI)
@@ -42,8 +108,9 @@ OPTIONS:
42
108
 
43
109
  NOTES:
44
110
  - Detects your shell/OS and picks the matching launcher automatically.
45
- - On Windows this runs scripts/http-forge.bat.
46
- - On Linux/macOS this runs scripts/http-forge.sh.
111
+ - On Windows Git Bash this runs scripts/http-forge.sh via bash.
112
+ - On Windows cmd/powershell this runs scripts/http-forge.bat via cmd.exe.
113
+ - On Linux/macOS this runs scripts/http-forge.sh via bash.
47
114
  `);
48
115
  return;
49
116
  }
@@ -52,22 +119,23 @@ NOTES:
52
119
  let child;
53
120
  if (platform === 'win32') {
54
121
  const cmdExe = process.env.ComSpec || process.env.COMSPEC || 'cmd.exe';
55
- const commandLine = `"${scriptPath}" ${modeArgs.map(quoteForCmdArg).join(' ')}`.trim();
56
- // cmd.exe /c quirk: when the command begins with ", the entire argument must
57
- // be wrapped in an additional outer pair of quotes so cmd strips them and
58
- // executes the inner quoted path correctly.
59
- // windowsVerbatimArguments prevents Node.js from re-escaping the quotes,
60
- // which would turn "path" into \"path\" and break cmd.exe's parsing.
61
- const cmdArg = commandLine.startsWith('"') ? `"${commandLine}"` : commandLine;
62
- child = (0, node_child_process_1.spawn)(cmdExe, ['/d', '/s', '/c', cmdArg], {
122
+ // Start with `call` so cmd.exe does not treat the quoted batch path as a title.
123
+ const commandLine = `call "${scriptPath}" ${modeArgs.map(quoteForCmdArg).join(' ')}`.trim();
124
+ child = (0, node_child_process_1.spawn)(cmdExe, ['/d', '/s', '/c', commandLine], {
63
125
  stdio: 'inherit',
64
126
  windowsHide: false,
65
127
  windowsVerbatimArguments: true,
66
128
  });
67
129
  }
68
130
  else {
69
- // The script declares #!/bin/bash; spawn it directly so the shebang is honoured.
70
- child = (0, node_child_process_1.spawn)(scriptPath, modeArgs, {
131
+ // Unix or Windows Git Bash: invoke Bash explicitly because npm archives can lose the executable bit.
132
+ // On Windows Git Bash, prefer the bash from $SHELL or MSYSTEM, fallback to 'bash' in PATH.
133
+ const isWinGitBash = process.platform === 'win32' && shell === 'git-bash';
134
+ const bashExe = isWinGitBash
135
+ ? process.env.SHELL || process.env.BASH || 'bash'
136
+ : '/bin/bash';
137
+ const effectiveScript = isWinGitBash ? toPosixForGitBash(scriptPath) : scriptPath;
138
+ child = (0, node_child_process_1.spawn)(bashExe, [effectiveScript, ...modeArgs], {
71
139
  stdio: 'inherit',
72
140
  });
73
141
  }
@@ -1 +1 @@
1
- {"version":3,"file":"launch.js","sourceRoot":"","sources":["../../src/commands/launch.ts"],"names":[],"mappings":";;;;;AA2BA,oCA2DC;AAtFD,2DAA2C;AAC3C,qCAAqC;AACrC,0DAA6B;AAE7B,SAAS,qBAAqB;IAC5B,MAAM,IAAI,GAAG,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;IAC/C,MAAM,UAAU,GAAG,SAAS;QAC1B,CAAC,CAAC,mBAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,gBAAgB,CAAC;QAC9C,CAAC,CAAC,mBAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;IAEhD,IAAI,CAAC,IAAA,oBAAU,EAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CACb,8BAA8B,UAAU,6DAA6D,CACtG,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AAChE,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAClC,MAAM,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,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@http-forge/cli",
3
- "version": "0.2.39",
3
+ "version": "0.2.41",
4
4
  "description": "Standalone HTTP Forge launcher and Postman alternative for UI mode, API testing, CI/CD, and MCP server automation",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -57,9 +57,23 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@http-forge/codegen": "^0.1.10",
60
- "@http-forge/core": "^0.6.35",
60
+ "@http-forge/core": "^0.6.39",
61
61
  "java-parser": "^0.3.2"
62
62
  },
63
+ "overrides": {
64
+ "lodash": "4.18.1",
65
+ "lodash-es": "4.18.1",
66
+ "esbuild": "0.28.2",
67
+ "gaxios": {
68
+ "uuid": "11.1.1"
69
+ },
70
+ "google-gax": {
71
+ "uuid": "11.1.1"
72
+ },
73
+ "teeny-request": {
74
+ "uuid": "11.1.1"
75
+ }
76
+ },
63
77
  "optionalDependencies": {
64
78
  "@aws-sdk/client-secrets-manager": "^3.0.0",
65
79
  "@azure/identity": "^4.0.0",
@@ -13,6 +13,11 @@ EXTENSION="henry-huang.http-forge"
13
13
  INSTALL_DIR="$HOME/.http-forge-launcher/vscode"
14
14
  TEST_DATA_DIR="$HOME/.http-forge-launcher/vscode-data"
15
15
 
16
+ is_wsl() {
17
+ [[ -n "${WSL_INTEROP:-}" || -n "${WSL_DISTRO_NAME:-}" ]] || \
18
+ grep -qiE 'microsoft|wsl' /proc/version 2>/dev/null
19
+ }
20
+
16
21
  # ─── Parse Arguments ───────────────────────────────────────────
17
22
  MODE="test"
18
23
  WORKSPACE_ARGS=()
@@ -48,6 +53,16 @@ find_code() {
48
53
  return
49
54
  fi
50
55
 
56
+ # WSL may expose the Windows VS Code CLI as an executable rather than `code`.
57
+ if is_wsl; then
58
+ for bin in code.exe code-insiders.exe; do
59
+ if command -v "$bin" &>/dev/null; then
60
+ command -v "$bin"
61
+ return
62
+ fi
63
+ done
64
+ fi
65
+
51
66
  # Check common Linux locations
52
67
  for bin in /usr/bin/code /snap/bin/code /usr/share/code/bin/code; do
53
68
  if [[ -x "$bin" ]]; then
@@ -74,6 +89,14 @@ find_code() {
74
89
  return 1
75
90
  }
76
91
 
92
+ code_data_dir() {
93
+ if is_wsl && [[ "$CODE_BIN" == *.exe ]] && command -v wslpath &>/dev/null; then
94
+ wslpath -w "$TEST_DATA_DIR"
95
+ else
96
+ echo "$TEST_DATA_DIR"
97
+ fi
98
+ }
99
+
77
100
  # ─── Install VS Code ──────────────────────────────────────────
78
101
  install_code() {
79
102
  echo "[http-forge] VS Code not found. Downloading..."
@@ -119,6 +142,7 @@ if [[ -z "$CODE_BIN" ]]; then
119
142
  fi
120
143
 
121
144
  echo "[http-forge] Using: $CODE_BIN"
145
+ CODE_TEST_DATA_DIR=$(code_data_dir)
122
146
 
123
147
  # Install extension only where it will actually be launched
124
148
  echo "[http-forge] Ensuring extension is installed..."
@@ -134,7 +158,7 @@ case "$MODE" in
134
158
  if [[ ! -f "$TEST_DATA_DIR/User/settings.json" ]]; then
135
159
  echo '{"debug.showInActivityBar": false, "debug.showInStatusBar": "never", "workbench.startupEditor": "none"}' > "$TEST_DATA_DIR/User/settings.json"
136
160
  fi
137
- "$CODE_BIN" --profile "$PROFILE_TEST" --user-data-dir "$TEST_DATA_DIR" --install-extension "$EXTENSION" --force 2>/dev/null
161
+ "$CODE_BIN" --profile "$PROFILE_TEST" --user-data-dir "$CODE_TEST_DATA_DIR" --install-extension "$EXTENSION" --force 2>/dev/null
138
162
  "$CODE_BIN" --profile "$PROFILE_DEV" --install-extension "$EXTENSION" --force 2>/dev/null
139
163
  ;;
140
164
  esac
@@ -158,8 +182,8 @@ case "$MODE" in
158
182
  echo " → Test: isolated instance (--user-data-dir)"
159
183
  echo " → Dev: default VS Code"
160
184
  # Test instance
161
- "$CODE_BIN" --new-window --profile "$PROFILE_TEST" --user-data-dir "$TEST_DATA_DIR" "${DISABLE_EXTENSIONS[@]}" "${WORKSPACE_ARGS[@]}"
162
- "$CODE_BIN" --profile "$PROFILE_TEST" --user-data-dir "$TEST_DATA_DIR" --open-url "vscode:extension/$EXTENSION" &
185
+ "$CODE_BIN" --new-window --profile "$PROFILE_TEST" --user-data-dir "$CODE_TEST_DATA_DIR" "${DISABLE_EXTENSIONS[@]}" "${WORKSPACE_ARGS[@]}"
186
+ "$CODE_BIN" --profile "$PROFILE_TEST" --user-data-dir "$CODE_TEST_DATA_DIR" --open-url "vscode:extension/$EXTENSION" &
163
187
  # Dev instance
164
188
  "$CODE_BIN" --new-window --profile "$PROFILE_DEV" "${WORKSPACE_ARGS[@]}"
165
189
  "$CODE_BIN" --profile "$PROFILE_DEV" --open-url "vscode:extension/$EXTENSION" &