lkpgestao-mcp 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +507 -67
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -176,8 +176,8 @@ var LkpClient = class {
|
|
|
176
176
|
get(path, query) {
|
|
177
177
|
return this.request("GET", path, { query });
|
|
178
178
|
}
|
|
179
|
-
post(path, body) {
|
|
180
|
-
return this.request("POST", path, { body });
|
|
179
|
+
post(path, body, extraHeaders) {
|
|
180
|
+
return this.request("POST", path, { body, extraHeaders });
|
|
181
181
|
}
|
|
182
182
|
patch(path, body) {
|
|
183
183
|
return this.request("PATCH", path, { body });
|
|
@@ -200,6 +200,11 @@ var LkpClient = class {
|
|
|
200
200
|
headers["Content-Type"] = "application/json";
|
|
201
201
|
bodyStr = JSON.stringify(opts.body);
|
|
202
202
|
}
|
|
203
|
+
if (opts.extraHeaders) {
|
|
204
|
+
for (const [k, v] of Object.entries(opts.extraHeaders)) {
|
|
205
|
+
headers[k] = v;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
203
208
|
const maxAttempts = this.retryAttempts + 1;
|
|
204
209
|
let retriedOn429 = false;
|
|
205
210
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
@@ -908,8 +913,397 @@ function registerOpportunities(server, client, logger) {
|
|
|
908
913
|
);
|
|
909
914
|
}
|
|
910
915
|
|
|
911
|
-
// src/tools/
|
|
916
|
+
// src/tools/quotes.ts
|
|
912
917
|
import { z as z6 } from "zod";
|
|
918
|
+
var QuoteStatus = z6.enum([
|
|
919
|
+
"DRAFT",
|
|
920
|
+
"SENT",
|
|
921
|
+
"ACCEPTED",
|
|
922
|
+
"REJECTED",
|
|
923
|
+
"EXPIRED",
|
|
924
|
+
"SUPERSEDED"
|
|
925
|
+
]);
|
|
926
|
+
var Currency = z6.enum(["BRL", "USD", "EUR"]);
|
|
927
|
+
var BillingModel = z6.enum([
|
|
928
|
+
"milestone",
|
|
929
|
+
"installment",
|
|
930
|
+
"measurement",
|
|
931
|
+
"subscription"
|
|
932
|
+
]);
|
|
933
|
+
var DiscountType = z6.enum(["PERCENT", "VALUE"]);
|
|
934
|
+
var BillingCadence = z6.enum(["monthly", "quarterly", "annual"]);
|
|
935
|
+
var QuoteItemInput = z6.object({
|
|
936
|
+
description: z6.string().min(1),
|
|
937
|
+
specialty_id: z6.coerce.number().int().positive(),
|
|
938
|
+
sold_hours: z6.coerce.number().positive(),
|
|
939
|
+
hourly_rate: z6.coerce.number().nonnegative(),
|
|
940
|
+
discount_type: DiscountType.optional(),
|
|
941
|
+
discount_value: z6.coerce.number().nonnegative().optional(),
|
|
942
|
+
notes: z6.string().optional()
|
|
943
|
+
});
|
|
944
|
+
var PaymentMilestoneInput = z6.object({
|
|
945
|
+
description: z6.string().min(1),
|
|
946
|
+
due_date: z6.string().optional(),
|
|
947
|
+
percentage: z6.coerce.number().min(0).max(100).optional(),
|
|
948
|
+
amount: z6.coerce.number().nonnegative().optional(),
|
|
949
|
+
sequence: z6.coerce.number().int().nonnegative().optional()
|
|
950
|
+
});
|
|
951
|
+
function registerQuotes(server, client, logger) {
|
|
952
|
+
server.registerTool(
|
|
953
|
+
"lkp_quotes_list",
|
|
954
|
+
{
|
|
955
|
+
title: "List quotes",
|
|
956
|
+
description: "List quotes (proposals) across all opportunities with filters. Returns code (QT-YYYY-NNNN), version, status, currency, billing_model, total, valid_until, sent_at, accepted_at. Status values: DRAFT | SENT | ACCEPTED | REJECTED | EXPIRED | SUPERSEDED. Use for quote portfolio review; scope to a specific opportunity with lkp_opportunity_quotes_list.",
|
|
957
|
+
inputSchema: {
|
|
958
|
+
status: QuoteStatus.optional(),
|
|
959
|
+
opportunity_id: z6.coerce.number().int().positive().optional(),
|
|
960
|
+
client_id: z6.coerce.number().int().positive().optional(),
|
|
961
|
+
account_manager_id: z6.coerce.number().int().positive().optional(),
|
|
962
|
+
billing_model: BillingModel.optional(),
|
|
963
|
+
valid_until_before: z6.string().optional(),
|
|
964
|
+
search: z6.string().optional(),
|
|
965
|
+
page: z6.coerce.number().int().positive().optional(),
|
|
966
|
+
per_page: z6.coerce.number().int().positive().max(200).default(20)
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
async (args) => runTool(
|
|
970
|
+
logger,
|
|
971
|
+
"lkp_quotes_list",
|
|
972
|
+
() => client.get("/api/v1/quotes", args)
|
|
973
|
+
)
|
|
974
|
+
);
|
|
975
|
+
server.registerTool(
|
|
976
|
+
"lkp_quote_detail",
|
|
977
|
+
{
|
|
978
|
+
title: "Quote detail",
|
|
979
|
+
description: "Full quote detail: parent fields (version, status, totals, discount, valid_until, timestamps) plus embedded items[] and payment_milestones[]. Use before any write on a quote (send, accept, update, item/milestone mutation) to verify current state and avoid stale edits. Returns 404 when id is unknown.",
|
|
980
|
+
inputSchema: {
|
|
981
|
+
quote_id: z6.coerce.number().int().positive()
|
|
982
|
+
}
|
|
983
|
+
},
|
|
984
|
+
async ({ quote_id }) => runTool(
|
|
985
|
+
logger,
|
|
986
|
+
"lkp_quote_detail",
|
|
987
|
+
() => client.get(`/api/v1/quotes/${quote_id}`)
|
|
988
|
+
)
|
|
989
|
+
);
|
|
990
|
+
server.registerTool(
|
|
991
|
+
"lkp_opportunity_quotes_list",
|
|
992
|
+
{
|
|
993
|
+
title: "List quotes on an opportunity",
|
|
994
|
+
description: "List every quote (all versions, all statuses) attached to one opportunity, ordered by version desc. Use this before new_version or duplicate so you can pick the right source quote. Children default to active-only.",
|
|
995
|
+
inputSchema: {
|
|
996
|
+
opportunity_id: z6.coerce.number().int().positive(),
|
|
997
|
+
include_inactive: z6.coerce.boolean().optional()
|
|
998
|
+
}
|
|
999
|
+
},
|
|
1000
|
+
async ({ opportunity_id, include_inactive }) => runTool(
|
|
1001
|
+
logger,
|
|
1002
|
+
"lkp_opportunity_quotes_list",
|
|
1003
|
+
() => client.get(
|
|
1004
|
+
`/api/v1/opportunities/${opportunity_id}/quotes`,
|
|
1005
|
+
{ include_inactive }
|
|
1006
|
+
)
|
|
1007
|
+
)
|
|
1008
|
+
);
|
|
1009
|
+
server.registerTool(
|
|
1010
|
+
"lkp_quote_create",
|
|
1011
|
+
{
|
|
1012
|
+
title: "Create quote (write)",
|
|
1013
|
+
description: "Create a new DRAFT quote under an opportunity. items[] and payment_milestones[] can be passed inline on create (recommended) or added later via lkp_quote_item_add / lkp_quote_milestone_add. Each item requires description, specialty_id (numeric; resolve via lkp_resources_list \u2192 specialties[]), sold_hours, hourly_rate. billing_model=subscription requires monthly_amount + contract_months and items[] must be omitted; any other billing_model accepts items[]. Currency defaults to BRL. Version starts at 1; use lkp_quote_new_version to branch later. Summarize the draft (opportunity, items, totals, milestones) and wait for explicit user approval before calling.",
|
|
1014
|
+
inputSchema: {
|
|
1015
|
+
opportunity_id: z6.coerce.number().int().positive(),
|
|
1016
|
+
currency: Currency.optional(),
|
|
1017
|
+
billing_model: BillingModel,
|
|
1018
|
+
billing_cadence: BillingCadence.optional(),
|
|
1019
|
+
valid_until: z6.string().optional(),
|
|
1020
|
+
notes: z6.string().optional(),
|
|
1021
|
+
discount_type: DiscountType.optional(),
|
|
1022
|
+
discount_value: z6.coerce.number().nonnegative().optional(),
|
|
1023
|
+
monthly_amount: z6.coerce.number().nonnegative().optional(),
|
|
1024
|
+
contract_months: z6.coerce.number().int().positive().optional(),
|
|
1025
|
+
items: z6.array(QuoteItemInput).optional(),
|
|
1026
|
+
payment_milestones: z6.array(PaymentMilestoneInput).optional()
|
|
1027
|
+
}
|
|
1028
|
+
},
|
|
1029
|
+
async ({ opportunity_id, ...body }) => runTool(
|
|
1030
|
+
logger,
|
|
1031
|
+
"lkp_quote_create",
|
|
1032
|
+
() => client.post(
|
|
1033
|
+
`/api/v1/opportunities/${opportunity_id}/quotes`,
|
|
1034
|
+
body
|
|
1035
|
+
)
|
|
1036
|
+
)
|
|
1037
|
+
);
|
|
1038
|
+
server.registerTool(
|
|
1039
|
+
"lkp_quote_update",
|
|
1040
|
+
{
|
|
1041
|
+
title: "Update quote (write)",
|
|
1042
|
+
description: "Update whitelisted fields on a quote. Only DRAFT quotes can be freely edited; SENT quotes are locked \u2014 clone via lkp_quote_new_version to change terms. Mutations to items[] or payment_milestones[] must go through the dedicated tools. Setting is_active=false archives the quote (soft-delete, same as lkp_quote_archive). Summarize the diff (field \u2192 old \u2192 new) and wait for user approval before calling.",
|
|
1043
|
+
inputSchema: {
|
|
1044
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1045
|
+
currency: Currency.optional(),
|
|
1046
|
+
billing_model: BillingModel.optional(),
|
|
1047
|
+
billing_cadence: BillingCadence.optional(),
|
|
1048
|
+
valid_until: z6.string().optional(),
|
|
1049
|
+
notes: z6.string().optional(),
|
|
1050
|
+
discount_type: DiscountType.optional(),
|
|
1051
|
+
discount_value: z6.coerce.number().nonnegative().optional(),
|
|
1052
|
+
monthly_amount: z6.coerce.number().nonnegative().optional(),
|
|
1053
|
+
contract_months: z6.coerce.number().int().positive().optional(),
|
|
1054
|
+
is_active: z6.coerce.boolean().optional()
|
|
1055
|
+
}
|
|
1056
|
+
},
|
|
1057
|
+
async ({ quote_id, ...body }) => runTool(
|
|
1058
|
+
logger,
|
|
1059
|
+
"lkp_quote_update",
|
|
1060
|
+
() => client.patch(`/api/v1/quotes/${quote_id}`, body)
|
|
1061
|
+
)
|
|
1062
|
+
);
|
|
1063
|
+
server.registerTool(
|
|
1064
|
+
"lkp_quote_archive",
|
|
1065
|
+
{
|
|
1066
|
+
title: "Archive quote (write)",
|
|
1067
|
+
description: "Soft-archive a quote (is_active=0). Only DRAFT quotes should be archived this way \u2014 if a SENT/ACCEPTED quote needs to be invalidated, use lkp_quote_new_version (which marks the prior version SUPERSEDED) instead. Always ask user approval before calling \u2014 destructive intent.",
|
|
1068
|
+
inputSchema: {
|
|
1069
|
+
quote_id: z6.coerce.number().int().positive()
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
async ({ quote_id }) => runTool(logger, "lkp_quote_archive", async () => {
|
|
1073
|
+
await client.delete(`/api/v1/quotes/${quote_id}`);
|
|
1074
|
+
return { ok: true, archived: true, quote_id };
|
|
1075
|
+
})
|
|
1076
|
+
);
|
|
1077
|
+
server.registerTool(
|
|
1078
|
+
"lkp_quote_send",
|
|
1079
|
+
{
|
|
1080
|
+
title: "Send quote to client (write)",
|
|
1081
|
+
description: "Transition a DRAFT quote to SENT. Moves the parent opportunity to SENT. Locks the quote for direct edits (use lkp_quote_new_version to revise after send). Not reversible without creating a new version. Confirm the customer-facing terms (totals, valid_until, milestones) with the user before invoking.",
|
|
1082
|
+
inputSchema: {
|
|
1083
|
+
quote_id: z6.coerce.number().int().positive()
|
|
1084
|
+
}
|
|
1085
|
+
},
|
|
1086
|
+
async ({ quote_id }) => runTool(
|
|
1087
|
+
logger,
|
|
1088
|
+
"lkp_quote_send",
|
|
1089
|
+
() => client.post(`/api/v1/quotes/${quote_id}/send`, {})
|
|
1090
|
+
)
|
|
1091
|
+
);
|
|
1092
|
+
server.registerTool(
|
|
1093
|
+
"lkp_quote_accept",
|
|
1094
|
+
{
|
|
1095
|
+
title: "Accept quote (write)",
|
|
1096
|
+
description: "Transition a SENT quote to ACCEPTED. Moves the parent opportunity to WON and cascades all sibling quotes on the same opportunity to REJECTED. This is a commercially binding step \u2014 ALWAYS ask for explicit, unambiguous approval from the user (e.g. 'sim, aceitar a QT-XXXX-YYYY'). Never accept a quote on inference or implicit cues. After success, surface the WON transition and the rejected siblings so the user can verify.",
|
|
1097
|
+
inputSchema: {
|
|
1098
|
+
quote_id: z6.coerce.number().int().positive()
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
async ({ quote_id }) => runTool(
|
|
1102
|
+
logger,
|
|
1103
|
+
"lkp_quote_accept",
|
|
1104
|
+
() => client.post(`/api/v1/quotes/${quote_id}/accept`, {})
|
|
1105
|
+
)
|
|
1106
|
+
);
|
|
1107
|
+
server.registerTool(
|
|
1108
|
+
"lkp_quote_reject",
|
|
1109
|
+
{
|
|
1110
|
+
title: "Reject quote (write)",
|
|
1111
|
+
description: "Transition a SENT quote to REJECTED. Always ask the user for the rejection motive before calling \u2014 reason is mandatory (API refuses empty). Reason is user-visible in the opportunity activity log and should summarize the client's stated objection (price, timing, scope, competitor, etc.).",
|
|
1112
|
+
inputSchema: {
|
|
1113
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1114
|
+
reason: z6.string().min(1).max(200)
|
|
1115
|
+
}
|
|
1116
|
+
},
|
|
1117
|
+
async ({ quote_id, reason }) => runTool(
|
|
1118
|
+
logger,
|
|
1119
|
+
"lkp_quote_reject",
|
|
1120
|
+
() => client.post(`/api/v1/quotes/${quote_id}/reject`, { reason })
|
|
1121
|
+
)
|
|
1122
|
+
);
|
|
1123
|
+
server.registerTool(
|
|
1124
|
+
"lkp_quote_new_version",
|
|
1125
|
+
{
|
|
1126
|
+
title: "Create new version of quote (write)",
|
|
1127
|
+
description: "Clone a quote (any status) into a new DRAFT with version = prior + 1. The prior version is marked SUPERSEDED. Use this to revise terms after a SENT quote (direct edits are blocked). items[] and payment_milestones[] are copied; edit them on the new draft via the dedicated tools. Confirm the intent with the user \u2014 this creates a new artifact and may need to be re-sent.",
|
|
1128
|
+
inputSchema: {
|
|
1129
|
+
quote_id: z6.coerce.number().int().positive()
|
|
1130
|
+
}
|
|
1131
|
+
},
|
|
1132
|
+
async ({ quote_id }) => runTool(
|
|
1133
|
+
logger,
|
|
1134
|
+
"lkp_quote_new_version",
|
|
1135
|
+
() => client.post(`/api/v1/quotes/${quote_id}/new-version`, {})
|
|
1136
|
+
)
|
|
1137
|
+
);
|
|
1138
|
+
server.registerTool(
|
|
1139
|
+
"lkp_quote_duplicate",
|
|
1140
|
+
{
|
|
1141
|
+
title: "Duplicate quote to another opportunity (write)",
|
|
1142
|
+
description: "Copy a quote (including items and payment_milestones) to a DIFFERENT opportunity as a new DRAFT (version 1). Use for reusing a negotiated proposal with a similar client. Confirm the target opportunity with the user before calling \u2014 summarize opportunity name and client so the user can verify.",
|
|
1143
|
+
inputSchema: {
|
|
1144
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1145
|
+
target_opportunity_id: z6.coerce.number().int().positive()
|
|
1146
|
+
}
|
|
1147
|
+
},
|
|
1148
|
+
async ({ quote_id, target_opportunity_id }) => runTool(
|
|
1149
|
+
logger,
|
|
1150
|
+
"lkp_quote_duplicate",
|
|
1151
|
+
() => client.post(`/api/v1/quotes/${quote_id}/duplicate`, {
|
|
1152
|
+
target_opportunity_id
|
|
1153
|
+
})
|
|
1154
|
+
)
|
|
1155
|
+
);
|
|
1156
|
+
server.registerTool(
|
|
1157
|
+
"lkp_quote_item_add",
|
|
1158
|
+
{
|
|
1159
|
+
title: "Add item to quote (write)",
|
|
1160
|
+
description: "Append a new line item to a DRAFT quote. Blocked on SENT/ACCEPTED/REJECTED/SUPERSEDED \u2014 create a new version first. specialty_id is numeric and maps to the specialties catalog (resolve via lkp_resources_list \u2192 specialties[]). discount_type values: PERCENT | VALUE. Summarize the line (description, sold_hours \xD7 hourly_rate, discount) and wait for user approval.",
|
|
1161
|
+
inputSchema: {
|
|
1162
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1163
|
+
description: z6.string().min(1),
|
|
1164
|
+
specialty_id: z6.coerce.number().int().positive(),
|
|
1165
|
+
sold_hours: z6.coerce.number().positive(),
|
|
1166
|
+
hourly_rate: z6.coerce.number().nonnegative(),
|
|
1167
|
+
discount_type: DiscountType.optional(),
|
|
1168
|
+
discount_value: z6.coerce.number().nonnegative().optional(),
|
|
1169
|
+
notes: z6.string().optional()
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
async ({ quote_id, ...body }) => runTool(
|
|
1173
|
+
logger,
|
|
1174
|
+
"lkp_quote_item_add",
|
|
1175
|
+
() => client.post(`/api/v1/quotes/${quote_id}/items`, body)
|
|
1176
|
+
)
|
|
1177
|
+
);
|
|
1178
|
+
server.registerTool(
|
|
1179
|
+
"lkp_quote_item_update",
|
|
1180
|
+
{
|
|
1181
|
+
title: "Update quote item (write)",
|
|
1182
|
+
description: "Update whitelisted fields on a line item of a DRAFT quote. Blocked when the parent quote is not DRAFT. specialty_id is numeric (resolve via lkp_resources_list \u2192 specialties[]). Summarize the diff (field \u2192 old \u2192 new) and wait for user approval.",
|
|
1183
|
+
inputSchema: {
|
|
1184
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1185
|
+
item_id: z6.coerce.number().int().positive(),
|
|
1186
|
+
description: z6.string().optional(),
|
|
1187
|
+
specialty_id: z6.coerce.number().int().positive().optional(),
|
|
1188
|
+
sold_hours: z6.coerce.number().positive().optional(),
|
|
1189
|
+
hourly_rate: z6.coerce.number().nonnegative().optional(),
|
|
1190
|
+
discount_type: DiscountType.optional(),
|
|
1191
|
+
discount_value: z6.coerce.number().nonnegative().optional(),
|
|
1192
|
+
notes: z6.string().optional()
|
|
1193
|
+
}
|
|
1194
|
+
},
|
|
1195
|
+
async ({ quote_id, item_id, ...body }) => runTool(
|
|
1196
|
+
logger,
|
|
1197
|
+
"lkp_quote_item_update",
|
|
1198
|
+
() => client.patch(
|
|
1199
|
+
`/api/v1/quotes/${quote_id}/items/${item_id}`,
|
|
1200
|
+
body
|
|
1201
|
+
)
|
|
1202
|
+
)
|
|
1203
|
+
);
|
|
1204
|
+
server.registerTool(
|
|
1205
|
+
"lkp_quote_item_delete",
|
|
1206
|
+
{
|
|
1207
|
+
title: "Delete quote item (write)",
|
|
1208
|
+
description: "Remove a line item from a DRAFT quote. Blocked when the parent quote is not DRAFT. Always ask user approval before calling.",
|
|
1209
|
+
inputSchema: {
|
|
1210
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1211
|
+
item_id: z6.coerce.number().int().positive()
|
|
1212
|
+
}
|
|
1213
|
+
},
|
|
1214
|
+
async ({ quote_id, item_id }) => runTool(logger, "lkp_quote_item_delete", async () => {
|
|
1215
|
+
await client.delete(`/api/v1/quotes/${quote_id}/items/${item_id}`);
|
|
1216
|
+
return { ok: true, deleted: true, quote_id, item_id };
|
|
1217
|
+
})
|
|
1218
|
+
);
|
|
1219
|
+
server.registerTool(
|
|
1220
|
+
"lkp_quote_milestones_replace",
|
|
1221
|
+
{
|
|
1222
|
+
title: "Replace all payment milestones (write)",
|
|
1223
|
+
description: "Replace the entire payment_milestones[] collection on a DRAFT quote in a single atomic call. Use when the schedule needs a full rewrite (e.g. switching 3 milestones to 5). Any existing milestones are deleted and the new set is inserted. Sent as POST with X-HTTP-Method-Override: PUT header. Summarize the new schedule (percentages/amounts summing correctly) and wait for user approval before calling.",
|
|
1224
|
+
inputSchema: {
|
|
1225
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1226
|
+
milestones: z6.array(PaymentMilestoneInput).min(1)
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1229
|
+
async ({ quote_id, milestones }) => runTool(
|
|
1230
|
+
logger,
|
|
1231
|
+
"lkp_quote_milestones_replace",
|
|
1232
|
+
() => client.post(
|
|
1233
|
+
`/api/v1/quotes/${quote_id}/payment-milestones`,
|
|
1234
|
+
{ milestones },
|
|
1235
|
+
{ "X-HTTP-Method-Override": "PUT" }
|
|
1236
|
+
)
|
|
1237
|
+
)
|
|
1238
|
+
);
|
|
1239
|
+
server.registerTool(
|
|
1240
|
+
"lkp_quote_milestone_add",
|
|
1241
|
+
{
|
|
1242
|
+
title: "Add payment milestone (write)",
|
|
1243
|
+
description: "Append a single payment milestone to a DRAFT quote (additive; does not touch existing milestones). Use replace when rewriting the entire schedule. Summarize (description, due_date, percentage or amount) and wait for user approval.",
|
|
1244
|
+
inputSchema: {
|
|
1245
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1246
|
+
description: z6.string().min(1),
|
|
1247
|
+
due_date: z6.string().optional(),
|
|
1248
|
+
percentage: z6.coerce.number().min(0).max(100).optional(),
|
|
1249
|
+
amount: z6.coerce.number().nonnegative().optional(),
|
|
1250
|
+
sequence: z6.coerce.number().int().nonnegative().optional()
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
async ({ quote_id, ...body }) => runTool(
|
|
1254
|
+
logger,
|
|
1255
|
+
"lkp_quote_milestone_add",
|
|
1256
|
+
() => client.post(
|
|
1257
|
+
`/api/v1/quotes/${quote_id}/payment-milestones`,
|
|
1258
|
+
body
|
|
1259
|
+
)
|
|
1260
|
+
)
|
|
1261
|
+
);
|
|
1262
|
+
server.registerTool(
|
|
1263
|
+
"lkp_quote_milestone_update",
|
|
1264
|
+
{
|
|
1265
|
+
title: "Update payment milestone (write)",
|
|
1266
|
+
description: "Update whitelisted fields on a payment milestone of a DRAFT quote. Blocked when the parent quote is not DRAFT. Summarize the diff and wait for user approval.",
|
|
1267
|
+
inputSchema: {
|
|
1268
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1269
|
+
milestone_id: z6.coerce.number().int().positive(),
|
|
1270
|
+
description: z6.string().optional(),
|
|
1271
|
+
due_date: z6.string().optional(),
|
|
1272
|
+
percentage: z6.coerce.number().min(0).max(100).optional(),
|
|
1273
|
+
amount: z6.coerce.number().nonnegative().optional(),
|
|
1274
|
+
sequence: z6.coerce.number().int().nonnegative().optional()
|
|
1275
|
+
}
|
|
1276
|
+
},
|
|
1277
|
+
async ({ quote_id, milestone_id, ...body }) => runTool(
|
|
1278
|
+
logger,
|
|
1279
|
+
"lkp_quote_milestone_update",
|
|
1280
|
+
() => client.patch(
|
|
1281
|
+
`/api/v1/quotes/${quote_id}/payment-milestones/${milestone_id}`,
|
|
1282
|
+
body
|
|
1283
|
+
)
|
|
1284
|
+
)
|
|
1285
|
+
);
|
|
1286
|
+
server.registerTool(
|
|
1287
|
+
"lkp_quote_milestone_delete",
|
|
1288
|
+
{
|
|
1289
|
+
title: "Delete payment milestone (write)",
|
|
1290
|
+
description: "Remove one payment milestone from a DRAFT quote. Blocked when the parent quote is not DRAFT. Always ask user approval before calling.",
|
|
1291
|
+
inputSchema: {
|
|
1292
|
+
quote_id: z6.coerce.number().int().positive(),
|
|
1293
|
+
milestone_id: z6.coerce.number().int().positive()
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1296
|
+
async ({ quote_id, milestone_id }) => runTool(logger, "lkp_quote_milestone_delete", async () => {
|
|
1297
|
+
await client.delete(
|
|
1298
|
+
`/api/v1/quotes/${quote_id}/payment-milestones/${milestone_id}`
|
|
1299
|
+
);
|
|
1300
|
+
return { ok: true, deleted: true, quote_id, milestone_id };
|
|
1301
|
+
})
|
|
1302
|
+
);
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
// src/tools/clients.ts
|
|
1306
|
+
import { z as z7 } from "zod";
|
|
913
1307
|
function registerClients(server, client, logger) {
|
|
914
1308
|
server.registerTool(
|
|
915
1309
|
"lkp_clients_list",
|
|
@@ -917,11 +1311,11 @@ function registerClients(server, client, logger) {
|
|
|
917
1311
|
title: "List clients",
|
|
918
1312
|
description: "List clients (hierarchical). Returns active project count, B1 codes count, account manager, price list. Use to find clients by name/doc or explore the portfolio.",
|
|
919
1313
|
inputSchema: {
|
|
920
|
-
status:
|
|
921
|
-
parent_client_id:
|
|
922
|
-
search:
|
|
923
|
-
page:
|
|
924
|
-
per_page:
|
|
1314
|
+
status: z7.string().optional(),
|
|
1315
|
+
parent_client_id: z7.coerce.number().int().positive().optional(),
|
|
1316
|
+
search: z7.string().optional(),
|
|
1317
|
+
page: z7.coerce.number().int().positive().optional(),
|
|
1318
|
+
per_page: z7.coerce.number().int().positive().max(200).default(20)
|
|
925
1319
|
}
|
|
926
1320
|
},
|
|
927
1321
|
async (args) => runTool(
|
|
@@ -936,7 +1330,7 @@ function registerClients(server, client, logger) {
|
|
|
936
1330
|
title: "Client detail",
|
|
937
1331
|
description: "Full client detail including all projects (active + inactive), all B1 codes, and stats.",
|
|
938
1332
|
inputSchema: {
|
|
939
|
-
client_id:
|
|
1333
|
+
client_id: z7.coerce.number().int().positive()
|
|
940
1334
|
}
|
|
941
1335
|
},
|
|
942
1336
|
async ({ client_id }) => runTool(
|
|
@@ -948,7 +1342,7 @@ function registerClients(server, client, logger) {
|
|
|
948
1342
|
}
|
|
949
1343
|
|
|
950
1344
|
// src/tools/helpdesk.ts
|
|
951
|
-
import { z as
|
|
1345
|
+
import { z as z8 } from "zod";
|
|
952
1346
|
function registerHelpdesk(server, client, logger) {
|
|
953
1347
|
server.registerTool(
|
|
954
1348
|
"lkp_helpdesk_tickets_list",
|
|
@@ -956,16 +1350,16 @@ function registerHelpdesk(server, client, logger) {
|
|
|
956
1350
|
title: "List helpdesk tickets",
|
|
957
1351
|
description: "List helpdesk tickets with filters. Returns SLA status (response/resolution deadlines, breach flags), priority, category, tags. Use for triage and to find tickets exceeding SLA.",
|
|
958
1352
|
inputSchema: {
|
|
959
|
-
status_id:
|
|
960
|
-
priority:
|
|
961
|
-
client_id:
|
|
962
|
-
assigned_to:
|
|
963
|
-
category_id:
|
|
964
|
-
sla_breached:
|
|
965
|
-
is_open:
|
|
966
|
-
search:
|
|
967
|
-
page:
|
|
968
|
-
per_page:
|
|
1353
|
+
status_id: z8.coerce.number().int().positive().optional(),
|
|
1354
|
+
priority: z8.string().optional(),
|
|
1355
|
+
client_id: z8.coerce.number().int().positive().optional(),
|
|
1356
|
+
assigned_to: z8.coerce.number().int().positive().optional(),
|
|
1357
|
+
category_id: z8.coerce.number().int().positive().optional(),
|
|
1358
|
+
sla_breached: z8.coerce.boolean().optional(),
|
|
1359
|
+
is_open: z8.coerce.boolean().optional(),
|
|
1360
|
+
search: z8.string().optional(),
|
|
1361
|
+
page: z8.coerce.number().int().positive().optional(),
|
|
1362
|
+
per_page: z8.coerce.number().int().positive().max(200).default(20)
|
|
969
1363
|
}
|
|
970
1364
|
},
|
|
971
1365
|
async (args) => runTool(
|
|
@@ -990,7 +1384,7 @@ function registerHelpdesk(server, client, logger) {
|
|
|
990
1384
|
}
|
|
991
1385
|
|
|
992
1386
|
// src/tools/billing.ts
|
|
993
|
-
import { z as
|
|
1387
|
+
import { z as z9 } from "zod";
|
|
994
1388
|
function registerBilling(server, client, logger) {
|
|
995
1389
|
server.registerTool(
|
|
996
1390
|
"lkp_billing_milestones",
|
|
@@ -998,14 +1392,14 @@ function registerBilling(server, client, logger) {
|
|
|
998
1392
|
title: "List billing milestones (legacy)",
|
|
999
1393
|
description: "LEGACY \u2014 returns only project_billing_milestones (one of 3 financial entity types). For a unified view (milestones + measurements + subscription_invoices) use lkp_financial_pending instead. Status lifecycle: pending \u2192 delivered \u2192 in_progress \u2192 invoiced \u2192 paid. Includes joined project and client.",
|
|
1000
1394
|
inputSchema: {
|
|
1001
|
-
status:
|
|
1002
|
-
project_id:
|
|
1003
|
-
client_id:
|
|
1004
|
-
due_from:
|
|
1005
|
-
due_to:
|
|
1006
|
-
include_cancelled:
|
|
1007
|
-
page:
|
|
1008
|
-
per_page:
|
|
1395
|
+
status: z9.string().optional(),
|
|
1396
|
+
project_id: z9.coerce.number().int().positive().optional(),
|
|
1397
|
+
client_id: z9.coerce.number().int().positive().optional(),
|
|
1398
|
+
due_from: z9.string().optional(),
|
|
1399
|
+
due_to: z9.string().optional(),
|
|
1400
|
+
include_cancelled: z9.coerce.boolean().optional(),
|
|
1401
|
+
page: z9.coerce.number().int().positive().optional(),
|
|
1402
|
+
per_page: z9.coerce.number().int().positive().max(200).default(20)
|
|
1009
1403
|
}
|
|
1010
1404
|
},
|
|
1011
1405
|
async (args) => runTool(
|
|
@@ -1017,7 +1411,7 @@ function registerBilling(server, client, logger) {
|
|
|
1017
1411
|
}
|
|
1018
1412
|
|
|
1019
1413
|
// src/tools/alerts.ts
|
|
1020
|
-
import { z as
|
|
1414
|
+
import { z as z10 } from "zod";
|
|
1021
1415
|
function registerAlerts(server, client, logger) {
|
|
1022
1416
|
server.registerTool(
|
|
1023
1417
|
"lkp_alerts",
|
|
@@ -1025,8 +1419,8 @@ function registerAlerts(server, client, logger) {
|
|
|
1025
1419
|
title: "Operational alerts",
|
|
1026
1420
|
description: "Live operational alerts computed on the fly: consultants idle, projects finishing (\u226430d), opportunities stale (\u22657d), billing milestones upcoming (\u226415d) or overdue, helpdesk SLA breaches. Use first thing in the morning and before any strategic decision.",
|
|
1027
1421
|
inputSchema: {
|
|
1028
|
-
severity:
|
|
1029
|
-
type:
|
|
1422
|
+
severity: z10.string().optional(),
|
|
1423
|
+
type: z10.string().optional()
|
|
1030
1424
|
}
|
|
1031
1425
|
},
|
|
1032
1426
|
async (args) => runTool(
|
|
@@ -1038,7 +1432,7 @@ function registerAlerts(server, client, logger) {
|
|
|
1038
1432
|
}
|
|
1039
1433
|
|
|
1040
1434
|
// src/tools/reports.ts
|
|
1041
|
-
import { z as
|
|
1435
|
+
import { z as z11 } from "zod";
|
|
1042
1436
|
function registerReports(server, client, logger) {
|
|
1043
1437
|
server.registerTool(
|
|
1044
1438
|
"lkp_ceo_weekly",
|
|
@@ -1059,9 +1453,9 @@ function registerReports(server, client, logger) {
|
|
|
1059
1453
|
title: "Managers with overdue items",
|
|
1060
1454
|
description: "List managers with overdue items in their projects. Returns two intentionally separate layers: (1) tasks_overdue (operational \u2014 tasks past due_date still not complete) and (2) financial_overdue (milestones / measurements / subscription_invoices past due). Ordered by oldest overdue first. Use when asked 'quem est\xE1 devendo?' or 'quais gerentes precisam de aten\xE7\xE3o?'. The two layers have different natures \u2014 do not sum them; present in separate sections.",
|
|
1061
1455
|
inputSchema: {
|
|
1062
|
-
include_tasks:
|
|
1063
|
-
include_financial:
|
|
1064
|
-
min_days_overdue:
|
|
1456
|
+
include_tasks: z11.coerce.boolean().optional(),
|
|
1457
|
+
include_financial: z11.coerce.boolean().optional(),
|
|
1458
|
+
min_days_overdue: z11.coerce.number().int().min(0).optional()
|
|
1065
1459
|
}
|
|
1066
1460
|
},
|
|
1067
1461
|
async (args) => runTool(
|
|
@@ -1073,7 +1467,7 @@ function registerReports(server, client, logger) {
|
|
|
1073
1467
|
}
|
|
1074
1468
|
|
|
1075
1469
|
// src/tools/financial.ts
|
|
1076
|
-
import { z as
|
|
1470
|
+
import { z as z12 } from "zod";
|
|
1077
1471
|
function registerFinancial(server, client, logger) {
|
|
1078
1472
|
server.registerTool(
|
|
1079
1473
|
"lkp_financial_pending",
|
|
@@ -1081,14 +1475,14 @@ function registerFinancial(server, client, logger) {
|
|
|
1081
1475
|
title: "List pending financial entities",
|
|
1082
1476
|
description: "List all pending financial entities (milestones + measurements + subscription invoices) in a unified paginated view. Each row is enriched with is_overdue. Replaces lkp_billing_milestones for unified views \u2014 the legacy tool stays for backward compatibility.",
|
|
1083
1477
|
inputSchema: {
|
|
1084
|
-
entity_type:
|
|
1085
|
-
project_id:
|
|
1086
|
-
client_id:
|
|
1087
|
-
status:
|
|
1088
|
-
due_from:
|
|
1089
|
-
due_to:
|
|
1090
|
-
page:
|
|
1091
|
-
per_page:
|
|
1478
|
+
entity_type: z12.enum(["milestone", "measurement", "subscription_invoice"]).optional(),
|
|
1479
|
+
project_id: z12.coerce.number().int().positive().optional(),
|
|
1480
|
+
client_id: z12.coerce.number().int().positive().optional(),
|
|
1481
|
+
status: z12.string().optional(),
|
|
1482
|
+
due_from: z12.string().optional(),
|
|
1483
|
+
due_to: z12.string().optional(),
|
|
1484
|
+
page: z12.coerce.number().int().positive().optional(),
|
|
1485
|
+
per_page: z12.coerce.number().int().positive().max(200).default(50)
|
|
1092
1486
|
}
|
|
1093
1487
|
},
|
|
1094
1488
|
async (args) => runTool(
|
|
@@ -1103,8 +1497,8 @@ function registerFinancial(server, client, logger) {
|
|
|
1103
1497
|
title: "Aging report (receivables)",
|
|
1104
1498
|
description: "Aging report over overdue financial items. Returns (1) buckets 0-30 / 31-60 / 61-90 / 90+ by entity_type with count + amount, (2) overdue totals (count, amount, avg_days, oldest_days), (3) DSO (days sales outstanding) over last 90d for measurements and subscription_invoices, (4) top clients-at-risk ranked by overdue amount.",
|
|
1105
1499
|
inputSchema: {
|
|
1106
|
-
group_bucket:
|
|
1107
|
-
top_clients:
|
|
1500
|
+
group_bucket: z12.coerce.boolean().optional(),
|
|
1501
|
+
top_clients: z12.coerce.number().int().positive().optional()
|
|
1108
1502
|
}
|
|
1109
1503
|
},
|
|
1110
1504
|
async (args) => runTool(
|
|
@@ -1132,11 +1526,11 @@ function registerFinancial(server, client, logger) {
|
|
|
1132
1526
|
title: "Margin analysis (project/client/specialty)",
|
|
1133
1527
|
description: "Aggregate margin by project, client, or specialty using the per_user_breakdown JSON persisted in each measurement. Returns top N rows with gross_amount, cost_amount, margin_amount, margin_percent, measurement_count. Default window: last 180 days. Default status: paid,invoiced,sent,approved. Only measurements carry line-level cost \u2014 milestones and subscription_invoices are out of scope; for their gross numbers use lkp_financial_overview.",
|
|
1134
1528
|
inputSchema: {
|
|
1135
|
-
group_by:
|
|
1136
|
-
from:
|
|
1137
|
-
to:
|
|
1138
|
-
limit:
|
|
1139
|
-
status:
|
|
1529
|
+
group_by: z12.enum(["project", "client", "specialty"]).optional(),
|
|
1530
|
+
from: z12.string().optional(),
|
|
1531
|
+
to: z12.string().optional(),
|
|
1532
|
+
limit: z12.coerce.number().int().positive().max(200).optional(),
|
|
1533
|
+
status: z12.string().optional()
|
|
1140
1534
|
}
|
|
1141
1535
|
},
|
|
1142
1536
|
async (args) => runTool(
|
|
@@ -1151,7 +1545,7 @@ function registerFinancial(server, client, logger) {
|
|
|
1151
1545
|
}
|
|
1152
1546
|
|
|
1153
1547
|
// src/tools/composite/skill-match.ts
|
|
1154
|
-
import { z as
|
|
1548
|
+
import { z as z13 } from "zod";
|
|
1155
1549
|
var OPEN_STAGES = ["QUALIFYING", "PROPOSAL", "SENT", "NEGOTIATION"];
|
|
1156
1550
|
function toSpecNames(specialties) {
|
|
1157
1551
|
return (specialties ?? []).map((s) => typeof s === "string" ? s : s?.name ?? "").filter((s) => s.length > 0);
|
|
@@ -1163,9 +1557,9 @@ function registerSkillMatch(server, client, logger) {
|
|
|
1163
1557
|
title: "Match idle consultants to open opportunities",
|
|
1164
1558
|
description: "Match idle or soon-to-finish consultants with open opportunities by skill compatibility. Returns a ranked list of (consultant, opportunity) pairs with a match score. Skill inference for v1 is based on substring match of consultant specialties against the opportunity name and description. Critical for the 'queima de caixa' problem.",
|
|
1165
1559
|
inputSchema: {
|
|
1166
|
-
horizon_days:
|
|
1167
|
-
min_match_percent:
|
|
1168
|
-
include_partial:
|
|
1560
|
+
horizon_days: z13.coerce.number().int().positive().default(30),
|
|
1561
|
+
min_match_percent: z13.coerce.number().int().min(0).max(100).default(50),
|
|
1562
|
+
include_partial: z13.coerce.boolean().default(false)
|
|
1169
1563
|
}
|
|
1170
1564
|
},
|
|
1171
1565
|
async ({ horizon_days, min_match_percent, include_partial }) => runTool(logger, "lkp_skill_match", async () => {
|
|
@@ -1334,7 +1728,7 @@ function registerWeeklyBrief(server, client, logger) {
|
|
|
1334
1728
|
}
|
|
1335
1729
|
|
|
1336
1730
|
// src/tools/composite/timesheet-anomalies.ts
|
|
1337
|
-
import { z as
|
|
1731
|
+
import { z as z14 } from "zod";
|
|
1338
1732
|
async function fetchAllTimesheets(client, resourceId, from, to) {
|
|
1339
1733
|
const all = [];
|
|
1340
1734
|
for (let page = 1; page <= 5; page++) {
|
|
@@ -1447,10 +1841,10 @@ function registerTimesheetAnomalies(server, client, logger) {
|
|
|
1447
1841
|
title: "Detect timesheet anomalies",
|
|
1448
1842
|
description: "Detect suspicious timesheet patterns for one consultant or across the team over a date range. Flags: days with >10h, weekend work, unapproved entries older than N days, orphaned entries (no task link). Use before closing a payroll period or when investigating a specific consultant.",
|
|
1449
1843
|
inputSchema: {
|
|
1450
|
-
from:
|
|
1451
|
-
to:
|
|
1452
|
-
resource_id:
|
|
1453
|
-
unapproved_days_threshold:
|
|
1844
|
+
from: z14.string(),
|
|
1845
|
+
to: z14.string(),
|
|
1846
|
+
resource_id: z14.coerce.number().int().positive().optional(),
|
|
1847
|
+
unapproved_days_threshold: z14.coerce.number().int().positive().default(15)
|
|
1454
1848
|
}
|
|
1455
1849
|
},
|
|
1456
1850
|
async ({ from, to, resource_id, unapproved_days_threshold }) => runTool(logger, "lkp_timesheet_anomalies", async () => {
|
|
@@ -1537,6 +1931,7 @@ function registerAllTools(server, client, logger) {
|
|
|
1537
1931
|
registerResources(server, client, logger);
|
|
1538
1932
|
registerProjects(server, client, logger);
|
|
1539
1933
|
registerOpportunities(server, client, logger);
|
|
1934
|
+
registerQuotes(server, client, logger);
|
|
1540
1935
|
registerClients(server, client, logger);
|
|
1541
1936
|
registerHelpdesk(server, client, logger);
|
|
1542
1937
|
registerBilling(server, client, logger);
|
|
@@ -1594,7 +1989,7 @@ function registerMorningStandupPrompt(server) {
|
|
|
1594
1989
|
}
|
|
1595
1990
|
|
|
1596
1991
|
// src/prompts/opportunity-action.ts
|
|
1597
|
-
import { z as
|
|
1992
|
+
import { z as z15 } from "zod";
|
|
1598
1993
|
function buildText(opportunityRef) {
|
|
1599
1994
|
return `The user wants to update opportunity: ${opportunityRef}.
|
|
1600
1995
|
|
|
@@ -1616,7 +2011,7 @@ function registerOpportunityActionPrompt(server) {
|
|
|
1616
2011
|
title: "Opportunity Action",
|
|
1617
2012
|
description: "Log an activity and/or update stage for an opportunity.",
|
|
1618
2013
|
argsSchema: {
|
|
1619
|
-
opportunity_ref:
|
|
2014
|
+
opportunity_ref: z15.string().describe("Opportunity id or name")
|
|
1620
2015
|
}
|
|
1621
2016
|
},
|
|
1622
2017
|
({ opportunity_ref }) => ({
|
|
@@ -1630,9 +2025,53 @@ function registerOpportunityActionPrompt(server) {
|
|
|
1630
2025
|
);
|
|
1631
2026
|
}
|
|
1632
2027
|
|
|
2028
|
+
// src/prompts/quote-action.ts
|
|
2029
|
+
import { z as z16 } from "zod";
|
|
2030
|
+
function buildText2(quoteRef) {
|
|
2031
|
+
return `The user wants to act on quote: ${quoteRef}.
|
|
2032
|
+
|
|
2033
|
+
1. Resolve the ref:
|
|
2034
|
+
- If it looks like a code (e.g. QT-2026-0007), use lkp_quotes_list with search to find the id.
|
|
2035
|
+
- If it looks like a numeric id, go straight to lkp_quote_detail.
|
|
2036
|
+
2. Run lkp_quote_detail to load the current state \u2014 version, status, totals, items[], payment_milestones[].
|
|
2037
|
+
3. Infer the intent from the user's phrasing and the current status:
|
|
2038
|
+
- DRAFT \u2192 offer: edit fields (lkp_quote_update), add/update/delete item (lkp_quote_item_*), add/update/delete milestone (lkp_quote_milestone_*), replace full milestone schedule (lkp_quote_milestones_replace), send (lkp_quote_send), archive (lkp_quote_archive).
|
|
2039
|
+
- SENT \u2192 offer: accept (lkp_quote_accept), reject (lkp_quote_reject), new version to revise (lkp_quote_new_version), duplicate to another opportunity (lkp_quote_duplicate).
|
|
2040
|
+
- ACCEPTED / REJECTED / EXPIRED / SUPERSEDED \u2192 read-only; offer duplicate or new version only.
|
|
2041
|
+
4. Before calling any write tool, SUMMARIZE the change (field/line \u2192 old \u2192 new, or the state transition with its downstream effects) and wait for explicit "sim" / "confirma" / "ok" from the user. Do NOT assume consent.
|
|
2042
|
+
|
|
2043
|
+
After writing, confirm using the returned payload and suggest one concrete next step.
|
|
2044
|
+
|
|
2045
|
+
HARD RULES (do not violate, even if the user seems to agree):
|
|
2046
|
+
- ACCEPT: never call lkp_quote_accept without explicit, unambiguous approval referencing the quote code (e.g. "sim, aceitar QT-2026-0007"). Accept cascades sibling quotes to REJECTED and moves the opportunity to WON \u2014 it is commercially binding.
|
|
2047
|
+
- REJECT: always ask the user for the rejection motive before calling lkp_quote_reject. Reason is mandatory (min 1 char, max 200).
|
|
2048
|
+
- ARCHIVE: only offer lkp_quote_archive when status = DRAFT. For SENT/ACCEPTED/etc. use new-version/supersede flow instead.
|
|
2049
|
+
- NEVER attempt DRAFT \u2192 ACCEPTED directly. The quote must be SENT first (lkp_quote_send), then accepted.`;
|
|
2050
|
+
}
|
|
2051
|
+
function registerQuoteActionPrompt(server) {
|
|
2052
|
+
server.registerPrompt(
|
|
2053
|
+
"quote-action",
|
|
2054
|
+
{
|
|
2055
|
+
title: "Quote Action",
|
|
2056
|
+
description: "Drive a quote through its lifecycle \u2014 edit, send, accept, reject, version.",
|
|
2057
|
+
argsSchema: {
|
|
2058
|
+
quote_ref: z16.string().describe("Quote id or code (e.g. QT-2026-0007)")
|
|
2059
|
+
}
|
|
2060
|
+
},
|
|
2061
|
+
({ quote_ref }) => ({
|
|
2062
|
+
messages: [
|
|
2063
|
+
{
|
|
2064
|
+
role: "user",
|
|
2065
|
+
content: { type: "text", text: buildText2(quote_ref) }
|
|
2066
|
+
}
|
|
2067
|
+
]
|
|
2068
|
+
})
|
|
2069
|
+
);
|
|
2070
|
+
}
|
|
2071
|
+
|
|
1633
2072
|
// src/prompts/consultant-investigation.ts
|
|
1634
|
-
import { z as
|
|
1635
|
-
function
|
|
2073
|
+
import { z as z17 } from "zod";
|
|
2074
|
+
function buildText3(consultantRef) {
|
|
1636
2075
|
return `Investigate consultant ${consultantRef}:
|
|
1637
2076
|
|
|
1638
2077
|
1. lkp_resources_list with the search filter \u2192 confirm identity and current allocation status.
|
|
@@ -1654,14 +2093,14 @@ function registerConsultantInvestigationPrompt(server) {
|
|
|
1654
2093
|
title: "Consultant Investigation",
|
|
1655
2094
|
description: "Deep-dive on one consultant \u2014 where they are, what they've done, what's next.",
|
|
1656
2095
|
argsSchema: {
|
|
1657
|
-
consultant_ref:
|
|
2096
|
+
consultant_ref: z17.string().describe("Consultant id or name")
|
|
1658
2097
|
}
|
|
1659
2098
|
},
|
|
1660
2099
|
({ consultant_ref }) => ({
|
|
1661
2100
|
messages: [
|
|
1662
2101
|
{
|
|
1663
2102
|
role: "user",
|
|
1664
|
-
content: { type: "text", text:
|
|
2103
|
+
content: { type: "text", text: buildText3(consultant_ref) }
|
|
1665
2104
|
}
|
|
1666
2105
|
]
|
|
1667
2106
|
})
|
|
@@ -1733,6 +2172,7 @@ function registerAllPrompts(server) {
|
|
|
1733
2172
|
registerWeeklyBriefPrompt(server);
|
|
1734
2173
|
registerMorningStandupPrompt(server);
|
|
1735
2174
|
registerOpportunityActionPrompt(server);
|
|
2175
|
+
registerQuoteActionPrompt(server);
|
|
1736
2176
|
registerConsultantInvestigationPrompt(server);
|
|
1737
2177
|
registerManagersInTroublePrompt(server);
|
|
1738
2178
|
registerPipelineHealthCheckPrompt(server);
|