openings 0.1.23 → 0.1.24

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openings",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Find evidence-grounded jobs, including relevant roles you may not have searched for, without accounts or API keys.",
5
5
  "author": { "name": "Openings contributors" },
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openings",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "A free, candidate-safe job-search substrate for AI agents",
5
5
  "license": "MIT",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/abhay-avagama/hiring-agent.git" },
@@ -22,7 +22,8 @@ export interface RecommendJobsResult {
22
22
  profile: CandidateProfile;
23
23
  matches: JobMatch[];
24
24
  exploration: ReturnType<typeof matchJobs>["exploration"];
25
- filteredOut: FilteredJob[];
25
+ /** Counts by reason plus a small sample: the full list once ran to every job in the index and blew past MCP payload limits. */
26
+ filteredOut: { total: number; byReason: Record<string, number>; sample: FilteredJob[] };
26
27
  assumptions: string[];
27
28
  ranking: { mode: "evidence" | "keyword"; minimumPercent: number };
28
29
  snapshot: SnapshotStatus;
@@ -143,15 +144,20 @@ function matchSnapshot(profile: CandidateProfile, intent: CandidateIntent, snaps
143
144
  return matchJobs(profile, intent, jobs, jobs.length, ranking);
144
145
  }
145
146
 
146
- function limitMatching<T extends ReturnType<typeof matchSnapshot>>(matching: T, limit = 20): T {
147
- const matches = matching.matches.slice(0, Math.max(0, limit));
148
- const ids = new Set(matches.map((match) => match.job.id));
149
- return { ...matching, matches, exploration: {
150
- ...matching.exploration,
151
- directMatches: matching.exploration.directMatches.filter((match) => ids.has(match.job.id)),
152
- hiddenMatches: matching.exploration.hiddenMatches.filter((match) => ids.has(match.job.id)),
153
- stretchMatches: matching.exploration.stretchMatches.filter((match) => ids.has(match.job.id)),
154
- } };
147
+ const EXCERPT_CHARS = 280;
148
+ /** Transport shape: descriptions become excerpts (get_job returns the full text), exploration lists carry the same compact matches, filtered jobs are summarised. */
149
+ function limitMatching(matching: ReturnType<typeof matchSnapshot>, limit = 20): Omit<ReturnType<typeof matchSnapshot>, "filteredOut"> & { filteredOut: RecommendJobsResult["filteredOut"] } {
150
+ const compact = (match: JobMatch): JobMatch => ({ ...match, job: { ...match.job, description: match.job.description.length > EXCERPT_CHARS ? `${match.job.description.slice(0, EXCERPT_CHARS).trimEnd()}…` : match.job.description } });
151
+ const matches = matching.matches.slice(0, Math.max(0, limit)).map(compact);
152
+ const byId = new Map(matches.map((match) => [match.job.id, match]));
153
+ const pick = (list: JobMatch[]) => list.filter((match) => byId.has(match.job.id)).map((match) => byId.get(match.job.id)!);
154
+ const byReason: Record<string, number> = {};
155
+ for (const entry of matching.filteredOut) for (const reason of entry.reasons) { const key = reason.split(":")[0]!; byReason[key] = (byReason[key] ?? 0) + 1; }
156
+ return {
157
+ ...matching, matches,
158
+ exploration: { ...matching.exploration, directMatches: pick(matching.exploration.directMatches), hiddenMatches: pick(matching.exploration.hiddenMatches), stretchMatches: pick(matching.exploration.stretchMatches) },
159
+ filteredOut: { total: matching.filteredOut.length, byReason, sample: matching.filteredOut.slice(0, 20) },
160
+ };
155
161
  }
156
162
 
157
163
  function preCutoffMatchCount(matching: ReturnType<typeof matchSnapshot>): number {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.1.23";
1
+ export const VERSION = "0.1.24";