@honua/mcp-server 0.1.1-beta.0 → 0.1.4-beta.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/LICENSE +201 -0
- package/README.md +202 -7
- package/dist/src/certification/census-fixture-client.d.ts.map +1 -1
- package/dist/src/certification/census-fixture-client.js +5 -0
- package/dist/src/certification/certifier.d.ts +1 -1
- package/dist/src/certification/certifier.d.ts.map +1 -1
- package/dist/src/certification/certifier.js +28 -20
- package/dist/src/certification/cli.js +1 -1
- package/dist/src/certification/cql2.d.ts +24 -0
- package/dist/src/certification/cql2.d.ts.map +1 -0
- package/dist/src/certification/cql2.js +354 -0
- package/dist/src/certification/fixtures.d.ts +8 -0
- package/dist/src/certification/fixtures.d.ts.map +1 -1
- package/dist/src/certification/fixtures.js +26 -10
- package/dist/src/certification/ogc-data.d.ts +30 -0
- package/dist/src/certification/ogc-data.d.ts.map +1 -0
- package/dist/src/certification/ogc-data.js +726 -0
- package/dist/src/certification/ogc-fixture-client.d.ts +4 -0
- package/dist/src/certification/ogc-fixture-client.d.ts.map +1 -0
- package/dist/src/certification/ogc-fixture-client.js +190 -0
- package/dist/src/certification/target.d.ts +10 -1
- package/dist/src/certification/target.d.ts.map +1 -1
- package/dist/src/certification/target.js +45 -2
- package/dist/src/eval/cli.js +6 -3
- package/dist/src/eval/corpus.d.ts +7 -0
- package/dist/src/eval/corpus.d.ts.map +1 -1
- package/dist/src/eval/corpus.js +12 -0
- package/dist/src/eval/ogc-corpus.d.ts +3 -0
- package/dist/src/eval/ogc-corpus.d.ts.map +1 -0
- package/dist/src/eval/ogc-corpus.js +437 -0
- package/dist/src/eval/runner.d.ts +6 -0
- package/dist/src/eval/runner.d.ts.map +1 -1
- package/dist/src/eval/runner.js +21 -7
- package/dist/src/helpers.d.ts +8 -13
- package/dist/src/helpers.d.ts.map +1 -1
- package/dist/src/helpers.js +7 -35
- package/dist/src/index.d.ts +14 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +24 -15
- package/dist/src/neutral/errors.d.ts +73 -0
- package/dist/src/neutral/errors.d.ts.map +1 -0
- package/dist/src/neutral/errors.js +112 -0
- package/dist/src/neutral/filter.d.ts +108 -0
- package/dist/src/neutral/filter.d.ts.map +1 -0
- package/dist/src/neutral/filter.js +271 -0
- package/dist/src/neutral/query.d.ts +101 -0
- package/dist/src/neutral/query.d.ts.map +1 -0
- package/dist/src/neutral/query.js +180 -0
- package/dist/src/neutral/result.d.ts +33 -0
- package/dist/src/neutral/result.d.ts.map +1 -0
- package/dist/src/neutral/result.js +38 -0
- package/dist/src/neutral/source-ref.d.ts +126 -0
- package/dist/src/neutral/source-ref.d.ts.map +1 -0
- package/dist/src/neutral/source-ref.js +267 -0
- package/dist/src/nl-map-control.d.ts.map +1 -1
- package/dist/src/tools/count-features.d.ts +85 -11
- package/dist/src/tools/count-features.d.ts.map +1 -1
- package/dist/src/tools/count-features.js +49 -31
- package/dist/src/tools/describe-layer.d.ts +30 -6
- package/dist/src/tools/describe-layer.d.ts.map +1 -1
- package/dist/src/tools/describe-layer.js +99 -8
- package/dist/src/tools/get-extent.d.ts +69 -11
- package/dist/src/tools/get-extent.d.ts.map +1 -1
- package/dist/src/tools/get-extent.js +28 -46
- package/dist/src/tools/list-services.d.ts +7 -0
- package/dist/src/tools/list-services.d.ts.map +1 -1
- package/dist/src/tools/list-services.js +8 -1
- package/dist/src/tools/list-sources.d.ts +44 -0
- package/dist/src/tools/list-sources.d.ts.map +1 -0
- package/dist/src/tools/list-sources.js +138 -0
- package/dist/src/tools/query-features.d.ts +99 -19
- package/dist/src/tools/query-features.d.ts.map +1 -1
- package/dist/src/tools/query-features.js +38 -45
- package/dist/src/tools/statistics.d.ts +80 -12
- package/dist/src/tools/statistics.d.ts.map +1 -1
- package/dist/src/tools/statistics.js +56 -23
- package/package.json +31 -7
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Honua
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -9,6 +9,11 @@ bound to their own platform; this one is bound to none.
|
|
|
9
9
|
**Release status: beta.** Tool contracts are certified against live and fixture
|
|
10
10
|
targets on every release; remaining pre-1.0 work is hardening, not surface change.
|
|
11
11
|
|
|
12
|
+
**Scores are published, not claimed.** How well different client models actually
|
|
13
|
+
drive this surface — and where they fail — is in the
|
|
14
|
+
[cross-model MCP eval scorecard](../docs/generated/mcp-eval-scorecard.md),
|
|
15
|
+
generated from the dated run artifacts committed under [`evals/`](evals/README.md).
|
|
16
|
+
|
|
12
17
|
Two modes:
|
|
13
18
|
|
|
14
19
|
- **Standalone (platform-free) — the front door.** The `honua-mcp` bin runs the
|
|
@@ -21,9 +26,48 @@ Two modes:
|
|
|
21
26
|
|
|
22
27
|
## Requirements
|
|
23
28
|
|
|
24
|
-
- Node.js `>=20`
|
|
29
|
+
- Node.js `>=20.19`
|
|
25
30
|
- Any reachable FeatureServer/OGC endpoint (public or Honua)
|
|
26
31
|
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
The server is published as
|
|
35
|
+
[`@honua/mcp-server`](https://www.npmjs.com/package/@honua/mcp-server) with two
|
|
36
|
+
bins: `honua-mcp` (the platform-free stdio server) and `honua-mcp-proxy` (the
|
|
37
|
+
bridge to a Honua deployment's hosted `/mcp` catalog). No checkout, no build:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# one-off
|
|
41
|
+
npx -y -p @honua/mcp-server honua-mcp # reads HONUA_BASE_URL from the environment
|
|
42
|
+
|
|
43
|
+
# or keep it installed
|
|
44
|
+
npm install -g @honua/mcp-server
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Claude Desktop, Claude Code, Cursor, and other MCP clients launch it as a stdio
|
|
48
|
+
server. Copy-paste client config (`.mcp.json` / `mcp.json` / Claude Desktop's
|
|
49
|
+
`claude_desktop_config.json`):
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"mcpServers": {
|
|
54
|
+
"honua": {
|
|
55
|
+
"command": "npx",
|
|
56
|
+
"args": ["-y", "-p", "@honua/mcp-server", "honua-mcp"],
|
|
57
|
+
"env": {
|
|
58
|
+
"HONUA_BASE_URL": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis",
|
|
59
|
+
"HONUA_TRANSPORT": "rest"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
That example points at a public ArcGIS endpoint — swap `HONUA_BASE_URL` for
|
|
67
|
+
your own FeatureServer folder, OGC API root, or Honua deployment. Contributors
|
|
68
|
+
running from a checkout: `npm install && npm run build`, then
|
|
69
|
+
`node dist/src/index.js` with the same environment.
|
|
70
|
+
|
|
27
71
|
## Platform-free mode (any ArcGIS / OGC endpoint)
|
|
28
72
|
|
|
29
73
|
Point `HONUA_BASE_URL` at any origin/folder that serves the standard GeoServices
|
|
@@ -31,12 +75,16 @@ REST paths (`/rest/services`, `/FeatureServer/{id}/query`). Example — the publ
|
|
|
31
75
|
US Census 2020 apportionment FeatureServer on `services.arcgis.com`:
|
|
32
76
|
|
|
33
77
|
```bash
|
|
34
|
-
npm install
|
|
35
|
-
npm run build
|
|
36
78
|
HONUA_BASE_URL="https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis" \
|
|
37
|
-
HONUA_TRANSPORT="rest"
|
|
79
|
+
HONUA_TRANSPORT="rest" npx -y -p @honua/mcp-server honua-mcp
|
|
38
80
|
```
|
|
39
81
|
|
|
82
|
+
The same applies to a bare **OGC API** service root: point `HONUA_BASE_URL` at
|
|
83
|
+
the root, address sources with the neutral `<protocol>:<address>` form
|
|
84
|
+
(`ogc-features:<collectionId>`), and pass `layout: "ogc-api"` on calls against
|
|
85
|
+
a third-party root (see the addressing table below). STAC works the same way
|
|
86
|
+
with `layout: "stac-api"` or `"stac-static"`.
|
|
87
|
+
|
|
40
88
|
Tools that require a Honua-only surface (server-side styling via OGC API – Styles,
|
|
41
89
|
a `/rest/services` catalog) **degrade gracefully** on a plain endpoint: they
|
|
42
90
|
return a structured result
|
|
@@ -66,8 +114,9 @@ When `HONUA_API_KEY` is configured, use `https://` for non-localhost servers.
|
|
|
66
114
|
|
|
67
115
|
All read-only:
|
|
68
116
|
|
|
69
|
-
- `
|
|
70
|
-
- `
|
|
117
|
+
- `honua_list_sources` — **protocol-neutral discovery.** Returns `<protocol>:<address>` source references plus each source's real capabilities. Every protocol family degrades independently with a reason.
|
|
118
|
+
- `honua_list_services` — GeoServices-specific service catalog (prefer `honua_list_sources`)
|
|
119
|
+
- `honua_describe_layer` — source schema, protocol, and advertised capabilities
|
|
71
120
|
- `honua_query_features`
|
|
72
121
|
- `honua_count_features`
|
|
73
122
|
- `honua_get_extent`
|
|
@@ -75,6 +124,100 @@ All read-only:
|
|
|
75
124
|
- `honua_explain_capability_gap`
|
|
76
125
|
- `honua_get_style`, `honua_apply_style_preset` — structured-unavailable on a plain FeatureServer
|
|
77
126
|
|
|
127
|
+
### Protocol-neutral tool contract
|
|
128
|
+
|
|
129
|
+
The tool vocabulary is the SDK's `Dataset` → `Source` → `Query` → `Result` contract,
|
|
130
|
+
not GeoServices with extra fields. **No tool schema requires an Esri-only field.**
|
|
131
|
+
|
|
132
|
+
**Addressing.** A source is one string, `<protocol>:<address>`, exactly as
|
|
133
|
+
`honua_list_sources` emits it:
|
|
134
|
+
|
|
135
|
+
| protocol | address | example |
|
|
136
|
+
| --- | --- | --- |
|
|
137
|
+
| `geoservices-feature-service` (alias `geoservices`) | `<serviceId>/<layerId>` | `geoservices-feature-service:Parks/0` |
|
|
138
|
+
| `geoservices-map-service` | `<serviceId>/<layerId>` | `geoservices-map-service:Basemap/2` |
|
|
139
|
+
| `ogc-features` (alias `ogc`) | `<collectionId>` | `ogc-features:hotels` |
|
|
140
|
+
| `ogc-records` | `<collectionId>` | `ogc-records:catalog` |
|
|
141
|
+
| `stac` | `<collectionId>` | `stac:sentinel-2-l2a` |
|
|
142
|
+
| `wfs` | `<typeName>` | `wfs:topp:states` |
|
|
143
|
+
| `odata` | `<entitySet>` | `odata:People` |
|
|
144
|
+
|
|
145
|
+
An unrecognized protocol token is **refused with the accepted forms** rather than
|
|
146
|
+
guessed at. Pass `layout` (`ogc-api` / `auto` / `stac-api` / `stac-static`) when the
|
|
147
|
+
OGC/STAC source lives at a third-party service root rather than the Honua facade.
|
|
148
|
+
|
|
149
|
+
**Filtering.** `filter` is the SDK's typed semantic filter, which compiles to
|
|
150
|
+
GeoServices SQL-92, CQL2, FES 2.0, or OData `$filter` depending on the backend —
|
|
151
|
+
one filter, same meaning everywhere:
|
|
152
|
+
|
|
153
|
+
```jsonc
|
|
154
|
+
{
|
|
155
|
+
"source": "ogc-features:obs",
|
|
156
|
+
"filter": {
|
|
157
|
+
"op": "and",
|
|
158
|
+
"args": [
|
|
159
|
+
{ "op": "eq", "field": "stn_id", "value": 2147 },
|
|
160
|
+
{ "op": "gt", "field": "value", "value": 95 }
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
"orderBy": [{ "field": "value", "direction": "desc" }],
|
|
164
|
+
"limit": 10
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Nodes: `eq`/`ne`/`lt`/`lte`/`gt`/`gte` (`field`, `value`), `in` (`values`),
|
|
169
|
+
`between` (`lower`, `upper`), `is-null`/`is-not-null`, `like` (`pattern`,
|
|
170
|
+
`caseSensitive`), `and`/`or` (`args`), `not` (`arg`), the spatial predicates
|
|
171
|
+
`intersects`/`contains`/`within`/`crosses`/`touches`/`overlaps`/`bbox-intersects`
|
|
172
|
+
(`geometry` or `bbox`), and the temporal predicates
|
|
173
|
+
`before`/`after`/`during`/`time-intersects` (`field`, `value`).
|
|
174
|
+
|
|
175
|
+
**Geometry** is GeoJSON (RFC 7946), or a `bbox` as `[minX, minY, maxX, maxY]`.
|
|
176
|
+
An envelope tested with `intersects` travels as the portable spatial constraint
|
|
177
|
+
(the OGC `bbox` parameter / a GeoServices geometry parameter); a richer geometry
|
|
178
|
+
or predicate becomes a typed spatial filter, which compiles where supported and
|
|
179
|
+
fails closed where it is not. **Time** is `temporal` — `{ "instant": … }` or
|
|
180
|
+
`{ "start": …, "end": … }`, with an optional `field`; without a field it targets
|
|
181
|
+
the source's own time dimension (`time=` / `datetime=`).
|
|
182
|
+
|
|
183
|
+
**Results** carry the neutral source identity, GeoJSON geometry, and — when the
|
|
184
|
+
protocol served the request a weaker way — an explicit `degraded` array (e.g. OGC
|
|
185
|
+
API Features has no server-side aggregation, so `honua_statistics` says it
|
|
186
|
+
aggregated client-side rather than presenting the number as authoritative).
|
|
187
|
+
|
|
188
|
+
**Capability honesty.** A request the backing protocol cannot express returns an
|
|
189
|
+
`isError` result with a structured envelope, never a silently empty feature list:
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"code": "capability_not_supported",
|
|
194
|
+
"error": {
|
|
195
|
+
"kind": "ExecutionFailed",
|
|
196
|
+
"message": "Capability \"queryAggregate\" is not supported by protocol \"wmts\"",
|
|
197
|
+
"capability": "queryAggregate",
|
|
198
|
+
"protocol": "wmts",
|
|
199
|
+
"guidance": "…what to do instead…"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Deprecated inputs (still accepted)
|
|
205
|
+
|
|
206
|
+
Nothing was removed. The following remain as **optional** compatibility inputs so
|
|
207
|
+
existing MCP clients keep working, and are marked `[DEPRECATED]` in their schema
|
|
208
|
+
descriptions:
|
|
209
|
+
|
|
210
|
+
- `serviceId` + `layerId` — the GeoServices pair. Equivalent to
|
|
211
|
+
`source: "geoservices-feature-service:<serviceId>/<layerId>"`. Passing
|
|
212
|
+
`serviceId` without `layerId` is refused rather than defaulted to layer 0.
|
|
213
|
+
- `where` — source-native filter text, whose language depends on the backend. Use
|
|
214
|
+
`filter` for a protocol-neutral one.
|
|
215
|
+
- `geometry` as Esri-JSON, with `geometryType` — converted on the way in.
|
|
216
|
+
|
|
217
|
+
One behavioural note: a source addressed the **deprecated** way keeps the legacy
|
|
218
|
+
Esri-JSON geometry output; a source addressed with `source` gets GeoJSON. Set
|
|
219
|
+
`geometryFormat` explicitly to override either default.
|
|
220
|
+
|
|
78
221
|
Hosts that use signed safe-agent plans can import
|
|
79
222
|
`@honua/mcp-server/agent-execution`. Its `createReadOnlyMcpAgentExecutor` binds
|
|
80
223
|
one named read tool to `@honua/sdk-js/agent-safety`'s exact approved-operation,
|
|
@@ -184,10 +327,37 @@ The fixture is recorded by `scripts/record-census-fixtures.mjs` into
|
|
|
184
327
|
`src/certification/census-data.ts`; the evaluator that replays it is verified for
|
|
185
328
|
parity against the live recordings in `test/certification/census-fixture-client.test.ts`.
|
|
186
329
|
|
|
330
|
+
### Non-GeoServices certification lane
|
|
331
|
+
|
|
332
|
+
A `standalone`-shaped lane can prove the surface works against Esri and still say
|
|
333
|
+
nothing about vendor neutrality. So a second target — **`standalone-ogc`**
|
|
334
|
+
(`HONUA_MCP_CERT_TARGET=standalone-ogc`, or `--target standalone-ogc`) — runs the
|
|
335
|
+
**same tool catalog** against an in-process fixture of a plain **OGC API Features**
|
|
336
|
+
endpoint, replaying collections recorded from the public
|
|
337
|
+
[pygeoapi demo](https://demo.pygeoapi.io/master) (the pinned `ogc-features` target
|
|
338
|
+
in `config/live-conformance-endpoints.v1.json`). Nothing Esri exists there: the
|
|
339
|
+
GeoServices entry points all reject, so a tool that still secretly required
|
|
340
|
+
`serviceId`/`layerId` fails loudly instead of passing by accident.
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
npm run certify:standalone-ogc # non-GeoServices cert (OGC API Features fixture)
|
|
344
|
+
npm run test:certification:standalone-ogc # CI gate variant
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
The fixture serves the OGC API Features Part 1 parameters (`limit`, `offset`,
|
|
348
|
+
`bbox`, `datetime`, `properties`, `sortby`) plus the Part 3 `filter` +
|
|
349
|
+
`filter-lang=cql2-text` the neutral contract compiles to — including a CQL2
|
|
350
|
+
evaluator that **refuses** a construct it cannot evaluate exactly (`S_*` spatial
|
|
351
|
+
predicates) rather than matching every row. Re-record with
|
|
352
|
+
`node scripts/record-ogc-fixtures.mjs`.
|
|
353
|
+
|
|
187
354
|
Artifacts are written to the package root as
|
|
188
355
|
`mcp-certification-results.json` and `mcp-certification-results.md` (gitignored;
|
|
189
356
|
uploaded by CI). To certify against a **live** honua-server, set `HONUA_BASE_URL`
|
|
190
|
-
(and `HONUA_TRANSPORT`, `HONUA_MCP_SERVICE_ID`, `HONUA_MCP_LAYER_ID
|
|
357
|
+
(and `HONUA_TRANSPORT`, `HONUA_MCP_SERVICE_ID`, `HONUA_MCP_LAYER_ID`; optionally
|
|
358
|
+
`HONUA_MCP_SOURCE` for a neutral `<protocol>:<address>` source ref,
|
|
359
|
+
`HONUA_MCP_ADDRESS` for the geocoding scenario, `HONUA_MCP_STYLE_ID`, and
|
|
360
|
+
`HONUA_MCP_STATISTIC_FIELD`); the
|
|
191
361
|
harness then drives a real `HonuaClient` instead of the fixture.
|
|
192
362
|
|
|
193
363
|
The standard schemas are vendored under
|
|
@@ -226,6 +396,13 @@ notifications are forwarded.
|
|
|
226
396
|
|
|
227
397
|
## Cross-model workflow eval (provability)
|
|
228
398
|
|
|
399
|
+
**Published results:
|
|
400
|
+
[Cross-model MCP eval scorecard](../docs/generated/mcp-eval-scorecard.md)** —
|
|
401
|
+
generated from the committed run artifacts in [`evals/runs/`](evals/runs), with
|
|
402
|
+
the deterministic control row, every non-passing run, and the protocol
|
|
403
|
+
certification failures. It ships on the docs site; its freshness is a CI gate
|
|
404
|
+
(`npm run docs:mcp-scorecard:check` from the repo root).
|
|
405
|
+
|
|
229
406
|
The package ships a **cross-model workflow eval** that proves the "any client →
|
|
230
407
|
any workflow" claim: a held-out corpus of GIS workflows (`src/eval/corpus.ts`)
|
|
231
408
|
is driven through the MCP surface by different client LLMs and graded for
|
|
@@ -273,6 +450,24 @@ hallucinated place name fails. The grading taxonomy is documented in
|
|
|
273
450
|
npm run eval:standalone # deterministic control over the census fixture (offline)
|
|
274
451
|
```
|
|
275
452
|
|
|
453
|
+
### Non-GeoServices semantic corpus (`src/eval/ogc-corpus.ts`)
|
|
454
|
+
|
|
455
|
+
The **ogc** corpus runs the identical catalog against the plain OGC API Features
|
|
456
|
+
fixture, addressing every source as `ogc-features:<collectionId>` — no `serviceId`,
|
|
457
|
+
no `layerId`, anywhere in the corpus (a test asserts that). Its assertions are
|
|
458
|
+
anchored to the recorded pygeoapi data (5 observations, 31 Utah cities:
|
|
459
|
+
`avg(value)=96.14`, `sum(POP_2000)=354212`, `stn_id=2147 ⇒ 2 rows`, the
|
|
460
|
+
2001–2004 interval ⇒ 3 rows), and it exercises the typed filter, a GeoJSON/bbox
|
|
461
|
+
spatial constraint, and canonical temporal predicates. Three scenarios grade
|
|
462
|
+
*honesty* rather than data: client-side aggregation must be reported as degraded,
|
|
463
|
+
an extent that came from the declared collection extent must say so, and a CQL2
|
|
464
|
+
spatial predicate the endpoint does not publish must come back as a structured
|
|
465
|
+
capability refusal — never as an empty result set.
|
|
466
|
+
|
|
467
|
+
```bash
|
|
468
|
+
npm run eval:ogc # deterministic control over the OGC API Features fixture (offline)
|
|
469
|
+
```
|
|
470
|
+
|
|
276
471
|
### Live lane (paid, manual only)
|
|
277
472
|
|
|
278
473
|
The **operator corpus** (`src/eval/operator-corpus.ts`, 8 harder scenarios) is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"census-fixture-client.d.ts","sourceRoot":"","sources":["../../../src/certification/census-fixture-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOjD,OAAO,EAML,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAC;AA4F1B,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,CAOjE;
|
|
1
|
+
{"version":3,"file":"census-fixture-client.d.ts","sourceRoot":"","sources":["../../../src/certification/census-fixture-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAOjD,OAAO,EAML,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAC;AA4F1B,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,EAAE,CAOjE;AA8FD,qFAAqF;AACrF,wBAAgB,6BAA6B,IAAI,WAAW,CAiE3D"}
|
|
@@ -154,6 +154,11 @@ function projectAttributes(row, outFields) {
|
|
|
154
154
|
return { ...row };
|
|
155
155
|
}
|
|
156
156
|
const requested = Array.isArray(outFields) ? outFields : outFields.split(",").map((f) => f.trim());
|
|
157
|
+
// A FeatureServer serializes `outFields` as a comma list, so `["*"]` reaches
|
|
158
|
+
// the wire as `outFields=*` and selects every field. Mirror that here.
|
|
159
|
+
if (requested.some((field) => field.trim() === "*")) {
|
|
160
|
+
return { ...row };
|
|
161
|
+
}
|
|
157
162
|
const attributes = {};
|
|
158
163
|
for (const field of requested) {
|
|
159
164
|
const value = fieldValue(row, field);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import { type AuthMode, type SuiteProvenance } from "../provenance.js";
|
|
3
3
|
import { AUTH_ERROR_CODES } from "./contracts.js";
|
|
4
|
-
import type
|
|
4
|
+
import { type CertTargetMode } from "./target.js";
|
|
5
5
|
/** Per-tool certification record (machine-readable). */
|
|
6
6
|
export interface ToolCertification {
|
|
7
7
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"certifier.d.ts","sourceRoot":"","sources":["../../../src/certification/certifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,eAAe,EAGrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAMjB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"certifier.d.ts","sourceRoot":"","sources":["../../../src/certification/certifier.ts"],"names":[],"mappings":"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"}
|
|
@@ -3,7 +3,9 @@ import { AUTH_ERROR_CODES, checkAuthContract, checkInvalidArgsContract, checkPag
|
|
|
3
3
|
import { buildInvalidArgsInputs, buildRoundTripInputs, resolveRoundTripEnv } from "./fixtures.js";
|
|
4
4
|
import { checkConformance, checkWellFormed, validateAgainstSchema } from "./json-schema.js";
|
|
5
5
|
import { runDeepContracts } from "./lifecycle.js";
|
|
6
|
+
import { OGC_COLLECTION_IDS } from "./ogc-data.js";
|
|
6
7
|
import { PLATFORM_FREE_DEGRADATIONS, buildReferenceToolLookup, loadSchemaFile, loadSchemaIndex, } from "./schema-index.js";
|
|
8
|
+
import { isStandaloneTargetMode } from "./target.js";
|
|
7
9
|
const STANDARD_SOURCE = "geospatial-mcp@54cbd49 (spec/schemas)";
|
|
8
10
|
/** Determine whether a discovered tool is safe to round-trip (read-only). */
|
|
9
11
|
export function isReadOnlyTool(tool) {
|
|
@@ -13,6 +15,20 @@ export function isReadOnlyTool(tool) {
|
|
|
13
15
|
const mutating = /(create|update|delete|publish|apply_.*write|execute|edit|deploy|cancel|propose)/i;
|
|
14
16
|
return !mutating.test(tool.name);
|
|
15
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Bind the round-trip inputs to what the target actually serves.
|
|
20
|
+
*
|
|
21
|
+
* The non-GeoServices lane has no `serviceId`/`layerId` at all, so the
|
|
22
|
+
* source-addressed tools round-trip through the protocol-neutral reference for
|
|
23
|
+
* a recorded OGC collection instead (#1005). An explicit `HONUA_MCP_SOURCE`
|
|
24
|
+
* always wins.
|
|
25
|
+
*/
|
|
26
|
+
function withTargetRoundTripDefaults(env, targetMode) {
|
|
27
|
+
if (targetMode !== "standalone-ogc" || env.sourceRef) {
|
|
28
|
+
return env;
|
|
29
|
+
}
|
|
30
|
+
return { ...env, sourceRef: `ogc-features:${OGC_COLLECTION_IDS[0]}`, statisticField: env.statisticField ?? "value" };
|
|
31
|
+
}
|
|
16
32
|
/**
|
|
17
33
|
* Connect an MCP client to the certified surface and produce a deterministic
|
|
18
34
|
* certification report. The client is already connected (offline mock upstream,
|
|
@@ -20,7 +36,7 @@ export function isReadOnlyTool(tool) {
|
|
|
20
36
|
*/
|
|
21
37
|
export async function certify(options) {
|
|
22
38
|
const { client } = options;
|
|
23
|
-
const roundTripEnv = resolveRoundTripEnv(options.env);
|
|
39
|
+
const roundTripEnv = withTargetRoundTripDefaults(resolveRoundTripEnv(options.env), options.targetMode);
|
|
24
40
|
const roundTripInputs = buildRoundTripInputs(roundTripEnv);
|
|
25
41
|
const index = loadSchemaIndex();
|
|
26
42
|
const referenceLookup = buildReferenceToolLookup(index);
|
|
@@ -31,7 +47,7 @@ export async function certify(options) {
|
|
|
31
47
|
// The platform-free standalone target has no Honua publishing surface, so
|
|
32
48
|
// reference-shape tools (e.g. apply_style_preset) intentionally degrade their
|
|
33
49
|
// platform-bound required properties. Conformance is evaluated accordingly.
|
|
34
|
-
const platformFree = options.targetMode
|
|
50
|
+
const platformFree = isStandaloneTargetMode(options.targetMode);
|
|
35
51
|
const tools = [];
|
|
36
52
|
const advertisedNames = new Set();
|
|
37
53
|
for (const tool of advertisedTools) {
|
|
@@ -47,7 +63,7 @@ export async function certify(options) {
|
|
|
47
63
|
contracts.push(paginationCheck("tools", toolPages));
|
|
48
64
|
contracts.push(paginationCheck("resources", resourcePages));
|
|
49
65
|
collectOutputSchemaContracts(tools, contracts);
|
|
50
|
-
contracts.push(await runErrorShapeContract(client, advertisedTools
|
|
66
|
+
contracts.push(await runErrorShapeContract(client, advertisedTools));
|
|
51
67
|
await runAuthContracts(options, advertisedTools, advertisedResources, contracts);
|
|
52
68
|
// Deep contracts: mutating round-trip, unauthenticated-write refusal, async job
|
|
53
69
|
// lifecycle, and query pagination. Safe by construction — mutations only run
|
|
@@ -155,7 +171,7 @@ async function certifyTool(client, tool, referenceLookup, roundTripInputs, platf
|
|
|
155
171
|
let structuredOutputValidated = null;
|
|
156
172
|
const fixtureInput = roundTripInputs[tool.name];
|
|
157
173
|
if (readOnly && fixtureInput !== undefined) {
|
|
158
|
-
const outcome = await roundTripTool(client, tool, fixtureInput, errors
|
|
174
|
+
const outcome = await roundTripTool(client, tool, fixtureInput, errors);
|
|
159
175
|
roundTrip = outcome.roundTrip;
|
|
160
176
|
structuredOutputValidated = outcome.structuredOutputValidated;
|
|
161
177
|
}
|
|
@@ -179,7 +195,7 @@ async function certifyTool(client, tool, referenceLookup, roundTripInputs, platf
|
|
|
179
195
|
notes,
|
|
180
196
|
};
|
|
181
197
|
}
|
|
182
|
-
async function roundTripTool(client, tool, input, errors
|
|
198
|
+
async function roundTripTool(client, tool, input, errors) {
|
|
183
199
|
try {
|
|
184
200
|
const result = (await client.callTool({ name: tool.name, arguments: input }));
|
|
185
201
|
if (result.isError) {
|
|
@@ -240,21 +256,13 @@ function collectOutputSchemaContracts(tools, contracts) {
|
|
|
240
256
|
});
|
|
241
257
|
}
|
|
242
258
|
}
|
|
243
|
-
async function runErrorShapeContract(client, advertised
|
|
244
|
-
// The platform-free
|
|
245
|
-
//
|
|
246
|
-
//
|
|
247
|
-
//
|
|
248
|
-
//
|
|
249
|
-
//
|
|
250
|
-
if (targetMode === "standalone") {
|
|
251
|
-
return {
|
|
252
|
-
contract: "error-shape",
|
|
253
|
-
target: "(standalone)",
|
|
254
|
-
status: "skipped",
|
|
255
|
-
detail: "standalone surface uses MCP-native input validation (JSON-RPC -32602 InvalidParams); the GeoprocessingError envelope is a Honua-operator surface feature",
|
|
256
|
-
};
|
|
257
|
-
}
|
|
259
|
+
async function runErrorShapeContract(client, advertised) {
|
|
260
|
+
// The platform-free surface used to skip this contract: its tools relied on
|
|
261
|
+
// MCP-native input validation (JSON-RPC -32602 InvalidParams), which is a
|
|
262
|
+
// valid structured error but not the GeoprocessingError envelope asserted
|
|
263
|
+
// here. Since #1005 the source-addressed tools validate the request
|
|
264
|
+
// themselves and emit that envelope, so the contract is exercised on every
|
|
265
|
+
// target.
|
|
258
266
|
const invalidInputs = buildInvalidArgsInputs();
|
|
259
267
|
const advertisedNames = new Set(advertised.map((t) => t.name));
|
|
260
268
|
const target = Object.keys(invalidInputs).find((name) => advertisedNames.has(name));
|
|
@@ -23,7 +23,7 @@ function parseArgs(argv) {
|
|
|
23
23
|
else if (arg === "--target") {
|
|
24
24
|
const value = argv[++i];
|
|
25
25
|
if (!value) {
|
|
26
|
-
throw new Error("--target requires a target mode (offline | remote | stdio-proxy | standalone)");
|
|
26
|
+
throw new Error("--target requires a target mode (offline | remote | stdio-proxy | standalone | standalone-ogc)");
|
|
27
27
|
}
|
|
28
28
|
target = value;
|
|
29
29
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal CQL2-text evaluator for the offline OGC API Features fixture (#1005).
|
|
3
|
+
*
|
|
4
|
+
* The neutral tool contract lowers `Query.filter` onto CQL2 text for the OGC
|
|
5
|
+
* family, so an offline fixture that ignored `filter=` would certify a filter
|
|
6
|
+
* path that never actually filtered. This evaluator parses the exact subset the
|
|
7
|
+
* SDK's CQL2 compiler emits — comparisons, `IN`, `BETWEEN`, `IS [NOT] NULL`,
|
|
8
|
+
* `LIKE`/`CASEI`, `AND`/`OR`/`NOT`, parentheses, and `DATE()`/`TIMESTAMP()`
|
|
9
|
+
* literals — and REFUSES anything else rather than silently matching every row,
|
|
10
|
+
* which would turn a filter regression into a passing test.
|
|
11
|
+
*
|
|
12
|
+
* It is a fixture, not a CQL2 implementation: spatial predicates are out of
|
|
13
|
+
* scope here (the fixture serves spatial constraints through the `bbox`
|
|
14
|
+
* parameter, exactly as OGC API Features Part 1 defines).
|
|
15
|
+
*/
|
|
16
|
+
export declare class Cql2UnsupportedError extends Error {
|
|
17
|
+
constructor(message: string);
|
|
18
|
+
}
|
|
19
|
+
type Row = Record<string, unknown>;
|
|
20
|
+
type Predicate = (row: Row) => boolean;
|
|
21
|
+
/** Compile a CQL2-text expression into a row predicate. */
|
|
22
|
+
export declare function compileCql2(filter: string): Predicate;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=cql2.d.ts.map
|