conduyt-mcp 4.105.42 → 4.108.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,7 @@ 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";
68
69
  /** Registers every Conduyt tool on the server; each tool gets its title + MCP annotations from src/tool-annotations.ts. */
69
70
  export function registerAllTools(server, client) {
70
71
  annotateRegistrations(server);
@@ -135,4 +136,5 @@ export function registerAllTools(server, client) {
135
136
  registerBookingPageTools(server, client);
136
137
  registerReportTools(server, client);
137
138
  registerReportDashboardTools(server, client);
139
+ registerDocumentReaderTools(server, client);
138
140
  }
@@ -83,6 +83,7 @@ export const TOOL_ANNOTATIONS = {
83
83
  conduyt_create_automation: create("Create Automation"),
84
84
  conduyt_update_automation: row("Update Automation", false, true, false), // webhook secret rotate/clear revokes the old credential; every config write bumps configRevision (automations/[id]/route.ts:248-275,726-739,1576-1579)
85
85
  conduyt_publish_automation: row("Publish Automation", false, false, false), // each repeat can publish another numbered version (automations/[id]/publish/route.ts:218,291)
86
+ conduyt_cancel_automation_run: destroy("Cancel Automation Run"), // tears down ONE run's waiting steps for good (a cancelled run never resumes); a repeat answers 200 changed false (POST /automation-executions/{id}/cancel)
86
87
  conduyt_resolve_names: ro("Resolve Names to IDs"),
87
88
  conduyt_list_sequences: ro("List Sequences"),
88
89
  conduyt_get_sequence: ro("Get Sequence"),
@@ -469,6 +470,17 @@ export const TOOL_ANNOTATIONS = {
469
470
  conduyt_update_dashboard_tile: update("Update Dashboard Tile"),
470
471
  conduyt_remove_dashboard_tile: destroy("Remove Dashboard Tile"),
471
472
  conduyt_run_dashboard: ro("Run Dashboard"),
473
+ // (ocr65-parity) the document reader (OCR)
474
+ conduyt_list_contact_document_reads: ro("List Contact Document Reads"),
475
+ conduyt_get_document_read: ro("Get Document Read"),
476
+ 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
477
+ 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
478
+ conduyt_get_document_reader_types: ro("Get Document Reader Types"),
479
+ 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
480
+ 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
481
+ conduyt_get_document_reader_settings: ro("Get Document Reader Settings"), // (parity66a) GET /settings, the documentReader block only
482
+ 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)
483
+ 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
472
484
  };
473
485
  /**
474
486
  * Wraps server.tool so each tool registered afterwards gets its title and annotations from TOOL_ANNOTATIONS. The registered
@@ -6,8 +6,10 @@ export declare const CARD_OWNERSHIP_ACTIONS_NOTE = " Card ownership per lane: as
6
6
  export declare const DEAL_NODES_ACTIONS_NOTE = " Deal nodes: find_opportunity config {version: 2, pipelineIds (ordered; the first pipeline holding a match wins; empty = every pipeline), status (open default | won | lost | abandoned | any), excludeSources (lead sources never matched, case-insensitive), excludeCreatedByAutomationIds (automations whose create_deal cards are skipped; cards created from 2026-10-13 on), matchField {fieldKey, value} (searches the WHOLE WORKSPACE, any contact, for the card whose deal custom field equals the value, merge fields allowed e.g. {{trigger.oes}}; a card is found when its field holds the searched value (trimmed) as the same text exactly (no case folding); a value written with separators such as dashes or spaces also matches its digits as text; it matches a stored number only when the value (or those digits) is a plain number with no leading zero and at most 15 significant digits that a number holds exactly (007 is text and does not match the number 7; a 16-digit value, 1e-400 or 3e-324 is text only); booleans and differently formatted stored values never match; status, pipelines and exclusions still apply; exactly one match is found, several are ambiguous and take not found; a found card becomes the run's contact when the run has none; the field must exist; an empty rendered value finds nothing), resolution}: searches the run's contact's cards; FOUND makes the card the run's deal and follows nextIfTrue (else next), NOT FOUND is a normal outcome that follows nextIfFalse (else next) and leaves the run's existing deal unchanged (a later deal step on the false branch still acts on the deal the run already had); without version 2 the step keeps the original single-pipeline lookup (a miss fails the step). Prerequisite: a version 2 find needs step cursors on this workspace, and publishing refuses (find_needs_step_cursors) with \"Find opportunity needs step cursors on this workspace; ask support\"; every version 2 find must hold its own live step cursor or it hard-stops the run without selecting or routing. A version 2 find cannot be retried on its own: retrying a failed one alone answers 409, so re-trigger the automation for the contact. An automation definition that touches deals needs the `deals` scope on an API key: without it the write answers 403. link_appointment_to_deal config {stageId, pipelineId (needs stageId), lostReason}: in an appointment-triggered run, links the trigger's appointment to the run's deal (its appointment fields follow it; a newer booking is never displaced; the appointment must be the deal's contact's), then optionally moves the card; it needs an appointment trigger and the run's deal (find_opportunity first, or a booking made with a deal id). update_deal_field config {systemField: \"source\", value, overwriteExisting}: sets the deal's own lead source instead of a custom field (a value only, trimmed, at most 500 characters; overwriteExisting false writes only while the source is the Unknown label).";
7
7
  /** (sendonce54, app) send_email's "at most once per contact" option; the catalog does not carry action config */
8
8
  export declare const SEND_ONCE_EMAIL_NOTE = " Send once per contact: send_email config {sendKey, sendKeyDays}: sendKey (1 to 64 lowercase letters, digits or dashes, e.g. \"welcome-first-email\") makes the step send at most once per contact per sendKeyDays days (a whole number 1 to 365, default 30) ACROSS automations: a contact already e-mailed under the same key by any workflow inside the window is skipped cleanly (no e-mail, the run continues; the step output carries reasonCode send_key_already_sent, earlierMessageId and earlierSentAt; the dry run and the node test say \"would be skipped\"). A send that definitely failed before reaching the provider does not count; an unknown outcome does. Not combinable with an explicit To list, nor with CC or BCC (a keyed e-mail is sent through the outbox, which carries no CC / BCC); a malformed key or window is refused by validate / import / publish (field action.config.sendKey or sendKeyDays). Omit sendKey for no limit.";
9
+ /** (parity64, app batonaudit64, live OpenAPI POST /automations/{id}/publish) publish judges a baton step's configured stages by the rule the run applies */
10
+ export declare const BATON_STAGE_REFUSED_NOTE = " Publish checks a baton step's configured stages by the rule the run applies (app batonaudit64): a handoff_and_keep stageId that is a Won, Lost, holding or finished-work stage, or a handoff_and_keep or credit_baton_source parkedStageId that is a Won, Lost or holding stage or one without Finished work, is a publish ERROR with code baton_stage_refused (422; the key in `field`, naming the stage and the reason, in data.errors), unless that same setting (the same step, the same action, the same stage) was already live in the published graph: then it is a WARNING with the same code (in data.warnings), so the automation stays editable.";
9
11
  /** (handoffkeep55, app) the baton hand-off actions; the catalog does not carry action config */
10
- export declare const BATON_HANDOFF_ACTIONS_NOTE = " Baton hand-off (app handoffkeep55): handoff_and_keep config {pipelineId (required, the receiver's pipeline), stageId, assignedTo (required, the receiver: a user id or one merge field naming a user on the trigger, such as {{trigger.userId}} or {{trigger.assignedTo}}; it must render to an active member who can see the receiver's pipeline, never the card's own owner, else the step is refused with a review task), parkedStageId (required, a finished-work stage (isParked) of the run's card's OWN pipeline), destinationEntryAutomations (fire default | suppress), copyNotes, listDocuments, source}: opens a NEW card for the receiver and, in the same transaction, credits the run's card: it moves to parkedStageId with status still OPEN (never Won: no deal.won, no Hyros sale, no #wins post, no master status change, no Post-Close card) and gets a write-once receipt (deal fields handedOffAt = the credit date, handedOffToDealId, handedOffByExecutionId); a card already handed off answers skipped already_handed_off; a Won, Lost or holding stage anywhere, a finished-work stage as the receiver's stage or as the card's current stage, the receiver being the owner (same_person) or a Post-Close target or source is refused; a later webhook step reads the receiver's card as {{deal.handed_off_to_deal_id}}. credit_baton_source config {sourcePipelineId (required), parkedStageId (required), matchField and/or leadIdField (existing deal custom fields both cards carry), ownerField (an existing user or text deal field; a missing or wrong-type field blocks publish and fails the run visibly with field_missing / field_wrong_type and a review task), lookbackDays (1-90, default 30), windowMinutes (5-1440, default 120), reviewerIds}: on a receiver's card a form created, credits the ONE earlier open card of the same contact in sourcePipelineId (same receipt, same stage rule); none = nothing, two or more = no credit and a review task (default reviewers: owners and admins); decided once per card (deal fields batonResolution bound | none | ambiguous, batonBoundDealId); it refuses (too_early) until windowMinutes after the card was created, so put a delay before it.";
12
+ export declare const BATON_HANDOFF_ACTIONS_NOTE: string;
11
13
  /** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
12
14
  export declare const AUTOMATION_KEY_REFUSALS_NOTE = " Unknown action keys are refused, never ignored: an action config key the action does not read (a typo such as `laneSoruce`) answers code `unknown_action_config_key` with the node, the key and, when one is close, a suggestion (\"Did you mean `laneSource`?\"); an action `type` no registry entry defines answers `unknown_action_type` (with 'Did you mean' when a registered type is close). Create and update answer 400 (an update that does not write `actions` is never refused for a key stored earlier), conduyt_workflow_validate answers 200 with valid false and the `errors` list (nodeId, field, code, message), and publish / a version restore answer 422 (the preflight refusal wraps `data.message`, `data.errors`, `data.warnings`). Read the suggestion, fix the key and send again; a stored workflow is never refused on read. A trigger condition or trigger node naming a deal MIRROR key (deal.customFields.<key>) answers 422 mirror_not_triggerable (#1292): trigger on the source field's own change (Contact Updated / Company Updated).";
13
15
  /** (idleoff57) the conditional switch-off, documented for an agent; (idleroute58) sent to POST /automations/:id/deactivate-if-idle */
@@ -1,14 +1,17 @@
1
1
  import { WEBHOOK_NAME_TAG_DOC } from "./user-fields-doc.js";
2
2
  import { z } from "zod";
3
3
  import { formatResult, formatToolError } from "../client.js";
4
+ import { strictInput } from "./strict.js";
4
5
  /** (card ownership per lane, app 10-08/09) the action options an agent can set; the catalog does not carry action config, so this is the one place they are documented */
5
6
  export const CARD_OWNERSHIP_ACTIONS_NOTE = " Card ownership per lane: assign_to_user config {userId | userIds (round robin) | groupId, mode (single | round_robin | trigger_host), target|applyTo: contact|deal|both, overwriteExisting, previousOwner, laneSource, lanePipelineId, laneStageId}: laneSource names a card lane (the Deal.source its Auto-Create step wrote, e.g. 'GSM', max 500 chars) and makes the deal leg assign the contact's newest OPEN card from that lane (inside lanePipelineId when set) instead of the run's deal; when the contact has none and lanePipelineId is set, the card is created there (laneStageId, else the pipeline's first stage) already owned by the user; lanePipelineId or laneStageId without laneSource, or laneStageId without lanePipelineId, is refused; a lane never applies to an 'Assign to: contact' step. assign_to_user mode 'trigger_host' assigns to the appointment's booked host (appointment.booked runs only; fails closed when the run has no host). previousOwner (release | keep_as_collaborator; default release) says what happens to the previous owner when the step changes an owner: release means they lose the lead unless something else explains their access (e.g. another open card of theirs), keep_as_collaborator keeps them as a collaborator of the contact (they still see the lead and its cards, read-only); any other value is refused, and keep_as_collaborator is refused on a step with a card lane (laneSource) unless it assigns the contact only (validate and publish answer a field error on action.config.previousOwner). create_deal config {pipelineId (required), stageId, dealName, dealValue, allowDuplicates, status, source, assignedTo, assigneeMode, leaveUnassigned}: leaveUnassigned true leaves the card unassigned when no assignee is set (default false: the card goes to the lead's owner). assigneeMode 'trigger_host' assigns the card to the appointment's booked host (appointment.booked runs only; wins over assignedTo; fails closed when the run has no host, creating nothing). The condition field 'Booked host' (trigger.hostUserId) exists on appointment.booked, whose payload now carries hostUserId. close_other_open_deals config {lostReason (required)}: closes the contact's OTHER open cards as lost with that reason, keeping the run's own card (each moves to its pipeline's lost stage with the usual stage-change effects; cards already won/lost, in the DPP Post-Close pipeline or in a pipeline with no lost stage are skipped; a re-run closes nothing twice); it needs the run's own deal, so use a deal trigger or a find_opportunity step first.";
6
7
  /** (deal nodes, app 10-13) find_opportunity v2, link_appointment_to_deal, update_deal_field systemField source; the catalog does not carry action config */
7
8
  export const DEAL_NODES_ACTIONS_NOTE = " Deal nodes: find_opportunity config {version: 2, pipelineIds (ordered; the first pipeline holding a match wins; empty = every pipeline), status (open default | won | lost | abandoned | any), excludeSources (lead sources never matched, case-insensitive), excludeCreatedByAutomationIds (automations whose create_deal cards are skipped; cards created from 2026-10-13 on), matchField {fieldKey, value} (searches the WHOLE WORKSPACE, any contact, for the card whose deal custom field equals the value, merge fields allowed e.g. {{trigger.oes}}; a card is found when its field holds the searched value (trimmed) as the same text exactly (no case folding); a value written with separators such as dashes or spaces also matches its digits as text; it matches a stored number only when the value (or those digits) is a plain number with no leading zero and at most 15 significant digits that a number holds exactly (007 is text and does not match the number 7; a 16-digit value, 1e-400 or 3e-324 is text only); booleans and differently formatted stored values never match; status, pipelines and exclusions still apply; exactly one match is found, several are ambiguous and take not found; a found card becomes the run's contact when the run has none; the field must exist; an empty rendered value finds nothing), resolution}: searches the run's contact's cards; FOUND makes the card the run's deal and follows nextIfTrue (else next), NOT FOUND is a normal outcome that follows nextIfFalse (else next) and leaves the run's existing deal unchanged (a later deal step on the false branch still acts on the deal the run already had); without version 2 the step keeps the original single-pipeline lookup (a miss fails the step). Prerequisite: a version 2 find needs step cursors on this workspace, and publishing refuses (find_needs_step_cursors) with \"Find opportunity needs step cursors on this workspace; ask support\"; every version 2 find must hold its own live step cursor or it hard-stops the run without selecting or routing. A version 2 find cannot be retried on its own: retrying a failed one alone answers 409, so re-trigger the automation for the contact. An automation definition that touches deals needs the `deals` scope on an API key: without it the write answers 403. link_appointment_to_deal config {stageId, pipelineId (needs stageId), lostReason}: in an appointment-triggered run, links the trigger's appointment to the run's deal (its appointment fields follow it; a newer booking is never displaced; the appointment must be the deal's contact's), then optionally moves the card; it needs an appointment trigger and the run's deal (find_opportunity first, or a booking made with a deal id). update_deal_field config {systemField: \"source\", value, overwriteExisting}: sets the deal's own lead source instead of a custom field (a value only, trimmed, at most 500 characters; overwriteExisting false writes only while the source is the Unknown label).";
8
9
  /** (sendonce54, app) send_email's "at most once per contact" option; the catalog does not carry action config */
9
10
  export const SEND_ONCE_EMAIL_NOTE = " Send once per contact: send_email config {sendKey, sendKeyDays}: sendKey (1 to 64 lowercase letters, digits or dashes, e.g. \"welcome-first-email\") makes the step send at most once per contact per sendKeyDays days (a whole number 1 to 365, default 30) ACROSS automations: a contact already e-mailed under the same key by any workflow inside the window is skipped cleanly (no e-mail, the run continues; the step output carries reasonCode send_key_already_sent, earlierMessageId and earlierSentAt; the dry run and the node test say \"would be skipped\"). A send that definitely failed before reaching the provider does not count; an unknown outcome does. Not combinable with an explicit To list, nor with CC or BCC (a keyed e-mail is sent through the outbox, which carries no CC / BCC); a malformed key or window is refused by validate / import / publish (field action.config.sendKey or sendKeyDays). Omit sendKey for no limit.";
11
+ /** (parity64, app batonaudit64, live OpenAPI POST /automations/{id}/publish) publish judges a baton step's configured stages by the rule the run applies */
12
+ export const BATON_STAGE_REFUSED_NOTE = " Publish checks a baton step's configured stages by the rule the run applies (app batonaudit64): a handoff_and_keep stageId that is a Won, Lost, holding or finished-work stage, or a handoff_and_keep or credit_baton_source parkedStageId that is a Won, Lost or holding stage or one without Finished work, is a publish ERROR with code baton_stage_refused (422; the key in `field`, naming the stage and the reason, in data.errors), unless that same setting (the same step, the same action, the same stage) was already live in the published graph: then it is a WARNING with the same code (in data.warnings), so the automation stays editable.";
10
13
  /** (handoffkeep55, app) the baton hand-off actions; the catalog does not carry action config */
11
- export const BATON_HANDOFF_ACTIONS_NOTE = " Baton hand-off (app handoffkeep55): handoff_and_keep config {pipelineId (required, the receiver's pipeline), stageId, assignedTo (required, the receiver: a user id or one merge field naming a user on the trigger, such as {{trigger.userId}} or {{trigger.assignedTo}}; it must render to an active member who can see the receiver's pipeline, never the card's own owner, else the step is refused with a review task), parkedStageId (required, a finished-work stage (isParked) of the run's card's OWN pipeline), destinationEntryAutomations (fire default | suppress), copyNotes, listDocuments, source}: opens a NEW card for the receiver and, in the same transaction, credits the run's card: it moves to parkedStageId with status still OPEN (never Won: no deal.won, no Hyros sale, no #wins post, no master status change, no Post-Close card) and gets a write-once receipt (deal fields handedOffAt = the credit date, handedOffToDealId, handedOffByExecutionId); a card already handed off answers skipped already_handed_off; a Won, Lost or holding stage anywhere, a finished-work stage as the receiver's stage or as the card's current stage, the receiver being the owner (same_person) or a Post-Close target or source is refused; a later webhook step reads the receiver's card as {{deal.handed_off_to_deal_id}}. credit_baton_source config {sourcePipelineId (required), parkedStageId (required), matchField and/or leadIdField (existing deal custom fields both cards carry), ownerField (an existing user or text deal field; a missing or wrong-type field blocks publish and fails the run visibly with field_missing / field_wrong_type and a review task), lookbackDays (1-90, default 30), windowMinutes (5-1440, default 120), reviewerIds}: on a receiver's card a form created, credits the ONE earlier open card of the same contact in sourcePipelineId (same receipt, same stage rule); none = nothing, two or more = no credit and a review task (default reviewers: owners and admins); decided once per card (deal fields batonResolution bound | none | ambiguous, batonBoundDealId); it refuses (too_early) until windowMinutes after the card was created, so put a delay before it.";
14
+ export const BATON_HANDOFF_ACTIONS_NOTE = " Baton hand-off (app handoffkeep55): handoff_and_keep config {pipelineId (required, the receiver's pipeline), stageId, assignedTo (required, the receiver: a user id or one merge field naming a user on the trigger, such as {{trigger.userId}} or {{trigger.assignedTo}}; it must render to an active member who can see the receiver's pipeline, never the card's own owner, else the step is refused with a review task), parkedStageId (required, a finished-work stage (isParked) of the run's card's OWN pipeline), destinationEntryAutomations (fire default | suppress), copyNotes, listDocuments, source}: opens a NEW card for the receiver and, in the same transaction, credits the run's card: it moves to parkedStageId with status still OPEN (never Won: no deal.won, no Hyros sale, no #wins post, no master status change, no Post-Close card) and gets a write-once receipt (deal fields handedOffAt = the credit date, handedOffToDealId, handedOffByExecutionId); a card already handed off answers skipped already_handed_off; a Won, Lost or holding stage anywhere, a finished-work stage as the receiver's stage or as the card's current stage, the receiver being the owner (same_person) or a Post-Close target or source is refused; a later webhook step reads the receiver's card as {{deal.handed_off_to_deal_id}}. credit_baton_source config {sourcePipelineId (required), parkedStageId (required), matchField and/or leadIdField (existing deal custom fields both cards carry), ownerField (an existing user or text deal field; a missing or wrong-type field blocks publish and fails the run visibly with field_missing / field_wrong_type and a review task), lookbackDays (1-90, default 30), windowMinutes (5-1440, default 120), reviewerIds}: on a receiver's card a form created, credits the ONE earlier open card of the same contact in sourcePipelineId (same receipt, same stage rule); none = nothing, two or more = no credit and a review task (default reviewers: owners and admins); decided once per card (deal fields batonResolution bound | none | ambiguous, batonBoundDealId); it refuses (too_early) until windowMinutes after the card was created, so put a delay before it." + BATON_STAGE_REFUSED_NOTE;
12
15
  /** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
13
16
  export const AUTOMATION_KEY_REFUSALS_NOTE = " Unknown action keys are refused, never ignored: an action config key the action does not read (a typo such as `laneSoruce`) answers code `unknown_action_config_key` with the node, the key and, when one is close, a suggestion (\"Did you mean `laneSource`?\"); an action `type` no registry entry defines answers `unknown_action_type` (with 'Did you mean' when a registered type is close). Create and update answer 400 (an update that does not write `actions` is never refused for a key stored earlier), conduyt_workflow_validate answers 200 with valid false and the `errors` list (nodeId, field, code, message), and publish / a version restore answer 422 (the preflight refusal wraps `data.message`, `data.errors`, `data.warnings`). Read the suggestion, fix the key and send again; a stored workflow is never refused on read. A trigger condition or trigger node naming a deal MIRROR key (deal.customFields.<key>) answers 422 mirror_not_triggerable (#1292): trigger on the source field's own change (Contact Updated / Company Updated).";
14
17
  /** (idleoff57) the conditional switch-off, documented for an agent; (idleroute58) sent to POST /automations/:id/deactivate-if-idle */
@@ -112,7 +115,7 @@ export function registerAutomationTools(server, client) {
112
115
  const result = await client.patch(`/api/v1/automations/${id}`, updates);
113
116
  return formatResult(result);
114
117
  });
115
- server.tool("conduyt_publish_automation", "Publish an automation — copies the draft actions to the live published version. The automation must have actions defined. The publish is bound to the draft revision you reviewed (fetched automatically unless you pass expectedConfigRevision)." + AUTOMATION_KEY_REFUSALS_NOTE + AUTOMATION_ENROLLMENT_REFUSALS_NOTE, {
118
+ server.tool("conduyt_publish_automation", "Publish an automation — copies the draft actions to the live published version. The automation must have actions defined. The publish is bound to the draft revision you reviewed (fetched automatically unless you pass expectedConfigRevision)." + AUTOMATION_KEY_REFUSALS_NOTE + BATON_STAGE_REFUSED_NOTE + AUTOMATION_ENROLLMENT_REFUSALS_NOTE, {
116
119
  id: z.string().describe("Automation UUID"),
117
120
  expectedConfigRevision: z.number().int().nonnegative().optional().describe("The configRevision of the draft you reviewed (from conduyt_get_automation); fetched automatically when omitted"),
118
121
  }, async ({ id, expectedConfigRevision }) => {
@@ -125,6 +128,14 @@ export function registerAutomationTools(server, client) {
125
128
  const result = await client.post(`/api/v1/automations/${id}/publish`, { expectedConfigRevision: revision });
126
129
  return formatResult(result);
127
130
  });
131
+ // (parity64, app cancelrun64, live OpenAPI POST /automation-executions/{id}/cancel) stop ONE run of an automation
132
+ strictInput(server.tool("conduyt_cancel_automation_run", "Stop ONE run of an automation (POST /api/v1/automation-executions/{id}/cancel; the id is the run's execution id). The run is marked cancelled and its waiting steps (delays, waits, queued retries, drip batches not yet released) are cancelled, so no worker ever resumes them. A step a worker is executing at this moment is not interrupted: it is counted in inProgressSteps / inProgressBatches and the run stays open (leftOpenReason says why); call again once it settles. Idempotent: a run that already finished or was cancelled answers 200 with its status and changed false. Answers { executionId, status (cancelled when the run was closed, otherwise its current status: completed, failed, waiting, running, ...), changed, cancelledSteps, cancelledBatches, inProgressSteps, inProgressBatches, leftOpenReason (a string or null) }. reason (a string of at most 300 characters) is written on the run, its cancelled steps and the audit line; a longer one answers 400. Requires the automations edit permission (the same as switching the automation off): 403 without it. Another account's run and an unknown id are both 404. Consent rules are unaffected. One audit line (automation_execution.cancelled) per call that changed something. This stops one run only: to stop an automation from starting new runs use conduyt_update_automation with isActive false.", {
133
+ executionId: z.string().uuid().describe("The automation run (execution log) UUID to stop"),
134
+ reason: z.string().max(300).optional().describe("Why the run is stopped (at most 300 characters); written on the run, its cancelled steps and the audit line"),
135
+ }, async ({ executionId, reason }) => {
136
+ const result = await client.post(`/api/v1/automation-executions/${encodeURIComponent(executionId)}/cancel`, { ...(reason !== undefined ? { reason } : {}) });
137
+ return formatResult(result);
138
+ }));
128
139
  server.tool("conduyt_resolve_names", "Resolve human-readable names to UUIDs. Use this before creating automations — converts tag names, pipeline names, user names, and custom field labels to their UUIDs.", {
129
140
  tags: z.array(z.string()).optional().describe("Tag names to resolve (e.g. ['new-lead', 'hot'])"),
130
141
  pipelines: z.array(z.string()).optional().describe("Pipeline names to resolve (e.g. ['Sales Pipeline'])"),
@@ -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).", {
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"),
@@ -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.";
@@ -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"),
@@ -220,6 +223,8 @@ export function registerContactTools(server, client) {
220
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) 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."),
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);
@@ -3,7 +3,7 @@ import { ConduytApiError, formatResult } from "../client.js";
3
3
  import { 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
- import { CUSTOM_FIELD_TYPES, DELANCEY_ID_NOTE, fail, formulaCreateProblem, formulaUpdateProblem, FORMULA_DEFINITION_NOTE, SECURE_IDENTIFIER_NOTE } from "./formula-fields.js";
6
+ import { CUSTOM_FIELD_TYPES, DELANCEY_ID_NOTE, fail, formulaCreateProblem, formulaUpdateProblem, FORMULA_DEFINITION_NOTE, FORMULA_EXPRESSION_NOTE, SECURE_IDENTIFIER_NOTE } from "./formula-fields.js";
7
7
  // (parity1292, batch30 #1292 Ship 1) Secure custom fields: the flag, its reveal set, and the codes. There is NO reveal tool: the reveal
8
8
  // routes (POST /{contacts|deals|companies}/{id}/custom-fields/{key}/reveal) refuse an API key (403 reveal_requires_session), and this
9
9
  // server always signs in with one.
@@ -26,13 +26,13 @@ export function registerCustomFieldTools(server, client) {
26
26
  const result = await client.get(`/api/v1/custom-fields?${params}`);
27
27
  return formatResult(result);
28
28
  });
29
- server.tool("conduyt_create_custom_field", "Create a new custom field definition for contacts, deals, or companies. Field types: text, textarea, number, date, datetime, url, select, radio, multiselect, boolean, phone, email, formula, user. " + FORMULA_DEFINITION_NOTE + " " + SECURE_IDENTIFIER_NOTE + " " + SECURE_NOTE + " " + OPTIONS_CAP_NOTE + " " + DELANCEY_ID_NOTE + " " + USER_NOTE + " " + STORE_LIST_NOTE, {
29
+ server.tool("conduyt_create_custom_field", "Create a new custom field definition for contacts, deals, or companies. Field types: text, textarea, number, date, datetime, url, select, radio, multiselect, boolean, phone, email, formula, user. " + FORMULA_DEFINITION_NOTE + " " + FORMULA_EXPRESSION_NOTE + " " + SECURE_IDENTIFIER_NOTE + " " + SECURE_NOTE + " " + OPTIONS_CAP_NOTE + " " + DELANCEY_ID_NOTE + " " + USER_NOTE + " " + STORE_LIST_NOTE, {
30
30
  entityType: z.enum(["contact", "deal", "company"]).describe("Entity type this field applies to"),
31
31
  fieldKey: z.string().describe("Unique field key (alphanumeric + underscores, e.g. 'lead_score'). On deals, delancey_deal_id is RESERVED (the Delancey Street deal ID the push writes: 422 reserved_field_key, never Secure, never edited or deleted); oes_number and dpp_oes_raw are allowed only as plain optional text fields and are never Secure"),
32
32
  label: z.string().describe("Human-readable label (e.g. 'Lead Score')"),
33
- fieldType: z.enum(CUSTOM_FIELD_TYPES).describe("Field data type; formula is computed at read time from two number fields (options { op, left, right, format })"),
33
+ fieldType: z.enum(CUSTOM_FIELD_TYPES).describe("Field data type; formula is computed at read time: two number fields (options { op, left, right, format }) or an expression (options { expression, format })"),
34
34
  section: z.string().optional().describe("Section grouping for UI display"),
35
- options: z.any().optional().describe("Options for select/multiselect fields (array of strings, up to 1000, each 1 to 200 characters); for fieldType formula the object { op: add|sub|mul|div, left: <number field key>, right: <number field key or a number>, format: number|currency|percent }"),
35
+ options: z.any().optional().describe("Options for select/multiselect fields (array of strings, up to 1000, each 1 to 200 characters); for fieldType formula the object { op: add|sub|mul|div, left: <number field key>, right: <number field key or a number>, format: number|currency|percent } or { expression: <text, e.g. DAYS_BETWEEN({start_date}, TODAY())>, format: number|currency|percent }"),
36
36
  optionList: z.literal("store").optional().describe("\"store\" = a STORE-BACKED select (typeahead): the list lives in the option store, starts empty, filled with conduyt_set_custom_field_options; needs fieldType select and allowOther; options may carry only { visibility } (no inline choices)"),
37
37
  allowOther: z.boolean().optional().describe("Store-backed select, REQUIRED with optionList: true = a typed value that is not on the list is also accepted, false = strict (custom_field_value_not_on_list). Refused 422 custom_field_allow_other_refused on a partner creditor field (contact creditor_1..creditor_7 or a Creditors Relief list)"),
38
38
  isRequired: z.boolean().optional().describe("Whether this field is required"),
@@ -54,11 +54,11 @@ 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), Secure flag and required flag are re-judged with its inputs locked: 422 formula_invalid, 422 formula_secure_input; 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, {
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"),
61
- options: z.any().optional().describe("Updated options for select/multiselect; for a formula field the object { op, left, right, format } (re-judged with its inputs locked)"),
61
+ options: z.any().optional().describe("Updated options for select/multiselect; for a formula field the object { op, left, right, format } or { expression, format } (re-judged with its inputs locked; the expression grammar and functions are in conduyt_create_custom_field)"),
62
62
  optionList: z.literal("store").optional().describe("\"store\" = CONVERT a select with inline choices into a STORE-BACKED list (owner / admin signed in only; sent alone with allowOther)"),
63
63
  allowOther: z.boolean().optional().describe("Store-backed select: true = accept a typed value that is not on the list, false = strict. Never true on a partner creditor field (422 custom_field_allow_other_refused). Alone it switches allowOther in place"),
64
64
  isRequired: z.boolean().optional().describe("Updated required status"),
@@ -1,5 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { ConduytClient } from "../client.js";
3
+ /** (parity64, app dealupdate63, live OpenAPI POST /imports importMode and ImportJobRead.unchangedRows) updating existing deals from the deal import */
4
+ export declare 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.";
3
5
  /** The six Pipeline health checks (GET /deals health_check, GET /deals/inspection check). */
4
6
  export declare const PIPELINE_HEALTH_CHECKS: readonly ["high_value_idle", "stale", "unassigned", "needs_action", "missing_close_date", "missing_contact"];
5
7
  /** GET /deals board_snapshot=true limits (the app's lib/deal-board-snapshot-limits, contract at 5729bc7b4). */
@@ -9,6 +9,8 @@ import { KEEP_PREVIOUS_OWNER_NEEDS_ASSIGNEE } from "./contacts.js";
9
9
  import { CONTACT_TIMEZONE_NOTE, appendContactTimezone, contactTimezoneSchema } from "./contact-timezone.js";
10
10
  import { DEAL_VIEW_AUDIENCE_DOC, DEAL_VIEW_RULES_DOC, 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
+ /** (parity64, app dealupdate63, live OpenAPI POST /imports importMode and ImportJobRead.unchangedRows) updating existing deals from the deal import */
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.";
12
14
  const MIRROR_READ_DOC = " Mirror fields (#1292): a deal custom field created as a MIRROR of a contact / company field answers that record's value in customFields, with mirrorFields[key] = { mirrored: true, source: { entityType, fieldKey }, unresolved? } beside it (unresolved: no_linked_contact | no_linked_company | source_field_missing, value null); a mirror of a Secure source answers the mask \u2022\u2022\u2022\u2022 like the source (passed through untouched).";
13
15
  const MIRROR_WRITE_DOC = " A customFields key that is a deal MIRROR writes the linked contact / company through its own write path (nothing is stored on the deal): 409 mirror_unresolved (no linked record), 409 mirror_relink_conflict (the same request re-links it), 403 mirror_source_not_editable, 422 mirror_source_rejected, 409 mirror_source_changed, 409 mirror_source_conflict (the source's required state changed under the lock), 422 mirror_conflicting_values (two mirror keys of one source field with different values).";
14
16
  /** The six Pipeline health checks (GET /deals health_check, GET /deals/inspection check). */
@@ -61,7 +63,7 @@ function boardSnapshotColumns(a, f) {
61
63
  return a.board_columns.map((c) => (c.limit === undefined ? c.stageId : `${c.stageId}:${c.limit}`)).join(",");
62
64
  }
63
65
  export function registerDealTools(server, client) {
64
- 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), 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, {
65
67
  pipeline: z.string().optional().describe("Filter by pipeline UUID (canonical). Aliases: pipelineId, pipeline_id."),
66
68
  pipelineId: z.string().optional().describe("Filter by pipeline UUID (alias of pipeline)."),
67
69
  pipeline_id: z.string().optional().describe("snake_case alias of pipelineId."),
@@ -313,11 +315,12 @@ export function registerDealTools(server, client) {
313
315
  const result = await client.del(`/api/v1/deals/${encodeURIComponent(id)}`);
314
316
  return formatResult(result);
315
317
  });
316
- server.tool("conduyt_import_deals", "Bulk-import deals from a list of rows in one call. Runs on the canonical import engine — pipelines and stages are resolved by NAME (create them first with conduyt_create_pipeline), contacts by email. Deduplicates on title + pipeline + contact, and intentionally does NOT fire deal-created automations/webhooks/SMS/email (bulk imports are side-effect-free by design). Requires an owner/admin API key. Returns the created/skipped/duplicate counts and any per-row errors. Row notes come back in the answer's errorLog as entries with a code: stage_not_found (the row named a stage its pipeline does not have; the deal went to the first stage) and probability_unreadable (the Probability cell could not be read; the deal has no probability). They are notes, not failures: the deal is created, the note is recorded only for a deal that was created, and the log keeps only the most recent 100 informational notes of ALL kinds together (these two share that budget with the other info notices, and older ones are dropped first), so a large import can carry more notes than it lists; read the stage and probability fields of the created deals for the rest. A CONTACTS import job run (POST /imports/{id}/process or /resume, same refusal; the server documents this refusal for a contacts file only, and this tool imports opportunities, so it is not refused with it here) can be refused 422 import_nothing_ready { readyCount: 0, blockedCount, reasons: [{ code: required_field | missing_identifier | invalid_email, label, rowCount }] (most frequent first) } when the job has NO row that can import (every row misses a required field or fails an identifier rule: no name, email or phone, or an invalid email): refused before the first write, the job is left as it is; fix the rows and import again.", {
318
+ server.tool("conduyt_import_deals", "Bulk-import deals from a list of rows in one call. Runs on the canonical import engine — pipelines and stages are resolved by NAME (create them first with conduyt_create_pipeline), contacts by email. CREATE rows are deduplicated on title + pipeline + contact and intentionally do NOT fire deal-created automations/webhooks/SMS/email (the create path is side-effect-free by design); an UPDATE row (below) is different. Requires an owner/admin API key. Returns the created/skipped/duplicate counts and any per-row errors. Row notes come back in the answer's errorLog as entries with a code: stage_not_found (the row named a stage its pipeline does not have; the deal went to the first stage) and probability_unreadable (the Probability cell could not be read; the deal has no probability). They are notes, not failures: the deal is created, the note is recorded only for a deal that was created, and the log keeps only the most recent 100 informational notes of ALL kinds together (these two share that budget with the other info notices, and older ones are dropped first), so a large import can carry more notes than it lists; read the stage and probability fields of the created deals for the rest." + DEAL_IMPORT_UPDATE_DOC + " A CONTACTS import job run (POST /imports/{id}/process or /resume, same refusal; the server documents this refusal for a contacts file only, and this tool imports opportunities, so it is not refused with it here) can be refused 422 import_nothing_ready { readyCount: 0, blockedCount, reasons: [{ code: required_field | missing_identifier | invalid_email, label, rowCount }] (most frequent first) } when the job has NO row that can import (every row misses a required field or fails an identifier rule: no name, email or phone, or an invalid email): refused before the first write, the job is left as it is; fix the rows and import again.", {
317
319
  deals: z
318
320
  .array(z.object({
319
- title: z.string().describe("Deal title (required)"),
320
- pipelineName: z.string().optional().describe("Pipeline name (resolved by name). Required on every row unless defaultPipelineId is given; a pipelineName in the row always wins over the default (a name that matches nothing still fails the row)"),
321
+ title: z.string().optional().describe("Deal title. Required on a CREATE row; an UPDATE row (one with a dealId, in a mode that reads it) may omit it. A blank title on a create row fails that row"),
322
+ dealId: z.string().uuid().optional().describe("The deal's UUID (from conduyt_list_deals, or the Deal ID column of conduyt_export_deals): the row updates that deal instead of creating one (importMode create_and_update, the default, or update_only; create_only does not read it). Never matched by title or contact. A malformed, unknown, other-account, deleted or not-editable id makes the row not applied, with one note"),
323
+ pipelineName: z.string().optional().describe("Pipeline name (resolved by name). Required on every CREATE row unless defaultPipelineId is given; a pipelineName in the row always wins over the default (a name that matches nothing still fails the row)"),
321
324
  stageName: z.string().optional().describe("Stage name within the pipeline. Omitted or blank: the pipeline's first stage. A name the pipeline does not have also puts the deal in the first stage (the row is kept) and records a stage_not_found note in errorLog naming the text and the stage used. A name that is a system holding stage fails the row"),
322
325
  contactEmail: z.string().optional().describe("Email of an existing contact to link (resolved by email)"),
323
326
  companyId: z.string().optional().describe("Company UUID to link (must belong to your account; invalid/deleted/cross-account IDs are reported as row errors)"),
@@ -331,18 +334,26 @@ export function registerDealTools(server, client) {
331
334
  }))
332
335
  .describe("Deals to import (1 or more rows; max matches the account import cap)"),
333
336
  defaultPipelineId: z.string().uuid().optional().describe("Optional UUID of a live (not archived) pipeline of this account, used for every row that has no pipelineName (or an empty one); a pipelineName in a row always wins. The API answers 400 when it is not a UUID, not a pipeline of this account, or archived; a pipeline deleted or archived while the import runs fails the rows that needed it"),
334
- }, async ({ deals, defaultPipelineId }) => {
335
- if (defaultPipelineId === undefined) {
336
- const missing = deals.findIndex((d) => d.pipelineName === undefined || d.pipelineName.trim() === "");
337
- if (missing >= 0)
338
- throw new Error(`deals[${missing}].pipelineName is required unless defaultPipelineId is given.`);
339
- }
337
+ importMode: z.enum(["create_and_update", "create_only", "update_only"]).optional().describe("Duplicate handling for deals (omit for the API's default, create_and_update): create_and_update 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 Deal ID column is not read). Any mode but create_only needs the edit permission of deals"),
338
+ }, async ({ deals, defaultPipelineId, importMode }) => {
339
+ // (parity64, app dealupdate63) a row is an UPDATE row when it carries a dealId and the mode reads it (create_only never does);
340
+ // update_only never creates, so no row of it is a create row. Only a CREATE row needs a title and a pipeline.
341
+ deals.forEach((d, i) => {
342
+ const createRow = importMode === "create_only" || (importMode !== "update_only" && d.dealId === undefined);
343
+ if (!createRow)
344
+ return;
345
+ if (d.title === undefined)
346
+ throw new Error(`deals[${i}].title is required unless the row has a dealId (an update row).`);
347
+ if (defaultPipelineId === undefined && (d.pipelineName === undefined || d.pipelineName.trim() === ""))
348
+ throw new Error(`deals[${i}].pipelineName is required unless defaultPipelineId is given.`);
349
+ });
340
350
  const created = (await client.post("/api/v1/imports", {
341
351
  objectType: "opportunities",
342
352
  format: "json",
343
353
  fileName: "deal-import.csv",
344
354
  rows: deals,
345
355
  ...(defaultPipelineId !== undefined ? { defaultPipelineId } : {}),
356
+ ...(importMode !== undefined ? { importMode } : {}),
346
357
  }));
347
358
  const jobId = created.data?.id;
348
359
  if (!jobId) {
@@ -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;