@f5-sales-demo/xcsh 23.3.3 → 23.4.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.
@@ -27,6 +27,7 @@ import {
27
27
  describeSetupPlan,
28
28
  executeInstallAuthorizedSetup,
29
29
  executeReviewedSetup,
30
+ formatSetupCommand,
30
31
  } from "../integrations/setup";
31
32
  import type { IntegrationHandle, IntegrationSetupPlan } from "../integrations/types";
32
33
  import { BorderedLoader } from "../modes/components/bordered-loader";
@@ -1203,6 +1204,8 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1203
1204
  ],
1204
1205
  allowArgs: true,
1205
1206
  handle: async (command, runtime) => {
1207
+ const pluginStatus = (message: string) => runtime.ctx.showStatus(message, { plugin: true });
1208
+ const pluginError = (message: string) => runtime.ctx.showError(message, { plugin: true });
1206
1209
  runtime.ctx.editor.setText("");
1207
1210
  const args = command.args.trim().split(/\s+/);
1208
1211
  const sub = args[0] || "";
@@ -1219,7 +1222,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1219
1222
  try {
1220
1223
  runtime.ctx.showPluginDashboard("discover");
1221
1224
  } catch (err) {
1222
- runtime.ctx.showStatus(t("commands.plugin.error", { message: String(err) }));
1225
+ pluginStatus(t("commands.plugin.error", { message: String(err) }));
1223
1226
  }
1224
1227
  return;
1225
1228
  }
@@ -1235,7 +1238,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1235
1238
  try {
1236
1239
  runtime.ctx.showPluginDashboard("installed");
1237
1240
  } catch (err) {
1238
- runtime.ctx.showStatus(t("commands.plugin.error", { message: String(err) }));
1241
+ pluginStatus(t("commands.plugin.error", { message: String(err) }));
1239
1242
  }
1240
1243
  return;
1241
1244
  }
@@ -1262,7 +1265,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1262
1265
  refresh?: Awaited<ReturnType<typeof mgr.refreshMarketplaces>>,
1263
1266
  ) => {
1264
1267
  const warning = refresh ? formatMarketplaceRefreshWarning(refresh) : undefined;
1265
- runtime.ctx.showStatus(warning ? `${warning}\n\n${message}` : message);
1268
+ pluginStatus(warning ? `${warning}\n\n${message}` : message);
1266
1269
  };
1267
1270
  switch (sub) {
1268
1271
  // ── Marketplace management (/plugin marketplace add|remove|update|list) ──
@@ -1273,7 +1276,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1273
1276
  switch (mktSub) {
1274
1277
  case "add": {
1275
1278
  if (!mktRest) {
1276
- runtime.ctx.showStatus(t("commands.plugin.marketplace.addUsage"));
1279
+ pluginStatus(t("commands.plugin.marketplace.addUsage"));
1277
1280
  return;
1278
1281
  }
1279
1282
  const prepared = await prepareMarketplaceAddition(mgr, mktRest);
@@ -1285,19 +1288,17 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1285
1288
  },
1286
1289
  execute: target => executeMarketplaceAddition(mgr, target),
1287
1290
  });
1288
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1291
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1289
1292
  else if (outcome === "succeeded")
1290
- runtime.ctx.showStatus(
1291
- t("commands.plugin.marketplace.added", { name: prepared.target.name }),
1292
- );
1293
+ pluginStatus(t("commands.plugin.marketplace.added", { name: prepared.target.name }));
1293
1294
  else if (outcome === "unresolved")
1294
- runtime.ctx.showError("Marketplace addition remains unresolved; retry from a fresh review.");
1295
+ pluginError("Marketplace addition remains unresolved; retry from a fresh review.");
1295
1296
  break;
1296
1297
  }
1297
1298
  case "remove":
1298
1299
  case "rm": {
1299
1300
  if (!mktRest) {
1300
- runtime.ctx.showStatus(t("commands.plugin.marketplace.removeUsage"));
1301
+ pluginStatus(t("commands.plugin.marketplace.removeUsage"));
1301
1302
  return;
1302
1303
  }
1303
1304
  const prepared = await prepareMarketplaceRemoval(mgr, mktRest);
@@ -1309,17 +1310,17 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1309
1310
  },
1310
1311
  execute: target => mgr.removeMarketplace(target.name),
1311
1312
  });
1312
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1313
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1313
1314
  else if (outcome === "succeeded")
1314
- runtime.ctx.showStatus(t("commands.plugin.marketplace.removed", { name: mktRest }));
1315
+ pluginStatus(t("commands.plugin.marketplace.removed", { name: mktRest }));
1315
1316
  else if (outcome === "unresolved")
1316
- runtime.ctx.showError("Marketplace removal remains unresolved; retry from a fresh review.");
1317
+ pluginError("Marketplace removal remains unresolved; retry from a fresh review.");
1317
1318
  break;
1318
1319
  }
1319
1320
  case "update": {
1320
1321
  if (mktRest) {
1321
1322
  await mgr.updateMarketplace(mktRest);
1322
- runtime.ctx.showStatus(t("commands.plugin.marketplace.updated", { name: mktRest }));
1323
+ pluginStatus(t("commands.plugin.marketplace.updated", { name: mktRest }));
1323
1324
  } else {
1324
1325
  const refresh = await mgr.refreshMarketplaces();
1325
1326
  showPluginStatus(
@@ -1334,13 +1335,13 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1334
1335
  case "enable":
1335
1336
  case "disable": {
1336
1337
  if (!mktRest) {
1337
- runtime.ctx.showStatus(`Usage: /plugin marketplace ${mktSub} <name>`);
1338
+ pluginStatus(`Usage: /plugin marketplace ${mktSub} <name>`);
1338
1339
  return;
1339
1340
  }
1340
1341
  const enabled = mktSub === "enable";
1341
1342
  const prepared = await prepareMarketplaceEnabled(mgr, mktRest, enabled);
1342
1343
  if (!prepared) {
1343
- runtime.ctx.showStatus(`Marketplace ${mktRest} is already ${mktSub}d.`);
1344
+ pluginStatus(`Marketplace ${mktRest} is already ${mktSub}d.`);
1344
1345
  break;
1345
1346
  }
1346
1347
  const outcome = await runReviewedAction(runtime.ctx, `marketplace ${mktSub}`, {
@@ -1354,25 +1355,23 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1354
1355
  await mgr.setMarketplaceEnabled(target.name, target.enabled);
1355
1356
  },
1356
1357
  });
1357
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1358
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1358
1359
  else if (outcome === "succeeded")
1359
- runtime.ctx.showStatus(`Marketplace ${mktRest} ${enabled ? "enabled" : "disabled"}.`);
1360
+ pluginStatus(`Marketplace ${mktRest} ${enabled ? "enabled" : "disabled"}.`);
1360
1361
  else if (outcome === "unresolved")
1361
- runtime.ctx.showError(
1362
- `Marketplace ${mktSub} remains unresolved; retry from a fresh review.`,
1363
- );
1362
+ pluginError(`Marketplace ${mktSub} remains unresolved; retry from a fresh review.`);
1364
1363
  break;
1365
1364
  }
1366
1365
  default: {
1367
1366
  const marketplaces = await mgr.listMarketplaces();
1368
1367
  if (marketplaces.length === 0) {
1369
- runtime.ctx.showStatus(t("commands.plugin.marketplace.noneConfiguredGetStarted"));
1368
+ pluginStatus(t("commands.plugin.marketplace.noneConfiguredGetStarted"));
1370
1369
  } else {
1371
1370
  const lines = marketplaces.map(
1372
1371
  m =>
1373
1372
  ` ${m.name} ${m.enabled ? "enabled" : "disabled"} ${m.builtIn ? "built-in" : "custom"} ${m.sourceUri}`,
1374
1373
  );
1375
- runtime.ctx.showStatus(
1374
+ pluginStatus(
1376
1375
  `Marketplaces:\n${lines.join("\n")}\n\n${t("commands.plugin.marketplace.listHint")}`,
1377
1376
  );
1378
1377
  }
@@ -1384,7 +1383,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1384
1383
  // ── Legacy shorthand: /marketplace add|remove|update → /plugin marketplace ──
1385
1384
  case "add": {
1386
1385
  if (!rest) {
1387
- runtime.ctx.showStatus(t("commands.plugin.marketplace.addUsage"));
1386
+ pluginStatus(t("commands.plugin.marketplace.addUsage"));
1388
1387
  return;
1389
1388
  }
1390
1389
  const prepared = await prepareMarketplaceAddition(mgr, rest);
@@ -1396,17 +1395,17 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1396
1395
  },
1397
1396
  execute: target => executeMarketplaceAddition(mgr, target),
1398
1397
  });
1399
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1398
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1400
1399
  else if (outcome === "succeeded")
1401
- runtime.ctx.showStatus(t("commands.plugin.marketplace.added", { name: prepared.target.name }));
1400
+ pluginStatus(t("commands.plugin.marketplace.added", { name: prepared.target.name }));
1402
1401
  else if (outcome === "unresolved")
1403
- runtime.ctx.showError("Marketplace addition remains unresolved; retry from a fresh review.");
1402
+ pluginError("Marketplace addition remains unresolved; retry from a fresh review.");
1404
1403
  break;
1405
1404
  }
1406
1405
  case "remove":
1407
1406
  case "rm": {
1408
1407
  if (!rest) {
1409
- runtime.ctx.showStatus(t("commands.plugin.marketplace.removeUsage"));
1408
+ pluginStatus(t("commands.plugin.marketplace.removeUsage"));
1410
1409
  return;
1411
1410
  }
1412
1411
  const prepared = await prepareMarketplaceRemoval(mgr, rest);
@@ -1418,17 +1417,17 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1418
1417
  },
1419
1418
  execute: target => mgr.removeMarketplace(target.name),
1420
1419
  });
1421
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1420
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1422
1421
  else if (outcome === "succeeded")
1423
- runtime.ctx.showStatus(t("commands.plugin.marketplace.removed", { name: rest }));
1422
+ pluginStatus(t("commands.plugin.marketplace.removed", { name: rest }));
1424
1423
  else if (outcome === "unresolved")
1425
- runtime.ctx.showError("Marketplace removal remains unresolved; retry from a fresh review.");
1424
+ pluginError("Marketplace removal remains unresolved; retry from a fresh review.");
1426
1425
  break;
1427
1426
  }
1428
1427
  case "update": {
1429
1428
  if (rest) {
1430
1429
  await mgr.updateMarketplace(rest);
1431
- runtime.ctx.showStatus(t("commands.plugin.marketplace.updated", { name: rest }));
1430
+ pluginStatus(t("commands.plugin.marketplace.updated", { name: rest }));
1432
1431
  } else {
1433
1432
  const refresh = await mgr.refreshMarketplaces();
1434
1433
  showPluginStatus(
@@ -1464,7 +1463,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1464
1463
  case "install": {
1465
1464
  const parsed = parseMarketplaceInstallArgs(rest);
1466
1465
  if ("error" in parsed) {
1467
- runtime.ctx.showStatus(parsed.error);
1466
+ pluginStatus(parsed.error);
1468
1467
  return;
1469
1468
  }
1470
1469
  const preview = parsed.installSpec.includes("@") ? undefined : await mgr.previewMarketplacePlugins();
@@ -1473,7 +1472,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1473
1472
  preview?.plugins.map(({ marketplace, plugin }) => ({ marketplace, name: plugin.name })) ?? [],
1474
1473
  );
1475
1474
  if ("error" in resolved) {
1476
- runtime.ctx.showStatus(resolved.error);
1475
+ pluginStatus(resolved.error);
1477
1476
  return;
1478
1477
  }
1479
1478
  const { name, marketplace } = resolved;
@@ -1486,7 +1485,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1486
1485
  },
1487
1486
  execute: target => executePluginInstall(mgr, target),
1488
1487
  });
1489
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1488
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1490
1489
  else if (outcome === "succeeded") {
1491
1490
  await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
1492
1491
  const handles = runtime.ctx.session?.extensionRunner?.getAllRegisteredIntegrations() ?? [];
@@ -1514,7 +1513,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1514
1513
  showPluginStatus(nextAction ? `${installed}\nnext: ${nextAction}` : installed);
1515
1514
  }
1516
1515
  } else if (outcome === "unresolved")
1517
- runtime.ctx.showError("Plugin installation remains unresolved; retry from a fresh review.");
1516
+ pluginError("Plugin installation remains unresolved; retry from a fresh review.");
1518
1517
  break;
1519
1518
  }
1520
1519
  // ── Uninstall ──
@@ -1524,7 +1523,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1524
1523
  "Usage: /plugin uninstall [--scope user|project] <name[@marketplace]>",
1525
1524
  );
1526
1525
  if ("error" in uninstArgs) {
1527
- runtime.ctx.showStatus(uninstArgs.error);
1526
+ pluginStatus(uninstArgs.error);
1528
1527
  return;
1529
1528
  }
1530
1529
  const prepared = await preparePluginRemoval(mgr, uninstArgs.pluginId, uninstArgs.scope);
@@ -1536,16 +1535,16 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1536
1535
  },
1537
1536
  execute: target => mgr.uninstallPlugin(target.pluginId, target.scope),
1538
1537
  });
1539
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1538
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1540
1539
  else if (outcome === "succeeded") {
1541
1540
  await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
1542
- runtime.ctx.showStatus(
1541
+ pluginStatus(
1543
1542
  t("commands.plugin.uninstalled", {
1544
1543
  pluginId: uninstArgs.pluginId,
1545
1544
  }),
1546
1545
  );
1547
1546
  } else if (outcome === "unresolved")
1548
- runtime.ctx.showError("Plugin removal remains unresolved; retry from a fresh review.");
1547
+ pluginError("Plugin removal remains unresolved; retry from a fresh review.");
1549
1548
  break;
1550
1549
  }
1551
1550
  // ── Enable / Disable ──
@@ -1556,13 +1555,13 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1556
1555
  `Usage: /plugin ${sub} [--scope user|project] <name@marketplace>`,
1557
1556
  );
1558
1557
  if ("error" in parsed) {
1559
- runtime.ctx.showStatus(parsed.error);
1558
+ pluginStatus(parsed.error);
1560
1559
  return;
1561
1560
  }
1562
1561
  const isEnable = sub === "enable";
1563
1562
  const prepared = await preparePluginEnabled(mgr, parsed.pluginId, parsed.scope, isEnable);
1564
1563
  if (!prepared) {
1565
- runtime.ctx.showStatus(
1564
+ pluginStatus(
1566
1565
  `Nothing changed. Plugin ${parsed.pluginId} is already ${isEnable ? "enabled" : "disabled"}.`,
1567
1566
  );
1568
1567
  break;
@@ -1575,16 +1574,16 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1575
1574
  },
1576
1575
  execute: target => mgr.setPluginEnabled(target.pluginId, isEnable, target.scope),
1577
1576
  });
1578
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1577
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1579
1578
  else if (outcome === "succeeded") {
1580
1579
  await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
1581
- runtime.ctx.showStatus(
1580
+ pluginStatus(
1582
1581
  isEnable
1583
1582
  ? t("commands.plugin.enabled", { pluginId: parsed.pluginId })
1584
1583
  : t("commands.plugin.disabled", { pluginId: parsed.pluginId }),
1585
1584
  );
1586
1585
  } else if (outcome === "unresolved")
1587
- runtime.ctx.showError(`Plugin ${sub} remains unresolved; retry from a fresh review.`);
1586
+ pluginError(`Plugin ${sub} remains unresolved; retry from a fresh review.`);
1588
1587
  break;
1589
1588
  }
1590
1589
  // ── Upgrade ──
@@ -1595,12 +1594,12 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1595
1594
  "Usage: /plugin upgrade [--scope user|project] <name@marketplace>",
1596
1595
  );
1597
1596
  if ("error" in upArgs) {
1598
- runtime.ctx.showStatus(upArgs.error);
1597
+ pluginStatus(upArgs.error);
1599
1598
  return;
1600
1599
  }
1601
1600
  const prepared = await preparePluginUpgrade(mgr, upArgs.pluginId, upArgs.scope);
1602
1601
  if (!prepared) {
1603
- runtime.ctx.showStatus(`Nothing changed. Plugin ${upArgs.pluginId} is already up to date.`);
1602
+ pluginStatus(`Nothing changed. Plugin ${upArgs.pluginId} is already up to date.`);
1604
1603
  break;
1605
1604
  }
1606
1605
  const outcome = await runReviewedAction(runtime.ctx, "plugin upgrade", {
@@ -1611,7 +1610,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1611
1610
  },
1612
1611
  execute: target => executePluginUpgrade(mgr, target),
1613
1612
  });
1614
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1613
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1615
1614
  else if (outcome === "succeeded") {
1616
1615
  await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
1617
1616
  showPluginStatus(
@@ -1621,7 +1620,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1621
1620
  }),
1622
1621
  );
1623
1622
  } else if (outcome === "unresolved")
1624
- runtime.ctx.showError("Plugin upgrade remains unresolved; retry from a fresh review.");
1623
+ pluginError("Plugin upgrade remains unresolved; retry from a fresh review.");
1625
1624
  } else {
1626
1625
  const prepared = await preparePluginUpgradeAll(mgr);
1627
1626
  if (!prepared) {
@@ -1639,9 +1638,9 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1639
1638
  result = await executePluginUpgradeAll(mgr, target);
1640
1639
  },
1641
1640
  });
1642
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1641
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1643
1642
  else if (outcome === "unresolved")
1644
- runtime.ctx.showError("Plugin upgrades remain unresolved; retry from a fresh review.");
1643
+ pluginError("Plugin upgrades remain unresolved; retry from a fresh review.");
1645
1644
  else if (outcome === "succeeded" && result) {
1646
1645
  await runtime.ctx.refreshSlashCommandState(undefined, { reloadExtensions: true });
1647
1646
  const lines = result.completed.map(
@@ -1651,7 +1650,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1651
1650
  const failures = result.failed.map(
1652
1651
  failure => ` ${failure.pluginId} [${failure.scope}]: ${failure.error}`,
1653
1652
  );
1654
- runtime.ctx.showStatus(
1653
+ pluginStatus(
1655
1654
  `${result.completed.length} plugin scope(s) upgraded; ${result.failed.length} unresolved. Re-run /plugin upgrade to review only unresolved operations.\n${[
1656
1655
  ...lines,
1657
1656
  ...failures,
@@ -1689,9 +1688,9 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1689
1688
  }
1690
1689
  }
1691
1690
  if (lines.length === 0) {
1692
- runtime.ctx.showStatus(t("commands.plugin.noneInstalled"));
1691
+ pluginStatus(t("commands.plugin.noneInstalled"));
1693
1692
  } else {
1694
- runtime.ctx.showStatus(lines.join("\n"));
1693
+ pluginStatus(lines.join("\n"));
1695
1694
  }
1696
1695
  break;
1697
1696
  }
@@ -1705,7 +1704,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1705
1704
  const catalogContent = await readOptionalTextFile(catalogPath);
1706
1705
  if (catalogContent !== undefined) {
1707
1706
  const catalog = parseMarketplaceCatalog(catalogContent, catalogPath);
1708
- runtime.ctx.showStatus(
1707
+ pluginStatus(
1709
1708
  t("commands.plugin.validate.marketplaceValid", {
1710
1709
  name: catalog.name,
1711
1710
  count: catalog.plugins.length,
@@ -1714,11 +1713,11 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1714
1713
  } else {
1715
1714
  const pluginContent = await readOptionalTextFile(pluginPath);
1716
1715
  if (pluginContent === undefined) {
1717
- runtime.ctx.showStatus(t("commands.plugin.validate.notFound", { path: targetPath }));
1716
+ pluginStatus(t("commands.plugin.validate.notFound", { path: targetPath }));
1718
1717
  break;
1719
1718
  }
1720
1719
  const manifest = JSON.parse(pluginContent);
1721
- runtime.ctx.showStatus(
1720
+ pluginStatus(
1722
1721
  t("commands.plugin.validate.pluginValid", {
1723
1722
  name: manifest.name ?? path.basename(targetPath),
1724
1723
  }),
@@ -1729,7 +1728,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1729
1728
  // ── Setup (reviewed authentication/readiness plan) ──
1730
1729
  case "setup": {
1731
1730
  if (!rest) {
1732
- runtime.ctx.showStatus("Usage: /plugin setup <plugin>");
1731
+ pluginStatus("Usage: /plugin setup <plugin>");
1733
1732
  break;
1734
1733
  }
1735
1734
  const matches = (runtime.ctx.session.extensionRunner?.getAllRegisteredIntegrations() ?? []).filter(
@@ -1738,7 +1737,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1738
1737
  handle.setupPlan !== undefined,
1739
1738
  );
1740
1739
  if (matches.length !== 1) {
1741
- runtime.ctx.showError(
1740
+ pluginError(
1742
1741
  matches.length
1743
1742
  ? `Plugin ${rest} registers multiple setup plans; use an integration id.`
1744
1743
  : `No setup plan is registered for ${rest}.`,
@@ -1748,7 +1747,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1748
1747
  const handle = matches[0] as IntegrationHandle<unknown>;
1749
1748
  let plan = handle.setupPlan;
1750
1749
  if (!plan) {
1751
- runtime.ctx.showError(`Integration ${handle.id} does not declare setup.`);
1750
+ pluginError(`Integration ${handle.id} does not declare setup.`);
1752
1751
  break;
1753
1752
  }
1754
1753
  const current = await handle.get();
@@ -1780,7 +1779,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1780
1779
  changes: plan.steps.map((step, index) => ({
1781
1780
  field: `${index + 1}. ${step.kind}`,
1782
1781
  before: "not run",
1783
- after: `${JSON.stringify(step.archive ?? step.argv)} (timeout ${step.timeoutMs}ms)`,
1782
+ after: `${step.archive ? JSON.stringify(step.archive, null, 2) : formatSetupCommand(step.argv)} (timeout ${step.timeoutMs}ms)`,
1784
1783
  })),
1785
1784
  consequence: describeSetupPlan(handle),
1786
1785
  };
@@ -1796,9 +1795,9 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1796
1795
  await personProfileService.reconcileFromCollectors(undefined, 0);
1797
1796
  },
1798
1797
  });
1799
- if (outcome === "busy") runtime.ctx.showStatus("Another reviewed action is already open.");
1798
+ if (outcome === "busy") pluginStatus("Another reviewed action is already open.");
1800
1799
  else if (outcome === "unresolved")
1801
- runtime.ctx.showError(`Plugin setup for ${rest} remains unresolved; retry from a fresh review.`);
1800
+ pluginError(`Plugin setup for ${rest} remains unresolved; retry from a fresh review.`);
1802
1801
  else if (outcome === "succeeded" && result) {
1803
1802
  showPluginStatus(
1804
1803
  `${handle.plugin ?? handle.id}: ${result.state}${result.reason ? ` (${result.reason})` : ""}`,
@@ -1807,21 +1806,21 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1807
1806
  break;
1808
1807
  }
1809
1808
  case "doctor": {
1810
- runtime.ctx.showError("Plugin health checks are CLI-only; run xcsh plugin doctor.");
1809
+ pluginError("Plugin health checks are CLI-only; run xcsh plugin doctor.");
1811
1810
  break;
1812
1811
  }
1813
1812
  // ── Help ──
1814
1813
  case "help": {
1815
- runtime.ctx.showStatus(t("commands.plugin.help"));
1814
+ pluginStatus(t("commands.plugin.help"));
1816
1815
  break;
1817
1816
  }
1818
1817
  default: {
1819
1818
  const marketplaces = await mgr.listMarketplaces();
1820
1819
  if (marketplaces.length === 0) {
1821
- runtime.ctx.showStatus(t("commands.plugin.marketplace.noneConfiguredBrowse"));
1820
+ pluginStatus(t("commands.plugin.marketplace.noneConfiguredBrowse"));
1822
1821
  } else {
1823
1822
  const lines = marketplaces.map(m => ` ${m.name} ${m.sourceUri}`);
1824
- runtime.ctx.showStatus(
1823
+ pluginStatus(
1825
1824
  `Marketplaces:\n${lines.join("\n")}\n\n${t("commands.plugin.marketplace.listHintAll")}`,
1826
1825
  );
1827
1826
  }
@@ -1830,7 +1829,7 @@ const BUILTIN_SLASH_COMMAND_REGISTRY: ReadonlyArray<BuiltinSlashCommandSpec> = [
1830
1829
  }
1831
1830
  } catch (err) {
1832
1831
  const msg = err instanceof Error ? err.message : String(err);
1833
- runtime.ctx.showError(t("commands.plugin.error", { message: msg }));
1832
+ pluginError(t("commands.plugin.error", { message: msg }));
1834
1833
  }
1835
1834
  },
1836
1835
  },
@@ -358,11 +358,27 @@ export const xcshApiToolRenderer = {
358
358
  const errorIcon = uiTheme.styledSymbol("status.error", "error");
359
359
 
360
360
  if (isError) {
361
+ if (details?.replacementId)
362
+ resultLines.push(
363
+ uiTheme.fg(
364
+ "warning",
365
+ `Replacement ${details.replacementId}: ${details.replacementStage ?? "pending"}. Resume this ID; do not DELETE again.`,
366
+ ),
367
+ );
361
368
  const apiMessage =
362
369
  parsed && typeof parsed.message === "string" ? stripProtobufPrefix(parsed.message) : undefined;
363
370
  const errorLabel = apiMessage ?? (status > 0 ? `Request failed (${status})` : "Request failed");
364
371
  resultLines.push(`${errorIcon} ${uiTheme.fg("warning", errorLabel)}`);
365
372
  if (guidance) resultLines.push(` ${uiTheme.fg("dim", `Try: ${guidance}`)}`);
373
+ } else if (details?.replacementStage === "complete" && parsed) {
374
+ resultLines.push(`${infoIcon} Recreated ${details.resourceLabel ?? resourceName}`);
375
+ resultLines.push(
376
+ uiTheme.fg(
377
+ "dim",
378
+ `Verified type ${String(parsed.targetSelections)} and new UID ${String(parsed.newUid)}`,
379
+ ),
380
+ );
381
+ resultLines.push(uiTheme.fg("warning", "Cutover caused downtime; the VIP may have changed."));
366
382
  } else if (details?.mutationVerb && details?.resourceLabel) {
367
383
  resultLines.push(`${infoIcon} ${details.mutationVerb} ${details.resourceLabel}`);
368
384
  } else if (method === "GET" && parsed) {