@curviate/cli 0.20.0 → 0.21.1

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 (30) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/{account-2SOSCEB6.js → account-OIV73PXX.js} +7 -7
  3. package/dist/{chunk-42VUUKQ3.js → chunk-56ORAZJO.js} +4 -1
  4. package/dist/{chunk-DW2HCRXJ.js → chunk-CUTMZWL6.js} +4 -0
  5. package/dist/{chunk-EEMJDJ4W.js → chunk-HZFK45IW.js} +7 -0
  6. package/dist/{chunk-IGCQNDIG.js → chunk-OE7OMTCM.js} +10 -10
  7. package/dist/{chunk-HDQUEFD2.js → chunk-VPKMJYIF.js} +49 -4
  8. package/dist/{chunk-ROULHEFW.js → chunk-WYRYCTUM.js} +2 -1
  9. package/dist/chunk-ZYURL5VK.js +83 -0
  10. package/dist/cli.js +37 -22
  11. package/dist/{comment-AXDINBPS.js → comment-W4XTOTHN.js} +9 -9
  12. package/dist/{company-BX4VDXZX.js → company-NT4VO6JV.js} +9 -9
  13. package/dist/{config-3O4N2XSH.js → config-FPWWYG7G.js} +2 -1
  14. package/dist/{connect-KWOJKCIB.js → connect-VXWRLGQZ.js} +5 -4
  15. package/dist/{feed-4ROKUBG5.js → feed-4Q3B56WI.js} +4 -3
  16. package/dist/{group-L7TQEEFN.js → group-43PHTFP7.js} +4 -3
  17. package/dist/{inbox-GMGZVDTQ.js → inbox-GZAOUWZP.js} +4 -3
  18. package/dist/{inboxes-YVYLSM5W.js → inboxes-6AZOB43U.js} +4 -3
  19. package/dist/{job-TYBA2DUQ.js → job-VOVQZGCK.js} +5 -4
  20. package/dist/{login-W7NCDZOQ.js → login-ZLDDIAFW.js} +13 -14
  21. package/dist/{message-C6FV6JH6.js → message-FIEWH2BU.js} +4 -4
  22. package/dist/{notification-45XFT3S4.js → notification-65V67NWK.js} +4 -3
  23. package/dist/{post-RETV3WUG.js → post-G4IMWUE2.js} +7 -7
  24. package/dist/{profile-A2TWF4HB.js → profile-GADE33FY.js} +5 -4
  25. package/dist/{recruiter-FQAKY6Z2.js → recruiter-LI2TMRHY.js} +12 -9
  26. package/dist/{sales-nav-SSJIZUNB.js → sales-nav-OXLRN6YK.js} +7 -6
  27. package/dist/{search-DH6BJFQC.js → search-V35MFTXL.js} +7 -5
  28. package/dist/{webhook-LED6AKF3.js → webhook-5HXMJQFO.js} +9 -8
  29. package/package.json +1 -1
  30. package/dist/chunk-U7Y4EXHT.js +0 -33
package/CHANGELOG.md CHANGED
@@ -8,6 +8,63 @@ a new command or flag is a minor; a breaking command/flag/exit-code change is a
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.21.1] - 2026-08-06
12
+
13
+ ### Fixed
14
+
15
+ - **A response's `notices[]` array is no longer silently dropped.** Both
16
+ render paths now surface it: JSON mode already passed it through, and human
17
+ mode now prints it above the results it qualifies, covering a filter value
18
+ that took the id fast path (field + value) and a page whose results are
19
+ anonymised upstream (no field/value). Previously a caller got an empty or
20
+ unexplained result set with nothing telling them why.
21
+ - **`--all` (NDJSON streaming) now surfaces per-page notices too.** stdout
22
+ stays pure one-object-per-line data; a page's notices are written to
23
+ stderr through the same renderer the human-mode path uses, so a long-running
24
+ `--all` consumer sees the same explanation a single-page call would.
25
+ - **`visibility` is back in the default (non-verbose) `search people` fields.**
26
+ It was missing from the default field allowlist even though the server
27
+ always sends it, so a row for a hidden or unresolved profile looked
28
+ identical to a normal one unless you passed `--verbose`.
29
+
30
+ ## [0.21.0] - 2026-08-04
31
+
32
+ A correctness release for every argument that reads from stdin. Upgrade
33
+ immediately if you are on 0.20.0: on that version the documented quick-start
34
+ login silently stored a placeholder instead of your API key, so the very first
35
+ command after it failed and blamed your key.
36
+
37
+ ### Fixed
38
+
39
+ - **`curviate login --api-key -` now stores the piped key.** It previously
40
+ reported success and exited 0 while writing the literal string
41
+ `__curviate_stdin__` into your config, so every later command answered 401 and
42
+ attributed the failure to your API key. That is the first command in the
43
+ quick-start, so a new install failed on first contact with a misleading cause.
44
+
45
+ - **Eleven further arguments documented as accepting `-` now read stdin.** Each
46
+ compared its raw value against `-`, but the dispatcher had already substituted
47
+ an internal placeholder by that point, so the branch was unreachable and the
48
+ placeholder was consumed as your data. Affected: `--filters` on the eight
49
+ search and list commands, and `--body` on the three recruiter and webhook
50
+ commands, which answered `--filters is not valid JSON` or
51
+ `--body only accepts '-'` to a caller who had passed exactly that.
52
+
53
+ ### Changed
54
+
55
+ - **A bare `-` is only special on an argument that declares a stdin contract.**
56
+ Every other argument now receives a literal `-`, restored between the parser
57
+ and the handler. Previously the substitution was indiscriminate, so a bare `-`
58
+ became the internal placeholder at any argument, including places where it
59
+ then travelled to the wire as a value. If you were relying on `-` being read
60
+ from stdin on an argument whose help text does not describe that behaviour, it
61
+ no longer is; the arguments that document the contract are unchanged.
62
+
63
+ - **The internal placeholder can no longer leave the process.** The request
64
+ transport and the config writer both refuse it as a defence in depth backstop,
65
+ and report what to do instead, so no future argument can leak it into a
66
+ request or a config file.
67
+
11
68
  ## [0.20.0] - 2026-08-03
12
69
 
13
70
  A safety and correctness release. Upgrade promptly: it closes a path by which a
@@ -5,18 +5,15 @@ import {
5
5
  import {
6
6
  AUTH_NEEDED
7
7
  } from "./chunk-M6UDWFHX.js";
8
- import {
9
- defaultReadStdin
10
- } from "./chunk-U7Y4EXHT.js";
11
8
  import {
12
9
  slimAccountGet,
13
10
  slimAccountList,
14
11
  slimAccountListItem
15
- } from "./chunk-ROULHEFW.js";
12
+ } from "./chunk-WYRYCTUM.js";
16
13
  import {
17
14
  pageDelayFromFlags,
18
15
  streamAll
19
- } from "./chunk-EEMJDJ4W.js";
16
+ } from "./chunk-HZFK45IW.js";
20
17
  import {
21
18
  buildPreviewOutput
22
19
  } from "./chunk-R3VLWLVV.js";
@@ -26,12 +23,15 @@ import {
26
23
  renderSuccess,
27
24
  renderUnexpectedError,
28
25
  resolveEffectiveConfig
29
- } from "./chunk-HDQUEFD2.js";
26
+ } from "./chunk-VPKMJYIF.js";
30
27
  import {
31
28
  GLOBAL_FLAGS,
32
29
  READ_SINGLE_FLAGS,
33
30
  WRITE_SINGLE_FLAGS
34
- } from "./chunk-DW2HCRXJ.js";
31
+ } from "./chunk-CUTMZWL6.js";
32
+ import {
33
+ defaultReadStdin
34
+ } from "./chunk-ZYURL5VK.js";
35
35
 
36
36
  // src/commands/account.ts
37
37
  import { defineCommand } from "citty";
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ isStdinToken
4
+ } from "./chunk-ZYURL5VK.js";
2
5
 
3
6
  // src/lib/search-filters.ts
4
7
  import { readFile } from "fs/promises";
@@ -23,7 +26,7 @@ async function assembleFilters(flags, readers = DEFAULT_FILTER_READERS) {
23
26
  } catch {
24
27
  return { error: `cannot read ${source}` };
25
28
  }
26
- } else if (flags.filters === "-") {
29
+ } else if (isStdinToken(flags.filters)) {
27
30
  source = "--filters - (stdin)";
28
31
  raw = await readers.readStdin();
29
32
  } else if (flags.filters !== void 0) {
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ assertNoStdinPlaceholder
4
+ } from "./chunk-ZYURL5VK.js";
2
5
 
3
6
  // src/lib/config.ts
4
7
  import {
@@ -37,6 +40,7 @@ async function writeConfig(cfg) {
37
40
  } catch {
38
41
  }
39
42
  const content = JSON.stringify(cfg, null, 2) + "\n";
43
+ assertNoStdinPlaceholder("the configuration about to be written", [content]);
40
44
  const tmpPath = join(
41
45
  tmpdir(),
42
46
  `curviate-cfg-${randomBytes(6).toString("hex")}.tmp`
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ renderNotices
4
+ } from "./chunk-VPKMJYIF.js";
2
5
 
3
6
  // src/lib/paginate.ts
4
7
  var PaginateError = class extends Error {
@@ -50,6 +53,10 @@ async function* streamAll(fn, params, opts = {}) {
50
53
  if (opts.out) opts.out.stderr.write(ndjsonModeNotice());
51
54
  firstPage = false;
52
55
  }
56
+ if (opts.out) {
57
+ const pageNotices = renderNotices(page.notices);
58
+ if (pageNotices) opts.out.stderr.write(pageNotices + "\n");
59
+ }
53
60
  if (Array.isArray(items)) {
54
61
  for (const item of items) {
55
62
  yield item;
@@ -3,9 +3,6 @@ import {
3
3
  looksLikeCommandWord,
4
4
  nearestSubcommand
5
5
  } from "./chunk-HOQ7EUHJ.js";
6
- import {
7
- resolveTextOrStdin
8
- } from "./chunk-U7Y4EXHT.js";
9
6
  import {
10
7
  AttachError,
11
8
  readAttachment,
@@ -28,11 +25,14 @@ import {
28
25
  renderSuccess,
29
26
  renderUnexpectedError,
30
27
  resolveEffectiveConfig
31
- } from "./chunk-HDQUEFD2.js";
28
+ } from "./chunk-VPKMJYIF.js";
32
29
  import {
33
30
  READ_SINGLE_FLAGS,
34
31
  WRITE_FLAGS
35
- } from "./chunk-DW2HCRXJ.js";
32
+ } from "./chunk-CUTMZWL6.js";
33
+ import {
34
+ resolveTextOrStdin
35
+ } from "./chunk-ZYURL5VK.js";
36
36
 
37
37
  // src/commands/message.ts
38
38
  import { defineCommand } from "citty";
@@ -393,7 +393,7 @@ var messageNewCommand = defineCommand({
393
393
  description: "Recipient: LinkedIn profile URL (e.g. https://www.linkedin.com/in/some-slug), bare slug (e.g. some-slug), or provider ID (e.g. ACoAAA\u2026). URL and slug inputs resolve the provider ID automatically.",
394
394
  required: true
395
395
  },
396
- text: { type: "positional", description: "Opening message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
396
+ text: { type: "positional", stdinArg: true, description: "Opening message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
397
397
  attach: { type: "string", description: "File to attach (repeatable)." }
398
398
  },
399
399
  async run({ args }) {
@@ -447,7 +447,7 @@ var messageEditCommand = defineCommand({
447
447
  ...WRITE_FLAGS,
448
448
  chatId: { type: "positional", description: "Chat ID or LinkedIn messaging thread URL." },
449
449
  messageId: { type: "positional", description: "Message ID." },
450
- text: { type: "positional", description: "Replacement text. Pass - to read from stdin." }
450
+ text: { type: "positional", stdinArg: true, description: "Replacement text. Pass - to read from stdin." }
451
451
  },
452
452
  async run({ args }) {
453
453
  const flags = args;
@@ -569,7 +569,7 @@ var messageInMailCommand = defineCommand({
569
569
  required: true
570
570
  },
571
571
  subject: { type: "string", description: "InMail subject line.", required: true },
572
- text: { type: "positional", description: "InMail body text. Pass - to read from stdin." }
572
+ text: { type: "positional", stdinArg: true, description: "InMail body text. Pass - to read from stdin." }
573
573
  },
574
574
  async run({ args }) {
575
575
  const flags = args;
@@ -601,7 +601,7 @@ var messageSendCommand = defineCommand({
601
601
  type: "positional",
602
602
  description: "Chat ID or LinkedIn messaging thread URL. A COMPANY_ chat id sends as the company page; any other chat id sends as the connected member."
603
603
  },
604
- text: { type: "positional", description: "Message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
604
+ text: { type: "positional", stdinArg: true, description: "Message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
605
605
  attach: { type: "string", description: "File to attach (repeatable)." }
606
606
  },
607
607
  async run({ args }) {
@@ -691,7 +691,7 @@ var messageCommand = defineCommand({
691
691
  description: "Chat ID to send a message to. A COMPANY_ chat id sends as the company page.",
692
692
  required: false
693
693
  },
694
- text: { type: "positional", description: "Message text. Pass - to read from stdin.", required: false },
694
+ text: { type: "positional", stdinArg: true, description: "Message text. Pass - to read from stdin.", required: false },
695
695
  attach: { type: "string", description: "File to attach (repeatable)." }
696
696
  },
697
697
  subCommands: {
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readConfig
4
- } from "./chunk-DW2HCRXJ.js";
4
+ } from "./chunk-CUTMZWL6.js";
5
+ import {
6
+ assertNoStdinPlaceholder
7
+ } from "./chunk-ZYURL5VK.js";
5
8
 
6
9
  // src/lib/resolve.ts
7
10
  var DEFAULT_BASE_URL = "https://api.curviate.com";
@@ -20,9 +23,28 @@ async function resolveEffectiveConfig(flags) {
20
23
 
21
24
  // src/lib/client.ts
22
25
  import { Curviate } from "@curviate/sdk";
26
+ function headerStrings(headers) {
27
+ if (!headers) return [];
28
+ if (headers instanceof Headers) {
29
+ const out = [];
30
+ headers.forEach((value, key) => out.push(key, value));
31
+ return out;
32
+ }
33
+ if (Array.isArray(headers)) return headers.flat().map(String);
34
+ return Object.entries(headers).flat().map(String);
35
+ }
36
+ var guardedFetch = (input, init) => {
37
+ assertNoStdinPlaceholder("the request about to be sent", [
38
+ String(input instanceof Request ? input.url : input),
39
+ ...headerStrings(init?.headers),
40
+ typeof init?.body === "string" ? init.body : void 0
41
+ ]);
42
+ return fetch(input, init);
43
+ };
23
44
  function createClient(config) {
24
45
  return new Curviate({
25
46
  apiKey: config.apiKey.trim(),
47
+ fetch: guardedFetch,
26
48
  ...config.baseUrl !== void 0 ? { baseUrl: config.baseUrl } : {},
27
49
  ...config.timeout !== void 0 ? { timeout: config.timeout } : {}
28
50
  });
@@ -116,16 +138,38 @@ function renderSuccess(data, opts, out) {
116
138
  out.stdout.write(renderHuman(projected) + "\n");
117
139
  }
118
140
  }
141
+ function formatNotice(notice) {
142
+ if (typeof notice !== "object" || notice === null) return null;
143
+ const n = notice;
144
+ const code = typeof n["code"] === "string" ? n["code"] : "NOTICE";
145
+ const message = typeof n["message"] === "string" ? n["message"] : "";
146
+ let line = `notice [${code}]${message ? ` ${message}` : ""}`;
147
+ const details = [];
148
+ if (typeof n["field"] === "string") details.push(`field: ${n["field"]}`);
149
+ if (typeof n["value"] === "string") details.push(`value: ${n["value"]}`);
150
+ if (details.length > 0) line += ` (${details.join(", ")})`;
151
+ return line;
152
+ }
153
+ function renderNotices(notices) {
154
+ if (!Array.isArray(notices) || notices.length === 0) return null;
155
+ const lines = notices.map(formatNotice).filter((line) => line !== null);
156
+ return lines.length > 0 ? lines.join("\n") : null;
157
+ }
119
158
  function renderHuman(data) {
120
159
  if (data === null || data === void 0) return "(empty)";
121
160
  if (typeof data === "object" && !Array.isArray(data)) {
122
161
  const obj = data;
162
+ const notices = renderNotices(obj["notices"]);
123
163
  if (Array.isArray(obj["items"])) {
124
164
  const items = obj["items"];
125
- if (items.length === 0) return "(no items)";
126
- return items.map(renderHuman).join("\n");
165
+ const body = items.length === 0 ? "(no items)" : items.map(renderHuman).join("\n");
166
+ return notices ? `${notices}
167
+ ${body}` : body;
127
168
  }
128
- return Object.entries(obj).map(([k, v]) => `${k}: ${typeof v === "object" ? JSON.stringify(v) : String(v)}`).join("\n");
169
+ const kv = Object.entries(obj).filter(([k]) => k !== "notices").map(([k, v]) => `${k}: ${typeof v === "object" ? JSON.stringify(v) : String(v)}`).join("\n");
170
+ if (!notices) return kv;
171
+ return kv ? `${notices}
172
+ ${kv}` : notices;
129
173
  }
130
174
  if (Array.isArray(data)) {
131
175
  return data.map(renderHuman).join("\n");
@@ -168,6 +212,7 @@ export {
168
212
  resolveEffectiveConfig,
169
213
  createClient,
170
214
  renderSuccess,
215
+ renderNotices,
171
216
  renderError,
172
217
  renderUnexpectedError
173
218
  };
@@ -122,7 +122,8 @@ function slimSearchPeopleItem(item) {
122
122
  full_name: item["full_name"] ?? null,
123
123
  headline: item["headline"] ?? null,
124
124
  location: item["location"] ?? null,
125
- network_distance: item["network_distance"] ?? null
125
+ network_distance: item["network_distance"] ?? null,
126
+ visibility: item["visibility"] ?? null
126
127
  };
127
128
  }
128
129
  function slimSearchPeople(data) {
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/lib/stdin.ts
4
+ var STDIN_SENTINEL = "__curviate_stdin__";
5
+ async function defaultReadStdin() {
6
+ return new Promise((resolve, reject) => {
7
+ const chunks = [];
8
+ process.stdin.on("data", (chunk) => {
9
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
10
+ });
11
+ process.stdin.on("end", () => {
12
+ const full = Buffer.concat(chunks).toString("utf8");
13
+ resolve(full.replace(/\n+$/, ""));
14
+ });
15
+ process.stdin.on("error", reject);
16
+ });
17
+ }
18
+ function isStdinToken(value) {
19
+ return value === "-" || value === STDIN_SENTINEL;
20
+ }
21
+ function declaresStdinArg(def) {
22
+ return def?.stdinArg === true;
23
+ }
24
+ function restoreLiteralDashes(args, argsDef) {
25
+ const declaring = /* @__PURE__ */ new Set();
26
+ const positionalNames = [];
27
+ for (const [name, def] of Object.entries(argsDef)) {
28
+ if (def?.type === "positional") positionalNames.push(name);
29
+ if (!declaresStdinArg(def)) continue;
30
+ declaring.add(name);
31
+ const alias = def.alias;
32
+ if (typeof alias === "string") declaring.add(alias);
33
+ else if (Array.isArray(alias)) for (const a of alias) declaring.add(a);
34
+ }
35
+ const put = (value) => {
36
+ if (value === STDIN_SENTINEL) return "-";
37
+ if (Array.isArray(value)) return value.map((e) => e === STDIN_SENTINEL ? "-" : e);
38
+ return value;
39
+ };
40
+ for (const key of Object.keys(args)) {
41
+ if (key === "_" || declaring.has(key)) continue;
42
+ args[key] = put(args[key]);
43
+ }
44
+ const rest = args["_"];
45
+ if (Array.isArray(rest)) {
46
+ for (let i = 0; i < rest.length; i++) {
47
+ const name = positionalNames[i];
48
+ if (name !== void 0 && declaring.has(name)) continue;
49
+ if (rest[i] === STDIN_SENTINEL) rest[i] = "-";
50
+ }
51
+ }
52
+ }
53
+ function assertNoStdinPlaceholder(where, values) {
54
+ if (!values.some((v) => typeof v === "string" && v.includes(STDIN_SENTINEL))) return;
55
+ process.stderr.write(
56
+ `error: refusing to continue. ${where} contains "${STDIN_SENTINEL}", the internal placeholder the CLI substitutes for a bare "-" while it parses arguments.
57
+ `
58
+ );
59
+ process.stderr.write(
60
+ `hint: that placeholder means "read this value from stdin" and must never leave the process. Check the value you supplied, including environment variables such as CURVIATE_ACCOUNT and CURVIATE_API_KEY. If you did not supply it yourself, this is a bug in the CLI. Nothing was sent or written.
61
+ `
62
+ );
63
+ process.exit(1);
64
+ }
65
+ async function resolveTextOrStdin(rawText, out, readStdin) {
66
+ if (!isStdinToken(rawText)) return rawText;
67
+ const reader = readStdin ?? defaultReadStdin;
68
+ const text = await reader();
69
+ if (!text) {
70
+ out.stderr.write("error: stdin: empty input\n");
71
+ process.exit(2);
72
+ }
73
+ return text;
74
+ }
75
+
76
+ export {
77
+ STDIN_SENTINEL,
78
+ defaultReadStdin,
79
+ isStdinToken,
80
+ restoreLiteralDashes,
81
+ assertNoStdinPlaceholder,
82
+ resolveTextOrStdin
83
+ };
package/dist/cli.js CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- STDIN_SENTINEL
4
- } from "./chunk-U7Y4EXHT.js";
3
+ STDIN_SENTINEL,
4
+ restoreLiteralDashes
5
+ } from "./chunk-ZYURL5VK.js";
5
6
 
6
7
  // src/cli.ts
7
8
  import { defineCommand } from "citty";
@@ -221,7 +222,21 @@ async function dispatch(root, rawArgs) {
221
222
  usageError(`unknown flag \`${unknown}\`.`);
222
223
  }
223
224
  const processedLeafArgs = leafArgs.map((a) => a === "-" ? STDIN_SENTINEL : a);
224
- const leafToRun = { ...leaf, subCommands: void 0 };
225
+ const leafArgsDef = await resolveValue(leaf.args ?? {});
226
+ const originalRun = leaf.run;
227
+ const leafToRun = {
228
+ ...leaf,
229
+ subCommands: void 0,
230
+ ...originalRun ? {
231
+ run: (ctx) => {
232
+ restoreLiteralDashes(
233
+ ctx.args,
234
+ leafArgsDef
235
+ );
236
+ return originalRun(ctx);
237
+ }
238
+ } : {}
239
+ };
225
240
  await runCommand(leafToRun, { rawArgs: processedLeafArgs });
226
241
  } catch (err) {
227
242
  const message = err instanceof Error ? err.message : String(err);
@@ -247,28 +262,28 @@ var main = defineCommand({
247
262
  // Subcommand registry — names and descriptions are static for help rendering;
248
263
  // the handler implementation is loaded lazily on first invocation.
249
264
  subCommands: {
250
- login: () => import("./login-W7NCDZOQ.js").then((m) => m.loginCommand),
251
- config: () => import("./config-3O4N2XSH.js").then((m) => m.configCommand),
265
+ login: () => import("./login-ZLDDIAFW.js").then((m) => m.loginCommand),
266
+ config: () => import("./config-FPWWYG7G.js").then((m) => m.configCommand),
252
267
  // ---------------------------------------------------------------------------
253
268
  // Noun groups — lazy-loaded on first invocation.
254
269
  // ---------------------------------------------------------------------------
255
- profile: () => import("./profile-A2TWF4HB.js").then((m) => m.profileCommand),
256
- company: () => import("./company-BX4VDXZX.js").then((m) => m.companyCommand),
257
- job: () => import("./job-TYBA2DUQ.js").then((m) => m.jobCommand),
258
- connect: () => import("./connect-KWOJKCIB.js").then((m) => m.connectCommand),
259
- search: () => import("./search-DH6BJFQC.js").then((m) => m.searchCommand),
260
- inbox: () => import("./inbox-GMGZVDTQ.js").then((m) => m.inboxCommand),
261
- inboxes: () => import("./inboxes-YVYLSM5W.js").then((m) => m.inboxesCommand),
262
- message: () => import("./message-C6FV6JH6.js").then((m) => m.messageCommand),
263
- post: () => import("./post-RETV3WUG.js").then((m) => m.postCommand),
264
- comment: () => import("./comment-AXDINBPS.js").then((m) => m.commentCommand),
265
- account: () => import("./account-2SOSCEB6.js").then((m) => m.accountCommand),
266
- webhook: () => import("./webhook-LED6AKF3.js").then((m) => m.webhookCommand),
267
- "sales-nav": () => import("./sales-nav-SSJIZUNB.js").then((m) => m.salesNavCommand),
268
- recruiter: () => import("./recruiter-FQAKY6Z2.js").then((m) => m.recruiterCommand),
269
- group: () => import("./group-L7TQEEFN.js").then((m) => m.groupCommand),
270
- feed: () => import("./feed-4ROKUBG5.js").then((m) => m.feedCommand),
271
- notification: () => import("./notification-45XFT3S4.js").then((m) => m.notificationCommand)
270
+ profile: () => import("./profile-GADE33FY.js").then((m) => m.profileCommand),
271
+ company: () => import("./company-NT4VO6JV.js").then((m) => m.companyCommand),
272
+ job: () => import("./job-VOVQZGCK.js").then((m) => m.jobCommand),
273
+ connect: () => import("./connect-VXWRLGQZ.js").then((m) => m.connectCommand),
274
+ search: () => import("./search-V35MFTXL.js").then((m) => m.searchCommand),
275
+ inbox: () => import("./inbox-GZAOUWZP.js").then((m) => m.inboxCommand),
276
+ inboxes: () => import("./inboxes-6AZOB43U.js").then((m) => m.inboxesCommand),
277
+ message: () => import("./message-FIEWH2BU.js").then((m) => m.messageCommand),
278
+ post: () => import("./post-G4IMWUE2.js").then((m) => m.postCommand),
279
+ comment: () => import("./comment-W4XTOTHN.js").then((m) => m.commentCommand),
280
+ account: () => import("./account-OIV73PXX.js").then((m) => m.accountCommand),
281
+ webhook: () => import("./webhook-5HXMJQFO.js").then((m) => m.webhookCommand),
282
+ "sales-nav": () => import("./sales-nav-OXLRN6YK.js").then((m) => m.salesNavCommand),
283
+ recruiter: () => import("./recruiter-LI2TMRHY.js").then((m) => m.recruiterCommand),
284
+ group: () => import("./group-43PHTFP7.js").then((m) => m.groupCommand),
285
+ feed: () => import("./feed-4Q3B56WI.js").then((m) => m.feedCommand),
286
+ notification: () => import("./notification-65V67NWK.js").then((m) => m.notificationCommand)
272
287
  },
273
288
  async run() {
274
289
  const { runMain } = await import("citty");
@@ -2,9 +2,6 @@
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
4
  } from "./chunk-QJZ3LWOX.js";
5
- import {
6
- resolveTextOrStdin
7
- } from "./chunk-U7Y4EXHT.js";
8
5
  import {
9
6
  AttachError,
10
7
  describeAttachment,
@@ -14,7 +11,7 @@ import {
14
11
  import {
15
12
  pageDelayFromFlags,
16
13
  streamAll
17
- } from "./chunk-EEMJDJ4W.js";
14
+ } from "./chunk-HZFK45IW.js";
18
15
  import "./chunk-DMQZEPQE.js";
19
16
  import {
20
17
  buildPreviewOutput
@@ -25,11 +22,14 @@ import {
25
22
  renderSuccess,
26
23
  renderUnexpectedError,
27
24
  resolveEffectiveConfig
28
- } from "./chunk-HDQUEFD2.js";
25
+ } from "./chunk-VPKMJYIF.js";
29
26
  import {
30
27
  GLOBAL_FLAGS,
31
28
  WRITE_SINGLE_FLAGS
32
- } from "./chunk-DW2HCRXJ.js";
29
+ } from "./chunk-CUTMZWL6.js";
30
+ import {
31
+ resolveTextOrStdin
32
+ } from "./chunk-ZYURL5VK.js";
33
33
 
34
34
  // src/commands/comment.ts
35
35
  import { defineCommand } from "citty";
@@ -452,7 +452,7 @@ var commentAddCommand = defineCommand({
452
452
  args: {
453
453
  ...WRITE_SINGLE_FLAGS,
454
454
  postId: { type: "positional", description: "Post id to comment on." },
455
- text: { type: "positional", description: "Comment text. Pass - to read from stdin." },
455
+ text: { type: "positional", stdinArg: true, description: "Comment text. Pass - to read from stdin." },
456
456
  attach: { type: "string", description: "Image file to attach (at most one)." }
457
457
  },
458
458
  async run({ args }) {
@@ -465,7 +465,7 @@ var commentReplyCommand = defineCommand({
465
465
  ...WRITE_SINGLE_FLAGS,
466
466
  postId: { type: "positional", description: "Post id the comment belongs to." },
467
467
  commentId: { type: "positional", description: "Comment id to reply to." },
468
- text: { type: "positional", description: "Reply text. Pass - to read from stdin." },
468
+ text: { type: "positional", stdinArg: true, description: "Reply text. Pass - to read from stdin." },
469
469
  attach: { type: "string", description: "Image file to attach (at most one)." }
470
470
  },
471
471
  async run({ args }) {
@@ -478,7 +478,7 @@ var commentEditCommand = defineCommand({
478
478
  ...WRITE_SINGLE_FLAGS,
479
479
  postId: { type: "positional", description: "Post id the comment belongs to." },
480
480
  commentId: { type: "positional", description: "Comment id to edit." },
481
- text: { type: "positional", description: "Updated comment text. Pass - to read from stdin." }
481
+ text: { type: "positional", stdinArg: true, description: "Updated comment text. Pass - to read from stdin." }
482
482
  },
483
483
  async run({ args }) {
484
484
  await withClient(args, (c, f, o) => runCommentEdit(c, f, o, void 0));
@@ -1,11 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  sentAsNotice
4
- } from "./chunk-IGCQNDIG.js";
4
+ } from "./chunk-OE7OMTCM.js";
5
5
  import "./chunk-HOQ7EUHJ.js";
6
- import {
7
- resolveTextOrStdin
8
- } from "./chunk-U7Y4EXHT.js";
9
6
  import {
10
7
  AttachError,
11
8
  readAttachment,
@@ -19,11 +16,11 @@ import {
19
16
  slimSearchJobs,
20
17
  slimSearchPeople,
21
18
  slimSearchPosts
22
- } from "./chunk-ROULHEFW.js";
19
+ } from "./chunk-WYRYCTUM.js";
23
20
  import {
24
21
  pageDelayFromFlags,
25
22
  streamAll
26
- } from "./chunk-EEMJDJ4W.js";
23
+ } from "./chunk-HZFK45IW.js";
27
24
  import "./chunk-UWO2D4HW.js";
28
25
  import {
29
26
  resolveIdentifier
@@ -37,11 +34,14 @@ import {
37
34
  renderSuccess,
38
35
  renderUnexpectedError,
39
36
  resolveEffectiveConfig
40
- } from "./chunk-HDQUEFD2.js";
37
+ } from "./chunk-VPKMJYIF.js";
41
38
  import {
42
39
  GLOBAL_FLAGS,
43
40
  WRITE_FLAGS
44
- } from "./chunk-DW2HCRXJ.js";
41
+ } from "./chunk-CUTMZWL6.js";
42
+ import {
43
+ resolveTextOrStdin
44
+ } from "./chunk-ZYURL5VK.js";
45
45
 
46
46
  // src/commands/company.ts
47
47
  import { defineCommand } from "citty";
@@ -824,7 +824,7 @@ var companyReplyCommand = defineCommand({
824
824
  type: "positional",
825
825
  description: "The 2-\u2026 chat id from `company chats`, passed through verbatim (no client-side check)."
826
826
  },
827
- text: { type: "positional", description: "Reply text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
827
+ text: { type: "positional", stdinArg: true, description: "Reply text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
828
828
  attach: { type: "string", description: "File to attach (repeatable)." }
829
829
  },
830
830
  async run({ args }) {
@@ -7,7 +7,8 @@ import {
7
7
  renameProfile,
8
8
  setActiveProfile,
9
9
  updateProfileField
10
- } from "./chunk-DW2HCRXJ.js";
10
+ } from "./chunk-CUTMZWL6.js";
11
+ import "./chunk-ZYURL5VK.js";
11
12
 
12
13
  // src/commands/config.ts
13
14
  import { defineCommand } from "citty";
@@ -7,11 +7,11 @@ import {
7
7
  slimInviteReceivedItem,
8
8
  slimInviteSent,
9
9
  slimInviteSentItem
10
- } from "./chunk-ROULHEFW.js";
10
+ } from "./chunk-WYRYCTUM.js";
11
11
  import {
12
12
  pageDelayFromFlags,
13
13
  streamAll
14
- } from "./chunk-EEMJDJ4W.js";
14
+ } from "./chunk-HZFK45IW.js";
15
15
  import {
16
16
  resolveIdentifier
17
17
  } from "./chunk-DMQZEPQE.js";
@@ -24,11 +24,12 @@ import {
24
24
  renderSuccess,
25
25
  renderUnexpectedError,
26
26
  resolveEffectiveConfig
27
- } from "./chunk-HDQUEFD2.js";
27
+ } from "./chunk-VPKMJYIF.js";
28
28
  import {
29
29
  GLOBAL_FLAGS,
30
30
  WRITE_FLAGS
31
- } from "./chunk-DW2HCRXJ.js";
31
+ } from "./chunk-CUTMZWL6.js";
32
+ import "./chunk-ZYURL5VK.js";
32
33
 
33
34
  // src/commands/connect.ts
34
35
  import { defineCommand } from "citty";
@@ -2,17 +2,18 @@
2
2
  import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
- } from "./chunk-EEMJDJ4W.js";
5
+ } from "./chunk-HZFK45IW.js";
6
6
  import {
7
7
  createClient,
8
8
  renderError,
9
9
  renderSuccess,
10
10
  renderUnexpectedError,
11
11
  resolveEffectiveConfig
12
- } from "./chunk-HDQUEFD2.js";
12
+ } from "./chunk-VPKMJYIF.js";
13
13
  import {
14
14
  GLOBAL_FLAGS
15
- } from "./chunk-DW2HCRXJ.js";
15
+ } from "./chunk-CUTMZWL6.js";
16
+ import "./chunk-ZYURL5VK.js";
16
17
 
17
18
  // src/commands/feed.ts
18
19
  import { defineCommand } from "citty";
@@ -2,18 +2,19 @@
2
2
  import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
- } from "./chunk-EEMJDJ4W.js";
5
+ } from "./chunk-HZFK45IW.js";
6
6
  import {
7
7
  createClient,
8
8
  renderError,
9
9
  renderSuccess,
10
10
  renderUnexpectedError,
11
11
  resolveEffectiveConfig
12
- } from "./chunk-HDQUEFD2.js";
12
+ } from "./chunk-VPKMJYIF.js";
13
13
  import {
14
14
  GLOBAL_FLAGS,
15
15
  READ_SINGLE_FLAGS
16
- } from "./chunk-DW2HCRXJ.js";
16
+ } from "./chunk-CUTMZWL6.js";
17
+ import "./chunk-ZYURL5VK.js";
17
18
 
18
19
  // src/commands/group.ts
19
20
  import { defineCommand } from "citty";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
- } from "./chunk-EEMJDJ4W.js";
5
+ } from "./chunk-HZFK45IW.js";
6
6
  import {
7
7
  normalizeChatId
8
8
  } from "./chunk-DMQZEPQE.js";
@@ -15,12 +15,13 @@ import {
15
15
  renderSuccess,
16
16
  renderUnexpectedError,
17
17
  resolveEffectiveConfig
18
- } from "./chunk-HDQUEFD2.js";
18
+ } from "./chunk-VPKMJYIF.js";
19
19
  import {
20
20
  GLOBAL_FLAGS,
21
21
  READ_SINGLE_FLAGS,
22
22
  WRITE_SINGLE_FLAGS
23
- } from "./chunk-DW2HCRXJ.js";
23
+ } from "./chunk-CUTMZWL6.js";
24
+ import "./chunk-ZYURL5VK.js";
24
25
 
25
26
  // src/commands/inbox.ts
26
27
  import { defineCommand } from "citty";
@@ -2,18 +2,19 @@
2
2
  import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
- } from "./chunk-EEMJDJ4W.js";
5
+ } from "./chunk-HZFK45IW.js";
6
6
  import {
7
7
  createClient,
8
8
  renderError,
9
9
  renderSuccess,
10
10
  renderUnexpectedError,
11
11
  resolveEffectiveConfig
12
- } from "./chunk-HDQUEFD2.js";
12
+ } from "./chunk-VPKMJYIF.js";
13
13
  import {
14
14
  GLOBAL_FLAGS,
15
15
  READ_SINGLE_FLAGS
16
- } from "./chunk-DW2HCRXJ.js";
16
+ } from "./chunk-CUTMZWL6.js";
17
+ import "./chunk-ZYURL5VK.js";
17
18
 
18
19
  // src/commands/inboxes.ts
19
20
  import { defineCommand } from "citty";
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  slimJob
4
- } from "./chunk-ROULHEFW.js";
4
+ } from "./chunk-WYRYCTUM.js";
5
5
  import {
6
6
  DEFAULT_PAGE_DELAY_MS,
7
7
  ndjsonModeNotice,
8
8
  pageDelayFromFlags,
9
9
  streamAll
10
- } from "./chunk-EEMJDJ4W.js";
10
+ } from "./chunk-HZFK45IW.js";
11
11
  import {
12
12
  BinaryOutputError,
13
13
  writeBinaryOutput
@@ -24,12 +24,13 @@ import {
24
24
  renderSuccess,
25
25
  renderUnexpectedError,
26
26
  resolveEffectiveConfig
27
- } from "./chunk-HDQUEFD2.js";
27
+ } from "./chunk-VPKMJYIF.js";
28
28
  import {
29
29
  GLOBAL_FLAGS,
30
30
  READ_SINGLE_FLAGS,
31
31
  WRITE_SINGLE_FLAGS
32
- } from "./chunk-DW2HCRXJ.js";
32
+ } from "./chunk-CUTMZWL6.js";
33
+ import "./chunk-ZYURL5VK.js";
33
34
 
34
35
  // src/commands/job.ts
35
36
  import { defineCommand } from "citty";
@@ -5,7 +5,11 @@ import {
5
5
  import {
6
6
  GLOBAL_FLAGS,
7
7
  writeProfile
8
- } from "./chunk-DW2HCRXJ.js";
8
+ } from "./chunk-CUTMZWL6.js";
9
+ import {
10
+ defaultReadStdin,
11
+ resolveTextOrStdin
12
+ } from "./chunk-ZYURL5VK.js";
9
13
 
10
14
  // src/commands/login.ts
11
15
  import { defineCommand } from "citty";
@@ -43,6 +47,7 @@ var loginCommand = defineCommand({
43
47
  ...GLOBAL_FLAGS,
44
48
  "api-key": {
45
49
  type: "string",
50
+ stdinArg: true,
46
51
  description: 'API key to save. Pass "-" to read from stdin (keeps the key off argv).'
47
52
  },
48
53
  account: {
@@ -58,8 +63,13 @@ var loginCommand = defineCommand({
58
63
  async run({ args }) {
59
64
  const profileName = args.profile ?? "default";
60
65
  let apiKey = args["api-key"];
61
- if (apiKey === "-") {
62
- apiKey = await readStdin();
66
+ const out = { stderr: { write: (s) => process.stderr.write(s) } };
67
+ if (apiKey !== void 0) {
68
+ apiKey = await resolveTextOrStdin(
69
+ apiKey,
70
+ out,
71
+ async () => (await defaultReadStdin()).trim()
72
+ );
63
73
  }
64
74
  if (apiKey === void 0) {
65
75
  if (process.stdin.isTTY) {
@@ -72,7 +82,6 @@ var loginCommand = defineCommand({
72
82
  return;
73
83
  }
74
84
  }
75
- const out = { stderr: { write: (s) => process.stderr.write(s) } };
76
85
  await runLogin(
77
86
  {
78
87
  "api-key": apiKey,
@@ -84,16 +93,6 @@ var loginCommand = defineCommand({
84
93
  );
85
94
  }
86
95
  });
87
- async function readStdin() {
88
- return new Promise((resolve, reject) => {
89
- const chunks = [];
90
- process.stdin.on("data", (chunk) => chunks.push(chunk));
91
- process.stdin.on("end", () => {
92
- resolve(Buffer.concat(chunks).toString("utf8").trim());
93
- });
94
- process.stdin.on("error", reject);
95
- });
96
- }
97
96
  async function promptMasked(prompt) {
98
97
  return readlineSync(prompt, { mask: true });
99
98
  }
@@ -13,15 +13,15 @@ import {
13
13
  runMessageSend,
14
14
  sentAsNotice,
15
15
  willSendAsNotice
16
- } from "./chunk-IGCQNDIG.js";
16
+ } from "./chunk-OE7OMTCM.js";
17
17
  import "./chunk-HOQ7EUHJ.js";
18
- import "./chunk-U7Y4EXHT.js";
19
18
  import "./chunk-BGZW6B7G.js";
20
19
  import "./chunk-UWO2D4HW.js";
21
20
  import "./chunk-DMQZEPQE.js";
22
21
  import "./chunk-R3VLWLVV.js";
23
- import "./chunk-HDQUEFD2.js";
24
- import "./chunk-DW2HCRXJ.js";
22
+ import "./chunk-VPKMJYIF.js";
23
+ import "./chunk-CUTMZWL6.js";
24
+ import "./chunk-ZYURL5VK.js";
25
25
  export {
26
26
  guardBareMessageForm,
27
27
  messageCommand,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
- } from "./chunk-EEMJDJ4W.js";
5
+ } from "./chunk-HZFK45IW.js";
6
6
  import {
7
7
  buildPreviewOutput
8
8
  } from "./chunk-R3VLWLVV.js";
@@ -12,11 +12,12 @@ import {
12
12
  renderSuccess,
13
13
  renderUnexpectedError,
14
14
  resolveEffectiveConfig
15
- } from "./chunk-HDQUEFD2.js";
15
+ } from "./chunk-VPKMJYIF.js";
16
16
  import {
17
17
  GLOBAL_FLAGS,
18
18
  WRITE_SINGLE_FLAGS
19
- } from "./chunk-DW2HCRXJ.js";
19
+ } from "./chunk-CUTMZWL6.js";
20
+ import "./chunk-ZYURL5VK.js";
20
21
 
21
22
  // src/commands/notification.ts
22
23
  import { defineCommand } from "citty";
@@ -2,9 +2,6 @@
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
4
  } from "./chunk-QJZ3LWOX.js";
5
- import {
6
- resolveTextOrStdin
7
- } from "./chunk-U7Y4EXHT.js";
8
5
  import {
9
6
  AttachError,
10
7
  readAttachment,
@@ -13,7 +10,7 @@ import {
13
10
  import {
14
11
  pageDelayFromFlags,
15
12
  streamAll
16
- } from "./chunk-EEMJDJ4W.js";
13
+ } from "./chunk-HZFK45IW.js";
17
14
  import "./chunk-DMQZEPQE.js";
18
15
  import {
19
16
  buildPreviewOutput
@@ -24,12 +21,15 @@ import {
24
21
  renderSuccess,
25
22
  renderUnexpectedError,
26
23
  resolveEffectiveConfig
27
- } from "./chunk-HDQUEFD2.js";
24
+ } from "./chunk-VPKMJYIF.js";
28
25
  import {
29
26
  GLOBAL_FLAGS,
30
27
  WRITE_FLAGS,
31
28
  WRITE_SINGLE_FLAGS
32
- } from "./chunk-DW2HCRXJ.js";
29
+ } from "./chunk-CUTMZWL6.js";
30
+ import {
31
+ resolveTextOrStdin
32
+ } from "./chunk-ZYURL5VK.js";
33
33
 
34
34
  // src/commands/post.ts
35
35
  import { defineCommand } from "citty";
@@ -412,7 +412,7 @@ var postCreateCommand = defineCommand({
412
412
  args: {
413
413
  // Write command: WRITE_FLAGS omits pagination/projection flags
414
414
  ...WRITE_FLAGS,
415
- text: { type: "positional", description: "Post body text. Pass - to read from stdin (enables multiline via heredoc or pipe)." },
415
+ text: { type: "positional", stdinArg: true, description: "Post body text. Pass - to read from stdin (enables multiline via heredoc or pipe)." },
416
416
  attach: {
417
417
  type: "string",
418
418
  description: "Image/video/document to attach (repeatable for images; a single PDF produces a document post). Supported: jpg, png, gif, mp4, pdf."
@@ -11,11 +11,11 @@ import {
11
11
  import {
12
12
  slimProfile,
13
13
  slimProfileMe
14
- } from "./chunk-ROULHEFW.js";
14
+ } from "./chunk-WYRYCTUM.js";
15
15
  import {
16
16
  pageDelayFromFlags,
17
17
  streamAll
18
- } from "./chunk-EEMJDJ4W.js";
18
+ } from "./chunk-HZFK45IW.js";
19
19
  import {
20
20
  resolveIdentifier
21
21
  } from "./chunk-DMQZEPQE.js";
@@ -28,12 +28,13 @@ import {
28
28
  renderSuccess,
29
29
  renderUnexpectedError,
30
30
  resolveEffectiveConfig
31
- } from "./chunk-HDQUEFD2.js";
31
+ } from "./chunk-VPKMJYIF.js";
32
32
  import {
33
33
  GLOBAL_FLAGS,
34
34
  READ_SINGLE_FLAGS,
35
35
  WRITE_SINGLE_FLAGS
36
- } from "./chunk-DW2HCRXJ.js";
36
+ } from "./chunk-CUTMZWL6.js";
37
+ import "./chunk-ZYURL5VK.js";
37
38
 
38
39
  // src/commands/profile.ts
39
40
  import { defineCommand } from "citty";
@@ -3,7 +3,7 @@ import {
3
3
  DEFAULT_FILTER_READERS,
4
4
  assembleFilters,
5
5
  splitCsv
6
- } from "./chunk-42VUUKQ3.js";
6
+ } from "./chunk-56ORAZJO.js";
7
7
  import {
8
8
  AttachError,
9
9
  readAttachment,
@@ -11,11 +11,11 @@ import {
11
11
  } from "./chunk-BGZW6B7G.js";
12
12
  import {
13
13
  slimJob
14
- } from "./chunk-ROULHEFW.js";
14
+ } from "./chunk-WYRYCTUM.js";
15
15
  import {
16
16
  pageDelayFromFlags,
17
17
  streamAll
18
- } from "./chunk-EEMJDJ4W.js";
18
+ } from "./chunk-HZFK45IW.js";
19
19
  import {
20
20
  BinaryOutputError,
21
21
  writeBinaryOutput
@@ -33,13 +33,16 @@ import {
33
33
  renderSuccess,
34
34
  renderUnexpectedError,
35
35
  resolveEffectiveConfig
36
- } from "./chunk-HDQUEFD2.js";
36
+ } from "./chunk-VPKMJYIF.js";
37
37
  import {
38
38
  GLOBAL_FLAGS,
39
39
  READ_SINGLE_FLAGS,
40
40
  WRITE_FLAGS,
41
41
  WRITE_SINGLE_FLAGS
42
- } from "./chunk-DW2HCRXJ.js";
42
+ } from "./chunk-CUTMZWL6.js";
43
+ import {
44
+ isStdinToken
45
+ } from "./chunk-ZYURL5VK.js";
43
46
 
44
47
  // src/commands/recruiter.ts
45
48
  import { defineCommand } from "citty";
@@ -112,7 +115,7 @@ async function assembleRecruiterJobBody(flags, readers) {
112
115
  } catch {
113
116
  return { error: `cannot read ${source}` };
114
117
  }
115
- } else if (flags.body === "-") {
118
+ } else if (isStdinToken(flags.body)) {
116
119
  source = "--body - (stdin)";
117
120
  raw = await readers.readStdin();
118
121
  } else if (flags.body !== void 0) {
@@ -962,7 +965,7 @@ var recruiterSearchPeopleCommand = defineCommand({
962
965
  args: {
963
966
  ...GLOBAL_FLAGS,
964
967
  keywords: { type: "string", description: "Keyword search string." },
965
- filters: { type: "string", description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
968
+ filters: { type: "string", stdinArg: true, description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
966
969
  "filters-file": { type: "string", description: "Path to a JSON file with the filter body." },
967
970
  locale: { type: "string", description: "Result locale, e.g. en." },
968
971
  "employment-type": { type: "string", description: "Employment type ids (comma-separated)." },
@@ -1228,7 +1231,7 @@ var recruiterJobsCommand = defineCommand({
1228
1231
  });
1229
1232
  var RECRUITER_JOB_BODY_FLAGS = {
1230
1233
  "body-file": { type: "string", description: "Path to a JSON file with the full job body." },
1231
- body: { type: "string", description: "Read the JSON job body from stdin (pass '-')." },
1234
+ body: { type: "string", stdinArg: true, description: "Read the JSON job body from stdin (pass '-')." },
1232
1235
  "job-title-id": { type: "string", description: "Resolved job-title parameter id (merged with --job-title into job_title:{id,name})." },
1233
1236
  "job-title": { type: "string", description: "Job title display name (merged with --job-title-id into job_title:{id,name})." },
1234
1237
  "company-id": { type: "string", description: "Resolved company id (or use --company-name for free text)." },
@@ -1537,7 +1540,7 @@ var recruiterTalentSearchCommand = defineCommand({
1537
1540
  projectId: { type: "positional", description: "Recruiter project ID." },
1538
1541
  "channel-id": { type: "string", description: "The project's RECRUITER_SEARCH talent-pool channel ID (required).", required: true },
1539
1542
  keywords: { type: "string", description: "Free-text keyword search." },
1540
- filters: { type: "string", description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
1543
+ filters: { type: "string", stdinArg: true, description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
1541
1544
  "filters-file": { type: "string", description: "Path to a JSON file with the filter body." }
1542
1545
  },
1543
1546
  async run({ args }) {
@@ -4,7 +4,7 @@ import {
4
4
  assembleFilters,
5
5
  splitCsv,
6
6
  splitCsvNumbers
7
- } from "./chunk-42VUUKQ3.js";
7
+ } from "./chunk-56ORAZJO.js";
8
8
  import {
9
9
  AttachError,
10
10
  readAttachment,
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  pageDelayFromFlags,
15
15
  streamAll
16
- } from "./chunk-EEMJDJ4W.js";
16
+ } from "./chunk-HZFK45IW.js";
17
17
  import {
18
18
  resolveIdentifier
19
19
  } from "./chunk-DMQZEPQE.js";
@@ -26,12 +26,13 @@ import {
26
26
  renderSuccess,
27
27
  renderUnexpectedError,
28
28
  resolveEffectiveConfig
29
- } from "./chunk-HDQUEFD2.js";
29
+ } from "./chunk-VPKMJYIF.js";
30
30
  import {
31
31
  GLOBAL_FLAGS,
32
32
  READ_SINGLE_FLAGS,
33
33
  WRITE_FLAGS
34
- } from "./chunk-DW2HCRXJ.js";
34
+ } from "./chunk-CUTMZWL6.js";
35
+ import "./chunk-ZYURL5VK.js";
35
36
 
36
37
  // src/commands/sales-nav.ts
37
38
  import { defineCommand } from "citty";
@@ -530,7 +531,7 @@ var salesNavSearchPeopleCommand = defineCommand({
530
531
  args: {
531
532
  ...GLOBAL_FLAGS,
532
533
  keywords: { type: "string", description: "Keyword search string." },
533
- filters: { type: "string", description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
534
+ filters: { type: "string", stdinArg: true, description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
534
535
  "filters-file": { type: "string", description: "Path to a JSON file with the filter body." },
535
536
  "first-name": { type: "string", description: "First name to match." },
536
537
  "last-name": { type: "string", description: "Last name to match." },
@@ -560,7 +561,7 @@ var salesNavSearchCompaniesCommand = defineCommand({
560
561
  args: {
561
562
  ...GLOBAL_FLAGS,
562
563
  keywords: { type: "string", description: "Keyword search string." },
563
- filters: { type: "string", description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
564
+ filters: { type: "string", stdinArg: true, description: "Filter body as a JSON object (escape hatch for the full filter surface); '-' reads JSON from stdin." },
564
565
  "filters-file": { type: "string", description: "Path to a JSON file with the filter body." },
565
566
  technologies: { type: "string", description: "Technology tags (comma-separated)." },
566
567
  "recent-activities": { type: "string", description: "Recent activity ids (comma-separated)." },
@@ -4,7 +4,7 @@ import {
4
4
  assembleFilters,
5
5
  splitCsv,
6
6
  splitCsvNumbers
7
- } from "./chunk-42VUUKQ3.js";
7
+ } from "./chunk-56ORAZJO.js";
8
8
  import {
9
9
  slimSearchCompanies,
10
10
  slimSearchCompaniesItem,
@@ -14,21 +14,22 @@ import {
14
14
  slimSearchPeopleItem,
15
15
  slimSearchPosts,
16
16
  slimSearchPostsItem
17
- } from "./chunk-ROULHEFW.js";
17
+ } from "./chunk-WYRYCTUM.js";
18
18
  import {
19
19
  pageDelayFromFlags,
20
20
  streamAll
21
- } from "./chunk-EEMJDJ4W.js";
21
+ } from "./chunk-HZFK45IW.js";
22
22
  import {
23
23
  createClient,
24
24
  renderError,
25
25
  renderSuccess,
26
26
  renderUnexpectedError,
27
27
  resolveEffectiveConfig
28
- } from "./chunk-HDQUEFD2.js";
28
+ } from "./chunk-VPKMJYIF.js";
29
29
  import {
30
30
  GLOBAL_FLAGS
31
- } from "./chunk-DW2HCRXJ.js";
31
+ } from "./chunk-CUTMZWL6.js";
32
+ import "./chunk-ZYURL5VK.js";
32
33
 
33
34
  // src/commands/search.ts
34
35
  import { defineCommand } from "citty";
@@ -45,6 +46,7 @@ var PEOPLE_INVALID_FLAGS = ["seniority", "function", "employment-type", "sort-by
45
46
  var FILTER_FLAGS = {
46
47
  filters: {
47
48
  type: "string",
49
+ stdinArg: true,
48
50
  description: "Filter body as a JSON object (named flags win on conflict; server validates and strips unknown fields); '-' reads JSON from stdin."
49
51
  },
50
52
  "filters-file": {
@@ -1,12 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- STDIN_SENTINEL,
4
- defaultReadStdin
5
- } from "./chunk-U7Y4EXHT.js";
6
2
  import {
7
3
  pageDelayFromFlags,
8
4
  streamAll
9
- } from "./chunk-EEMJDJ4W.js";
5
+ } from "./chunk-HZFK45IW.js";
10
6
  import {
11
7
  buildPreviewOutput
12
8
  } from "./chunk-R3VLWLVV.js";
@@ -16,10 +12,14 @@ import {
16
12
  renderSuccess,
17
13
  renderUnexpectedError,
18
14
  resolveEffectiveConfig
19
- } from "./chunk-HDQUEFD2.js";
15
+ } from "./chunk-VPKMJYIF.js";
20
16
  import {
21
17
  GLOBAL_FLAGS
22
- } from "./chunk-DW2HCRXJ.js";
18
+ } from "./chunk-CUTMZWL6.js";
19
+ import {
20
+ defaultReadStdin,
21
+ isStdinToken
22
+ } from "./chunk-ZYURL5VK.js";
23
23
 
24
24
  // src/commands/webhook.ts
25
25
  import { defineCommand } from "citty";
@@ -216,7 +216,7 @@ async function resolveWebhookBody(raw, out, readStdin = defaultReadStdin) {
216
216
  );
217
217
  process.exit(2);
218
218
  }
219
- if (raw === "-" || raw === STDIN_SENTINEL) {
219
+ if (isStdinToken(raw)) {
220
220
  const piped = stripTrailingNewlines(await readStdin());
221
221
  if (!piped) {
222
222
  out.stderr.write("error: --body -: stdin: empty input\n");
@@ -428,6 +428,7 @@ var webhookVerifyCommand = defineCommand({
428
428
  },
429
429
  body: {
430
430
  type: "string",
431
+ stdinArg: true,
431
432
  description: "The raw webhook body: inline JSON, a path to a file containing it, or - to read it from stdin.",
432
433
  required: true
433
434
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.20.0",
3
+ "version": "0.21.1",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",
@@ -1,33 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // src/lib/stdin.ts
4
- var STDIN_SENTINEL = "__curviate_stdin__";
5
- async function defaultReadStdin() {
6
- return new Promise((resolve, reject) => {
7
- const chunks = [];
8
- process.stdin.on("data", (chunk) => {
9
- chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
10
- });
11
- process.stdin.on("end", () => {
12
- const full = Buffer.concat(chunks).toString("utf8");
13
- resolve(full.replace(/\n+$/, ""));
14
- });
15
- process.stdin.on("error", reject);
16
- });
17
- }
18
- async function resolveTextOrStdin(rawText, out, readStdin) {
19
- if (rawText !== "-" && rawText !== STDIN_SENTINEL) return rawText;
20
- const reader = readStdin ?? defaultReadStdin;
21
- const text = await reader();
22
- if (!text) {
23
- out.stderr.write("error: stdin: empty input\n");
24
- process.exit(2);
25
- }
26
- return text;
27
- }
28
-
29
- export {
30
- STDIN_SENTINEL,
31
- defaultReadStdin,
32
- resolveTextOrStdin
33
- };