@capxul/cli 4.20.0-beta.12 → 4.20.0-beta.13

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/main.mjs CHANGED
@@ -16127,7 +16127,7 @@ function signerFailure(source, operation, cause) {
16127
16127
  }
16128
16128
  //#endregion
16129
16129
  //#region ../../packages/sdk/package.json
16130
- var version$3 = "4.20.0-beta.12";
16130
+ var version$3 = "4.20.0-beta.13";
16131
16131
  //#endregion
16132
16132
  //#region ../../packages/sdk/src/telemetry/exception-projection.ts
16133
16133
  /** Fixed fallback for failures that have no safe message. */
@@ -68879,8 +68879,8 @@ function captureException(telemetry, error, context) {
68879
68879
  }
68880
68880
  //#endregion
68881
68881
  //#region src/runtime/version.ts
68882
- const cliVersion = "4.20.0-beta.12";
68883
- const sdkVersion = "4.20.0-beta.12";
68882
+ const cliVersion = "4.20.0-beta.13";
68883
+ const sdkVersion = "4.20.0-beta.13";
68884
68884
  const ReleaseVersion = Schema.String.check(Schema.isMaxLength(256), Schema.isPattern(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/u)).pipe(Schema.brand("CliReleaseVersion"));
68885
68885
  const parts = (version) => {
68886
68886
  const [core = "", ...prerelease] = version.split("+")[0].split("-");
@@ -71669,7 +71669,11 @@ const restoreVerifiedClient = (config, opened, options) => Effect.gen(function*
71669
71669
  }).pipe(Effect.mapError((error) => authenticationFailure(error, opened.email)));
71670
71670
  const restoreAuthenticatedClient = (config, suppliedEmail, options) => Effect.gen(function* () {
71671
71671
  const opened = yield* openAuthenticatedSession(config, suppliedEmail);
71672
- return yield* restoreVerifiedClient(config, opened, options);
71672
+ const runtime = yield* CliRuntime;
71673
+ return yield* withWaiting(restoreVerifiedClient(config, opened, options), {
71674
+ ...runtime,
71675
+ label: "Session restoration"
71676
+ });
71673
71677
  });
71674
71678
  const profileReport = (client, session, readProfile) => Effect.gen(function* () {
71675
71679
  const profile = yield* call((signal) => readProfile === void 0 ? client.identity.loadCurrent({ signal }) : readProfile(signal));
@@ -71851,7 +71855,11 @@ const completeAccountSetup = (config, store, client, session, suppliedProfile, c
71851
71855
  //#region src/commands/account/subcommands/status/execute.ts
71852
71856
  const execute$77 = (config, email) => Effect.gen(function* () {
71853
71857
  const { client, session } = yield* restoreAuthenticatedClient(config, email);
71854
- return yield* Effect.promise(() => client.account.getLifecycle()).pipe(Effect.flatMap(resultValue), Effect.map((lifecycle) => lifecycleResult(lifecycle, session.email)), Effect.mapError((error) => accountReadFailure(error, session.email)));
71858
+ const runtime = yield* CliRuntime;
71859
+ return yield* withWaiting(Effect.promise(() => client.account.getLifecycle()).pipe(Effect.flatMap(resultValue), Effect.map((lifecycle) => lifecycleResult(lifecycle, session.email)), Effect.mapError((error) => accountReadFailure(error, session.email))), {
71860
+ ...runtime,
71861
+ label: "Account status"
71862
+ });
71855
71863
  });
71856
71864
  //#endregion
71857
71865
  //#region src/commands/account/subcommands/status/command.ts
@@ -71860,10 +71868,14 @@ const command$79 = Command.make("status", { email: emailFlag$10 }, ({ email }) =
71860
71868
  //#region src/commands/account/subcommands/balance/execute.ts
71861
71869
  const execute$76 = (config, email) => Effect.gen(function* () {
71862
71870
  const { client, session } = yield* restoreAuthenticatedClient(config, email);
71863
- return yield* Effect.promise((signal) => client.accounts.read({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((account) => ({
71871
+ const runtime = yield* CliRuntime;
71872
+ return yield* withWaiting(Effect.promise((signal) => client.accounts.read({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((account) => ({
71864
71873
  data: { account },
71865
71874
  lines: balanceLines(account)
71866
- })), Effect.mapError((error) => accountReadFailure(error, session.email)));
71875
+ })), Effect.mapError((error) => accountReadFailure(error, session.email))), {
71876
+ ...runtime,
71877
+ label: "Account balance"
71878
+ });
71867
71879
  });
71868
71880
  //#endregion
71869
71881
  //#region src/commands/account/subcommands/balance/command.ts
@@ -71872,10 +71884,14 @@ const command$78 = Command.make("balance", { email: emailFlag$10 }, ({ email })
71872
71884
  //#region src/commands/account/subcommands/deposit/execute.ts
71873
71885
  const execute$75 = (config, email) => Effect.gen(function* () {
71874
71886
  const { client, session } = yield* restoreAuthenticatedClient(config, email);
71875
- return yield* Effect.promise((signal) => client.account.profile.depositInstructions({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((depositInstructions) => ({
71887
+ const runtime = yield* CliRuntime;
71888
+ return yield* withWaiting(Effect.promise((signal) => client.account.profile.depositInstructions({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((depositInstructions) => ({
71876
71889
  data: { depositInstructions },
71877
71890
  lines: depositLines(depositInstructions)
71878
- })), Effect.mapError((error) => accountReadFailure(error, session.email)));
71891
+ })), Effect.mapError((error) => accountReadFailure(error, session.email))), {
71892
+ ...runtime,
71893
+ label: "Account deposit instructions"
71894
+ });
71879
71895
  });
71880
71896
  //#endregion
71881
71897
  //#region src/commands/account/subcommands/deposit/command.ts
@@ -72299,7 +72315,10 @@ const readOrganization = (config, command, input, handler) => Effect.gen(functio
72299
72315
  const local = command === "list" || command === "use" ? organizationId : yield* readResolvedOrganization(config, session.authUserId, organizationId);
72300
72316
  const setupRead = command === "status" || command === "wait";
72301
72317
  let unfinished = [];
72302
- if (setupRead && local === null) unfinished = yield* listUnfinishedSetups(client);
72318
+ if (setupRead && local === null) unfinished = yield* withWaiting(listUnfinishedSetups(client), {
72319
+ ...runtime,
72320
+ label: "Organization setup discovery"
72321
+ });
72303
72322
  let resolved = setupRead && local === null && unfinished.length === 1 ? unfinished[0].orgId : local;
72304
72323
  if (setupRead && unfinished.length > 1) {
72305
72324
  if (!interactive) return yield* Effect.fail(inputRequired("Provide --org to select one unfinished Organization setup."));
@@ -72312,8 +72331,14 @@ const readOrganization = (config, command, input, handler) => Effect.gen(functio
72312
72331
  });
72313
72332
  }
72314
72333
  const exactSetupRead = setupRead && resolved !== null;
72315
- const organizations = exactSetupRead ? [] : yield* Effect.promise((signal) => handler.kind === "list" ? handler.listOrganizations(client, signal) : client.orgs({ signal })).pipe(Effect.flatMap(resultValue));
72316
- if (command === "list") unfinished = yield* listUnfinishedSetups(client, handler.kind === "list" ? handler.readSetupPage : void 0);
72334
+ const organizations = exactSetupRead ? [] : yield* withWaiting(Effect.promise((signal) => handler.kind === "list" ? handler.listOrganizations(client, signal) : client.orgs({ signal })).pipe(Effect.flatMap(resultValue)), {
72335
+ ...runtime,
72336
+ label: "Organization access"
72337
+ });
72338
+ if (command === "list") unfinished = yield* withWaiting(listUnfinishedSetups(client, handler.kind === "list" ? handler.readSetupPage : void 0), {
72339
+ ...runtime,
72340
+ label: "Organization setup discovery"
72341
+ });
72317
72342
  if (command === "list") {
72318
72343
  if (handler.kind !== "list") return yield* Effect.die("Expected Organization list handler");
72319
72344
  return yield* handler.run(organizations, unfinished);
@@ -73312,6 +73337,16 @@ const contactLines = (entry) => [
73312
73337
  ];
73313
73338
  //#endregion
73314
73339
  //#region src/commands/contact/internal/recovery.ts
73340
+ /** Only an exact selected Organization can normalize the backend's masked denial. */
73341
+ const normalizeContactScopeFailure = (error, orgs) => {
73342
+ const selected = [...new Set(orgs)];
73343
+ if (selected.length !== 1 || selected[0] === void 0) return error;
73344
+ try {
73345
+ return normalizeOrganizationReadFailure(error, toOrgId(selected[0]));
73346
+ } catch {
73347
+ return error;
73348
+ }
73349
+ };
73315
73350
  /** A lost write response needs readback in the same actor scope. */
73316
73351
  const uncertainContactFailure = (error, email, orgs, entryId) => {
73317
73352
  const failure = classifyFailure(Cause.fail(error));
@@ -73357,6 +73392,12 @@ const unhideCommand = (email, orgs, entryId) => {
73357
73392
  return `capxul ${orgs[0] === void 0 ? "" : "org "}contact unhide${orgs[0] === void 0 ? "" : ` --org ${shellArgument(orgs[0])}`} --entry-id ${shellArgument(entryId)} --email ${shellArgument(email)} --confirm`;
73358
73393
  };
73359
73394
  //#endregion
73395
+ //#region src/commands/contact/internal/client.ts
73396
+ const contactWaiting = (work, label) => Effect.flatMap(CliRuntime, (runtime) => withWaiting(work, {
73397
+ ...runtime,
73398
+ label
73399
+ }));
73400
+ //#endregion
73360
73401
  //#region src/commands/contact/internal/selection.ts
73361
73402
  const selectedBook = (client, actor, orgs) => Effect.gen(function* () {
73362
73403
  const ids = [...new Set(orgs)];
@@ -73373,9 +73414,9 @@ const selectedBook = (client, actor, orgs) => Effect.gen(function* () {
73373
73414
  return client.org(organizationId).addressBook;
73374
73415
  });
73375
73416
  /** Preserve supplied IDs; otherwise select an exact Party in this book, including hidden entries. */
73376
- const selectContactParty = (book, supplied) => Effect.gen(function* () {
73417
+ const selectContactParty = (book, supplied, orgs) => Effect.gen(function* () {
73377
73418
  if (supplied !== null) return supplied;
73378
- const entries = yield* Effect.promise((signal) => book.list({ includeHidden: true }, { signal })).pipe(Effect.flatMap(resultValue));
73419
+ const entries = yield* contactWaiting(Effect.promise((signal) => book.list({ includeHidden: true }, { signal })).pipe(Effect.flatMap(resultValue)), "Contact selection").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)));
73379
73420
  if (entries.length === 0) return yield* inputRequired("No contacts are available to select.");
73380
73421
  return yield* Prompt.select({
73381
73422
  message: "Contact",
@@ -73411,7 +73452,10 @@ const perform$15 = (book, prepared, orgs, email) => Effect.gen(function* () {
73411
73452
  ],
73412
73453
  question: "Add this contact?"
73413
73454
  });
73414
- const entry = yield* Effect.promise((signal) => book.add(prepared.value, { signal })).pipe(Effect.flatMap(resultValue), Effect.mapError((error) => email === void 0 ? error : uncertainContactFailure(error, email, orgs)));
73455
+ const entry = yield* contactWaiting(Effect.promise((signal) => book.add(prepared.value, { signal })).pipe(Effect.flatMap(resultValue)), "Contact add").pipe(Effect.mapError((error) => {
73456
+ const scoped = normalizeContactScopeFailure(error, orgs);
73457
+ return email === void 0 || !isCapxulError(scoped) ? scoped : uncertainContactFailure(scoped, email, orgs);
73458
+ }));
73415
73459
  return {
73416
73460
  data: entry,
73417
73461
  lines: [
@@ -73446,8 +73490,8 @@ const command$65 = (context) => Command.make("add", {
73446
73490
  //#region src/commands/contact/subcommands/get/execute.ts
73447
73491
  const prepare$3 = (input) => optionalPartyId(input.entryId);
73448
73492
  const perform$14 = (book, entryId, orgs) => Effect.gen(function* () {
73449
- const selected = yield* selectContactParty(book, entryId);
73450
- const entry = yield* Effect.promise((signal) => book.get(selected, { signal })).pipe(Effect.flatMap(resultValue));
73493
+ const selected = yield* selectContactParty(book, entryId, orgs);
73494
+ const entry = yield* contactWaiting(Effect.promise((signal) => book.get(selected, { signal })).pipe(Effect.flatMap(resultValue)), "Contact get").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)));
73451
73495
  return {
73452
73496
  data: entry,
73453
73497
  lines: [actorLine(orgs), ...entry === null ? ["No contact found."] : contactLines(entry)]
@@ -73475,9 +73519,9 @@ const command$64 = (context) => Command.make("get", {
73475
73519
  //#endregion
73476
73520
  //#region src/commands/contact/internal/visibility.ts
73477
73521
  const performVisibility = (book, prepared, orgs, email, kind, mutate) => Effect.gen(function* () {
73478
- const entryId = yield* selectContactParty(book, prepared.entryId);
73522
+ const entryId = yield* selectContactParty(book, prepared.entryId, orgs);
73479
73523
  if (prepared.interactive) {
73480
- const current = yield* Effect.promise((signal) => book.get(entryId, { signal })).pipe(Effect.flatMap(resultValue));
73524
+ const current = yield* contactWaiting(Effect.promise((signal) => book.get(entryId, { signal })).pipe(Effect.flatMap(resultValue)), "Contact preview").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)));
73481
73525
  if (current === null) return yield* inputRequired("No contact has that --entry-id.");
73482
73526
  yield* confirmWrite({
73483
73527
  lines: [
@@ -73488,7 +73532,10 @@ const performVisibility = (book, prepared, orgs, email, kind, mutate) => Effect.
73488
73532
  question: kind === "hide" ? "Hide this contact?" : "Show this contact again?"
73489
73533
  });
73490
73534
  }
73491
- const entry = yield* Effect.promise((signal) => mutate(entryId, signal)).pipe(Effect.flatMap(resultValue), Effect.mapError((error) => email === void 0 ? error : uncertainContactFailure(error, email, orgs, entryId)));
73535
+ const entry = yield* contactWaiting(Effect.promise((signal) => mutate(entryId, signal)).pipe(Effect.flatMap(resultValue)), kind === "hide" ? "Contact hide" : "Contact unhide").pipe(Effect.mapError((error) => {
73536
+ const scoped = normalizeContactScopeFailure(error, orgs);
73537
+ return email === void 0 || !isCapxulError(scoped) ? scoped : uncertainContactFailure(scoped, email, orgs, entryId);
73538
+ }));
73492
73539
  const undo = kind !== "hide" || email === void 0 ? null : unhideCommand(email, orgs, entry.id);
73493
73540
  return {
73494
73541
  data: entry,
@@ -73540,9 +73587,9 @@ const prepare$1 = (input) => Effect.gen(function* () {
73540
73587
  };
73541
73588
  });
73542
73589
  const perform$12 = (book, prepared, orgs, email) => Effect.gen(function* () {
73543
- const entryId = yield* selectContactParty(book, prepared.entryId);
73590
+ const entryId = yield* selectContactParty(book, prepared.entryId, orgs);
73544
73591
  if (prepared.interactive) {
73545
- const current = yield* Effect.promise((signal) => book.get(entryId, { signal })).pipe(Effect.flatMap(resultValue));
73592
+ const current = yield* contactWaiting(Effect.promise((signal) => book.get(entryId, { signal })).pipe(Effect.flatMap(resultValue)), "Contact preview").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)));
73546
73593
  if (current === null) return yield* inputRequired("No contact has that --entry-id.");
73547
73594
  yield* confirmWrite({
73548
73595
  lines: [
@@ -73553,10 +73600,13 @@ const perform$12 = (book, prepared, orgs, email) => Effect.gen(function* () {
73553
73600
  question: "Change this contact's label?"
73554
73601
  });
73555
73602
  }
73556
- const entry = yield* Effect.promise((signal) => book.label({
73603
+ const entry = yield* contactWaiting(Effect.promise((signal) => book.label({
73557
73604
  entryId,
73558
73605
  label: prepared.label
73559
- }, { signal })).pipe(Effect.flatMap(resultValue), Effect.mapError((error) => email === void 0 ? error : uncertainContactFailure(error, email, orgs, entryId)));
73606
+ }, { signal })).pipe(Effect.flatMap(resultValue)), "Contact label").pipe(Effect.mapError((error) => {
73607
+ const scoped = normalizeContactScopeFailure(error, orgs);
73608
+ return email === void 0 || !isCapxulError(scoped) ? scoped : uncertainContactFailure(scoped, email, orgs, entryId);
73609
+ }));
73560
73610
  return {
73561
73611
  data: entry,
73562
73612
  lines: [
@@ -73591,7 +73641,7 @@ const command$62 = (context) => Command.make("label", {
73591
73641
  }, execute$59)).pipe(context.annotate("label"), Command.withDescription("Change one contact label by stable PartyId"));
73592
73642
  //#endregion
73593
73643
  //#region src/commands/contact/subcommands/list/execute.ts
73594
- const perform$11 = (book, input, orgs) => Effect.promise((signal) => book.list(input.includeHidden ? { includeHidden: true } : void 0, { signal })).pipe(Effect.flatMap(resultValue), Effect.map((entries) => ({
73644
+ const perform$11 = (book, input, orgs) => contactWaiting(Effect.promise((signal) => book.list(input.includeHidden ? { includeHidden: true } : void 0, { signal })).pipe(Effect.flatMap(resultValue)), "Contact list").pipe(Effect.mapError((error) => normalizeContactScopeFailure(error, orgs)), Effect.map((entries) => ({
73595
73645
  data: entries,
73596
73646
  lines: [actorLine(orgs), ...entries.length === 0 ? ["No contacts found."] : entries.flatMap(contactLines)]
73597
73647
  })));
@@ -74498,7 +74548,7 @@ const resolveOwningOrganization = (client, invitationId) => Effect.gen(function*
74498
74548
  }, { signal })).pipe(Effect.flatMap(resultValue));
74499
74549
  const match = page.items.find((invitation) => invitation.id === invitationId);
74500
74550
  if (match !== void 0) return match.orgId;
74501
- if (page.nextCursor === null) return yield* Effect.fail(Errors.invalidInput("invitationId", "The invitation is not in your available offers. Provide --org to read it directly."));
74551
+ if (page.nextCursor === null) return yield* Effect.fail(invitationAccessFailure(new CapxulError("ROLE_PERMISSION_DENIED", "The invitation is unavailable.")));
74502
74552
  cursor = page.nextCursor;
74503
74553
  }
74504
74554
  });
@@ -74805,13 +74855,19 @@ const invite = Command.make("invite").pipe(annotate$6(CAPXUL_OPERATIONS.org.invi
74805
74855
  ]));
74806
74856
  //#endregion
74807
74857
  //#region src/commands/org/subcommands/balance/execute.ts
74808
- const perform$9 = (scoped, organizationId, organization) => Effect.promise((signal) => scoped.treasury({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((account) => ({
74809
- data: {
74810
- organizationId,
74811
- account
74812
- },
74813
- lines: [...organizationIdentityLines(organization), ...balanceLines(account)]
74814
- })));
74858
+ const perform$9 = (scoped, organizationId, organization) => Effect.gen(function* () {
74859
+ const runtime = yield* CliRuntime;
74860
+ return yield* withWaiting(Effect.promise((signal) => scoped.treasury({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((account) => ({
74861
+ data: {
74862
+ organizationId,
74863
+ account
74864
+ },
74865
+ lines: [...organizationIdentityLines(organization), ...balanceLines(account)]
74866
+ }))), {
74867
+ ...runtime,
74868
+ label: "Organization balance"
74869
+ });
74870
+ });
74815
74871
  const execute$46 = (config, input) => readOrganization(config, "balance", input, {
74816
74872
  kind: "scoped",
74817
74873
  run: ({ scoped, organizationId, organization }) => perform$9(scoped(), organizationId, organization)
@@ -74821,13 +74877,19 @@ const execute$46 = (config, input) => readOrganization(config, "balance", input,
74821
74877
  const command$49 = Command.make("balance", scoped, (flags) => read("org.balance", flags, execute$46)).pipe(Command.annotate(CliCommandMetadata, metadata$12("org.balance")), Command.withDescription("Read exact Organization treasury balances"));
74822
74878
  //#endregion
74823
74879
  //#region src/commands/org/subcommands/deposit/execute.ts
74824
- const perform$8 = (scoped, organizationId, organization) => Effect.promise((signal) => scoped.profile.depositInstructions({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((depositInstructions) => ({
74825
- data: {
74826
- organizationId,
74827
- depositInstructions
74828
- },
74829
- lines: [...organizationIdentityLines(organization), ...depositLines(depositInstructions)]
74830
- })));
74880
+ const perform$8 = (scoped, organizationId, organization) => Effect.gen(function* () {
74881
+ const runtime = yield* CliRuntime;
74882
+ return yield* withWaiting(Effect.promise((signal) => scoped.profile.depositInstructions({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((depositInstructions) => ({
74883
+ data: {
74884
+ organizationId,
74885
+ depositInstructions
74886
+ },
74887
+ lines: [...organizationIdentityLines(organization), ...depositLines(depositInstructions)]
74888
+ }))), {
74889
+ ...runtime,
74890
+ label: "Organization deposit instructions"
74891
+ });
74892
+ });
74831
74893
  const execute$45 = (config, input) => readOrganization(config, "deposit", input, {
74832
74894
  kind: "scoped",
74833
74895
  run: ({ scoped, organizationId, organization }) => perform$8(scoped(), organizationId, organization)
@@ -74947,10 +75009,13 @@ const accessDenied = (orgId) => new CliFailure({
74947
75009
  });
74948
75010
  const resolvePermissionScope = (config, email, explicit) => Effect.gen(function* () {
74949
75011
  const { client, session } = yield* restoreAuthenticatedClient(config, email);
74950
- const organizations = yield* Effect.promise((signal) => client.orgs({ signal })).pipe(Effect.flatMap(resultValue));
75012
+ const runtime = yield* CliRuntime;
75013
+ const organizations = yield* withWaiting(Effect.promise((signal) => client.orgs({ signal })).pipe(Effect.flatMap(resultValue)), {
75014
+ ...runtime,
75015
+ label: "Organization access"
75016
+ });
74951
75017
  let orgId = explicit ?? (yield* readOrganizationSelection(config, session.authUserId));
74952
75018
  if (orgId === null) {
74953
- const runtime = yield* CliRuntime;
74954
75019
  if (!runtime.tty || runtime.ci || runtime.mode === "json" || organizations.length === 0) return yield* inputRequired("Provide --org or select a read default with org use.");
74955
75020
  orgId = yield* Prompt.select({
74956
75021
  message: "Organization",
@@ -74973,7 +75038,11 @@ const resolvePermissionScope = (config, email, explicit) => Effect.gen(function*
74973
75038
  const execute$44 = (config, input) => Effect.gen(function* () {
74974
75039
  const explicit = yield* explicitOrganization$1(input.orgs);
74975
75040
  const { orgId, organization, permissions } = yield* resolvePermissionScope(config, input.email, explicit);
74976
- const result = yield* Effect.promise((signal) => permissions.list({ signal })).pipe(Effect.flatMap(resultValue));
75041
+ const runtime = yield* CliRuntime;
75042
+ const result = yield* withWaiting(Effect.promise((signal) => permissions.list({ signal })).pipe(Effect.flatMap(resultValue)), {
75043
+ ...runtime,
75044
+ label: "Permission list"
75045
+ });
74977
75046
  return {
74978
75047
  data: { permissions: result },
74979
75048
  lines: permissionListLines(orgId, result, organization.name)
@@ -75006,7 +75075,11 @@ const execute$43 = (config, input) => Effect.gen(function* () {
75006
75075
  const explicit = yield* explicitOrganization$1(input.orgs);
75007
75076
  const permissionId = yield* readPermissionId(input.permissionId);
75008
75077
  const { orgId, permissions } = yield* resolvePermissionScope(config, input.email, explicit);
75009
- const permission = yield* Effect.promise((signal) => permissions.get(permissionId, { signal })).pipe(Effect.flatMap(resultValue));
75078
+ const runtime = yield* CliRuntime;
75079
+ const permission = yield* withWaiting(Effect.promise((signal) => permissions.get(permissionId, { signal })).pipe(Effect.flatMap(resultValue)), {
75080
+ ...runtime,
75081
+ label: "Permission read"
75082
+ });
75010
75083
  if (permission === null) return yield* notFound();
75011
75084
  if (permission.permissionId !== permissionId || permission.orgId !== orgId) return yield* new CliFailure({
75012
75085
  code: "INVALID_INPUT",
@@ -78745,13 +78818,19 @@ const command$23 = Command.make("list", { email: emailFlag$9 }, ({ email }) => r
78745
78818
  }, execute$21)).pipe(Command.annotate(CliCommandMetadata, metadata$12(CAPXUL_OPERATIONS.org.list)), Command.withDescription("List current Organization access"));
78746
78819
  //#endregion
78747
78820
  //#region src/commands/org/subcommands/me/execute.ts
78748
- const perform$6 = (scoped, organizationId, organization) => Effect.promise((signal) => scoped.me({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((member) => ({
78749
- data: {
78750
- organizationId,
78751
- member
78752
- },
78753
- lines: [...organizationIdentityLines(organization), ...organizationMeLines(member)]
78754
- })));
78821
+ const perform$6 = (scoped, organizationId, organization) => Effect.gen(function* () {
78822
+ const runtime = yield* CliRuntime;
78823
+ return yield* withWaiting(Effect.promise((signal) => scoped.me({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((member) => ({
78824
+ data: {
78825
+ organizationId,
78826
+ member
78827
+ },
78828
+ lines: [...organizationIdentityLines(organization), ...organizationMeLines(member)]
78829
+ }))), {
78830
+ ...runtime,
78831
+ label: "Organization membership"
78832
+ });
78833
+ });
78755
78834
  const execute$20 = (config, input) => readOrganization(config, "me", input, {
78756
78835
  kind: "scoped",
78757
78836
  run: ({ scoped, organizationId, organization }) => perform$6(scoped(), organizationId, organization)
@@ -78765,7 +78844,11 @@ const command$22 = Command.make("me", scoped, ({ email, orgs }) => read(CAPXUL_O
78765
78844
  //#endregion
78766
78845
  //#region src/commands/org/subcommands/member/get/execute.ts
78767
78846
  const perform$5 = (scoped, organizationId, organization, selectedAccountId) => Effect.gen(function* () {
78768
- const members = yield* Effect.promise((signal) => scoped.members({ signal })).pipe(Effect.flatMap(resultValue));
78847
+ const runtime = yield* CliRuntime;
78848
+ const members = yield* withWaiting(Effect.promise((signal) => scoped.members({ signal })).pipe(Effect.flatMap(resultValue)), {
78849
+ ...runtime,
78850
+ label: "Organization members"
78851
+ });
78769
78852
  let accountId = selectedAccountId;
78770
78853
  if (accountId === null) {
78771
78854
  const choices = members.flatMap((member) => member.accountId === null ? [] : [{
@@ -78813,17 +78896,23 @@ const command$21 = Command.make("get", {
78813
78896
  }, execute$19, Option.isSome(accountId) ? { accountId: accountId.value } : {})).pipe(Command.annotate(CliCommandMetadata, metadata$12("org.member.get")), Command.withDescription("Read one member by exact Account ID"));
78814
78897
  //#endregion
78815
78898
  //#region src/commands/org/subcommands/member/list/execute.ts
78816
- const perform$4 = (scoped, organizationId, organization) => Effect.promise((signal) => scoped.members({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((members) => ({
78817
- data: {
78818
- organizationId,
78819
- members
78820
- },
78821
- lines: [
78822
- ...organizationIdentityLines(organization),
78823
- "Members",
78824
- ...members.length === 0 ? ["No members found."] : members.flatMap((member) => [...organizationMemberLines(member), ""])
78825
- ]
78826
- })));
78899
+ const perform$4 = (scoped, organizationId, organization) => Effect.gen(function* () {
78900
+ const runtime = yield* CliRuntime;
78901
+ return yield* withWaiting(Effect.promise((signal) => scoped.members({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((members) => ({
78902
+ data: {
78903
+ organizationId,
78904
+ members
78905
+ },
78906
+ lines: [
78907
+ ...organizationIdentityLines(organization),
78908
+ "Members",
78909
+ ...members.length === 0 ? ["No members found."] : members.flatMap((member) => [...organizationMemberLines(member), ""])
78910
+ ]
78911
+ }))), {
78912
+ ...runtime,
78913
+ label: "Organization members"
78914
+ });
78915
+ });
78827
78916
  const execute$18 = (config, input) => readOrganization(config, "member.list", input, {
78828
78917
  kind: "scoped",
78829
78918
  run: ({ scoped, organizationId, organization }) => perform$4(scoped(), organizationId, organization)
@@ -78843,17 +78932,23 @@ const command$19 = Command.make("member").pipe(Command.annotate(CliCommandMetada
78843
78932
  ]));
78844
78933
  //#endregion
78845
78934
  //#region src/commands/org/subcommands/members/execute.ts
78846
- const perform$3 = (scoped, organizationId, organization) => Effect.promise((signal) => scoped.members({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((members) => ({
78847
- data: {
78848
- organizationId,
78849
- members
78850
- },
78851
- lines: [
78852
- ...organizationIdentityLines(organization),
78853
- "Members",
78854
- ...members.length === 0 ? ["No members found."] : members.flatMap((member) => [...organizationMemberLines(member), ""])
78855
- ]
78856
- })));
78935
+ const perform$3 = (scoped, organizationId, organization) => Effect.gen(function* () {
78936
+ const runtime = yield* CliRuntime;
78937
+ return yield* withWaiting(Effect.promise((signal) => scoped.members({ signal })).pipe(Effect.flatMap(resultValue), Effect.map((members) => ({
78938
+ data: {
78939
+ organizationId,
78940
+ members
78941
+ },
78942
+ lines: [
78943
+ ...organizationIdentityLines(organization),
78944
+ "Members",
78945
+ ...members.length === 0 ? ["No members found."] : members.flatMap((member) => [...organizationMemberLines(member), ""])
78946
+ ]
78947
+ }))), {
78948
+ ...runtime,
78949
+ label: "Organization members"
78950
+ });
78951
+ });
78857
78952
  const execute$17 = (config, input) => readOrganization(config, "members", input, {
78858
78953
  kind: "scoped",
78859
78954
  run: ({ scoped, organizationId, organization }) => perform$3(scoped(), organizationId, organization)