conduyt-mcp 4.105.22 → 4.105.23
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/tool-annotations.js +1 -0
- package/dist/tools/advanced-filter-compilability.js +9 -0
- package/dist/tools/advanced-filter-rules.d.ts +1 -1
- package/dist/tools/advanced-filter-rules.js +4 -2
- package/dist/tools/bulk.js +2 -2
- package/dist/tools/companies.js +5 -4
- package/dist/tools/contacts.js +8 -5
- package/dist/tools/custom-fields.js +12 -6
- package/dist/tools/deal-profile.d.ts +1 -0
- package/dist/tools/deal-profile.js +13 -8
- package/dist/tools/deals.js +7 -5
- package/dist/tools/formula-fields.d.ts +8 -3
- package/dist/tools/formula-fields.js +44 -18
- package/dist/tools/lead-pool.js +3 -2
- package/dist/tools/lender-options.d.ts +11 -0
- package/dist/tools/lender-options.js +11 -0
- package/dist/tools/saved-filters.js +3 -2
- package/dist/tools/smart-lists.js +3 -2
- package/dist/tools/user-fields-doc.d.ts +5 -0
- package/dist/tools/user-fields-doc.js +6 -0
- package/package.json +1 -1
- package/scripts/coverage-matrix.json +10 -4
package/dist/tool-annotations.js
CHANGED
|
@@ -16,6 +16,7 @@ export const TOOL_ANNOTATIONS = {
|
|
|
16
16
|
conduyt_mcp_coverage: ro("Get MCP Coverage Matrix"),
|
|
17
17
|
conduyt_list_contacts: ro("List Contacts"),
|
|
18
18
|
conduyt_count_contacts: ro("Count Contacts"),
|
|
19
|
+
conduyt_list_contact_timezones: ro("List Contact Time Zones"),
|
|
19
20
|
conduyt_get_contact: ro("Get Contact"),
|
|
20
21
|
conduyt_create_contact: create("Create Contact"),
|
|
21
22
|
conduyt_update_contact: update("Update Contact"),
|
|
@@ -63,6 +63,15 @@ export function advancedRuleCompiles(rule) {
|
|
|
63
63
|
return true;
|
|
64
64
|
return operator === "equals" || operator === "not_equals";
|
|
65
65
|
}
|
|
66
|
+
// (#1312) timezoneRuleToWhere: the two absence operators need no value; every other operator needs at least one value
|
|
67
|
+
if (field === "timezone") {
|
|
68
|
+
if (operator === "is_empty" || operator === "is_not_empty")
|
|
69
|
+
return true;
|
|
70
|
+
const zones = (Array.isArray(value) ? value : String(value ?? "").split(",")).map((v) => String(v).trim()).filter(Boolean);
|
|
71
|
+
if (zones.length === 0)
|
|
72
|
+
return false;
|
|
73
|
+
return rawOp === "is_any_of" || rawOp === "is_none_of" || operator === "equals" || operator === "not_equals";
|
|
74
|
+
}
|
|
66
75
|
if (rawOp === "is_any_of") {
|
|
67
76
|
const values = Array.isArray(value) ? value : String(value ?? "").split(",").map((v) => v.trim()).filter(Boolean);
|
|
68
77
|
return values.length > 0 && LIST_FIELDS.has(field);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PORTED VERBATIM from conduyt-app lib/smart-view-filters.ts @ slice B r28 (bfba9b0ef + the non-string array element refusal; the app's validator additionally compiles every rule — see validateAdvancedFiltersEffective below) — validateAdvancedFilters, its tables and its
|
|
2
|
+
* PORTED VERBATIM from conduyt-app lib/smart-view-filters.ts @ slice B r28 (+ #1312 the timezone field, parity32) (bfba9b0ef + the non-string array element refusal; the app's validator additionally compiles every rule — see validateAdvancedFiltersEffective below) — validateAdvancedFilters, its tables and its
|
|
3
3
|
* value rules — so a call this surface accepts is never a predictable 400 from the API (Codex mcp r2 m1 / cli r2 m1).
|
|
4
4
|
* Keep in sync with the app: when validateAdvancedFilters, VALID_FIELDS, VALID_OPERATORS, ADVANCED_OPERATORS,
|
|
5
5
|
* CF_OPERATORS, VALUELESS_OPERATORS, DATE_FILTER_FIELDS or isSupportedCallAttemptsFilter change there, re-port here.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PORTED VERBATIM from conduyt-app lib/smart-view-filters.ts @ slice B r28 (bfba9b0ef + the non-string array element refusal; the app's validator additionally compiles every rule — see validateAdvancedFiltersEffective below) — validateAdvancedFilters, its tables and its
|
|
2
|
+
* PORTED VERBATIM from conduyt-app lib/smart-view-filters.ts @ slice B r28 (+ #1312 the timezone field, parity32) (bfba9b0ef + the non-string array element refusal; the app's validator additionally compiles every rule — see validateAdvancedFiltersEffective below) — validateAdvancedFilters, its tables and its
|
|
3
3
|
* value rules — so a call this surface accepts is never a predictable 400 from the API (Codex mcp r2 m1 / cli r2 m1).
|
|
4
4
|
* Keep in sync with the app: when validateAdvancedFilters, VALID_FIELDS, VALID_OPERATORS, ADVANCED_OPERATORS,
|
|
5
5
|
* CF_OPERATORS, VALUELESS_OPERATORS, DATE_FILTER_FIELDS or isSupportedCallAttemptsFilter change there, re-port here.
|
|
@@ -13,7 +13,7 @@ export const VALID_FIELDS = new Set([
|
|
|
13
13
|
"city", "state", "country", "jobTitle", "optedOutSms", "optedOutEmail",
|
|
14
14
|
"leadScore", "email", "phone", "source", "assignedTo", "tags",
|
|
15
15
|
"pipeline", "pipelineStage", "dealStatus", "company",
|
|
16
|
-
"masterStatus",
|
|
16
|
+
"masterStatus", "timezone",
|
|
17
17
|
]);
|
|
18
18
|
const VALID_OPERATORS = {
|
|
19
19
|
lastContactedAt: new Set(["within", "not_within", "is_empty", "is_not_empty"]),
|
|
@@ -37,6 +37,7 @@ const VALID_OPERATORS = {
|
|
|
37
37
|
pipelineStage: new Set(["equals", "not_equals", "is_empty", "is_not_empty"]),
|
|
38
38
|
dealStatus: new Set(["equals", "not_equals", "is_empty", "is_not_empty"]),
|
|
39
39
|
masterStatus: new Set(["equals", "not_equals", "is_any_of", "is_none_of"]),
|
|
40
|
+
timezone: new Set(["equals", "not_equals", "is_any_of", "is_none_of", "is_empty", "is_not_empty"]),
|
|
40
41
|
city: new Set(["equals", "not_equals", "contains", "is_empty", "is_not_empty"]),
|
|
41
42
|
state: new Set(["equals", "not_equals", "contains", "is_empty", "is_not_empty"]),
|
|
42
43
|
country: new Set(["equals", "not_equals"]),
|
|
@@ -67,6 +68,7 @@ export const ADVANCED_OPERATORS = {
|
|
|
67
68
|
pipelineStage: new Set([...VALID_OPERATORS.pipelineStage, "is", "is_not", "is_empty", "is_not_empty", "is_any_of"]),
|
|
68
69
|
dealStatus: new Set([...VALID_OPERATORS.dealStatus, "is", "is_not", "is_empty", "is_not_empty", "is_any_of"]),
|
|
69
70
|
masterStatus: new Set([...VALID_OPERATORS.masterStatus, "is", "is_not"]),
|
|
71
|
+
timezone: new Set([...VALID_OPERATORS.timezone, "is", "is_not"]),
|
|
70
72
|
city: new Set([...VALID_OPERATORS.city, "is", "is_not", "is_any_of"]),
|
|
71
73
|
state: new Set([...VALID_OPERATORS.state, "is", "is_not", "is_any_of"]),
|
|
72
74
|
country: new Set([...VALID_OPERATORS.country, "is", "is_not", "is_any_of"]),
|
package/dist/tools/bulk.js
CHANGED
|
@@ -25,7 +25,7 @@ export function registerBulkTools(server, client) {
|
|
|
25
25
|
const result = await client.post("/api/v1/contacts/ai-import", { contacts, options });
|
|
26
26
|
return formatResult(result);
|
|
27
27
|
});
|
|
28
|
-
server.tool("conduyt_export_contacts", "Export contacts as JSON with filtering. Returns all matching contacts with tags and custom fields.", {
|
|
28
|
+
server.tool("conduyt_export_contacts", "Export contacts as JSON with filtering. Returns all matching contacts with tags and custom fields. min_score that is not an integer 0..2147483647 is 400 invalid_min_score { message, param, accepted } (GET /contacts, /contacts/count and /contacts/export).", {
|
|
29
29
|
format: z.enum(["json"]).optional().describe("Export format (use 'json' for MCP)"),
|
|
30
30
|
search: z.string().optional().describe("Search filter"),
|
|
31
31
|
tag: z.string().optional().describe("Filter by tag name"),
|
|
@@ -64,7 +64,7 @@ export function registerBulkTools(server, client) {
|
|
|
64
64
|
});
|
|
65
65
|
return formatResult(result);
|
|
66
66
|
});
|
|
67
|
-
server.tool("conduyt_export_deals", "Export deals as JSON with filtering by status, pipeline, or search term.", {
|
|
67
|
+
server.tool("conduyt_export_deals", "Export deals as JSON with filtering by status, pipeline, or search term. 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).", {
|
|
68
68
|
search: z.string().optional().describe("Search deal titles"),
|
|
69
69
|
status: z.string().optional().describe("Filter by status (open, won, lost)"),
|
|
70
70
|
pipeline: z.string().optional().describe("Filter by pipeline UUID"),
|
package/dist/tools/companies.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { USER_FIELD_READ_DOC, USER_FIELD_RECORD_WRITE_DOC } from "./user-fields-doc.js";
|
|
2
3
|
import { formatResult } from "../client.js";
|
|
3
4
|
import { FORMULA_WRITE_NOTE } from "./formula-fields.js";
|
|
4
5
|
export function registerCompanyTools(server, client) {
|
|
5
|
-
server.tool("conduyt_list_companies", "List and search companies. Returns name, domain, industry, contact count, deal count, and total deal value. `count_mode: \"none\"` skips the total count (a picker that only lists names): meta.total is then null and meta.has_more says whether another page exists.", {
|
|
6
|
+
server.tool("conduyt_list_companies", "List and search companies. Returns name, domain, industry, contact count, deal count, and total deal value. `count_mode: \"none\"` skips the total count (a picker that only lists names): meta.total is then null and meta.has_more says whether another page exists. 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.", {
|
|
6
7
|
search: z.string().optional().describe("Search by company name, domain, or phone"),
|
|
7
8
|
industry: z.string().optional().describe("Filter by industry"),
|
|
8
9
|
size: z.enum(["1-10", "11-50", "51-200", "201-500", "501-1000", "1001+"]).optional().describe("Filter by company size"),
|
|
@@ -32,7 +33,7 @@ export function registerCompanyTools(server, client) {
|
|
|
32
33
|
const result = await client.get(`/api/v1/companies?${params}`);
|
|
33
34
|
return formatResult(result);
|
|
34
35
|
});
|
|
35
|
-
server.tool("conduyt_get_company", "Get a single company with full details and aggregated deal value. Carries the FIRST page of each related list: contacts (100, total contactCount, contactsNextCursor), deals (50, dealsNextCursor) and child accounts (childCompanies, 25, total childCount, childNextCursor). A non-null next cursor means more rows: read them with conduyt_list_company_related.", {
|
|
36
|
+
server.tool("conduyt_get_company", "Get a single company with full details and aggregated deal value. Carries the FIRST page of each related list: contacts (100, total contactCount, contactsNextCursor), deals (50, dealsNextCursor) and child accounts (childCompanies, 25, total childCount, childNextCursor). A non-null next cursor means more rows: read them with conduyt_list_company_related." + " " + USER_FIELD_READ_DOC, {
|
|
36
37
|
id: z.string().describe("Company UUID"),
|
|
37
38
|
}, async ({ id }) => {
|
|
38
39
|
const result = await client.get(`/api/v1/companies/${id}`);
|
|
@@ -50,7 +51,7 @@ export function registerCompanyTools(server, client) {
|
|
|
50
51
|
const result = await client.get(`/api/v1/companies/${encodeURIComponent(company_id)}/related?${params}`);
|
|
51
52
|
return formatResult(result);
|
|
52
53
|
});
|
|
53
|
-
server.tool("conduyt_create_company", "Create a new company record with business details." + " " + FORMULA_WRITE_NOTE, {
|
|
54
|
+
server.tool("conduyt_create_company", "Create a new company record with business details." + " " + FORMULA_WRITE_NOTE + " " + USER_FIELD_RECORD_WRITE_DOC, {
|
|
54
55
|
name: z.string().describe("Company name (required)"),
|
|
55
56
|
domain: z.string().optional().describe("Company domain (e.g. 'acme.com')"),
|
|
56
57
|
industry: z.string().optional().describe("Industry (e.g. 'Technology', 'Healthcare')"),
|
|
@@ -67,7 +68,7 @@ export function registerCompanyTools(server, client) {
|
|
|
67
68
|
const result = await client.post("/api/v1/companies", params);
|
|
68
69
|
return formatResult(result);
|
|
69
70
|
});
|
|
70
|
-
server.tool("conduyt_update_company", "Update a company's details — name, domain, industry, address, or any other field." + " " + FORMULA_WRITE_NOTE, {
|
|
71
|
+
server.tool("conduyt_update_company", "Update a company's details — name, domain, industry, address, or any other field." + " " + FORMULA_WRITE_NOTE + " " + USER_FIELD_RECORD_WRITE_DOC, {
|
|
71
72
|
id: z.string().describe("Company UUID"),
|
|
72
73
|
name: z.string().optional().describe("Updated company name"),
|
|
73
74
|
domain: z.string().optional().describe("Updated domain"),
|
package/dist/tools/contacts.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { USER_FIELD_READ_DOC, USER_FIELD_RECORD_WRITE_DOC } from "./user-fields-doc.js";
|
|
3
|
+
import { OFF_LIST_NOTE, TIMEZONE_FILTER_NOTE } from "./lender-options.js";
|
|
2
4
|
import { formatResult, formatToolError } from "../client.js";
|
|
3
5
|
import { FORMULA_FILTER_NOTE, FORMULA_WRITE_NOTE } from "./formula-fields.js";
|
|
4
6
|
import { strictInput } from "./strict.js";
|
|
@@ -139,7 +141,7 @@ export function registerContactTools(server, client) {
|
|
|
139
141
|
params.set(`cf[${key}]`, value);
|
|
140
142
|
return params;
|
|
141
143
|
};
|
|
142
|
-
server.tool("conduyt_list_contacts", "List and search contacts with filtering. To find the contact(s) holding a known email address, pass `email` (exact match on the primary or any secondary email); `search` is a substring search. To list the contacts carrying a tag (or any of several tags), pass `tagId` (uuid) or `tag` (name). Returns paginated results with name, email, phone, tags, source, and assignee. Each row carries `revision` (integer save revision; pass it back as expectedRevision on conduyt_update_contact or the collaborator tools). " + LIST_TOTAL_NOTE + " " + FORMULA_FILTER_NOTE, {
|
|
144
|
+
server.tool("conduyt_list_contacts", "List and search contacts with filtering. To find the contact(s) holding a known email address, pass `email` (exact match on the primary or any secondary email); `search` is a substring search. To list the contacts carrying a tag (or any of several tags), pass `tagId` (uuid) or `tag` (name). Returns paginated results with name, email, phone, tags, source, and assignee. Each row carries `revision` (integer save revision; pass it back as expectedRevision on conduyt_update_contact or the collaborator tools). " + LIST_TOTAL_NOTE + " " + FORMULA_FILTER_NOTE + " " + TIMEZONE_FILTER_NOTE + " 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. min_score that is not an integer 0..2147483647 is 400 invalid_min_score { message, param, accepted } (GET /contacts, /contacts/count and /contacts/export).", {
|
|
143
145
|
...contactFilterShape,
|
|
144
146
|
// list-only filters (GET /contacts reads them; GET /contacts/count does not)
|
|
145
147
|
dealContextOwners: z.string().optional().describe("Deal-context filter: comma-separated owner ids (query param `deal_context_owners`; list only, the count route does not read it)"),
|
|
@@ -162,18 +164,19 @@ export function registerContactTools(server, client) {
|
|
|
162
164
|
const result = await client.get(`/api/v1/contacts?${params}`);
|
|
163
165
|
return formatResult(result);
|
|
164
166
|
});
|
|
165
|
-
server.tool("conduyt_count_contacts", "Count the contacts a list filter matches (GET /contacts/count): the exact total when conduyt_list_contacts answers `meta.total: null` with `meta.total_deferred: true`. Takes the SHARED subset of conduyt_list_contacts filters (no page, per_page or sort, and NOT dealContextOwners / dealContextStages / dealContextStatuses, which exist only on the list): with a deal-context filter the exact total is not available here (dropping it counts a broader set), so page the list with has_more instead. Answers `{ total, age_ms?, total_capped?, pending?, timed_out? }`: a cached list (the unfiltered list, or a Smart View alone) answers its cached exact count while under a minute old (`age_ms`), else recounts; `total: null` with `pending: true` = another request is recounting and nothing is cached yet, ask again in a few seconds; `total: null` with `timed_out: true` = the count could not finish within 30 s (narrow the filter); a `search` counts up to 10,000 (`total_capped: true` = more match). Use the total as `expectedTotal` for conduyt_bulk_delete_contacts_matching or conduyt_create_batch_operation." + " " + FORMULA_FILTER_NOTE, contactFilterShape, async (filter) => {
|
|
167
|
+
server.tool("conduyt_count_contacts", "Count the contacts a list filter matches (GET /contacts/count): the exact total when conduyt_list_contacts answers `meta.total: null` with `meta.total_deferred: true`. Takes the SHARED subset of conduyt_list_contacts filters (no page, per_page or sort, and NOT dealContextOwners / dealContextStages / dealContextStatuses, which exist only on the list): with a deal-context filter the exact total is not available here (dropping it counts a broader set), so page the list with has_more instead. Answers `{ total, age_ms?, total_capped?, pending?, timed_out? }`: a cached list (the unfiltered list, or a Smart View alone) answers its cached exact count while under a minute old (`age_ms`), else recounts; `total: null` with `pending: true` = another request is recounting and nothing is cached yet, ask again in a few seconds; `total: null` with `timed_out: true` = the count could not finish within 30 s (narrow the filter); a `search` counts up to 10,000 (`total_capped: true` = more match). Use the total as `expectedTotal` for conduyt_bulk_delete_contacts_matching or conduyt_create_batch_operation." + " " + FORMULA_FILTER_NOTE + " " + TIMEZONE_FILTER_NOTE + " min_score that is not an integer 0..2147483647 is 400 invalid_min_score { message, param, accepted } (GET /contacts, /contacts/count and /contacts/export).", contactFilterShape, async (filter) => {
|
|
166
168
|
const params = contactFilterParams(filter);
|
|
167
169
|
const result = await client.get(`/api/v1/contacts/count?${params}`);
|
|
168
170
|
return formatResult(result);
|
|
169
171
|
});
|
|
170
|
-
server.tool("
|
|
172
|
+
server.tool("conduyt_list_contact_timezones", "List the workspace's DISTINCT contact time zones with counts (GET /contacts/timezones, contacts:view): { data: { timezones: [{ timezone, count }], truncated } }. These are the options of the Time zone filter in Advanced Filters (field `timezone`, the contact's IANA string such as America/Chicago; a contact with no zone is never listed). Scoped to the contacts the caller can see (a member limited to their own leads sees only the zones on those), ordered by zone, at most 200 zones (truncated: true says a longer list was cut) and cached for a few minutes per workspace and visibility scope, so a new zone can take a moment to appear. The web builder labels the common US zones (Eastern, Central, Mountain, Pacific, Arizona, Alaska, Hawaii) and shows every other zone as its IANA string; the value to filter on is always the IANA string. " + TIMEZONE_FILTER_NOTE, {}, async () => formatResult(await client.get("/api/v1/contacts/timezones")));
|
|
173
|
+
server.tool("conduyt_get_contact", "Get a single contact with full details — profile, tags, custom fields, timeline, deals, and activity history. Includes `revision` (integer save revision): pass it as expectedRevision on conduyt_update_contact or the collaborator tools so a newer change is never overwritten. Includes `hasOutboundSms` (boolean): true when this workspace has ever PROVABLY texted the contact (a proven send only: not a draft, a queued row or a pre-send failure); use it to pick the `context` for conduyt_check_message (false = 'first', true = 'conversation'). Also includes `hasOutboundEmail` (boolean): the same for email (true when at least one outbound email to the contact was proven sent, so a genuine \"Re:\" reply is a conversation and not flagged); use it to pick the `context` for an email check. Also includes `duplicateProposals` (the open and not-sure possible-duplicate lines on this record, each naming the other record as far as your key may see it) and `heldIdentifiers` (emails or phones held from this record because another record owns them, value-free), each the FIRST page only, with duplicateProposalsTotal, duplicateProposalsNextCursor, duplicateProposalsMembershipRevision, heldIdentifiersTotal, heldIdentifiersNextCursor and heldIdentifiersMembershipRevision (page on with conduyt_list_duplicate_proposals, passing the next cursors as cursor / held_cursor); list or decide them with conduyt_list_duplicate_proposals / conduyt_decide_duplicate_proposal." + " " + USER_FIELD_READ_DOC, {
|
|
171
174
|
id: z.string().describe("Contact UUID"),
|
|
172
175
|
}, async ({ id }) => {
|
|
173
176
|
const result = await client.get(`/api/v1/contacts/${id}`);
|
|
174
177
|
return formatResult(result);
|
|
175
178
|
});
|
|
176
|
-
const createContactTool = server.tool("conduyt_create_contact", "Create a new contact in the CRM. Email or phone is recommended but not strictly required. With callId (a lead made from a contact-less inbound call) you must NOT send source or assignedTo: the server derives both from the call, and the request is refused if either is present." + INVALID_NUMBER_REFUSALS + " " + IDENTITY_CREATE_ANSWERS + " " + FORMULA_WRITE_NOTE, {
|
|
179
|
+
const createContactTool = server.tool("conduyt_create_contact", "Create a new contact in the CRM. Email or phone is recommended but not strictly required. With callId (a lead made from a contact-less inbound call) you must NOT send source or assignedTo: the server derives both from the call, and the request is refused if either is present." + INVALID_NUMBER_REFUSALS + " " + IDENTITY_CREATE_ANSWERS + " " + FORMULA_WRITE_NOTE + " " + OFF_LIST_NOTE + " " + USER_FIELD_RECORD_WRITE_DOC, {
|
|
177
180
|
email: z.string().optional().describe("Contact email address"),
|
|
178
181
|
firstName: z.string().optional().describe("First name"),
|
|
179
182
|
lastName: z.string().optional().describe("Last name"),
|
|
@@ -203,7 +206,7 @@ export function registerContactTools(server, client) {
|
|
|
203
206
|
created.inputSchema = Object.assign(base.superRefine((v, ctx) => { if (callDerivedFieldsConflict(v))
|
|
204
207
|
ctx.addIssue({ code: z.ZodIssueCode.custom, message: CALL_DERIVED_REFUSAL, path: ["callId"] }); }), { shape: base.shape });
|
|
205
208
|
}
|
|
206
|
-
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, {
|
|
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, {
|
|
207
210
|
id: z.string().describe("Contact UUID"),
|
|
208
211
|
email: z.string().optional().describe("Updated email"),
|
|
209
212
|
firstName: z.string().optional().describe("Updated first name"),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ConduytApiError, formatResult } from "../client.js";
|
|
3
|
-
import {
|
|
3
|
+
import { USER_NOTE } from "./user-fields-doc.js";
|
|
4
|
+
import { OPTIONS_CAP_NOTE, OPTIONS_MAX, TYPE_CHANGE_NOTE } from "./lender-options.js";
|
|
5
|
+
import { CUSTOM_FIELD_TYPES, DELANCEY_ID_NOTE, fail, formulaCreateProblem, formulaUpdateProblem, FORMULA_DEFINITION_NOTE, SECURE_IDENTIFIER_NOTE } from "./formula-fields.js";
|
|
4
6
|
// (parity1292, batch30 #1292 Ship 1) Secure custom fields: the flag, its reveal set, and the codes. There is NO reveal tool: the reveal
|
|
5
7
|
// routes (POST /{contacts|deals|companies}/{id}/custom-fields/{key}/reveal) refuse an API key (403 reveal_requires_session), and this
|
|
6
8
|
// server always signs in with one.
|
|
@@ -23,13 +25,13 @@ export function registerCustomFieldTools(server, client) {
|
|
|
23
25
|
const result = await client.get(`/api/v1/custom-fields?${params}`);
|
|
24
26
|
return formatResult(result);
|
|
25
27
|
});
|
|
26
|
-
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. " + FORMULA_DEFINITION_NOTE + " " + SECURE_IDENTIFIER_NOTE + " " + SECURE_NOTE, {
|
|
28
|
+
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, {
|
|
27
29
|
entityType: z.enum(["contact", "deal", "company"]).describe("Entity type this field applies to"),
|
|
28
|
-
fieldKey: z.string().describe("Unique field key (alphanumeric + underscores, e.g. 'lead_score')"),
|
|
30
|
+
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"),
|
|
29
31
|
label: z.string().describe("Human-readable label (e.g. 'Lead Score')"),
|
|
30
32
|
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 })"),
|
|
31
33
|
section: z.string().optional().describe("Section grouping for UI display"),
|
|
32
|
-
options: z.any().optional().describe("Options for select/multiselect fields (array of strings); 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 }"),
|
|
34
|
+
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 }"),
|
|
33
35
|
isRequired: z.boolean().optional().describe("Whether this field is required"),
|
|
34
36
|
sortOrder: z.number().optional().describe("Display order"),
|
|
35
37
|
isSecure: z.boolean().optional().describe("Make this a Secure field (values masked everywhere; 400 secure_fields_not_enabled until enabled)"),
|
|
@@ -39,10 +41,12 @@ export function registerCustomFieldTools(server, client) {
|
|
|
39
41
|
const problem = formulaCreateProblem(params);
|
|
40
42
|
if (problem)
|
|
41
43
|
return fail(problem);
|
|
44
|
+
if (Array.isArray(params.options) && params.options.length > OPTIONS_MAX)
|
|
45
|
+
return fail(`options holds at most ${OPTIONS_MAX} choices (got ${params.options.length}).`);
|
|
42
46
|
const result = await client.post("/api/v1/custom-fields", params);
|
|
43
47
|
return formatResult(result);
|
|
44
48
|
});
|
|
45
|
-
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, {
|
|
49
|
+
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, {
|
|
46
50
|
id: z.string().describe("Custom field UUID"),
|
|
47
51
|
label: z.string().optional().describe("Updated label"),
|
|
48
52
|
section: z.string().max(120).nullable().optional().describe("Updated section grouping (null clears); the one place besides sortOrder a deal MIRROR can be edited"),
|
|
@@ -57,10 +61,12 @@ export function registerCustomFieldTools(server, client) {
|
|
|
57
61
|
const problem = formulaUpdateProblem(updates);
|
|
58
62
|
if (problem)
|
|
59
63
|
return fail(problem);
|
|
64
|
+
if (Array.isArray(updates.options) && updates.options.length > OPTIONS_MAX)
|
|
65
|
+
return fail(`options holds at most ${OPTIONS_MAX} choices (got ${updates.options.length}).`);
|
|
60
66
|
const result = await client.patch(`/api/v1/custom-fields/${id}`, updates);
|
|
61
67
|
return formatResult(result);
|
|
62
68
|
});
|
|
63
|
-
server.tool("conduyt_delete_custom_field", "Delete a custom field definition. Removes the field from all entities. A field a formula computes from cannot be deleted: 409 deletion_blocked (the formula named in blockers). A contact / company field mirrored on deals cannot be deleted: 409 mirror_source_in_use { mirrors } (delete the deal mirrors first; deleting a mirror deletes only the placement, never the contact's value). A Secure field cannot be deleted: 409 secure_field_delete_refused (turn Secure off first with conduyt_update_custom_field isSecure false + confirmUnsecure true, then delete).", {
|
|
69
|
+
server.tool("conduyt_delete_custom_field", "Delete a custom field definition. Removes the field from all entities. A field a formula computes from cannot be deleted: 409 deletion_blocked (the formula named in blockers). A contact / company field mirrored on deals cannot be deleted: 409 mirror_source_in_use { mirrors } (delete the deal mirrors first; deleting a mirror deletes only the placement, never the contact's value). A Secure field cannot be deleted: 409 secure_field_delete_refused (turn Secure off first with conduyt_update_custom_field isSecure false + confirmUnsecure true, then delete)." + " " + DELANCEY_ID_NOTE, {
|
|
64
70
|
id: z.string().describe("Custom field UUID"),
|
|
65
71
|
}, async ({ id }) => {
|
|
66
72
|
const result = await client.del(`/api/v1/custom-fields/${id}`);
|
|
@@ -3,4 +3,5 @@ import { ConduytClient } from "../client.js";
|
|
|
3
3
|
/** (parity28, batch28) the Deal profile (the deal page's tabs of the primary contact's bound fields), the partner push and the workspace binding. */
|
|
4
4
|
export declare const PUSH_PARTNERS: readonly ["creditors_relief", "delancey_street"];
|
|
5
5
|
export declare const PUSH_ACTIONS: readonly ["create", "update"];
|
|
6
|
+
export declare const PUSH_EXPECT_MODES: readonly ["test", "live"];
|
|
6
7
|
export declare function registerDealProfileTools(server: McpServer, client: ConduytClient): void;
|
|
@@ -5,10 +5,14 @@ import { fail, secureEgressProblem } from "./formula-fields.js";
|
|
|
5
5
|
/** (parity28, batch28) the Deal profile (the deal page's tabs of the primary contact's bound fields), the partner push and the workspace binding. */
|
|
6
6
|
export const PUSH_PARTNERS = ["creditors_relief", "delancey_street"];
|
|
7
7
|
export const PUSH_ACTIONS = ["create", "update"];
|
|
8
|
+
export const PUSH_EXPECT_MODES = ["test", "live"];
|
|
8
9
|
const PROFILE_KEYS_MAX = 100;
|
|
9
10
|
const KEY_MAX = 100;
|
|
10
11
|
const PATCH_CODES = "400 profile_key_not_bound (keys lists them), profile_field_invalid (key), deal_profile_not_enabled, invalid_body; 403 deal_not_editable or contacts_permission_required; 404 deal not found; 409 profile_field_changed { key, current } (nothing written), profile_conflict or deal_has_no_contact; 422 stage_automation_only (the card sits in a stage only automation may change; nothing written); 503 profile_busy (the contact stayed locked; nothing written, retry after the Retry-After seconds).";
|
|
11
|
-
|
|
12
|
+
/** (parity32, batch32 delseam1286) a pending Delancey Street submission the CURRENT Secure policy refuses to resend: an ERROR, never a success state */
|
|
13
|
+
const HELD_RESEND_NOTE = "A pending delancey_street submission (status unknown after an ambiguous answer: the next push resends it with the same key) is RE-CHECKED against the CURRENT Secure policy: if its body carries a Secure key the binding's secureEgress no longer lists for delancey_street, nothing is sent and the press answers 422 profile_secure_field with blocked: true { secure[], pushId } (an error: pending.blocked on conduyt_get_deal_partner_pushes is NOT a success state). The push row stays unknown with code secure_blocked and the slot stays held, because the deal may already exist at Delancey Street: list the keys for delancey_street in the Deal profile secureEgress to resend it, or an admin checks Delancey Street by hand.";
|
|
14
|
+
const DELANCEY_PUSH_NOTE = "delancey_street (the ISO Partner API) is enabled per workspace (config.partners.delancey_street.enabled plus a key; else 409 partner_disabled / partner_not_configured) and takes NEW submissions only: action create, one deal record per card (a card that already has its delancey_deal_id or a succeeded submission answers 409 already_submitted). A TEST key runs every check and creates nothing (the answer carries test: true; the card is not stamped). expectMode is the key mode the card showed (test or live): a changed key answers 409 key_mode_changed with nothing sent.";
|
|
15
|
+
const PUSH_CODES = "403 deal_not_editable / push_not_permitted; 404; 409 partner_disabled, partner_not_configured (delancey_street: no API key in the workspace), partner_not_enabled, push_in_flight, needs_link, action_changed (the current state comes back), already_submitted (delancey_street takes a new submission only: the card already has its deal id), key_mode_changed { mode } (delancey_street: the workspace key is now a test or live key other than the expectMode you passed; nothing sent), deal_has_no_contact, contact_busy, reconcile_needs_admin, reconcile_ambiguous; 422 profile_incomplete (missing[] names each gap; nothing written, no partner call), profile_secure_field { secure[], missing[] } (a Secure value the push would send whose key the binding does not list in secureEgress FOR THAT PARTNER; nothing written, no partner call) or stage_automation_only (the card sits in a stage only automation may change); 503 deal_busy or partner_auth.";
|
|
12
16
|
/** fields: 1 to 100 keys; expected: any number of keys (the server caps only fields); both: key length 1 to 100 */
|
|
13
17
|
const keyed = (min, max) => z.record(z.string().min(1).max(KEY_MAX), z.unknown()).refine((o) => Object.keys(o).length >= min && Object.keys(o).length <= max, { message: `must hold ${min} to ${max} keys` });
|
|
14
18
|
export function registerDealProfileTools(server, client) {
|
|
@@ -21,23 +25,24 @@ export function registerDealProfileTools(server, client) {
|
|
|
21
25
|
}, async ({ id, fields, expected }) => formatResult(await client.patch(`/api/v1/deals/${encodeURIComponent(id)}/profile`, { fields, expected }))));
|
|
22
26
|
strictInput(server.tool("conduyt_reveal_deal_profile_field", "Reveal ONE sensitive Deal profile field in full (POST /api/v1/deals/{id}/profile/reveal with body { key }; the answer is never cached and carries the value's token; the old GET answers 405). A bound key whose contact field is Secure is revealed the same way but is refused for an API key (403 reveal_requires_session) and needs that field's own reveal set. Allowed only for a caller in the binding's reveal set (settings.dealProfile revealRoles / revealGroupIds; a super admin always) with contacts:view on a card they can see. Every reveal of a stored value is audited before the answer (deal_profile.reveal for a sensitive-only key; custom_field.revealed with via deal_profile for a Secure key), so each call is recorded; an empty field answers value null and is not audited. 400 invalid_body, invalid_json, profile_key_not_sensitive or deal_profile_not_enabled; 403 reveal_not_allowed or contacts_permission_required; 404.", { id: dealId, key: z.string().min(1).max(100).refine((v) => v.trim() !== "", { message: "key must not be blank" }).describe("The sensitive bound field key (exactly one)") }, async ({ id, key }) => formatResult(await client.post(`/api/v1/deals/${encodeURIComponent(id)}/profile/reveal`, { key }))));
|
|
23
27
|
server.tool("conduyt_get_deal_profile_settings", "Read the workspace's Deal profile binding (GET /api/v1/settings/deal-profile; settings:view): { dealProfile (as stored), valid, danglingKeys (bound keys that name no contact custom field definition) }.", {}, async () => formatResult(await client.get("/api/v1/settings/deal-profile")));
|
|
24
|
-
strictInput(server.tool("conduyt_set_deal_profile_settings", "REPLACE the workspace's Deal profile binding (PUT /api/v1/settings/deal-profile; settings:edit, and only an owner or admin: a delegated holder is refused 403 deal_profile_admin_only; audited as settings_deal_profile_updated): the whole object is replaced, nothing merges, so read the current one with conduyt_get_deal_profile_settings first. dealProfile holds enabled, pipelineIds (null or absent = every pipeline), generalTab { label }, tabs (up to 12: key, label, fields of { key (a CONTACT custom field key), label, control, options, span, sensitive, default, requiredFor, showWhen, note, validate }), repeating slot tables (each may set readinessPerSlot: true), footerNote, actions, secureEgress, revealRoles / revealGroupIds. secureEgress is [custom field key] (up to 100 keys, none twice; the Secure CONTACT or DEAL custom field keys the partner push MAY send: each must name an existing contact or deal custom field, else 422 invalid_deal_profile; a Secure value the push would send whose
|
|
28
|
+
strictInput(server.tool("conduyt_set_deal_profile_settings", "REPLACE the workspace's Deal profile binding (PUT /api/v1/settings/deal-profile; settings:edit, and only an owner or admin: a delegated holder is refused 403 deal_profile_admin_only; audited as settings_deal_profile_updated): the whole object is replaced, nothing merges, so read the current one with conduyt_get_deal_profile_settings first. dealProfile holds enabled, pipelineIds (null or absent = every pipeline), generalTab { label }, tabs (up to 12: key, label, fields of { key (a CONTACT custom field key), label, control, options, span, sensitive, default, requiredFor, showWhen, note, validate }), repeating slot tables (each may set readinessPerSlot: true), footerNote, actions, secureEgress, revealRoles / revealGroupIds. secureEgress is an OBJECT per partner { creditors_relief: [custom field key], delancey_street: [custom field key] } (each list optional, up to 100 keys, none twice within a list, no other key; the Secure CONTACT or DEAL custom field keys the partner push MAY send TO THAT PARTNER: a key listed for one partner never unblocks the other; each key must name an existing contact or deal custom field, else 422 invalid_deal_profile; a Secure value the push would send to a partner whose list does not name the key refuses the push with 422 profile_secure_field, a listed one is sent masked to the last 4 in the preview, the stored snapshot and the history, and every send is audited); the older FLAT array [custom field key] is still accepted and is read as the Creditors Relief list ONLY (it never unblocks Delancey Street; a stored flat list keeps working). roleStamping { enabled, rules: [{ role: appointment_setter|opener|transfer_rep|closer, groupId (a member group UUID), fieldKey (a DEAL custom field of type user; another type is skipped), mode: first|latest }] } (up to 20 rules; on an owner change the new owner's role field is stamped when their group maps: first = never replaced once set, latest = the newest owner of the group wins; #1303). actions is [{ key, name }] (up to 20, one entry per partner key; a key named twice is refused; name 1 to 60 characters of plain text): the readiness copy on the deal page reads \"Needed for <name>\", and an action without one shows its partner's default name, else its key. A field's note is a hint to the rep shown under the field (plain text, 1 to 240 characters). readinessPerSlot: true on a repeating table makes each readiness column count one item per filled slot (3 creditors listed = 3 items per column in the N of M); absent, the whole table is one item per column. Plain text starts with a visible character and holds no control, line-separator, invisible (zero-width, soft hyphen, BOM) or bidirectional characters. conduyt_get_deal_profile answers the result as partners[key].actionName (the binding's saved name, else \"Send to <name>\" for a known partner, else the key) and fields[].note (null = none, absent on a repeating cell). Every pipeline and member group named must be this workspace's. No custom field definition is created or altered. 422 invalid_deal_profile (shape, a foreign pipeline or member group).", { dealProfile: z.record(z.string(), z.unknown()).describe("The whole binding object (validated by the server: secureEgress { creditors_relief: [field key], delancey_street: [field key] } or the older flat array (= Creditors Relief), each list up to 100 none twice, actions [{ key, name }] up to 20, a field note up to 240 plain-text characters, readinessPerSlot true on a repeating table)") }, async ({ dealProfile }) => {
|
|
25
29
|
const problem = secureEgressProblem(dealProfile);
|
|
26
30
|
if (problem)
|
|
27
31
|
return fail(problem);
|
|
28
32
|
return formatResult(await client.put("/api/v1/settings/deal-profile", { dealProfile }));
|
|
29
33
|
}));
|
|
30
34
|
strictInput(server.tool("conduyt_remove_deal_profile_settings", "REMOVE the workspace's Deal profile binding (PUT /api/v1/settings/deal-profile with dealProfile null; settings:edit, and only an owner or admin: a delegated holder is refused 403 deal_profile_admin_only): the deal page's Details card returns to its plain view and the stored binding (tabs, rules, reveal set) is DISCARDED, so read and keep a copy with conduyt_get_deal_profile_settings first. No custom field definition is touched.", {}, async () => formatResult(await client.put("/api/v1/settings/deal-profile", { dealProfile: null }))));
|
|
31
|
-
server.tool("conduyt_get_deal_partner_pushes", "The deal page's Push to partner card (GET /api/v1/deals/{id}/partner-pushes): { enabled: false } when the workspace has no enabled partner, else the partners (Creditors Relief; Delancey Street
|
|
32
|
-
server.tool("conduyt_preview_deal_partner_push", "Preview what the next partner push would send (GET /api/v1/deals/{id}/partner-pushes/preview): the action (create when the card has no OES #, update when it has one), the partner endpoint, the payload rows (SSN and bank numbers masked to the last 4), the readiness gaps (missing[]; a push answers 422 profile_incomplete while any remain) and the policy warnings. Nothing is written and no partner is called. Same gates as the push: deals:edit, the card's edit scope, closer or above. 403 deal_not_editable / push_not_permitted; 404; 409 partner_disabled (delancey_street
|
|
35
|
+
server.tool("conduyt_get_deal_partner_pushes", "The deal page's Push to partner card (GET /api/v1/deals/{id}/partner-pushes): { enabled: false } when the workspace has no enabled partner, else the partners (Creditors Relief; Delancey Street when the workspace enables it with a key, with its key mode test / live), the card's partner id (the deal field oes_number) and its display (CRL-<id>; Delancey Street: the deal id), a pending create (sending, or unknown after an ambiguous answer: the next push checks the partner first; for delancey_street an unknown one the CURRENT Secure policy refuses to resend carries pending.blocked { reason: secure_policy, keys }, an ERROR state: the next press answers 422 profile_secure_field blocked: true, never a success), the newest four pushes, submitted (delancey_street: the succeeded submission) and canPush (the card's edit scope and closer or above). " + HELD_RESEND_NOTE + " Needs deals:view on the card; 404 when the deal does not exist or the caller cannot see it.", { id: dealId }, async ({ id }) => formatResult(await client.get(`/api/v1/deals/${encodeURIComponent(id)}/partner-pushes`)));
|
|
36
|
+
server.tool("conduyt_preview_deal_partner_push", "Preview what the next partner push would send (GET /api/v1/deals/{id}/partner-pushes/preview): the action (create when the card has no OES #, update when it has one), the partner endpoint, the payload rows (SSN and bank numbers masked to the last 4), the readiness gaps (missing[]; a push answers 422 profile_incomplete while any remain) and the policy warnings. Nothing is written and no partner is called. Same gates as the push: deals:edit, the card's edit scope, closer or above. 403 deal_not_editable / push_not_permitted; 404; 409 partner_disabled / partner_not_configured (delancey_street needs the workspace flag and a key), partner_not_enabled, deal_has_no_contact; 422 profile_secure_field { secure[], missing[] } (a Secure value the push would send whose key the binding does not list in secureEgress for that partner; the preview refuses it too, nothing is sent). " + DELANCEY_PUSH_NOTE, { id: dealId, partner: z.enum(PUSH_PARTNERS).optional().describe("creditors_relief (default) or delancey_street") }, async ({ id, partner }) => {
|
|
33
37
|
if (partner === undefined)
|
|
34
38
|
return formatResult(await client.get(`/api/v1/deals/${encodeURIComponent(id)}/partner-pushes/preview`));
|
|
35
39
|
return formatResult(await client.get(`/api/v1/deals/${encodeURIComponent(id)}/partner-pushes/preview?partner=${partner}`));
|
|
36
40
|
});
|
|
37
|
-
strictInput(server.tool("conduyt_push_deal_to_partner", `Push a deal to a partner (POST /api/v1/deals/{id}/partner-pushes): ONE press of the deal page's Push to partner, which SENDS the card's data to the partner and cannot be recalled. One partner record per card: a card without an OES # creates the record (the contact, one debt per creditor, then the bank account when its details are filled) and stamps the partner's id on the card; a card with an OES # can only update that record's contact. action is what you saw (create or update): the server decides from the locked card and answers 409 action_changed with the current state when they differ (call conduyt_preview_deal_partner_push first). An executed attempt answers 200 with result accepted, found, updated, refused (nothing saved on the deal), unknown (no definite answer: the next push checks the partner before creating), needs_link (the partner created the record but the card could not carry its id; an admin links it by hand) or erased. Needs deals:edit, the card's edit scope and closer or above. idempotencyKey (1-255 printable ASCII) is sent as the Idempotency-Key header: one key per push press, reused ONLY to retry the SAME request (same key + same body replays the first answer; a different body is 422 idempotency_request_conflict). A refusal decided before any partner call (the 403s, partner_disabled, partner_not_enabled, push_in_flight, needs_link, action_changed, deal_has_no_contact, contact_busy, profile_incomplete, profile_secure_field, deal_busy) releases the key, so the SAME key may be retried at once; an executed attempt (accepted, found, updated, refused, unknown) and reconcile_needs_admin, reconcile_ambiguous or partner_auth spend it: a retry with that key answers 409 idempotency_key_spent, so verify what happened before sending a NEW key. 409 idempotency_in_progress: wait Retry-After and retry with the SAME key. A key starting with forgotten: is reserved (400 idempotency_key_reserved). Rare wrapper outcomes: 409 idempotency_conflict_retry (a concurrent claim could not be resolved, nothing ran: retry with the SAME key); 503 idempotency_claim_held (the release of a failed attempt's claim could not be confirmed: retry with a NEW key); 503 idempotency_outcome_unknown (the success could not be confirmed and the push may have gone through: verify the outcome before any new key). ${PUSH_CODES}`, {
|
|
41
|
+
strictInput(server.tool("conduyt_push_deal_to_partner", `Push a deal to a partner (POST /api/v1/deals/{id}/partner-pushes): ONE press of the deal page's Push to partner, which SENDS the card's data to the partner and cannot be recalled. One partner record per card: a card without an OES # creates the record (the contact, one debt per creditor, then the bank account when its details are filled) and stamps the partner's id on the card; a card with an OES # can only update that record's contact. action is what you saw (create or update): the server decides from the locked card and answers 409 action_changed with the current state when they differ (call conduyt_preview_deal_partner_push first). An executed attempt answers 200 with result accepted, found, updated, refused (nothing saved on the deal), unknown (no definite answer: the next push checks the partner before creating), needs_link (the partner created the record but the card could not carry its id; an admin links it by hand) or erased. Needs deals:edit, the card's edit scope and closer or above. idempotencyKey (1-255 printable ASCII) is sent as the Idempotency-Key header: one key per push press, reused ONLY to retry the SAME request (same key + same body replays the first answer; a different body is 422 idempotency_request_conflict). A refusal decided before any partner call (the 403s, partner_disabled, partner_not_configured, partner_not_enabled, push_in_flight, needs_link, action_changed, already_submitted, key_mode_changed, deal_has_no_contact, contact_busy, profile_incomplete, profile_secure_field, deal_busy) releases the key (a held Delancey resend the current Secure policy refuses, 422 profile_secure_field blocked: true, is one of them), so the SAME key may be retried at once; an executed attempt (accepted, found, updated, refused, unknown) and reconcile_needs_admin, reconcile_ambiguous or partner_auth spend it: a retry with that key answers 409 idempotency_key_spent, so verify what happened before sending a NEW key. 409 idempotency_in_progress: wait Retry-After and retry with the SAME key. A key starting with forgotten: is reserved (400 idempotency_key_reserved). Rare wrapper outcomes: 409 idempotency_conflict_retry (a concurrent claim could not be resolved, nothing ran: retry with the SAME key); 503 idempotency_claim_held (the release of a failed attempt's claim could not be confirmed: retry with a NEW key); 503 idempotency_outcome_unknown (the success could not be confirmed and the push may have gone through: verify the outcome before any new key). ${DELANCEY_PUSH_NOTE} ${HELD_RESEND_NOTE} ${PUSH_CODES}`, {
|
|
38
42
|
id: dealId,
|
|
39
|
-
partner: z.enum(PUSH_PARTNERS).describe("creditors_relief (Forth) or delancey_street (
|
|
40
|
-
action: z.enum(PUSH_ACTIONS).describe("What the card showed: create (no
|
|
43
|
+
partner: z.enum(PUSH_PARTNERS).describe("creditors_relief (Forth) or delancey_street (the ISO Partner API; enabled per workspace)"),
|
|
44
|
+
action: z.enum(PUSH_ACTIONS).describe("What the card showed: create (no partner id yet) or update (a Creditors Relief card with an OES #); delancey_street takes create only"),
|
|
45
|
+
expectMode: z.enum(PUSH_EXPECT_MODES).optional().describe("delancey_street only: the key mode the card showed, test or live (a changed key answers 409 key_mode_changed with nothing sent)"),
|
|
41
46
|
idempotencyKey: z.string().regex(/^[!-~](?:[ -~]{0,253}[!-~])?$/, "idempotencyKey must be 1-255 printable ASCII characters, not blank").optional().describe("Sent as the Idempotency-Key header; reuse it ONLY to retry the SAME request"),
|
|
42
|
-
}, async ({ id, partner, action, idempotencyKey }) => formatResult(await client.post(`/api/v1/deals/${encodeURIComponent(id)}/partner-pushes`, { partner, action }, idempotencyKey !== undefined ? { headers: { "Idempotency-Key": idempotencyKey } } : undefined))));
|
|
47
|
+
}, async ({ id, partner, action, expectMode, idempotencyKey }) => formatResult(await client.post(`/api/v1/deals/${encodeURIComponent(id)}/partner-pushes`, { partner, action, ...(expectMode !== undefined ? { expectMode } : {}) }, idempotencyKey !== undefined ? { headers: { "Idempotency-Key": idempotencyKey } } : undefined))));
|
|
43
48
|
}
|
package/dist/tools/deals.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { USER_FIELD_READ_DOC, USER_FIELD_RECORD_WRITE_DOC, USER_FIELD_WRITE_DOC } from "./user-fields-doc.js";
|
|
3
|
+
import { OFF_LIST_NOTE } from "./lender-options.js";
|
|
2
4
|
import { formatResult } from "../client.js";
|
|
3
5
|
import { FORMULA_WRITE_NOTE } from "./formula-fields.js";
|
|
4
6
|
import { strictInput } from "./strict.js";
|
|
@@ -53,7 +55,7 @@ function boardSnapshotColumns(a, f) {
|
|
|
53
55
|
return a.board_columns.map((c) => (c.limit === undefined ? c.stageId : `${c.stageId}:${c.limit}`)).join(",");
|
|
54
56
|
}
|
|
55
57
|
export function registerDealTools(server, client) {
|
|
56
|
-
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).", {
|
|
58
|
+
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, search, page, per_page, 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).", {
|
|
57
59
|
pipeline: z.string().optional().describe("Filter by pipeline UUID (canonical). Aliases: pipelineId, pipeline_id."),
|
|
58
60
|
pipelineId: z.string().optional().describe("Filter by pipeline UUID (alias of pipeline)."),
|
|
59
61
|
pipeline_id: z.string().optional().describe("snake_case alias of pipelineId."),
|
|
@@ -198,13 +200,13 @@ export function registerDealTools(server, client) {
|
|
|
198
200
|
const result = await client.post("/api/v1/tasks", { checkOrigin, dealId, expectedDealUpdatedAt, title, description, dueDate, priority, status, assignedTo, contactId }, idempotencyKey !== undefined ? { headers: { "Idempotency-Key": idempotencyKey } } : undefined);
|
|
199
201
|
return formatResult(result);
|
|
200
202
|
}));
|
|
201
|
-
server.tool("conduyt_get_deal", "Get a single deal with full details — value, currency, probability, stage, contact, expected close date, custom-field values, activities, tasks, and history. Use this to read structured custom-field data back out of a deal (e.g. for a P&L or balance-sheet model). Deal rows also carry hasNextStep and nextAppointmentAt (null unless your key can view the calendar) when the API returns them." + MIRROR_READ_DOC, {
|
|
203
|
+
server.tool("conduyt_get_deal", "Get a single deal with full details — value, currency, probability, stage, contact, expected close date, custom-field values, activities, tasks, and history. Use this to read structured custom-field data back out of a deal (e.g. for a P&L or balance-sheet model). Deal rows also carry hasNextStep and nextAppointmentAt (null unless your key can view the calendar) when the API returns them." + MIRROR_READ_DOC + " " + USER_FIELD_READ_DOC, {
|
|
202
204
|
id: z.string().describe("Deal UUID"),
|
|
203
205
|
}, async ({ id }) => {
|
|
204
206
|
const result = await client.get(`/api/v1/deals/${id}`);
|
|
205
207
|
return formatResult(result);
|
|
206
208
|
});
|
|
207
|
-
server.tool("conduyt_create_deal", "Create a new deal in a pipeline with full attributes. Requires a pipeline and stage ID — use conduyt_list_pipelines to discover them. Supports currency (e.g. GBP), probability, priority, expected close date, and structured custom-field values. A stage set to \"Entry by automation only\" refuses every entry here: 422 code stage_automation_only, message \"Only an automation can move a deal into <stage>\" (admins and API keys included; moving out is free)." + " A mirror key cannot be set on a new deal: 422 mirror_not_writable." + " " + FORMULA_WRITE_NOTE, {
|
|
209
|
+
server.tool("conduyt_create_deal", "Create a new deal in a pipeline with full attributes. Requires a pipeline and stage ID — use conduyt_list_pipelines to discover them. Supports currency (e.g. GBP), probability, priority, expected close date, and structured custom-field values. A stage set to \"Entry by automation only\" refuses every entry here: 422 code stage_automation_only, message \"Only an automation can move a deal into <stage>\" (admins and API keys included; moving out is free)." + " A mirror key cannot be set on a new deal: 422 mirror_not_writable." + " " + FORMULA_WRITE_NOTE + " " + OFF_LIST_NOTE + USER_FIELD_RECORD_WRITE_DOC, {
|
|
208
210
|
title: z.string().describe("Deal title (e.g. 'Acme Corp — Enterprise Plan')"),
|
|
209
211
|
pipelineId: z.string().describe("Pipeline UUID"),
|
|
210
212
|
stageId: z.string().describe("Stage UUID within the pipeline"),
|
|
@@ -223,7 +225,7 @@ export function registerDealTools(server, client) {
|
|
|
223
225
|
const result = await client.post("/api/v1/deals", params);
|
|
224
226
|
return formatResult(result);
|
|
225
227
|
});
|
|
226
|
-
server.tool("conduyt_update_deal", "Update a deal — move stage, change value/currency, set probability or expected close date, reassign (assignedTo: the previous owner is released unless they own another open card of the lead, or keepPreviousOwnerAsCollaborator is true, which keeps them as a read-only collaborator of the contact; the flag is refused 400 without assignedTo and 400 together with a contact change), mark won/lost, or write structured custom-field values. customFields are merged into existing values (omit a key to leave it unchanged). A stage set to \"Entry by automation only\" refuses every entry here: 422 code stage_automation_only, message \"Only an automation can move a deal into <stage>\" (admins and API keys included; moving out is free)." + MIRROR_WRITE_DOC + " " + FORMULA_WRITE_NOTE, {
|
|
228
|
+
server.tool("conduyt_update_deal", "Update a deal — move stage, change value/currency, set probability or expected close date, reassign (assignedTo: the previous owner is released unless they own another open card of the lead, or keepPreviousOwnerAsCollaborator is true, which keeps them as a read-only collaborator of the contact; the flag is refused 400 without assignedTo and 400 together with a contact change), mark won/lost, or write structured custom-field values. customFields are merged into existing values (omit a key to leave it unchanged). A stage set to \"Entry by automation only\" refuses every entry here: 422 code stage_automation_only, message \"Only an automation can move a deal into <stage>\" (admins and API keys included; moving out is free)." + MIRROR_WRITE_DOC + " " + FORMULA_WRITE_NOTE + " " + OFF_LIST_NOTE + " " + USER_FIELD_WRITE_DOC, {
|
|
227
229
|
id: z.string().describe("Deal UUID"),
|
|
228
230
|
title: z.string().optional().describe("Updated title"),
|
|
229
231
|
stageId: z.string().optional().describe("Move to a new stage UUID"),
|
|
@@ -257,7 +259,7 @@ export function registerDealTools(server, client) {
|
|
|
257
259
|
const result = await client.del(`/api/v1/deals/${encodeURIComponent(id)}`);
|
|
258
260
|
return formatResult(result);
|
|
259
261
|
});
|
|
260
|
-
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.", {
|
|
262
|
+
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.", {
|
|
261
263
|
deals: z
|
|
262
264
|
.array(z.object({
|
|
263
265
|
title: z.string().describe("Deal title (required)"),
|
|
@@ -6,15 +6,18 @@ import { z } from "zod";
|
|
|
6
6
|
export declare const FORMULA_OPS: readonly ["add", "sub", "mul", "div"];
|
|
7
7
|
export declare const FORMULA_FORMATS: readonly ["number", "currency", "percent"];
|
|
8
8
|
/** every fieldType the custom-fields route accepts for a definition (the server's create enum, batch31) */
|
|
9
|
-
export declare const CUSTOM_FIELD_TYPES: readonly ["text", "textarea", "number", "date", "datetime", "url", "select", "radio", "multiselect", "boolean", "phone", "email", "formula"];
|
|
9
|
+
export declare const CUSTOM_FIELD_TYPES: readonly ["text", "textarea", "number", "date", "datetime", "url", "select", "radio", "multiselect", "boolean", "phone", "email", "formula", "user"];
|
|
10
10
|
export declare const DEAL_OES_KEYS: readonly ["oes_number", "dpp_oes_raw"];
|
|
11
|
+
/** (parity32, batch32 delseam1286) the Delancey Street deal ID the partner push writes on the card: a partner identifier too (never Secure), and a RESERVED deal key */
|
|
12
|
+
export declare const DELANCEY_ID_KEY = "delancey_deal_id";
|
|
13
|
+
export declare const DELANCEY_ID_NOTE = "delancey_deal_id (the deal field the Delancey Street push writes, the card's link to the partner) is RESERVED: it can never be created through custom-fields (422 reserved_field_key), never made Secure (422 secure_identifier_refused), and a definition that already exists is never renamed, retyped, made required or deleted (422 reserved_field_key; only its section and sortOrder change); while a legacy definition of it is Secure its value is masked to the last 4.";
|
|
11
14
|
/** one description sentence for every record write that could carry a formula key */
|
|
12
15
|
export declare const FORMULA_WRITE_NOTE = "A customFields key that is a FORMULA field (computed at read time, never stored) is refused: 422 formula_read_only.";
|
|
13
16
|
/** one description sentence for every filter that could name a formula key */
|
|
14
17
|
export declare const FORMULA_FILTER_NOTE = "A filter naming a FORMULA custom field is refused: 422 formula_not_filterable (formulas are not filterable in v1).";
|
|
15
18
|
/** the definition-side rules, shared by the create and update tool descriptions */
|
|
16
19
|
export declare const FORMULA_DEFINITION_NOTE = "fieldType formula (#1292) is a COMPUTED field: options { op: add|sub|mul|div, left: <number field key>, right: <number field key or a number>, format: number|currency|percent }; left and right are number fields of the SAME entity (never the formula itself or another formula); the value is computed at read time (never stored), blank when an input is blank and on a division by zero; every record answer carries it in customFields plus computedFields[key] = { computed: true, readOnly: true, format }. A formula is read-only on every write path (422 formula_read_only), not filterable (422 formula_not_filterable), never required, and an input that is Secure needs a Secure formula (422 formula_secure_input; turning Secure on for an input a non-Secure formula computes from is 409 formula_secure_input naming the formulas). A formula needs a FRESH key (409 formula_key_in_use); malformed options, a non-number / formula / self input or a system-owned key is 422 formula_invalid. Deleting a field a formula computes from is 409 deletion_blocked (the formula in blockers).";
|
|
17
|
-
export declare const SECURE_IDENTIFIER_NOTE = "A phone or email field, or a deal OES #
|
|
20
|
+
export declare const SECURE_IDENTIFIER_NOTE = "A phone or email field, or a deal partner identifier (the OES # keys oes_number, dpp_oes_raw; the Delancey Street deal ID delancey_deal_id), identifies the record and can never be Secure: isSecure true on one is 422 secure_identifier_refused.";
|
|
18
21
|
/** the server's formula options object, strict */
|
|
19
22
|
export declare const formulaOptionsSchema: z.ZodObject<{
|
|
20
23
|
op: z.ZodEnum<["add", "sub", "mul", "div"]>;
|
|
@@ -45,8 +48,10 @@ export declare function formulaCreateProblem(p: {
|
|
|
45
48
|
export declare function formulaUpdateProblem(p: {
|
|
46
49
|
options?: unknown;
|
|
47
50
|
}): string | null;
|
|
48
|
-
/** the binding's secureEgress
|
|
51
|
+
/** the binding's secureEgress, in the two shapes the server accepts (batch32, per partner): an OBJECT { creditors_relief: string[], delancey_street: string[] } (each list optional,
|
|
52
|
+
* no other key) or the older flat ARRAY (= the Creditors Relief list only). Each list: at most 100 field keys, none twice within the list. Returns an error text or null */
|
|
49
53
|
export declare const SECURE_EGRESS_MAX = 100;
|
|
54
|
+
export declare const SECURE_EGRESS_PARTNERS: readonly ["creditors_relief", "delancey_street"];
|
|
50
55
|
export declare function secureEgressProblem(binding: Record<string, unknown>): string | null;
|
|
51
56
|
export declare const fail: (text: string) => {
|
|
52
57
|
content: {
|
|
@@ -7,15 +7,18 @@ const KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
|
7
7
|
export const FORMULA_OPS = ["add", "sub", "mul", "div"];
|
|
8
8
|
export const FORMULA_FORMATS = ["number", "currency", "percent"];
|
|
9
9
|
/** every fieldType the custom-fields route accepts for a definition (the server's create enum, batch31) */
|
|
10
|
-
export const CUSTOM_FIELD_TYPES = ["text", "textarea", "number", "date", "datetime", "url", "select", "radio", "multiselect", "boolean", "phone", "email", "formula"];
|
|
10
|
+
export const CUSTOM_FIELD_TYPES = ["text", "textarea", "number", "date", "datetime", "url", "select", "radio", "multiselect", "boolean", "phone", "email", "formula", "user"];
|
|
11
11
|
export const DEAL_OES_KEYS = ["oes_number", "dpp_oes_raw"];
|
|
12
|
+
/** (parity32, batch32 delseam1286) the Delancey Street deal ID the partner push writes on the card: a partner identifier too (never Secure), and a RESERVED deal key */
|
|
13
|
+
export const DELANCEY_ID_KEY = "delancey_deal_id";
|
|
14
|
+
export const DELANCEY_ID_NOTE = "delancey_deal_id (the deal field the Delancey Street push writes, the card's link to the partner) is RESERVED: it can never be created through custom-fields (422 reserved_field_key), never made Secure (422 secure_identifier_refused), and a definition that already exists is never renamed, retyped, made required or deleted (422 reserved_field_key; only its section and sortOrder change); while a legacy definition of it is Secure its value is masked to the last 4.";
|
|
12
15
|
/** one description sentence for every record write that could carry a formula key */
|
|
13
16
|
export const FORMULA_WRITE_NOTE = "A customFields key that is a FORMULA field (computed at read time, never stored) is refused: 422 formula_read_only.";
|
|
14
17
|
/** one description sentence for every filter that could name a formula key */
|
|
15
18
|
export const FORMULA_FILTER_NOTE = "A filter naming a FORMULA custom field is refused: 422 formula_not_filterable (formulas are not filterable in v1).";
|
|
16
19
|
/** the definition-side rules, shared by the create and update tool descriptions */
|
|
17
20
|
export const FORMULA_DEFINITION_NOTE = "fieldType formula (#1292) is a COMPUTED field: options { op: add|sub|mul|div, left: <number field key>, right: <number field key or a number>, format: number|currency|percent }; left and right are number fields of the SAME entity (never the formula itself or another formula); the value is computed at read time (never stored), blank when an input is blank and on a division by zero; every record answer carries it in customFields plus computedFields[key] = { computed: true, readOnly: true, format }. A formula is read-only on every write path (422 formula_read_only), not filterable (422 formula_not_filterable), never required, and an input that is Secure needs a Secure formula (422 formula_secure_input; turning Secure on for an input a non-Secure formula computes from is 409 formula_secure_input naming the formulas). A formula needs a FRESH key (409 formula_key_in_use); malformed options, a non-number / formula / self input or a system-owned key is 422 formula_invalid. Deleting a field a formula computes from is 409 deletion_blocked (the formula in blockers).";
|
|
18
|
-
export const SECURE_IDENTIFIER_NOTE = "A phone or email field, or a deal OES #
|
|
21
|
+
export const SECURE_IDENTIFIER_NOTE = "A phone or email field, or a deal partner identifier (the OES # keys oes_number, dpp_oes_raw; the Delancey Street deal ID delancey_deal_id), identifies the record and can never be Secure: isSecure true on one is 422 secure_identifier_refused.";
|
|
19
22
|
const inputKey = z.string().trim().min(1).max(120).regex(KEY_RE);
|
|
20
23
|
/** the server's formula options object, strict */
|
|
21
24
|
export const formulaOptionsSchema = z.object({
|
|
@@ -41,10 +44,13 @@ export function formulaCreateProblem(p) {
|
|
|
41
44
|
return "The formula options object is accepted only with fieldType formula (otherwise 422 formula_invalid); select options are an array.";
|
|
42
45
|
}
|
|
43
46
|
if (p.isSecure === true) {
|
|
44
|
-
const
|
|
45
|
-
if (p.fieldType === "phone" || p.fieldType === "email" ||
|
|
46
|
-
return "A phone or email field, or a deal OES #
|
|
47
|
+
const partnerId = p.entityType === "deal" && typeof p.fieldKey === "string" && (DEAL_OES_KEYS.includes(p.fieldKey) || p.fieldKey === DELANCEY_ID_KEY);
|
|
48
|
+
if (p.fieldType === "phone" || p.fieldType === "email" || partnerId)
|
|
49
|
+
return "A phone or email field, or a deal partner identifier (the OES # keys oes_number, dpp_oes_raw; the Delancey Street deal ID delancey_deal_id), identifies the record and can never be Secure (422 secure_identifier_refused).";
|
|
47
50
|
}
|
|
51
|
+
// (parity32) delancey_deal_id on deals is written by the Delancey Street push only: a create naming it is 422 reserved_field_key (the server judges it after the Secure rule above)
|
|
52
|
+
if (p.entityType === "deal" && p.fieldKey === DELANCEY_ID_KEY)
|
|
53
|
+
return `"${DELANCEY_ID_KEY}" is the Delancey Street deal ID the partner push writes: its definition cannot be created here (422 reserved_field_key).`;
|
|
48
54
|
return null;
|
|
49
55
|
}
|
|
50
56
|
/** update: a formula-shaped options object gets the shape check; any other option object (numberFormat, currencyCode, ...) goes to the server untouched */
|
|
@@ -53,26 +59,46 @@ export function formulaUpdateProblem(p) {
|
|
|
53
59
|
return `A formula's options are { op: ${FORMULA_OPS.join("|")}, left: <field key>, right: <field key or a number>, format: ${FORMULA_FORMATS.join("|")} } and nothing else (422 formula_invalid).`;
|
|
54
60
|
return null;
|
|
55
61
|
}
|
|
56
|
-
/** the binding's secureEgress
|
|
62
|
+
/** the binding's secureEgress, in the two shapes the server accepts (batch32, per partner): an OBJECT { creditors_relief: string[], delancey_street: string[] } (each list optional,
|
|
63
|
+
* no other key) or the older flat ARRAY (= the Creditors Relief list only). Each list: at most 100 field keys, none twice within the list. Returns an error text or null */
|
|
57
64
|
export const SECURE_EGRESS_MAX = 100;
|
|
65
|
+
export const SECURE_EGRESS_PARTNERS = ["creditors_relief", "delancey_street"];
|
|
58
66
|
const EGRESS_KEY_RE = /^[a-zA-Z_][a-zA-Z0-9_]{0,99}$/;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return null;
|
|
63
|
-
if (!Array.isArray(e))
|
|
64
|
-
return "secureEgress must be an array of Secure custom field keys.";
|
|
65
|
-
if (e.length > SECURE_EGRESS_MAX)
|
|
66
|
-
return `secureEgress holds at most ${SECURE_EGRESS_MAX} keys.`;
|
|
67
|
+
function egressListProblem(list, where) {
|
|
68
|
+
if (list.length > SECURE_EGRESS_MAX)
|
|
69
|
+
return `${where} holds at most ${SECURE_EGRESS_MAX} keys.`;
|
|
67
70
|
const seen = new Set();
|
|
68
|
-
for (let i = 0; i <
|
|
69
|
-
const k =
|
|
71
|
+
for (let i = 0; i < list.length; i++) {
|
|
72
|
+
const k = list[i];
|
|
70
73
|
if (typeof k !== "string" || !EGRESS_KEY_RE.test(k))
|
|
71
|
-
return
|
|
74
|
+
return `${where}[${i}] must be a custom field key (letters, digits, underscores, not starting with a digit; at most 100 characters).`;
|
|
72
75
|
if (seen.has(k))
|
|
73
|
-
return
|
|
76
|
+
return `${where}[${i}] (${k}) is listed twice.`;
|
|
74
77
|
seen.add(k);
|
|
75
78
|
}
|
|
76
79
|
return null;
|
|
77
80
|
}
|
|
81
|
+
export function secureEgressProblem(binding) {
|
|
82
|
+
const e = binding.secureEgress;
|
|
83
|
+
if (e === undefined)
|
|
84
|
+
return null;
|
|
85
|
+
if (Array.isArray(e))
|
|
86
|
+
return egressListProblem(e, "secureEgress");
|
|
87
|
+
if (e === null || typeof e !== "object")
|
|
88
|
+
return "secureEgress must be an object per partner { creditors_relief: [keys], delancey_street: [keys] } (or the older flat array of keys, read as Creditors Relief only).";
|
|
89
|
+
for (const k of Object.keys(e))
|
|
90
|
+
if (!SECURE_EGRESS_PARTNERS.includes(k))
|
|
91
|
+
return `secureEgress may only hold ${SECURE_EGRESS_PARTNERS.join(" and ")} (got ${JSON.stringify(k)}).`;
|
|
92
|
+
for (const p of SECURE_EGRESS_PARTNERS) {
|
|
93
|
+
const list = e[p];
|
|
94
|
+
if (list === undefined)
|
|
95
|
+
continue;
|
|
96
|
+
if (!Array.isArray(list))
|
|
97
|
+
return `secureEgress.${p} must be an array of Secure custom field keys.`;
|
|
98
|
+
const problem = egressListProblem(list, `secureEgress.${p}`);
|
|
99
|
+
if (problem)
|
|
100
|
+
return problem;
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
78
104
|
export const fail = (text) => ({ content: [{ type: "text", text }], isError: true });
|
package/dist/tools/lead-pool.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { FORMULA_FILTER_NOTE } from "./formula-fields.js";
|
|
3
|
+
import { TIMEZONE_FILTER_NOTE } from "./lender-options.js";
|
|
3
4
|
import { formatResult } from "../client.js";
|
|
4
5
|
import { patchGeneralSettings } from "./lifecycle.js";
|
|
5
6
|
import { validateAdvancedFiltersEffective } from "./advanced-filter-rules.js";
|
|
@@ -118,7 +119,7 @@ export function registerLeadPoolTools(server, client) {
|
|
|
118
119
|
}
|
|
119
120
|
return formatResult({ data: { sets: rows, pageVersion: version } });
|
|
120
121
|
});
|
|
121
|
-
server.tool("conduyt_create_pool_filter_set", "Add a named filter set to a pool page (admin only). A new set is a DRAFT (off) unless isEnabled is true. Enabling a set that would OPEN the whole page (no rule) is refused with 409 pool_opens unless acknowledgeOpensPool is true. Every tag name a rule carries must be a live tag (422 tag_missing); a custom field must exist (422 custom_field_missing). pageVersion is the one your list read answered (409 page_version_stale when the page moved since: re-list and retry)." + " " + FORMULA_FILTER_NOTE, {
|
|
122
|
+
server.tool("conduyt_create_pool_filter_set", "Add a named filter set to a pool page (admin only). A new set is a DRAFT (off) unless isEnabled is true. Enabling a set that would OPEN the whole page (no rule) is refused with 409 pool_opens unless acknowledgeOpensPool is true. Every tag name a rule carries must be a live tag (422 tag_missing); a custom field must exist (422 custom_field_missing). pageVersion is the one your list read answered (409 page_version_stale when the page moved since: re-list and retry)." + " " + FORMULA_FILTER_NOTE + " " + TIMEZONE_FILTER_NOTE, {
|
|
122
123
|
page: poolPage,
|
|
123
124
|
name: setName,
|
|
124
125
|
filters: filtersSchema,
|
|
@@ -130,7 +131,7 @@ export function registerLeadPoolTools(server, client) {
|
|
|
130
131
|
...(isEnabled !== undefined ? { isEnabled } : {}),
|
|
131
132
|
...(acknowledgeOpensPool !== undefined ? { acknowledgeOpensPool } : {}),
|
|
132
133
|
})));
|
|
133
|
-
server.tool("conduyt_update_pool_filter_set", "Rename, refilter, enable / disable or reorder a pool filter set (admin only). Pass only what changes. Switching a set on or changing its rules reconciles the open offers the page no longer shows; a change that OPENS the whole page needs acknowledgeOpensPool. pageVersion is the one your list read answered for the set's page (409 page_version_stale when the page moved since: re-list and retry)." + " " + FORMULA_FILTER_NOTE, {
|
|
134
|
+
server.tool("conduyt_update_pool_filter_set", "Rename, refilter, enable / disable or reorder a pool filter set (admin only). Pass only what changes. Switching a set on or changing its rules reconciles the open offers the page no longer shows; a change that OPENS the whole page needs acknowledgeOpensPool. pageVersion is the one your list read answered for the set's page (409 page_version_stale when the page moved since: re-list and retry)." + " " + FORMULA_FILTER_NOTE + " " + TIMEZONE_FILTER_NOTE, {
|
|
134
135
|
id: z.string().uuid().describe("The set's UUID"),
|
|
135
136
|
name: setName.optional(),
|
|
136
137
|
filters: filtersSchema.optional(),
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (parity32, batch32 lenderv1 #1307 + tz1312 #1312) The select-type option cap, the guarded text -> select type change, the write-path
|
|
3
|
+
* fence for off-list values, and the timezone filter field, named once so every tool description carries the same sentences
|
|
4
|
+
* (the server stays the authority).
|
|
5
|
+
*/
|
|
6
|
+
export declare const OPTIONS_MAX = 1000;
|
|
7
|
+
export declare const OPTION_LABEL_MAX = 200;
|
|
8
|
+
export declare const OPTIONS_CAP_NOTE = "A select / radio / multiselect field holds up to 1000 options (each 1 to 200 characters, trimmed); options is an array, so a name with a comma (\"Dlp Funding, LLC\") is ONE option (only the web editor's box is one option per line).";
|
|
9
|
+
export declare const TYPE_CHANGE_NOTE = "A guarded TYPE CHANGE exists on the API (PATCH /custom-fields/{id} with fieldType select + options, optionally confirmOffListValues): a TEXT field becomes a select with that list (an existing select just takes the new list; nothing else changes beside it, the key never changes, the audit row keeps the before and after definition, there is no way back to text). It is for an owner or admin SIGNED IN, never an API key or an AI teammate, so it answers 403 field_type_change_forbidden here: there is no input for it on this tool. Its other refusals: 422 field_type_change_refused (a system field, a non-text field, an OES # key, an empty or repeating list); 409 field_type_change_off_list_unconfirmed (records hold a value not on the new list: they keep it, but it cannot be saved again; resend with confirmOffListValues true); 422 when fieldType comes with anything but options and confirmOffListValues, or confirmOffListValues without fieldType.";
|
|
10
|
+
export declare const OFF_LIST_NOTE = "A customFields value for a SELECT field (a lender dropdown is one) must be one of the field's options: another value is 422 `Invalid custom field values: <field label>` (no code; the answer's invalidFieldKeys names the key). A stored value that is no longer on the list (a text field became a select) stays readable, a write of OTHER keys never re-judges it, and an unchanged re-send of it is accepted; only a DIFFERENT off-list value is refused.";
|
|
11
|
+
export declare const TIMEZONE_FILTER_NOTE = "Advanced Filters field `timezone` (the contact's IANA zone, e.g. America/Chicago; options from conduyt_list_contact_timezones) takes is / is not / is any of / is none of / is empty / is not empty, an exact case-sensitive match on the stored zone (is not / is none of keep only contacts WITH a zone: ask for the unknown ones with is empty).";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* (parity32, batch32 lenderv1 #1307 + tz1312 #1312) The select-type option cap, the guarded text -> select type change, the write-path
|
|
3
|
+
* fence for off-list values, and the timezone filter field, named once so every tool description carries the same sentences
|
|
4
|
+
* (the server stays the authority).
|
|
5
|
+
*/
|
|
6
|
+
export const OPTIONS_MAX = 1000;
|
|
7
|
+
export const OPTION_LABEL_MAX = 200;
|
|
8
|
+
export const OPTIONS_CAP_NOTE = `A select / radio / multiselect field holds up to ${OPTIONS_MAX} options (each 1 to ${OPTION_LABEL_MAX} characters, trimmed); options is an array, so a name with a comma ("Dlp Funding, LLC") is ONE option (only the web editor's box is one option per line).`;
|
|
9
|
+
export const TYPE_CHANGE_NOTE = "A guarded TYPE CHANGE exists on the API (PATCH /custom-fields/{id} with fieldType select + options, optionally confirmOffListValues): a TEXT field becomes a select with that list (an existing select just takes the new list; nothing else changes beside it, the key never changes, the audit row keeps the before and after definition, there is no way back to text). It is for an owner or admin SIGNED IN, never an API key or an AI teammate, so it answers 403 field_type_change_forbidden here: there is no input for it on this tool. Its other refusals: 422 field_type_change_refused (a system field, a non-text field, an OES # key, an empty or repeating list); 409 field_type_change_off_list_unconfirmed (records hold a value not on the new list: they keep it, but it cannot be saved again; resend with confirmOffListValues true); 422 when fieldType comes with anything but options and confirmOffListValues, or confirmOffListValues without fieldType.";
|
|
10
|
+
export const OFF_LIST_NOTE = "A customFields value for a SELECT field (a lender dropdown is one) must be one of the field's options: another value is 422 `Invalid custom field values: <field label>` (no code; the answer's invalidFieldKeys names the key). A stored value that is no longer on the list (a text field became a select) stays readable, a write of OTHER keys never re-judges it, and an unchanged re-send of it is accepted; only a DIFFERENT off-list value is refused.";
|
|
11
|
+
export const TIMEZONE_FILTER_NOTE = "Advanced Filters field `timezone` (the contact's IANA zone, e.g. America/Chicago; options from conduyt_list_contact_timezones) takes is / is not / is any of / is none of / is empty / is not empty, an exact case-sensitive match on the stored zone (is not / is none of keep only contacts WITH a zone: ask for the unknown ones with is empty).";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { FORMULA_FILTER_NOTE } from "./formula-fields.js";
|
|
3
|
+
import { TIMEZONE_FILTER_NOTE } from "./lender-options.js";
|
|
3
4
|
import { formatResult } from "../client.js";
|
|
4
5
|
/**
|
|
5
6
|
* Personal saved filters for list pages (Velocify-style). Strictly
|
|
@@ -46,7 +47,7 @@ export function registerSavedFilterTools(server, client) {
|
|
|
46
47
|
const result = await client.get(`/api/v1/saved-filters${qs ? `?${qs}` : ""}`);
|
|
47
48
|
return formatResult(result);
|
|
48
49
|
});
|
|
49
|
-
server.tool("conduyt_create_saved_filter", "Save a named contact filter for one-click re-use — e.g. \"save a filter for Heather's Facebook leads\". Since 2026-09-24 a saved filter IS a personal Smart View (the Smart Views tab), private to the key's user for every role (max 50 per user). Requires the 'saved-filters' scope." + " " + FORMULA_FILTER_NOTE, {
|
|
50
|
+
server.tool("conduyt_create_saved_filter", "Save a named contact filter for one-click re-use — e.g. \"save a filter for Heather's Facebook leads\". Since 2026-09-24 a saved filter IS a personal Smart View (the Smart Views tab), private to the key's user for every role (max 50 per user). Requires the 'saved-filters' scope." + " " + FORMULA_FILTER_NOTE + " " + TIMEZONE_FILTER_NOTE, {
|
|
50
51
|
name: z.string().min(1).max(60).describe("Display name shown in the Saved dropdown (unique per user, max 60 chars)"),
|
|
51
52
|
filters: filtersSchema,
|
|
52
53
|
sortField: z.string().optional().describe("Sort field applied with the filter (default createdAt)"),
|
|
@@ -60,7 +61,7 @@ export function registerSavedFilterTools(server, client) {
|
|
|
60
61
|
const result = await client.post("/api/v1/smart-views", { name: params.name, filters: params.filters, sortField: params.sortField, sortOrder: params.sortOrder, icon: params.icon, personal: true });
|
|
61
62
|
return formatResult(result);
|
|
62
63
|
});
|
|
63
|
-
server.tool("conduyt_update_saved_filter", "Rename a saved filter (a personal Smart View) or replace its filters/sort. Owner-only — a personal view is its owner's for every role. Use conduyt_list_saved_filters or conduyt_list_smart_views to find the id. Requires the 'saved-filters' scope." + " " + FORMULA_FILTER_NOTE, {
|
|
64
|
+
server.tool("conduyt_update_saved_filter", "Rename a saved filter (a personal Smart View) or replace its filters/sort. Owner-only — a personal view is its owner's for every role. Use conduyt_list_saved_filters or conduyt_list_smart_views to find the id. Requires the 'saved-filters' scope." + " " + FORMULA_FILTER_NOTE + " " + TIMEZONE_FILTER_NOTE, {
|
|
64
65
|
id: z.string().uuid().describe("Saved filter UUID (from conduyt_list_saved_filters)"),
|
|
65
66
|
name: z.string().min(1).max(60).optional().describe("New display name (unique per user)"),
|
|
66
67
|
filters: filtersSchema,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { TIMEZONE_FILTER_NOTE } from "./lender-options.js";
|
|
2
3
|
import { formatResult } from "../client.js";
|
|
3
4
|
import { FORMULA_FILTER_NOTE } from "./formula-fields.js";
|
|
4
5
|
export function registerSmartListTools(server, client) {
|
|
@@ -12,7 +13,7 @@ export function registerSmartListTools(server, client) {
|
|
|
12
13
|
const result = await client.get(`/api/v1/smart-lists/${id}`);
|
|
13
14
|
return formatResult(result);
|
|
14
15
|
});
|
|
15
|
-
server.tool("conduyt_create_smart_list", "Create a new smart list (segment). Static lists have manually added contacts; dynamic lists use filter rules." + " " + FORMULA_FILTER_NOTE, {
|
|
16
|
+
server.tool("conduyt_create_smart_list", "Create a new smart list (segment). Static lists have manually added contacts; dynamic lists use filter rules." + " " + FORMULA_FILTER_NOTE + " " + TIMEZONE_FILTER_NOTE, {
|
|
16
17
|
name: z.string().describe("Smart list name"),
|
|
17
18
|
description: z.string().optional().describe("Description"),
|
|
18
19
|
type: z.enum(["static", "dynamic"]).optional().describe("List type — 'static' (manual) or 'dynamic' (filter-based). Default: static"),
|
|
@@ -21,7 +22,7 @@ export function registerSmartListTools(server, client) {
|
|
|
21
22
|
const result = await client.post("/api/v1/smart-lists", params);
|
|
22
23
|
return formatResult(result);
|
|
23
24
|
});
|
|
24
|
-
server.tool("conduyt_update_smart_list", "Update a smart list's name, description, type, or filters." + " " + FORMULA_FILTER_NOTE, {
|
|
25
|
+
server.tool("conduyt_update_smart_list", "Update a smart list's name, description, type, or filters." + " " + FORMULA_FILTER_NOTE + " " + TIMEZONE_FILTER_NOTE, {
|
|
25
26
|
id: z.string().describe("Smart list UUID"),
|
|
26
27
|
name: z.string().optional().describe("Updated name"),
|
|
27
28
|
description: z.string().optional().describe("Updated description"),
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const USER_FIELD_READ_DOC = " User fields (#1303): a custom field of fieldType user holds a user id of the workspace; the answer carries customFieldUsers ({ userId (lowercase): \"First Last\" }) naming the people its user fields hold (a value that names no member of the workspace is absent from the map).";
|
|
2
|
+
export declare const USER_FIELD_WRITE_DOC = " A USER custom field (fieldType user) takes a user id of the workspace (null clears); an id outside the workspace is 422 user_not_in_account. An owner change (assignedTo) also stamps the new owner's ROLE field when the workspace's settings.dealProfile.roleStamping maps their group (each rule's mode decides: first = never replaced once set, latest = the newest owner of the group wins; never blanked; a role key set in the same request is kept as sent).";
|
|
3
|
+
export declare const USER_NOTE = " USER fields (fieldType user): the value is a user id of the workspace (record writes refuse an id outside it: 422 user_not_in_account; the inbound webhooks and the import also accept an exact \"First Last\" or the user's e-mail); a user field takes no options (422). Changing a TEXT field into a user field (PATCH fieldType user, a DEAL field only; confirmDependencies true to accept the references that read it as text, else 409 field_type_change_dependencies_unconfirmed; 422 field_type_change_refused) is a signed-in owner / admin action in the app only: an API key is refused 403 field_type_change_forbidden, so there is no input for it on these tools. A user value is a lowercase member id of the workspace (an empty array is refused); the type change is allowed on DEAL fields only (422 on a contact or company field). Automation steps update_contact_field, math_operation, ai_compose_email and update_deal_field refuse a non-member with 422 user_not_in_account. A deal create can answer 422 \"The custom fields changed while saving\" when a field's type changed meanwhile: re-read the definitions and retry.";
|
|
4
|
+
/** contacts and companies: a user field is written by user id too (the role stamp is a deal-owner rule only) */
|
|
5
|
+
export declare const USER_FIELD_RECORD_WRITE_DOC = " A USER custom field (fieldType user) takes a user id of the workspace (null clears); an id outside the workspace is 422 user_not_in_account.";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// (userfield1303, batch32 #1303) USER custom fields and the card role stamp, named once for the record get / update tools and the definition tools
|
|
2
|
+
export const USER_FIELD_READ_DOC = " User fields (#1303): a custom field of fieldType user holds a user id of the workspace; the answer carries customFieldUsers ({ userId (lowercase): \"First Last\" }) naming the people its user fields hold (a value that names no member of the workspace is absent from the map).";
|
|
3
|
+
export const USER_FIELD_WRITE_DOC = " A USER custom field (fieldType user) takes a user id of the workspace (null clears); an id outside the workspace is 422 user_not_in_account. An owner change (assignedTo) also stamps the new owner's ROLE field when the workspace's settings.dealProfile.roleStamping maps their group (each rule's mode decides: first = never replaced once set, latest = the newest owner of the group wins; never blanked; a role key set in the same request is kept as sent).";
|
|
4
|
+
export const USER_NOTE = " USER fields (fieldType user): the value is a user id of the workspace (record writes refuse an id outside it: 422 user_not_in_account; the inbound webhooks and the import also accept an exact \"First Last\" or the user's e-mail); a user field takes no options (422). Changing a TEXT field into a user field (PATCH fieldType user, a DEAL field only; confirmDependencies true to accept the references that read it as text, else 409 field_type_change_dependencies_unconfirmed; 422 field_type_change_refused) is a signed-in owner / admin action in the app only: an API key is refused 403 field_type_change_forbidden, so there is no input for it on these tools. A user value is a lowercase member id of the workspace (an empty array is refused); the type change is allowed on DEAL fields only (422 on a contact or company field). Automation steps update_contact_field, math_operation, ai_compose_email and update_deal_field refuse a non-member with 422 user_not_in_account. A deal create can answer 422 \"The custom fields changed while saving\" when a field's type changed meanwhile: re-read the definitions and retry.";
|
|
5
|
+
/** contacts and companies: a user field is written by user id too (the role stamp is a deal-owner rule only) */
|
|
6
|
+
export const USER_FIELD_RECORD_WRITE_DOC = " A USER custom field (fieldType user) takes a user id of the workspace (null clears); an id outside the workspace is 422 user_not_in_account.";
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-11-
|
|
3
|
-
"toolCount":
|
|
4
|
-
"totalEndpoints":
|
|
2
|
+
"generatedAt": "2026-11-13T12:08:25.855Z",
|
|
3
|
+
"toolCount": 430,
|
|
4
|
+
"totalEndpoints": 1208,
|
|
5
5
|
"counts": {
|
|
6
|
-
"covered":
|
|
6
|
+
"covered": 379,
|
|
7
7
|
"excluded": 372,
|
|
8
8
|
"planned": 457,
|
|
9
9
|
"uncategorized": 0
|
|
@@ -1966,6 +1966,12 @@
|
|
|
1966
1966
|
"status": "planned",
|
|
1967
1967
|
"reason": "contact subroutes beyond the core CRUD/search tools"
|
|
1968
1968
|
},
|
|
1969
|
+
"GET /api/v1/contacts/timezones": {
|
|
1970
|
+
"status": "covered",
|
|
1971
|
+
"tools": [
|
|
1972
|
+
"conduyt_list_contact_timezones"
|
|
1973
|
+
]
|
|
1974
|
+
},
|
|
1969
1975
|
"POST /api/v1/contacts/verify-line-type": {
|
|
1970
1976
|
"status": "covered",
|
|
1971
1977
|
"tools": [
|