@kynver-app/mcp-estimator 0.2.16 → 0.2.18

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.
Files changed (45) hide show
  1. package/dist/index.js +1 -14
  2. package/dist/sse.js +1 -9
  3. package/package.json +8 -5
  4. package/dist/index.d.ts +0 -7
  5. package/dist/lib/kynver-client.d.ts +0 -20
  6. package/dist/lib/kynver-client.js +0 -115
  7. package/dist/lib/mcp-sse-server.d.ts +0 -44
  8. package/dist/lib/mcp-sse-server.js +0 -441
  9. package/dist/lib/package-version.d.ts +0 -7
  10. package/dist/lib/package-version.js +0 -44
  11. package/dist/server.d.ts +0 -6
  12. package/dist/server.js +0 -119
  13. package/dist/sse.d.ts +0 -1
  14. package/dist/tools/catalog-tools.d.ts +0 -381
  15. package/dist/tools/catalog-tools.js +0 -192
  16. package/dist/tools/client-tools.d.ts +0 -193
  17. package/dist/tools/client-tools.js +0 -105
  18. package/dist/tools/company-tools.d.ts +0 -163
  19. package/dist/tools/company-tools.js +0 -98
  20. package/dist/tools/email-pdf-tools.d.ts +0 -51
  21. package/dist/tools/email-pdf-tools.js +0 -22
  22. package/dist/tools/estimate-tools.d.ts +0 -531
  23. package/dist/tools/estimate-tools.js +0 -259
  24. package/dist/tools/intake-tools.d.ts +0 -463
  25. package/dist/tools/intake-tools.js +0 -82
  26. package/dist/tools/photo-tools.d.ts +0 -77
  27. package/dist/tools/photo-tools.js +0 -51
  28. package/dist/tools/price-catalog-tools.d.ts +0 -96
  29. package/dist/tools/price-catalog-tools.js +0 -72
  30. package/dist/tools/remodel-deliverable-tools.d.ts +0 -1868
  31. package/dist/tools/remodel-deliverable-tools.js +0 -138
  32. package/dist/tools/remodel-estimate-tools.d.ts +0 -525
  33. package/dist/tools/remodel-estimate-tools.js +0 -71
  34. package/dist/tools/signing-tools.d.ts +0 -89
  35. package/dist/tools/signing-tools.js +0 -51
  36. package/dist/tools/stats-pdf-tools.d.ts +0 -113
  37. package/dist/tools/stats-pdf-tools.js +0 -73
  38. package/dist/tools/takeoff-tools.d.ts +0 -730
  39. package/dist/tools/takeoff-tools.js +0 -297
  40. package/dist/tools/template-tools.d.ts +0 -96
  41. package/dist/tools/template-tools.js +0 -70
  42. package/dist/tools/version-tools.d.ts +0 -46
  43. package/dist/tools/version-tools.js +0 -33
  44. package/dist/tools/vision-tools.d.ts +0 -52
  45. package/dist/tools/vision-tools.js +0 -42
@@ -1,193 +0,0 @@
1
- import { z } from "zod";
2
- declare const createClientSchema: z.ZodObject<{
3
- name: z.ZodString;
4
- companyId: z.ZodOptional<z.ZodString>;
5
- title: z.ZodOptional<z.ZodString>;
6
- phone: z.ZodOptional<z.ZodString>;
7
- email: z.ZodOptional<z.ZodString>;
8
- address: z.ZodOptional<z.ZodString>;
9
- notes: z.ZodOptional<z.ZodString>;
10
- }, "strip", z.ZodTypeAny, {
11
- name: string;
12
- notes?: string | undefined;
13
- companyId?: string | undefined;
14
- phone?: string | undefined;
15
- email?: string | undefined;
16
- address?: string | undefined;
17
- title?: string | undefined;
18
- }, {
19
- name: string;
20
- notes?: string | undefined;
21
- companyId?: string | undefined;
22
- phone?: string | undefined;
23
- email?: string | undefined;
24
- address?: string | undefined;
25
- title?: string | undefined;
26
- }>;
27
- export declare const createClient: {
28
- name: string;
29
- description: string;
30
- inputSchemaZod: z.ZodObject<{
31
- name: z.ZodString;
32
- companyId: z.ZodOptional<z.ZodString>;
33
- title: z.ZodOptional<z.ZodString>;
34
- phone: z.ZodOptional<z.ZodString>;
35
- email: z.ZodOptional<z.ZodString>;
36
- address: z.ZodOptional<z.ZodString>;
37
- notes: z.ZodOptional<z.ZodString>;
38
- }, "strip", z.ZodTypeAny, {
39
- name: string;
40
- notes?: string | undefined;
41
- companyId?: string | undefined;
42
- phone?: string | undefined;
43
- email?: string | undefined;
44
- address?: string | undefined;
45
- title?: string | undefined;
46
- }, {
47
- name: string;
48
- notes?: string | undefined;
49
- companyId?: string | undefined;
50
- phone?: string | undefined;
51
- email?: string | undefined;
52
- address?: string | undefined;
53
- title?: string | undefined;
54
- }>;
55
- execute: (args: z.infer<typeof createClientSchema>) => Promise<string>;
56
- };
57
- declare const listClientsSchema: z.ZodObject<{
58
- search: z.ZodOptional<z.ZodString>;
59
- companyId: z.ZodOptional<z.ZodString>;
60
- limit: z.ZodOptional<z.ZodNumber>;
61
- cursor: z.ZodOptional<z.ZodString>;
62
- }, "strip", z.ZodTypeAny, {
63
- search?: string | undefined;
64
- limit?: number | undefined;
65
- cursor?: string | undefined;
66
- companyId?: string | undefined;
67
- }, {
68
- search?: string | undefined;
69
- limit?: number | undefined;
70
- cursor?: string | undefined;
71
- companyId?: string | undefined;
72
- }>;
73
- export declare const listClients: {
74
- name: string;
75
- description: string;
76
- inputSchemaZod: z.ZodObject<{
77
- search: z.ZodOptional<z.ZodString>;
78
- companyId: z.ZodOptional<z.ZodString>;
79
- limit: z.ZodOptional<z.ZodNumber>;
80
- cursor: z.ZodOptional<z.ZodString>;
81
- }, "strip", z.ZodTypeAny, {
82
- search?: string | undefined;
83
- limit?: number | undefined;
84
- cursor?: string | undefined;
85
- companyId?: string | undefined;
86
- }, {
87
- search?: string | undefined;
88
- limit?: number | undefined;
89
- cursor?: string | undefined;
90
- companyId?: string | undefined;
91
- }>;
92
- execute: (args: z.infer<typeof listClientsSchema>) => Promise<string>;
93
- };
94
- declare const getClientSchema: z.ZodObject<{
95
- clientId: z.ZodString;
96
- }, "strip", z.ZodTypeAny, {
97
- clientId: string;
98
- }, {
99
- clientId: string;
100
- }>;
101
- export declare const getClient: {
102
- name: string;
103
- description: string;
104
- inputSchemaZod: z.ZodObject<{
105
- clientId: z.ZodString;
106
- }, "strip", z.ZodTypeAny, {
107
- clientId: string;
108
- }, {
109
- clientId: string;
110
- }>;
111
- execute: (args: z.infer<typeof getClientSchema>) => Promise<string>;
112
- };
113
- declare const updateClientSchema: z.ZodObject<{
114
- clientId: z.ZodString;
115
- name: z.ZodOptional<z.ZodString>;
116
- companyId: z.ZodOptional<z.ZodString>;
117
- title: z.ZodOptional<z.ZodString>;
118
- phone: z.ZodOptional<z.ZodString>;
119
- email: z.ZodOptional<z.ZodString>;
120
- address: z.ZodOptional<z.ZodString>;
121
- notes: z.ZodOptional<z.ZodString>;
122
- }, "strip", z.ZodTypeAny, {
123
- clientId: string;
124
- name?: string | undefined;
125
- notes?: string | undefined;
126
- companyId?: string | undefined;
127
- phone?: string | undefined;
128
- email?: string | undefined;
129
- address?: string | undefined;
130
- title?: string | undefined;
131
- }, {
132
- clientId: string;
133
- name?: string | undefined;
134
- notes?: string | undefined;
135
- companyId?: string | undefined;
136
- phone?: string | undefined;
137
- email?: string | undefined;
138
- address?: string | undefined;
139
- title?: string | undefined;
140
- }>;
141
- export declare const updateClient: {
142
- name: string;
143
- description: string;
144
- inputSchemaZod: z.ZodObject<{
145
- clientId: z.ZodString;
146
- name: z.ZodOptional<z.ZodString>;
147
- companyId: z.ZodOptional<z.ZodString>;
148
- title: z.ZodOptional<z.ZodString>;
149
- phone: z.ZodOptional<z.ZodString>;
150
- email: z.ZodOptional<z.ZodString>;
151
- address: z.ZodOptional<z.ZodString>;
152
- notes: z.ZodOptional<z.ZodString>;
153
- }, "strip", z.ZodTypeAny, {
154
- clientId: string;
155
- name?: string | undefined;
156
- notes?: string | undefined;
157
- companyId?: string | undefined;
158
- phone?: string | undefined;
159
- email?: string | undefined;
160
- address?: string | undefined;
161
- title?: string | undefined;
162
- }, {
163
- clientId: string;
164
- name?: string | undefined;
165
- notes?: string | undefined;
166
- companyId?: string | undefined;
167
- phone?: string | undefined;
168
- email?: string | undefined;
169
- address?: string | undefined;
170
- title?: string | undefined;
171
- }>;
172
- execute: (args: z.infer<typeof updateClientSchema>) => Promise<string>;
173
- };
174
- declare const deleteClientSchema: z.ZodObject<{
175
- clientId: z.ZodString;
176
- }, "strip", z.ZodTypeAny, {
177
- clientId: string;
178
- }, {
179
- clientId: string;
180
- }>;
181
- export declare const deleteClient: {
182
- name: string;
183
- description: string;
184
- inputSchemaZod: z.ZodObject<{
185
- clientId: z.ZodString;
186
- }, "strip", z.ZodTypeAny, {
187
- clientId: string;
188
- }, {
189
- clientId: string;
190
- }>;
191
- execute: (args: z.infer<typeof deleteClientSchema>) => Promise<string>;
192
- };
193
- export {};
@@ -1,105 +0,0 @@
1
- import { z } from "zod";
2
- import * as client from "../lib/kynver-client.js";
3
- // --- estimator_create_client ---
4
- const createClientSchema = z.object({
5
- name: z.string(),
6
- companyId: z.string().optional(),
7
- title: z.string().optional(),
8
- phone: z.string().optional(),
9
- email: z.string().optional(),
10
- address: z.string().optional(),
11
- notes: z.string().optional(),
12
- });
13
- export const createClient = {
14
- name: "estimator_create_client",
15
- description: "Create a new client (individual person) in the client book. Clients can optionally belong to a company (pass companyId). Include contact details: name (required), title, phone, email, address, and notes. The client can then be linked to estimates via their clientId.",
16
- inputSchemaZod: createClientSchema,
17
- execute: async (args) => {
18
- if (!client.hasApiKey())
19
- return client.noApiKeyMessage();
20
- const data = await client.post("/estimator/clients", args);
21
- return JSON.stringify(data);
22
- },
23
- };
24
- // --- estimator_list_clients ---
25
- const listClientsSchema = z.object({
26
- search: z.string().optional(),
27
- companyId: z.string().optional(),
28
- limit: z.number().optional(),
29
- cursor: z.string().optional(),
30
- });
31
- export const listClients = {
32
- name: "estimator_list_clients",
33
- description: "Search and list clients in the client book. Use the search param to find clients by name, phone, or email. Filter by companyId to see all contacts at a specific company. Returns client details with linked company info. Always search here before creating a new client to avoid duplicates.",
34
- inputSchemaZod: listClientsSchema,
35
- execute: async (args) => {
36
- if (!client.hasApiKey())
37
- return client.noApiKeyMessage();
38
- const params = new URLSearchParams();
39
- if (args.search)
40
- params.set("search", args.search);
41
- if (args.companyId)
42
- params.set("companyId", args.companyId);
43
- if (args.limit != null)
44
- params.set("limit", String(args.limit));
45
- if (args.cursor)
46
- params.set("cursor", args.cursor);
47
- const q = params.toString();
48
- const path = q ? `/estimator/clients?${q}` : "/estimator/clients";
49
- const data = await client.get(path);
50
- return JSON.stringify(data);
51
- },
52
- };
53
- // --- estimator_get_client ---
54
- const getClientSchema = z.object({
55
- clientId: z.string(),
56
- });
57
- export const getClient = {
58
- name: "estimator_get_client",
59
- description: "Get a specific client's full details including their company info and a summary of linked estimates (recent 10). Use this to see a client's estimate history before creating new ones.",
60
- inputSchemaZod: getClientSchema,
61
- execute: async (args) => {
62
- if (!client.hasApiKey())
63
- return client.noApiKeyMessage();
64
- const data = await client.get(`/estimator/clients/${args.clientId}`);
65
- return JSON.stringify(data);
66
- },
67
- };
68
- // --- estimator_update_client ---
69
- const updateClientSchema = z.object({
70
- clientId: z.string(),
71
- name: z.string().optional(),
72
- companyId: z.string().optional(),
73
- title: z.string().optional(),
74
- phone: z.string().optional(),
75
- email: z.string().optional(),
76
- address: z.string().optional(),
77
- notes: z.string().optional(),
78
- });
79
- export const updateClient = {
80
- name: "estimator_update_client",
81
- description: "Update a client's contact details. Pass the clientId and any fields to change: name, title, phone, email, address, notes, or companyId (to move them to a different company).",
82
- inputSchemaZod: updateClientSchema,
83
- execute: async (args) => {
84
- if (!client.hasApiKey())
85
- return client.noApiKeyMessage();
86
- const { clientId, ...body } = args;
87
- const data = await client.patch(`/estimator/clients/${clientId}`, body);
88
- return JSON.stringify(data);
89
- },
90
- };
91
- // --- estimator_delete_client ---
92
- const deleteClientSchema = z.object({
93
- clientId: z.string(),
94
- });
95
- export const deleteClient = {
96
- name: "estimator_delete_client",
97
- description: "Soft-delete a client from the client book. The client's data is preserved but hidden from searches. Existing estimates linked to this client are not affected.",
98
- inputSchemaZod: deleteClientSchema,
99
- execute: async (args) => {
100
- if (!client.hasApiKey())
101
- return client.noApiKeyMessage();
102
- const data = await client.del(`/estimator/clients/${args.clientId}`);
103
- return JSON.stringify(data);
104
- },
105
- };
@@ -1,163 +0,0 @@
1
- import { z } from "zod";
2
- declare const createCompanySchema: z.ZodObject<{
3
- name: z.ZodString;
4
- phone: z.ZodOptional<z.ZodString>;
5
- email: z.ZodOptional<z.ZodString>;
6
- address: z.ZodOptional<z.ZodString>;
7
- notes: z.ZodOptional<z.ZodString>;
8
- }, "strip", z.ZodTypeAny, {
9
- name: string;
10
- notes?: string | undefined;
11
- phone?: string | undefined;
12
- email?: string | undefined;
13
- address?: string | undefined;
14
- }, {
15
- name: string;
16
- notes?: string | undefined;
17
- phone?: string | undefined;
18
- email?: string | undefined;
19
- address?: string | undefined;
20
- }>;
21
- export declare const createCompany: {
22
- name: string;
23
- description: string;
24
- inputSchemaZod: z.ZodObject<{
25
- name: z.ZodString;
26
- phone: z.ZodOptional<z.ZodString>;
27
- email: z.ZodOptional<z.ZodString>;
28
- address: z.ZodOptional<z.ZodString>;
29
- notes: z.ZodOptional<z.ZodString>;
30
- }, "strip", z.ZodTypeAny, {
31
- name: string;
32
- notes?: string | undefined;
33
- phone?: string | undefined;
34
- email?: string | undefined;
35
- address?: string | undefined;
36
- }, {
37
- name: string;
38
- notes?: string | undefined;
39
- phone?: string | undefined;
40
- email?: string | undefined;
41
- address?: string | undefined;
42
- }>;
43
- execute: (args: z.infer<typeof createCompanySchema>) => Promise<string>;
44
- };
45
- declare const listCompaniesSchema: z.ZodObject<{
46
- search: z.ZodOptional<z.ZodString>;
47
- limit: z.ZodOptional<z.ZodNumber>;
48
- cursor: z.ZodOptional<z.ZodString>;
49
- }, "strip", z.ZodTypeAny, {
50
- search?: string | undefined;
51
- limit?: number | undefined;
52
- cursor?: string | undefined;
53
- }, {
54
- search?: string | undefined;
55
- limit?: number | undefined;
56
- cursor?: string | undefined;
57
- }>;
58
- export declare const listCompanies: {
59
- name: string;
60
- description: string;
61
- inputSchemaZod: z.ZodObject<{
62
- search: z.ZodOptional<z.ZodString>;
63
- limit: z.ZodOptional<z.ZodNumber>;
64
- cursor: z.ZodOptional<z.ZodString>;
65
- }, "strip", z.ZodTypeAny, {
66
- search?: string | undefined;
67
- limit?: number | undefined;
68
- cursor?: string | undefined;
69
- }, {
70
- search?: string | undefined;
71
- limit?: number | undefined;
72
- cursor?: string | undefined;
73
- }>;
74
- execute: (args: z.infer<typeof listCompaniesSchema>) => Promise<string>;
75
- };
76
- declare const getCompanySchema: z.ZodObject<{
77
- companyId: z.ZodString;
78
- }, "strip", z.ZodTypeAny, {
79
- companyId: string;
80
- }, {
81
- companyId: string;
82
- }>;
83
- export declare const getCompany: {
84
- name: string;
85
- description: string;
86
- inputSchemaZod: z.ZodObject<{
87
- companyId: z.ZodString;
88
- }, "strip", z.ZodTypeAny, {
89
- companyId: string;
90
- }, {
91
- companyId: string;
92
- }>;
93
- execute: (args: z.infer<typeof getCompanySchema>) => Promise<string>;
94
- };
95
- declare const updateCompanySchema: z.ZodObject<{
96
- companyId: z.ZodString;
97
- name: z.ZodOptional<z.ZodString>;
98
- phone: z.ZodOptional<z.ZodString>;
99
- email: z.ZodOptional<z.ZodString>;
100
- address: z.ZodOptional<z.ZodString>;
101
- notes: z.ZodOptional<z.ZodString>;
102
- }, "strip", z.ZodTypeAny, {
103
- companyId: string;
104
- name?: string | undefined;
105
- notes?: string | undefined;
106
- phone?: string | undefined;
107
- email?: string | undefined;
108
- address?: string | undefined;
109
- }, {
110
- companyId: string;
111
- name?: string | undefined;
112
- notes?: string | undefined;
113
- phone?: string | undefined;
114
- email?: string | undefined;
115
- address?: string | undefined;
116
- }>;
117
- export declare const updateCompany: {
118
- name: string;
119
- description: string;
120
- inputSchemaZod: z.ZodObject<{
121
- companyId: z.ZodString;
122
- name: z.ZodOptional<z.ZodString>;
123
- phone: z.ZodOptional<z.ZodString>;
124
- email: z.ZodOptional<z.ZodString>;
125
- address: z.ZodOptional<z.ZodString>;
126
- notes: z.ZodOptional<z.ZodString>;
127
- }, "strip", z.ZodTypeAny, {
128
- companyId: string;
129
- name?: string | undefined;
130
- notes?: string | undefined;
131
- phone?: string | undefined;
132
- email?: string | undefined;
133
- address?: string | undefined;
134
- }, {
135
- companyId: string;
136
- name?: string | undefined;
137
- notes?: string | undefined;
138
- phone?: string | undefined;
139
- email?: string | undefined;
140
- address?: string | undefined;
141
- }>;
142
- execute: (args: z.infer<typeof updateCompanySchema>) => Promise<string>;
143
- };
144
- declare const deleteCompanySchema: z.ZodObject<{
145
- companyId: z.ZodString;
146
- }, "strip", z.ZodTypeAny, {
147
- companyId: string;
148
- }, {
149
- companyId: string;
150
- }>;
151
- export declare const deleteCompany: {
152
- name: string;
153
- description: string;
154
- inputSchemaZod: z.ZodObject<{
155
- companyId: z.ZodString;
156
- }, "strip", z.ZodTypeAny, {
157
- companyId: string;
158
- }, {
159
- companyId: string;
160
- }>;
161
- execute: (args: z.infer<typeof deleteCompanySchema>) => Promise<string>;
162
- };
163
- export {};
@@ -1,98 +0,0 @@
1
- import { z } from "zod";
2
- import * as client from "../lib/kynver-client.js";
3
- // --- estimator_create_company ---
4
- const createCompanySchema = z.object({
5
- name: z.string(),
6
- phone: z.string().optional(),
7
- email: z.string().optional(),
8
- address: z.string().optional(),
9
- notes: z.string().optional(),
10
- });
11
- export const createCompany = {
12
- name: "estimator_create_company",
13
- description: "Create a new company in the client book. Companies group clients (contacts) together. Include: name (required), phone, email, address, and notes. After creating, you can add clients to the company using estimator_create_client with the companyId.",
14
- inputSchemaZod: createCompanySchema,
15
- execute: async (args) => {
16
- if (!client.hasApiKey())
17
- return client.noApiKeyMessage();
18
- const data = await client.post("/estimator/companies", args);
19
- return JSON.stringify(data);
20
- },
21
- };
22
- // --- estimator_list_companies ---
23
- const listCompaniesSchema = z.object({
24
- search: z.string().optional(),
25
- limit: z.number().optional(),
26
- cursor: z.string().optional(),
27
- });
28
- export const listCompanies = {
29
- name: "estimator_list_companies",
30
- description: "Search and list companies in the client book. Use the search param to find companies by name. Returns company details with a count of contacts and estimates. Always search here before creating a new company to avoid duplicates.",
31
- inputSchemaZod: listCompaniesSchema,
32
- execute: async (args) => {
33
- if (!client.hasApiKey())
34
- return client.noApiKeyMessage();
35
- const params = new URLSearchParams();
36
- if (args.search)
37
- params.set("search", args.search);
38
- if (args.limit != null)
39
- params.set("limit", String(args.limit));
40
- if (args.cursor)
41
- params.set("cursor", args.cursor);
42
- const q = params.toString();
43
- const path = q ? `/estimator/companies?${q}` : "/estimator/companies";
44
- const data = await client.get(path);
45
- return JSON.stringify(data);
46
- },
47
- };
48
- // --- estimator_get_company ---
49
- const getCompanySchema = z.object({
50
- companyId: z.string(),
51
- });
52
- export const getCompany = {
53
- name: "estimator_get_company",
54
- description: "Get a specific company's full details including all its client contacts and a summary of linked estimates.",
55
- inputSchemaZod: getCompanySchema,
56
- execute: async (args) => {
57
- if (!client.hasApiKey())
58
- return client.noApiKeyMessage();
59
- const data = await client.get(`/estimator/companies/${args.companyId}`);
60
- return JSON.stringify(data);
61
- },
62
- };
63
- // --- estimator_update_company ---
64
- const updateCompanySchema = z.object({
65
- companyId: z.string(),
66
- name: z.string().optional(),
67
- phone: z.string().optional(),
68
- email: z.string().optional(),
69
- address: z.string().optional(),
70
- notes: z.string().optional(),
71
- });
72
- export const updateCompany = {
73
- name: "estimator_update_company",
74
- description: "Update a company's details. Pass the companyId and any fields to change: name, phone, email, address, or notes.",
75
- inputSchemaZod: updateCompanySchema,
76
- execute: async (args) => {
77
- if (!client.hasApiKey())
78
- return client.noApiKeyMessage();
79
- const { companyId, ...body } = args;
80
- const data = await client.patch(`/estimator/companies/${companyId}`, body);
81
- return JSON.stringify(data);
82
- },
83
- };
84
- // --- estimator_delete_company ---
85
- const deleteCompanySchema = z.object({
86
- companyId: z.string(),
87
- });
88
- export const deleteCompany = {
89
- name: "estimator_delete_company",
90
- description: "Soft-delete a company from the client book. The company's data is preserved but hidden. Clients belonging to this company are NOT deleted — they become unlinked.",
91
- inputSchemaZod: deleteCompanySchema,
92
- execute: async (args) => {
93
- if (!client.hasApiKey())
94
- return client.noApiKeyMessage();
95
- const data = await client.del(`/estimator/companies/${args.companyId}`);
96
- return JSON.stringify(data);
97
- },
98
- };
@@ -1,51 +0,0 @@
1
- import { z } from "zod";
2
- declare const emailPdfSchema: z.ZodObject<{
3
- estimateId: z.ZodString;
4
- recipient: z.ZodOptional<z.ZodString>;
5
- ccRecipients: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
6
- subject: z.ZodOptional<z.ZodString>;
7
- message: z.ZodOptional<z.ZodString>;
8
- confirmExternalRecipient: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
9
- }, "strip", z.ZodTypeAny, {
10
- estimateId: string;
11
- ccRecipients: string[];
12
- confirmExternalRecipient: boolean;
13
- message?: string | undefined;
14
- recipient?: string | undefined;
15
- subject?: string | undefined;
16
- }, {
17
- estimateId: string;
18
- message?: string | undefined;
19
- recipient?: string | undefined;
20
- ccRecipients?: string[] | undefined;
21
- subject?: string | undefined;
22
- confirmExternalRecipient?: boolean | undefined;
23
- }>;
24
- export declare const emailPdf: {
25
- name: string;
26
- description: string;
27
- inputSchemaZod: z.ZodObject<{
28
- estimateId: z.ZodString;
29
- recipient: z.ZodOptional<z.ZodString>;
30
- ccRecipients: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
31
- subject: z.ZodOptional<z.ZodString>;
32
- message: z.ZodOptional<z.ZodString>;
33
- confirmExternalRecipient: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
34
- }, "strip", z.ZodTypeAny, {
35
- estimateId: string;
36
- ccRecipients: string[];
37
- confirmExternalRecipient: boolean;
38
- message?: string | undefined;
39
- recipient?: string | undefined;
40
- subject?: string | undefined;
41
- }, {
42
- estimateId: string;
43
- message?: string | undefined;
44
- recipient?: string | undefined;
45
- ccRecipients?: string[] | undefined;
46
- subject?: string | undefined;
47
- confirmExternalRecipient?: boolean | undefined;
48
- }>;
49
- execute: (args: z.infer<typeof emailPdfSchema>) => Promise<string>;
50
- };
51
- export {};
@@ -1,22 +0,0 @@
1
- import { z } from "zod";
2
- import * as client from "../lib/kynver-client.js";
3
- const emailPdfSchema = z.object({
4
- estimateId: z.string(),
5
- recipient: z.string().email().optional(),
6
- ccRecipients: z.array(z.string().email()).max(10).optional().default([]),
7
- subject: z.string().min(1).max(200).optional(),
8
- message: z.string().min(1).max(10_000).optional(),
9
- confirmExternalRecipient: z.boolean().optional().default(false),
10
- });
11
- export const emailPdf = {
12
- name: "estimator_email_pdf",
13
- description: "Email an estimate PDF to a primary recipient with optional CC recipients in one group email. Fetches and attaches the PDF server-side (no secrets exposed). Defaults to the account owner's email when recipient is omitted. Estimate client emails and linked client records are trusted without extra confirmation; any external To or CC address requires confirmExternalRecipient=true after explicit user confirmation. Respects the estimate approval gate before customer send. Returns send status and audit metadata.",
14
- inputSchemaZod: emailPdfSchema,
15
- execute: async (args) => {
16
- if (!client.hasApiKey())
17
- return client.noApiKeyMessage();
18
- const { estimateId, ...body } = args;
19
- const data = await client.post(`/estimator/estimates/${estimateId}/email-pdf`, body);
20
- return JSON.stringify(data);
21
- },
22
- };