conduyt-mcp 4.105.41 → 4.105.42

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.
@@ -11,7 +11,7 @@ export declare const BATON_HANDOFF_ACTIONS_NOTE = " Baton hand-off (app handoffk
11
11
  /** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
12
12
  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
13
  /** (idleoff57) the conditional switch-off, documented for an agent; (idleroute58) sent to POST /automations/:id/deactivate-if-idle */
14
- export declare const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation that has no outcome yet (a draft, queued, scheduled or sending message)), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class, earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
14
+ export declare const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation still queued, being sent or with an unknown outcome in the outbox (an outbox e-mail row not provably finished, or its message still a draft, queued, scheduled or sending)), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class (executions, parkedSteps, chases, queuedEvents, dripBatches, scheduledSlots, wakeJobs, webhookDeliveries, queuedEmails, and a total), earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
15
15
  /** (parity60, twinmerge59; app lib/drip-campaign-lock.ts DripEnrollmentTwinError, route.ts and publish/route.ts) the drip-twin 409: its code, the app's wording and the recovery */
16
16
  export declare const ENROLLMENT_TWIN_409_DOC = "409 code automation_would_duplicate_enrollment: the write would make this automation enroll the same contacts as another ACTIVE automation on a drip campaign they did not share before (the same drip campaign, on the same tag or a merged alias of it, or with a trigger that fires for every tag); the app says: This would enroll the same contacts as \"<name>\", which is already active. Switch one of them off first. The error names it and `automation` is { id, name }. A retry cannot fix this. Recovery: switch that other automation off (conduyt_update_automation isActive false), OR change either workflow so the two no longer enroll the same contacts on that campaign AND PUBLISH that change (conduyt_publish_automation): a v2 workflow's edit stays a draft until it is published, and switching on resumes the PUBLISHED graph, never a draft, so an unpublished edit leaves the ownership unchanged and the same 409 comes back. Workflows that already overlapped before the write are never refused for it, but switching one of them off and on again is a new switch-on and is refused";
17
17
  /** (parity60, twinmerge59; app lib/automation-inflight.ts AUTOMATION_BUSY_MESSAGE) the retryable lock timeout of any save, publish or switch-on */
@@ -12,7 +12,7 @@ export const BATON_HANDOFF_ACTIONS_NOTE = " Baton hand-off (app handoffkeep55):
12
12
  /** (#124, automation unknown keys / types) the refusal codes the write paths answer; surfaced verbatim by the client (details JSON object last), never retried */
13
13
  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
14
  /** (idleoff57) the conditional switch-off, documented for an agent; (idleroute58) sent to POST /automations/:id/deactivate-if-idle */
15
- export const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation that has no outcome yet (a draft, queued, scheduled or sending message)), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class, earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
15
+ export const IF_IDLE_DOC = "Conditional switch-off: send ONLY isActive false with ifIdle true (it is sent to POST /api/v1/automations/:id/deactivate-if-idle, never as a PATCH: an app build without the feature answers 404 there and changes nothing, so an older server can never turn it into an unconditional switch-off; the result's data.isActive is false either way, and an automation that was already off answers the same success). The automation is switched off only if none of its work is in flight (a run that has not finished, a parked step such as a delay / wait / retry, a queued chase, a queued tag or consent hand-off, a contact held at a drip step, a due schedule slot, an event wake, an n8n delivery being retried, an e-mail of the automation still queued, being sent or with an unknown outcome in the outbox (an outbox e-mail row not provably finished, or its message still a draft, queued, scheduled or sending)), decided in one transaction that also keeps any new run from starting until the switch-off commits. Nothing in flight: the same result as isActive false alone. 409: in-flight work, or a concurrent change; retry. Either way the API changes NOTHING. With code automation_has_inflight_work it is in-flight work: its inFlight object counts each class (executions, parkedSteps, chases, queuedEvents, dripBatches, scheduledSlots, wakeJobs, webhookDeliveries, queuedEmails, and a total), earliestResumeAt is the earliest due time; wait and call again. A 409 without that code is a concurrent change (another change to the automation committed at the same moment): read it again and call again. 503 code automation_lock_timeout (Retry-After seconds): the automation was busy, nothing changed, call again. Without ifIdle, isActive false switches off unconditionally (a parked run is then dropped at its next step).";
16
16
  /** (parity60, twinmerge59; app lib/drip-campaign-lock.ts DripEnrollmentTwinError, route.ts and publish/route.ts) the drip-twin 409: its code, the app's wording and the recovery */
17
17
  export const ENROLLMENT_TWIN_409_DOC = "409 code automation_would_duplicate_enrollment: the write would make this automation enroll the same contacts as another ACTIVE automation on a drip campaign they did not share before (the same drip campaign, on the same tag or a merged alias of it, or with a trigger that fires for every tag); the app says: This would enroll the same contacts as \"<name>\", which is already active. Switch one of them off first. The error names it and `automation` is { id, name }. A retry cannot fix this. Recovery: switch that other automation off (conduyt_update_automation isActive false), OR change either workflow so the two no longer enroll the same contacts on that campaign AND PUBLISH that change (conduyt_publish_automation): a v2 workflow's edit stays a draft until it is published, and switching on resumes the PUBLISHED graph, never a draft, so an unpublished edit leaves the ownership unchanged and the same 409 comes back. Workflows that already overlapped before the write are never refused for it, but switching one of them off and on again is a new switch-on and is refused";
18
18
  /** (parity60, twinmerge59; app lib/automation-inflight.ts AUTOMATION_BUSY_MESSAGE) the retryable lock timeout of any save, publish or switch-on */
@@ -313,29 +313,36 @@ export function registerDealTools(server, client) {
313
313
  const result = await client.del(`/api/v1/deals/${encodeURIComponent(id)}`);
314
314
  return formatResult(result);
315
315
  });
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. 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.", {
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.", {
317
317
  deals: z
318
318
  .array(z.object({
319
319
  title: z.string().describe("Deal title (required)"),
320
- pipelineName: z.string().describe("Pipeline name (resolved by name; required)"),
321
- stageName: z.string().optional().describe("Stage name within the pipeline; defaults to the first stage if omitted or unmatched"),
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
+ 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
322
  contactEmail: z.string().optional().describe("Email of an existing contact to link (resolved by email)"),
323
323
  companyId: z.string().optional().describe("Company UUID to link (must belong to your account; invalid/deleted/cross-account IDs are reported as row errors)"),
324
324
  value: z.number().optional().describe("Deal value (numeric, in the deal's currency)"),
325
325
  currency: z.string().optional().describe("ISO 4217 currency code, e.g. 'GBP'. Defaults to USD."),
326
326
  status: z.string().optional().describe("Deal status (default 'open')"),
327
327
  priority: z.string().optional().describe("Deal priority, e.g. 'low', 'medium', 'high'"),
328
- probability: z.number().min(0).max(1).optional().describe("Win probability as a 0–1 fraction (e.g. 0.75 = 75%); clamped to 0–1"),
328
+ probability: z.union([z.number(), z.string()]).optional().describe("Win probability: a 0–1 fraction (0.75) or a percent (75, 12.5, or text such as \"75%\"); a number above 1 up to 100 is read as a percent. A value that cannot be read (N/A, above 100, negative, 1,000) leaves the probability empty and the row is still imported with a probability_unreadable note naming the cell; it is never clamped"),
329
329
  expectedCloseDate: z.string().optional().describe("Expected close date (ISO 8601, e.g. '2026-09-30')"),
330
330
  customFields: z.record(z.any()).optional().describe("Structured custom-field values keyed by field key, e.g. { limit_of_indemnity: 5000000 }"),
331
331
  }))
332
332
  .describe("Deals to import (1 or more rows; max matches the account import cap)"),
333
- }, async ({ deals }) => {
333
+ 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
+ }
334
340
  const created = (await client.post("/api/v1/imports", {
335
341
  objectType: "opportunities",
336
342
  format: "json",
337
343
  fileName: "deal-import.csv",
338
344
  rows: deals,
345
+ ...(defaultPipelineId !== undefined ? { defaultPipelineId } : {}),
339
346
  }));
340
347
  const jobId = created.data?.id;
341
348
  if (!jobId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt-mcp",
3
- "version": "4.105.41",
3
+ "version": "4.105.42",
4
4
  "mcpName": "com.conduyt/mcp",
5
5
  "description": "MCP server for Conduyt CRM — expose CRM operations as AI-accessible tools",
6
6
  "type": "module",