@cyanheads/brapi-mcp-server 0.7.13 → 0.8.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/AGENTS.md +15 -8
- package/CLAUDE.md +15 -8
- package/README.md +206 -240
- package/changelog/0.8.x/0.8.0.md +48 -0
- package/dist/config/alias-credentials.d.ts +28 -7
- package/dist/config/alias-credentials.d.ts.map +1 -1
- package/dist/config/alias-credentials.js +91 -24
- package/dist/config/alias-credentials.js.map +1 -1
- package/dist/config/builtin-aliases.d.ts +11 -6
- package/dist/config/builtin-aliases.d.ts.map +1 -1
- package/dist/config/builtin-aliases.js +23 -37
- package/dist/config/builtin-aliases.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-server/resources/definitions/brapi-server-info.resource.js +1 -1
- package/dist/mcp-server/resources/definitions/brapi-server-info.resource.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-connect.tool.d.ts +46 -0
- package/dist/mcp-server/tools/definitions/brapi-connect.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-connect.tool.js +65 -15
- package/dist/mcp-server/tools/definitions/brapi-connect.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-describe-filters.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-describe-filters.tool.js +7 -2
- package/dist/mcp-server/tools/definitions/brapi-describe-filters.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-server-info.tool.d.ts +12 -0
- package/dist/mcp-server/tools/definitions/brapi-server-info.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/brapi-server-info.tool.js +1 -1
- package/dist/mcp-server/tools/definitions/brapi-server-info.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +123 -65
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared/find-helpers.d.ts +6 -0
- package/dist/mcp-server/tools/shared/find-helpers.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared/find-helpers.js +17 -5
- package/dist/mcp-server/tools/shared/find-helpers.js.map +1 -1
- package/dist/mcp-server/tools/shared/orientation-envelope.d.ts +26 -0
- package/dist/mcp-server/tools/shared/orientation-envelope.d.ts.map +1 -1
- package/dist/mcp-server/tools/shared/orientation-envelope.js +75 -6
- package/dist/mcp-server/tools/shared/orientation-envelope.js.map +1 -1
- package/dist/services/brapi-client/brapi-client.d.ts.map +1 -1
- package/dist/services/brapi-client/brapi-client.js +29 -26
- package/dist/services/brapi-client/brapi-client.js.map +1 -1
- package/dist/services/capability-registry/capability-registry.d.ts +8 -1
- package/dist/services/capability-registry/capability-registry.d.ts.map +1 -1
- package/dist/services/capability-registry/capability-registry.js +37 -6
- package/dist/services/capability-registry/capability-registry.js.map +1 -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 +9 -4
- package/dist/services/reference-data-cache/reference-data-cache.js.map +1 -1
- package/dist/services/server-registry/server-registry.d.ts +17 -3
- package/dist/services/server-registry/server-registry.d.ts.map +1 -1
- package/dist/services/server-registry/server-registry.js +30 -4
- package/dist/services/server-registry/server-registry.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -2
- package/server.json +3 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Server-configured credentials are only sent to the base URL configured with them, and caller-supplied credentials are refused on session-less shared HTTP. The T3 built-ins are gone, auth walls fail brapi_connect with typed errors, and the orientation envelope names the finders the server supports."
|
|
3
|
+
breaking: true
|
|
4
|
+
security: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.8.0 — 2026-09-23
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`nextToolSuggestions`** on the orientation envelope (`brapi_connect`, `brapi_server_info`, `brapi://server/info`) — the entry-point finders the server can serve (`brapi_find_studies`, `brapi_find_germplasm`, `brapi_find_variables`, `brapi_find_locations`, in that order), each with `args: { alias }`. A finder counts when its GET route or a POST `/search` route the active dialect doesn't disable is advertised ([#57](https://github.com/cyanheads/brapi-mcp-server/issues/57)).
|
|
12
|
+
|
|
13
|
+
## Changed
|
|
14
|
+
|
|
15
|
+
- **Auth walls fail `brapi_connect`** — an HTTP 401/403 on `/serverinfo` or `/calls` throws `upstream_unauthorized` (-32006) / `upstream_forbidden` (-32005) with a credentials hint and caches nothing, instead of registering an empty profile ([#52](https://github.com/cyanheads/brapi-mcp-server/issues/52)).
|
|
16
|
+
- **Upstream 4xx carry an `upstream_*` reason** — 401/403/404 as `upstream_unauthorized` / `upstream_forbidden` / `upstream_not_found`, 429 as `upstream_rate_limited` (still retried), every other 4xx as `ValidationError` (-32007) `upstream_bad_request`. 408 and 425 stay `Timeout` and keep retrying ([#52](https://github.com/cyanheads/brapi-mcp-server/issues/52)).
|
|
17
|
+
- **A failed `brapi_connect` registers nothing** — token exchange and a fresh capability fetch run before the connection is saved, so a failure leaves any previous registration under the alias and its cached profile intact. `ServerRegistry.register()` is now `resolve()` + `save()`.
|
|
18
|
+
- **`baseUrl` with userinfo (`user:password@host`) is refused** with a `ValidationError` that does not echo the URL.
|
|
19
|
+
- **`discoverConfiguredAliases`** reports the `authMode` an argument-free `brapi_connect` would resolve to under the pairing rules below, including default credentials for an alias on `BRAPI_DEFAULT_BASE_URL`.
|
|
20
|
+
- **README reorganized** — one-line tool, resource, and prompt tables and a condensed capability reference; `.env.example` documents `BRAPI_<ALIAS>_DIALECT`, the `BRAPI_DEFAULT_*` credential fields, `BRAPI_BUILTIN_ALIASES_DISABLED`, and `BRAPI_COMPANION_TIMEOUT_MS`.
|
|
21
|
+
|
|
22
|
+
## Removed
|
|
23
|
+
|
|
24
|
+
- **Built-in aliases `t3-wheat`, `t3-oat`, `t3-barley`** — the Triticeae Toolbox hosts now require login. The registry keeps `bti-cassava`, `bti-sweetpotato`, and `bti-breedbase-demo` ([#52](https://github.com/cyanheads/brapi-mcp-server/issues/52)).
|
|
25
|
+
|
|
26
|
+
## Fixed
|
|
27
|
+
|
|
28
|
+
- **`brapi_describe_filters`** escapes backslashes in Description cells, so a backslash in a filter description renders literally instead of being consumed as a Markdown escape — `x\|y` and `a\*b` no longer render as `x|y` and `a*b`. Pipes in the code-span Name and Example cells are escaped too, since a bare `|` there split the row ([#55](https://github.com/cyanheads/brapi-mcp-server/issues/55)).
|
|
29
|
+
- **Capability and reference-data cache keys** hash the base URL (SHA-256) instead of mapping punctuation to `-`, so servers whose URLs differ only in punctuation no longer share cached entries.
|
|
30
|
+
- **Built-in attribution and the demo note** attach only when a built-in alias still points at its built-in URL.
|
|
31
|
+
- **Built-in alias lookup** matches every spelling that shares the alias's `BRAPI_<ALIAS>_*` env prefix (case, `_` for `-`), including entries in `BRAPI_BUILTIN_ALIASES_DISABLED`.
|
|
32
|
+
|
|
33
|
+
## Security
|
|
34
|
+
|
|
35
|
+
- **Caller-supplied credentials are no longer shared across session-less callers** — on an HTTP deployment with `MCP_AUTH_MODE=none` and `BRAPI_SESSION_ISOLATION=true`, `brapi_connect` refuses caller `auth` from a request with no MCP session (`auth_session_required`, before any token exchange). Keyless connects and operator env credentials still work ([#49](https://github.com/cyanheads/brapi-mcp-server/issues/49)).
|
|
36
|
+
- **Operator env credentials are only sent to the base URL configured with them** — per-alias credentials pair with `BRAPI_<ALIAS>_BASE_URL`, else the alias's enabled built-in URL; a caller `baseUrl` that differs is refused with `auth_base_url_mismatch` before any request. `BRAPI_DEFAULT_*` credentials attach only when the resolved URL is `BRAPI_DEFAULT_BASE_URL`. URLs compare after normalizing host case, default port, and trailing slashes.
|
|
37
|
+
|
|
38
|
+
## Dependencies
|
|
39
|
+
|
|
40
|
+
- `@types/node` ^26.5.1 → ^26.6.2
|
|
41
|
+
|
|
42
|
+
## Migration
|
|
43
|
+
|
|
44
|
+
- **T3 aliases** — set `BRAPI_<ALIAS>_BASE_URL` plus credentials for the host (e.g. `BRAPI_WHEAT_BASE_URL=https://wheat.triticeaetoolbox.org/brapi/v2` with `BRAPI_WHEAT_USERNAME` / `BRAPI_WHEAT_PASSWORD`), then connect with that alias.
|
|
45
|
+
- **`BRAPI_DEFAULT_*` credentials** are no longer inherited by an alias whose URL points at another server — give that alias its own `BRAPI_<ALIAS>_*` credentials.
|
|
46
|
+
- **Env credentials with no URL of their own** — per-alias ones without `BRAPI_<ALIAS>_BASE_URL` (including leftovers for a built-in disabled via `BRAPI_BUILTIN_ALIASES_DISABLED`), and `BRAPI_DEFAULT_*` ones without `BRAPI_DEFAULT_BASE_URL` — are refused with `alias_base_url_unset` (-32008) instead of being sent to a caller `baseUrl`; set the alias's `BASE_URL` or remove the credential variables.
|
|
47
|
+
- **A caller `baseUrl` that differs from a credentialed alias's configured URL** is refused with `auth_base_url_mismatch` — omit `baseUrl`, or register the other server under a different alias.
|
|
48
|
+
- **Upstream HTTP 4xx other than 401, 403, 404, 408, 425, and 429** now surface as -32007 `upstream_bad_request` — 400 was -32602, 402 was -32005, 409/423/424 were -32002, 422 is unchanged, the rest were -32600; clients routing on the code should switch to `data.reason`.
|
|
@@ -38,6 +38,8 @@ export interface ResolvedConnectInput {
|
|
|
38
38
|
auth: ConnectAuth;
|
|
39
39
|
baseUrl: string;
|
|
40
40
|
}
|
|
41
|
+
/** Recovery hint for the `auth_base_url_mismatch` refusal; shared with the `brapi_connect` contract. */
|
|
42
|
+
export declare const AUTH_BASE_URL_MISMATCH_RECOVERY = "Omit `baseUrl` to connect to the server configured for this alias, or register the other server under a different alias.";
|
|
41
43
|
/**
|
|
42
44
|
* Layer agent input over alias env over the builtin registry over default env.
|
|
43
45
|
* Returns the resolved baseUrl + auth. Throws when no baseUrl is resolvable
|
|
@@ -50,15 +52,31 @@ export interface ResolvedConnectInput {
|
|
|
50
52
|
* 4. Default env vars (`BRAPI_DEFAULT_*`) — only when alias differs.
|
|
51
53
|
* 5. `auth` falls through to `{ mode: 'none' }`; `baseUrl` has no fallback.
|
|
52
54
|
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* builtin
|
|
56
|
-
*
|
|
55
|
+
* Env credentials only travel to the server configured alongside them:
|
|
56
|
+
* - Per-alias credentials pair with the alias's own URL: its env base URL,
|
|
57
|
+
* else its enabled builtin URL (for `default`, `BRAPI_DEFAULT_BASE_URL`).
|
|
58
|
+
* A caller `baseUrl` that differs from it is refused with
|
|
59
|
+
* `auth_base_url_mismatch`. Credentials with no URL of their own pair with
|
|
60
|
+
* nothing and are refused with `alias_base_url_unset` — they never fall
|
|
61
|
+
* back to `BRAPI_DEFAULT_BASE_URL`. Both refusals precede any request.
|
|
62
|
+
* - Default credentials pair with `BRAPI_DEFAULT_BASE_URL` only. For another
|
|
63
|
+
* alias they attach when the resolved URL is that one and are otherwise
|
|
64
|
+
* left off, so auth falls through to `none`.
|
|
65
|
+
*
|
|
66
|
+
* URLs compare after normalization (host case, default port, trailing
|
|
67
|
+
* slashes). Caller-supplied `auth` bypasses env credentials entirely.
|
|
57
68
|
*/
|
|
58
69
|
export declare function resolveConnectInput(alias: string, agent: {
|
|
59
70
|
baseUrl?: string | undefined;
|
|
60
71
|
auth?: ConnectAuth | undefined;
|
|
61
72
|
}, env?: NodeJS.ProcessEnv): ResolvedConnectInput;
|
|
73
|
+
/**
|
|
74
|
+
* True when both URLs parse, carry no userinfo, and name the same BrAPI base:
|
|
75
|
+
* scheme, host (case-insensitive), port (default port elided), path with
|
|
76
|
+
* trailing slashes dropped, query, and fragment. A URL with userinfo never
|
|
77
|
+
* matches — `brapi_connect` refuses it as a baseUrl.
|
|
78
|
+
*/
|
|
79
|
+
export declare function sameBaseUrl(a: string, b: string | undefined): boolean;
|
|
62
80
|
/**
|
|
63
81
|
* Summary of an alias the agent can call out-of-the-box. Either pre-wired by
|
|
64
82
|
* the operator via `BRAPI_<ALIAS>_BASE_URL` (`origin: 'env'`) or shipped in the
|
|
@@ -76,9 +94,12 @@ export interface DiscoveredAlias {
|
|
|
76
94
|
* Inventory of aliases the agent can call without specifying a baseUrl. Merges
|
|
77
95
|
* env-driven entries (operator-set `BRAPI_<X>_BASE_URL`) with the built-in
|
|
78
96
|
* known-server registry. Env-set aliases win when both are present, since the
|
|
79
|
-
* resolver gives env precedence; their `origin` reflects that.
|
|
80
|
-
*
|
|
81
|
-
* `BRAPI_<ALIAS>_USERNAME` set
|
|
97
|
+
* resolver gives env precedence; their `origin` reflects that. `authMode` is
|
|
98
|
+
* what an argument-free `brapi_connect` for the alias resolves to, so the
|
|
99
|
+
* pairing rules apply: a builtin with `BRAPI_<ALIAS>_USERNAME` set reports
|
|
100
|
+
* `sgn`, and default credentials count only on `BRAPI_DEFAULT_BASE_URL`.
|
|
101
|
+
* Credentials with no URL of their own have nothing to connect to, so they
|
|
102
|
+
* never surface an alias.
|
|
82
103
|
*
|
|
83
104
|
* Default-alias entries land first; the rest are alphabetical.
|
|
84
105
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alias-credentials.d.ts","sourceRoot":"","sources":["../../src/config/alias-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEjF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA6BD,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,sFAAsF;AACtF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,gBAAgB,CAalB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,MAAM,GACZ,WAAW,GAAG,SAAS,CAwCzB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED
|
|
1
|
+
{"version":3,"file":"alias-credentials.d.ts","sourceRoot":"","sources":["../../src/config/alias-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEjF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA6BD,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,sFAAsF;AACtF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,gBAAgB,CAalB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,MAAM,GACZ,WAAW,GAAG,SAAS,CAwCzB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wGAAwG;AACxG,eAAO,MAAM,+BAA+B,6HACgF,CAAC;AAE7H;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE,EACvE,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,oBAAoB,CAwDtB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAIrE;AAcD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,KAAK,GAAG,SAAS,CAAC;CAC3B;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,eAAe,EAAE,CA2CjG;AAYD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,CAmB9E"}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
12
12
|
import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
|
|
13
|
-
import { validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
13
|
+
import { configurationError, forbidden, validationError } from '@cyanheads/mcp-ts-core/errors';
|
|
14
14
|
import { findBuiltinAlias, listBuiltinAliases } from './builtin-aliases.js';
|
|
15
15
|
const FIELD_SUFFIXES = [
|
|
16
16
|
['baseUrl', 'BASE_URL'],
|
|
@@ -96,6 +96,8 @@ export function deriveAuthFromCredentials(creds, alias) {
|
|
|
96
96
|
}
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
+
/** Recovery hint for the `auth_base_url_mismatch` refusal; shared with the `brapi_connect` contract. */
|
|
100
|
+
export const AUTH_BASE_URL_MISMATCH_RECOVERY = 'Omit `baseUrl` to connect to the server configured for this alias, or register the other server under a different alias.';
|
|
99
101
|
/**
|
|
100
102
|
* Layer agent input over alias env over the builtin registry over default env.
|
|
101
103
|
* Returns the resolved baseUrl + auth. Throws when no baseUrl is resolvable
|
|
@@ -108,36 +110,103 @@ export function deriveAuthFromCredentials(creds, alias) {
|
|
|
108
110
|
* 4. Default env vars (`BRAPI_DEFAULT_*`) — only when alias differs.
|
|
109
111
|
* 5. `auth` falls through to `{ mode: 'none' }`; `baseUrl` has no fallback.
|
|
110
112
|
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* builtin
|
|
114
|
-
*
|
|
113
|
+
* Env credentials only travel to the server configured alongside them:
|
|
114
|
+
* - Per-alias credentials pair with the alias's own URL: its env base URL,
|
|
115
|
+
* else its enabled builtin URL (for `default`, `BRAPI_DEFAULT_BASE_URL`).
|
|
116
|
+
* A caller `baseUrl` that differs from it is refused with
|
|
117
|
+
* `auth_base_url_mismatch`. Credentials with no URL of their own pair with
|
|
118
|
+
* nothing and are refused with `alias_base_url_unset` — they never fall
|
|
119
|
+
* back to `BRAPI_DEFAULT_BASE_URL`. Both refusals precede any request.
|
|
120
|
+
* - Default credentials pair with `BRAPI_DEFAULT_BASE_URL` only. For another
|
|
121
|
+
* alias they attach when the resolved URL is that one and are otherwise
|
|
122
|
+
* left off, so auth falls through to `none`.
|
|
123
|
+
*
|
|
124
|
+
* URLs compare after normalization (host case, default port, trailing
|
|
125
|
+
* slashes). Caller-supplied `auth` bypasses env credentials entirely.
|
|
115
126
|
*/
|
|
116
127
|
export function resolveConnectInput(alias, agent, env = process.env) {
|
|
117
128
|
const aliasCreds = readAliasCredentials(alias, env);
|
|
118
129
|
const defaultCreds = alias === DEFAULT_ALIAS ? aliasCreds : readAliasCredentials(DEFAULT_ALIAS, env);
|
|
119
|
-
const
|
|
120
|
-
const
|
|
130
|
+
const ownBaseUrl = aliasCreds.baseUrl ?? findBuiltinAlias(alias, env)?.baseUrl;
|
|
131
|
+
const aliasAuth = agent.auth ? undefined : deriveAuthFromCredentials(aliasCreds, alias);
|
|
132
|
+
if (aliasAuth && ownBaseUrl === undefined) {
|
|
133
|
+
const envVar = `${aliasEnvPrefix(alias)}BASE_URL`;
|
|
134
|
+
throw configurationError(`Alias '${alias}' has server-configured credentials but no base URL of its own, so they are not sent anywhere. Set ${envVar} on the server, or remove the alias's credential variables. No request was made.`, {
|
|
135
|
+
reason: 'alias_base_url_unset',
|
|
136
|
+
alias,
|
|
137
|
+
envVar,
|
|
138
|
+
retryable: false,
|
|
139
|
+
recovery: {
|
|
140
|
+
hint: `Set ${envVar} on the server for alias '${alias}', or remove its credential variables, before retrying.`,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
const baseUrl = agent.baseUrl ?? ownBaseUrl ?? defaultCreds.baseUrl;
|
|
121
145
|
if (!baseUrl) {
|
|
122
146
|
throw validationError(`No baseUrl provided. Pass \`baseUrl\` explicitly, or set ${aliasEnvPrefix(alias)}BASE_URL${alias === DEFAULT_ALIAS ? '' : ` or ${aliasEnvPrefix(DEFAULT_ALIAS)}BASE_URL`}.`, { alias });
|
|
123
147
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
148
|
+
if (agent.auth)
|
|
149
|
+
return { baseUrl, auth: agent.auth };
|
|
150
|
+
if (aliasAuth) {
|
|
151
|
+
if (agent.baseUrl === undefined || sameBaseUrl(agent.baseUrl, ownBaseUrl)) {
|
|
152
|
+
return { baseUrl, auth: aliasAuth };
|
|
153
|
+
}
|
|
154
|
+
// An unparsable or userinfo-bearing caller URL fails baseUrl validation
|
|
155
|
+
// downstream, which does not echo it; it just gets no credentials.
|
|
156
|
+
if (comparableBaseUrl(agent.baseUrl) === undefined)
|
|
157
|
+
return { baseUrl, auth: NONE_AUTH };
|
|
158
|
+
throw forbidden(`Alias '${alias}' has server-configured credentials that are only sent to the server configured for it, and the supplied baseUrl points elsewhere. No request was made.`, {
|
|
159
|
+
reason: 'auth_base_url_mismatch',
|
|
160
|
+
alias,
|
|
161
|
+
baseUrl: agent.baseUrl,
|
|
162
|
+
retryable: false,
|
|
163
|
+
recovery: { hint: AUTH_BASE_URL_MISMATCH_RECOVERY },
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (alias !== DEFAULT_ALIAS && sameBaseUrl(baseUrl, defaultCreds.baseUrl)) {
|
|
167
|
+
const defaultAuth = deriveAuthFromCredentials(defaultCreds, DEFAULT_ALIAS);
|
|
168
|
+
if (defaultAuth)
|
|
169
|
+
return { baseUrl, auth: defaultAuth };
|
|
170
|
+
}
|
|
171
|
+
return { baseUrl, auth: NONE_AUTH };
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* True when both URLs parse, carry no userinfo, and name the same BrAPI base:
|
|
175
|
+
* scheme, host (case-insensitive), port (default port elided), path with
|
|
176
|
+
* trailing slashes dropped, query, and fragment. A URL with userinfo never
|
|
177
|
+
* matches — `brapi_connect` refuses it as a baseUrl.
|
|
178
|
+
*/
|
|
179
|
+
export function sameBaseUrl(a, b) {
|
|
180
|
+
if (b === undefined)
|
|
181
|
+
return false;
|
|
182
|
+
const left = comparableBaseUrl(a);
|
|
183
|
+
return left !== undefined && left === comparableBaseUrl(b);
|
|
184
|
+
}
|
|
185
|
+
function comparableBaseUrl(value) {
|
|
186
|
+
if (!URL.canParse(value))
|
|
187
|
+
return;
|
|
188
|
+
const url = new URL(value);
|
|
189
|
+
if (url.username || url.password)
|
|
190
|
+
return;
|
|
191
|
+
// Read `pathname` once: the getter re-serializes on every access.
|
|
192
|
+
const { pathname } = url;
|
|
193
|
+
let end = pathname.length;
|
|
194
|
+
while (end > 0 && pathname[end - 1] === '/')
|
|
195
|
+
end--;
|
|
196
|
+
const path = pathname.slice(0, end);
|
|
197
|
+
return `${url.protocol}//${url.host}${path}${url.search}${url.hash}`;
|
|
132
198
|
}
|
|
133
199
|
const ALIAS_BASE_URL_PATTERN = /^BRAPI_([A-Z0-9_]+)_BASE_URL$/;
|
|
134
200
|
/**
|
|
135
201
|
* Inventory of aliases the agent can call without specifying a baseUrl. Merges
|
|
136
202
|
* env-driven entries (operator-set `BRAPI_<X>_BASE_URL`) with the built-in
|
|
137
203
|
* known-server registry. Env-set aliases win when both are present, since the
|
|
138
|
-
* resolver gives env precedence; their `origin` reflects that.
|
|
139
|
-
*
|
|
140
|
-
* `BRAPI_<ALIAS>_USERNAME` set
|
|
204
|
+
* resolver gives env precedence; their `origin` reflects that. `authMode` is
|
|
205
|
+
* what an argument-free `brapi_connect` for the alias resolves to, so the
|
|
206
|
+
* pairing rules apply: a builtin with `BRAPI_<ALIAS>_USERNAME` set reports
|
|
207
|
+
* `sgn`, and default credentials count only on `BRAPI_DEFAULT_BASE_URL`.
|
|
208
|
+
* Credentials with no URL of their own have nothing to connect to, so they
|
|
209
|
+
* never surface an alias.
|
|
141
210
|
*
|
|
142
211
|
* Default-alias entries land first; the rest are alphabetical.
|
|
143
212
|
*/
|
|
@@ -162,7 +231,7 @@ export function discoverConfiguredAliases(env = process.env) {
|
|
|
162
231
|
continue;
|
|
163
232
|
result.push({
|
|
164
233
|
alias,
|
|
165
|
-
authMode: deriveModeForDiscovery(
|
|
234
|
+
authMode: deriveModeForDiscovery(alias, env),
|
|
166
235
|
baseUrl: creds.baseUrl,
|
|
167
236
|
origin: 'env',
|
|
168
237
|
});
|
|
@@ -171,10 +240,9 @@ export function discoverConfiguredAliases(env = process.env) {
|
|
|
171
240
|
for (const builtin of builtins) {
|
|
172
241
|
if (seen.has(builtin.alias))
|
|
173
242
|
continue;
|
|
174
|
-
const creds = readAliasCredentials(builtin.alias, env);
|
|
175
243
|
result.push({
|
|
176
244
|
alias: builtin.alias,
|
|
177
|
-
authMode: deriveModeForDiscovery(
|
|
245
|
+
authMode: deriveModeForDiscovery(builtin.alias, env),
|
|
178
246
|
baseUrl: builtin.baseUrl,
|
|
179
247
|
origin: 'builtin',
|
|
180
248
|
});
|
|
@@ -188,10 +256,9 @@ export function discoverConfiguredAliases(env = process.env) {
|
|
|
188
256
|
});
|
|
189
257
|
return result;
|
|
190
258
|
}
|
|
191
|
-
function deriveModeForDiscovery(
|
|
259
|
+
function deriveModeForDiscovery(alias, env) {
|
|
192
260
|
try {
|
|
193
|
-
|
|
194
|
-
return auth?.mode ?? 'none';
|
|
261
|
+
return resolveConnectInput(alias, {}, env).auth.mode;
|
|
195
262
|
}
|
|
196
263
|
catch {
|
|
197
264
|
// Ambiguous credential family — surface the alias as `none` so the agent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alias-credentials.js","sourceRoot":"","sources":["../../src/config/alias-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"alias-credentials.js","sourceRoot":"","sources":["../../src/config/alias-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAmBnF,MAA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,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;IACnF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CACR,kGAAkG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CACxH,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnB,KAAK,CAAC,IAAI,CACR,0GAA0G,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAC5H,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CACR,mGAAmG,CACpG,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -7,13 +7,16 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Override behavior: env-set `BRAPI_<ALIAS>_BASE_URL` always wins over the
|
|
9
9
|
* builtin URL — the builtin is a fallback, not a lock. Per-alias credentials
|
|
10
|
-
* (`BRAPI_<ALIAS>_USERNAME` / `_PASSWORD` / etc.) layer on top of
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* (`BRAPI_<ALIAS>_USERNAME` / `_PASSWORD` / etc.) layer on top of the alias's
|
|
11
|
+
* configured URL (env base URL, else the builtin one) and are never sent to a
|
|
12
|
+
* caller-supplied baseUrl that points elsewhere, so write workflows still need
|
|
13
|
+
* a separate registration on each upstream instance.
|
|
13
14
|
*
|
|
14
15
|
* Opt-out: comma-separated alias names in `BRAPI_BUILTIN_ALIASES_DISABLED`
|
|
15
16
|
* remove specific builtins from resolution and discovery (matched
|
|
16
|
-
* case-insensitively).
|
|
17
|
+
* case-insensitively). Credentials left set for a disabled builtin have no URL
|
|
18
|
+
* to pair with, so `brapi_connect` refuses that alias until
|
|
19
|
+
* `BRAPI_<ALIAS>_BASE_URL` is set.
|
|
17
20
|
*
|
|
18
21
|
* @module config/builtin-aliases
|
|
19
22
|
*/
|
|
@@ -32,11 +35,13 @@ export interface BuiltinAlias {
|
|
|
32
35
|
* against the live upstream surface — anonymous reads return real data and
|
|
33
36
|
* the standard `/studies`, `/germplasm`, `/variables` endpoints respond with
|
|
34
37
|
* non-trivial totals. Servers that flipped to an auth wall (musabase,
|
|
35
|
-
* solgenomics) are intentionally absent
|
|
38
|
+
* solgenomics, the Triticeae Toolbox hosts) are intentionally absent; they
|
|
39
|
+
* stay reachable through `BRAPI_<ALIAS>_BASE_URL` plus credentials.
|
|
36
40
|
*/
|
|
37
41
|
export declare const BUILTIN_ALIASES: ReadonlyArray<BuiltinAlias>;
|
|
38
42
|
/**
|
|
39
|
-
* Resolve a builtin entry by alias.
|
|
43
|
+
* Resolve a builtin entry by alias. Matches every spelling that shares the
|
|
44
|
+
* builtin's env prefix (case-insensitive, `_` for `-`); respects the
|
|
40
45
|
* `BRAPI_BUILTIN_ALIASES_DISABLED` opt-out list. Returns `undefined` when the
|
|
41
46
|
* alias is unknown or disabled — callers fall through to the next baseUrl
|
|
42
47
|
* source (default env, then a thrown ValidationError).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-aliases.d.ts","sourceRoot":"","sources":["../../src/config/builtin-aliases.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"builtin-aliases.d.ts","sourceRoot":"","sources":["../../src/config/builtin-aliases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,YAAY,CA6BtD,CAAC;AA4BH;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,YAAY,GAAG,SAAS,CAK1B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,aAAa,CAAC,YAAY,CAAC,CAI7B"}
|
|
@@ -7,13 +7,16 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Override behavior: env-set `BRAPI_<ALIAS>_BASE_URL` always wins over the
|
|
9
9
|
* builtin URL — the builtin is a fallback, not a lock. Per-alias credentials
|
|
10
|
-
* (`BRAPI_<ALIAS>_USERNAME` / `_PASSWORD` / etc.) layer on top of
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* (`BRAPI_<ALIAS>_USERNAME` / `_PASSWORD` / etc.) layer on top of the alias's
|
|
11
|
+
* configured URL (env base URL, else the builtin one) and are never sent to a
|
|
12
|
+
* caller-supplied baseUrl that points elsewhere, so write workflows still need
|
|
13
|
+
* a separate registration on each upstream instance.
|
|
13
14
|
*
|
|
14
15
|
* Opt-out: comma-separated alias names in `BRAPI_BUILTIN_ALIASES_DISABLED`
|
|
15
16
|
* remove specific builtins from resolution and discovery (matched
|
|
16
|
-
* case-insensitively).
|
|
17
|
+
* case-insensitively). Credentials left set for a disabled builtin have no URL
|
|
18
|
+
* to pair with, so `brapi_connect` refuses that alias until
|
|
19
|
+
* `BRAPI_<ALIAS>_BASE_URL` is set.
|
|
17
20
|
*
|
|
18
21
|
* @module config/builtin-aliases
|
|
19
22
|
*/
|
|
@@ -23,7 +26,8 @@ const BREEDBASE_CITATION = 'Morales et al. 2022. "Breedbase: a digital ecosystem
|
|
|
23
26
|
* against the live upstream surface — anonymous reads return real data and
|
|
24
27
|
* the standard `/studies`, `/germplasm`, `/variables` endpoints respond with
|
|
25
28
|
* non-trivial totals. Servers that flipped to an auth wall (musabase,
|
|
26
|
-
* solgenomics) are intentionally absent
|
|
29
|
+
* solgenomics, the Triticeae Toolbox hosts) are intentionally absent; they
|
|
30
|
+
* stay reachable through `BRAPI_<ALIAS>_BASE_URL` plus credentials.
|
|
27
31
|
*/
|
|
28
32
|
export const BUILTIN_ALIASES = Object.freeze([
|
|
29
33
|
Object.freeze({
|
|
@@ -44,33 +48,6 @@ export const BUILTIN_ALIASES = Object.freeze([
|
|
|
44
48
|
license: 'CC-BY',
|
|
45
49
|
citation: BREEDBASE_CITATION,
|
|
46
50
|
}),
|
|
47
|
-
Object.freeze({
|
|
48
|
-
alias: 't3-wheat',
|
|
49
|
-
baseUrl: 'https://wheat.triticeaetoolbox.org/brapi/v2',
|
|
50
|
-
homepage: 'https://wheat.triticeaetoolbox.org/',
|
|
51
|
-
organizationName: 'Triticeae Toolbox (T3)',
|
|
52
|
-
cropFocus: 'Wheat',
|
|
53
|
-
license: 'CC-BY',
|
|
54
|
-
citation: BREEDBASE_CITATION,
|
|
55
|
-
}),
|
|
56
|
-
Object.freeze({
|
|
57
|
-
alias: 't3-oat',
|
|
58
|
-
baseUrl: 'https://oat.triticeaetoolbox.org/brapi/v2',
|
|
59
|
-
homepage: 'https://oat.triticeaetoolbox.org/',
|
|
60
|
-
organizationName: 'Triticeae Toolbox (T3)',
|
|
61
|
-
cropFocus: 'Oat',
|
|
62
|
-
license: 'CC-BY',
|
|
63
|
-
citation: BREEDBASE_CITATION,
|
|
64
|
-
}),
|
|
65
|
-
Object.freeze({
|
|
66
|
-
alias: 't3-barley',
|
|
67
|
-
baseUrl: 'https://barley.triticeaetoolbox.org/brapi/v2',
|
|
68
|
-
homepage: 'https://barley.triticeaetoolbox.org/',
|
|
69
|
-
organizationName: 'Triticeae Toolbox (T3)',
|
|
70
|
-
cropFocus: 'Barley',
|
|
71
|
-
license: 'CC-BY',
|
|
72
|
-
citation: BREEDBASE_CITATION,
|
|
73
|
-
}),
|
|
74
51
|
Object.freeze({
|
|
75
52
|
alias: 'bti-breedbase-demo',
|
|
76
53
|
baseUrl: 'https://breedbase.org/brapi/v2',
|
|
@@ -83,9 +60,17 @@ export const BUILTIN_ALIASES = Object.freeze([
|
|
|
83
60
|
}),
|
|
84
61
|
]);
|
|
85
62
|
const DISABLED_ENV_VAR = 'BRAPI_BUILTIN_ALIASES_DISABLED';
|
|
63
|
+
/**
|
|
64
|
+
* Canonical builtin key for an alias spelling. Spellings that share a
|
|
65
|
+
* `BRAPI_<ALIAS>_*` env prefix (case, `-` vs `_`) read the same credentials,
|
|
66
|
+
* so they must resolve to the same builtin — and so the same paired URL.
|
|
67
|
+
*/
|
|
68
|
+
function builtinKey(alias) {
|
|
69
|
+
return alias.toLowerCase().replace(/_/g, '-');
|
|
70
|
+
}
|
|
86
71
|
/**
|
|
87
72
|
* Parse the comma-separated disabled list from env. Whitespace tolerant,
|
|
88
|
-
* case-insensitive — entries are
|
|
73
|
+
* case-insensitive — entries are canonicalized to match alias keys.
|
|
89
74
|
*/
|
|
90
75
|
function readDisabledSet(env) {
|
|
91
76
|
const raw = env[DISABLED_ENV_VAR];
|
|
@@ -93,20 +78,21 @@ function readDisabledSet(env) {
|
|
|
93
78
|
return new Set();
|
|
94
79
|
const out = new Set();
|
|
95
80
|
for (const part of raw.split(',')) {
|
|
96
|
-
const trimmed = part.trim()
|
|
81
|
+
const trimmed = part.trim();
|
|
97
82
|
if (trimmed)
|
|
98
|
-
out.add(trimmed);
|
|
83
|
+
out.add(builtinKey(trimmed));
|
|
99
84
|
}
|
|
100
85
|
return out;
|
|
101
86
|
}
|
|
102
87
|
/**
|
|
103
|
-
* Resolve a builtin entry by alias.
|
|
88
|
+
* Resolve a builtin entry by alias. Matches every spelling that shares the
|
|
89
|
+
* builtin's env prefix (case-insensitive, `_` for `-`); respects the
|
|
104
90
|
* `BRAPI_BUILTIN_ALIASES_DISABLED` opt-out list. Returns `undefined` when the
|
|
105
91
|
* alias is unknown or disabled — callers fall through to the next baseUrl
|
|
106
92
|
* source (default env, then a thrown ValidationError).
|
|
107
93
|
*/
|
|
108
94
|
export function findBuiltinAlias(alias, env = process.env) {
|
|
109
|
-
const key = alias
|
|
95
|
+
const key = builtinKey(alias);
|
|
110
96
|
const disabled = readDisabledSet(env);
|
|
111
97
|
if (disabled.has(key))
|
|
112
98
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtin-aliases.js","sourceRoot":"","sources":["../../src/config/builtin-aliases.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"builtin-aliases.js","sourceRoot":"","sources":["../../src/config/builtin-aliases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,kBAAkB,GACtB,+IAA+I,CAAC;AAalJ;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAgC,MAAM,CAAC,MAAM,CAAC;IACxE,MAAM,CAAC,MAAM,CAAC;QACZ,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,kCAAkC;QAC3C,QAAQ,EAAE,0BAA0B;QACpC,gBAAgB,EAAE,0BAA0B;QAC5C,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,OAAO;QAChB,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;IACF,MAAM,CAAC,MAAM,CAAC;QACZ,KAAK,EAAE,iBAAiB;QACxB,OAAO,EAAE,sCAAsC;QAC/C,QAAQ,EAAE,8BAA8B;QACxC,gBAAgB,EAAE,0BAA0B;QAC5C,SAAS,EAAE,aAAa;QACxB,OA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AAG,CAAC;QAAE,OAAO;IAC9B,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC;AAC9D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,GAAG,GAAsB,OAAO,CAAC,GAAG;IAEpC,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,eAAe,CAAC;IAChD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACvE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -118,7 +118,7 @@ await createApp({
|
|
|
118
118
|
// visitors even when MCP_AUTH_MODE is jwt/oauth. Framework default (0.9.13+)
|
|
119
119
|
// gates the inventory behind auth; this override restores the open-catalog UX.
|
|
120
120
|
landing: { requireAuth: false },
|
|
121
|
-
instructions: 'Bridges BrAPI v2 servers (Breeding API for plant/crop research). Call `brapi_connect` first to register a server under an alias and return the orientation envelope (capabilities, dialect,
|
|
121
|
+
instructions: 'Bridges BrAPI v2 servers (Breeding API for plant/crop research). Call `brapi_connect` first to register a server under an alias and return the orientation envelope (capabilities, dialect, content summary, the finders the server supports). `brapi_find_*` tools page filtered lookups across studies, germplasm, observations, variables, locations, images, variants, and genotype calls; rows beyond the per-call cap spill to a canvas dataframe — query with `brapi_dataframe_query` (SELECT-only SQL). `brapi_get_*` fetch single records by `*DbId`. Use `brapi_raw_get` / `brapi_raw_search` only when no curated tool fits — responses route back to the right curated tool.',
|
|
122
122
|
setup(core) {
|
|
123
123
|
if (!core.canvas) {
|
|
124
124
|
throw configurationError('brapi-mcp-server requires the framework canvas service (DuckDB) for dataframe spillover. Set CANVAS_PROVIDER_TYPE=duckdb (the default) and ensure @duckdb/node-api is installed.', { canvasProviderType: process.env.CANVAS_PROVIDER_TYPE ?? 'duckdb' });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,0EAA0E;AAC1E,yEAAyE;AACzE,qEAAqE;AACrE,uEAAuE;AACvE,0BAA0B;AAC1B,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,0EAA0E;AAC1E,gEAAgE;AAChE,wDAAwD;AACxD,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,QAAQ,CAAC;AAE9C,6EAA6E;AAC7E,wEAAwE;AACxE,4EAA4E;AAC5E,yEAAyE;AACzE,wEAAwE;AACxE,yEAAyE;AACzE,kBAAkB;AAClB,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IACjC,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAClE,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM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AAE,CAAC;QAC3B,sBAAsB,CAAC,YAAY,CAAC,CAAC;QACrC,kBAAkB,CAAC,YAAY,CAAC,CAAC;QACjC,oBAAoB,EAAE,CAAC;IACzB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { brapiServerInfo } from '../../tools/definitions/brapi-server-info.tool.
|
|
|
11
11
|
export const brapiServerInfoResource = resource('brapi://server/info', {
|
|
12
12
|
name: 'brapi-server-info',
|
|
13
13
|
title: 'BrAPI server orientation envelope',
|
|
14
|
-
description: 'Orientation envelope for the default BrAPI connection — identity, capabilities, content counts, notes. Same payload as the brapi_server_info tool.',
|
|
14
|
+
description: 'Orientation envelope for the default BrAPI connection — identity, capabilities, content counts, suggested finders, notes. Same payload as the brapi_server_info tool.',
|
|
15
15
|
mimeType: 'application/json',
|
|
16
16
|
errors: [
|
|
17
17
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brapi-server-info.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/brapi-server-info.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAE3F,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC,qBAAqB,EAAE;IACrE,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"brapi-server-info.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/brapi-server-info.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAE3F,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC,qBAAqB,EAAE;IACrE,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,mCAAmC;IAC1C,WAAW,EACT,uKAAuK;IACzK,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE;QACN;YACE,MAAM,EAAE,eAAe;YACvB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,iDAAiD;YACvD,QAAQ,EACN,8FAA8F;YAChG,QAAQ,EAAE,SAAS;SACpB;KACO;IACV,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG;QACxB,OAAO,MAAM,eAAe,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;IAC7E,CAAC;IACD,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACjB,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,qBAAqB;gBAC1B,IAAI,EAAE,mCAAmC;gBACzC,QAAQ,EAAE,kBAAkB;aAC7B;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|