githolon 0.110.0 → 0.110.1
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/compile_mountability_entry.js +114 -71
- package/dist/dev-server.mjs +114 -71
- package/dist/full-cli.mjs +114 -71
- package/package.json +2 -2
package/dist/full-cli.mjs
CHANGED
|
@@ -20640,6 +20640,15 @@ var init_replica_follow_controller = __esm({
|
|
|
20640
20640
|
}
|
|
20641
20641
|
if (result.stillAhead || result.pushFailed || result.directOfferDeferred || result.reconnectRequired) {
|
|
20642
20642
|
if (result.directOfferDeferred) {
|
|
20643
|
+
if (!result.reconnectRequired) {
|
|
20644
|
+
this.#desk.transition(result.workspace, {
|
|
20645
|
+
case: ReplicaFollowEventKind.Failed,
|
|
20646
|
+
nowUnixMillis,
|
|
20647
|
+
failure: "remote workspace opening; retrying",
|
|
20648
|
+
retryWithinMillis: 5e3
|
|
20649
|
+
});
|
|
20650
|
+
return delayUntilDue(this.#desk.get(result.workspace), nowUnixMillis);
|
|
20651
|
+
}
|
|
20643
20652
|
this.#desk.transition(result.workspace, {
|
|
20644
20653
|
case: ReplicaFollowEventKind.DependencyDeferred,
|
|
20645
20654
|
nowUnixMillis,
|
|
@@ -22644,6 +22653,34 @@ var init_custody_replacement = __esm({
|
|
|
22644
22653
|
|
|
22645
22654
|
// ../peer-office/src/runtime/custody_offer.ts
|
|
22646
22655
|
import { create as create54, fromBinary as fromBinary19, toBinary as toBinary17 } from "@bufbuild/protobuf";
|
|
22656
|
+
function settleCustodyOfferExchange(awaiting, response) {
|
|
22657
|
+
if (response.status === 202 && response.contentType?.includes("application/json")) {
|
|
22658
|
+
try {
|
|
22659
|
+
const pending = JSON.parse(new TextDecoder().decode(response.body));
|
|
22660
|
+
if (pending?.retryable === true && typeof pending.preparing === "string") {
|
|
22661
|
+
return { case: "maintenance", kind: pending.preparing };
|
|
22662
|
+
}
|
|
22663
|
+
} catch {
|
|
22664
|
+
}
|
|
22665
|
+
}
|
|
22666
|
+
if (!response.contentType?.includes(CUSTODY_OFFER_RESULT_MEDIA_TYPE)) {
|
|
22667
|
+
return {
|
|
22668
|
+
case: "unexpected",
|
|
22669
|
+
status: response.status,
|
|
22670
|
+
...response.contentType === void 0 ? {} : { contentType: response.contentType }
|
|
22671
|
+
};
|
|
22672
|
+
}
|
|
22673
|
+
const verdict = decodeCustodyOffer(response.body, awaiting.requestId);
|
|
22674
|
+
const receipt = custodyOfferReceipt(awaiting.requestId, verdict);
|
|
22675
|
+
switch (verdict.case) {
|
|
22676
|
+
case "admission":
|
|
22677
|
+
return { case: "admission", value: verdict.value, receipt, status: response.status };
|
|
22678
|
+
case "failure":
|
|
22679
|
+
return { case: "failure", value: verdict.value, receipt, status: response.status };
|
|
22680
|
+
case "blocked":
|
|
22681
|
+
return { case: "blocked", value: verdict.value, receipt, status: response.status };
|
|
22682
|
+
}
|
|
22683
|
+
}
|
|
22647
22684
|
function encodeInlineCustodyOffer(args) {
|
|
22648
22685
|
return toBinary17(CustodyOfferBatchRequestSchema, create54(CustodyOfferBatchRequestSchema, {
|
|
22649
22686
|
protocolVersion: 2,
|
|
@@ -22797,6 +22834,7 @@ var init_workspace_sync = __esm({
|
|
|
22797
22834
|
PLACEMENT_REF3 = "refs/nomos/placement";
|
|
22798
22835
|
LAW_PRODUCTS_MEDIA_TYPE = "application/vnd.nomos.export-law-products-response+protobuf";
|
|
22799
22836
|
WorkspaceSyncPhase = Object.freeze({
|
|
22837
|
+
Idle: "idle",
|
|
22800
22838
|
Probe: "probe",
|
|
22801
22839
|
Offer: "offer",
|
|
22802
22840
|
Lease: "lease",
|
|
@@ -22827,7 +22865,6 @@ var init_workspace_sync = __esm({
|
|
|
22827
22865
|
#rediscover;
|
|
22828
22866
|
/** The route the directory's answer yields, recomputed once that answer is observed. */
|
|
22829
22867
|
#reroute;
|
|
22830
|
-
#placementFetch;
|
|
22831
22868
|
#discoveredFrontier;
|
|
22832
22869
|
#observePlacement;
|
|
22833
22870
|
/** Ask the directory for the provider's current placement frontier this round although a
|
|
@@ -22836,19 +22873,14 @@ var init_workspace_sync = __esm({
|
|
|
22836
22873
|
#directoryAnswered;
|
|
22837
22874
|
#placementFetched;
|
|
22838
22875
|
/** A round which converged without leasing, finishing once placement alone is fetched. */
|
|
22839
|
-
#afterPlacement;
|
|
22840
22876
|
#leased = false;
|
|
22841
|
-
#lease;
|
|
22842
22877
|
#command;
|
|
22843
22878
|
#requestId;
|
|
22844
22879
|
#started;
|
|
22845
|
-
#
|
|
22880
|
+
#state = { phase: WorkspaceSyncPhase.Idle };
|
|
22846
22881
|
#localHead;
|
|
22847
22882
|
#offerHead;
|
|
22848
22883
|
#previousHead;
|
|
22849
|
-
#fetchStarted;
|
|
22850
|
-
#offerStarted;
|
|
22851
|
-
#offerRequestId;
|
|
22852
22884
|
#pushMillis = 0;
|
|
22853
22885
|
#pushBytes = 0n;
|
|
22854
22886
|
#desiredHead;
|
|
@@ -22943,7 +22975,7 @@ var init_workspace_sync = __esm({
|
|
|
22943
22975
|
throw new Error(`replica '${this.#binding.replicaId}' has no custody remote`);
|
|
22944
22976
|
}
|
|
22945
22977
|
if (this.#rediscover || this.#recheckPlacement || !this.#route?.placementObserved && !this.#route?.placementFrontier && !this.#kernel.resolveRef(this.#mount, this.#requestId, PLACEMENT_REF3)) {
|
|
22946
|
-
this.#
|
|
22978
|
+
this.#state = { phase: WorkspaceSyncPhase.Discover };
|
|
22947
22979
|
return this.#remember({
|
|
22948
22980
|
case: "pending",
|
|
22949
22981
|
value: create55(CorrespondencePendingSchema, {
|
|
@@ -22963,13 +22995,13 @@ var init_workspace_sync = __esm({
|
|
|
22963
22995
|
#openRound() {
|
|
22964
22996
|
if (this.#receiveState || this.#replaceLocalHead !== void 0) return this.#leaseEffect();
|
|
22965
22997
|
if (!this.#localHead) return this.#leaseEffect();
|
|
22966
|
-
|
|
22998
|
+
const requestId = `${this.#binding.replicaId}:${this.#requestId}:${this.workId}:frontier`;
|
|
22967
22999
|
return this.#beginOffer(encodeInlineCustodyOffer({
|
|
22968
23000
|
session: this.#binding.replicaId,
|
|
22969
|
-
requestId
|
|
23001
|
+
requestId,
|
|
22970
23002
|
observedHead: this.#localHead,
|
|
22971
23003
|
intents: []
|
|
22972
|
-
}), true);
|
|
23004
|
+
}), { case: "awaiting", requestId }, true);
|
|
22973
23005
|
}
|
|
22974
23006
|
#offerOrReconcile() {
|
|
22975
23007
|
if (this.#command.admit && this.#localHead && this.#localHead !== this.#previousHead) {
|
|
@@ -22990,13 +23022,13 @@ var init_workspace_sync = __esm({
|
|
|
22990
23022
|
throw new Error(`kernel did not classify transport for intent '${unspecified.intentId}'`);
|
|
22991
23023
|
}
|
|
22992
23024
|
if (suffix.length > 0) {
|
|
22993
|
-
|
|
22994
|
-
|
|
23025
|
+
const requestId2 = `${this.#binding.replicaId}:${this.#requestId}:${this.workId}`;
|
|
23026
|
+
const startedAt = this.#clock.monotonicNanoseconds();
|
|
22995
23027
|
this.#offerAfterConverge = true;
|
|
22996
23028
|
this.#rebaseFrom = this.#previousHead;
|
|
22997
23029
|
return this.#beginOffer(encodeInlineCustodyOffer({
|
|
22998
23030
|
session: this.#binding.replicaId,
|
|
22999
|
-
requestId:
|
|
23031
|
+
requestId: requestId2,
|
|
23000
23032
|
...this.#previousHead === void 0 ? {} : { baseHead: this.#previousHead },
|
|
23001
23033
|
observedHead: this.#localHead,
|
|
23002
23034
|
intents: suffix,
|
|
@@ -23007,17 +23039,17 @@ var init_workspace_sync = __esm({
|
|
|
23007
23039
|
this.#previousHead
|
|
23008
23040
|
) : void 0,
|
|
23009
23041
|
fastForwardOnly: true
|
|
23010
|
-
}));
|
|
23042
|
+
}), { case: "awaiting", requestId: requestId2, startedAt });
|
|
23011
23043
|
}
|
|
23012
23044
|
}
|
|
23013
|
-
|
|
23045
|
+
const requestId = `${this.#binding.replicaId}:${this.#requestId}:${this.workId}:reconcile`;
|
|
23014
23046
|
return this.#beginOffer(encodeInlineCustodyOffer({
|
|
23015
23047
|
session: this.#binding.replicaId,
|
|
23016
|
-
requestId
|
|
23048
|
+
requestId,
|
|
23017
23049
|
baseHead: this.#previousHead,
|
|
23018
23050
|
observedHead: this.#localHead,
|
|
23019
23051
|
intents: []
|
|
23020
|
-
}));
|
|
23052
|
+
}), { case: "awaiting", requestId });
|
|
23021
23053
|
}
|
|
23022
23054
|
/**
|
|
23023
23055
|
* NO COMMON BASE — a round that cannot converge, and must not pay for history to find out.
|
|
@@ -23093,18 +23125,18 @@ var init_workspace_sync = __esm({
|
|
|
23093
23125
|
#pullBeforeOffer() {
|
|
23094
23126
|
this.#offerAfterConverge = true;
|
|
23095
23127
|
this.#rebaseFrom = this.#previousHead;
|
|
23096
|
-
|
|
23128
|
+
const requestId = `${this.#binding.replicaId}:${this.#requestId}:${this.workId}:pull-${this.#rebases}`;
|
|
23097
23129
|
return this.#beginOffer(encodeInlineCustodyOffer({
|
|
23098
23130
|
session: this.#binding.replicaId,
|
|
23099
|
-
requestId
|
|
23131
|
+
requestId,
|
|
23100
23132
|
...this.#previousHead === void 0 ? {} : { baseHead: this.#previousHead },
|
|
23101
23133
|
observedHead: this.#localHead,
|
|
23102
23134
|
intents: []
|
|
23103
|
-
}));
|
|
23135
|
+
}), { case: "awaiting", requestId });
|
|
23104
23136
|
}
|
|
23105
|
-
#leaseEffect() {
|
|
23137
|
+
#leaseEffect(afterPlacement) {
|
|
23106
23138
|
const token = this.#authToken();
|
|
23107
|
-
this.#
|
|
23139
|
+
this.#state = { phase: WorkspaceSyncPhase.Lease, ...afterPlacement ? { afterPlacement } : {} };
|
|
23108
23140
|
return this.#remember({
|
|
23109
23141
|
case: "pending",
|
|
23110
23142
|
value: create55(CorrespondencePendingSchema, {
|
|
@@ -23133,35 +23165,38 @@ var init_workspace_sync = __esm({
|
|
|
23133
23165
|
`workspace sync '${this.workId}' expected effect '${expected}', received '${receipt.effectId}'`
|
|
23134
23166
|
);
|
|
23135
23167
|
}
|
|
23168
|
+
const state = this.#state;
|
|
23136
23169
|
const previousReceipt = this.#lastReceiptEffectId;
|
|
23137
23170
|
this.#lastReceiptEffectId = receipt.effectId;
|
|
23138
23171
|
try {
|
|
23139
23172
|
if (receipt.outcome.case === "failure") {
|
|
23140
|
-
if (
|
|
23173
|
+
if (state.phase === WorkspaceSyncPhase.Discover) return this.#openRound();
|
|
23141
23174
|
return this.#transportFailure(
|
|
23142
23175
|
receipt.outcome.value.message,
|
|
23143
23176
|
receipt.outcome.value.reason === PeerEffectFailureReason.OFFLINE
|
|
23144
23177
|
);
|
|
23145
23178
|
}
|
|
23146
|
-
if (
|
|
23147
|
-
|
|
23148
|
-
|
|
23149
|
-
if (
|
|
23150
|
-
|
|
23151
|
-
|
|
23179
|
+
if (state.phase === WorkspaceSyncPhase.Offer || state.phase === WorkspaceSyncPhase.Probe) {
|
|
23180
|
+
return this.#acceptOffer(receipt, state);
|
|
23181
|
+
}
|
|
23182
|
+
if (state.phase === WorkspaceSyncPhase.Lease) return this.#acceptLease(receipt, state);
|
|
23183
|
+
if (state.phase === WorkspaceSyncPhase.Discover) return this.#acceptDiscovery(receipt);
|
|
23184
|
+
if (state.phase === WorkspaceSyncPhase.Placement) {
|
|
23185
|
+
state.transfer.accept(receipt);
|
|
23152
23186
|
this.#placementFetched?.();
|
|
23153
|
-
if (
|
|
23154
|
-
return this.#beginMainFetch(
|
|
23187
|
+
if (state.afterPlacement) return this.#finish(state.afterPlacement);
|
|
23188
|
+
return this.#beginMainFetch(state.lease);
|
|
23155
23189
|
}
|
|
23156
|
-
if (
|
|
23190
|
+
if (state.phase === WorkspaceSyncPhase.Fetch) return this.#acceptFetch(receipt, state);
|
|
23157
23191
|
throw new Error(`workspace sync '${this.workId}' is already complete`);
|
|
23158
23192
|
} catch (error) {
|
|
23159
23193
|
this.#lastReceiptEffectId = previousReceipt;
|
|
23160
23194
|
throw error;
|
|
23161
23195
|
}
|
|
23162
23196
|
}
|
|
23163
|
-
#beginOffer(body, probe = false) {
|
|
23164
|
-
|
|
23197
|
+
#beginOffer(body, exchange, probe = false) {
|
|
23198
|
+
const phase = probe ? WorkspaceSyncPhase.Probe : WorkspaceSyncPhase.Offer;
|
|
23199
|
+
this.#state = { phase, exchange };
|
|
23165
23200
|
const token = this.#authToken();
|
|
23166
23201
|
this.#pushBytes += BigInt(body.byteLength);
|
|
23167
23202
|
return this.#remember({
|
|
@@ -23171,7 +23206,7 @@ var init_workspace_sync = __esm({
|
|
|
23171
23206
|
effect: {
|
|
23172
23207
|
case: "http",
|
|
23173
23208
|
value: create55(PeerHttpEffectSchema, {
|
|
23174
|
-
effectId: `${this.workId}:${
|
|
23209
|
+
effectId: `${this.workId}:${phase}`,
|
|
23175
23210
|
method: PeerHttpMethod.POST,
|
|
23176
23211
|
url: this.#offerEndpoint(),
|
|
23177
23212
|
contentType: CUSTODY_OFFER_MEDIA_TYPE,
|
|
@@ -23188,28 +23223,30 @@ var init_workspace_sync = __esm({
|
|
|
23188
23223
|
})
|
|
23189
23224
|
});
|
|
23190
23225
|
}
|
|
23191
|
-
#acceptOffer(receipt) {
|
|
23192
|
-
|
|
23226
|
+
#acceptOffer(receipt, state) {
|
|
23227
|
+
const exchange = state.exchange;
|
|
23228
|
+
this.#pushMillis = exchange.startedAt === void 0 ? 0 : elapsedMillis(this.#clock, exchange.startedAt);
|
|
23193
23229
|
if (receipt.outcome.case !== "response") {
|
|
23194
23230
|
throw new Error("platform returned the wrong receipt for a custody offer");
|
|
23195
23231
|
}
|
|
23196
|
-
const
|
|
23197
|
-
if (
|
|
23232
|
+
const outcome = settleCustodyOfferExchange(exchange, receipt.outcome.value);
|
|
23233
|
+
if (outcome.case === "maintenance") {
|
|
23234
|
+
return this.#finishOfferOutcome(true, false);
|
|
23235
|
+
}
|
|
23236
|
+
if (outcome.case === "unexpected") {
|
|
23198
23237
|
this.#pushError = create55(RuntimeTransportFailureSchema, {
|
|
23199
23238
|
endpoint: this.#offerEndpoint(),
|
|
23200
|
-
status:
|
|
23239
|
+
status: outcome.status,
|
|
23201
23240
|
refused: false,
|
|
23202
|
-
message: `Sync received an unexpected server response (HTTP ${
|
|
23241
|
+
message: `Sync received an unexpected server response (HTTP ${outcome.status}; ${outcome.contentType || "no content type"}). No custody receipt was returned.`
|
|
23203
23242
|
});
|
|
23204
23243
|
return this.#finishOfferOutcome(false);
|
|
23205
23244
|
}
|
|
23206
|
-
|
|
23207
|
-
const outcome = decodeCustodyOffer(response.body, this.#offerRequestId);
|
|
23208
|
-
this.#offerReceipt = custodyOfferReceipt(this.#offerRequestId, outcome);
|
|
23245
|
+
this.#offerReceipt = outcome.receipt;
|
|
23209
23246
|
if (outcome.case === "failure") {
|
|
23210
23247
|
this.#pushError = create55(RuntimeTransportFailureSchema, {
|
|
23211
23248
|
endpoint: this.#offerEndpoint(),
|
|
23212
|
-
status:
|
|
23249
|
+
status: outcome.status,
|
|
23213
23250
|
refused: false,
|
|
23214
23251
|
message: `${outcome.value.code}: ${outcome.value.message}`
|
|
23215
23252
|
});
|
|
@@ -23218,12 +23255,12 @@ var init_workspace_sync = __esm({
|
|
|
23218
23255
|
if (outcome.case === "blocked") {
|
|
23219
23256
|
return this.#finishOfferOutcome(true);
|
|
23220
23257
|
}
|
|
23221
|
-
if (
|
|
23258
|
+
if (outcome.status < 200 || outcome.status >= 300) {
|
|
23222
23259
|
this.#pushError = create55(RuntimeTransportFailureSchema, {
|
|
23223
23260
|
endpoint: this.#offerEndpoint(),
|
|
23224
|
-
status:
|
|
23225
|
-
refused:
|
|
23226
|
-
message: `custody offer returned an admission verdict with HTTP ${
|
|
23261
|
+
status: outcome.status,
|
|
23262
|
+
refused: outcome.status === 422,
|
|
23263
|
+
message: `custody offer returned an admission verdict with HTTP ${outcome.status}`
|
|
23227
23264
|
});
|
|
23228
23265
|
return this.#finishOfferOutcome(false);
|
|
23229
23266
|
}
|
|
@@ -23231,7 +23268,7 @@ var init_workspace_sync = __esm({
|
|
|
23231
23268
|
this.#desiredHead = admission.main || void 0;
|
|
23232
23269
|
if (!this.#desiredHead) return this.#transportFailure("resident peer returned no admitted frontier", false);
|
|
23233
23270
|
this.#candidateDurable = admission.sealedMain === this.#desiredHead;
|
|
23234
|
-
if (
|
|
23271
|
+
if (state.phase === WorkspaceSyncPhase.Probe && this.#desiredHead !== this.#localHead) {
|
|
23235
23272
|
if (!this.#establishBase(this.#desiredHead)) return this.#noCommonBaseResult();
|
|
23236
23273
|
if (this.#alreadyJudged(this.#desiredHead)) {
|
|
23237
23274
|
return this.#finish(create55(SyncWorkspaceResponseSchema, {
|
|
@@ -23293,7 +23330,7 @@ var init_workspace_sync = __esm({
|
|
|
23293
23330
|
if (admission.recoveryRequired !== false) return this.#leaseEffect();
|
|
23294
23331
|
return this.#transportFailure("resident peer supplied neither the missing delta nor a history gap", false);
|
|
23295
23332
|
}
|
|
23296
|
-
#acceptLease(receipt) {
|
|
23333
|
+
#acceptLease(receipt, state) {
|
|
23297
23334
|
if (receipt.outcome.case !== "response") {
|
|
23298
23335
|
throw new Error("platform returned the wrong receipt for a Git read lease");
|
|
23299
23336
|
}
|
|
@@ -23309,21 +23346,25 @@ var init_workspace_sync = __esm({
|
|
|
23309
23346
|
this.#leased = true;
|
|
23310
23347
|
const frontier = this.#placementFrontier();
|
|
23311
23348
|
if (frontier) {
|
|
23312
|
-
|
|
23349
|
+
const transfer = new PlacementFetch(
|
|
23313
23350
|
this.#kernel,
|
|
23314
23351
|
this.#mount,
|
|
23315
23352
|
this.#requestId,
|
|
23316
23353
|
this.workId,
|
|
23317
23354
|
frontier
|
|
23318
23355
|
);
|
|
23319
|
-
const pending =
|
|
23356
|
+
const pending = transfer.start(lease);
|
|
23320
23357
|
if (pending) {
|
|
23321
|
-
this.#
|
|
23322
|
-
|
|
23358
|
+
this.#state = {
|
|
23359
|
+
phase: WorkspaceSyncPhase.Placement,
|
|
23360
|
+
transfer,
|
|
23361
|
+
lease,
|
|
23362
|
+
...state.afterPlacement ? { afterPlacement: state.afterPlacement } : {}
|
|
23363
|
+
};
|
|
23323
23364
|
return this.#remember({ case: "pending", value: pending });
|
|
23324
23365
|
}
|
|
23325
23366
|
}
|
|
23326
|
-
if (
|
|
23367
|
+
if (state.afterPlacement) return this.#finish(state.afterPlacement);
|
|
23327
23368
|
return this.#beginMainFetch(lease);
|
|
23328
23369
|
}
|
|
23329
23370
|
/** The provider's placement frontier as this round knows it: what the directory named in this
|
|
@@ -23343,8 +23384,7 @@ var init_workspace_sync = __esm({
|
|
|
23343
23384
|
if (!new PlacementFetch(this.#kernel, this.#mount, this.#requestId, this.workId, frontier).wanted()) {
|
|
23344
23385
|
return void 0;
|
|
23345
23386
|
}
|
|
23346
|
-
this.#
|
|
23347
|
-
return this.#leaseEffect();
|
|
23387
|
+
return this.#leaseEffect(presented);
|
|
23348
23388
|
}
|
|
23349
23389
|
#acceptDiscovery(receipt) {
|
|
23350
23390
|
this.#directoryAnswered?.();
|
|
@@ -23368,9 +23408,11 @@ var init_workspace_sync = __esm({
|
|
|
23368
23408
|
return this.#replaceLocalHead !== void 0 || this.#localHead === void 0 && this.#previousHead === void 0;
|
|
23369
23409
|
}
|
|
23370
23410
|
#beginMainFetch(lease) {
|
|
23371
|
-
this.#phase = WorkspaceSyncPhase.Fetch;
|
|
23372
23411
|
const lawProducts = this.#lawProductsAlongside();
|
|
23373
|
-
this.#
|
|
23412
|
+
this.#state = {
|
|
23413
|
+
phase: WorkspaceSyncPhase.Fetch,
|
|
23414
|
+
startedAt: this.#clock.monotonicNanoseconds()
|
|
23415
|
+
};
|
|
23374
23416
|
const haves = this.#replaceLocalHead !== void 0 ? this.#repairMissingCommit ? [] : [this.#kernel.resolveRef(this.#mount, this.#requestId, deferredRemote)].filter(
|
|
23375
23417
|
(head) => !!head
|
|
23376
23418
|
) : [...new Set([
|
|
@@ -23401,7 +23443,7 @@ var init_workspace_sync = __esm({
|
|
|
23401
23443
|
})
|
|
23402
23444
|
});
|
|
23403
23445
|
}
|
|
23404
|
-
#acceptFetch(receipt) {
|
|
23446
|
+
#acceptFetch(receipt, state) {
|
|
23405
23447
|
if (receipt.outcome.case !== "gitFetch") {
|
|
23406
23448
|
throw new Error("platform returned the wrong receipt for a Git object fetch");
|
|
23407
23449
|
}
|
|
@@ -23411,7 +23453,7 @@ var init_workspace_sync = __esm({
|
|
|
23411
23453
|
if (fetched.pack.byteLength > 0) {
|
|
23412
23454
|
this.#kernel.applyPack(this.#mount, this.#requestId, fetched.pack, fetched.head, fetched.shallow);
|
|
23413
23455
|
}
|
|
23414
|
-
const prefetchMillis =
|
|
23456
|
+
const prefetchMillis = elapsedMillis(this.#clock, state.startedAt);
|
|
23415
23457
|
const candidateHead = this.#receiveState ? this.#kernel.resolveStatePosition?.(this.#mount, this.#requestId, fetched.head, this.#receiveState) : fetched.head;
|
|
23416
23458
|
if (!candidateHead) {
|
|
23417
23459
|
return this.#finish(create55(SyncWorkspaceResponseSchema, {
|
|
@@ -23762,11 +23804,11 @@ var init_workspace_sync = __esm({
|
|
|
23762
23804
|
pushBytes: this.#pushBytes,
|
|
23763
23805
|
pullBytes: BigInt(receivedBytes),
|
|
23764
23806
|
serverMillis: this.#admissionSummary?.serverMillis ?? 0,
|
|
23765
|
-
offerInPush: this.#
|
|
23807
|
+
offerInPush: this.#pushBytes > 0n
|
|
23766
23808
|
})
|
|
23767
23809
|
});
|
|
23768
23810
|
}
|
|
23769
|
-
#finishOfferOutcome(blocked) {
|
|
23811
|
+
#finishOfferOutcome(blocked, reconnectRequired = true) {
|
|
23770
23812
|
return this.#finish(create55(SyncWorkspaceResponseSchema, {
|
|
23771
23813
|
workspace: this.#mount.workspace,
|
|
23772
23814
|
previousHead: this.#previousHead,
|
|
@@ -23774,7 +23816,7 @@ var init_workspace_sync = __esm({
|
|
|
23774
23816
|
admitted: BigInt(this.#admissionSummary?.admittedIntentIds.length ?? 0),
|
|
23775
23817
|
refused: BigInt((this.#admissionSummary?.refusedMessages.length ?? 0) + this.#parkedLocal),
|
|
23776
23818
|
deferred: BigInt(this.#admissionSummary ? this.#admissionSummary.blockedMessages.length + this.#admissionSummary.deadLetteredMessages.length + this.#admissionSummary.quarantinedMessages.length + this.#admissionSummary.deferredMessages.length : blocked ? 1 : 0),
|
|
23777
|
-
reconnectRequired
|
|
23819
|
+
reconnectRequired,
|
|
23778
23820
|
stillAhead: this.#localHead !== this.#previousHead,
|
|
23779
23821
|
directOfferDeferred: blocked,
|
|
23780
23822
|
offerReceipt: this.#offerReceipt,
|
|
@@ -23788,15 +23830,16 @@ var init_workspace_sync = __esm({
|
|
|
23788
23830
|
}));
|
|
23789
23831
|
}
|
|
23790
23832
|
#transportFailure(message, offline, status2 = -1) {
|
|
23791
|
-
const
|
|
23833
|
+
const state = this.#state;
|
|
23834
|
+
const pushFailed = state.phase === WorkspaceSyncPhase.Offer;
|
|
23792
23835
|
const failedEndpoint = this.#offerEndpoint();
|
|
23793
23836
|
const failure = create55(RuntimeTransportFailureSchema, {
|
|
23794
23837
|
endpoint: pushFailed ? failedEndpoint : this.#binding.cloud ?? "",
|
|
23795
23838
|
status: status2,
|
|
23796
23839
|
message
|
|
23797
23840
|
});
|
|
23798
|
-
if (
|
|
23799
|
-
this.#pushMillis =
|
|
23841
|
+
if (state.phase === WorkspaceSyncPhase.Offer) {
|
|
23842
|
+
this.#pushMillis = state.exchange.startedAt === void 0 ? 0 : elapsedMillis(this.#clock, state.exchange.startedAt);
|
|
23800
23843
|
this.#pushError = failure;
|
|
23801
23844
|
}
|
|
23802
23845
|
return this.#finish(create55(SyncWorkspaceResponseSchema, {
|
|
@@ -23813,7 +23856,7 @@ var init_workspace_sync = __esm({
|
|
|
23813
23856
|
pushMillis: this.#pushMillis,
|
|
23814
23857
|
pushBytes: this.#pushBytes,
|
|
23815
23858
|
prefetchMillis: elapsedMillis(this.#clock, this.#started),
|
|
23816
|
-
offerInPush: this.#
|
|
23859
|
+
offerInPush: this.#pushBytes > 0n
|
|
23817
23860
|
})
|
|
23818
23861
|
}));
|
|
23819
23862
|
}
|
|
@@ -23823,7 +23866,7 @@ var init_workspace_sync = __esm({
|
|
|
23823
23866
|
return step;
|
|
23824
23867
|
}
|
|
23825
23868
|
#finish(value) {
|
|
23826
|
-
this.#
|
|
23869
|
+
this.#state = { phase: WorkspaceSyncPhase.Done };
|
|
23827
23870
|
this.#current = void 0;
|
|
23828
23871
|
return this.#remember({ case: "synced", value });
|
|
23829
23872
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "githolon",
|
|
3
|
-
"version": "0.110.
|
|
3
|
+
"version": "0.110.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "githolon — the Nomos developer CLI: Rails-style generators for @githolon/dsl domains + the package compiler. Kernel-independent.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@bjorn3/browser_wasi_shim": "0.4.2",
|
|
32
32
|
"@bufbuild/protobuf": "^2.13.0",
|
|
33
|
-
"@githolon/dsl": "^0.110.
|
|
33
|
+
"@githolon/dsl": "^0.110.1",
|
|
34
34
|
"fast-xml-parser": "5.10.1",
|
|
35
35
|
"isomorphic-git": "^1.38.4",
|
|
36
36
|
"tsx": "^4.19.2",
|