@prover-coder-ai/docker-git 1.0.34 → 1.0.36

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.
@@ -1268,7 +1268,12 @@ const findKeyByPriority = (fs, path, cwd, spec) => Effect.gen(function* (_) {
1268
1268
  return fallback;
1269
1269
  }
1270
1270
  }
1271
- const home = resolveEnvPath("HOME");
1271
+ const dockerGitHomeKey = path.join(defaultProjectsRoot(cwd), spec.devKeyName);
1272
+ const dockerGitHomeExisting = yield* _(findExistingPath(fs, dockerGitHomeKey));
1273
+ if (dockerGitHomeExisting !== null) {
1274
+ return dockerGitHomeExisting;
1275
+ }
1276
+ const home = resolveHomeDir();
1272
1277
  if (home === null) {
1273
1278
  return null;
1274
1279
  }
@@ -1332,7 +1337,7 @@ const ensureDockerImage = (fs, path, cwd, spec) => Effect.gen(function* (_) {
1332
1337
  );
1333
1338
  });
1334
1339
  const ghAuthRoot = ".docker-git/.orch/auth/gh";
1335
- const ghAuthDir = "/root/.config/gh";
1340
+ const ghAuthDir = "/gh-auth";
1336
1341
  const ghImageName = "docker-git-auth-gh:latest";
1337
1342
  const ghImageDir = ".docker-git/.orch/auth/gh/.image";
1338
1343
  const renderGhDockerfile = () => String.raw`FROM ubuntu:24.04
@@ -4124,8 +4129,39 @@ if [[ -z "$CDP_ENDPOINT" ]]; then
4124
4129
  CDP_ENDPOINT="http://__SERVICE_NAME__-browser:9223"
4125
4130
  fi
4126
4131
 
4132
+ # CHANGE: add retry logic for browser sidecar startup wait
4133
+ # WHY: the browser container may take time to initialize, causing MCP server to fail on first attempt
4134
+ # QUOTE(issue-123): "Почему MCP сервер лежит с ошибкой?"
4135
+ # REF: issue-123
4136
+ # SOURCE: n/a
4137
+ # FORMAT THEOREM: forall t in [1..max_attempts]: retry(t) -> eventually(cdp_ready) OR timeout_error
4138
+ # PURITY: SHELL
4139
+ # INVARIANT: script exits only after cdp_ready OR all retries exhausted
4140
+ # COMPLEXITY: O(max_attempts * timeout_per_attempt)
4141
+ MCP_PLAYWRIGHT_RETRY_ATTEMPTS="\${MCP_PLAYWRIGHT_RETRY_ATTEMPTS:-10}"
4142
+ MCP_PLAYWRIGHT_RETRY_DELAY="\${MCP_PLAYWRIGHT_RETRY_DELAY:-2}"
4143
+
4144
+ fetch_cdp_version() {
4145
+ curl -sSf --connect-timeout 3 --max-time 10 -H 'Host: 127.0.0.1:9222' "\${CDP_ENDPOINT%/}/json/version" 2>/dev/null
4146
+ }
4147
+
4148
+ JSON=""
4149
+ for attempt in $(seq 1 "$MCP_PLAYWRIGHT_RETRY_ATTEMPTS"); do
4150
+ if JSON="$(fetch_cdp_version)"; then
4151
+ break
4152
+ fi
4153
+ if [[ "$attempt" -lt "$MCP_PLAYWRIGHT_RETRY_ATTEMPTS" ]]; then
4154
+ echo "docker-git-playwright-mcp: waiting for browser sidecar (attempt $attempt/$MCP_PLAYWRIGHT_RETRY_ATTEMPTS)..." >&2
4155
+ sleep "$MCP_PLAYWRIGHT_RETRY_DELAY"
4156
+ fi
4157
+ done
4158
+
4159
+ if [[ -z "$JSON" ]]; then
4160
+ echo "docker-git-playwright-mcp: failed to connect to CDP endpoint $CDP_ENDPOINT after $MCP_PLAYWRIGHT_RETRY_ATTEMPTS attempts" >&2
4161
+ exit 1
4162
+ fi
4163
+
4127
4164
  # kechangdev/browser-vnc binds Chromium CDP on 127.0.0.1:9222; it also host-checks HTTP requests.
4128
- JSON="$(curl -sSf --connect-timeout 3 --max-time 10 -H 'Host: 127.0.0.1:9222' "\${CDP_ENDPOINT%/}/json/version")"
4129
4165
  WS_URL="$(printf "%s" "$JSON" | node -e 'const fs=require("fs"); const j=JSON.parse(fs.readFileSync(0,"utf8")); process.stdout.write(j.webSocketDebuggerUrl || "")')"
4130
4166
  if [[ -z "$WS_URL" ]]; then
4131
4167
  echo "docker-git-playwright-mcp: webSocketDebuggerUrl missing" >&2
@@ -6717,7 +6753,7 @@ const authClaudeLogout = (command) => Effect.gen(function* (_) {
6717
6753
  }).pipe(Effect.asVoid);
6718
6754
  const codexImageName = "docker-git-auth-codex:latest";
6719
6755
  const codexImageDir = ".docker-git/.orch/auth/codex/.image";
6720
- const codexHome = "/root/.codex";
6756
+ const codexHome = "/codex-home";
6721
6757
  const ensureCodexOrchLayout = (cwd, codexAuthPath) => migrateLegacyOrchLayout(cwd, {
6722
6758
  envGlobalPath: defaultTemplateConfig.envGlobalPath,
6723
6759
  envProjectPath: defaultTemplateConfig.envProjectPath,
@@ -6873,6 +6909,7 @@ const resolveGithubTokenFromGh = (cwd, accountPath) => runDockerAuthCapture(
6873
6909
  image: ghImageName,
6874
6910
  hostPath: accountPath,
6875
6911
  containerPath: ghAuthDir,
6912
+ env: `GH_CONFIG_DIR=${ghAuthDir}`,
6876
6913
  args: ["auth", "token"],
6877
6914
  interactive: false
6878
6915
  }),
@@ -6891,7 +6928,7 @@ const runGithubLogin = (cwd, accountPath, scopes) => runDockerAuth(
6891
6928
  image: ghImageName,
6892
6929
  hostPath: accountPath,
6893
6930
  containerPath: ghAuthDir,
6894
- env: "BROWSER=echo",
6931
+ env: ["BROWSER=echo", `GH_CONFIG_DIR=${ghAuthDir}`],
6895
6932
  args: [
6896
6933
  "auth",
6897
6934
  "login",
@@ -8459,6 +8496,8 @@ Container runtime env (set via .orch/env/project.env):
8459
8496
  DOCKER_GIT_ZSH_AUTOSUGGEST_STRATEGY=... Suggestion sources (default: history completion)
8460
8497
  MCP_PLAYWRIGHT_ISOLATED=1|0 Isolated browser contexts (recommended for many Codex; default: 1)
8461
8498
  MCP_PLAYWRIGHT_CDP_ENDPOINT=http://... Override CDP endpoint (default: http://dg-<repo>-browser:9223)
8499
+ MCP_PLAYWRIGHT_RETRY_ATTEMPTS=<n> Retry attempts for browser sidecar startup wait (default: 10)
8500
+ MCP_PLAYWRIGHT_RETRY_DELAY=<seconds> Delay between retry attempts (default: 2)
8462
8501
 
8463
8502
  Auth providers:
8464
8503
  github, gh GitHub CLI auth (tokens saved to env file)