lumnisai 0.5.48 → 0.5.50

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
@@ -1091,14 +1091,18 @@ class CrmResource {
1091
1091
  });
1092
1092
  }
1093
1093
  /**
1094
- * Grant a member the right to exclude against an owner's synced CRM ledger
1095
- * (all providers for that owner). Typically called by the FE on org join.
1094
+ * Grant a member access to an owner's CRM — every provider that owner has
1095
+ * synced. One grant serves both reads that name another owner: ledger
1096
+ * exclusion in search and campaigns, and `account_monitor`'s `crmUserId`.
1097
+ * Both users must be in the authenticated tenant; a self-grant is a no-op.
1098
+ * Typically called by the FE on org join.
1096
1099
  */
1097
1100
  async grantExclusionGrant(data) {
1098
1101
  return this.http.post("/crm/exclusion-grants", data);
1099
1102
  }
1100
1103
  /**
1101
- * Revoke a member's access to an owner's CRM exclusion ledger.
1104
+ * Revoke a member's access to an owner's CRM. Implicit access to their own
1105
+ * CRM cannot be revoked.
1102
1106
  */
1103
1107
  async revokeExclusionGrant(data) {
1104
1108
  return this.http.delete("/crm/exclusion-grants", {
@@ -1106,7 +1110,8 @@ class CrmResource {
1106
1110
  });
1107
1111
  }
1108
1112
  /**
1109
- * List CRM owners whose exclusion ledger a member may read (via grants).
1113
+ * List the CRM owners a member may read via grants. The member's own CRM is
1114
+ * implicit and is not listed.
1110
1115
  */
1111
1116
  async listExclusionGrants(memberUserId) {
1112
1117
  return this.http.get("/crm/exclusion-grants", {
@@ -1938,7 +1943,12 @@ const PASSTHROUGH_VALUE_KEYS = /* @__PURE__ */ new Set([
1938
1943
  "customFields",
1939
1944
  "custom_fields",
1940
1945
  "engagementProfile",
1941
- "engagement_profile"
1946
+ "engagement_profile",
1947
+ // account_monitor's committee: its own fields (`people`, `groups`) are
1948
+ // spelled the same in both cases, while the group labels underneath
1949
+ // `groups` are caller-chosen names such as 'Security team'. Converting
1950
+ // those would rename the customer's own groups.
1951
+ "committee"
1942
1952
  ]);
1943
1953
  function convertCase(obj, converter) {
1944
1954
  if (Array.isArray(obj)) {
@@ -3256,6 +3266,39 @@ const ENGAGEMENT_ACTIVITIES = [
3256
3266
  "comments",
3257
3267
  "authored_posts"
3258
3268
  ];
3269
+ const ACCOUNT_MONITOR_SIGNALS = [
3270
+ "company_hiring",
3271
+ "company_news",
3272
+ "company_funding",
3273
+ "company_posts",
3274
+ "company_mention",
3275
+ "company_background",
3276
+ "committee_activity",
3277
+ "committee_to_competitor",
3278
+ "competitor_to_committee",
3279
+ "committee_to_our_company",
3280
+ "account_to_our_company"
3281
+ ];
3282
+ const RETIRED_ACCOUNT_MONITOR_SIGNALS = [
3283
+ "incoming_engagement",
3284
+ "our_company_to_committee",
3285
+ "our_company_to_account"
3286
+ ];
3287
+ const ACCOUNT_MONITOR_FIELDS = [
3288
+ ["account", "account"],
3289
+ ["depth", "depth"],
3290
+ ["committee", "committee"],
3291
+ ["competitors", "competitors"],
3292
+ ["ourCompany", "our_company"],
3293
+ ["days", "days"],
3294
+ ["window", "window"],
3295
+ ["signalDefinitions", "signal_definitions"],
3296
+ ["intentScoringInstructions", "intent_scoring_instructions"],
3297
+ ["history", "history"],
3298
+ ["crmUserId", "crm_user_id"],
3299
+ ["tier", "tier"]
3300
+ ];
3301
+ const ACCOUNT_MONITOR_FIELD_KEYS = new Set(ACCOUNT_MONITOR_FIELDS.flat());
3259
3302
  const MAX_SIGNAL_CONTEXT_CHARS = 4e3;
3260
3303
  const MAX_CONTENT_INTELLIGENCE_COMPETITORS = 5;
3261
3304
  const MAX_CONTENT_INTELLIGENCE_COMPETITOR_CHARS = 200;
@@ -3874,6 +3917,251 @@ class ResponsesResource {
3874
3917
  );
3875
3918
  }
3876
3919
  }
3920
+ /**
3921
+ * Validate one merged `account_monitor` request.
3922
+ *
3923
+ * The monitor's parameters are a CLOSED shape server-side, so unknown keys
3924
+ * are rejected here with the offending name rather than failing after the
3925
+ * request is sent. Everything else mirrors the backend's own rules: an
3926
+ * account that identity resolution can actually resolve, one period (days
3927
+ * OR window, never both), and explicit people/title scopes.
3928
+ */
3929
+ _validateAccountMonitorParams(params) {
3930
+ const account = params.account;
3931
+ if (typeof account !== "string" || !account.trim()) {
3932
+ throw new ValidationError(
3933
+ "`account` is required for account_monitor \u2014 give the monitored company's domain, website, or LinkedIn company URL. A bare company name cannot be resolved."
3934
+ );
3935
+ }
3936
+ const depth = params.depth;
3937
+ if (depth !== void 0 && depth !== "light" && depth !== "deep")
3938
+ throw new ValidationError(`depth must be 'light' or 'deep' for account_monitor`);
3939
+ const days = params.days;
3940
+ if (days !== void 0 && (!Number.isInteger(days) || days < 1))
3941
+ throw new ValidationError("days must be a positive integer for account_monitor");
3942
+ const window = params.window;
3943
+ if (window !== void 0) {
3944
+ if (days !== void 0)
3945
+ throw new ValidationError("Supply days or window for account_monitor, not both");
3946
+ if (!this._isPlainObject(window)) {
3947
+ throw new ValidationError(
3948
+ "window must be an object with startAt and endAt timestamps for account_monitor"
3949
+ );
3950
+ }
3951
+ for (const [camel, snake] of [["startAt", "start_at"], ["endAt", "end_at"]]) {
3952
+ const value = this._getParamValue(window, camel, snake);
3953
+ if (typeof value !== "string" || !value.trim()) {
3954
+ throw new ValidationError(
3955
+ `window.${camel} must be a timezone-aware ISO 8601 timestamp for account_monitor`
3956
+ );
3957
+ }
3958
+ }
3959
+ }
3960
+ this._validateAccountMonitorCommittee(params.committee);
3961
+ const competitors = params.competitors;
3962
+ if (competitors !== void 0) {
3963
+ if (!Array.isArray(competitors))
3964
+ throw new ValidationError("competitors must be an array for account_monitor");
3965
+ competitors.forEach((competitor, index) => this._validateAccountMonitorCompany(competitor, `competitors[${index}]`));
3966
+ }
3967
+ if (params.ourCompany !== void 0)
3968
+ this._validateAccountMonitorCompany(params.ourCompany, "ourCompany");
3969
+ const history = params.history;
3970
+ if (history !== void 0 && typeof history !== "string" && !this._isPlainObject(history)) {
3971
+ throw new ValidationError(
3972
+ "history must be an object or a string for account_monitor \u2014 the run compares against what you supply here, it never looks a previous response up."
3973
+ );
3974
+ }
3975
+ const tier = params.tier;
3976
+ if (tier !== void 0 && typeof tier !== "string")
3977
+ throw new ValidationError("tier must be a string for account_monitor");
3978
+ const instructions = params.intentScoringInstructions;
3979
+ if (instructions !== void 0 && typeof instructions !== "string")
3980
+ throw new ValidationError("intentScoringInstructions must be a string");
3981
+ this._validateAccountMonitorSignalDefinitions(params.signalDefinitions);
3982
+ }
3983
+ /**
3984
+ * `crmUserId` reads one tenant member's CRM, so the request has to name the
3985
+ * requester too: the backend refuses the pair without a top-level `userId`,
3986
+ * and reading anyone else's CRM also needs a CRM access grant
3987
+ * (`client.crm.grantExclusionGrant`). Reading your own is always allowed.
3988
+ */
3989
+ _validateAccountMonitorCrmAccess(params, request) {
3990
+ const crmUserId = params.crmUserId;
3991
+ if (crmUserId === void 0)
3992
+ return;
3993
+ if (typeof crmUserId !== "string" || !crmUserId.trim() || crmUserId.length > 255) {
3994
+ throw new ValidationError(
3995
+ "crmUserId must be the UUID or email of a CRM owner in the authenticated tenant (1-255 characters) for account_monitor"
3996
+ );
3997
+ }
3998
+ if (typeof request.userId !== "string" || !request.userId.trim())
3999
+ throw new ValidationError("userId is required when crmUserId is provided");
4000
+ }
4001
+ /** People are LinkedIn profile URLs; no employee discovery is ever implied. */
4002
+ _validateAccountMonitorProfiles(value, field) {
4003
+ if (!Array.isArray(value) || value.some((url) => typeof url !== "string" || !url.trim())) {
4004
+ throw new ValidationError(
4005
+ `${field} must be an array of LinkedIn profile URLs for account_monitor`
4006
+ );
4007
+ }
4008
+ }
4009
+ /**
4010
+ * The committee accepts the full `{ people, groups }` object, a bare URL
4011
+ * array, or a legacy label-to-URLs map. A map that carries `people` or
4012
+ * `groups` is read as the full object, exactly as the backend reads it.
4013
+ */
4014
+ _validateAccountMonitorCommittee(committee) {
4015
+ if (committee === void 0)
4016
+ return;
4017
+ if (Array.isArray(committee)) {
4018
+ this._validateAccountMonitorProfiles(committee, "committee");
4019
+ return;
4020
+ }
4021
+ if (!this._isPlainObject(committee)) {
4022
+ throw new ValidationError(
4023
+ "committee must be an object with people and/or groups, an array of LinkedIn profile URLs, or a map of group name to URLs"
4024
+ );
4025
+ }
4026
+ const hasPeople = Object.prototype.hasOwnProperty.call(committee, "people");
4027
+ const hasGroups = Object.prototype.hasOwnProperty.call(committee, "groups");
4028
+ if (!hasPeople && !hasGroups) {
4029
+ this._validateAccountMonitorGroups(committee, "committee");
4030
+ return;
4031
+ }
4032
+ if (hasPeople)
4033
+ this._validateAccountMonitorProfiles(committee.people, "committee.people");
4034
+ if (hasGroups) {
4035
+ if (!this._isPlainObject(committee.groups))
4036
+ throw new ValidationError("committee.groups must map each group name to LinkedIn profile URLs");
4037
+ this._validateAccountMonitorGroups(committee.groups, "committee.groups");
4038
+ }
4039
+ }
4040
+ _validateAccountMonitorGroups(groups, field) {
4041
+ for (const [label, people] of Object.entries(groups)) {
4042
+ if (!label.trim())
4043
+ throw new ValidationError(`${field} group names must not be blank`);
4044
+ this._validateAccountMonitorProfiles(people, `${field}['${label}']`);
4045
+ }
4046
+ }
4047
+ /**
4048
+ * A company string means the company page only. People and titles are the
4049
+ * only ways to reach employees — neither is implied by the company itself.
4050
+ */
4051
+ _validateAccountMonitorCompany(value, field) {
4052
+ if (typeof value === "string") {
4053
+ if (!value.trim())
4054
+ throw new ValidationError(`${field} must be a non-empty company domain, URL, or name`);
4055
+ return;
4056
+ }
4057
+ if (!this._isPlainObject(value)) {
4058
+ throw new ValidationError(
4059
+ `${field} must be a company string, or an object with company and an explicit people or employeeTitles scope`
4060
+ );
4061
+ }
4062
+ for (const key of Object.keys(value)) {
4063
+ if (!["company", "people", "employeeTitles", "employee_titles"].includes(key)) {
4064
+ throw new ValidationError(
4065
+ `Unknown ${field} field '${key}'. A company accepts only company, people, and employeeTitles.`
4066
+ );
4067
+ }
4068
+ }
4069
+ const company = this._getParamValue(value, "company", "company");
4070
+ if (typeof company !== "string" || !company.trim())
4071
+ throw new ValidationError(`${field}.company is required and must be a non-empty string`);
4072
+ const people = this._getParamValue(value, "people", "people");
4073
+ if (people !== void 0)
4074
+ this._validateAccountMonitorProfiles(people, `${field}.people`);
4075
+ const employeeTitles = this._getParamValue(value, "employeeTitles", "employee_titles");
4076
+ if (employeeTitles !== void 0 && employeeTitles !== null) {
4077
+ if (!Array.isArray(employeeTitles) || employeeTitles.length === 0 || employeeTitles.some((title) => typeof title !== "string" || !title.trim())) {
4078
+ throw new ValidationError(
4079
+ `${field}.employeeTitles must contain at least one non-blank current-title filter. Omit it to skip employee discovery entirely.`
4080
+ );
4081
+ }
4082
+ }
4083
+ }
4084
+ _validateAccountMonitorSignalDefinitions(value) {
4085
+ if (value === void 0 || value === null)
4086
+ return;
4087
+ if (!Array.isArray(value))
4088
+ throw new ValidationError("signalDefinitions must be an array");
4089
+ const seen = /* @__PURE__ */ new Set();
4090
+ for (const entry of value) {
4091
+ if (!this._isPlainObject(entry)) {
4092
+ throw new ValidationError(
4093
+ `Each account_monitor signalDefinitions entry must be an object like { name: 'company_hiring' }`
4094
+ );
4095
+ }
4096
+ const rawName = this._getParamValue(entry, "name", "name");
4097
+ const name = typeof rawName === "string" ? rawName.trim().toLowerCase() : rawName;
4098
+ if (typeof name !== "string" || !name)
4099
+ throw new ValidationError("Each signalDefinitions entry requires a signal name");
4100
+ if (RETIRED_ACCOUNT_MONITOR_SIGNALS.includes(name)) {
4101
+ throw new ValidationError(
4102
+ `The '${name}' monitor check was retired and can no longer be requested. Choose from: ${ACCOUNT_MONITOR_SIGNALS.join(", ")}.`
4103
+ );
4104
+ }
4105
+ if (!ACCOUNT_MONITOR_SIGNALS.includes(name)) {
4106
+ throw new ValidationError(
4107
+ `'${name}' is not an account_monitor signal. Choose from: ${ACCOUNT_MONITOR_SIGNALS.join(", ")}.`
4108
+ );
4109
+ }
4110
+ if (seen.has(name)) {
4111
+ throw new ValidationError(
4112
+ `The '${name}' signal appears more than once in signalDefinitions \u2014 send each signal once.`
4113
+ );
4114
+ }
4115
+ seen.add(name);
4116
+ for (const key of Object.keys(entry)) {
4117
+ if (key !== "name") {
4118
+ throw new ValidationError(
4119
+ `Unknown signalDefinitions field '${key}'. An account_monitor entry accepts only name.`
4120
+ );
4121
+ }
4122
+ }
4123
+ }
4124
+ }
4125
+ /**
4126
+ * Merge the monitor request the way the backend does: flat `options` fields
4127
+ * first, then the nested params copy, then the dedicated field. A null never
4128
+ * overwrites a value that an earlier source already supplied.
4129
+ *
4130
+ * Only known monitor fields are read out of flat `options`, because general
4131
+ * platform options live there too. The dedicated and nested parameter
4132
+ * objects are strict, so their unknown fields are reported instead.
4133
+ */
4134
+ _accountMonitorParams(request) {
4135
+ const requestOptions = this._isPlainObject(request.options) ? request.options : {};
4136
+ const nested = this._getParamValue(
4137
+ requestOptions,
4138
+ "specializedAgentParams",
4139
+ "specialized_agent_params"
4140
+ );
4141
+ const strict = [];
4142
+ if (this._isPlainObject(nested))
4143
+ strict.push(nested);
4144
+ if (this._isPlainObject(request.specializedAgentParams))
4145
+ strict.push(request.specializedAgentParams);
4146
+ for (const source of strict) {
4147
+ for (const key of Object.keys(source)) {
4148
+ if (!ACCOUNT_MONITOR_FIELD_KEYS.has(key)) {
4149
+ throw new ValidationError(
4150
+ `Unknown account_monitor parameter '${key}'. This agent accepts only: ${ACCOUNT_MONITOR_FIELDS.map(([camel]) => camel).join(", ")}.`
4151
+ );
4152
+ }
4153
+ }
4154
+ }
4155
+ const merged = {};
4156
+ for (const source of [requestOptions, ...strict]) {
4157
+ for (const [camel, snake] of ACCOUNT_MONITOR_FIELDS) {
4158
+ const value = this._getParamValue(source, camel, snake);
4159
+ if (value !== void 0 && value !== null)
4160
+ merged[camel] = value;
4161
+ }
4162
+ }
4163
+ return merged;
4164
+ }
3877
4165
  /**
3878
4166
  * Every place a caller may put specialized-agent params: the dedicated field
3879
4167
  * and the legacy nested copy inside `options`. Both are validated so a nested
@@ -4114,6 +4402,12 @@ class ResponsesResource {
4114
4402
  for (const file of request.files)
4115
4403
  this._validateFileReference(file.uri);
4116
4404
  }
4405
+ if (request.specializedAgent === "account_monitor") {
4406
+ const monitorParams = this._accountMonitorParams(request);
4407
+ this._validateAccountMonitorParams(monitorParams);
4408
+ this._validateAccountMonitorCrmAccess(monitorParams, request);
4409
+ return this.http.post("/responses", request);
4410
+ }
4117
4411
  this._validateSalesNavigatorRequest(request);
4118
4412
  for (const params of this._specializedParamSources(request))
4119
4413
  this._validateSignalParams(params);
@@ -4194,7 +4488,7 @@ class ResponsesResource {
4194
4488
  * @param options - Optional search parameters
4195
4489
  * @param options.limit - Maximum number of results (1-100, default: 20)
4196
4490
  * @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
4197
- * @param options.excludeCrmContacts - Exclude people in the acting user's synced CRM ledger; @default true (via request `options`)
4491
+ * @param options.excludeCrmContacts - Exclude people in the acting user's synced CRM ledger; @default false (via request `options`)
4198
4492
  * @param options.crmExclusionOwners - Granted owner ledgers to exclude against (user id or email)
4199
4493
  * @param options.crmNameCompanyMatch - Also exclude by exact name+company; @default true
4200
4494
  * @returns Response with structured_response containing:
@@ -4249,7 +4543,7 @@ class ResponsesResource {
4249
4543
  * @param options.excludeProfiles - LinkedIn URLs to exclude from results
4250
4544
  * @param options.excludePreviouslyContacted - Exclude previously contacted people
4251
4545
  * @param options.excludeNames - Names to exclude from results
4252
- * @param options.excludeCrmContacts - Exclude people in the acting user's synced CRM ledger; @default true
4546
+ * @param options.excludeCrmContacts - Exclude people in the acting user's synced CRM ledger; @default false
4253
4547
  * @param options.crmExclusionOwners - Granted owner ledgers to exclude against (user id or email)
4254
4548
  * @param options.crmNameCompanyMatch - Also exclude by exact name+company; @default true
4255
4549
  * @param options.salesNavigatorUrl - Sales Navigator people-search or people-list URL to use as the only discovery source
@@ -4400,32 +4694,33 @@ class ResponsesResource {
4400
4694
  * - criteria: Generated/reused criteria definitions and classification
4401
4695
  */
4402
4696
  async peopleScoring(query, candidateProfiles, options) {
4697
+ const params = {
4698
+ candidateProfiles,
4699
+ deepValidationUseRelevanceReranker: options?.deepValidationUseRelevanceReranker ?? true,
4700
+ deepValidationBackfillBelowCriteria: options?.deepValidationBackfillBelowCriteria ?? true
4701
+ };
4403
4702
  const request = {
4404
4703
  messages: [{ role: "user", content: query }],
4405
4704
  specializedAgent: "people_scoring",
4406
- specializedAgentParams: {
4407
- candidateProfiles,
4408
- deepValidationUseRelevanceReranker: options?.deepValidationUseRelevanceReranker ?? true,
4409
- deepValidationBackfillBelowCriteria: options?.deepValidationBackfillBelowCriteria ?? true
4410
- }
4705
+ specializedAgentParams: params
4411
4706
  };
4412
4707
  if (options) {
4413
4708
  if (options.reuseCriteriaFrom)
4414
- request.specializedAgentParams.reuseCriteriaFrom = options.reuseCriteriaFrom;
4709
+ params.reuseCriteriaFrom = options.reuseCriteriaFrom;
4415
4710
  if (options.criteriaDefinitions)
4416
- request.specializedAgentParams.criteriaDefinitions = options.criteriaDefinitions;
4711
+ params.criteriaDefinitions = options.criteriaDefinitions;
4417
4712
  if (options.criteriaClassification)
4418
- request.specializedAgentParams.criteriaClassification = options.criteriaClassification;
4713
+ params.criteriaClassification = options.criteriaClassification;
4419
4714
  if (options.runSingleCriterion)
4420
- request.specializedAgentParams.runSingleCriterion = options.runSingleCriterion;
4715
+ params.runSingleCriterion = options.runSingleCriterion;
4421
4716
  if (options.addCriterion)
4422
- request.specializedAgentParams.addCriterion = options.addCriterion;
4717
+ params.addCriterion = options.addCriterion;
4423
4718
  if (options.addAndRunCriterion)
4424
- request.specializedAgentParams.addAndRunCriterion = options.addAndRunCriterion;
4719
+ params.addAndRunCriterion = options.addAndRunCriterion;
4425
4720
  if (options.deepSearchCriteriaModel)
4426
- request.specializedAgentParams.deepSearchCriteriaModel = options.deepSearchCriteriaModel;
4721
+ params.deepSearchCriteriaModel = options.deepSearchCriteriaModel;
4427
4722
  if (options.intentScoringInstructions !== void 0)
4428
- request.specializedAgentParams.intentScoringInstructions = options.intentScoringInstructions;
4723
+ params.intentScoringInstructions = options.intentScoringInstructions;
4429
4724
  }
4430
4725
  return this.create(request);
4431
4726
  }
@@ -4822,6 +5117,86 @@ class ResponsesResource {
4822
5117
  specializedAgentParams: params
4823
5118
  });
4824
5119
  }
5120
+ /**
5121
+ * Report on ONE account for ONE fixed period.
5122
+ *
5123
+ * This runs once, now: there is no backend schedule and no saved cadence, so
5124
+ * call it again when you want the next report. The period defaults to the
5125
+ * last seven days — pass `days` for a different look-back, or `window` for an
5126
+ * exact interval.
5127
+ *
5128
+ * What gets collected is decided ONLY by `signalDefinitions`, or by the
5129
+ * `depth` preset that stands in for it. Nothing is implied: a competitor
5130
+ * string means that company's page, not its employees, and committee work
5131
+ * needs `committee` people plus `depth: 'deep'` or an explicit signal.
5132
+ *
5133
+ * Coverage is always partial and the report says so — a missing record never
5134
+ * proves that nothing happened.
5135
+ *
5136
+ * @param query - What to watch for; it steers the report, not the collection.
5137
+ * Pass an empty string to run the monitor with no steering prompt — the
5138
+ * account, the period and `intentScoringInstructions` are what decide the
5139
+ * report.
5140
+ * @param options - The account, its period, and the explicit scopes to track.
5141
+ * @param options.crmUserId - CRM owner (UUID or email) whose connected CRM is
5142
+ * read for relationship context; requires `options.userId`, and another
5143
+ * member's CRM requires a CRM access grant. Omit for no CRM lookup.
5144
+ * @param options.userId - The acting user, sent as the request's top-level
5145
+ * `userId`. Required with `crmUserId`.
5146
+ * @returns Response; poll with `get()`, read `outputText` for the report and
5147
+ * `structuredResponse` as {@link AccountMonitorOutput}, whose `crmContext`
5148
+ * is present only when `crmUserId` was sent.
5149
+ *
5150
+ * @example
5151
+ * ```ts
5152
+ * await client.responses.accountMonitor(
5153
+ * 'Anything suggesting they are re-evaluating their data warehouse',
5154
+ * {
5155
+ * account: 'acme.com',
5156
+ * days: 14,
5157
+ * depth: 'deep',
5158
+ * committee: { groups: { 'data platform': ['https://www.linkedin.com/in/some-vp'] } },
5159
+ * competitors: [{ company: 'rival.com', employeeTitles: ['Account Executive'] }],
5160
+ * },
5161
+ * )
5162
+ * ```
5163
+ */
5164
+ async accountMonitor(query, options) {
5165
+ if (typeof query !== "string")
5166
+ throw new ValidationError("accountMonitor query must be a string");
5167
+ const params = { account: options.account };
5168
+ if (options.depth !== void 0)
5169
+ params.depth = options.depth;
5170
+ if (options.committee !== void 0)
5171
+ params.committee = options.committee;
5172
+ if (options.competitors !== void 0)
5173
+ params.competitors = options.competitors;
5174
+ if (options.ourCompany !== void 0)
5175
+ params.ourCompany = options.ourCompany;
5176
+ if (options.days !== void 0)
5177
+ params.days = options.days;
5178
+ if (options.window !== void 0)
5179
+ params.window = options.window;
5180
+ if (options.signalDefinitions !== void 0)
5181
+ params.signalDefinitions = options.signalDefinitions;
5182
+ if (options.intentScoringInstructions !== void 0)
5183
+ params.intentScoringInstructions = options.intentScoringInstructions;
5184
+ if (options.history !== void 0)
5185
+ params.history = options.history;
5186
+ if (options.crmUserId !== void 0)
5187
+ params.crmUserId = options.crmUserId;
5188
+ if (options.tier !== void 0)
5189
+ params.tier = options.tier;
5190
+ const prompt = query.trim() || `Account monitor report for ${options.account}`;
5191
+ const request = {
5192
+ messages: [{ role: "user", content: prompt }],
5193
+ specializedAgent: "account_monitor",
5194
+ specializedAgentParams: params
5195
+ };
5196
+ if (options.userId !== void 0)
5197
+ request.userId = options.userId;
5198
+ return this.create(request);
5199
+ }
4825
5200
  }
4826
5201
 
4827
5202
  class SequencesResource {