@pome-sh/cli 0.23.43 → 0.23.45
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/build-info.json +3 -3
- package/dist/{checks-YI7MUJIE.js → checks-5T2MVAUX.js} +1 -1
- package/dist/{chunk-GHRZRQW5.js → chunk-5Q6D6ORU.js} +2 -2
- package/dist/{chunk-NAQHX4KD.js → chunk-6GS7QNCQ.js} +1 -1
- package/dist/{chunk-LA52VCI4.js → chunk-F3KQCVWU.js} +2 -2
- package/dist/{chunk-NCHH5LIC.js → chunk-VIB6XLX2.js} +1 -1
- package/dist/{chunk-JGZFB6ZZ.js → chunk-XIKQEAWV.js} +1 -1
- package/dist/{runDemo-5P3FBTOI.js → runDemo-L5HORQFT.js} +4 -4
- package/dist/{runTrialGroup-KDVWTFDR.js → runTrialGroup-BC47IPE2.js} +3 -3
- package/dist/src/cli/main.js +12 -12
- package/dist/{src-VKYIOI2P.js → src-OYBYLMMI.js} +57 -68
- package/dist/twinHarness-MRRHZ6WW.js +5 -0
- package/dist/{twinStart-DR3NHOYR.js → twinStart-63756OWJ.js} +2 -2
- package/package.json +1 -1
- package/dist/twinHarness-HQL3WCWU.js +0 -5
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "pome-sh",
|
|
3
|
-
"version": "0.23.
|
|
4
|
-
"git_sha": "
|
|
5
|
-
"build_time": "2026-08-
|
|
3
|
+
"version": "0.23.45",
|
|
4
|
+
"git_sha": "7a8c37c3e89a791bc34e20bb69d127dc2050c304",
|
|
5
|
+
"build_time": "2026-08-13T14:37:28.198Z"
|
|
6
6
|
}
|
|
@@ -183,7 +183,7 @@ async function checkTwinReachable(_configDir) {
|
|
|
183
183
|
});
|
|
184
184
|
let harness;
|
|
185
185
|
try {
|
|
186
|
-
const { bootTwin } = await import('./twinHarness-
|
|
186
|
+
const { bootTwin } = await import('./twinHarness-MRRHZ6WW.js');
|
|
187
187
|
harness = await bootTwin({
|
|
188
188
|
twin: "github",
|
|
189
189
|
seedState: void 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAvailablePort } from './chunk-XDU6TD4O.js';
|
|
2
2
|
import { buildEgressAllowlist, readBlockedEgress } from './chunk-CBFKZZBR.js';
|
|
3
|
-
import { parseTaskFile, seedStateForTwin, runAgentCommand, writeRunArtifactsCore } from './chunk-
|
|
4
|
-
import { createRecorder, bootTwin } from './chunk-
|
|
3
|
+
import { parseTaskFile, seedStateForTwin, runAgentCommand, writeRunArtifactsCore } from './chunk-6GS7QNCQ.js';
|
|
4
|
+
import { createRecorder, bootTwin } from './chunk-XIKQEAWV.js';
|
|
5
5
|
import { eventSchema } from './chunk-VBATFCWR.js';
|
|
6
6
|
import { redactSecrets, redactEvent } from './chunk-SG6ZTIMT.js';
|
|
7
7
|
import { serve } from '@hono/node-server';
|
|
@@ -2,7 +2,7 @@ import { criterionSchema, finalizeResponseSchema, HostedDiscardRefusedError, Hos
|
|
|
2
2
|
import { seedSchema, parseSeed, defaultSeedState as defaultSeedState$2 } from './chunk-B22TYIEM.js';
|
|
3
3
|
import { gmailSeedSchema, defaultSeedState } from './chunk-NJ246QPJ.js';
|
|
4
4
|
import { linearSeedSchema, defaultSeedState as defaultSeedState$1 } from './chunk-ZKID2HS3.js';
|
|
5
|
-
import { isTwinName, TWIN_REGISTRY } from './chunk-
|
|
5
|
+
import { isTwinName, TWIN_REGISTRY } from './chunk-F3KQCVWU.js';
|
|
6
6
|
import { toTwinHttpEventRow } from './chunk-OW7VVW6X.js';
|
|
7
7
|
import { redactEvent, redactSecrets } from './chunk-SG6ZTIMT.js';
|
|
8
8
|
import { mkdir, appendFile, writeFile, readFile } from 'node:fs/promises';
|
|
@@ -39,7 +39,7 @@ var TWIN_REGISTRY = {
|
|
|
39
39
|
defaultSeedState,
|
|
40
40
|
GitHubDomain,
|
|
41
41
|
openGitHubCloneDatabase
|
|
42
|
-
} = await import('./src-
|
|
42
|
+
} = await import('./src-OYBYLMMI.js');
|
|
43
43
|
const db = openGitHubCloneDatabase();
|
|
44
44
|
const domain = new GitHubDomain(db);
|
|
45
45
|
domain.seed(seedState === void 0 ? defaultSeedState() : seedState);
|
|
@@ -173,7 +173,7 @@ var TWIN_REGISTRY = {
|
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
async function createGitHubSmokeApp() {
|
|
176
|
-
const { createGitHubCloneApp } = await import('./src-
|
|
176
|
+
const { createGitHubCloneApp } = await import('./src-OYBYLMMI.js');
|
|
177
177
|
return createGitHubCloneApp();
|
|
178
178
|
}
|
|
179
179
|
function defaultPortFor(twin, env = process.env) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readManifest, normalizeManifestTwins } from './chunk-ABM3CMQB.js';
|
|
2
|
-
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, evaluationCounts } from './chunk-
|
|
2
|
+
import { createHostedClient, perTwinReturnedByCloud, parseTaskFile, runAgentCommand, writeRunArtifactsCore, toTwinHttpEvent, redactJsonl, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, evaluationCounts } from './chunk-6GS7QNCQ.js';
|
|
3
3
|
import { MOUNTED_TWINS, HostedAuthError, HostedDiscardRefusedError, HostedQuotaError, HostedOrchError, HostedTrialError, agentResponseSchema } from './chunk-X66JOOO7.js';
|
|
4
4
|
import { redactSecrets, redactEvent } from './chunk-SG6ZTIMT.js';
|
|
5
5
|
import { randomUUID, createHash } from 'node:crypto';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-
|
|
1
|
+
import { TWIN_NAMES, isTwinName, TWIN_REGISTRY } from './chunk-F3KQCVWU.js';
|
|
2
2
|
import { createFileBackedRecorderStore, createRecorderStore } from './chunk-OW7VVW6X.js';
|
|
3
3
|
|
|
4
4
|
// src/recorder/recorder.ts
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { newGroupId, reassuranceBox, twinReadyLine, trialsHeaderLine, trialLine, summaryLines, evaluatingLine, criterionPhrase } from './chunk-RGZBC7NF.js';
|
|
2
2
|
import { DemoCapacityError, capacityLabel, parseCapacityMarker, capacityKindFrom } from './chunk-ZX4WNSZ5.js';
|
|
3
|
-
import { runTask, demoTaskPath, DEMO_TASK_NAME, DEMO_REPO } from './chunk-
|
|
3
|
+
import { runTask, demoTaskPath, DEMO_TASK_NAME, DEMO_REPO } from './chunk-5Q6D6ORU.js';
|
|
4
4
|
import { getAvailablePort } from './chunk-XDU6TD4O.js';
|
|
5
5
|
import './chunk-CBFKZZBR.js';
|
|
6
|
-
import { createHostedClient, parseTaskFile, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, outcomeOf } from './chunk-
|
|
6
|
+
import { createHostedClient, parseTaskFile, uploadRunBlobs, scoreFromFinalizeResponse, scoreStatus, outcomeOf } from './chunk-6GS7QNCQ.js';
|
|
7
7
|
import './chunk-NW7HGA2K.js';
|
|
8
8
|
import { HostedQuotaError, HostedOrchError } from './chunk-X66JOOO7.js';
|
|
9
9
|
import './chunk-B22TYIEM.js';
|
|
10
10
|
import './chunk-NJ246QPJ.js';
|
|
11
11
|
import './chunk-ZKID2HS3.js';
|
|
12
|
-
import { bootTwin } from './chunk-
|
|
13
|
-
import './chunk-
|
|
12
|
+
import { bootTwin } from './chunk-XIKQEAWV.js';
|
|
13
|
+
import './chunk-F3KQCVWU.js';
|
|
14
14
|
import './chunk-OW7VVW6X.js';
|
|
15
15
|
import './chunk-VBATFCWR.js';
|
|
16
16
|
import './chunk-SG6ZTIMT.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { newGroupId, criterionPhrase } from './chunk-RGZBC7NF.js';
|
|
2
|
-
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-
|
|
2
|
+
import { runTaskHosted, resolveRunAgentIdentity } from './chunk-VIB6XLX2.js';
|
|
3
3
|
import './chunk-ABM3CMQB.js';
|
|
4
|
-
import { createHostedClient, parseTaskFile, outcomeOf } from './chunk-
|
|
4
|
+
import { createHostedClient, parseTaskFile, outcomeOf } from './chunk-6GS7QNCQ.js';
|
|
5
5
|
import './chunk-NW7HGA2K.js';
|
|
6
6
|
import { HostedQuotaError, HostedTrialError } from './chunk-X66JOOO7.js';
|
|
7
7
|
import './chunk-B22TYIEM.js';
|
|
8
8
|
import './chunk-NJ246QPJ.js';
|
|
9
9
|
import './chunk-ZKID2HS3.js';
|
|
10
|
-
import './chunk-
|
|
10
|
+
import './chunk-F3KQCVWU.js';
|
|
11
11
|
import './chunk-OW7VVW6X.js';
|
|
12
12
|
import './chunk-VBATFCWR.js';
|
|
13
13
|
import './chunk-SG6ZTIMT.js';
|
package/dist/src/cli/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, runTaskHosted, discoverRunSet, VERDICT_ARTIFACT_VERSION, persistCredentialsAfterLogin, DEFAULT_DOCS_SITE_ORIGIN, resolveSeams, resolveCachedAgentId, readLinkCache, postAgentResolver, writeLinkCache, ensurePomeGitignored } from '../../chunk-
|
|
2
|
+
import { DEFAULT_CONTROL_PLANE_URL, DEFAULT_DASHBOARD_URL, clearLocalCredentials, friendlyHostedError, runSessionCreate, runSessionList, runSessionStop, resolveCredentials, runTaskHosted, discoverRunSet, VERDICT_ARTIFACT_VERSION, persistCredentialsAfterLogin, DEFAULT_DOCS_SITE_ORIGIN, resolveSeams, resolveCachedAgentId, readLinkCache, postAgentResolver, writeLinkCache, ensurePomeGitignored } from '../../chunk-VIB6XLX2.js';
|
|
3
3
|
import { readManifest, writeManifest, MANIFEST_JSON, readRequiredManifest, normalizeManifestTwins } from '../../chunk-ABM3CMQB.js';
|
|
4
|
-
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } from '../../chunk-
|
|
4
|
+
import { assetPath, runTask, resolvePackageRoot, DEMO_TASK_NAME, demoTaskPath } from '../../chunk-5Q6D6ORU.js';
|
|
5
5
|
import '../../chunk-XDU6TD4O.js';
|
|
6
6
|
import '../../chunk-CBFKZZBR.js';
|
|
7
|
-
import { parseTaskFile, scoreStatus, runScoreLine, readLatestRun, readMetaSummary, outcomeOf, readConfigTwins, scoreCountsSummary, markerFor, criterionMarkerLabel, twinSkipSuffix, readCodeCriteria, createHostedClient, toTwinHttpEvent, redactJsonl, scoreFromFinalizeResponse, parseGitHubSeedState, uploadRunBlobs, isPreSatisfied } from '../../chunk-
|
|
7
|
+
import { parseTaskFile, scoreStatus, runScoreLine, readLatestRun, readMetaSummary, outcomeOf, readConfigTwins, scoreCountsSummary, markerFor, criterionMarkerLabel, twinSkipSuffix, readCodeCriteria, createHostedClient, toTwinHttpEvent, redactJsonl, scoreFromFinalizeResponse, parseGitHubSeedState, uploadRunBlobs, isPreSatisfied } from '../../chunk-6GS7QNCQ.js';
|
|
8
8
|
import '../../chunk-NW7HGA2K.js';
|
|
9
9
|
import { MOUNTED_TWINS, deriveAgentSlug, exitCodeFor, HostedUsageError, HostedOrchError, HostedAuthError, HostedQuotaError } from '../../chunk-X66JOOO7.js';
|
|
10
10
|
import { TAPE_ASSERTABLE_TOOLS } from '../../chunk-FKZZWWYC.js';
|
|
@@ -15,8 +15,8 @@ import '../../chunk-NJ246QPJ.js';
|
|
|
15
15
|
import { LINEAR_CHECKS } from '../../chunk-XBT6ZLBG.js';
|
|
16
16
|
import '../../chunk-ZKID2HS3.js';
|
|
17
17
|
import { oneOf, defineCheck, repoRef, VACUITY_SENTINEL_NUMBER, childStatePath, VACUITY_SENTINEL, statePath, templateSlots, renderCheck, checksDigest, checkPattern, checkNearMissPattern } from '../../chunk-JWJYNAWI.js';
|
|
18
|
-
import '../../chunk-
|
|
19
|
-
import { TWIN_NAME_LIST, isTwinName, createGitHubSmokeApp } from '../../chunk-
|
|
18
|
+
import '../../chunk-XIKQEAWV.js';
|
|
19
|
+
import { TWIN_NAME_LIST, isTwinName, createGitHubSmokeApp } from '../../chunk-F3KQCVWU.js';
|
|
20
20
|
import '../../chunk-OW7VVW6X.js';
|
|
21
21
|
import { isLegacyEventRow, eventSchema } from '../../chunk-VBATFCWR.js';
|
|
22
22
|
import { redactEvent, redactSecrets } from '../../chunk-SG6ZTIMT.js';
|
|
@@ -850,7 +850,7 @@ async function throwForStatus(res) {
|
|
|
850
850
|
|
|
851
851
|
// src/task/seed-verifier.ts
|
|
852
852
|
async function verifySeedWithTwin(seed) {
|
|
853
|
-
const { GitHubDomain, openGitHubCloneDatabase } = await import('../../src-
|
|
853
|
+
const { GitHubDomain, openGitHubCloneDatabase } = await import('../../src-OYBYLMMI.js');
|
|
854
854
|
const db = openGitHubCloneDatabase(":memory:");
|
|
855
855
|
try {
|
|
856
856
|
new GitHubDomain(db).seed(seed);
|
|
@@ -4580,7 +4580,7 @@ var DEFAULT_AGENT_COMMAND = `node ${DEFAULT_AGENT_FILE}`;
|
|
|
4580
4580
|
var MANIFEST_SCHEMA_URL = "https://pome.sh/schemas/v1/pome.json";
|
|
4581
4581
|
var MAX_UNREADABLE_PATHS_SHOWN = 5;
|
|
4582
4582
|
function readPackageVersion() {
|
|
4583
|
-
if ("0.23.
|
|
4583
|
+
if ("0.23.45".length > 0) return "0.23.45";
|
|
4584
4584
|
try {
|
|
4585
4585
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
4586
4586
|
const candidates = [
|
|
@@ -5035,7 +5035,7 @@ function createProgram() {
|
|
|
5035
5035
|
return;
|
|
5036
5036
|
}
|
|
5037
5037
|
{
|
|
5038
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
5038
|
+
const { runDoctorChecks } = await import('../../checks-5T2MVAUX.js');
|
|
5039
5039
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
5040
5040
|
const doctorReport = await runDoctorChecks({ mode: useLocal ? "full" : "hosted" });
|
|
5041
5041
|
if (!doctorReport.ok) {
|
|
@@ -5073,7 +5073,7 @@ function createProgram() {
|
|
|
5073
5073
|
taskForRuns.config.runs
|
|
5074
5074
|
);
|
|
5075
5075
|
if (k > 1) {
|
|
5076
|
-
const { runTrialGroup } = await import('../../runTrialGroup-
|
|
5076
|
+
const { runTrialGroup } = await import('../../runTrialGroup-BC47IPE2.js');
|
|
5077
5077
|
const fileForRerun = relative(process.cwd(), file);
|
|
5078
5078
|
const rerunCommand = defaultTask ? options.trials !== void 0 ? `pome run -n ${k}` : "pome run" : `pome run ${fileForRerun && !fileForRerun.startsWith("..") ? fileForRerun : file} -n ${k}`;
|
|
5079
5079
|
const groupResult = await runTrialGroup({
|
|
@@ -5167,7 +5167,7 @@ function createProgram() {
|
|
|
5167
5167
|
process.exitCode = 5;
|
|
5168
5168
|
return;
|
|
5169
5169
|
}
|
|
5170
|
-
const { runDemo } = await import('../../runDemo-
|
|
5170
|
+
const { runDemo } = await import('../../runDemo-L5HORQFT.js');
|
|
5171
5171
|
const result = await runDemo({
|
|
5172
5172
|
apiBase: opts.apiUrl.replace(/\/$/, ""),
|
|
5173
5173
|
dashboardBase: process.env.POME_DASHBOARD_URL ?? DEFAULT_DASHBOARD_URL,
|
|
@@ -5185,7 +5185,7 @@ function createProgram() {
|
|
|
5185
5185
|
program.command("doctor").description(
|
|
5186
5186
|
"Check the agent\u2194twin wiring: pome.json (or pome.yaml) present + valid, the local twin boots + serves, requests routed to the twin (not a hardcoded production host), egress floor active. On failure prints one named cause (file:line where knowable) + one concrete fix and exits non-zero."
|
|
5187
5187
|
).action(async () => {
|
|
5188
|
-
const { runDoctorChecks } = await import('../../checks-
|
|
5188
|
+
const { runDoctorChecks } = await import('../../checks-5T2MVAUX.js');
|
|
5189
5189
|
const { renderDoctorReport } = await import('../../render-ZQQ4UMNO.js');
|
|
5190
5190
|
const report = await runDoctorChecks();
|
|
5191
5191
|
for (const line of renderDoctorReport(report, { passNote: true })) console.error(line);
|
|
@@ -5361,7 +5361,7 @@ function createProgram() {
|
|
|
5361
5361
|
).description(
|
|
5362
5362
|
"Start a standalone twin as a long-lived foreground server (Ctrl-C to stop)"
|
|
5363
5363
|
).action(async (name, options) => {
|
|
5364
|
-
const { runTwinStartCommand } = await import('../../twinStart-
|
|
5364
|
+
const { runTwinStartCommand } = await import('../../twinStart-63756OWJ.js');
|
|
5365
5365
|
await runTwinStartCommand(name, options);
|
|
5366
5366
|
});
|
|
5367
5367
|
twin.command("reset").argument("[name]", "Twin name (default: github)", "github").description("Reset standalone twin state").action(async (name) => {
|
|
@@ -2502,6 +2502,39 @@ function detectRenames(removed, added) {
|
|
|
2502
2502
|
}
|
|
2503
2503
|
return renames;
|
|
2504
2504
|
}
|
|
2505
|
+
function diffFileRows(repoId, base, head, urls) {
|
|
2506
|
+
const paths = [.../* @__PURE__ */ new Set([...base.keys(), ...head.keys()])].sort();
|
|
2507
|
+
const renames = detectRenames(paths.filter((path) => base.has(path) && !head.has(path)).map((path) => ({ path, sha: base.get(path).sha })), paths.filter((path) => head.has(path) && !base.has(path)).map((path) => ({ path, sha: head.get(path).sha })));
|
|
2508
|
+
const movedFrom = new Set(renames.values());
|
|
2509
|
+
const rows = [];
|
|
2510
|
+
for (const path of paths) {
|
|
2511
|
+
const before = base.get(path);
|
|
2512
|
+
const after = head.get(path);
|
|
2513
|
+
if (before?.sha === after?.sha)
|
|
2514
|
+
continue;
|
|
2515
|
+
if (movedFrom.has(path))
|
|
2516
|
+
continue;
|
|
2517
|
+
const previousFilename = renames.get(path) ?? null;
|
|
2518
|
+
const diff = linesChanged(before?.content, after?.content ?? "");
|
|
2519
|
+
rows.push({
|
|
2520
|
+
repo_id: repoId,
|
|
2521
|
+
pull_number: 0,
|
|
2522
|
+
filename: path,
|
|
2523
|
+
status: previousFilename ? "renamed" : before && after ? "modified" : after ? "added" : "removed",
|
|
2524
|
+
// A detected move is an EXACT one (identical blobs), so it touches no
|
|
2525
|
+
// lines — which is what GitHub reports for it. `linesChanged` would call
|
|
2526
|
+
// the whole file an addition, because from its path-by-path view the
|
|
2527
|
+
// destination is a file that did not exist.
|
|
2528
|
+
additions: previousFilename ? 0 : diff.additions,
|
|
2529
|
+
deletions: previousFilename ? 0 : after ? diff.deletions : before?.content.split("\n").length ?? 0,
|
|
2530
|
+
changes: previousFilename ? 0 : diff.additions + diff.deletions,
|
|
2531
|
+
...urls(path),
|
|
2532
|
+
patch: `@@ ${path} @@`,
|
|
2533
|
+
previous_filename: previousFilename
|
|
2534
|
+
});
|
|
2535
|
+
}
|
|
2536
|
+
return rows;
|
|
2537
|
+
}
|
|
2505
2538
|
function linesChanged(before, after) {
|
|
2506
2539
|
if (before === void 0) {
|
|
2507
2540
|
return { additions: after.split("\n").filter(Boolean).length || 1, deletions: 0 };
|
|
@@ -4875,44 +4908,25 @@ var GitHubDomain = class {
|
|
|
4875
4908
|
raw_url: `https://raw.githubusercontent.com/${repo.full_name}/${commit.sha}/${version.path}`,
|
|
4876
4909
|
contents_url: `https://api.github.com/repos/${repo.full_name}/contents/${version.path}?ref=${commit.sha}`,
|
|
4877
4910
|
patch: `@@ ${version.path} @@`,
|
|
4878
|
-
// F-
|
|
4879
|
-
//
|
|
4880
|
-
//
|
|
4881
|
-
//
|
|
4882
|
-
//
|
|
4883
|
-
//
|
|
4911
|
+
// F-1513 moved the COMPARE surface onto the shared `diffFileRows`; this
|
|
4912
|
+
// one is still outside it, and for a reason that is not scope. A single
|
|
4913
|
+
// commit's change set is read straight out of `file_versions`, whose
|
|
4914
|
+
// `status` column has no `renamed` member, so there is no pair of trees
|
|
4915
|
+
// here to detect a move BETWEEN — the row loop below sees one version
|
|
4916
|
+
// row at a time. Pairing them would mean re-deriving the commit's parent
|
|
4917
|
+
// tree, which is a different derivation from the one this fixes, on a
|
|
4918
|
+
// route no capture has measured a move on. It reports an add and a
|
|
4919
|
+
// remove and carries no pre-rename path.
|
|
4884
4920
|
previous_filename: null
|
|
4885
4921
|
};
|
|
4886
4922
|
});
|
|
4887
4923
|
}
|
|
4888
4924
|
computeCompareFiles(repo, base, head) {
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
const baseFile = baseSnapshot.get(path);
|
|
4895
|
-
const headFile = headSnapshot.get(path);
|
|
4896
|
-
if (baseFile?.sha === headFile?.sha)
|
|
4897
|
-
continue;
|
|
4898
|
-
const diff = linesChanged(baseFile?.content, headFile?.content ?? "");
|
|
4899
|
-
rows.push({
|
|
4900
|
-
repo_id: repo.id,
|
|
4901
|
-
pull_number: 0,
|
|
4902
|
-
filename: path,
|
|
4903
|
-
status: baseFile && headFile ? "modified" : headFile ? "added" : "removed",
|
|
4904
|
-
additions: diff.additions,
|
|
4905
|
-
deletions: headFile ? diff.deletions : baseFile?.content.split("\n").length ?? 0,
|
|
4906
|
-
changes: diff.additions + diff.deletions,
|
|
4907
|
-
blob_url: `https://github.com/${repo.full_name}/blob/${head.sha}/${path}`,
|
|
4908
|
-
raw_url: `https://raw.githubusercontent.com/${repo.full_name}/${head.sha}/${path}`,
|
|
4909
|
-
contents_url: `https://api.github.com/repos/${repo.full_name}/contents/${path}?ref=${head.sha}`,
|
|
4910
|
-
patch: `@@ ${path} @@`,
|
|
4911
|
-
// See `computeCommitFiles` — the compare surface is outside F-1500.
|
|
4912
|
-
previous_filename: null
|
|
4913
|
-
});
|
|
4914
|
-
}
|
|
4915
|
-
return rows;
|
|
4925
|
+
return diffFileRows(repo.id, this.snapshotAtCommit(repo.id, base.sha), this.snapshotAtCommit(repo.id, head.sha), (path) => ({
|
|
4926
|
+
blob_url: `https://github.com/${repo.full_name}/blob/${head.sha}/${path}`,
|
|
4927
|
+
raw_url: `https://raw.githubusercontent.com/${repo.full_name}/${head.sha}/${path}`,
|
|
4928
|
+
contents_url: `https://api.github.com/repos/${repo.full_name}/contents/${path}?ref=${head.sha}`
|
|
4929
|
+
}));
|
|
4916
4930
|
}
|
|
4917
4931
|
snapshotAtCommit(repoId, sha) {
|
|
4918
4932
|
const ancestry = this.commitAncestry(repoId, sha).reverse();
|
|
@@ -5005,42 +5019,17 @@ var GitHubDomain = class {
|
|
|
5005
5019
|
this.db.prepare("UPDATE repositories SET updated_at = ? WHERE id = ?").run(now, repo.id);
|
|
5006
5020
|
return commit;
|
|
5007
5021
|
}
|
|
5022
|
+
/** The tree a branch holds right now, in the shape `diffFileRows` diffs. */
|
|
5023
|
+
branchTree(repoId, branch) {
|
|
5024
|
+
const files = this.db.prepare("SELECT path, content, sha FROM files WHERE repo_id = ? AND branch = ?").all(repoId, branch);
|
|
5025
|
+
return new Map(files.map((file) => [file.path, { content: file.content, sha: file.sha }]));
|
|
5026
|
+
}
|
|
5008
5027
|
calculatePullFiles(baseRepo, baseRef, headRepo, headRef) {
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
const rows = [];
|
|
5015
|
-
for (const path of paths) {
|
|
5016
|
-
const base = baseFiles.get(path);
|
|
5017
|
-
const head = headFiles.get(path);
|
|
5018
|
-
if (base?.sha === head?.sha)
|
|
5019
|
-
continue;
|
|
5020
|
-
if (movedFrom.has(path))
|
|
5021
|
-
continue;
|
|
5022
|
-
const previousFilename = renames.get(path) ?? null;
|
|
5023
|
-
const diff = linesChanged(base?.content, head?.content ?? "");
|
|
5024
|
-
rows.push({
|
|
5025
|
-
repo_id: baseRepo.id,
|
|
5026
|
-
pull_number: 0,
|
|
5027
|
-
filename: path,
|
|
5028
|
-
status: previousFilename ? "renamed" : base && head ? "modified" : head ? "added" : "removed",
|
|
5029
|
-
// A detected move is an EXACT one (identical blobs), so it touches no
|
|
5030
|
-
// lines — which is what GitHub reports for it. `linesChanged` would call
|
|
5031
|
-
// the whole file an addition, because from its path-by-path view the
|
|
5032
|
-
// destination is a file that did not exist.
|
|
5033
|
-
additions: previousFilename ? 0 : diff.additions,
|
|
5034
|
-
deletions: previousFilename ? 0 : head ? diff.deletions : base?.content.split("\n").length ?? 0,
|
|
5035
|
-
changes: previousFilename ? 0 : diff.additions + diff.deletions,
|
|
5036
|
-
blob_url: `https://github.com/${headRepo.full_name}/blob/${headRef}/${path}`,
|
|
5037
|
-
raw_url: `https://raw.githubusercontent.com/${headRepo.full_name}/${headRef}/${path}`,
|
|
5038
|
-
contents_url: `https://api.github.com/repos/${headRepo.full_name}/contents/${path}`,
|
|
5039
|
-
patch: `@@ ${path} @@`,
|
|
5040
|
-
previous_filename: previousFilename
|
|
5041
|
-
});
|
|
5042
|
-
}
|
|
5043
|
-
return rows;
|
|
5028
|
+
return diffFileRows(baseRepo.id, this.branchTree(baseRepo.id, baseRef), this.branchTree(headRepo.id, headRef), (path) => ({
|
|
5029
|
+
blob_url: `https://github.com/${headRepo.full_name}/blob/${headRef}/${path}`,
|
|
5030
|
+
raw_url: `https://raw.githubusercontent.com/${headRepo.full_name}/${headRef}/${path}`,
|
|
5031
|
+
contents_url: `https://api.github.com/repos/${headRepo.full_name}/contents/${path}`
|
|
5032
|
+
}));
|
|
5044
5033
|
}
|
|
5045
5034
|
replacePullFiles(repoId, pullNumber, files) {
|
|
5046
5035
|
this.db.prepare("DELETE FROM pull_request_files WHERE repo_id = ? AND pull_number = ?").run(repoId, pullNumber);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bootTwin } from './chunk-
|
|
2
|
-
import { isTwinName, TWIN_NAMES, defaultPortFor, TWIN_REGISTRY } from './chunk-
|
|
1
|
+
import { bootTwin } from './chunk-XIKQEAWV.js';
|
|
2
|
+
import { isTwinName, TWIN_NAMES, defaultPortFor, TWIN_REGISTRY } from './chunk-F3KQCVWU.js';
|
|
3
3
|
import './chunk-OW7VVW6X.js';
|
|
4
4
|
import './chunk-VBATFCWR.js';
|
|
5
5
|
import './chunk-SG6ZTIMT.js';
|
package/package.json
CHANGED