@sideboard-ai/core 0.1.74 → 0.1.79

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 (37) hide show
  1. package/dist/{agents-H7M5CQY2.js → agents-EWPHOM6Y.js} +6 -6
  2. package/dist/{agents-2S2JVLZ6.js → agents-GRAPUXWW.js} +5 -5
  3. package/dist/{app-settings-3TLA2EJ7.js → app-settings-6IOQYGBK.js} +7 -1
  4. package/dist/{app-settings-P42Z3VOB.js → app-settings-NILNWNNQ.js} +7 -1
  5. package/dist/{caffeinate-hold-KLC6SABD.js → caffeinate-hold-EAZNWJBE.js} +5 -1
  6. package/dist/caffeinate-hold-OHAUWOA6.js +20 -0
  7. package/dist/{chunk-77W62MTX.js → chunk-5LXWTU3J.js} +6 -6
  8. package/dist/{chunk-GJ2LZQJI.js → chunk-5VTWBI3I.js} +2 -2
  9. package/dist/{chunk-2NKSHIRI.js → chunk-6T2SKGCS.js} +3 -3
  10. package/dist/{chunk-OE7YBB5X.js → chunk-FUUVPN4A.js} +108 -3
  11. package/dist/{chunk-HCWAIEBU.js → chunk-HCGEFU3J.js} +8 -7
  12. package/dist/{chunk-XA2FQJTN.js → chunk-HSLQXL6M.js} +6 -5
  13. package/dist/{chunk-W7YOTDVO.js → chunk-IFPN6TER.js} +47 -2
  14. package/dist/chunk-MFF2RE3I.js +168 -0
  15. package/dist/{chunk-KBKPVKYZ.js → chunk-P33ZQ7ZC.js} +3 -3
  16. package/dist/{chunk-DG3S2UXP.js → chunk-PW5YHHP3.js} +2 -2
  17. package/dist/chunk-RV6DBEDQ.js +170 -0
  18. package/dist/{chunk-5KJMNNCB.js → chunk-SHCR6RPU.js} +3 -3
  19. package/dist/{chunk-PTJJIQK7.js → chunk-XKNBSYA7.js} +47 -2
  20. package/dist/{chunk-MF2YMEGD.js → chunk-YVVXWWCC.js} +110 -3
  21. package/dist/{coordinator-prompt-3XXSG7M2.js → coordinator-prompt-2OVON2LQ.js} +4 -4
  22. package/dist/{coordinator-prompt-RTUCCPCI.js → coordinator-prompt-K2R34A5T.js} +3 -3
  23. package/dist/{global-workspace-PJU6HISJ.js → global-workspace-RI367AM6.js} +4 -4
  24. package/dist/{global-workspace-CSIS62Z4.js → global-workspace-VG44RZUH.js} +5 -5
  25. package/dist/index.cjs +1548 -614
  26. package/dist/index.d.cts +226 -28
  27. package/dist/index.d.ts +226 -28
  28. package/dist/index.js +1277 -575
  29. package/dist/mcp/run-stdio.cjs +3153 -2509
  30. package/dist/mcp/run-stdio.js +690 -262
  31. package/dist/{workspaces-L4TXMUNM.js → workspaces-BQWQEZWE.js} +5 -5
  32. package/dist/{workspaces-W72KZL4B.js → workspaces-TYPJNUSM.js} +6 -6
  33. package/dist/{worktree-VOCH3WS3.js → worktree-5VLLFI5W.js} +5 -1
  34. package/dist/{worktree-KWXHMKRN.js → worktree-UNSOCYZU.js} +5 -1
  35. package/package.json +1 -1
  36. package/dist/caffeinate-hold-BEJIYPJ7.js +0 -107
  37. package/dist/chunk-JAWEDVVA.js +0 -106
@@ -1,6 +1,10 @@
1
1
  import {
2
2
  isWorkspaceScratchPath
3
3
  } from "./chunk-FKOIHGKV.js";
4
+ import {
5
+ getGithubGitAuthMode,
6
+ getGithubPat
7
+ } from "./chunk-IFPN6TER.js";
4
8
  import {
5
9
  listThreads
6
10
  } from "./chunk-FWJYLBO6.js";
@@ -886,6 +890,74 @@ function formatIpcInvokeError(err) {
886
890
  return formatGhLandError(msg);
887
891
  }
888
892
 
893
+ // src/git/git-auth-mode.ts
894
+ var HTTPS_REWRITE = [
895
+ { key: "url.https://github.com/.insteadOf", value: "git@github.com:" },
896
+ { key: "url.https://github.com/.insteadOf", value: "ssh://git@github.com/" },
897
+ { key: "credential.https://github.com.helper", value: "!gh auth git-credential" }
898
+ ];
899
+ function appendIndexedGitConfig(existing, entries) {
900
+ const start = Number.parseInt(String(existing?.GIT_CONFIG_COUNT ?? "0"), 10);
901
+ const count = Number.isFinite(start) && start > 0 ? start : 0;
902
+ const out = {};
903
+ entries.forEach((entry, i) => {
904
+ const n = count + i;
905
+ out[`GIT_CONFIG_KEY_${n}`] = entry.key;
906
+ out[`GIT_CONFIG_VALUE_${n}`] = entry.value;
907
+ });
908
+ out.GIT_CONFIG_COUNT = String(count + entries.length);
909
+ return out;
910
+ }
911
+ function githubAgentGitEnv(existing) {
912
+ return appendIndexedGitConfig(existing, HTTPS_REWRITE);
913
+ }
914
+ function applyGithubGitAuthEnv(existing, opts) {
915
+ const out = {};
916
+ if (opts.mode === "gh" || opts.mode === "token") {
917
+ Object.assign(out, githubAgentGitEnv(existing));
918
+ }
919
+ if (opts.mode === "token") {
920
+ const token = opts.token?.trim();
921
+ if (token && !existing?.GH_TOKEN?.trim()) {
922
+ out.GH_TOKEN = token;
923
+ }
924
+ }
925
+ return out;
926
+ }
927
+ function formatGitAuthModeDirective(mode) {
928
+ switch (mode) {
929
+ case "gh":
930
+ return [
931
+ "Git authentication (Account \u2192 GitHub mode: gh CLI):",
932
+ "- This process rewrites `git@github.com:` and `ssh://git@github.com/` to HTTPS.",
933
+ "- `gh` supplies credentials (`gh auth git-credential`). Do not switch remotes to SSH.",
934
+ "- Push with `git push -u origin HEAD`. Create/update PRs with `gh` as below."
935
+ ].join("\n");
936
+ case "ssh":
937
+ return [
938
+ "Git authentication (Account \u2192 GitHub mode: SSH):",
939
+ "- Keep SSH remotes (`git@github.com:\u2026`). Do not rewrite them to HTTPS.",
940
+ "- 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.",
941
+ "- Push with `git push -u origin HEAD`. Create/update PRs with `gh` as below (API still uses `gh`)."
942
+ ].join("\n");
943
+ case "token":
944
+ return [
945
+ "Git authentication (Account \u2192 GitHub mode: personal access token):",
946
+ "- This process rewrites GitHub SSH remotes to HTTPS.",
947
+ "- `GH_TOKEN` is set in the environment. Use HTTPS git and `gh`; do not paste the token into commands or chat.",
948
+ "- Push with `git push -u origin HEAD`. Create/update PRs with `gh` as below."
949
+ ].join("\n");
950
+ case "auto":
951
+ default:
952
+ return [
953
+ "Git authentication (Account \u2192 GitHub mode: auto):",
954
+ "- Prefer the existing remote URL (SSH or HTTPS). Do not rewrite remotes unless a push/fetch fails.",
955
+ '- 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`.',
956
+ "- Then create/update the PR with `gh` as below."
957
+ ].join("\n");
958
+ }
959
+ }
960
+
889
961
  // src/git/pr-gates.ts
890
962
  function prIsInMergeQueue(gate) {
891
963
  if (gate.isInMergeQueue) return true;
@@ -1286,10 +1358,15 @@ ${view.stderr}`;
1286
1358
  timeoutMs: 15e3
1287
1359
  });
1288
1360
  }
1289
- async function originGhRepoEnv(cwd) {
1361
+ async function originGhRepoEnv(cwd, opts) {
1290
1362
  await ensureGhPreferOrigin(cwd);
1291
1363
  const slug = await resolveGithubRepoSlug(cwd);
1292
- return slug ? { GH_REPO: slug } : {};
1364
+ const mode = opts?.mode ?? getGithubGitAuthMode();
1365
+ const token = mode === "token" ? getGithubPat() : null;
1366
+ return {
1367
+ ...applyGithubGitAuthEnv(opts?.env, { mode, token }),
1368
+ ...slug ? { GH_REPO: slug } : {}
1369
+ };
1293
1370
  }
1294
1371
  async function resolveDefaultBranch(repoPath, opts) {
1295
1372
  const viaOrigin = await git(
@@ -2038,7 +2115,33 @@ async function commitAll(worktreePath, message) {
2038
2115
  return true;
2039
2116
  }
2040
2117
  async function pushBranch(worktreePath, branchName) {
2041
- await git(["push", "-u", "origin", branchName], worktreePath);
2118
+ const ssh = await git(["push", "-u", "origin", branchName], worktreePath, {
2119
+ reject: false
2120
+ });
2121
+ if (ssh.exitCode === 0) return;
2122
+ const sshErr = (ssh.stderr || ssh.stdout).trim();
2123
+ const slug = await resolveGithubRepoSlug(worktreePath);
2124
+ const token = await resolveGhAuthToken(worktreePath);
2125
+ if (!slug || !token) {
2126
+ throw new Error(
2127
+ sshErr || `git push origin ${branchName} failed` + (!token ? " (no SSH agent and gh auth token unavailable \u2014 run: gh auth login)" : "")
2128
+ );
2129
+ }
2130
+ const tryHttps = async (header) => git(["push", "-u", "origin", branchName], worktreePath, {
2131
+ reject: false,
2132
+ env: { GIT_TERMINAL_PROMPT: "0" },
2133
+ config: {
2134
+ "url.https://github.com/.insteadOf": "git@github.com:",
2135
+ "http.extraHeader": header
2136
+ }
2137
+ });
2138
+ const bearer = await tryHttps(`AUTHORIZATION: bearer ${token}`);
2139
+ if (bearer.exitCode === 0) return;
2140
+ const basic = Buffer.from(`x-access-token:${token}`, "utf8").toString("base64");
2141
+ const basicPush = await tryHttps(`Authorization: Basic ${basic}`);
2142
+ if (basicPush.exitCode === 0) return;
2143
+ const httpsErr = (basicPush.stderr || bearer.stderr || bearer.stdout).trim();
2144
+ throw new Error(httpsErr || sshErr || `git push origin ${branchName} failed`);
2042
2145
  }
2043
2146
  async function mergePr(cwd, selector, opts) {
2044
2147
  const slug = await resolveGithubRepoSlug(cwd);
@@ -2251,6 +2354,10 @@ export {
2251
2354
  extractGhErrorDetail,
2252
2355
  formatGhLandError,
2253
2356
  formatIpcInvokeError,
2357
+ appendIndexedGitConfig,
2358
+ githubAgentGitEnv,
2359
+ applyGithubGitAuthEnv,
2360
+ formatGitAuthModeDirective,
2254
2361
  detectGhStack,
2255
2362
  resetGhStackDetectCache,
2256
2363
  parseGhStackViewJson,
@@ -7,11 +7,11 @@ import {
7
7
  enrichWorkspacesWithGithub,
8
8
  ensureGlobalCoordinatorCwd,
9
9
  formatWorkspaceInventory
10
- } from "./chunk-HCWAIEBU.js";
11
- import "./chunk-W7YOTDVO.js";
12
- import "./chunk-JT7R45JB.js";
13
- import "./chunk-MF2YMEGD.js";
10
+ } from "./chunk-HCGEFU3J.js";
11
+ import "./chunk-YVVXWWCC.js";
14
12
  import "./chunk-FKOIHGKV.js";
13
+ import "./chunk-IFPN6TER.js";
14
+ import "./chunk-JT7R45JB.js";
15
15
  import "./chunk-FWJYLBO6.js";
16
16
  import "./chunk-77WWLBCI.js";
17
17
  import "./chunk-M37RITA6.js";
@@ -9,12 +9,12 @@ import {
9
9
  enrichWorkspacesWithGithub,
10
10
  ensureGlobalCoordinatorCwd,
11
11
  formatWorkspaceInventory
12
- } from "./chunk-XA2FQJTN.js";
13
- import "./chunk-OE7YBB5X.js";
12
+ } from "./chunk-HSLQXL6M.js";
13
+ import "./chunk-FUUVPN4A.js";
14
14
  import "./chunk-B3SJXYIJ.js";
15
15
  import "./chunk-7FD7COKE.js";
16
16
  import "./chunk-AE5VBOFE.js";
17
- import "./chunk-PTJJIQK7.js";
17
+ import "./chunk-XKNBSYA7.js";
18
18
  import "./chunk-NSTQ6QKD.js";
19
19
  import "./chunk-KGZBYWZ3.js";
20
20
  import "./chunk-7MV3RXSC.js";
@@ -16,13 +16,13 @@ import {
16
16
  orchestratorSessionPoisonedByBuiltins,
17
17
  slackCoordinatorSourceRef,
18
18
  takenTeamSlugsForOrchestration
19
- } from "./chunk-2NKSHIRI.js";
20
- import "./chunk-XA2FQJTN.js";
21
- import "./chunk-OE7YBB5X.js";
19
+ } from "./chunk-6T2SKGCS.js";
20
+ import "./chunk-HSLQXL6M.js";
21
+ import "./chunk-FUUVPN4A.js";
22
22
  import "./chunk-B3SJXYIJ.js";
23
23
  import "./chunk-7FD7COKE.js";
24
24
  import "./chunk-AE5VBOFE.js";
25
- import "./chunk-PTJJIQK7.js";
25
+ import "./chunk-XKNBSYA7.js";
26
26
  import "./chunk-NSTQ6QKD.js";
27
27
  import "./chunk-KGZBYWZ3.js";
28
28
  import {
@@ -14,12 +14,12 @@ import {
14
14
  orchestratorSessionPoisonedByBuiltins,
15
15
  slackCoordinatorSourceRef,
16
16
  takenTeamSlugsForOrchestration
17
- } from "./chunk-77W62MTX.js";
18
- import "./chunk-HCWAIEBU.js";
19
- import "./chunk-W7YOTDVO.js";
20
- import "./chunk-JT7R45JB.js";
21
- import "./chunk-MF2YMEGD.js";
17
+ } from "./chunk-5LXWTU3J.js";
18
+ import "./chunk-HCGEFU3J.js";
19
+ import "./chunk-YVVXWWCC.js";
22
20
  import "./chunk-FKOIHGKV.js";
21
+ import "./chunk-IFPN6TER.js";
22
+ import "./chunk-JT7R45JB.js";
23
23
  import "./chunk-FWJYLBO6.js";
24
24
  import "./chunk-77WWLBCI.js";
25
25
  import {