@cyanheads/genealogy-mcp-server 0.1.1 → 0.2.1
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/AGENTS.md +54 -23
- package/CLAUDE.md +54 -23
- package/README.md +142 -94
- package/changelog/0.2.x/0.2.0.md +27 -0
- package/changelog/0.2.x/0.2.1.md +27 -0
- package/dist/config/server-config.d.ts +6 -1
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +17 -3
- package/dist/config/server-config.js.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/tools/definitions/{genealogy_find_common_ancestors.tool.d.ts → find-common-ancestors.tool.d.ts} +14 -12
- package/dist/mcp-server/tools/definitions/find-common-ancestors.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/find-common-ancestors.tool.js +35 -0
- package/dist/mcp-server/tools/definitions/find-common-ancestors.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/find-person.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/find-person.tool.js +3 -2
- package/dist/mcp-server/tools/definitions/find-person.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/{genealogy_get_profiles.tool.d.ts → get-profiles.tool.d.ts} +2 -2
- package/dist/mcp-server/tools/definitions/get-profiles.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/{genealogy_get_profiles.tool.js → get-profiles.tool.js} +3 -3
- package/dist/mcp-server/tools/definitions/get-profiles.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-record.tool.d.ts +8 -1
- package/dist/mcp-server/tools/definitions/get-record.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-record.tool.js +13 -1
- package/dist/mcp-server/tools/definitions/get-record.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/{genealogy_get_relatives.tool.d.ts → get-relatives.tool.d.ts} +13 -12
- package/dist/mcp-server/tools/definitions/get-relatives.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/get-relatives.tool.js +35 -0
- package/dist/mcp-server/tools/definitions/get-relatives.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-transcription.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-transcription.tool.js +1 -0
- package/dist/mcp-server/tools/definitions/get-transcription.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/list-reference.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/list-reference.tool.js +14 -8
- package/dist/mcp-server/tools/definitions/list-reference.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/{genealogy_search_profiles.tool.d.ts → search-profiles.tool.d.ts} +12 -4
- package/dist/mcp-server/tools/definitions/search-profiles.tool.d.ts.map +1 -0
- package/dist/mcp-server/tools/definitions/search-profiles.tool.js +27 -0
- package/dist/mcp-server/tools/definitions/search-profiles.tool.js.map +1 -0
- package/dist/mcp-server/tools/definitions/search-records.tool.d.ts +26 -0
- package/dist/mcp-server/tools/definitions/search-records.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-records.tool.js +34 -3
- package/dist/mcp-server/tools/definitions/search-records.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-transcriptions.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/search-transcriptions.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-transcriptions.tool.js +10 -1
- package/dist/mcp-server/tools/definitions/search-transcriptions.tool.js.map +1 -1
- package/dist/services/genealogy/discovery.d.ts +8 -20
- package/dist/services/genealogy/discovery.d.ts.map +1 -1
- package/dist/services/genealogy/discovery.js +44 -24
- package/dist/services/genealogy/discovery.js.map +1 -1
- package/dist/services/genealogy/records.d.ts +8 -2
- package/dist/services/genealogy/records.d.ts.map +1 -1
- package/dist/services/genealogy/search-records.d.ts +25 -2
- package/dist/services/genealogy/search-records.d.ts.map +1 -1
- package/dist/services/genealogy/search-records.js +67 -16
- package/dist/services/genealogy/search-records.js.map +1 -1
- package/dist/services/genealogy/upstream.d.ts.map +1 -1
- package/dist/services/genealogy/upstream.js +1 -1
- package/dist/services/genealogy/upstream.js.map +1 -1
- package/dist/services/mirror/mirror-build.d.ts.map +1 -1
- package/dist/services/mirror/mirror-build.js +11 -15
- package/dist/services/mirror/mirror-build.js.map +1 -1
- package/dist/services/mirror/mirror-service.d.ts +4 -4
- package/dist/services/mirror/mirror-service.d.ts.map +1 -1
- package/dist/services/mirror/mirror-service.js +4 -15
- package/dist/services/mirror/mirror-service.js.map +1 -1
- package/dist/services/mirror/mirror-snapshot.d.ts.map +1 -1
- package/dist/services/mirror/mirror-snapshot.js +2 -3
- package/dist/services/mirror/mirror-snapshot.js.map +1 -1
- package/dist/services/open-archives/client.d.ts +1 -0
- package/dist/services/open-archives/client.d.ts.map +1 -1
- package/dist/services/open-archives/client.js +17 -6
- package/dist/services/open-archives/client.js.map +1 -1
- package/dist/services/open-archives/read-record.d.ts +4 -7
- package/dist/services/open-archives/read-record.d.ts.map +1 -1
- package/dist/services/open-archives/read-record.js +19 -15
- package/dist/services/open-archives/read-record.js.map +1 -1
- package/dist/services/open-archives/reference.d.ts +9 -3
- package/dist/services/open-archives/reference.d.ts.map +1 -1
- package/dist/services/open-archives/reference.js +64 -8
- package/dist/services/open-archives/reference.js.map +1 -1
- package/dist/services/open-archives/search-records.d.ts +1 -0
- package/dist/services/open-archives/search-records.d.ts.map +1 -1
- package/dist/services/open-archives/search-records.js +18 -18
- package/dist/services/open-archives/search-records.js.map +1 -1
- package/dist/services/open-archives/source-labels.d.ts +4 -0
- package/dist/services/open-archives/source-labels.d.ts.map +1 -0
- package/dist/services/open-archives/source-labels.js +116 -0
- package/dist/services/open-archives/source-labels.js.map +1 -0
- package/dist/services/open-archives/transcriptions.d.ts +1 -1
- package/dist/services/open-archives/transcriptions.d.ts.map +1 -1
- package/dist/services/open-archives/transcriptions.js +14 -17
- package/dist/services/open-archives/transcriptions.js.map +1 -1
- package/dist/services/socrata/indexes.d.ts +6 -1
- package/dist/services/socrata/indexes.d.ts.map +1 -1
- package/dist/services/socrata/indexes.js +54 -28
- package/dist/services/socrata/indexes.js.map +1 -1
- package/dist/services/socrata/search-index.d.ts +2 -1
- package/dist/services/socrata/search-index.d.ts.map +1 -1
- package/dist/services/socrata/search-index.js +36 -19
- package/dist/services/socrata/search-index.js.map +1 -1
- package/dist/services/socrata/us-state-codes.d.ts +4 -0
- package/dist/services/socrata/us-state-codes.d.ts.map +1 -0
- package/dist/services/socrata/us-state-codes.js +55 -0
- package/dist/services/socrata/us-state-codes.js.map +1 -0
- package/dist/services/wikitree/find-common-ancestors.d.ts +1 -0
- package/dist/services/wikitree/find-common-ancestors.d.ts.map +1 -1
- package/dist/services/wikitree/find-common-ancestors.js +25 -12
- package/dist/services/wikitree/find-common-ancestors.js.map +1 -1
- package/dist/services/wikitree/profile.d.ts +4 -0
- package/dist/services/wikitree/profile.d.ts.map +1 -1
- package/dist/services/wikitree/profile.js +17 -16
- package/dist/services/wikitree/profile.js.map +1 -1
- package/dist/services/wikitree/read-family.d.ts.map +1 -1
- package/dist/services/wikitree/read-family.js +24 -5
- package/dist/services/wikitree/read-family.js.map +1 -1
- package/dist/services/wikitree/read-people.d.ts.map +1 -1
- package/dist/services/wikitree/read-people.js +19 -7
- package/dist/services/wikitree/read-people.js.map +1 -1
- package/dist/services/wikitree/search-profiles.d.ts +3 -3
- package/dist/services/wikitree/search-profiles.d.ts.map +1 -1
- package/dist/services/wikitree/search-profiles.js +27 -20
- package/dist/services/wikitree/search-profiles.js.map +1 -1
- package/dist/services/wikitree/wiki-request.d.ts +3 -1
- package/dist/services/wikitree/wiki-request.d.ts.map +1 -1
- package/dist/services/wikitree/wiki-request.js +5 -1
- package/dist/services/wikitree/wiki-request.js.map +1 -1
- package/package.json +7 -3
- package/server.json +12 -6
- package/skills/genealogy-guide/SKILL.md +47 -0
- package/dist/mcp-server/tools/definitions/genealogy_find_common_ancestors.tool.d.ts.map +0 -1
- package/dist/mcp-server/tools/definitions/genealogy_find_common_ancestors.tool.js +0 -17
- package/dist/mcp-server/tools/definitions/genealogy_find_common_ancestors.tool.js.map +0 -1
- package/dist/mcp-server/tools/definitions/genealogy_get_profiles.tool.d.ts.map +0 -1
- package/dist/mcp-server/tools/definitions/genealogy_get_profiles.tool.js.map +0 -1
- package/dist/mcp-server/tools/definitions/genealogy_get_relatives.tool.d.ts.map +0 -1
- package/dist/mcp-server/tools/definitions/genealogy_get_relatives.tool.js +0 -17
- package/dist/mcp-server/tools/definitions/genealogy_get_relatives.tool.js.map +0 -1
- package/dist/mcp-server/tools/definitions/genealogy_search_profiles.tool.d.ts.map +0 -1
- package/dist/mcp-server/tools/definitions/genealogy_search_profiles.tool.js +0 -16
- package/dist/mcp-server/tools/definitions/genealogy_search_profiles.tool.js.map +0 -1
- package/dist/services/wikitree/tool-output.d.ts +0 -21
- package/dist/services/wikitree/tool-output.d.ts.map +0 -1
- package/dist/services/wikitree/tool-output.js +0 -26
- package/dist/services/wikitree/tool-output.js.map +0 -1
|
@@ -5,6 +5,7 @@ import { recordPageSchema } from '../../../services/genealogy/records.js';
|
|
|
5
5
|
import { recordSources, searchRecords } from '../../../services/genealogy/search-records.js';
|
|
6
6
|
import { formatData, limit, offset, optionalText, readOnly, year, } from '../../../services/genealogy/tool-fields.js';
|
|
7
7
|
export const searchRecordsTool = tool('genealogy_search_records', {
|
|
8
|
+
title: 'Search Documentary Records',
|
|
8
9
|
description: 'Search one source for documentary records by person and event year. Use genealogy_list_reference with topic=sources to choose an archive or vital, veteran, or burial index and check its filters. Use next_offset to continue or pass an Open Archives record ID to genealogy_get_record.',
|
|
9
10
|
annotations: readOnly,
|
|
10
11
|
input: z.object({
|
|
@@ -13,13 +14,15 @@ export const searchRecordsTool = tool('genealogy_search_records', {
|
|
|
13
14
|
.describe('Record source from genealogy_list_reference.'),
|
|
14
15
|
first_name: optionalText.describe('Given name of a person in the record.'),
|
|
15
16
|
last_name: optionalText.describe('Surname of a person in the record.'),
|
|
17
|
+
certificate_number: optionalText.describe('NYC vital certificate number as printed in the index. Without a name, supply a place and the same year in both year fields.'),
|
|
18
|
+
soundex: optionalText.describe('Published NYC vital index Soundex code, such as K400. Marriage parties can share a code even when their surnames differ. Use with a name or a scoped certificate lookup.'),
|
|
16
19
|
year_from: year.describe('Earliest event year, inclusive.'),
|
|
17
20
|
year_to: year.describe('Latest event year, inclusive.'),
|
|
18
|
-
place: optionalText.describe('Source-specific
|
|
21
|
+
place: optionalText.describe('Source-specific place. For VA gravesites, use the cemetery city, full state name or USPS state code. See the sources reference for other indexes.'),
|
|
19
22
|
query: optionalText.describe('Open Archives name expression, in place of separate names.'),
|
|
20
|
-
archive_code: optionalText.describe('Open Archives holding archive.'),
|
|
23
|
+
archive_code: optionalText.describe('Case-insensitive Open Archives holding archive code.'),
|
|
21
24
|
source_type: optionalText.describe('Open Archives source type in Dutch or English.'),
|
|
22
|
-
relation_type: optionalText.describe('Open Archives role
|
|
25
|
+
relation_type: optionalText.describe('Exact Dutch Open Archives role or a known English alias. Consult genealogy_list_reference with topic=relation_types for examples.'),
|
|
23
26
|
event_place: optionalText.describe('Open Archives event place, an alternative to place.'),
|
|
24
27
|
birth_place: optionalText.describe('Open Archives birthplace.'),
|
|
25
28
|
country: optionalText.describe('Open Archives country code.'),
|
|
@@ -43,6 +46,34 @@ export const searchRecordsTool = tool('genealogy_search_records', {
|
|
|
43
46
|
recovery: 'Read genealogy_list_reference with topic=sources and remove unsupported filters.',
|
|
44
47
|
thrownBy: 'service',
|
|
45
48
|
},
|
|
49
|
+
{
|
|
50
|
+
reason: 'years_outside_coverage',
|
|
51
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
52
|
+
when: 'The requested years fall wholly outside the verified event years for the selected index.',
|
|
53
|
+
recovery: 'Choose years that overlap the verified bounds in this error or select another record source.',
|
|
54
|
+
thrownBy: 'service',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
reason: 'years_outside_privacy',
|
|
58
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
59
|
+
when: 'The requested years are later than the latest visible event year.',
|
|
60
|
+
recovery: 'Choose an earlier year within the visible coverage in this error.',
|
|
61
|
+
thrownBy: 'service',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
reason: 'unsupported_place',
|
|
65
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
66
|
+
when: 'The selected NYC vital index does not recognize the borough or county.',
|
|
67
|
+
recovery: 'Use an accepted borough or county name from this error or topic=sources.',
|
|
68
|
+
thrownBy: 'service',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
reason: 'certificate_scope_required',
|
|
72
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
73
|
+
when: 'A NYC vital certificate number is supplied without a name, borough and single year.',
|
|
74
|
+
recovery: 'Add a name or supply place and set year_from and year_to to the same year.',
|
|
75
|
+
thrownBy: 'service',
|
|
76
|
+
},
|
|
46
77
|
{
|
|
47
78
|
reason: 'unknown_reference_value',
|
|
48
79
|
code: JsonRpcErrorCode.InvalidParams,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-records.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-records.tool.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAC7F,OAAO,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,IAAI,GACL,MAAM,4CAA4C,CAAC;AACpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IAChE,WAAW,EACT,4RAA4R;IAC9R,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;aACpC,QAAQ,CAAC,8CAA8C,CAAC;QAC3D,UAAU,EAAE,YAAY,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QAC1E,SAAS,EAAE,YAAY,CAAC,QAAQ,CAAC,oCAAoC,CAAC;QACtE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,iCAAiC,CAAC;QAC3D,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QACvD,KAAK,EAAE,YAAY,CAAC,QAAQ,CAC1B,
|
|
1
|
+
{"version":3,"file":"search-records.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-records.tool.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAC7F,OAAO,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,IAAI,GACL,MAAM,4CAA4C,CAAC;AACpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IAChE,KAAK,EAAE,4BAA4B;IACnC,WAAW,EACT,4RAA4R;IAC9R,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAA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E,MAAM,EAAE,kBAAkB;YAC1B,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;YACzC,IAAI,EAAE,gDAAgD;YACtD,QAAQ,EACN,kHAAkH;YACpH,QAAQ,EAAE,SAAS;SACpB;KACF;IACD,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC;IACzD,MAAM,EAAE,UAAU;CACnB,CAAC,CAAC"}
|
|
@@ -29,6 +29,12 @@ export declare const searchTranscriptionsTool: import("@cyanheads/mcp-ts-core").
|
|
|
29
29
|
}, z.core.$strip>>;
|
|
30
30
|
notices: z.ZodArray<z.ZodString>;
|
|
31
31
|
}, z.core.$strip>, readonly [{
|
|
32
|
+
readonly reason: "unknown_reference_value";
|
|
33
|
+
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
34
|
+
readonly when: "The holding archive code is unknown.";
|
|
35
|
+
readonly recovery: "Use genealogy_list_reference with topic=archives and copy the archive code.";
|
|
36
|
+
readonly thrownBy: "service";
|
|
37
|
+
}, {
|
|
32
38
|
readonly reason: "page_out_of_range";
|
|
33
39
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
34
40
|
readonly when: "The requested offset exceeds the accessible transcription search window.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-transcriptions.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-transcriptions.tool.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"search-transcriptions.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-transcriptions.tool.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAWjE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8DnC,CAAC"}
|
|
@@ -2,11 +2,20 @@
|
|
|
2
2
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
3
3
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
4
4
|
import { formatData, limit, offset, optionalText, readOnly, year, } from '../../../services/genealogy/tool-fields.js';
|
|
5
|
+
import { archiveCodeRecovery } from '../../../services/open-archives/client.js';
|
|
5
6
|
import { searchTranscriptions } from '../../../services/open-archives/transcriptions.js';
|
|
6
7
|
export const searchTranscriptionsTool = tool('genealogy_search_transcriptions', {
|
|
8
|
+
title: 'Search Open Archives Transcriptions',
|
|
7
9
|
description: 'Search the text of Open Archives pages by word, phrase, or wildcard. Filter by holding archive or inventory years and pass an ID to genealogy_get_transcription for the full page. Continue with next_offset when present.',
|
|
8
10
|
annotations: readOnly,
|
|
9
11
|
errors: [
|
|
12
|
+
{
|
|
13
|
+
reason: 'unknown_reference_value',
|
|
14
|
+
code: JsonRpcErrorCode.InvalidParams,
|
|
15
|
+
when: 'The holding archive code is unknown.',
|
|
16
|
+
recovery: archiveCodeRecovery,
|
|
17
|
+
thrownBy: 'service',
|
|
18
|
+
},
|
|
10
19
|
{
|
|
11
20
|
reason: 'page_out_of_range',
|
|
12
21
|
code: JsonRpcErrorCode.InvalidParams,
|
|
@@ -21,7 +30,7 @@ export const searchTranscriptionsTool = tool('genealogy_search_transcriptions',
|
|
|
21
30
|
.trim()
|
|
22
31
|
.min(1)
|
|
23
32
|
.describe('Full-text query. Double quotes match a phrase, * or ? match wildcards.'),
|
|
24
|
-
archive_code: optionalText.describe('
|
|
33
|
+
archive_code: optionalText.describe('Case-insensitive holding archive code.'),
|
|
25
34
|
archive_number: optionalText.describe('Archive collection number, requires archive_code.'),
|
|
26
35
|
inventory_number: optionalText.describe('Inventory number, requires both archive fields.'),
|
|
27
36
|
year_from: year.describe('Earliest year in the inventory span.'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-transcriptions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-transcriptions.tool.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,IAAI,GACL,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC,iCAAiC,EAAE;IAC9E,WAAW,EACT,4NAA4N;IAC9N,WAAW,EAAE,QAAQ;IACrB,MAAM,EAAE;QACN;YACE,MAAM,EAAE,mBAAmB;YAC3B,IAAI,EAAE,gBAAgB,CAAC,aAAa;YACpC,IAAI,EAAE,0EAA0E;YAChF,QAAQ,EAAE,oEAAoE;YAC9E,QAAQ,EAAE,SAAS;SACpB;KACF;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CAAC,wEAAwE,CAAC;QACrF,YAAY,EAAE,YAAY,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"search-transcriptions.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/search-transcriptions.tool.ts"],"names":[],"mappings":"AAAA,0HAA0H;AAC1H,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC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CAAC;YAChD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;YACjE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,wCAAwC,CAAC;SACjF,CAAC;aACD,QAAQ,CAAC,gCAAgC,CAAC,CAC9C;aACA,QAAQ,CAAC,2BAA2B,CAAC;QACxC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,uCAAuC,CAAC;KAC/E,CAAC;IACF,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,oBAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC;IAChE,MAAM,EAAE,UAAU;CACnB,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RecordQuery } from './records.js';
|
|
1
2
|
export interface PersonQuery {
|
|
2
3
|
birth_year?: number | undefined;
|
|
3
4
|
country?: string | undefined;
|
|
@@ -81,32 +82,19 @@ export declare function discover(q: PersonQuery, signal: AbortSignal): Promise<{
|
|
|
81
82
|
total: number;
|
|
82
83
|
has_more: boolean;
|
|
83
84
|
as_of: string | undefined;
|
|
84
|
-
applied_filters:
|
|
85
|
-
archive_code?: string | undefined;
|
|
86
|
-
birth_place?: string | undefined;
|
|
87
|
-
country?: string | undefined;
|
|
88
|
-
event_place?: string | undefined;
|
|
89
|
-
first_name?: string | undefined;
|
|
90
|
-
last_name?: string | undefined;
|
|
91
|
-
limit: number;
|
|
92
|
-
offset: number;
|
|
93
|
-
place?: string | undefined;
|
|
94
|
-
query?: string | undefined;
|
|
95
|
-
relation_type?: string | undefined;
|
|
96
|
-
sort?: number | undefined;
|
|
97
|
-
source: string;
|
|
98
|
-
source_type?: string | undefined;
|
|
99
|
-
year_from?: number | undefined;
|
|
100
|
-
year_to?: number | undefined;
|
|
101
|
-
};
|
|
85
|
+
applied_filters: RecordQuery;
|
|
102
86
|
notices: string[];
|
|
103
87
|
}))[];
|
|
104
88
|
coverage: {
|
|
89
|
+
year_from: number | undefined;
|
|
90
|
+
year_to: number | undefined;
|
|
91
|
+
published_year_to?: number;
|
|
92
|
+
searchable_year_from: number | undefined;
|
|
93
|
+
searchable_year_to: number | undefined;
|
|
94
|
+
privacy_year_to: number | undefined;
|
|
105
95
|
source: string;
|
|
106
96
|
description: string;
|
|
107
97
|
country: string[];
|
|
108
|
-
year_from: number | undefined;
|
|
109
|
-
year_to: number | undefined;
|
|
110
98
|
}[];
|
|
111
99
|
}>;
|
|
112
100
|
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/services/genealogy/discovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../../src/services/genealogy/discovery.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,cAAc,CAAC;AAWlE,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAoDD,wBAAsB,QAAQ,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW;;qBA1DnD,MAAM,GAAG,SAAS;kBACrB,MAAM,GAAG,SAAS;qBACf,MAAM,GAAG,SAAS;qBAClB,MAAM,GAAG,SAAS;oBACnB,MAAM,GAAG,SAAS;gBACtB,MAAM,GAAG,SAAS;;;;gBAWG,aAAa;;;;gBALf,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAKF,aAAa;;;;gBA2EL,SAAS;;;;gBAhFnB,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmIhC"}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/** @fileoverview Attribute each independent search and preserve partial availability. */
|
|
2
2
|
import { invalidParams, JsonRpcErrorCode, McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
3
3
|
import { searchProfiles } from '../wikitree/search-profiles.js';
|
|
4
|
-
import { wikiTreeDeadline } from '../wikitree/
|
|
5
|
-
import {
|
|
4
|
+
import { wikiTreeDeadline } from '../wikitree/wiki-request.js';
|
|
5
|
+
import { historicalYearTo, profileSource, recordSources, recordYearCoverage, recordYearExclusion, resolveRecordPlace, searchRecords, } from './search-records.js';
|
|
6
|
+
const yearTolerance = 2;
|
|
6
7
|
async function available(source, signal, task) {
|
|
7
8
|
try {
|
|
8
9
|
return { source, status: 'ok', ...(await task()) };
|
|
9
10
|
}
|
|
10
11
|
catch (e) {
|
|
11
12
|
signal.throwIfAborted();
|
|
13
|
+
// A source's own deadline (AbortSignal.timeout) rejects with a raw TimeoutError, not an McpError.
|
|
14
|
+
if (e instanceof DOMException && e.name === 'TimeoutError')
|
|
15
|
+
return { source, status: 'unavailable', reason: 'upstream_timeout' };
|
|
12
16
|
if (e instanceof McpError &&
|
|
13
17
|
[
|
|
14
18
|
JsonRpcErrorCode.ServiceUnavailable,
|
|
@@ -35,15 +39,18 @@ function recordLookup(q, s) {
|
|
|
35
39
|
query.place = q.place;
|
|
36
40
|
if (s.id === 'openarchieven') {
|
|
37
41
|
query.country = q.country;
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
if (q.birth_year !== undefined)
|
|
43
|
+
query.year_from = Math.max(1, q.birth_year - yearTolerance);
|
|
44
|
+
if (q.death_year !== undefined)
|
|
45
|
+
query.year_to = Math.min(9999, q.death_year + yearTolerance);
|
|
46
|
+
}
|
|
47
|
+
else if (s.kind === 'birth' || s.kind === 'death' || s.kind === 'burial') {
|
|
48
|
+
const year = s.kind === 'birth' ? q.birth_year : q.death_year;
|
|
49
|
+
if (year !== undefined) {
|
|
50
|
+
query.year_from = Math.max(1, year - yearTolerance);
|
|
51
|
+
query.year_to = Math.min(9999, year + yearTolerance);
|
|
52
|
+
}
|
|
40
53
|
}
|
|
41
|
-
else if (s.kind.toLowerCase().includes('birth'))
|
|
42
|
-
query.year_from = query.year_to = q.birth_year;
|
|
43
|
-
else if (s.kind.toLowerCase().includes('death') ||
|
|
44
|
-
s.kind.toLowerCase().includes('burial') ||
|
|
45
|
-
s.id === 'va_birls')
|
|
46
|
-
query.year_from = query.year_to = q.death_year;
|
|
47
54
|
else {
|
|
48
55
|
query.year_from = q.birth_year;
|
|
49
56
|
query.year_to = q.death_year;
|
|
@@ -62,11 +69,11 @@ export async function discover(q, signal) {
|
|
|
62
69
|
birth_date: q.birth_year?.toString(),
|
|
63
70
|
death_date: q.death_year?.toString(),
|
|
64
71
|
birth_location: q.place,
|
|
65
|
-
date_spread_years:
|
|
72
|
+
date_spread_years: yearTolerance,
|
|
66
73
|
limit: 10,
|
|
67
74
|
offset: 0,
|
|
68
75
|
};
|
|
69
|
-
const r = await searchProfiles(filters, wikiTreeDeadline(signal));
|
|
76
|
+
const r = await searchProfiles(filters, wikiTreeDeadline(signal), 'discovery');
|
|
70
77
|
return {
|
|
71
78
|
rows: r.profiles,
|
|
72
79
|
total: r.total,
|
|
@@ -82,12 +89,31 @@ export async function discover(q, signal) {
|
|
|
82
89
|
});
|
|
83
90
|
const indexes = Promise.all(recordSources.map((s) => {
|
|
84
91
|
const input = recordLookup(q, s);
|
|
85
|
-
const lastYear = effectiveYearTo(s);
|
|
86
92
|
if (q.country && !s.country.some((code) => code.toUpperCase() === q.country?.toUpperCase()))
|
|
87
93
|
return { source: s.id, status: 'skipped', reason: 'country_outside_coverage' };
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
const exclusion = recordYearExclusion(s, {
|
|
95
|
+
year_from: input.year_from ?? q.birth_year,
|
|
96
|
+
year_to: input.year_to ?? q.death_year,
|
|
97
|
+
});
|
|
98
|
+
if (exclusion)
|
|
99
|
+
return { source: s.id, status: 'skipped', reason: exclusion.reason };
|
|
100
|
+
if (input.place !== undefined) {
|
|
101
|
+
const place = resolveRecordPlace(s, input.place);
|
|
102
|
+
if (place === undefined)
|
|
103
|
+
return { source: s.id, status: 'skipped', reason: 'unsupported_place' };
|
|
104
|
+
input.place = place;
|
|
105
|
+
}
|
|
106
|
+
const { year_from: requestedStart, year_to: requestedEnd } = input;
|
|
107
|
+
const hasEventWindow = (s.kind === 'birth' || s.kind === 'death' || s.kind === 'burial') &&
|
|
108
|
+
requestedStart !== undefined &&
|
|
109
|
+
requestedEnd !== undefined;
|
|
110
|
+
if (hasEventWindow && s.searchable_year_from !== undefined)
|
|
111
|
+
input.year_from = Math.max(requestedStart, s.searchable_year_from);
|
|
112
|
+
if (hasEventWindow && s.searchable_year_to !== undefined)
|
|
113
|
+
input.year_to = Math.min(requestedEnd, s.searchable_year_to);
|
|
114
|
+
const cutoff = historicalYearTo(s);
|
|
115
|
+
if (cutoff !== undefined)
|
|
116
|
+
input.year_to = Math.min(input.year_to ?? cutoff, cutoff);
|
|
91
117
|
return available(s.id, signal, async () => {
|
|
92
118
|
const r = await searchRecords(input, signal);
|
|
93
119
|
return {
|
|
@@ -95,12 +121,7 @@ export async function discover(q, signal) {
|
|
|
95
121
|
total: r.total,
|
|
96
122
|
has_more: r.has_more,
|
|
97
123
|
as_of: r.as_of,
|
|
98
|
-
applied_filters:
|
|
99
|
-
...input,
|
|
100
|
-
...(lastYear !== s.year_to && {
|
|
101
|
-
year_to: Math.min(input.year_to ?? Infinity, lastYear ?? Infinity),
|
|
102
|
-
}),
|
|
103
|
-
},
|
|
124
|
+
applied_filters: input,
|
|
104
125
|
notices: [
|
|
105
126
|
...(r.notices ?? []),
|
|
106
127
|
...(q.place && !input.place ? ['This index has no place filter.'] : []),
|
|
@@ -117,8 +138,7 @@ export async function discover(q, signal) {
|
|
|
117
138
|
source: s.id,
|
|
118
139
|
description: s.description,
|
|
119
140
|
country: s.country,
|
|
120
|
-
|
|
121
|
-
year_to: effectiveYearTo(s),
|
|
141
|
+
...recordYearCoverage(s),
|
|
122
142
|
})),
|
|
123
143
|
};
|
|
124
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../../src/services/genealogy/discovery.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../../src/services/genealogy/discovery.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAU7B,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,KAAK,UAAU,SAAS,CAAI,MAAc,EAAE,MAAmB,EAAE,IAAsB;IACrF,IAAI,CAAC;QACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAa,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;IAC9D,CAAC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E,EAAE,CAAC,CAAC;YACtD,MAAM,EAAE,CAAC,CAAC,EAAE;YACZ,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,GAAG,kBAAkB,CAAC,CAAC,CAAC;SACzB,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -56,9 +56,10 @@ export declare const recordPageSchema: z.ZodObject<{
|
|
|
56
56
|
export type RecordPage = z.infer<typeof recordPageSchema>;
|
|
57
57
|
export type GenealogyRecord = z.infer<typeof recordSchema>;
|
|
58
58
|
export type GenealogyDate = z.infer<typeof dateSchema>;
|
|
59
|
-
export
|
|
59
|
+
export type RecordQuery = {
|
|
60
60
|
archive_code?: string | undefined;
|
|
61
61
|
birth_place?: string | undefined;
|
|
62
|
+
certificate_number?: string | undefined;
|
|
62
63
|
country?: string | undefined;
|
|
63
64
|
event_place?: string | undefined;
|
|
64
65
|
first_name?: string | undefined;
|
|
@@ -69,11 +70,12 @@ export interface RecordQuery {
|
|
|
69
70
|
query?: string | undefined;
|
|
70
71
|
relation_type?: string | undefined;
|
|
71
72
|
sort?: number | undefined;
|
|
73
|
+
soundex?: string | undefined;
|
|
72
74
|
source: string;
|
|
73
75
|
source_type?: string | undefined;
|
|
74
76
|
year_from?: number | undefined;
|
|
75
77
|
year_to?: number | undefined;
|
|
76
|
-
}
|
|
78
|
+
};
|
|
77
79
|
export interface SourceDescriptor {
|
|
78
80
|
access: 'live' | 'mirror';
|
|
79
81
|
as_of?: string | undefined;
|
|
@@ -84,7 +86,11 @@ export interface SourceDescriptor {
|
|
|
84
86
|
id: string;
|
|
85
87
|
kind: string;
|
|
86
88
|
metadata_url?: string;
|
|
89
|
+
place_filter?: string;
|
|
90
|
+
place_values?: string[];
|
|
87
91
|
publisher: string;
|
|
92
|
+
searchable_year_from?: number;
|
|
93
|
+
searchable_year_to?: number;
|
|
88
94
|
source_rows?: number;
|
|
89
95
|
url: string;
|
|
90
96
|
year_from?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../src/services/genealogy/records.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,eAAO,MAAM,UAAU;;;;;;iBAQiC,CAAC;AAEzD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;iBAwB4C,CAAC;AAEtE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEvD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../src/services/genealogy/records.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAE3C,eAAO,MAAM,UAAU;;;;;;iBAQiC,CAAC;AAEzD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;iBAwB4C,CAAC;AAEtE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG;IACxB,YAAY,CAAC,EAAE,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E,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import type { RecordQuery, SourceDescriptor } from './records.js';
|
|
2
2
|
export declare const recordSources: SourceDescriptor[];
|
|
3
|
-
/**
|
|
4
|
-
export declare function
|
|
3
|
+
/** The latest year visible under the active historical privacy policy. */
|
|
4
|
+
export declare function historicalYearTo(source: SourceDescriptor): number | undefined;
|
|
5
|
+
/** Keep catalogue dates distinct from verified year bounds and the active privacy cutoff. */
|
|
6
|
+
export declare function recordYearCoverage(source: SourceDescriptor): {
|
|
7
|
+
year_from: number | undefined;
|
|
8
|
+
year_to: number | undefined;
|
|
9
|
+
published_year_to?: number;
|
|
10
|
+
searchable_year_from: number | undefined;
|
|
11
|
+
searchable_year_to: number | undefined;
|
|
12
|
+
privacy_year_to: number | undefined;
|
|
13
|
+
};
|
|
14
|
+
type YearRange = Pick<RecordQuery, 'year_from' | 'year_to'>;
|
|
15
|
+
/** Year constraints that can safely decide a query before searching the source. */
|
|
16
|
+
export declare function recordYearExclusion(source: SourceDescriptor, range: YearRange): {
|
|
17
|
+
readonly reason: 'years_outside_coverage';
|
|
18
|
+
readonly year_from: number;
|
|
19
|
+
readonly year_to: number;
|
|
20
|
+
} | {
|
|
21
|
+
readonly year_from?: never;
|
|
22
|
+
readonly reason: 'years_outside_privacy';
|
|
23
|
+
readonly year_to: number;
|
|
24
|
+
} | undefined;
|
|
25
|
+
/** Resolve an accepted place to its effective query value, or return undefined if unsupported. */
|
|
26
|
+
export declare function resolveRecordPlace(source: SourceDescriptor, place: string): string | undefined;
|
|
5
27
|
export declare const profileSource: SourceDescriptor;
|
|
6
28
|
export declare const recordLimit: (s: SourceDescriptor) => number;
|
|
7
29
|
export declare function searchRecords(q: RecordQuery, signal: AbortSignal): Promise<{
|
|
@@ -32,4 +54,5 @@ export declare function searchRecords(q: RecordQuery, signal: AbortSignal): Prom
|
|
|
32
54
|
}[];
|
|
33
55
|
notices?: string[] | undefined;
|
|
34
56
|
}>;
|
|
57
|
+
export {};
|
|
35
58
|
//# sourceMappingURL=search-records.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-records.d.ts","sourceRoot":"","sources":["../../../src/services/genealogy/search-records.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search-records.d.ts","sourceRoot":"","sources":["../../../src/services/genealogy/search-records.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAElE,eAAO,MAAM,aAAa,oBAAuD,CAAC;AAKlF,0EAA0E;AAC1E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,sBAIxD;AAED,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB;;;;;;;EAW1D;AAED,KAAK,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;AAS5D,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,SAAS;qBAIzD,wBAAwB;;;;;qBAGxB,uBAAuB;;cAE3C;AAED,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,sBAEzE;AAED,eAAO,MAAM,aAAa,EAAE,gBAY3B,CAAC;AAaF,eAAO,MAAM,WAAW,MAAO,gBAAgB,WAAiC,CAAC;AACjF,wBAAsB,aAAa,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEtE"}
|
|
@@ -1,25 +1,56 @@
|
|
|
1
1
|
/** @fileoverview Dispatch one deep search after validating the chosen source's filter contract. */
|
|
2
2
|
import { invalidParams } from '@cyanheads/mcp-ts-core/errors';
|
|
3
3
|
import { getServerConfig } from '../../config/server-config.js';
|
|
4
|
-
import {
|
|
4
|
+
import { searchMirror } from '../mirror/mirror-service.js';
|
|
5
|
+
import { mirrorSources } from '../mirror/mirror-sources.js';
|
|
6
|
+
import { protectedSource } from '../mirror/project-row.js';
|
|
5
7
|
import { archiveSource, searchArchiveRecords } from '../open-archives/search-records.js';
|
|
6
|
-
import { socrataSources } from '../socrata/indexes.js';
|
|
8
|
+
import { indexes, nycCounty, socrataSources } from '../socrata/indexes.js';
|
|
7
9
|
import { searchIndex } from '../socrata/search-index.js';
|
|
8
10
|
import { searchProfilesInput } from '../wikitree/search-profiles.js';
|
|
9
11
|
export const recordSources = [archiveSource, ...socrataSources, ...mirrorSources];
|
|
10
12
|
const historicalSources = new Set([
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'ct_divorces',
|
|
14
|
-
'oh_births',
|
|
15
|
-
'mo_births',
|
|
16
|
-
'hi_marriages',
|
|
13
|
+
...indexes.filter((index) => index.protectedEvent).map((index) => index.id),
|
|
14
|
+
...mirrorSources.map((source) => source.id).filter(protectedSource),
|
|
17
15
|
]);
|
|
18
|
-
/**
|
|
19
|
-
export function
|
|
16
|
+
/** The latest year visible under the active historical privacy policy. */
|
|
17
|
+
export function historicalYearTo(source) {
|
|
20
18
|
return historicalSources.has(source.id) && getServerConfig().withholdLiving
|
|
21
|
-
?
|
|
22
|
-
:
|
|
19
|
+
? new Date().getUTCFullYear() - 101
|
|
20
|
+
: undefined;
|
|
21
|
+
}
|
|
22
|
+
/** Keep catalogue dates distinct from verified year bounds and the active privacy cutoff. */
|
|
23
|
+
export function recordYearCoverage(source) {
|
|
24
|
+
const cutoff = historicalYearTo(source);
|
|
25
|
+
const yearTo = cutoff === undefined ? source.year_to : Math.min(source.year_to ?? cutoff, cutoff);
|
|
26
|
+
return {
|
|
27
|
+
year_from: source.year_from,
|
|
28
|
+
year_to: yearTo,
|
|
29
|
+
...(yearTo !== source.year_to && { published_year_to: source.year_to }),
|
|
30
|
+
searchable_year_from: source.searchable_year_from,
|
|
31
|
+
searchable_year_to: source.searchable_year_to,
|
|
32
|
+
privacy_year_to: cutoff,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function outsideYears(range, start, end) {
|
|
36
|
+
return ((start !== undefined && (range.year_to ?? Infinity) < start) ||
|
|
37
|
+
(end !== undefined && (range.year_from ?? 0) > end));
|
|
38
|
+
}
|
|
39
|
+
/** Year constraints that can safely decide a query before searching the source. */
|
|
40
|
+
export function recordYearExclusion(source, range) {
|
|
41
|
+
if (source.access === 'mirror' && !getServerConfig().mirrorEnabled)
|
|
42
|
+
return;
|
|
43
|
+
const { searchable_year_from: start, searchable_year_to: end } = source;
|
|
44
|
+
if (start !== undefined && end !== undefined && outsideYears(range, start, end))
|
|
45
|
+
return { reason: 'years_outside_coverage', year_from: start, year_to: end };
|
|
46
|
+
const cutoff = historicalYearTo(source);
|
|
47
|
+
if (cutoff !== undefined && outsideYears(range, undefined, cutoff))
|
|
48
|
+
return { reason: 'years_outside_privacy', year_to: cutoff };
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
/** Resolve an accepted place to its effective query value, or return undefined if unsupported. */
|
|
52
|
+
export function resolveRecordPlace(source, place) {
|
|
53
|
+
return source.place_values ? nycCounty(place) : place;
|
|
23
54
|
}
|
|
24
55
|
const descriptorById = new Map(recordSources.map((source) => [source.id, source]));
|
|
25
56
|
export const profileSource = {
|
|
@@ -53,20 +84,40 @@ export async function searchRecords(q, signal) {
|
|
|
53
84
|
for (const [key, v] of Object.entries(q))
|
|
54
85
|
if (v !== undefined && !allowed.has(key))
|
|
55
86
|
throw invalidParams(`Filter ${key} is unsupported for ${source.id}. Available filters: ${source.filters.join(', ')}.`, { reason: 'unsupported_filter', field: key });
|
|
56
|
-
if (!q.query && !q.first_name && !q.last_name)
|
|
57
|
-
|
|
87
|
+
if (!q.query && !q.first_name && !q.last_name) {
|
|
88
|
+
if (!q.certificate_number)
|
|
89
|
+
throw invalidParams('Supply a name or an Open Archives query.');
|
|
90
|
+
if (!q.place || q.year_from === undefined || q.year_from !== q.year_to)
|
|
91
|
+
throw invalidParams('A certificate lookup without names requires a borough and a single year.', { reason: 'certificate_scope_required' });
|
|
92
|
+
}
|
|
58
93
|
if ((q.query && (q.first_name || q.last_name)) || (q.event_place && q.place))
|
|
59
94
|
throw invalidParams('Supply either a query or name fields, and use only one event-place filter.');
|
|
60
95
|
if (q.year_from !== undefined && q.year_to !== undefined && q.year_from > q.year_to)
|
|
61
96
|
throw invalidParams('year_from must be no later than year_to.');
|
|
97
|
+
const exclusion = recordYearExclusion(source, q);
|
|
98
|
+
if (exclusion)
|
|
99
|
+
throw invalidParams(exclusion.reason === 'years_outside_coverage'
|
|
100
|
+
? `The ${source.id} index covers ${exclusion.year_from}–${exclusion.year_to}.`
|
|
101
|
+
: `Historical privacy filtering permits known event years through ${exclusion.year_to}.`, exclusion);
|
|
102
|
+
const cutoff = historicalYearTo(source);
|
|
103
|
+
const place = q.place === undefined ? undefined : resolveRecordPlace(source, q.place);
|
|
104
|
+
if (q.place !== undefined && place === undefined)
|
|
105
|
+
throw invalidParams(`Use one of these places for ${source.id}: ${source.place_values?.join(', ')}.`, { reason: 'unsupported_place', field: 'place' });
|
|
62
106
|
const cap = recordLimit(source);
|
|
63
|
-
const input = { ...q, limit: Math.min(q.limit, cap) };
|
|
107
|
+
const input = { ...q, place, limit: Math.min(q.limit, cap) };
|
|
64
108
|
const scoped = AbortSignal.any([signal, AbortSignal.timeout(48_000)]);
|
|
65
109
|
const page = await (source.id === 'openarchieven'
|
|
66
110
|
? searchArchiveRecords(input, scoped)
|
|
67
111
|
: source.access === 'mirror'
|
|
68
112
|
? searchMirror(input, scoped)
|
|
69
|
-
: searchIndex(input, scoped));
|
|
113
|
+
: searchIndex(input, scoped, cutoff));
|
|
114
|
+
if (!page.total && (input.place || input.event_place) && source.place_filter)
|
|
115
|
+
page.notices = [...(page.notices ?? []), `Place matched against ${source.place_filter}.`];
|
|
116
|
+
if (!page.total && outsideYears(input, source.year_from, source.year_to))
|
|
117
|
+
page.notices = [
|
|
118
|
+
...(page.notices ?? []),
|
|
119
|
+
`The requested years fall outside the catalogue span (${source.year_from ?? 'unknown'}–${source.year_to ?? 'unknown'}). The search ran over the available years in the request.`,
|
|
120
|
+
];
|
|
70
121
|
if (input.limit !== q.limit)
|
|
71
122
|
page.notices = [
|
|
72
123
|
...(page.notices ?? []),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-records.js","sourceRoot":"","sources":["../../../src/services/genealogy/search-records.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"search-records.js","sourceRoot":"","sources":["../../../src/services/genealogy/search-records.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC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../../../src/services/genealogy/upstream.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,KAAK,EAAa,MAAM,8BAA8B,CAAC;AAUrE,oGAAoG;AACpG,wBAAgB,WAAW,CACzB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAElB;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"upstream.d.ts","sourceRoot":"","sources":["../../../src/services/genealogy/upstream.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,KAAK,EAAa,MAAM,8BAA8B,CAAC;AAUrE,oGAAoG;AACpG,wBAAgB,WAAW,CACzB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAElB;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM;UAwEhD,OAAO;;GA2BvD"}
|
|
@@ -36,7 +36,7 @@ export function requestJsonResponse(url, pacer, signal, provider) {
|
|
|
36
36
|
break;
|
|
37
37
|
await response.body?.cancel();
|
|
38
38
|
const location = response.headers.get('location');
|
|
39
|
-
const next = location
|
|
39
|
+
const next = location ? URL.parse(location, target) : null;
|
|
40
40
|
if (!next ||
|
|
41
41
|
redirects >= 4 ||
|
|
42
42
|
url.origin !== 'https://api.openarchieven.nl' ||
|