spacecode 2.11.1 → 2.12.0
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/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/repl.mjs +7 -1
- package/package.json +1 -1
package/dist/repl.mjs
CHANGED
|
@@ -104426,7 +104426,7 @@ async function runCoreTurn(d, prompt) {
|
|
|
104426
104426
|
const created = await call("POST", "", {
|
|
104427
104427
|
sessionId: d.sessionId,
|
|
104428
104428
|
budgetTokens: d.budgetTokens ?? DEFAULT_BUDGET,
|
|
104429
|
-
...d.repo ? { repoUrl: d.repo.url, ...d.repo.branch ? { branch: d.repo.branch } : {} } : {}
|
|
104429
|
+
...d.repo ? { repoUrl: d.repo.url, ...d.repo.branch ? { branch: d.repo.branch } : {}, ...d.ghToken ? { ghToken: d.ghToken } : {} } : {}
|
|
104430
104430
|
});
|
|
104431
104431
|
runId = created.runId;
|
|
104432
104432
|
d.setRunId(runId);
|
|
@@ -104519,6 +104519,11 @@ async function detectRepo(cwd2, env3) {
|
|
|
104519
104519
|
const branch = env3.SPACECODE_CORE_BRANCH?.trim();
|
|
104520
104520
|
return { url, ...branch ? { branch } : {} };
|
|
104521
104521
|
}
|
|
104522
|
+
function shareableGithubToken(env3) {
|
|
104523
|
+
if (env3.SPACECODE_CORE_SHARE_GITHUB_TOKEN?.trim().toLowerCase() !== "on") return void 0;
|
|
104524
|
+
const t = (env3.GH_TOKEN ?? env3.GITHUB_TOKEN)?.trim();
|
|
104525
|
+
return t ? t : void 0;
|
|
104526
|
+
}
|
|
104522
104527
|
function patchApplier(executor, cwd2, runId) {
|
|
104523
104528
|
return async ({ taskId, patch }) => {
|
|
104524
104529
|
const top = await gitOut(cwd2, ["rev-parse", "--show-toplevel"]) ?? cwd2;
|
|
@@ -104541,6 +104546,7 @@ async function runCoreForRepl(o) {
|
|
|
104541
104546
|
apiKey: o.apiKey,
|
|
104542
104547
|
sessionId: o.sessionId,
|
|
104543
104548
|
repo,
|
|
104549
|
+
...shareableGithubToken(o.env) ? { ghToken: shareableGithubToken(o.env) } : {},
|
|
104544
104550
|
getRunId: () => o.runIdRef.current,
|
|
104545
104551
|
setRunId: (id) => {
|
|
104546
104552
|
o.runIdRef.current = id;
|