@servicialo/mcp-server 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -43
- package/dist/client.d.ts +20 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +58 -9
- package/dist/client.js.map +1 -1
- package/dist/index.js +82 -51
- package/dist/index.js.map +1 -1
- package/dist/mode.d.ts +9 -0
- package/dist/mode.d.ts.map +1 -0
- package/dist/mode.js +18 -0
- package/dist/mode.js.map +1 -0
- package/dist/tools/{clients.d.ts → authenticated/cerrar.d.ts} +76 -84
- package/dist/tools/authenticated/cerrar.d.ts.map +1 -0
- package/dist/tools/authenticated/cerrar.js +73 -0
- package/dist/tools/authenticated/cerrar.js.map +1 -0
- package/dist/tools/authenticated/comprometer.d.ts +204 -0
- package/dist/tools/authenticated/comprometer.d.ts.map +1 -0
- package/dist/tools/authenticated/comprometer.js +55 -0
- package/dist/tools/authenticated/comprometer.js.map +1 -0
- package/dist/tools/authenticated/delivery.d.ts +234 -0
- package/dist/tools/authenticated/delivery.d.ts.map +1 -0
- package/dist/tools/authenticated/delivery.js +53 -0
- package/dist/tools/authenticated/delivery.js.map +1 -0
- package/dist/tools/authenticated/entender.d.ts +35 -0
- package/dist/tools/authenticated/entender.d.ts.map +1 -0
- package/dist/tools/authenticated/entender.js +25 -0
- package/dist/tools/authenticated/entender.js.map +1 -0
- package/dist/tools/{scheduling.d.ts → authenticated/lifecycle.d.ts} +26 -103
- package/dist/tools/authenticated/lifecycle.d.ts.map +1 -0
- package/dist/tools/authenticated/lifecycle.js +63 -0
- package/dist/tools/authenticated/lifecycle.js.map +1 -0
- package/dist/tools/public/availability.d.ts +34 -0
- package/dist/tools/public/availability.d.ts.map +1 -0
- package/dist/tools/public/availability.js +22 -0
- package/dist/tools/public/availability.js.map +1 -0
- package/dist/tools/public/registry.d.ts +39 -0
- package/dist/tools/public/registry.d.ts.map +1 -0
- package/dist/tools/public/registry.js +28 -0
- package/dist/tools/public/registry.js.map +1 -0
- package/dist/tools/public/services.d.ts +18 -0
- package/dist/tools/public/services.d.ts.map +1 -0
- package/dist/tools/public/services.js +13 -0
- package/dist/tools/public/services.js.map +1 -0
- package/dist/tools/schemas.d.ts +40 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +14 -0
- package/dist/tools/schemas.js.map +1 -0
- package/package.json +2 -2
- package/dist/tools/clients.d.ts.map +0 -1
- package/dist/tools/clients.js +0 -64
- package/dist/tools/clients.js.map +0 -1
- package/dist/tools/notifications.d.ts +0 -31
- package/dist/tools/notifications.d.ts.map +0 -1
- package/dist/tools/notifications.js +0 -22
- package/dist/tools/notifications.js.map +0 -1
- package/dist/tools/payments.d.ts +0 -105
- package/dist/tools/payments.d.ts.map +0 -1
- package/dist/tools/payments.js +0 -70
- package/dist/tools/payments.js.map +0 -1
- package/dist/tools/payroll.d.ts +0 -106
- package/dist/tools/payroll.d.ts.map +0 -1
- package/dist/tools/payroll.js +0 -77
- package/dist/tools/payroll.js.map +0 -1
- package/dist/tools/providers.d.ts +0 -52
- package/dist/tools/providers.d.ts.map +0 -1
- package/dist/tools/providers.js +0 -37
- package/dist/tools/providers.js.map +0 -1
- package/dist/tools/scheduling.d.ts.map +0 -1
- package/dist/tools/scheduling.js +0 -99
- package/dist/tools/scheduling.js.map +0 -1
|
@@ -1,75 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { CoordinaloClient } from '
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
on_behalf_of: z.ZodOptional<z.ZodObject<{
|
|
7
|
-
type: z.ZodString;
|
|
8
|
-
id: z.ZodString;
|
|
9
|
-
}, "strip", z.ZodTypeAny, {
|
|
10
|
-
type: string;
|
|
11
|
-
id: string;
|
|
12
|
-
}, {
|
|
13
|
-
type: string;
|
|
14
|
-
id: string;
|
|
15
|
-
}>>;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
type: "client" | "provider" | "organization" | "agent";
|
|
18
|
-
id: string;
|
|
19
|
-
on_behalf_of?: {
|
|
20
|
-
type: string;
|
|
21
|
-
id: string;
|
|
22
|
-
} | undefined;
|
|
23
|
-
}, {
|
|
24
|
-
type: "client" | "provider" | "organization" | "agent";
|
|
25
|
-
id: string;
|
|
26
|
-
on_behalf_of?: {
|
|
27
|
-
type: string;
|
|
28
|
-
id: string;
|
|
29
|
-
} | undefined;
|
|
30
|
-
}>;
|
|
31
|
-
export declare const clientsTools: {
|
|
32
|
-
'clients.list': {
|
|
2
|
+
import type { CoordinaloClient } from '../../client.js';
|
|
3
|
+
import { ActorSchema } from '../schemas.js';
|
|
4
|
+
export declare const cerrarTools: {
|
|
5
|
+
'documentation.create': {
|
|
33
6
|
description: string;
|
|
34
7
|
schema: z.ZodObject<{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
limit: number;
|
|
40
|
-
page: number;
|
|
41
|
-
search?: string | undefined;
|
|
42
|
-
}, {
|
|
43
|
-
limit?: number | undefined;
|
|
44
|
-
page?: number | undefined;
|
|
45
|
-
search?: string | undefined;
|
|
46
|
-
}>;
|
|
47
|
-
handler: (client: CoordinaloClient, args: {
|
|
48
|
-
search?: string;
|
|
49
|
-
limit?: number;
|
|
50
|
-
page?: number;
|
|
51
|
-
}) => Promise<unknown>;
|
|
52
|
-
};
|
|
53
|
-
'clients.get': {
|
|
54
|
-
description: string;
|
|
55
|
-
schema: z.ZodObject<{
|
|
56
|
-
client_id: z.ZodString;
|
|
57
|
-
}, "strip", z.ZodTypeAny, {
|
|
58
|
-
client_id: string;
|
|
59
|
-
}, {
|
|
60
|
-
client_id: string;
|
|
61
|
-
}>;
|
|
62
|
-
handler: (client: CoordinaloClient, args: {
|
|
63
|
-
client_id: string;
|
|
64
|
-
}) => Promise<unknown>;
|
|
65
|
-
};
|
|
66
|
-
'clients.create': {
|
|
67
|
-
description: string;
|
|
68
|
-
schema: z.ZodObject<{
|
|
69
|
-
name: z.ZodString;
|
|
70
|
-
last_name: z.ZodString;
|
|
71
|
-
email: z.ZodOptional<z.ZodString>;
|
|
72
|
-
phone: z.ZodOptional<z.ZodString>;
|
|
8
|
+
session_id: z.ZodString;
|
|
9
|
+
content: z.ZodString;
|
|
10
|
+
template_id: z.ZodOptional<z.ZodString>;
|
|
73
11
|
actor: z.ZodObject<{
|
|
74
12
|
type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
|
|
75
13
|
id: z.ZodString;
|
|
@@ -107,10 +45,9 @@ export declare const clientsTools: {
|
|
|
107
45
|
id: string;
|
|
108
46
|
} | undefined;
|
|
109
47
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
phone?: string | undefined;
|
|
48
|
+
session_id: string;
|
|
49
|
+
content: string;
|
|
50
|
+
template_id?: string | undefined;
|
|
114
51
|
}, {
|
|
115
52
|
actor: {
|
|
116
53
|
type: "client" | "provider" | "organization" | "agent";
|
|
@@ -120,32 +57,87 @@ export declare const clientsTools: {
|
|
|
120
57
|
id: string;
|
|
121
58
|
} | undefined;
|
|
122
59
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
phone?: string | undefined;
|
|
60
|
+
session_id: string;
|
|
61
|
+
content: string;
|
|
62
|
+
template_id?: string | undefined;
|
|
127
63
|
}>;
|
|
128
64
|
handler: (client: CoordinaloClient, args: {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
phone?: string;
|
|
65
|
+
session_id: string;
|
|
66
|
+
content: string;
|
|
67
|
+
template_id?: string;
|
|
133
68
|
actor: z.infer<typeof ActorSchema>;
|
|
134
69
|
}) => Promise<unknown>;
|
|
135
70
|
};
|
|
136
|
-
'
|
|
71
|
+
'payments.create_sale': {
|
|
137
72
|
description: string;
|
|
138
73
|
schema: z.ZodObject<{
|
|
139
74
|
client_id: z.ZodString;
|
|
75
|
+
service_id: z.ZodString;
|
|
76
|
+
provider_id: z.ZodString;
|
|
77
|
+
quantity: z.ZodDefault<z.ZodNumber>;
|
|
78
|
+
unit_price: z.ZodNumber;
|
|
140
79
|
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
service_id: string;
|
|
81
|
+
provider_id: string;
|
|
141
82
|
client_id: string;
|
|
83
|
+
quantity: number;
|
|
84
|
+
unit_price: number;
|
|
142
85
|
}, {
|
|
86
|
+
service_id: string;
|
|
87
|
+
provider_id: string;
|
|
143
88
|
client_id: string;
|
|
89
|
+
unit_price: number;
|
|
90
|
+
quantity?: number | undefined;
|
|
144
91
|
}>;
|
|
145
92
|
handler: (client: CoordinaloClient, args: {
|
|
146
93
|
client_id: string;
|
|
94
|
+
service_id: string;
|
|
95
|
+
provider_id: string;
|
|
96
|
+
quantity?: number;
|
|
97
|
+
unit_price: number;
|
|
98
|
+
}) => Promise<unknown>;
|
|
99
|
+
};
|
|
100
|
+
'payments.record_payment': {
|
|
101
|
+
description: string;
|
|
102
|
+
schema: z.ZodObject<{
|
|
103
|
+
venta_id: z.ZodString;
|
|
104
|
+
amount: z.ZodNumber;
|
|
105
|
+
method: z.ZodEnum<["efectivo", "transferencia", "mercadopago", "tarjeta"]>;
|
|
106
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
method: "efectivo" | "transferencia" | "mercadopago" | "tarjeta";
|
|
109
|
+
venta_id: string;
|
|
110
|
+
amount: number;
|
|
111
|
+
reference?: string | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
method: "efectivo" | "transferencia" | "mercadopago" | "tarjeta";
|
|
114
|
+
venta_id: string;
|
|
115
|
+
amount: number;
|
|
116
|
+
reference?: string | undefined;
|
|
117
|
+
}>;
|
|
118
|
+
handler: (client: CoordinaloClient, args: {
|
|
119
|
+
venta_id: string;
|
|
120
|
+
amount: number;
|
|
121
|
+
method: string;
|
|
122
|
+
reference?: string;
|
|
123
|
+
}) => Promise<unknown>;
|
|
124
|
+
};
|
|
125
|
+
'payments.get_status': {
|
|
126
|
+
description: string;
|
|
127
|
+
schema: z.ZodObject<{
|
|
128
|
+
sale_id: z.ZodOptional<z.ZodString>;
|
|
129
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
client_id?: string | undefined;
|
|
132
|
+
sale_id?: string | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
client_id?: string | undefined;
|
|
135
|
+
sale_id?: string | undefined;
|
|
136
|
+
}>;
|
|
137
|
+
handler: (client: CoordinaloClient, args: {
|
|
138
|
+
sale_id?: string;
|
|
139
|
+
client_id?: string;
|
|
147
140
|
}) => Promise<unknown>;
|
|
148
141
|
};
|
|
149
142
|
};
|
|
150
|
-
|
|
151
|
-
//# sourceMappingURL=clients.d.ts.map
|
|
143
|
+
//# sourceMappingURL=cerrar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cerrar.d.ts","sourceRoot":"","sources":["../../../src/tools/authenticated/cerrar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAUI,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;0BAmBzH,gBAAgB,QAAQ;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;0BAoB7H,gBAAgB,QAAQ;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;0BAiBhG,gBAAgB,QAAQ;YAAE,OAAO,CAAC,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE;;CAU3F,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ActorSchema } from '../schemas.js';
|
|
3
|
+
export const cerrarTools = {
|
|
4
|
+
'documentation.create': {
|
|
5
|
+
description: '[Fase 6 — Cerrar] Genera el registro/documentación del servicio entregado (nota clínica, reporte de inspección, acta de clase, etc.). Mueve la sesión a "Documentado".',
|
|
6
|
+
schema: z.object({
|
|
7
|
+
session_id: z.string().describe('ID de la sesión'),
|
|
8
|
+
content: z.string().describe('Contenido del registro/documentación'),
|
|
9
|
+
template_id: z.string().optional().describe('ID de plantilla de documentación (si aplica)'),
|
|
10
|
+
actor: ActorSchema.describe('Quién genera la documentación (típicamente el proveedor)'),
|
|
11
|
+
}),
|
|
12
|
+
handler: async (client, args) => {
|
|
13
|
+
return client.post(`/coordinalo/sessions/${args.session_id}/documentation`, {
|
|
14
|
+
content: args.content,
|
|
15
|
+
templateId: args.template_id,
|
|
16
|
+
actor: args.actor,
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
'payments.create_sale': {
|
|
21
|
+
description: '[Fase 6 — Cerrar] Crea una venta (cargo) asociada a un servicio documentado. Mueve la sesión a "Facturado". Debe llamarse después de documentation.create.',
|
|
22
|
+
schema: z.object({
|
|
23
|
+
client_id: z.string().describe('ID del cliente'),
|
|
24
|
+
service_id: z.string().describe('ID del servicio'),
|
|
25
|
+
provider_id: z.string().describe('ID del proveedor'),
|
|
26
|
+
quantity: z.number().default(1).describe('Cantidad de sesiones'),
|
|
27
|
+
unit_price: z.number().describe('Precio unitario'),
|
|
28
|
+
}),
|
|
29
|
+
handler: async (client, args) => {
|
|
30
|
+
return client.post('/planificalo/sales', {
|
|
31
|
+
clientId: args.client_id,
|
|
32
|
+
serviceId: args.service_id,
|
|
33
|
+
providerId: args.provider_id,
|
|
34
|
+
quantity: args.quantity ?? 1,
|
|
35
|
+
unitPrice: args.unit_price,
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
'payments.record_payment': {
|
|
40
|
+
description: '[Fase 6 — Cerrar] Registra un cobro (pago recibido) contra una venta existente. Cuando el pago cubre el total, mueve la sesión a "Cerrado".',
|
|
41
|
+
schema: z.object({
|
|
42
|
+
venta_id: z.string().describe('ID de la venta'),
|
|
43
|
+
amount: z.number().describe('Monto cobrado'),
|
|
44
|
+
method: z.enum(['efectivo', 'transferencia', 'mercadopago', 'tarjeta']).describe('Método de pago'),
|
|
45
|
+
reference: z.string().optional().describe('Referencia o número de transacción'),
|
|
46
|
+
}),
|
|
47
|
+
handler: async (client, args) => {
|
|
48
|
+
return client.post('/planificalo/payments', {
|
|
49
|
+
ventaId: args.venta_id,
|
|
50
|
+
amount: args.amount,
|
|
51
|
+
paymentMethod: args.method,
|
|
52
|
+
reference: args.reference,
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
'payments.get_status': {
|
|
57
|
+
description: '[Fase 6 — Cerrar] Consulta el estado de pago de una venta específica o el estado de cuenta de un cliente. Provee sale_id para una venta o client_id para el estado de cuenta completo.',
|
|
58
|
+
schema: z.object({
|
|
59
|
+
sale_id: z.string().optional().describe('ID de la venta (para consultar una venta específica)'),
|
|
60
|
+
client_id: z.string().optional().describe('ID del cliente (para consultar estado de cuenta)'),
|
|
61
|
+
}),
|
|
62
|
+
handler: async (client, args) => {
|
|
63
|
+
if (args.sale_id) {
|
|
64
|
+
return client.get(`/planificalo/sales/${args.sale_id}`);
|
|
65
|
+
}
|
|
66
|
+
if (args.client_id) {
|
|
67
|
+
return client.get(`/planificalo/clients/${args.client_id}/account-history`);
|
|
68
|
+
}
|
|
69
|
+
throw new Error('Debe proveer sale_id o client_id');
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=cerrar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cerrar.js","sourceRoot":"","sources":["../../../src/tools/authenticated/cerrar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,sBAAsB,EAAE;QACtB,WAAW,EACT,wKAAwK;QAC1K,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAClD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;YACpE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;YAC3F,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,0DAA0D,CAAC;SACxF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAAuG,EAAE,EAAE;YACnJ,OAAO,MAAM,CAAC,IAAI,CAAC,wBAAwB,IAAI,CAAC,UAAU,gBAAgB,EAAE;gBAC1E,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,UAAU,EAAE,IAAI,CAAC,WAAW;gBAC5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from 'zod';
|
|
2
|
+
import type { CoordinaloClient } from '../../client.js';
|
|
3
|
+
import { ActorSchema } from '../schemas.js';
|
|
4
|
+
export declare const comprometerTools: {
|
|
5
|
+
'clients.get_or_create': {
|
|
6
|
+
description: string;
|
|
7
|
+
schema: z.ZodObject<{
|
|
8
|
+
email: z.ZodOptional<z.ZodString>;
|
|
9
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
10
|
+
name: z.ZodOptional<z.ZodString>;
|
|
11
|
+
last_name: z.ZodOptional<z.ZodString>;
|
|
12
|
+
actor: z.ZodObject<{
|
|
13
|
+
type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
on_behalf_of: z.ZodOptional<z.ZodObject<{
|
|
16
|
+
type: z.ZodString;
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
type: string;
|
|
20
|
+
id: string;
|
|
21
|
+
}, {
|
|
22
|
+
type: string;
|
|
23
|
+
id: string;
|
|
24
|
+
}>>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
27
|
+
id: string;
|
|
28
|
+
on_behalf_of?: {
|
|
29
|
+
type: string;
|
|
30
|
+
id: string;
|
|
31
|
+
} | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
34
|
+
id: string;
|
|
35
|
+
on_behalf_of?: {
|
|
36
|
+
type: string;
|
|
37
|
+
id: string;
|
|
38
|
+
} | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
actor: {
|
|
42
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
43
|
+
id: string;
|
|
44
|
+
on_behalf_of?: {
|
|
45
|
+
type: string;
|
|
46
|
+
id: string;
|
|
47
|
+
} | undefined;
|
|
48
|
+
};
|
|
49
|
+
email?: string | undefined;
|
|
50
|
+
phone?: string | undefined;
|
|
51
|
+
name?: string | undefined;
|
|
52
|
+
last_name?: string | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
actor: {
|
|
55
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
56
|
+
id: string;
|
|
57
|
+
on_behalf_of?: {
|
|
58
|
+
type: string;
|
|
59
|
+
id: string;
|
|
60
|
+
} | undefined;
|
|
61
|
+
};
|
|
62
|
+
email?: string | undefined;
|
|
63
|
+
phone?: string | undefined;
|
|
64
|
+
name?: string | undefined;
|
|
65
|
+
last_name?: string | undefined;
|
|
66
|
+
}>;
|
|
67
|
+
handler: (client: CoordinaloClient, args: {
|
|
68
|
+
email?: string;
|
|
69
|
+
phone?: string;
|
|
70
|
+
name?: string;
|
|
71
|
+
last_name?: string;
|
|
72
|
+
actor: z.infer<typeof ActorSchema>;
|
|
73
|
+
}) => Promise<unknown>;
|
|
74
|
+
};
|
|
75
|
+
'scheduling.book': {
|
|
76
|
+
description: string;
|
|
77
|
+
schema: z.ZodObject<{
|
|
78
|
+
service_id: z.ZodString;
|
|
79
|
+
provider_id: z.ZodString;
|
|
80
|
+
client_id: z.ZodString;
|
|
81
|
+
starts_at: z.ZodString;
|
|
82
|
+
actor: z.ZodObject<{
|
|
83
|
+
type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
on_behalf_of: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
type: z.ZodString;
|
|
87
|
+
id: z.ZodString;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
type: string;
|
|
90
|
+
id: string;
|
|
91
|
+
}, {
|
|
92
|
+
type: string;
|
|
93
|
+
id: string;
|
|
94
|
+
}>>;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
97
|
+
id: string;
|
|
98
|
+
on_behalf_of?: {
|
|
99
|
+
type: string;
|
|
100
|
+
id: string;
|
|
101
|
+
} | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
104
|
+
id: string;
|
|
105
|
+
on_behalf_of?: {
|
|
106
|
+
type: string;
|
|
107
|
+
id: string;
|
|
108
|
+
} | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
service_id: string;
|
|
112
|
+
provider_id: string;
|
|
113
|
+
actor: {
|
|
114
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
115
|
+
id: string;
|
|
116
|
+
on_behalf_of?: {
|
|
117
|
+
type: string;
|
|
118
|
+
id: string;
|
|
119
|
+
} | undefined;
|
|
120
|
+
};
|
|
121
|
+
client_id: string;
|
|
122
|
+
starts_at: string;
|
|
123
|
+
}, {
|
|
124
|
+
service_id: string;
|
|
125
|
+
provider_id: string;
|
|
126
|
+
actor: {
|
|
127
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
128
|
+
id: string;
|
|
129
|
+
on_behalf_of?: {
|
|
130
|
+
type: string;
|
|
131
|
+
id: string;
|
|
132
|
+
} | undefined;
|
|
133
|
+
};
|
|
134
|
+
client_id: string;
|
|
135
|
+
starts_at: string;
|
|
136
|
+
}>;
|
|
137
|
+
handler: (client: CoordinaloClient, args: {
|
|
138
|
+
service_id: string;
|
|
139
|
+
provider_id: string;
|
|
140
|
+
client_id: string;
|
|
141
|
+
starts_at: string;
|
|
142
|
+
actor: z.infer<typeof ActorSchema>;
|
|
143
|
+
}) => Promise<unknown>;
|
|
144
|
+
};
|
|
145
|
+
'scheduling.confirm': {
|
|
146
|
+
description: string;
|
|
147
|
+
schema: z.ZodObject<{
|
|
148
|
+
session_id: z.ZodString;
|
|
149
|
+
actor: z.ZodObject<{
|
|
150
|
+
type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
on_behalf_of: z.ZodOptional<z.ZodObject<{
|
|
153
|
+
type: z.ZodString;
|
|
154
|
+
id: z.ZodString;
|
|
155
|
+
}, "strip", z.ZodTypeAny, {
|
|
156
|
+
type: string;
|
|
157
|
+
id: string;
|
|
158
|
+
}, {
|
|
159
|
+
type: string;
|
|
160
|
+
id: string;
|
|
161
|
+
}>>;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
164
|
+
id: string;
|
|
165
|
+
on_behalf_of?: {
|
|
166
|
+
type: string;
|
|
167
|
+
id: string;
|
|
168
|
+
} | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
171
|
+
id: string;
|
|
172
|
+
on_behalf_of?: {
|
|
173
|
+
type: string;
|
|
174
|
+
id: string;
|
|
175
|
+
} | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
}, "strip", z.ZodTypeAny, {
|
|
178
|
+
actor: {
|
|
179
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
180
|
+
id: string;
|
|
181
|
+
on_behalf_of?: {
|
|
182
|
+
type: string;
|
|
183
|
+
id: string;
|
|
184
|
+
} | undefined;
|
|
185
|
+
};
|
|
186
|
+
session_id: string;
|
|
187
|
+
}, {
|
|
188
|
+
actor: {
|
|
189
|
+
type: "client" | "provider" | "organization" | "agent";
|
|
190
|
+
id: string;
|
|
191
|
+
on_behalf_of?: {
|
|
192
|
+
type: string;
|
|
193
|
+
id: string;
|
|
194
|
+
} | undefined;
|
|
195
|
+
};
|
|
196
|
+
session_id: string;
|
|
197
|
+
}>;
|
|
198
|
+
handler: (client: CoordinaloClient, args: {
|
|
199
|
+
session_id: string;
|
|
200
|
+
actor: z.infer<typeof ActorSchema>;
|
|
201
|
+
}) => Promise<unknown>;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=comprometer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comprometer.d.ts","sourceRoot":"","sources":["../../../src/tools/authenticated/comprometer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAWD,gBAAgB,QAAQ;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAqBjI,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAkB7I,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;SAAE;;CAM7G,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ActorSchema } from '../schemas.js';
|
|
3
|
+
export const comprometerTools = {
|
|
4
|
+
'clients.get_or_create': {
|
|
5
|
+
description: '[Fase 3 — Comprometer] Busca un cliente por email o teléfono. Si existe, retorna sus datos y resumen de historial. Si no existe, lo crea con los datos proporcionados. Una sola llamada para resolver la identidad del cliente antes de agendar.',
|
|
6
|
+
schema: z.object({
|
|
7
|
+
email: z.string().email().optional().describe('Email del cliente (buscará primero por email)'),
|
|
8
|
+
phone: z.string().optional().describe('Teléfono del cliente (buscará si no se provee email)'),
|
|
9
|
+
name: z.string().optional().describe('Nombre — requerido solo si el cliente no existe'),
|
|
10
|
+
last_name: z.string().optional().describe('Apellido — requerido solo si el cliente no existe'),
|
|
11
|
+
actor: ActorSchema.describe('Quién realiza la acción'),
|
|
12
|
+
}),
|
|
13
|
+
handler: async (client, args) => {
|
|
14
|
+
return client.post('/relacionalo/clients/upsert', {
|
|
15
|
+
email: args.email,
|
|
16
|
+
phone: args.phone,
|
|
17
|
+
name: args.name,
|
|
18
|
+
lastName: args.last_name,
|
|
19
|
+
actor: args.actor,
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
'scheduling.book': {
|
|
24
|
+
description: '[Fase 3 — Comprometer] Agenda una nueva sesión para un cliente con un proveedor. Crea la sesión en estado "Solicitado". Requiere haber llamado contract.get antes para conocer las reglas del servicio.',
|
|
25
|
+
schema: z.object({
|
|
26
|
+
service_id: z.string().describe('ID del servicio'),
|
|
27
|
+
provider_id: z.string().describe('ID del proveedor'),
|
|
28
|
+
client_id: z.string().describe('ID del cliente'),
|
|
29
|
+
starts_at: z.string().describe('Fecha y hora de inicio (ISO datetime)'),
|
|
30
|
+
actor: ActorSchema.describe('Quién realiza la acción'),
|
|
31
|
+
}),
|
|
32
|
+
handler: async (client, args) => {
|
|
33
|
+
return client.post('/coordinalo/sessions', {
|
|
34
|
+
serviceId: args.service_id,
|
|
35
|
+
providerId: args.provider_id,
|
|
36
|
+
clientId: args.client_id,
|
|
37
|
+
startTime: args.starts_at,
|
|
38
|
+
actor: args.actor,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
'scheduling.confirm': {
|
|
43
|
+
description: '[Fase 3 — Comprometer] Confirma una sesión agendada, moviéndola a estado "Confirmado". Ambas partes (proveedor y cliente) deben confirmar antes de que el servicio pueda iniciar.',
|
|
44
|
+
schema: z.object({
|
|
45
|
+
session_id: z.string().describe('ID de la sesión a confirmar'),
|
|
46
|
+
actor: ActorSchema.describe('Quién confirma (client, provider, organization o agent)'),
|
|
47
|
+
}),
|
|
48
|
+
handler: async (client, args) => {
|
|
49
|
+
return client.post(`/coordinalo/sessions/${args.session_id}/confirm`, {
|
|
50
|
+
actor: args.actor,
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=comprometer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comprometer.js","sourceRoot":"","sources":["../../../src/tools/authenticated/comprometer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,uBAAuB,EAAE;QACvB,WAAW,EACT,kPAAkP;QACpP,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;YAC9F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;YAC7F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;YACvF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mDAAmD,CAAC;YAC9F,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,yBAAyB,CAAC;SAC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