@pmate/cli 0.49.7 → 0.50.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/README.md CHANGED
@@ -424,3 +424,21 @@ Permission risk: H requires an admin-level role, M requires maintainer or admin,
424
424
  A Bot Account may own multiple application Profiles. Normal registration ensures one initial Profile; explicit `account bot profile create` adds another Profile for testing or another role. Agent execution metadata uses the selected Profile ID, not the account name.
425
425
 
426
426
  Bot login and nickname updates accept `--profile-id 0x…`. With multiple Profiles, select the intended Profile explicitly. Login does not create a Profile or silently choose the first. The desktop Runtime editor also requires an existing canonical Bot Profile ID; plugin IDs retain their own namespace.
427
+
428
+ ## Account lookup
429
+
430
+ ### Background
431
+
432
+ `account view` separates basic identity from explicitly requested private fields. Looking up another account in an authorized App no longer requires account administration rights. Role bindings, sessions and credentials remain separate resources.
433
+
434
+ ```sh
435
+ pmate account view --app pmate:merry --nickname Arius --json
436
+ pmate account view --account <id> --json
437
+ pmate account view --account <id> --include private --json
438
+ ```
439
+
440
+ Nickname lookup requires `--app`; duplicate nicknames return candidates for selection by Account ID. ID lookups default to the authenticated session's App. An explicit different App requires platform `profile:read`; namespace-limited credentials cannot escape their namespace. The App flag filters profiles; it does not switch authentication identity or grant access.
441
+
442
+ The response remains a JSON array with `account`, `profiles`, and `nickNames`. Basic account fields are `id`, `createdAt`, `kind`, and optional `name`; profiles contain only `id`, `app`, `account`, `userName`, `nickName`, `avatar`. Even self/root lookups omit mobile by default. `--include private` adds mobile only for self or platform `account:read`; phone-number search always requires that permission before lookup, plus explicit private inclusion. Inaccessible and absent basic targets both return an empty array.
443
+
444
+ Migration: callers relying on the old aggregated `roles`, `session`, full profiles or implicit mobile must use the appropriate resource API or explicitly request private fields. Account list and app-users remain privileged administration commands and retain their existing contracts. Deploy the updated auth API before using these CLI options.
package/dist/index.d.ts CHANGED
@@ -379,6 +379,8 @@ type AccountCommandArgs = {
379
379
  account?: string;
380
380
  mobile?: string;
381
381
  nickName?: string;
382
+ app?: string;
383
+ include?: "private";
382
384
  baseUrl?: string;
383
385
  json: boolean;
384
386
  } | {
package/dist/index.js CHANGED
@@ -23417,7 +23417,7 @@ var AccountCommandHandler = class {
23417
23417
  "GET",
23418
23418
  `/accounts/view?${this.buildAccountViewQuery(args)}`
23419
23419
  );
23420
- this.renderAccountView(result.items, args.json);
23420
+ this.renderAccountLookup(result.items, args.json);
23421
23421
  return;
23422
23422
  }
23423
23423
  case "role-list": {
@@ -23821,6 +23821,8 @@ var AccountCommandHandler = class {
23821
23821
  if (args.account) params.set("account", args.account);
23822
23822
  if (args.mobile) params.set("mobile", args.mobile);
23823
23823
  if (args.nickName) params.set("nickName", args.nickName);
23824
+ if (args.app) params.set("app", args.app);
23825
+ if (args.include) params.set("include", args.include);
23824
23826
  return params.toString();
23825
23827
  }
23826
23828
  buildAccountListQuery(args) {
@@ -23897,6 +23899,19 @@ var AccountCommandHandler = class {
23897
23899
  ui.plain(item);
23898
23900
  }
23899
23901
  }
23902
+ renderAccountLookup(items, asJson) {
23903
+ if (asJson) {
23904
+ ui.plain(JSON.stringify(items, null, 2));
23905
+ return;
23906
+ }
23907
+ if (!items.length) {
23908
+ ui.warn("No accounts found in the visible scope.");
23909
+ return;
23910
+ }
23911
+ for (const item of items) {
23912
+ ui.info(item.account.id, { ...item.account, profiles: item.profiles, nickNames: item.nickNames });
23913
+ }
23914
+ }
23900
23915
  renderAccountView(items, asJson) {
23901
23916
  if (asJson) {
23902
23917
  ui.plain(JSON.stringify(items, null, 2));
@@ -26430,7 +26445,8 @@ function parseAccountArgs(tokens) {
26430
26445
  let account2;
26431
26446
  let mobile;
26432
26447
  let nickName;
26433
- let profileId;
26448
+ let app;
26449
+ let include;
26434
26450
  let baseUrl3;
26435
26451
  let json2 = false;
26436
26452
  while (rest.length > 0) {
@@ -26448,6 +26464,13 @@ function parseAccountArgs(tokens) {
26448
26464
  case "--nickName":
26449
26465
  nickName = requireValue5(rest, token);
26450
26466
  break;
26467
+ case "--app":
26468
+ app = parseNamespacedRef(requireValue5(rest, token), { entityLabel: "app ref" }).fullId;
26469
+ break;
26470
+ case "--include":
26471
+ if (requireValue5(rest, token) !== "private") throw new Error("--include must be private");
26472
+ include = "private";
26473
+ break;
26451
26474
  case "--base-url":
26452
26475
  baseUrl3 = requireValue5(rest, token);
26453
26476
  break;
@@ -26465,15 +26488,19 @@ function parseAccountArgs(tokens) {
26465
26488
  const provided = [account2, mobile, nickName].filter(Boolean).length;
26466
26489
  if (provided !== 1) {
26467
26490
  throw new Error(
26468
- "Usage: account view (--account <id> | --mobile <mobile> | --nickname <nickname>) [--base-url <url>] [--json]"
26491
+ "Usage: account view (--account <id> | --mobile <mobile> | --nickname <nickname>) [--app <ns:id>] [--include private] [--base-url <url>] [--json]"
26469
26492
  );
26470
26493
  }
26494
+ if (nickName && !app) throw new Error("Nickname lookup requires --app <ns:id>");
26495
+ if (mobile && include !== "private") throw new Error("Mobile lookup requires --include private");
26471
26496
  return {
26472
26497
  type: "account" /* Account */,
26473
26498
  action,
26474
26499
  account: account2,
26475
26500
  mobile,
26476
26501
  nickName,
26502
+ ...app ? { app } : {},
26503
+ ...include ? { include } : {},
26477
26504
  baseUrl: baseUrl3,
26478
26505
  json: json2
26479
26506
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/cli",
3
- "version": "0.49.7",
3
+ "version": "0.50.0",
4
4
  "description": "CLI utilities for the pMate project",
5
5
  "license": "MIT",
6
6
  "bin": {