@run402/sdk 4.51.0 → 4.53.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/namespaces/gitvault.d.ts +21 -0
- package/dist/namespaces/gitvault.d.ts.map +1 -1
- package/dist/namespaces/gitvault.js +56 -5
- package/dist/namespaces/gitvault.js.map +1 -1
- package/dist/node/gitvault-address.d.ts +47 -0
- package/dist/node/gitvault-address.d.ts.map +1 -1
- package/dist/node/gitvault-address.js +80 -14
- package/dist/node/gitvault-address.js.map +1 -1
- package/dist/node/gitvault-edge-fetch.d.ts +68 -0
- package/dist/node/gitvault-edge-fetch.d.ts.map +1 -0
- package/dist/node/gitvault-edge-fetch.js +70 -0
- package/dist/node/gitvault-edge-fetch.js.map +1 -0
- package/dist/node/gitvault-mirror.d.ts.map +1 -1
- package/dist/node/gitvault-mirror.js +6 -1
- package/dist/node/gitvault-mirror.js.map +1 -1
- package/dist/node/gitvault-publication.d.ts.map +1 -1
- package/dist/node/gitvault-publication.js +21 -5
- package/dist/node/gitvault-publication.js.map +1 -1
- package/package.json +1 -1
|
@@ -37,6 +37,7 @@ import { mkdtempSync, readdirSync, readFileSync, rmSync } from "node:fs";
|
|
|
37
37
|
import { tmpdir } from "node:os";
|
|
38
38
|
import { join } from "node:path";
|
|
39
39
|
import { LocalError, isRun402Error } from "../errors.js";
|
|
40
|
+
import { fetchGitvaultObjectBytes } from "./gitvault-edge-fetch.js";
|
|
40
41
|
import { GITVAULT_FORMAT, GITVAULT_GENESIS_EPOCH, GITVAULT_GENESIS_GENERATION, GITVAULT_HEX16_RE, GITVAULT_OID40_RE, GITVAULT_SUITE, attemptKeyCommitment, bytesToHex, checkFreshEpochKeyAgainstPriorKeys, checkHPartition, computeRotationId, computeTargetPartitionDigest, deriveDigestKey, deriveObjectKey, ekFingerprint, epochRotationKeyCommitment, formatGitvaultTimestamp, fromBase64url, hexToBytes, jcs, keyEnvelopeLedgerId, keyedCommitment, newGitvaultId, newHex32, nextEpoch, objectsetContent, openBindingPreimage, openEpochRotationForRecipient, openFrame, parseGitvaultStrict, parseRotateEpochPayload, pinManifestLedgerId, randomBytes, sealFrame, sealKeyEnvelope, sha256Hex, signGitvaultObject, storedBytes, storedBytesSha256, toBase64url, verifyGitvaultObject, } from "../namespaces/gitvault.crypto.js";
|
|
41
42
|
import { GITVAULT_ZERO_SHA256_SENTINEL } from "../namespaces/gitvault.types.js";
|
|
42
43
|
import { crossProfileGitvaultHint } from "./gitvault-profile-scan.js";
|
|
@@ -173,7 +174,22 @@ export async function evaluateRefTransaction(current, transaction, options) {
|
|
|
173
174
|
dropped.push({ ref: u.ref, oid: cur, reason: "force_displaced" });
|
|
174
175
|
}
|
|
175
176
|
if (failures.length > 0) {
|
|
176
|
-
|
|
177
|
+
const nextActions = [{ action: "refetch, reapply the transaction to the winner's map, retry" }];
|
|
178
|
+
// The force-with-lease inversion (gitvault-force-spelling-and-pin-fold):
|
|
179
|
+
// git's remote-helper protocol carries force only as a `+` refspec
|
|
180
|
+
// prefix, which `--force-with-lease` never sets — the lease cannot cross
|
|
181
|
+
// the helper boundary, so a rebased tip arrives as a NON-force update
|
|
182
|
+
// and lands here as `non_fast_forward`. Plain `--force` through this
|
|
183
|
+
// helper is with-lease-safe by construction (expected-old is mandatory
|
|
184
|
+
// and CASed against the freshly materialized base), so the refusal
|
|
185
|
+
// names the spelling that works.
|
|
186
|
+
if (failures.some((f) => f.reason === "non_fast_forward")) {
|
|
187
|
+
nextActions.push({
|
|
188
|
+
action: "git push --force",
|
|
189
|
+
why: "history was rewritten; this remote enforces expected-old server-side, so --force here carries force-with-lease safety — --force-with-lease itself cannot cross git's remote-helper boundary and arrives as a non-force push",
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
fail("REF_EXPECTED_OLD_MISMATCH", `${failures.length} update(s) refused: ${failures.map((f) => `${f.ref} (${f.reason})`).join(", ")}`, "evaluating ref transaction", { failures }, nextActions);
|
|
177
193
|
}
|
|
178
194
|
assertRefMapCardinality(next);
|
|
179
195
|
return { refs: next, dropped };
|
|
@@ -724,7 +740,7 @@ export function createGitvaultHttpTransport(client, options = {}) {
|
|
|
724
740
|
const target = presigned.reads[0];
|
|
725
741
|
if (!target)
|
|
726
742
|
return null;
|
|
727
|
-
const r = await client
|
|
743
|
+
const r = await fetchGitvaultObjectBytes(client, target);
|
|
728
744
|
if (r.status === 404)
|
|
729
745
|
return null;
|
|
730
746
|
if (!r.ok)
|
|
@@ -766,7 +782,7 @@ export function createGitvaultHttpTransport(client, options = {}) {
|
|
|
766
782
|
return mapBounded(targets, GITVAULT_TRANSPORT_CONCURRENCY, async (target, i) => {
|
|
767
783
|
if (!target)
|
|
768
784
|
return null;
|
|
769
|
-
const r = await client
|
|
785
|
+
const r = await fetchGitvaultObjectBytes(client, target);
|
|
770
786
|
if (r.status === 404)
|
|
771
787
|
return null;
|
|
772
788
|
if (!r.ok)
|
|
@@ -774,11 +790,11 @@ export function createGitvaultHttpTransport(client, options = {}) {
|
|
|
774
790
|
return new Uint8Array(await r.arrayBuffer());
|
|
775
791
|
});
|
|
776
792
|
}
|
|
777
|
-
/** Resolve ONE `GET …/state` carrier arm to raw bytes — inline decode, or a plain GET on the presigned URL, `null` on a 404 (mirrors {@link getObjectBytes}'s absent reading; both arms indistinguishable after this). */
|
|
793
|
+
/** Resolve ONE `GET …/state` carrier arm to raw bytes — inline decode, or a plain GET on the presigned URL (preferring its `edge_url` companion, gitvault-read-edge-cache design D5), `null` on a 404 (mirrors {@link getObjectBytes}'s absent reading; both arms indistinguishable after this). */
|
|
778
794
|
async function resolveVaultStateCarrier(carrier) {
|
|
779
795
|
if ("inline" in carrier)
|
|
780
796
|
return fromBase64url(carrier.inline, "carriers.inline");
|
|
781
|
-
const r = await client
|
|
797
|
+
const r = await fetchGitvaultObjectBytes(client, { url: carrier.presigned_url, edge_url: carrier.edge_url });
|
|
782
798
|
if (r.status === 404)
|
|
783
799
|
return null;
|
|
784
800
|
if (!r.ok)
|