openings 0.1.13 → 0.1.14

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.13",
3
+ "version": "0.1.14",
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.13",
3
+ "version": "0.1.14",
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" },
package/src/cli.ts CHANGED
@@ -22,7 +22,7 @@ import { mergeAttemptedRoundLeads, prepareRecruiteeRoundArtifacts } from "./recr
22
22
  const HELP = `Openings — search public company job boards
23
23
 
24
24
  Usage:
25
- openings crawl [--workday-countries IN,US] [--country CODE | --companies FILE] [--concurrency N] [--source-cache-hours N] [--source-limit N] [--delay-ms N] [--workday-page-delay-ms N] [--data-dir PATH]
25
+ openings crawl [--workday-countries IN,US] [--country CODE | --companies FILE] [--concurrency N] [--source-cache-hours N] [--source-limit N] [--delay-ms N] [--workday-page-delay-ms N] [--timeout-ms N] [--data-dir PATH]
26
26
  openings snapshot export [--input FILE] [--output-dir PATH]
27
27
  openings coverage report --country CODE [--snapshot FILE] [--catalog FILE] [--candidates FILE] [--registry FILE] [--output FILE] [--as-of ISO]
28
28
  openings sources discover-subdomains SEEDS.json [--output FILE] [--limit N] [--delay-ms N] [--report FILE]
@@ -69,7 +69,7 @@ export async function run(args: string[]): Promise<number> {
69
69
  if (typeof parsed === "string") return fail(parsed);
70
70
  const runtime = createRuntime({
71
71
  dataDir: parsed.dataDir, concurrency: parsed.concurrency, sourceCacheHours: parsed.sourceCacheHours,
72
- sourceLimit: parsed.sourceLimit, crawlDelayMs: parsed.delayMs, workdayPageDelayMs: parsed.workdayPageDelayMs, workdayCountries: parsed.workdayCountries,
72
+ sourceLimit: parsed.sourceLimit, crawlDelayMs: parsed.delayMs, workdayPageDelayMs: parsed.workdayPageDelayMs, workdayCountries: parsed.workdayCountries, timeoutMs: parsed.timeoutMs,
73
73
  });
74
74
  const slugs = parsed.companiesFile ? await readCompanyFile(parsed.companiesFile) : undefined;
75
75
  console.log(JSON.stringify(await runtime.crawl({ country: parsed.country, slugs }), null, 2));
@@ -514,6 +514,7 @@ function parseCrawl(args: string[]) {
514
514
  let concurrency = 10;
515
515
  let delayMs = 0;
516
516
  let workdayPageDelayMs = 0;
517
+ let timeoutMs: number | undefined;
517
518
  let workdayCountries: string[] | undefined;
518
519
  let sourceCacheHours = 24;
519
520
  let sourceLimit = 0;
@@ -537,6 +538,9 @@ function parseCrawl(args: string[]) {
537
538
  } else if (arg === "--workday-page-delay-ms") {
538
539
  workdayPageDelayMs = Number(args[++index]);
539
540
  if (!Number.isInteger(workdayPageDelayMs) || workdayPageDelayMs < 0 || workdayPageDelayMs > 60_000) return "--workday-page-delay-ms must be an integer from 0 to 60000";
541
+ } else if (arg === "--timeout-ms") {
542
+ timeoutMs = Number(args[++index]);
543
+ if (!Number.isInteger(timeoutMs) || timeoutMs < 1000 || timeoutMs > 1_800_000) return "--timeout-ms must be an integer from 1000 to 1800000";
540
544
  } else if (arg === "--source-cache-hours") {
541
545
  sourceCacheHours = Number(args[++index]);
542
546
  if (!Number.isFinite(sourceCacheHours) || sourceCacheHours < 0 || sourceCacheHours > 8760) return "--source-cache-hours must be a number from 0 to 8760";
@@ -548,7 +552,7 @@ function parseCrawl(args: string[]) {
548
552
  if (country && companiesFile) return "Use either --country or --companies, not both";
549
553
  if (args.includes("--companies") && !companiesFile) return "--companies requires a file";
550
554
  if (args.includes("--data-dir") && !dataDir) return "--data-dir requires a value";
551
- return { country, companiesFile, dataDir, concurrency, delayMs, workdayPageDelayMs, sourceCacheHours, sourceLimit , workdayCountries };
555
+ return { country, companiesFile, dataDir, concurrency, delayMs, workdayPageDelayMs, sourceCacheHours, sourceLimit, workdayCountries, timeoutMs };
552
556
  }
553
557
 
554
558
  function parseCountry(value: string | undefined): string | undefined {
package/src/runtime.ts CHANGED
@@ -13,7 +13,7 @@ import { createFileSnapshotStore } from "./snapshot-store.ts";
13
13
  import { createJobCoverageReader } from "./job-coverage.ts";
14
14
  import { createJobSearchPreparer } from "./job-search-preparation.ts";
15
15
 
16
- export function createRuntime(options: { dataDir?: string; concurrency?: number; crawlDelayMs?: number; workdayPageDelayMs?: number; workdayCountries?: string[]; sourceCacheHours?: number; sourceLimit?: number } = {}) {
16
+ export function createRuntime(options: { dataDir?: string; concurrency?: number; crawlDelayMs?: number; workdayPageDelayMs?: number; workdayCountries?: string[]; sourceCacheHours?: number; sourceLimit?: number; timeoutMs?: number } = {}) {
17
17
  const workdayCountries = options.workdayCountries ?? (process.env.OPENINGS_WORKDAY_COUNTRIES ?? "IN,US").split(",").map((code) => code.trim().toUpperCase()).filter((code) => /^[A-Z]{2}$/.test(code));
18
18
  const dataDir = options.dataDir ?? process.env.OPENINGS_DATA_DIR ?? join(process.cwd(), ".openings");
19
19
  const store = createFileSnapshotStore(join(dataDir, "snapshot.json"));
@@ -25,6 +25,7 @@ export function createRuntime(options: { dataDir?: string; concurrency?: number;
25
25
  store,
26
26
  fetchJobs: (source, signal, observer) => fetchSourceJobs(source, globalThis.fetch, signal, observer),
27
27
  concurrency: options.concurrency,
28
+ timeoutMs: options.timeoutMs,
28
29
  sourceStartDelayMs: options.crawlDelayMs,
29
30
  sourceFreshnessMs: (options.sourceCacheHours ?? 0) * 60 * 60 * 1000,
30
31
  sourceLimit: options.sourceLimit,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = "0.1.13";
1
+ export const VERSION = "0.1.14";