@curviate/cli 0.32.0 → 0.33.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +215 -1
  2. package/README.md +2 -0
  3. package/dist/{account-JDSZC633.js → account-IPAW6YRD.js} +89 -46
  4. package/dist/{chunk-V3PB4HSF.js → chunk-27E2M2PS.js} +9 -6
  5. package/dist/chunk-4EH6EWFW.js +327 -0
  6. package/dist/{chunk-SKJNLN37.js → chunk-4GXO42ZH.js} +85 -1
  7. package/dist/{chunk-KQXYEQAD.js → chunk-4IPHFPLO.js} +172 -8
  8. package/dist/{chunk-5EJDQ47B.js → chunk-5SHLELR7.js} +16 -16
  9. package/dist/{chunk-JRKM4OV2.js → chunk-REO2BCEX.js} +1 -1
  10. package/dist/{chunk-6P52Q2GK.js → chunk-REVD4GXL.js} +5 -4
  11. package/dist/chunk-TCUYH5GO.js +34 -0
  12. package/dist/{chunk-EIEF2KFH.js → chunk-YCLU5VSN.js} +4 -2
  13. package/dist/cli.js +104 -37
  14. package/dist/{comment-YOFNFQUE.js → comment-F2O4UOSD.js} +32 -26
  15. package/dist/{company-6PKHDK6L.js → company-ANZGO2HT.js} +52 -34
  16. package/dist/{config-FUHT23SX.js → config-ZD3Y5MWP.js} +74 -29
  17. package/dist/{connect-DG2AVGVL.js → connect-HYJCGYFO.js} +34 -31
  18. package/dist/{doctor-FK7B6754.js → doctor-VPGGB5CW.js} +22 -16
  19. package/dist/{exit-codes-AAFTOAXF.js → exit-codes-ZFWQJYOY.js} +1 -1
  20. package/dist/{feed-HXBKXKAQ.js → feed-IZZYSYYI.js} +18 -17
  21. package/dist/{group-UYX3KTX3.js → group-ETDDF2PJ.js} +21 -18
  22. package/dist/{inbox-EVE2ZTHC.js → inbox-XQQ4YRRO.js} +27 -22
  23. package/dist/{inboxes-JBB34WMQ.js → inboxes-6KHXXEBC.js} +18 -17
  24. package/dist/{job-GXUZANYN.js → job-PBTJ5DWL.js} +43 -29
  25. package/dist/{login-3OAUY7TG.js → login-HP5URYD6.js} +15 -3
  26. package/dist/{message-34AGROW2.js → message-DQQPMRFU.js} +7 -9
  27. package/dist/{notification-SKKZS2C5.js → notification-CXIRJB57.js} +20 -19
  28. package/dist/{post-FIW522Q6.js → post-2S7FYMZO.js} +33 -25
  29. package/dist/{profile-SX6JOYMD.js → profile-UCERD6RR.js} +61 -43
  30. package/dist/{recruiter-H7ROBEVC.js → recruiter-PJFUM2ZZ.js} +41 -28
  31. package/dist/{sales-nav-7KCK562X.js → sales-nav-7XNJGVIX.js} +43 -29
  32. package/dist/{search-PASMDQEH.js → search-DYGIIODT.js} +57 -43
  33. package/dist/{setup-YV5PVIU5.js → setup-BRULZH53.js} +12 -8
  34. package/dist/{webhook-GPLFPC6N.js → webhook-2TKWOXYK.js} +25 -22
  35. package/package.json +2 -2
  36. package/dist/chunk-LKF5MZIP.js +0 -90
  37. package/dist/chunk-PKSKQ3LN.js +0 -68
  38. package/dist/chunk-R3VLWLVV.js +0 -23
  39. package/dist/chunk-TD2ZIXFR.js +0 -67
  40. package/dist/chunk-TQJ77SL4.js +0 -147
package/CHANGELOG.md CHANGED
@@ -4,7 +4,221 @@ All notable changes to `@curviate/cli` are documented here.
4
4
 
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
  Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
7
- a new command or flag is a minor; a breaking command/flag/exit-code change is a major; a fix is a patch.
7
+ a new command or flag is a minor; a breaking command/flag/exit-code change is a major (before 1.0.0, a minor); a fix is a patch.
8
+
9
+ ## [0.33.0] - 2026-09-14
10
+
11
+ One addition, one change and twelve fixes. Several refuse input that used to
12
+ be accepted or change an exit code, so it ships as a minor.
13
+
14
+ **Behavior changes a script may notice:**
15
+
16
+ - Passing an inert flag to a local command (`curviate login --cursor abc`
17
+ and the like) now exits `2` instead of being silently accepted. None of
18
+ those flags did anything.
19
+ - Repeating a non-repeatable flag, such as `--keywords x --keywords y`, used
20
+ to send an array (or crash, or for a boolean silently read as unset) and
21
+ now exits `2`.
22
+ - `---<flag>`, and `--no-<flag>` for a flag that is not a boolean, used to
23
+ be ignored and now exit `2`.
24
+ - A malformed base URL (including one carrying `user:pass@`) or an invalid
25
+ `--timeout` now exits `2` (was `1`, or `7` for a non-http scheme or
26
+ credentials in the URL).
27
+ - A request that gets no response, or a response that is not an API answer,
28
+ now exits `7` (was `1`, or `0` printing `{}` for a `200` whose body is not
29
+ JSON).
30
+ Download commands are the exception: they save any `2xx` body as the file.
31
+ - A malformed config file (a field of the wrong JSON type, a `null` top
32
+ level, a non-string `active`, a non-object `profiles`) now exits `2` when
33
+ the command takes a value from it (was `1`, or sent as-is), and so does a
34
+ file that is not valid JSON. `config list --json` shows a broken field as
35
+ `"<invalid>"` and drops unknown fields. `config set-account` and
36
+ `config set-base-url` replace a profile that is not an object.
37
+ - A list answer that is not a page now exits `7` on every path that reads
38
+ one, `setup`'s verifying call included (it reported success on most such
39
+ answers).
40
+ - `--all`, `--max-pages` and `--page-delay` on a command that does not
41
+ stream pages now exit `2` (they were accepted and ignored on some).
42
+ - Usage errors name a stray argument by its position
43
+ (`unexpected argument 2 after \`curviate login\``) instead of echoing it.
44
+
45
+ ### Added
46
+
47
+ - **`curviate account seats`.** Lists the workspace's live seats and whether
48
+ each is free or bound to an account (`seat_id`, `occupied`, `account_id`).
49
+ A free seat (`occupied:false`) is one `account link --seat-id` accepts
50
+ right now; an empty result can mean the workspace has no seats, or that
51
+ billing needs attention. Not paginated, `--all` is refused. Requires
52
+ `@curviate/sdk@0.32.0` (`accounts.listSeats()`), bumped below.
53
+
54
+ ### Changed
55
+
56
+ - **Local commands accept only the flags they act on.** These commands make
57
+ no API request, yet listed and accepted the full global set. The flags
58
+ below are now refused as unknown flags (exit `2`):
59
+ - `login`: `--limit`, `--cursor`, `--all`, `--max-pages`, `--page-delay`,
60
+ `--fields`, `--preview`, `--verbose`, `--timeout`.
61
+ - `config list`: the same nine, plus `--api-key`, `--base-url`,
62
+ `--profile` and `--account`.
63
+ - `config set-account`: the same nine, plus `--api-key` and `--base-url`.
64
+ - `config set-base-url` and `config reset`: the same nine, plus
65
+ `--api-key`, `--base-url` and `--account`.
66
+ - `webhook verify`: the same nine, plus `--api-key`, `--base-url`,
67
+ `--account` and `--profile`.
68
+
69
+ `--json` stays accepted on all of them. `--beta` is still tolerated
70
+ everywhere, because it is consumed before flags are checked; it persists
71
+ nothing and has no effect on these commands. `setup` and `doctor` already
72
+ declared only their own flags and are unchanged.
73
+
74
+ ### Fixed
75
+
76
+ - **`safety_warning` reaches the caller on every command.** A success body on
77
+ the warn posture carries `safety_warning` (the action went through, the
78
+ account is past a safety ceiling). Commands with a slim default, and
79
+ `--fields` on a single object, discarded it. It is now carried across both
80
+ projections like `notices`, and shown above list results in human mode.
81
+ Under `--all`, a page's `safety_warning` is written to stderr as one
82
+ `safety_warning: {...}` line per page, beside that page's notices.
83
+ - **`account link` without `--seat-id` says where a seat id comes from.** A
84
+ missing required flag now prints the first complete sentence of its help
85
+ description as a `hint:` line, and the `--seat-id` description names
86
+ `curviate account seats`, the new command below that lists seat ids. Exit
87
+ stays `2`. The help's exit-`12` note is now scoped to a call that already
88
+ has `--seat-id` and `--auth-method`.
89
+ - **An unknown flag's inline value is no longer echoed.** `--api-key=<key>`
90
+ on a command that does not declare `--api-key` printed the key in the
91
+ error line. The error now names the flag only.
92
+ - **The publish leak gate scans `.yml` and `.yaml` files**, including CI
93
+ workflow files, which it previously never opened.
94
+ - **A malformed base URL exits `2`.** `--base-url 'not a url'` (or
95
+ `http://`, `localhost:9`, `ftp://x`, the same value from
96
+ `CURVIATE_BASE_URL` or the profile) exited `1` with `Invalid URL`, or `7`
97
+ for a non-http scheme. Nothing was sent, so it is now a usage error on every
98
+ command, `doctor` included, whose report still prints. `login --base-url`
99
+ and `config set-base-url` refuse it before saving. A base URL carrying a
100
+ user name or password (`http://user:pass@host`) is refused the same way,
101
+ exit `2` with nothing sent (it exited `7`), and `doctor` and `config list`
102
+ never display the credentials.
103
+ - **A response that is not an API answer exits `7`.** A 5xx whose body is not
104
+ an error envelope (a gateway's HTML page, an empty body) decoded as
105
+ `INTERNAL`, exit `1`. A `2xx` whose non-empty body is not JSON exited `1`
106
+ when it claimed JSON (`doctor`: `3`), and otherwise (`text/html`,
107
+ `text/plain`, `application/octet-stream`, no content type) exited `0`
108
+ printing `{}`. All now surface as `PLATFORM_ERROR`, exit `7`. A 5xx that
109
+ carries an error envelope keeps its declared code. A `204` or any other
110
+ empty-bodied success still exits `0`, and an empty `200` labelled JSON,
111
+ which exited `7`, now does too. A list answer that is not a page (an object
112
+ with an `items` array, or `data` on the Recruiter lists), such as `null`,
113
+ `{}`, a non-array `items`, an array, a scalar or an empty body, exits `7`
114
+ wherever one is read: every `--all` stream, `job list`, the `--account`
115
+ name lookup, and the credential checks in `doctor` and `setup` (`setup`
116
+ reported success and `doctor` reported the credential valid). Depending on the path
117
+ it used to crash with exit `1`, or print an empty result or a usage error.
118
+ A company or member slug lookup whose answer carries no id exits `7` too,
119
+ instead of sending `undefined` in the next request's path (`company posts
120
+ acme` against `[]`). The download commands (`message
121
+ attachment`, `job applicant resume`, `recruiter applicant resume`) are
122
+ exempt: they save any `2xx` body byte-for-byte whatever its content type,
123
+ since the server passes the file's own type through. That includes a
124
+ JSON-labelled file, which used to be saved empty.
125
+ - **A plain (non-`--all`) list read now applies the same not-a-page guard the
126
+ `--all` streams already had.** `company posts <id>` (and every other list
127
+ read named on the streaming surface above) exited `0` on a `null` or
128
+ otherwise not-a-page body when read without `--all`; it now exits `7`,
129
+ matching the `--all` behavior exactly.
130
+ - **`--max-pages`/`--page-delay` without `--all`, on a command that does
131
+ stream, now exit `2` with nothing sent.** Both flags only mean anything as
132
+ part of an `--all` page walk; without it they were accepted and silently
133
+ did nothing, which an agent has no way to detect. This is distinct from
134
+ the `--all`-declared-nowhere case above (unknown flag, exit `2`): here the
135
+ command genuinely streams, `--all` is just missing. `job list --state ALL`
136
+ keeps its own inter-state `--page-delay` pacing without `--all`, since it
137
+ is not part of an `--all` walk either way; only `--max-pages` is refused
138
+ there without `--all`.
139
+ - **A request that gets no response exits `7` on every command.** A refused
140
+ connection, a DNS failure or a timeout arrived as `INTERNAL` and exited
141
+ `1`, while `doctor` already reported it as `7`. It is a transient platform
142
+ fault worth a retry, so every command now exits `7`. The `--json` envelope
143
+ is unchanged, and an `INTERNAL` the server sends still exits `1`.
144
+ - **`--fields` narrows each item of an `--all` stream.** `account list --all
145
+ --fields account_id` streamed full items. Every NDJSON line now carries only
146
+ the requested keys, plus `notices`, `safety_warning` and the provenance
147
+ keys when the item has them. Without `--fields` the stream is unchanged.
148
+ - **A repeated flag exits `2`.** `--account a --account b` crashed with
149
+ `account.trim is not a function`, and `--json --json` silently turned JSON
150
+ output off. Any flag given more than once, by name, alias (`-o x
151
+ --output y`) or negation (`--json --no-json`), and `--beta` given twice,
152
+ now exit `2` with `--<flag> was given more than once`. A flag still
153
+ accumulates where the command's help calls it repeatable: `--attach` on
154
+ `message`, `post create`, `company reply`, `sales-nav message new` and
155
+ `recruiter message new`, and `--invitee` on `company follow-invite`.
156
+ `comment add` and `comment reply` take at most one `--attach`, and used to
157
+ send every repeat.
158
+ - **Credential flags are handled strictly and never echoed.**
159
+ - A usage error never echoes a user-supplied token. A value after
160
+ `--api-key=` with a stray space, or after `--`, was printed as an
161
+ unexpected argument; it is now named by position. A flag written without
162
+ its `=` (`--api-key-<key>`) is named by position too, and an unknown flag
163
+ by its exact name without any value. `--beta=<value>` no longer echoes the
164
+ rejected value.
165
+ - `--preview` masks every secret flag's value as `••••`. `account
166
+ checkpoint solve --code <otp> --preview` printed the code. The mask
167
+ covers `--code`, `--password`, `--li-at`, `--li-a` and `--proxy-password`
168
+ wherever the value sits in the rendered request. `recruiter message new
169
+ --signature` is the message's sign-off line, not a credential, so its
170
+ preview shows it.
171
+ - `---api-key=X` and `--no-api-key=X` are unknown flags (exit `2`). They
172
+ were ignored. `--no-<flag>` stays valid for boolean flags.
173
+ - `config list` shows only the last 4 characters of a key (`••••1234`),
174
+ and none of a key shorter than 16 characters. It showed the first 8 and
175
+ last 4, most of a short key.
176
+ - `--timeout` must be a whole number of milliseconds from `1` to
177
+ `2147483647`, digits only. `abc`, `10abc`, `0`, `1.5`, `0x10`, `1e3`,
178
+ ` 5` or `2147483648` now exit `2`; they surfaced as an immediate timeout,
179
+ a silently truncated value, or an out-of-range timer.
180
+ - **A malformed config file exits `2`.** A hand-edited config whose profile
181
+ `apiKey` was an array, object or number crashed every command and
182
+ `config list` with exit `1`; a non-string `account` or `baseUrl` was sent
183
+ as-is; a `null` top level, a non-string `active` or a non-object `profiles`
184
+ crashed or was echoed back. Each is now a usage error, exit `2`, naming the
185
+ file, the profile and the field with the repair (`curviate config reset
186
+ --profile <name>`, or edit the file), never the value. A value is checked
187
+ only when the command actually takes it from the profile, so `--api-key`,
188
+ `--base-url`, `--timeout`, `--account` or the matching environment variable
189
+ still works around a broken field, and a root-scoped command such as
190
+ `account list` ignores a broken `account`. `null` on a field means unset.
191
+ `config list` never refuses: it lists every profile, shows a broken field
192
+ (or a broken `active`, `profiles` or profile) as `<invalid>`, and emits only
193
+ the known fields, where `--json` used to copy any stored field through.
194
+ A config file that is not valid JSON (empty, truncated, hand-mangled) exited
195
+ `1` printing the parser's error; every command now exits `2` with the
196
+ `curviate config reset` repair and no parser text, unless every value it
197
+ needs comes from flags or the environment; `config list` always exits `2`
198
+ on it. Config writers
199
+ (`login`, `config set-*`) refuse a broken top level, `active` or `profiles`
200
+ with exit `2`, and repair a profile that is not an object by replacing it
201
+ with a fresh one holding the written value: `config set-account` and
202
+ `config set-base-url` used to report success without writing (an array
203
+ profile) or crash printing the stored value (a string profile).
204
+ An `active` that is `null` or absent means `default` for writers as well
205
+ as readers; `config set-account` and `config set-base-url` reported
206
+ `Profile "null" not found`. When the API key and base URL both come from
207
+ flags or the environment, an unreadable config never blocks a command:
208
+ `timeout` falls back to its default, so env-only CI runs. A leading UTF-8
209
+ byte order mark is ignored.
210
+ - **`--all` is refused where nothing streams.** `--all`, `--max-pages` and
211
+ `--page-delay` are no longer declared on the commands listed below, which
212
+ never stream pages; there they are unknown flags, exit `2`, nothing sent.
213
+ `profile me` keeps the flags and refuses `--all` at run time (exit `2`). `webhook delete
214
+ <id> --all` sent the DELETE, and `recruiter applicants`, `recruiter search
215
+ parameters`, `sales-nav search parameters`, `webhook create`, `get`,
216
+ `update` and `profile endorse` accepted and ignored it. `company <id>`,
217
+ `company chat`, `company message`, `post get`, `search parameters`,
218
+ `search service-parameters` and `webhook events` already refused it and
219
+ no longer list the three flags in `--help`.
220
+ - **`@curviate/sdk` bumped to `0.32.0`**, for `accounts.listSeats()` behind
221
+ the new `account seats` command above.
8
222
 
9
223
  ## [0.32.0] - 2026-09-11
10
224
 
package/README.md CHANGED
@@ -5,6 +5,8 @@ Official command-line interface for the [Curviate API](https://docs.curviate.com
5
5
  Built for coding agents and power users: JSON output on pipes, structured exit codes,
6
6
  and shell-native composition with `jq`, `xargs`, and `curl`.
7
7
 
8
+ ![An agent using the Curviate CLI to triage a LinkedIn inbox: 18 threads unread, 7 profiles analyzed, 3 companies researched, 6 warm intros, 5 no action needed, 6 drafts waiting for approval](./assets/curviate-cli-hero.png)
9
+
8
10
  ## Install
9
11
 
10
12
  **Global install** (recommended for interactive use):
@@ -7,33 +7,34 @@ import {
7
7
  slimAccountList,
8
8
  slimAccountListItem
9
9
  } from "./chunk-LJR4LJG6.js";
10
- import {
11
- pageDelayFromFlags,
12
- streamAll
13
- } from "./chunk-LKF5MZIP.js";
14
10
  import {
15
11
  buildPreviewOutput
16
- } from "./chunk-R3VLWLVV.js";
12
+ } from "./chunk-TCUYH5GO.js";
17
13
  import {
14
+ isJsonMode,
15
+ pageDelayFromFlags,
16
+ readablePage,
17
+ rejectPaginationModifiersWithoutAll,
18
18
  renderError,
19
+ renderNotices,
19
20
  renderSuccess,
20
- renderUnexpectedError
21
- } from "./chunk-KQXYEQAD.js";
22
- import {
23
- createClient,
24
- resolveEffectiveConfig
25
- } from "./chunk-TD2ZIXFR.js";
26
- import "./chunk-PKSKQ3LN.js";
21
+ renderUnexpectedError,
22
+ resolveEffectiveConfig,
23
+ streamAll,
24
+ writeNdjsonItem
25
+ } from "./chunk-4IPHFPLO.js";
27
26
  import {
28
27
  AUTH_NEEDED
29
- } from "./chunk-EIEF2KFH.js";
30
- import "./chunk-TQJ77SL4.js";
28
+ } from "./chunk-YCLU5VSN.js";
29
+ import {
30
+ createClient
31
+ } from "./chunk-4EH6EWFW.js";
31
32
  import {
32
33
  GLOBAL_FLAGS,
33
34
  READ_SINGLE_FLAGS,
34
35
  WRITE_SINGLE_FLAGS,
35
36
  defaultReadStdin
36
- } from "./chunk-SKJNLN37.js";
37
+ } from "./chunk-4GXO42ZH.js";
37
38
 
38
39
  // src/commands/account.ts
39
40
  import { defineCommand } from "citty";
@@ -115,29 +116,6 @@ function failConflict(out, message) {
115
116
  `);
116
117
  process.exit(2);
117
118
  }
118
- var SECRET_MASK = "\u2022\u2022\u2022\u2022";
119
- function isRecord(value) {
120
- return typeof value === "object" && value !== null && !Array.isArray(value);
121
- }
122
- function maskCredentialSecretsForPreview(body) {
123
- const masked = { ...body };
124
- const credentials = masked["credentials"];
125
- if (isRecord(credentials) && "password" in credentials) {
126
- masked["credentials"] = { ...credentials, password: SECRET_MASK };
127
- }
128
- const cookie = masked["cookie"];
129
- if (isRecord(cookie)) {
130
- const maskedCookie = { ...cookie };
131
- if ("li_at" in maskedCookie) maskedCookie["li_at"] = SECRET_MASK;
132
- if ("li_a" in maskedCookie) maskedCookie["li_a"] = SECRET_MASK;
133
- masked["cookie"] = maskedCookie;
134
- }
135
- const proxy = masked["proxy"];
136
- if (isRecord(proxy) && "password" in proxy) {
137
- masked["proxy"] = { ...proxy, password: SECRET_MASK };
138
- }
139
- return masked;
140
- }
141
119
 
142
120
  // src/lib/checkpoint-copy.ts
143
121
  var RESENDABLE_CHALLENGE_TYPES = /* @__PURE__ */ new Set([
@@ -223,15 +201,16 @@ function resolveOutputOpts(flags) {
223
201
  async function handleError(err, outOpts, out) {
224
202
  const { CurviateError } = await import("@curviate/sdk");
225
203
  if (err instanceof CurviateError) {
226
- const { getExitCode } = await import("./exit-codes-AAFTOAXF.js");
204
+ const { getExitCode } = await import("./exit-codes-ZFWQJYOY.js");
227
205
  renderError(err, outOpts, out);
228
- process.exit(getExitCode(err.code));
206
+ process.exit(getExitCode(err));
229
207
  }
230
208
  renderUnexpectedError(err, out);
231
209
  process.exit(1);
232
210
  }
233
211
  async function runAccountList(client, flags, out) {
234
212
  rejectPreviewOnRead(flags.preview, out);
213
+ rejectPaginationModifiersWithoutAll(flags, out);
235
214
  const outOpts = resolveOutputOpts(flags);
236
215
  const all = flags.all ?? false;
237
216
  const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
@@ -249,10 +228,11 @@ async function runAccountList(client, flags, out) {
249
228
  pageDelayMs: pageDelayFromFlags(flags)
250
229
  })) {
251
230
  const projected = outOpts.verbose ? item : slimAccountListItem(item);
252
- out.stdout.write(JSON.stringify(projected) + "\n");
231
+ writeNdjsonItem(out, projected, outOpts.fields, item);
253
232
  }
254
233
  } else {
255
234
  const result = await client.accounts.list(params);
235
+ readablePage(result);
256
236
  renderSuccess(result, { ...outOpts, slim: slimAccountList }, out);
257
237
  }
258
238
  } catch (err) {
@@ -271,6 +251,44 @@ async function runAccountGet(client, flags, out) {
271
251
  await handleError(err, outOpts, out);
272
252
  }
273
253
  }
254
+ function renderSeatLineHuman(item) {
255
+ const seat = item;
256
+ const seatId = typeof seat.seat_id === "string" ? seat.seat_id : String(seat.seat_id ?? "");
257
+ if (seat.occupied === true) {
258
+ const accountId = typeof seat.account_id === "string" ? seat.account_id : "";
259
+ return `${seatId}: bound (${accountId})`;
260
+ }
261
+ return `${seatId}: free`;
262
+ }
263
+ async function runAccountSeats(client, flags, out) {
264
+ rejectPreviewOnRead(flags.preview, out);
265
+ const outOpts = resolveOutputOpts(flags);
266
+ let result;
267
+ try {
268
+ result = readablePage(await client.accounts.listSeats());
269
+ } catch (err) {
270
+ await handleError(err, outOpts, out);
271
+ return;
272
+ }
273
+ if (result.items.length === 0) {
274
+ out.stderr.write(
275
+ "note: no seats listed. This can mean the workspace has no seats, or that billing needs attention (an empty seat is listed here only while connecting to it would be accepted right now).\n"
276
+ );
277
+ }
278
+ if (isJsonMode(outOpts) || flags.fields) {
279
+ renderSuccess(result, outOpts, out);
280
+ return;
281
+ }
282
+ const notices = renderNotices(result.notices);
283
+ if (notices) out.stdout.write(notices + "\n");
284
+ let body = result.items.length === 0 ? "(no seats)" : result.items.map(renderSeatLineHuman).join("\n");
285
+ const safetyWarning = result.safety_warning;
286
+ if (typeof safetyWarning === "object" && safetyWarning !== null) {
287
+ body = `safety_warning: ${JSON.stringify(safetyWarning)}
288
+ ${body}`;
289
+ }
290
+ out.stdout.write(body + "\n");
291
+ }
274
292
  async function buildAuthBody(flags, ctx) {
275
293
  const body = {};
276
294
  if (flags["auth-method"]) body["auth_method"] = flags["auth-method"];
@@ -525,7 +543,7 @@ async function runAccountLink(client, flags, out, io = {}) {
525
543
  };
526
544
  const outOpts = resolveOutputOpts(flags);
527
545
  if (flags.preview) {
528
- const preview = buildPreviewOutput({ method: "auth.intent", args: {}, body: maskCredentialSecretsForPreview(body) });
546
+ const preview = buildPreviewOutput({ method: "auth.intent", args: {}, body });
529
547
  out.stdout.write(JSON.stringify(preview) + "\n");
530
548
  return;
531
549
  }
@@ -684,7 +702,7 @@ async function runAccountUpdate(client, flags, out) {
684
702
  const preview = buildPreviewOutput({
685
703
  method: "accounts.update",
686
704
  args: { accountId },
687
- body: maskCredentialSecretsForPreview(body)
705
+ body
688
706
  });
689
707
  out.stdout.write(JSON.stringify(preview) + "\n");
690
708
  return;
@@ -914,14 +932,37 @@ var accountGetCommand = defineCommand({
914
932
  await runAccountGet(client, flags, out);
915
933
  }
916
934
  });
935
+ var accountSeatsCommand = defineCommand({
936
+ meta: {
937
+ name: "seats",
938
+ description: "List the workspace's live seats and whether each is free or bound to an account. A seat with occupied:false (free) is a seat_id `curviate account link --seat-id` accepts right now. Not paginated (bounded by purchased seats), --all is not supported. An empty result can mean the workspace has no seats, or that billing needs attention."
939
+ },
940
+ args: { ...READ_SINGLE_FLAGS },
941
+ async run({ args }) {
942
+ const flags = args;
943
+ const cfg = await resolveEffectiveConfig({
944
+ apiKey: flags["api-key"],
945
+ baseUrl: flags["base-url"],
946
+ timeout: flags.timeout,
947
+ profile: flags.profile
948
+ });
949
+ if (!cfg.apiKey) {
950
+ process.stderr.write("error: no API key, run `curviate login` or pass --api-key.\n");
951
+ process.exit(3);
952
+ }
953
+ const client = createClient({ apiKey: cfg.apiKey, baseUrl: cfg.baseUrl, timeout: cfg.timeout });
954
+ const out = buildOutputStreams();
955
+ await runAccountSeats(client, flags, out);
956
+ }
957
+ });
917
958
  var accountLinkCommand = defineCommand({
918
959
  meta: {
919
960
  name: "link",
920
- description: "Connect a LinkedIn account to an empty seat. If LinkedIn requires verification you'll be prompted for the code interactively; in a non-interactive shell the command exits 12 and you finish with `curviate account checkpoint solve <account_id> --code`."
961
+ description: "Connect a LinkedIn account to an empty seat. If LinkedIn requires verification you'll be prompted for the code interactively. Given --seat-id and --auth-method, a non-interactive shell exits 12 at that step and you finish with `curviate account checkpoint solve <account_id> --code`."
921
962
  },
922
963
  args: {
923
964
  ...WRITE_SINGLE_FLAGS,
924
- "seat-id": { type: "string", description: "Empty seat to bind the account to.", required: true },
965
+ "seat-id": { type: "string", description: "Empty seat to bind the account to, listed by `curviate account seats` (a free seat there is one this call accepts right now).", required: true },
925
966
  "auth-method": { type: "string", description: "Authentication method: credentials | cookie.", required: true },
926
967
  email: { type: "string", description: "LinkedIn email (credentials method)." },
927
968
  password: { type: "string", description: `LinkedIn password (credentials method). ${PW_WARNING("--password-stdin", "CURVIATE_LINKEDIN_PASSWORD")}` },
@@ -1187,6 +1228,7 @@ var accountCommand = defineCommand({
1187
1228
  subCommands: {
1188
1229
  list: accountListCommand,
1189
1230
  get: accountGetCommand,
1231
+ seats: accountSeatsCommand,
1190
1232
  link: accountLinkCommand,
1191
1233
  "connect-session": accountConnectSessionCommand,
1192
1234
  update: accountUpdateCommand,
@@ -1195,7 +1237,7 @@ var accountCommand = defineCommand({
1195
1237
  },
1196
1238
  async run() {
1197
1239
  process.stderr.write(
1198
- "Usage: curviate account <subcommand>\n list | get | link | connect-session poll | update | disconnect | checkpoint\n"
1240
+ "Usage: curviate account <subcommand>\n list | get | seats | link | connect-session poll | update | disconnect | checkpoint\n"
1199
1241
  );
1200
1242
  }
1201
1243
  });
@@ -1209,5 +1251,6 @@ export {
1209
1251
  runAccountGet,
1210
1252
  runAccountLink,
1211
1253
  runAccountList,
1254
+ runAccountSeats,
1212
1255
  runAccountUpdate
1213
1256
  };
@@ -1,10 +1,13 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ readablePage
4
+ } from "./chunk-4IPHFPLO.js";
2
5
  import {
3
6
  getExitCode
4
- } from "./chunk-EIEF2KFH.js";
7
+ } from "./chunk-YCLU5VSN.js";
5
8
  import {
6
9
  assertNoStdinPlaceholder
7
- } from "./chunk-SKJNLN37.js";
10
+ } from "./chunk-4GXO42ZH.js";
8
11
 
9
12
  // src/lib/path-safety.ts
10
13
  var UNSAFE_CHARS = /[\u0000-\u0020\u007F/\\?#%]/;
@@ -75,10 +78,10 @@ function listConnectedAccounts(client) {
75
78
  for (let page = 0; page < MAX_LOOKUP_PAGES; page++) {
76
79
  const params = { limit: 250 };
77
80
  if (cursor) params["cursor"] = cursor;
78
- const result = await client.accounts.list(
79
- params
81
+ const result = readablePage(
82
+ await client.accounts.list(params)
80
83
  );
81
- for (const item of result.items ?? []) {
84
+ for (const item of result.items) {
82
85
  const account = toConnectedAccount(item);
83
86
  if (account) accounts.push(account);
84
87
  }
@@ -138,7 +141,7 @@ async function requireAccount(client, flags, out) {
138
141
  `error: [${e.code}] could not look up connected accounts to resolve --account "${selector}": ${e.message}
139
142
  `
140
143
  );
141
- process.exit(getExitCode(e.code));
144
+ process.exit(getExitCode(e));
142
145
  }
143
146
  throw err;
144
147
  }