@sideboard-ai/core 0.1.84 → 0.1.85

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.
Files changed (35) hide show
  1. package/dist/{agents-OPTHS4IX.js → agents-FD77JUOP.js} +10 -10
  2. package/dist/{agents-JFXM66QA.js → agents-YAYNNJWC.js} +6 -6
  3. package/dist/{chunk-ODZ2ZOA4.js → chunk-2N5DVTGH.js} +2 -2
  4. package/dist/{chunk-BBQ6HXKS.js → chunk-3CCRD6WS.js} +19 -9
  5. package/dist/{chunk-AE5VBOFE.js → chunk-3KETJKYA.js} +9 -2
  6. package/dist/{chunk-WJ5TINR6.js → chunk-6GKDYUTJ.js} +2 -2
  7. package/dist/{chunk-VROPG6QF.js → chunk-6K5VAPVR.js} +3 -3
  8. package/dist/{chunk-CKBIQ54F.js → chunk-6WQAYBVE.js} +88 -20
  9. package/dist/{chunk-BTL7EMGT.js → chunk-HHTHF5BQ.js} +4 -4
  10. package/dist/{chunk-UN3LVQB2.js → chunk-JFQ2M6NQ.js} +2 -2
  11. package/dist/{chunk-OIEFHOP7.js → chunk-JTHWVYSD.js} +2 -2
  12. package/dist/{chunk-XW47PL6A.js → chunk-KRAUS3RF.js} +86 -16
  13. package/dist/{chunk-D4DPQ552.js → chunk-LGXBYZZA.js} +9 -2
  14. package/dist/{chunk-JPHG2KCC.js → chunk-SH75CXJR.js} +1 -1
  15. package/dist/{chunk-R753UFSX.js → chunk-WGI6KXKJ.js} +14 -4
  16. package/dist/{chunk-NW7MEJHO.js → chunk-XVFV56JG.js} +1 -1
  17. package/dist/{connected-teams-ZRS53OAT.js → connected-teams-BNBM7OIC.js} +2 -2
  18. package/dist/{connected-teams-35EIRJCP.js → connected-teams-LSQ5TAZP.js} +2 -2
  19. package/dist/{coordinator-prompt-RCTIIZ6C.js → coordinator-prompt-VN7FF76K.js} +3 -3
  20. package/dist/{coordinator-prompt-DOIOSLUN.js → coordinator-prompt-YYQSPLIP.js} +3 -3
  21. package/dist/{global-workspace-73OAKD3C.js → global-workspace-BRIDCBMY.js} +4 -4
  22. package/dist/{global-workspace-33BIG7KK.js → global-workspace-U3XVTQLL.js} +4 -4
  23. package/dist/index.cjs +181 -82
  24. package/dist/index.d.cts +32 -6
  25. package/dist/index.d.ts +32 -6
  26. package/dist/index.js +36 -22
  27. package/dist/mcp/run-stdio.cjs +361 -270
  28. package/dist/mcp/run-stdio.js +34 -27
  29. package/dist/{run-V2WZUMJA.js → run-CFKZPY7F.js} +1 -1
  30. package/dist/{run-A4RHY7HH.js → run-XKTAJRWF.js} +1 -1
  31. package/dist/{workspaces-WDLY34MX.js → workspaces-AIZDG6PS.js} +5 -5
  32. package/dist/{workspaces-SRITISKA.js → workspaces-IWQIWAMQ.js} +5 -5
  33. package/dist/{worktree-TUAO74SI.js → worktree-6ZALJUWG.js} +2 -2
  34. package/dist/{worktree-SGZVAWOQ.js → worktree-7Y22WHR7.js} +2 -2
  35. package/package.json +1 -1
@@ -1,19 +1,23 @@
1
1
  import {
2
2
  isOrchestratorThread
3
- } from "./chunk-OIEFHOP7.js";
3
+ } from "./chunk-JTHWVYSD.js";
4
4
  import {
5
5
  applyConnectedTeamToCli,
6
6
  brightsyMcpServerName,
7
7
  ensureCliTeamTracked,
8
8
  ensureConnectedBrightsyTeamTokens,
9
9
  loadBrightsyConfig
10
- } from "./chunk-BTL7EMGT.js";
10
+ } from "./chunk-HHTHF5BQ.js";
11
11
  import {
12
12
  extractJsonErrorMessage,
13
13
  formatUnknownDetail,
14
14
  looksLikeAgentFailureMessage,
15
15
  parseCursorRunnerLine
16
16
  } from "./chunk-CBJSPTBG.js";
17
+ import {
18
+ codexUnattendedGitConfigArgs,
19
+ resolveAgentGitAuthEnv
20
+ } from "./chunk-KRAUS3RF.js";
17
21
  import {
18
22
  claudeChromeEnabled,
19
23
  loadAppSettings,
@@ -33,7 +37,7 @@ import {
33
37
  resolveCommandBinarySync,
34
38
  run,
35
39
  withExportedPath
36
- } from "./chunk-D4DPQ552.js";
40
+ } from "./chunk-LGXBYZZA.js";
37
41
 
38
42
  // src/agents/brightsy.ts
39
43
  import { existsSync } from "fs";
@@ -736,6 +740,10 @@ async function buildInjectedMcpServers(opts) {
736
740
  if (orchId) {
737
741
  sideboard.env.SIDEBOARD_ORCHESTRATOR_THREAD_ID = orchId;
738
742
  }
743
+ try {
744
+ Object.assign(sideboard.env, await resolveAgentGitAuthEnv(sideboard.env));
745
+ } catch {
746
+ }
739
747
  servers.push(sideboard);
740
748
  }
741
749
  if (opts.includeBrightsy && isBrightsyConnected()) {
@@ -1017,7 +1025,7 @@ var claudeAdapter = {
1017
1025
  );
1018
1026
  }
1019
1027
  const mode = permissionMode(thread);
1020
- const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-73OAKD3C.js");
1028
+ const { isOrchestratorThread: isOrchestratorThread2 } = await import("./global-workspace-BRIDCBMY.js");
1021
1029
  const isOrchestrator = isOrchestratorThread2(thread);
1022
1030
  const injectedServers = await buildInjectedMcpServers({
1023
1031
  includeSideboard: true,
@@ -1399,6 +1407,8 @@ var codexAdapter = {
1399
1407
  // `codex exec` rejects `--ask-for-approval` (global-only on newer CLIs).
1400
1408
  "-c",
1401
1409
  'approval_policy="never"',
1410
+ // Seatbelt cannot use the login Keychain; default policy also strips GH_TOKEN.
1411
+ ...codexUnattendedGitConfigArgs(mode.codexSandbox),
1402
1412
  ...model ? ["--model", model] : [],
1403
1413
  ...mcpOverrides
1404
1414
  ];
@@ -2,7 +2,7 @@
2
2
 
3
3
  import {
4
4
  resolveGithubRepoSlug
5
- } from "./chunk-CKBIQ54F.js";
5
+ } from "./chunk-6WQAYBVE.js";
6
6
  import {
7
7
  resolveThreadDefaults
8
8
  } from "./chunk-AY53MPDE.js";
@@ -7,9 +7,9 @@ import {
7
7
  ensureConnectedBrightsyTeamTokens,
8
8
  getConnectedBrightsyTeamsRaw,
9
9
  listConnectedBrightsyTeams
10
- } from "./chunk-BTL7EMGT.js";
10
+ } from "./chunk-HHTHF5BQ.js";
11
11
  import "./chunk-M37RITA6.js";
12
- import "./chunk-D4DPQ552.js";
12
+ import "./chunk-LGXBYZZA.js";
13
13
  export {
14
14
  applyConnectedTeamToCli,
15
15
  brightsyMcpServerName,
@@ -9,9 +9,9 @@ import {
9
9
  ensureConnectedBrightsyTeamTokens,
10
10
  getConnectedBrightsyTeamsRaw,
11
11
  listConnectedBrightsyTeams
12
- } from "./chunk-VROPG6QF.js";
13
- import "./chunk-AE5VBOFE.js";
12
+ } from "./chunk-6K5VAPVR.js";
14
13
  import "./chunk-7MV3RXSC.js";
14
+ import "./chunk-3KETJKYA.js";
15
15
  export {
16
16
  applyConnectedTeamToCli,
17
17
  brightsyMcpServerName,
@@ -7,8 +7,8 @@ import {
7
7
  enrichWorkspacesWithGithub,
8
8
  ensureGlobalCoordinatorCwd,
9
9
  formatWorkspaceInventory
10
- } from "./chunk-JPHG2KCC.js";
11
- import "./chunk-XW47PL6A.js";
10
+ } from "./chunk-SH75CXJR.js";
11
+ import "./chunk-KRAUS3RF.js";
12
12
  import "./chunk-FKOIHGKV.js";
13
13
  import "./chunk-I3FRXL7J.js";
14
14
  import "./chunk-5KLC2MWZ.js";
@@ -16,7 +16,7 @@ import "./chunk-JT7R45JB.js";
16
16
  import "./chunk-FWJYLBO6.js";
17
17
  import "./chunk-77WWLBCI.js";
18
18
  import "./chunk-M37RITA6.js";
19
- import "./chunk-D4DPQ552.js";
19
+ import "./chunk-LGXBYZZA.js";
20
20
  export {
21
21
  COORDINATOR_TOOL_PLAYBOOK,
22
22
  SLACK_REPLY_FORMATTING,
@@ -9,15 +9,15 @@ import {
9
9
  enrichWorkspacesWithGithub,
10
10
  ensureGlobalCoordinatorCwd,
11
11
  formatWorkspaceInventory
12
- } from "./chunk-NW7MEJHO.js";
13
- import "./chunk-CKBIQ54F.js";
12
+ } from "./chunk-XVFV56JG.js";
13
+ import "./chunk-6WQAYBVE.js";
14
14
  import "./chunk-B3SJXYIJ.js";
15
15
  import "./chunk-7FD7COKE.js";
16
- import "./chunk-AE5VBOFE.js";
17
16
  import "./chunk-AY53MPDE.js";
18
17
  import "./chunk-NSTQ6QKD.js";
19
18
  import "./chunk-KGZBYWZ3.js";
20
19
  import "./chunk-7MV3RXSC.js";
20
+ import "./chunk-3KETJKYA.js";
21
21
  export {
22
22
  COORDINATOR_TOOL_PLAYBOOK,
23
23
  SLACK_REPLY_FORMATTING,
@@ -14,9 +14,9 @@ import {
14
14
  orchestratorSessionPoisonedByBuiltins,
15
15
  slackCoordinatorSourceRef,
16
16
  takenTeamSlugsForOrchestration
17
- } from "./chunk-OIEFHOP7.js";
18
- import "./chunk-JPHG2KCC.js";
19
- import "./chunk-XW47PL6A.js";
17
+ } from "./chunk-JTHWVYSD.js";
18
+ import "./chunk-SH75CXJR.js";
19
+ import "./chunk-KRAUS3RF.js";
20
20
  import "./chunk-FKOIHGKV.js";
21
21
  import "./chunk-I3FRXL7J.js";
22
22
  import "./chunk-5KLC2MWZ.js";
@@ -26,7 +26,7 @@ import "./chunk-77WWLBCI.js";
26
26
  import {
27
27
  globalAgentCwd
28
28
  } from "./chunk-M37RITA6.js";
29
- import "./chunk-D4DPQ552.js";
29
+ import "./chunk-LGXBYZZA.js";
30
30
  export {
31
31
  GLOBAL_WORKSPACE_ID,
32
32
  createGlobalChat,
@@ -16,18 +16,18 @@ import {
16
16
  orchestratorSessionPoisonedByBuiltins,
17
17
  slackCoordinatorSourceRef,
18
18
  takenTeamSlugsForOrchestration
19
- } from "./chunk-WJ5TINR6.js";
20
- import "./chunk-NW7MEJHO.js";
21
- import "./chunk-CKBIQ54F.js";
19
+ } from "./chunk-6GKDYUTJ.js";
20
+ import "./chunk-XVFV56JG.js";
21
+ import "./chunk-6WQAYBVE.js";
22
22
  import "./chunk-B3SJXYIJ.js";
23
23
  import "./chunk-7FD7COKE.js";
24
- import "./chunk-AE5VBOFE.js";
25
24
  import "./chunk-AY53MPDE.js";
26
25
  import "./chunk-NSTQ6QKD.js";
27
26
  import "./chunk-KGZBYWZ3.js";
28
27
  import {
29
28
  globalAgentCwd
30
29
  } from "./chunk-7MV3RXSC.js";
30
+ import "./chunk-3KETJKYA.js";
31
31
  export {
32
32
  GLOBAL_WORKSPACE_ID,
33
33
  createGlobalChat,
package/dist/index.cjs CHANGED
@@ -2915,80 +2915,6 @@ var init_gh_errors = __esm({
2915
2915
  }
2916
2916
  });
2917
2917
 
2918
- // src/git/git-auth-mode.ts
2919
- function appendIndexedGitConfig(existing, entries) {
2920
- const start = Number.parseInt(String(existing?.GIT_CONFIG_COUNT ?? "0"), 10);
2921
- const count = Number.isFinite(start) && start > 0 ? start : 0;
2922
- const out = {};
2923
- entries.forEach((entry, i) => {
2924
- const n = count + i;
2925
- out[`GIT_CONFIG_KEY_${n}`] = entry.key;
2926
- out[`GIT_CONFIG_VALUE_${n}`] = entry.value;
2927
- });
2928
- out.GIT_CONFIG_COUNT = String(count + entries.length);
2929
- return out;
2930
- }
2931
- function githubAgentGitEnv(existing) {
2932
- return appendIndexedGitConfig(existing, HTTPS_REWRITE);
2933
- }
2934
- function applyGithubGitAuthEnv(existing, opts) {
2935
- const out = {};
2936
- if (opts.mode === "gh" || opts.mode === "token") {
2937
- Object.assign(out, githubAgentGitEnv(existing));
2938
- }
2939
- if (opts.mode === "token") {
2940
- const token = opts.token?.trim();
2941
- if (token && !existing?.GH_TOKEN?.trim()) {
2942
- out.GH_TOKEN = token;
2943
- }
2944
- }
2945
- return out;
2946
- }
2947
- function formatGitAuthModeDirective(mode) {
2948
- switch (mode) {
2949
- case "gh":
2950
- return [
2951
- "Git authentication (Account \u2192 GitHub mode: gh CLI):",
2952
- "- This process rewrites `git@github.com:` and `ssh://git@github.com/` to HTTPS.",
2953
- "- `gh` supplies credentials (`gh auth git-credential`). Do not switch remotes to SSH.",
2954
- "- Push with `git push -u origin HEAD`. Create/update PRs with `gh` as below."
2955
- ].join("\n");
2956
- case "ssh":
2957
- return [
2958
- "Git authentication (Account \u2192 GitHub mode: SSH):",
2959
- "- Keep SSH remotes (`git@github.com:\u2026`). Do not rewrite them to HTTPS.",
2960
- "- Use this Mac\u2019s SSH agent / keys. If push fails with `Permission denied (publickey)`, tell the user to start ssh-agent or switch Account \u2192 GitHub to Auto / gh CLI \u2014 do not rewrite remotes yourself.",
2961
- "- Push with `git push -u origin HEAD`. Create/update PRs with `gh` as below (API still uses `gh`)."
2962
- ].join("\n");
2963
- case "token":
2964
- return [
2965
- "Git authentication (Account \u2192 GitHub mode: personal access token):",
2966
- "- This process rewrites GitHub SSH remotes to HTTPS.",
2967
- "- `GH_TOKEN` is set in the environment. Use HTTPS git and `gh`; do not paste the token into commands or chat.",
2968
- "- Push with `git push -u origin HEAD`. Create/update PRs with `gh` as below."
2969
- ].join("\n");
2970
- case "auto":
2971
- default:
2972
- return [
2973
- "Git authentication (Account \u2192 GitHub mode: auto):",
2974
- "- Prefer the existing remote URL (SSH or HTTPS). Do not rewrite remotes unless a push/fetch fails.",
2975
- '- If `git push` fails with `Permission denied (publickey)`, this shell has no ssh-agent. Retry over HTTPS (do not stop): `git -c url.https://github.com/.insteadOf=git@github.com: -c http.extraHeader="AUTHORIZATION: bearer $(gh auth token)" push -u origin HEAD`.',
2976
- "- Then create/update the PR with `gh` as below."
2977
- ].join("\n");
2978
- }
2979
- }
2980
- var HTTPS_REWRITE;
2981
- var init_git_auth_mode = __esm({
2982
- "src/git/git-auth-mode.ts"() {
2983
- "use strict";
2984
- HTTPS_REWRITE = [
2985
- { key: "url.https://github.com/.insteadOf", value: "git@github.com:" },
2986
- { key: "url.https://github.com/.insteadOf", value: "ssh://git@github.com/" },
2987
- { key: "credential.https://github.com.helper", value: "!gh auth git-credential" }
2988
- ];
2989
- }
2990
- });
2991
-
2992
2918
  // src/agents/path.ts
2993
2919
  function prependPathDir(env, dir) {
2994
2920
  if (!dir || !(0, import_node_fs8.existsSync)(dir)) return;
@@ -3140,7 +3066,10 @@ async function git(args, cwd, opts) {
3140
3066
  env: {
3141
3067
  GIT_TERMINAL_PROMPT: "0",
3142
3068
  GIT_ASKPASS: process.env.GIT_ASKPASS || "echo",
3069
+ SSH_ASKPASS: process.env.SSH_ASKPASS || "echo",
3143
3070
  GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND || "ssh -o BatchMode=yes -o ConnectTimeout=15",
3071
+ GCM_INTERACTIVE: "never",
3072
+ GH_PROMPT_DISABLED: "1",
3144
3073
  ...opts?.env
3145
3074
  }
3146
3075
  });
@@ -3149,11 +3078,15 @@ async function gh(args, cwd, opts) {
3149
3078
  return run("gh", args, {
3150
3079
  cwd,
3151
3080
  reject: opts?.reject,
3152
- timeoutMs: opts?.timeoutMs
3081
+ timeoutMs: opts?.timeoutMs,
3082
+ env: {
3083
+ GH_PROMPT_DISABLED: "1",
3084
+ GIT_TERMINAL_PROMPT: "0"
3085
+ }
3153
3086
  });
3154
3087
  }
3155
3088
  async function resolveGhAuthToken(cwd) {
3156
- const result = await gh(["auth", "token"], cwd, { reject: false });
3089
+ const result = await gh(["auth", "token"], cwd, { reject: false, timeoutMs: 8e3 });
3157
3090
  if (result.exitCode !== 0) return null;
3158
3091
  const token = result.stdout.trim();
3159
3092
  return token || null;
@@ -3167,6 +3100,148 @@ var init_run = __esm({
3167
3100
  }
3168
3101
  });
3169
3102
 
3103
+ // src/git/git-auth-mode.ts
3104
+ function nonInteractiveGitProcessEnv() {
3105
+ return {
3106
+ GIT_TERMINAL_PROMPT: "0",
3107
+ GIT_ASKPASS: process.env.GIT_ASKPASS?.trim() || "echo",
3108
+ SSH_ASKPASS: process.env.SSH_ASKPASS?.trim() || "echo",
3109
+ GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND?.trim() || "ssh -o BatchMode=yes -o ConnectTimeout=15",
3110
+ GCM_INTERACTIVE: "never",
3111
+ GH_PROMPT_DISABLED: "1"
3112
+ };
3113
+ }
3114
+ function appendIndexedGitConfig(existing, entries) {
3115
+ const start = Number.parseInt(String(existing?.GIT_CONFIG_COUNT ?? "0"), 10);
3116
+ const count = Number.isFinite(start) && start > 0 ? start : 0;
3117
+ const out = {};
3118
+ entries.forEach((entry, i) => {
3119
+ const n = count + i;
3120
+ out[`GIT_CONFIG_KEY_${n}`] = entry.key;
3121
+ out[`GIT_CONFIG_VALUE_${n}`] = entry.value;
3122
+ });
3123
+ out.GIT_CONFIG_COUNT = String(count + entries.length);
3124
+ return out;
3125
+ }
3126
+ function githubAgentGitEnv(existing) {
3127
+ return appendIndexedGitConfig(existing, HTTPS_REWRITE);
3128
+ }
3129
+ function githubHttpsBearerEnv(existing, token) {
3130
+ const rewrite = githubAgentGitEnv(existing);
3131
+ const header = appendIndexedGitConfig(
3132
+ { ...existing, ...rewrite },
3133
+ [
3134
+ {
3135
+ key: "http.https://github.com/.extraHeader",
3136
+ value: `AUTHORIZATION: bearer ${token}`
3137
+ }
3138
+ ]
3139
+ );
3140
+ return { ...rewrite, ...header };
3141
+ }
3142
+ function applyGithubGitAuthEnv(existing, opts) {
3143
+ const out = { ...nonInteractiveGitProcessEnv() };
3144
+ if (opts.mode === "ssh") return out;
3145
+ const existingToken = existing?.GH_TOKEN?.trim() || "";
3146
+ const provided = existingToken ? "" : opts.token?.trim() || "";
3147
+ const token = existingToken || provided;
3148
+ Object.assign(
3149
+ out,
3150
+ token ? githubHttpsBearerEnv(existing, token) : githubAgentGitEnv(existing)
3151
+ );
3152
+ if (provided) out.GH_TOKEN = provided;
3153
+ return out;
3154
+ }
3155
+ async function resolveGithubAgentToken(mode, cwd) {
3156
+ if (mode === "ssh") return null;
3157
+ if (mode === "token") return getGithubPat();
3158
+ try {
3159
+ return await resolveGhAuthToken(cwd);
3160
+ } catch {
3161
+ return null;
3162
+ }
3163
+ }
3164
+ async function resolveAgentGitAuthEnv(existing, opts) {
3165
+ let mode = "auto";
3166
+ if (opts?.mode) {
3167
+ mode = opts.mode;
3168
+ } else {
3169
+ try {
3170
+ mode = getGithubGitAuthMode();
3171
+ } catch {
3172
+ mode = "auto";
3173
+ }
3174
+ }
3175
+ const cwd = opts?.cwd?.trim() || process.cwd();
3176
+ let token = null;
3177
+ try {
3178
+ token = await resolveGithubAgentToken(mode, cwd);
3179
+ } catch {
3180
+ token = null;
3181
+ }
3182
+ return applyGithubGitAuthEnv(existing, { mode, token });
3183
+ }
3184
+ function codexUnattendedGitConfigArgs(sandbox) {
3185
+ const args = [
3186
+ "-c",
3187
+ 'shell_environment_policy.inherit="all"',
3188
+ "-c",
3189
+ "shell_environment_policy.ignore_default_excludes=true"
3190
+ ];
3191
+ if (sandbox === "workspace-write") {
3192
+ args.push("-c", "sandbox_workspace_write.network_access=true");
3193
+ }
3194
+ return args;
3195
+ }
3196
+ function formatGitAuthModeDirective(mode) {
3197
+ switch (mode) {
3198
+ case "gh":
3199
+ return [
3200
+ "Git authentication (Account \u2192 GitHub mode: gh CLI):",
3201
+ "- This process rewrites `git@github.com:` and `ssh://git@github.com/` to HTTPS.",
3202
+ "- `GH_TOKEN` is injected from `gh auth token` (no macOS Keychain prompts). Do not switch remotes to SSH.",
3203
+ "- Push with `git push -u origin HEAD`. Create/update PRs with `gh` as below."
3204
+ ].join("\n");
3205
+ case "ssh":
3206
+ return [
3207
+ "Git authentication (Account \u2192 GitHub mode: SSH):",
3208
+ "- Keep SSH remotes (`git@github.com:\u2026`). Do not rewrite them to HTTPS.",
3209
+ "- SSH is batch-mode: it will not prompt for a Keychain password. If push fails with `Permission denied (publickey)`, tell the user to unlock ssh-agent or switch Account \u2192 GitHub to Auto / gh CLI \u2014 do not rewrite remotes yourself.",
3210
+ "- Push with `git push -u origin HEAD`. Create/update PRs with `gh` as below (API still uses `gh`)."
3211
+ ].join("\n");
3212
+ case "token":
3213
+ return [
3214
+ "Git authentication (Account \u2192 GitHub mode: personal access token):",
3215
+ "- This process rewrites GitHub SSH remotes to HTTPS.",
3216
+ "- `GH_TOKEN` is set in the environment. Use HTTPS git and `gh`; do not paste the token into commands or chat.",
3217
+ "- Push with `git push -u origin HEAD`. Create/update PRs with `gh` as below."
3218
+ ].join("\n");
3219
+ case "auto":
3220
+ default:
3221
+ return [
3222
+ "Git authentication (Account \u2192 GitHub mode: auto):",
3223
+ "- This process rewrites GitHub SSH remotes to HTTPS and authenticates with `GH_TOKEN` from `gh` so git/ssh never prompt the macOS Keychain (required for Slack / unattended Cursor).",
3224
+ "- Do not switch remotes to SSH. Push with `git push -u origin HEAD`.",
3225
+ "- If HTTPS auth fails, tell the user to run `gh auth login` on this Mac or set Account \u2192 GitHub to a PAT \u2014 do not wait for a Keychain dialog."
3226
+ ].join("\n");
3227
+ }
3228
+ }
3229
+ var HTTPS_REWRITE;
3230
+ var init_git_auth_mode = __esm({
3231
+ "src/git/git-auth-mode.ts"() {
3232
+ "use strict";
3233
+ init_app_settings();
3234
+ init_run();
3235
+ HTTPS_REWRITE = [
3236
+ { key: "url.https://github.com/.insteadOf", value: "git@github.com:" },
3237
+ { key: "url.https://github.com/.insteadOf", value: "ssh://git@github.com/" },
3238
+ // Empty helper disables ~/.gitconfig osxkeychain so GUI agents cannot pop
3239
+ // "git-credential-osxkeychain wants to use the keychain".
3240
+ { key: "credential.helper", value: "" }
3241
+ ];
3242
+ }
3243
+ });
3244
+
3170
3245
  // src/git/pr-gates.ts
3171
3246
  function prIsInMergeQueue(gate) {
3172
3247
  if (gate.isInMergeQueue) return true;
@@ -3652,7 +3727,7 @@ async function originGhRepoEnv(cwd, opts) {
3652
3727
  await ensureGhPreferOrigin(cwd);
3653
3728
  const slug = await resolveGithubRepoSlug(cwd);
3654
3729
  const mode = opts?.mode ?? getGithubGitAuthMode();
3655
- const token = mode === "token" ? getGithubPat() : null;
3730
+ const token = mode === "token" ? getGithubPat() : mode === "ssh" ? null : await resolveGhAuthToken(cwd);
3656
3731
  return {
3657
3732
  ...applyGithubGitAuthEnv(opts?.env, { mode, token }),
3658
3733
  ...slug ? { GH_REPO: slug } : {}
@@ -6418,6 +6493,10 @@ async function buildInjectedMcpServers(opts) {
6418
6493
  if (orchId) {
6419
6494
  sideboard.env.SIDEBOARD_ORCHESTRATOR_THREAD_ID = orchId;
6420
6495
  }
6496
+ try {
6497
+ Object.assign(sideboard.env, await resolveAgentGitAuthEnv(sideboard.env));
6498
+ } catch {
6499
+ }
6421
6500
  servers.push(sideboard);
6422
6501
  }
6423
6502
  if (opts.includeBrightsy && isBrightsyConnected()) {
@@ -6523,6 +6602,7 @@ var init_injected_mcp = __esm({
6523
6602
  init_paths();
6524
6603
  init_node_launch();
6525
6604
  init_nested_electron_env();
6605
+ init_git_auth_mode();
6526
6606
  import_meta = {};
6527
6607
  SIDEBOARD_MCP_ALLOWED_TOOLS = [
6528
6608
  "mcp__sideboard",
@@ -7066,6 +7146,7 @@ var init_codex = __esm({
7066
7146
  init_global_workspace();
7067
7147
  init_error_detail();
7068
7148
  init_usage();
7149
+ init_git_auth_mode();
7069
7150
  init_injected_mcp();
7070
7151
  init_turn_input();
7071
7152
  init_types();
@@ -7157,6 +7238,8 @@ var init_codex = __esm({
7157
7238
  // `codex exec` rejects `--ask-for-approval` (global-only on newer CLIs).
7158
7239
  "-c",
7159
7240
  'approval_policy="never"',
7241
+ // Seatbelt cannot use the login Keychain; default policy also strips GH_TOKEN.
7242
+ ...codexUnattendedGitConfigArgs(mode.codexSandbox),
7160
7243
  ...model ? ["--model", model] : [],
7161
7244
  ...mcpOverrides
7162
7245
  ];
@@ -8770,6 +8853,7 @@ __export(index_exports, {
8770
8853
  cleanupOrphanWorktrees: () => cleanupOrphanWorktrees,
8771
8854
  cloneRepoIntoSideboard: () => cloneRepoIntoSideboard,
8772
8855
  codexAdapter: () => codexAdapter,
8856
+ codexUnattendedGitConfigArgs: () => codexUnattendedGitConfigArgs,
8773
8857
  coerceOrchestratorAgent: () => coerceOrchestratorAgent,
8774
8858
  collectTakenTeamSlugs: () => collectTakenTeamSlugs,
8775
8859
  commentLinearIssue: () => commentLinearIssue,
@@ -8990,6 +9074,7 @@ __export(index_exports, {
8990
9074
  mergeUsage: () => mergeUsage,
8991
9075
  nextPastedTextName: () => nextPastedTextName,
8992
9076
  nextThinkingEffort: () => nextThinkingEffort,
9077
+ nonInteractiveGitProcessEnv: () => nonInteractiveGitProcessEnv,
8993
9078
  normalizeParseResult: () => normalizeParseResult,
8994
9079
  normalizeThinkingEffort: () => normalizeThinkingEffort,
8995
9080
  normalizeThread: () => normalizeThread,
@@ -9045,6 +9130,7 @@ __export(index_exports, {
9045
9130
  requireAgent: () => requireAgent,
9046
9131
  resetGhStackDetectCache: () => resetGhStackDetectCache,
9047
9132
  resolveAgentExecutable: () => resolveAgentExecutable,
9133
+ resolveAgentGitAuthEnv: () => resolveAgentGitAuthEnv,
9048
9134
  resolveClaudeExecutable: () => resolveClaudeExecutable,
9049
9135
  resolveCommandBinarySync: () => resolveCommandBinarySync,
9050
9136
  resolveConductorCursorAgentId: () => resolveConductorCursorAgentId,
@@ -9054,6 +9140,7 @@ __export(index_exports, {
9054
9140
  resolveEffectiveIssueSource: () => resolveEffectiveIssueSource,
9055
9141
  resolveFilesToCopy: () => resolveFilesToCopy,
9056
9142
  resolveGhAuthToken: () => resolveGhAuthToken,
9143
+ resolveGithubAgentToken: () => resolveGithubAgentToken,
9057
9144
  resolveGithubRepoSlug: () => resolveGithubRepoSlug,
9058
9145
  resolveLinearState: () => resolveLinearState,
9059
9146
  resolveLinearTeam: () => resolveLinearTeam,
@@ -9925,6 +10012,7 @@ init_agents();
9925
10012
  var import_node_readline = require("readline");
9926
10013
  var import_execa2 = require("execa");
9927
10014
  init_worktree();
10015
+ init_git_auth_mode();
9928
10016
  init_app_settings();
9929
10017
  init_global_workspace();
9930
10018
  init_brightsy();
@@ -10187,14 +10275,16 @@ async function spawnAgentTurn(thread, input, onEvent) {
10187
10275
  );
10188
10276
  }
10189
10277
  const env = childEnvWithAppSettings(cmd.env);
10190
- if (!isOrchestratorThread(thread)) {
10191
- try {
10278
+ try {
10279
+ if (isOrchestratorThread(thread)) {
10280
+ Object.assign(env, await resolveAgentGitAuthEnv(env));
10281
+ } else {
10192
10282
  const originEnv = await originGhRepoEnv(thread.worktreePath, { env });
10193
10283
  Object.assign(env, originEnv);
10194
- } catch (err) {
10195
- const detail = err instanceof Error ? err.message : String(err);
10196
- console.warn(`[sideboard] originGhRepoEnv failed (${thread.worktreePath}): ${detail}`);
10197
10284
  }
10285
+ } catch (err) {
10286
+ const detail = err instanceof Error ? err.message : String(err);
10287
+ console.warn(`[sideboard] git auth env failed (${thread.worktreePath}): ${detail}`);
10198
10288
  }
10199
10289
  const child = (0, import_execa2.execa)(cmd.file, cmd.args, {
10200
10290
  cwd: cmd.cwd,
@@ -10547,6 +10637,7 @@ var import_execa3 = require("execa");
10547
10637
  var import_node_readline2 = require("readline");
10548
10638
  init_settings();
10549
10639
  init_nested_electron_env();
10640
+ init_git_auth_mode();
10550
10641
  init_nested_electron_env();
10551
10642
  var PORT_RANGE_SIZE = 10;
10552
10643
  function matchSimpleGlob(pattern, name) {
@@ -10720,6 +10811,10 @@ async function spawnWorkspaceScript(command, opts) {
10720
10811
  },
10721
10812
  loginEnv
10722
10813
  );
10814
+ try {
10815
+ Object.assign(env, await resolveAgentGitAuthEnv(env, { cwd: opts.worktreePath }));
10816
+ } catch {
10817
+ }
10723
10818
  const shell = process.platform === "darwin" ? "zsh" : "bash";
10724
10819
  const child = (0, import_execa3.execa)(shell, ["-lc", command], {
10725
10820
  cwd: opts.worktreePath,
@@ -20234,6 +20329,7 @@ async function startSlackRelayServer(opts) {
20234
20329
  cleanupOrphanWorktrees,
20235
20330
  cloneRepoIntoSideboard,
20236
20331
  codexAdapter,
20332
+ codexUnattendedGitConfigArgs,
20237
20333
  coerceOrchestratorAgent,
20238
20334
  collectTakenTeamSlugs,
20239
20335
  commentLinearIssue,
@@ -20454,6 +20550,7 @@ async function startSlackRelayServer(opts) {
20454
20550
  mergeUsage,
20455
20551
  nextPastedTextName,
20456
20552
  nextThinkingEffort,
20553
+ nonInteractiveGitProcessEnv,
20457
20554
  normalizeParseResult,
20458
20555
  normalizeThinkingEffort,
20459
20556
  normalizeThread,
@@ -20509,6 +20606,7 @@ async function startSlackRelayServer(opts) {
20509
20606
  requireAgent,
20510
20607
  resetGhStackDetectCache,
20511
20608
  resolveAgentExecutable,
20609
+ resolveAgentGitAuthEnv,
20512
20610
  resolveClaudeExecutable,
20513
20611
  resolveCommandBinarySync,
20514
20612
  resolveConductorCursorAgentId,
@@ -20518,6 +20616,7 @@ async function startSlackRelayServer(opts) {
20518
20616
  resolveEffectiveIssueSource,
20519
20617
  resolveFilesToCopy,
20520
20618
  resolveGhAuthToken,
20619
+ resolveGithubAgentToken,
20521
20620
  resolveGithubRepoSlug,
20522
20621
  resolveLinearState,
20523
20622
  resolveLinearTeam,