conduyt-mcp 4.105.27 → 4.105.30

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/README.md CHANGED
@@ -340,7 +340,7 @@ Team Chat 2.0 publishes thin events (ids and kinds, never message content) on th
340
340
  |------|-------------|
341
341
  | `conduyt_ai_import_contacts` | AI-powered bulk import (up to 1000, auto-tag, smart list, automation) |
342
342
  | `conduyt_export_contacts` | Export contacts as JSON with filters |
343
- | `conduyt_export_deals` | Export deals as JSON with filters |
343
+ | `conduyt_export_deals` | Export deals as JSON with the board's filters (owner, tags, time zone, dates, value, health) |
344
344
  | `conduyt_bulk_tag_contacts` | Add one tag to many contacts |
345
345
  | `conduyt_bulk_untag_contacts` | Remove one tag from many contacts |
346
346
  | `conduyt_bulk_edit_contacts` | Apply the same field changes to many contacts |
@@ -44,6 +44,10 @@ export const TOOL_ANNOTATIONS = {
44
44
  conduyt_import_deals: create("Import Deals"),
45
45
  conduyt_add_deal_tags: update("Add Deal Tags"),
46
46
  conduyt_list_deal_views: ro("List Deal Views"),
47
+ conduyt_get_deal_view: ro("Get Deal View"),
48
+ conduyt_create_deal_view: create("Create Deal View"),
49
+ conduyt_update_deal_view: update("Update Deal View"),
50
+ conduyt_delete_deal_view: destroy("Delete Deal View"),
47
51
  conduyt_list_tasks: ro("List Tasks"),
48
52
  conduyt_create_task: create("Create Task"),
49
53
  conduyt_get_task: ro("Get Task"),
@@ -1,5 +1,5 @@
1
1
  /**
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
2
+ * PORTED VERBATIM from conduyt-app lib/smart-view-filters.ts @ slice B r28 (+ #1312 the timezone field, parity32; parity36: the field's VALUES now also take the group words eastern ... hawaii and unknown, a value the API compiles and this validator never inspects, so no table changed) (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 (+ #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
2
+ * PORTED VERBATIM from conduyt-app lib/smart-view-filters.ts @ slice B r28 (+ #1312 the timezone field, parity32; parity36: the field's VALUES now also take the group words eastern ... hawaii and unknown, a value the API compiles and this validator never inspects, so no table changed) (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.
@@ -12,16 +12,18 @@ export { hide } from "./routine-key-redaction.js";
12
12
  * ONE plain sentence: the server's own (the S.3 and input sentences are written for people) or ours where its text is not one (today's
13
13
  * production answers these paths with an HTML 404; the switch answers "Not found").
14
14
  */
15
- export declare const OLDER_SERVER_SENTENCE = "This Conduyt server does not have the Grok Bot connection yet (it predates it); connect the teammate in Settings > AI instead.";
15
+ export declare const OLDER_SERVER_SENTENCE = "This Conduyt server does not have the Grok Bot / OpenClaw connection yet (it predates it); connect the teammate in Settings > AI instead.";
16
16
  export declare const AI_OFF_SENTENCE = "AI teammates are switched off for this workspace; an owner or admin turns them on in Settings > AI.";
17
17
  export declare const NOT_FOUND_SENTENCE = "There is no AI teammate with that id or handle in this workspace (it may have been revoked); conduyt_list_ai_teammates lists them.";
18
18
  /** (#1153) GET /chat/agents on a server from before #1153 refuses every API key with its session-only sentence */
19
19
  export declare const OLDER_LIST_SENTENCE = "This Conduyt server does not let an API key read the AI teammate list yet (it predates it); see the teammates in Settings > AI.";
20
- export declare const TEAMMATE_KEY_SENTENCE = "This is an AI teammate's own key; connect a Grok Bot with a person's API key (an owner or admin).";
21
- /** the listener-test tool's own wording: the teammate may be any listener (Claude Code, Cowork or another coding-agent listener, or a Grok Bot), so the shared Grok Bot sentences are not used for it */
20
+ export declare const TEAMMATE_KEY_SENTENCE = "This is an AI teammate's own key; connect a Grok Bot or OpenClaw teammate with a person's API key (an owner or admin).";
21
+ /** the listener-test tool's own wording: the teammate may be any listener (Claude Code, Cowork or another coding-agent listener, or a Grok Bot or OpenClaw connector), so the shared connector sentences are not used for it */
22
22
  export declare const LISTENER_KEY_SENTENCE = "This is an AI teammate's own key; test a teammate's connection with a person's API key (an owner or admin).";
23
23
  export declare const LISTENER_OLDER_SERVER_SENTENCE = "This Conduyt server does not have the AI teammate connection test yet (it predates it); test the teammate in Settings > AI instead.";
24
- export declare const NO_CREDENTIALS_SENTENCE = "Give the routine's address and key: paste (the block Grok Bot shows), or address and key.";
24
+ export declare const NO_CREDENTIALS_SENTENCE = "Give the connector's address and key: paste (the block Grok Bot shows, or OpenClaw's hooks address and hook token), or address and key.";
25
+ /** (parity36b, #1137) the one sentence for a delivery an OpenClaw gateway accepted without starting a run: neither a failure nor a plain success */
26
+ export declare const NO_RUN_SENTENCE = "Delivered: OpenClaw's gateway accepted it (HTTP 204) and started no run, so no hello will come from this test.";
25
27
  /** the one sentence for a refused call, and its code when the API sent one */
26
28
  export declare function refusalOf(err: ConduytApiError): {
27
29
  status: number | null;
@@ -14,16 +14,18 @@ export { hide } from "./routine-key-redaction.js";
14
14
  * ONE plain sentence: the server's own (the S.3 and input sentences are written for people) or ours where its text is not one (today's
15
15
  * production answers these paths with an HTML 404; the switch answers "Not found").
16
16
  */
17
- export const OLDER_SERVER_SENTENCE = "This Conduyt server does not have the Grok Bot connection yet (it predates it); connect the teammate in Settings > AI instead.";
17
+ export const OLDER_SERVER_SENTENCE = "This Conduyt server does not have the Grok Bot / OpenClaw connection yet (it predates it); connect the teammate in Settings > AI instead.";
18
18
  export const AI_OFF_SENTENCE = "AI teammates are switched off for this workspace; an owner or admin turns them on in Settings > AI.";
19
19
  export const NOT_FOUND_SENTENCE = "There is no AI teammate with that id or handle in this workspace (it may have been revoked); conduyt_list_ai_teammates lists them.";
20
20
  /** (#1153) GET /chat/agents on a server from before #1153 refuses every API key with its session-only sentence */
21
21
  export const OLDER_LIST_SENTENCE = "This Conduyt server does not let an API key read the AI teammate list yet (it predates it); see the teammates in Settings > AI.";
22
- export const TEAMMATE_KEY_SENTENCE = "This is an AI teammate's own key; connect a Grok Bot with a person's API key (an owner or admin).";
23
- /** the listener-test tool's own wording: the teammate may be any listener (Claude Code, Cowork or another coding-agent listener, or a Grok Bot), so the shared Grok Bot sentences are not used for it */
22
+ export const TEAMMATE_KEY_SENTENCE = "This is an AI teammate's own key; connect a Grok Bot or OpenClaw teammate with a person's API key (an owner or admin).";
23
+ /** the listener-test tool's own wording: the teammate may be any listener (Claude Code, Cowork or another coding-agent listener, or a Grok Bot or OpenClaw connector), so the shared connector sentences are not used for it */
24
24
  export const LISTENER_KEY_SENTENCE = "This is an AI teammate's own key; test a teammate's connection with a person's API key (an owner or admin).";
25
25
  export const LISTENER_OLDER_SERVER_SENTENCE = "This Conduyt server does not have the AI teammate connection test yet (it predates it); test the teammate in Settings > AI instead.";
26
- export const NO_CREDENTIALS_SENTENCE = "Give the routine's address and key: paste (the block Grok Bot shows), or address and key.";
26
+ export const NO_CREDENTIALS_SENTENCE = "Give the connector's address and key: paste (the block Grok Bot shows, or OpenClaw's hooks address and hook token), or address and key.";
27
+ /** (parity36b, #1137) the one sentence for a delivery an OpenClaw gateway accepted without starting a run: neither a failure nor a plain success */
28
+ export const NO_RUN_SENTENCE = "Delivered: OpenClaw's gateway accepted it (HTTP 204) and started no run, so no hello will come from this test.";
27
29
  function errorDetailsOf(message) {
28
30
  for (let i = message.indexOf("{"); i !== -1; i = message.indexOf("{", i + 1)) {
29
31
  try {
@@ -88,10 +90,13 @@ const unwrap = (res) => (res && typeof res === "object" && "data" in res ? res.d
88
90
  function testOutcome(secrets) {
89
91
  return (res) => {
90
92
  const d = unwrap(res);
93
+ // (parity36b) accepted with no run started: an ok result (not an error) that says so in its own sentence, beside the server's answer
94
+ if (d?.test?.ok === true && d.test.noRun === true)
95
+ return connectResult({ ...d, note: NO_RUN_SENTENCE }, secrets);
91
96
  if (d?.test?.ok === true)
92
97
  return connectResult(d, secrets);
93
98
  const problem = d?.test?.problem;
94
- return connectError(problem?.message ?? "Grok Bot did not accept the test.", secrets, { status: 200, ...(problem?.code ? { code: problem.code } : {}), answer: d });
99
+ return connectError(problem?.message ?? "The connector did not accept the test.", secrets, { status: 200, ...(problem?.code ? { code: problem.code } : {}), answer: d });
95
100
  };
96
101
  }
97
102
  const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -100,13 +105,13 @@ const HANDLE_RE = /^@[a-z][a-z0-9_-]{1,31}$/i;
100
105
  /** (#1153) the teammate: its id (a UUID) or its @handle, lower-cased; the server resolves the handle (lib/agent-webhook-routes.ts
101
106
  * parseTeammateRef, the one place for every surface), so nothing here looks it up */
102
107
  const TEAMMATE_ID = z.string().trim().refine((v) => UUID_RE.test(v) || HANDLE_RE.test(v), { message: "teammateId must be the teammate's id (a UUID) or its @handle" })
103
- .describe("The Grok Bot teammate: its id (a UUID) or its @handle, as conduyt_list_ai_teammates lists them (the agent.id of conduyt_connect_ai_teammate's answer and the senderId of its messages are the id too)");
108
+ .describe("The connector teammate (provider Grok Bot or OpenClaw): its id (a UUID) or its @handle, as conduyt_list_ai_teammates lists them (the agent.id of conduyt_connect_ai_teammate's answer and the senderId of its messages are the id too)");
104
109
  /** the path segment of a teammate: trimmed and lower-cased (handles and ids are case-insensitive), an @handle travels as %40handle */
105
110
  const seg = (teammateId) => encodeURIComponent(teammateId.trim().toLowerCase());
106
- const WHO = "Owners and admins, with a person's API key (the chat scope); an AI teammate's own key is refused (403 agent_route_refused). The teammate must have the provider Grok Bot (409 agent_not_webhook_provider otherwise). Answers 404 ai_teammates_off while AI teammates are switched off and 402 plan_required when the workspace is not entitled. Against a server that predates these routes (an HTML 404) the error says so.";
111
+ const WHO = "Owners and admins, with a person's API key (the chat scope); an AI teammate's own key is refused (403 agent_route_refused). The teammate must have the provider Grok Bot or OpenClaw (grok or clawdbot; 409 agent_not_webhook_provider otherwise). Answers 404 ai_teammates_off while AI teammates are switched off and 402 plan_required when the workspace is not entitled. Against a server that predates these routes (an HTML 404) the error says so.";
107
112
  export function registerAiTeammateConnectTools(server, client) {
108
113
  // (#1153, tri-surface parity) the workspace's AI teammates, so an agent can find the one to connect by id or @handle
109
- strictInput(server.tool("conduyt_list_ai_teammates", "List the workspace's live AI teammates (GET /api/v1/chat/agents; a removed teammate is not listed), oldest first: [{ id, handle, name, provider (claude_code, codex, grok), state (listening, replying, needs_attention (#1213: listening, nothing running, and a turn in the last 24 hours failed or timed out), away), connected (a Grok Bot teammate: its connection is stored and live; any other: a listener runs now), connection (a Grok Bot teammate's not_connected, waiting_for_hello, listening or not_listening; null otherwise), knowledgeFolders (#1209: how many knowledge folders the teammate's RUNNING listeners reported, the sum over the listeners whose heartbeat beats now, 0 = none; a knowledge folder is a folder on the listener's computer the teammate reads on every turn, whoever asked, read-only, secrets-looking files excluded; it is chosen on that computer with \`conduyt agent listen\` (the start directory, --knowledge <folder> or --no-knowledge), never through Conduyt, and its path never leaves the computer), createdAt }]. Nothing secret is listed. Name a teammate to the Grok Bot tools by its id or its @handle. Owners and admins, with a person's API key (the chat scope; reading is enough); a member's key is refused (403) and an AI teammate's own key too (403 agent_route_refused). Adding a teammate stays in Settings > AI. Answers 404 ai_teammates_off while AI teammates are switched off and 402 plan_required when the workspace is not entitled; a workspace with more than 200 live teammates is refused to an API key (413 agent_list_over_ceiling; Settings > AI lists them all).", {}, async () => {
114
+ strictInput(server.tool("conduyt_list_ai_teammates", "List the workspace's live AI teammates (GET /api/v1/chat/agents; a removed teammate is not listed), oldest first: [{ id, handle, name, provider (claude_code, codex, grok, clawdbot), state (listening, replying, needs_attention (#1213: listening, nothing running, and a turn in the last 24 hours failed or timed out), away), connected (a connector teammate, grok or clawdbot: its connection is stored and live; any other: a listener runs now), connection (a connector teammate's not_connected, waiting_for_hello, listening or not_listening; null otherwise), knowledgeFolders (#1209: how many knowledge folders the teammate's RUNNING listeners reported, the sum over the listeners whose heartbeat beats now, 0 = none; a knowledge folder is a folder on the listener's computer the teammate reads on every turn, whoever asked, read-only, secrets-looking files excluded; it is chosen on that computer with \`conduyt agent listen\` (the start directory, --knowledge <folder> or --no-knowledge), never through Conduyt, and its path never leaves the computer), createdAt }]. Nothing secret is listed. Name a teammate to the connector tools (Grok Bot and OpenClaw) by its id or its @handle. The rows an API key reads carry no webhook object (the Settings session rows do: webhook.noRun and webhook.provider are read there, never through this tool). Owners and admins, with a person's API key (the chat scope; reading is enough); a member's key is refused (403) and an AI teammate's own key too (403 agent_route_refused). Adding a teammate stays in Settings > AI. Answers 404 ai_teammates_off while AI teammates are switched off and 402 plan_required when the workspace is not entitled; a workspace with more than 200 live teammates is refused to an API key (413 agent_list_over_ceiling; Settings > AI lists them all).", {}, async () => {
110
115
  try {
111
116
  const res = await client.get("/api/v1/chat/agents");
112
117
  return connectResult(unwrap(res), []);
@@ -121,23 +126,24 @@ export function registerAiTeammateConnectTools(server, client) {
121
126
  throw err;
122
127
  }
123
128
  }));
124
- strictInput(server.tool("conduyt_connect_ai_teammate", `Step 1 of connecting a Grok Bot as an AI teammate (POST /api/v1/chat/agents/{id}/connect). Mints the teammate's token and returns it ONCE: { token, tokenPrefix, message, toolsUrl, agent }. Give the person the message to paste into Grok Bot and the token to paste into Grok Bot's masked connector field; NEVER post the token in Team Chat or any message, and never call this again just to read it: every call revokes the teammate's earlier tokens (the card's "Get a new token"). The calling key must hold the write tier and the chat and deals scopes (403 api_key_scope_insufficient otherwise). 409 agent_listener_webhook_conflict while the teammate's listener is running; 409 teammate_not_live when its owner lost access. Step 3 is conduyt_set_ai_teammate_webhook. ${WHO}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.post(`/api/v1/chat/agents/${seg(teammateId)}/connect`, {}), (res) => connectResult(unwrap(res), []))));
125
- strictInput(server.tool("conduyt_set_ai_teammate_webhook", `Step 3 of connecting a Grok Bot (PUT /api/v1/chat/agents/{id}/webhook): the routine's address and key, as Grok Bot shows them. Send EITHER paste (the whole block the person copied: it must hold one https address and one key) OR address and key. Conduyt checks the address (https, a public host), stores both (the key encrypted), sends the test at once (10 s) and answers { stored, test: { ok, statusCode, runUuid, problem }, status }. The key is write-only: it is never returned, and any text this tool returns has it replaced by [hidden]. A test that was not accepted is an error result { ok: false, error: <its one sentence>, status: 200, code (key_refused, routine_gone, unreachable, not_accepted, rate_limited), answer: <the whole answer> }; an accepted test leaves status Waiting for Grok Bot to say hello: poll conduyt_get_ai_teammate_webhook (every few seconds, up to about 3 minutes) until state is listening or a problem is named. Refusals: 400 with the input codes (input_conflict, address_missing, address_invalid, address_ambiguous, key_missing, key_invalid, key_ambiguous), 422 address_invalid / unreachable, 409 agent_token_missing (run conduyt_connect_ai_teammate first), agent_listener_webhook_conflict, agent_webhook_contended, teammate_not_live, 429 after 20 tests per teammate in 10 minutes, 503 while a delivery is in flight. ${WHO}`, {
129
+ strictInput(server.tool("conduyt_connect_ai_teammate", `Step 1 of connecting a Grok Bot or OpenClaw as an AI teammate (POST /api/v1/chat/agents/{id}/connect). Mints the teammate's token and returns it ONCE: { token, tokenPrefix, message, toolsUrl, agent }. Give the person the message to paste into Grok Bot (or OpenClaw) and the token to paste into the connector's masked field; NEVER post the token in Team Chat or any message, and never call this again just to read it: every call revokes the teammate's earlier tokens (the card's "Get a new token"). The calling key must hold the write tier and the chat and deals scopes (403 api_key_scope_insufficient otherwise). 409 agent_listener_webhook_conflict while the teammate's listener is running; 409 teammate_not_live when its owner lost access. Step 3 is conduyt_set_ai_teammate_webhook. ${WHO}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.post(`/api/v1/chat/agents/${seg(teammateId)}/connect`, {}), (res) => connectResult(unwrap(res), []))));
130
+ strictInput(server.tool("conduyt_set_ai_teammate_webhook", `Step 3 of connecting a Grok Bot or OpenClaw (PUT /api/v1/chat/agents/{id}/webhook): Grok Bot's routine address and key, or OpenClaw's hooks address (https, ending in /hooks/agent) and hook token, as the connector shows them. Send EITHER paste (the whole block the person copied: it must hold one https address and one key; for OpenClaw an "agent:" line may name the hook agent) OR address and key. OpenClaw only, optional: agentId, the agent id inside the OpenClaw gateway that answers (as in its hooks.allowedAgentIds); without it OpenClaw runs its default agent; a Grok Bot teammate takes none. Conduyt checks the address (https, a public host), stores both (the key encrypted), sends the test at once (10 s) and answers { stored, test: { ok, statusCode, runUuid, noRun, problem }, status }. The key (an OpenClaw hook token too) is write-only: it is never returned, and any text this tool returns has it replaced by [hidden]. test.noRun true: an OpenClaw gateway answered 204, so the hello was delivered and accepted but NO RUN was started (neither a failure nor a plain success; this tool answers an ok result with a note saying so, and no hello will come from that test: check the hook agent in OpenClaw, then call conduyt_test_ai_teammate_webhook). A test that was not accepted is an error result { ok: false, error: <its one sentence>, status: 200, code (key_refused, routine_gone, unreachable, not_accepted, rate_limited, session_busy (OpenClaw is still running another turn in the hook's session: wait, test again), body_too_large (the message was over the gateway's hook body limit)), answer: <the whole answer> }; an accepted test that started a run leaves status Waiting for the connector to say hello: poll conduyt_get_ai_teammate_webhook (every few seconds, up to about 3 minutes) until state is listening or a problem is named. Refusals: 400 with the input codes (input_conflict, address_missing, address_invalid, address_ambiguous, key_missing, key_invalid, key_ambiguous, agent_id_not_used, agent_id_invalid, agent_id_ambiguous), 422 address_invalid / unreachable, 409 agent_token_missing (run conduyt_connect_ai_teammate first), agent_listener_webhook_conflict, agent_webhook_contended, teammate_not_live, 429 after 20 tests per teammate in 10 minutes, 503 while a delivery is in flight. ${WHO}`, {
126
131
  teammateId: TEAMMATE_ID,
127
- paste: z.string().min(1).max(12_000).optional().describe("The block Grok Bot shows (address and key together); not with address or key"),
128
- address: z.string().min(1).max(2_048).optional().describe("The routine's address (https://...)"),
129
- key: z.string().min(1).max(600).optional().describe("The routine's key (write-only: never returned). The bare key or the \"Authorization: Bearer ...\" header value"),
130
- }, async ({ teammateId, paste, address, key }) => {
132
+ paste: z.string().min(1).max(12_000).optional().describe("The block Grok Bot (or OpenClaw) shows (address and key together); not with address or key"),
133
+ address: z.string().min(1).max(2_048).optional().describe("The routine's address (https://...); OpenClaw: the hooks address, ending in /hooks/agent"),
134
+ key: z.string().min(1).max(600).optional().describe("The routine's key, or OpenClaw's hook token (write-only: never returned). The bare key or the \"Authorization: Bearer ...\" header value"),
135
+ agentId: z.string().min(1).max(64).optional().describe("OpenClaw only, optional: the agent id inside the OpenClaw gateway that answers (hooks.allowedAgentIds; 1 to 64 characters of A-Z a-z 0-9 . _ -); sent as agentId, not a secret. A Grok Bot teammate takes none (400 agent_id_not_used)"),
136
+ }, async ({ teammateId, paste, address, key, agentId }) => {
131
137
  // (r2, Codex grokA3-mcp-r1 P1) every form the server could take as the key (routine-key-redaction.ts: the server's rules ported,
132
138
  // plus the floor of every token as typed), for each input that can carry it: the key field, the paste, an address box holding both
133
139
  const secrets = [...(key !== undefined ? secretsOfKey(key) : []), ...(paste !== undefined ? secretsInPaste(paste) : []), ...(address !== undefined ? secretsInPaste(address) : [])];
134
140
  if (paste === undefined && address === undefined)
135
141
  return connectError(NO_CREDENTIALS_SENTENCE, secrets, { status: null, code: "address_missing" });
136
- // the body as ONE literal: the contract gate reads the request fields (paste, address, key) from it
137
- return attempt(secrets, () => client.put(`/api/v1/chat/agents/${seg(teammateId)}/webhook`, { ...(paste !== undefined ? { paste } : {}), ...(address !== undefined ? { address } : {}), ...(key !== undefined ? { key } : {}) }), testOutcome(secrets));
142
+ // the body as ONE literal: the contract gate reads the request fields (paste, address, key, agentId) from it
143
+ return attempt(secrets, () => client.put(`/api/v1/chat/agents/${seg(teammateId)}/webhook`, { ...(paste !== undefined ? { paste } : {}), ...(address !== undefined ? { address } : {}), ...(key !== undefined ? { key } : {}), ...(agentId !== undefined ? { agentId } : {}) }), testOutcome(secrets));
138
144
  }));
139
- strictInput(server.tool("conduyt_test_ai_teammate_webhook", `The card's Test button (POST /api/v1/chat/agents/{id}/webhook/test): sends the hello again to the stored routine (nothing is pasted); an accepted test turns a stored connection live. Answers { test, status } like conduyt_set_ai_teammate_webhook (a test that was not accepted is an error result with its sentence); then poll conduyt_get_ai_teammate_webhook for the hello. 409 agent_webhook_not_connected when nothing is stored; 429 after 20 tests per teammate in 10 minutes. ${WHO}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.post(`/api/v1/chat/agents/${seg(teammateId)}/webhook/test`, {}), testOutcome([]))));
140
- strictInput(server.tool("conduyt_test_ai_teammate_listener", `The Settings > AI Test for a LISTENER teammate (a teammate whose listener runs the conduyt CLI: Claude Code, Cowork or another coding-agent listener; POST /api/v1/chat/agents/{id}/test, no body): asks the teammate's running listener for the hello. Its next inbox page carries the test and the listener posts "Hello, I'm connected." in AI Team Chat once; read the result with conduyt_list_ai_teammates (helloTest.helloAt). Answers { hello, test: { supported, requestedAt, helloAt, waitingUntil } }. It changes nothing but the request time on the teammate (not destructive; a repeat only asks again). Owners and admins with a person's API key (the chat scope); an AI teammate's own key is refused (403 agent_route_refused). 409 with a code: agent_not_listener_provider (a Grok Bot teammate: use conduyt_test_ai_teammate_webhook), listener_not_listening (no heartbeat in the last 60 seconds), listener_too_old (the listener is older than conduyt CLI 1.91.0; mention the teammate with hello instead), teammate_not_live (its owner lost access); 402 plan_required when the workspace's plan does not include AI teammates; 429 after 20 tests in 10 minutes; 404 ai_teammates_off while the workspace's AI teammates switch is off.`, { teammateId: TEAMMATE_ID.describe("The listener teammate: its id (a UUID) or its @handle, as conduyt_list_ai_teammates lists them (any provider; a Grok Bot is refused with agent_not_listener_provider)") }, async ({ teammateId }) => {
145
+ strictInput(server.tool("conduyt_test_ai_teammate_webhook", `The card's Test button (POST /api/v1/chat/agents/{id}/webhook/test): sends the hello again to the stored routine or hook (nothing is pasted); an accepted test turns a stored connection live. Answers { test, status } like conduyt_set_ai_teammate_webhook (a test that was not accepted is an error result with its sentence, code including session_busy and body_too_large for OpenClaw; test.noRun true = delivered, the gateway accepted it, no run was started: an ok result with a note, and no hello will come); then poll conduyt_get_ai_teammate_webhook for the hello. 409 agent_webhook_not_connected when nothing is stored; 429 after 20 tests per teammate in 10 minutes. ${WHO}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.post(`/api/v1/chat/agents/${seg(teammateId)}/webhook/test`, {}), testOutcome([]))));
146
+ strictInput(server.tool("conduyt_test_ai_teammate_listener", `The Settings > AI Test for a LISTENER teammate (a teammate whose listener runs the conduyt CLI: Claude Code, Cowork or another coding-agent listener; POST /api/v1/chat/agents/{id}/test, no body): asks the teammate's running listener for the hello. Its next inbox page carries the test and the listener posts "Hello, I'm connected." in AI Team Chat once; read the result with conduyt_list_ai_teammates (helloTest.helloAt). Answers { hello, test: { supported, requestedAt, helloAt, waitingUntil } }. It changes nothing but the request time on the teammate (not destructive; a repeat only asks again). Owners and admins with a person's API key (the chat scope); an AI teammate's own key is refused (403 agent_route_refused). 409 with a code: agent_not_listener_provider (a Grok Bot or OpenClaw teammate: use conduyt_test_ai_teammate_webhook), listener_not_listening (no heartbeat in the last 60 seconds), listener_too_old (the listener is older than conduyt CLI 1.91.0; mention the teammate with hello instead), teammate_not_live (its owner lost access); 402 plan_required when the workspace's plan does not include AI teammates; 429 after 20 tests in 10 minutes; 404 ai_teammates_off while the workspace's AI teammates switch is off.`, { teammateId: TEAMMATE_ID.describe("The listener teammate: its id (a UUID) or its @handle, as conduyt_list_ai_teammates lists them (any provider; a Grok Bot or OpenClaw teammate is refused with agent_not_listener_provider)") }, async ({ teammateId }) => {
141
147
  try {
142
148
  return connectResult(unwrap(await client.post(`/api/v1/chat/agents/${seg(teammateId)}/test`, {})), []);
143
149
  }
@@ -150,6 +156,6 @@ export function registerAiTeammateConnectTools(server, client) {
150
156
  throw err;
151
157
  }
152
158
  }));
153
- strictInput(server.tool("conduyt_get_ai_teammate_webhook", `The Grok Bot connection's status (GET /api/v1/chat/agents/{id}/webhook), what the Settings card polls: { state (not_connected | waiting_for_hello | listening | not_listening), label, problem: { code, message } | null (the sentence of what to fix), waitingUntil, connected, address (masked), lastAttempt, tokenUsedAt, lastMessageAt }. Never carries the key. ${WHO}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.get(`/api/v1/chat/agents/${seg(teammateId)}/webhook`), (res) => connectResult(unwrap(res), []))));
154
- strictInput(server.tool("conduyt_disconnect_ai_teammate", `Disconnect a Grok Bot teammate (DELETE /api/v1/chat/agents/{id}/webhook; never blocked by billing): its tokens are revoked, the routine's key is cleared and pending deliveries are cancelled; the teammate and its messages stay. Answers { disconnected, revokedKeys, webhook, cancelledDeliveries }. Safe to repeat. Connect it again with conduyt_connect_ai_teammate then conduyt_set_ai_teammate_webhook. ${WHO.replace(" and 402 plan_required when the workspace is not entitled", "")}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.del(`/api/v1/chat/agents/${seg(teammateId)}/webhook`), (res) => connectResult(unwrap(res), []))));
159
+ strictInput(server.tool("conduyt_get_ai_teammate_webhook", `The Grok Bot or OpenClaw connection's status (GET /api/v1/chat/agents/{id}/webhook), what the Settings card polls: { state (not_connected | waiting_for_hello | listening | not_listening), label, problem: { code, message } | null (the sentence of what to fix; session_busy and body_too_large are OpenClaw's codes for a busy hook session and an oversized message), waitingUntil, connected, address (masked), lastAttempt { event, ok, statusCode, at, runUuid, noRun (true: the last delivery was accepted by an OpenClaw gateway without starting a run) }, tokenUsedAt, lastMessageAt }. Never carries the key or the hook token. ${WHO}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.get(`/api/v1/chat/agents/${seg(teammateId)}/webhook`), (res) => connectResult(unwrap(res), []))));
160
+ strictInput(server.tool("conduyt_disconnect_ai_teammate", `Disconnect a Grok Bot or OpenClaw teammate (DELETE /api/v1/chat/agents/{id}/webhook; never blocked by billing): its tokens are revoked, the routine's key (an OpenClaw hook token too) is cleared and pending deliveries are cancelled; the teammate and its messages stay. Answers { disconnected, revokedKeys, webhook, cancelledDeliveries }. Safe to repeat. Connect it again with conduyt_connect_ai_teammate then conduyt_set_ai_teammate_webhook. ${WHO.replace(" and 402 plan_required when the workspace is not entitled", "")}`, { teammateId: TEAMMATE_ID }, async ({ teammateId }) => attempt([], () => client.del(`/api/v1/chat/agents/${seg(teammateId)}/webhook`), (res) => connectResult(unwrap(res), []))));
155
161
  }
@@ -2,6 +2,8 @@ import { z } from "zod";
2
2
  import { formatResult } from "../client.js";
3
3
  import { INVALID_NUMBER_REFUSALS } from "./contacts.js";
4
4
  import { strictInput } from "./strict.js";
5
+ import { CONTACT_TIMEZONE_NOTE, appendContactTimezone, contactTimezoneSchema } from "./contact-timezone.js";
6
+ import { appendDealExportFilters, dealExportFilterShape } from "./deal-views.js";
5
7
  /** (#136, Codex r1 m2) POST /bulk/contacts/update is NOT atomic and answers per row: an impossible phone is a per-row success:false inside HTTP 200 (no code) while other rows commit; the route takes no country */
6
8
  export const BULK_UPDATE_REFUSALS = " Results are PER ROW inside an HTTP 200 (not atomic: some rows can be saved while others fail): read data.summary { total, succeeded, failed } and data.results, each { id, success, error? }. An impossible US/Canada number (area code or exchange starting 0 or 1) fails only that row, success: false with the error text (no phone_invalid code, no top-level 400), and nothing is saved for that row. This route does not take country: a country-only row fails as a row, and a country sent beside another field is ignored while that field is applied (use conduyt_bulk_edit_contacts for a country; it refuses a null or blank country 400 country_invalid).";
7
9
  export function registerBulkTools(server, client) {
@@ -65,10 +67,12 @@ export function registerBulkTools(server, client) {
65
67
  });
66
68
  return formatResult(result);
67
69
  });
68
- server.tool("conduyt_export_deals", "Export deals as JSON with filtering by status, pipeline, or search term. The API judges the query names first (batch33): a name the export does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and the whole book exported) and two different values of format, search, status, pipeline, value_min / minValue, value_max / maxValue, needsAction or stale 400 query_param_conflict { message, param }, both before the numeric codes; this tool sends only accepted names. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param).", {
70
+ server.tool("conduyt_export_deals", "Export deals as JSON (GET /api/v1/deals/export, owner or admin only: otherwise 403) with the board's filters: search, status, pipeline, assigned_to (user UUIDs or `unassigned`, at most 25 distinct owners), tag_ids (tag UUIDs, ANY match, at most 25), contact_timezone, created_after / created_before (YYYY-MM-DD in the account time zone, day-inclusive, or an ISO datetime with offset), value_min / value_max, needsAction, stale, health (one Pipeline health check). Answer: { deals, meta { total, exported_at, filters_applied } }; Secure custom field values are masked. The whole filtered book is read in one request (not streamed): at most 50,000 rows, past that 413 and nothing is exported (narrow the filters); rate limited to 5 exports a minute per workspace and address (429). Each repeated filter is sent as repeated query parameters, never comma-joined; the owner and tag caps are also checked here, before any request. The API judges the query names first (batch33): a name the export does not read is 400 unknown_query_param { message, unknown[], accepted[], didYouMean } (it used to be ignored and the whole book exported) and two different values of format, search, status, pipeline, value_min / minValue, value_max / maxValue, needsAction or stale 400 query_param_conflict { message, param }, both before the numeric codes; this tool sends only accepted names. The deal value bounds are judged too: value_min / minValue and value_max / maxValue that are non-numeric or outside the deal value column range (-9999999999.99..9999999999.99) are 400 invalid_value_min / invalid_value_max { message, param, accepted } (absent or empty = no filter; an alias spelling answers the same code with the sent spelling in param). TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE + " The export applies the same rule as conduyt_list_deals.", {
69
71
  search: z.string().optional().describe("Search deal titles"),
70
72
  status: z.string().optional().describe("Filter by status (open, won, lost)"),
71
73
  pipeline: z.string().optional().describe("Filter by pipeline UUID"),
74
+ contact_timezone: contactTimezoneSchema,
75
+ ...dealExportFilterShape,
72
76
  }, async (params) => {
73
77
  const qp = new URLSearchParams({ format: "json" });
74
78
  if (params.search)
@@ -77,6 +81,8 @@ export function registerBulkTools(server, client) {
77
81
  qp.set("status", params.status);
78
82
  if (params.pipeline)
79
83
  qp.set("pipeline", params.pipeline);
84
+ appendContactTimezone(qp, params.contact_timezone);
85
+ appendDealExportFilters(qp, params);
80
86
  // Same widened-but-bounded budget as the contacts export.
81
87
  const result = await client.get(`/api/v1/deals/export?${qp}`, {
82
88
  timeoutMs: 120_000,
@@ -150,16 +150,16 @@ export function registerChatTools(server, client) {
150
150
  const result = await client.post(`/api/v1/chat/channels/${channelId}/messages`, { body, ...(idempotencyKey ? { idempotencyKey } : {}) });
151
151
  return formatResult(result);
152
152
  }));
153
- strictInput(server.tool("conduyt_reply_chat_message", "Reply in a Team Chat thread as the API key's user (POST /api/v1/chat/channels/{id}/messages with parentId). parentId must name a live top-level message in that channel. The caller must be a member with communications:create. AI-agent keys are subject to the same six-consecutive-agent-turn cap as a top-level send, and to the same 409 agent_human_required / agents_muted_in_channel refusals (nothing written, do not retry; agents_muted_in_channel = an admin turned \"agents respond here\" off for the channel). (#1213) AI teammates may talk to each other in a thread, bounded: with two consecutive AI posts already (the asker and the answerer), a turn answering an AI teammate's message is refused 409 agent_human_required with reason agent_chain_cap (the same one pause line; the thread waits for a person). A 409 parent_deleted means the parent, its thread or the turn's message was deleted: nothing was written and the turn ended; do not retry. (#1213) While an AI teammate is answering a turn (it holds a running claim) every post must be that turn's reply (its reply:<source> key and claim token, in the source's channel and thread): anything else is refused 409 write_outside_turn, nothing posted. A Grok Bot turn's answer (idempotencyKey turn:<message id>) needs turnToken (409 turn_token_invalid otherwise).", {
153
+ strictInput(server.tool("conduyt_reply_chat_message", "Reply in a Team Chat thread as the API key's user (POST /api/v1/chat/channels/{id}/messages with parentId). parentId must name a live top-level message in that channel. The caller must be a member with communications:create. AI-agent keys are subject to the same six-consecutive-agent-turn cap as a top-level send, and to the same 409 agent_human_required / agents_muted_in_channel refusals (nothing written, do not retry; agents_muted_in_channel = an admin turned \"agents respond here\" off for the channel). (#1213) AI teammates may talk to each other in a thread, bounded: with two consecutive AI posts already (the asker and the answerer), a turn answering an AI teammate's message is refused 409 agent_human_required with reason agent_chain_cap (the same one pause line; the thread waits for a person). A 409 parent_deleted means the parent, its thread or the turn's message was deleted: nothing was written and the turn ended; do not retry. (#1213) While an AI teammate is answering a turn (it holds a running claim) every post must be that turn's reply (its reply:<source> key and claim token, in the source's channel and thread): anything else is refused 409 write_outside_turn, nothing posted. A connector turn's answer (Grok Bot or OpenClaw; idempotencyKey turn:<message id>) needs turnToken (409 turn_token_invalid otherwise).", {
154
154
  channelId: z.string().uuid().describe("Channel UUID"),
155
155
  parentId: z.string().uuid().describe("Top-level message UUID to reply to"),
156
156
  body: z.string().trim().min(1).max(10_000).describe("Reply text"),
157
157
  idempotencyKey: z.string().regex(/^[A-Za-z0-9:_.-]{1,128}$/).optional().describe("Paired AI agent keys only: a key unique per agent and source turn (the listener uses reply:<source message id>). The same key returns the reply already created (200, idempotentReplay: true) instead of posting a second one; a key used in another channel is a 409 idempotency_key_reused. A person's key gets 400."),
158
158
  alsoInChannel: z.boolean().optional().describe("(#684, a person's reply, only while the workspace's thread view is on) true = \"Also send to #channel\": the ONE reply is also shown in the channel (topLevel reads list it with threadReply.reason alsoInChannel); never a second message or notification. Sent only when true. 409 team_chat_threads_off while the thread view is off (nothing posted); an AI teammate never sets it (its first answer already shows in the channel): refused here with claimToken, 400 from the server otherwise"),
159
159
  claimToken: z.string().regex(/^[1-9][0-9]{0,8}:[A-Za-z0-9:_.-]{8,128}$/).optional().describe("Paired AI agent keys only; REQUIRED with idempotencyKey reply:<source message id> (refused otherwise, nothing posted): the listener's claim token <generation>:<listener id> from the turn prompt. The reply completes that turn only when posted in the source's channel and thread with the current generation's token; a reply:<source> reply anywhere else, or with a stale token, is refused 409 (reply_wrong_channel / reply_wrong_thread / reply_stale_claim) with nothing posted, so a corrected retry still completes the turn."),
160
- turnToken: z.string().regex(/^[1-9][0-9]{9,15}\.[0-9a-f]{64}$/).optional().describe("(#1213) an AI teammate answering a Grok Bot turn: the turn's turnToken from its payload; REQUIRED with idempotencyKey turn:<message id> (refused otherwise, nothing posted)"),
160
+ turnToken: z.string().regex(/^[1-9][0-9]{9,15}\.[0-9a-f]{64}$/).optional().describe("(#1213) an AI teammate answering a connector turn (Grok Bot, OpenClaw): the turn's turnToken from its payload; REQUIRED with idempotencyKey turn:<message id> (refused otherwise, nothing posted)"),
161
161
  }, async ({ channelId, parentId, body, idempotencyKey, claimToken, turnToken, alsoInChannel }) => {
162
- // (#1213) a Grok Bot turn's answer always carries the turn's server-minted token
162
+ // (#1213) a connector turn's (Grok Bot, OpenClaw) answer always carries the turn's server-minted token
163
163
  if (!turnToken && typeof idempotencyKey === "string" && /^turn:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(idempotencyKey)) {
164
164
  throw new Error("turnToken is required with an idempotencyKey turn:<message id> (the turn's turnToken from its payload); nothing was posted");
165
165
  }
@@ -185,13 +185,13 @@ export function registerChatTools(server, client) {
185
185
  const out = formatResult(result);
186
186
  return note ? { ...out, content: [...out.content, { type: "text", text: note }] } : out;
187
187
  }));
188
- strictInput(server.tool("conduyt_react_chat_message", "Add a reaction to a Team Chat message as the API key's user (POST /api/v1/chat/channels/{id}/messages/{messageId}/reactions). The server accepts only its Team Chat reaction set and returns the fully hydrated message. Repeating the same reaction is safe and leaves one reaction from this user. (#802, app #655 c) An AI teammate ENDS its turn with a reaction by passing claimToken (the turn prompt's reply claim token): the reaction then completes that turn (outcome reacted) in the same transaction, so the turn needs no reply. React to the turn's message or one in its thread; when it is another message of the thread, pass the turn's message id as sourceMessageId. Exactly one of a reply, a reaction or conduyt_stay_silent ends a turn: a token that is not the running holder's, or a message outside the turn's thread, is refused 409 reaction_stale_claim, and a turn that already ended (a reply, a silence, another reaction) 409 turn_finished with its outcome; nothing is written on either, do not retry. A person's key sending claimToken gets 400. (#1213 r3) While the teammate is answering a turn its only reaction is that turn's (409 write_outside_turn otherwise); a Grok Bot teammate passes its turn's turnToken (and sourceMessageId for another message of the turn's thread).", {
188
+ strictInput(server.tool("conduyt_react_chat_message", "Add a reaction to a Team Chat message as the API key's user (POST /api/v1/chat/channels/{id}/messages/{messageId}/reactions). The server accepts only its Team Chat reaction set and returns the fully hydrated message. Repeating the same reaction is safe and leaves one reaction from this user. (#802, app #655 c) An AI teammate ENDS its turn with a reaction by passing claimToken (the turn prompt's reply claim token): the reaction then completes that turn (outcome reacted) in the same transaction, so the turn needs no reply. React to the turn's message or one in its thread; when it is another message of the thread, pass the turn's message id as sourceMessageId. Exactly one of a reply, a reaction or conduyt_stay_silent ends a turn: a token that is not the running holder's, or a message outside the turn's thread, is refused 409 reaction_stale_claim, and a turn that already ended (a reply, a silence, another reaction) 409 turn_finished with its outcome; nothing is written on either, do not retry. A person's key sending claimToken gets 400. (#1213 r3) While the teammate is answering a turn its only reaction is that turn's (409 write_outside_turn otherwise); a connector teammate (Grok Bot or OpenClaw) passes its turn's turnToken (and sourceMessageId for another message of the turn's thread).", {
189
189
  channelId: z.string().uuid().describe("Channel UUID"),
190
190
  messageId: z.string().uuid().describe("Message UUID"),
191
191
  emoji: z.string().min(1).max(16).describe("One allowed Team Chat emoji"),
192
192
  claimToken: z.string().regex(/^[1-9][0-9]{0,8}:[A-Za-z0-9:_.-]{8,128}$/).optional().describe("Paired AI agent keys only: the turn prompt's reply claim token <generation>:<listener id>; the reaction then ends that turn"),
193
193
  sourceMessageId: z.string().uuid().optional().describe("With claimToken (or turnToken): the turn's message id, when the reaction targets ANOTHER message of its thread (default: the reacted message)"),
194
- turnToken: z.string().regex(/^[1-9][0-9]{9,15}\.[0-9a-f]{64}$/).optional().describe("(#1213 r3) an AI teammate answering a Grok Bot turn: the turn's turnToken from its payload; REQUIRED for that teammate's reaction"),
194
+ turnToken: z.string().regex(/^[1-9][0-9]{9,15}\.[0-9a-f]{64}$/).optional().describe("(#1213 r3) an AI teammate answering a connector turn (Grok Bot, OpenClaw): the turn's turnToken from its payload; REQUIRED for that teammate's reaction"),
195
195
  }, async ({ channelId, messageId, emoji, claimToken, sourceMessageId, turnToken }) => {
196
196
  if (sourceMessageId !== undefined && claimToken === undefined && turnToken === undefined)
197
197
  throw new Error("sourceMessageId needs claimToken or turnToken (it names the turn the reaction belongs to); nothing was sent");
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ /** (parity36, #1312 tzfilter) GET /deals and GET /deals/export accept the repeatable query parameter contact_timezone (the linked contact's time zone). */
3
+ export declare const MAX_CONTACT_TIMEZONE_VALUES = 25;
4
+ export declare const TIMEZONE_GROUP_WORDS: readonly ["eastern", "central", "mountain", "pacific", "alaska", "hawaii"];
5
+ export declare const CONTACT_TIMEZONE_NOTE = "contact_timezone (repeatable: pass an array, each value is sent as its own repeated query parameter, deals matching ANY value) filters by the linked (primary) contact's time zone. A value is one of the group words eastern, central, mountain, pacific, alaska, hawaii (the US zones; each stands for a fixed list of IANA ids: America/Detroit is eastern, America/Boise and America/Phoenix are mountain, America/Adak is hawaii), the word unknown (the deal has no linked contact, its contact is deleted, or its contact has no time zone), or one IANA id (America/Toronto). Group words and unknown are case-insensitive. At most 25 distinct values (more is refused locally before any request, with the API's wording, and is a 400 on the server); a value that is none of the above or not a recognized IANA zone is a 400 from the API, which judges it (this tool does not keep a zone list). A blank value is no filter. Combines with every other filter (AND).";
6
+ export declare const contactTimezoneSchema: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
7
+ /** appends every value as its own contact_timezone parameter (never comma-joined); throws the API's cap wording past 25 distinct values */
8
+ export declare function appendContactTimezone(params: URLSearchParams, value: string | string[] | undefined): void;
@@ -0,0 +1,49 @@
1
+ import { z } from "zod";
2
+ /** (parity36, #1312 tzfilter) GET /deals and GET /deals/export accept the repeatable query parameter contact_timezone (the linked contact's time zone). */
3
+ export const MAX_CONTACT_TIMEZONE_VALUES = 25;
4
+ export const TIMEZONE_GROUP_WORDS = ["eastern", "central", "mountain", "pacific", "alaska", "hawaii"];
5
+ export const CONTACT_TIMEZONE_NOTE = "contact_timezone (repeatable: pass an array, each value is sent as its own repeated query parameter, deals matching ANY value) filters by the linked (primary) contact's time zone. A value is one of the group words eastern, central, mountain, pacific, alaska, hawaii (the US zones; each stands for a fixed list of IANA ids: America/Detroit is eastern, America/Boise and America/Phoenix are mountain, America/Adak is hawaii), the word unknown (the deal has no linked contact, its contact is deleted, or its contact has no time zone), or one IANA id (America/Toronto). Group words and unknown are case-insensitive. At most 25 distinct values (more is refused locally before any request, with the API's wording, and is a 400 on the server); a value that is none of the above or not a recognized IANA zone is a 400 from the API, which judges it (this tool does not keep a zone list). A blank value is no filter. Combines with every other filter (AND).";
6
+ export const contactTimezoneSchema = z
7
+ .union([z.string(), z.array(z.string())])
8
+ .optional()
9
+ .describe("Contact time zone filter, repeatable (an array sends one repeated contact_timezone query parameter per value; a single string is one value): eastern | central | mountain | pacific | alaska | hawaii | unknown | an IANA id such as America/Toronto, deals matching ANY value; at most 25 distinct values.");
10
+ /** the server's IANA check (conduyt-app lib/contact-timezone.ts normalizeIanaTimezone, the runtime's own Intl time zone support: no list is kept here): at most 64 characters of the zone-id alphabet that Intl resolves. A POSIX spelling the app maps first (its canonicalTimeZone) that Intl does not know reads as malformed here, which can only UNDER-count, never refuse a request the API accepts */
11
+ function isRecognizedIana(v) {
12
+ if (v.length > 64 || !/^[A-Za-z][A-Za-z0-9_+\-/]*$/.test(v))
13
+ return false;
14
+ try {
15
+ new Intl.DateTimeFormat("en-US", { timeZone: v });
16
+ return true;
17
+ }
18
+ catch {
19
+ return false;
20
+ }
21
+ }
22
+ /** the distinct values the API COUNTS (lib/deal-filter-params.ts parseContactTimezoneParam): comma lists split and trimmed, blanks dropped, group words and unknown folded to lower case, an IANA id kept as given, repeats collapsed; a value that is none of those and not a recognized IANA id is excluded from the count (the API reports it as its own 400, so it is still forwarded) */
23
+ function distinctContactTimezones(values) {
24
+ const seen = new Set();
25
+ for (const raw of values) {
26
+ for (const part of raw.split(",")) {
27
+ const v = part.trim();
28
+ if (!v)
29
+ continue;
30
+ const lower = v.toLowerCase();
31
+ if (lower === "unknown" || TIMEZONE_GROUP_WORDS.includes(lower))
32
+ seen.add(lower);
33
+ else if (isRecognizedIana(v))
34
+ seen.add(v);
35
+ }
36
+ }
37
+ return seen.size;
38
+ }
39
+ /** appends every value as its own contact_timezone parameter (never comma-joined); throws the API's cap wording past 25 distinct values */
40
+ export function appendContactTimezone(params, value) {
41
+ if (value === undefined)
42
+ return;
43
+ const values = Array.isArray(value) ? value : [value];
44
+ const n = distinctContactTimezones(values);
45
+ if (n > MAX_CONTACT_TIMEZONE_VALUES)
46
+ throw new Error(`contact_timezone accepts at most ${MAX_CONTACT_TIMEZONE_VALUES} values; got ${n}.`);
47
+ for (const v of values)
48
+ params.append("contact_timezone", v);
49
+ }
@@ -169,7 +169,7 @@ export function registerContactTools(server, client) {
169
169
  const result = await client.get(`/api/v1/contacts/count?${params}`);
170
170
  return formatResult(result);
171
171
  });
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")));
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 an IANA string or, for the US zones, a group word (eastern, central, mountain, pacific, alaska, hawaii) or unknown (#1312; see the note below). " + TIMEZONE_FILTER_NOTE, {}, async () => formatResult(await client.get("/api/v1/contacts/timezones")));
173
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, {
174
174
  id: z.string().describe("Contact UUID"),
175
175
  }, async ({ id }) => {
@@ -0,0 +1,60 @@
1
+ /** (dealsviews) the deal export filters and the saved deal view tools' shared pieces: GET /deals/export, GET|POST /deals/views, GET|PATCH|DELETE /deals/views/{id}. */
2
+ import { z } from "zod";
3
+ /** the caps the API applies (conduyt-app lib/deal-filter-params.ts MAX_OWNER_FILTERS / MAX_TAG_FILTERS) */
4
+ export declare const MAX_OWNER_FILTERS = 25;
5
+ export declare const MAX_TAG_FILTERS = 25;
6
+ /** the extra GET /deals/export filters (the board's), beside search / status / pipeline / contact_timezone which the tool already had */
7
+ export declare const dealExportFilterShape: {
8
+ assigned_to: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
9
+ tag_ids: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
10
+ created_after: z.ZodOptional<z.ZodString>;
11
+ created_before: z.ZodOptional<z.ZodString>;
12
+ value_min: z.ZodOptional<z.ZodNumber>;
13
+ value_max: z.ZodOptional<z.ZodNumber>;
14
+ needsAction: z.ZodOptional<z.ZodBoolean>;
15
+ stale: z.ZodOptional<z.ZodBoolean>;
16
+ health: z.ZodOptional<z.ZodString>;
17
+ };
18
+ type ExportFilters = {
19
+ assigned_to?: string | string[];
20
+ tag_ids?: string | string[];
21
+ created_after?: string;
22
+ created_before?: string;
23
+ value_min?: number;
24
+ value_max?: number;
25
+ needsAction?: boolean;
26
+ stale?: boolean;
27
+ health?: string;
28
+ };
29
+ /** appends the extra export filters; throws the API's cap wording past a cap (owners count DISTINCT UUIDs, tags count every entry, as the API does) */
30
+ export declare function appendDealExportFilters(qp: URLSearchParams, p: ExportFilters): void;
31
+ export declare const DEAL_VIEW_RULES_DOC = "A view's `filters` is a flat ARRAY of rules { field, operator, value } that are ANDed; value is always a STRING (a comma-separated list for operator in; every rule carries a value: send \"\" for is_empty / is_not_empty). Fields and operators: title, status, priority, currency, lostReason (equals, not_equals, contains, not_contains, starts_with, in, is_empty, is_not_empty); value (equals, not_equals, gt, gte, lt, lte, is_empty, is_not_empty; a plain number); pipelineId, stageId, assignedTo, contactId, companyId (UUIDs; equals, not_equals, in, is_empty, is_not_empty); createdAt, updatedAt, expectedCloseDate, wonAt, lostAt (within / not_within with a duration like 7d, 24h or 30m; before / after with an ISO calendar date; is_empty, is_not_empty); contactTimezone (the linked contact's time zone; equals, in; each value a group word eastern, central, mountain, pacific, alaska, hawaii, unknown, or an IANA id, the same values as conduyt_list_deals contact_timezone, at most 25 distinct). The API validates every rule and answers 400 with the reason (a custom-field mirror key is 422 mirror_not_filterable).";
32
+ export declare const DEAL_VIEW_AUDIENCE_DOC = "AUDIENCE: an admin or owner creates a SHARED view and must pass members ([{ userId }] for the picked reps, or [] for everyone), else 400 audience_required; any other user creates a PERSONAL view, which has no audience (members on a personal view update is 400 personal_no_audience). Only an admin edits or deletes a shared view; a personal view is its owner's; a system view's name, filters, icon and sort cannot be changed and it cannot be deleted (403).";
33
+ export declare const dealViewFields: {
34
+ name: z.ZodString;
35
+ description: z.ZodOptional<z.ZodString>;
36
+ icon: z.ZodOptional<z.ZodString>;
37
+ filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ field: z.ZodString;
39
+ operator: z.ZodString;
40
+ value: z.ZodString;
41
+ }, "strict", z.ZodTypeAny, {
42
+ value: string;
43
+ field: string;
44
+ operator: string;
45
+ }, {
46
+ value: string;
47
+ field: string;
48
+ operator: string;
49
+ }>, "many">>;
50
+ sortField: z.ZodOptional<z.ZodString>;
51
+ sortOrder: z.ZodOptional<z.ZodEnum<["asc", "desc"]>>;
52
+ members: z.ZodOptional<z.ZodArray<z.ZodObject<{
53
+ userId: z.ZodString;
54
+ }, "strict", z.ZodTypeAny, {
55
+ userId: string;
56
+ }, {
57
+ userId: string;
58
+ }>, "many">>;
59
+ };
60
+ export {};
@@ -0,0 +1,69 @@
1
+ /** (dealsviews) the deal export filters and the saved deal view tools' shared pieces: GET /deals/export, GET|POST /deals/views, GET|PATCH|DELETE /deals/views/{id}. */
2
+ import { z } from "zod";
3
+ /** the caps the API applies (conduyt-app lib/deal-filter-params.ts MAX_OWNER_FILTERS / MAX_TAG_FILTERS) */
4
+ export const MAX_OWNER_FILTERS = 25;
5
+ export const MAX_TAG_FILTERS = 25;
6
+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
7
+ /** the extra GET /deals/export filters (the board's), beside search / status / pipeline / contact_timezone which the tool already had */
8
+ export const dealExportFilterShape = {
9
+ assigned_to: z.union([z.string(), z.array(z.string())]).optional().describe("Only deals owned by these users: a user UUID or `unassigned`, one string or an array (each value is sent as its own repeated assigned_to parameter; a comma list inside a value is read too). ANY of them. At most 25 distinct owners (refused before any request)"),
10
+ tag_ids: z.union([z.string(), z.array(z.string())]).optional().describe("Only deals with one of these tags: tag UUIDs, one string or an array (each value sent as its own repeated tag_ids parameter), ANY match. At most 25 entries (refused before any request)"),
11
+ created_after: z.string().optional().describe("Created on or after this date: YYYY-MM-DD (the account time zone) or a full ISO datetime with offset"),
12
+ created_before: z.string().optional().describe("Created on or before this date (a date-only value is day-inclusive): same forms as created_after"),
13
+ value_min: z.number().optional().describe("Deal value at least this number"),
14
+ value_max: z.number().optional().describe("Deal value at most this number"),
15
+ needsAction: z.boolean().optional().describe("true = only open deals with no next action (the board's needs-next-action filter); false sends nothing"),
16
+ stale: z.boolean().optional().describe("true = only open deals not updated for the board's stale period; false sends nothing"),
17
+ health: z.string().optional().describe("One Pipeline health check: high_value_idle | stale | unassigned | needs_action | missing_close_date | missing_contact (the API validates it: 400 otherwise)"),
18
+ };
19
+ const entries = (v) => (Array.isArray(v) ? v : [v]).flatMap((x) => x.split(",")).map((x) => x.trim()).filter(Boolean);
20
+ /** appends the extra export filters; throws the API's cap wording past a cap (owners count DISTINCT UUIDs, tags count every entry, as the API does) */
21
+ export function appendDealExportFilters(qp, p) {
22
+ for (const [name, v] of [["assigned_to", p.assigned_to], ["tag_ids", p.tag_ids]]) {
23
+ if (v === undefined)
24
+ continue;
25
+ const list = Array.isArray(v) ? v : [v];
26
+ if (name === "assigned_to") {
27
+ const owners = new Set(entries(list).filter((e) => UUID_RE.test(e)));
28
+ if (owners.size > MAX_OWNER_FILTERS)
29
+ throw new Error(`assigned_to accepts at most ${MAX_OWNER_FILTERS} owners; got ${owners.size}.`);
30
+ }
31
+ else {
32
+ const n = entries(list).length;
33
+ if (n > MAX_TAG_FILTERS)
34
+ throw new Error(`tag_ids accepts at most ${MAX_TAG_FILTERS} tags; got ${n}.`);
35
+ }
36
+ for (const x of list)
37
+ qp.append(name, x);
38
+ }
39
+ if (p.created_after)
40
+ qp.set("created_after", p.created_after);
41
+ if (p.created_before)
42
+ qp.set("created_before", p.created_before);
43
+ if (p.value_min !== undefined)
44
+ qp.set("value_min", String(p.value_min));
45
+ if (p.value_max !== undefined)
46
+ qp.set("value_max", String(p.value_max));
47
+ if (p.needsAction === true)
48
+ qp.set("needsAction", "true");
49
+ if (p.stale === true)
50
+ qp.set("stale", "true");
51
+ if (p.health)
52
+ qp.set("health", p.health);
53
+ }
54
+ export const DEAL_VIEW_RULES_DOC = "A view's `filters` is a flat ARRAY of rules { field, operator, value } that are ANDed; value is always a STRING (a comma-separated list for operator in; every rule carries a value: send \"\" for is_empty / is_not_empty). Fields and operators: title, status, priority, currency, lostReason (equals, not_equals, contains, not_contains, starts_with, in, is_empty, is_not_empty); value (equals, not_equals, gt, gte, lt, lte, is_empty, is_not_empty; a plain number); pipelineId, stageId, assignedTo, contactId, companyId (UUIDs; equals, not_equals, in, is_empty, is_not_empty); createdAt, updatedAt, expectedCloseDate, wonAt, lostAt (within / not_within with a duration like 7d, 24h or 30m; before / after with an ISO calendar date; is_empty, is_not_empty); contactTimezone (the linked contact's time zone; equals, in; each value a group word eastern, central, mountain, pacific, alaska, hawaii, unknown, or an IANA id, the same values as conduyt_list_deals contact_timezone, at most 25 distinct). The API validates every rule and answers 400 with the reason (a custom-field mirror key is 422 mirror_not_filterable).";
55
+ export const DEAL_VIEW_AUDIENCE_DOC = "AUDIENCE: an admin or owner creates a SHARED view and must pass members ([{ userId }] for the picked reps, or [] for everyone), else 400 audience_required; any other user creates a PERSONAL view, which has no audience (members on a personal view update is 400 personal_no_audience). Only an admin edits or deletes a shared view; a personal view is its owner's; a system view's name, filters, icon and sort cannot be changed and it cannot be deleted (403).";
56
+ const rule = z.object({
57
+ field: z.string().describe("Rule field, e.g. status, stageId, value, createdAt, contactTimezone (see the tool description for the list)"),
58
+ operator: z.string().describe("Rule operator valid for the field, e.g. equals, in, gt, within"),
59
+ value: z.string().describe("The value, REQUIRED and always a string; a comma-separated list for in; send \"\" for is_empty / is_not_empty (the operators that take no value)"),
60
+ }).strict();
61
+ export const dealViewFields = {
62
+ name: z.string().describe("Display name"),
63
+ description: z.string().optional().describe("Description (an empty string clears it on update)"),
64
+ icon: z.string().optional().describe("Icon id (default briefcase)"),
65
+ filters: z.array(rule).optional().describe("The rules (see the tool description); an update REPLACES all the rules ([] clears them); omitted on create = no rules, every deal"),
66
+ sortField: z.string().optional().describe("Sort field (default createdAt)"),
67
+ sortOrder: z.enum(["asc", "desc"]).optional().describe("Sort direction (default desc)"),
68
+ members: z.array(z.object({ userId: z.string().uuid().describe("User UUID") }).strict()).optional().describe("The audience of a SHARED view: the picked reps, or [] for everyone (see AUDIENCE)"),
69
+ };
@@ -6,6 +6,8 @@ import { formatResult } from "../client.js";
6
6
  import { FORMULA_WRITE_NOTE } from "./formula-fields.js";
7
7
  import { strictInput } from "./strict.js";
8
8
  import { KEEP_PREVIOUS_OWNER_NEEDS_ASSIGNEE } from "./contacts.js";
9
+ import { CONTACT_TIMEZONE_NOTE, appendContactTimezone, contactTimezoneSchema } from "./contact-timezone.js";
10
+ import { DEAL_VIEW_AUDIENCE_DOC, DEAL_VIEW_RULES_DOC, dealViewFields } from "./deal-views.js";
9
11
  // (mirror1292, batch31 #1292 Ship 3) deal MIRROR fields: a write-through view of a contact / company field, named on the deal tools
10
12
  const MIRROR_READ_DOC = " Mirror fields (#1292): a deal custom field created as a MIRROR of a contact / company field answers that record's value in customFields, with mirrorFields[key] = { mirrored: true, source: { entityType, fieldKey }, unresolved? } beside it (unresolved: no_linked_contact | no_linked_company | source_field_missing, value null); a mirror of a Secure source answers the mask \u2022\u2022\u2022\u2022 like the source (passed through untouched).";
11
13
  const MIRROR_WRITE_DOC = " A customFields key that is a deal MIRROR writes the linked contact / company through its own write path (nothing is stored on the deal): 409 mirror_unresolved (no linked record), 409 mirror_relink_conflict (the same request re-links it), 403 mirror_source_not_editable, 422 mirror_source_rejected, 409 mirror_source_changed, 409 mirror_source_conflict (the source's required state changed under the lock), 422 mirror_conflicting_values (two mirror keys of one source field with different values).";
@@ -56,7 +58,7 @@ function boardSnapshotColumns(a, f) {
56
58
  return a.board_columns.map((c) => (c.limit === undefined ? c.stageId : `${c.stageId}:${c.limit}`)).join(",");
57
59
  }
58
60
  export function registerDealTools(server, client) {
59
- 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)." + " " + ROLE_COLUMNS_NOTE, {
61
+ 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, contact_timezone, 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)." + " " + ROLE_COLUMNS_NOTE + " TIME ZONE (#1312): " + CONTACT_TIMEZONE_NOTE, {
60
62
  pipeline: z.string().optional().describe("Filter by pipeline UUID (canonical). Aliases: pipelineId, pipeline_id."),
61
63
  pipelineId: z.string().optional().describe("Filter by pipeline UUID (alias of pipeline)."),
62
64
  pipeline_id: z.string().optional().describe("snake_case alias of pipelineId."),
@@ -70,6 +72,8 @@ export function registerDealTools(server, client) {
70
72
  assignedTo: z.string().optional().describe("Filter by assigned user UUID"),
71
73
  status: z.enum(["open", "won", "lost"]).optional().describe("Filter by deal status"),
72
74
  search: z.string().optional().describe("Search deal titles"),
75
+ contact_timezone: contactTimezoneSchema,
76
+ view_id: z.string().optional().describe("Apply this SAVED DEAL VIEW (a UUID from conduyt_list_deal_views; sent as view_id, the canonical name in the OpenAPI, which also documents the alias viewId): the list is the set the view defines, ANDed with every other filter given here (the API combines them; nothing is resolved by this tool). 404 when the view does not exist, is disabled or is not visible to you; 422 when its stored rules are invalid or unsupported; 400 for a blank or non-UUID id (forwarded as given). Works with health_summary and board_snapshot too."),
73
77
  page: z.number().optional().describe("Page number (default 1)"),
74
78
  per_page: z.number().int().min(1).max(BOARD_SNAPSHOT_MAX_COLUMN_ROWS).optional().describe("Results per page, an integer 1-1000 (server default 50, max 1000; with board_snapshot it is the default rows per column)"),
75
79
  health_summary: z.boolean().optional().describe("true: answer the Pipeline health shape (totalOpenDeals, atRiskValue, checks[], deals) for the filtered set instead of the deal list."),
@@ -125,6 +129,9 @@ export function registerDealTools(server, client) {
125
129
  params.set("status", status);
126
130
  if (search)
127
131
  params.set("search", search);
132
+ appendContactTimezone(params, a.contact_timezone);
133
+ if (a.view_id !== undefined)
134
+ params.set("view_id", a.view_id);
128
135
  if (page)
129
136
  params.set("page", String(page));
130
137
  if (per_page)
@@ -318,8 +325,33 @@ export function registerDealTools(server, client) {
318
325
  const result = await client.post(`/api/v1/deals/${dealId}/tags`, { tagIds });
319
326
  return formatResult(result);
320
327
  });
321
- server.tool("conduyt_list_deal_views", "List the account's SAVED DEAL VIEWS (saved deal segments, e.g. 'Open deals over $10k'), each with its id, name, stored filter rules, and current deal count. Read-only — shows how the account segments its deals.", {}, async () => {
328
+ server.tool("conduyt_list_deal_views", "List the account's SAVED DEAL VIEWS (saved deal segments, e.g. 'Open deals over $10k'), each with its id, name, stored filter rules, and current deal count. Read-only — shows how the account segments its deals. A rule's filter field `contactTimezone` (#1312 tzfilter, the linked contact's time zone) takes operators equals / in (the value is a string: one value for equals, a comma-separated list for in) and each value is a group word (eastern, central, mountain, pacific, alaska, hawaii), unknown, or an IANA id (the same values as conduyt_list_deals contact_timezone; the API validates it and refuses a malformed value or more than 25 distinct values with a 400); a view with that rule is created or edited with conduyt_create_deal_view / conduyt_update_deal_view (POST / PATCH /api/v1/deals/views), read one with conduyt_get_deal_view and removed with conduyt_delete_deal_view.", {}, async () => {
322
329
  const result = await client.get("/api/v1/deals/views");
323
330
  return formatResult(result);
324
331
  });
332
+ strictInput(server.tool("conduyt_get_deal_view", "Get one SAVED DEAL VIEW by id (GET /api/v1/deals/views/{id}): name, description, icon, stored filter rules, sort, isSystem, isEnabled, isPersonal, createdBy and its audience members. Read-only. 404 when it does not exist or you cannot see it. " + DEAL_VIEW_RULES_DOC, { id: z.string().uuid().describe("Deal view UUID") }, async ({ id }) => {
333
+ const result = await client.get(`/api/v1/deals/views/${encodeURIComponent(id)}`);
334
+ return formatResult(result);
335
+ }));
336
+ strictInput(server.tool("conduyt_create_deal_view", "Create a SAVED DEAL VIEW (POST /api/v1/deals/views, the board's saved view tabs; needs deals.edit and active billing). Answers the created view (201). " + DEAL_VIEW_RULES_DOC + " " + DEAL_VIEW_AUDIENCE_DOC, dealViewFields, async (params) => {
337
+ if (params.name.trim() === "")
338
+ throw new Error("name is required.");
339
+ const result = await client.post("/api/v1/deals/views", params);
340
+ return formatResult(result);
341
+ }));
342
+ strictInput(server.tool("conduyt_update_deal_view", "Update a SAVED DEAL VIEW (PATCH /api/v1/deals/views/{id}; needs deals.edit): only the fields you pass change; filters REPLACES all the rules; isEnabled shows or hides the view (switching a shared view on needs an audience: 409 when it has none, so pass members). Answers the updated view. 404 when the view does not exist. " + DEAL_VIEW_RULES_DOC + " " + DEAL_VIEW_AUDIENCE_DOC, {
343
+ id: z.string().uuid().describe("Deal view UUID"),
344
+ ...dealViewFields,
345
+ name: z.string().optional().describe("New display name (not blank)"),
346
+ isEnabled: z.boolean().optional().describe("true = show the view, false = hide it"),
347
+ }, async ({ id, ...updates }) => {
348
+ if (Object.keys(updates).length === 0)
349
+ throw new Error("Nothing to update: pass at least one field.");
350
+ const result = await client.patch(`/api/v1/deals/views/${encodeURIComponent(id)}`, updates);
351
+ return formatResult(result);
352
+ }));
353
+ strictInput(server.tool("conduyt_delete_deal_view", "Delete a SAVED DEAL VIEW (DELETE /api/v1/deals/views/{id}; needs deals.edit). Answers { success: true }. The deals themselves are untouched. A personal view only by its owner, a shared one by admins only; a system view cannot be deleted (403). 404 when the view does not exist. Not undoable.", { id: z.string().uuid().describe("Deal view UUID to delete") }, async ({ id }) => {
354
+ const result = await client.del(`/api/v1/deals/views/${encodeURIComponent(id)}`);
355
+ return formatResult(result);
356
+ }));
325
357
  }
@@ -8,4 +8,4 @@ export declare const OPTION_LABEL_MAX = 200;
8
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
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
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).";
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. A value is an IANA id (an exact case-sensitive match on the stored zone) or, since #1312 tzfilter, a GROUP WORD: eastern, central, mountain, pacific, alaska, hawaii (the US zones, each a fixed list of IANA ids: America/Detroit is eastern, America/Boise and America/Phoenix are mountain, America/Adak is hawaii; group words are case-insensitive and mix freely with IANA ids in is any of) or `unknown` (a contact with no zone). Same operators, same shapes: `is eastern` / `is any of [eastern, central, America/Toronto]`. is not / is none of keep only contacts WITH a zone (a group word there excludes that group; `unknown` in them adds nothing: ask for the unknown ones with is empty or is unknown).";
@@ -8,4 +8,4 @@ export const OPTION_LABEL_MAX = 200;
8
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
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
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).";
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. A value is an IANA id (an exact case-sensitive match on the stored zone) or, since #1312 tzfilter, a GROUP WORD: eastern, central, mountain, pacific, alaska, hawaii (the US zones, each a fixed list of IANA ids: America/Detroit is eastern, America/Boise and America/Phoenix are mountain, America/Adak is hawaii; group words are case-insensitive and mix freely with IANA ids in is any of) or `unknown` (a contact with no zone). Same operators, same shapes: `is eastern` / `is any of [eastern, central, America/Toronto]`. is not / is none of keep only contacts WITH a zone (a group word there excludes that group; `unknown` in them adds nothing: ask for the unknown ones with is empty or is unknown).";
@@ -14,7 +14,7 @@ export declare function serverNormalizeKey(raw: string): string | null;
14
14
  * Returns EVERY normalized candidate (the server takes exactly one; all of them are hidden). */
15
15
  export declare function serverKeyCandidates(text: string): string[];
16
16
  /** the FLOOR: every whitespace-separated token of the input as typed (not an address) of 8 characters or more, in each shape a strip
17
- * of surrounding quotes or brackets, a leading label (key: / key= / Authorization: / Bearer) or trailing punctuation gives it */
17
+ * of surrounding quotes or brackets, a leading label (key: / key= / token: / hook token: / x-openclaw-token: / Authorization: / Bearer) or trailing punctuation gives it */
18
18
  export declare function rawKeyTokens(text: string): string[];
19
19
  /** what to hide for a pasted block (the server's candidates, then the floor) */
20
20
  export declare function secretsInPaste(text: string): string[];
@@ -51,6 +51,10 @@ export function serverKeyCandidates(text) {
51
51
  found.push(m[1]);
52
52
  for (const m of rest.matchAll(/^[ \t]*(?:the\s+)?key\s*[:=][ \t]*["'`]?([^\s"'`]+)/gim))
53
53
  found.push(m[1]);
54
+ // (parity36b, #1137) OpenClaw's step 3 (conduyt-app openclaw1137 873e1abd0 lib/agent-webhook-connect.ts parseOpenClawBlock): the hook token is the
55
+ // token after a line-leading "token:" / "hook token:" / "key:" (the Grok rules above already read key and Bearer); no crsr_ prefix is looked for
56
+ for (const m of rest.matchAll(/^[ \t]*(?:the\s+)?(?:hook\s+token|token)\s*[:=][ \t]*["'`]?([^\s"'`]+)/gim))
57
+ found.push(m[1]);
54
58
  const out = [];
55
59
  for (const c of found) {
56
60
  const k = serverNormalizeKey(c.replace(SERVER_TRAILING_PUNCT_RE, ""));
@@ -60,7 +64,7 @@ export function serverKeyCandidates(text) {
60
64
  return out;
61
65
  }
62
66
  /** the FLOOR: every whitespace-separated token of the input as typed (not an address) of 8 characters or more, in each shape a strip
63
- * of surrounding quotes or brackets, a leading label (key: / key= / Authorization: / Bearer) or trailing punctuation gives it */
67
+ * of surrounding quotes or brackets, a leading label (key: / key= / token: / hook token: / x-openclaw-token: / Authorization: / Bearer) or trailing punctuation gives it */
64
68
  export function rawKeyTokens(text) {
65
69
  const out = new Set();
66
70
  const add = (t) => { if (t.length >= 8 && !/^https?:\/\//i.test(t))
@@ -69,7 +73,7 @@ export function rawKeyTokens(text) {
69
73
  const shapes = [tok];
70
74
  for (let i = 0; i < 3; i++) {
71
75
  for (const t of [...shapes]) {
72
- shapes.push(t.replace(/^["'`<(\[{]+|["'`>)\]}]+$/g, ""), t.replace(SERVER_TRAILING_PUNCT_RE, ""), t.replace(/^(?:key\s*[:=]|authorization\s*:|bearer\s*:?)/i, ""));
76
+ shapes.push(t.replace(/^["'`<(\[{]+|["'`>)\]}]+$/g, ""), t.replace(SERVER_TRAILING_PUNCT_RE, ""), t.replace(/^(?:key\s*[:=]|(?:hook\s*token|token)\s*[:=]|x-openclaw-token\s*:|authorization\s*:|bearer\s*:?)/i, ""));
73
77
  }
74
78
  }
75
79
  for (const t of shapes)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt-mcp",
3
- "version": "4.105.27",
3
+ "version": "4.105.30",
4
4
  "mcpName": "com.conduyt/mcp",
5
5
  "description": "MCP server for Conduyt CRM — expose CRM operations as AI-accessible tools",
6
6
  "type": "module",
@@ -1,11 +1,11 @@
1
1
  {
2
- "generatedAt": "2026-11-14T09:05:03.593Z",
3
- "toolCount": 437,
4
- "totalEndpoints": 1212,
2
+ "generatedAt": "2026-11-14T23:17:44.183Z",
3
+ "toolCount": 441,
4
+ "totalEndpoints": 1214,
5
5
  "counts": {
6
- "covered": 386,
7
- "excluded": 372,
8
- "planned": 454,
6
+ "covered": 390,
7
+ "excluded": 374,
8
+ "planned": 450,
9
9
  "uncategorized": 0
10
10
  },
11
11
  "matrix": {
@@ -441,6 +441,10 @@
441
441
  "status": "excluded",
442
442
  "reason": "super-admin platform operations (Conduyt staff only)"
443
443
  },
444
+ "POST /api/v1/admin/external-deletions/calendar-ops/:id/abandon": {
445
+ "status": "excluded",
446
+ "reason": "super-admin platform operations (Conduyt staff only)"
447
+ },
444
448
  "POST /api/v1/admin/external-deletions/calendar-ops/:id/resolve": {
445
449
  "status": "excluded",
446
450
  "reason": "super-admin platform operations (Conduyt staff only)"
@@ -2164,6 +2168,10 @@
2164
2168
  "status": "excluded",
2165
2169
  "reason": "CRON_SECRET-gated infrastructure jobs; never key-callable"
2166
2170
  },
2171
+ "GET /api/v1/cron/process-calendar-by-key": {
2172
+ "status": "excluded",
2173
+ "reason": "CRON_SECRET-gated infrastructure jobs; never key-callable"
2174
+ },
2167
2175
  "GET /api/v1/cron/process-calendar-provider-ops": {
2168
2176
  "status": "excluded",
2169
2177
  "reason": "CRON_SECRET-gated infrastructure jobs; never key-callable"
@@ -2783,20 +2791,28 @@
2783
2791
  ]
2784
2792
  },
2785
2793
  "POST /api/v1/deals/views": {
2786
- "status": "planned",
2787
- "reason": "deal subroutes beyond core CRUD (history, files, links)"
2794
+ "status": "covered",
2795
+ "tools": [
2796
+ "conduyt_create_deal_view"
2797
+ ]
2788
2798
  },
2789
2799
  "GET /api/v1/deals/views/:id": {
2790
- "status": "planned",
2791
- "reason": "deal subroutes beyond core CRUD (history, files, links)"
2800
+ "status": "covered",
2801
+ "tools": [
2802
+ "conduyt_get_deal_view"
2803
+ ]
2792
2804
  },
2793
2805
  "PATCH /api/v1/deals/views/:id": {
2794
- "status": "planned",
2795
- "reason": "deal subroutes beyond core CRUD (history, files, links)"
2806
+ "status": "covered",
2807
+ "tools": [
2808
+ "conduyt_update_deal_view"
2809
+ ]
2796
2810
  },
2797
2811
  "DELETE /api/v1/deals/views/:id": {
2798
- "status": "planned",
2799
- "reason": "deal subroutes beyond core CRUD (history, files, links)"
2812
+ "status": "covered",
2813
+ "tools": [
2814
+ "conduyt_delete_deal_view"
2815
+ ]
2800
2816
  },
2801
2817
  "GET /api/v1/dialer/agent-statuses": {
2802
2818
  "status": "covered",