@senticor/hive 1.134.0 → 1.136.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/hive.cjs +150 -8
- package/package.json +1 -1
package/hive.cjs
CHANGED
|
@@ -10511,22 +10511,22 @@ var artifactName = injectedString(
|
|
|
10511
10511
|
true ? "hive-cli" : void 0
|
|
10512
10512
|
) || String(process.env.HIVE_CLI_ARTIFACT_NAME || "hive-cli").trim() || "hive-cli";
|
|
10513
10513
|
var packageVersion = injectedString(
|
|
10514
|
-
true ? "1.
|
|
10514
|
+
true ? "1.136.0" : void 0
|
|
10515
10515
|
) || String(process.env.HIVE_CLI_PACKAGE_VERSION || "").trim() || readPackageVersion();
|
|
10516
10516
|
var releaseVersion = injectedString(
|
|
10517
|
-
true ? "1.
|
|
10517
|
+
true ? "1.136.0" : void 0
|
|
10518
10518
|
) || String(process.env.HIVE_CLI_RELEASE_VERSION || "").trim() || packageVersion || "dev";
|
|
10519
10519
|
var releaseChannel = injectedString(
|
|
10520
10520
|
true ? "final" : void 0
|
|
10521
10521
|
) || String(process.env.HIVE_CLI_RELEASE_CHANNEL || "").trim() || (releaseVersion.includes("-rc.") ? "rc" : releaseVersion === "dev" ? "dev" : "final");
|
|
10522
10522
|
var buildCommit = injectedString(
|
|
10523
|
-
true ? "
|
|
10523
|
+
true ? "5ee4dfebdc58dd6214b6a3a0ffa9f1bf7eb8f2de" : void 0
|
|
10524
10524
|
) || String(process.env.HIVE_CLI_BUILD_COMMIT || "").trim() || "unknown";
|
|
10525
10525
|
var buildTimestamp = injectedString(
|
|
10526
|
-
true ? "2026-11-
|
|
10526
|
+
true ? "2026-11-11T16:44:40Z" : void 0
|
|
10527
10527
|
) || String(process.env.HIVE_CLI_BUILD_TIMESTAMP || "").trim() || "unknown";
|
|
10528
10528
|
var ociRef = injectedString(
|
|
10529
|
-
true ? "registry.onstackit.cloud/senticor/hive-cli:1.
|
|
10529
|
+
true ? "registry.onstackit.cloud/senticor/hive-cli:1.136.0" : void 0
|
|
10530
10530
|
) || String(process.env.HIVE_CLI_OCI_REF || "").trim() || `registry.onstackit.cloud/senticor/${artifactName}:${releaseVersion}`;
|
|
10531
10531
|
var RELEASE_INFO = Object.freeze({
|
|
10532
10532
|
packageVersion,
|
|
@@ -33444,7 +33444,7 @@ async function changeRoles2(args, action) {
|
|
|
33444
33444
|
};
|
|
33445
33445
|
}
|
|
33446
33446
|
var members2 = defineCommand({
|
|
33447
|
-
meta: { name: "members", description: "Manage the active tenant's members with your own user-manager role" },
|
|
33447
|
+
meta: { name: "members", description: "Manage the active tenant's members with your own user-manager or tenant-admin role" },
|
|
33448
33448
|
args: withOwnArgs({ ...whoArgs, ...roleArgs, ...admitArgs, ...reasonArg }),
|
|
33449
33449
|
default: "list",
|
|
33450
33450
|
subCommands: {
|
|
@@ -34721,7 +34721,14 @@ var MEMBERSHIP_ERROR_CODES = {
|
|
|
34721
34721
|
GRANTEE_MEMBERSHIP_NOT_ACTIVE: "GRANTEE_MEMBERSHIP_NOT_ACTIVE",
|
|
34722
34722
|
CROSS_TENANT_GRANT_FORBIDDEN: "CROSS_TENANT_GRANT_FORBIDDEN",
|
|
34723
34723
|
OWNER_CANNOT_BE_REMOVED: "OWNER_CANNOT_BE_REMOVED",
|
|
34724
|
-
CANNOT_REMOVE_FROM_TENANT_WIDE: "CANNOT_REMOVE_FROM_TENANT_WIDE"
|
|
34724
|
+
CANNOT_REMOVE_FROM_TENANT_WIDE: "CANNOT_REMOVE_FROM_TENANT_WIDE",
|
|
34725
|
+
// #469: tenant admins manage any mission's members and hand a mission over.
|
|
34726
|
+
MISSION_MEMBER_ADMIN_FORBIDDEN: "MISSION_MEMBER_ADMIN_FORBIDDEN",
|
|
34727
|
+
MISSION_OWNER_TRANSFER_FORBIDDEN: "MISSION_OWNER_TRANSFER_FORBIDDEN",
|
|
34728
|
+
MISSION_OWNER_NOT_TENANT_MEMBER: "MISSION_OWNER_NOT_TENANT_MEMBER",
|
|
34729
|
+
MISSION_OWNER_TARGET_REQUIRED: "MISSION_OWNER_TARGET_REQUIRED",
|
|
34730
|
+
MISSION_OWNER_TARGET_INVALID: "MISSION_OWNER_TARGET_INVALID",
|
|
34731
|
+
MISSION_OWNER_TRANSFER_UNAVAILABLE: "MISSION_OWNER_TRANSFER_UNAVAILABLE"
|
|
34725
34732
|
};
|
|
34726
34733
|
function assertMissionMembershipOk(status2, data, action) {
|
|
34727
34734
|
if (isHttpOk(status2)) return;
|
|
@@ -35158,6 +35165,7 @@ var missionArgs = withArgs({
|
|
|
35158
35165
|
principalEmail: { type: "string", description: "Grantee email (resolved to an OIDC sub server-side)" },
|
|
35159
35166
|
principalSub: { type: "string", description: "Grantee OIDC sub" },
|
|
35160
35167
|
email: { type: "string", description: "Grantee email for `members admit` (works before first login; alias of --principal-email)" },
|
|
35168
|
+
reason: { type: "string", description: "mission members handover: why, recorded in the audit row" },
|
|
35161
35169
|
tenantWideRead: { type: "string", description: "Mission access policy: tenant-wide read (true|false)" },
|
|
35162
35170
|
yes: { type: "boolean", description: "Confirm a sensitive change (e.g. widening tenant-wide read)" },
|
|
35163
35171
|
dryRun: { type: "boolean", description: "Print the request that would be sent; perform no write" },
|
|
@@ -35411,7 +35419,7 @@ var mission = defineCommand({
|
|
|
35411
35419
|
}
|
|
35412
35420
|
}),
|
|
35413
35421
|
members: defineCommand({
|
|
35414
|
-
meta: { name: "members", description: "Mission membership \u2014 list, check, grant, admit (by email, pre-login), revoke (+ invite/accept)" },
|
|
35422
|
+
meta: { name: "members", description: "Mission membership \u2014 list, check, grant, admit (by email, pre-login), revoke, handover (+ invite/accept)" },
|
|
35415
35423
|
args: missionArgs,
|
|
35416
35424
|
default: "list",
|
|
35417
35425
|
subCommands: {
|
|
@@ -35575,6 +35583,38 @@ var mission = defineCommand({
|
|
|
35575
35583
|
fmt
|
|
35576
35584
|
);
|
|
35577
35585
|
}
|
|
35586
|
+
}),
|
|
35587
|
+
handover: defineCommand({
|
|
35588
|
+
meta: {
|
|
35589
|
+
name: "handover",
|
|
35590
|
+
alias: "transfer-owner",
|
|
35591
|
+
description: "Hand the mission to another owner (tenant admin, #469). --principal-email | --principal-sub, --yes. The previous owner stays a member."
|
|
35592
|
+
},
|
|
35593
|
+
args: missionArgs,
|
|
35594
|
+
async run({ args }) {
|
|
35595
|
+
const { client, fmt } = ctx(args);
|
|
35596
|
+
printContextNotice(args, { mission: true });
|
|
35597
|
+
const missionId = requireMissionContext(args, "mission members handover");
|
|
35598
|
+
const principal = resolvePrincipal(args);
|
|
35599
|
+
const reason = String(args.reason ?? "").trim();
|
|
35600
|
+
const body = { ...principal, ...reason ? { reason } : {} };
|
|
35601
|
+
const path10 = `/api/missions/${enc(missionId)}/owner`;
|
|
35602
|
+
if (args.dryRun) return output(dryRunResult("PUT", path10, body), fmt);
|
|
35603
|
+
if (!args.yes) {
|
|
35604
|
+
throw commandError(
|
|
35605
|
+
"HANDOVER_CONFIRMATION_REQUIRED",
|
|
35606
|
+
2,
|
|
35607
|
+
"Handing a mission over gives the new owner its owner rights and takes them from the current owner. Re-run with --yes."
|
|
35608
|
+
);
|
|
35609
|
+
}
|
|
35610
|
+
const res = await client.put(path10, body);
|
|
35611
|
+
assertMissionMembershipOk(res.status, res.data, "hand over mission");
|
|
35612
|
+
const data = recordOf3(res.data);
|
|
35613
|
+
return output(
|
|
35614
|
+
{ handedOver: data.changed === true, owner: data.owner ?? null, previousOwners: data.previousOwners ?? [] },
|
|
35615
|
+
fmt
|
|
35616
|
+
);
|
|
35617
|
+
}
|
|
35578
35618
|
})
|
|
35579
35619
|
}
|
|
35580
35620
|
}),
|
|
@@ -35828,6 +35868,13 @@ var cells = defineCommand({
|
|
|
35828
35868
|
})
|
|
35829
35869
|
}
|
|
35830
35870
|
});
|
|
35871
|
+
var templateRevisionArgs = withArgs({
|
|
35872
|
+
hash: { type: "string", description: "Content hash of the revision (sha256:\u2026), as publish-revision returned it" },
|
|
35873
|
+
acknowledge: { type: "string", description: "apply-revision: comma-separated finding codes you accept by name" },
|
|
35874
|
+
reason: { type: "string", description: "apply-revision: why, recorded in the audit row" },
|
|
35875
|
+
yes: { type: "boolean", description: "apply-revision: confirm the apply" },
|
|
35876
|
+
dryRun: { type: "boolean", description: "Print the request that would be sent; perform no write" }
|
|
35877
|
+
});
|
|
35831
35878
|
var templates = defineCommand({
|
|
35832
35879
|
meta: { name: "templates", description: "Mission templates" },
|
|
35833
35880
|
args: withArgs(),
|
|
@@ -35865,9 +35912,104 @@ var templates = defineCommand({
|
|
|
35865
35912
|
assertRemoteOk(res.status, res.data, "publish platform mission template");
|
|
35866
35913
|
return output(res.data, fmt);
|
|
35867
35914
|
}
|
|
35915
|
+
}),
|
|
35916
|
+
// #469: template revisions, published and applied per mission (tenant admin).
|
|
35917
|
+
revisions: defineCommand({
|
|
35918
|
+
meta: { name: "revisions", description: "List the tenant's published revisions of a template (--id; tenant admin)" },
|
|
35919
|
+
args: withArgs(),
|
|
35920
|
+
async run({ args }) {
|
|
35921
|
+
const { client, fmt } = ctx(args);
|
|
35922
|
+
req(args, "id");
|
|
35923
|
+
const res = await client.get(`/api/mission-templates/${enc(String(args.id))}/revisions`);
|
|
35924
|
+
assertTemplateRevisionOk(res.status, res.data, "list template revisions");
|
|
35925
|
+
return output(res.data, fmt);
|
|
35926
|
+
}
|
|
35927
|
+
}),
|
|
35928
|
+
"publish-revision": defineCommand({
|
|
35929
|
+
meta: { name: "publish-revision", description: "Publish an immutable revision of a tenant template (--file; tenant admin). Changes no mission." },
|
|
35930
|
+
args: withArgs(),
|
|
35931
|
+
async run({ args }) {
|
|
35932
|
+
const { client, fmt } = ctx(args);
|
|
35933
|
+
req(args, "file");
|
|
35934
|
+
const spec = readJsonFile(args.file);
|
|
35935
|
+
const templateId = String(spec?.templateId || "").trim();
|
|
35936
|
+
if (!templateId) throw commandError("TEMPLATE_ID_REQUIRED", 1, "The template file must contain a non-empty templateId.");
|
|
35937
|
+
const res = await client.post(`/api/mission-templates/${enc(templateId)}/revisions`, { spec });
|
|
35938
|
+
assertTemplateRevisionOk(res.status, res.data, "publish template revision");
|
|
35939
|
+
return output(res.data, fmt);
|
|
35940
|
+
}
|
|
35941
|
+
}),
|
|
35942
|
+
"preview-revision": defineCommand({
|
|
35943
|
+
meta: { name: "preview-revision", description: "Show what applying a revision would do to a mission (--id, --hash, mission pin or --mission-id). Changes nothing." },
|
|
35944
|
+
args: templateRevisionArgs,
|
|
35945
|
+
async run({ args }) {
|
|
35946
|
+
const { client, fmt } = ctx(args);
|
|
35947
|
+
req(args, "id");
|
|
35948
|
+
req(args, "hash");
|
|
35949
|
+
const missionId = requireMissionContext(args, "templates preview-revision");
|
|
35950
|
+
const res = await client.post(revisionPath(String(args.id), String(args.hash), "preview"), { missionId });
|
|
35951
|
+
assertTemplateRevisionOk(res.status, res.data, "preview template revision");
|
|
35952
|
+
return output(res.data, fmt);
|
|
35953
|
+
}
|
|
35954
|
+
}),
|
|
35955
|
+
"apply-revision": defineCommand({
|
|
35956
|
+
meta: {
|
|
35957
|
+
name: "apply-revision",
|
|
35958
|
+
description: "Apply a published revision to a mission (--id, --hash, mission pin or --mission-id, --acknowledge CODE[,CODE], --reason, --yes; tenant admin)"
|
|
35959
|
+
},
|
|
35960
|
+
args: templateRevisionArgs,
|
|
35961
|
+
async run({ args }) {
|
|
35962
|
+
const { client, fmt } = ctx(args);
|
|
35963
|
+
req(args, "id");
|
|
35964
|
+
req(args, "hash");
|
|
35965
|
+
const missionId = requireMissionContext(args, "templates apply-revision");
|
|
35966
|
+
const acknowledge = String(args.acknowledge ?? "").split(",").map((code) => code.trim()).filter(Boolean);
|
|
35967
|
+
const reason = String(args.reason ?? "").trim();
|
|
35968
|
+
const body = { missionId, acknowledge, ...reason ? { reason } : {} };
|
|
35969
|
+
const path10 = revisionPath(String(args.id), String(args.hash), "apply");
|
|
35970
|
+
if (args.dryRun) return output(dryRunResult("POST", path10, body), fmt);
|
|
35971
|
+
if (!args.yes) {
|
|
35972
|
+
throw commandError(
|
|
35973
|
+
"APPLY_CONFIRMATION_REQUIRED",
|
|
35974
|
+
2,
|
|
35975
|
+
"Applying a revision changes how CHOS enforces this mission's records. Preview it with `hive templates preview-revision`, then re-run with --yes."
|
|
35976
|
+
);
|
|
35977
|
+
}
|
|
35978
|
+
const res = await client.post(path10, body);
|
|
35979
|
+
assertTemplateRevisionOk(res.status, res.data, "apply template revision");
|
|
35980
|
+
return output(res.data, fmt);
|
|
35981
|
+
}
|
|
35868
35982
|
})
|
|
35869
35983
|
}
|
|
35870
35984
|
});
|
|
35985
|
+
function revisionPath(templateId, contentHash, action) {
|
|
35986
|
+
return `/api/mission-templates/${enc(templateId)}/revisions/${encodeURIComponent(contentHash)}/${action}`;
|
|
35987
|
+
}
|
|
35988
|
+
var TEMPLATE_REVISION_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
35989
|
+
"MISSION_TEMPLATE_MANAGE_FORBIDDEN",
|
|
35990
|
+
"TEMPLATE_REVISION_INVALID",
|
|
35991
|
+
"TEMPLATE_REVISION_NOT_FOUND",
|
|
35992
|
+
"TEMPLATE_REVISION_TEMPLATE_MISMATCH",
|
|
35993
|
+
"TEMPLATE_APPLY_MISSION_UNBOUND",
|
|
35994
|
+
"TEMPLATE_APPLY_REFUSED",
|
|
35995
|
+
"TEMPLATE_APPLY_ACKNOWLEDGEMENT_REQUIRED",
|
|
35996
|
+
"TEMPLATE_APPLY_UNAVAILABLE",
|
|
35997
|
+
"EXPERIMENTAL_FEATURE_NOT_ENABLED"
|
|
35998
|
+
]);
|
|
35999
|
+
function assertTemplateRevisionOk(status2, data, action) {
|
|
36000
|
+
if (isHttpOk(status2)) return;
|
|
36001
|
+
const body = recordOf3(data);
|
|
36002
|
+
const code = String(body.error || "").trim();
|
|
36003
|
+
if (!TEMPLATE_REVISION_ERROR_CODES.has(code)) return assertRemoteOk(status2, data, action);
|
|
36004
|
+
const findings = Array.isArray(body.findings) ? body.findings : [];
|
|
36005
|
+
const missing = Array.isArray(body.unacknowledged) ? body.unacknowledged.map(String) : [];
|
|
36006
|
+
const refused = findings.filter((f) => f.class === "refused").map((f) => String(f.code));
|
|
36007
|
+
const detail = [
|
|
36008
|
+
missing.length ? `Acknowledge by name: ${missing.join(", ")}.` : "",
|
|
36009
|
+
refused.length ? `Refused, no acknowledgement helps: ${[...new Set(refused)].join(", ")}.` : ""
|
|
36010
|
+
].filter(Boolean).join(" ");
|
|
36011
|
+
throw commandError(code, EXIT_GUARDRAIL, [String(body.message || `${action} failed`), detail].filter(Boolean).join(" "));
|
|
36012
|
+
}
|
|
35871
36013
|
var upgrade = defineCommand({
|
|
35872
36014
|
meta: { name: "upgrade", description: "Install a newer hive CLI bundle with rollback support" },
|
|
35873
36015
|
args: withArgs({
|