@githolon/runtime 0.112.5 → 0.112.6
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/RUNTIME-SOURCES.sha256 +5 -3
- package/dist/nomos-runner.js +302 -21
- package/package.json +1 -1
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
33e7d6bdd22396057d3f8db92384079f7ec2fda4b3582709de2d43fccacc4a9c node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js
|
|
70
70
|
34f8712de2bd30a2cb8366d8cfdcde466d979f1a28ac0d78f7547341b01f6c57 adapter/proto/nomos/kernel/v1/progress_pb.js
|
|
71
71
|
3a90933569db7e42ec2ed3b77509c29d1ab75f6eb078f53fe5d1ac6d239d231e peer-office/src/runtime/peer_background_scheduler.ts
|
|
72
|
+
3b29007c75a5f51ad2eb490a828c3943ece28a0b3aaecfc7e416b1b35076e236 peer-office/package/package.json
|
|
72
73
|
3c092b8d4185badd23ecf4552434d05aa541b0cd0d534781d687db55260d5da8 adapter/proto/nomos/runtime/v2/sealing_desk_pb.js
|
|
73
74
|
3c98fa838c05abcfd8dfda1128f2d1fca9b196a371fe9751abbd8f4c3b9d04ec node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js
|
|
74
75
|
3d05089a8c1008f20e06da9907eec7f8824f871edfc95e907c15dc8e2bdf43e7 node_modules/@bufbuild/protobuf/dist/esm/extensions.js
|
|
@@ -105,7 +106,6 @@
|
|
|
105
106
|
589afd70975c49b5d8856a85ffb597b1412f04b35b6234c324564d8640fcae15 node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js
|
|
106
107
|
59ceb09d3fd2402e81ed7e5992245f2b398c7ceeb80141138f4eab5da0244586 node_modules/is-unsafe/src/contexts/redos.js
|
|
107
108
|
59dd7fdcd3eac52054ff1edd4667fbadb66c851a66f60ec528f9db6421a0eed9 node_modules/@bufbuild/protobuf/dist/esm/codegenv2/restore-json-names.js
|
|
108
|
-
5ac35f182ca8cdf2e187276f9c961a20799d7a2d64f3de3f5217d12ed3420890 peer-office/package/package.json
|
|
109
109
|
5c47d871d691707bfa347b2c9199b433e277332ba4c523a4eb802d8c5cded105 peer-office/src/runtime/office_seat.ts
|
|
110
110
|
5ce7673a392e7c11100428b040d6c9a08242021e33f859b2ad670edef31d80de node_modules/@bufbuild/protobuf/dist/esm/from-binary.js
|
|
111
111
|
5cf55a0f51490590bf56e1ff2d6dd11002f8a8b43b0bc661d2cc15a6c6e0e981 adapter/git-fs.ts
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
71de64c0b205eed7bcbbe11bd937a363c83cb5ab8e9977c4bb4b73b3c5353cf3 peer-office/src/runtime/placement_discovery_desk.ts
|
|
128
128
|
71edee071faa5f0ebbeda63fa23e009983da9e413db2340feb6287d95f497dcd node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js
|
|
129
129
|
720eb959038ea5a41d7ce358d5fb1f575199db3f4f90267bdaf0314440290546 platform-shells/node/sqlite_peer_desk_store.ts
|
|
130
|
+
722cbe0b307c0e525ea25709dd7d6b307ec3413ab6887b2cc3a573995fd003e1 platform-shells/browser/kernel_work.ts
|
|
130
131
|
7287f23bb63a7f10dbacc04c773050dcc279299948a70cec5a9a3a040be2a933 platform-shells/node/kernel_wasi_stdio.ts
|
|
131
132
|
72f4dbde9d104ea96276198f8fab8b32e1a296d7ae57b74f8f175472627c2546 peer-office/src/runtime/custody_return_delta.ts
|
|
132
133
|
73e489001027c703bc0224ae73f78ecefe028e88284bd06952e8603c3d81472c node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js
|
|
@@ -178,13 +179,13 @@
|
|
|
178
179
|
98f70a85fe9d2578c977bbf26927910479cef472100b5ed7bebd4c390e79213c peer-office/src/runtime/workspace_access_desk.ts
|
|
179
180
|
99ce0b71dc7acc73e48634ff609eeb3620cf24b524e89835e804d37fb6b51b2c adapter/offer_transport_contract.ts
|
|
180
181
|
9a3d4c2296b0139778c8f61319349eac6dc0cdb723688f41ebf3c135dca85702 peer-office/src/runtime/history_acquisition_state.ts
|
|
182
|
+
9b07729add8df9f24781f3135c821781e943780ef3374b16a884850949a6890a platform-shells/browser/peer.ts
|
|
181
183
|
9b1e46d587a9ad5d1531a5755ba4feccd2878de77749edce8a0086db3eb2217d peer-office/src/runtime/admission_durability_desk.ts
|
|
182
184
|
9c4c967ea6c149011acb8aabfbadb73651f84d572335c48391d627e5283c0cd0 node_modules/@bufbuild/protobuf/dist/esm/fields.js
|
|
183
185
|
9e1bf39540fd14df32aa2307c44dd4d93a40a6024199f334ccf3db001f44a7f6 peer-office/src/runtime/local_copy_readability.ts
|
|
184
186
|
9e82e1fc1bfd3e3573f64349dc42b4b624ed61d24e5c553f2bb4d041444f166c node_modules/@bjorn3/browser_wasi_shim/dist/fd.js
|
|
185
187
|
9efa0e5824cc0370ea3596b30cd57ea860df0bae95a0caccbbfe97d845a7a09b peer-office/src/runtime/custody_offer.ts
|
|
186
188
|
9f7a3b2bb0e2a2da849fd9101228bd9c9682b39d667e20900dd172d954b1a548 peer-office/src/runtime/observability_desk.ts
|
|
187
|
-
9fa129d6ec52dea4f992be9bc3786fca75fdf733903f489ca8b954eadbd90078 platform-shells/browser/entry.ts
|
|
188
189
|
a0eca2694871be026546039e99a71291822d01ba81943d44e69a14b2d766fd1a peer-office/src/runtime/custody_desk.ts
|
|
189
190
|
a0fcc6110f1154fd197a8ce056e2008dbc7d1750f8dd3ba77c3910af928ed3a1 node_modules/uri-js/dist/es5/uri.all.js
|
|
190
191
|
a33120feed1faf765328722cee117f63e2147cb87052120fdacc9bd1086e67ab peer-office/src/runtime/receiving_group_framework_wire.generated.ts
|
|
@@ -193,6 +194,7 @@ a51ad595569ec83af14644004083aad7f5086703dd46d609e8b006e36bac0f55 peer-office/sr
|
|
|
193
194
|
a5540af900952b2ea7fde1fa967d624d427bcec5f3d1d89f3e78453a8624c650 peer-office/src/runtime/identity_witness_cache.ts
|
|
194
195
|
a56cf2bf8174e0adf94970d70e003afcfc3923a53d0cf973f92d374cfe684544 node_modules/@nodable/entities/src/EntityDecoder.js
|
|
195
196
|
a6250aa83ce7f238614fb7421f31e541c63c415a295e3764687693464918f3c4 node_modules/path-expression-matcher/src/ExpressionSet.js
|
|
197
|
+
a7273df68b1a53d1efbc3919f0224119fcec335774a99f38e952dc8354ec375d platform-shells/browser/entry.ts
|
|
196
198
|
a79a133a4f4ae9559b127aca26b20b0b40af3b6a2cc17d75bedbd413d78276af peer-office/src/runtime/receiving_group_desk.ts
|
|
197
199
|
a91848ee180529e2a60c05dfb9584cad19cd4e1c6f391fdb76a938bcae4c0328 node_modules/@bjorn3/browser_wasi_shim/dist/debug.js
|
|
198
200
|
a98127162afc0a5038171882b19d62f1c035cc8706f2463fda52fdf73c8c21bc peer-office/src/runtime/live_correspondence_desk.ts
|
|
@@ -237,7 +239,6 @@ c41faf95c6c33b80349ff96f8127153672a6e6bf8bb9593f7aa67d2e2e642684 peer-office/sr
|
|
|
237
239
|
c649d39c53ebe6817c71407de8105b6d8cbc2326867f90d59f49ab02d9271b44 node_modules/anynum/digitTable.js
|
|
238
240
|
c6c85d892e445a8f84e9f628f2ac1ac6766103e90bb502ee9c101774831c4f0c peer-office/src/runtime/command_preparation_desk.ts
|
|
239
241
|
c87f55e284241bdf08e06a54b09567c329e8cc24519dbd08f064d0230a19f8fd peer-office/src/runtime/correspondence_work_registry.ts
|
|
240
|
-
c884aa80ac787299da2ec4ebd930c78372d82e227363980cc6a3baf08daf1889 platform-shells/browser/peer.ts
|
|
241
242
|
caa925cb881f7586e9e01f09325f09ebdecf742debbfff21eb7c4c49ea09ef02 node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js
|
|
242
243
|
cb095614d5f901cd00d46b930a23c64ebd909a77831aa666768fca47f3e7745f node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js
|
|
243
244
|
cce0e8a8876bd1d3305a666e70cd556fd1ae57560fbca9f4ff0577d91178a0b1 node_modules/fast-xml-parser/src/xmlparser/node2json.js
|
|
@@ -262,6 +263,7 @@ db05a3f19bc575c1ed771fc6882af337a49cde7bd469181f3acc772d1a76df3e node_modules/@
|
|
|
262
263
|
db61a17ab4dbb3514b676cd93cc702fe62a6582d5ec292725f1ada20dfbc1f72 peer-office/src/runtime/custody_replacement.ts
|
|
263
264
|
dd9f3f24fb154cfbfbde94e8f2647647c80c8ca050b98e981a407e760a4b9c1e node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js
|
|
264
265
|
deaa25227d669aa3fbe99174275588dcc175de648ae6623fddf11d6ae69d7f67 platform-shells/node/local-development/peer_process.ts
|
|
266
|
+
dff6af323ca5f9c73dd06120879fcd5f561d22a8a7fd36d3317e564ae4e10e3b platform-shells/shared/kernel_work_accounting.ts
|
|
265
267
|
e20a132033f105a29db1cfdb3d85bbadbb7206b9a7e3336bcb030a63d66b4ab2 node_modules/is-unsafe/src/contexts/nosql.js
|
|
266
268
|
e2133d7e0f0ce5491a3e9bd560e9e47db2243a6a9f762be89c82e027d99d278e peer-office/src/runtime/credential_sessions.ts
|
|
267
269
|
e34016b82b6f6e4c4a1cc2dd44ccd14a348e8156a1f6c5aeeb2c7fc36a15b8f9 adapter/proto/nomos/kernel/v1/kernel_pb.js
|
package/dist/nomos-runner.js
CHANGED
|
@@ -8108,6 +8108,10 @@
|
|
|
8108
8108
|
var ResidencyPressureRelievedSchema = /* @__PURE__ */ messageDesc(file_nomos_runtime_v2_residency_desk, 2);
|
|
8109
8109
|
var ResidentPlacementSchema = /* @__PURE__ */ messageDesc(file_nomos_runtime_v2_residency_desk, 6);
|
|
8110
8110
|
var ResidentOutboxSchema = /* @__PURE__ */ messageDesc(file_nomos_runtime_v2_residency_desk, 7);
|
|
8111
|
+
var KernelWorkCounterSchema = /* @__PURE__ */ messageDesc(file_nomos_runtime_v2_residency_desk, 8);
|
|
8112
|
+
var KernelWorkCpuBucketSchema = /* @__PURE__ */ messageDesc(file_nomos_runtime_v2_residency_desk, 9);
|
|
8113
|
+
var ActiveKernelWorkSchema = /* @__PURE__ */ messageDesc(file_nomos_runtime_v2_residency_desk, 10);
|
|
8114
|
+
var KernelWorkSnapshotSchema = /* @__PURE__ */ messageDesc(file_nomos_runtime_v2_residency_desk, 11);
|
|
8111
8115
|
var CorrespondenceHoldSchema = /* @__PURE__ */ messageDesc(file_nomos_runtime_v2_residency_desk, 18);
|
|
8112
8116
|
var LocalHistoryPostureSchema = /* @__PURE__ */ enumDesc(file_nomos_runtime_v2_residency_desk, 1);
|
|
8113
8117
|
var LocalHistoryPosture = /* @__PURE__ */ tsEnum(LocalHistoryPostureSchema);
|
|
@@ -10408,6 +10412,274 @@
|
|
|
10408
10412
|
// ../../adapter/kernel_execution_desk.ts
|
|
10409
10413
|
var kernelExecutionDesk = (machine) => runtimeKernelPort(machine);
|
|
10410
10414
|
|
|
10415
|
+
// ../../platform-shells/shared/kernel_work_accounting.ts
|
|
10416
|
+
init_define_NOMOS_KERNEL_RELEASE();
|
|
10417
|
+
init_shims();
|
|
10418
|
+
var KERNEL_WORK_CPU_BUCKET_MICROS = [
|
|
10419
|
+
100,
|
|
10420
|
+
250,
|
|
10421
|
+
500,
|
|
10422
|
+
1e3,
|
|
10423
|
+
2500,
|
|
10424
|
+
5e3,
|
|
10425
|
+
1e4,
|
|
10426
|
+
25e3,
|
|
10427
|
+
5e4,
|
|
10428
|
+
1e5,
|
|
10429
|
+
25e4,
|
|
10430
|
+
5e5,
|
|
10431
|
+
1e6,
|
|
10432
|
+
25e5,
|
|
10433
|
+
5e6,
|
|
10434
|
+
1e7,
|
|
10435
|
+
3e7,
|
|
10436
|
+
6e7
|
|
10437
|
+
];
|
|
10438
|
+
var custodyValidation = /* @__PURE__ */ new Set([
|
|
10439
|
+
"inspectChange",
|
|
10440
|
+
"inspectRefusalVerdict",
|
|
10441
|
+
"lawClosureInfo",
|
|
10442
|
+
"resolveStatePosition",
|
|
10443
|
+
"proveCompactionEquivalence"
|
|
10444
|
+
]);
|
|
10445
|
+
var custodyOpenRestore = /* @__PURE__ */ new Set([
|
|
10446
|
+
"checkpointExport",
|
|
10447
|
+
"checkpointImport",
|
|
10448
|
+
"restoreMain",
|
|
10449
|
+
"openGitState",
|
|
10450
|
+
"attachLocalFrontier",
|
|
10451
|
+
"releaseWorkspaceState"
|
|
10452
|
+
]);
|
|
10453
|
+
var custodyWrites = /* @__PURE__ */ new Set([
|
|
10454
|
+
"writeRef",
|
|
10455
|
+
"deleteRef",
|
|
10456
|
+
"writeMetaCommit",
|
|
10457
|
+
"recordWorkspaceEffectOutcome"
|
|
10458
|
+
]);
|
|
10459
|
+
var custodyTransfers = /* @__PURE__ */ new Set([
|
|
10460
|
+
"packDelta",
|
|
10461
|
+
"applyPack",
|
|
10462
|
+
"intentsAbove",
|
|
10463
|
+
"historySummary",
|
|
10464
|
+
"readBlob",
|
|
10465
|
+
"resolveRef",
|
|
10466
|
+
"listRefs"
|
|
10467
|
+
]);
|
|
10468
|
+
var telemetryMeasurements = /* @__PURE__ */ new Set(["residentFootprint", "aggregateCensus"]);
|
|
10469
|
+
var lawQueries = /* @__PURE__ */ new Set([
|
|
10470
|
+
"authorizationCheck",
|
|
10471
|
+
"authorizationExpand",
|
|
10472
|
+
"frontierTransition",
|
|
10473
|
+
"ownedDeviceRequest",
|
|
10474
|
+
"ownedPrepareApproval",
|
|
10475
|
+
"authenticationPosture",
|
|
10476
|
+
"authoringRequirements",
|
|
10477
|
+
"identityProviderWitness",
|
|
10478
|
+
"interfaceCompatibility"
|
|
10479
|
+
]);
|
|
10480
|
+
var authoringOperations = /* @__PURE__ */ new Set([
|
|
10481
|
+
"signPreparedOffer",
|
|
10482
|
+
"prepareRemoteOffer",
|
|
10483
|
+
"signOfferPreparation"
|
|
10484
|
+
]);
|
|
10485
|
+
var cryptographicOperations = /* @__PURE__ */ new Set([
|
|
10486
|
+
"signBirthCertificate",
|
|
10487
|
+
"signingIdentity",
|
|
10488
|
+
"signAuthorityAttestation",
|
|
10489
|
+
"mintTypedId",
|
|
10490
|
+
"encryptionIdentity",
|
|
10491
|
+
"wrapScopeKey",
|
|
10492
|
+
"unwrapScopeKey"
|
|
10493
|
+
]);
|
|
10494
|
+
function classifyKernelWork(frame) {
|
|
10495
|
+
try {
|
|
10496
|
+
const decoded = fromBinary(CallRequestSchema, frame);
|
|
10497
|
+
const operation = decoded.operation;
|
|
10498
|
+
if (!operation.case) return { family: "other", operation: "unspecified" };
|
|
10499
|
+
if (operation.case === "query") {
|
|
10500
|
+
const detail = operation.value.query.case || "unspecified";
|
|
10501
|
+
const family = detail === "maintenanceQuantum" ? "read_index_maintenance" : detail === "fullHistoryAudit" ? "custody_validation" : lawQueries.has(detail) ? "law_evaluation" : "read_query";
|
|
10502
|
+
return { family, operation: `query.${detail}`, workspace: operation.value.target?.workspace };
|
|
10503
|
+
}
|
|
10504
|
+
if (operation.case === "custody") {
|
|
10505
|
+
const detail = operation.value.operation.case || "unspecified";
|
|
10506
|
+
const value = operation.value.operation.value;
|
|
10507
|
+
const target3 = value && "target" in value ? value.target : void 0;
|
|
10508
|
+
const workspace = typeof target3 === "string" ? target3 : target3?.workspace;
|
|
10509
|
+
const family = telemetryMeasurements.has(detail) ? "telemetry_measurement" : custodyValidation.has(detail) ? "custody_validation" : custodyOpenRestore.has(detail) ? "custody_open_restore" : custodyWrites.has(detail) ? "git_state_write" : custodyTransfers.has(detail) ? "sync_transfer" : "custody_inspection";
|
|
10510
|
+
return { family, operation: `custody.${detail}`, workspace };
|
|
10511
|
+
}
|
|
10512
|
+
if (operation.case === "offer") {
|
|
10513
|
+
const detail = operation.value.intent.case || "unspecified";
|
|
10514
|
+
return {
|
|
10515
|
+
family: "offer_adjudication",
|
|
10516
|
+
operation: `offer.${detail}`,
|
|
10517
|
+
workspace: operation.value.target?.workspace
|
|
10518
|
+
};
|
|
10519
|
+
}
|
|
10520
|
+
if (operation.case === "open") {
|
|
10521
|
+
return {
|
|
10522
|
+
family: "custody_open_restore",
|
|
10523
|
+
operation: "open",
|
|
10524
|
+
workspace: operation.value.target?.workspace
|
|
10525
|
+
};
|
|
10526
|
+
}
|
|
10527
|
+
if (operation.case === "outbox") {
|
|
10528
|
+
return {
|
|
10529
|
+
family: "correspondence_outbox",
|
|
10530
|
+
operation: operation.value.prepare ? "outbox.prepare" : "outbox.inventory",
|
|
10531
|
+
workspace: operation.value.target?.workspace
|
|
10532
|
+
};
|
|
10533
|
+
}
|
|
10534
|
+
if (operation.case === "sync") {
|
|
10535
|
+
return { family: "sync_transfer", operation: "sync", workspace: operation.value.target?.workspace };
|
|
10536
|
+
}
|
|
10537
|
+
if (operation.case === "configure") return { family: "configuration", operation: "configure" };
|
|
10538
|
+
if (authoringOperations.has(operation.case)) {
|
|
10539
|
+
return { family: "offer_authoring", operation: operation.case };
|
|
10540
|
+
}
|
|
10541
|
+
if (cryptographicOperations.has(operation.case)) {
|
|
10542
|
+
return { family: "cryptography", operation: operation.case };
|
|
10543
|
+
}
|
|
10544
|
+
return { family: "other", operation: operation.case };
|
|
10545
|
+
} catch {
|
|
10546
|
+
return { family: "other", operation: "undecodable" };
|
|
10547
|
+
}
|
|
10548
|
+
}
|
|
10549
|
+
function classifyCompletedKernelWork(work, result) {
|
|
10550
|
+
if (work.family !== "offer_adjudication") return work;
|
|
10551
|
+
try {
|
|
10552
|
+
if (result) {
|
|
10553
|
+
const response = fromBinary(CallResponseSchema, result);
|
|
10554
|
+
if (response.outcome.case === "offer" && response.outcome.value.outcome.case === "admitted") {
|
|
10555
|
+
const admitted = response.outcome.value.outcome.value;
|
|
10556
|
+
if (!admitted.dryRun && !admitted.placement && !admitted.alreadyApplied) {
|
|
10557
|
+
return { ...work, family: "offer_admitted" };
|
|
10558
|
+
}
|
|
10559
|
+
}
|
|
10560
|
+
}
|
|
10561
|
+
} catch {
|
|
10562
|
+
}
|
|
10563
|
+
return { ...work, family: "offer_not_admitted" };
|
|
10564
|
+
}
|
|
10565
|
+
var _counters, _activeChanged, _cpuAvailable, _startedUnixMillis, _active;
|
|
10566
|
+
var KernelWorkAccounting = class {
|
|
10567
|
+
constructor(activeChanged, cpuAvailable = true) {
|
|
10568
|
+
__privateAdd(this, _counters, /* @__PURE__ */ new Map());
|
|
10569
|
+
__privateAdd(this, _activeChanged);
|
|
10570
|
+
__privateAdd(this, _cpuAvailable);
|
|
10571
|
+
__privateAdd(this, _startedUnixMillis, Date.now());
|
|
10572
|
+
__privateAdd(this, _active);
|
|
10573
|
+
__privateSet(this, _activeChanged, activeChanged);
|
|
10574
|
+
__privateSet(this, _cpuAvailable, cpuAvailable);
|
|
10575
|
+
}
|
|
10576
|
+
begin(work, startedUnixMillis) {
|
|
10577
|
+
var _a;
|
|
10578
|
+
__privateSet(this, _active, create(ActiveKernelWorkSchema, {
|
|
10579
|
+
family: work.family,
|
|
10580
|
+
operation: work.operation,
|
|
10581
|
+
startedUnixMillis: BigInt(startedUnixMillis)
|
|
10582
|
+
}));
|
|
10583
|
+
try {
|
|
10584
|
+
(_a = __privateGet(this, _activeChanged)) == null ? void 0 : _a.call(this, __privateGet(this, _active));
|
|
10585
|
+
} catch {
|
|
10586
|
+
}
|
|
10587
|
+
}
|
|
10588
|
+
complete(work, elapsedMillis2, cpuMicros, completed) {
|
|
10589
|
+
var _a;
|
|
10590
|
+
const key = `${work.family}\0${work.operation}`;
|
|
10591
|
+
let counter = __privateGet(this, _counters).get(key);
|
|
10592
|
+
if (!counter) {
|
|
10593
|
+
counter = {
|
|
10594
|
+
calls: 0n,
|
|
10595
|
+
failures: 0n,
|
|
10596
|
+
cpuMicros: __privateGet(this, _cpuAvailable) ? 0n : void 0,
|
|
10597
|
+
wallMicros: 0n,
|
|
10598
|
+
bucketCalls: __privateGet(this, _cpuAvailable) ? KERNEL_WORK_CPU_BUCKET_MICROS.map(() => 0n) : [],
|
|
10599
|
+
lastCompletedUnixMillis: 0n
|
|
10600
|
+
};
|
|
10601
|
+
__privateGet(this, _counters).set(key, counter);
|
|
10602
|
+
}
|
|
10603
|
+
const boundedCpuMicros = cpuMicros === void 0 ? void 0 : Math.max(0, Math.round(cpuMicros));
|
|
10604
|
+
counter.calls += 1n;
|
|
10605
|
+
if (!completed) counter.failures += 1n;
|
|
10606
|
+
if (boundedCpuMicros !== void 0 && counter.cpuMicros !== void 0) {
|
|
10607
|
+
counter.cpuMicros += BigInt(boundedCpuMicros);
|
|
10608
|
+
}
|
|
10609
|
+
counter.wallMicros += BigInt(Math.max(0, Math.round(elapsedMillis2 * 1e3)));
|
|
10610
|
+
counter.lastCompletedUnixMillis = BigInt(Date.now());
|
|
10611
|
+
for (let index = 0; boundedCpuMicros !== void 0 && index < counter.bucketCalls.length; index += 1) {
|
|
10612
|
+
if (boundedCpuMicros <= KERNEL_WORK_CPU_BUCKET_MICROS[index]) counter.bucketCalls[index] += 1n;
|
|
10613
|
+
}
|
|
10614
|
+
__privateSet(this, _active, void 0);
|
|
10615
|
+
try {
|
|
10616
|
+
(_a = __privateGet(this, _activeChanged)) == null ? void 0 : _a.call(this, void 0);
|
|
10617
|
+
} catch {
|
|
10618
|
+
}
|
|
10619
|
+
}
|
|
10620
|
+
snapshot(observedUnixMillis = Date.now()) {
|
|
10621
|
+
const counters = [...__privateGet(this, _counters).entries()].sort(([left], [right]) => left.localeCompare(right)).map(([key, value]) => {
|
|
10622
|
+
const [family, operation] = key.split("\0");
|
|
10623
|
+
return create(KernelWorkCounterSchema, {
|
|
10624
|
+
family,
|
|
10625
|
+
operation,
|
|
10626
|
+
calls: value.calls,
|
|
10627
|
+
failures: value.failures,
|
|
10628
|
+
cpuMicros: value.cpuMicros,
|
|
10629
|
+
wallMicros: value.wallMicros,
|
|
10630
|
+
cpuBuckets: value.bucketCalls.map((calls, index) => create(KernelWorkCpuBucketSchema, { leMicros: BigInt(KERNEL_WORK_CPU_BUCKET_MICROS[index]), calls })),
|
|
10631
|
+
lastCompletedUnixMillis: value.lastCompletedUnixMillis
|
|
10632
|
+
});
|
|
10633
|
+
});
|
|
10634
|
+
return create(KernelWorkSnapshotSchema, {
|
|
10635
|
+
startedUnixMillis: BigInt(__privateGet(this, _startedUnixMillis)),
|
|
10636
|
+
observedUnixMillis: BigInt(observedUnixMillis),
|
|
10637
|
+
counters,
|
|
10638
|
+
active: __privateGet(this, _active)
|
|
10639
|
+
});
|
|
10640
|
+
}
|
|
10641
|
+
reset() {
|
|
10642
|
+
var _a;
|
|
10643
|
+
__privateGet(this, _counters).clear();
|
|
10644
|
+
__privateSet(this, _startedUnixMillis, Date.now());
|
|
10645
|
+
__privateSet(this, _active, void 0);
|
|
10646
|
+
try {
|
|
10647
|
+
(_a = __privateGet(this, _activeChanged)) == null ? void 0 : _a.call(this, void 0);
|
|
10648
|
+
} catch {
|
|
10649
|
+
}
|
|
10650
|
+
}
|
|
10651
|
+
};
|
|
10652
|
+
_counters = new WeakMap();
|
|
10653
|
+
_activeChanged = new WeakMap();
|
|
10654
|
+
_cpuAvailable = new WeakMap();
|
|
10655
|
+
_startedUnixMillis = new WeakMap();
|
|
10656
|
+
_active = new WeakMap();
|
|
10657
|
+
|
|
10658
|
+
// ../../platform-shells/browser/kernel_work.ts
|
|
10659
|
+
init_define_NOMOS_KERNEL_RELEASE();
|
|
10660
|
+
init_shims();
|
|
10661
|
+
function observeBrowserKernelCalls(kernel, accounting, now = () => performance.now()) {
|
|
10662
|
+
return {
|
|
10663
|
+
...kernel,
|
|
10664
|
+
call(frame) {
|
|
10665
|
+
const work = classifyKernelWork(frame);
|
|
10666
|
+
accounting.begin(work, Date.now());
|
|
10667
|
+
const started = now();
|
|
10668
|
+
let completed = false;
|
|
10669
|
+
let completedWork = work;
|
|
10670
|
+
try {
|
|
10671
|
+
const result = kernel.call(frame);
|
|
10672
|
+
completedWork = classifyCompletedKernelWork(work, result);
|
|
10673
|
+
completed = true;
|
|
10674
|
+
return result;
|
|
10675
|
+
} finally {
|
|
10676
|
+
if (!completed) completedWork = classifyCompletedKernelWork(work);
|
|
10677
|
+
accounting.complete(completedWork, now() - started, void 0, completed);
|
|
10678
|
+
}
|
|
10679
|
+
}
|
|
10680
|
+
};
|
|
10681
|
+
}
|
|
10682
|
+
|
|
10411
10683
|
// ../../adapter/git_custody_desk.ts
|
|
10412
10684
|
init_define_NOMOS_KERNEL_RELEASE();
|
|
10413
10685
|
init_shims();
|
|
@@ -14749,7 +15021,7 @@
|
|
|
14749
15021
|
}
|
|
14750
15022
|
|
|
14751
15023
|
// ../src/runtime/credential_recovery_desk.ts
|
|
14752
|
-
var _ports, _waiting, _background, _renewing,
|
|
15024
|
+
var _ports, _waiting, _background, _renewing, _active2, _replicaWaiters, _joining, _completed2, _sequence2, _CredentialRecoveryDesk_instances, now_fn, unixMillis_fn, tokenless_fn, prune_fn, begin_fn, wake_fn, callOnce_fn, remember_fn2, finishReplicaWaiters_fn;
|
|
14753
15025
|
var CredentialRecoveryDesk = class {
|
|
14754
15026
|
constructor(ports) {
|
|
14755
15027
|
__privateAdd(this, _CredentialRecoveryDesk_instances);
|
|
@@ -14759,7 +15031,7 @@
|
|
|
14759
15031
|
/** Capabilities whose renewal-ahead-of-expiry is in flight: one refresh per capability, not one per offer. */
|
|
14760
15032
|
__privateAdd(this, _renewing, /* @__PURE__ */ new Map());
|
|
14761
15033
|
/** One physical acquisition per capability; other callers wait outside the serial kernel lane. */
|
|
14762
|
-
__privateAdd(this,
|
|
15034
|
+
__privateAdd(this, _active2, /* @__PURE__ */ new Map());
|
|
14763
15035
|
/** Headless follows joining an interaction-owned refresh of the same
|
|
14764
15036
|
* capability. They need no synthetic session or second provider request. */
|
|
14765
15037
|
__privateAdd(this, _replicaWaiters, /* @__PURE__ */ new Map());
|
|
@@ -14797,7 +15069,7 @@
|
|
|
14797
15069
|
request: fromBinary(RuntimeRequestSchema, toBinary(RuntimeRequestSchema, request))
|
|
14798
15070
|
}, { allowCached: false, rejectCurrent: false });
|
|
14799
15071
|
if (step.case !== "pending") throw new Error("credential renewal did not produce its physical paper");
|
|
14800
|
-
__privateGet(this, _renewing).set(capability, __privateGet(this,
|
|
15072
|
+
__privateGet(this, _renewing).set(capability, __privateGet(this, _active2).get(capability));
|
|
14801
15073
|
return step;
|
|
14802
15074
|
}
|
|
14803
15075
|
beginOffer(request, command, response) {
|
|
@@ -14812,7 +15084,7 @@
|
|
|
14812
15084
|
ensurePresent(session) {
|
|
14813
15085
|
if (__privateGet(this, _ports).authToken(session).byteLength > 0 || __privateMethod(this, _CredentialRecoveryDesk_instances, tokenless_fn).call(this, session)) return true;
|
|
14814
15086
|
__privateMethod(this, _CredentialRecoveryDesk_instances, prune_fn).call(this);
|
|
14815
|
-
const active = __privateGet(this,
|
|
15087
|
+
const active = __privateGet(this, _active2).get(__privateGet(this, _ports).capabilityFor(session));
|
|
14816
15088
|
if (active !== void 0) {
|
|
14817
15089
|
__privateGet(this, _waiting).get(active)?.affectedSessions.add(session);
|
|
14818
15090
|
return false;
|
|
@@ -14826,7 +15098,7 @@
|
|
|
14826
15098
|
if (!syncNeedsCredentialRefresh(event.result, event.failure) || __privateMethod(this, _CredentialRecoveryDesk_instances, tokenless_fn).call(this, session)) return;
|
|
14827
15099
|
__privateMethod(this, _CredentialRecoveryDesk_instances, prune_fn).call(this);
|
|
14828
15100
|
const capability = __privateGet(this, _ports).capabilityFor(session);
|
|
14829
|
-
const existing = __privateGet(this,
|
|
15101
|
+
const existing = __privateGet(this, _active2).get(capability);
|
|
14830
15102
|
if (existing !== void 0) {
|
|
14831
15103
|
__privateGet(this, _waiting).get(existing)?.affectedSessions.add(session);
|
|
14832
15104
|
return;
|
|
@@ -14844,7 +15116,7 @@
|
|
|
14844
15116
|
return { case: "refreshed", value: create(CredentialsRefreshedSchema, { session: capability }) };
|
|
14845
15117
|
}
|
|
14846
15118
|
__privateMethod(this, _CredentialRecoveryDesk_instances, prune_fn).call(this);
|
|
14847
|
-
if (__privateGet(this,
|
|
15119
|
+
if (__privateGet(this, _active2).has(capability)) {
|
|
14848
15120
|
const waiting = __privateGet(this, _replicaWaiters).get(capability) ?? /* @__PURE__ */ new Set();
|
|
14849
15121
|
waiting.add(workspace);
|
|
14850
15122
|
__privateGet(this, _replicaWaiters).set(capability, waiting);
|
|
@@ -14893,7 +15165,7 @@
|
|
|
14893
15165
|
__privateGet(this, _waiting).delete(command.workId);
|
|
14894
15166
|
if (__privateGet(this, _background).get(work.capability) === command.workId) __privateGet(this, _background).delete(work.capability);
|
|
14895
15167
|
if (__privateGet(this, _renewing).get(work.capability) === command.workId) __privateGet(this, _renewing).delete(work.capability);
|
|
14896
|
-
if (__privateGet(this,
|
|
15168
|
+
if (__privateGet(this, _active2).get(work.capability) === command.workId) __privateGet(this, _active2).delete(work.capability);
|
|
14897
15169
|
const sameContext = __privateMethod(this, _CredentialRecoveryDesk_instances, now_fn).call(this) < work.expiresAt && (work.directCapability || __privateGet(this, _ports).capabilityFor(work.session) === work.capability) && (work.directCapability ? __privateGet(this, _ports).deviceChallengeForCapability(work.capability) : __privateGet(this, _ports).deviceChallenge(work.session)) === work.deviceChallenge;
|
|
14898
15170
|
const material = sameContext && receipt.outcome.case === "credentialRefreshed" ? receipt.outcome.value : void 0;
|
|
14899
15171
|
let refreshed = create(CredentialsRefreshedSchema, { session: work.session });
|
|
@@ -14930,7 +15202,7 @@
|
|
|
14930
15202
|
clear() {
|
|
14931
15203
|
__privateGet(this, _waiting).clear();
|
|
14932
15204
|
__privateGet(this, _joining).clear();
|
|
14933
|
-
__privateGet(this,
|
|
15205
|
+
__privateGet(this, _active2).clear();
|
|
14934
15206
|
__privateGet(this, _replicaWaiters).clear();
|
|
14935
15207
|
__privateGet(this, _background).clear();
|
|
14936
15208
|
__privateGet(this, _renewing).clear();
|
|
@@ -14941,7 +15213,7 @@
|
|
|
14941
15213
|
_waiting = new WeakMap();
|
|
14942
15214
|
_background = new WeakMap();
|
|
14943
15215
|
_renewing = new WeakMap();
|
|
14944
|
-
|
|
15216
|
+
_active2 = new WeakMap();
|
|
14945
15217
|
_replicaWaiters = new WeakMap();
|
|
14946
15218
|
_joining = new WeakMap();
|
|
14947
15219
|
_completed2 = new WeakMap();
|
|
@@ -14962,7 +15234,7 @@
|
|
|
14962
15234
|
__privateGet(this, _waiting).delete(id);
|
|
14963
15235
|
if (__privateGet(this, _background).get(work.capability) === id) __privateGet(this, _background).delete(work.capability);
|
|
14964
15236
|
if (__privateGet(this, _renewing).get(work.capability) === id) __privateGet(this, _renewing).delete(work.capability);
|
|
14965
|
-
if (__privateGet(this,
|
|
15237
|
+
if (__privateGet(this, _active2).get(work.capability) === id) __privateGet(this, _active2).delete(work.capability);
|
|
14966
15238
|
__privateMethod(this, _CredentialRecoveryDesk_instances, finishReplicaWaiters_fn).call(this, work.capability, false);
|
|
14967
15239
|
}
|
|
14968
15240
|
for (const [id, work] of __privateGet(this, _joining)) if (work.expiresAt <= now) __privateGet(this, _joining).delete(id);
|
|
@@ -14972,7 +15244,7 @@
|
|
|
14972
15244
|
const id = `credential-recovery-${++__privateWrapper(this, _sequence2)._}`;
|
|
14973
15245
|
const effectId2 = `${id}:refresh`;
|
|
14974
15246
|
const capability = direct ? session : __privateGet(this, _ports).capabilityFor(session);
|
|
14975
|
-
const active = __privateGet(this,
|
|
15247
|
+
const active = __privateGet(this, _active2).get(capability);
|
|
14976
15248
|
if (active !== void 0 && original !== void 0) {
|
|
14977
15249
|
__privateGet(this, _waiting).get(active)?.affectedSessions.add(session);
|
|
14978
15250
|
const current2 = __privateMethod(this, _CredentialRecoveryDesk_instances, wake_fn).call(this, id, 0);
|
|
@@ -14999,7 +15271,7 @@
|
|
|
14999
15271
|
...direct === void 0 ? {} : { workspace: direct.workspace },
|
|
15000
15272
|
...original === void 0 ? {} : { original }
|
|
15001
15273
|
});
|
|
15002
|
-
__privateGet(this,
|
|
15274
|
+
__privateGet(this, _active2).set(capability, id);
|
|
15003
15275
|
return { case: "pending", value: create(CorrespondencePendingSchema, { workId: id, effect: {
|
|
15004
15276
|
case: "refreshCredential",
|
|
15005
15277
|
value: create(PeerCredentialRefreshEffectSchema, {
|
|
@@ -19372,27 +19644,27 @@
|
|
|
19372
19644
|
// ../src/runtime/residency_pins.ts
|
|
19373
19645
|
init_define_NOMOS_KERNEL_RELEASE();
|
|
19374
19646
|
init_shims();
|
|
19375
|
-
var _pending2, _resumed,
|
|
19647
|
+
var _pending2, _resumed, _active3;
|
|
19376
19648
|
var ResidencyPins = class {
|
|
19377
19649
|
constructor() {
|
|
19378
19650
|
__privateAdd(this, _pending2, /* @__PURE__ */ new Map());
|
|
19379
19651
|
__privateAdd(this, _resumed, /* @__PURE__ */ new WeakMap());
|
|
19380
|
-
__privateAdd(this,
|
|
19652
|
+
__privateAdd(this, _active3, []);
|
|
19381
19653
|
}
|
|
19382
19654
|
begin(workId2, effectId2) {
|
|
19383
19655
|
const pending = workId2 ? __privateGet(this, _pending2).get(workId2) : void 0;
|
|
19384
19656
|
const correlated = pending && pending.effectId === effectId2;
|
|
19385
19657
|
const scope = new Set(correlated ? pending.scope : void 0);
|
|
19386
19658
|
if (correlated) __privateGet(this, _resumed).set(scope, workId2);
|
|
19387
|
-
__privateGet(this,
|
|
19659
|
+
__privateGet(this, _active3).push(scope);
|
|
19388
19660
|
return scope;
|
|
19389
19661
|
}
|
|
19390
19662
|
touch(workspace) {
|
|
19391
|
-
if (workspace) for (const scope of __privateGet(this,
|
|
19663
|
+
if (workspace) for (const scope of __privateGet(this, _active3)) scope.add(workspace);
|
|
19392
19664
|
}
|
|
19393
19665
|
end(scope, previousWorkId, pendingWorkId, pendingEffectId) {
|
|
19394
|
-
if (__privateGet(this,
|
|
19395
|
-
__privateGet(this,
|
|
19666
|
+
if (__privateGet(this, _active3).at(-1) !== scope) throw new Error("residency scopes must settle in stack order");
|
|
19667
|
+
__privateGet(this, _active3).pop();
|
|
19396
19668
|
if (previousWorkId && __privateGet(this, _resumed).get(scope) === previousWorkId) __privateGet(this, _pending2).delete(previousWorkId);
|
|
19397
19669
|
if (pendingWorkId) __privateGet(this, _pending2).set(pendingWorkId, {
|
|
19398
19670
|
scope,
|
|
@@ -19400,7 +19672,7 @@
|
|
|
19400
19672
|
});
|
|
19401
19673
|
}
|
|
19402
19674
|
workspaces() {
|
|
19403
|
-
return new Set([...__privateGet(this,
|
|
19675
|
+
return new Set([...__privateGet(this, _active3), ...[...__privateGet(this, _pending2).values()].map((pending) => pending.scope)].flatMap((scope) => [...scope]));
|
|
19404
19676
|
}
|
|
19405
19677
|
clear() {
|
|
19406
19678
|
__privateGet(this, _pending2).clear();
|
|
@@ -19408,7 +19680,7 @@
|
|
|
19408
19680
|
};
|
|
19409
19681
|
_pending2 = new WeakMap();
|
|
19410
19682
|
_resumed = new WeakMap();
|
|
19411
|
-
|
|
19683
|
+
_active3 = new WeakMap();
|
|
19412
19684
|
|
|
19413
19685
|
// ../src/runtime/subscription_manager.ts
|
|
19414
19686
|
init_define_NOMOS_KERNEL_RELEASE();
|
|
@@ -35250,7 +35522,8 @@
|
|
|
35250
35522
|
replica: options.replica ?? storage.replica,
|
|
35251
35523
|
trustRootPublicKey: options.trustRootPublicKey
|
|
35252
35524
|
}, storage.filesystem, storage.changed);
|
|
35253
|
-
const
|
|
35525
|
+
const kernelWork = new KernelWorkAccounting(options.onKernelWorkChanged, false);
|
|
35526
|
+
const physicalKernel = observeBrowserKernelCalls(kernelExecutionDesk(machine), kernelWork);
|
|
35254
35527
|
const kernel = options.observeKernel?.(physicalKernel) ?? physicalKernel;
|
|
35255
35528
|
const custodyDesk = gitCustodyDesk(kernel, fetchImpl);
|
|
35256
35529
|
const kernelStore = browserKernelCustody(kernel, () => storage.checkpoint(), () => storage.isCheckpointCurrent(), options.provisionedGenesisWorkspace);
|
|
@@ -35288,6 +35561,7 @@
|
|
|
35288
35561
|
await storage.checkpoint();
|
|
35289
35562
|
return result;
|
|
35290
35563
|
},
|
|
35564
|
+
kernelWorkSnapshot: () => kernelWork.snapshot(),
|
|
35291
35565
|
close: async () => {
|
|
35292
35566
|
await office.settleRetention();
|
|
35293
35567
|
office.close();
|
|
@@ -35393,6 +35667,12 @@
|
|
|
35393
35667
|
warmResidencyMillis: 86400000n
|
|
35394
35668
|
},
|
|
35395
35669
|
postEvent,
|
|
35670
|
+
onKernelWorkChanged: (active) => {
|
|
35671
|
+
try {
|
|
35672
|
+
window.__nomosKernelWorkChanged?.(active ? toJsonString(ActiveKernelWorkSchema, active) : "");
|
|
35673
|
+
} catch {
|
|
35674
|
+
}
|
|
35675
|
+
},
|
|
35396
35676
|
kernelCache: kernelCache()
|
|
35397
35677
|
});
|
|
35398
35678
|
flushEvents();
|
|
@@ -35406,6 +35686,7 @@
|
|
|
35406
35686
|
if (!peer) throw new Error("Nomos peer runtime is not booted");
|
|
35407
35687
|
return frameToBase64(await peer.invoke(frameFromBase64(frameBase64)));
|
|
35408
35688
|
};
|
|
35689
|
+
window.__nomosKernelWorkSnapshot = () => peer ? toJsonString(KernelWorkSnapshotSchema, peer.kernelWorkSnapshot()) : void 0;
|
|
35409
35690
|
window.NomosRunner = {
|
|
35410
35691
|
version: 2,
|
|
35411
35692
|
dispose: () => {
|
package/package.json
CHANGED