mcp-grampsweb 1.0.2 → 1.2.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/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -1
- package/dist/constants.d.ts +7 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -1
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/prompts/index.d.ts +26 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +310 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/schemas/common.d.ts +67 -4
- package/dist/schemas/common.d.ts.map +1 -1
- package/dist/schemas/common.js +13 -2
- package/dist/schemas/common.js.map +1 -1
- package/dist/schemas/entities.d.ts +154 -36
- package/dist/schemas/entities.d.ts.map +1 -1
- package/dist/tools/analysis.d.ts.map +1 -1
- package/dist/tools/analysis.js +134 -56
- package/dist/tools/analysis.js.map +1 -1
- package/dist/tools/convenience.d.ts +59 -0
- package/dist/tools/convenience.d.ts.map +1 -0
- package/dist/tools/convenience.js +131 -0
- package/dist/tools/convenience.js.map +1 -0
- package/dist/tools/create.d.ts +35 -0
- package/dist/tools/create.d.ts.map +1 -1
- package/dist/tools/create.js +216 -44
- package/dist/tools/create.js.map +1 -1
- package/dist/tools/index.d.ts +253 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +7 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/list.d.ts +88 -0
- package/dist/tools/list.d.ts.map +1 -0
- package/dist/tools/list.js +222 -0
- package/dist/tools/list.js.map +1 -0
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +67 -24
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/update.d.ts +662 -0
- package/dist/tools/update.d.ts.map +1 -0
- package/dist/tools/update.js +383 -0
- package/dist/tools/update.js.map +1 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/formatting.js +23 -2
- package/dist/utils/formatting.js.map +1 -1
- package/dist/utils/response.d.ts +34 -0
- package/dist/utils/response.d.ts.map +1 -0
- package/dist/utils/response.js +71 -0
- package/dist/utils/response.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/schemas/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qBAAqB;AACrB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,WAAW;IACX,cAAc;IACd,OAAO;IACP,OAAO;CACR,CAAC,CAAC;AAEH,6BAA6B;AAC7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;AAEzF,yBAAyB;AACzB,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OA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AAM;YACT,OAAO,CAAC,CAAC;QACX,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC;QACX;YACE,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,oBAAoB;AACpB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAChF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CAClG,CAAC,CAAC"}
|
|
@@ -7,7 +7,30 @@ export declare const createPersonSchema: z.ZodObject<{
|
|
|
7
7
|
primary_name: z.ZodObject<{
|
|
8
8
|
_class: z.ZodOptional<z.ZodLiteral<"Name">>;
|
|
9
9
|
first_name: z.ZodOptional<z.ZodString>;
|
|
10
|
+
call_name: z.ZodOptional<z.ZodString>;
|
|
10
11
|
surname: z.ZodOptional<z.ZodString>;
|
|
12
|
+
surname_list: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
13
|
+
_class: z.ZodOptional<z.ZodLiteral<"Surname">>;
|
|
14
|
+
surname: z.ZodString;
|
|
15
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
16
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
origintype: z.ZodOptional<z.ZodString>;
|
|
18
|
+
connector: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
surname: string;
|
|
21
|
+
_class?: "Surname" | undefined;
|
|
22
|
+
prefix?: string | undefined;
|
|
23
|
+
primary?: boolean | undefined;
|
|
24
|
+
origintype?: string | undefined;
|
|
25
|
+
connector?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
surname: string;
|
|
28
|
+
_class?: "Surname" | undefined;
|
|
29
|
+
prefix?: string | undefined;
|
|
30
|
+
primary?: boolean | undefined;
|
|
31
|
+
origintype?: string | undefined;
|
|
32
|
+
connector?: string | undefined;
|
|
33
|
+
}>, "many">>;
|
|
11
34
|
suffix: z.ZodOptional<z.ZodString>;
|
|
12
35
|
title: z.ZodOptional<z.ZodString>;
|
|
13
36
|
type: z.ZodOptional<z.ZodString>;
|
|
@@ -15,24 +38,65 @@ export declare const createPersonSchema: z.ZodObject<{
|
|
|
15
38
|
}, "strip", z.ZodTypeAny, {
|
|
16
39
|
_class?: "Name" | undefined;
|
|
17
40
|
type?: string | undefined;
|
|
18
|
-
first_name?: string | undefined;
|
|
19
41
|
surname?: string | undefined;
|
|
42
|
+
primary?: boolean | undefined;
|
|
43
|
+
first_name?: string | undefined;
|
|
44
|
+
call_name?: string | undefined;
|
|
45
|
+
surname_list?: {
|
|
46
|
+
surname: string;
|
|
47
|
+
_class?: "Surname" | undefined;
|
|
48
|
+
prefix?: string | undefined;
|
|
49
|
+
primary?: boolean | undefined;
|
|
50
|
+
origintype?: string | undefined;
|
|
51
|
+
connector?: string | undefined;
|
|
52
|
+
}[] | undefined;
|
|
20
53
|
suffix?: string | undefined;
|
|
21
54
|
title?: string | undefined;
|
|
22
|
-
primary?: boolean | undefined;
|
|
23
55
|
}, {
|
|
24
56
|
_class?: "Name" | undefined;
|
|
25
57
|
type?: string | undefined;
|
|
26
|
-
first_name?: string | undefined;
|
|
27
58
|
surname?: string | undefined;
|
|
59
|
+
primary?: boolean | undefined;
|
|
60
|
+
first_name?: string | undefined;
|
|
61
|
+
call_name?: string | undefined;
|
|
62
|
+
surname_list?: {
|
|
63
|
+
surname: string;
|
|
64
|
+
_class?: "Surname" | undefined;
|
|
65
|
+
prefix?: string | undefined;
|
|
66
|
+
primary?: boolean | undefined;
|
|
67
|
+
origintype?: string | undefined;
|
|
68
|
+
connector?: string | undefined;
|
|
69
|
+
}[] | undefined;
|
|
28
70
|
suffix?: string | undefined;
|
|
29
71
|
title?: string | undefined;
|
|
30
|
-
primary?: boolean | undefined;
|
|
31
72
|
}>;
|
|
32
73
|
alternate_names: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
33
74
|
_class: z.ZodOptional<z.ZodLiteral<"Name">>;
|
|
34
75
|
first_name: z.ZodOptional<z.ZodString>;
|
|
76
|
+
call_name: z.ZodOptional<z.ZodString>;
|
|
35
77
|
surname: z.ZodOptional<z.ZodString>;
|
|
78
|
+
surname_list: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
79
|
+
_class: z.ZodOptional<z.ZodLiteral<"Surname">>;
|
|
80
|
+
surname: z.ZodString;
|
|
81
|
+
prefix: z.ZodOptional<z.ZodString>;
|
|
82
|
+
primary: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
origintype: z.ZodOptional<z.ZodString>;
|
|
84
|
+
connector: z.ZodOptional<z.ZodString>;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
surname: string;
|
|
87
|
+
_class?: "Surname" | undefined;
|
|
88
|
+
prefix?: string | undefined;
|
|
89
|
+
primary?: boolean | undefined;
|
|
90
|
+
origintype?: string | undefined;
|
|
91
|
+
connector?: string | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
surname: string;
|
|
94
|
+
_class?: "Surname" | undefined;
|
|
95
|
+
prefix?: string | undefined;
|
|
96
|
+
primary?: boolean | undefined;
|
|
97
|
+
origintype?: string | undefined;
|
|
98
|
+
connector?: string | undefined;
|
|
99
|
+
}>, "many">>;
|
|
36
100
|
suffix: z.ZodOptional<z.ZodString>;
|
|
37
101
|
title: z.ZodOptional<z.ZodString>;
|
|
38
102
|
type: z.ZodOptional<z.ZodString>;
|
|
@@ -40,19 +104,37 @@ export declare const createPersonSchema: z.ZodObject<{
|
|
|
40
104
|
}, "strip", z.ZodTypeAny, {
|
|
41
105
|
_class?: "Name" | undefined;
|
|
42
106
|
type?: string | undefined;
|
|
43
|
-
first_name?: string | undefined;
|
|
44
107
|
surname?: string | undefined;
|
|
108
|
+
primary?: boolean | undefined;
|
|
109
|
+
first_name?: string | undefined;
|
|
110
|
+
call_name?: string | undefined;
|
|
111
|
+
surname_list?: {
|
|
112
|
+
surname: string;
|
|
113
|
+
_class?: "Surname" | undefined;
|
|
114
|
+
prefix?: string | undefined;
|
|
115
|
+
primary?: boolean | undefined;
|
|
116
|
+
origintype?: string | undefined;
|
|
117
|
+
connector?: string | undefined;
|
|
118
|
+
}[] | undefined;
|
|
45
119
|
suffix?: string | undefined;
|
|
46
120
|
title?: string | undefined;
|
|
47
|
-
primary?: boolean | undefined;
|
|
48
121
|
}, {
|
|
49
122
|
_class?: "Name" | undefined;
|
|
50
123
|
type?: string | undefined;
|
|
51
|
-
first_name?: string | undefined;
|
|
52
124
|
surname?: string | undefined;
|
|
125
|
+
primary?: boolean | undefined;
|
|
126
|
+
first_name?: string | undefined;
|
|
127
|
+
call_name?: string | undefined;
|
|
128
|
+
surname_list?: {
|
|
129
|
+
surname: string;
|
|
130
|
+
_class?: "Surname" | undefined;
|
|
131
|
+
prefix?: string | undefined;
|
|
132
|
+
primary?: boolean | undefined;
|
|
133
|
+
origintype?: string | undefined;
|
|
134
|
+
connector?: string | undefined;
|
|
135
|
+
}[] | undefined;
|
|
53
136
|
suffix?: string | undefined;
|
|
54
137
|
title?: string | undefined;
|
|
55
|
-
primary?: boolean | undefined;
|
|
56
138
|
}>, "many">>;
|
|
57
139
|
gender: z.ZodOptional<z.ZodEnum<["male", "female", "unknown"]>>;
|
|
58
140
|
event_ref_list: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -104,21 +186,39 @@ export declare const createPersonSchema: z.ZodObject<{
|
|
|
104
186
|
primary_name: {
|
|
105
187
|
_class?: "Name" | undefined;
|
|
106
188
|
type?: string | undefined;
|
|
107
|
-
first_name?: string | undefined;
|
|
108
189
|
surname?: string | undefined;
|
|
190
|
+
primary?: boolean | undefined;
|
|
191
|
+
first_name?: string | undefined;
|
|
192
|
+
call_name?: string | undefined;
|
|
193
|
+
surname_list?: {
|
|
194
|
+
surname: string;
|
|
195
|
+
_class?: "Surname" | undefined;
|
|
196
|
+
prefix?: string | undefined;
|
|
197
|
+
primary?: boolean | undefined;
|
|
198
|
+
origintype?: string | undefined;
|
|
199
|
+
connector?: string | undefined;
|
|
200
|
+
}[] | undefined;
|
|
109
201
|
suffix?: string | undefined;
|
|
110
202
|
title?: string | undefined;
|
|
111
|
-
primary?: boolean | undefined;
|
|
112
203
|
};
|
|
113
204
|
gramps_id?: string | undefined;
|
|
114
205
|
alternate_names?: {
|
|
115
206
|
_class?: "Name" | undefined;
|
|
116
207
|
type?: string | undefined;
|
|
117
|
-
first_name?: string | undefined;
|
|
118
208
|
surname?: string | undefined;
|
|
209
|
+
primary?: boolean | undefined;
|
|
210
|
+
first_name?: string | undefined;
|
|
211
|
+
call_name?: string | undefined;
|
|
212
|
+
surname_list?: {
|
|
213
|
+
surname: string;
|
|
214
|
+
_class?: "Surname" | undefined;
|
|
215
|
+
prefix?: string | undefined;
|
|
216
|
+
primary?: boolean | undefined;
|
|
217
|
+
origintype?: string | undefined;
|
|
218
|
+
connector?: string | undefined;
|
|
219
|
+
}[] | undefined;
|
|
119
220
|
suffix?: string | undefined;
|
|
120
221
|
title?: string | undefined;
|
|
121
|
-
primary?: boolean | undefined;
|
|
122
222
|
}[] | undefined;
|
|
123
223
|
gender?: "male" | "female" | "unknown" | undefined;
|
|
124
224
|
event_ref_list?: {
|
|
@@ -146,21 +246,39 @@ export declare const createPersonSchema: z.ZodObject<{
|
|
|
146
246
|
primary_name: {
|
|
147
247
|
_class?: "Name" | undefined;
|
|
148
248
|
type?: string | undefined;
|
|
149
|
-
first_name?: string | undefined;
|
|
150
249
|
surname?: string | undefined;
|
|
250
|
+
primary?: boolean | undefined;
|
|
251
|
+
first_name?: string | undefined;
|
|
252
|
+
call_name?: string | undefined;
|
|
253
|
+
surname_list?: {
|
|
254
|
+
surname: string;
|
|
255
|
+
_class?: "Surname" | undefined;
|
|
256
|
+
prefix?: string | undefined;
|
|
257
|
+
primary?: boolean | undefined;
|
|
258
|
+
origintype?: string | undefined;
|
|
259
|
+
connector?: string | undefined;
|
|
260
|
+
}[] | undefined;
|
|
151
261
|
suffix?: string | undefined;
|
|
152
262
|
title?: string | undefined;
|
|
153
|
-
primary?: boolean | undefined;
|
|
154
263
|
};
|
|
155
264
|
gramps_id?: string | undefined;
|
|
156
265
|
alternate_names?: {
|
|
157
266
|
_class?: "Name" | undefined;
|
|
158
267
|
type?: string | undefined;
|
|
159
|
-
first_name?: string | undefined;
|
|
160
268
|
surname?: string | undefined;
|
|
269
|
+
primary?: boolean | undefined;
|
|
270
|
+
first_name?: string | undefined;
|
|
271
|
+
call_name?: string | undefined;
|
|
272
|
+
surname_list?: {
|
|
273
|
+
surname: string;
|
|
274
|
+
_class?: "Surname" | undefined;
|
|
275
|
+
prefix?: string | undefined;
|
|
276
|
+
primary?: boolean | undefined;
|
|
277
|
+
origintype?: string | undefined;
|
|
278
|
+
connector?: string | undefined;
|
|
279
|
+
}[] | undefined;
|
|
161
280
|
suffix?: string | undefined;
|
|
162
281
|
title?: string | undefined;
|
|
163
|
-
primary?: boolean | undefined;
|
|
164
282
|
}[] | undefined;
|
|
165
283
|
gender?: "male" | "female" | "unknown" | undefined;
|
|
166
284
|
event_ref_list?: {
|
|
@@ -637,16 +755,6 @@ export declare const createPlaceSchema: z.ZodObject<{
|
|
|
637
755
|
private: z.ZodOptional<z.ZodBoolean>;
|
|
638
756
|
}, "strip", z.ZodTypeAny, {
|
|
639
757
|
title?: string | undefined;
|
|
640
|
-
gramps_id?: string | undefined;
|
|
641
|
-
media_list?: {
|
|
642
|
-
ref: string;
|
|
643
|
-
_class?: "MediaRef" | undefined;
|
|
644
|
-
rect?: number[] | undefined;
|
|
645
|
-
}[] | undefined;
|
|
646
|
-
citation_list?: string[] | undefined;
|
|
647
|
-
note_list?: string[] | undefined;
|
|
648
|
-
tag_list?: string[] | undefined;
|
|
649
|
-
private?: boolean | undefined;
|
|
650
758
|
name?: {
|
|
651
759
|
value?: string | undefined;
|
|
652
760
|
_class?: "PlaceName" | undefined;
|
|
@@ -662,6 +770,16 @@ export declare const createPlaceSchema: z.ZodObject<{
|
|
|
662
770
|
} | undefined;
|
|
663
771
|
lang?: string | undefined;
|
|
664
772
|
} | undefined;
|
|
773
|
+
gramps_id?: string | undefined;
|
|
774
|
+
media_list?: {
|
|
775
|
+
ref: string;
|
|
776
|
+
_class?: "MediaRef" | undefined;
|
|
777
|
+
rect?: number[] | undefined;
|
|
778
|
+
}[] | undefined;
|
|
779
|
+
citation_list?: string[] | undefined;
|
|
780
|
+
note_list?: string[] | undefined;
|
|
781
|
+
tag_list?: string[] | undefined;
|
|
782
|
+
private?: boolean | undefined;
|
|
665
783
|
alt_names?: {
|
|
666
784
|
value?: string | undefined;
|
|
667
785
|
_class?: "PlaceName" | undefined;
|
|
@@ -696,16 +814,6 @@ export declare const createPlaceSchema: z.ZodObject<{
|
|
|
696
814
|
place_type?: string | undefined;
|
|
697
815
|
}, {
|
|
698
816
|
title?: string | undefined;
|
|
699
|
-
gramps_id?: string | undefined;
|
|
700
|
-
media_list?: {
|
|
701
|
-
ref: string;
|
|
702
|
-
_class?: "MediaRef" | undefined;
|
|
703
|
-
rect?: number[] | undefined;
|
|
704
|
-
}[] | undefined;
|
|
705
|
-
citation_list?: string[] | undefined;
|
|
706
|
-
note_list?: string[] | undefined;
|
|
707
|
-
tag_list?: string[] | undefined;
|
|
708
|
-
private?: boolean | undefined;
|
|
709
817
|
name?: {
|
|
710
818
|
value?: string | undefined;
|
|
711
819
|
_class?: "PlaceName" | undefined;
|
|
@@ -721,6 +829,16 @@ export declare const createPlaceSchema: z.ZodObject<{
|
|
|
721
829
|
} | undefined;
|
|
722
830
|
lang?: string | undefined;
|
|
723
831
|
} | undefined;
|
|
832
|
+
gramps_id?: string | undefined;
|
|
833
|
+
media_list?: {
|
|
834
|
+
ref: string;
|
|
835
|
+
_class?: "MediaRef" | undefined;
|
|
836
|
+
rect?: number[] | undefined;
|
|
837
|
+
}[] | undefined;
|
|
838
|
+
citation_list?: string[] | undefined;
|
|
839
|
+
note_list?: string[] | undefined;
|
|
840
|
+
tag_list?: string[] | undefined;
|
|
841
|
+
private?: boolean | undefined;
|
|
724
842
|
alt_names?: {
|
|
725
843
|
value?: string | undefined;
|
|
726
844
|
_class?: "PlaceName" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/schemas/entities.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/schemas/entities.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc7B,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASjC,CAAC;AAGH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../src/tools/analysis.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../src/tools/analysis.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,aAAa;;;;;;;;;EASjB,CAAC;AAGH,QAAA,MAAM,mBAAmB;;;;;;;;;EAGvB,CAAC;AAEH;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC,CAsFvD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,GACpC,OAAO,CAAC,MAAM,CAAC,CA+GjB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,GACpC,OAAO,CAAC,MAAM,CAAC,CAyGjB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,GAC1C,OAAO,CAAC,MAAM,CAAC,CA8GjB;AAGD,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2FzB,CAAC"}
|
package/dist/tools/analysis.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { grampsClient } from "../client.js";
|
|
6
|
-
import { API_ENDPOINTS } from "../constants.js";
|
|
6
|
+
import { API_ENDPOINTS, MESSAGES } from "../constants.js";
|
|
7
7
|
import { formatPersonName } from "../utils/formatting.js";
|
|
8
|
+
import { formatToolResponse } from "../utils/response.js";
|
|
8
9
|
// Schema for ancestor/descendant queries
|
|
9
10
|
const lineageSchema = z.object({
|
|
10
11
|
handle: z.string().describe("Person handle to start from"),
|
|
@@ -77,20 +78,32 @@ export async function grampsTreeStats() {
|
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
`
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
const totalRecords = Object.values(stats).reduce((a, b) => a + b, 0);
|
|
82
|
+
if (totalRecords === 0) {
|
|
83
|
+
return formatToolResponse({
|
|
84
|
+
status: "empty",
|
|
85
|
+
summary: MESSAGES.EMPTY_TREE,
|
|
86
|
+
details: "Use gramps_create_person to add your first family member.",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return formatToolResponse({
|
|
90
|
+
status: "success",
|
|
91
|
+
summary: `Family tree contains ${totalRecords.toLocaleString()} total records`,
|
|
92
|
+
data: {
|
|
93
|
+
people: stats.people,
|
|
94
|
+
families: stats.families,
|
|
95
|
+
events: stats.events,
|
|
96
|
+
places: stats.places,
|
|
97
|
+
sources: stats.sources,
|
|
98
|
+
citations: stats.citations,
|
|
99
|
+
repositories: stats.repositories,
|
|
100
|
+
media: stats.media,
|
|
101
|
+
notes: stats.notes,
|
|
102
|
+
},
|
|
103
|
+
details: stats.people > 0
|
|
104
|
+
? "Use gramps_search or gramps_find to explore specific records."
|
|
105
|
+
: undefined,
|
|
106
|
+
});
|
|
94
107
|
}
|
|
95
108
|
/**
|
|
96
109
|
* Get ancestors of a person
|
|
@@ -149,9 +162,12 @@ export async function grampsGetAncestors(params) {
|
|
|
149
162
|
}
|
|
150
163
|
// Format output
|
|
151
164
|
if (ancestors.length === 0) {
|
|
152
|
-
return
|
|
165
|
+
return formatToolResponse({
|
|
166
|
+
status: "empty",
|
|
167
|
+
summary: "No ancestors found for this person",
|
|
168
|
+
details: "The person may not have parent family links. Check the person's parent_family_list.",
|
|
169
|
+
});
|
|
153
170
|
}
|
|
154
|
-
const lines = [`Found ${ancestors.length} ancestor(s) up to ${generations} generation(s):`, ""];
|
|
155
171
|
// Group by generation
|
|
156
172
|
const byGen = new Map();
|
|
157
173
|
for (const a of ancestors) {
|
|
@@ -160,17 +176,28 @@ export async function grampsGetAncestors(params) {
|
|
|
160
176
|
}
|
|
161
177
|
byGen.get(a.generation).push(a);
|
|
162
178
|
}
|
|
179
|
+
const generationsData = {};
|
|
163
180
|
for (let g = 0; g <= generations; g++) {
|
|
164
181
|
const genAncestors = byGen.get(g);
|
|
165
182
|
if (genAncestors && genAncestors.length > 0) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
183
|
+
generationsData[`generation_${g}`] = genAncestors.map((a) => ({
|
|
184
|
+
relationship: a.relationship,
|
|
185
|
+
name: formatPersonName(a.person.primary_name),
|
|
186
|
+
gramps_id: a.person.gramps_id,
|
|
187
|
+
handle: a.person.handle,
|
|
188
|
+
}));
|
|
171
189
|
}
|
|
172
190
|
}
|
|
173
|
-
return
|
|
191
|
+
return formatToolResponse({
|
|
192
|
+
status: "success",
|
|
193
|
+
summary: `Found ${ancestors.length} ancestor(s) across ${generations} generation(s)`,
|
|
194
|
+
data: {
|
|
195
|
+
total_count: ancestors.length,
|
|
196
|
+
generations_retrieved: generations,
|
|
197
|
+
ancestors: generationsData,
|
|
198
|
+
},
|
|
199
|
+
details: "Use handles with gramps_get to retrieve full details of any ancestor.",
|
|
200
|
+
});
|
|
174
201
|
}
|
|
175
202
|
/**
|
|
176
203
|
* Get descendants of a person
|
|
@@ -225,12 +252,12 @@ export async function grampsGetDescendants(params) {
|
|
|
225
252
|
}
|
|
226
253
|
// Format output
|
|
227
254
|
if (descendants.length === 0) {
|
|
228
|
-
return
|
|
255
|
+
return formatToolResponse({
|
|
256
|
+
status: "empty",
|
|
257
|
+
summary: "No descendants found for this person",
|
|
258
|
+
details: "The person may not have family links. Check the person's family_list.",
|
|
259
|
+
});
|
|
229
260
|
}
|
|
230
|
-
const lines = [
|
|
231
|
-
`Found ${descendants.length} descendant(s) up to ${generations} generation(s):`,
|
|
232
|
-
"",
|
|
233
|
-
];
|
|
234
261
|
// Group by generation
|
|
235
262
|
const byGen = new Map();
|
|
236
263
|
for (const d of descendants) {
|
|
@@ -239,17 +266,28 @@ export async function grampsGetDescendants(params) {
|
|
|
239
266
|
}
|
|
240
267
|
byGen.get(d.generation).push(d);
|
|
241
268
|
}
|
|
269
|
+
const generationsData = {};
|
|
242
270
|
for (let g = 0; g <= generations; g++) {
|
|
243
271
|
const genDescendants = byGen.get(g);
|
|
244
272
|
if (genDescendants && genDescendants.length > 0) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
273
|
+
generationsData[`generation_${g}`] = genDescendants.map((d) => ({
|
|
274
|
+
relationship: d.relationship,
|
|
275
|
+
name: formatPersonName(d.person.primary_name),
|
|
276
|
+
gramps_id: d.person.gramps_id,
|
|
277
|
+
handle: d.person.handle,
|
|
278
|
+
}));
|
|
250
279
|
}
|
|
251
280
|
}
|
|
252
|
-
return
|
|
281
|
+
return formatToolResponse({
|
|
282
|
+
status: "success",
|
|
283
|
+
summary: `Found ${descendants.length} descendant(s) across ${generations} generation(s)`,
|
|
284
|
+
data: {
|
|
285
|
+
total_count: descendants.length,
|
|
286
|
+
generations_retrieved: generations,
|
|
287
|
+
descendants: generationsData,
|
|
288
|
+
},
|
|
289
|
+
details: "Use handles with gramps_get to retrieve full details of any descendant.",
|
|
290
|
+
});
|
|
253
291
|
}
|
|
254
292
|
/**
|
|
255
293
|
* Get recent changes
|
|
@@ -262,15 +300,31 @@ export async function grampsRecentChanges(params) {
|
|
|
262
300
|
pagesize,
|
|
263
301
|
});
|
|
264
302
|
if (!response || response.length === 0) {
|
|
265
|
-
return
|
|
303
|
+
return formatToolResponse({
|
|
304
|
+
status: "empty",
|
|
305
|
+
summary: "No recent changes found",
|
|
306
|
+
details: "The tree may be new or have no activity tracking.",
|
|
307
|
+
});
|
|
266
308
|
}
|
|
267
|
-
const
|
|
268
|
-
for (const change of response) {
|
|
309
|
+
const changes = response.map((change) => {
|
|
269
310
|
const date = new Date(change.change * 1000);
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
311
|
+
return {
|
|
312
|
+
timestamp: date.toISOString(),
|
|
313
|
+
type: change.object_type,
|
|
314
|
+
gramps_id: change.gramps_id,
|
|
315
|
+
handle: change.handle,
|
|
316
|
+
};
|
|
317
|
+
});
|
|
318
|
+
return formatToolResponse({
|
|
319
|
+
status: "success",
|
|
320
|
+
summary: `Found ${changes.length} recent change(s)`,
|
|
321
|
+
data: {
|
|
322
|
+
page,
|
|
323
|
+
count: changes.length,
|
|
324
|
+
changes,
|
|
325
|
+
},
|
|
326
|
+
details: "Use handles with gramps_get to see full details of changed records.",
|
|
327
|
+
});
|
|
274
328
|
}
|
|
275
329
|
catch {
|
|
276
330
|
// Fallback: try fetching from each entity type and sorting by change time
|
|
@@ -297,23 +351,41 @@ export async function grampsRecentChanges(params) {
|
|
|
297
351
|
allEntities.sort((a, b) => b.change - a.change);
|
|
298
352
|
const topEntities = allEntities.slice(0, pagesize);
|
|
299
353
|
if (topEntities.length === 0) {
|
|
300
|
-
return
|
|
354
|
+
return formatToolResponse({
|
|
355
|
+
status: "empty",
|
|
356
|
+
summary: "No recent changes found",
|
|
357
|
+
details: "The tree may be new or have no activity tracking.",
|
|
358
|
+
});
|
|
301
359
|
}
|
|
302
|
-
const
|
|
303
|
-
for (const item of topEntities) {
|
|
360
|
+
const changes = topEntities.map((item) => {
|
|
304
361
|
const date = new Date(item.change * 1000);
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
362
|
+
return {
|
|
363
|
+
timestamp: date.toISOString(),
|
|
364
|
+
type: item.type,
|
|
365
|
+
gramps_id: item.entity.gramps_id,
|
|
366
|
+
handle: item.entity.handle,
|
|
367
|
+
};
|
|
368
|
+
});
|
|
369
|
+
return formatToolResponse({
|
|
370
|
+
status: "success",
|
|
371
|
+
summary: `Found ${changes.length} recent change(s)`,
|
|
372
|
+
data: {
|
|
373
|
+
page,
|
|
374
|
+
count: changes.length,
|
|
375
|
+
changes,
|
|
376
|
+
},
|
|
377
|
+
details: "Use handles with gramps_get to see full details of changed records.",
|
|
378
|
+
});
|
|
309
379
|
}
|
|
310
380
|
}
|
|
311
381
|
// Tool definitions for MCP
|
|
312
382
|
export const analysisTools = {
|
|
313
383
|
gramps_tree_stats: {
|
|
314
384
|
name: "gramps_tree_stats",
|
|
315
|
-
description: "Get
|
|
316
|
-
"
|
|
385
|
+
description: "Get database overview with record counts by type. " +
|
|
386
|
+
"USE FOR: Understanding tree size, checking if data exists. " +
|
|
387
|
+
"RETURNS: Counts of people, families, events, places, sources, etc. " +
|
|
388
|
+
"START HERE: Good first call to understand the tree before searching.",
|
|
317
389
|
inputSchema: {
|
|
318
390
|
type: "object",
|
|
319
391
|
properties: {},
|
|
@@ -323,8 +395,10 @@ export const analysisTools = {
|
|
|
323
395
|
},
|
|
324
396
|
gramps_get_ancestors: {
|
|
325
397
|
name: "gramps_get_ancestors",
|
|
326
|
-
description: "
|
|
327
|
-
"
|
|
398
|
+
description: "Traverse ancestry tree upward from a person. " +
|
|
399
|
+
"REQUIRED: handle of starting person (from search results). " +
|
|
400
|
+
"OPTIONAL: generations (1-10, default 3). " +
|
|
401
|
+
"RETURNS: Parents, grandparents, great-grandparents with handles.",
|
|
328
402
|
inputSchema: {
|
|
329
403
|
type: "object",
|
|
330
404
|
properties: {
|
|
@@ -344,8 +418,10 @@ export const analysisTools = {
|
|
|
344
418
|
},
|
|
345
419
|
gramps_get_descendants: {
|
|
346
420
|
name: "gramps_get_descendants",
|
|
347
|
-
description: "
|
|
348
|
-
"
|
|
421
|
+
description: "Traverse descendant tree downward from a person. " +
|
|
422
|
+
"REQUIRED: handle of starting person (from search results). " +
|
|
423
|
+
"OPTIONAL: generations (1-10, default 3). " +
|
|
424
|
+
"RETURNS: Children, grandchildren, great-grandchildren with handles.",
|
|
349
425
|
inputSchema: {
|
|
350
426
|
type: "object",
|
|
351
427
|
properties: {
|
|
@@ -365,8 +441,10 @@ export const analysisTools = {
|
|
|
365
441
|
},
|
|
366
442
|
gramps_recent_changes: {
|
|
367
443
|
name: "gramps_recent_changes",
|
|
368
|
-
description: "
|
|
369
|
-
"
|
|
444
|
+
description: "List recently added or modified records. " +
|
|
445
|
+
"USE FOR: Seeing latest tree activity, finding newly added records. " +
|
|
446
|
+
"OPTIONAL: page, pagesize for pagination. " +
|
|
447
|
+
"RETURNS: Timestamped list of changes with handles.",
|
|
370
448
|
inputSchema: {
|
|
371
449
|
type: "object",
|
|
372
450
|
properties: {
|