githolon 0.69.2 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +266 -6
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -2972,10 +2972,12 @@ var init_repairs = __esm({
|
|
|
2972
2972
|
// src/governance.ts
|
|
2973
2973
|
var governance_exports = {};
|
|
2974
2974
|
__export(governance_exports, {
|
|
2975
|
+
HONEST_CEILING: () => HONEST_CEILING,
|
|
2975
2976
|
ROOT_CUSTODIAN_SECRET: () => ROOT_CUSTODIAN_SECRET,
|
|
2976
2977
|
buildCertificate: () => buildCertificate,
|
|
2977
2978
|
buildRebirthPlan: () => buildRebirthPlan,
|
|
2978
2979
|
certifyEra: () => certifyEra,
|
|
2980
|
+
consentRebirth: () => consentRebirth,
|
|
2979
2981
|
executeRepairRebirth: () => executeRepairRebirth,
|
|
2980
2982
|
governanceOffer: () => governanceOffer,
|
|
2981
2983
|
governanceRelay: () => governanceRelay,
|
|
@@ -2984,10 +2986,16 @@ __export(governance_exports, {
|
|
|
2984
2986
|
keyExport: () => keyExport,
|
|
2985
2987
|
keyImport: () => keyImport,
|
|
2986
2988
|
keyShow: () => keyShow,
|
|
2989
|
+
postureMeaning: () => postureMeaning,
|
|
2990
|
+
postureSet: () => postureSet,
|
|
2991
|
+
postureShow: () => postureShow,
|
|
2992
|
+
readLiveConsent: () => readLiveConsent,
|
|
2993
|
+
readPosture: () => readPosture2,
|
|
2987
2994
|
rebirthApply: () => rebirthApply,
|
|
2988
2995
|
rebirthPlanCommand: () => rebirthPlanCommand,
|
|
2989
2996
|
rebirthWorkspace: () => rebirthWorkspace,
|
|
2990
2997
|
renderRebirthImpact: () => renderRebirthImpact,
|
|
2998
|
+
resolveGovernanceHash: () => resolveGovernanceHash,
|
|
2991
2999
|
resolveGovernancePrincipal: () => resolveGovernancePrincipal,
|
|
2992
3000
|
signAndPostGovernance: () => signAndPostGovernance,
|
|
2993
3001
|
signAndPostOffer: () => signAndPostOffer,
|
|
@@ -3094,6 +3102,129 @@ async function grantOrRevoke(verb, kind, subject, opts) {
|
|
|
3094
3102
|
out2(`\u2713 ${directiveId} ${subject} via signed governance offer to ${parent}`);
|
|
3095
3103
|
return 0;
|
|
3096
3104
|
}
|
|
3105
|
+
function postureMeaning(posture) {
|
|
3106
|
+
return posture === "sovereign" ? "the operator CANNOT run recovery verbs (rebirth, certifyEra, repairs) without YOUR consent \u2014 root's rebirth REFUSES for this workspace unless a live RebirthConsent fact is folded in your OWN chain (githolon consent rebirth <ws>). Restraint is law that replays, not host policy." : 'the operator CAN run recovery verbs (rebirth, certifyEra, repairs) FOR you \u2014 each a signed, attributed, permanent law fact you audit forever. "The assurance of being able to ask us for help." Revoke any time (\u2192 sovereign): githolon posture set <ws> sovereign --reason \u2026';
|
|
3107
|
+
}
|
|
3108
|
+
async function readPosture2(cloud, ws) {
|
|
3109
|
+
try {
|
|
3110
|
+
const r = await fetch(`${cloud}/v2/workspaces/${ws}/governancePosture?scope=self`);
|
|
3111
|
+
if (!r.ok) return "managed";
|
|
3112
|
+
const d = await r.json();
|
|
3113
|
+
const rows = Array.isArray(d?.rows) ? d.rows : [];
|
|
3114
|
+
const last = rows[rows.length - 1];
|
|
3115
|
+
return last?.data?.posture === "sovereign" ? "sovereign" : "managed";
|
|
3116
|
+
} catch {
|
|
3117
|
+
return null;
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
async function readLiveConsent(cloud, ws) {
|
|
3121
|
+
try {
|
|
3122
|
+
const r = await fetch(`${cloud}/v2/workspaces/${ws}/rebirthConsentByWorkspace?workspaceId=${encodeURIComponent(ws)}`);
|
|
3123
|
+
if (!r.ok) return [];
|
|
3124
|
+
const d = await r.json();
|
|
3125
|
+
const now = Date.now();
|
|
3126
|
+
return (Array.isArray(d?.rows) ? d.rows : []).map((row) => row?.data ?? {}).filter((data) => {
|
|
3127
|
+
const e = Number(data["expiresAt"]);
|
|
3128
|
+
return !(e > 0) || e > now;
|
|
3129
|
+
}).map((data) => ({
|
|
3130
|
+
reason: String(data["reason"] ?? ""),
|
|
3131
|
+
consentedBy: String(data["consentedBy"] ?? ""),
|
|
3132
|
+
consentedAt: Number(data["consentedAt"] ?? 0),
|
|
3133
|
+
...Number(data["expiresAt"]) > 0 ? { expiresAt: Number(data["expiresAt"]) } : {}
|
|
3134
|
+
}));
|
|
3135
|
+
} catch {
|
|
3136
|
+
return [];
|
|
3137
|
+
}
|
|
3138
|
+
}
|
|
3139
|
+
async function postureShow(ws, opts) {
|
|
3140
|
+
const cloud = cloudBase(opts.cloud);
|
|
3141
|
+
const posture = await readPosture2(cloud, ws);
|
|
3142
|
+
if (posture === null) {
|
|
3143
|
+
err2(`could not read '${ws}' posture from ${cloud} \u2014 is the workspace born?`);
|
|
3144
|
+
return 1;
|
|
3145
|
+
}
|
|
3146
|
+
out2(`governance posture \u2014 ${ws} on ${cloud}`);
|
|
3147
|
+
out2("\u2550".repeat(48));
|
|
3148
|
+
out2(` posture : ${posture.toUpperCase()}${posture === "managed" ? " (default)" : ""}`);
|
|
3149
|
+
out2(` means : ${postureMeaning(posture)}`);
|
|
3150
|
+
if (posture === "sovereign") {
|
|
3151
|
+
const consents = await readLiveConsent(cloud, ws);
|
|
3152
|
+
if (consents.length === 0) {
|
|
3153
|
+
out2(` consent : NONE live \u2014 a rebirth of this workspace would be REFUSED (428) until the tenant consents.`);
|
|
3154
|
+
out2(` grant it: githolon consent rebirth ${ws} --reason "\u2026"`);
|
|
3155
|
+
} else {
|
|
3156
|
+
out2(` consent : ${consents.length} live consent fact(s):`);
|
|
3157
|
+
for (const c of consents) out2(` \u2022 by ${c.consentedBy || "?"} at ${c.consentedAt ? new Date(c.consentedAt).toISOString() : "?"}${c.expiresAt ? ` (expires ${new Date(c.expiresAt).toISOString()})` : ""} \u2014 ${c.reason || ""}`);
|
|
3158
|
+
}
|
|
3159
|
+
out2("");
|
|
3160
|
+
out2(` HONEST CEILING: ${HONEST_CEILING}`);
|
|
3161
|
+
}
|
|
3162
|
+
return 0;
|
|
3163
|
+
}
|
|
3164
|
+
async function postureSet(ws, posture, opts) {
|
|
3165
|
+
if (posture !== "managed" && posture !== "sovereign") {
|
|
3166
|
+
err2(`expected: githolon posture set ${ws} <managed|sovereign> --reason "\u2026"`);
|
|
3167
|
+
return 1;
|
|
3168
|
+
}
|
|
3169
|
+
const reason = opts.reason;
|
|
3170
|
+
if (reason === void 0 || reason.trim() === "") {
|
|
3171
|
+
err2(`posture set requires a --reason (the audit justification, on the ledger forever)`);
|
|
3172
|
+
return 1;
|
|
3173
|
+
}
|
|
3174
|
+
let principal;
|
|
3175
|
+
try {
|
|
3176
|
+
principal = resolveGovernancePrincipal(opts);
|
|
3177
|
+
} catch (e) {
|
|
3178
|
+
err2(e.message);
|
|
3179
|
+
return 1;
|
|
3180
|
+
}
|
|
3181
|
+
const payload = { workspaceId: ws, posture, reason, setBy: principal, at: Date.now() };
|
|
3182
|
+
let v;
|
|
3183
|
+
try {
|
|
3184
|
+
v = await signAndPostGovernance(ws, "setGovernancePosture", payload, opts);
|
|
3185
|
+
} catch (e) {
|
|
3186
|
+
err2(e.message);
|
|
3187
|
+
return 1;
|
|
3188
|
+
}
|
|
3189
|
+
if (!v.ok) {
|
|
3190
|
+
err2(`setGovernancePosture refused (${v.status}): ${typeof v.body === "string" ? v.body : JSON.stringify(v.body)}`);
|
|
3191
|
+
return 1;
|
|
3192
|
+
}
|
|
3193
|
+
out2(`\u2713 ${ws} posture set to ${posture.toUpperCase()} via signed governance offer`);
|
|
3194
|
+
out2(` ${postureMeaning(posture)}`);
|
|
3195
|
+
if (posture === "sovereign") out2(` (forward-only: help already given stays in history; the operator now needs your consent to rebirth \u2014 githolon consent rebirth ${ws} --reason \u2026)`);
|
|
3196
|
+
return 0;
|
|
3197
|
+
}
|
|
3198
|
+
async function consentRebirth(ws, opts) {
|
|
3199
|
+
const reason = opts.reason;
|
|
3200
|
+
if (reason === void 0 || reason.trim() === "") {
|
|
3201
|
+
err2(`consent rebirth requires a --reason (why you consent \u2014 on the ledger forever)`);
|
|
3202
|
+
return 1;
|
|
3203
|
+
}
|
|
3204
|
+
let principal;
|
|
3205
|
+
try {
|
|
3206
|
+
principal = resolveGovernancePrincipal(opts);
|
|
3207
|
+
} catch (e) {
|
|
3208
|
+
err2(e.message);
|
|
3209
|
+
return 1;
|
|
3210
|
+
}
|
|
3211
|
+
const payload = { workspaceId: ws, reason, consentedBy: principal, consentedAt: Date.now() };
|
|
3212
|
+
if (typeof opts.expiresAt === "number" && opts.expiresAt > 0) payload["expiresAt"] = opts.expiresAt;
|
|
3213
|
+
let v;
|
|
3214
|
+
try {
|
|
3215
|
+
v = await signAndPostGovernance(ws, "consentToRebirth", payload, opts);
|
|
3216
|
+
} catch (e) {
|
|
3217
|
+
err2(e.message);
|
|
3218
|
+
return 1;
|
|
3219
|
+
}
|
|
3220
|
+
if (!v.ok) {
|
|
3221
|
+
err2(`consentToRebirth refused (${v.status}): ${typeof v.body === "string" ? v.body : JSON.stringify(v.body)}`);
|
|
3222
|
+
return 1;
|
|
3223
|
+
}
|
|
3224
|
+
out2(`\u2713 ${ws} \u2014 rebirth consent folded in the tenant chain (by ${principal})`);
|
|
3225
|
+
out2(` the operator's rebirth custody act may now proceed (the two-key ceremony is satisfied).`);
|
|
3226
|
+
return 0;
|
|
3227
|
+
}
|
|
3097
3228
|
async function keyEnroll(opts) {
|
|
3098
3229
|
const cloud = cloudBase(opts.cloud);
|
|
3099
3230
|
const principal = opts.principal ?? activePrincipal();
|
|
@@ -3317,6 +3448,7 @@ async function certifyEra(ws, opts) {
|
|
|
3317
3448
|
return 1;
|
|
3318
3449
|
}
|
|
3319
3450
|
let seed = opts.seedSecret ?? process.env["NOMOS_ROOT_SEED"];
|
|
3451
|
+
const hasAsIdentity = typeof opts.as === "string" && opts.as.length > 0;
|
|
3320
3452
|
if (seed === void 0 && opts.gcpSecret !== void 0) {
|
|
3321
3453
|
try {
|
|
3322
3454
|
const { execFileSync } = await import("node:child_process");
|
|
@@ -3436,6 +3568,15 @@ certify-era ${ws}:`);
|
|
|
3436
3568
|
out2(` verify: githolon ledger verify ${ws} (expect GREEN with certifiedRanges naming the oids)`);
|
|
3437
3569
|
return 0;
|
|
3438
3570
|
}
|
|
3571
|
+
async function resolveGovernanceHash(cloud, domainKey, ws = "root", fetchImpl = fetch) {
|
|
3572
|
+
try {
|
|
3573
|
+
const d = await (await fetchImpl(`${cloud}/v2/workspaces/${ws}/domains`)).json();
|
|
3574
|
+
const h = d && d.currentLaw && d.currentLaw[domainKey];
|
|
3575
|
+
return typeof h === "string" && h.length > 0 ? h : void 0;
|
|
3576
|
+
} catch {
|
|
3577
|
+
return void 0;
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3439
3580
|
async function parkedAreAllLawInstalls(engMod, eng, ws, oids) {
|
|
3440
3581
|
try {
|
|
3441
3582
|
const git4 = (await import("isomorphic-git")).default;
|
|
@@ -3566,6 +3707,9 @@ async function buildRebirthPlan(cloud, ws, reason) {
|
|
|
3566
3707
|
}
|
|
3567
3708
|
const frozenAt = priorSupersessions === 0 ? ws : `${ws}--i${priorSupersessions}`;
|
|
3568
3709
|
const newCustodyAddress = `${ws}--i${priorSupersessions + 1}`;
|
|
3710
|
+
const posture = await readPosture2(cloud, ws) ?? "managed";
|
|
3711
|
+
const consents = posture === "sovereign" ? await readLiveConsent(cloud, ws) : [];
|
|
3712
|
+
const consentState = posture === "managed" ? "not-required" : consents.length > 0 ? "present" : "absent";
|
|
3569
3713
|
const plan = {
|
|
3570
3714
|
v: 1,
|
|
3571
3715
|
workspace: ws,
|
|
@@ -3581,6 +3725,7 @@ async function buildRebirthPlan(cloud, ws, reason) {
|
|
|
3581
3725
|
mode,
|
|
3582
3726
|
compaction,
|
|
3583
3727
|
repairs,
|
|
3728
|
+
posture: { posture, consent: consentState },
|
|
3584
3729
|
clientImpact: CLIENT_IMPACT,
|
|
3585
3730
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3586
3731
|
};
|
|
@@ -3652,6 +3797,18 @@ function renderRebirthImpact(plan, ledgerCommits) {
|
|
|
3652
3797
|
L.push(" state-transform verbs execute at the re-fold seam in a future release.");
|
|
3653
3798
|
}
|
|
3654
3799
|
L.push("");
|
|
3800
|
+
L.push("GOVERNANCE POSTURE");
|
|
3801
|
+
const pp = plan.posture ?? { posture: "managed", consent: "not-required" };
|
|
3802
|
+
L.push(` posture : ${pp.posture.toUpperCase()}${pp.posture === "managed" ? " (default \u2014 the operator may run recovery verbs for the tenant)" : ""}`);
|
|
3803
|
+
if (pp.posture === "sovereign") {
|
|
3804
|
+
if (pp.consent === "present") {
|
|
3805
|
+
L.push(" consent : PRESENT \u2014 a live tenant RebirthConsent fact authorizes this rebirth (the two-key ceremony is satisfied).");
|
|
3806
|
+
} else {
|
|
3807
|
+
L.push(` consent : ABSENT \u2014 SOVEREIGN target: this rebirth is REFUSED until the tenant consents in THEIR OWN chain.`);
|
|
3808
|
+
L.push(` the tenant grants it: githolon consent rebirth ${plan.workspace} --reason "\u2026"`);
|
|
3809
|
+
}
|
|
3810
|
+
}
|
|
3811
|
+
L.push("");
|
|
3655
3812
|
L.push("CLIENT IMPACT");
|
|
3656
3813
|
L.push(` ${plan.clientImpact}.`);
|
|
3657
3814
|
L.push(" Recommend tenants DRAIN/SYNC their clients before the rebirth window.");
|
|
@@ -3725,6 +3882,7 @@ async function rebirthWorkspace(ws, opts) {
|
|
|
3725
3882
|
}
|
|
3726
3883
|
}
|
|
3727
3884
|
let seed = opts.seedSecret ?? process.env["NOMOS_ROOT_SEED"];
|
|
3885
|
+
const hasAsIdentity = typeof opts.as === "string" && opts.as.length > 0;
|
|
3728
3886
|
if (seed === void 0 && opts.gcpSecret !== void 0) {
|
|
3729
3887
|
try {
|
|
3730
3888
|
const { execFileSync } = await import("node:child_process");
|
|
@@ -3735,8 +3893,10 @@ async function rebirthWorkspace(ws, opts) {
|
|
|
3735
3893
|
}
|
|
3736
3894
|
}
|
|
3737
3895
|
if (seed === void 0 || seed.trim() === "") {
|
|
3738
|
-
|
|
3739
|
-
|
|
3896
|
+
if (!hasAsIdentity) {
|
|
3897
|
+
err2(`gov rebirth needs an identity: --as <admin-uid> (key on file \u2014 the same lane every signed governance offer uses), or the ROOT CUSTODIAN seed (--gcp-secret ${ROOT_CUSTODIAN_SECRET}; --seed-secret <b64> is break-glass, env NOMOS_ROOT_SEED the CI lane)`);
|
|
3898
|
+
return 1;
|
|
3899
|
+
}
|
|
3740
3900
|
}
|
|
3741
3901
|
const cloud = cloudBase(opts.cloud);
|
|
3742
3902
|
const engMod = await Promise.resolve().then(() => (init_engine(), engine_exports));
|
|
@@ -3766,6 +3926,20 @@ async function rebirthWorkspace(ws, opts) {
|
|
|
3766
3926
|
err2("refusing to rebirth root (the fixed point)");
|
|
3767
3927
|
return 1;
|
|
3768
3928
|
}
|
|
3929
|
+
{
|
|
3930
|
+
const planPosture = opts.plan?.posture;
|
|
3931
|
+
let sovereignBlocked = false;
|
|
3932
|
+
if (planPosture !== void 0) {
|
|
3933
|
+
sovereignBlocked = planPosture.posture === "sovereign" && planPosture.consent === "absent";
|
|
3934
|
+
} else {
|
|
3935
|
+
const posture = await readPosture2(cloud, ws) ?? "managed";
|
|
3936
|
+
if (posture === "sovereign") sovereignBlocked = (await readLiveConsent(cloud, ws)).length === 0;
|
|
3937
|
+
}
|
|
3938
|
+
if (sovereignBlocked) {
|
|
3939
|
+
err2(`'${ws}' is SOVEREIGN \u2014 a rebirth needs the tenant's OWN consent first (no live RebirthConsent fact). The tenant grants it from their admin: githolon consent rebirth ${ws} --reason "\u2026" \u2014 then re-run this rebirth. (Operator restraint is law that replays here, not host policy.)`);
|
|
3940
|
+
return 1;
|
|
3941
|
+
}
|
|
3942
|
+
}
|
|
3769
3943
|
if (opts.quiet !== true) {
|
|
3770
3944
|
try {
|
|
3771
3945
|
const built = await buildRebirthPlan(cloud, ws, reason);
|
|
@@ -3795,12 +3969,24 @@ gov rebirth ${ws}:`);
|
|
|
3795
3969
|
}
|
|
3796
3970
|
}
|
|
3797
3971
|
const rebornAt = Date.now();
|
|
3798
|
-
const controllerHash = opts.controllerHash ??
|
|
3972
|
+
const controllerHash = opts.controllerHash ?? await resolveGovernanceHash(cloud, "workspaces");
|
|
3799
3973
|
if (typeof controllerHash !== "string") {
|
|
3800
|
-
err2("could not resolve root's governance
|
|
3974
|
+
err2("could not resolve root's governance (workspaces) law hash from root currentLaw (pass --controller-hash)");
|
|
3801
3975
|
return 1;
|
|
3802
3976
|
}
|
|
3803
|
-
const
|
|
3977
|
+
const actorUid = opts.as;
|
|
3978
|
+
let signSecret = seed;
|
|
3979
|
+
let actor = "user:root-custodian";
|
|
3980
|
+
if (typeof actorUid === "string" && actorUid.length > 0) {
|
|
3981
|
+
const dk = getDeviceKey(actorUid);
|
|
3982
|
+
if (dk === void 0) {
|
|
3983
|
+
err2(`no signing key on file for --as ${actorUid} (githolon key import/enroll)`);
|
|
3984
|
+
return 1;
|
|
3985
|
+
}
|
|
3986
|
+
signSecret = dk.secret;
|
|
3987
|
+
actor = `user:${actorUid}`;
|
|
3988
|
+
}
|
|
3989
|
+
const res = author2(eng, "root", "workspaces", "rebirthWorkspace", { workspaceId, reason, rebornAt }, controllerHash, { authorSecret: signSecret, actor });
|
|
3804
3990
|
if (res.ok === false) {
|
|
3805
3991
|
err2(`rebirthWorkspace refused locally: ${res.error}`);
|
|
3806
3992
|
return 1;
|
|
@@ -4085,13 +4271,14 @@ function readSealedIntentBytes(eng, ws, intentOut) {
|
|
|
4085
4271
|
if (f?.data === void 0) return void 0;
|
|
4086
4272
|
return Buffer.from(f.data).toString("base64");
|
|
4087
4273
|
}
|
|
4088
|
-
var out2, err2, ROOT_CUSTODIAN_SECRET, CLIENT_IMPACT;
|
|
4274
|
+
var out2, err2, HONEST_CEILING, ROOT_CUSTODIAN_SECRET, CLIENT_IMPACT;
|
|
4089
4275
|
var init_governance = __esm({
|
|
4090
4276
|
"src/governance.ts"() {
|
|
4091
4277
|
"use strict";
|
|
4092
4278
|
init_cloud();
|
|
4093
4279
|
out2 = (s) => void process.stdout.write(s + "\n");
|
|
4094
4280
|
err2 = (s) => void process.stderr.write("error: " + s + "\n");
|
|
4281
|
+
HONEST_CEILING = `The operator controls root's law and could deploy law removing the consent check \u2014 but that act is itself a signed, ordered, permanent fact in root's chain, visible to every tenant running \`replay root\`, and grounds for exit-with-everything. Not "we can't" \u2014 "we can't secretly, and you can always leave."`;
|
|
4095
4282
|
ROOT_CUSTODIAN_SECRET = "nomos-root-custodian-key";
|
|
4096
4283
|
CLIENT_IMPACT = "every connected client raises CustodyBreak(superseded); unsynced client work is invisible to the cloud \u2014 drain/sync clients first";
|
|
4097
4284
|
}
|
|
@@ -8508,6 +8695,19 @@ async function status(wsArg, opts) {
|
|
|
8508
8695
|
}
|
|
8509
8696
|
} catch {
|
|
8510
8697
|
}
|
|
8698
|
+
try {
|
|
8699
|
+
const { readPosture: readPosture3, readLiveConsent: readLiveConsent2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
|
|
8700
|
+
const posture = await readPosture3(cloud, ws);
|
|
8701
|
+
if (posture !== null) {
|
|
8702
|
+
if (posture === "sovereign") {
|
|
8703
|
+
const consents = await readLiveConsent2(cloud, ws);
|
|
8704
|
+
out10(`posture SOVEREIGN (operator recovery verbs need tenant consent \u2014 ${consents.length} live consent fact(s))`);
|
|
8705
|
+
} else {
|
|
8706
|
+
out10(`posture managed (default \u2014 operator may run recovery verbs for the tenant)`);
|
|
8707
|
+
}
|
|
8708
|
+
}
|
|
8709
|
+
} catch {
|
|
8710
|
+
}
|
|
8511
8711
|
const allDomains = d.domains ?? [];
|
|
8512
8712
|
const frameworkHashes = new Set(FRAMEWORK_DOMAIN_KEYS.map((k) => d.currentLaw?.[k]).filter(Boolean));
|
|
8513
8713
|
const domains = allDomains.filter((dm) => !frameworkHashes.has(dm.domainHash));
|
|
@@ -9186,6 +9386,7 @@ ${USAGE}`);
|
|
|
9186
9386
|
...opts,
|
|
9187
9387
|
...flag("--seed-secret") !== void 0 ? { seedSecret: flag("--seed-secret") } : {},
|
|
9188
9388
|
...flag("--gcp-secret") !== void 0 ? { gcpSecret: flag("--gcp-secret") } : {},
|
|
9389
|
+
...flag("--as") !== void 0 ? { as: flag("--as") } : {},
|
|
9189
9390
|
...flag("--controller-hash") !== void 0 ? { controllerHash: flag("--controller-hash") } : {},
|
|
9190
9391
|
yes: argv.includes("--yes")
|
|
9191
9392
|
});
|
|
@@ -9193,6 +9394,65 @@ ${USAGE}`);
|
|
|
9193
9394
|
process.stderr.write("error: expected: githolon rebirth <plan <ws> | apply --plan <plan.json>>\n");
|
|
9194
9395
|
return 1;
|
|
9195
9396
|
}
|
|
9397
|
+
if (argv[0] === "posture") {
|
|
9398
|
+
const { pos, opts, bad } = cloudArgs(argv.slice(1));
|
|
9399
|
+
if (bad !== void 0) {
|
|
9400
|
+
process.stderr.write(`error: ${bad}
|
|
9401
|
+
|
|
9402
|
+
${USAGE}`);
|
|
9403
|
+
return 1;
|
|
9404
|
+
}
|
|
9405
|
+
const flag = (n) => {
|
|
9406
|
+
const i = argv.indexOf(n);
|
|
9407
|
+
return i >= 0 ? argv[i + 1] : void 0;
|
|
9408
|
+
};
|
|
9409
|
+
if (pos[0] === "set") {
|
|
9410
|
+
const platform2 = pos[1];
|
|
9411
|
+
const posture = pos[2];
|
|
9412
|
+
if (platform2 === void 0 || posture === void 0) {
|
|
9413
|
+
process.stderr.write("error: expected: githolon posture set <platform> <managed|sovereign> --reason <text>\n");
|
|
9414
|
+
return 1;
|
|
9415
|
+
}
|
|
9416
|
+
const { postureSet: postureSet2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
|
|
9417
|
+
return postureSet2(platform2, posture, { ...opts, ...flag("--reason") !== void 0 ? { reason: flag("--reason") } : {} });
|
|
9418
|
+
}
|
|
9419
|
+
const platform = pos[0];
|
|
9420
|
+
if (platform === void 0) {
|
|
9421
|
+
process.stderr.write("error: expected: githolon posture <platform> | githolon posture set <platform> <managed|sovereign> --reason <text>\n");
|
|
9422
|
+
return 1;
|
|
9423
|
+
}
|
|
9424
|
+
const { postureShow: postureShow2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
|
|
9425
|
+
return postureShow2(platform, opts);
|
|
9426
|
+
}
|
|
9427
|
+
if (argv[0] === "consent") {
|
|
9428
|
+
const { pos, opts, bad } = cloudArgs(argv.slice(1));
|
|
9429
|
+
if (bad !== void 0) {
|
|
9430
|
+
process.stderr.write(`error: ${bad}
|
|
9431
|
+
|
|
9432
|
+
${USAGE}`);
|
|
9433
|
+
return 1;
|
|
9434
|
+
}
|
|
9435
|
+
const flag = (n) => {
|
|
9436
|
+
const i = argv.indexOf(n);
|
|
9437
|
+
return i >= 0 ? argv[i + 1] : void 0;
|
|
9438
|
+
};
|
|
9439
|
+
if (pos[0] === "rebirth") {
|
|
9440
|
+
const ws = pos[1];
|
|
9441
|
+
if (ws === void 0) {
|
|
9442
|
+
process.stderr.write("error: expected: githolon consent rebirth <ws> --reason <text> [--expires-at <epoch-ms>]\n");
|
|
9443
|
+
return 1;
|
|
9444
|
+
}
|
|
9445
|
+
const { consentRebirth: consentRebirth2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
|
|
9446
|
+
const expiresRaw = flag("--expires-at");
|
|
9447
|
+
return consentRebirth2(ws, {
|
|
9448
|
+
...opts,
|
|
9449
|
+
...flag("--reason") !== void 0 ? { reason: flag("--reason") } : {},
|
|
9450
|
+
...expiresRaw !== void 0 && Number.isFinite(Number(expiresRaw)) ? { expiresAt: Number(expiresRaw) } : {}
|
|
9451
|
+
});
|
|
9452
|
+
}
|
|
9453
|
+
process.stderr.write("error: expected: githolon consent rebirth <ws> --reason <text>\n");
|
|
9454
|
+
return 1;
|
|
9455
|
+
}
|
|
9196
9456
|
if (argv[0] === "gov") {
|
|
9197
9457
|
const { governanceOffer: governanceOffer2, governanceRelay: governanceRelay2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
|
|
9198
9458
|
const { pos, opts, bad } = cloudArgs(argv.slice(1));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "githolon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.0",
|
|
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",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@bjorn3/browser_wasi_shim": "0.4.2",
|
|
32
|
-
"@githolon/client": "^0.
|
|
33
|
-
"@githolon/dsl": "^0.
|
|
32
|
+
"@githolon/client": "^0.70.0",
|
|
33
|
+
"@githolon/dsl": "^0.70.0",
|
|
34
34
|
"isomorphic-git": "^1.38.4"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|