bingocode 1.0.36 → 1.0.37

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/bin/bingo CHANGED
@@ -1,27 +1,27 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
- export CALLER_DIR="${CALLER_DIR:-$(pwd -W 2>/dev/null || pwd)}"
6
-
7
- # ── 首次部署:将默认 bingo 配置复制到 ~/.claude/bingo/ ──
8
- _BINGO_CONFIG_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
9
- _BINGO_DIR="$_BINGO_CONFIG_DIR/bingo"
10
- _BINGO_TARGET="$_BINGO_DIR/settings.json"
11
- _BINGO_SRC="$ROOT_DIR/config/bingo-defaults/settings.json"
12
-
13
- if [ ! -f "$_BINGO_TARGET" ] && [ -f "$_BINGO_SRC" ]; then
14
- mkdir -p "$_BINGO_DIR"
15
- cp "$_BINGO_SRC" "$_BINGO_TARGET" 2>/dev/null && \
16
- echo "[bingo] 首次启动:已部署默认配置到 $_BINGO_TARGET" || true
17
- fi
18
-
19
- cd "$ROOT_DIR"
20
-
21
- if [[ -f .env ]]; then
22
- ENV_FILE_FLAG="--env-file=.env"
23
- else
24
- ENV_FILE_FLAG=""
25
- fi
26
-
27
- exec bun --preload ./preload.ts $ENV_FILE_FLAG ./src/entrypoints/manager.tsx "$@"
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
5
+ export CALLER_DIR="${CALLER_DIR:-$(pwd -W 2>/dev/null || pwd)}"
6
+
7
+ # ── 首次部署:将默认 bingo 配置复制到 ~/.claude/bingo/ ──
8
+ _BINGO_CONFIG_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
9
+ _BINGO_DIR="$_BINGO_CONFIG_DIR/bingo"
10
+ _BINGO_TARGET="$_BINGO_DIR/settings.json"
11
+ _BINGO_SRC="$ROOT_DIR/config/bingo-defaults/settings.json"
12
+
13
+ if [ ! -f "$_BINGO_TARGET" ] && [ -f "$_BINGO_SRC" ]; then
14
+ mkdir -p "$_BINGO_DIR"
15
+ cp "$_BINGO_SRC" "$_BINGO_TARGET" 2>/dev/null && \
16
+ echo "[bingo] 首次启动:已部署默认配置到 $_BINGO_TARGET" || true
17
+ fi
18
+
19
+ cd "$ROOT_DIR"
20
+
21
+ if [[ -f .env ]]; then
22
+ ENV_FILE_FLAG="--env-file=.env"
23
+ else
24
+ ENV_FILE_FLAG=""
25
+ fi
26
+
27
+ exec bun --preload ./preload.ts $ENV_FILE_FLAG ./src/entrypoints/manager.tsx "$@"
@@ -33,10 +33,11 @@ process.env.NoDefaultCurrentDirectoryInExePath = '1';
33
33
  }
34
34
  })();
35
35
 
36
- // 自动定位 bun 路径
37
- const bun =
36
+ // 自动定位 bun 路径(优先用环境变量,再检查默认安装位置,最后 fallback 到 PATH)
37
+ const bunPath =
38
38
  process.env.BUN_PATH ||
39
39
  path.join(os.homedir(), '.bun', 'bin', 'bun.exe');
40
+ const bun = fs.existsSync(bunPath) ? bunPath : 'bun';
40
41
 
41
42
  // 主 CLI 入口
42
43
  const entry = path.join(__dirname, '..', 'src', 'entrypoints', 'cli.tsx');
@@ -32,10 +32,11 @@ process.env.NoDefaultCurrentDirectoryInExePath = '1';
32
32
  }
33
33
  })();
34
34
 
35
- // 自动定位 bun 路径
36
- const bun =
35
+ // 自动定位 bun 路径(优先用环境变量,再检查默认安装位置,最后 fallback 到 PATH)
36
+ const bunPath =
37
37
  process.env.BUN_PATH ||
38
38
  path.join(os.homedir(), '.bun', 'bin', 'bun.exe');
39
+ const bun = fs.existsSync(bunPath) ? bunPath : 'bun';
39
40
 
40
41
  // 主 CLI 入口
41
42
  const entry = path.join(__dirname, '..', 'src', 'entrypoints', 'cli.tsx');
@@ -1,7 +1,6 @@
1
- {
2
- "env": {
3
- "ANTHROPIC_AUTH_TOKEN": "pending-provider-setup",
4
- "ANTHROPIC_BASE_URL": "http://127.0.0.1:3456",
5
- "BINGO_SKIP_TRUST_DIALOG": "1"
6
- }
7
- }
1
+ {
2
+ "env": {
3
+ "ANTHROPIC_AUTH_TOKEN": "pending-provider-setup",
4
+ "ANTHROPIC_BASE_URL": "http://127.0.0.1:3456"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingocode",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -720,6 +720,21 @@ function computeTrustDialogAccepted(): boolean {
720
720
  return true
721
721
  }
722
722
 
723
+ // Fallback: also check the raw original CWD path directly.
724
+ // This handles the case where trust was saved under CWD (no .git at the time),
725
+ // but now .git exists so getProjectPathForConfig() returns the git root instead.
726
+ // Without this fallback the old trust entry would never be found, causing the
727
+ // trust dialog to reappear after `git init` / `git clone`.
728
+ const normalizedOriginalCwd = normalizePathForConfigKey(
729
+ resolve(getOriginalCwd()),
730
+ )
731
+ if (normalizedOriginalCwd !== projectPath) {
732
+ const cwdConfig = config.projects?.[normalizedOriginalCwd]
733
+ if (cwdConfig?.hasTrustDialogAccepted) {
734
+ return true
735
+ }
736
+ }
737
+
723
738
  // Now check from current working directory and its parents
724
739
  // Normalize paths for consistent JSON key lookup
725
740
  let currentPath = normalizePathForConfigKey(getCwd())
Binary file