conduyt-mcp 4.105.43 → 4.110.0

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/client.js CHANGED
@@ -35,8 +35,9 @@ const AMBIGUOUS = " The server may have applied it: read the current state befor
35
35
  /** Room for the nested objects of an error body (a 409 contact_changed's `contact`, a stage-requirements list). */
36
36
  const ERROR_DETAILS_BOUND = 1000;
37
37
  /** Error-body keys that are the actionable state itself and are always rendered WHOLE: HealthFixRefusal.row (the deal's
38
- * current health row, which a caller needs to choose again). The response size cap bounds it. */
39
- const ALWAYS_WHOLE_KEYS = new Set(["row", "metadataConflict"]);
38
+ * current health row, which a caller needs to choose again), and the document reader's 409 creditor_row_exists `existingRow` (the
39
+ * creditor-table row the document matches, which the caller shows instead of filling). The response size cap bounds it. */
40
+ const ALWAYS_WHOLE_KEYS = new Set(["row", "metadataConflict", "existingRow"]);
40
41
  /** Bounded scheme for a refusal's error LISTS (the automation write refusals: AutomationActionConfigKeyError.errors, the 422
41
42
  * AutomationPreflightRefusal.data { message, errors[], warnings[] }) when they do not fit ERROR_DETAILS_BOUND: keep the first
42
43
  * MAX_LISTED_ERRORS entries (warnings: MAX_LISTED_WARNINGS) with every string field capped at MAX_FIELD_CHARS, and close the list with
@@ -65,6 +65,8 @@ import { registerZoomTools } from "./tools/zoom.js";
65
65
  import { registerBookingPageTools } from "./tools/booking-pages.js";
66
66
  import { registerReportTools } from "./tools/reports.js";
67
67
  import { registerReportDashboardTools } from "./tools/dashboards.js";
68
+ import { registerDocumentReaderTools } from "./tools/document-reader.js";
69
+ import { registerRoutes66cTools } from "./tools/routes66c.js";
68
70
  /** Registers every Conduyt tool on the server; each tool gets its title + MCP annotations from src/tool-annotations.ts. */
69
71
  export function registerAllTools(server, client) {
70
72
  annotateRegistrations(server);
@@ -135,4 +137,6 @@ export function registerAllTools(server, client) {
135
137
  registerBookingPageTools(server, client);
136
138
  registerReportTools(server, client);
137
139
  registerReportDashboardTools(server, client);
140
+ registerDocumentReaderTools(server, client);
141
+ registerRoutes66cTools(server, client);
138
142
  }
@@ -132,6 +132,24 @@ export const TOOL_ANNOTATIONS = {
132
132
  conduyt_get_dialer_settings: ro("Get Dialer Settings"),
133
133
  conduyt_update_dialer_settings: update("Update Dialer Settings"),
134
134
  conduyt_get_calling_hours: ro("Get Calling Hours"),
135
+ conduyt_get_call_late_link: ro("Get Call Late Link"),
136
+ // (parity66c) routes that had no tool: calendar connections / health / sync / events, mailbox connections, integrations health,
137
+ // the call log, the Twilio settings (non-credential fields), the duplicate contact groups
138
+ conduyt_list_calendar_connections: ro("List Calendar Connections"),
139
+ conduyt_get_calendar_health: ro("Get Calendar Health"),
140
+ conduyt_sync_calendar: create("Sync Calendar"), // reads the provider's events into Conduyt; each call is a new sync
141
+ conduyt_list_calendar_events: ro("List Calendar Events"),
142
+ conduyt_get_calendar_event: ro("Get Calendar Event"),
143
+ conduyt_create_calendar_event: create("Create Calendar Event"), // writes an event at the provider; a repeat makes another
144
+ conduyt_update_calendar_event: create("Update Calendar Event"), // NOT idempotent (Codex parity66c-r1): every successful PATCH calls the provider again and records another audit event
145
+ conduyt_delete_calendar_event: destroy("Delete Calendar Event"), // removes the event at the provider and in Conduyt
146
+ conduyt_list_mailbox_connections: ro("List Mailbox Connections"),
147
+ conduyt_get_integrations_health: ro("Get Integrations Health"),
148
+ conduyt_log_call: create("Log Call"), // records a call row (never dials); a repeat records another
149
+ conduyt_get_twilio_settings: ro("Get Twilio Settings"),
150
+ conduyt_update_twilio_settings: row("Update Twilio Settings", false, true, false), // destructive + not idempotent (Codex parity66c-r1): it can clear phoneNumber / twimlAppSid, release or rewire provider resources, and each save is audited; no credential is taken
151
+ conduyt_find_duplicate_contacts: ro("Find Duplicate Contacts"), // (callcontact66) GET /settings, the callLateLink block only
152
+ conduyt_update_call_late_link: update("Update Call Late Link"), // (callcontact66) PATCH /settings merges callLateLink; the same body lands on the same state; it links future calls only and deletes nothing
135
153
  conduyt_update_calling_hours: destroy("Update Calling Hours"), // enabled:false (with acknowledgeAnyHour) switches the calling-time check off, which re-enables outreach at any hour: a compliance change like the DNC removals; a repeat saves the same window
136
154
  conduyt_get_call_recording_settings: ro("Get Call Recording Settings"),
137
155
  conduyt_update_call_recording_settings: update("Update Call Recording Settings"),
@@ -470,6 +488,17 @@ export const TOOL_ANNOTATIONS = {
470
488
  conduyt_update_dashboard_tile: update("Update Dashboard Tile"),
471
489
  conduyt_remove_dashboard_tile: destroy("Remove Dashboard Tile"),
472
490
  conduyt_run_dashboard: ro("Run Dashboard"),
491
+ // (ocr65-parity) the document reader (OCR)
492
+ conduyt_list_contact_document_reads: ro("List Contact Document Reads"),
493
+ conduyt_get_document_read: ro("Get Document Read"),
494
+ conduyt_start_document_read: row("Start Document Read", false, true, false), // a restart discards the file's earlier reading and its Filled mark (lib/document-reader/server.ts queueDocumentRead: extracted and filled_* set NULL); each call is a new attempt
495
+ conduyt_fill_deal_from_document_read: row("Fill Deal From Document Read", false, true, false), // writes the deal's custom fields (replacing their values) and one creditor row; a repeat can add another row or answer 409 creditor_row_exists
496
+ conduyt_get_document_reader_types: ro("Get Document Reader Types"),
497
+ conduyt_put_document_reader_types: row("Replace Document Reader Types", false, true, false), // PUT replaces the whole list (types not sent are deleted); every save appends document_reader.types_updated
498
+ conduyt_update_document_reader_enabled: create("Update Document Reader Switch"), // PATCH /settings: every save appends account_settings_changed even when unchanged (as conduyt_update_document_upload_bell); off removes no data
499
+ conduyt_get_document_reader_settings: ro("Get Document Reader Settings"), // (parity66a) GET /settings, the documentReader block only
500
+ conduyt_update_document_reader_settings: create("Update Document Reader Settings"), // (parity66a) PATCH /settings as the switch: every save appends account_settings_changed; autoRead off, a lower dailyLimit or a withdrawn cloud consent deletes nothing and can be set back (readings already stored are kept)
501
+ conduyt_confirm_document_read_values: create("Confirm Document Read Values"), // (parity66a) records { by, at, valueHash } per field and audits document_read.confirmed / unconfirmed on every call; confirmed false takes a confirmation back (re-confirmable), nothing is written to a deal
473
502
  };
474
503
  /**
475
504
  * Wraps server.tool so each tool registered afterwards gets its title and annotations from TOOL_ANNOTATIONS. The registered
@@ -68,7 +68,7 @@ export function registerBulkTools(server, client) {
68
68
  });
69
69
  return formatResult(result);
70
70
  });
71
- server.tool("conduyt_export_deals", "Export deals as JSON (GET /api/v1/deals/export, owner or admin only: otherwise 403) with the board's filters: search, status, pipeline, assigned_to (user UUIDs or `unassigned`, at most 25 distinct owners), tag_ids (tag UUIDs, ANY match, at most 25), contact_timezone, created_after / created_before (YYYY-MM-DD in the account time zone, day-inclusive, or an ISO datetime with offset), value_min / value_max, needsAction, stale, health (one Pipeline health check). Answer: { deals, meta { total, exported_at, filters_applied } }; Secure custom field values are masked. The whole filtered book is read in one request (not streamed): at most 50,000 rows, past that 413 and nothing is exported (narrow the filters); rate limited to 5 exports a minute per workspace and address (429). Each repeated filter is sent as repeated query parameters, never comma-joined; the owner and tag caps are also checked here, before any request. The API judges the query names first (batch33): a name the export does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and the whole book exported) and two different values of format, search, status, pipeline, value_min / minValue, value_max / maxValue, needsAction or stale 400 query_param_conflict { message, param }, both before the numeric codes; this tool sends only accepted names. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param). TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE + " The export applies the same rule as conduyt_list_deals." + LIST_USERS_DOC, {
71
+ server.tool("conduyt_export_deals", "Export deals as JSON (GET /api/v1/deals/export, owner or admin only: otherwise 403) with the board's filters: search, status, pipeline, assigned_to (user UUIDs or `unassigned`, at most 25 distinct owners), tag_ids (tag UUIDs, ANY match, at most 25), contact_timezone, created_after / created_before (YYYY-MM-DD in the account time zone, day-inclusive, or an ISO datetime with offset), value_min / value_max, needsAction, stale, health (one Pipeline health check), last_attempt_after / last_attempt_before or no_attempt_days (the card's Last attempt, dealattempt66). Answer: { deals, meta { total, exported_at, filters_applied } } (each deal carries lastAttemptAt; the CSV export has a Last Attempt column just before Deal ID); Secure custom field values are masked. The whole filtered book is read in one request (not streamed): at most 50,000 rows, past that 413 and nothing is exported (narrow the filters); rate limited to 5 exports a minute per workspace and address (429). Each repeated filter is sent as repeated query parameters, never comma-joined; the owner and tag caps are also checked here, before any request. The API judges the query names first (batch33): a name the export does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and the whole book exported) and two different values of format, search, status, pipeline, value_min / minValue, value_max / maxValue, needsAction or stale 400 query_param_conflict { message, param }, both before the numeric codes; this tool sends only accepted names. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param). TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE + " The export applies the same rule as conduyt_list_deals." + LIST_USERS_DOC, {
72
72
  search: z.string().optional().describe("Search deal titles"),
73
73
  status: z.string().optional().describe("Filter by status (open, won, lost, or all for every status). open = open WORK: cards in a finished-work stage (isParked) are left out, as on the board"),
74
74
  include_parked: z.boolean().optional().describe("(stageparked53) true or false; the API's default is false = open work. With status open: true also returns the cards in a finished-work stage (isParked), i.e. every not-closed record (sent as include_parked=true); use it to find or share a card. Without status open it changes nothing, as in the API (the export route's own default is also false). Alias: includeParked."),
@@ -195,7 +195,7 @@ export function registerBulkTools(server, client) {
195
195
  const result = await client.post("/api/v1/bulk/deals/update", params);
196
196
  return formatResult(result);
197
197
  });
198
- server.tool("conduyt_import_preflight", "Pre-check a contact import BEFORE running it — returns criticalWarnings (phone-less list bound for SMS, heavy create-only duplicate skips, double-mapped columns), duplicate/existing-match estimates, invalid emails, DNC/litigator hits, SMS-provider readiness, and plan-limit impact. Same engine the import wizard uses; call this before conduyt_ai_import_contacts on any sizeable list. A workspace whose identifier index is still being built answers 503 `IDENTITY_INDEX_NOT_READY` (nothing checked; retry later). For objectType opportunities (deal files; absent for contacts and companies) the answer also carries dealPipelines (app dealverify64): the pipelines the deal import itself matches rows against, every pipeline of the account including archived ones (an archived pipeline keeps its [Archived] name prefix; a row naming that stored name is matched and refused with the row code pipeline_archived, because no deal can be added to an archived pipeline), each as { id, name, archived, stages: [{ name, isSystem }] } with its live stages in order. Judge a row's Pipeline and Stage cells against this list, as the import does.", {
198
+ server.tool("conduyt_import_preflight", "Pre-check a contact import BEFORE running it — returns criticalWarnings (phone-less list bound for SMS, heavy create-only duplicate skips, double-mapped columns), duplicate/existing-match estimates, invalid emails, DNC/litigator hits, SMS-provider readiness, and plan-limit impact. Same engine the import wizard uses; call this before conduyt_ai_import_contacts on any sizeable list. A workspace whose identifier index is still being built answers 503 `IDENTITY_INDEX_NOT_READY` (nothing checked; retry later). For objectType opportunities (deal files; absent for contacts and companies) the answer also carries dealPipelines (app dealverify64): the pipelines the deal import itself matches rows against, every pipeline of the account including archived ones (an archived pipeline keeps its [Archived] name prefix and, in archivedFromName (app eyeson111), the name it had before (null when not recorded, and on an active pipeline); a row naming either is matched and refused with the row code pipeline_archived, because no deal can be added to an archived pipeline; an active pipeline of the same name always wins), each as { id, name, archived, archivedFromName, stages: [{ name, isSystem }] } with its live stages in order. Judge a row's Pipeline and Stage cells against this list, as the import does.", {
199
199
  objectType: z.enum(["contacts", "opportunities", "companies"]).default("contacts").describe("What the import creates"),
200
200
  importMode: z.enum(["create_and_update", "create_only", "update_only"]).optional().describe("Duplicate handling mode the import will use"),
201
201
  totalRows: z.number().describe("Total rows in the file/payload"),
@@ -131,7 +131,7 @@ export function registerCallTools(server, client) {
131
131
  const result = await client.get(`/api/v1/dialer/calls?${searchQuery(args)}`);
132
132
  return formatResult(result);
133
133
  });
134
- server.tool("conduyt_count_unknown_callers", "Count a line's unknown callers since an instant (GET /api/v1/calls/unknown-callers, the toll-free quick mode counter: 'N unknown callers today, M not matched yet'). `total` = inbound calls to that line since `since` that arrived with no contact (still contact-less plus the ones the unknown-caller prompt linked since); `unmatched` = those still contact-less (list them with conduyt_search_dialer_history unmatched=true and line). `since` is the caller's start of day as an ISO instant and must be within the last 31 days. Refusals are 400 line_required, line_conflict, line_invalid, since_required, since_conflict, since_out_of_range. Read-only, counts only; requires dialer:view (a scoped member counts their own calls, contact-less calls and calls linked to a contact they can see).", {
134
+ server.tool("conduyt_count_unknown_callers", "Count a line's unknown callers since an instant (GET /api/v1/calls/unknown-callers, the toll-free quick mode counter: 'N unknown callers today, M not matched yet'). `total` = inbound calls to that line since `since` that arrived with no contact (still contact-less plus the ones the unknown-caller prompt linked since and, callcontact66, the ones the late link attached since: call_auto_linked, see conduyt_get_call_late_link); `unmatched` = those still contact-less (list them with conduyt_search_dialer_history unmatched=true and line). `since` is the caller's start of day as an ISO instant and must be within the last 31 days. Refusals are 400 line_required, line_conflict, line_invalid, since_required, since_conflict, since_out_of_range. Read-only, counts only; requires dialer:view (a scoped member counts their own calls, contact-less calls and calls linked to a contact they can see).", {
135
135
  line: z.string().trim().min(1).describe("Our line (the number the callers dialed), any formatting, e.g. +18005550199"),
136
136
  since: z.string().datetime({ offset: true }).describe("ISO instant, the caller's midnight, e.g. 2026-10-15T07:00:00.000Z; within the last 31 days"),
137
137
  }, async ({ line, since }) => {
@@ -20,6 +20,9 @@ export declare const LOSER_ORDER_NOTE = "losers are merged in the order given: f
20
20
  export declare const MERGE_PREVIEW_MAX = 50;
21
21
  export declare const MERGE_PREVIEW_TTL_MS: number;
22
22
  export declare const EMAIL_LOOKUP_NOTE = "Exact email lookup: one address, or up to 20 distinct addresses in an array. Each is trimmed and lower-cased and matches the contact's primary email OR any secondary email slot (email_2 and up); it is an exact match, not a substring search (use `search` for partial text). Combines with every other filter (AND) inside your account and visibility. An empty or invalid address, or more than 20 distinct addresses, is a 400. On a workspace whose identifier index is still being built, the lookup answers 422 when the stored spellings of the requested addresses exceed its stored-spelling bind budget (a count of spellings, not of contacts; other filters do not help); ask support to complete the identifier backfill. Send addresses once; duplicates collapse.";
23
+ /** (parity65pub, app apigaps65b-r4 8d674129ad) what a tag change answers when its COMMIT outcome is unknown; shared by every tool that changes a contact's tags */
24
+ export declare const TAG_OUTCOME_UNKNOWN_NOTE = "A tag change whose COMMIT acknowledgement was lost answers 503 with code tag_change_outcome_unknown (Retry-After): the change MAY have been applied, so never treat it as not applied; read the contact before retrying (a retry of a change that did commit is a reported no-op).";
25
+ export declare const TAG_READ_DEGRADED_NOTE = "When the tag change committed but a response-only read failed, the answer is still 200: `_tagsDegraded` { read: contact_tags, reason: request_budget | read_failed, tagsPredateTagChanges: true } says the `tags` shown are from before the change (tagChanges is what changed), and `_degraded` { read: custom_field_definitions, reason: request_budget | read_failed, customFieldsOmitted: true } says customFields is shown as {} because it was omitted, not because it is empty.";
23
26
  export declare const TAG_FILTER_NOTE = "Filter by tag NAME: one name, or up to 20 distinct names in an array (the contact carries ANY of them). Names match case-insensitively within your account. Cannot be combined with tagId (400). To filter by tag id use tagId.";
24
27
  export declare const TAG_ID_FILTER_NOTE = "Filter by tag ID (uuid): one id, or up to 20 distinct ids in an array (the contact carries ANY of them). A malformed id or more than 20 ids is a 400; an id that is not a tag of your account matches nothing; a merged-away tag id follows its alias to the live tag. Cannot be combined with tag (400). meta.total counts the filtered set when present, but it can be null with total_deferred; per_page 1 is only an existence probe. Use conduyt_count_contacts with tagId for the exact total.";
25
28
  /** (slow566b, app main 9aef66389) the contacts list may not count: how a caller gets the exact total */
@@ -73,6 +73,9 @@ function createMergePreviewStore() {
73
73
  /** (API ?email=, app main 318adf38d) exact lookup of one address; the API trims and lower-cases, so a stray space is harmless */
74
74
  const EMAIL_LOOKUP_ONE = z.string().trim().min(1).max(254);
75
75
  export const EMAIL_LOOKUP_NOTE = "Exact email lookup: one address, or up to 20 distinct addresses in an array. Each is trimmed and lower-cased and matches the contact's primary email OR any secondary email slot (email_2 and up); it is an exact match, not a substring search (use `search` for partial text). Combines with every other filter (AND) inside your account and visibility. An empty or invalid address, or more than 20 distinct addresses, is a 400. On a workspace whose identifier index is still being built, the lookup answers 422 when the stored spellings of the requested addresses exceed its stored-spelling bind budget (a count of spellings, not of contacts; other filters do not help); ask support to complete the identifier backfill. Send addresses once; duplicates collapse.";
76
+ /** (parity65pub, app apigaps65b-r4 8d674129ad) what a tag change answers when its COMMIT outcome is unknown; shared by every tool that changes a contact's tags */
77
+ export const TAG_OUTCOME_UNKNOWN_NOTE = "A tag change whose COMMIT acknowledgement was lost answers 503 with code tag_change_outcome_unknown (Retry-After): the change MAY have been applied, so never treat it as not applied; read the contact before retrying (a retry of a change that did commit is a reported no-op).";
78
+ export const TAG_READ_DEGRADED_NOTE = "When the tag change committed but a response-only read failed, the answer is still 200: `_tagsDegraded` { read: contact_tags, reason: request_budget | read_failed, tagsPredateTagChanges: true } says the `tags` shown are from before the change (tagChanges is what changed), and `_degraded` { read: custom_field_definitions, reason: request_budget | read_failed, customFieldsOmitted: true } says customFields is shown as {} because it was omitted, not because it is empty.";
76
79
  /** (API ?tag= / ?tagId=, #506) both are repeatable and capped at 20 distinct values; the API reads every occurrence (ANY-of) and refuses tagId together with tag */
77
80
  const TAG_FILTER_MAX = 20;
78
81
  export const TAG_FILTER_NOTE = "Filter by tag NAME: one name, or up to 20 distinct names in an array (the contact carries ANY of them). Names match case-insensitively within your account. Cannot be combined with tagId (400). To filter by tag id use tagId.";
@@ -185,7 +188,7 @@ export function registerContactTools(server, client) {
185
188
  company: z.string().optional().describe("Company name"),
186
189
  source: z.string().trim().min(1).max(100).optional().describe("Lead source (e.g. 'website', 'referral', 'import') — FIRST-WRITE-WINS acquisition truth for the lead; later inbound events do not overwrite it. 1-100 chars. Refused together with callId."),
187
190
  assignedTo: z.string().min(1).optional().describe("Owner (user ID) of the new lead. Refused together with callId: a lead made from a call is owned by the rep who took it."),
188
- masterStatus: z.string().trim().min(1).max(40).optional().describe("Lifecycle status of the LEAD (master record), distinct from any deal's status: 'open' (default), 'won', 'lost', 'abandoned', 'disqualified', or an account-defined custom status. A terminal status (won/lost/abandoned/disqualified) SILENCES all outbound automations for this contact — drips, sequences, and scheduled sends stop. Use conduyt_get_lifecycle_settings to see the account's configured statuses."),
191
+ masterStatus: z.string().trim().min(1).max(40).optional().describe("Lifecycle status of the LEAD (master record), distinct from any deal's status: 'open' (default), 'won', 'lost', 'abandoned', 'disqualified', or an account-defined custom status. A terminal status (won/lost/abandoned/disqualified) stops this contact's drips, sequences and playbooks; (wonmail66) automations, scheduled automation sends included, still act for a contact in any lead status (a workflow that must leave closed leads alone adds a contact.masterStatus condition). Consent (opt-out, DNC, litigator, GDPR forget) still applies everywhere. Use conduyt_get_lifecycle_settings to see the account's configured statuses."),
189
192
  tags: z.array(z.string()).optional().describe("Tag UUIDs to apply (tags must already exist — create them with conduyt_create_tag first)"),
190
193
  customFields: z.record(z.any()).optional().describe("Structured custom-field values keyed by field key, e.g. { lead_temperature: 'hot', budget: 50000 }. Define fields first with conduyt_create_custom_field (entity 'contact')."),
191
194
  custom_fields: z.record(z.any()).optional().describe("Alias for customFields (snake_case). Provide only one of customFields / custom_fields."),
@@ -206,7 +209,7 @@ export function registerContactTools(server, client) {
206
209
  created.inputSchema = Object.assign(base.superRefine((v, ctx) => { if (callDerivedFieldsConflict(v))
207
210
  ctx.addIssue({ code: z.ZodIssueCode.custom, message: CALL_DERIVED_REFUSAL, path: ["callId"] }); }), { shape: base.shape });
208
211
  }
209
- strictInput(server.tool("conduyt_update_contact", "Update an existing contact's fields — name, email, phone, company, owner (assignedTo), custom fields. A reassignment releases the previous owner unless keepPreviousOwnerAsCollaborator is true, which keeps them as a collaborator (read-only access to the lead and its cards). customFields merge into existing values (omit a key to leave it unchanged). Pass expectedRevision (the contact's `revision` as you read it) to refuse the save when the contact changed since." + INVALID_NUMBER_REFUSALS + " " + CONTACT_CHANGED + " " + IDENTITY_SAVE_RETRY + " " + FORMULA_WRITE_NOTE + " " + OFF_LIST_NOTE + " " + USER_FIELD_RECORD_WRITE_DOC + REPLY_USERS_DOC, {
212
+ strictInput(server.tool("conduyt_update_contact", "Update an existing contact's fields — name, email, phone, company, owner (assignedTo), custom fields. A reassignment releases the previous owner unless keepPreviousOwnerAsCollaborator is true, which keeps them as a collaborator (read-only access to the lead and its cards). customFields merge into existing values (omit a key to leave it unchanged). Pass expectedRevision (the contact's `revision` as you read it) to refuse the save when the contact changed since. TAGS: change a contact's tags with addTags / removeTags (tag names or ids, at most 100 each; refusals unknown_tag_name 400, unknown_tag_id 422, tag_add_remove_conflict 400 for the same tag in both lists, too_many_tags 400). When either list is sent the answer gains tagChanges { added, removed, unchanged: { alreadyTagged, notTagged } }, so a no-op (a tag already there, a tag not on the contact) is reported rather than silent. PATCH IGNORES a `tags` field (the API answers with a warning): this tool does not take it, use addTags / removeTags. " + TAG_OUTCOME_UNKNOWN_NOTE + " " + TAG_READ_DEGRADED_NOTE + INVALID_NUMBER_REFUSALS + " " + CONTACT_CHANGED + " " + IDENTITY_SAVE_RETRY + " " + FORMULA_WRITE_NOTE + " " + OFF_LIST_NOTE + " " + USER_FIELD_RECORD_WRITE_DOC + REPLY_USERS_DOC, {
210
213
  id: z.string().describe("Contact UUID"),
211
214
  email: z.string().optional().describe("Updated email"),
212
215
  firstName: z.string().optional().describe("Updated first name"),
@@ -217,9 +220,11 @@ export function registerContactTools(server, client) {
217
220
  assignedTo: z.string().trim().min(1).max(100).nullable().optional().describe("Reassign the lead: the new owner's user ID; null unassigns. The previous owner is released (they lose the lead unless something else explains their access) unless keepPreviousOwnerAsCollaborator is true."),
218
221
  keepPreviousOwnerAsCollaborator: z.boolean().optional().describe("With assignedTo set to another user: keep the previous owner as a collaborator of this contact (read-only access to the lead and its cards) instead of releasing them. Default false. Refused 400 without assignedTo in the same request."),
219
222
  source: z.string().trim().min(1).max(100).nullable().optional().describe("Correct the lead's first-touch source (normally first-write-wins and set at creation — update only to FIX bad attribution). Pass null to clear."),
220
- masterStatus: z.string().trim().min(1).max(40).optional().describe("Lifecycle status of the LEAD (master record), distinct from any deal's status: 'open' (default), 'won', 'lost', 'abandoned', 'disqualified', or an account-defined custom status. A terminal status (won/lost/abandoned/disqualified) SILENCES all outbound automations for this contact — drips, sequences, and scheduled sends stop. Use conduyt_get_lifecycle_settings to see the account's configured statuses."),
223
+ masterStatus: z.string().trim().min(1).max(40).optional().describe("Lifecycle status of the LEAD (master record), distinct from any deal's status: 'open' (default), 'won', 'lost', 'abandoned', 'disqualified', or an account-defined custom status. A terminal status (won/lost/abandoned/disqualified) stops this contact's drips, sequences and playbooks; (wonmail66) automations, scheduled automation sends included, still act for a contact in any lead status (a workflow that must leave closed leads alone adds a contact.masterStatus condition). Consent (opt-out, DNC, litigator, GDPR forget) still applies everywhere. Use conduyt_get_lifecycle_settings to see the account's configured statuses."),
221
224
  customFields: z.record(z.any()).optional().describe("Structured custom-field values to merge, keyed by field key. Omit a key to leave it unchanged."),
222
225
  custom_fields: z.record(z.any()).optional().describe("Alias for customFields (snake_case). Provide only one of customFields / custom_fields."),
226
+ addTags: z.array(z.string().min(1)).max(100).optional().describe("Tags to add: tag NAMES or tag ids, at most 100. An unknown name is 400 unknown_tag_name, an unknown id 422 unknown_tag_id, more than 100 in a list 400 too_many_tags, the same tag in addTags and removeTags 400 tag_add_remove_conflict. A tag the contact already has is reported, not an error (tagChanges.unchanged.alreadyTagged)."),
227
+ removeTags: z.array(z.string().min(1)).max(100).optional().describe("Tags to remove: tag NAMES or tag ids, at most 100 (same refusals as addTags). A tag the contact does not carry is reported, not an error (tagChanges.unchanged.notTagged)."),
223
228
  expectedRevision: expectedRevision(),
224
229
  }, async ({ id, customFields, custom_fields, ...updates }) => {
225
230
  const cf = resolveCustomFields(customFields, custom_fields);
@@ -255,9 +260,9 @@ export function registerContactTools(server, client) {
255
260
  const result = await client.del(`/api/v1/contacts/${encodeURIComponent(id)}`);
256
261
  return formatResult(result);
257
262
  });
258
- server.tool("conduyt_add_tags", "Add one or more existing tags to a contact by tag UUID. Tags must already exist (create them with conduyt_create_tag); this does NOT create tags." + REPLY_USERS_DOC, {
263
+ server.tool("conduyt_add_tags", "Add one or more existing tags to a contact by tag name or tag UUID (tagIds takes both, mixed). Tags must already exist (create them with conduyt_create_tag); this does NOT create tags. " + TAG_OUTCOME_UNKNOWN_NOTE + REPLY_USERS_DOC, {
259
264
  contactId: z.string().describe("Contact UUID"),
260
- tagIds: z.array(z.string()).describe("Tag UUIDs to add (must already exist)"),
265
+ tagIds: z.array(z.string()).describe("Tag names or tag UUIDs to add (must already exist)"),
261
266
  }, async ({ contactId, tagIds }) => {
262
267
  const result = await client.post(`/api/v1/contacts/${contactId}/tags`, { tagIds });
263
268
  return formatResult(result);
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { ConduytApiError, formatResult } from "../client.js";
3
- import { USER_NOTE } from "./user-fields-doc.js";
3
+ import { NUMBER_DATE_TYPE_CHANGE_NOTE, USER_NOTE } from "./user-fields-doc.js";
4
4
  import { OPTIONS_CAP_NOTE, OPTIONS_MAX, TYPE_CHANGE_NOTE } from "./lender-options.js";
5
5
  import { REMOVE_NOTE, RESOLVE_NOTE, SEARCH_NOTE, SET_NOTE, STORE_LIST_NOTE, STORE_UPDATE_NOTE, optionRowSchema, setRowsProblem, storeCreateProblem, storeUpdateProblem, writeFlags, writeQuery } from "./store-options.js";
6
6
  import { CUSTOM_FIELD_TYPES, DELANCEY_ID_NOTE, fail, formulaCreateProblem, formulaUpdateProblem, FORMULA_DEFINITION_NOTE, FORMULA_EXPRESSION_NOTE, SECURE_IDENTIFIER_NOTE } from "./formula-fields.js";
@@ -54,7 +54,7 @@ export function registerCustomFieldTools(server, client) {
54
54
  const result = await client.post("/api/v1/custom-fields", { ...params, ...(store ?? {}) });
55
55
  return formatResult(result);
56
56
  });
57
- server.tool("conduyt_update_custom_field", "Update a custom field's label, options, required status, Secure flag or reveal set. Cannot change the field key or entity type. A FORMULA field's options (op / left / right / format, or expression / format: an expression the parser refuses is 400 formula_expression_invalid with reason and position), Secure flag and required flag are re-judged with its inputs locked: 422 formula_invalid, 422 formula_secure_input; a text field an expression formula reads cannot become a user field (409 field_type_change_refused naming the formulas); turning Secure on for a number field a non-Secure formula computes from is 409 formula_secure_input naming the formulas. A deal MIRROR (conduyt_create_mirror_field) takes only section and sortOrder; anything else answers 422 invalid_mirror_definition. Turning Secure OFF (isSecure false) makes every stored value visible and needs confirmUnsecure true, else 409 secure_unsecure_unconfirmed. " + SECURE_NOTE + " " + OPTIONS_CAP_NOTE + " " + TYPE_CHANGE_NOTE + " " + DELANCEY_ID_NOTE + " " + USER_NOTE + " " + STORE_UPDATE_NOTE, {
57
+ server.tool("conduyt_update_custom_field", "Update a custom field's label, options, required status, Secure flag or reveal set. Cannot change the field key or entity type. A FORMULA field's options (op / left / right / format, or expression / format: an expression the parser refuses is 400 formula_expression_invalid with reason and position), Secure flag and required flag are re-judged with its inputs locked: 422 formula_invalid, 422 formula_secure_input; a text field an expression formula reads cannot become a user field (409 field_type_change_refused naming the formulas); turning Secure on for a number field a non-Secure formula computes from is 409 formula_secure_input naming the formulas. A deal MIRROR (conduyt_create_mirror_field) takes only section and sortOrder; anything else answers 422 invalid_mirror_definition. Turning Secure OFF (isSecure false) makes every stored value visible and needs confirmUnsecure true, else 409 secure_unsecure_unconfirmed. " + SECURE_NOTE + " " + OPTIONS_CAP_NOTE + " " + TYPE_CHANGE_NOTE + " " + DELANCEY_ID_NOTE + " " + USER_NOTE + " " + STORE_UPDATE_NOTE + NUMBER_DATE_TYPE_CHANGE_NOTE, {
58
58
  id: z.string().describe("Custom field UUID"),
59
59
  label: z.string().optional().describe("Updated label"),
60
60
  section: z.string().max(120).nullable().optional().describe("Updated section grouping (null clears); the one place besides sortOrder a deal MIRROR can be edited"),
@@ -80,7 +80,7 @@ export function registerCustomFieldTools(server, client) {
80
80
  const result = await client.patch(`/api/v1/custom-fields/${id}`, { ...rest, ...(store ?? {}) });
81
81
  return formatResult(result);
82
82
  });
83
- server.tool("conduyt_delete_custom_field", "Delete a custom field definition. Removes the field from all entities. A field a formula computes from cannot be deleted: 409 deletion_blocked (the formula named in blockers). A contact / company field mirrored on deals cannot be deleted: 409 mirror_source_in_use { mirrors } (delete the deal mirrors first; deleting a mirror deletes only the placement, never the contact's value). A Secure field cannot be deleted: 409 secure_field_delete_refused (turn Secure off first with conduyt_update_custom_field isSecure false + confirmUnsecure true, then delete). A BDA-sized field can take longer than the server's impact budget to read: DELETE answers 503 custom_field_impact_timeout with Retry-After 5 (nothing was deleted: the transaction rolled back and no lock is held), a RETRYABLE answer: wait the Retry-After seconds and call this tool again (this tool does not replay a delete itself); if it keeps answering 503 after a few tries, stop and report the code. GET /api/v1/custom-fields/{id}/impact (the Settings delete preview) answers the same 503 (\"Impact preview timed out, the delete still works.\"). The same 503 also answers the delete's pre-check (the read that produces the 409 counts) and a dry run; nothing changes either way. The 409 with counts is unchanged." + " " + DELANCEY_ID_NOTE, {
83
+ server.tool("conduyt_delete_custom_field", "Delete a custom field definition. Removes the field from all entities. A field a formula computes from cannot be deleted: 409 deletion_blocked (the formula named in blockers). A contact / company field mirrored on deals cannot be deleted: 409 mirror_source_in_use { mirrors } (delete the deal mirrors first; deleting a mirror deletes only the placement, never the contact's value). A Secure field cannot be deleted: 409 secure_field_delete_refused (turn Secure off first with conduyt_update_custom_field isSecure false + confirmUnsecure true, then delete). A BDA-sized field can take longer than the server's impact budget to read: DELETE answers 503 custom_field_impact_timeout with Retry-After 5 (nothing was deleted: the transaction rolled back and no lock is held), a RETRYABLE answer: wait the Retry-After seconds and call this tool again (this tool does not replay a delete itself); if it keeps answering 503 after a few tries, stop and report the code. GET /api/v1/custom-fields/{id}/impact (the Settings delete preview) answers the same 503 (\"Impact preview timed out, the delete still works.\"). The same 503 also answers the delete's pre-check (the read that produces the 409 counts) and a dry run; nothing changes either way. The 409 with counts is unchanged." + " " + DELANCEY_ID_NOTE + NUMBER_DATE_TYPE_CHANGE_NOTE, {
84
84
  id: z.string().describe("Custom field UUID"),
85
85
  }, async ({ id }) => {
86
86
  const result = await client.del(`/api/v1/custom-fields/${id}`);
@@ -3,6 +3,23 @@ import { z } from "zod";
3
3
  /** the caps the API applies (conduyt-app lib/deal-filter-params.ts MAX_OWNER_FILTERS / MAX_TAG_FILTERS) */
4
4
  export declare const MAX_OWNER_FILTERS = 25;
5
5
  export declare const MAX_TAG_FILTERS = 25;
6
+ /** (dealattempt66, app lib/deal-attempt-filter.ts) the card's Last attempt filters GET /deals and GET /deals/export both read */
7
+ export declare const NO_ATTEMPT_DAYS_MAX = 3650;
8
+ /** the API's own sentence for the conflict (400 query_param_conflict); refused here before any request */
9
+ export declare const NO_ATTEMPT_DAYS_CONFLICT = "no_attempt_days cannot be combined with last_attempt_after or last_attempt_before.";
10
+ export declare const dealAttemptFilterShape: {
11
+ last_attempt_after: z.ZodOptional<z.ZodString>;
12
+ last_attempt_before: z.ZodOptional<z.ZodString>;
13
+ no_attempt_days: z.ZodOptional<z.ZodNumber>;
14
+ };
15
+ export declare const DEAL_ATTEMPT_DOC = " LAST ATTEMPT (dealattempt66): each deal carries lastAttemptAt (ISO or null, read-only): the newest outbound call, text or e-mail for THAT deal (the one it was made from via dealId on the send / call, else the contact's only open deal, else the sender's own open deals); kept about a minute after the attempt; null = no attempt since the field shipped (no history backfill). Filter with last_attempt_after / last_attempt_before or no_attempt_days.";
16
+ type AttemptFilters = {
17
+ last_attempt_after?: string;
18
+ last_attempt_before?: string;
19
+ no_attempt_days?: number;
20
+ };
21
+ /** appends the Last attempt filters (sent as given; the API judges the dates); the days filter with a bound is refused here */
22
+ export declare function appendDealAttemptFilters(qp: URLSearchParams, p: AttemptFilters): void;
6
23
  /** the extra GET /deals/export filters (the board's), beside search / status / pipeline / contact_timezone which the tool already had */
7
24
  export declare const dealExportFilterShape: {
8
25
  assigned_to: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -14,8 +31,11 @@ export declare const dealExportFilterShape: {
14
31
  needsAction: z.ZodOptional<z.ZodBoolean>;
15
32
  stale: z.ZodOptional<z.ZodBoolean>;
16
33
  health: z.ZodOptional<z.ZodString>;
34
+ last_attempt_after: z.ZodOptional<z.ZodString>;
35
+ last_attempt_before: z.ZodOptional<z.ZodString>;
36
+ no_attempt_days: z.ZodOptional<z.ZodNumber>;
17
37
  };
18
- type ExportFilters = {
38
+ type ExportFilters = AttemptFilters & {
19
39
  assigned_to?: string | string[];
20
40
  tag_ids?: string | string[];
21
41
  created_after?: string;
@@ -4,8 +4,30 @@ import { z } from "zod";
4
4
  export const MAX_OWNER_FILTERS = 25;
5
5
  export const MAX_TAG_FILTERS = 25;
6
6
  const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
7
+ /** (dealattempt66, app lib/deal-attempt-filter.ts) the card's Last attempt filters GET /deals and GET /deals/export both read */
8
+ export const NO_ATTEMPT_DAYS_MAX = 3650;
9
+ /** the API's own sentence for the conflict (400 query_param_conflict); refused here before any request */
10
+ export const NO_ATTEMPT_DAYS_CONFLICT = "no_attempt_days cannot be combined with last_attempt_after or last_attempt_before.";
11
+ export const dealAttemptFilterShape = {
12
+ last_attempt_after: z.string().optional().describe("(dealattempt66) Deals whose Last attempt (lastAttemptAt) is on or after this day: YYYY-MM-DD (from the start of that day in the account's time zone) or a full ISO 8601 datetime with offset; an invalid date is 400 invalid_last_attempt_range. Not with no_attempt_days"),
13
+ last_attempt_before: z.string().optional().describe("(dealattempt66) Deals whose Last attempt is on or before this day: YYYY-MM-DD (through the end of that day in the account's time zone) or a full ISO 8601 datetime with offset; same rules as last_attempt_after"),
14
+ no_attempt_days: z.number().int().min(1).max(NO_ATTEMPT_DAYS_MAX).optional().describe(`(dealattempt66) Deals with no attempt in the last N days (1 to ${NO_ATTEMPT_DAYS_MAX}), a deal never attempted included. Not with last_attempt_after / last_attempt_before (refused before any request; the API answers 400 query_param_conflict)`),
15
+ };
16
+ export const DEAL_ATTEMPT_DOC = " LAST ATTEMPT (dealattempt66): each deal carries lastAttemptAt (ISO or null, read-only): the newest outbound call, text or e-mail for THAT deal (the one it was made from via dealId on the send / call, else the contact's only open deal, else the sender's own open deals); kept about a minute after the attempt; null = no attempt since the field shipped (no history backfill). Filter with last_attempt_after / last_attempt_before or no_attempt_days.";
17
+ /** appends the Last attempt filters (sent as given; the API judges the dates); the days filter with a bound is refused here */
18
+ export function appendDealAttemptFilters(qp, p) {
19
+ if (p.no_attempt_days !== undefined && (p.last_attempt_after !== undefined || p.last_attempt_before !== undefined))
20
+ throw new Error(NO_ATTEMPT_DAYS_CONFLICT);
21
+ if (p.last_attempt_after !== undefined)
22
+ qp.set("last_attempt_after", p.last_attempt_after);
23
+ if (p.last_attempt_before !== undefined)
24
+ qp.set("last_attempt_before", p.last_attempt_before);
25
+ if (p.no_attempt_days !== undefined)
26
+ qp.set("no_attempt_days", String(p.no_attempt_days));
27
+ }
7
28
  /** the extra GET /deals/export filters (the board's), beside search / status / pipeline / contact_timezone which the tool already had */
8
29
  export const dealExportFilterShape = {
30
+ ...dealAttemptFilterShape,
9
31
  assigned_to: z.union([z.string(), z.array(z.string())]).optional().describe("Only deals owned by these users: a user UUID or `unassigned`, one string or an array (each value is sent as its own repeated assigned_to parameter; a comma list inside a value is read too). ANY of them. At most 25 distinct owners (refused before any request)"),
10
32
  tag_ids: z.union([z.string(), z.array(z.string())]).optional().describe("Only deals with one of these tags: tag UUIDs, one string or an array (each value sent as its own repeated tag_ids parameter), ANY match. At most 25 entries (refused before any request)"),
11
33
  created_after: z.string().optional().describe("Created on or after this date: YYYY-MM-DD (the account time zone) or a full ISO datetime with offset"),
@@ -50,6 +72,7 @@ export function appendDealExportFilters(qp, p) {
50
72
  qp.set("stale", "true");
51
73
  if (p.health)
52
74
  qp.set("health", p.health);
75
+ appendDealAttemptFilters(qp, p);
53
76
  }
54
77
  export const DEAL_VIEW_RULES_DOC = "A view's `filters` is a flat ARRAY of rules { field, operator, value } that are ANDed; value is always a STRING (a comma-separated list for operator in; every rule carries a value: send \"\" for is_empty / is_not_empty). Fields and operators: title, status, priority, currency, lostReason (equals, not_equals, contains, not_contains, starts_with, in, is_empty, is_not_empty); value (equals, not_equals, gt, gte, lt, lte, is_empty, is_not_empty; a plain number); pipelineId, stageId, assignedTo, contactId, companyId (UUIDs; equals, not_equals, in, is_empty, is_not_empty); createdAt, updatedAt, expectedCloseDate, wonAt, lostAt (within / not_within with a duration like 7d, 24h or 30m; before / after with an ISO calendar date; is_empty, is_not_empty); contactTimezone (the linked contact's time zone; equals, in; each value a group word eastern, central, mountain, pacific, alaska, hawaii, unknown, or an IANA id, the same values as conduyt_list_deals contact_timezone, at most 25 distinct). The API validates every rule and answers 400 with the reason (a custom-field mirror key is 422 mirror_not_filterable).";
55
78
  export const DEAL_VIEW_AUDIENCE_DOC = "AUDIENCE: an admin or owner creates a SHARED view and must pass members ([{ userId }] for the picked reps, or [] for everyone), else 400 audience_required; any other user creates a PERSONAL view, which has no audience (members on a personal view update is 400 personal_no_audience). Only an admin edits or deletes a shared view; a personal view is its owner's; a system view's name, filters, icon and sort cannot be changed and it cannot be deleted (403).";
@@ -8,12 +8,14 @@ const UUID = "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-
8
8
  const VIEW_ID_RE = new RegExp(`^(?:${DEALS_PAGE_VIEW_BUILTIN_IDS.join("|")}|${UUID})$`);
9
9
  const DATE_RE = /^(?:\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01]))?$/;
10
10
  const AMOUNT_RE = /^(?:\d{1,10}(?:\.\d{1,2})?)?$/;
11
+ /** (dealattempt66) "" or 1..3650 with no leading zero (the app's NO_ATTEMPT_DAYS_RE, lib/deal-views.ts) */
12
+ const NO_ATTEMPT_DAYS_RE = /^(?:|[1-9]\d{0,2}|[1-2]\d{3}|3[0-5]\d{2}|36[0-4]\d|3650)$/;
11
13
  /** the API's rules for one view (lib/validators/deal-views.ts at the app's dealviewsaved53 branch), mirrored so a bad body is refused before any request */
12
14
  const viewId = (what) => z.string().regex(VIEW_ID_RE, "a built-in id (all | open | mine | won | lost) or a view UUID").describe(what);
13
15
  const nameSchema = z.string().min(1).max(60).regex(/\S/, "not blank").describe("View name, 1-60 characters, not blank; one name per person (any case), built-in names taken");
14
16
  const statusSchema = z.enum(["all", "open", "won", "lost"]).describe("Which deals: all | open | won | lost");
15
17
  const sortSchema = z.object({
16
- field: z.enum(["name", "value", "closeDate", "created"]).describe("name | value | closeDate | created (a view with no sort opens on created, newest first)"),
18
+ field: z.enum(["name", "value", "closeDate", "created", "lastAttempt"]).describe("name | value | closeDate | created | lastAttempt (the card's Last attempt, dealattempt66; a view with no sort opens on created, newest first)"),
17
19
  dir: z.enum(["asc", "desc"]).describe("asc | desc"),
18
20
  }).strict();
19
21
  /** (dealviewsaved53 r6, Codex r5 P3) the API's own filter rules (the app's lib/deal-views parseDealViewFilters), refused before any
@@ -35,13 +37,22 @@ const filtersSchema = z.object({
35
37
  contactTimezones: noRepeats(z.array(z.enum(["eastern", "central", "mountain", "pacific", "alaska", "hawaii", "unknown"])).max(7)).optional().describe("The linked contact's time zone group: eastern | central | mountain | pacific | alaska | hawaii | unknown"),
36
38
  valueMin: z.string().regex(AMOUNT_RE, "an amount string, at most two decimals, or \"\"").optional().describe("Deal value at least, an amount STRING like \"5000\" or \"99.50\"; \"\" = no bound"),
37
39
  valueMax: z.string().regex(AMOUNT_RE, "an amount string, at most two decimals, or \"\"").optional().describe("Deal value at most, same form as valueMin (the API refuses min above max)"),
40
+ // (dealattempt66, app lib/deal-views.ts) the card's Last attempt: a day range, or none in the last N days; "" = no filter
41
+ attemptFrom: z.string().regex(DATE_RE, "YYYY-MM-DD or \"\"").refine(realDateOrBlank, "attemptFrom: a date (YYYY-MM-DD).").optional().describe("Last attempt on or after, YYYY-MM-DD; \"\" = no bound"),
42
+ attemptTo: z.string().regex(DATE_RE, "YYYY-MM-DD or \"\"").refine(realDateOrBlank, "attemptTo: a date (YYYY-MM-DD).").optional().describe("Last attempt on or before, YYYY-MM-DD; \"\" = no bound (the API refuses from after to)"),
43
+ noAttemptDays: z.string().regex(NO_ATTEMPT_DAYS_RE, "noAttemptDays: a whole number of days from 1 to 3650.").optional().describe("No attempt in the last N days, a whole number STRING \"1\"..\"3650\" (no leading zero), a deal never attempted included; \"\" = no filter; not with attemptFrom / attemptTo"),
38
44
  }).strict().superRefine((f, ctx) => {
39
45
  // (r6, Codex r5 P3) the API's cross-field rules (parseDealViewFilters): a range is never reversed
40
46
  if (f.createdFrom && f.createdTo && f.createdFrom > f.createdTo)
41
47
  ctx.addIssue({ code: z.ZodIssueCode.custom, message: "createdFrom is after createdTo", path: ["createdFrom"] });
42
48
  if (f.valueMin && f.valueMax && Number(f.valueMin) > Number(f.valueMax))
43
49
  ctx.addIssue({ code: z.ZodIssueCode.custom, message: "valueMin is above valueMax", path: ["valueMin"] });
44
- }).describe("The Deals page's filters (no other key): ownerIds, createdFrom, createdTo, tagIds, contactTimezones, valueMin, valueMax; every key optional");
50
+ // (dealattempt66) the API's two Last attempt rules (parseDealViewFilters)
51
+ if (f.attemptFrom && f.attemptTo && f.attemptFrom > f.attemptTo)
52
+ ctx.addIssue({ code: z.ZodIssueCode.custom, message: "attemptFrom is after attemptTo.", path: ["attemptFrom"] });
53
+ if (f.noAttemptDays && (f.attemptFrom || f.attemptTo))
54
+ ctx.addIssue({ code: z.ZodIssueCode.custom, message: "noAttemptDays cannot be combined with attemptFrom or attemptTo.", path: ["noAttemptDays"] });
55
+ }).describe("The Deals page's filters (no other key): ownerIds, createdFrom, createdTo, tagIds, contactTimezones, valueMin, valueMax, attemptFrom, attemptTo, noAttemptDays; every key optional");
45
56
  const VIEW_DOC = "A view is { id, name, builtin, status (all | open | won | lost), filters, listSort ({ field, dir } or null), savedListSort, shared, mine, canEdit, owner ({ id, name } or null), revision (16 hex characters, on every view but a built-in: the revision of what the view saves; pass it back as expectedRevision on an update), count? }. These are the Deals page's views, per person per workspace (needs deals.view); they are NOT the board's saved view tabs of conduyt_list_deal_views (GET /deals/views).";
46
57
  export function registerDealsPageViewTools(server, client) {
47
58
  strictInput(server.tool("conduyt_list_deals_page_views", "List the Deals page's saved views you see (GET /api/v1/deal-views): { views, defaultViewId, canShare }. The five built-ins come first in this order: all \"All deals\", open \"Open deals\", mine \"My deals\" (your own OPEN deals), won \"Won\", lost \"Lost and disqualified\"; then your own views and the views shared in the workspace. defaultViewId = the view the page opens on (your starred one, else all); canShare = whether you may share views (the Manager permission deals.view_all). With pipeline every view also carries count: its deals on that pipeline as GET /deals counts them for you (null when a count could not be read). Read-only. 400 invalid_pipeline (not a UUID), unknown_query_param, query_param_conflict. " + VIEW_DOC, { pipeline: z.string().uuid().optional().describe("Pipeline UUID: adds each view's count of deals on that pipeline") }, async ({ pipeline }) => {
@@ -7,7 +7,7 @@ import { FORMULA_WRITE_NOTE } from "./formula-fields.js";
7
7
  import { strictInput } from "./strict.js";
8
8
  import { KEEP_PREVIOUS_OWNER_NEEDS_ASSIGNEE } from "./contacts.js";
9
9
  import { CONTACT_TIMEZONE_NOTE, appendContactTimezone, contactTimezoneSchema } from "./contact-timezone.js";
10
- import { DEAL_VIEW_AUDIENCE_DOC, DEAL_VIEW_RULES_DOC, dealViewFields } from "./deal-views.js";
10
+ import { DEAL_ATTEMPT_DOC, DEAL_VIEW_AUDIENCE_DOC, DEAL_VIEW_RULES_DOC, appendDealAttemptFilters, dealAttemptFilterShape, dealViewFields } from "./deal-views.js";
11
11
  // (mirror1292, batch31 #1292 Ship 3) deal MIRROR fields: a write-through view of a contact / company field, named on the deal tools
12
12
  /** (parity64, app dealupdate63, live OpenAPI POST /imports importMode and ImportJobRead.unchangedRows) updating existing deals from the deal import */
13
13
  export const DEAL_IMPORT_UPDATE_DOC = " UPDATING deals (app dealupdate63): importMode create_and_update (the default when omitted) updates the deal a row's dealId names and creates the rows without one; update_only updates by dealId and never creates (a row without a dealId is not applied); create_only creates every row (a dealId is not read: the create behaviour above). The ONLY matching key is the Deal ID, the deal's UUID (from conduyt_list_deals, or the last column, Deal ID, of conduyt_export_deals); nothing else (title, contact) ever matches a deal. An update writes only the non-blank cells that differ from the deal (a blank cell keeps the stored value; there is no clear), through the same write as PATCH /deals/{id} (its validation, permission, row-level edit rule and side effects: deal.updated webhooks and automations, activities, mirrors, audit), so, unlike the create path, an update DOES fire them. It never changes the stage, pipeline or status (a differing cell is noted on the row, code stage_status_not_changed). A dealId that is malformed, unknown, of another account, deleted, or of a deal the importer may not edit: the row is not applied, with one note (the same text for each). A field value that cannot be applied is noted (code deal_field_not_applied) and the row's other fields still apply. A matched row with nothing to change is unchanged (no write, no event). A non-blank cell of a Secure custom field is always written, never compared, so the outcome never tells whether it matched the stored value. A mirrored field the linked record refuses is not applied (deal_field_not_applied) and the row's other fields still apply. The answer counts updatedRows and unchangedRows beside the created / skipped / duplicate counts (unchangedRows are also counted in skippedRows: skippedRows = failedRows + duplicateRows + unchangedRows on a deal import); stage_status_not_changed and deal_field_not_applied come back in errorLog like the other row notes. title and pipelineName are required only on a create row.";
@@ -63,7 +63,7 @@ function boardSnapshotColumns(a, f) {
63
63
  return a.board_columns.map((c) => (c.limit === undefined ? c.stageId : `${c.stageId}:${c.limit}`)).join(",");
64
64
  }
65
65
  export function registerDealTools(server, client) {
66
- strictInput(server.tool("conduyt_list_deals", "List deals with filtering by pipeline, stage, assignee, or status. Returns deal title, value, stage, contact, and dates. Filter by pipeline/stage NAME (the same names you import with) or by UUID — both camelCase (pipelineName) and snake_case (pipeline_name) argument names are accepted. An unknown name returns a clear error, never the whole account. Each deal row carries hasNextStep (boolean: an open task or a booked appointment from a day ago on; the Needs next action rule's own answer) and nextAppointmentAt (ISO string or null; null unless your key can view the calendar, even when hasNextStep is true). PIPELINE HEALTH: pass health_summary=true to get the Pipeline health strip for the same filtered set instead of the deal list: { totalOpenDeals, atRiskValue, checks[] (key, label, severity, color, rule, count, value; the six checks high_value_idle, stale, unassigned, needs_action, missing_close_date, missing_contact, ordered by money at risk), deals }. Add health_check to also get that check's first page of deals (highest value first) as deals: { check, offset, items, hasMore, nextCursor, total }; deals is null without a check. Page with health_cursor (the previous nextCursor, passed back UNCHANGED: an opaque signed token) or health_offset, and health_rows_only=true to get just the page without the summary: the answer is {data:{deals:{check, offset, items, hasMore, nextCursor}}} (the page sits under data.deals). " + HEALTH_ERRORS + " " + BOARD_SNAPSHOT_DOC + " " + BUSY_503_DOC + MIRROR_READ_DOC + " A mirror key is not filterable (422 mirror_not_filterable). The API judges the query NAMES (batch32, #1313): a name GET /deals does not read is 400 unknown_query_param { message, unknown[], accepted[] (every name it reads), didYouMean { name: accepted twin } for the camelCase / snake_case twin of an accepted name } and is never silently ignored (it used to answer the unfiltered list); two different values for a single-value name (status, contact_id, search, stale, needsAction, summary, latest_updated, system_occupancy, sort, order, page, per_page, value_min / minValue, value_max / maxValue) are 400 query_param_conflict { message, param }, an exact repeat is accepted. This tool sends only accepted names (pipeline, pipeline_name, stage, stage_name, assigned_to, status, include_parked, search, contact_timezone, view_id, page, per_page, sort, order, list_order, board_snapshot, board_columns, health_summary, health_check, health_limit, health_offset, health_cursor, health_rows_only), so these two codes mean an older or newer server than this MCP expects; they reach you as `Conduyt API 400: <message>` with the code. The API judges sort and order (batch32): an unknown sort field, or an order other than asc / desc, is 400 sort_invalid { message, param, accepted } (the sent spelling in param) and is never silently replaced by the default order. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param)." + " " + ROLE_COLUMNS_NOTE + " TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE + LIST_USERS_DOC, {
66
+ strictInput(server.tool("conduyt_list_deals", "List deals with filtering by pipeline, stage, assignee, or status. Returns deal title, value, stage, contact, and dates. Paged: meta.has_more says whether another page exists; page by has_more, never by meta.total (the total can be left out). Filter by pipeline/stage NAME (the same names you import with) or by UUID — both camelCase (pipelineName) and snake_case (pipeline_name) argument names are accepted. An unknown name returns a clear error, never the whole account. Each deal row carries hasNextStep (boolean: an open task or a booked appointment from a day ago on; the Needs next action rule's own answer) and nextAppointmentAt (ISO string or null; null unless your key can view the calendar, even when hasNextStep is true). PIPELINE HEALTH: pass health_summary=true to get the Pipeline health strip for the same filtered set instead of the deal list: { totalOpenDeals, atRiskValue, checks[] (key, label, severity, color, rule, count, value; the six checks high_value_idle, stale, unassigned, needs_action, missing_close_date, missing_contact, ordered by money at risk), deals }. Add health_check to also get that check's first page of deals (highest value first) as deals: { check, offset, items, hasMore, nextCursor, total }; deals is null without a check. Page with health_cursor (the previous nextCursor, passed back UNCHANGED: an opaque signed token) or health_offset, and health_rows_only=true to get just the page without the summary: the answer is {data:{deals:{check, offset, items, hasMore, nextCursor}}} (the page sits under data.deals). " + HEALTH_ERRORS + " " + BOARD_SNAPSHOT_DOC + " " + BUSY_503_DOC + MIRROR_READ_DOC + " A mirror key is not filterable (422 mirror_not_filterable). The API judges the query NAMES (batch32, #1313): a name GET /deals does not read is 400 unknown_query_param { message, unknown[], accepted[] (every name it reads), didYouMean { name: accepted twin } for the camelCase / snake_case twin of an accepted name } and is never silently ignored (it used to answer the unfiltered list); two different values for a single-value name (status, contact_id, search, stale, needsAction, summary, latest_updated, system_occupancy, sort, order, page, per_page, value_min / minValue, value_max / maxValue) are 400 query_param_conflict { message, param }, an exact repeat is accepted. This tool sends only accepted names (pipeline, pipeline_name, stage, stage_name, assigned_to, status, include_parked, search, contact_timezone, view_id, page, per_page, sort, order, list_order, board_snapshot, board_columns, health_summary, health_check, health_limit, health_offset, health_cursor, health_rows_only, last_attempt_after, last_attempt_before, no_attempt_days), so these two codes mean an older or newer server than this MCP expects; they reach you as `Conduyt API 400: <message>` with the code. The API judges sort and order (batch32): an unknown sort field, or an order other than asc / desc, is 400 sort_invalid { message, param, accepted } (the sent spelling in param) and is never silently replaced by the default order. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param)." + " " + ROLE_COLUMNS_NOTE + " TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE + DEAL_ATTEMPT_DOC + LIST_USERS_DOC, {
67
67
  pipeline: z.string().optional().describe("Filter by pipeline UUID (canonical). Aliases: pipelineId, pipeline_id."),
68
68
  pipelineId: z.string().optional().describe("Filter by pipeline UUID (alias of pipeline)."),
69
69
  pipeline_id: z.string().optional().describe("snake_case alias of pipelineId."),
@@ -83,7 +83,8 @@ export function registerDealTools(server, client) {
83
83
  view_id: z.string().optional().describe("Apply this SAVED DEAL VIEW (a UUID from conduyt_list_deal_views; sent as view_id, the canonical name in the OpenAPI, which also documents the alias viewId): the list is the set the view defines, ANDed with every other filter given here (the API combines them; nothing is resolved by this tool). 404 when the view does not exist, is disabled or is not visible to you; 422 when its stored rules are invalid or unsupported; 400 for a blank or non-UUID id (forwarded as given). Works with health_summary and board_snapshot too."),
84
84
  page: z.number().optional().describe("Page number (default 1)"),
85
85
  per_page: z.number().int().min(1).max(BOARD_SNAPSHOT_MAX_COLUMN_ROWS).optional().describe("Results per page, an integer 1-1000 (server default 50, max 1000; with board_snapshot it is the default rows per column)"),
86
- sort: z.enum(["createdAt", "updatedAt", "title", "value", "expectedCloseDate"]).optional().describe("Sort field (server default createdAt). A missing value / expectedCloseDate sorts last both ways under list_order. Without list_order the board's order (stage, card position) comes first and sort only breaks ties."),
86
+ ...dealAttemptFilterShape,
87
+ sort: z.enum(["createdAt", "updatedAt", "title", "value", "expectedCloseDate", "lastAttemptAt"]).optional().describe("Sort field (server default createdAt). lastAttemptAt = the card's Last attempt (dealattempt66; a deal never attempted sorts last both ways). A missing value / expectedCloseDate sorts last both ways under list_order. Without list_order the board's order (stage, card position) comes first and sort only breaks ties."),
87
88
  order: z.enum(["asc", "desc"]).optional().describe("Sort direction (server default desc)."),
88
89
  list_order: z.boolean().optional().describe("true: sort is the PRIMARY order of the whole filtered set (the Deals page's list: page 2 continues the same order across every stage), then id. Refused before any request with health_summary or board_snapshot (sort and order are refused with health_summary too; with board_snapshot they break ties in the board order and are sent)."),
89
90
  health_summary: z.boolean().optional().describe("true: answer the Pipeline health shape (totalOpenDeals, atRiskValue, checks[], deals) for the filtered set instead of the deal list."),
@@ -152,6 +153,7 @@ export function registerDealTools(server, client) {
152
153
  appendContactTimezone(params, a.contact_timezone);
153
154
  if (a.view_id !== undefined)
154
155
  params.set("view_id", a.view_id);
156
+ appendDealAttemptFilters(params, a);
155
157
  if (page)
156
158
  params.set("page", String(page));
157
159
  if (per_page)
@@ -41,4 +41,12 @@ export declare const CALLING_HOURS_ORDER_MESSAGE = "callingWindow.end must be af
41
41
  * settings revision, 403) are surfaced as it sends them.
42
42
  */
43
43
  export declare function registerCallingHoursTools(server: McpServer, client: ConduytClient): void;
44
+ /** (callcontact66, app lib/call-late-link.ts) the window's default and ceiling */
45
+ export declare const CALL_LATE_LINK_DEFAULT_WINDOW_MINUTES = 30;
46
+ export declare const CALL_LATE_LINK_MAX_WINDOW_MINUTES = 240;
47
+ /** settings.callLateLink as the server reads it (readCallLateLinkSettings): a non-integer window = the default, out of range = clamped */
48
+ export declare function callLateLinkOf(settings: unknown): {
49
+ windowMinutes: number;
50
+ sharedNumberRepDealRule: boolean;
51
+ };
44
52
  export {};
@@ -142,4 +142,29 @@ export function registerCallingHoursTools(server, client) {
142
142
  callingWindow.acknowledgeAnyHour = acknowledgeAnyHour;
143
143
  return patchGeneralSettings(client, { callingWindow });
144
144
  }));
145
+ // (callcontact66) the late link of calls saved with no contact: settings.callLateLink (app lib/call-late-link.ts)
146
+ server.tool("conduyt_get_call_late_link", `Read how calls saved with NO contact are linked later (settings.callLateLink, as the server reads it; GET /api/v1/settings): { callLateLink: { windowMinutes (minutes after a call ends during which a contactless call is still linked once its number has exactly one live contact, e.g. a contact a transfer form created while the call was in progress; default ${CALL_LATE_LINK_DEFAULT_WINDOW_MINUTES}, 0 = the late link is off, at most ${CALL_LATE_LINK_MAX_WINDOW_MINUTES}), sharedNumberRepDealRule (default false: a number several contacts share is never linked; true also links an ANSWERED INBOUND call on a shared number when exactly one of those contacts has an open deal assigned to the rep who answered and that rep can already open the contact) } }. A link writes a call_auto_linked activity on the contact. Change it with conduyt_update_call_late_link. API key scopes: settings.`, {}, async () => {
147
+ const result = (await client.get("/api/v1/settings"));
148
+ return formatResult({ data: { callLateLink: callLateLinkOf(result?.data) } });
149
+ });
150
+ strictInput(server.tool("conduyt_update_call_late_link", `Change how calls saved with no contact are linked later (PATCH /api/v1/settings { callLateLink: { windowMinutes?, sharedNumberRepDealRule? } }; owner or admin only, else 403 forbidden "Only an owner or admin can change how calls with no contact are linked later"). Only the keys sent change (the API merges them). windowMinutes: an integer 0 to ${CALL_LATE_LINK_MAX_WINDOW_MINUTES} (default ${CALL_LATE_LINK_DEFAULT_WINDOW_MINUTES}; 0 turns the late link off). sharedNumberRepDealRule: default false; true ALSO links an answered inbound call whose number several contacts share, inside the same window, but only when exactly one of those contacts has an open deal assigned to the rep who answered and that rep can already open the contact (a household line's call lands on the rep's client); otherwise it stays unlinked. Each link writes a call_auto_linked activity. Nothing to change is refused before any request. A stale settings revision is handed back as a conflict with the current settings. API key scopes: settings.`, {
151
+ windowMinutes: z.number().int().min(0).max(CALL_LATE_LINK_MAX_WINDOW_MINUTES).optional().describe(`minutes after a call ends, 0 to ${CALL_LATE_LINK_MAX_WINDOW_MINUTES} (0 = off; default ${CALL_LATE_LINK_DEFAULT_WINDOW_MINUTES})`),
152
+ sharedNumberRepDealRule: z.boolean().optional().describe("true = also link an answered inbound call on a shared number to the one contact with an open deal of the rep who answered (default false)"),
153
+ }, async ({ windowMinutes, sharedNumberRepDealRule }) => {
154
+ if (windowMinutes === undefined && sharedNumberRepDealRule === undefined) {
155
+ return { content: [{ type: "text", text: "Nothing to change: pass windowMinutes or sharedNumberRepDealRule." }], isError: true };
156
+ }
157
+ return patchGeneralSettings(client, { callLateLink: { ...(windowMinutes !== undefined ? { windowMinutes } : {}), ...(sharedNumberRepDealRule !== undefined ? { sharedNumberRepDealRule } : {}) } });
158
+ }));
159
+ }
160
+ /** (callcontact66, app lib/call-late-link.ts) the window's default and ceiling */
161
+ export const CALL_LATE_LINK_DEFAULT_WINDOW_MINUTES = 30;
162
+ export const CALL_LATE_LINK_MAX_WINDOW_MINUTES = 240;
163
+ /** settings.callLateLink as the server reads it (readCallLateLinkSettings): a non-integer window = the default, out of range = clamped */
164
+ export function callLateLinkOf(settings) {
165
+ const root = settings && typeof settings === "object" && !Array.isArray(settings) ? settings : {};
166
+ const b = root.callLateLink && typeof root.callLateLink === "object" && !Array.isArray(root.callLateLink) ? root.callLateLink : {};
167
+ const raw = b.windowMinutes;
168
+ const windowMinutes = typeof raw === "number" && Number.isInteger(raw) ? Math.min(CALL_LATE_LINK_MAX_WINDOW_MINUTES, Math.max(0, raw)) : CALL_LATE_LINK_DEFAULT_WINDOW_MINUTES;
169
+ return { windowMinutes, sharedNumberRepDealRule: b.sharedNumberRepDealRule === true };
145
170
  }
@@ -0,0 +1,63 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { ConduytClient } from "../client.js";
3
+ /**
4
+ * (ocr65-parity) The document reader (OCR) on a contact's files: list what was read, start or restart a read, review one read, fill a
5
+ * deal from it (the only write to CRM records, and only when that tool is called), the workspace's document types, and the workspace
6
+ * switch settings.documentReader.enabled. Every reader route answers 404 code document_reader_off while the switch is off.
7
+ * (parity66a, app batch65 5de16149a9: ocr66 / ocr66-autoqueue / ocr66-fillconfirm / ocr65-fillmap) the workspace's reader settings
8
+ * (autoRead, dailyLimit, the cloud-model consent cloudModel; autoReadSince, decidedBy and decidedAt are stamped by the server and
9
+ * never sent), the confirm step of a flagged value (POST /document-reads/{id}/confirm), and a fill-map target's `normalize`.
10
+ *
11
+ * Refusals come back as error results carrying the API's status and code (readerRefusal).
12
+ *
13
+ * Masked values stay masked (defence in depth): the app answers a sensitive value as the Secure mask with sensitive: true and nothing
14
+ * else. These tools do not rely on that alone: any object a response marks sensitive: true leaves the tool as { key, field, label, kind,
15
+ * value: the mask (null when the API gave null), sensitive: true }, never with a quote, page, box, basis, title, confidence or any other
16
+ * key, and a summary tile whose label is a sensitive field's label answers the mask (tiles carry no sensitive flag; the app masks them). The document-type tools carry no read
17
+ * values: they answer only the API's configuration fields (unknown keys are dropped).
18
+ */
19
+ /** the Secure mask the app answers for a sensitive value (lib/custom-field-secure-shared.ts SECURE_MASK) */
20
+ export declare const SECURE_MASK = "\u2022\u2022\u2022\u2022";
21
+ /** every object marked sensitive: true, at any depth, is reduced to maskedEntry */
22
+ export declare function scrubSensitive(v: unknown): unknown;
23
+ export declare function readerRefusal(err: unknown): {
24
+ content: {
25
+ type: "text";
26
+ text: string;
27
+ }[];
28
+ isError: true;
29
+ } | null;
30
+ /** (parity66a, app lib/document-reader/flag.ts) the reader settings' limits and the cloud model providers a workspace can consent to */
31
+ export declare const AUTO_READ_DAILY_LIMIT_DEFAULT = 200;
32
+ export declare const AUTO_READ_DAILY_LIMIT_MAX = 5000;
33
+ export declare const CLOUD_MODEL_PROVIDERS: readonly ["google_gemini"];
34
+ /** the API's own refusal sentences (app/api/v1/settings/route.ts settingsPatchSchema; a 422 with the first one when the body breaks it) */
35
+ export declare const READER_SETTINGS_NEEDS_ONE = "documentReader needs enabled, cloudModel, autoRead or dailyLimit";
36
+ export declare const CLOUD_PROVIDER_REQUIRED = "cloudModel.provider is required when allowed is true";
37
+ /** (app/api/v1/document-reads/[id]/confirm/route.ts, 400 invalid_body) */
38
+ export declare const CONFIRM_FIELD_OR_FIELDS = "body: send either field or fields";
39
+ /**
40
+ * (parity66a) the reader's settings as the server reads them (lib/document-reader/flag.ts): enabled (absent = off), autoRead (absent =
41
+ * on), dailyLimit (absent or out of range = 200), autoReadSince (server-stamped when automatic reading turned on; null = nothing is read
42
+ * automatically yet), cloudModel { allowed (only with a known provider), provider, decidedBy, decidedAt } (who decided and when: set
43
+ * by the server). Only these keys and the settings revision leave the tool.
44
+ */
45
+ export declare function readerSettingsOut(settings: unknown): {
46
+ documentReader: {
47
+ enabled: boolean;
48
+ autoRead: boolean;
49
+ dailyLimit: number;
50
+ autoReadSince: string | null;
51
+ cloudModel: {
52
+ allowed: boolean;
53
+ provider: string | null;
54
+ decidedBy: string | null;
55
+ decidedAt: string | null;
56
+ };
57
+ };
58
+ settingsRevision: string | null;
59
+ };
60
+ /** (Codex parity66a-r1 P2) a stored instant as the server reads it (lib/document-reader/flag.ts autoReadSettings: Date.parse, finite or null);
61
+ * the stored string is answered when it parses, null otherwise */
62
+ export declare function readableInstant(v: unknown): string | null;
63
+ export declare function registerDocumentReaderTools(server: McpServer, client: ConduytClient): void;