skydive-cli 0.3.0-beta.853 → 0.3.0-beta.869

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/js/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { C as setActiveWorkspace, S as listWorkspaces, T as version, _ as themes, b as getActiveWorkspaceId, o as brandHelpArt, t as installCrashHandler, w as name, x as getSessionIdentity, y as ensureActiveOrganization } from "./install-mpXV2NVA.mjs";
2
+ import { C as setActiveWorkspace, S as listWorkspaces, T as version, _ as themes, b as getActiveWorkspaceId, o as brandHelpArt, t as installCrashHandler, w as name, x as getSessionIdentity, y as ensureActiveOrganization } from "./install-L5hAfRk-.mjs";
3
3
  import { A as getStoredApiKeyWorkspaceName, C as getLastSeenVersion, F as resolveManagementAuth, I as resolveSession, M as resolveAppUrl, N as resolveChatAuth, O as getShareMachineDefault, P as resolveConfig, R as saveConfig, S as getConfigPath, T as getPromptHistoryPath, V as setLastSeenVersion, _ as API_KEY_PREFIX, b as PREFERENCES, g as API_KEY_FAMILY_PREFIX, h as API_KEYS_URL, i as resolveAgent, j as getUpdateCheckDisabled, k as getStoredApiKeyId, v as DEFAULT_API_URL, w as getPreference, x as deleteConfig, z as saveSession } from "./print-X2N5wJ5l.mjs";
4
4
  import { n as printError, r as printTable, t as output } from "./output-DYzzdXYV.mjs";
5
5
  import { n as createRestClient, t as HttpError } from "./rest-imDZZGQA.mjs";
@@ -73,31 +73,24 @@ var SkydiveApiClient = class {
73
73
  this.authKind = config.kind;
74
74
  }
75
75
  /**
76
- * List agents in the caller's workspace, following the server's cursor
77
- * until `limit` is satisfied. The endpoint caps one page at
78
- * {@link MAX_AGENT_PAGE}, so a larger limit takes several requests
79
- * callers just ask for what they want. `hasMore` reports whether the
80
- * roster continues past what was returned.
76
+ * List one page of agents in the caller's workspace. The server caps a
77
+ * page at {@link MAX_AGENT_PAGE}, so `limit` is clamped to that. Callers
78
+ * page forward by passing the returned `nextCursor` back in as `cursor`;
79
+ * `nextCursor` is null once the roster is exhausted.
81
80
  */
82
81
  async listAgents(params) {
83
- const agents = [];
84
- let cursor = null;
85
- do {
86
- const query = new URLSearchParams({ limit: String(Math.min(MAX_AGENT_PAGE, params.limit - agents.length)) });
87
- if (params.scope) query.set("scope", params.scope);
88
- if (cursor) query.set("cursor", cursor);
89
- const page = await this.request({
90
- method: "GET",
91
- path: `/agents?${query.toString()}`,
92
- schema: ListAgentsResponseSchema
93
- });
94
- if (page.isErr()) return err(page.error);
95
- agents.push(...page.value.agents);
96
- cursor = page.value.nextCursor;
97
- } while (cursor && agents.length < params.limit);
82
+ const query = new URLSearchParams({ limit: String(Math.min(MAX_AGENT_PAGE, params.limit)) });
83
+ if (params.scope) query.set("scope", params.scope);
84
+ if (params.cursor) query.set("cursor", params.cursor);
85
+ const page = await this.request({
86
+ method: "GET",
87
+ path: `/agents?${query.toString()}`,
88
+ schema: ListAgentsResponseSchema
89
+ });
90
+ if (page.isErr()) return err(page.error);
98
91
  return ok({
99
- agents,
100
- hasMore: cursor !== null
92
+ agents: page.value.agents,
93
+ nextCursor: page.value.nextCursor
101
94
  });
102
95
  }
103
96
  async getAgent(id) {
@@ -1067,7 +1060,10 @@ const listCommand$5 = {
1067
1060
  builder: (y) => y.option("limit", {
1068
1061
  type: "number",
1069
1062
  default: 20,
1070
- describe: "Max results"
1063
+ describe: "Results per page"
1064
+ }).option("cursor", {
1065
+ type: "string",
1066
+ describe: "Page token from a previous list to fetch the next page"
1071
1067
  }).option("scope", {
1072
1068
  type: "string",
1073
1069
  choices: ["mine", "org"],
@@ -1076,15 +1072,19 @@ const listCommand$5 = {
1076
1072
  handler: async (argv) => {
1077
1073
  const result = await requireManagementClient(argv).listAgents({
1078
1074
  limit: argv.limit,
1079
- scope: argv.scope ?? null
1075
+ scope: argv.scope ?? null,
1076
+ cursor: argv.cursor
1080
1077
  });
1081
1078
  if (result.isErr()) {
1082
1079
  printError(result.error.message);
1083
1080
  process.exit(1);
1084
1081
  }
1085
- const { agents, hasMore } = result.value;
1082
+ const { agents, nextCursor } = result.value;
1086
1083
  if (argv.json) {
1087
- output(argv, agents);
1084
+ output(argv, {
1085
+ agents,
1086
+ nextCursor
1087
+ });
1088
1088
  return;
1089
1089
  }
1090
1090
  if (agents.length === 0) {
@@ -1093,7 +1093,7 @@ const listCommand$5 = {
1093
1093
  }
1094
1094
  const { headers, rows } = buildAgentTable(agents);
1095
1095
  printTable(headers, rows);
1096
- if (hasMore && !argv.quiet) console.log(`\nShowing the ${agents.length} newest. Raise --limit to see more.`);
1096
+ if (nextCursor && !argv.quiet) console.log(`\nMore results. Next page: --cursor ${nextCursor}`);
1097
1097
  }
1098
1098
  };
1099
1099
  const DESCRIPTION_MAX = 48;
@@ -1505,7 +1505,7 @@ const importCommand = {
1505
1505
  process.exit(1);
1506
1506
  }
1507
1507
  }
1508
- const { runChat } = await import("./boot-95ngTnOd.mjs");
1508
+ const { runChat } = await import("./boot-BIpdog5Z.mjs");
1509
1509
  await runChat({
1510
1510
  appUrl,
1511
1511
  sessionToken: session.value.sessionToken,
@@ -1917,7 +1917,7 @@ const chatCommand = {
1917
1917
  sessionToken: auth.value.token,
1918
1918
  agentSelector: argv.agent ?? null
1919
1919
  });
1920
- const { runChat } = await import("./boot-95ngTnOd.mjs");
1920
+ const { runChat } = await import("./boot-BIpdog5Z.mjs");
1921
1921
  await runChat({
1922
1922
  appUrl: auth.value.appUrl,
1923
1923
  sessionToken: auth.value.token,
@@ -2276,7 +2276,7 @@ const switchCommand = {
2276
2276
  printError("The workspace picker needs the Bun runtime and it could not be set up automatically. Pass a workspace slug instead, or install Bun and retry.");
2277
2277
  process.exit(1);
2278
2278
  }
2279
- const { runWorkspacePicker } = await import("./boot-95ngTnOd.mjs");
2279
+ const { runWorkspacePicker } = await import("./boot-BIpdog5Z.mjs");
2280
2280
  await runWorkspacePicker(session);
2281
2281
  return;
2282
2282
  }
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { C as setActiveWorkspace, S as listWorkspaces, a as WORDMARK, b as getActiveWorkspaceId, c as applyTheme, d as noColorRequested, f as theme, g as themeVersion, h as themeModeFromColorFgBg, i as MARK_CELLS, l as findTheme, m as themeMode, n as buildCrashReport, p as themeForMode, r as writeCrashReport, s as DEFAULT_THEME_ID, t as installCrashHandler, u as monoTheme, v as themesForMode } from "./install-mpXV2NVA.mjs";
2
+ import { C as setActiveWorkspace, S as listWorkspaces, a as WORDMARK, b as getActiveWorkspaceId, c as applyTheme, d as noColorRequested, f as theme, g as themeVersion, h as themeModeFromColorFgBg, i as MARK_CELLS, l as findTheme, m as themeMode, n as buildCrashReport, p as themeForMode, r as writeCrashReport, s as DEFAULT_THEME_ID, t as installCrashHandler, u as monoTheme, v as themesForMode } from "./install-L5hAfRk-.mjs";
3
3
  import { B as saveTheme, D as getSavedTheme, E as getReviewStateDir, L as resolveWebUrl, S as getConfigPath, c as cardActionErrorMessage, d as reconcileMaskedInput, f as resolveConnectUrl, i as resolveAgent, l as parseExternalOauthConnectParams, m as specKeyFor, p as parseConnectCard, s as MASK_CHAR, u as parseOauthConnectParams, v as DEFAULT_API_URL, y as DEFAULT_APP_URL } from "./print-X2N5wJ5l.mjs";
4
4
  import { a as errorMessage, i as sendErrorMessage, n as createRestClient, o as isRecord, r as errorDetail, t as HttpError } from "./rest-imDZZGQA.mjs";
5
5
  import "./billing-blocked-CwfG1BTR.mjs";
@@ -8,7 +8,7 @@ import fs from "node:fs";
8
8
 
9
9
  //#region package.json
10
10
  var name = "skydive-cli";
11
- var version$1 = "0.3.0-beta.853";
11
+ var version$1 = "0.3.0-beta.869";
12
12
 
13
13
  //#endregion
14
14
  //#region src/auth/organization.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skydive-cli",
3
- "version": "0.3.0-beta.853",
3
+ "version": "0.3.0-beta.869",
4
4
  "description": "Skydive CLI — cloud agents from the command line",
5
5
  "homepage": "https://skydive.com",
6
6
  "license": "MIT",