linkedin-relay-mcp 3.26.0 → 3.27.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/.claude/skills/linkedin-relay/SKILL.md +11 -0
- package/README.md +2 -0
- package/dist/cli.js +285 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp-shim.js +296 -22
- package/dist/mcp-shim.js.map +1 -1
- package/package.json +1 -1
package/dist/mcp-shim.js
CHANGED
|
@@ -813,6 +813,24 @@ var CONTRACTS = {
|
|
|
813
813
|
provenance: "verified",
|
|
814
814
|
capturedAt: "2026-11-22"
|
|
815
815
|
},
|
|
816
|
+
// LinkedIn's AI assistant, as a job's "Show match details" asks it
|
|
817
|
+
// (2026-11-22). See engine/job-premium.ts.
|
|
818
|
+
guideMessage: {
|
|
819
|
+
name: "guideMessage",
|
|
820
|
+
transport: "voyager-graphql",
|
|
821
|
+
path: `${VOYAGER}/graphql`,
|
|
822
|
+
queryId: "voyagerGuideDashMessage.7eaf64013d9f7cc6c5c32038dfc3fb81",
|
|
823
|
+
provenance: "verified",
|
|
824
|
+
capturedAt: "2026-11-22"
|
|
825
|
+
},
|
|
826
|
+
guideMessages: {
|
|
827
|
+
name: "guideMessages",
|
|
828
|
+
transport: "voyager-graphql",
|
|
829
|
+
path: `${VOYAGER}/graphql`,
|
|
830
|
+
queryId: "voyagerGuideDashBionicMessageV2.6c3ccc4bfc5030c09d28a50e5332ac06",
|
|
831
|
+
provenance: "verified",
|
|
832
|
+
capturedAt: "2026-11-22"
|
|
833
|
+
},
|
|
816
834
|
jobPosting: {
|
|
817
835
|
name: "jobPosting",
|
|
818
836
|
transport: "voyager-restli",
|
|
@@ -1282,6 +1300,8 @@ function encodeBody(spec) {
|
|
|
1282
1300
|
async function fetchRaw(spec, session, deps) {
|
|
1283
1301
|
const requestHeaders = buildHeaders(session);
|
|
1284
1302
|
if (spec.body !== void 0) requestHeaders["content-type"] = "application/json; charset=UTF-8";
|
|
1303
|
+
if (spec.url.includes("linkedin.com/flagship-web/"))
|
|
1304
|
+
requestHeaders.referer = "https://www.linkedin.com/feed/";
|
|
1285
1305
|
Object.assign(requestHeaders, spec.headers);
|
|
1286
1306
|
const body = encodeBody(spec);
|
|
1287
1307
|
try {
|
|
@@ -3856,6 +3876,164 @@ function parseJobInsights(json) {
|
|
|
3856
3876
|
unknownSections
|
|
3857
3877
|
};
|
|
3858
3878
|
}
|
|
3879
|
+
var HEAR_BACK_PAGE = 25;
|
|
3880
|
+
var SEARCH_RESULTS = "https://www.linkedin.com/flagship-web/jobs/search-results/";
|
|
3881
|
+
var HEAR_BACK_HEADERS = {
|
|
3882
|
+
"x-li-rsc-stream": "true",
|
|
3883
|
+
referer: "https://www.linkedin.com/jobs/"
|
|
3884
|
+
};
|
|
3885
|
+
function hearBackUrl(start) {
|
|
3886
|
+
return `${SEARCH_RESULTS}?showHowYouFit=HOW_YOU_FIT&origin=QUALIFICATION_LANDING&start=${start}`;
|
|
3887
|
+
}
|
|
3888
|
+
function hearBackBody() {
|
|
3889
|
+
return {
|
|
3890
|
+
requestedArguments: {
|
|
3891
|
+
payload: {
|
|
3892
|
+
showHowYouFit: "HOW_YOU_FIT",
|
|
3893
|
+
shouldHideLoadingSpinner: true,
|
|
3894
|
+
origin: "JobSearchOrigin_QUALIFICATION_LANDING"
|
|
3895
|
+
},
|
|
3896
|
+
states: [],
|
|
3897
|
+
requestMetadata: { $type: "proto.sdui.common.RequestMetadata" },
|
|
3898
|
+
screenId: "com.linkedin.sdui.flagshipnav.jobs.SemanticJobDetails",
|
|
3899
|
+
knownTemplateIds: []
|
|
3900
|
+
}
|
|
3901
|
+
};
|
|
3902
|
+
}
|
|
3903
|
+
function parseJobIds(stream) {
|
|
3904
|
+
if (/^\s*</.test(stream)) return drift4("LinkedIn answered the page, not its data");
|
|
3905
|
+
const ids = [...stream.matchAll(/job-card-component-ref-(\d+)/g)].map((m) => m[1]);
|
|
3906
|
+
return { ok: true, ids: [...new Set(ids)] };
|
|
3907
|
+
}
|
|
3908
|
+
var HOW_YOU_FIT = "com.linkedin.sdui.generated.jobseeker.dsl.impl.howYouFitGuide";
|
|
3909
|
+
var HOW_YOU_FIT_URL = `https://www.linkedin.com/flagship-web/rsc-action/actions/component?componentId=${HOW_YOU_FIT}&sduiid=${HOW_YOU_FIT}`;
|
|
3910
|
+
function howYouFitBody(jobId) {
|
|
3911
|
+
const key = `jdpApplyState_${jobId}`;
|
|
3912
|
+
return {
|
|
3913
|
+
componentId: HOW_YOU_FIT,
|
|
3914
|
+
clientArguments: {
|
|
3915
|
+
payload: { jobId, isPremium: true, applyState: { key, namespace: "MemoryNamespace" } },
|
|
3916
|
+
states: [
|
|
3917
|
+
{
|
|
3918
|
+
key,
|
|
3919
|
+
namespace: "MemoryNamespace",
|
|
3920
|
+
value: "Initial",
|
|
3921
|
+
originalProtoCase: "stringValue",
|
|
3922
|
+
protoKey: { $type: "proto.sdui.Key", value: { $case: "id", id: key } }
|
|
3923
|
+
}
|
|
3924
|
+
],
|
|
3925
|
+
requestMetadata: { $type: "proto.sdui.common.RequestMetadata" },
|
|
3926
|
+
screenId: "com.linkedin.sdui.flagshipnav.jobs.SemanticJobDetails",
|
|
3927
|
+
knownTemplateIds: []
|
|
3928
|
+
}
|
|
3929
|
+
};
|
|
3930
|
+
}
|
|
3931
|
+
var FIT = "JobSeekerAgentIntent_JOB_FIT_EXPLANATION";
|
|
3932
|
+
function parseMatchLink(stream, jobId) {
|
|
3933
|
+
for (const m of stream.matchAll(/"url":"(\/preload\/guideOverlay\/\?[^"]*)"/g)) {
|
|
3934
|
+
const q = new URL(`https://www.linkedin.com${m[1]}`).searchParams;
|
|
3935
|
+
const customContext = (q.get("customContext") ?? "").split(",").flatMap((pair) => {
|
|
3936
|
+
const at = pair.indexOf("~:");
|
|
3937
|
+
return at === -1 ? [] : [{ key: pair.slice(0, at), value: pair.slice(at + 2) }];
|
|
3938
|
+
});
|
|
3939
|
+
const sub = customContext.find((c) => c.key === "subIntent")?.value;
|
|
3940
|
+
const job = customContext.find((c) => c.key === "jobPostingId")?.value;
|
|
3941
|
+
const query = q.get("query");
|
|
3942
|
+
const mailbox2 = q.get("originalThreadMailbox");
|
|
3943
|
+
if (sub !== FIT || job !== jobId || query === null || mailbox2 === null) continue;
|
|
3944
|
+
return {
|
|
3945
|
+
ok: true,
|
|
3946
|
+
link: {
|
|
3947
|
+
query,
|
|
3948
|
+
intent: q.get("intent") ?? "GuideIntent_JOB_SEEKING_AGENT",
|
|
3949
|
+
mailbox: mailbox2,
|
|
3950
|
+
contextUrns: (q.get("contextUrns") ?? "").split(",").filter((u) => u !== ""),
|
|
3951
|
+
customContext
|
|
3952
|
+
}
|
|
3953
|
+
};
|
|
3954
|
+
}
|
|
3955
|
+
return {
|
|
3956
|
+
ok: false,
|
|
3957
|
+
code: "NOT_FOUND",
|
|
3958
|
+
message: "the job offers no match details (Premium only, and not on every job)"
|
|
3959
|
+
};
|
|
3960
|
+
}
|
|
3961
|
+
var randomId = () => String.fromCharCode(...crypto.getRandomValues(new Uint8Array(16)));
|
|
3962
|
+
function matchMessageUrl() {
|
|
3963
|
+
const c = graphql("guideMessage");
|
|
3964
|
+
return `${c.path}?action=execute&queryId=${c.queryId}`;
|
|
3965
|
+
}
|
|
3966
|
+
function matchMessageBody(link, jobId, ids = { interaction: randomId(), session: randomId() }) {
|
|
3967
|
+
const c = graphql("guideMessage");
|
|
3968
|
+
return {
|
|
3969
|
+
variables: {
|
|
3970
|
+
guideInteractionId: ids.interaction,
|
|
3971
|
+
guideQueryContext: {
|
|
3972
|
+
customContext: link.customContext,
|
|
3973
|
+
intent: link.intent,
|
|
3974
|
+
pageContext: {
|
|
3975
|
+
origin: "",
|
|
3976
|
+
companyUrns: null,
|
|
3977
|
+
profileUrns: null,
|
|
3978
|
+
jobPostingUrns: [`urn:li:fsd_jobPosting:${jobId}`]
|
|
3979
|
+
},
|
|
3980
|
+
contextUrns: link.contextUrns,
|
|
3981
|
+
originalIntent: link.intent,
|
|
3982
|
+
originalThreadMailbox: link.mailbox,
|
|
3983
|
+
isZeroState: false
|
|
3984
|
+
},
|
|
3985
|
+
guideSessionId: ids.session,
|
|
3986
|
+
query: link.query
|
|
3987
|
+
},
|
|
3988
|
+
queryId: c.queryId,
|
|
3989
|
+
includeWebMetadata: true
|
|
3990
|
+
};
|
|
3991
|
+
}
|
|
3992
|
+
function parseMatchSent(json) {
|
|
3993
|
+
const root = json;
|
|
3994
|
+
const message = nodes(root?.included).find(
|
|
3995
|
+
(n) => typeof n.conversationV2Urn === "string" && n.content?.["*aiResponse"]
|
|
3996
|
+
);
|
|
3997
|
+
const conversation = message?.conversationV2Urn;
|
|
3998
|
+
const response = message?.content?.["*aiResponse"];
|
|
3999
|
+
if (typeof conversation !== "string" || typeof response !== "string") {
|
|
4000
|
+
const why = nodes(root?.data?.errors)[0]?.message;
|
|
4001
|
+
return drift4(
|
|
4002
|
+
`the assistant did not take the question${typeof why === "string" ? `: ${why}` : ""}`
|
|
4003
|
+
);
|
|
4004
|
+
}
|
|
4005
|
+
return { ok: true, conversation, response };
|
|
4006
|
+
}
|
|
4007
|
+
function matchAnswerUrl(conversation) {
|
|
4008
|
+
const c = graphql("guideMessages");
|
|
4009
|
+
const urn = encodeURIComponent(conversation);
|
|
4010
|
+
return `${c.path}?includeWebMetadata=true&variables=(guideConversationV2Urn:${urn},syncToken:null)&queryId=${c.queryId}`;
|
|
4011
|
+
}
|
|
4012
|
+
function matchOf(t) {
|
|
4013
|
+
const spans = (style) => (t.attributesV2 ?? []).filter((a) => a.detailData?.style === style).map((a) => t.text.slice(a.start ?? 0, (a.start ?? 0) + (a.length ?? 0)).trim());
|
|
4014
|
+
const first = (t.attributesV2 ?? [])[0];
|
|
4015
|
+
const lines = spans("PARAGRAPH").filter((l) => l !== "");
|
|
4016
|
+
const marked = (mark) => lines.filter((l) => l.startsWith(mark)).map((l) => l.slice(mark.length).trim());
|
|
4017
|
+
return defined5({
|
|
4018
|
+
summary: first?.detailData?.style === "BOLD" && first.start === 0 ? spans("BOLD")[0] : void 0,
|
|
4019
|
+
met: marked("\u2713"),
|
|
4020
|
+
missing: marked("?"),
|
|
4021
|
+
text: lines.join("\n")
|
|
4022
|
+
});
|
|
4023
|
+
}
|
|
4024
|
+
function parseMatchAnswer(json, response) {
|
|
4025
|
+
const root = json;
|
|
4026
|
+
if (!Array.isArray(root?.included)) return drift4("the conversation came back without messages");
|
|
4027
|
+
const answer = root.included.find((n) => n.entityUrn === response);
|
|
4028
|
+
const streaming = answer?.responseV2?.streamingResponse ?? {};
|
|
4029
|
+
if (typeof streaming.finalComponentPosition !== "number") return { ok: true, done: false };
|
|
4030
|
+
for (const part2 of nodes(streaming.responseComponent)) {
|
|
4031
|
+
const t = part2.component?.aiResponse?.text;
|
|
4032
|
+
if (typeof t?.text === "string")
|
|
4033
|
+
return { ok: true, done: true, match: matchOf(t) };
|
|
4034
|
+
}
|
|
4035
|
+
return drift4("the assistant finished without a written answer");
|
|
4036
|
+
}
|
|
3859
4037
|
|
|
3860
4038
|
// src/commands/jobs.ts
|
|
3861
4039
|
function liveFetch5(command, quiet) {
|
|
@@ -3863,10 +4041,11 @@ function liveFetch5(command, quiet) {
|
|
|
3863
4041
|
if (session.state !== "ok")
|
|
3864
4042
|
return err(command, "AUTH_FAILED", "no LinkedIn session \u2014 run `lnrelay login`");
|
|
3865
4043
|
const client = createLiveClient(session.session, void 0, quiet);
|
|
3866
|
-
return async (url, spendClass, body) => {
|
|
4044
|
+
return async (url, spendClass, body, headers) => {
|
|
3867
4045
|
const r = await client.request({
|
|
3868
4046
|
url,
|
|
3869
4047
|
...body !== void 0 ? { method: "POST", body } : {},
|
|
4048
|
+
...headers !== void 0 ? { headers } : {},
|
|
3870
4049
|
spendClass,
|
|
3871
4050
|
operation: command
|
|
3872
4051
|
});
|
|
@@ -3933,7 +4112,11 @@ async function addDetails(get, rows, withDescription) {
|
|
|
3933
4112
|
return read.stoppedBy === void 0 ? { unread } : { unread, stoppedBy: read.stoppedBy };
|
|
3934
4113
|
}
|
|
3935
4114
|
async function runJobs(req, opts = {}, fetch2) {
|
|
3936
|
-
if (req.collection !== void 0)
|
|
4115
|
+
if (req.collection !== void 0) {
|
|
4116
|
+
const misuse = collectionMisuse(req, req.collection);
|
|
4117
|
+
if (misuse !== null) return misuse;
|
|
4118
|
+
return req.collection === "hear-back" ? runHearBack(req, opts, fetch2) : runCollection(req, req.collection, opts, fetch2);
|
|
4119
|
+
}
|
|
3937
4120
|
const sets = keywordSets(req.keywords);
|
|
3938
4121
|
const hasQuery = sets.length > 0 || [req.location, req.geoId].some((v) => v !== void 0 && v !== "");
|
|
3939
4122
|
if (!hasQuery) {
|
|
@@ -4000,16 +4183,66 @@ async function runJobs(req, opts = {}, fetch2) {
|
|
|
4000
4183
|
meta
|
|
4001
4184
|
});
|
|
4002
4185
|
}
|
|
4003
|
-
|
|
4186
|
+
function collectionMisuse(req, collection2) {
|
|
4004
4187
|
const searched = keywordSets(req.keywords).length > 0 || req.location || req.geoId;
|
|
4005
4188
|
const selection3 = jobFilterSelection(req.filter ?? {});
|
|
4006
4189
|
const filtered = !selection3.ok || Object.keys(selection3.filters).length > 0;
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4190
|
+
return searched || filtered ? err(
|
|
4191
|
+
"jobs",
|
|
4192
|
+
"INVALID_INPUT",
|
|
4193
|
+
`--${collection2} is LinkedIn's own list: it takes no keywords, location or filters`
|
|
4194
|
+
) : null;
|
|
4195
|
+
}
|
|
4196
|
+
async function hearBackIds(get, upTo) {
|
|
4197
|
+
const ids = [];
|
|
4198
|
+
for (let start = 0; start < PAGING3.max; start += HEAR_BACK_PAGE) {
|
|
4199
|
+
const res = await get(hearBackUrl(start), "jobSearch", hearBackBody(), {
|
|
4200
|
+
...HEAR_BACK_HEADERS
|
|
4201
|
+
});
|
|
4202
|
+
const page = res.ok ? parseJobIds(res.raw ?? "") : res;
|
|
4203
|
+
if (!page.ok) return { ids, ended: false, failure: page };
|
|
4204
|
+
const fresh = page.ids.filter((id) => !ids.includes(id));
|
|
4205
|
+
ids.push(...fresh);
|
|
4206
|
+
if (page.ids.length < HEAR_BACK_PAGE || fresh.length === 0) return { ids, ended: true };
|
|
4207
|
+
if (ids.length >= upTo) return { ids, ended: false };
|
|
4208
|
+
}
|
|
4209
|
+
return { ids, ended: false };
|
|
4210
|
+
}
|
|
4211
|
+
async function runHearBack(req, opts, fetch2) {
|
|
4212
|
+
const get = fetch2 ?? liveFetch5("jobs", opts.quiet === true);
|
|
4213
|
+
if (typeof get !== "function") return get;
|
|
4214
|
+
const first = Math.max(0, req.start ?? 0);
|
|
4215
|
+
const want = Math.max(1, Math.min(req.limit, PAGING3.max - first));
|
|
4216
|
+
const listed = await hearBackIds(get, first + want);
|
|
4217
|
+
if (listed.ids.length === 0 && listed.failure !== void 0) {
|
|
4218
|
+
const f = listed.failure;
|
|
4219
|
+
return err("jobs", f.code, f.message, f.hint);
|
|
4220
|
+
}
|
|
4221
|
+
const slice = listed.ids.slice(first, first + want);
|
|
4222
|
+
const read = await readJobs(get, slice);
|
|
4223
|
+
const rows = slice.flatMap((id) => read.jobs.get(id) ?? []);
|
|
4224
|
+
const unread = slice.filter((id) => !read.jobs.has(id));
|
|
4225
|
+
const whole = listed.ended && first + want >= listed.ids.length;
|
|
4226
|
+
return ok("jobs", {
|
|
4227
|
+
collection: "hear-back",
|
|
4228
|
+
items: shape2(
|
|
4229
|
+
rows,
|
|
4230
|
+
opts,
|
|
4231
|
+
(j) => compactJob({ ...j, easyApply: j.apply?.type === "easy-apply", promoted: false })
|
|
4232
|
+
),
|
|
4233
|
+
meta: {
|
|
4234
|
+
state: whole && unread.length === 0 ? "complete" : "partial",
|
|
4235
|
+
operation: "jobs",
|
|
4236
|
+
...listed.ended ? { claimedCount: listed.ids.length } : {},
|
|
4237
|
+
returnedCount: rows.length,
|
|
4238
|
+
start: first,
|
|
4239
|
+
...unread.length > 0 ? { unread } : {},
|
|
4240
|
+
...listed.failure !== void 0 ? { stoppedBy: listed.failure.code } : {},
|
|
4241
|
+
...read.stoppedBy !== void 0 ? { readStop: read.stoppedBy } : {}
|
|
4242
|
+
}
|
|
4243
|
+
});
|
|
4244
|
+
}
|
|
4245
|
+
async function runCollection(req, collection2, opts, fetch2) {
|
|
4013
4246
|
const get = fetch2 ?? liveFetch5("jobs", opts.quiet === true);
|
|
4014
4247
|
if (typeof get !== "function") return get;
|
|
4015
4248
|
const first = Math.max(0, req.start ?? 0);
|
|
@@ -4044,6 +4277,35 @@ async function runCollection(req, collection2, opts, fetch2) {
|
|
|
4044
4277
|
meta: metaOf("jobs", merged, true, first, { unread: 0, ...extra })
|
|
4045
4278
|
});
|
|
4046
4279
|
}
|
|
4280
|
+
var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
4281
|
+
var MATCH_POLLS = 8;
|
|
4282
|
+
async function matchFor(get, jobId, pollMs) {
|
|
4283
|
+
const linked = await get(HOW_YOU_FIT_URL, "page", howYouFitBody(jobId));
|
|
4284
|
+
const link = linked.ok ? parseMatchLink(linked.raw ?? "", jobId) : linked;
|
|
4285
|
+
if (!link.ok) return link;
|
|
4286
|
+
const sentRes = await get(matchMessageUrl(), "page", matchMessageBody(link.link, jobId));
|
|
4287
|
+
const sent = sentRes.ok ? parseMatchSent(sentRes.json) : sentRes;
|
|
4288
|
+
if (!sent.ok) return sent;
|
|
4289
|
+
for (let i = 0; i < MATCH_POLLS; i++) {
|
|
4290
|
+
await sleep(pollMs);
|
|
4291
|
+
const res = await get(matchAnswerUrl(sent.conversation), "page");
|
|
4292
|
+
const answer = res.ok ? parseMatchAnswer(res.json, sent.response) : res;
|
|
4293
|
+
if (!answer.ok) return answer;
|
|
4294
|
+
if (answer.done) return { ok: true, match: answer.match };
|
|
4295
|
+
}
|
|
4296
|
+
return {
|
|
4297
|
+
ok: false,
|
|
4298
|
+
code: "TIMEOUT",
|
|
4299
|
+
message: `the assistant had not finished after ${MATCH_POLLS} looks; it may still be in its history`
|
|
4300
|
+
};
|
|
4301
|
+
}
|
|
4302
|
+
async function addMatches(get, jobs, pollMs) {
|
|
4303
|
+
for (const job of jobs) {
|
|
4304
|
+
const r = await matchFor(get, job.id, pollMs);
|
|
4305
|
+
if (r.ok) job.match = r.match;
|
|
4306
|
+
else job.matchError = `${r.code}: ${r.message}`;
|
|
4307
|
+
}
|
|
4308
|
+
}
|
|
4047
4309
|
async function addInsights(get, jobs) {
|
|
4048
4310
|
for (const job of jobs) {
|
|
4049
4311
|
const res = await get(jobInsightsUrl(job.id), "jobRead");
|
|
@@ -4067,6 +4329,11 @@ async function addTeams(get, jobs) {
|
|
|
4067
4329
|
else job.hiringTeamError = `${team.code}: ${team.message}`;
|
|
4068
4330
|
}
|
|
4069
4331
|
}
|
|
4332
|
+
async function enrich(get, jobs, req) {
|
|
4333
|
+
if (req.team === true) await addTeams(get, jobs);
|
|
4334
|
+
if (req.insights === true) await addInsights(get, jobs);
|
|
4335
|
+
if (req.match === true) await addMatches(get, jobs, req.pollMs ?? 4e3);
|
|
4336
|
+
}
|
|
4070
4337
|
async function runJob(input, opts = {}, fetch2, req = {}) {
|
|
4071
4338
|
const given = input === void 0 ? [] : Array.isArray(input) ? input : [input];
|
|
4072
4339
|
const ids = [...new Set(given.map(jobIdOf))];
|
|
@@ -4088,8 +4355,7 @@ async function runJob(input, opts = {}, fetch2, req = {}) {
|
|
|
4088
4355
|
const detail = parseJobDetail(res.json);
|
|
4089
4356
|
if (!detail.ok) return err("job", detail.code, detail.message, detail.hint);
|
|
4090
4357
|
const job = detail.job;
|
|
4091
|
-
|
|
4092
|
-
if (req.insights === true) await addInsights(get, [job]);
|
|
4358
|
+
await enrich(get, [job], req);
|
|
4093
4359
|
return ok("job", job);
|
|
4094
4360
|
}
|
|
4095
4361
|
const read = await readJobs(get, wanted);
|
|
@@ -4097,8 +4363,7 @@ async function runJob(input, opts = {}, fetch2, req = {}) {
|
|
|
4097
4363
|
return err("job", read.stoppedBy, "no job could be read");
|
|
4098
4364
|
const unread = wanted.filter((id) => !read.jobs.has(id));
|
|
4099
4365
|
const jobs = wanted.flatMap((id) => read.jobs.get(id) ?? []);
|
|
4100
|
-
|
|
4101
|
-
if (req.insights === true) await addInsights(get, jobs);
|
|
4366
|
+
await enrich(get, jobs, req);
|
|
4102
4367
|
return ok("job", {
|
|
4103
4368
|
items: shape2(
|
|
4104
4369
|
jobs,
|
|
@@ -6395,16 +6660,16 @@ var COMMANDS = [
|
|
|
6395
6660
|
name: "jobs",
|
|
6396
6661
|
cost: "1 job-search call per 100 jobs; --details adds 1 job read per 100 jobs",
|
|
6397
6662
|
summary: "Job search with every filter the jobs page has. Cards carry id, title, company, place, workplace, listed date, Easy Apply. Read finalists with `job`.",
|
|
6398
|
-
usage: 'lnrelay jobs "<keywords>" ["<more keywords>" ...] [--location "<place>" | --geo <id>]\n [--distance <miles>]\n [--posted 24h|week|month|<N>h|<N>d] [--experience internship,entry,associate,\n mid-senior,director,executive] [--type full-time,part-time,contract,temporary,\n volunteer,internship,other] [--workplace on-site,remote,hybrid] [--easy-apply]\n [--under-10] [--verified] [--in-network] [--fair-chance] [--company <ids>]\n [--industry <ids>] [--function <codes>] [--title <ids>] [--place <geo-ids>]\n [--filter key=v1,v2 ...] [--sort recent|relevant] [--limit N] [--start N]\n [--details [--description]] [--compact | --fields a,b,c]\n Ids for --company/--industry/--title/--place/--filter come from `job-filters`.\n The resolved place is in data.location: check it, "Vienna" may resolve narrow.\nlnrelay jobs --top-applicant [--limit N] [--details] [--compact | --fields a,b,c]\n Premium: the jobs where LinkedIn says you would be a top applicant
|
|
6663
|
+
usage: 'lnrelay jobs "<keywords>" ["<more keywords>" ...] [--location "<place>" | --geo <id>]\n [--distance <miles>]\n [--posted 24h|week|month|<N>h|<N>d] [--experience internship,entry,associate,\n mid-senior,director,executive] [--type full-time,part-time,contract,temporary,\n volunteer,internship,other] [--workplace on-site,remote,hybrid] [--easy-apply]\n [--under-10] [--verified] [--in-network] [--fair-chance] [--company <ids>]\n [--industry <ids>] [--function <codes>] [--title <ids>] [--place <geo-ids>]\n [--filter key=v1,v2 ...] [--sort recent|relevant] [--limit N] [--start N]\n [--details [--description]] [--compact | --fields a,b,c]\n Ids for --company/--industry/--title/--place/--filter come from `job-filters`.\n The resolved place is in data.location: check it, "Vienna" may resolve narrow.\nlnrelay jobs --top-applicant | --hear-back [--limit N] [--details] [--compact | --fields a,b,c]\n Premium: the jobs where LinkedIn says you would be a top applicant (100 a call), or\n where you are more likely to hear back (25 a call, then read in full).',
|
|
6399
6664
|
audience: ["cli", "mcp"],
|
|
6400
6665
|
risk: "read",
|
|
6401
6666
|
implemented: true
|
|
6402
6667
|
},
|
|
6403
6668
|
{
|
|
6404
6669
|
name: "job",
|
|
6405
|
-
cost: "1 job read per 100 jobs; --team adds 1 page call per job; --insights 1 job read per job",
|
|
6406
|
-
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. --insights (Premium) adds who applied (count, last day, seniority, education) and the company's insights: headcount over two years, the job's function, tenure, competitors.",
|
|
6407
|
-
usage: "lnrelay job <id|job-url> [<id|job-url> ...] [--team] [--insights] [--compact | --fields a,b,c]",
|
|
6670
|
+
cost: "1 job read per 100 jobs; --team adds 1 page call per job; --insights 1 job read per job; --match about 3 page calls per job",
|
|
6671
|
+
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. --insights (Premium) adds who applied (count, last day, seniority, education) and the company's insights: headcount over two years, the job's function, tenure, competitors. --match (Premium) asks LinkedIn's AI how well you fit: verdict, met and missing qualifications.",
|
|
6672
|
+
usage: "lnrelay job <id|job-url> [<id|job-url> ...] [--team] [--insights] [--match]\n [--compact | --fields a,b,c]",
|
|
6408
6673
|
audience: ["cli", "mcp"],
|
|
6409
6674
|
risk: "read",
|
|
6410
6675
|
implemented: true
|
|
@@ -7655,21 +7920,23 @@ function buildServer() {
|
|
|
7655
7920
|
};
|
|
7656
7921
|
server.tool(
|
|
7657
7922
|
"jobs",
|
|
7658
|
-
`Search LinkedIn jobs with every filter the jobs page has. 1 job-search call per 100 results (150 a day). Rows carry id, title, company, location, workplace, listed (date), easyApply, promoted, salary when shown, url. RANK ON THOSE, then call \`job\` on finalists for the description and apply link; \`details:true\` reads every row in full, 100 per job read (60 a day). Pass several keyword sets as a list to search them all with the same filters in one call: jobs found by several come back once, with \`matched\` naming the sets that found them, most-matched first; \`meta.searches\` reports each set and \`meta.duplicates\` how many repeats were merged. Ids for company/industry/title/place/filter come from \`job_filters\`. \`data.location\` is the place a typed location resolved to: check it. \`meta.claimedCount\` is LinkedIn's total; \`meta.next\` is the start for the next page; LinkedIn serves at most 1000 per search. topApplicant: true (Premium) lists instead the jobs where LinkedIn says the user would be a top applicant, 100 per call;
|
|
7923
|
+
`Search LinkedIn jobs with every filter the jobs page has. 1 job-search call per 100 results (150 a day). Rows carry id, title, company, location, workplace, listed (date), easyApply, promoted, salary when shown, url. RANK ON THOSE, then call \`job\` on finalists for the description and apply link; \`details:true\` reads every row in full, 100 per job read (60 a day). Pass several keyword sets as a list to search them all with the same filters in one call: jobs found by several come back once, with \`matched\` naming the sets that found them, most-matched first; \`meta.searches\` reports each set and \`meta.duplicates\` how many repeats were merged. Ids for company/industry/title/place/filter come from \`job_filters\`. \`data.location\` is the place a typed location resolved to: check it. \`meta.claimedCount\` is LinkedIn's total; \`meta.next\` is the start for the next page; LinkedIn serves at most 1000 per search. topApplicant: true (Premium) lists instead the jobs where LinkedIn says the user would be a top applicant, 100 per call; hearBack: true (Premium) lists the jobs where the user is more likely to hear back, 25 per job-search call plus a job read per 100 (rows are full jobs, as \`job\` returns them). Neither takes keywords, location or filters. ${READING_CONTRACT} ${NO_RETRY}`,
|
|
7659
7924
|
{
|
|
7660
7925
|
...jobQuery,
|
|
7661
7926
|
topApplicant: z.boolean().optional().describe("Premium: LinkedIn's list of jobs where the user would be a top applicant"),
|
|
7927
|
+
hearBack: z.boolean().optional().describe("Premium: LinkedIn's list of jobs where the user is more likely to hear back"),
|
|
7662
7928
|
limit: z.number().int().min(1).max(1e3).optional().describe("per keyword set; default 25"),
|
|
7663
7929
|
start: z.number().int().min(0).optional(),
|
|
7664
7930
|
details: z.boolean().optional().describe("read each job: apply link, applicants"),
|
|
7665
7931
|
description: z.boolean().optional().describe("with details, keep full descriptions"),
|
|
7666
7932
|
compact: z.boolean().optional().describe("one line per job")
|
|
7667
7933
|
},
|
|
7668
|
-
async ({ limit, start, details, description, compact: compact2, topApplicant, ...q }) => reply(
|
|
7934
|
+
async ({ limit, start, details, description, compact: compact2, topApplicant, hearBack, ...q }) => reply(
|
|
7669
7935
|
await runJobs(
|
|
7670
7936
|
{
|
|
7671
7937
|
...jobRequest(q, limit ?? 25),
|
|
7672
7938
|
...topApplicant === true ? { collection: "top-applicant" } : {},
|
|
7939
|
+
...hearBack === true ? { collection: "hear-back" } : {},
|
|
7673
7940
|
...start !== void 0 ? { start } : {},
|
|
7674
7941
|
...details !== void 0 ? { details } : {},
|
|
7675
7942
|
...description !== void 0 ? { description } : {}
|
|
@@ -7680,13 +7947,20 @@ function buildServer() {
|
|
|
7680
7947
|
);
|
|
7681
7948
|
server.tool(
|
|
7682
7949
|
"job",
|
|
7683
|
-
`LinkedIn jobs by id or URL, in full: description, apply {type: external | easy-apply, url}, company, location, workplace, employmentType, applicants, listed/expires, state (LISTED or CLOSED), and whether the user already applied or saved it. One id returns the job; several return {items, meta}, read 100 per job read (60 a day), so pass all finalists in one call. meta.unread lists ids LinkedIn did not return. team: true adds hiringTeam [{name, id, url, headline, degree, role ("Job poster"), verified}] per job \u2014 who posted it and who is hiring \u2014 one page call (60 a day) per job; [] means LinkedIn shows no one, and hiringTeamError says why one could not be read. insights: true (Premium) adds premium {applicants {total, lastDay, seniority [{level, share, count}], education [{degree, share}]}, company {name, headcount {asOf, now, sixMonthsAgo, yearAgo, twoYearsAgo, growth1y (%)}, function {name, now, \u2026} (the job's function), medianTenure, competitors [{name, industry, url}], hiring, priorities, landscape (LinkedIn's generated text)}}, one more job read per job; premiumError says why they could not be read. ` + NO_RETRY,
|
|
7950
|
+
`LinkedIn jobs by id or URL, in full: description, apply {type: external | easy-apply, url}, company, location, workplace, employmentType, applicants, listed/expires, state (LISTED or CLOSED), and whether the user already applied or saved it. One id returns the job; several return {items, meta}, read 100 per job read (60 a day), so pass all finalists in one call. meta.unread lists ids LinkedIn did not return. team: true adds hiringTeam [{name, id, url, headline, degree, role ("Job poster"), verified}] per job \u2014 who posted it and who is hiring \u2014 one page call (60 a day) per job; [] means LinkedIn shows no one, and hiringTeamError says why one could not be read. insights: true (Premium) adds premium {applicants {total, lastDay, seniority [{level, share, count}], education [{degree, share}]}, company {name, headcount {asOf, now, sixMonthsAgo, yearAgo, twoYearsAgo, growth1y (%)}, function {name, now, \u2026} (the job's function), medianTenure, competitors [{name, industry, url}], hiring, priorities, landscape (LinkedIn's generated text)}}, one more job read per job; premiumError says why they could not be read. match: true (Premium) asks LinkedIn's AI assistant how well the user fits each job, as "Show match details" does: match {summary (the verdict), met and missing (required qualifications), text}, in the user's language; about 3 page calls and a few seconds per job, and the exchange is added to the user's assistant history. matchError says why not. ` + NO_RETRY,
|
|
7684
7951
|
{
|
|
7685
7952
|
job: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]).describe("job id, /jobs/view/ URL or ?currentJobId= URL, or a list of them"),
|
|
7686
7953
|
team: z.boolean().optional().describe("also read each job's hiring team"),
|
|
7687
|
-
insights: z.boolean().optional().describe("Premium: who applied, and the company's headcount and insights")
|
|
7954
|
+
insights: z.boolean().optional().describe("Premium: who applied, and the company's headcount and insights"),
|
|
7955
|
+
match: z.boolean().optional().describe("Premium: LinkedIn's AI assessment of how well the user fits each job")
|
|
7688
7956
|
},
|
|
7689
|
-
async ({ job, team, insights }) => reply(
|
|
7957
|
+
async ({ job, team, insights, match }) => reply(
|
|
7958
|
+
await runJob(job, {}, void 0, {
|
|
7959
|
+
team: team === true,
|
|
7960
|
+
insights: insights === true,
|
|
7961
|
+
match: match === true
|
|
7962
|
+
})
|
|
7963
|
+
)
|
|
7690
7964
|
);
|
|
7691
7965
|
server.tool(
|
|
7692
7966
|
"job_filters",
|