@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.
Files changed (70) hide show
  1. package/README.md +121 -43
  2. package/dist/client.d.ts +20 -6
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +58 -9
  5. package/dist/client.js.map +1 -1
  6. package/dist/index.js +82 -51
  7. package/dist/index.js.map +1 -1
  8. package/dist/mode.d.ts +9 -0
  9. package/dist/mode.d.ts.map +1 -0
  10. package/dist/mode.js +18 -0
  11. package/dist/mode.js.map +1 -0
  12. package/dist/tools/{clients.d.ts → authenticated/cerrar.d.ts} +76 -84
  13. package/dist/tools/authenticated/cerrar.d.ts.map +1 -0
  14. package/dist/tools/authenticated/cerrar.js +73 -0
  15. package/dist/tools/authenticated/cerrar.js.map +1 -0
  16. package/dist/tools/authenticated/comprometer.d.ts +204 -0
  17. package/dist/tools/authenticated/comprometer.d.ts.map +1 -0
  18. package/dist/tools/authenticated/comprometer.js +55 -0
  19. package/dist/tools/authenticated/comprometer.js.map +1 -0
  20. package/dist/tools/authenticated/delivery.d.ts +234 -0
  21. package/dist/tools/authenticated/delivery.d.ts.map +1 -0
  22. package/dist/tools/authenticated/delivery.js +53 -0
  23. package/dist/tools/authenticated/delivery.js.map +1 -0
  24. package/dist/tools/authenticated/entender.d.ts +35 -0
  25. package/dist/tools/authenticated/entender.d.ts.map +1 -0
  26. package/dist/tools/authenticated/entender.js +25 -0
  27. package/dist/tools/authenticated/entender.js.map +1 -0
  28. package/dist/tools/{scheduling.d.ts → authenticated/lifecycle.d.ts} +26 -103
  29. package/dist/tools/authenticated/lifecycle.d.ts.map +1 -0
  30. package/dist/tools/authenticated/lifecycle.js +63 -0
  31. package/dist/tools/authenticated/lifecycle.js.map +1 -0
  32. package/dist/tools/public/availability.d.ts +34 -0
  33. package/dist/tools/public/availability.d.ts.map +1 -0
  34. package/dist/tools/public/availability.js +22 -0
  35. package/dist/tools/public/availability.js.map +1 -0
  36. package/dist/tools/public/registry.d.ts +39 -0
  37. package/dist/tools/public/registry.d.ts.map +1 -0
  38. package/dist/tools/public/registry.js +28 -0
  39. package/dist/tools/public/registry.js.map +1 -0
  40. package/dist/tools/public/services.d.ts +18 -0
  41. package/dist/tools/public/services.d.ts.map +1 -0
  42. package/dist/tools/public/services.js +13 -0
  43. package/dist/tools/public/services.js.map +1 -0
  44. package/dist/tools/schemas.d.ts +40 -0
  45. package/dist/tools/schemas.d.ts.map +1 -0
  46. package/dist/tools/schemas.js +14 -0
  47. package/dist/tools/schemas.js.map +1 -0
  48. package/package.json +2 -2
  49. package/dist/tools/clients.d.ts.map +0 -1
  50. package/dist/tools/clients.js +0 -64
  51. package/dist/tools/clients.js.map +0 -1
  52. package/dist/tools/notifications.d.ts +0 -31
  53. package/dist/tools/notifications.d.ts.map +0 -1
  54. package/dist/tools/notifications.js +0 -22
  55. package/dist/tools/notifications.js.map +0 -1
  56. package/dist/tools/payments.d.ts +0 -105
  57. package/dist/tools/payments.d.ts.map +0 -1
  58. package/dist/tools/payments.js +0 -70
  59. package/dist/tools/payments.js.map +0 -1
  60. package/dist/tools/payroll.d.ts +0 -106
  61. package/dist/tools/payroll.d.ts.map +0 -1
  62. package/dist/tools/payroll.js +0 -77
  63. package/dist/tools/payroll.js.map +0 -1
  64. package/dist/tools/providers.d.ts +0 -52
  65. package/dist/tools/providers.d.ts.map +0 -1
  66. package/dist/tools/providers.js +0 -37
  67. package/dist/tools/providers.js.map +0 -1
  68. package/dist/tools/scheduling.d.ts.map +0 -1
  69. package/dist/tools/scheduling.js +0 -99
  70. package/dist/tools/scheduling.js.map +0 -1
@@ -0,0 +1,234 @@
1
+ import { z } from 'zod';
2
+ import type { CoordinaloClient } from '../../client.js';
3
+ import { ActorSchema, LocationSchema } from '../schemas.js';
4
+ export declare const deliveryTools: {
5
+ 'delivery.checkin': {
6
+ description: string;
7
+ schema: z.ZodObject<{
8
+ session_id: z.ZodString;
9
+ actor: z.ZodObject<{
10
+ type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
11
+ id: z.ZodString;
12
+ on_behalf_of: z.ZodOptional<z.ZodObject<{
13
+ type: z.ZodString;
14
+ id: z.ZodString;
15
+ }, "strip", z.ZodTypeAny, {
16
+ type: string;
17
+ id: string;
18
+ }, {
19
+ type: string;
20
+ id: string;
21
+ }>>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ type: "client" | "provider" | "organization" | "agent";
24
+ id: string;
25
+ on_behalf_of?: {
26
+ type: string;
27
+ id: string;
28
+ } | undefined;
29
+ }, {
30
+ type: "client" | "provider" | "organization" | "agent";
31
+ id: string;
32
+ on_behalf_of?: {
33
+ type: string;
34
+ id: string;
35
+ } | undefined;
36
+ }>;
37
+ location: z.ZodOptional<z.ZodObject<{
38
+ lat: z.ZodNumber;
39
+ lng: z.ZodNumber;
40
+ }, "strip", z.ZodTypeAny, {
41
+ lat: number;
42
+ lng: number;
43
+ }, {
44
+ lat: number;
45
+ lng: number;
46
+ }>>;
47
+ timestamp: z.ZodOptional<z.ZodString>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ actor: {
50
+ type: "client" | "provider" | "organization" | "agent";
51
+ id: string;
52
+ on_behalf_of?: {
53
+ type: string;
54
+ id: string;
55
+ } | undefined;
56
+ };
57
+ session_id: string;
58
+ location?: {
59
+ lat: number;
60
+ lng: number;
61
+ } | undefined;
62
+ timestamp?: string | undefined;
63
+ }, {
64
+ actor: {
65
+ type: "client" | "provider" | "organization" | "agent";
66
+ id: string;
67
+ on_behalf_of?: {
68
+ type: string;
69
+ id: string;
70
+ } | undefined;
71
+ };
72
+ session_id: string;
73
+ location?: {
74
+ lat: number;
75
+ lng: number;
76
+ } | undefined;
77
+ timestamp?: string | undefined;
78
+ }>;
79
+ handler: (client: CoordinaloClient, args: {
80
+ session_id: string;
81
+ actor: z.infer<typeof ActorSchema>;
82
+ location?: z.infer<typeof LocationSchema>;
83
+ timestamp?: string;
84
+ }) => Promise<unknown>;
85
+ };
86
+ 'delivery.checkout': {
87
+ description: string;
88
+ schema: z.ZodObject<{
89
+ session_id: z.ZodString;
90
+ actor: z.ZodObject<{
91
+ type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
92
+ id: z.ZodString;
93
+ on_behalf_of: z.ZodOptional<z.ZodObject<{
94
+ type: z.ZodString;
95
+ id: z.ZodString;
96
+ }, "strip", z.ZodTypeAny, {
97
+ type: string;
98
+ id: string;
99
+ }, {
100
+ type: string;
101
+ id: string;
102
+ }>>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ type: "client" | "provider" | "organization" | "agent";
105
+ id: string;
106
+ on_behalf_of?: {
107
+ type: string;
108
+ id: string;
109
+ } | undefined;
110
+ }, {
111
+ type: "client" | "provider" | "organization" | "agent";
112
+ id: string;
113
+ on_behalf_of?: {
114
+ type: string;
115
+ id: string;
116
+ } | undefined;
117
+ }>;
118
+ location: z.ZodOptional<z.ZodObject<{
119
+ lat: z.ZodNumber;
120
+ lng: z.ZodNumber;
121
+ }, "strip", z.ZodTypeAny, {
122
+ lat: number;
123
+ lng: number;
124
+ }, {
125
+ lat: number;
126
+ lng: number;
127
+ }>>;
128
+ timestamp: z.ZodOptional<z.ZodString>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ actor: {
131
+ type: "client" | "provider" | "organization" | "agent";
132
+ id: string;
133
+ on_behalf_of?: {
134
+ type: string;
135
+ id: string;
136
+ } | undefined;
137
+ };
138
+ session_id: string;
139
+ location?: {
140
+ lat: number;
141
+ lng: number;
142
+ } | undefined;
143
+ timestamp?: string | undefined;
144
+ }, {
145
+ actor: {
146
+ type: "client" | "provider" | "organization" | "agent";
147
+ id: string;
148
+ on_behalf_of?: {
149
+ type: string;
150
+ id: string;
151
+ } | undefined;
152
+ };
153
+ session_id: string;
154
+ location?: {
155
+ lat: number;
156
+ lng: number;
157
+ } | undefined;
158
+ timestamp?: string | undefined;
159
+ }>;
160
+ handler: (client: CoordinaloClient, args: {
161
+ session_id: string;
162
+ actor: z.infer<typeof ActorSchema>;
163
+ location?: z.infer<typeof LocationSchema>;
164
+ timestamp?: string;
165
+ }) => Promise<unknown>;
166
+ };
167
+ 'delivery.record_evidence': {
168
+ description: string;
169
+ schema: z.ZodObject<{
170
+ session_id: z.ZodString;
171
+ evidence_type: z.ZodEnum<["gps", "signature", "photo", "document", "duration", "notes"]>;
172
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
173
+ actor: z.ZodObject<{
174
+ type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
175
+ id: z.ZodString;
176
+ on_behalf_of: z.ZodOptional<z.ZodObject<{
177
+ type: z.ZodString;
178
+ id: z.ZodString;
179
+ }, "strip", z.ZodTypeAny, {
180
+ type: string;
181
+ id: string;
182
+ }, {
183
+ type: string;
184
+ id: string;
185
+ }>>;
186
+ }, "strip", z.ZodTypeAny, {
187
+ type: "client" | "provider" | "organization" | "agent";
188
+ id: string;
189
+ on_behalf_of?: {
190
+ type: string;
191
+ id: string;
192
+ } | undefined;
193
+ }, {
194
+ type: "client" | "provider" | "organization" | "agent";
195
+ id: string;
196
+ on_behalf_of?: {
197
+ type: string;
198
+ id: string;
199
+ } | undefined;
200
+ }>;
201
+ }, "strip", z.ZodTypeAny, {
202
+ actor: {
203
+ type: "client" | "provider" | "organization" | "agent";
204
+ id: string;
205
+ on_behalf_of?: {
206
+ type: string;
207
+ id: string;
208
+ } | undefined;
209
+ };
210
+ session_id: string;
211
+ evidence_type: "gps" | "signature" | "photo" | "document" | "duration" | "notes";
212
+ data: Record<string, unknown>;
213
+ }, {
214
+ actor: {
215
+ type: "client" | "provider" | "organization" | "agent";
216
+ id: string;
217
+ on_behalf_of?: {
218
+ type: string;
219
+ id: string;
220
+ } | undefined;
221
+ };
222
+ session_id: string;
223
+ evidence_type: "gps" | "signature" | "photo" | "document" | "duration" | "notes";
224
+ data: Record<string, unknown>;
225
+ }>;
226
+ handler: (client: CoordinaloClient, args: {
227
+ session_id: string;
228
+ evidence_type: string;
229
+ data: Record<string, unknown>;
230
+ actor: z.infer<typeof ActorSchema>;
231
+ }) => Promise<unknown>;
232
+ };
233
+ };
234
+ //# sourceMappingURL=delivery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery.d.ts","sourceRoot":"","sources":["../../../src/tools/authenticated/delivery.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,cAAc,EAAE,MAAM,eAAe,CAAC;AAE5D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAUE,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;YAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAkBjJ,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;YAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAkBjJ,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,aAAa,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;SAAE;;CAQnK,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ import { ActorSchema, LocationSchema } from '../schemas.js';
3
+ export const deliveryTools = {
4
+ 'delivery.checkin': {
5
+ description: '[Fase 5 — Verificar entrega] Registra el check-in del proveedor o cliente, moviendo la sesión a "En Curso". Captura timestamp y ubicación GPS como evidencia de inicio de servicio.',
6
+ schema: z.object({
7
+ session_id: z.string().describe('ID de la sesión'),
8
+ actor: ActorSchema.describe('Quién hace check-in (provider o client)'),
9
+ location: LocationSchema.optional().describe('Ubicación GPS al momento del check-in'),
10
+ timestamp: z.string().optional().describe('ISO datetime del check-in (default: ahora)'),
11
+ }),
12
+ handler: async (client, args) => {
13
+ return client.post(`/coordinalo/sessions/${args.session_id}/checkin`, {
14
+ actor: args.actor,
15
+ location: args.location,
16
+ timestamp: args.timestamp,
17
+ });
18
+ },
19
+ },
20
+ 'delivery.checkout': {
21
+ description: '[Fase 5 — Verificar entrega] Registra el check-out al finalizar el servicio, moviendo la sesión a "Completado". Captura timestamp y ubicación GPS. La duración real se calcula automáticamente.',
22
+ schema: z.object({
23
+ session_id: z.string().describe('ID de la sesión'),
24
+ actor: ActorSchema.describe('Quién hace check-out (provider o client)'),
25
+ location: LocationSchema.optional().describe('Ubicación GPS al momento del check-out'),
26
+ timestamp: z.string().optional().describe('ISO datetime del check-out (default: ahora)'),
27
+ }),
28
+ handler: async (client, args) => {
29
+ return client.post(`/coordinalo/sessions/${args.session_id}/checkout`, {
30
+ actor: args.actor,
31
+ location: args.location,
32
+ timestamp: args.timestamp,
33
+ });
34
+ },
35
+ },
36
+ 'delivery.record_evidence': {
37
+ description: '[Fase 5 — Verificar entrega] Registra evidencia de entrega del servicio según los requisitos del contrato. Tipos: GPS, firma, foto, documento, duración, notas. Consultar contract.get para conocer la evidencia requerida por vertical.',
38
+ schema: z.object({
39
+ session_id: z.string().describe('ID de la sesión'),
40
+ evidence_type: z.enum(['gps', 'signature', 'photo', 'document', 'duration', 'notes']).describe('Tipo de evidencia'),
41
+ data: z.record(z.unknown()).describe('Payload de la evidencia (estructura varía por tipo)'),
42
+ actor: ActorSchema.describe('Quién registra la evidencia'),
43
+ }),
44
+ handler: async (client, args) => {
45
+ return client.post(`/coordinalo/sessions/${args.session_id}/evidence`, {
46
+ evidenceType: args.evidence_type,
47
+ data: args.data,
48
+ actor: args.actor,
49
+ });
50
+ },
51
+ },
52
+ };
53
+ //# sourceMappingURL=delivery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery.js","sourceRoot":"","sources":["../../../src/tools/authenticated/delivery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,kBAAkB,EAAE;QAClB,WAAW,EACT,qLAAqL;QACvL,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAClD,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,yCAAyC,CAAC;YACtE,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;YACrF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;SACxF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAA+H,EAAE,EAAE;YAC3K,OAAO,MAAM,CAAC,IAAI,CAAC,wBAAwB,IAAI,CAAC,UAAU,UAAU,EAAE;gBACpE,KAAK,EAAE,IAAI,CAAC,KAAK;gBAC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3F,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,6BAA6B,CAAC;SAC3D,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAAsH,EAAE,EAAE;YAClK,OAAO,MAAM,CAAC,IAAI,CAAC,wBAAwB,IAAI,CAAC,UAAU,WAAW,EAAE;gBACrE,YAAY,EAAE,IAAI,CAAC,aAAa;gBAChC,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ import type { CoordinaloClient } from '../../client.js';
3
+ export declare const entenderTools: {
4
+ 'service.get': {
5
+ description: string;
6
+ schema: z.ZodObject<{
7
+ service_id: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ service_id: string;
10
+ }, {
11
+ service_id: string;
12
+ }>;
13
+ handler: (client: CoordinaloClient, args: {
14
+ service_id: string;
15
+ }) => Promise<unknown>;
16
+ };
17
+ 'contract.get': {
18
+ description: string;
19
+ schema: z.ZodObject<{
20
+ service_id: z.ZodString;
21
+ org_id: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ service_id: string;
24
+ org_id: string;
25
+ }, {
26
+ service_id: string;
27
+ org_id: string;
28
+ }>;
29
+ handler: (client: CoordinaloClient, args: {
30
+ service_id: string;
31
+ org_id: string;
32
+ }) => Promise<unknown>;
33
+ };
34
+ };
35
+ //# sourceMappingURL=entender.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entender.d.ts","sourceRoot":"","sources":["../../../src/tools/authenticated/entender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,aAAa;;;;;;;;;;0BAOE,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;0BAY9C,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE;;CAMzF,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ export const entenderTools = {
3
+ 'service.get': {
4
+ description: '[Fase 2 — Entender] Obtiene las 9 dimensiones de un servicio: qué se entrega, quién lo entrega, quién lo recibe, quién lo solicita, quién paga, cuándo, dónde, evidencia requerida y resultado esperado. Llama esto para entender completamente un servicio antes de comprometerse.',
5
+ schema: z.object({
6
+ service_id: z.string().describe('ID del servicio'),
7
+ }),
8
+ handler: async (client, args) => {
9
+ return client.get(`/coordinalo/services/${args.service_id}`);
10
+ },
11
+ },
12
+ 'contract.get': {
13
+ description: '[Fase 2 — Entender] Obtiene el contrato de servicio pre-acordado. Define las reglas bajo las que opera el servicio: evidencia requerida, políticas de cancelación, inasistencia y arbitraje. DEBE llamarse antes de cualquier acción en Fase 3+.',
14
+ schema: z.object({
15
+ service_id: z.string().describe('ID del servicio'),
16
+ org_id: z.string().describe('ID de la organización'),
17
+ }),
18
+ handler: async (client, args) => {
19
+ return client.get(`/coordinalo/services/${args.service_id}/contract`, {
20
+ orgId: args.org_id,
21
+ });
22
+ },
23
+ },
24
+ };
25
+ //# sourceMappingURL=entender.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entender.js","sourceRoot":"","sources":["../../../src/tools/authenticated/entender.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,aAAa,EAAE;QACb,WAAW,EACT,qRAAqR;QACvR,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;SACnD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAA4B,EAAE,EAAE;YACxE,OAAO,MAAM,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAC/D,CAAC;KACF;IAED,cAAc,EAAE;QACd,WAAW,EACT,kPAAkP;QACpP,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;YAClD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;SACrD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAA4C,EAAE,EAAE;YACxF,OAAO,MAAM,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,UAAU,WAAW,EAAE;gBACpE,KAAK,EAAE,IAAI,CAAC,MAAM;aACnB,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC"}
@@ -1,103 +1,25 @@
1
1
  import { z } from 'zod';
2
- import type { CoordinaloClient } from '../client.js';
3
- declare const ActorSchema: z.ZodObject<{
4
- type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
5
- id: z.ZodString;
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 schedulingTools: {
32
- 'scheduling.check_availability': {
2
+ import type { CoordinaloClient } from '../../client.js';
3
+ import { ActorSchema } from '../schemas.js';
4
+ export declare const lifecycleTools: {
5
+ 'lifecycle.get_state': {
33
6
  description: string;
34
7
  schema: z.ZodObject<{
35
- provider_id: z.ZodOptional<z.ZodString>;
36
- service_id: z.ZodOptional<z.ZodString>;
37
- date_from: z.ZodString;
38
- date_to: z.ZodString;
39
- }, "strip", z.ZodTypeAny, {
40
- date_from: string;
41
- date_to: string;
42
- provider_id?: string | undefined;
43
- service_id?: string | undefined;
44
- }, {
45
- date_from: string;
46
- date_to: string;
47
- provider_id?: string | undefined;
48
- service_id?: string | undefined;
49
- }>;
50
- handler: (client: CoordinaloClient, args: {
51
- provider_id?: string;
52
- service_id?: string;
53
- date_from: string;
54
- date_to: string;
55
- }) => Promise<unknown>;
56
- };
57
- 'scheduling.list_sessions': {
58
- description: string;
59
- schema: z.ZodObject<{
60
- date_from: z.ZodOptional<z.ZodString>;
61
- date_to: z.ZodOptional<z.ZodString>;
62
- provider_id: z.ZodOptional<z.ZodString>;
63
- client_id: z.ZodOptional<z.ZodString>;
64
- status: z.ZodOptional<z.ZodString>;
65
- limit: z.ZodDefault<z.ZodNumber>;
66
- page: z.ZodDefault<z.ZodNumber>;
8
+ session_id: z.ZodString;
67
9
  }, "strip", z.ZodTypeAny, {
68
- limit: number;
69
- page: number;
70
- status?: string | undefined;
71
- provider_id?: string | undefined;
72
- date_from?: string | undefined;
73
- date_to?: string | undefined;
74
- client_id?: string | undefined;
10
+ session_id: string;
75
11
  }, {
76
- status?: string | undefined;
77
- provider_id?: string | undefined;
78
- date_from?: string | undefined;
79
- date_to?: string | undefined;
80
- client_id?: string | undefined;
81
- limit?: number | undefined;
82
- page?: number | undefined;
12
+ session_id: string;
83
13
  }>;
84
14
  handler: (client: CoordinaloClient, args: {
85
- date_from?: string;
86
- date_to?: string;
87
- provider_id?: string;
88
- client_id?: string;
89
- status?: string;
90
- limit?: number;
91
- page?: number;
15
+ session_id: string;
92
16
  }) => Promise<unknown>;
93
17
  };
94
- 'scheduling.book': {
18
+ 'lifecycle.transition': {
95
19
  description: string;
96
20
  schema: z.ZodObject<{
97
- service_id: z.ZodString;
98
- provider_id: z.ZodString;
99
- client_id: z.ZodString;
100
- starts_at: z.ZodString;
21
+ session_id: z.ZodString;
22
+ to_state: z.ZodEnum<["matched", "scheduled", "confirmed", "in_progress", "completed", "documented", "billed", "closed", "cancelled"]>;
101
23
  actor: z.ZodObject<{
102
24
  type: z.ZodEnum<["client", "provider", "organization", "agent"]>;
103
25
  id: z.ZodString;
@@ -126,11 +48,9 @@ export declare const schedulingTools: {
126
48
  id: string;
127
49
  } | undefined;
128
50
  }>;
51
+ reason: z.ZodOptional<z.ZodString>;
52
+ evidence: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
129
53
  }, "strip", z.ZodTypeAny, {
130
- provider_id: string;
131
- service_id: string;
132
- client_id: string;
133
- starts_at: string;
134
54
  actor: {
135
55
  type: "client" | "provider" | "organization" | "agent";
136
56
  id: string;
@@ -139,11 +59,11 @@ export declare const schedulingTools: {
139
59
  id: string;
140
60
  } | undefined;
141
61
  };
62
+ session_id: string;
63
+ to_state: "matched" | "scheduled" | "confirmed" | "in_progress" | "completed" | "documented" | "billed" | "closed" | "cancelled";
64
+ reason?: string | undefined;
65
+ evidence?: Record<string, unknown> | undefined;
142
66
  }, {
143
- provider_id: string;
144
- service_id: string;
145
- client_id: string;
146
- starts_at: string;
147
67
  actor: {
148
68
  type: "client" | "provider" | "organization" | "agent";
149
69
  id: string;
@@ -152,13 +72,17 @@ export declare const schedulingTools: {
152
72
  id: string;
153
73
  } | undefined;
154
74
  };
75
+ session_id: string;
76
+ to_state: "matched" | "scheduled" | "confirmed" | "in_progress" | "completed" | "documented" | "billed" | "closed" | "cancelled";
77
+ reason?: string | undefined;
78
+ evidence?: Record<string, unknown> | undefined;
155
79
  }>;
156
80
  handler: (client: CoordinaloClient, args: {
157
- service_id: string;
158
- provider_id: string;
159
- client_id: string;
160
- starts_at: string;
81
+ session_id: string;
82
+ to_state: string;
161
83
  actor: z.infer<typeof ActorSchema>;
84
+ reason?: string;
85
+ evidence?: Record<string, unknown>;
162
86
  }) => Promise<unknown>;
163
87
  };
164
88
  'scheduling.reschedule': {
@@ -286,5 +210,4 @@ export declare const schedulingTools: {
286
210
  }) => Promise<unknown>;
287
211
  };
288
212
  };
289
- export {};
290
- //# sourceMappingURL=scheduling.d.ts.map
213
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/tools/authenticated/lifecycle.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,cAAc;;;;;;;;;;0BAOC,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAkB9C,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAkBzJ,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,YAAY,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgBxG,gBAAgB,QAAQ;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;SAAE;;CAO9H,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { z } from 'zod';
2
+ import { ActorSchema } from '../schemas.js';
3
+ export const lifecycleTools = {
4
+ 'lifecycle.get_state': {
5
+ description: '[Fase 4 — Ciclo de vida] Obtiene el estado actual de una sesión en el ciclo de vida Servicialo, incluyendo las transiciones disponibles desde el estado actual y el historial de transiciones pasadas.',
6
+ schema: z.object({
7
+ session_id: z.string().describe('ID de la sesión'),
8
+ }),
9
+ handler: async (client, args) => {
10
+ return client.get(`/coordinalo/sessions/${args.session_id}/lifecycle`);
11
+ },
12
+ },
13
+ 'lifecycle.transition': {
14
+ description: '[Fase 4 — Ciclo de vida] Ejecuta una transición de estado en el ciclo de vida de una sesión. Transiciones válidas: requested→matched, matched→scheduled, scheduled→confirmed, confirmed→in_progress, in_progress→completed, completed→documented, documented→billed, billed→closed, any→cancelled. Cada transición puede requerir evidencia según el contrato del servicio.',
15
+ schema: z.object({
16
+ session_id: z.string().describe('ID de la sesión'),
17
+ to_state: z.enum([
18
+ 'matched', 'scheduled', 'confirmed', 'in_progress',
19
+ 'completed', 'documented', 'billed', 'closed', 'cancelled',
20
+ ]).describe('Estado destino de la transición'),
21
+ actor: ActorSchema.describe('Quién ejecuta la transición'),
22
+ reason: z.string().optional().describe('Motivo de la transición (requerido para cancelled)'),
23
+ evidence: z.record(z.unknown()).optional().describe('Evidencia requerida por el contrato para esta transición'),
24
+ }),
25
+ handler: async (client, args) => {
26
+ return client.post(`/coordinalo/sessions/${args.session_id}/lifecycle/transition`, {
27
+ toState: args.to_state,
28
+ actor: args.actor,
29
+ reason: args.reason,
30
+ evidence: args.evidence,
31
+ });
32
+ },
33
+ },
34
+ 'scheduling.reschedule': {
35
+ description: '[Fase 4 — Ciclo de vida] Reagenda una sesión existente a una nueva fecha/hora. Flujo de excepción: la sesión vuelve a estado "Scheduled" con nuevo horario. La política de reagendamiento del contrato puede aplicar cargos.',
36
+ schema: z.object({
37
+ session_id: z.string().describe('ID de la sesión a reagendar'),
38
+ new_datetime: z.string().describe('Nueva fecha y hora (ISO datetime)'),
39
+ actor: ActorSchema.describe('Quién realiza la acción'),
40
+ }),
41
+ handler: async (client, args) => {
42
+ return client.put(`/coordinalo/sessions/${args.session_id}`, {
43
+ startTime: args.new_datetime,
44
+ actor: args.actor,
45
+ });
46
+ },
47
+ },
48
+ 'scheduling.cancel': {
49
+ description: '[Fase 4 — Ciclo de vida] Cancela una sesión existente. Flujo de excepción: aplica la política de cancelación definida en el contrato (reembolso total fuera de ventana de penalidad, parcial/nulo dentro). Llama contract.get primero para conocer la política.',
50
+ schema: z.object({
51
+ session_id: z.string().describe('ID de la sesión a cancelar'),
52
+ reason: z.string().optional().describe('Motivo de la cancelación'),
53
+ actor: ActorSchema.describe('Quién realiza la acción'),
54
+ }),
55
+ handler: async (client, args) => {
56
+ return client.post(`/coordinalo/sessions/${args.session_id}/cancel`, {
57
+ reason: args.reason,
58
+ actor: args.actor,
59
+ });
60
+ },
61
+ },
62
+ };
63
+ //# sourceMappingURL=lifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../../src/tools/authenticated/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,qBAAqB,EAAE;QACrB,WAAW,EACT,wMAAwM;QAC1M,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;SACnD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MA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,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;YAC9D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;YACtE,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,yBAAyB,CAAC;SACvD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAAsF,EAAE,EAAE;YAClI,OAAO,MAAM,CAAC,GAAG,CAAC,wBAAwB,IAAI,CAAC,UAAU,EAAE,EAAE;gBAC3D,SAAS,EAAE,IAAI,CAAC,YAAY;gBAC5B,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC,CAAC;QACL,CAAC;KACF;IAED,mBAAmB,EAAE;QACnB,WAAW,EACT,iQAAiQ;QACnQ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;YAC7D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;YAClE,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,yBAAyB,CAAC;SACvD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,MAAwB,EAAE,IAAiF,EAAE,EAAE;YAC7H,OAAO,MAAM,CAAC,IAAI,CAAC,wBAAwB,IAAI,CAAC,UAAU,SAAS,EAAE;gBACnE,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC,CAAC;QACL,CAAC;KACF;CACF,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ import type { CoordinaloClient } from '../../client.js';
3
+ export declare const publicAvailabilityTools: {
4
+ 'scheduling.check_availability': {
5
+ description: string;
6
+ schema: z.ZodObject<{
7
+ org_slug: z.ZodString;
8
+ service_id: z.ZodOptional<z.ZodString>;
9
+ provider_id: z.ZodOptional<z.ZodString>;
10
+ date_from: z.ZodString;
11
+ date_to: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ org_slug: string;
14
+ date_from: string;
15
+ date_to: string;
16
+ service_id?: string | undefined;
17
+ provider_id?: string | undefined;
18
+ }, {
19
+ org_slug: string;
20
+ date_from: string;
21
+ date_to: string;
22
+ service_id?: string | undefined;
23
+ provider_id?: string | undefined;
24
+ }>;
25
+ handler: (client: CoordinaloClient, args: {
26
+ org_slug: string;
27
+ service_id?: string;
28
+ provider_id?: string;
29
+ date_from: string;
30
+ date_to: string;
31
+ }) => Promise<unknown>;
32
+ };
33
+ };
34
+ //# sourceMappingURL=availability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"availability.d.ts","sourceRoot":"","sources":["../../../src/tools/public/availability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;0BAUR,gBAAgB,QAAQ;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,UAAU,CAAC,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE;;CAStJ,CAAC"}