@pmate/cli 0.20.9 → 0.20.10

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 (2) hide show
  1. package/dist/index.js +3 -32
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19429,12 +19429,12 @@ var AgentCommandHandler = class {
19429
19429
  return;
19430
19430
  }
19431
19431
  case "list": {
19432
- const items = args.namespace ? (await this.request(
19432
+ const items = (await this.request(
19433
19433
  baseUrl,
19434
19434
  token,
19435
19435
  "GET",
19436
- `/agents?namespace=${encodeURIComponent(args.namespace)}`
19437
- )).items : await this.listAgentsAcrossNamespaces(baseUrl, token);
19436
+ args.namespace ? `/agents?namespace=${encodeURIComponent(args.namespace)}` : "/agents/all"
19437
+ )).items;
19438
19438
  this.renderList(items, args.json);
19439
19439
  return;
19440
19440
  }
@@ -19567,35 +19567,6 @@ var AgentCommandHandler = class {
19567
19567
  }
19568
19568
  return payload.data;
19569
19569
  }
19570
- async listAgentsAcrossNamespaces(baseUrl, token) {
19571
- const namespacesResponse = await this.request(
19572
- baseUrl,
19573
- token,
19574
- "GET",
19575
- "/agents/namespaces"
19576
- );
19577
- const namespaces = namespacesResponse.items.map((item) => item.namespace?.trim()).filter((value) => Boolean(value));
19578
- if (namespaces.length === 0) {
19579
- return [];
19580
- }
19581
- const listResponses = await Promise.all(
19582
- namespaces.map(async (namespace) => {
19583
- const response = await this.request(
19584
- baseUrl,
19585
- token,
19586
- "GET",
19587
- `/agents?namespace=${encodeURIComponent(namespace)}`
19588
- );
19589
- return response.items;
19590
- })
19591
- );
19592
- const merged = listResponses.flat();
19593
- const deduped = /* @__PURE__ */ new Map();
19594
- for (const item of merged) {
19595
- deduped.set(item.id, item);
19596
- }
19597
- return Array.from(deduped.values());
19598
- }
19599
19570
  renderList(items, asJson) {
19600
19571
  if (asJson) {
19601
19572
  ui.plain(JSON.stringify(items, null, 2));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/cli",
3
- "version": "0.20.9",
3
+ "version": "0.20.10",
4
4
  "description": "CLI utilities for the pMate project",
5
5
  "license": "MIT",
6
6
  "bin": {