openings 0.1.25 → 0.1.26
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/.codex-plugin/plugin.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +6 -0
- package/src/runtime.ts +24 -0
- package/src/version.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openings",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.26",
|
|
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
package/src/index.ts
CHANGED
|
@@ -35,3 +35,9 @@ export { createSelectedJobLookup } from "./selected-job-lookup.ts";
|
|
|
35
35
|
export type { SelectedJobLookupOptions } from "./selected-job-lookup.ts";
|
|
36
36
|
export { createJobCoverageReader, projectJobCoverage } from "./job-coverage.ts";
|
|
37
37
|
export type { CountryJobCoverage, JobCoverageSummary } from "./job-coverage.ts";
|
|
38
|
+
export { createHostedRuntime } from "./runtime.ts";
|
|
39
|
+
export type { SnapshotStore } from "./crawler.ts";
|
|
40
|
+
export { createToolHandler } from "./tools.ts";
|
|
41
|
+
export { createMcpHandler, FLOW_INSTRUCTIONS } from "./mcp.ts";
|
|
42
|
+
export type { UpdateNotice } from "./update-check.ts";
|
|
43
|
+
export { VERSION } from "./version.ts";
|
package/src/runtime.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
+
import type { SnapshotStore } from "./crawler.ts";
|
|
3
|
+
import type { Company, SearchQuery } from "./types.ts";
|
|
2
4
|
import { fetchSourceJobs } from "./catalog.ts";
|
|
3
5
|
import { createCrawlReporter, fetchSeedSnapshot, resolveAggregatorUrl } from "./crawl-reporting.ts";
|
|
4
6
|
import { createUsageReporter, type UsageReporter } from "./usage.ts";
|
|
@@ -56,3 +58,25 @@ export function createRuntime(options: { dataDir?: string; concurrency?: number;
|
|
|
56
58
|
const optimizer = createResumeOptimizer({ analyzeJobFit: analyzer.analyze });
|
|
57
59
|
return { ...local, prepareJobSearch: preparation.prepare, getJobCoverage: coverage.getCoverage, recommend: recommender.recommend, analyzeJobFit: analyzer.analyze, optimizeResume: optimizer.optimize, usage };
|
|
58
60
|
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The same workflows over a read-only shared index, for the hosted connector. The store is supplied by the host
|
|
64
|
+
* (the aggregator's live index), nothing is crawled, and the sources are exactly those the store holds so
|
|
65
|
+
* preparation reports ready at once. No usage reporter: the host meters by account instead.
|
|
66
|
+
*/
|
|
67
|
+
export function createHostedRuntime(options: { sources: Company[]; store: SnapshotStore; now?: () => Date }) {
|
|
68
|
+
const readOnly = async () => { throw new Error("The hosted index is read-only; it refreshes from the nightly crawl"); };
|
|
69
|
+
const local = createLocalJobs({ sources: options.sources, store: options.store, fetchJobs: readOnly, now: options.now, sourceFreshnessMs: 0 });
|
|
70
|
+
const noCrawl = async () => ({ startedAt: new Date().toISOString(), finishedAt: new Date().toISOString(), selected: 0, succeeded: 0, failed: [] });
|
|
71
|
+
const recommender = createJobRecommender({ sources: options.sources, store: options.store, crawl: noCrawl, now: options.now });
|
|
72
|
+
const coverage = createJobCoverageReader({ sources: options.sources, store: options.store });
|
|
73
|
+
const preparation = createJobSearchPreparer({ sources: options.sources, store: options.store, crawl: noCrawl, now: options.now, freshnessDays: 3650 });
|
|
74
|
+
const getSelectedJob = createSelectedJobLookup({ getSnapshotJob: async (id) => (await local.get(id, { offline: true, staleDays: 3650 })).job, getDetailedJob: async () => null });
|
|
75
|
+
const analyzer = createJobFitAnalyzer({ getJob: getSelectedJob });
|
|
76
|
+
const optimizer = createResumeOptimizer({ analyzeJobFit: analyzer.analyze });
|
|
77
|
+
return {
|
|
78
|
+
search: (query: SearchQuery) => local.search(query, { offline: true, staleDays: 3650 }),
|
|
79
|
+
get: (id: string) => local.get(id, { offline: true, staleDays: 3650 }),
|
|
80
|
+
prepareJobSearch: preparation.prepare, getJobCoverage: coverage.getCoverage, recommend: recommender.recommend, analyzeJobFit: analyzer.analyze, optimizeResume: optimizer.optimize,
|
|
81
|
+
};
|
|
82
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.1.
|
|
1
|
+
export const VERSION = "0.1.26";
|