longtable 0.1.40 → 0.1.42
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 +1 -1
- package/src/repo.mjs +17 -8
- package/src/run.mjs +7 -1
package/package.json
CHANGED
package/src/repo.mjs
CHANGED
|
@@ -259,8 +259,7 @@ export function openWork(tableId, branch, name = "work", { refresh = false } = {
|
|
|
259
259
|
const common = git(["--git-dir", p.G, "merge-base", main, base]);
|
|
260
260
|
if (common !== main) {
|
|
261
261
|
const both = git(["--git-dir", p.G, "merge-tree", "--write-tree", `--merge-base=${common}`, base, main]).split(/\r?\n/)[0];
|
|
262
|
-
base = git(["--git-dir", p.G, "commit-tree", both, "-p", base, "-p", main, "-m", "Take in the team's latest"],
|
|
263
|
-
{ ...quiet, GIT_AUTHOR_NAME: "Longtable", GIT_AUTHOR_EMAIL: "longtable@users.noreply.github.com", GIT_COMMITTER_NAME: "Longtable", GIT_COMMITTER_EMAIL: "longtable@users.noreply.github.com" });
|
|
262
|
+
base = git(["--git-dir", p.G, "commit-tree", both, "-p", base, "-p", main, "-m", "Take in the team's latest"], signer(p.G));
|
|
264
263
|
}
|
|
265
264
|
} catch {
|
|
266
265
|
stale = true;
|
|
@@ -307,8 +306,7 @@ export function openBranch(tableId, branch, fresh = false) {
|
|
|
307
306
|
if (!fresh) return tip;
|
|
308
307
|
const clean = git(["--git-dir", G, "rev-parse", "HEAD^{tree}"]);
|
|
309
308
|
if (git(["--git-dir", G, "rev-parse", `${tip}^{tree}`]) === clean) return tip;
|
|
310
|
-
const
|
|
311
|
-
const again = git(["--git-dir", G, "commit-tree", clean, "-p", tip, "-m", "A clean copy"], as);
|
|
309
|
+
const again = git(["--git-dir", G, "commit-tree", clean, "-p", tip, "-m", "A clean copy"], signer(G));
|
|
312
310
|
git(["--git-dir", G, "push", "--quiet", "origin", `${again}:refs/heads/${branch}`]);
|
|
313
311
|
return again;
|
|
314
312
|
} catch (e) {
|
|
@@ -316,8 +314,7 @@ export function openBranch(tableId, branch, fresh = false) {
|
|
|
316
314
|
}
|
|
317
315
|
const head = git(["--git-dir", G, "rev-parse", "HEAD"]);
|
|
318
316
|
const tree = git(["--git-dir", G, "rev-parse", `${head}^{tree}`]);
|
|
319
|
-
const
|
|
320
|
-
const commit = git(["--git-dir", G, "commit-tree", tree, "-p", head, "-m", "A copy of its own"], who);
|
|
317
|
+
const commit = git(["--git-dir", G, "commit-tree", tree, "-p", head, "-m", "A copy of its own"], signer(G));
|
|
321
318
|
git(["--git-dir", G, "push", "--quiet", "origin", `${commit}:refs/heads/${branch}`]);
|
|
322
319
|
return commit;
|
|
323
320
|
}
|
|
@@ -335,6 +332,18 @@ export function layTree(tableId, commit, name = "check") {
|
|
|
335
332
|
|
|
336
333
|
const LONGTABLE = { ...quiet, GIT_AUTHOR_NAME: "Longtable", GIT_AUTHOR_EMAIL: "longtable@users.noreply.github.com", GIT_COMMITTER_NAME: "Longtable", GIT_COMMITTER_EMAIL: "longtable@users.noreply.github.com" };
|
|
337
334
|
|
|
335
|
+
// Who a copy's own commits (its start, a clean copy, catching up, a take-back) are signed by: the person whose
|
|
336
|
+
// computer makes them, as git already knows them, the same way landWork signs a change. Vercel's free plan refuses
|
|
337
|
+
// to build a private repository's commit whose author is not the account's own, so a copy signed "Longtable" was
|
|
338
|
+
// never put up (found on SAMS's preview, 26 Oct 2026). "Longtable" only when this computer has no git identity.
|
|
339
|
+
function signer(G) {
|
|
340
|
+
let name = "";
|
|
341
|
+
let email = "";
|
|
342
|
+
try { name = git(["--git-dir", G, "config", "user.name"]); email = git(["--git-dir", G, "config", "user.email"]); } catch {}
|
|
343
|
+
if (!name || !email) return LONGTABLE;
|
|
344
|
+
return { ...quiet, GIT_AUTHOR_NAME: name, GIT_AUTHOR_EMAIL: email, GIT_COMMITTER_NAME: name, GIT_COMMITTER_EMAIL: email };
|
|
345
|
+
}
|
|
346
|
+
|
|
338
347
|
// A client's copy brought up to what the team has shipped, their own changes kept on top, and pushed. Nothing moves
|
|
339
348
|
// when it is already current; when the two no longer fit together it stays as it is and says so (stale).
|
|
340
349
|
export function refreshBranch(tableId, branch) {
|
|
@@ -352,7 +361,7 @@ export function refreshBranch(tableId, branch) {
|
|
|
352
361
|
let tree;
|
|
353
362
|
try { tree = git(["--git-dir", G, "merge-tree", "--write-tree", `--merge-base=${common}`, tip, main]).split(/\r?\n/)[0]; }
|
|
354
363
|
catch { return { commit: tip, moved: false, stale: true }; }
|
|
355
|
-
const commit = git(["--git-dir", G, "commit-tree", tree, "-p", tip, "-p", main, "-m", "Take in the team's latest"],
|
|
364
|
+
const commit = git(["--git-dir", G, "commit-tree", tree, "-p", tip, "-p", main, "-m", "Take in the team's latest"], signer(G));
|
|
356
365
|
git(["--git-dir", G, "push", "--quiet", "origin", `${commit}:refs/heads/${branch}`]);
|
|
357
366
|
return { commit, moved: true, stale: false };
|
|
358
367
|
}
|
|
@@ -375,7 +384,7 @@ export function undoCommit(tableId, branch, sha, words = "") {
|
|
|
375
384
|
catch { return null; }
|
|
376
385
|
if (tree === git(["--git-dir", G, "rev-parse", `${tip}^{tree}`])) return tip;
|
|
377
386
|
const said = String(words || "").split(/\r?\n/)[0].slice(0, 60);
|
|
378
|
-
const commit = git(["--git-dir", G, "commit-tree", tree, "-p", tip, "-m", `Take back: ${said || "a change"}`],
|
|
387
|
+
const commit = git(["--git-dir", G, "commit-tree", tree, "-p", tip, "-m", `Take back: ${said || "a change"}`], signer(G));
|
|
379
388
|
git(["--git-dir", G, "push", "--quiet", "origin", `${commit}:refs/heads/${branch}`]);
|
|
380
389
|
return commit;
|
|
381
390
|
}
|
package/src/run.mjs
CHANGED
|
@@ -1089,10 +1089,16 @@ async function work(rpc, seat, engines, raw) {
|
|
|
1089
1089
|
// The table's repository, when the owner set one this computer knows, is where the team's code is read from and
|
|
1090
1090
|
// where branches land, for this job and every kind of work below.
|
|
1091
1091
|
const source = seat.source ? sourceFor(seat, job.repo, job.use_repo) : seat.source;
|
|
1092
|
-
|
|
1092
|
+
const trusted = seat.source ? trustedRepo(seat, job.repo, job.use_repo) : null;
|
|
1093
|
+
heardRepo(seat, job.repo, trusted);
|
|
1093
1094
|
if (source !== seat.source) seat = { ...seat, source };
|
|
1094
1095
|
if (job.kind === "sandbox") {
|
|
1095
1096
|
try {
|
|
1097
|
+
// A copy lands where the team's hosting builds it. One that would only land in a folder on this computer (the
|
|
1098
|
+
// table names a repository this person has not said yes to) is refused, saying what to press.
|
|
1099
|
+
if (job.repo && !trusted && /^file:/i.test(String(seat.source || ""))) {
|
|
1100
|
+
throw new Error(`${job.me}'s Claude has not said yes to the table's repository, so this copy would only land on this computer. In ${job.me}'s AI window, press Use it`);
|
|
1101
|
+
}
|
|
1096
1102
|
await workSandbox(rpc, { ...seat, model: await chosenModel(rpc, seat, job) }, engines, job);
|
|
1097
1103
|
} catch (e) {
|
|
1098
1104
|
log(`sandbox job ${job.job_id} failed: ${e.message}`);
|