openings 0.1.35 → 0.1.36

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.35",
3
+ "version": "0.1.36",
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/README.md CHANGED
@@ -61,7 +61,7 @@ The [job-seeker quickstart](docs/job-seeker-quickstart.md) has sample prompts, a
61
61
  | `recommend_jobs` | Ranks jobs against a resume and explicit intent. Returns direct, hidden, and stretch results with evidence. Performs at most one scoped refresh; `refresh.policy: "never"` guarantees no crawl. |
62
62
  | `analyze_job_fit` | Explains one job against verbatim resume evidence: supported, transferable, unsupported, and screening risks. |
63
63
  | `optimize_resume` | Proposes grounded suggestions, an additive diff, or revised Markdown. Never invents experience. |
64
- | `search_jobs` | Plain keyword, location, country, and remote search over the index, newest first. `country` takes a two-letter code such as `IN`; `maxAgeDays` keeps only roles posted within that window. |
64
+ | `search_jobs` | Resume-free keyword, location, country, remote, and stated-experience search, newest first. `country` takes a two-letter code such as `IN`. Optional `experienceYears` compares stated min/max ranges, excluding unknowns unless `includeUnknownExperience: true`. Results include `pagination.total` and `pagination.nextOffset`; request the next page with that `offset`, unchanged filters, and `maxAgeDays` set to the returned `window.daysUsed`. Restart pagination after index refresh; this is not a frozen snapshot cursor. Without `maxAgeDays`, search widens through 7/14/30/all days until at least five results exist. |
65
65
  | `get_job` | Returns one job with its full description. |
66
66
 
67
67
  There is deliberately no form-fill, apply, or submit tool. The only thing Openings writes is your own job index.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openings",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
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" },
@@ -12,8 +12,8 @@ Use `prepare_job_search` to bootstrap the private local index and set honest cou
12
12
  ## Search
13
13
 
14
14
  1. Ask for the target countries and call `prepare_job_search` before requesting a resume. Explain that first-time setup runs in resumable batches and uses the network only to build a private local job index. While `nextAction` is `call_again`, call the tool again with the same countries and the returned opaque `continuation`; do not ask for a resume between batches. On `retry_later`, disclose failures and offer to continue with the indexed coverage or retry later without the old continuation. On `ready`, present its job-level source, job, and employer counts exactly as returned; never substitute discovery-cohort counts or recalculate coverage.
15
- 2. Ask only for missing constraints that materially change the recommendation.
16
- 3. Supply the user's resume content, explicit intent, and their chosen `ranking.mode` (`evidence` by default or `keyword`) to `recommend_jobs`; never pass an arbitrary filesystem path. Use `ranking.minimumPercent` only when the user requests a cutoff.
15
+ 2. Ask only for missing constraints that materially change the search. Search immediately with `search_jobs` when role and country are known; do not require or repeatedly request a resume. Use `experienceYears` only when supplied, explain that it compares stated posting ranges, and offer `includeUnknownExperience` when strict results are thin. Unknown experience is not proof of fit or a gap. To show another page, keep the filters, set `maxAgeDays` to the returned `window.daysUsed`, and use `pagination.nextOffset`; restart after an index refresh.
16
+ 3. Offer resume matching as optional. When the user chooses it, supply their resume content, explicit intent, and their chosen `ranking.mode` (`evidence` by default or `keyword`) to `recommend_jobs`; never pass an arbitrary filesystem path. Use `ranking.minimumPercent` only when the user requests a cutoff.
17
17
  4. Present the returned coverage summary alongside the recommendations without recalculating it.
18
18
  5. Present direct, hidden title-family, and stretch results separately. For a hidden result, quote the returned title expansions and whether each came from explicit intent or validated resume fact IDs; never invent or broaden an alias in the skill.
19
19
  6. Present both returned percentages, the selected score, assumptions, evidence, gaps, refresh status, and failures without recalculating fit. Never describe keyword overlap as demonstrated competence.
package/src/catalog.ts CHANGED
@@ -2,6 +2,7 @@ import { CASCADE_MINIMUM, CASCADE_WINDOWS, type Company, type Job, type JobAge,
2
2
  import { decodeEntities, providerSpec, type JsonGet } from "./providers.ts";
3
3
  import { crawlSite, sitePostingsToJobs } from "./jobposting-site.ts";
4
4
  import { classifyJob, isEligibleForCountry, normalizeLocation } from "./locations.ts";
5
+ import { statedExperience } from "./experience.ts";
5
6
 
6
7
  type Fetch = (input: string | URL, init?: RequestInit) => Promise<Response>;
7
8
 
@@ -107,7 +108,7 @@ export function createCatalog(options: CatalogOptions): Catalog {
107
108
  }
108
109
 
109
110
  export const DEFAULT_MAX_AGE_DAYS = 30;
110
- export type SearchResult = JobSummary[] & { window?: SearchWindow };
111
+ export type SearchResult = JobSummary[] & { window?: SearchWindow; pagination?: { offset: number; limit: number; total: number; nextOffset: number | null } };
111
112
 
112
113
  /** One window: dated jobs inside it; 0 means everything including undated. */
113
114
  export function withinWindow(job: Pick<Job, "updatedAt">, days: number, now: number): boolean {
@@ -118,8 +119,12 @@ export function withinWindow(job: Pick<Job, "updatedAt">, days: number, now: num
118
119
 
119
120
  /** Keyword search newest first. Without maxAgeDays it walks 7, 14, 30, then everything until CASCADE_MINIMUM results appear; the window used rides on the result. */
120
121
  export function searchJobs(jobs: Job[], query: SearchQuery, now: number = Date.now()): SearchResult {
121
- const matched = jobs.filter((job) => matches(job, query));
122
- const run = (days: number) => matched.filter((job) => withinWindow(job, days, now)).sort((left, right) => postedTime(right) - postedTime(left));
122
+ const matched = jobs.filter((job) => matches(job, query)).filter((job) => {
123
+ if (query.experienceYears === undefined) return true;
124
+ const experience = job.experience === undefined ? statedExperience(job.description) : job.experience;
125
+ return experience ? query.experienceYears >= experience.min && (experience.max === undefined || query.experienceYears <= experience.max) : query.includeUnknownExperience === true;
126
+ });
127
+ const run = (days: number) => matched.filter((job) => withinWindow(job, days, now)).sort((left, right) => postedTime(right) - postedTime(left) || (left.id < right.id ? -1 : left.id > right.id ? 1 : 0));
123
128
  const steps: SearchWindow["steps"] = [];
124
129
  let found: Job[] = [];
125
130
  for (const days of query.maxAgeDays !== undefined ? [query.maxAgeDays] : CASCADE_WINDOWS) {
@@ -127,7 +132,9 @@ export function searchJobs(jobs: Job[], query: SearchQuery, now: number = Date.n
127
132
  steps.push({ days, results: found.length });
128
133
  if (found.length >= CASCADE_MINIMUM) break;
129
134
  }
130
- const result = found.slice(0, query.limit ?? 50).map((job) => toSummary(job, now)) as SearchResult;
135
+ const offset = query.offset ?? 0, limit = query.limit ?? 50;
136
+ const result = found.slice(offset, offset + limit).map((job) => toSummary(query.experienceYears !== undefined && job.experience === undefined ? { ...job, experience: statedExperience(job.description) } : job, now)) as SearchResult;
137
+ Object.defineProperty(result, "pagination", { value: { offset, limit, total: found.length, nextOffset: offset + limit < found.length ? offset + limit : null }, enumerable: false });
131
138
  Object.defineProperty(result, "window", { value: { daysUsed: steps[steps.length - 1]!.days, widened: steps.length > 1, steps } satisfies SearchWindow, enumerable: false });
132
139
  return result;
133
140
  }
package/src/mcp.ts CHANGED
@@ -19,7 +19,7 @@ interface ToolHandler {
19
19
 
20
20
  /** Read by the AI app before its first call: the order of operations that keeps results honest. */
21
21
  export const FLOW_INSTRUCTIONS = [
22
- "Openings flow: 1) call prepare_job_search for the person's countries; it is normally ready in one call. 2) Ask for the resume before exploring roles, because recommend_jobs ranks by evidence from it. 3) If the person declines a resume, use search_jobs with their keywords. 4) If they decline that too, use your judgement.",
22
+ "Openings flow: ask only for missing search constraints, such as role and country. Call prepare_job_search when setup is needed, then search_jobs immediately; a resume is optional, never a prerequisite to explore jobs. Offer recommend_jobs when the person wants evidence-based matching and chooses to share a resume. Follow preparation.nextAction rather than assuming setup succeeded.",
23
23
  "Freshness: results start with roles posted in the last 7 days and widen to 14, 30, then everything only when fewer than 5 appear; each result carries age (new, older, stale, undated) and postedDaysAgo. Say which window results came from and present older or stale roles as possibly still open, never as current.",
24
24
  "Experience: a job's experience field is the years its posting states ({ min, max }); null means the posting states none, and absent means it was not read. Quote it as the employer's requirement.",
25
25
  "Every match carries applyUrl, the employer's own posting; include it. When recommend_jobs reports no_matches, relay its explanation and nextMoves instead of searching silently.",
package/src/tools.ts CHANGED
@@ -106,7 +106,7 @@ export function createToolHandler(catalog: Catalog, workflows: JobWorkflows, opt
106
106
  },
107
107
  {
108
108
  name: "search_jobs",
109
- description: "Plain keyword search over the local job index, newest first, walking 7, 14, 30 days then everything until 5 results appear; the window used is returned. Use only when the person declines to share a resume or asks for a plain search; recommend_jobs ranks against a resume.",
109
+ description: "Search jobs immediately from role, country, location and optional stated experience. No resume required. Newest first; automatically widens 7, 14, 30 days then all dates until 5 matches. For another page reuse the same filters and returned window.daysUsed as maxAgeDays, with pagination.nextOffset. Resume-based ranking is optional via recommend_jobs.",
110
110
  inputSchema: {
111
111
  type: "object",
112
112
  properties: {
@@ -114,8 +114,11 @@ export function createToolHandler(catalog: Catalog, workflows: JobWorkflows, opt
114
114
  location: { type: "string", description: "Case-insensitive location substring" },
115
115
  country: { type: "string", pattern: "^[A-Za-z]{2}$", description: "Two-letter country code for job eligibility, such as IN or DE" },
116
116
  remote: { type: "boolean", description: "True for remote-only; false for non-remote-only" },
117
- maxAgeDays: { type: "integer", minimum: 0, maximum: 365, description: "Only roles posted within this many days, newest first. Default 30 (undated roles kept, listed last); an explicit value also drops undated roles; 0 includes older roles" },
117
+ maxAgeDays: { type: "integer", minimum: 0, maximum: 365, description: "Omit to widen 7/14/30/all until 5 matches. Explicit positive values exclude undated roles; 0 includes all dates." },
118
118
  limit: { type: "integer", minimum: 1, maximum: 100, default: 50 },
119
+ offset: { type: "integer", minimum: 0, maximum: 1000000, default: 0 },
120
+ experienceYears: { type: "number", minimum: 0, maximum: 60, description: "Years of experience to compare with the posting's stated min/max range; not a qualification or fit verdict." },
121
+ includeUnknownExperience: { type: "boolean", default: false, description: "With experienceYears, also keep roles without a stated range, clearly unknown rather than matched." },
119
122
  },
120
123
  additionalProperties: false,
121
124
  },
@@ -148,7 +151,10 @@ export function createToolHandler(catalog: Catalog, workflows: JobWorkflows, opt
148
151
  if (name === "analyze_job_fit") return workflows.analyzeJobFit(input);
149
152
  if (name === "optimize_resume") return workflows.optimizeResume(input);
150
153
  if (name === "search_jobs") {
151
- assertToolKeys(input, ["query", "location", "country", "remote", "maxAgeDays", "limit"], "search_jobs");
154
+ assertToolKeys(input, ["query", "location", "country", "remote", "maxAgeDays", "limit", "offset", "experienceYears", "includeUnknownExperience"], "search_jobs");
155
+ if (input.offset !== undefined && (!Number.isInteger(input.offset) || (input.offset as number) < 0 || (input.offset as number) > 1000000)) throw new Error("offset must be an integer between 0 and 1000000");
156
+ if (input.experienceYears !== undefined && (typeof input.experienceYears !== "number" || !Number.isFinite(input.experienceYears) || input.experienceYears < 0 || input.experienceYears > 60)) throw new Error("experienceYears must be a number between 0 and 60");
157
+ if (input.includeUnknownExperience !== undefined && typeof input.includeUnknownExperience !== "boolean") throw new Error("includeUnknownExperience must be a boolean");
152
158
  if (input.query !== undefined && typeof input.query !== "string") throw new Error("query must be a string");
153
159
  if (input.location !== undefined && typeof input.location !== "string") throw new Error("location must be a string");
154
160
  if (input.remote !== undefined && typeof input.remote !== "boolean") throw new Error("remote must be a boolean");
@@ -162,10 +168,13 @@ export function createToolHandler(catalog: Catalog, workflows: JobWorkflows, opt
162
168
  if (typeof input.remote === "boolean") query.remote = input.remote;
163
169
  if (typeof input.maxAgeDays === "number") query.maxAgeDays = input.maxAgeDays;
164
170
  if (typeof input.limit === "number") query.limit = input.limit;
171
+ if (typeof input.offset === "number") query.offset = input.offset;
172
+ if (typeof input.experienceYears === "number") query.experienceYears = input.experienceYears;
173
+ if (typeof input.includeUnknownExperience === "boolean") query.includeUnknownExperience = input.includeUnknownExperience;
165
174
  const jobs = await catalog.search(query) as SearchResult;
166
175
  return {
167
- jobs, window: jobs.window,
168
- guidance: "Unranked keyword matches. Present roles labelled older or stale as possibly still open, not as current. With a resume, recommend_jobs ranks roles by evidence and explains fit.",
176
+ jobs, window: jobs.window, pagination: jobs.pagination,
177
+ guidance: "Unranked keyword matches. Experience filters compare stated ranges only; unknown experience is not a match or a gap. Present older/stale roles as possibly still open, not current. Reuse window.daysUsed as maxAgeDays and pagination.nextOffset with unchanged filters for the next page. Pagination is over the current index, not a frozen snapshot; restart if the index refreshes. Resume-based matching is optional.",
169
178
  };
170
179
  }
171
180
  if (name === "get_job") {
package/src/types.ts CHANGED
@@ -116,6 +116,11 @@ export interface SearchQuery {
116
116
  /** Only jobs posted within this many days. Unset walks 7, 14, 30, then everything until 5 results appear; an explicit value is a single window that drops undated jobs; 0 includes everything. */
117
117
  maxAgeDays?: number;
118
118
  limit?: number;
119
+ /** Zero-based offset within the chosen date window; restart when the index changes. */
120
+ offset?: number;
121
+ /** Match stated experience ranges, not inferred seniority or a hiring guarantee. */
122
+ experienceYears?: number;
123
+ includeUnknownExperience?: boolean;
119
124
  }
120
125
 
121
126
  export interface CrawlFailure {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.1.35";
1
+ export const VERSION = "0.1.36";