@commonlyai/cli 0.1.314 → 0.1.315

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/cli",
3
- "version": "0.1.314",
3
+ "version": "0.1.315",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Commonly CLI — connect agents, manage pods, iterate fast",
6
6
  "type": "module",
@@ -1104,7 +1104,9 @@ export default {
1104
1104
  // repository set up to run programs is refused before anything starts
1105
1105
  // (sandbox/workspace-git-config.js).
1106
1106
  if (workspacePath) {
1107
- (ctx._refuseCodeRunningGitSetup || refuseCodeRunningGitSetup)(workspacePath, { seat: 'This public Codex agent' });
1107
+ (ctx._refuseCodeRunningGitSetup || refuseCodeRunningGitSetup)(workspacePath, {
1108
+ seat: 'This public Codex agent', env: ctx.env || process.env,
1109
+ });
1108
1110
  }
1109
1111
 
1110
1112
  // Per-spawn temp dir for --output-last-message. Cleaned up in `finally`
@@ -82,9 +82,15 @@ export const codeRunningKey = (key, value = '') => {
82
82
  return false;
83
83
  };
84
84
 
85
- // What git reads from the environment to pick a repository. Passed through, so
86
- // the check opens the repository Codex's git would.
87
- const DISCOVERY_ENV = ['GIT_DIR', 'GIT_WORK_TREE', 'GIT_COMMON_DIR', 'GIT_CEILING_DIRECTORIES', 'GIT_DISCOVERY_ACROSS_FILESYSTEM'];
85
+ // What git reads from the environment to pick a repository and its index.
86
+ // Passed through, so the check opens the repository Codex's git would.
87
+ const DISCOVERY_ENV = [
88
+ 'GIT_DIR', 'GIT_WORK_TREE', 'GIT_COMMON_DIR', 'GIT_INDEX_FILE', 'GIT_CEILING_DIRECTORIES', 'GIT_DISCOVERY_ACROSS_FILESYSTEM',
89
+ ];
90
+ // The ones git clears before it runs inside a submodule (its local_repo_env):
91
+ // they name the top repository, so a submodule is opened from its own folder.
92
+ const TOP_REPOSITORY_ENV = ['GIT_DIR', 'GIT_WORK_TREE', 'GIT_COMMON_DIR', 'GIT_INDEX_FILE'];
93
+ const submoduleEnv = (env) => Object.fromEntries(Object.entries(env).filter(([name]) => !TOP_REPOSITORY_ENV.includes(name)));
88
94
  // On the command line, ahead of anything the repository says: nothing these
89
95
  // commands do may start fsmonitor or a hook.
90
96
  const SAFE_FLAGS = ['-c', 'core.fsmonitor=false', '-c', 'core.hooksPath=/dev/null', '-c', 'core.untrackedCache=false'];
@@ -202,7 +208,8 @@ const inspect = (dir, context, findings, seen, depth) => {
202
208
  findings.push({ file: top, key: 'unreadable index' });
203
209
  return;
204
210
  }
205
- for (const sub of submodules) inspect(sub, context, findings, seen, depth + 1);
211
+ const subContext = { ...context, env: submoduleEnv(context.env) };
212
+ for (const sub of submodules) inspect(sub, subContext, findings, seen, depth + 1);
206
213
  };
207
214
 
208
215
  /**