lumnisai 0.1.25 → 0.1.27

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/dist/index.cjs CHANGED
@@ -1966,6 +1966,167 @@ class ResponsesResource {
1966
1966
  constructor(http) {
1967
1967
  this.http = http;
1968
1968
  }
1969
+ _getParamValue(obj, camel, snake) {
1970
+ if (!obj)
1971
+ return void 0;
1972
+ if (Object.prototype.hasOwnProperty.call(obj, camel))
1973
+ return obj[camel];
1974
+ if (Object.prototype.hasOwnProperty.call(obj, snake))
1975
+ return obj[snake];
1976
+ return void 0;
1977
+ }
1978
+ _isPlainObject(value) {
1979
+ return !!value && typeof value === "object" && !Array.isArray(value);
1980
+ }
1981
+ _validateCriteriaDefinitions(criteriaDefinitions) {
1982
+ if (!Array.isArray(criteriaDefinitions))
1983
+ throw new ValidationError("criteria_definitions must be a list");
1984
+ if (criteriaDefinitions.length === 0)
1985
+ throw new ValidationError("criteria_definitions cannot be empty");
1986
+ const criterionIds = /* @__PURE__ */ new Set();
1987
+ const columnNames = /* @__PURE__ */ new Set();
1988
+ const validTypes = ["universal", "varying", "validation_only"];
1989
+ criteriaDefinitions.forEach((criterion, index) => {
1990
+ if (!this._isPlainObject(criterion))
1991
+ throw new ValidationError(`Criterion ${index} must be an object`);
1992
+ const criterionId = this._getParamValue(criterion, "criterionId", "criterion_id");
1993
+ const columnName = this._getParamValue(criterion, "columnName", "column_name");
1994
+ const criterionText = this._getParamValue(criterion, "criterionText", "criterion_text");
1995
+ const criterionType = this._getParamValue(criterion, "criterionType", "criterion_type");
1996
+ const weightRaw = this._getParamValue(criterion, "weight", "weight");
1997
+ if (!criterionId || typeof criterionId !== "string")
1998
+ throw new ValidationError(`Criterion ${index} criterion_id must be a non-empty string`);
1999
+ if (criterionIds.has(criterionId))
2000
+ throw new ValidationError(`Duplicate criterion_id: ${criterionId}`);
2001
+ criterionIds.add(criterionId);
2002
+ if (!columnName || typeof columnName !== "string")
2003
+ throw new ValidationError(`Criterion ${index} column_name must be a non-empty string`);
2004
+ if (columnNames.has(columnName))
2005
+ throw new ValidationError(`Duplicate column_name: ${columnName}`);
2006
+ columnNames.add(columnName);
2007
+ if (!criterionText || typeof criterionText !== "string")
2008
+ throw new ValidationError(`Criterion ${index} criterion_text must be a non-empty string`);
2009
+ if (!criterionType || !validTypes.includes(criterionType))
2010
+ throw new ValidationError(`Criterion ${index} has invalid criterion_type: ${String(criterionType)}`);
2011
+ const weight = Number(weightRaw);
2012
+ if (!Number.isFinite(weight))
2013
+ throw new ValidationError(`Criterion ${index} weight must be a number`);
2014
+ if (weight <= 0)
2015
+ throw new ValidationError(`Criterion ${index} weight must be positive`);
2016
+ });
2017
+ }
2018
+ _validateCriteriaClassification(criteriaClassification) {
2019
+ if (!this._isPlainObject(criteriaClassification))
2020
+ throw new ValidationError("criteria_classification must be an object");
2021
+ const universalCriteria = this._getParamValue(criteriaClassification, "universalCriteria", "universal_criteria");
2022
+ const varyingCriteria = this._getParamValue(criteriaClassification, "varyingCriteria", "varying_criteria");
2023
+ const validationOnlyCriteria = this._getParamValue(criteriaClassification, "validationOnlyCriteria", "validation_only_criteria");
2024
+ if (!Array.isArray(universalCriteria))
2025
+ throw new ValidationError("criteria_classification missing or invalid universal_criteria");
2026
+ if (!Array.isArray(varyingCriteria))
2027
+ throw new ValidationError("criteria_classification missing or invalid varying_criteria");
2028
+ if (!Array.isArray(validationOnlyCriteria))
2029
+ throw new ValidationError("criteria_classification missing or invalid validation_only_criteria");
2030
+ }
2031
+ _validateCriteriaParams(params, specializedAgent) {
2032
+ if (!params)
2033
+ return;
2034
+ const rawParams = params;
2035
+ const reuseCriteriaFrom = this._getParamValue(rawParams, "reuseCriteriaFrom", "reuse_criteria_from");
2036
+ const criteriaDefinitions = this._getParamValue(
2037
+ rawParams,
2038
+ "criteriaDefinitions",
2039
+ "criteria_definitions"
2040
+ );
2041
+ const criteriaClassification = this._getParamValue(
2042
+ rawParams,
2043
+ "criteriaClassification",
2044
+ "criteria_classification"
2045
+ );
2046
+ const runSingleCriterion = this._getParamValue(rawParams, "runSingleCriterion", "run_single_criterion");
2047
+ const addCriterion = this._getParamValue(rawParams, "addCriterion", "add_criterion");
2048
+ const addAndRunCriterion = this._getParamValue(
2049
+ rawParams,
2050
+ "addAndRunCriterion",
2051
+ "add_and_run_criterion"
2052
+ );
2053
+ const candidateProfiles = this._getParamValue(
2054
+ rawParams,
2055
+ "candidateProfiles",
2056
+ "candidate_profiles"
2057
+ );
2058
+ const hasCriteria = !!criteriaDefinitions && !!criteriaClassification;
2059
+ if (criteriaDefinitions && !criteriaClassification || !criteriaDefinitions && criteriaClassification) {
2060
+ throw new ValidationError(
2061
+ "When providing criteria directly, both criteria_definitions and criteria_classification must be provided."
2062
+ );
2063
+ }
2064
+ if (criteriaDefinitions || criteriaClassification) {
2065
+ this._validateCriteriaDefinitions(criteriaDefinitions);
2066
+ this._validateCriteriaClassification(criteriaClassification);
2067
+ }
2068
+ if (runSingleCriterion) {
2069
+ if (!reuseCriteriaFrom && !hasCriteria) {
2070
+ throw new ValidationError(
2071
+ "run_single_criterion requires reuse_criteria_from or explicit criteria_definitions/criteria_classification."
2072
+ );
2073
+ }
2074
+ if (typeof runSingleCriterion !== "string" || !runSingleCriterion.trim()) {
2075
+ throw new ValidationError("run_single_criterion must be a non-empty string");
2076
+ }
2077
+ }
2078
+ if (addCriterion) {
2079
+ if (!reuseCriteriaFrom && !hasCriteria)
2080
+ throw new ValidationError("add_criterion requires existing criteria (reuse or direct criteria).");
2081
+ if (!this._isPlainObject(addCriterion))
2082
+ throw new ValidationError("add_criterion must be an object");
2083
+ const columnName = this._getParamValue(addCriterion, "columnName", "column_name");
2084
+ const criterionText = this._getParamValue(addCriterion, "criterionText", "criterion_text");
2085
+ if (!columnName || typeof columnName !== "string")
2086
+ throw new ValidationError("add_criterion requires column_name");
2087
+ if (!criterionText || typeof criterionText !== "string")
2088
+ throw new ValidationError("add_criterion requires criterion_text");
2089
+ }
2090
+ if (addAndRunCriterion !== void 0) {
2091
+ if (!reuseCriteriaFrom && !hasCriteria)
2092
+ throw new ValidationError("add_and_run_criterion requires existing criteria (reuse or direct criteria).");
2093
+ if (typeof addAndRunCriterion === "string") {
2094
+ if (!addAndRunCriterion.trim())
2095
+ throw new ValidationError("add_and_run_criterion must be a non-empty string");
2096
+ } else if (this._isPlainObject(addAndRunCriterion)) {
2097
+ const criterionText = this._getParamValue(addAndRunCriterion, "criterionText", "criterion_text");
2098
+ const suggestedColumnName = this._getParamValue(
2099
+ addAndRunCriterion,
2100
+ "suggestedColumnName",
2101
+ "suggested_column_name"
2102
+ );
2103
+ if (!criterionText || typeof criterionText !== "string")
2104
+ throw new ValidationError("add_and_run_criterion object requires criterion_text");
2105
+ if (suggestedColumnName !== void 0 && typeof suggestedColumnName !== "string")
2106
+ throw new ValidationError("add_and_run_criterion suggested_column_name must be a string if provided");
2107
+ } else {
2108
+ throw new ValidationError("add_and_run_criterion must be a string or an object");
2109
+ }
2110
+ }
2111
+ if (specializedAgent === "people_scoring") {
2112
+ if (!candidateProfiles || !Array.isArray(candidateProfiles) || candidateProfiles.length === 0)
2113
+ throw new ValidationError("candidate_profiles is required for people_scoring agent and must be a non-empty list");
2114
+ const missingIds = [];
2115
+ candidateProfiles.forEach((candidate, index) => {
2116
+ const c = candidate || {};
2117
+ const linkedinUrl = c.linkedin_url || c.linkedinUrl;
2118
+ const email = c.email;
2119
+ const emails = c.emails;
2120
+ if (!linkedinUrl && !email && (!emails || !Array.isArray(emails) || emails.length === 0))
2121
+ missingIds.push({ index, name: c.name });
2122
+ });
2123
+ if (missingIds.length > 0) {
2124
+ throw new ValidationError(
2125
+ `Each candidate in candidate_profiles must include at least one identifier: linkedin_url or email. Missing identifiers for ${missingIds.length} candidates: ${JSON.stringify(missingIds)}`
2126
+ );
2127
+ }
2128
+ }
2129
+ }
1969
2130
  _validateFileReference(uri) {
1970
2131
  if (uri.startsWith("artifact_"))
1971
2132
  return;
@@ -2006,6 +2167,8 @@ class ResponsesResource {
2006
2167
  for (const file of request.files)
2007
2168
  this._validateFileReference(file.uri);
2008
2169
  }
2170
+ if (request.specializedAgentParams)
2171
+ this._validateCriteriaParams(request.specializedAgentParams, request.specializedAgent);
2009
2172
  return this.http.post("/responses", request);
2010
2173
  }
2011
2174
  /**
@@ -2104,6 +2267,105 @@ class ResponsesResource {
2104
2267
  }
2105
2268
  return this.create(request);
2106
2269
  }
2270
+ /**
2271
+ * Perform a deep people search with AI-generated criteria and validation
2272
+ * @param query - Natural language search query describing ideal candidates
2273
+ * @param options - Optional search parameters
2274
+ * @param options.requestedCandidates - Number of candidates to find (default: 100)
2275
+ * @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
2276
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
2277
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
2278
+ * @param options.criteriaClassification - Pre-defined criteria classification
2279
+ * @param options.runSingleCriterion - Run only a single criterion by ID
2280
+ * @param options.addCriterion - Add a new criterion to existing criteria
2281
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
2282
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
2283
+ * Example string: 'Must have 5+ years Python experience'
2284
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
2285
+ * @param options.excludeProfiles - LinkedIn URLs to exclude from results
2286
+ * @param options.excludePreviouslyContacted - Exclude previously contacted people
2287
+ * @param options.excludeNames - Names to exclude from results
2288
+ * @returns Response with structured_response containing:
2289
+ * - candidates: Validated and scored candidates
2290
+ * - criteria: Generated/reused criteria definitions and classification
2291
+ * - searchStats: Search execution statistics
2292
+ */
2293
+ async deepPeopleSearch(query, options) {
2294
+ const request = {
2295
+ messages: [{ role: "user", content: query }],
2296
+ specializedAgent: "deep_people_search"
2297
+ };
2298
+ if (options) {
2299
+ const params = {};
2300
+ if (options.requestedCandidates !== void 0)
2301
+ params.requestedCandidates = options.requestedCandidates;
2302
+ if (options.dataSources)
2303
+ params.dataSources = options.dataSources;
2304
+ if (options.reuseCriteriaFrom)
2305
+ params.reuseCriteriaFrom = options.reuseCriteriaFrom;
2306
+ if (options.criteriaDefinitions)
2307
+ params.criteriaDefinitions = options.criteriaDefinitions;
2308
+ if (options.criteriaClassification)
2309
+ params.criteriaClassification = options.criteriaClassification;
2310
+ if (options.runSingleCriterion)
2311
+ params.runSingleCriterion = options.runSingleCriterion;
2312
+ if (options.addCriterion)
2313
+ params.addCriterion = options.addCriterion;
2314
+ if (options.addAndRunCriterion)
2315
+ params.addAndRunCriterion = options.addAndRunCriterion;
2316
+ if (options.excludeProfiles)
2317
+ params.excludeProfiles = options.excludeProfiles;
2318
+ if (options.excludePreviouslyContacted !== void 0)
2319
+ params.excludePreviouslyContacted = options.excludePreviouslyContacted;
2320
+ if (options.excludeNames)
2321
+ params.excludeNames = options.excludeNames;
2322
+ if (Object.keys(params).length > 0)
2323
+ request.specializedAgentParams = params;
2324
+ }
2325
+ return this.create(request);
2326
+ }
2327
+ /**
2328
+ * Score provided candidates against AI-generated or provided criteria
2329
+ * @param query - Natural language description of ideal candidate criteria
2330
+ * @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
2331
+ * @param options - Optional scoring parameters
2332
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
2333
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
2334
+ * @param options.criteriaClassification - Pre-defined criteria classification
2335
+ * @param options.runSingleCriterion - Run only a single criterion by ID
2336
+ * @param options.addCriterion - Add a new criterion to existing criteria
2337
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
2338
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
2339
+ * Example string: 'Must have 5+ years Python experience'
2340
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
2341
+ * @returns Response with structured_response containing:
2342
+ * - candidates: Scored candidates with validation results
2343
+ * - criteria: Generated/reused criteria definitions and classification
2344
+ */
2345
+ async peopleScoring(query, candidateProfiles, options) {
2346
+ const request = {
2347
+ messages: [{ role: "user", content: query }],
2348
+ specializedAgent: "people_scoring",
2349
+ specializedAgentParams: {
2350
+ candidateProfiles
2351
+ }
2352
+ };
2353
+ if (options) {
2354
+ if (options.reuseCriteriaFrom)
2355
+ request.specializedAgentParams.reuseCriteriaFrom = options.reuseCriteriaFrom;
2356
+ if (options.criteriaDefinitions)
2357
+ request.specializedAgentParams.criteriaDefinitions = options.criteriaDefinitions;
2358
+ if (options.criteriaClassification)
2359
+ request.specializedAgentParams.criteriaClassification = options.criteriaClassification;
2360
+ if (options.runSingleCriterion)
2361
+ request.specializedAgentParams.runSingleCriterion = options.runSingleCriterion;
2362
+ if (options.addCriterion)
2363
+ request.specializedAgentParams.addCriterion = options.addCriterion;
2364
+ if (options.addAndRunCriterion)
2365
+ request.specializedAgentParams.addAndRunCriterion = options.addAndRunCriterion;
2366
+ }
2367
+ return this.create(request);
2368
+ }
2107
2369
  }
2108
2370
 
2109
2371
  class SkillsResource {
package/dist/index.d.cts CHANGED
@@ -638,11 +638,48 @@ interface AgentConfig {
638
638
  interface ModelOverrides {
639
639
  [key: string]: string;
640
640
  }
641
+ type CriterionType = 'universal' | 'varying' | 'validation_only';
642
+ interface CriterionDefinition {
643
+ criterionId: string;
644
+ columnName: string;
645
+ criterionText: string;
646
+ criterionType: CriterionType;
647
+ weight: number;
648
+ }
649
+ interface CriteriaClassification {
650
+ universalCriteria: CriterionDefinition[];
651
+ varyingCriteria: CriterionDefinition[];
652
+ validationOnlyCriteria: CriterionDefinition[];
653
+ universalReasoning?: string;
654
+ varyingReasoning?: string;
655
+ validationReasoning?: string;
656
+ }
657
+ interface AddCriterionRequest {
658
+ columnName: string;
659
+ criterionText: string;
660
+ criterionType?: CriterionType;
661
+ weight?: number;
662
+ }
663
+ interface AddAndRunCriterionRequest {
664
+ criterionText: string;
665
+ suggestedColumnName?: string;
666
+ }
667
+ interface CriteriaMetadata {
668
+ version: number;
669
+ createdAt: string;
670
+ source: 'generated' | 'reused' | 'provided';
671
+ sourceResponseId?: string;
672
+ criteriaDefinitions: CriterionDefinition[];
673
+ criteriaClassification: CriteriaClassification;
674
+ }
675
+ interface StructuredResponse extends Record<string, any> {
676
+ criteria?: CriteriaMetadata;
677
+ }
641
678
  /**
642
679
  * Available specialized agents
643
680
  * Using a union type that can be extended with any string to support future agents
644
681
  */
645
- type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | (string & {});
682
+ type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | 'people_scoring' | (string & {});
646
683
  /**
647
684
  * Parameters for specialized agent execution
648
685
  * This is a flexible interface that supports any agent-specific parameters
@@ -677,6 +714,39 @@ interface SpecializedAgentParams {
677
714
  * Names to exclude from results (passed through to CrustData post-processing when supported).
678
715
  */
679
716
  excludeNames?: string[];
717
+ /**
718
+ * Response ID to reuse criteria from.
719
+ */
720
+ reuseCriteriaFrom?: string;
721
+ /**
722
+ * Pre-defined criteria definitions to use.
723
+ */
724
+ criteriaDefinitions?: CriterionDefinition[];
725
+ /**
726
+ * Pre-defined criteria classification to use.
727
+ */
728
+ criteriaClassification?: CriteriaClassification;
729
+ /**
730
+ * Run validation against a single criterion ID.
731
+ */
732
+ runSingleCriterion?: string;
733
+ /**
734
+ * Add a new criterion to existing criteria.
735
+ */
736
+ addCriterion?: AddCriterionRequest;
737
+ /**
738
+ * Add a new criterion from English text and run only that criterion.
739
+ * Can be a string (criterion text) or an object with criterion_text and optional suggested_column_name.
740
+ * Example string: 'Must have 5+ years Python experience'
741
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
742
+ * If suggestedColumnName not provided, it will be auto-generated from the text.
743
+ */
744
+ addAndRunCriterion?: string | AddAndRunCriterionRequest;
745
+ /**
746
+ * List of candidate profiles to score (for people_scoring agent).
747
+ * Each candidate must include at least one identifier: linkedin_url or email/emails.
748
+ */
749
+ candidateProfiles?: Array<Record<string, any>>;
680
750
  /**
681
751
  * Additional parameters for any specialized agent
682
752
  * This allows flexibility for future agents without SDK updates
@@ -695,7 +765,7 @@ interface CreateResponseRequest {
695
765
  modelOverrides?: ModelOverrides;
696
766
  /**
697
767
  * Route to a specialized agent instead of the main Lumnis agent
698
- * Known agents: 'quick_people_search', 'deep_people_search'
768
+ * Known agents: 'quick_people_search', 'deep_people_search', 'people_scoring'
699
769
  * Accepts any string to support future agents without SDK updates
700
770
  */
701
771
  specializedAgent?: SpecializedAgentType;
@@ -728,7 +798,7 @@ interface ResponseObject {
728
798
  outputText?: string | null;
729
799
  content?: string | null;
730
800
  responseTitle?: string | null;
731
- structuredResponse?: Record<string, any> | null;
801
+ structuredResponse?: StructuredResponse | null;
732
802
  artifacts?: ResponseArtifact[] | null;
733
803
  createdAt: string;
734
804
  completedAt?: string | null;
@@ -2806,6 +2876,11 @@ declare class PeopleResource {
2806
2876
  declare class ResponsesResource {
2807
2877
  private readonly http;
2808
2878
  constructor(http: Http);
2879
+ private _getParamValue;
2880
+ private _isPlainObject;
2881
+ private _validateCriteriaDefinitions;
2882
+ private _validateCriteriaClassification;
2883
+ private _validateCriteriaParams;
2809
2884
  private _validateFileReference;
2810
2885
  /**
2811
2886
  * Create a new response request for asynchronous processing
@@ -2878,6 +2953,78 @@ declare class ResponsesResource {
2878
2953
  limit?: number;
2879
2954
  dataSources?: string[];
2880
2955
  }): Promise<CreateResponseResponse>;
2956
+ /**
2957
+ * Perform a deep people search with AI-generated criteria and validation
2958
+ * @param query - Natural language search query describing ideal candidates
2959
+ * @param options - Optional search parameters
2960
+ * @param options.requestedCandidates - Number of candidates to find (default: 100)
2961
+ * @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
2962
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
2963
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
2964
+ * @param options.criteriaClassification - Pre-defined criteria classification
2965
+ * @param options.runSingleCriterion - Run only a single criterion by ID
2966
+ * @param options.addCriterion - Add a new criterion to existing criteria
2967
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
2968
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
2969
+ * Example string: 'Must have 5+ years Python experience'
2970
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
2971
+ * @param options.excludeProfiles - LinkedIn URLs to exclude from results
2972
+ * @param options.excludePreviouslyContacted - Exclude previously contacted people
2973
+ * @param options.excludeNames - Names to exclude from results
2974
+ * @returns Response with structured_response containing:
2975
+ * - candidates: Validated and scored candidates
2976
+ * - criteria: Generated/reused criteria definitions and classification
2977
+ * - searchStats: Search execution statistics
2978
+ */
2979
+ deepPeopleSearch(query: string, options?: {
2980
+ requestedCandidates?: number;
2981
+ dataSources?: string[];
2982
+ reuseCriteriaFrom?: string;
2983
+ criteriaDefinitions?: CriterionDefinition[];
2984
+ criteriaClassification?: CriteriaClassification;
2985
+ runSingleCriterion?: string;
2986
+ addCriterion?: {
2987
+ columnName: string;
2988
+ criterionText: string;
2989
+ criterionType?: CriterionType;
2990
+ weight?: number;
2991
+ };
2992
+ addAndRunCriterion?: string | AddAndRunCriterionRequest;
2993
+ excludeProfiles?: string[];
2994
+ excludePreviouslyContacted?: boolean;
2995
+ excludeNames?: string[];
2996
+ }): Promise<CreateResponseResponse>;
2997
+ /**
2998
+ * Score provided candidates against AI-generated or provided criteria
2999
+ * @param query - Natural language description of ideal candidate criteria
3000
+ * @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
3001
+ * @param options - Optional scoring parameters
3002
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
3003
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
3004
+ * @param options.criteriaClassification - Pre-defined criteria classification
3005
+ * @param options.runSingleCriterion - Run only a single criterion by ID
3006
+ * @param options.addCriterion - Add a new criterion to existing criteria
3007
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
3008
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
3009
+ * Example string: 'Must have 5+ years Python experience'
3010
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
3011
+ * @returns Response with structured_response containing:
3012
+ * - candidates: Scored candidates with validation results
3013
+ * - criteria: Generated/reused criteria definitions and classification
3014
+ */
3015
+ peopleScoring(query: string, candidateProfiles: Array<Record<string, any>>, options?: {
3016
+ reuseCriteriaFrom?: string;
3017
+ criteriaDefinitions?: CriterionDefinition[];
3018
+ criteriaClassification?: CriteriaClassification;
3019
+ runSingleCriterion?: string;
3020
+ addCriterion?: {
3021
+ columnName: string;
3022
+ criterionText: string;
3023
+ criterionType?: CriterionType;
3024
+ weight?: number;
3025
+ };
3026
+ addAndRunCriterion?: string | AddAndRunCriterionRequest;
3027
+ }): Promise<CreateResponseResponse>;
2881
3028
  }
2882
3029
 
2883
3030
  declare class SkillsResource {
@@ -3331,4 +3478,4 @@ declare class ProgressTracker {
3331
3478
  */
3332
3479
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
3333
3480
 
3334
- export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
3481
+ export { ACTION_DELAYS, type AddAndRunCriterionRequest, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionType, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
package/dist/index.d.mts CHANGED
@@ -638,11 +638,48 @@ interface AgentConfig {
638
638
  interface ModelOverrides {
639
639
  [key: string]: string;
640
640
  }
641
+ type CriterionType = 'universal' | 'varying' | 'validation_only';
642
+ interface CriterionDefinition {
643
+ criterionId: string;
644
+ columnName: string;
645
+ criterionText: string;
646
+ criterionType: CriterionType;
647
+ weight: number;
648
+ }
649
+ interface CriteriaClassification {
650
+ universalCriteria: CriterionDefinition[];
651
+ varyingCriteria: CriterionDefinition[];
652
+ validationOnlyCriteria: CriterionDefinition[];
653
+ universalReasoning?: string;
654
+ varyingReasoning?: string;
655
+ validationReasoning?: string;
656
+ }
657
+ interface AddCriterionRequest {
658
+ columnName: string;
659
+ criterionText: string;
660
+ criterionType?: CriterionType;
661
+ weight?: number;
662
+ }
663
+ interface AddAndRunCriterionRequest {
664
+ criterionText: string;
665
+ suggestedColumnName?: string;
666
+ }
667
+ interface CriteriaMetadata {
668
+ version: number;
669
+ createdAt: string;
670
+ source: 'generated' | 'reused' | 'provided';
671
+ sourceResponseId?: string;
672
+ criteriaDefinitions: CriterionDefinition[];
673
+ criteriaClassification: CriteriaClassification;
674
+ }
675
+ interface StructuredResponse extends Record<string, any> {
676
+ criteria?: CriteriaMetadata;
677
+ }
641
678
  /**
642
679
  * Available specialized agents
643
680
  * Using a union type that can be extended with any string to support future agents
644
681
  */
645
- type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | (string & {});
682
+ type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | 'people_scoring' | (string & {});
646
683
  /**
647
684
  * Parameters for specialized agent execution
648
685
  * This is a flexible interface that supports any agent-specific parameters
@@ -677,6 +714,39 @@ interface SpecializedAgentParams {
677
714
  * Names to exclude from results (passed through to CrustData post-processing when supported).
678
715
  */
679
716
  excludeNames?: string[];
717
+ /**
718
+ * Response ID to reuse criteria from.
719
+ */
720
+ reuseCriteriaFrom?: string;
721
+ /**
722
+ * Pre-defined criteria definitions to use.
723
+ */
724
+ criteriaDefinitions?: CriterionDefinition[];
725
+ /**
726
+ * Pre-defined criteria classification to use.
727
+ */
728
+ criteriaClassification?: CriteriaClassification;
729
+ /**
730
+ * Run validation against a single criterion ID.
731
+ */
732
+ runSingleCriterion?: string;
733
+ /**
734
+ * Add a new criterion to existing criteria.
735
+ */
736
+ addCriterion?: AddCriterionRequest;
737
+ /**
738
+ * Add a new criterion from English text and run only that criterion.
739
+ * Can be a string (criterion text) or an object with criterion_text and optional suggested_column_name.
740
+ * Example string: 'Must have 5+ years Python experience'
741
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
742
+ * If suggestedColumnName not provided, it will be auto-generated from the text.
743
+ */
744
+ addAndRunCriterion?: string | AddAndRunCriterionRequest;
745
+ /**
746
+ * List of candidate profiles to score (for people_scoring agent).
747
+ * Each candidate must include at least one identifier: linkedin_url or email/emails.
748
+ */
749
+ candidateProfiles?: Array<Record<string, any>>;
680
750
  /**
681
751
  * Additional parameters for any specialized agent
682
752
  * This allows flexibility for future agents without SDK updates
@@ -695,7 +765,7 @@ interface CreateResponseRequest {
695
765
  modelOverrides?: ModelOverrides;
696
766
  /**
697
767
  * Route to a specialized agent instead of the main Lumnis agent
698
- * Known agents: 'quick_people_search', 'deep_people_search'
768
+ * Known agents: 'quick_people_search', 'deep_people_search', 'people_scoring'
699
769
  * Accepts any string to support future agents without SDK updates
700
770
  */
701
771
  specializedAgent?: SpecializedAgentType;
@@ -728,7 +798,7 @@ interface ResponseObject {
728
798
  outputText?: string | null;
729
799
  content?: string | null;
730
800
  responseTitle?: string | null;
731
- structuredResponse?: Record<string, any> | null;
801
+ structuredResponse?: StructuredResponse | null;
732
802
  artifacts?: ResponseArtifact[] | null;
733
803
  createdAt: string;
734
804
  completedAt?: string | null;
@@ -2806,6 +2876,11 @@ declare class PeopleResource {
2806
2876
  declare class ResponsesResource {
2807
2877
  private readonly http;
2808
2878
  constructor(http: Http);
2879
+ private _getParamValue;
2880
+ private _isPlainObject;
2881
+ private _validateCriteriaDefinitions;
2882
+ private _validateCriteriaClassification;
2883
+ private _validateCriteriaParams;
2809
2884
  private _validateFileReference;
2810
2885
  /**
2811
2886
  * Create a new response request for asynchronous processing
@@ -2878,6 +2953,78 @@ declare class ResponsesResource {
2878
2953
  limit?: number;
2879
2954
  dataSources?: string[];
2880
2955
  }): Promise<CreateResponseResponse>;
2956
+ /**
2957
+ * Perform a deep people search with AI-generated criteria and validation
2958
+ * @param query - Natural language search query describing ideal candidates
2959
+ * @param options - Optional search parameters
2960
+ * @param options.requestedCandidates - Number of candidates to find (default: 100)
2961
+ * @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
2962
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
2963
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
2964
+ * @param options.criteriaClassification - Pre-defined criteria classification
2965
+ * @param options.runSingleCriterion - Run only a single criterion by ID
2966
+ * @param options.addCriterion - Add a new criterion to existing criteria
2967
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
2968
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
2969
+ * Example string: 'Must have 5+ years Python experience'
2970
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
2971
+ * @param options.excludeProfiles - LinkedIn URLs to exclude from results
2972
+ * @param options.excludePreviouslyContacted - Exclude previously contacted people
2973
+ * @param options.excludeNames - Names to exclude from results
2974
+ * @returns Response with structured_response containing:
2975
+ * - candidates: Validated and scored candidates
2976
+ * - criteria: Generated/reused criteria definitions and classification
2977
+ * - searchStats: Search execution statistics
2978
+ */
2979
+ deepPeopleSearch(query: string, options?: {
2980
+ requestedCandidates?: number;
2981
+ dataSources?: string[];
2982
+ reuseCriteriaFrom?: string;
2983
+ criteriaDefinitions?: CriterionDefinition[];
2984
+ criteriaClassification?: CriteriaClassification;
2985
+ runSingleCriterion?: string;
2986
+ addCriterion?: {
2987
+ columnName: string;
2988
+ criterionText: string;
2989
+ criterionType?: CriterionType;
2990
+ weight?: number;
2991
+ };
2992
+ addAndRunCriterion?: string | AddAndRunCriterionRequest;
2993
+ excludeProfiles?: string[];
2994
+ excludePreviouslyContacted?: boolean;
2995
+ excludeNames?: string[];
2996
+ }): Promise<CreateResponseResponse>;
2997
+ /**
2998
+ * Score provided candidates against AI-generated or provided criteria
2999
+ * @param query - Natural language description of ideal candidate criteria
3000
+ * @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
3001
+ * @param options - Optional scoring parameters
3002
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
3003
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
3004
+ * @param options.criteriaClassification - Pre-defined criteria classification
3005
+ * @param options.runSingleCriterion - Run only a single criterion by ID
3006
+ * @param options.addCriterion - Add a new criterion to existing criteria
3007
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
3008
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
3009
+ * Example string: 'Must have 5+ years Python experience'
3010
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
3011
+ * @returns Response with structured_response containing:
3012
+ * - candidates: Scored candidates with validation results
3013
+ * - criteria: Generated/reused criteria definitions and classification
3014
+ */
3015
+ peopleScoring(query: string, candidateProfiles: Array<Record<string, any>>, options?: {
3016
+ reuseCriteriaFrom?: string;
3017
+ criteriaDefinitions?: CriterionDefinition[];
3018
+ criteriaClassification?: CriteriaClassification;
3019
+ runSingleCriterion?: string;
3020
+ addCriterion?: {
3021
+ columnName: string;
3022
+ criterionText: string;
3023
+ criterionType?: CriterionType;
3024
+ weight?: number;
3025
+ };
3026
+ addAndRunCriterion?: string | AddAndRunCriterionRequest;
3027
+ }): Promise<CreateResponseResponse>;
2881
3028
  }
2882
3029
 
2883
3030
  declare class SkillsResource {
@@ -3331,4 +3478,4 @@ declare class ProgressTracker {
3331
3478
  */
3332
3479
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
3333
3480
 
3334
- export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
3481
+ export { ACTION_DELAYS, type AddAndRunCriterionRequest, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionType, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -638,11 +638,48 @@ interface AgentConfig {
638
638
  interface ModelOverrides {
639
639
  [key: string]: string;
640
640
  }
641
+ type CriterionType = 'universal' | 'varying' | 'validation_only';
642
+ interface CriterionDefinition {
643
+ criterionId: string;
644
+ columnName: string;
645
+ criterionText: string;
646
+ criterionType: CriterionType;
647
+ weight: number;
648
+ }
649
+ interface CriteriaClassification {
650
+ universalCriteria: CriterionDefinition[];
651
+ varyingCriteria: CriterionDefinition[];
652
+ validationOnlyCriteria: CriterionDefinition[];
653
+ universalReasoning?: string;
654
+ varyingReasoning?: string;
655
+ validationReasoning?: string;
656
+ }
657
+ interface AddCriterionRequest {
658
+ columnName: string;
659
+ criterionText: string;
660
+ criterionType?: CriterionType;
661
+ weight?: number;
662
+ }
663
+ interface AddAndRunCriterionRequest {
664
+ criterionText: string;
665
+ suggestedColumnName?: string;
666
+ }
667
+ interface CriteriaMetadata {
668
+ version: number;
669
+ createdAt: string;
670
+ source: 'generated' | 'reused' | 'provided';
671
+ sourceResponseId?: string;
672
+ criteriaDefinitions: CriterionDefinition[];
673
+ criteriaClassification: CriteriaClassification;
674
+ }
675
+ interface StructuredResponse extends Record<string, any> {
676
+ criteria?: CriteriaMetadata;
677
+ }
641
678
  /**
642
679
  * Available specialized agents
643
680
  * Using a union type that can be extended with any string to support future agents
644
681
  */
645
- type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | (string & {});
682
+ type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | 'people_scoring' | (string & {});
646
683
  /**
647
684
  * Parameters for specialized agent execution
648
685
  * This is a flexible interface that supports any agent-specific parameters
@@ -677,6 +714,39 @@ interface SpecializedAgentParams {
677
714
  * Names to exclude from results (passed through to CrustData post-processing when supported).
678
715
  */
679
716
  excludeNames?: string[];
717
+ /**
718
+ * Response ID to reuse criteria from.
719
+ */
720
+ reuseCriteriaFrom?: string;
721
+ /**
722
+ * Pre-defined criteria definitions to use.
723
+ */
724
+ criteriaDefinitions?: CriterionDefinition[];
725
+ /**
726
+ * Pre-defined criteria classification to use.
727
+ */
728
+ criteriaClassification?: CriteriaClassification;
729
+ /**
730
+ * Run validation against a single criterion ID.
731
+ */
732
+ runSingleCriterion?: string;
733
+ /**
734
+ * Add a new criterion to existing criteria.
735
+ */
736
+ addCriterion?: AddCriterionRequest;
737
+ /**
738
+ * Add a new criterion from English text and run only that criterion.
739
+ * Can be a string (criterion text) or an object with criterion_text and optional suggested_column_name.
740
+ * Example string: 'Must have 5+ years Python experience'
741
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
742
+ * If suggestedColumnName not provided, it will be auto-generated from the text.
743
+ */
744
+ addAndRunCriterion?: string | AddAndRunCriterionRequest;
745
+ /**
746
+ * List of candidate profiles to score (for people_scoring agent).
747
+ * Each candidate must include at least one identifier: linkedin_url or email/emails.
748
+ */
749
+ candidateProfiles?: Array<Record<string, any>>;
680
750
  /**
681
751
  * Additional parameters for any specialized agent
682
752
  * This allows flexibility for future agents without SDK updates
@@ -695,7 +765,7 @@ interface CreateResponseRequest {
695
765
  modelOverrides?: ModelOverrides;
696
766
  /**
697
767
  * Route to a specialized agent instead of the main Lumnis agent
698
- * Known agents: 'quick_people_search', 'deep_people_search'
768
+ * Known agents: 'quick_people_search', 'deep_people_search', 'people_scoring'
699
769
  * Accepts any string to support future agents without SDK updates
700
770
  */
701
771
  specializedAgent?: SpecializedAgentType;
@@ -728,7 +798,7 @@ interface ResponseObject {
728
798
  outputText?: string | null;
729
799
  content?: string | null;
730
800
  responseTitle?: string | null;
731
- structuredResponse?: Record<string, any> | null;
801
+ structuredResponse?: StructuredResponse | null;
732
802
  artifacts?: ResponseArtifact[] | null;
733
803
  createdAt: string;
734
804
  completedAt?: string | null;
@@ -2806,6 +2876,11 @@ declare class PeopleResource {
2806
2876
  declare class ResponsesResource {
2807
2877
  private readonly http;
2808
2878
  constructor(http: Http);
2879
+ private _getParamValue;
2880
+ private _isPlainObject;
2881
+ private _validateCriteriaDefinitions;
2882
+ private _validateCriteriaClassification;
2883
+ private _validateCriteriaParams;
2809
2884
  private _validateFileReference;
2810
2885
  /**
2811
2886
  * Create a new response request for asynchronous processing
@@ -2878,6 +2953,78 @@ declare class ResponsesResource {
2878
2953
  limit?: number;
2879
2954
  dataSources?: string[];
2880
2955
  }): Promise<CreateResponseResponse>;
2956
+ /**
2957
+ * Perform a deep people search with AI-generated criteria and validation
2958
+ * @param query - Natural language search query describing ideal candidates
2959
+ * @param options - Optional search parameters
2960
+ * @param options.requestedCandidates - Number of candidates to find (default: 100)
2961
+ * @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
2962
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
2963
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
2964
+ * @param options.criteriaClassification - Pre-defined criteria classification
2965
+ * @param options.runSingleCriterion - Run only a single criterion by ID
2966
+ * @param options.addCriterion - Add a new criterion to existing criteria
2967
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
2968
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
2969
+ * Example string: 'Must have 5+ years Python experience'
2970
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
2971
+ * @param options.excludeProfiles - LinkedIn URLs to exclude from results
2972
+ * @param options.excludePreviouslyContacted - Exclude previously contacted people
2973
+ * @param options.excludeNames - Names to exclude from results
2974
+ * @returns Response with structured_response containing:
2975
+ * - candidates: Validated and scored candidates
2976
+ * - criteria: Generated/reused criteria definitions and classification
2977
+ * - searchStats: Search execution statistics
2978
+ */
2979
+ deepPeopleSearch(query: string, options?: {
2980
+ requestedCandidates?: number;
2981
+ dataSources?: string[];
2982
+ reuseCriteriaFrom?: string;
2983
+ criteriaDefinitions?: CriterionDefinition[];
2984
+ criteriaClassification?: CriteriaClassification;
2985
+ runSingleCriterion?: string;
2986
+ addCriterion?: {
2987
+ columnName: string;
2988
+ criterionText: string;
2989
+ criterionType?: CriterionType;
2990
+ weight?: number;
2991
+ };
2992
+ addAndRunCriterion?: string | AddAndRunCriterionRequest;
2993
+ excludeProfiles?: string[];
2994
+ excludePreviouslyContacted?: boolean;
2995
+ excludeNames?: string[];
2996
+ }): Promise<CreateResponseResponse>;
2997
+ /**
2998
+ * Score provided candidates against AI-generated or provided criteria
2999
+ * @param query - Natural language description of ideal candidate criteria
3000
+ * @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
3001
+ * @param options - Optional scoring parameters
3002
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
3003
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
3004
+ * @param options.criteriaClassification - Pre-defined criteria classification
3005
+ * @param options.runSingleCriterion - Run only a single criterion by ID
3006
+ * @param options.addCriterion - Add a new criterion to existing criteria
3007
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
3008
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
3009
+ * Example string: 'Must have 5+ years Python experience'
3010
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
3011
+ * @returns Response with structured_response containing:
3012
+ * - candidates: Scored candidates with validation results
3013
+ * - criteria: Generated/reused criteria definitions and classification
3014
+ */
3015
+ peopleScoring(query: string, candidateProfiles: Array<Record<string, any>>, options?: {
3016
+ reuseCriteriaFrom?: string;
3017
+ criteriaDefinitions?: CriterionDefinition[];
3018
+ criteriaClassification?: CriteriaClassification;
3019
+ runSingleCriterion?: string;
3020
+ addCriterion?: {
3021
+ columnName: string;
3022
+ criterionText: string;
3023
+ criterionType?: CriterionType;
3024
+ weight?: number;
3025
+ };
3026
+ addAndRunCriterion?: string | AddAndRunCriterionRequest;
3027
+ }): Promise<CreateResponseResponse>;
2881
3028
  }
2882
3029
 
2883
3030
  declare class SkillsResource {
@@ -3331,4 +3478,4 @@ declare class ProgressTracker {
3331
3478
  */
3332
3479
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
3333
3480
 
3334
- export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
3481
+ export { ACTION_DELAYS, type AddAndRunCriterionRequest, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, BatchJobStatus, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionType, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
package/dist/index.mjs CHANGED
@@ -1960,6 +1960,167 @@ class ResponsesResource {
1960
1960
  constructor(http) {
1961
1961
  this.http = http;
1962
1962
  }
1963
+ _getParamValue(obj, camel, snake) {
1964
+ if (!obj)
1965
+ return void 0;
1966
+ if (Object.prototype.hasOwnProperty.call(obj, camel))
1967
+ return obj[camel];
1968
+ if (Object.prototype.hasOwnProperty.call(obj, snake))
1969
+ return obj[snake];
1970
+ return void 0;
1971
+ }
1972
+ _isPlainObject(value) {
1973
+ return !!value && typeof value === "object" && !Array.isArray(value);
1974
+ }
1975
+ _validateCriteriaDefinitions(criteriaDefinitions) {
1976
+ if (!Array.isArray(criteriaDefinitions))
1977
+ throw new ValidationError("criteria_definitions must be a list");
1978
+ if (criteriaDefinitions.length === 0)
1979
+ throw new ValidationError("criteria_definitions cannot be empty");
1980
+ const criterionIds = /* @__PURE__ */ new Set();
1981
+ const columnNames = /* @__PURE__ */ new Set();
1982
+ const validTypes = ["universal", "varying", "validation_only"];
1983
+ criteriaDefinitions.forEach((criterion, index) => {
1984
+ if (!this._isPlainObject(criterion))
1985
+ throw new ValidationError(`Criterion ${index} must be an object`);
1986
+ const criterionId = this._getParamValue(criterion, "criterionId", "criterion_id");
1987
+ const columnName = this._getParamValue(criterion, "columnName", "column_name");
1988
+ const criterionText = this._getParamValue(criterion, "criterionText", "criterion_text");
1989
+ const criterionType = this._getParamValue(criterion, "criterionType", "criterion_type");
1990
+ const weightRaw = this._getParamValue(criterion, "weight", "weight");
1991
+ if (!criterionId || typeof criterionId !== "string")
1992
+ throw new ValidationError(`Criterion ${index} criterion_id must be a non-empty string`);
1993
+ if (criterionIds.has(criterionId))
1994
+ throw new ValidationError(`Duplicate criterion_id: ${criterionId}`);
1995
+ criterionIds.add(criterionId);
1996
+ if (!columnName || typeof columnName !== "string")
1997
+ throw new ValidationError(`Criterion ${index} column_name must be a non-empty string`);
1998
+ if (columnNames.has(columnName))
1999
+ throw new ValidationError(`Duplicate column_name: ${columnName}`);
2000
+ columnNames.add(columnName);
2001
+ if (!criterionText || typeof criterionText !== "string")
2002
+ throw new ValidationError(`Criterion ${index} criterion_text must be a non-empty string`);
2003
+ if (!criterionType || !validTypes.includes(criterionType))
2004
+ throw new ValidationError(`Criterion ${index} has invalid criterion_type: ${String(criterionType)}`);
2005
+ const weight = Number(weightRaw);
2006
+ if (!Number.isFinite(weight))
2007
+ throw new ValidationError(`Criterion ${index} weight must be a number`);
2008
+ if (weight <= 0)
2009
+ throw new ValidationError(`Criterion ${index} weight must be positive`);
2010
+ });
2011
+ }
2012
+ _validateCriteriaClassification(criteriaClassification) {
2013
+ if (!this._isPlainObject(criteriaClassification))
2014
+ throw new ValidationError("criteria_classification must be an object");
2015
+ const universalCriteria = this._getParamValue(criteriaClassification, "universalCriteria", "universal_criteria");
2016
+ const varyingCriteria = this._getParamValue(criteriaClassification, "varyingCriteria", "varying_criteria");
2017
+ const validationOnlyCriteria = this._getParamValue(criteriaClassification, "validationOnlyCriteria", "validation_only_criteria");
2018
+ if (!Array.isArray(universalCriteria))
2019
+ throw new ValidationError("criteria_classification missing or invalid universal_criteria");
2020
+ if (!Array.isArray(varyingCriteria))
2021
+ throw new ValidationError("criteria_classification missing or invalid varying_criteria");
2022
+ if (!Array.isArray(validationOnlyCriteria))
2023
+ throw new ValidationError("criteria_classification missing or invalid validation_only_criteria");
2024
+ }
2025
+ _validateCriteriaParams(params, specializedAgent) {
2026
+ if (!params)
2027
+ return;
2028
+ const rawParams = params;
2029
+ const reuseCriteriaFrom = this._getParamValue(rawParams, "reuseCriteriaFrom", "reuse_criteria_from");
2030
+ const criteriaDefinitions = this._getParamValue(
2031
+ rawParams,
2032
+ "criteriaDefinitions",
2033
+ "criteria_definitions"
2034
+ );
2035
+ const criteriaClassification = this._getParamValue(
2036
+ rawParams,
2037
+ "criteriaClassification",
2038
+ "criteria_classification"
2039
+ );
2040
+ const runSingleCriterion = this._getParamValue(rawParams, "runSingleCriterion", "run_single_criterion");
2041
+ const addCriterion = this._getParamValue(rawParams, "addCriterion", "add_criterion");
2042
+ const addAndRunCriterion = this._getParamValue(
2043
+ rawParams,
2044
+ "addAndRunCriterion",
2045
+ "add_and_run_criterion"
2046
+ );
2047
+ const candidateProfiles = this._getParamValue(
2048
+ rawParams,
2049
+ "candidateProfiles",
2050
+ "candidate_profiles"
2051
+ );
2052
+ const hasCriteria = !!criteriaDefinitions && !!criteriaClassification;
2053
+ if (criteriaDefinitions && !criteriaClassification || !criteriaDefinitions && criteriaClassification) {
2054
+ throw new ValidationError(
2055
+ "When providing criteria directly, both criteria_definitions and criteria_classification must be provided."
2056
+ );
2057
+ }
2058
+ if (criteriaDefinitions || criteriaClassification) {
2059
+ this._validateCriteriaDefinitions(criteriaDefinitions);
2060
+ this._validateCriteriaClassification(criteriaClassification);
2061
+ }
2062
+ if (runSingleCriterion) {
2063
+ if (!reuseCriteriaFrom && !hasCriteria) {
2064
+ throw new ValidationError(
2065
+ "run_single_criterion requires reuse_criteria_from or explicit criteria_definitions/criteria_classification."
2066
+ );
2067
+ }
2068
+ if (typeof runSingleCriterion !== "string" || !runSingleCriterion.trim()) {
2069
+ throw new ValidationError("run_single_criterion must be a non-empty string");
2070
+ }
2071
+ }
2072
+ if (addCriterion) {
2073
+ if (!reuseCriteriaFrom && !hasCriteria)
2074
+ throw new ValidationError("add_criterion requires existing criteria (reuse or direct criteria).");
2075
+ if (!this._isPlainObject(addCriterion))
2076
+ throw new ValidationError("add_criterion must be an object");
2077
+ const columnName = this._getParamValue(addCriterion, "columnName", "column_name");
2078
+ const criterionText = this._getParamValue(addCriterion, "criterionText", "criterion_text");
2079
+ if (!columnName || typeof columnName !== "string")
2080
+ throw new ValidationError("add_criterion requires column_name");
2081
+ if (!criterionText || typeof criterionText !== "string")
2082
+ throw new ValidationError("add_criterion requires criterion_text");
2083
+ }
2084
+ if (addAndRunCriterion !== void 0) {
2085
+ if (!reuseCriteriaFrom && !hasCriteria)
2086
+ throw new ValidationError("add_and_run_criterion requires existing criteria (reuse or direct criteria).");
2087
+ if (typeof addAndRunCriterion === "string") {
2088
+ if (!addAndRunCriterion.trim())
2089
+ throw new ValidationError("add_and_run_criterion must be a non-empty string");
2090
+ } else if (this._isPlainObject(addAndRunCriterion)) {
2091
+ const criterionText = this._getParamValue(addAndRunCriterion, "criterionText", "criterion_text");
2092
+ const suggestedColumnName = this._getParamValue(
2093
+ addAndRunCriterion,
2094
+ "suggestedColumnName",
2095
+ "suggested_column_name"
2096
+ );
2097
+ if (!criterionText || typeof criterionText !== "string")
2098
+ throw new ValidationError("add_and_run_criterion object requires criterion_text");
2099
+ if (suggestedColumnName !== void 0 && typeof suggestedColumnName !== "string")
2100
+ throw new ValidationError("add_and_run_criterion suggested_column_name must be a string if provided");
2101
+ } else {
2102
+ throw new ValidationError("add_and_run_criterion must be a string or an object");
2103
+ }
2104
+ }
2105
+ if (specializedAgent === "people_scoring") {
2106
+ if (!candidateProfiles || !Array.isArray(candidateProfiles) || candidateProfiles.length === 0)
2107
+ throw new ValidationError("candidate_profiles is required for people_scoring agent and must be a non-empty list");
2108
+ const missingIds = [];
2109
+ candidateProfiles.forEach((candidate, index) => {
2110
+ const c = candidate || {};
2111
+ const linkedinUrl = c.linkedin_url || c.linkedinUrl;
2112
+ const email = c.email;
2113
+ const emails = c.emails;
2114
+ if (!linkedinUrl && !email && (!emails || !Array.isArray(emails) || emails.length === 0))
2115
+ missingIds.push({ index, name: c.name });
2116
+ });
2117
+ if (missingIds.length > 0) {
2118
+ throw new ValidationError(
2119
+ `Each candidate in candidate_profiles must include at least one identifier: linkedin_url or email. Missing identifiers for ${missingIds.length} candidates: ${JSON.stringify(missingIds)}`
2120
+ );
2121
+ }
2122
+ }
2123
+ }
1963
2124
  _validateFileReference(uri) {
1964
2125
  if (uri.startsWith("artifact_"))
1965
2126
  return;
@@ -2000,6 +2161,8 @@ class ResponsesResource {
2000
2161
  for (const file of request.files)
2001
2162
  this._validateFileReference(file.uri);
2002
2163
  }
2164
+ if (request.specializedAgentParams)
2165
+ this._validateCriteriaParams(request.specializedAgentParams, request.specializedAgent);
2003
2166
  return this.http.post("/responses", request);
2004
2167
  }
2005
2168
  /**
@@ -2098,6 +2261,105 @@ class ResponsesResource {
2098
2261
  }
2099
2262
  return this.create(request);
2100
2263
  }
2264
+ /**
2265
+ * Perform a deep people search with AI-generated criteria and validation
2266
+ * @param query - Natural language search query describing ideal candidates
2267
+ * @param options - Optional search parameters
2268
+ * @param options.requestedCandidates - Number of candidates to find (default: 100)
2269
+ * @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
2270
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
2271
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
2272
+ * @param options.criteriaClassification - Pre-defined criteria classification
2273
+ * @param options.runSingleCriterion - Run only a single criterion by ID
2274
+ * @param options.addCriterion - Add a new criterion to existing criteria
2275
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
2276
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
2277
+ * Example string: 'Must have 5+ years Python experience'
2278
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
2279
+ * @param options.excludeProfiles - LinkedIn URLs to exclude from results
2280
+ * @param options.excludePreviouslyContacted - Exclude previously contacted people
2281
+ * @param options.excludeNames - Names to exclude from results
2282
+ * @returns Response with structured_response containing:
2283
+ * - candidates: Validated and scored candidates
2284
+ * - criteria: Generated/reused criteria definitions and classification
2285
+ * - searchStats: Search execution statistics
2286
+ */
2287
+ async deepPeopleSearch(query, options) {
2288
+ const request = {
2289
+ messages: [{ role: "user", content: query }],
2290
+ specializedAgent: "deep_people_search"
2291
+ };
2292
+ if (options) {
2293
+ const params = {};
2294
+ if (options.requestedCandidates !== void 0)
2295
+ params.requestedCandidates = options.requestedCandidates;
2296
+ if (options.dataSources)
2297
+ params.dataSources = options.dataSources;
2298
+ if (options.reuseCriteriaFrom)
2299
+ params.reuseCriteriaFrom = options.reuseCriteriaFrom;
2300
+ if (options.criteriaDefinitions)
2301
+ params.criteriaDefinitions = options.criteriaDefinitions;
2302
+ if (options.criteriaClassification)
2303
+ params.criteriaClassification = options.criteriaClassification;
2304
+ if (options.runSingleCriterion)
2305
+ params.runSingleCriterion = options.runSingleCriterion;
2306
+ if (options.addCriterion)
2307
+ params.addCriterion = options.addCriterion;
2308
+ if (options.addAndRunCriterion)
2309
+ params.addAndRunCriterion = options.addAndRunCriterion;
2310
+ if (options.excludeProfiles)
2311
+ params.excludeProfiles = options.excludeProfiles;
2312
+ if (options.excludePreviouslyContacted !== void 0)
2313
+ params.excludePreviouslyContacted = options.excludePreviouslyContacted;
2314
+ if (options.excludeNames)
2315
+ params.excludeNames = options.excludeNames;
2316
+ if (Object.keys(params).length > 0)
2317
+ request.specializedAgentParams = params;
2318
+ }
2319
+ return this.create(request);
2320
+ }
2321
+ /**
2322
+ * Score provided candidates against AI-generated or provided criteria
2323
+ * @param query - Natural language description of ideal candidate criteria
2324
+ * @param candidateProfiles - List of candidates to score (each must have linkedin_url or email)
2325
+ * @param options - Optional scoring parameters
2326
+ * @param options.reuseCriteriaFrom - Response ID to reuse criteria from
2327
+ * @param options.criteriaDefinitions - Pre-defined criteria definitions
2328
+ * @param options.criteriaClassification - Pre-defined criteria classification
2329
+ * @param options.runSingleCriterion - Run only a single criterion by ID
2330
+ * @param options.addCriterion - Add a new criterion to existing criteria
2331
+ * @param options.addAndRunCriterion - Add criterion from text and run only that criterion.
2332
+ * Can be a string (criterion text) or an object with criterionText and optional suggestedColumnName.
2333
+ * Example string: 'Must have 5+ years Python experience'
2334
+ * Example object: { criterionText: 'Has ML experience', suggestedColumnName: 'ml_experience' }
2335
+ * @returns Response with structured_response containing:
2336
+ * - candidates: Scored candidates with validation results
2337
+ * - criteria: Generated/reused criteria definitions and classification
2338
+ */
2339
+ async peopleScoring(query, candidateProfiles, options) {
2340
+ const request = {
2341
+ messages: [{ role: "user", content: query }],
2342
+ specializedAgent: "people_scoring",
2343
+ specializedAgentParams: {
2344
+ candidateProfiles
2345
+ }
2346
+ };
2347
+ if (options) {
2348
+ if (options.reuseCriteriaFrom)
2349
+ request.specializedAgentParams.reuseCriteriaFrom = options.reuseCriteriaFrom;
2350
+ if (options.criteriaDefinitions)
2351
+ request.specializedAgentParams.criteriaDefinitions = options.criteriaDefinitions;
2352
+ if (options.criteriaClassification)
2353
+ request.specializedAgentParams.criteriaClassification = options.criteriaClassification;
2354
+ if (options.runSingleCriterion)
2355
+ request.specializedAgentParams.runSingleCriterion = options.runSingleCriterion;
2356
+ if (options.addCriterion)
2357
+ request.specializedAgentParams.addCriterion = options.addCriterion;
2358
+ if (options.addAndRunCriterion)
2359
+ request.specializedAgentParams.addAndRunCriterion = options.addAndRunCriterion;
2360
+ }
2361
+ return this.create(request);
2362
+ }
2101
2363
  }
2102
2364
 
2103
2365
  class SkillsResource {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lumnisai",
3
3
  "type": "module",
4
- "version": "0.1.25",
4
+ "version": "0.1.27",
5
5
  "description": "Official Node.js SDK for the Lumnis AI API",
6
6
  "author": "Lumnis AI",
7
7
  "license": "MIT",