linkedin-relay-mcp 3.17.0 → 3.19.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.
package/dist/cli.js CHANGED
@@ -572,12 +572,12 @@ var NAMESPACE_ALIASES = {
572
572
  fs_profile: "fsd_profile"
573
573
  };
574
574
  function canonicalUrn(urn) {
575
- const inner = innerUrn(urn);
576
- const parts = inner.split(":");
575
+ const inner2 = innerUrn(urn);
576
+ const parts = inner2.split(":");
577
577
  const namespace = parts[2];
578
- if (namespace === void 0) return inner;
578
+ if (namespace === void 0) return inner2;
579
579
  const alias = NAMESPACE_ALIASES[namespace];
580
- if (alias === void 0) return inner;
580
+ if (alias === void 0) return inner2;
581
581
  parts[2] = alias;
582
582
  return parts.join(":");
583
583
  }
@@ -1908,8 +1908,8 @@ function activityIdSegment(activityId) {
1908
1908
  if (!/^\d+$/.test(activityId)) {
1909
1909
  throw new Error(`'${activityId}' is not a numeric activity id`);
1910
1910
  }
1911
- const inner = [8, ...varint(zigzag(BigInt(activityId)))];
1912
- const message = Uint8Array.from([10, inner.length, ...inner]);
1911
+ const inner2 = [8, ...varint(zigzag(BigInt(activityId)))];
1912
+ const message = Uint8Array.from([10, inner2.length, ...inner2]);
1913
1913
  return btoa(String.fromCharCode(...message)).replace(/=+$/, "");
1914
1914
  }
1915
1915
  function keyMatchesPost(bindingKey, activityId) {
@@ -2064,7 +2064,7 @@ async function fetchCommentMenu(ref, trackingId, client) {
2064
2064
  const stream = result.classification.raw ?? "";
2065
2065
  return { ok: true, stream };
2066
2066
  }
2067
- function textStates(payload, text5) {
2067
+ function textStates(payload, text6) {
2068
2068
  const keyOf = (...names) => {
2069
2069
  for (const n of names) {
2070
2070
  const slot = payload[n];
@@ -2083,12 +2083,12 @@ function textStates(payload, text5) {
2083
2083
  protoKey: { $type: "proto.sdui.Key", value: { $case: "id", id: key } }
2084
2084
  });
2085
2085
  return [
2086
- entry2(plain2, text5, "stringValue"),
2087
- entry2(rich, { text: text5, attribute: [], $type: "TextModel", source: "local" }, "textModelForWrite")
2086
+ entry2(plain2, text6, "stringValue"),
2087
+ entry2(rich, { text: text6, attribute: [], $type: "TextModel", source: "local" }, "textModelForWrite")
2088
2088
  ];
2089
2089
  }
2090
- function editStates(payload, text5) {
2091
- return textStates(payload, text5);
2090
+ function editStates(payload, text6) {
2091
+ return textStates(payload, text6);
2092
2092
  }
2093
2093
  async function runCommentAction(ref, operation, trackingId, client, newText) {
2094
2094
  const menu = await fetchCommentMenu(ref, trackingId, client);
@@ -2427,12 +2427,12 @@ var CATEGORY = {
2427
2427
  VIDEO: "VIDEO",
2428
2428
  DOCUMENT: "NATIVE_DOCUMENT"
2429
2429
  };
2430
- function sharePayload(text5, visibility, media = [], scheduledAt) {
2430
+ function sharePayload(text6, visibility, media = [], scheduledAt) {
2431
2431
  const schedule = scheduledAt === void 0 ? { postState: "PUBLISHED" } : { postState: "SCHEDULED", scheduledAt };
2432
2432
  return {
2433
2433
  visibleToConnectionsOnly: visibility === "CONNECTIONS",
2434
2434
  externalAudienceProviders: [],
2435
- commentaryV2: { text: text5, attributes: [] },
2435
+ commentaryV2: { text: text6, attributes: [] },
2436
2436
  origin: "FEED",
2437
2437
  allowedCommentersScope: "ALL",
2438
2438
  ...schedule,
@@ -2546,15 +2546,15 @@ async function share(confirmed, client, bytes) {
2546
2546
  note: "LinkedIn accepted the post but the response carried no recognisable urn. Run `lnrelay sync my-posts && lnrelay my-posts` to confirm what actually landed \u2014 and do NOT re-run this command on the assumption it failed, or you will post twice."
2547
2547
  } : { ok: true, id };
2548
2548
  }
2549
- function editPostBody(text5) {
2550
- return { patch: { $set: { commentaryV2: { text: text5, attributes: [] } } } };
2549
+ function editPostBody(text6) {
2550
+ return { patch: { $set: { commentaryV2: { text: text6, attributes: [] } } } };
2551
2551
  }
2552
2552
  async function editPost(confirmed, client) {
2553
- const { urn, text: text5 } = confirmed.payload;
2553
+ const { urn, text: text6 } = confirmed.payload;
2554
2554
  const result = await client.request({
2555
2555
  url: deleteUrl(urn),
2556
2556
  method: "POST",
2557
- body: editPostBody(text5),
2557
+ body: editPostBody(text6),
2558
2558
  spendClass: "write",
2559
2559
  operation: "edit-post"
2560
2560
  });
@@ -2564,7 +2564,7 @@ async function editPost(confirmed, client) {
2564
2564
  return out;
2565
2565
  }
2566
2566
  const held = result.json?.data?.commentary?.text;
2567
- if (held !== text5) {
2567
+ if (held !== text6) {
2568
2568
  return {
2569
2569
  ok: false,
2570
2570
  code: "SCHEMA_DRIFT",
@@ -2625,8 +2625,8 @@ async function createPoll(poll, client) {
2625
2625
  }
2626
2626
  return { ok: true, urn };
2627
2627
  }
2628
- function firstUrl(text5) {
2629
- const found = text5.match(/https?:\/\/[^\s<>"]+/)?.[0];
2628
+ function firstUrl(text6) {
2629
+ const found = text6.match(/https?:\/\/[^\s<>"]+/)?.[0];
2630
2630
  if (found === void 0) return null;
2631
2631
  let url = found.replace(/[.,;:!?'"]+$/, "");
2632
2632
  if (url.endsWith(")") && !url.includes("(")) url = url.slice(0, -1);
@@ -2790,8 +2790,8 @@ function previewLines2(post) {
2790
2790
  " about to delete, or that it is yours."
2791
2791
  ];
2792
2792
  }
2793
- const text5 = typeof post.text === "string" ? post.text : "(no text \u2014 media-only post?)";
2794
- const shown = text5.length > PREVIEW_CHARS ? `${text5.slice(0, PREVIEW_CHARS)}\u2026` : text5;
2793
+ const text6 = typeof post.text === "string" ? post.text : "(no text \u2014 media-only post?)";
2794
+ const shown = text6.length > PREVIEW_CHARS ? `${text6.slice(0, PREVIEW_CHARS)}\u2026` : text6;
2795
2795
  const lines = [`content "${shown.replace(/\n/g, " ")}"`];
2796
2796
  if (typeof post.scheduledAt === "string") {
2797
2797
  lines.push(`status scheduled, publishes ${post.scheduledAt} unless cancelled`);
@@ -2958,10 +2958,10 @@ function balanced(s, start) {
2958
2958
  return null;
2959
2959
  }
2960
2960
  function parseAt(s, start) {
2961
- const text5 = start < 0 ? null : balanced(s, start);
2962
- if (text5 === null) return null;
2961
+ const text6 = start < 0 ? null : balanced(s, start);
2962
+ if (text6 === null) return null;
2963
2963
  try {
2964
- return JSON.parse(text5);
2964
+ return JSON.parse(text6);
2965
2965
  } catch {
2966
2966
  return null;
2967
2967
  }
@@ -3292,13 +3292,13 @@ function readPost(rows, top, model) {
3292
3292
  const subRow = sub === void 0 ? "" : rows.byId.get(sub.row) ?? "";
3293
3293
  const posted = sub === void 0 ? void 0 : texts(subRow, subRow.indexOf('"viewName":"feed-actor-sub-description"'))[0];
3294
3294
  const said = commentary === void 0 ? void 0 : firstIn(rows, commentary.under, (row) => texts(row)[0]);
3295
- const text5 = said?.v;
3295
+ const text6 = said?.v;
3296
3296
  const post = {
3297
3297
  id,
3298
3298
  url: `https://www.linkedin.com/feed/update/${id}/`,
3299
3299
  ...author.fields,
3300
3300
  ...posted !== void 0 ? { posted } : {},
3301
- ...text5 !== void 0 ? { text: text5 } : {},
3301
+ ...text6 !== void 0 ? { text: text6 } : {},
3302
3302
  ...reactions !== void 0 ? { reactions } : {}
3303
3303
  };
3304
3304
  const comments = n(`commentCount-${id}`);
@@ -3703,8 +3703,8 @@ function cardToJob(card) {
3703
3703
  const footer = Array.isArray(card.footerItems) ? card.footerItems : [];
3704
3704
  const listed2 = footer.find((f) => f.type === "LISTED_DATE");
3705
3705
  const insights = footer.filter((f) => !["LISTED_DATE", "PROMOTED", "EASY_APPLY_TEXT"].includes(String(f.type))).map((f) => text2(f.text)).filter((t) => t !== void 0);
3706
- const insight = text2(card.relevanceInsight?.text);
3707
- if (insight !== void 0) insights.push(insight);
3706
+ const insight2 = text2(card.relevanceInsight?.text);
3707
+ if (insight2 !== void 0) insights.push(insight2);
3708
3708
  return defined2({
3709
3709
  id,
3710
3710
  title,
@@ -3851,6 +3851,63 @@ function parseJobBatch(json) {
3851
3851
  const errors = root?.data?.errors ?? {};
3852
3852
  return { ok: true, jobs, missing: Object.keys(errors).map((k) => k.replace(/^\*/, "")) };
3853
3853
  }
3854
+ var HIRING_TEAM = "com.linkedin.sdui.generated.jobseeker.dsl.impl.peopleWhoCanHelp";
3855
+ var HIRING_TEAM_URL = `https://www.linkedin.com/flagship-web/rsc-action/actions/component?componentId=${HIRING_TEAM}&sduiid=${HIRING_TEAM}`;
3856
+ function hiringTeamBody(jobId) {
3857
+ return {
3858
+ componentId: HIRING_TEAM,
3859
+ clientArguments: {
3860
+ payload: { jobId, isTwoPane: false },
3861
+ states: [],
3862
+ requestMetadata: { $type: "proto.sdui.common.RequestMetadata" },
3863
+ screenId: "com.linkedin.sdui.flagshipnav.jobs.JobDetails",
3864
+ knownTemplateIds: []
3865
+ }
3866
+ };
3867
+ }
3868
+ var unquote = (s) => JSON.parse(`"${s}"`);
3869
+ function memberOf(card, id) {
3870
+ const url = card.match(/"url":"(https:\/\/www\.linkedin\.com\/in\/[^"/]+\/)"/)?.[1];
3871
+ const name = card.match(/\[null,"((?:[^"\\]|\\.)+)"/)?.[1];
3872
+ if (url === void 0 || name === void 0) return void 0;
3873
+ const lines = [...card.matchAll(/"children":\["((?:[^"\\$]|\\.)(?:[^"\\]|\\.)*)"\]/g)].map(
3874
+ (m) => unquote(m[1]).trim()
3875
+ );
3876
+ const degree = lines.find((l) => l.startsWith("\u2022"));
3877
+ const [headline, role2] = lines.filter((l) => l !== degree && l !== "");
3878
+ return defined2({
3879
+ name: unquote(name).trim(),
3880
+ id,
3881
+ url,
3882
+ headline,
3883
+ degree: degree?.replace(/^•\s*/, ""),
3884
+ role: role2,
3885
+ verified: /"role":"img","aria-label"/.test(card) ? true : void 0
3886
+ });
3887
+ }
3888
+ function parseHiringTeam(stream) {
3889
+ if (/^0:null\s*$/.test(stream.trim())) return { ok: true, members: [] };
3890
+ if (!stream.includes("peopleWhoCanHelp"))
3891
+ return drift2("the hiring team answer was not the hiring team component");
3892
+ const rows = new Rows(stream);
3893
+ const cards = [...rows.byId].filter(([, row]) => /linkedin\.com\\?\/in\\?\//.test(row));
3894
+ const at = (card) => stream.indexOf(`"$L${card}"`);
3895
+ const placed = cards.map(([key]) => at(key)).sort((a, b) => a - b);
3896
+ const members = [];
3897
+ for (const [key, row] of cards) {
3898
+ const from = at(key);
3899
+ const to = placed.find((p) => p > from) ?? stream.length;
3900
+ const id = stream.slice(from, to).match(/recipient=([A-Za-z0-9_-]+)/)?.[1];
3901
+ const m = memberOf(row, from === -1 ? void 0 : id);
3902
+ if (m !== void 0) members.push(m);
3903
+ }
3904
+ const shown = (stream.match(/screenContext=JOB_DETAILS_HIRING_TEAM/g) ?? []).length;
3905
+ if (members.length === 0 && Math.max(shown, cards.length) > 0)
3906
+ return drift2(
3907
+ `${Math.max(shown, cards.length)} hiring team members were shown but none could be read`
3908
+ );
3909
+ return { ok: true, members };
3910
+ }
3854
3911
  function parseJobFilters(json) {
3855
3912
  const elements = json?.data?.elements;
3856
3913
  if (!Array.isArray(elements)) return drift2("the job filter list was missing");
@@ -4560,12 +4617,21 @@ function liveFetch3(command, quiet) {
4560
4617
  if (session.state !== "ok")
4561
4618
  return err(command, "AUTH_FAILED", "no LinkedIn session \u2014 run `lnrelay login`");
4562
4619
  const client = createLiveClient(session.session, void 0, quiet);
4563
- return async (url, spendClass) => {
4564
- const r = await client.request({ url, spendClass, operation: command });
4565
- return r.ok ? { ok: true, json: r.json } : r;
4620
+ return async (url, spendClass, body) => {
4621
+ const r = await client.request({
4622
+ url,
4623
+ ...body !== void 0 ? { method: "POST", body } : {},
4624
+ spendClass,
4625
+ operation: command
4626
+ });
4627
+ if (!r.ok) return r;
4628
+ return { ok: true, json: r.json, raw: r.classification.raw ?? "" };
4566
4629
  };
4567
4630
  }
4568
4631
  var PAGING2 = { pageSize: PAGE_SIZE2, max: 1e3 };
4632
+ var teamLine = (team) => team === void 0 || team.length === 0 ? void 0 : `team: ${team.map(
4633
+ (m) => [m.name, m.role !== void 0 ? `(${m.role})` : void 0, m.url].filter(Boolean).join(" ")
4634
+ ).join("; ")}`;
4569
4635
  function compactJob(j) {
4570
4636
  return line([
4571
4637
  j.id,
@@ -4578,7 +4644,8 @@ function compactJob(j) {
4578
4644
  j.promoted ? "promoted" : void 0,
4579
4645
  j.salary,
4580
4646
  j.apply?.url !== void 0 ? `apply: ${j.apply.url}` : void 0,
4581
- j.matched !== void 0 ? `matched: ${j.matched.join(" + ")}` : void 0
4647
+ j.matched !== void 0 ? `matched: ${j.matched.join(" + ")}` : void 0,
4648
+ teamLine(j.hiringTeam)
4582
4649
  ]);
4583
4650
  }
4584
4651
  function shape2(rows, opts, line2) {
@@ -4686,7 +4753,15 @@ async function runJobs(req, opts = {}, fetch2) {
4686
4753
  meta
4687
4754
  });
4688
4755
  }
4689
- async function runJob(input, opts = {}, fetch2) {
4756
+ async function addTeams(get, jobs) {
4757
+ for (const job of jobs) {
4758
+ const res = await get(HIRING_TEAM_URL, "page", hiringTeamBody(job.id));
4759
+ const team = res.ok ? parseHiringTeam(res.raw ?? "") : res;
4760
+ if (team.ok) job.hiringTeam = team.members;
4761
+ else job.hiringTeamError = `${team.code}: ${team.message}`;
4762
+ }
4763
+ }
4764
+ async function runJob(input, opts = {}, fetch2, req = {}) {
4690
4765
  const given = input === void 0 ? [] : Array.isArray(input) ? input : [input];
4691
4766
  const ids = [...new Set(given.map(jobIdOf))];
4692
4767
  if (ids.length === 0 || ids.some((id) => id === void 0)) {
@@ -4706,6 +4781,7 @@ async function runJob(input, opts = {}, fetch2) {
4706
4781
  if (!res.ok) return err("job", res.code, res.message, res.hint);
4707
4782
  const detail = parseJobDetail(res.json);
4708
4783
  if (!detail.ok) return err("job", detail.code, detail.message, detail.hint);
4784
+ if (req.team === true) await addTeams(get, [detail.job]);
4709
4785
  return ok("job", detail.job);
4710
4786
  }
4711
4787
  const read = await readJobs(get, wanted);
@@ -4713,6 +4789,7 @@ async function runJob(input, opts = {}, fetch2) {
4713
4789
  return err("job", read.stoppedBy, "no job could be read");
4714
4790
  const unread = wanted.filter((id) => !read.jobs.has(id));
4715
4791
  const jobs = wanted.flatMap((id) => read.jobs.get(id) ?? []);
4792
+ if (req.team === true) await addTeams(get, jobs);
4716
4793
  return ok("job", {
4717
4794
  items: shape2(
4718
4795
  jobs,
@@ -5386,8 +5463,8 @@ function loadDrafts() {
5386
5463
  };
5387
5464
  return Array.isArray(loaded.value) ? loaded.value : [];
5388
5465
  }
5389
- async function runDraft(conversation, text5, fetch2, opts = {}) {
5390
- const body = text5?.trim() ?? "";
5466
+ async function runDraft(conversation, text6, fetch2, opts = {}) {
5467
+ const body = text6?.trim() ?? "";
5391
5468
  if (body === "")
5392
5469
  return err(
5393
5470
  "draft",
@@ -5430,8 +5507,8 @@ async function runDraft(conversation, text5, fetch2, opts = {}) {
5430
5507
  notice: "Saved on this machine only. Nothing was sent: open the link, review, and send it yourself."
5431
5508
  });
5432
5509
  }
5433
- function draftText(text5, file) {
5434
- return file !== void 0 ? readFileSync2(file, "utf-8") : text5;
5510
+ function draftText(text6, file) {
5511
+ return file !== void 0 ? readFileSync2(file, "utf-8") : text6;
5435
5512
  }
5436
5513
  function runDrafts(opts = {}) {
5437
5514
  const drafts = loadDrafts();
@@ -5463,6 +5540,225 @@ function runDraftRemove(id) {
5463
5540
  return ok("draft", { removed: id });
5464
5541
  }
5465
5542
 
5543
+ // src/engine/my-items.ts
5544
+ var ITEMS = {
5545
+ posts: "SEARCH_MY_ITEMS_SAVED_POSTS",
5546
+ learning: "SEARCH_MY_ITEMS_LEARNING",
5547
+ jobs: "SEARCH_MY_ITEMS_JOB_SEEKER"
5548
+ };
5549
+ var STAGES = {
5550
+ saved: "SAVED",
5551
+ "in-progress": "IN_PROGRESS",
5552
+ applied: "APPLIED",
5553
+ interview: "INTERVIEW",
5554
+ archived: "ARCHIVED"
5555
+ };
5556
+ var ITEMS_PAGE = 10;
5557
+ function itemsUrl(list2, q2) {
5558
+ const c = CONTRACTS.search;
5559
+ if (c?.queryId === void 0) throw new Error("the 'search' contract is missing");
5560
+ const variables = encodeVariables({
5561
+ start: q2.start,
5562
+ paginationToken: q2.token,
5563
+ query: {
5564
+ flagshipSearchIntent: ITEMS[list2],
5565
+ queryParameters: q2.stage !== void 0 ? [{ key: "cardType", value: [STAGES[q2.stage]] }] : void 0
5566
+ }
5567
+ });
5568
+ return `${c.path}?variables=${variables}&queryId=${c.queryId}`;
5569
+ }
5570
+ var text4 = (v) => {
5571
+ const t = v?.text;
5572
+ return typeof t === "string" && t.trim() !== "" ? t.trim().replace(/\s+/g, " ") : void 0;
5573
+ };
5574
+ var inner = (urn) => String(urn ?? "").match(/\((urn:li:[A-Za-z_]+:[^,)]+)/)?.[1];
5575
+ var clean = (url) => typeof url === "string" && url.startsWith("https://") ? url.split("?")[0] : void 0;
5576
+ var insight = (row) => (Array.isArray(row.insightsResolutionResults) ? row.insightsResolutionResults : []).map((i) => text4(i.simpleInsight?.title)).find((t) => t !== void 0);
5577
+ function defined5(obj) {
5578
+ for (const k of Object.keys(obj)) if (obj[k] === void 0) delete obj[k];
5579
+ return obj;
5580
+ }
5581
+ var WORKPLACE = {
5582
+ remote: "remote",
5583
+ hybrid: "hybrid",
5584
+ "on-site": "on-site"
5585
+ };
5586
+ function postRow(row) {
5587
+ const id = inner(row.entityUrn);
5588
+ if (id === void 0 || !/^urn:li:(activity|ugcPost|share):/.test(id)) return void 0;
5589
+ const posted = text4(row.secondarySubtitle)?.replace(/\s*•\s*$/, "");
5590
+ return defined5({
5591
+ id,
5592
+ url: `https://www.linkedin.com/feed/update/${id}/`,
5593
+ author: text4(row.title),
5594
+ authorHeadline: text4(row.primarySubtitle),
5595
+ posted,
5596
+ text: text4(row.summary)
5597
+ });
5598
+ }
5599
+ function courseRow(row) {
5600
+ const id = inner(row.entityUrn)?.split(":").pop();
5601
+ const name = text4(row.title);
5602
+ if (id === void 0 || name === void 0) return void 0;
5603
+ return defined5({
5604
+ id,
5605
+ name,
5606
+ length: text4(row.primarySubtitle),
5607
+ detail: text4(row.secondarySubtitle),
5608
+ progress: text4(row.summary),
5609
+ url: clean(row.navigationUrl)
5610
+ });
5611
+ }
5612
+ function jobRow(row, stage) {
5613
+ const id = inner(row.entityUrn)?.split(":").pop();
5614
+ const title = text4(row.title);
5615
+ if (id === void 0 || title === void 0) return void 0;
5616
+ const place = text4(row.secondarySubtitle);
5617
+ const m = place?.match(/^(.*?)\s*\(([^()]+)\)$/);
5618
+ const workplace = m?.[2] === void 0 ? void 0 : WORKPLACE[m[2].toLowerCase()];
5619
+ return defined5({
5620
+ id,
5621
+ title,
5622
+ company: text4(row.primarySubtitle),
5623
+ location: workplace !== void 0 ? m?.[1] : place,
5624
+ workplace,
5625
+ stage,
5626
+ note: insight(row),
5627
+ url: `https://www.linkedin.com/jobs/view/${id}/`
5628
+ });
5629
+ }
5630
+ function parseItems(list2, json, stage) {
5631
+ const c = clustersOf(json);
5632
+ if (c === void 0 || !Array.isArray(c.elements))
5633
+ return { ok: false, code: "SCHEMA_DRIFT", message: "the My items list was missing" };
5634
+ const included = json.included ?? [];
5635
+ const toRow = (row) => list2 === "posts" ? postRow(row) : list2 === "learning" ? courseRow(row) : jobRow(row, stage);
5636
+ const { people: items, unresolved } = readItems(
5637
+ c,
5638
+ included,
5639
+ toRow
5640
+ );
5641
+ if (unresolved > 0 && items.length === 0)
5642
+ return {
5643
+ ok: false,
5644
+ code: "SCHEMA_DRIFT",
5645
+ message: `${unresolved} items were listed but none could be read`
5646
+ };
5647
+ const total = typeof c.paging?.total === "number" ? c.paging.total : void 0;
5648
+ const token = c.metadata?.paginationToken;
5649
+ return {
5650
+ ok: true,
5651
+ items,
5652
+ ...total !== void 0 ? { total } : {},
5653
+ ...typeof token === "string" && token !== "" ? { token } : {}
5654
+ };
5655
+ }
5656
+
5657
+ // src/commands/my-items.ts
5658
+ function liveFetch4(quiet) {
5659
+ const session = loadSession();
5660
+ if (session.state !== "ok")
5661
+ return err("my-items", "AUTH_FAILED", "no LinkedIn session \u2014 run `lnrelay login`");
5662
+ const client = createLiveClient(session.session, void 0, quiet);
5663
+ return async (url, spendClass) => {
5664
+ const r = await client.request({ url, spendClass, operation: "my-items" });
5665
+ return r.ok ? { ok: true, json: r.json } : r;
5666
+ };
5667
+ }
5668
+ async function collect2(get, list2, want, stage) {
5669
+ const items = [];
5670
+ let token;
5671
+ for (let start = 0; items.length < want; start += ITEMS_PAGE) {
5672
+ const res = await get(
5673
+ itemsUrl(list2, { start, ...stage ? { stage } : {}, ...token ? { token } : {} }),
5674
+ "page"
5675
+ );
5676
+ const page = res.ok ? parseItems(list2, res.json, stage) : res;
5677
+ if (!page.ok)
5678
+ return items.length === 0 ? page : { items, complete: false, stoppedBy: page.code };
5679
+ const room = want - items.length;
5680
+ items.push(...page.items.slice(0, room));
5681
+ if (page.items.length > room) return { items, complete: false };
5682
+ const last = page.items.length < ITEMS_PAGE || page.total !== void 0 && start + ITEMS_PAGE >= page.total;
5683
+ if (last) return { items, complete: true };
5684
+ token = page.token;
5685
+ }
5686
+ return { items, complete: false };
5687
+ }
5688
+ function compactRow(r) {
5689
+ return line(
5690
+ [
5691
+ r.id,
5692
+ r.title ?? r.name ?? r.author,
5693
+ r.company ?? r.length ?? r.authorHeadline,
5694
+ r.location ?? r.detail ?? r.posted,
5695
+ r.workplace,
5696
+ r.stage,
5697
+ r.note ?? r.progress,
5698
+ typeof r.text === "string" ? r.text.replace(/\s+/g, " ").slice(0, 140) : void 0,
5699
+ r.url
5700
+ ].map((x) => typeof x === "string" ? x : void 0)
5701
+ );
5702
+ }
5703
+ async function collectStages(get, which, want, stages) {
5704
+ const out = { items: [], byStage: {}, complete: true };
5705
+ let failure;
5706
+ for (const stage of stages) {
5707
+ const got = await collect2(get, which, want - out.items.length, stage);
5708
+ if ("ok" in got) {
5709
+ failure = failure ?? got;
5710
+ out.complete = false;
5711
+ out.stoppedBy = got.code;
5712
+ continue;
5713
+ }
5714
+ out.items.push(...got.items);
5715
+ if (stage !== void 0) out.byStage[stage] = got.items.length;
5716
+ out.complete &&= got.complete;
5717
+ if (got.stoppedBy !== void 0) out.stoppedBy = got.stoppedBy;
5718
+ if (out.items.length >= want) break;
5719
+ }
5720
+ if (out.items.length === 0 && failure !== void 0) return { failure };
5721
+ return out;
5722
+ }
5723
+ async function runMyItems(list2, req, opts = {}, fetch2) {
5724
+ if (list2 === void 0 || !(list2 in ITEMS))
5725
+ return err(
5726
+ "my-items",
5727
+ "INVALID_INPUT",
5728
+ `no list '${list2 ?? ""}'`,
5729
+ `one of: ${Object.keys(ITEMS).join(", ")}`
5730
+ );
5731
+ if (req.stage !== void 0 && !(req.stage in STAGES))
5732
+ return err(
5733
+ "my-items",
5734
+ "INVALID_INPUT",
5735
+ `no stage '${req.stage}'`,
5736
+ `one of: ${Object.keys(STAGES).join(", ")}`
5737
+ );
5738
+ const get = fetch2 ?? liveFetch4(opts.quiet === true);
5739
+ if (typeof get !== "function") return get;
5740
+ const want = Math.max(1, req.limit);
5741
+ const which = list2;
5742
+ const stages = which === "jobs" ? req.stage !== void 0 ? [req.stage] : Object.keys(STAGES) : [void 0];
5743
+ const got = await collectStages(get, which, want, stages);
5744
+ if ("failure" in got) {
5745
+ const f = got.failure;
5746
+ return err("my-items", f.code, f.message, f.hint);
5747
+ }
5748
+ const { items, byStage, complete, stoppedBy } = got;
5749
+ return ok("my-items", {
5750
+ list: which,
5751
+ items: shape(items, opts, compactRow),
5752
+ meta: {
5753
+ state: complete && stoppedBy === void 0 ? "complete" : "partial",
5754
+ operation: `my-items ${which}`,
5755
+ returnedCount: items.length,
5756
+ ...which === "jobs" && req.stage === void 0 ? { byStage } : {},
5757
+ ...stoppedBy !== void 0 ? { stoppedBy } : {}
5758
+ }
5759
+ });
5760
+ }
5761
+
5466
5762
  // src/engine/search.ts
5467
5763
  var SEARCH_KINDS = {
5468
5764
  companies: "COMPANIES",
@@ -5483,13 +5779,13 @@ function searchUrl(q2) {
5483
5779
  kind: SEARCH_KINDS[q2.kind]
5484
5780
  });
5485
5781
  }
5486
- var text4 = (v) => {
5782
+ var text5 = (v) => {
5487
5783
  const t = v?.text;
5488
5784
  return typeof t === "string" && t.trim() !== "" ? t.trim().replace(/\s+/g, " ") : void 0;
5489
5785
  };
5490
5786
  function idOf(entityUrn) {
5491
- const inner = String(entityUrn ?? "").match(/\((urn:li:[A-Za-z_]+:[^,)]+)/)?.[1];
5492
- return inner?.split(":").pop();
5787
+ const inner2 = String(entityUrn ?? "").match(/\((urn:li:[A-Za-z_]+:[^,)]+)/)?.[1];
5788
+ return inner2?.split(":").pop();
5493
5789
  }
5494
5790
  function cleanUrl2(nav) {
5495
5791
  if (typeof nav !== "string" || !nav.startsWith("https://")) return void 0;
@@ -5497,13 +5793,13 @@ function cleanUrl2(nav) {
5497
5793
  }
5498
5794
  function rowToFound(row) {
5499
5795
  const id = idOf(row.entityUrn);
5500
- const name = text4(row.title);
5796
+ const name = text5(row.title);
5501
5797
  if (id === void 0 || name === void 0) return void 0;
5502
5798
  const found = { id, name };
5503
5799
  const fields = [
5504
- ["subtitle", text4(row.primarySubtitle)],
5505
- ["detail", text4(row.secondarySubtitle)],
5506
- ["summary", text4(row.summary)],
5800
+ ["subtitle", text5(row.primarySubtitle)],
5801
+ ["detail", text5(row.secondarySubtitle)],
5802
+ ["summary", text5(row.summary)],
5507
5803
  ["url", cleanUrl2(row.navigationUrl)]
5508
5804
  ];
5509
5805
  for (const [k, v] of fields)
@@ -5630,7 +5926,7 @@ function parseSentInvitations(json) {
5630
5926
  }
5631
5927
 
5632
5928
  // src/commands/network.ts
5633
- function liveFetch4(quiet) {
5929
+ function liveFetch5(quiet) {
5634
5930
  const session = loadSession();
5635
5931
  if (session.state !== "ok")
5636
5932
  return err("network", "AUTH_FAILED", "no LinkedIn session \u2014 run `lnrelay login`");
@@ -5643,7 +5939,7 @@ function liveFetch4(quiet) {
5643
5939
  var LISTS = [...Object.keys(HUB), "invitations"];
5644
5940
  var PAGING3 = { pageSize: HUB_PAGE, max: 1e3 };
5645
5941
  var INVITATIONS_PAGE = 10;
5646
- function compactRow(r) {
5942
+ function compactRow2(r) {
5647
5943
  const p = r;
5648
5944
  return line([p.id, p.name, p.headline ?? p.subtitle, p.location ?? p.detail, p.degree, p.url]);
5649
5945
  }
@@ -5703,7 +5999,7 @@ async function runNetwork(list2, req, opts = {}, fetch2) {
5703
5999
  `one of: ${LISTS.join(", ")} \u2014 or none, for the counts`
5704
6000
  );
5705
6001
  }
5706
- const get = fetch2 ?? liveFetch4(opts.quiet === true);
6002
+ const get = fetch2 ?? liveFetch5(opts.quiet === true);
5707
6003
  if (typeof get !== "function") return get;
5708
6004
  if (list2 === void 0) {
5709
6005
  const c = await counts(get);
@@ -5737,7 +6033,7 @@ async function runNetwork(list2, req, opts = {}, fetch2) {
5737
6033
  }
5738
6034
  return ok("network", {
5739
6035
  list: hub,
5740
- items: shape(merged.rows, opts, compactRow),
6036
+ items: shape(merged.rows, opts, compactRow2),
5741
6037
  meta: metaOf(`network ${hub}`, merged, true, first)
5742
6038
  });
5743
6039
  }
@@ -5782,18 +6078,18 @@ async function exchange(code, config, deps) {
5782
6078
  } catch (e) {
5783
6079
  return { ok: false, message: `could not reach LinkedIn: ${e.message}` };
5784
6080
  }
5785
- const text5 = await res.text();
6081
+ const text6 = await res.text();
5786
6082
  if (res.status !== 200) {
5787
6083
  return {
5788
6084
  ok: false,
5789
6085
  message: `LinkedIn rejected the code exchange (${res.status})`,
5790
6086
  // The most common causes, in the order they actually happen.
5791
- hint: `Check that the app has BOTH products added, and that its Auth tab lists exactly ${REDIRECT_URI} as an authorized redirect URL. Response: ${text5.slice(0, 200)}`
6087
+ hint: `Check that the app has BOTH products added, and that its Auth tab lists exactly ${REDIRECT_URI} as an authorized redirect URL. Response: ${text6.slice(0, 200)}`
5792
6088
  };
5793
6089
  }
5794
6090
  let parsed;
5795
6091
  try {
5796
- parsed = JSON.parse(text5);
6092
+ parsed = JSON.parse(text6);
5797
6093
  } catch {
5798
6094
  return { ok: false, message: "token response was not JSON" };
5799
6095
  }
@@ -6027,7 +6323,7 @@ function runOauthStatus() {
6027
6323
  }
6028
6324
 
6029
6325
  // src/commands/posts-search.ts
6030
- function liveFetch5(quiet) {
6326
+ function liveFetch6(quiet) {
6031
6327
  const session = loadSession();
6032
6328
  if (session.state !== "ok")
6033
6329
  return err("search posts", "AUTH_FAILED", "no LinkedIn session \u2014 run `lnrelay login`");
@@ -6159,13 +6455,13 @@ function compactPost(p) {
6159
6455
  p.comments !== void 0 ? `${p.comments} comments` : void 0,
6160
6456
  p.reposts !== void 0 ? `${p.reposts} reposts` : void 0
6161
6457
  ].filter(Boolean);
6162
- const text5 = p.text?.replace(/\s+/g, " ");
6458
+ const text6 = p.text?.replace(/\s+/g, " ");
6163
6459
  return line([
6164
6460
  p.id,
6165
6461
  p.author,
6166
6462
  p.posted,
6167
6463
  counts2.length > 0 ? counts2.join(" \xB7 ") : void 0,
6168
- text5 !== void 0 && text5.length > 160 ? `${text5.slice(0, 157)}\u2026` : text5,
6464
+ text6 !== void 0 && text6.length > 160 ? `${text6.slice(0, 157)}\u2026` : text6,
6169
6465
  p.url,
6170
6466
  p.matched !== void 0 ? `matched: ${p.matched.join(" + ")}` : void 0
6171
6467
  ]);
@@ -6183,7 +6479,7 @@ async function runPostsSearch(req, opts = {}, fetch2) {
6183
6479
  "give keywords, a filter, or both",
6184
6480
  'lnrelay search posts "<keywords>"'
6185
6481
  );
6186
- const get = fetch2 ?? liveFetch5(opts.quiet === true);
6482
+ const get = fetch2 ?? liveFetch6(opts.quiet === true);
6187
6483
  if (typeof get !== "function") return get;
6188
6484
  const f = await filtersOf(req, get);
6189
6485
  if ("ok" in f) return err(command, f.code, f.message, f.hint);
@@ -6334,9 +6630,9 @@ var COMMANDS = [
6334
6630
  },
6335
6631
  {
6336
6632
  name: "job",
6337
- cost: "1 job read per 100 jobs",
6338
- summary: "Jobs in full: description, apply link (external or Easy Apply), applicants, state. Several ids are read together, 100 a call.",
6339
- usage: "lnrelay job <id|job-url> [<id|job-url> ...] [--compact | --fields a,b,c]",
6633
+ cost: "1 job read per 100 jobs; --team adds 1 page call per job",
6634
+ summary: "Jobs in full: description, apply link (external or Easy Apply), applicants, state. Several ids are read together, 100 a call. --team adds who posted it and who is hiring.",
6635
+ usage: "lnrelay job <id|job-url> [<id|job-url> ...] [--team] [--compact | --fields a,b,c]",
6340
6636
  audience: ["cli", "mcp"],
6341
6637
  risk: "read",
6342
6638
  implemented: true
@@ -6414,6 +6710,15 @@ var COMMANDS = [
6414
6710
  risk: "read",
6415
6711
  implemented: true
6416
6712
  },
6713
+ {
6714
+ name: "my-items",
6715
+ cost: "1 page call per 10 items; jobs with no --stage read all 5 stages",
6716
+ summary: "Your My items: saved posts, LinkedIn Learning courses, and the job tracker (saved, in progress, applied, interview, archived).",
6717
+ usage: "lnrelay my-items posts|learning|jobs [--stage saved|in-progress|applied|interview|archived]\n [--limit N] [--compact | --fields a,b,c]",
6718
+ audience: ["cli", "mcp"],
6719
+ risk: "read",
6720
+ implemented: true
6721
+ },
6417
6722
  {
6418
6723
  name: "events",
6419
6724
  cost: "1 page call",
@@ -6786,10 +7091,10 @@ function listPositions(stream) {
6786
7091
  for (; ; ) {
6787
7092
  i = stream.indexOf(EDIT_NAV, i);
6788
7093
  if (i === -1) break;
6789
- const text5 = balanced(stream, i);
7094
+ const text6 = balanced(stream, i);
6790
7095
  i += EDIT_NAV.length;
6791
- if (text5 === null) continue;
6792
- const payload = JSON.parse(text5).requestedArguments?.payload;
7096
+ if (text6 === null) continue;
7097
+ const payload = JSON.parse(text6).requestedArguments?.payload;
6793
7098
  const id = payload?.positionId;
6794
7099
  if (typeof id !== "string" || seen.has(id) || payload === void 0) continue;
6795
7100
  seen.add(id);
@@ -6992,9 +7297,9 @@ async function send(url, body, token, deps) {
6992
7297
  } catch (e) {
6993
7298
  return { ok: false, code: "FETCH_FAILED", message: e.message };
6994
7299
  }
6995
- const text5 = await res.text();
7300
+ const text6 = await res.text();
6996
7301
  if (res.status === 201 || res.status === 200) {
6997
- const id = res.headers.get("x-restli-id") ?? extractId(text5);
7302
+ const id = res.headers.get("x-restli-id") ?? extractId(text6);
6998
7303
  return {
6999
7304
  ok: true,
7000
7305
  id: id ?? "(unknown)",
@@ -7021,7 +7326,7 @@ async function send(url, body, token, deps) {
7021
7326
  ok: false,
7022
7327
  code: "FETCH_FAILED",
7023
7328
  message: `write failed (${res.status})`,
7024
- hint: text5.slice(0, 300)
7329
+ hint: text6.slice(0, 300)
7025
7330
  };
7026
7331
  }
7027
7332
  function extractId(body) {
@@ -7069,7 +7374,7 @@ function feedTypeFor(bindingKey) {
7069
7374
  function stateKey(prefix, body) {
7070
7375
  return `${prefix}-${body}`;
7071
7376
  }
7072
- function states(text5, body) {
7377
+ function states(text6, body) {
7073
7378
  return STATE_PREFIXES.map((prefix) => {
7074
7379
  const key = stateKey(prefix, body);
7075
7380
  const base = {
@@ -7078,19 +7383,19 @@ function states(text5, body) {
7078
7383
  protoKey: { $type: "proto.sdui.Key", value: { $case: "id", id: key } }
7079
7384
  };
7080
7385
  if (prefix === "commentBoxText") {
7081
- return { ...base, value: text5, originalProtoCase: "stringValue" };
7386
+ return { ...base, value: text6, originalProtoCase: "stringValue" };
7082
7387
  }
7083
7388
  if (prefix === "richCommentBoxText") {
7084
7389
  return {
7085
7390
  ...base,
7086
- value: { text: text5, attribute: [], $type: "TextModel", source: "local" },
7391
+ value: { text: text6, attribute: [], $type: "TextModel", source: "local" },
7087
7392
  originalProtoCase: "textModelForWrite"
7088
7393
  };
7089
7394
  }
7090
7395
  return { ...base, value: "", originalProtoCase: "stringValue" };
7091
7396
  });
7092
7397
  }
7093
- function commentBody(activityId, text5, tokens, feedType) {
7398
+ function commentBody(activityId, text6, tokens, feedType) {
7094
7399
  const body = keyBody(tokens.bindingKey);
7095
7400
  const activityUrn = { activityUrn: { activityId } };
7096
7401
  const binding = (prefix) => ({
@@ -7137,17 +7442,17 @@ function commentBody(activityId, text5, tokens, feedType) {
7137
7442
  isStreaming: false,
7138
7443
  rumPageKey: ""
7139
7444
  },
7140
- states: states(text5, body),
7445
+ states: states(text6, body),
7141
7446
  requestedArguments: {
7142
7447
  ...args,
7143
- states: states(text5, body),
7448
+ states: states(text6, body),
7144
7449
  screenId: SCREEN_ID3,
7145
7450
  knownTemplateIds: []
7146
7451
  }
7147
7452
  };
7148
7453
  }
7149
7454
  async function comment(confirmed, client) {
7150
- const { activityId, text: text5, tokens } = confirmed.payload;
7455
+ const { activityId, text: text6, tokens } = confirmed.payload;
7151
7456
  if (!keyMatchesPost(tokens.bindingKey, activityId)) {
7152
7457
  return {
7153
7458
  ok: false,
@@ -7168,7 +7473,7 @@ async function comment(confirmed, client) {
7168
7473
  const result = await client.request({
7169
7474
  url: COMMENT_URL,
7170
7475
  method: "POST",
7171
- body: commentBody(activityId, text5, tokens, feedType),
7476
+ body: commentBody(activityId, text6, tokens, feedType),
7172
7477
  spendClass: "write",
7173
7478
  operation: "comment.create"
7174
7479
  });
@@ -7292,10 +7597,10 @@ var REPLY_URL = `https://www.linkedin.com/voyager/api/voyagerSocialDashNormComme
7292
7597
  function parentThreadUrn(ref) {
7293
7598
  return `urn:li:comment:(${ref.threadType}:${ref.activityId},${ref.commentId})`;
7294
7599
  }
7295
- function replyBody(ref, text5) {
7600
+ function replyBody(ref, text6) {
7296
7601
  return {
7297
7602
  commentary: {
7298
- text: text5,
7603
+ text: text6,
7299
7604
  // The captured reply carried a profileMention, because LinkedIn's UI
7300
7605
  // pre-fills "@Author " into the box. We send none: an @mention notifies a
7301
7606
  // real person, and inventing one would put words — and a notification —
@@ -7307,11 +7612,11 @@ function replyBody(ref, text5) {
7307
7612
  };
7308
7613
  }
7309
7614
  async function replyToComment(confirmed, client) {
7310
- const { ref, text: text5 } = confirmed.payload;
7615
+ const { ref, text: text6 } = confirmed.payload;
7311
7616
  const result = await client.request({
7312
7617
  url: REPLY_URL,
7313
7618
  method: "POST",
7314
- body: replyBody(ref, text5),
7619
+ body: replyBody(ref, text6),
7315
7620
  spendClass: "write",
7316
7621
  operation: "reply"
7317
7622
  });
@@ -7673,8 +7978,8 @@ function whenLine(at, now) {
7673
7978
  const away = hours < 48 ? `in ${hours} h` : `in ${Math.round(hours / 24)} days`;
7674
7979
  return `when ${local} (${zone}) \u2014 ${away}`;
7675
7980
  }
7676
- async function runShare(text5, visibility, now = Date.now(), deps = terminalDeps(), via2, media, at, poll, link = {}) {
7677
- if (text5 === void 0 || text5.trim() === "") {
7981
+ async function runShare(text6, visibility, now = Date.now(), deps = terminalDeps(), via2, media, at, poll, link = {}) {
7982
+ if (text6 === void 0 || text6.trim() === "") {
7678
7983
  return err("share", "INVALID_INPUT", "text is required", 'lnrelay share "<text>"');
7679
7984
  }
7680
7985
  const vis = visibility === "connections" ? "CONNECTIONS" : "PUBLIC";
@@ -7689,7 +7994,7 @@ async function runShare(text5, visibility, now = Date.now(), deps = terminalDeps
7689
7994
  via: via2
7690
7995
  });
7691
7996
  if (pollSpec !== void 0 && "ok" in pollSpec) return pollSpec;
7692
- const cardUrl = link.card !== false && loaded === void 0 && pollSpec === void 0 && via2 !== "oauth" ? firstUrl(text5) : null;
7997
+ const cardUrl = link.card !== false && loaded === void 0 && pollSpec === void 0 && via2 !== "oauth" ? firstUrl(text6) : null;
7693
7998
  const needs = shareNeeds(loaded?.approved.length, scheduledAt, pollSpec, cardUrl);
7694
7999
  const ctx = prepare("share", now, needs.voyagerOnly ? "voyager" : via2, needs.calls);
7695
8000
  if ("ok" in ctx) return ctx;
@@ -7698,7 +8003,7 @@ async function runShare(text5, visibility, now = Date.now(), deps = terminalDeps
7698
8003
  const plan = sharePlan({
7699
8004
  author: authorLine(ctx.transport),
7700
8005
  transport: ctx.transport.kind,
7701
- text: text5,
8006
+ text: text6,
7702
8007
  visibility: vis,
7703
8008
  media: loaded?.approved,
7704
8009
  scheduledAt,
@@ -7721,7 +8026,7 @@ async function runShare(text5, visibility, now = Date.now(), deps = terminalDeps
7721
8026
  note: "note" in result ? result.note : ctx.note
7722
8027
  });
7723
8028
  }
7724
- async function runEditPost(urn, text5, now, deps) {
8029
+ async function runEditPost(urn, text6, now, deps) {
7725
8030
  const unapprovable = refuseUnapprovable("edit", "editing", deps);
7726
8031
  if (unapprovable !== null) return unapprovable;
7727
8032
  const ctx = prepare("edit", now, "voyager");
@@ -7736,12 +8041,12 @@ async function runEditPost(urn, text5, now, deps) {
7736
8041
  const before = await lookup(urn, true);
7737
8042
  const plan = {
7738
8043
  action: "edit your post",
7739
- payload: { urn, text: text5 },
8044
+ payload: { urn, text: text6 },
7740
8045
  summary: [
7741
8046
  authorLine(ctx.transport),
7742
8047
  `post ${urn}`,
7743
8048
  ...previewLines2(before).map((l) => l.replace(/^content /, "was ")),
7744
- `new text "${text5}"`
8049
+ `new text "${text6}"`
7745
8050
  ],
7746
8051
  reversibility: "editable again, but the previous text is NOT kept here, LinkedIn marks the post as edited, and an @mention in the old text is not carried over",
7747
8052
  transport: "voyager"
@@ -7765,7 +8070,7 @@ function liveProfile(session) {
7765
8070
  };
7766
8071
  }
7767
8072
  var PROFILE_HINT = `profile fields: ${Object.keys(PROFILE_FIELDS).join(", ")}`;
7768
- async function runEditProfile(name, text5, now = Date.now(), deps = terminalDeps(), surface) {
8073
+ async function runEditProfile(name, text6, now = Date.now(), deps = terminalDeps(), surface) {
7769
8074
  const field = PROFILE_FIELDS[name];
7770
8075
  if (field === void 0) {
7771
8076
  return err(
@@ -7775,7 +8080,7 @@ async function runEditProfile(name, text5, now = Date.now(), deps = terminalDeps
7775
8080
  PROFILE_HINT
7776
8081
  );
7777
8082
  }
7778
- if (text5 === void 0 || text5.trim() === "") {
8083
+ if (text6 === void 0 || text6.trim() === "") {
7779
8084
  return err(
7780
8085
  "edit",
7781
8086
  "INVALID_INPUT",
@@ -7783,11 +8088,11 @@ async function runEditProfile(name, text5, now = Date.now(), deps = terminalDeps
7783
8088
  `lnrelay edit ${name} "<text>"`
7784
8089
  );
7785
8090
  }
7786
- if (text5.length > field.maxLength) {
8091
+ if (text6.length > field.maxLength) {
7787
8092
  return err(
7788
8093
  "edit",
7789
8094
  "INVALID_INPUT",
7790
- `the ${name} is ${text5.length} characters; LinkedIn allows ${field.maxLength}`
8095
+ `the ${name} is ${text6.length} characters; LinkedIn allows ${field.maxLength}`
7791
8096
  );
7792
8097
  }
7793
8098
  const unapprovable = refuseUnapprovable("edit", "editing", deps);
@@ -7803,19 +8108,19 @@ async function runEditProfile(name, text5, now = Date.now(), deps = terminalDeps
7803
8108
  const form = await profile.open(field, me.vanity);
7804
8109
  if (!form.ok) return err("edit", form.code, form.message, form.hint);
7805
8110
  const was = currentValue(form, field) ?? "";
7806
- if (was === text5) {
8111
+ if (was === text6) {
7807
8112
  return err("edit", "INVALID_INPUT", `your ${name} already reads exactly that; nothing to save`);
7808
8113
  }
7809
- const built = saveBody(form, field, text5);
8114
+ const built = saveBody(form, field, text6);
7810
8115
  if (!built.ok) return err("edit", built.code, built.message, built.hint);
7811
8116
  const plan = {
7812
8117
  action: `change your ${name}`,
7813
- payload: { field: name, was, text: text5 },
8118
+ payload: { field: name, was, text: text6 },
7814
8119
  summary: [
7815
8120
  authorLine(ctx.transport),
7816
8121
  `field ${name}`,
7817
8122
  `was "${was}"`,
7818
- `new "${text5}"`
8123
+ `new "${text6}"`
7819
8124
  ],
7820
8125
  reversibility: "editable again, but the old text is kept only in this preview and the audit log (~/.lnrelay/writes.jsonl). Every other profile field is sent back as LinkedIn holds it.",
7821
8126
  transport: "voyager"
@@ -7826,7 +8131,7 @@ async function runEditProfile(name, text5, now = Date.now(), deps = terminalDeps
7826
8131
  if (!sent.ok) return err("edit", sent.code, sent.message, sent.hint);
7827
8132
  const after = await profile.open(field, me.vanity);
7828
8133
  const reads = after.ok ? currentValue(after, field) : void 0;
7829
- if (reads !== text5) {
8134
+ if (reads !== text6) {
7830
8135
  return err(
7831
8136
  "edit",
7832
8137
  "SCHEMA_DRIFT",
@@ -7865,8 +8170,8 @@ async function harvest(activityId, session, now) {
7865
8170
  if (!found.ok) return err("comment", "SCHEMA_DRIFT", found.message, found.hint);
7866
8171
  return { ok: true, tokens: { bindingKey: found.bindingKey, trackingId: found.trackingId } };
7867
8172
  }
7868
- async function runComment(postUrn2, text5, now = Date.now(), deps = terminalDeps()) {
7869
- if (postUrn2 === void 0 || text5 === void 0 || text5.trim() === "") {
8173
+ async function runComment(postUrn2, text6, now = Date.now(), deps = terminalDeps()) {
8174
+ if (postUrn2 === void 0 || text6 === void 0 || text6.trim() === "") {
7870
8175
  return err(
7871
8176
  "comment",
7872
8177
  "INVALID_INPUT",
@@ -7903,11 +8208,11 @@ async function runComment(postUrn2, text5, now = Date.now(), deps = terminalDeps
7903
8208
  if (!("tokens" in harvested)) return harvested;
7904
8209
  const plan = {
7905
8210
  action: "comment on a post",
7906
- payload: { activityId, text: text5, tokens: harvested.tokens },
8211
+ payload: { activityId, text: text6, tokens: harvested.tokens },
7907
8212
  // The harvested trackingId changes on every render, so --plan and --confirm
7908
8213
  // would never agree on a token derived from it. The intent is what's approved.
7909
- tokenBasis: { activityId, text: text5 },
7910
- summary: [authorLine(ctx.transport), `on ${postUrn2}`, `content "${text5}"`],
8214
+ tokenBasis: { activityId, text: text6 },
8215
+ summary: [authorLine(ctx.transport), `on ${postUrn2}`, `content "${text6}"`],
7911
8216
  reversibility: "deletable with `lnrelay delete <comment-urn>`; the author is notified immediately",
7912
8217
  transport: "voyager"
7913
8218
  };
@@ -7919,8 +8224,8 @@ async function runComment(postUrn2, text5, now = Date.now(), deps = terminalDeps
7919
8224
  );
7920
8225
  return result.ok ? ok("comment", { on: postUrn2 }) : err("comment", result.code, result.message, result.hint);
7921
8226
  }
7922
- async function runEdit(commentUrn, text5, now = Date.now(), deps = terminalDeps()) {
7923
- if (commentUrn === void 0 || text5 === void 0 || text5.trim() === "") {
8227
+ async function runEdit(commentUrn, text6, now = Date.now(), deps = terminalDeps()) {
8228
+ if (commentUrn === void 0 || text6 === void 0 || text6.trim() === "") {
7924
8229
  return err(
7925
8230
  "edit",
7926
8231
  "INVALID_INPUT",
@@ -7930,11 +8235,11 @@ async function runEdit(commentUrn, text5, now = Date.now(), deps = terminalDeps(
7930
8235
  }
7931
8236
  const ref = parseCommentUrn(commentUrn);
7932
8237
  if (ref === null && !commentUrn.startsWith("urn:")) {
7933
- return runEditProfile(commentUrn, text5, now, deps);
8238
+ return runEditProfile(commentUrn, text6, now, deps);
7934
8239
  }
7935
8240
  if (ref === null) {
7936
8241
  if (/^urn:li:(share|ugcPost):\d+$/.test(commentUrn)) {
7937
- return runEditPost(commentUrn, text5, now, deps);
8242
+ return runEditPost(commentUrn, text6, now, deps);
7938
8243
  }
7939
8244
  return err(
7940
8245
  "edit",
@@ -7954,8 +8259,8 @@ async function runEdit(commentUrn, text5, now = Date.now(), deps = terminalDeps(
7954
8259
  if (!("tokens" in harvested)) return harvested;
7955
8260
  const plan = {
7956
8261
  action: "edit your comment",
7957
- payload: { urn: commentUrn, text: text5 },
7958
- summary: [authorLine(ctx.transport), `comment ${commentUrn}`, `new text "${text5}"`],
8262
+ payload: { urn: commentUrn, text: text6 },
8263
+ summary: [authorLine(ctx.transport), `comment ${commentUrn}`, `new text "${text6}"`],
7959
8264
  reversibility: "editable again, but the previous text is NOT recoverable here and LinkedIn marks the comment as edited",
7960
8265
  transport: "voyager"
7961
8266
  };
@@ -7966,7 +8271,7 @@ async function runEdit(commentUrn, text5, now = Date.now(), deps = terminalDeps(
7966
8271
  UPDATE_OP,
7967
8272
  harvested.tokens.trackingId,
7968
8273
  createLiveClient(ctx.transport.session),
7969
- text5
8274
+ text6
7970
8275
  );
7971
8276
  return result.ok ? ok("edit", { edited: commentUrn }) : err("edit", result.code, result.message, result.hint);
7972
8277
  }
@@ -8010,8 +8315,8 @@ async function runReact(postUrn2, type, now = Date.now(), deps = terminalDeps(),
8010
8315
  const result = await react(gated.confirmed, createLiveClient(ctx.transport.session));
8011
8316
  return result.ok ? ok("react", { id: result.id, removed: remove }) : err("react", result.code, result.message, result.hint);
8012
8317
  }
8013
- async function runReply(commentUrn, text5, now = Date.now(), deps = terminalDeps()) {
8014
- if (commentUrn === void 0 || text5 === void 0 || text5.trim() === "") {
8318
+ async function runReply(commentUrn, text6, now = Date.now(), deps = terminalDeps()) {
8319
+ if (commentUrn === void 0 || text6 === void 0 || text6.trim() === "") {
8015
8320
  return err(
8016
8321
  "reply",
8017
8322
  "INVALID_INPUT",
@@ -8037,8 +8342,8 @@ async function runReply(commentUrn, text5, now = Date.now(), deps = terminalDeps
8037
8342
  }
8038
8343
  const plan = {
8039
8344
  action: "reply to a comment",
8040
- payload: { ref: parent, text: text5 },
8041
- summary: [authorLine(ctx.transport), `replying to ${commentUrn}`, `content "${text5}"`],
8345
+ payload: { ref: parent, text: text6 },
8346
+ summary: [authorLine(ctx.transport), `replying to ${commentUrn}`, `content "${text6}"`],
8042
8347
  reversibility: "deletable with `lnrelay delete <the reply urn>`; the comment author is notified immediately",
8043
8348
  transport: "voyager"
8044
8349
  };
@@ -8481,11 +8786,11 @@ function skillsFromPage(stream) {
8481
8786
  for (; ; ) {
8482
8787
  i = stream.indexOf(EDIT_NAV2, i);
8483
8788
  if (i === -1) break;
8484
- const text5 = balanced(stream, i);
8789
+ const text6 = balanced(stream, i);
8485
8790
  const end = i;
8486
8791
  i += EDIT_NAV2.length;
8487
- if (text5 === null) continue;
8488
- const payload = JSON.parse(text5).requestedArguments?.payload;
8792
+ if (text6 === null) continue;
8793
+ const payload = JSON.parse(text6).requestedArguments?.payload;
8489
8794
  const id = payload?.skillId;
8490
8795
  if (typeof id !== "string" || payload === void 0 || skills.some((s) => s.skillId === id))
8491
8796
  continue;
@@ -8493,7 +8798,7 @@ function skillsFromPage(stream) {
8493
8798
  (m) => JSON.parse(`"${m[1]}"`)
8494
8799
  );
8495
8800
  skills.push({ skillId: id, name: names.length === 1 ? names[0] ?? null : null, payload });
8496
- from = end + text5.length;
8801
+ from = end + text6.length;
8497
8802
  }
8498
8803
  return { ok: true, skills };
8499
8804
  }
@@ -8562,9 +8867,9 @@ async function fetchSkills(vanityName, client) {
8562
8867
  if (typeof screen !== "string") return screen;
8563
8868
  const at = screen.indexOf('"filter":"ProfileSkillCategory_ALL"');
8564
8869
  const open = at === -1 ? -1 : screen.lastIndexOf('"payload":{', at);
8565
- const text5 = open === -1 ? null : balanced(screen, open + '"payload":'.length);
8566
- if (text5 === null) return drift6("the Skills screen carried no list request");
8567
- const payload = JSON.parse(text5);
8870
+ const text6 = open === -1 ? null : balanced(screen, open + '"payload":'.length);
8871
+ if (text6 === null) return drift6("the Skills screen carried no list request");
8872
+ const payload = JSON.parse(text6);
8568
8873
  const count3 = typeof payload.count === "number" ? payload.count : 10;
8569
8874
  const skills = [];
8570
8875
  for (let page = 0; page < MAX_PAGES2; page++) {
@@ -9083,6 +9388,17 @@ function mine(command, args) {
9083
9388
  output(args)
9084
9389
  );
9085
9390
  if (command === "event") return runEvent(args.positionals, output(args));
9391
+ if (command === "my-items") {
9392
+ const stage = str(args, "stage");
9393
+ return runMyItems(
9394
+ args.positionals[0],
9395
+ {
9396
+ limit: num(args, "limit") ?? 50,
9397
+ ...stage !== void 0 ? { stage } : {}
9398
+ },
9399
+ output(args)
9400
+ );
9401
+ }
9086
9402
  const start = num(args, "start");
9087
9403
  return runNetwork(
9088
9404
  args.positionals[0],
@@ -9223,7 +9539,7 @@ async function dispatch(argv, now) {
9223
9539
  case "jobs":
9224
9540
  return runJobs(jobsRequest(args), output(args));
9225
9541
  case "job":
9226
- return runJob(args.positionals, output(args));
9542
+ return runJob(args.positionals, output(args), void 0, { team: bool(args, "team") });
9227
9543
  case "job-filters":
9228
9544
  return runJobFilters(jobsRequest(args), output(args));
9229
9545
  case "people":
@@ -9232,6 +9548,7 @@ async function dispatch(argv, now) {
9232
9548
  return runPeopleFilters(peopleRequest(args), output(args));
9233
9549
  case "events":
9234
9550
  case "event":
9551
+ case "my-items":
9235
9552
  case "network":
9236
9553
  return mine(command, args);
9237
9554
  case "inbox":
@@ -9293,13 +9610,13 @@ function edit(args, now, deps) {
9293
9610
  if (inline !== void 0) {
9294
9611
  return err("edit", "INVALID_INPUT", "pass the new text inline or with --file, not both");
9295
9612
  }
9296
- let text5;
9613
+ let text6;
9297
9614
  try {
9298
- text5 = readFileSync4(file, "utf-8").replace(/\n$/, "");
9615
+ text6 = readFileSync4(file, "utf-8").replace(/\n$/, "");
9299
9616
  } catch {
9300
9617
  return err("edit", "INVALID_INPUT", `cannot read ${file}`);
9301
9618
  }
9302
- return runEdit(target, text5, now, deps);
9619
+ return runEdit(target, text6, now, deps);
9303
9620
  }
9304
9621
  function role(args, now, deps) {
9305
9622
  const [sub, target] = args.positionals;