@senticor/hive 1.118.0 → 1.119.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.
Files changed (3) hide show
  1. package/README.md +36 -0
  2. package/hive.cjs +42 -22
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -70,6 +70,42 @@ export HIVE_TOKEN=eyJ… # a Keycloak access token for the caller
70
70
  hive whoami
71
71
  ```
72
72
 
73
+ ## Manage your tenant's members
74
+
75
+ If you hold the tenant role `user-manager`, you manage that tenant's members with your own login. You
76
+ can hand out the roles a platform admin has put on your tenant's list.
77
+
78
+ ```bash
79
+ export HIVE_TENANT=acme # or pass --tenant acme to each command
80
+
81
+ hive members list
82
+ hive members delegable-roles # the roles you may hand out
83
+ hive members admit --email ina@example.org --roles editor
84
+ hive members roles grant --email ina@example.org --roles reviewer
85
+ hive members roles revoke --email ina@example.org --roles editor --reason "moved team"
86
+ hive members suspend --email ina@example.org # access paused, roles kept
87
+ hive members reactivate --email ina@example.org # back to active
88
+ hive members revoke --email ina@example.org # removed from the tenant; roles go too
89
+ ```
90
+
91
+ **Adding someone new.** `admit` creates no login and sends no message. Ask your platform operator to create
92
+ their account with a verified email address, then tell them the workspace URL. They sign in and switch to
93
+ your tenant. Until the address is verified, they only see their own tenant.
94
+
95
+ **When a command refuses:**
96
+
97
+ | Code | What it means | What to do |
98
+ | --- | --- | --- |
99
+ | `ROLE_NOT_DELEGABLE` | The role is not on your tenant's list, or the member holds one that is not | Ask a platform admin |
100
+ | `MEMBER_SUSPENDED` | The person is suspended, so `admit` leaves them as they are | Use `hive members reactivate` |
101
+ | `MEMBERSHIP_GENERATION_CONFLICT` | Someone changed the person's status while the command ran | Look at them again, then decide |
102
+ | `LAST_USER_MANAGER` | This would leave the tenant without a user manager | Make someone else a user manager first |
103
+ | `MEMBER_NOT_VISIBLE` / `MEMBER_NOT_FOUND` | The person is not in the list you can see, or not a member | Check the address and run it again, then ask a platform admin |
104
+ | `MEMBER_TARGET_NOT_HUMAN` | The address belongs to an agent or service | Ask a platform admin |
105
+
106
+ Removing someone ends their access to this tenant. If they leave altogether, ask your platform operator to
107
+ disable their login.
108
+
73
109
  ## Updating
74
110
 
75
111
  Because this is an npm-managed install, update it with npm — `hive upgrade` is
package/hive.cjs CHANGED
@@ -10286,6 +10286,10 @@ function withArgs(extra = {}) {
10286
10286
  registerValueFlags(extra);
10287
10287
  return { ...globalArgs, ...commonArgs, ...extra };
10288
10288
  }
10289
+ function withOwnArgs(extra = {}) {
10290
+ registerValueFlags(extra);
10291
+ return { ...globalArgs, ...extra };
10292
+ }
10289
10293
  function readJsonFile(p) {
10290
10294
  const raw = import_node_fs3.default.readFileSync(p, "utf-8");
10291
10295
  try {
@@ -10429,22 +10433,22 @@ var artifactName = injectedString(
10429
10433
  true ? "hive-cli" : void 0
10430
10434
  ) || String(process.env.HIVE_CLI_ARTIFACT_NAME || "hive-cli").trim() || "hive-cli";
10431
10435
  var packageVersion = injectedString(
10432
- true ? "1.118.0" : void 0
10436
+ true ? "1.119.0" : void 0
10433
10437
  ) || String(process.env.HIVE_CLI_PACKAGE_VERSION || "").trim() || readPackageVersion();
10434
10438
  var releaseVersion = injectedString(
10435
- true ? "1.118.0" : void 0
10439
+ true ? "1.119.0" : void 0
10436
10440
  ) || String(process.env.HIVE_CLI_RELEASE_VERSION || "").trim() || packageVersion || "dev";
10437
10441
  var releaseChannel = injectedString(
10438
10442
  true ? "final" : void 0
10439
10443
  ) || String(process.env.HIVE_CLI_RELEASE_CHANNEL || "").trim() || (releaseVersion.includes("-rc.") ? "rc" : releaseVersion === "dev" ? "dev" : "final");
10440
10444
  var buildCommit = injectedString(
10441
- true ? "355c80bcaf756522bf01b3d3ac5c1f22ae254fc6" : void 0
10445
+ true ? "dcc60a6c6e9eb8754a6ab1d525d615390b2edde1" : void 0
10442
10446
  ) || String(process.env.HIVE_CLI_BUILD_COMMIT || "").trim() || "unknown";
10443
10447
  var buildTimestamp = injectedString(
10444
- true ? "2026-11-06T23:01:05Z" : void 0
10448
+ true ? "2026-11-07T00:49:00Z" : void 0
10445
10449
  ) || String(process.env.HIVE_CLI_BUILD_TIMESTAMP || "").trim() || "unknown";
10446
10450
  var ociRef = injectedString(
10447
- true ? "registry.onstackit.cloud/senticor/hive-cli:1.118.0" : void 0
10451
+ true ? "registry.onstackit.cloud/senticor/hive-cli:1.119.0" : void 0
10448
10452
  ) || String(process.env.HIVE_CLI_OCI_REF || "").trim() || `registry.onstackit.cloud/senticor/${artifactName}:${releaseVersion}`;
10449
10453
  var RELEASE_INFO = Object.freeze({
10450
10454
  packageVersion,
@@ -33199,15 +33203,24 @@ var org = defineCommand({
33199
33203
 
33200
33204
  // src/commands/members.ts
33201
33205
  init_cjs_shims();
33202
- var memberArgs = withArgs({
33206
+ var whoArgs = {
33203
33207
  email: { type: "string", description: "The person's email" },
33204
- principalId: { type: "string", description: "Principal UUID" },
33208
+ principalId: { type: "string", description: "Principal UUID" }
33209
+ };
33210
+ var roleArgs = {
33205
33211
  role: { type: "string", description: "Role key" },
33206
- roles: { type: "string", description: "Comma-separated role keys" },
33212
+ roles: { type: "string", description: "Comma-separated role keys" }
33213
+ };
33214
+ var admitArgs = {
33207
33215
  displayName: { type: "string", description: "Name of a new person; an existing person's name does not change" },
33208
- directoryScope: { type: "string", description: "tenant | shared-missions; only a platform admin can widen it to tenant" },
33216
+ directoryScope: { type: "string", description: "tenant | shared-missions; only a platform admin can widen it to tenant" }
33217
+ };
33218
+ var reasonArg = {
33209
33219
  reason: { type: "string", description: "roles revoke: why the role ends, kept on record" }
33210
- });
33220
+ };
33221
+ var LOGIN_AND_URL = "CHOS has not told them. They need a login whose email address is verified; without one they land in their own tenant only. Then tell them the workspace URL.";
33222
+ var NEXT_STEP_FIRST_SIGN_IN = `This person has not signed in yet. ${LOGIN_AND_URL}`;
33223
+ var NEXT_STEP_UNKNOWN = `You cannot see whether this person has signed in. If they have not: ${LOGIN_AND_URL}`;
33211
33224
  function ensureOk2(status2, data, action) {
33212
33225
  if (!isHttpOk(status2)) throw remoteFailureError(status2, data, action);
33213
33226
  }
@@ -33225,7 +33238,8 @@ async function listMembers2(client) {
33225
33238
  directoryScope: typeof m.directoryScope === "string" ? m.directoryScope : void 0,
33226
33239
  roles: Array.isArray(m.roles) ? m.roles.map(String).sort() : [],
33227
33240
  principalId: String(principal.principalId ?? ""),
33228
- email: String(principal.email ?? "").toLowerCase()
33241
+ email: String(principal.email ?? "").toLowerCase(),
33242
+ signedIn: Boolean(principal.oidcSub)
33229
33243
  };
33230
33244
  });
33231
33245
  }
@@ -33299,12 +33313,12 @@ async function changeRoles2(args, action) {
33299
33313
  }
33300
33314
  var members2 = defineCommand({
33301
33315
  meta: { name: "members", description: "Manage the active tenant's members with your own user-manager role" },
33302
- args: memberArgs,
33316
+ args: withOwnArgs({ ...whoArgs, ...roleArgs, ...admitArgs, ...reasonArg }),
33303
33317
  default: "list",
33304
33318
  subCommands: {
33305
33319
  list: defineCommand({
33306
33320
  meta: { name: "list", description: "List the members you can see in the active tenant" },
33307
- args: memberArgs,
33321
+ args: withOwnArgs(),
33308
33322
  async run({ args }) {
33309
33323
  printContextNotice(args);
33310
33324
  const { client, fmt } = ctx(args);
@@ -33315,7 +33329,7 @@ var members2 = defineCommand({
33315
33329
  }),
33316
33330
  admit: defineCommand({
33317
33331
  meta: { name: "admit", description: "Admit a person by email, with roles the tenant's managers may hand out" },
33318
- args: memberArgs,
33332
+ args: withOwnArgs({ email: whoArgs.email, ...roleArgs, ...admitArgs }),
33319
33333
  async run({ args }) {
33320
33334
  printContextNotice(args);
33321
33335
  req(args, "email");
@@ -33334,6 +33348,9 @@ var members2 = defineCommand({
33334
33348
  ...directoryScope === void 0 ? {} : { directoryScope },
33335
33349
  ...generationField(before)
33336
33350
  });
33351
+ if (res.status === 428 && !before) {
33352
+ throw commandError("MEMBER_NOT_VISIBLE", 1, `${email3} is already a member of this tenant, but was not in the list this command read, so nothing changed. Run it again. If this repeats, your directory scope hides them: ask a platform admin to make this change or to give you the tenant scope.`);
33353
+ }
33337
33354
  ensureOk2(res.status, res.data, "admit tenant member");
33338
33355
  const after = findMember2(await listMembers2(client), { email: email3 });
33339
33356
  const rolesBefore = before?.roles ?? [];
@@ -33347,45 +33364,48 @@ var members2 = defineCommand({
33347
33364
  rolesBefore,
33348
33365
  rolesAfter,
33349
33366
  rolesAdded,
33350
- idempotent: Boolean(before) && before?.membershipStatus === "active" && rolesAdded.length === 0 && (directoryScope === void 0 || before?.directoryScope === directoryScope)
33367
+ idempotent: Boolean(before) && before?.membershipStatus === "active" && rolesAdded.length === 0 && (directoryScope === void 0 || before?.directoryScope === directoryScope),
33368
+ // A member the caller's directory hides after the admission reads as unknown.
33369
+ awaitingFirstSignIn: after ? !after.signedIn : null,
33370
+ ...after?.signedIn ? {} : { nextStep: after ? NEXT_STEP_FIRST_SIGN_IN : NEXT_STEP_UNKNOWN }
33351
33371
  }, fmt);
33352
33372
  }
33353
33373
  }),
33354
33374
  suspend: defineCommand({
33355
33375
  meta: { name: "suspend", description: "Suspend a member (--email or --principal-id); reactivate undoes it" },
33356
- args: memberArgs,
33376
+ args: withOwnArgs(whoArgs),
33357
33377
  async run({ args }) {
33358
33378
  return output(await changeMembership2(args, "suspended"), ctx(args).fmt);
33359
33379
  }
33360
33380
  }),
33361
33381
  revoke: defineCommand({
33362
33382
  meta: { name: "revoke", description: "Remove a person from the tenant (--email or --principal-id); their roles go too" },
33363
- args: memberArgs,
33383
+ args: withOwnArgs(whoArgs),
33364
33384
  async run({ args }) {
33365
33385
  return output(await changeMembership2(args, "revoked"), ctx(args).fmt);
33366
33386
  }
33367
33387
  }),
33368
33388
  reactivate: defineCommand({
33369
33389
  meta: { name: "reactivate", description: "Make a suspended or revoked membership active again (--email or --principal-id)" },
33370
- args: memberArgs,
33390
+ args: withOwnArgs(whoArgs),
33371
33391
  async run({ args }) {
33372
33392
  return output(await changeMembership2(args, "active"), ctx(args).fmt);
33373
33393
  }
33374
33394
  }),
33375
33395
  roles: defineCommand({
33376
33396
  meta: { name: "roles", description: "Grant or revoke roles the tenant's managers may hand out" },
33377
- args: memberArgs,
33397
+ args: withOwnArgs({ ...whoArgs, ...roleArgs, ...reasonArg }),
33378
33398
  subCommands: {
33379
33399
  grant: defineCommand({
33380
33400
  meta: { name: "grant", description: "Grant roles to a member (--roles a,b; --email or --principal-id)" },
33381
- args: memberArgs,
33401
+ args: withOwnArgs({ ...whoArgs, ...roleArgs }),
33382
33402
  async run({ args }) {
33383
33403
  return output(await changeRoles2(args, "grant"), ctx(args).fmt);
33384
33404
  }
33385
33405
  }),
33386
33406
  revoke: defineCommand({
33387
33407
  meta: { name: "revoke", description: "End roles of a member (--roles a,b; --email or --principal-id; --reason)" },
33388
- args: memberArgs,
33408
+ args: withOwnArgs({ ...whoArgs, ...roleArgs, ...reasonArg }),
33389
33409
  async run({ args }) {
33390
33410
  return output(await changeRoles2(args, "revoke"), ctx(args).fmt);
33391
33411
  }
@@ -33394,7 +33414,7 @@ var members2 = defineCommand({
33394
33414
  }),
33395
33415
  "delegable-roles": defineCommand({
33396
33416
  meta: { name: "delegable-roles", description: "List the roles this tenant's user managers may hand out" },
33397
- args: memberArgs,
33417
+ args: withOwnArgs(),
33398
33418
  async run({ args }) {
33399
33419
  printContextNotice(args);
33400
33420
  const { client, fmt } = ctx(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senticor/hive",
3
- "version": "1.118.0",
3
+ "version": "1.119.0",
4
4
  "description": "Cognitive Hive OS — unified CLI",
5
5
  "type": "commonjs",
6
6
  "bin": {