lumnisai 0.5.33 → 0.5.34

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
@@ -3402,9 +3402,9 @@ class ResponsesResource {
3402
3402
  "expandFromResponse",
3403
3403
  "expand_from_response"
3404
3404
  );
3405
- if (typeof expandFromResponse !== "string" || !expandFromResponse.trim()) {
3405
+ if (expandFromResponse !== void 0 && (typeof expandFromResponse !== "string" || !expandFromResponse.trim())) {
3406
3406
  throw new ValidationError(
3407
- "expandFromResponse is required for engagement_expansion and must be a non-empty string"
3407
+ "expandFromResponse must be a non-empty string when provided for engagement_expansion"
3408
3408
  );
3409
3409
  }
3410
3410
  for (const [camel, snake] of [
@@ -3886,26 +3886,28 @@ class ResponsesResource {
3886
3886
  });
3887
3887
  }
3888
3888
  /**
3889
- * Find new people by walking outward from a saved content-intelligence package.
3889
+ * Find new people by walking outward from a saved engagement package.
3890
3890
  *
3891
- * Hop 1 pulls the other engagers of the package's best posts. Additional hops
3892
- * select the highest-fit new people, rank posts from their feeds, and pull the
3893
- * engagers of those posts. Collection breadth is derived from `limit` unless
3894
- * `postsPerHop` is set explicitly. At the default limit, collection is about
3895
- * 300 credits for one hop and 1,060 for three hops; enrichment and validation
3896
- * use the standard deep-search economics on top.
3891
+ * With `expandFromResponse`, hop 1 pulls the other engagers of that response's
3892
+ * saved package. Without it, the backend first finds a seed audience from the
3893
+ * prompt, collects and saves its package, then expands it. Additional hops
3894
+ * select the highest-fit new people, rank posts from their feeds, and pull
3895
+ * their engagers. Collection breadth is derived from `limit` unless
3896
+ * `postsPerHop` is explicit. At the default limit, hop collection is about
3897
+ * 300 credits for one hop and 1,060 for three; prompt-only seed collection,
3898
+ * enrichment, and validation are additional.
3897
3899
  *
3898
3900
  * @param query - Persona prompt used to rank and validate discovered people.
3899
- * @param options - Source response plus hop, breadth, limit, and exclusion controls.
3901
+ * @param options - Optional source response, hop, breadth, limit, and exclusion controls.
3900
3902
  * @returns Response; poll with `get()` and read `structuredResponse` as
3901
3903
  * {@link EngagementExpansionOutput}.
3902
3904
  */
3903
- async engagementExpansion(query, options) {
3905
+ async engagementExpansion(query, options = {}) {
3904
3906
  if (!query.trim())
3905
3907
  throw new ValidationError("engagementExpansion requires a non-empty persona query");
3906
- const params = {
3907
- expandFromResponse: options?.expandFromResponse
3908
- };
3908
+ const params = {};
3909
+ if (options.expandFromResponse !== void 0)
3910
+ params.expandFromResponse = options.expandFromResponse;
3909
3911
  if (options?.hops !== void 0)
3910
3912
  params.hops = options.hops;
3911
3913
  if (options?.postsPerHop !== void 0)
package/dist/index.d.cts CHANGED
@@ -1416,8 +1416,12 @@ interface ContentIntelligenceOutput {
1416
1416
 
1417
1417
  /** Options accepted by {@link ResponsesResource.engagementExpansion}. */
1418
1418
  interface EngagementExpansionOptions {
1419
- /** Finished content_intelligence response whose saved package seeds the walk. */
1420
- expandFromResponse: string;
1419
+ /**
1420
+ * Finished response whose saved package seeds the walk. This may be a
1421
+ * content-intelligence or prior engagement-expansion response. Omit it to
1422
+ * collect a seed audience and package from the persona prompt first.
1423
+ */
1424
+ expandFromResponse?: string;
1421
1425
  /**
1422
1426
  * Number of outward rounds to run. At the default limit, collection is
1423
1427
  * approximately 300 credits for one hop and 1,060 for three hops.
@@ -1441,7 +1445,8 @@ interface EngagementExpansionOptions {
1441
1445
  }
1442
1446
  /** Resolved parameters echoed in `structuredResponse.agentParams`. */
1443
1447
  interface EngagementExpansionResolvedParams {
1444
- expandFromResponse: string;
1448
+ /** Null when the run collected its seed package from the prompt. */
1449
+ expandFromResponse: string | null;
1445
1450
  hops: number;
1446
1451
  postsPerHop?: number | null;
1447
1452
  peoplePerNextHop: number;
@@ -1462,12 +1467,16 @@ interface EngagementExpansionHopStats {
1462
1467
  /** Collection and finalist-history accounting for an expansion run. */
1463
1468
  interface EngagementExpansionStats {
1464
1469
  hopsRun: number;
1465
- hopsRequested: number;
1466
- postsPerHop: number;
1467
- postsPerHopSource: 'requested' | 'derived';
1470
+ /** Absent on an early `empty_package` stop. */
1471
+ hopsRequested?: number;
1472
+ /** Absent on an early `empty_package` stop. */
1473
+ postsPerHop?: number;
1474
+ /** Absent on an early `empty_package` stop. */
1475
+ postsPerHopSource?: 'requested' | 'derived';
1468
1476
  /** Hop collection only; enrichment and validation use standard deep-search economics. */
1469
- collectionCreditsSpent: number;
1470
- collectionCreditCeiling: number;
1477
+ collectionCreditsSpent?: number;
1478
+ /** Absent on an early `empty_package` stop. */
1479
+ collectionCreditCeiling?: number;
1471
1480
  stopReason: string;
1472
1481
  perHop: EngagementExpansionHopStats[];
1473
1482
  /** Credits spent loading broader engagement history for finalists. */
@@ -1489,6 +1498,8 @@ interface EngagementExpansionOutput {
1489
1498
  candidates: ValidatedCandidate[];
1490
1499
  criteria?: CriteriaMetadata;
1491
1500
  expansionStats?: EngagementExpansionStats;
1501
+ /** Package used by this run, saved so a later expansion can chain from it. */
1502
+ package?: ContentIntelligencePackage;
1492
1503
  agentParams: EngagementExpansionResolvedParams;
1493
1504
  }
1494
1505
 
@@ -1976,6 +1987,12 @@ interface ValidatedCandidate {
1976
1987
  * 2 for judged/out-of-region, and 0 for unjudged. Tier 1 may exist on older responses.
1977
1988
  */
1978
1989
  rankTier?: 0 | 1 | 2 | 3;
1990
+ /**
1991
+ * Zero-based position in the backend's shipped order. Preserve response
1992
+ * order or sort this field ascending; per-row scores cannot reproduce
1993
+ * diversity reordering exactly.
1994
+ */
1995
+ deliveryRank?: number;
1979
1996
  /** Whether the candidate satisfies the search's location requirement. */
1980
1997
  geoOk?: boolean;
1981
1998
  /** Model's direct answer to the location requirement, when one exists. */
@@ -2005,6 +2022,8 @@ interface ValidatedCandidate {
2005
2022
  * criteria. This is useful for display and auditing but no longer forces a lower rank tier.
2006
2023
  */
2007
2024
  backfilled?: boolean;
2025
+ /** Promoted from the excluded pool so deep validation could issue a real verdict. */
2026
+ promotedToValidation?: boolean;
2008
2027
  /**
2009
2028
  * LinkedIn posts this candidate engaged with (reacted or commented).
2010
2029
  * One entry per post — if someone engaged with multiple competitor posts,
@@ -2123,7 +2142,7 @@ interface StructuredResponse extends Record<string, any> {
2123
2142
  /** Competitor rep engagement output (when using competitor_rep_engagement agent) */
2124
2143
  resolutionWarnings?: string[];
2125
2144
  repEngagementStats?: RepEngagementStats;
2126
- /** Content intelligence output (when using content_intelligence agent). */
2145
+ /** Saved content package from content_intelligence or engagement_expansion. */
2127
2146
  package?: ContentIntelligencePackage;
2128
2147
  summary?: ContentIntelligenceSummary;
2129
2148
  outputs?: ContentIntelligenceOutputs;
@@ -6672,21 +6691,23 @@ declare class ResponsesResource {
6672
6691
  */
6673
6692
  contentIntelligence(query: string, options?: ContentIntelligenceOptions): Promise<CreateResponseResponse>;
6674
6693
  /**
6675
- * Find new people by walking outward from a saved content-intelligence package.
6694
+ * Find new people by walking outward from a saved engagement package.
6676
6695
  *
6677
- * Hop 1 pulls the other engagers of the package's best posts. Additional hops
6678
- * select the highest-fit new people, rank posts from their feeds, and pull the
6679
- * engagers of those posts. Collection breadth is derived from `limit` unless
6680
- * `postsPerHop` is set explicitly. At the default limit, collection is about
6681
- * 300 credits for one hop and 1,060 for three hops; enrichment and validation
6682
- * use the standard deep-search economics on top.
6696
+ * With `expandFromResponse`, hop 1 pulls the other engagers of that response's
6697
+ * saved package. Without it, the backend first finds a seed audience from the
6698
+ * prompt, collects and saves its package, then expands it. Additional hops
6699
+ * select the highest-fit new people, rank posts from their feeds, and pull
6700
+ * their engagers. Collection breadth is derived from `limit` unless
6701
+ * `postsPerHop` is explicit. At the default limit, hop collection is about
6702
+ * 300 credits for one hop and 1,060 for three; prompt-only seed collection,
6703
+ * enrichment, and validation are additional.
6683
6704
  *
6684
6705
  * @param query - Persona prompt used to rank and validate discovered people.
6685
- * @param options - Source response plus hop, breadth, limit, and exclusion controls.
6706
+ * @param options - Optional source response, hop, breadth, limit, and exclusion controls.
6686
6707
  * @returns Response; poll with `get()` and read `structuredResponse` as
6687
6708
  * {@link EngagementExpansionOutput}.
6688
6709
  */
6689
- engagementExpansion(query: string, options: EngagementExpansionOptions): Promise<CreateResponseResponse>;
6710
+ engagementExpansion(query: string, options?: EngagementExpansionOptions): Promise<CreateResponseResponse>;
6690
6711
  /**
6691
6712
  * Score people who reacted to or commented on competitor LinkedIn posts.
6692
6713
  *
package/dist/index.d.mts CHANGED
@@ -1416,8 +1416,12 @@ interface ContentIntelligenceOutput {
1416
1416
 
1417
1417
  /** Options accepted by {@link ResponsesResource.engagementExpansion}. */
1418
1418
  interface EngagementExpansionOptions {
1419
- /** Finished content_intelligence response whose saved package seeds the walk. */
1420
- expandFromResponse: string;
1419
+ /**
1420
+ * Finished response whose saved package seeds the walk. This may be a
1421
+ * content-intelligence or prior engagement-expansion response. Omit it to
1422
+ * collect a seed audience and package from the persona prompt first.
1423
+ */
1424
+ expandFromResponse?: string;
1421
1425
  /**
1422
1426
  * Number of outward rounds to run. At the default limit, collection is
1423
1427
  * approximately 300 credits for one hop and 1,060 for three hops.
@@ -1441,7 +1445,8 @@ interface EngagementExpansionOptions {
1441
1445
  }
1442
1446
  /** Resolved parameters echoed in `structuredResponse.agentParams`. */
1443
1447
  interface EngagementExpansionResolvedParams {
1444
- expandFromResponse: string;
1448
+ /** Null when the run collected its seed package from the prompt. */
1449
+ expandFromResponse: string | null;
1445
1450
  hops: number;
1446
1451
  postsPerHop?: number | null;
1447
1452
  peoplePerNextHop: number;
@@ -1462,12 +1467,16 @@ interface EngagementExpansionHopStats {
1462
1467
  /** Collection and finalist-history accounting for an expansion run. */
1463
1468
  interface EngagementExpansionStats {
1464
1469
  hopsRun: number;
1465
- hopsRequested: number;
1466
- postsPerHop: number;
1467
- postsPerHopSource: 'requested' | 'derived';
1470
+ /** Absent on an early `empty_package` stop. */
1471
+ hopsRequested?: number;
1472
+ /** Absent on an early `empty_package` stop. */
1473
+ postsPerHop?: number;
1474
+ /** Absent on an early `empty_package` stop. */
1475
+ postsPerHopSource?: 'requested' | 'derived';
1468
1476
  /** Hop collection only; enrichment and validation use standard deep-search economics. */
1469
- collectionCreditsSpent: number;
1470
- collectionCreditCeiling: number;
1477
+ collectionCreditsSpent?: number;
1478
+ /** Absent on an early `empty_package` stop. */
1479
+ collectionCreditCeiling?: number;
1471
1480
  stopReason: string;
1472
1481
  perHop: EngagementExpansionHopStats[];
1473
1482
  /** Credits spent loading broader engagement history for finalists. */
@@ -1489,6 +1498,8 @@ interface EngagementExpansionOutput {
1489
1498
  candidates: ValidatedCandidate[];
1490
1499
  criteria?: CriteriaMetadata;
1491
1500
  expansionStats?: EngagementExpansionStats;
1501
+ /** Package used by this run, saved so a later expansion can chain from it. */
1502
+ package?: ContentIntelligencePackage;
1492
1503
  agentParams: EngagementExpansionResolvedParams;
1493
1504
  }
1494
1505
 
@@ -1976,6 +1987,12 @@ interface ValidatedCandidate {
1976
1987
  * 2 for judged/out-of-region, and 0 for unjudged. Tier 1 may exist on older responses.
1977
1988
  */
1978
1989
  rankTier?: 0 | 1 | 2 | 3;
1990
+ /**
1991
+ * Zero-based position in the backend's shipped order. Preserve response
1992
+ * order or sort this field ascending; per-row scores cannot reproduce
1993
+ * diversity reordering exactly.
1994
+ */
1995
+ deliveryRank?: number;
1979
1996
  /** Whether the candidate satisfies the search's location requirement. */
1980
1997
  geoOk?: boolean;
1981
1998
  /** Model's direct answer to the location requirement, when one exists. */
@@ -2005,6 +2022,8 @@ interface ValidatedCandidate {
2005
2022
  * criteria. This is useful for display and auditing but no longer forces a lower rank tier.
2006
2023
  */
2007
2024
  backfilled?: boolean;
2025
+ /** Promoted from the excluded pool so deep validation could issue a real verdict. */
2026
+ promotedToValidation?: boolean;
2008
2027
  /**
2009
2028
  * LinkedIn posts this candidate engaged with (reacted or commented).
2010
2029
  * One entry per post — if someone engaged with multiple competitor posts,
@@ -2123,7 +2142,7 @@ interface StructuredResponse extends Record<string, any> {
2123
2142
  /** Competitor rep engagement output (when using competitor_rep_engagement agent) */
2124
2143
  resolutionWarnings?: string[];
2125
2144
  repEngagementStats?: RepEngagementStats;
2126
- /** Content intelligence output (when using content_intelligence agent). */
2145
+ /** Saved content package from content_intelligence or engagement_expansion. */
2127
2146
  package?: ContentIntelligencePackage;
2128
2147
  summary?: ContentIntelligenceSummary;
2129
2148
  outputs?: ContentIntelligenceOutputs;
@@ -6672,21 +6691,23 @@ declare class ResponsesResource {
6672
6691
  */
6673
6692
  contentIntelligence(query: string, options?: ContentIntelligenceOptions): Promise<CreateResponseResponse>;
6674
6693
  /**
6675
- * Find new people by walking outward from a saved content-intelligence package.
6694
+ * Find new people by walking outward from a saved engagement package.
6676
6695
  *
6677
- * Hop 1 pulls the other engagers of the package's best posts. Additional hops
6678
- * select the highest-fit new people, rank posts from their feeds, and pull the
6679
- * engagers of those posts. Collection breadth is derived from `limit` unless
6680
- * `postsPerHop` is set explicitly. At the default limit, collection is about
6681
- * 300 credits for one hop and 1,060 for three hops; enrichment and validation
6682
- * use the standard deep-search economics on top.
6696
+ * With `expandFromResponse`, hop 1 pulls the other engagers of that response's
6697
+ * saved package. Without it, the backend first finds a seed audience from the
6698
+ * prompt, collects and saves its package, then expands it. Additional hops
6699
+ * select the highest-fit new people, rank posts from their feeds, and pull
6700
+ * their engagers. Collection breadth is derived from `limit` unless
6701
+ * `postsPerHop` is explicit. At the default limit, hop collection is about
6702
+ * 300 credits for one hop and 1,060 for three; prompt-only seed collection,
6703
+ * enrichment, and validation are additional.
6683
6704
  *
6684
6705
  * @param query - Persona prompt used to rank and validate discovered people.
6685
- * @param options - Source response plus hop, breadth, limit, and exclusion controls.
6706
+ * @param options - Optional source response, hop, breadth, limit, and exclusion controls.
6686
6707
  * @returns Response; poll with `get()` and read `structuredResponse` as
6687
6708
  * {@link EngagementExpansionOutput}.
6688
6709
  */
6689
- engagementExpansion(query: string, options: EngagementExpansionOptions): Promise<CreateResponseResponse>;
6710
+ engagementExpansion(query: string, options?: EngagementExpansionOptions): Promise<CreateResponseResponse>;
6690
6711
  /**
6691
6712
  * Score people who reacted to or commented on competitor LinkedIn posts.
6692
6713
  *
package/dist/index.d.ts CHANGED
@@ -1416,8 +1416,12 @@ interface ContentIntelligenceOutput {
1416
1416
 
1417
1417
  /** Options accepted by {@link ResponsesResource.engagementExpansion}. */
1418
1418
  interface EngagementExpansionOptions {
1419
- /** Finished content_intelligence response whose saved package seeds the walk. */
1420
- expandFromResponse: string;
1419
+ /**
1420
+ * Finished response whose saved package seeds the walk. This may be a
1421
+ * content-intelligence or prior engagement-expansion response. Omit it to
1422
+ * collect a seed audience and package from the persona prompt first.
1423
+ */
1424
+ expandFromResponse?: string;
1421
1425
  /**
1422
1426
  * Number of outward rounds to run. At the default limit, collection is
1423
1427
  * approximately 300 credits for one hop and 1,060 for three hops.
@@ -1441,7 +1445,8 @@ interface EngagementExpansionOptions {
1441
1445
  }
1442
1446
  /** Resolved parameters echoed in `structuredResponse.agentParams`. */
1443
1447
  interface EngagementExpansionResolvedParams {
1444
- expandFromResponse: string;
1448
+ /** Null when the run collected its seed package from the prompt. */
1449
+ expandFromResponse: string | null;
1445
1450
  hops: number;
1446
1451
  postsPerHop?: number | null;
1447
1452
  peoplePerNextHop: number;
@@ -1462,12 +1467,16 @@ interface EngagementExpansionHopStats {
1462
1467
  /** Collection and finalist-history accounting for an expansion run. */
1463
1468
  interface EngagementExpansionStats {
1464
1469
  hopsRun: number;
1465
- hopsRequested: number;
1466
- postsPerHop: number;
1467
- postsPerHopSource: 'requested' | 'derived';
1470
+ /** Absent on an early `empty_package` stop. */
1471
+ hopsRequested?: number;
1472
+ /** Absent on an early `empty_package` stop. */
1473
+ postsPerHop?: number;
1474
+ /** Absent on an early `empty_package` stop. */
1475
+ postsPerHopSource?: 'requested' | 'derived';
1468
1476
  /** Hop collection only; enrichment and validation use standard deep-search economics. */
1469
- collectionCreditsSpent: number;
1470
- collectionCreditCeiling: number;
1477
+ collectionCreditsSpent?: number;
1478
+ /** Absent on an early `empty_package` stop. */
1479
+ collectionCreditCeiling?: number;
1471
1480
  stopReason: string;
1472
1481
  perHop: EngagementExpansionHopStats[];
1473
1482
  /** Credits spent loading broader engagement history for finalists. */
@@ -1489,6 +1498,8 @@ interface EngagementExpansionOutput {
1489
1498
  candidates: ValidatedCandidate[];
1490
1499
  criteria?: CriteriaMetadata;
1491
1500
  expansionStats?: EngagementExpansionStats;
1501
+ /** Package used by this run, saved so a later expansion can chain from it. */
1502
+ package?: ContentIntelligencePackage;
1492
1503
  agentParams: EngagementExpansionResolvedParams;
1493
1504
  }
1494
1505
 
@@ -1976,6 +1987,12 @@ interface ValidatedCandidate {
1976
1987
  * 2 for judged/out-of-region, and 0 for unjudged. Tier 1 may exist on older responses.
1977
1988
  */
1978
1989
  rankTier?: 0 | 1 | 2 | 3;
1990
+ /**
1991
+ * Zero-based position in the backend's shipped order. Preserve response
1992
+ * order or sort this field ascending; per-row scores cannot reproduce
1993
+ * diversity reordering exactly.
1994
+ */
1995
+ deliveryRank?: number;
1979
1996
  /** Whether the candidate satisfies the search's location requirement. */
1980
1997
  geoOk?: boolean;
1981
1998
  /** Model's direct answer to the location requirement, when one exists. */
@@ -2005,6 +2022,8 @@ interface ValidatedCandidate {
2005
2022
  * criteria. This is useful for display and auditing but no longer forces a lower rank tier.
2006
2023
  */
2007
2024
  backfilled?: boolean;
2025
+ /** Promoted from the excluded pool so deep validation could issue a real verdict. */
2026
+ promotedToValidation?: boolean;
2008
2027
  /**
2009
2028
  * LinkedIn posts this candidate engaged with (reacted or commented).
2010
2029
  * One entry per post — if someone engaged with multiple competitor posts,
@@ -2123,7 +2142,7 @@ interface StructuredResponse extends Record<string, any> {
2123
2142
  /** Competitor rep engagement output (when using competitor_rep_engagement agent) */
2124
2143
  resolutionWarnings?: string[];
2125
2144
  repEngagementStats?: RepEngagementStats;
2126
- /** Content intelligence output (when using content_intelligence agent). */
2145
+ /** Saved content package from content_intelligence or engagement_expansion. */
2127
2146
  package?: ContentIntelligencePackage;
2128
2147
  summary?: ContentIntelligenceSummary;
2129
2148
  outputs?: ContentIntelligenceOutputs;
@@ -6672,21 +6691,23 @@ declare class ResponsesResource {
6672
6691
  */
6673
6692
  contentIntelligence(query: string, options?: ContentIntelligenceOptions): Promise<CreateResponseResponse>;
6674
6693
  /**
6675
- * Find new people by walking outward from a saved content-intelligence package.
6694
+ * Find new people by walking outward from a saved engagement package.
6676
6695
  *
6677
- * Hop 1 pulls the other engagers of the package's best posts. Additional hops
6678
- * select the highest-fit new people, rank posts from their feeds, and pull the
6679
- * engagers of those posts. Collection breadth is derived from `limit` unless
6680
- * `postsPerHop` is set explicitly. At the default limit, collection is about
6681
- * 300 credits for one hop and 1,060 for three hops; enrichment and validation
6682
- * use the standard deep-search economics on top.
6696
+ * With `expandFromResponse`, hop 1 pulls the other engagers of that response's
6697
+ * saved package. Without it, the backend first finds a seed audience from the
6698
+ * prompt, collects and saves its package, then expands it. Additional hops
6699
+ * select the highest-fit new people, rank posts from their feeds, and pull
6700
+ * their engagers. Collection breadth is derived from `limit` unless
6701
+ * `postsPerHop` is explicit. At the default limit, hop collection is about
6702
+ * 300 credits for one hop and 1,060 for three; prompt-only seed collection,
6703
+ * enrichment, and validation are additional.
6683
6704
  *
6684
6705
  * @param query - Persona prompt used to rank and validate discovered people.
6685
- * @param options - Source response plus hop, breadth, limit, and exclusion controls.
6706
+ * @param options - Optional source response, hop, breadth, limit, and exclusion controls.
6686
6707
  * @returns Response; poll with `get()` and read `structuredResponse` as
6687
6708
  * {@link EngagementExpansionOutput}.
6688
6709
  */
6689
- engagementExpansion(query: string, options: EngagementExpansionOptions): Promise<CreateResponseResponse>;
6710
+ engagementExpansion(query: string, options?: EngagementExpansionOptions): Promise<CreateResponseResponse>;
6690
6711
  /**
6691
6712
  * Score people who reacted to or commented on competitor LinkedIn posts.
6692
6713
  *
package/dist/index.mjs CHANGED
@@ -3396,9 +3396,9 @@ class ResponsesResource {
3396
3396
  "expandFromResponse",
3397
3397
  "expand_from_response"
3398
3398
  );
3399
- if (typeof expandFromResponse !== "string" || !expandFromResponse.trim()) {
3399
+ if (expandFromResponse !== void 0 && (typeof expandFromResponse !== "string" || !expandFromResponse.trim())) {
3400
3400
  throw new ValidationError(
3401
- "expandFromResponse is required for engagement_expansion and must be a non-empty string"
3401
+ "expandFromResponse must be a non-empty string when provided for engagement_expansion"
3402
3402
  );
3403
3403
  }
3404
3404
  for (const [camel, snake] of [
@@ -3880,26 +3880,28 @@ class ResponsesResource {
3880
3880
  });
3881
3881
  }
3882
3882
  /**
3883
- * Find new people by walking outward from a saved content-intelligence package.
3883
+ * Find new people by walking outward from a saved engagement package.
3884
3884
  *
3885
- * Hop 1 pulls the other engagers of the package's best posts. Additional hops
3886
- * select the highest-fit new people, rank posts from their feeds, and pull the
3887
- * engagers of those posts. Collection breadth is derived from `limit` unless
3888
- * `postsPerHop` is set explicitly. At the default limit, collection is about
3889
- * 300 credits for one hop and 1,060 for three hops; enrichment and validation
3890
- * use the standard deep-search economics on top.
3885
+ * With `expandFromResponse`, hop 1 pulls the other engagers of that response's
3886
+ * saved package. Without it, the backend first finds a seed audience from the
3887
+ * prompt, collects and saves its package, then expands it. Additional hops
3888
+ * select the highest-fit new people, rank posts from their feeds, and pull
3889
+ * their engagers. Collection breadth is derived from `limit` unless
3890
+ * `postsPerHop` is explicit. At the default limit, hop collection is about
3891
+ * 300 credits for one hop and 1,060 for three; prompt-only seed collection,
3892
+ * enrichment, and validation are additional.
3891
3893
  *
3892
3894
  * @param query - Persona prompt used to rank and validate discovered people.
3893
- * @param options - Source response plus hop, breadth, limit, and exclusion controls.
3895
+ * @param options - Optional source response, hop, breadth, limit, and exclusion controls.
3894
3896
  * @returns Response; poll with `get()` and read `structuredResponse` as
3895
3897
  * {@link EngagementExpansionOutput}.
3896
3898
  */
3897
- async engagementExpansion(query, options) {
3899
+ async engagementExpansion(query, options = {}) {
3898
3900
  if (!query.trim())
3899
3901
  throw new ValidationError("engagementExpansion requires a non-empty persona query");
3900
- const params = {
3901
- expandFromResponse: options?.expandFromResponse
3902
- };
3902
+ const params = {};
3903
+ if (options.expandFromResponse !== void 0)
3904
+ params.expandFromResponse = options.expandFromResponse;
3903
3905
  if (options?.hops !== void 0)
3904
3906
  params.hops = options.hops;
3905
3907
  if (options?.postsPerHop !== void 0)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lumnisai",
3
3
  "type": "module",
4
- "version": "0.5.33",
4
+ "version": "0.5.34",
5
5
  "description": "Official Node.js SDK for the Lumnis AI API",
6
6
  "author": "Lumnis AI",
7
7
  "license": "MIT",