@kynver-app/mcp-estimator 0.2.15 → 0.2.17
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 +1 -14
- package/dist/sse.js +1 -9
- package/package.json +5 -4
- package/dist/index.d.ts +0 -7
- package/dist/lib/kynver-client.d.ts +0 -20
- package/dist/lib/kynver-client.js +0 -110
- package/dist/lib/mcp-sse-server.d.ts +0 -44
- package/dist/lib/mcp-sse-server.js +0 -279
- package/dist/lib/package-version.d.ts +0 -7
- package/dist/lib/package-version.js +0 -44
- package/dist/server.d.ts +0 -6
- package/dist/server.js +0 -119
- package/dist/sse.d.ts +0 -1
- package/dist/tools/catalog-tools.d.ts +0 -381
- package/dist/tools/catalog-tools.js +0 -192
- package/dist/tools/client-tools.d.ts +0 -193
- package/dist/tools/client-tools.js +0 -105
- package/dist/tools/company-tools.d.ts +0 -163
- package/dist/tools/company-tools.js +0 -98
- package/dist/tools/email-pdf-tools.d.ts +0 -45
- package/dist/tools/email-pdf-tools.js +0 -21
- package/dist/tools/estimate-tools.d.ts +0 -531
- package/dist/tools/estimate-tools.js +0 -259
- package/dist/tools/intake-tools.d.ts +0 -463
- package/dist/tools/intake-tools.js +0 -82
- package/dist/tools/photo-tools.d.ts +0 -77
- package/dist/tools/photo-tools.js +0 -51
- package/dist/tools/price-catalog-tools.d.ts +0 -96
- package/dist/tools/price-catalog-tools.js +0 -72
- package/dist/tools/remodel-deliverable-tools.d.ts +0 -1868
- package/dist/tools/remodel-deliverable-tools.js +0 -138
- package/dist/tools/remodel-estimate-tools.d.ts +0 -525
- package/dist/tools/remodel-estimate-tools.js +0 -71
- package/dist/tools/signing-tools.d.ts +0 -89
- package/dist/tools/signing-tools.js +0 -51
- package/dist/tools/stats-pdf-tools.d.ts +0 -113
- package/dist/tools/stats-pdf-tools.js +0 -73
- package/dist/tools/takeoff-tools.d.ts +0 -730
- package/dist/tools/takeoff-tools.js +0 -297
- package/dist/tools/template-tools.d.ts +0 -96
- package/dist/tools/template-tools.js +0 -70
- package/dist/tools/version-tools.d.ts +0 -46
- package/dist/tools/version-tools.js +0 -33
- package/dist/tools/vision-tools.d.ts +0 -52
- package/dist/tools/vision-tools.js +0 -42
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as client from "../lib/kynver-client.js";
|
|
3
|
-
const projectIdSchema = z.object({ projectId: z.string().uuid() });
|
|
4
|
-
const createTakeoffProjectSchema = z.object({
|
|
5
|
-
projectName: z.string(),
|
|
6
|
-
buildingType: z.enum(["commercial", "residential"]),
|
|
7
|
-
siteAddress: z.string().optional(),
|
|
8
|
-
clientId: z.string().optional(),
|
|
9
|
-
companyId: z.string().optional(),
|
|
10
|
-
});
|
|
11
|
-
const listTakeoffProjectsSchema = z.object({});
|
|
12
|
-
const remodelHintsSchema = z
|
|
13
|
-
.object({
|
|
14
|
-
cabinetLinearFt: z.number().nonnegative().optional(),
|
|
15
|
-
rooms: z
|
|
16
|
-
.array(z.object({
|
|
17
|
-
name: z.string(),
|
|
18
|
-
lengthFt: z.number().positive().optional(),
|
|
19
|
-
widthFt: z.number().positive().optional(),
|
|
20
|
-
}))
|
|
21
|
-
.optional(),
|
|
22
|
-
baths: z
|
|
23
|
-
.array(z.object({
|
|
24
|
-
type: z.enum(["full", "half", "three_quarter", "unknown"]).optional(),
|
|
25
|
-
count: z.number().int().positive().optional(),
|
|
26
|
-
label: z.string().optional(),
|
|
27
|
-
}))
|
|
28
|
-
.optional(),
|
|
29
|
-
flooringSqFt: z.number().nonnegative().optional(),
|
|
30
|
-
drywallSqFt: z.number().nonnegative().optional(),
|
|
31
|
-
paintSqFt: z.number().nonnegative().optional(),
|
|
32
|
-
roofSqFt: z.number().nonnegative().optional(),
|
|
33
|
-
flags: z
|
|
34
|
-
.object({
|
|
35
|
-
wallMovingRisk: z.boolean().optional(),
|
|
36
|
-
electricalSurpriseRisk: z.boolean().optional(),
|
|
37
|
-
plumbingSurpriseRisk: z.boolean().optional(),
|
|
38
|
-
})
|
|
39
|
-
.optional(),
|
|
40
|
-
notes: z.string().optional(),
|
|
41
|
-
})
|
|
42
|
-
.optional();
|
|
43
|
-
const uploadTakeoffInputSchema = z.object({
|
|
44
|
-
projectId: z.string().uuid(),
|
|
45
|
-
kind: z.string(),
|
|
46
|
-
fileName: z.string(),
|
|
47
|
-
base64: z.string(),
|
|
48
|
-
mimeType: z.string().optional(),
|
|
49
|
-
remodelHints: remodelHintsSchema,
|
|
50
|
-
});
|
|
51
|
-
const listTakeoffRowsSchema = z.object({
|
|
52
|
-
projectId: z.string().uuid(),
|
|
53
|
-
reviewState: z.string().optional(),
|
|
54
|
-
});
|
|
55
|
-
const reviewTakeoffRowSchema = z.object({
|
|
56
|
-
projectId: z.string().uuid(),
|
|
57
|
-
rowId: z.string().uuid(),
|
|
58
|
-
action: z.enum(["approve", "skip", "edit"]),
|
|
59
|
-
edits: z
|
|
60
|
-
.object({
|
|
61
|
-
description: z.string().optional(),
|
|
62
|
-
quantity: z.number().optional(),
|
|
63
|
-
unit: z.string().optional(),
|
|
64
|
-
serviceCode: z.string().nullable().optional(),
|
|
65
|
-
})
|
|
66
|
-
.optional(),
|
|
67
|
-
});
|
|
68
|
-
const commitTakeoffSchema = z.object({
|
|
69
|
-
projectId: z.string().uuid(),
|
|
70
|
-
overrideNote: z.string().optional(),
|
|
71
|
-
});
|
|
72
|
-
const listSystemPacksSchema = z.object({ segment: z.enum(["commercial", "residential"]).optional() });
|
|
73
|
-
const applySystemPackSchema = z.object({
|
|
74
|
-
projectId: z.string().uuid(),
|
|
75
|
-
systemPackSlug: z.string(),
|
|
76
|
-
serviceProfileId: z.string().optional(),
|
|
77
|
-
});
|
|
78
|
-
const listServiceProfilesSchema = z.object({});
|
|
79
|
-
const upsertServiceProfileSchema = z.object({
|
|
80
|
-
slug: z.string(),
|
|
81
|
-
name: z.string(),
|
|
82
|
-
segment: z.enum([
|
|
83
|
-
"commercial_service",
|
|
84
|
-
"commercial_production",
|
|
85
|
-
"residential_service",
|
|
86
|
-
"residential_production",
|
|
87
|
-
]),
|
|
88
|
-
laborMultiplier: z.number().optional(),
|
|
89
|
-
defaultWastePercent: z.number().optional(),
|
|
90
|
-
});
|
|
91
|
-
const requestEstimateApprovalSchema = z.object({
|
|
92
|
-
estimateId: z.string().uuid(),
|
|
93
|
-
note: z.string().optional(),
|
|
94
|
-
});
|
|
95
|
-
const approveEstimateSchema = z.object({
|
|
96
|
-
estimateId: z.string().uuid(),
|
|
97
|
-
approvalId: z.string().uuid(),
|
|
98
|
-
action: z.enum(["approve", "reject"]),
|
|
99
|
-
note: z.string().optional(),
|
|
100
|
-
});
|
|
101
|
-
const getEstimateApprovalSchema = z.object({ estimateId: z.string().uuid() });
|
|
102
|
-
export const createTakeoffProject = {
|
|
103
|
-
name: "estimator_create_takeoff_project",
|
|
104
|
-
description: "Create a takeoff project shell (commercial or residential). Upload inputs, run extract, review rows, commit, apply system pack, then generate estimate.",
|
|
105
|
-
inputSchemaZod: createTakeoffProjectSchema,
|
|
106
|
-
execute: async (args) => {
|
|
107
|
-
if (!client.hasApiKey())
|
|
108
|
-
return client.noApiKeyMessage();
|
|
109
|
-
const data = await client.post("/estimator/takeoffs", args);
|
|
110
|
-
return JSON.stringify(data);
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
export const getTakeoffProject = {
|
|
114
|
-
name: "estimator_get_takeoff_project",
|
|
115
|
-
description: "Get takeoff project with inputs, rows, status, pack/profile, linked estimate.",
|
|
116
|
-
inputSchemaZod: projectIdSchema,
|
|
117
|
-
execute: async (args) => {
|
|
118
|
-
if (!client.hasApiKey())
|
|
119
|
-
return client.noApiKeyMessage();
|
|
120
|
-
const data = await client.get(`/estimator/takeoffs/${args.projectId}`);
|
|
121
|
-
return JSON.stringify(data);
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
export const listTakeoffProjects = {
|
|
125
|
-
name: "estimator_list_takeoff_projects",
|
|
126
|
-
description: "List takeoff projects for the workspace.",
|
|
127
|
-
inputSchemaZod: listTakeoffProjectsSchema,
|
|
128
|
-
execute: async (_args) => {
|
|
129
|
-
if (!client.hasApiKey())
|
|
130
|
-
return client.noApiKeyMessage();
|
|
131
|
-
const data = await client.get("/estimator/takeoffs");
|
|
132
|
-
return JSON.stringify(data);
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
export const uploadTakeoffInput = {
|
|
136
|
-
name: "estimator_upload_takeoff_input",
|
|
137
|
-
description: "Upload a takeoff input file (base64) for a project. kind: eagleview_pdf|eagleview_xml|eagleview_json|eagleview_csv|spec_pdf|spreadsheet|photo|voice|other. For remodel photo/drawing takeoff, use kind=photo or spec_pdf and pass optional remodelHints (cabinet LF, room dims, bath counts, flooring/drywall/paint/roof sf, risk flags) — quantities are reviewable, not auto-measured from pixels.",
|
|
138
|
-
inputSchemaZod: uploadTakeoffInputSchema,
|
|
139
|
-
execute: async (args) => {
|
|
140
|
-
if (!client.hasApiKey())
|
|
141
|
-
return client.noApiKeyMessage();
|
|
142
|
-
const data = await client.post(`/estimator/takeoffs/${args.projectId}/inputs`, {
|
|
143
|
-
kind: args.kind,
|
|
144
|
-
fileName: args.fileName,
|
|
145
|
-
base64: args.base64,
|
|
146
|
-
...(args.mimeType ? { mimeType: args.mimeType } : {}),
|
|
147
|
-
...(args.remodelHints ? { remodelHints: args.remodelHints } : {}),
|
|
148
|
-
});
|
|
149
|
-
return JSON.stringify(data);
|
|
150
|
-
},
|
|
151
|
-
};
|
|
152
|
-
export const runTakeoffExtract = {
|
|
153
|
-
name: "estimator_run_takeoff_extract",
|
|
154
|
-
description: "Run takeoff extractors on all uploaded inputs (idempotent).",
|
|
155
|
-
inputSchemaZod: projectIdSchema,
|
|
156
|
-
execute: async (args) => {
|
|
157
|
-
if (!client.hasApiKey())
|
|
158
|
-
return client.noApiKeyMessage();
|
|
159
|
-
const data = await client.post(`/estimator/takeoffs/${args.projectId}/extract`, {});
|
|
160
|
-
return JSON.stringify(data);
|
|
161
|
-
},
|
|
162
|
-
};
|
|
163
|
-
export const listTakeoffRows = {
|
|
164
|
-
name: "estimator_list_takeoff_rows",
|
|
165
|
-
description: "List takeoff rows with evidence and review state.",
|
|
166
|
-
inputSchemaZod: listTakeoffRowsSchema,
|
|
167
|
-
execute: async (args) => {
|
|
168
|
-
if (!client.hasApiKey())
|
|
169
|
-
return client.noApiKeyMessage();
|
|
170
|
-
const qs = args.reviewState ? `?reviewState=${args.reviewState}` : "";
|
|
171
|
-
const data = await client.get(`/estimator/takeoffs/${args.projectId}/rows${qs}`);
|
|
172
|
-
return JSON.stringify(data);
|
|
173
|
-
},
|
|
174
|
-
};
|
|
175
|
-
export const reviewTakeoffRow = {
|
|
176
|
-
name: "estimator_review_takeoff_row",
|
|
177
|
-
description: "Approve, skip, or edit a single takeoff row.",
|
|
178
|
-
inputSchemaZod: reviewTakeoffRowSchema,
|
|
179
|
-
execute: async (args) => {
|
|
180
|
-
if (!client.hasApiKey())
|
|
181
|
-
return client.noApiKeyMessage();
|
|
182
|
-
const { projectId, rowId, ...body } = args;
|
|
183
|
-
const data = await client.patch(`/estimator/takeoffs/${projectId}/rows/${rowId}`, body);
|
|
184
|
-
return JSON.stringify(data);
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
export const commitTakeoff = {
|
|
188
|
-
name: "estimator_commit_takeoff",
|
|
189
|
-
description: "Mark takeoff ready after all rows reviewed and area measurement approved (or override note).",
|
|
190
|
-
inputSchemaZod: commitTakeoffSchema,
|
|
191
|
-
execute: async (args) => {
|
|
192
|
-
if (!client.hasApiKey())
|
|
193
|
-
return client.noApiKeyMessage();
|
|
194
|
-
const data = await client.post(`/estimator/takeoffs/${args.projectId}/commit`, {
|
|
195
|
-
overrideNote: args.overrideNote,
|
|
196
|
-
});
|
|
197
|
-
return JSON.stringify(data);
|
|
198
|
-
},
|
|
199
|
-
};
|
|
200
|
-
export const listSystemPacks = {
|
|
201
|
-
name: "estimator_list_system_packs",
|
|
202
|
-
description: "List built-in commercial and residential system packs.",
|
|
203
|
-
inputSchemaZod: listSystemPacksSchema,
|
|
204
|
-
execute: async (args) => {
|
|
205
|
-
if (!client.hasApiKey())
|
|
206
|
-
return client.noApiKeyMessage();
|
|
207
|
-
const qs = args.segment ? `?segment=${args.segment}` : "";
|
|
208
|
-
const data = await client.get(`/estimator/system-packs${qs}`);
|
|
209
|
-
return JSON.stringify(data);
|
|
210
|
-
},
|
|
211
|
-
};
|
|
212
|
-
export const applySystemPack = {
|
|
213
|
-
name: "estimator_apply_system_pack",
|
|
214
|
-
description: "Set system pack slug and optional service profile on takeoff project.",
|
|
215
|
-
inputSchemaZod: applySystemPackSchema,
|
|
216
|
-
execute: async (args) => {
|
|
217
|
-
if (!client.hasApiKey())
|
|
218
|
-
return client.noApiKeyMessage();
|
|
219
|
-
const data = await client.patch(`/estimator/takeoffs/${args.projectId}`, {
|
|
220
|
-
systemPackSlug: args.systemPackSlug,
|
|
221
|
-
serviceProfileId: args.serviceProfileId ?? null,
|
|
222
|
-
});
|
|
223
|
-
return JSON.stringify(data);
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
export const listServiceProfiles = {
|
|
227
|
-
name: "estimator_list_service_profiles",
|
|
228
|
-
description: "List service department profiles (includes v6 defaults).",
|
|
229
|
-
inputSchemaZod: listServiceProfilesSchema,
|
|
230
|
-
execute: async (_args) => {
|
|
231
|
-
if (!client.hasApiKey())
|
|
232
|
-
return client.noApiKeyMessage();
|
|
233
|
-
const data = await client.get("/estimator/service-profiles");
|
|
234
|
-
return JSON.stringify(data);
|
|
235
|
-
},
|
|
236
|
-
};
|
|
237
|
-
export const upsertServiceProfile = {
|
|
238
|
-
name: "estimator_upsert_service_profile",
|
|
239
|
-
description: "Create or update a service department profile.",
|
|
240
|
-
inputSchemaZod: upsertServiceProfileSchema,
|
|
241
|
-
execute: async (args) => {
|
|
242
|
-
if (!client.hasApiKey())
|
|
243
|
-
return client.noApiKeyMessage();
|
|
244
|
-
const data = await client.post("/estimator/service-profiles", args);
|
|
245
|
-
return JSON.stringify(data);
|
|
246
|
-
},
|
|
247
|
-
};
|
|
248
|
-
export const generateEstimateFromTakeoff = {
|
|
249
|
-
name: "estimator_generate_estimate_from_takeoff",
|
|
250
|
-
description: "Generate draft estimate from committed takeoff + system pack. Preflight fails if catalog codes missing.",
|
|
251
|
-
inputSchemaZod: projectIdSchema,
|
|
252
|
-
execute: async (args) => {
|
|
253
|
-
if (!client.hasApiKey())
|
|
254
|
-
return client.noApiKeyMessage();
|
|
255
|
-
const data = await client.post(`/estimator/takeoffs/${args.projectId}/generate-estimate`, {});
|
|
256
|
-
return JSON.stringify(data);
|
|
257
|
-
},
|
|
258
|
-
};
|
|
259
|
-
export const requestEstimateApproval = {
|
|
260
|
-
name: "estimator_request_estimate_approval",
|
|
261
|
-
description: "Request owner approval before customer send.",
|
|
262
|
-
inputSchemaZod: requestEstimateApprovalSchema,
|
|
263
|
-
execute: async (args) => {
|
|
264
|
-
if (!client.hasApiKey())
|
|
265
|
-
return client.noApiKeyMessage();
|
|
266
|
-
const data = await client.post(`/estimator/estimates/${args.estimateId}/approval`, {
|
|
267
|
-
note: args.note,
|
|
268
|
-
});
|
|
269
|
-
return JSON.stringify(data);
|
|
270
|
-
},
|
|
271
|
-
};
|
|
272
|
-
export const approveEstimate = {
|
|
273
|
-
name: "estimator_approve_estimate",
|
|
274
|
-
description: "Approve or reject estimate (workspace owner).",
|
|
275
|
-
inputSchemaZod: approveEstimateSchema,
|
|
276
|
-
execute: async (args) => {
|
|
277
|
-
if (!client.hasApiKey())
|
|
278
|
-
return client.noApiKeyMessage();
|
|
279
|
-
const data = await client.post(`/estimator/estimates/${args.estimateId}/approval`, {
|
|
280
|
-
approvalId: args.approvalId,
|
|
281
|
-
action: args.action,
|
|
282
|
-
note: args.note,
|
|
283
|
-
});
|
|
284
|
-
return JSON.stringify(data);
|
|
285
|
-
},
|
|
286
|
-
};
|
|
287
|
-
export const getEstimateApproval = {
|
|
288
|
-
name: "estimator_get_estimate_approval",
|
|
289
|
-
description: "Get latest approval status for an estimate.",
|
|
290
|
-
inputSchemaZod: getEstimateApprovalSchema,
|
|
291
|
-
execute: async (args) => {
|
|
292
|
-
if (!client.hasApiKey())
|
|
293
|
-
return client.noApiKeyMessage();
|
|
294
|
-
const data = await client.get(`/estimator/estimates/${args.estimateId}/approval`);
|
|
295
|
-
return JSON.stringify(data);
|
|
296
|
-
},
|
|
297
|
-
};
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
declare const saveTemplateSchema: z.ZodObject<{
|
|
3
|
-
estimateId: z.ZodString;
|
|
4
|
-
name: z.ZodString;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
name: string;
|
|
7
|
-
estimateId: string;
|
|
8
|
-
}, {
|
|
9
|
-
name: string;
|
|
10
|
-
estimateId: string;
|
|
11
|
-
}>;
|
|
12
|
-
export declare const saveTemplate: {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
inputSchemaZod: z.ZodObject<{
|
|
16
|
-
estimateId: z.ZodString;
|
|
17
|
-
name: z.ZodString;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
name: string;
|
|
20
|
-
estimateId: string;
|
|
21
|
-
}, {
|
|
22
|
-
name: string;
|
|
23
|
-
estimateId: string;
|
|
24
|
-
}>;
|
|
25
|
-
execute: (args: z.infer<typeof saveTemplateSchema>) => Promise<string>;
|
|
26
|
-
};
|
|
27
|
-
declare const listTemplatesSchema: z.ZodObject<{
|
|
28
|
-
type: z.ZodOptional<z.ZodString>;
|
|
29
|
-
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
type?: string | undefined;
|
|
31
|
-
}, {
|
|
32
|
-
type?: string | undefined;
|
|
33
|
-
}>;
|
|
34
|
-
export declare const listTemplates: {
|
|
35
|
-
name: string;
|
|
36
|
-
description: string;
|
|
37
|
-
inputSchemaZod: z.ZodObject<{
|
|
38
|
-
type: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, "strip", z.ZodTypeAny, {
|
|
40
|
-
type?: string | undefined;
|
|
41
|
-
}, {
|
|
42
|
-
type?: string | undefined;
|
|
43
|
-
}>;
|
|
44
|
-
execute: (args: z.infer<typeof listTemplatesSchema>) => Promise<string>;
|
|
45
|
-
};
|
|
46
|
-
declare const deleteTemplateSchema: z.ZodObject<{
|
|
47
|
-
id: z.ZodString;
|
|
48
|
-
}, "strip", z.ZodTypeAny, {
|
|
49
|
-
id: string;
|
|
50
|
-
}, {
|
|
51
|
-
id: string;
|
|
52
|
-
}>;
|
|
53
|
-
export declare const deleteTemplate: {
|
|
54
|
-
name: string;
|
|
55
|
-
description: string;
|
|
56
|
-
inputSchemaZod: z.ZodObject<{
|
|
57
|
-
id: z.ZodString;
|
|
58
|
-
}, "strip", z.ZodTypeAny, {
|
|
59
|
-
id: string;
|
|
60
|
-
}, {
|
|
61
|
-
id: string;
|
|
62
|
-
}>;
|
|
63
|
-
execute: (args: z.infer<typeof deleteTemplateSchema>) => Promise<string>;
|
|
64
|
-
};
|
|
65
|
-
declare const createFromTemplateSchema: z.ZodObject<{
|
|
66
|
-
templateId: z.ZodString;
|
|
67
|
-
projectName: z.ZodString;
|
|
68
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
69
|
-
}, "strip", z.ZodTypeAny, {
|
|
70
|
-
templateId: string;
|
|
71
|
-
projectName: string;
|
|
72
|
-
clientId?: string | undefined;
|
|
73
|
-
}, {
|
|
74
|
-
templateId: string;
|
|
75
|
-
projectName: string;
|
|
76
|
-
clientId?: string | undefined;
|
|
77
|
-
}>;
|
|
78
|
-
export declare const createFromTemplate: {
|
|
79
|
-
name: string;
|
|
80
|
-
description: string;
|
|
81
|
-
inputSchemaZod: z.ZodObject<{
|
|
82
|
-
templateId: z.ZodString;
|
|
83
|
-
projectName: z.ZodString;
|
|
84
|
-
clientId: z.ZodOptional<z.ZodString>;
|
|
85
|
-
}, "strip", z.ZodTypeAny, {
|
|
86
|
-
templateId: string;
|
|
87
|
-
projectName: string;
|
|
88
|
-
clientId?: string | undefined;
|
|
89
|
-
}, {
|
|
90
|
-
templateId: string;
|
|
91
|
-
projectName: string;
|
|
92
|
-
clientId?: string | undefined;
|
|
93
|
-
}>;
|
|
94
|
-
execute: (args: z.infer<typeof createFromTemplateSchema>) => Promise<string>;
|
|
95
|
-
};
|
|
96
|
-
export {};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as client from "../lib/kynver-client.js";
|
|
3
|
-
// --- estimator_save_template ---
|
|
4
|
-
const saveTemplateSchema = z.object({
|
|
5
|
-
estimateId: z.string(),
|
|
6
|
-
name: z.string(),
|
|
7
|
-
});
|
|
8
|
-
export const saveTemplate = {
|
|
9
|
-
name: "estimator_save_template",
|
|
10
|
-
description: "Save an existing estimate as a reusable template. Templates capture the estimate's line items, quantities, and structure so you can quickly create similar estimates in the future. Requires the estimateId of the source estimate and a name for the template.",
|
|
11
|
-
inputSchemaZod: saveTemplateSchema,
|
|
12
|
-
execute: async (args) => {
|
|
13
|
-
if (!client.hasApiKey())
|
|
14
|
-
return client.noApiKeyMessage();
|
|
15
|
-
const data = await client.post("/estimator/templates", args);
|
|
16
|
-
return JSON.stringify(data);
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
// --- estimator_list_templates ---
|
|
20
|
-
const listTemplatesSchema = z.object({
|
|
21
|
-
type: z.string().optional(),
|
|
22
|
-
});
|
|
23
|
-
export const listTemplates = {
|
|
24
|
-
name: "estimator_list_templates",
|
|
25
|
-
description: "List all saved estimate templates. Optionally filter by type: 'replacement' or 'repair_service'. Returns template names, types, and IDs. Use template IDs with estimator_create_from_template to create new estimates.",
|
|
26
|
-
inputSchemaZod: listTemplatesSchema,
|
|
27
|
-
execute: async (args) => {
|
|
28
|
-
if (!client.hasApiKey())
|
|
29
|
-
return client.noApiKeyMessage();
|
|
30
|
-
const params = new URLSearchParams();
|
|
31
|
-
if (args.type)
|
|
32
|
-
params.set("type", args.type);
|
|
33
|
-
const q = params.toString();
|
|
34
|
-
const path = q ? `/estimator/templates?${q}` : "/estimator/templates";
|
|
35
|
-
const data = await client.get(path);
|
|
36
|
-
return JSON.stringify(data);
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
// --- estimator_delete_template ---
|
|
40
|
-
const deleteTemplateSchema = z.object({
|
|
41
|
-
id: z.string(),
|
|
42
|
-
});
|
|
43
|
-
export const deleteTemplate = {
|
|
44
|
-
name: "estimator_delete_template",
|
|
45
|
-
description: "Delete a saved estimate template permanently. This does not affect any estimates that were previously created from this template.",
|
|
46
|
-
inputSchemaZod: deleteTemplateSchema,
|
|
47
|
-
execute: async (args) => {
|
|
48
|
-
if (!client.hasApiKey())
|
|
49
|
-
return client.noApiKeyMessage();
|
|
50
|
-
const data = await client.del(`/estimator/templates/${args.id}`);
|
|
51
|
-
return JSON.stringify(data);
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
// --- estimator_create_from_template ---
|
|
55
|
-
const createFromTemplateSchema = z.object({
|
|
56
|
-
templateId: z.string(),
|
|
57
|
-
projectName: z.string(),
|
|
58
|
-
clientId: z.string().optional(),
|
|
59
|
-
});
|
|
60
|
-
export const createFromTemplate = {
|
|
61
|
-
name: "estimator_create_from_template",
|
|
62
|
-
description: "Create a new estimate from a saved template. The new estimate gets all the template's line items and structure. Requires: templateId (from estimator_list_templates), projectName. Optionally link to a clientId. The new estimate is created as a draft.",
|
|
63
|
-
inputSchemaZod: createFromTemplateSchema,
|
|
64
|
-
execute: async (args) => {
|
|
65
|
-
if (!client.hasApiKey())
|
|
66
|
-
return client.noApiKeyMessage();
|
|
67
|
-
const data = await client.post("/estimator/estimates", args);
|
|
68
|
-
return JSON.stringify(data);
|
|
69
|
-
},
|
|
70
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
declare const listVersionsSchema: z.ZodObject<{
|
|
3
|
-
estimateId: z.ZodString;
|
|
4
|
-
}, "strip", z.ZodTypeAny, {
|
|
5
|
-
estimateId: string;
|
|
6
|
-
}, {
|
|
7
|
-
estimateId: string;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const listVersions: {
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
inputSchemaZod: z.ZodObject<{
|
|
13
|
-
estimateId: z.ZodString;
|
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
estimateId: string;
|
|
16
|
-
}, {
|
|
17
|
-
estimateId: string;
|
|
18
|
-
}>;
|
|
19
|
-
execute: (args: z.infer<typeof listVersionsSchema>) => Promise<string>;
|
|
20
|
-
};
|
|
21
|
-
declare const getVersionSchema: z.ZodObject<{
|
|
22
|
-
estimateId: z.ZodString;
|
|
23
|
-
versionId: z.ZodString;
|
|
24
|
-
}, "strip", z.ZodTypeAny, {
|
|
25
|
-
estimateId: string;
|
|
26
|
-
versionId: string;
|
|
27
|
-
}, {
|
|
28
|
-
estimateId: string;
|
|
29
|
-
versionId: string;
|
|
30
|
-
}>;
|
|
31
|
-
export declare const getVersion: {
|
|
32
|
-
name: string;
|
|
33
|
-
description: string;
|
|
34
|
-
inputSchemaZod: z.ZodObject<{
|
|
35
|
-
estimateId: z.ZodString;
|
|
36
|
-
versionId: z.ZodString;
|
|
37
|
-
}, "strip", z.ZodTypeAny, {
|
|
38
|
-
estimateId: string;
|
|
39
|
-
versionId: string;
|
|
40
|
-
}, {
|
|
41
|
-
estimateId: string;
|
|
42
|
-
versionId: string;
|
|
43
|
-
}>;
|
|
44
|
-
execute: (args: z.infer<typeof getVersionSchema>) => Promise<string>;
|
|
45
|
-
};
|
|
46
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as client from "../lib/kynver-client.js";
|
|
3
|
-
// --- estimator_list_versions ---
|
|
4
|
-
const listVersionsSchema = z.object({
|
|
5
|
-
estimateId: z.string(),
|
|
6
|
-
});
|
|
7
|
-
export const listVersions = {
|
|
8
|
-
name: "estimator_list_versions",
|
|
9
|
-
description: "List all saved version snapshots of an estimate. Versions are created automatically when significant changes are made. Shows version numbers and timestamps. Use this to track the history of changes to an estimate.",
|
|
10
|
-
inputSchemaZod: listVersionsSchema,
|
|
11
|
-
execute: async (args) => {
|
|
12
|
-
if (!client.hasApiKey())
|
|
13
|
-
return client.noApiKeyMessage();
|
|
14
|
-
const data = await client.get(`/estimator/estimates/${args.estimateId}/versions`);
|
|
15
|
-
return JSON.stringify(data);
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
// --- estimator_get_version ---
|
|
19
|
-
const getVersionSchema = z.object({
|
|
20
|
-
estimateId: z.string(),
|
|
21
|
-
versionId: z.string(),
|
|
22
|
-
});
|
|
23
|
-
export const getVersion = {
|
|
24
|
-
name: "estimator_get_version",
|
|
25
|
-
description: "Get a specific historical version of an estimate. Returns the full estimate snapshot as it existed at that point in time — all line items, totals, and metadata. Useful for comparing current vs previous versions or reverting changes.",
|
|
26
|
-
inputSchemaZod: getVersionSchema,
|
|
27
|
-
execute: async (args) => {
|
|
28
|
-
if (!client.hasApiKey())
|
|
29
|
-
return client.noApiKeyMessage();
|
|
30
|
-
const data = await client.get(`/estimator/estimates/${args.estimateId}/versions/${args.versionId}`);
|
|
31
|
-
return JSON.stringify(data);
|
|
32
|
-
},
|
|
33
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
declare const analyzePhotosSchema: z.ZodObject<{
|
|
3
|
-
images: z.ZodArray<z.ZodString, "many">;
|
|
4
|
-
prompt: z.ZodOptional<z.ZodString>;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
images: string[];
|
|
7
|
-
prompt?: string | undefined;
|
|
8
|
-
}, {
|
|
9
|
-
images: string[];
|
|
10
|
-
prompt?: string | undefined;
|
|
11
|
-
}>;
|
|
12
|
-
export declare const analyzePhotos: {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
inputSchemaZod: z.ZodObject<{
|
|
16
|
-
images: z.ZodArray<z.ZodString, "many">;
|
|
17
|
-
prompt: z.ZodOptional<z.ZodString>;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
images: string[];
|
|
20
|
-
prompt?: string | undefined;
|
|
21
|
-
}, {
|
|
22
|
-
images: string[];
|
|
23
|
-
prompt?: string | undefined;
|
|
24
|
-
}>;
|
|
25
|
-
execute: (args: z.infer<typeof analyzePhotosSchema>) => Promise<string>;
|
|
26
|
-
};
|
|
27
|
-
declare const analyzeDocumentSchema: z.ZodObject<{
|
|
28
|
-
text: z.ZodString;
|
|
29
|
-
prompt: z.ZodOptional<z.ZodString>;
|
|
30
|
-
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
text: string;
|
|
32
|
-
prompt?: string | undefined;
|
|
33
|
-
}, {
|
|
34
|
-
text: string;
|
|
35
|
-
prompt?: string | undefined;
|
|
36
|
-
}>;
|
|
37
|
-
export declare const analyzeDocument: {
|
|
38
|
-
name: string;
|
|
39
|
-
description: string;
|
|
40
|
-
inputSchemaZod: z.ZodObject<{
|
|
41
|
-
text: z.ZodString;
|
|
42
|
-
prompt: z.ZodOptional<z.ZodString>;
|
|
43
|
-
}, "strip", z.ZodTypeAny, {
|
|
44
|
-
text: string;
|
|
45
|
-
prompt?: string | undefined;
|
|
46
|
-
}, {
|
|
47
|
-
text: string;
|
|
48
|
-
prompt?: string | undefined;
|
|
49
|
-
}>;
|
|
50
|
-
execute: (args: z.infer<typeof analyzeDocumentSchema>) => Promise<string>;
|
|
51
|
-
};
|
|
52
|
-
export {};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as client from "../lib/kynver-client.js";
|
|
3
|
-
// --- estimator_analyze_photos ---
|
|
4
|
-
const analyzePhotosSchema = z.object({
|
|
5
|
-
images: z.array(z.string()),
|
|
6
|
-
prompt: z.string().optional(),
|
|
7
|
-
});
|
|
8
|
-
export const analyzePhotos = {
|
|
9
|
-
name: "estimator_analyze_photos",
|
|
10
|
-
description: "Analyze roof photos using Claude's vision AI. Provide image URLs (can be multiple). The AI identifies: roofing materials, visible damage (missing shingles, cracks, moss, ponding), approximate measurements, and repair recommendations. Use the optional prompt parameter to ask specific questions about the photos. Results can inform estimate creation.",
|
|
11
|
-
inputSchemaZod: analyzePhotosSchema,
|
|
12
|
-
execute: async (args) => {
|
|
13
|
-
if (!client.hasApiKey())
|
|
14
|
-
return client.noApiKeyMessage();
|
|
15
|
-
const data = await client.post("/estimator/analyze", {
|
|
16
|
-
type: "photos",
|
|
17
|
-
images: args.images,
|
|
18
|
-
...(args.prompt ? { prompt: args.prompt } : {}),
|
|
19
|
-
});
|
|
20
|
-
return JSON.stringify(data);
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
// --- estimator_analyze_document ---
|
|
24
|
-
const analyzeDocumentSchema = z.object({
|
|
25
|
-
text: z.string(),
|
|
26
|
-
prompt: z.string().optional(),
|
|
27
|
-
});
|
|
28
|
-
export const analyzeDocument = {
|
|
29
|
-
name: "estimator_analyze_document",
|
|
30
|
-
description: "Analyze a text document (inspection report, insurance scope of work, contractor notes) and extract structured estimating data — identified services, quantities, materials, and damage descriptions. Pass the document text in the text field. Use the optional prompt parameter to focus the analysis. Results can be used to create estimates with accurate line items.",
|
|
31
|
-
inputSchemaZod: analyzeDocumentSchema,
|
|
32
|
-
execute: async (args) => {
|
|
33
|
-
if (!client.hasApiKey())
|
|
34
|
-
return client.noApiKeyMessage();
|
|
35
|
-
const data = await client.post("/estimator/analyze", {
|
|
36
|
-
type: "document",
|
|
37
|
-
text: args.text,
|
|
38
|
-
...(args.prompt ? { prompt: args.prompt } : {}),
|
|
39
|
-
});
|
|
40
|
-
return JSON.stringify(data);
|
|
41
|
-
},
|
|
42
|
-
};
|