githolon 0.112.0 → 0.112.2
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 +30 -18
- package/dist/dev-server.mjs +30 -18
- package/dist/full-cli.mjs +30 -18
- package/package.json +2 -2
|
@@ -4323,7 +4323,7 @@ function runtimeKernelPort(engine) {
|
|
|
4323
4323
|
case: "resolveRef",
|
|
4324
4324
|
value: create3(ResolveRefRequestSchema, {
|
|
4325
4325
|
repo: workspaceRepositoryPath(workspace),
|
|
4326
|
-
reference: `refs/heads/${branch}`
|
|
4326
|
+
reference: branch.startsWith("refs/") ? branch : `refs/heads/${branch}`
|
|
4327
4327
|
})
|
|
4328
4328
|
}
|
|
4329
4329
|
})
|
|
@@ -5335,7 +5335,6 @@ function gitCustodyDesk(kernel, fetchImpl = fetch, observe, phaseStarted) {
|
|
|
5335
5335
|
return acquired;
|
|
5336
5336
|
},
|
|
5337
5337
|
deepenMain(workspace, ledger) {
|
|
5338
|
-
if (ledger.operatorCustody !== true) return Promise.resolve({ changed: false, complete: true });
|
|
5339
5338
|
return acquiring(workspace, ledger, "deepen-main", async () => {
|
|
5340
5339
|
if (resolveRef(workspace, branchRef("main")) === void 0) {
|
|
5341
5340
|
const acquired = await acquireMain(workspace, ledger);
|
|
@@ -6054,6 +6053,7 @@ var init_peer_platform_shell = __esm({
|
|
|
6054
6053
|
// one constitutional genesis offer. WorkspaceAccessDesk decides whether
|
|
6055
6054
|
// that exact request may proceed against the unborn kernel mount.
|
|
6056
6055
|
async openCustody(workspace) {
|
|
6056
|
+
if (physical.openLocalCustody) return physical.openLocalCustody(workspace);
|
|
6057
6057
|
await custody.acquireMain(workspace, await ledgerFor(workspace));
|
|
6058
6058
|
return {};
|
|
6059
6059
|
},
|
|
@@ -6069,7 +6069,12 @@ var init_peer_platform_shell = __esm({
|
|
|
6069
6069
|
},
|
|
6070
6070
|
persistBornCustody: (effect) => physical.persistBornCustody(effect),
|
|
6071
6071
|
retainFrontier: (effect) => physical.retainFrontier(effect),
|
|
6072
|
-
...physical.
|
|
6072
|
+
...physical.advanceHistory ? {
|
|
6073
|
+
advanceHistory: (workspace, capability) => {
|
|
6074
|
+
const credential = capability ? this.#credentials.authToken(capability) : authToken;
|
|
6075
|
+
return physical.advanceHistory(workspace, credential && new TextDecoder().decode(credential));
|
|
6076
|
+
}
|
|
6077
|
+
} : physical.completeHistoryInLocalCustody ? {
|
|
6073
6078
|
// The kernel mounts a shallow working copy; the peer's own Git custody is deep.
|
|
6074
6079
|
// One bounded slice per call; the Peer Office decides whether and when to take the next.
|
|
6075
6080
|
async advanceHistory(workspace) {
|
|
@@ -15879,10 +15884,11 @@ var init_live_correspondence_desk = __esm({
|
|
|
15879
15884
|
failures: 0,
|
|
15880
15885
|
origin,
|
|
15881
15886
|
publisher: !binding.cloudBound,
|
|
15882
|
-
published: !binding.cloudBound ? head : void 0
|
|
15887
|
+
published: !binding.cloudBound ? head : void 0,
|
|
15888
|
+
wasResident: this.kernel.isResident(binding.workspace) !== false
|
|
15883
15889
|
};
|
|
15884
15890
|
this.#links.set(binding.workspace, link);
|
|
15885
|
-
this.#open(link);
|
|
15891
|
+
if (link.wasResident) this.#open(link);
|
|
15886
15892
|
}
|
|
15887
15893
|
changed(workspace) {
|
|
15888
15894
|
const link = this.#links.get(workspace);
|
|
@@ -16039,9 +16045,11 @@ var init_live_correspondence_desk = __esm({
|
|
|
16039
16045
|
let wake;
|
|
16040
16046
|
for (const link of this.#links.values()) {
|
|
16041
16047
|
if (this.kernel.isResident(link.binding.workspace) === false) {
|
|
16042
|
-
this.disconnect(link.binding.workspace);
|
|
16048
|
+
if (link.wasResident) this.disconnect(link.binding.workspace);
|
|
16049
|
+
else wake = wake === void 0 || wake > 250n ? 250n : wake;
|
|
16043
16050
|
continue;
|
|
16044
16051
|
}
|
|
16052
|
+
link.wasResident = true;
|
|
16045
16053
|
if (link.state === "opening" && now >= link.due) {
|
|
16046
16054
|
this.#effect(link, { case: "close", value: true });
|
|
16047
16055
|
link.state = "closed";
|
|
@@ -23865,7 +23873,7 @@ var init_frame_runner = __esm({
|
|
|
23865
23873
|
|
|
23866
23874
|
// ../peer-office/src/runtime/platform_effect_driver.ts
|
|
23867
23875
|
import { create as create71, fromBinary as fromBinary25, toBinary as toBinary26 } from "@bufbuild/protobuf";
|
|
23868
|
-
async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch, custody, bornCustody, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage, yieldLocalReadToCaller = false, yieldHistoryToCaller = false) {
|
|
23876
|
+
async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch, custody, bornCustody, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage, yieldLocalReadToCaller = false, yieldHistoryToCaller = false, performExternalEffect) {
|
|
23869
23877
|
const persistBornCustody = bornCustody ?? (custody?.persistBornCustody ? (effect) => custody.persistBornCustody(effect) : void 0);
|
|
23870
23878
|
let responseFrame = runner.handleFrame(initialFrame);
|
|
23871
23879
|
const satisfied = /* @__PURE__ */ new Set();
|
|
@@ -24001,12 +24009,10 @@ async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch
|
|
|
24001
24009
|
if (pending.effect.case === "historyAcquisition" && (yieldHistoryToCaller || !custody?.advanceHistory)) {
|
|
24002
24010
|
return responseFrame;
|
|
24003
24011
|
}
|
|
24004
|
-
if (pending.effect.case === "refreshCredential" && credentialRefresh === externalPeerEffect) return responseFrame;
|
|
24005
|
-
if (pending.effect.case === "deviceIdentity" && deviceIdentity === externalPeerEffect) return responseFrame;
|
|
24006
|
-
if (pending.effect.case === "lawPackage" && lawPackage === externalPeerEffect) return responseFrame;
|
|
24007
24012
|
if (pending.effect.case === "wake" && yieldWakeToCaller) return responseFrame;
|
|
24008
|
-
|
|
24009
|
-
|
|
24013
|
+
const external = pending.effect.case === "refreshCredential" && credentialRefresh === externalPeerEffect || pending.effect.case === "deviceIdentity" && deviceIdentity === externalPeerEffect || pending.effect.case === "lawPackage" && lawPackage === externalPeerEffect || pending.effect.case === "consoleEnrolment";
|
|
24014
|
+
if (external && !performExternalEffect) return responseFrame;
|
|
24015
|
+
const receipt = external ? await performExternalEffect(pending) : pending.effect.case === "http" ? await executeHttpEffect(pending.effect.value, fetchImpl) : pending.effect.case === "gitFetch" ? await executeGitFetchWithAlongside(pending.effect.value, fetchImpl) : pending.effect.case === "gitPush" ? await executeGitPushEffect(pending.effect.value, fetchImpl) : pending.effect.case === "persistBornCustody" ? create71(PeerEffectReceiptSchema, {
|
|
24010
24016
|
effectId: pending.effect.value.effectId,
|
|
24011
24017
|
outcome: {
|
|
24012
24018
|
case: "bornCustodyPersisted",
|
|
@@ -24034,7 +24040,7 @@ async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch
|
|
|
24034
24040
|
async function executeHistoryAcquisitionEffect(effect, custody) {
|
|
24035
24041
|
try {
|
|
24036
24042
|
if (!custody.advanceHistory) throw new Error("platform shell has no history acquisition capability");
|
|
24037
|
-
const progress = await custody.advanceHistory(effect.workspace);
|
|
24043
|
+
const progress = await custody.advanceHistory(effect.workspace, effect.credentialCapability);
|
|
24038
24044
|
return create71(PeerEffectReceiptSchema, {
|
|
24039
24045
|
effectId: effect.effectId,
|
|
24040
24046
|
outcome: {
|
|
@@ -24517,7 +24523,7 @@ var init_credential_effects = __esm({
|
|
|
24517
24523
|
// ../platform-shells/shared/peer_office_host.ts
|
|
24518
24524
|
import { create as create74, fromBinary as fromBinary28, toBinary as toBinary29 } from "@bufbuild/protobuf";
|
|
24519
24525
|
function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, maintenanceSettled, postEvent = () => {
|
|
24520
|
-
}, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage) {
|
|
24526
|
+
}, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage, performExternalEffect) {
|
|
24521
24527
|
let runner;
|
|
24522
24528
|
const configuredOrigins = new Set((shell.providerOrigins?.() ?? []).map((provider) => originOf(provider)).filter((origin) => origin !== void 0));
|
|
24523
24529
|
const permittedSocket = (url) => {
|
|
@@ -24526,10 +24532,10 @@ function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, mainten
|
|
|
24526
24532
|
return origin !== void 0 && configuredOrigins.has(origin);
|
|
24527
24533
|
};
|
|
24528
24534
|
const sockets = socketEffects(
|
|
24529
|
-
(frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, void 0, false, deviceIdentity, lawPackage),
|
|
24535
|
+
(frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, void 0, false, deviceIdentity, lawPackage, false, false, performExternalEffect),
|
|
24530
24536
|
permittedSocket
|
|
24531
24537
|
);
|
|
24532
|
-
const credentials = credentialEffects((frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, credentialRefresh, false, deviceIdentity, lawPackage), credentialRefresh);
|
|
24538
|
+
const credentials = credentialEffects((frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, credentialRefresh, false, deviceIdentity, lawPackage, false, false, performExternalEffect), credentialRefresh);
|
|
24533
24539
|
runner = createPeerOfficeFrameRunner(
|
|
24534
24540
|
kernel,
|
|
24535
24541
|
shell.credentials(),
|
|
@@ -24554,7 +24560,10 @@ function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, mainten
|
|
|
24554
24560
|
credentialRefresh,
|
|
24555
24561
|
false,
|
|
24556
24562
|
deviceIdentity,
|
|
24557
|
-
lawPackage
|
|
24563
|
+
lawPackage,
|
|
24564
|
+
false,
|
|
24565
|
+
false,
|
|
24566
|
+
performExternalEffect
|
|
24558
24567
|
);
|
|
24559
24568
|
},
|
|
24560
24569
|
shell.peerDeskStore()
|
|
@@ -24606,7 +24615,10 @@ function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, mainten
|
|
|
24606
24615
|
credentialRefresh,
|
|
24607
24616
|
yieldWakeToCaller,
|
|
24608
24617
|
deviceIdentity,
|
|
24609
|
-
lawPackage
|
|
24618
|
+
lawPackage,
|
|
24619
|
+
false,
|
|
24620
|
+
false,
|
|
24621
|
+
performExternalEffect
|
|
24610
24622
|
);
|
|
24611
24623
|
},
|
|
24612
24624
|
settleRetention: (withinMillis) => runner.settleRetention(withinMillis),
|
package/dist/dev-server.mjs
CHANGED
|
@@ -2925,7 +2925,7 @@ function runtimeKernelPort(engine) {
|
|
|
2925
2925
|
case: "resolveRef",
|
|
2926
2926
|
value: create8(ResolveRefRequestSchema, {
|
|
2927
2927
|
repo: workspaceRepositoryPath(workspace),
|
|
2928
|
-
reference: `refs/heads/${branch}`
|
|
2928
|
+
reference: branch.startsWith("refs/") ? branch : `refs/heads/${branch}`
|
|
2929
2929
|
})
|
|
2930
2930
|
}
|
|
2931
2931
|
})
|
|
@@ -3633,7 +3633,6 @@ function gitCustodyDesk(kernel, fetchImpl = fetch, observe, phaseStarted) {
|
|
|
3633
3633
|
return acquired;
|
|
3634
3634
|
},
|
|
3635
3635
|
deepenMain(workspace, ledger) {
|
|
3636
|
-
if (ledger.operatorCustody !== true) return Promise.resolve({ changed: false, complete: true });
|
|
3637
3636
|
return acquiring(workspace, ledger, "deepen-main", async () => {
|
|
3638
3637
|
if (resolveRef(workspace, branchRef("main")) === void 0) {
|
|
3639
3638
|
const acquired = await acquireMain(workspace, ledger);
|
|
@@ -3959,6 +3958,7 @@ var PeerPlatformShell = class {
|
|
|
3959
3958
|
// one constitutional genesis offer. WorkspaceAccessDesk decides whether
|
|
3960
3959
|
// that exact request may proceed against the unborn kernel mount.
|
|
3961
3960
|
async openCustody(workspace) {
|
|
3961
|
+
if (physical.openLocalCustody) return physical.openLocalCustody(workspace);
|
|
3962
3962
|
await custody.acquireMain(workspace, await ledgerFor(workspace));
|
|
3963
3963
|
return {};
|
|
3964
3964
|
},
|
|
@@ -3974,7 +3974,12 @@ var PeerPlatformShell = class {
|
|
|
3974
3974
|
},
|
|
3975
3975
|
persistBornCustody: (effect) => physical.persistBornCustody(effect),
|
|
3976
3976
|
retainFrontier: (effect) => physical.retainFrontier(effect),
|
|
3977
|
-
...physical.
|
|
3977
|
+
...physical.advanceHistory ? {
|
|
3978
|
+
advanceHistory: (workspace, capability) => {
|
|
3979
|
+
const credential = capability ? this.#credentials.authToken(capability) : authToken;
|
|
3980
|
+
return physical.advanceHistory(workspace, credential && new TextDecoder().decode(credential));
|
|
3981
|
+
}
|
|
3982
|
+
} : physical.completeHistoryInLocalCustody ? {
|
|
3978
3983
|
// The kernel mounts a shallow working copy; the peer's own Git custody is deep.
|
|
3979
3984
|
// One bounded slice per call; the Peer Office decides whether and when to take the next.
|
|
3980
3985
|
async advanceHistory(workspace) {
|
|
@@ -13305,10 +13310,11 @@ var LiveCorrespondenceDesk = class {
|
|
|
13305
13310
|
failures: 0,
|
|
13306
13311
|
origin,
|
|
13307
13312
|
publisher: !binding.cloudBound,
|
|
13308
|
-
published: !binding.cloudBound ? head : void 0
|
|
13313
|
+
published: !binding.cloudBound ? head : void 0,
|
|
13314
|
+
wasResident: this.kernel.isResident(binding.workspace) !== false
|
|
13309
13315
|
};
|
|
13310
13316
|
this.#links.set(binding.workspace, link);
|
|
13311
|
-
this.#open(link);
|
|
13317
|
+
if (link.wasResident) this.#open(link);
|
|
13312
13318
|
}
|
|
13313
13319
|
changed(workspace) {
|
|
13314
13320
|
const link = this.#links.get(workspace);
|
|
@@ -13465,9 +13471,11 @@ var LiveCorrespondenceDesk = class {
|
|
|
13465
13471
|
let wake;
|
|
13466
13472
|
for (const link of this.#links.values()) {
|
|
13467
13473
|
if (this.kernel.isResident(link.binding.workspace) === false) {
|
|
13468
|
-
this.disconnect(link.binding.workspace);
|
|
13474
|
+
if (link.wasResident) this.disconnect(link.binding.workspace);
|
|
13475
|
+
else wake = wake === void 0 || wake > 250n ? 250n : wake;
|
|
13469
13476
|
continue;
|
|
13470
13477
|
}
|
|
13478
|
+
link.wasResident = true;
|
|
13471
13479
|
if (link.state === "opening" && now >= link.due) {
|
|
13472
13480
|
this.#effect(link, { case: "close", value: true });
|
|
13473
13481
|
link.state = "closed";
|
|
@@ -21135,7 +21143,7 @@ var executeGitPushEffect = async (effect, fetchImpl) => {
|
|
|
21135
21143
|
});
|
|
21136
21144
|
}
|
|
21137
21145
|
};
|
|
21138
|
-
async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch, custody, bornCustody, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage, yieldLocalReadToCaller = false, yieldHistoryToCaller = false) {
|
|
21146
|
+
async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch, custody, bornCustody, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage, yieldLocalReadToCaller = false, yieldHistoryToCaller = false, performExternalEffect) {
|
|
21139
21147
|
const persistBornCustody = bornCustody ?? (custody?.persistBornCustody ? (effect) => custody.persistBornCustody(effect) : void 0);
|
|
21140
21148
|
let responseFrame = runner.handleFrame(initialFrame);
|
|
21141
21149
|
const satisfied = /* @__PURE__ */ new Set();
|
|
@@ -21271,12 +21279,10 @@ async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch
|
|
|
21271
21279
|
if (pending.effect.case === "historyAcquisition" && (yieldHistoryToCaller || !custody?.advanceHistory)) {
|
|
21272
21280
|
return responseFrame;
|
|
21273
21281
|
}
|
|
21274
|
-
if (pending.effect.case === "refreshCredential" && credentialRefresh === externalPeerEffect) return responseFrame;
|
|
21275
|
-
if (pending.effect.case === "deviceIdentity" && deviceIdentity === externalPeerEffect) return responseFrame;
|
|
21276
|
-
if (pending.effect.case === "lawPackage" && lawPackage === externalPeerEffect) return responseFrame;
|
|
21277
21282
|
if (pending.effect.case === "wake" && yieldWakeToCaller) return responseFrame;
|
|
21278
|
-
|
|
21279
|
-
|
|
21283
|
+
const external = pending.effect.case === "refreshCredential" && credentialRefresh === externalPeerEffect || pending.effect.case === "deviceIdentity" && deviceIdentity === externalPeerEffect || pending.effect.case === "lawPackage" && lawPackage === externalPeerEffect || pending.effect.case === "consoleEnrolment";
|
|
21284
|
+
if (external && !performExternalEffect) return responseFrame;
|
|
21285
|
+
const receipt = external ? await performExternalEffect(pending) : pending.effect.case === "http" ? await executeHttpEffect(pending.effect.value, fetchImpl) : pending.effect.case === "gitFetch" ? await executeGitFetchWithAlongside(pending.effect.value, fetchImpl) : pending.effect.case === "gitPush" ? await executeGitPushEffect(pending.effect.value, fetchImpl) : pending.effect.case === "persistBornCustody" ? create76(PeerEffectReceiptSchema, {
|
|
21280
21286
|
effectId: pending.effect.value.effectId,
|
|
21281
21287
|
outcome: {
|
|
21282
21288
|
case: "bornCustodyPersisted",
|
|
@@ -21304,7 +21310,7 @@ async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch
|
|
|
21304
21310
|
async function executeHistoryAcquisitionEffect(effect, custody) {
|
|
21305
21311
|
try {
|
|
21306
21312
|
if (!custody.advanceHistory) throw new Error("platform shell has no history acquisition capability");
|
|
21307
|
-
const progress = await custody.advanceHistory(effect.workspace);
|
|
21313
|
+
const progress = await custody.advanceHistory(effect.workspace, effect.credentialCapability);
|
|
21308
21314
|
return create76(PeerEffectReceiptSchema, {
|
|
21309
21315
|
effectId: effect.effectId,
|
|
21310
21316
|
outcome: {
|
|
@@ -21535,7 +21541,7 @@ var targetOf = (frame) => {
|
|
|
21535
21541
|
};
|
|
21536
21542
|
};
|
|
21537
21543
|
function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, maintenanceSettled, postEvent = () => {
|
|
21538
|
-
}, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage) {
|
|
21544
|
+
}, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage, performExternalEffect) {
|
|
21539
21545
|
let runner;
|
|
21540
21546
|
const configuredOrigins = new Set((shell.providerOrigins?.() ?? []).map((provider) => originOf(provider)).filter((origin) => origin !== void 0));
|
|
21541
21547
|
const permittedSocket = (url) => {
|
|
@@ -21544,10 +21550,10 @@ function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, mainten
|
|
|
21544
21550
|
return origin !== void 0 && configuredOrigins.has(origin);
|
|
21545
21551
|
};
|
|
21546
21552
|
const sockets = socketEffects(
|
|
21547
|
-
(frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, void 0, false, deviceIdentity, lawPackage),
|
|
21553
|
+
(frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, void 0, false, deviceIdentity, lawPackage, false, false, performExternalEffect),
|
|
21548
21554
|
permittedSocket
|
|
21549
21555
|
);
|
|
21550
|
-
const credentials = credentialEffects((frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, credentialRefresh, false, deviceIdentity, lawPackage), credentialRefresh);
|
|
21556
|
+
const credentials = credentialEffects((frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, credentialRefresh, false, deviceIdentity, lawPackage, false, false, performExternalEffect), credentialRefresh);
|
|
21551
21557
|
runner = createPeerOfficeFrameRunner(
|
|
21552
21558
|
kernel,
|
|
21553
21559
|
shell.credentials(),
|
|
@@ -21572,7 +21578,10 @@ function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, mainten
|
|
|
21572
21578
|
credentialRefresh,
|
|
21573
21579
|
false,
|
|
21574
21580
|
deviceIdentity,
|
|
21575
|
-
lawPackage
|
|
21581
|
+
lawPackage,
|
|
21582
|
+
false,
|
|
21583
|
+
false,
|
|
21584
|
+
performExternalEffect
|
|
21576
21585
|
);
|
|
21577
21586
|
},
|
|
21578
21587
|
shell.peerDeskStore()
|
|
@@ -21624,7 +21633,10 @@ function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, mainten
|
|
|
21624
21633
|
credentialRefresh,
|
|
21625
21634
|
yieldWakeToCaller,
|
|
21626
21635
|
deviceIdentity,
|
|
21627
|
-
lawPackage
|
|
21636
|
+
lawPackage,
|
|
21637
|
+
false,
|
|
21638
|
+
false,
|
|
21639
|
+
performExternalEffect
|
|
21628
21640
|
);
|
|
21629
21641
|
},
|
|
21630
21642
|
settleRetention: (withinMillis) => runner.settleRetention(withinMillis),
|
package/dist/full-cli.mjs
CHANGED
|
@@ -10253,7 +10253,7 @@ function runtimeKernelPort(engine) {
|
|
|
10253
10253
|
case: "resolveRef",
|
|
10254
10254
|
value: create4(ResolveRefRequestSchema, {
|
|
10255
10255
|
repo: workspaceRepositoryPath(workspace),
|
|
10256
|
-
reference: `refs/heads/${branch}`
|
|
10256
|
+
reference: branch.startsWith("refs/") ? branch : `refs/heads/${branch}`
|
|
10257
10257
|
})
|
|
10258
10258
|
}
|
|
10259
10259
|
})
|
|
@@ -11265,7 +11265,6 @@ function gitCustodyDesk(kernel, fetchImpl = fetch, observe, phaseStarted) {
|
|
|
11265
11265
|
return acquired;
|
|
11266
11266
|
},
|
|
11267
11267
|
deepenMain(workspace, ledger) {
|
|
11268
|
-
if (ledger.operatorCustody !== true) return Promise.resolve({ changed: false, complete: true });
|
|
11269
11268
|
return acquiring(workspace, ledger, "deepen-main", async () => {
|
|
11270
11269
|
if (resolveRef(workspace, branchRef("main")) === void 0) {
|
|
11271
11270
|
const acquired = await acquireMain(workspace, ledger);
|
|
@@ -11989,6 +11988,7 @@ var init_peer_platform_shell = __esm({
|
|
|
11989
11988
|
// one constitutional genesis offer. WorkspaceAccessDesk decides whether
|
|
11990
11989
|
// that exact request may proceed against the unborn kernel mount.
|
|
11991
11990
|
async openCustody(workspace) {
|
|
11991
|
+
if (physical.openLocalCustody) return physical.openLocalCustody(workspace);
|
|
11992
11992
|
await custody.acquireMain(workspace, await ledgerFor(workspace));
|
|
11993
11993
|
return {};
|
|
11994
11994
|
},
|
|
@@ -12004,7 +12004,12 @@ var init_peer_platform_shell = __esm({
|
|
|
12004
12004
|
},
|
|
12005
12005
|
persistBornCustody: (effect) => physical.persistBornCustody(effect),
|
|
12006
12006
|
retainFrontier: (effect) => physical.retainFrontier(effect),
|
|
12007
|
-
...physical.
|
|
12007
|
+
...physical.advanceHistory ? {
|
|
12008
|
+
advanceHistory: (workspace, capability) => {
|
|
12009
|
+
const credential = capability ? this.#credentials.authToken(capability) : authToken;
|
|
12010
|
+
return physical.advanceHistory(workspace, credential && new TextDecoder().decode(credential));
|
|
12011
|
+
}
|
|
12012
|
+
} : physical.completeHistoryInLocalCustody ? {
|
|
12008
12013
|
// The kernel mounts a shallow working copy; the peer's own Git custody is deep.
|
|
12009
12014
|
// One bounded slice per call; the Peer Office decides whether and when to take the next.
|
|
12010
12015
|
async advanceHistory(workspace) {
|
|
@@ -21814,10 +21819,11 @@ var init_live_correspondence_desk = __esm({
|
|
|
21814
21819
|
failures: 0,
|
|
21815
21820
|
origin,
|
|
21816
21821
|
publisher: !binding.cloudBound,
|
|
21817
|
-
published: !binding.cloudBound ? head : void 0
|
|
21822
|
+
published: !binding.cloudBound ? head : void 0,
|
|
21823
|
+
wasResident: this.kernel.isResident(binding.workspace) !== false
|
|
21818
21824
|
};
|
|
21819
21825
|
this.#links.set(binding.workspace, link);
|
|
21820
|
-
this.#open(link);
|
|
21826
|
+
if (link.wasResident) this.#open(link);
|
|
21821
21827
|
}
|
|
21822
21828
|
changed(workspace) {
|
|
21823
21829
|
const link = this.#links.get(workspace);
|
|
@@ -21974,9 +21980,11 @@ var init_live_correspondence_desk = __esm({
|
|
|
21974
21980
|
let wake;
|
|
21975
21981
|
for (const link of this.#links.values()) {
|
|
21976
21982
|
if (this.kernel.isResident(link.binding.workspace) === false) {
|
|
21977
|
-
this.disconnect(link.binding.workspace);
|
|
21983
|
+
if (link.wasResident) this.disconnect(link.binding.workspace);
|
|
21984
|
+
else wake = wake === void 0 || wake > 250n ? 250n : wake;
|
|
21978
21985
|
continue;
|
|
21979
21986
|
}
|
|
21987
|
+
link.wasResident = true;
|
|
21980
21988
|
if (link.state === "opening" && now >= link.due) {
|
|
21981
21989
|
this.#effect(link, { case: "close", value: true });
|
|
21982
21990
|
link.state = "closed";
|
|
@@ -29800,7 +29808,7 @@ var init_frame_runner = __esm({
|
|
|
29800
29808
|
|
|
29801
29809
|
// ../peer-office/src/runtime/platform_effect_driver.ts
|
|
29802
29810
|
import { create as create72, fromBinary as fromBinary25, toBinary as toBinary26 } from "@bufbuild/protobuf";
|
|
29803
|
-
async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch, custody, bornCustody, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage, yieldLocalReadToCaller = false, yieldHistoryToCaller = false) {
|
|
29811
|
+
async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch, custody, bornCustody, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage, yieldLocalReadToCaller = false, yieldHistoryToCaller = false, performExternalEffect) {
|
|
29804
29812
|
const persistBornCustody = bornCustody ?? (custody?.persistBornCustody ? (effect) => custody.persistBornCustody(effect) : void 0);
|
|
29805
29813
|
let responseFrame = runner.handleFrame(initialFrame);
|
|
29806
29814
|
const satisfied = /* @__PURE__ */ new Set();
|
|
@@ -29936,12 +29944,10 @@ async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch
|
|
|
29936
29944
|
if (pending.effect.case === "historyAcquisition" && (yieldHistoryToCaller || !custody?.advanceHistory)) {
|
|
29937
29945
|
return responseFrame;
|
|
29938
29946
|
}
|
|
29939
|
-
if (pending.effect.case === "refreshCredential" && credentialRefresh === externalPeerEffect) return responseFrame;
|
|
29940
|
-
if (pending.effect.case === "deviceIdentity" && deviceIdentity === externalPeerEffect) return responseFrame;
|
|
29941
|
-
if (pending.effect.case === "lawPackage" && lawPackage === externalPeerEffect) return responseFrame;
|
|
29942
29947
|
if (pending.effect.case === "wake" && yieldWakeToCaller) return responseFrame;
|
|
29943
|
-
|
|
29944
|
-
|
|
29948
|
+
const external = pending.effect.case === "refreshCredential" && credentialRefresh === externalPeerEffect || pending.effect.case === "deviceIdentity" && deviceIdentity === externalPeerEffect || pending.effect.case === "lawPackage" && lawPackage === externalPeerEffect || pending.effect.case === "consoleEnrolment";
|
|
29949
|
+
if (external && !performExternalEffect) return responseFrame;
|
|
29950
|
+
const receipt = external ? await performExternalEffect(pending) : pending.effect.case === "http" ? await executeHttpEffect(pending.effect.value, fetchImpl) : pending.effect.case === "gitFetch" ? await executeGitFetchWithAlongside(pending.effect.value, fetchImpl) : pending.effect.case === "gitPush" ? await executeGitPushEffect(pending.effect.value, fetchImpl) : pending.effect.case === "persistBornCustody" ? create72(PeerEffectReceiptSchema, {
|
|
29945
29951
|
effectId: pending.effect.value.effectId,
|
|
29946
29952
|
outcome: {
|
|
29947
29953
|
case: "bornCustodyPersisted",
|
|
@@ -29969,7 +29975,7 @@ async function drivePeerFrame(runner, initialFrame, fetchImpl = globalThis.fetch
|
|
|
29969
29975
|
async function executeHistoryAcquisitionEffect(effect, custody) {
|
|
29970
29976
|
try {
|
|
29971
29977
|
if (!custody.advanceHistory) throw new Error("platform shell has no history acquisition capability");
|
|
29972
|
-
const progress = await custody.advanceHistory(effect.workspace);
|
|
29978
|
+
const progress = await custody.advanceHistory(effect.workspace, effect.credentialCapability);
|
|
29973
29979
|
return create72(PeerEffectReceiptSchema, {
|
|
29974
29980
|
effectId: effect.effectId,
|
|
29975
29981
|
outcome: {
|
|
@@ -30452,7 +30458,7 @@ var init_credential_effects = __esm({
|
|
|
30452
30458
|
// ../platform-shells/shared/peer_office_host.ts
|
|
30453
30459
|
import { create as create75, fromBinary as fromBinary28, toBinary as toBinary29 } from "@bufbuild/protobuf";
|
|
30454
30460
|
function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, maintenanceSettled, postEvent = () => {
|
|
30455
|
-
}, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage) {
|
|
30461
|
+
}, credentialRefresh, yieldWakeToCaller = false, deviceIdentity, lawPackage, performExternalEffect) {
|
|
30456
30462
|
let runner;
|
|
30457
30463
|
const configuredOrigins = new Set((shell.providerOrigins?.() ?? []).map((provider) => originOf(provider)).filter((origin) => origin !== void 0));
|
|
30458
30464
|
const permittedSocket = (url) => {
|
|
@@ -30461,10 +30467,10 @@ function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, mainten
|
|
|
30461
30467
|
return origin !== void 0 && configuredOrigins.has(origin);
|
|
30462
30468
|
};
|
|
30463
30469
|
const sockets = socketEffects(
|
|
30464
|
-
(frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, void 0, false, deviceIdentity, lawPackage),
|
|
30470
|
+
(frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, void 0, false, deviceIdentity, lawPackage, false, false, performExternalEffect),
|
|
30465
30471
|
permittedSocket
|
|
30466
30472
|
);
|
|
30467
|
-
const credentials = credentialEffects((frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, credentialRefresh, false, deviceIdentity, lawPackage), credentialRefresh);
|
|
30473
|
+
const credentials = credentialEffects((frame) => drivePeerFrame(runner, frame, fetchImpl, shell.custodyPort(), void 0, credentialRefresh, false, deviceIdentity, lawPackage, false, false, performExternalEffect), credentialRefresh);
|
|
30468
30474
|
runner = createPeerOfficeFrameRunner(
|
|
30469
30475
|
kernel,
|
|
30470
30476
|
shell.credentials(),
|
|
@@ -30489,7 +30495,10 @@ function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, mainten
|
|
|
30489
30495
|
credentialRefresh,
|
|
30490
30496
|
false,
|
|
30491
30497
|
deviceIdentity,
|
|
30492
|
-
lawPackage
|
|
30498
|
+
lawPackage,
|
|
30499
|
+
false,
|
|
30500
|
+
false,
|
|
30501
|
+
performExternalEffect
|
|
30493
30502
|
);
|
|
30494
30503
|
},
|
|
30495
30504
|
shell.peerDeskStore()
|
|
@@ -30541,7 +30550,10 @@ function openPeerOfficeHost(kernel, shell, fetchImpl = globalThis.fetch, mainten
|
|
|
30541
30550
|
credentialRefresh,
|
|
30542
30551
|
yieldWakeToCaller,
|
|
30543
30552
|
deviceIdentity,
|
|
30544
|
-
lawPackage
|
|
30553
|
+
lawPackage,
|
|
30554
|
+
false,
|
|
30555
|
+
false,
|
|
30556
|
+
performExternalEffect
|
|
30545
30557
|
);
|
|
30546
30558
|
},
|
|
30547
30559
|
settleRetention: (withinMillis) => runner.settleRetention(withinMillis),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "githolon",
|
|
3
|
-
"version": "0.112.
|
|
3
|
+
"version": "0.112.2",
|
|
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.112.
|
|
33
|
+
"@githolon/dsl": "^0.112.2",
|
|
34
34
|
"fast-xml-parser": "5.10.1",
|
|
35
35
|
"isomorphic-git": "^1.38.4",
|
|
36
36
|
"tsx": "^4.19.2",
|