@cyanheads/brapi-mcp-server 0.4.5 → 0.4.7
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/CLAUDE.md +1 -1
- package/README.md +1 -1
- package/changelog/0.4.x/0.4.6.md +26 -0
- package/changelog/0.4.x/0.4.7.md +35 -0
- package/dist/config/server-config.d.ts +1 -0
- package/dist/config/server-config.d.ts.map +1 -1
- package/dist/config/server-config.js +7 -0
- package/dist/config/server-config.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-germplasm.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/brapi-find-germplasm.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-germplasm.tool.js +11 -2
- package/dist/mcp-server/tools/definitions/brapi-find-germplasm.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-images.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/brapi-find-images.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-images.tool.js +11 -2
- package/dist/mcp-server/tools/definitions/brapi-find-images.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-locations.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/brapi-find-locations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-locations.tool.js +11 -2
- package/dist/mcp-server/tools/definitions/brapi-find-locations.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-observations.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/brapi-find-observations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-observations.tool.js +11 -2
- package/dist/mcp-server/tools/definitions/brapi-find-observations.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-studies.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/brapi-find-studies.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-studies.tool.js +11 -2
- package/dist/mcp-server/tools/definitions/brapi-find-studies.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variables.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variables.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variables.tool.js +11 -2
- package/dist/mcp-server/tools/definitions/brapi-find-variables.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variants.tool.d.ts +7 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variants.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-find-variants.tool.js +11 -2
- package/dist/mcp-server/tools/definitions/brapi-find-variants.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-get-study.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-get-study.tool.js +13 -5
- package/dist/mcp-server/tools/definitions/brapi-get-study.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-submit-observations.tool.d.ts +1 -0
- package/dist/mcp-server/tools/definitions/brapi-submit-observations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-submit-observations.tool.js +18 -4
- package/dist/mcp-server/tools/definitions/brapi-submit-observations.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +43 -7
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared/find-helpers.d.ts +23 -6
- package/dist/mcp-server/tools/shared/find-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared/find-helpers.js +41 -5
- package/dist/mcp-server/tools/shared/find-helpers.js.map +1 -1
- package/dist/services/brapi-client/brapi-client.d.ts +16 -1
- package/dist/services/brapi-client/brapi-client.d.ts.map +1 -1
- package/dist/services/brapi-client/brapi-client.js +65 -5
- package/dist/services/brapi-client/brapi-client.js.map +1 -1
- package/dist/services/brapi-client/index.d.ts +2 -1
- package/dist/services/brapi-client/index.d.ts.map +1 -1
- package/dist/services/brapi-client/index.js +2 -1
- package/dist/services/brapi-client/index.js.map +1 -1
- package/dist/services/brapi-client/types.d.ts +24 -0
- package/dist/services/brapi-client/types.d.ts.map +1 -1
- package/dist/services/brapi-client/types.js +2 -1
- package/dist/services/brapi-client/types.js.map +1 -1
- package/dist/services/brapi-dialect/brapi-test-dialect.d.ts +19 -8
- package/dist/services/brapi-dialect/brapi-test-dialect.d.ts.map +1 -1
- package/dist/services/brapi-dialect/brapi-test-dialect.js +148 -11
- package/dist/services/brapi-dialect/brapi-test-dialect.js.map +1 -1
- package/dist/services/brapi-dialect/cassavabase-dialect.d.ts +2 -2
- package/dist/services/brapi-dialect/cassavabase-dialect.d.ts.map +1 -1
- package/dist/services/brapi-dialect/cassavabase-dialect.js +23 -40
- package/dist/services/brapi-dialect/cassavabase-dialect.js.map +1 -1
- package/dist/services/brapi-dialect/singularizing-dialect.d.ts +47 -0
- package/dist/services/brapi-dialect/singularizing-dialect.d.ts.map +1 -0
- package/dist/services/brapi-dialect/singularizing-dialect.js +63 -0
- package/dist/services/brapi-dialect/singularizing-dialect.js.map +1 -0
- package/dist/services/brapi-dialect/spec-dialect.d.ts +7 -5
- package/dist/services/brapi-dialect/spec-dialect.d.ts.map +1 -1
- package/dist/services/brapi-dialect/spec-dialect.js +8 -6
- package/dist/services/brapi-dialect/spec-dialect.js.map +1 -1
- package/dist/services/brapi-dialect/types.d.ts +10 -1
- package/dist/services/brapi-dialect/types.d.ts.map +1 -1
- package/dist/services/reference-data-cache/reference-data-cache.d.ts +14 -1
- package/dist/services/reference-data-cache/reference-data-cache.d.ts.map +1 -1
- package/dist/services/reference-data-cache/reference-data-cache.js +22 -3
- package/dist/services/reference-data-cache/reference-data-cache.js.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* we invented this earlier; not in the BrAPI v2.1 spec, no SGN-family
|
|
19
19
|
* server honors it).
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Translation engine lives in `singularizing-dialect.ts`; this module supplies
|
|
22
|
+
* SGN-specific data only.
|
|
23
23
|
*
|
|
24
24
|
* @module services/brapi-dialect/cassavabase-dialect
|
|
25
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cassavabase-dialect.d.ts","sourceRoot":"","sources":["../../../src/services/brapi-dialect/cassavabase-dialect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"cassavabase-dialect.d.ts","sourceRoot":"","sources":["../../../src/services/brapi-dialect/cassavabase-dialect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqK/C,eAAO,MAAM,kBAAkB,cAAuD,CAAC;AAEvF,eAAO,MAAM,gBAAgB,cAAuD,CAAC"}
|
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
* we invented this earlier; not in the BrAPI v2.1 spec, no SGN-family
|
|
19
19
|
* server honors it).
|
|
20
20
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Translation engine lives in `singularizing-dialect.ts`; this module supplies
|
|
22
|
+
* SGN-specific data only.
|
|
23
23
|
*
|
|
24
24
|
* @module services/brapi-dialect/cassavabase-dialect
|
|
25
25
|
*/
|
|
26
|
+
import { createSingularizingDialect } from './singularizing-dialect.js';
|
|
26
27
|
/**
|
|
27
28
|
* Plural BrAPI v2.1 filter key → singular form CassavaBase honors. Keyed by
|
|
28
29
|
* endpoint resource segment (matches the path's first segment, no leading
|
|
@@ -76,6 +77,16 @@ const PLURAL_TO_SINGULAR = {
|
|
|
76
77
|
trialDbIds: 'trialDbId',
|
|
77
78
|
observationLevels: 'observationLevel',
|
|
78
79
|
},
|
|
80
|
+
observationunits: {
|
|
81
|
+
studyDbIds: 'studyDbId',
|
|
82
|
+
germplasmDbIds: 'germplasmDbId',
|
|
83
|
+
observationUnitDbIds: 'observationUnitDbId',
|
|
84
|
+
programDbIds: 'programDbId',
|
|
85
|
+
trialDbIds: 'trialDbId',
|
|
86
|
+
locationDbIds: 'locationDbId',
|
|
87
|
+
seasonDbIds: 'seasonDbId',
|
|
88
|
+
observationLevels: 'observationLevel',
|
|
89
|
+
},
|
|
79
90
|
locations: {
|
|
80
91
|
locationDbIds: 'locationDbId',
|
|
81
92
|
locationNames: 'locationName',
|
|
@@ -132,7 +143,6 @@ const DROPPED_FILTERS = {
|
|
|
132
143
|
studies: new Set(['searchText', 'locationDbIds', 'locationDbId']),
|
|
133
144
|
germplasm: new Set(['searchText']),
|
|
134
145
|
};
|
|
135
|
-
const EMPTY_DROP_SET = new Set();
|
|
136
146
|
/**
|
|
137
147
|
* POST `/search/{noun}` routes CassavaBase advertises in `/calls` but does not
|
|
138
148
|
* actually serve. Probing them in practice yields hangs, 5xx responses, or
|
|
@@ -158,46 +168,19 @@ const DISABLED_SEARCH_ENDPOINTS = new Set([
|
|
|
158
168
|
'samples',
|
|
159
169
|
'callsets',
|
|
160
170
|
]);
|
|
171
|
+
const SGN_NOTES = [
|
|
172
|
+
'SGN/Breedbase-style GET filters use singular names for many fields; this dialect translates plural BrAPI v2.1 filters before sending requests.',
|
|
173
|
+
'Several advertised POST /search routes are treated as unavailable because SGN-family deployments often expose them in /calls while serving broken or hanging responses.',
|
|
174
|
+
];
|
|
161
175
|
function createSgnFamilyDialect(id, label) {
|
|
162
|
-
return {
|
|
176
|
+
return createSingularizingDialect({
|
|
163
177
|
id,
|
|
178
|
+
label,
|
|
179
|
+
pluralToSingular: PLURAL_TO_SINGULAR,
|
|
180
|
+
droppedFilters: DROPPED_FILTERS,
|
|
164
181
|
disabledSearchEndpoints: DISABLED_SEARCH_ENDPOINTS,
|
|
165
|
-
notes:
|
|
166
|
-
|
|
167
|
-
'Several advertised POST /search routes are treated as unavailable because SGN-family deployments often expose them in /calls while serving broken or hanging responses.',
|
|
168
|
-
],
|
|
169
|
-
adaptGetFilters(endpoint, filters) {
|
|
170
|
-
const mapping = PLURAL_TO_SINGULAR[endpoint] ?? {};
|
|
171
|
-
const dropped = DROPPED_FILTERS[endpoint] ?? EMPTY_DROP_SET;
|
|
172
|
-
const out = {};
|
|
173
|
-
const warnings = [];
|
|
174
|
-
for (const [key, value] of Object.entries(filters)) {
|
|
175
|
-
if (value === undefined)
|
|
176
|
-
continue;
|
|
177
|
-
if (dropped.has(key)) {
|
|
178
|
-
warnings.push(`${label} dialect: dropped filter '${key}' — this server does not honor it. Adjust the query or omit the filter.`);
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
const target = mapping[key];
|
|
182
|
-
if (!target) {
|
|
183
|
-
out[key] = value;
|
|
184
|
-
continue;
|
|
185
|
-
}
|
|
186
|
-
if (Array.isArray(value)) {
|
|
187
|
-
if (value.length === 0)
|
|
188
|
-
continue;
|
|
189
|
-
out[target] = value[0];
|
|
190
|
-
if (value.length > 1) {
|
|
191
|
-
warnings.push(`${label} dialect: '${key}' downcast to '${target}'; only the first value (${JSON.stringify(value[0])}) was sent — this server's GET /${endpoint} accepts a single value per filter, not arrays. Run separate calls for the other values, or use a curated tool that paginates over them.`);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
out[target] = value;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return { filters: out, warnings };
|
|
199
|
-
},
|
|
200
|
-
};
|
|
182
|
+
notes: SGN_NOTES,
|
|
183
|
+
});
|
|
201
184
|
}
|
|
202
185
|
export const cassavabaseDialect = createSgnFamilyDialect('cassavabase', 'CassavaBase');
|
|
203
186
|
export const breedbaseDialect = createSgnFamilyDialect('breedbase', 'Breedbase/SGN');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cassavabase-dialect.js","sourceRoot":"","sources":["../../../src/services/brapi-dialect/cassavabase-dialect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"cassavabase-dialect.js","sourceRoot":"","sources":["../../../src/services/brapi-dialect/cassavabase-dialect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAGxE;;;;;;;;;;;GAWG;AACH,MAAM,kBAAkB,GAAqD;IAC3E,OAAO,EAAE;QACP,eAAe,EAAE,gBAAgB,EAAE,kBAAkB;QACrD,UAAU,EAAE,WAAW;QACvB,YAAY,EAAE,aAAa,EAAE,kBAAkB;QAC/C,YAAY,EAAE,aAAa;QAC3B,UAAU,EAAE,WAAW,EAAE,kBAAkB;QAC3C,UAAU,EAAE,WAAW;QACvB,aAAa,EAAE,cAAc;QAC7B,WAAW,EAAE,YAAY,EAAE,kBAAkB;QAC7C,UAAU,EAAE,WAAW;QACvB,UAAU,EAAE,WAAW;QACvB,UAAU,EAAE,WAAW;QACvB,SAAS,EAAE,UAAU;QACrB,oBAAoB,EAAE,qBAAqB;QAC3C,wBAAwB,EAAE,yBAAyB;KACpD;IACD,SAAS,EAAE;QACT,eAAe,EAAE,gBAAgB;QACjC,cAAc,EAAE,eAAe;QAC/B,cAAc,EAAE,eAAe;QAC/B,aAAa,EAAE,cAAc;QAC7B,gBAAgB,EAAE,iBAAiB;QACnC,WAAW,EAAE,YAAY;QACzB,QAAQ,EAAE,SAAS;QACnB,YAAY,EAAE,aAAa;QAC3B,UAAU,EAAE,WAAW;QACvB,UAAU,EAAE,WAAW;QACvB,oBAAoB,EAAE,qBAAqB;KAC5C;IACD,YAAY,EAAE;QACZ,UAAU,EAAE,WAAW,EAAE,kBAAkB;QAC3C,cAAc,EAAE,eAAe;QAC/B,wBAAwB,EAAE,yBAAyB;QACnD,oBAAoB,EAAE,qBAAqB;QAC3C,gBAAgB,EAAE,iBAAiB;QACnC,WAAW,EAAE,YA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;AACH,MAAM,eAAe,GAAwC;IAC3D,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC;IACjE,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;CACnC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,yBAAyB,GAAwB,IAAI,GAAG,CAAC;IAC7D,WAAW;IACX,SAAS;IACT,cAAc;IACd,kBAAkB;IAClB,WAAW;IACX,WAAW;IACX,QAAQ;IACR,UAAU;IACV,aAAa;IACb,SAAS;IACT,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG;IAChB,gJAAgJ;IAChJ,yKAAyK;CACjK,CAAC;AAEX,SAAS,sBAAsB,CAAC,EAAU,EAAE,KAAa;IACvD,OAAO,0BAA0B,CAAC;QAChC,EAAE;QACF,KAAK;QACL,gBAAgB,EAAE,kBAAkB;QACpC,cAAc,EAAE,eAAe;QAC/B,uBAAuB,EAAE,yBAAyB;QAClD,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAEvF,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Generic factory for dialects that translate BrAPI v2.1 plural
|
|
3
|
+
* filter keys (`studyDbIds`, `germplasmDbIds`, …) to the v2.0 singular forms
|
|
4
|
+
* the upstream actually honors. Used by both the SGN/Breedbase family
|
|
5
|
+
* (`cassavabase-dialect`) and the BrAPI Community Test Server
|
|
6
|
+
* (`brapi-test-dialect`) — the two share an identical translation engine but
|
|
7
|
+
* carry different per-endpoint mappings, drop lists, and search-route flags,
|
|
8
|
+
* so the data lives in each dialect module while the engine lives here.
|
|
9
|
+
*
|
|
10
|
+
* @module services/brapi-dialect/singularizing-dialect
|
|
11
|
+
*/
|
|
12
|
+
import type { BrapiDialect } from './types.js';
|
|
13
|
+
export interface SingularizingDialectConfig {
|
|
14
|
+
/**
|
|
15
|
+
* POST `/search/{noun}` routes the dialect knows are dead — advertised in
|
|
16
|
+
* `/calls` but unresponsive in practice. Forwarded onto `BrapiDialect`
|
|
17
|
+
* verbatim. Omit when search routes work normally.
|
|
18
|
+
*/
|
|
19
|
+
disabledSearchEndpoints?: ReadonlySet<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Per-endpoint set of filter keys to drop entirely — the server silently
|
|
22
|
+
* ignores them in both plural and singular form. Drops surface a warning so
|
|
23
|
+
* the agent stops trusting the response as if the filter were honored.
|
|
24
|
+
*/
|
|
25
|
+
droppedFilters?: Readonly<Record<string, ReadonlySet<string>>>;
|
|
26
|
+
/** Stable dialect id surfaced in logs and the orientation envelope. */
|
|
27
|
+
id: string;
|
|
28
|
+
/** Human-readable label used in warning text (e.g. `CassavaBase`). */
|
|
29
|
+
label: string;
|
|
30
|
+
/** Compatibility notes surfaced in brapi_connect / brapi_server_info. */
|
|
31
|
+
notes?: readonly string[];
|
|
32
|
+
/**
|
|
33
|
+
* Per-endpoint mapping from the v2.1 plural filter key to the singular form
|
|
34
|
+
* the server honors. Keyed by bare resource segment (`studies`, no slash).
|
|
35
|
+
* Endpoints not listed pass through with no translation.
|
|
36
|
+
*/
|
|
37
|
+
pluralToSingular: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Build a `BrapiDialect` whose `adaptGetFilters` translates plural v2.1 filter
|
|
41
|
+
* names to the configured singulars, drops blacklisted keys, and downcasts
|
|
42
|
+
* multi-value arrays to the first element with a loud warning (the v2.0 GET
|
|
43
|
+
* surface can't express multi-value filters; the agent should re-call per
|
|
44
|
+
* value or use a curated tool that paginates).
|
|
45
|
+
*/
|
|
46
|
+
export declare function createSingularizingDialect(config: SingularizingDialectConfig): BrapiDialect;
|
|
47
|
+
//# sourceMappingURL=singularizing-dialect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singularizing-dialect.d.ts","sourceRoot":"","sources":["../../../src/services/brapi-dialect/singularizing-dialect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAqB,MAAM,YAAY,CAAC;AAElE,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9C;;;;OAIG;IACH,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC/D,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B;;;;OAIG;IACH,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;CAC9E;AAID;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,0BAA0B,GAAG,YAAY,CAiD3F"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Generic factory for dialects that translate BrAPI v2.1 plural
|
|
3
|
+
* filter keys (`studyDbIds`, `germplasmDbIds`, …) to the v2.0 singular forms
|
|
4
|
+
* the upstream actually honors. Used by both the SGN/Breedbase family
|
|
5
|
+
* (`cassavabase-dialect`) and the BrAPI Community Test Server
|
|
6
|
+
* (`brapi-test-dialect`) — the two share an identical translation engine but
|
|
7
|
+
* carry different per-endpoint mappings, drop lists, and search-route flags,
|
|
8
|
+
* so the data lives in each dialect module while the engine lives here.
|
|
9
|
+
*
|
|
10
|
+
* @module services/brapi-dialect/singularizing-dialect
|
|
11
|
+
*/
|
|
12
|
+
const EMPTY_DROP_SET = new Set();
|
|
13
|
+
/**
|
|
14
|
+
* Build a `BrapiDialect` whose `adaptGetFilters` translates plural v2.1 filter
|
|
15
|
+
* names to the configured singulars, drops blacklisted keys, and downcasts
|
|
16
|
+
* multi-value arrays to the first element with a loud warning (the v2.0 GET
|
|
17
|
+
* surface can't express multi-value filters; the agent should re-call per
|
|
18
|
+
* value or use a curated tool that paginates).
|
|
19
|
+
*/
|
|
20
|
+
export function createSingularizingDialect(config) {
|
|
21
|
+
const adaptGetFilters = (endpoint, filters) => {
|
|
22
|
+
const mapping = config.pluralToSingular[endpoint] ?? {};
|
|
23
|
+
const droppedSet = config.droppedFilters?.[endpoint] ?? EMPTY_DROP_SET;
|
|
24
|
+
const out = {};
|
|
25
|
+
const warnings = [];
|
|
26
|
+
const dropped = [];
|
|
27
|
+
for (const [key, value] of Object.entries(filters)) {
|
|
28
|
+
if (value === undefined)
|
|
29
|
+
continue;
|
|
30
|
+
if (droppedSet.has(key)) {
|
|
31
|
+
dropped.push(key);
|
|
32
|
+
warnings.push(`${config.label} dialect: dropped filter '${key}' — this server does not honor it. Adjust the query or omit the filter.`);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
const target = mapping[key];
|
|
36
|
+
if (!target) {
|
|
37
|
+
out[key] = value;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (Array.isArray(value)) {
|
|
41
|
+
if (value.length === 0)
|
|
42
|
+
continue;
|
|
43
|
+
out[target] = value[0];
|
|
44
|
+
if (value.length > 1) {
|
|
45
|
+
warnings.push(`${config.label} dialect: '${key}' downcast to '${target}'; only the first value (${JSON.stringify(value[0])}) was sent — this server's GET /${endpoint} accepts a single value per filter, not arrays. Run separate calls for the other values, or use a curated tool that paginates over them.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
out[target] = value;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { filters: out, dropped, warnings };
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
id: config.id,
|
|
56
|
+
adaptGetFilters,
|
|
57
|
+
...(config.disabledSearchEndpoints !== undefined && {
|
|
58
|
+
disabledSearchEndpoints: config.disabledSearchEndpoints,
|
|
59
|
+
}),
|
|
60
|
+
...(config.notes !== undefined && { notes: config.notes }),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=singularizing-dialect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singularizing-dialect.js","sourceRoot":"","sources":["../../../src/services/brapi-dialect/singularizing-dialect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA+BH,MAAM,cAAc,GAAwB,IAAI,GAAG,EAAE,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAkC;IAC3E,MAAM,eAAe,GAAG,CACtB,QAAgB,EAChB,OAA0C,EACvB,EAAE;QACrB,MAAM,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxD,MAAM,UAAU,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC;QACvE,MAAM,GAAG,GAA4B,EAAE,CAAC;QACxC,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACnD,IAAI,KAAK,KAAK,SAAS;gBAAE,SAAS;YAClC,IAAI,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxB,OAAO,CAAC,IAAI,CAAC,GAAG,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
1
1
|
/**
|
|
2
2
|
* @fileoverview The default `spec` dialect — passes filters through verbatim.
|
|
3
|
-
* Used for
|
|
4
|
-
* specified (
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* Used for servers that implement BrAPI v2.1 query-string filters as
|
|
4
|
+
* specified (modern PIPPA / GnpIS / Reference Server deployments). Selected
|
|
5
|
+
* when no server-specific dialect matches the detected `serverInfo.serverName`,
|
|
6
|
+
* or when an operator pins `BRAPI_<ALIAS>_DIALECT=spec` to override detection.
|
|
7
|
+
*
|
|
8
|
+
* Note: the BrAPI Community Test Server is intentionally **not** spec-shaped
|
|
9
|
+
* for GET filters — see `brapi-test-dialect.ts`.
|
|
8
10
|
*
|
|
9
11
|
* @module services/brapi-dialect/spec-dialect
|
|
10
12
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-dialect.d.ts","sourceRoot":"","sources":["../../../src/services/brapi-dialect/spec-dialect.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"spec-dialect.d.ts","sourceRoot":"","sources":["../../../src/services/brapi-dialect/spec-dialect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,WAAW,EAAE,YAKzB,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview The default `spec` dialect — passes filters through verbatim.
|
|
3
|
-
* Used for
|
|
4
|
-
* specified (
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* Used for servers that implement BrAPI v2.1 query-string filters as
|
|
4
|
+
* specified (modern PIPPA / GnpIS / Reference Server deployments). Selected
|
|
5
|
+
* when no server-specific dialect matches the detected `serverInfo.serverName`,
|
|
6
|
+
* or when an operator pins `BRAPI_<ALIAS>_DIALECT=spec` to override detection.
|
|
7
|
+
*
|
|
8
|
+
* Note: the BrAPI Community Test Server is intentionally **not** spec-shaped
|
|
9
|
+
* for GET filters — see `brapi-test-dialect.ts`.
|
|
8
10
|
*
|
|
9
11
|
* @module services/brapi-dialect/spec-dialect
|
|
10
12
|
*/
|
|
11
13
|
export const specDialect = {
|
|
12
14
|
id: 'spec',
|
|
13
15
|
adaptGetFilters(_endpoint, filters) {
|
|
14
|
-
return { filters: { ...filters }, warnings: [] };
|
|
16
|
+
return { filters: { ...filters }, dropped: [], warnings: [] };
|
|
15
17
|
},
|
|
16
18
|
};
|
|
17
19
|
//# sourceMappingURL=spec-dialect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-dialect.js","sourceRoot":"","sources":["../../../src/services/brapi-dialect/spec-dialect.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"spec-dialect.js","sourceRoot":"","sources":["../../../src/services/brapi-dialect/spec-dialect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,EAAE,EAAE,MAAM;IACV,eAAe,CAAC,SAAS,EAAE,OAAO;QAChC,OAAO,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAChE,CAAC;CACF,CAAC"}
|
|
@@ -18,9 +18,18 @@
|
|
|
18
18
|
* Result of adapting a filter map for a specific endpoint. `filters` is the
|
|
19
19
|
* wire-shape map (what gets serialized into the URL); `warnings` are
|
|
20
20
|
* operator-facing notes about lossy conversions (multi-value array downcast,
|
|
21
|
-
* filters dropped because the server doesn't honor them, etc.).
|
|
21
|
+
* filters dropped because the server doesn't honor them, etc.). `dropped` is
|
|
22
|
+
* the structured list of input keys that were removed entirely so callers can
|
|
23
|
+
* detect "agent intended to scope, dialect couldn't honor it" without parsing
|
|
24
|
+
* warning strings.
|
|
22
25
|
*/
|
|
23
26
|
export interface DialectAdaptation {
|
|
27
|
+
/**
|
|
28
|
+
* Input filter keys the dialect dropped entirely (server doesn't honor them
|
|
29
|
+
* in any form). Each dropped key also produces a human-readable entry in
|
|
30
|
+
* `warnings`. Empty when nothing was dropped.
|
|
31
|
+
*/
|
|
32
|
+
dropped: readonly string[];
|
|
24
33
|
filters: Record<string, unknown>;
|
|
25
34
|
warnings: string[];
|
|
26
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/brapi-dialect/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/brapi-dialect/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;;;;OASG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,iBAAiB,CAAC;IACjG;;;;;;;;;OASG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC"}
|
|
@@ -10,8 +10,21 @@
|
|
|
10
10
|
import type { Context } from '@cyanheads/mcp-ts-core';
|
|
11
11
|
import type { ServerConfig } from '../../config/server-config.js';
|
|
12
12
|
import { type BrapiClient, type BrapiRequestOptions } from '../../services/brapi-client/index.js';
|
|
13
|
+
import type { BrapiDialect } from '../../services/brapi-dialect/index.js';
|
|
13
14
|
import type { Location, Program, Trial } from './types.js';
|
|
14
|
-
export
|
|
15
|
+
export interface ReferenceLookupOptions {
|
|
16
|
+
auth?: BrapiRequestOptions['auth'];
|
|
17
|
+
/**
|
|
18
|
+
* Active dialect for the connection. Threaded through to the BrapiClient so
|
|
19
|
+
* the v2.1 plural ID filter (`trialDbIds`, `programDbIds`, …) is translated
|
|
20
|
+
* to the singular form servers like CassavaBase honor. Without this, the
|
|
21
|
+
* filter is silently ignored upstream and the response carries an arbitrary
|
|
22
|
+
* page-zero row instead of the requested record.
|
|
23
|
+
*/
|
|
24
|
+
dialect?: BrapiDialect;
|
|
25
|
+
/** Optional warnings sink — receives any dialect-translation warnings. */
|
|
26
|
+
warnings?: string[];
|
|
27
|
+
}
|
|
15
28
|
export declare class ReferenceDataCache {
|
|
16
29
|
private readonly serverConfig;
|
|
17
30
|
private readonly client;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-data-cache.d.ts","sourceRoot":"","sources":["../../../src/services/reference-data-cache/reference-data-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,mBAAmB,
|
|
1
|
+
{"version":3,"file":"reference-data-cache.d.ts","sourceRoot":"","sources":["../../../src/services/reference-data-cache/reference-data-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EACL,KAAK,W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YAAY;YAsCZ,UAAU;YAsCV,YAAY;CAY3B;AAiBD,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAEvE;AAED,wBAAgB,qBAAqB,IAAI,kBAAkB,CAO1D;AAED,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module services/reference-data-cache/reference-data-cache
|
|
9
9
|
*/
|
|
10
|
-
import { getBrapiClient, } from '../../services/brapi-client/index.js';
|
|
10
|
+
import { getBrapiClient, isDialectAllDropped, } from '../../services/brapi-client/index.js';
|
|
11
11
|
const PROGRAM_CFG = {
|
|
12
12
|
endpoint: '/programs',
|
|
13
13
|
idFilter: 'programDbIds',
|
|
@@ -83,11 +83,30 @@ export class ReferenceDataCache {
|
|
|
83
83
|
async fetchBatch(cfg, baseUrl, ids, ctx, options) {
|
|
84
84
|
const requestOptions = {
|
|
85
85
|
params: { [cfg.idFilter]: ids, pageSize: ids.length },
|
|
86
|
+
timeoutMs: this.serverConfig.companionTimeoutMs,
|
|
87
|
+
retryMaxAttempts: 0,
|
|
86
88
|
};
|
|
87
89
|
if (options.auth)
|
|
88
90
|
requestOptions.auth = options.auth;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
if (options.dialect)
|
|
92
|
+
requestOptions.dialect = options.dialect;
|
|
93
|
+
if (options.warnings)
|
|
94
|
+
requestOptions.warnings = options.warnings;
|
|
95
|
+
try {
|
|
96
|
+
const env = await this.client().get(baseUrl, cfg.endpoint, ctx, requestOptions);
|
|
97
|
+
return extractDataArray(env);
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
if (isDialectAllDropped(err)) {
|
|
101
|
+
// The dialect dropped every plural ID filter and there's no singular
|
|
102
|
+
// alias on this server — surface a warning and return empty so the
|
|
103
|
+
// caller treats the FK as unavailable instead of receiving a page-zero
|
|
104
|
+
// row keyed off the wrong ID.
|
|
105
|
+
options.warnings?.push(`Reference lookup ${cfg.endpoint} skipped: active dialect drops every supported ID filter; FK enrichment unavailable.`);
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
throw err;
|
|
109
|
+
}
|
|
91
110
|
}
|
|
92
111
|
async deletePrefix(ctx, prefix) {
|
|
93
112
|
let cursor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference-data-cache.js","sourceRoot":"","sources":["../../../src/services/reference-data-cache/reference-data-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAIL,cAAc,
|
|
1
|
+
{"version":3,"file":"reference-data-cache.js","sourceRoot":"","sources":["../../../src/services/reference-data-cache/reference-data-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAIL,cAAc,EACd,mBAAmB,GACpB,MAAM,kCAAkC,CAAC;AAyB1C,MAAM,WAAW,GAAgC;IAC/C,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF,MAAM,SAAS,GAA8B;IAC3C,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,YAAY;IACtB,OAAO,EAAE,WAAW;IACpB,WAAW,EAAE,OAAO;CACrB,CAAC;AAEF,MAAM,YAAY,GAAiC;IACjD,QAAQ,EAAE,YAAY;IACtB,QAAQ,EAAE,eAAe;IACzB,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,UAAU;CACxB,CAAC;AAEF,MAAM,OAAO,kBAAkB;IAEV;IACA;IAFnB,YACmB,YAA0B,EAC1B,SAA4B,cAAc;QAD1C,iBAAY,GAAZ,YAAY,CAAc;QAC1B,WAAM,GAAN,MAAM,CAAoC;IAC1D,CAAC;IAEJ,WAAW,CACT,OAAe,EACf,YAA+B,EAC/B,GAAY,EACZ,OAAgC;QAEhC,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,E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Z,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,MAAM,GAAG,SAAS,CAAC;AACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/brapi-mcp-server",
|
|
3
3
|
"mcpName": "io.github.cyanheads/brapi-mcp-server",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.7",
|
|
5
5
|
"description": "BrAPI v2.1 MCP server — studies, germplasm, observations, genotypes, images, and pedigrees.",
|
|
6
6
|
"author": "Casey Hand @cyanheads (https://github.com/cyanheads/brapi-mcp-server#readme)",
|
|
7
7
|
"type": "module",
|
package/server.json
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
"url": "https://github.com/cyanheads/brapi-mcp-server",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.4.
|
|
9
|
+
"version": "0.4.7",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
14
14
|
"identifier": "@cyanheads/brapi-mcp-server",
|
|
15
15
|
"runtimeHint": "bun",
|
|
16
|
-
"version": "0.4.
|
|
16
|
+
"version": "0.4.7",
|
|
17
17
|
"packageArguments": [
|
|
18
18
|
{ "type": "positional", "value": "run" },
|
|
19
19
|
{ "type": "positional", "value": "start:stdio" }
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
50
50
|
"identifier": "@cyanheads/brapi-mcp-server",
|
|
51
51
|
"runtimeHint": "bun",
|
|
52
|
-
"version": "0.4.
|
|
52
|
+
"version": "0.4.7",
|
|
53
53
|
"packageArguments": [
|
|
54
54
|
{ "type": "positional", "value": "run" },
|
|
55
55
|
{ "type": "positional", "value": "start:http" }
|