githolon 0.105.18 → 0.105.22
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/full-cli.mjs +78 -20
- package/package.json +2 -2
package/dist/full-cli.mjs
CHANGED
|
@@ -4276,6 +4276,17 @@ var init_kernel_provider_wasm = __esm({
|
|
|
4276
4276
|
}
|
|
4277
4277
|
});
|
|
4278
4278
|
|
|
4279
|
+
// ../cloud/web-client/src/offer_args.ts
|
|
4280
|
+
function withoutBirthCertificate(args) {
|
|
4281
|
+
const { birthCertificate: _birthCertificate, ...rest } = args;
|
|
4282
|
+
return rest;
|
|
4283
|
+
}
|
|
4284
|
+
var init_offer_args = __esm({
|
|
4285
|
+
"../cloud/web-client/src/offer_args.ts"() {
|
|
4286
|
+
"use strict";
|
|
4287
|
+
}
|
|
4288
|
+
});
|
|
4289
|
+
|
|
4279
4290
|
// ../cloud/web-client/src/_adapter/custody-transport.ts
|
|
4280
4291
|
function concatBytes(chunks) {
|
|
4281
4292
|
let n = 0;
|
|
@@ -5402,6 +5413,42 @@ var init_intent_offer_codec = __esm({
|
|
|
5402
5413
|
}
|
|
5403
5414
|
});
|
|
5404
5415
|
|
|
5416
|
+
// ../cloud/web-client/src/domain_readiness.ts
|
|
5417
|
+
async function prepareDomainUntilReady({
|
|
5418
|
+
domain,
|
|
5419
|
+
packageHash,
|
|
5420
|
+
directiveId,
|
|
5421
|
+
warm,
|
|
5422
|
+
timeoutMs = 3e4,
|
|
5423
|
+
yieldEvery = 32,
|
|
5424
|
+
now = Date.now,
|
|
5425
|
+
yieldHost = () => new Promise((resolve8) => setTimeout(resolve8, 0)),
|
|
5426
|
+
onQuantum
|
|
5427
|
+
}) {
|
|
5428
|
+
if (!domain || !packageHash) return { prepared: false, reason: "invalid-target", quanta: 0 };
|
|
5429
|
+
const selector = directiveId ? `plan:offer:${domain}:${directiveId}` : `plan:domain:${domain}`;
|
|
5430
|
+
const deadlineAt = now() + timeoutMs;
|
|
5431
|
+
let quanta = 0;
|
|
5432
|
+
while (now() <= deadlineAt) {
|
|
5433
|
+
quanta += 1;
|
|
5434
|
+
const progress = await warm();
|
|
5435
|
+
onQuantum?.(progress);
|
|
5436
|
+
if (progress.preparedCommandDomain === domain && progress.preparedCommandPackage === packageHash && progress.preparedCommandSelector === selector) {
|
|
5437
|
+
return { prepared: true, quanta };
|
|
5438
|
+
}
|
|
5439
|
+
if (progress.maintenancePending !== true) {
|
|
5440
|
+
return { prepared: false, reason: "maintenance-exhausted", quanta };
|
|
5441
|
+
}
|
|
5442
|
+
if (quanta % Math.max(1, yieldEvery) === 0) await yieldHost();
|
|
5443
|
+
}
|
|
5444
|
+
return { prepared: false, reason: "deadline-exceeded", quanta };
|
|
5445
|
+
}
|
|
5446
|
+
var init_domain_readiness = __esm({
|
|
5447
|
+
"../cloud/web-client/src/domain_readiness.ts"() {
|
|
5448
|
+
"use strict";
|
|
5449
|
+
}
|
|
5450
|
+
});
|
|
5451
|
+
|
|
5405
5452
|
// ../cloud/web-client/src/remote_holon.ts
|
|
5406
5453
|
function connectRemote(opts) {
|
|
5407
5454
|
const { cloud, workspace } = opts;
|
|
@@ -6154,30 +6201,31 @@ ${String(commit).toLowerCase()}`;
|
|
|
6154
6201
|
scheduleMaintenanceSoon();
|
|
6155
6202
|
};
|
|
6156
6203
|
const prepareDomainReady = async (domain, packageHash, directiveId) => {
|
|
6157
|
-
if (!domain || !packageHash) return { prepared: false };
|
|
6158
6204
|
requestDomainMaintenance(domain, packageHash, directiveId);
|
|
6159
|
-
const
|
|
6160
|
-
|
|
6161
|
-
|
|
6205
|
+
const readiness2 = await prepareDomainUntilReady({
|
|
6206
|
+
domain,
|
|
6207
|
+
packageHash,
|
|
6208
|
+
directiveId,
|
|
6209
|
+
warm: () => serialize(async () => JSON.parse(call("query", { queryBytes: qBytes({
|
|
6162
6210
|
op: "warm",
|
|
6163
6211
|
interactiveOnly: true,
|
|
6164
6212
|
requestedDomain: domain,
|
|
6165
6213
|
...directiveId ? { requestedDirective: directiveId } : {},
|
|
6166
6214
|
requestedPackage: packageHash
|
|
6167
|
-
}) })), "prepare generated domain", false)
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
const index = _maintenanceTargets.findIndex(
|
|
6173
|
-
(target) => target.domain === domain && target.packageHash === packageHash && target.directiveId === directiveId
|
|
6174
|
-
);
|
|
6175
|
-
if (index >= 0) _maintenanceTargets.splice(index, 1);
|
|
6176
|
-
return { prepared: true };
|
|
6215
|
+
}) })), "prepare generated domain", false),
|
|
6216
|
+
onQuantum: (result) => {
|
|
6217
|
+
if (typeof process !== "undefined" && process.env?.NOMOS_DEBUG_RAW) {
|
|
6218
|
+
console.error("[nomos] generated domain readiness quantum", result);
|
|
6219
|
+
}
|
|
6177
6220
|
}
|
|
6178
|
-
|
|
6221
|
+
});
|
|
6222
|
+
if (readiness2.prepared) {
|
|
6223
|
+
const index = _maintenanceTargets.findIndex(
|
|
6224
|
+
(target) => target.domain === domain && target.packageHash === packageHash && target.directiveId === directiveId
|
|
6225
|
+
);
|
|
6226
|
+
if (index >= 0) _maintenanceTargets.splice(index, 1);
|
|
6179
6227
|
}
|
|
6180
|
-
return
|
|
6228
|
+
return readiness2;
|
|
6181
6229
|
};
|
|
6182
6230
|
const scheduleMaintenanceSoon = (delayMs = 0) => {
|
|
6183
6231
|
if (_disposed || _maintenanceTimer !== null || _maintenanceInFlight) return;
|
|
@@ -7085,7 +7133,7 @@ ${String(commit).toLowerCase()}`;
|
|
|
7085
7133
|
};
|
|
7086
7134
|
writeWork2(`envelope-${es}.json`, enc4.encode(stringifyBig(enrollEnvelope)));
|
|
7087
7135
|
const enrollment = JSON.parse(authorViaOffer({
|
|
7088
|
-
...authorArgs,
|
|
7136
|
+
...withoutBirthCertificate(authorArgs),
|
|
7089
7137
|
directiveId: "enrollSigner",
|
|
7090
7138
|
envelopeFile: `/work/envelope-${es}.json`,
|
|
7091
7139
|
seq: es
|
|
@@ -7296,7 +7344,9 @@ ${String(commit).toLowerCase()}`;
|
|
|
7296
7344
|
try {
|
|
7297
7345
|
const readiness2 = await prepareDomainReady(domain, candidateHash);
|
|
7298
7346
|
if (readiness2.prepared !== true) {
|
|
7299
|
-
throw new Error(
|
|
7347
|
+
throw new Error(
|
|
7348
|
+
`the current model '${candidateHash}' authenticated '${domain}' USDA slice did not become ready (${readiness2.reason} after ${readiness2.quanta} maintenance quanta)`
|
|
7349
|
+
);
|
|
7300
7350
|
}
|
|
7301
7351
|
return { ok: true, stage: "promoted" };
|
|
7302
7352
|
} catch (error) {
|
|
@@ -7344,7 +7394,9 @@ ${String(commit).toLowerCase()}`;
|
|
|
7344
7394
|
const readiness2 = await prepareDomainReady(domain, candidateHash);
|
|
7345
7395
|
if (readiness2.prepared !== true) {
|
|
7346
7396
|
throw Object.assign(
|
|
7347
|
-
new Error(
|
|
7397
|
+
new Error(
|
|
7398
|
+
`the promoted model '${candidateHash}' is active but its authenticated '${domain}' USDA slice did not become ready (${readiness2.reason} after ${readiness2.quanta} maintenance quanta)`
|
|
7399
|
+
),
|
|
7348
7400
|
{ code: "nomos.model.readiness_failed" }
|
|
7349
7401
|
);
|
|
7350
7402
|
}
|
|
@@ -11526,6 +11578,7 @@ var enc4, dec4, BRANCH, qBytes, OWNED_KEY_RELATION, OWNED_READ_RELATION2, OWNED_
|
|
|
11526
11578
|
var init_src2 = __esm({
|
|
11527
11579
|
"../cloud/web-client/src/index.ts"() {
|
|
11528
11580
|
init_kernel_provider_wasm();
|
|
11581
|
+
init_offer_args();
|
|
11529
11582
|
init_pack_auth_contract();
|
|
11530
11583
|
init_custody_transport();
|
|
11531
11584
|
init_managed_promotion();
|
|
@@ -11540,6 +11593,7 @@ var init_src2 = __esm({
|
|
|
11540
11593
|
init_serialized_scheduler();
|
|
11541
11594
|
init_kernel_pb();
|
|
11542
11595
|
init_intent_offer_codec();
|
|
11596
|
+
init_domain_readiness();
|
|
11543
11597
|
init_intent_offer_codec();
|
|
11544
11598
|
init_kernel_provider_wasm();
|
|
11545
11599
|
init_errors();
|
|
@@ -21348,11 +21402,12 @@ var init_dlq = __esm({
|
|
|
21348
21402
|
});
|
|
21349
21403
|
|
|
21350
21404
|
// src/cli.ts
|
|
21351
|
-
import { existsSync as existsSync16, readdirSync as readdirSync6, readFileSync as readFileSync12 } from "node:fs";
|
|
21405
|
+
import { existsSync as existsSync16, mkdtempSync as mkdtempSync2, readdirSync as readdirSync6, readFileSync as readFileSync12, rmSync as rmSync3 } from "node:fs";
|
|
21352
21406
|
import { spawn as spawn2, spawnSync as spawnSync7 } from "node:child_process";
|
|
21353
21407
|
import { createHash as createHash6 } from "node:crypto";
|
|
21354
21408
|
import { createRequire as createRequire3 } from "node:module";
|
|
21355
21409
|
import { dirname as dirname9, join as join17, resolve as resolve7 } from "node:path";
|
|
21410
|
+
import { tmpdir as tmpdir2 } from "node:os";
|
|
21356
21411
|
import { pathToFileURL as pathToFileURL5, fileURLToPath as fileURLToPath3 } from "node:url";
|
|
21357
21412
|
|
|
21358
21413
|
// src/generate.ts
|
|
@@ -25122,6 +25177,7 @@ async function runGeneratedApplicationProofLocally(proofPath, onPerformance) {
|
|
|
25122
25177
|
const platform = `proof-app-${createHash6("sha256").update(readFileSync12(proofPath)).digest("hex").slice(0, 20)}`;
|
|
25123
25178
|
const proofLegs = parseOfflineLegs(readFileSync12(proofPath, "utf8"));
|
|
25124
25179
|
const applicationMaxChildWorkspacesPerUser = proofLegs.applicationMaxChildWorkspacesPerUser;
|
|
25180
|
+
const proofHomeDirectory = mkdtempSync2(join17(tmpdir2(), "nomos-generated-proof-home-"));
|
|
25125
25181
|
let dev2;
|
|
25126
25182
|
try {
|
|
25127
25183
|
dev2 = await module.startGeneratedApplicationProofCloud({
|
|
@@ -25147,6 +25203,7 @@ async function runGeneratedApplicationProofLocally(proofPath, onPerformance) {
|
|
|
25147
25203
|
NOMOS_DEVICE_TOKEN_ENDPOINT: `${dev2.origin}/dev/mint-token`,
|
|
25148
25204
|
NOMOS_TEST_K_ROOT_PUBLIC: testKRootPublic,
|
|
25149
25205
|
NOMOS_PROOF_MANAGED: "1",
|
|
25206
|
+
HOME: proofHomeDirectory,
|
|
25150
25207
|
...onPerformance === void 0 ? {} : { NOMOS_PROOF_PERFORMANCE: "1" }
|
|
25151
25208
|
}
|
|
25152
25209
|
});
|
|
@@ -25184,6 +25241,7 @@ async function runGeneratedApplicationProofLocally(proofPath, onPerformance) {
|
|
|
25184
25241
|
}
|
|
25185
25242
|
if (priorLocalWasm === void 0) delete process.env.NOMOS_LOCAL_WASM;
|
|
25186
25243
|
else process.env.NOMOS_LOCAL_WASM = priorLocalWasm;
|
|
25244
|
+
rmSync3(proofHomeDirectory, { recursive: true, force: true });
|
|
25187
25245
|
}
|
|
25188
25246
|
}
|
|
25189
25247
|
async function runProof(args) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "githolon",
|
|
3
|
-
"version": "0.105.
|
|
3
|
+
"version": "0.105.22",
|
|
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.105.
|
|
33
|
+
"@githolon/dsl": "^0.105.22",
|
|
34
34
|
"isomorphic-git": "^1.38.4",
|
|
35
35
|
"tsx": "^4.19.2"
|
|
36
36
|
},
|