@pranavraut033/ats-checker 1.2.0 → 1.3.2

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.
@@ -0,0 +1,319 @@
1
+ type ResumeSection = "summary" | "experience" | "skills" | "education" | "projects" | "certifications";
2
+ interface ParsedDateRange {
3
+ raw?: string;
4
+ start?: string;
5
+ end?: string;
6
+ durationInMonths?: number;
7
+ /** Numeric year/month of the start and end, for overlap-aware summing. */
8
+ startYear?: number;
9
+ startMonth?: number;
10
+ endYear?: number;
11
+ endMonth?: number;
12
+ }
13
+ interface ParsedExperienceEntry {
14
+ title?: string;
15
+ company?: string;
16
+ location?: string;
17
+ dates?: ParsedDateRange;
18
+ description?: string;
19
+ }
20
+ interface ParsedAchievement {
21
+ text: string;
22
+ strength: "strong" | "weak";
23
+ reason: string;
24
+ }
25
+ interface ParsedLanguage {
26
+ /** Canonical lowercase language name, e.g. "german". */
27
+ name: string;
28
+ /** Raw level as written/normalized, e.g. "c1", "fluent", "native". */
29
+ level?: string;
30
+ /** CEFR-aligned rank 1 (A1/basic) – 6 (C2/native), for comparing proficiency. */
31
+ levelRank?: number;
32
+ }
33
+ interface ParsedResume {
34
+ raw: string;
35
+ normalizedText: string;
36
+ detectedSections: ResumeSection[];
37
+ sectionContent: Partial<Record<ResumeSection, string>>;
38
+ skills: string[];
39
+ jobTitles: string[];
40
+ actionVerbs: string[];
41
+ /** Weak verbs (helped, worked, performed, ...) found in the resume text. */
42
+ weakVerbs: string[];
43
+ /** Experience bullets classified as strong/weak achievement statements. */
44
+ achievements: ParsedAchievement[];
45
+ educationEntries: string[];
46
+ experience: ParsedExperienceEntry[];
47
+ totalExperienceYears: number;
48
+ keywords: string[];
49
+ languages: ParsedLanguage[];
50
+ warnings: string[];
51
+ }
52
+ interface ParsedJobDescription {
53
+ raw: string;
54
+ normalizedText: string;
55
+ requiredSkills: string[];
56
+ preferredSkills: string[];
57
+ roleKeywords: string[];
58
+ keywords: string[];
59
+ minExperienceYears?: number;
60
+ educationRequirements: string[];
61
+ /** canonical keyword -> the surface form (original casing/spelling) the JD used. */
62
+ keywordSurfaceForms: Record<string, string>;
63
+ requiredLanguages: ParsedLanguage[];
64
+ }
65
+
66
+ interface ATSWeights {
67
+ skills: number;
68
+ experience: number;
69
+ keywords: number;
70
+ education: number;
71
+ }
72
+ type SkillAliases = Record<string, string[]>;
73
+ type KeywordCategory = "technical" | "tool" | "concept" | "soft" | "marketing" | "domain";
74
+ interface KeywordEntry {
75
+ canonical: string;
76
+ aliases: string[];
77
+ category: KeywordCategory;
78
+ }
79
+ type KeywordRegistry = KeywordEntry[];
80
+ interface ATSProfile {
81
+ name: string;
82
+ mandatorySkills: string[];
83
+ optionalSkills: string[];
84
+ minExperience?: number;
85
+ }
86
+ interface KeywordDensityConfig {
87
+ /** Minimum density before a keyword is considered underused (informational only). */
88
+ min: number;
89
+ /** Maximum density before a keyword is considered stuffed. */
90
+ max: number;
91
+ /** Penalty applied when density exceeds max. */
92
+ overusePenalty: number;
93
+ }
94
+ interface SectionPenaltyConfig {
95
+ missingSummary?: number;
96
+ missingExperience?: number;
97
+ missingSkills?: number;
98
+ missingEducation?: number;
99
+ }
100
+ interface ATSRule {
101
+ id: string;
102
+ description?: string;
103
+ penalty: number;
104
+ warning?: string;
105
+ condition: (context: RuleContext) => boolean;
106
+ }
107
+ interface ATSConfig {
108
+ weights?: Partial<ATSWeights>;
109
+ skillAliases?: SkillAliases;
110
+ /** Categorized keyword/alias entries (technical, tool, concept, soft, marketing, domain). Merges over the default registry by canonical term. */
111
+ keywordRegistry?: KeywordRegistry;
112
+ profile?: ATSProfile;
113
+ rules?: ATSRule[];
114
+ keywordDensity?: KeywordDensityConfig;
115
+ sectionPenalties?: SectionPenaltyConfig;
116
+ allowPartialMatches?: boolean;
117
+ /**
118
+ * ISO date string (e.g. "2024-06-01") used as the "today" reference when
119
+ * computing duration for open-ended date ranges ("Present"/"Current"/"Now").
120
+ * Omit to use the actual current date (live/production behaviour).
121
+ * Set to a fixed value in tests or batch processing to guarantee determinism.
122
+ */
123
+ referenceDate?: string;
124
+ }
125
+ interface NormalizedWeights extends ATSWeights {
126
+ /** Weights normalized so they sum to 1. */
127
+ normalizedTotal: number;
128
+ }
129
+ interface ResolvedATSConfig {
130
+ weights: NormalizedWeights;
131
+ skillAliases: SkillAliases;
132
+ keywordRegistry: KeywordRegistry;
133
+ /** canonical term -> category, derived once from keywordRegistry. */
134
+ categoryIndex: Map<string, KeywordCategory>;
135
+ profile?: ATSProfile;
136
+ rules: ATSRule[];
137
+ keywordDensity: KeywordDensityConfig;
138
+ sectionPenalties: Required<SectionPenaltyConfig>;
139
+ allowPartialMatches: boolean;
140
+ /** Resolved reference date for "Present" duration calculations. */
141
+ referenceDate?: Date;
142
+ }
143
+ interface RuleContext {
144
+ resume: ParsedResume;
145
+ job: ParsedJobDescription;
146
+ weights: NormalizedWeights;
147
+ keywordDensity: KeywordDensityConfig;
148
+ breakdown?: ATSBreakdown;
149
+ matchedKeywords?: string[];
150
+ overusedKeywords?: string[];
151
+ }
152
+
153
+ /**
154
+ * LLM v2 Support Types - Optional, Backward Compatible
155
+ */
156
+
157
+ /**
158
+ * JSON Schema for response validation
159
+ */
160
+ interface JSONSchema {
161
+ type: string;
162
+ properties?: Record<string, unknown>;
163
+ required?: string[];
164
+ items?: unknown;
165
+ [key: string]: unknown;
166
+ }
167
+ /**
168
+ * LLM Client abstraction - user provides their own implementation
169
+ * This allows flexibility with different LLM providers without direct dependencies
170
+ */
171
+ interface LLMClient {
172
+ /**
173
+ * Create a structured completion from the LLM
174
+ * Must validate and return only valid JSON matching the schema
175
+ */
176
+ createCompletion(input: {
177
+ model: string;
178
+ messages: {
179
+ role: "system" | "user";
180
+ content: string;
181
+ }[];
182
+ max_tokens: number;
183
+ response_format: JSONSchema;
184
+ }): Promise<{
185
+ content: unknown;
186
+ usage?: {
187
+ prompt_tokens?: number;
188
+ completion_tokens?: number;
189
+ total_tokens?: number;
190
+ };
191
+ }>;
192
+ }
193
+ /**
194
+ * LLM budget configuration - prevents runaway spending
195
+ */
196
+ interface LLMBudget {
197
+ maxCalls: number;
198
+ maxTokensPerCall: number;
199
+ maxTotalTokens: number;
200
+ }
201
+ /**
202
+ * Feature toggles for LLM capabilities
203
+ */
204
+ interface LLMFeatures {
205
+ skillNormalization?: boolean;
206
+ sectionClassification?: boolean;
207
+ suggestions?: boolean;
208
+ }
209
+ /**
210
+ * Complete LLM configuration
211
+ */
212
+ interface LLMConfig {
213
+ /** User-provided LLM client (e.g., OpenAI wrapper) */
214
+ client: LLMClient;
215
+ /** Model identifiers */
216
+ models?: {
217
+ /** Default model for fast, structured output (e.g., "gpt-4o-mini") */
218
+ default: string;
219
+ /** Optional thinking model for complex reasoning (e.g., "o4-mini") */
220
+ thinking?: string;
221
+ };
222
+ /** Budget constraints */
223
+ limits: LLMBudget;
224
+ /** Which LLM features to enable */
225
+ enable?: LLMFeatures;
226
+ /** Request timeout in milliseconds */
227
+ timeoutMs?: number;
228
+ }
229
+ /**
230
+ * Updated AnalyzeResumeInput with optional LLM support
231
+ */
232
+ interface AnalyzeResumeInputV2 {
233
+ resumeText: string;
234
+ jobDescription: string;
235
+ config?: ATSConfig;
236
+ llm?: LLMConfig;
237
+ }
238
+ /**
239
+ * LLM usage tracking for debugging
240
+ */
241
+ interface LLMUsageStats {
242
+ totalCalls: number;
243
+ totalTokensUsed: number;
244
+ callsRemaining: number;
245
+ tokensRemaining: number;
246
+ features: Partial<Record<keyof LLMFeatures, boolean>>;
247
+ }
248
+ /**
249
+ * Result of an LLM operation (with fallback info)
250
+ */
251
+ interface LLMResult<T> {
252
+ success: boolean;
253
+ data?: T;
254
+ fallback: boolean;
255
+ error?: string;
256
+ tokensUsed?: number;
257
+ }
258
+
259
+ interface ATSBreakdown {
260
+ skills: number;
261
+ experience: number;
262
+ keywords: number;
263
+ education: number;
264
+ }
265
+ interface AnalyzeResumeInput {
266
+ resumeText: string;
267
+ jobDescription: string;
268
+ config?: ATSConfig;
269
+ llm?: LLMConfig;
270
+ }
271
+ interface KeywordWeight {
272
+ term: string;
273
+ category: KeywordCategory;
274
+ /** Importance of this term in the job description (location + frequency based). */
275
+ jdWeight: number;
276
+ /** How often this term appears in the resume. */
277
+ resumeWeight: number;
278
+ /** Alias of jdWeight — how much this term matters for the role. */
279
+ importance: number;
280
+ }
281
+ interface ATSAnalysisResult {
282
+ score: number;
283
+ breakdown: ATSBreakdown;
284
+ /** Skills found in the resume that satisfy JD + profile requirements. */
285
+ matchedSkills: string[];
286
+ /** Required skills absent from the resume. */
287
+ missingSkills: string[];
288
+ matchedKeywords: string[];
289
+ missingKeywords: string[];
290
+ overusedKeywords: string[];
291
+ /** Matched/missing keywords grouped by category (technical, tool, concept, soft, marketing, domain). */
292
+ keywordsByCategory: Record<KeywordCategory, {
293
+ matched: string[];
294
+ missing: string[];
295
+ }>;
296
+ /** Per-keyword JD importance and resume usage, for callers who want the raw numbers. */
297
+ keywordWeights: KeywordWeight[];
298
+ /** Count of resume achievement bullets classified as strong vs weak. */
299
+ achievementStrength: {
300
+ strong: number;
301
+ weak: number;
302
+ };
303
+ /** JD-required languages the resume meets or exceeds in proficiency. */
304
+ matchedLanguages: ParsedLanguage[];
305
+ /** JD-required languages absent from the resume, or below the required proficiency. */
306
+ missingLanguages: ParsedLanguage[];
307
+ suggestions: string[];
308
+ warnings: string[];
309
+ /** Years below the JD's minimum experience requirement; 0 when the requirement is met. */
310
+ experienceGap: number;
311
+ /** Resume sections the parser successfully detected (e.g. "summary", "skills"). */
312
+ detectedSections: string[];
313
+ /** Total years of experience parsed from the resume's date ranges. */
314
+ parsedExperienceYears: number;
315
+ /** Parsed experience entries from the resume, with titles and date ranges. */
316
+ experienceEntries: ParsedExperienceEntry[];
317
+ }
318
+
319
+ export type { ATSProfile as A, JSONSchema as J, KeywordRegistry as K, LLMConfig as L, NormalizedWeights as N, ParsedDateRange as P, ResolvedATSConfig as R, SkillAliases as S, LLMResult as a, LLMBudget as b, AnalyzeResumeInput as c, ATSAnalysisResult as d, ATSWeights as e, KeywordCategory as f, KeywordEntry as g, KeywordDensityConfig as h, SectionPenaltyConfig as i, ATSRule as j, ATSConfig as k, RuleContext as l, ResumeSection as m, ParsedExperienceEntry as n, ParsedAchievement as o, ParsedLanguage as p, ParsedResume as q, ParsedJobDescription as r, ATSBreakdown as s, KeywordWeight as t, LLMClient as u, LLMFeatures as v, AnalyzeResumeInputV2 as w, LLMUsageStats as x };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pranavraut033/ats-checker",
3
- "version": "1.2.0",
3
+ "version": "1.3.2",
4
4
  "description": "Deterministic, configurable ATS (Applicant Tracking System) compatibility checker with no external dependencies. Analyze resumes, generate scores, and get actionable suggestions.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -40,6 +40,18 @@
40
40
  "import": "./dist/pdf/index.mjs",
41
41
  "require": "./dist/pdf/index.cjs",
42
42
  "default": "./dist/pdf/index.mjs"
43
+ },
44
+ "./en": {
45
+ "types": "./dist/lang/en/index.d.ts",
46
+ "import": "./dist/lang/en/index.mjs",
47
+ "require": "./dist/lang/en/index.cjs",
48
+ "default": "./dist/lang/en/index.mjs"
49
+ },
50
+ "./de": {
51
+ "types": "./dist/lang/de/index.d.ts",
52
+ "import": "./dist/lang/de/index.mjs",
53
+ "require": "./dist/lang/de/index.cjs",
54
+ "default": "./dist/lang/de/index.mjs"
43
55
  }
44
56
  },
45
57
  "peerDependencies": {