@lexapi/mcp 0.2.0 → 0.5.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/CHANGELOG.md +110 -0
- package/LICENSE +1 -1
- package/README.md +128 -35
- package/dist/client.d.ts +125 -21
- package/dist/client.js +442 -97
- package/dist/credentials.d.ts +67 -0
- package/dist/credentials.js +118 -0
- package/dist/errors.d.ts +53 -0
- package/dist/errors.js +313 -0
- package/dist/http-entry.js +19 -2
- package/dist/http-server.d.ts +48 -2
- package/dist/http-server.js +544 -111
- package/dist/index.js +18 -60
- package/dist/oauth/body.d.ts +5 -0
- package/dist/oauth/body.js +35 -0
- package/dist/oauth/config.d.ts +59 -0
- package/dist/oauth/config.js +149 -0
- package/dist/oauth/exchange.d.ts +196 -0
- package/dist/oauth/exchange.js +573 -0
- package/dist/oauth/jwt.d.ts +124 -0
- package/dist/oauth/jwt.js +352 -0
- package/dist/oauth/redact.d.ts +1 -0
- package/dist/oauth/redact.js +23 -0
- package/dist/oauth/upstream.d.ts +41 -0
- package/dist/oauth/upstream.js +95 -0
- package/dist/server.d.ts +62 -0
- package/dist/server.js +100 -0
- package/dist/shape.d.ts +115 -0
- package/dist/shape.js +1043 -0
- package/dist/tools.d.ts +29 -8
- package/dist/tools.js +1071 -216
- package/dist/webhookUrl.d.ts +4 -0
- package/dist/webhookUrl.js +114 -0
- package/package.json +23 -15
- package/dist/types.d.ts +0 -43
- package/dist/types.js +0 -7
package/dist/tools.d.ts
CHANGED
|
@@ -1,17 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import type { LexAPIClient } from './client.js';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const LANGUAGES: readonly ["en", "fr", "de", "es", "it", "pl", "nl", "pt", "ro", "bg", "cs", "da", "el", "et", "fi", "ga", "hr", "hu", "lt", "lv", "mt", "sk", "sl", "sv"];
|
|
4
|
+
/** Languages the semantic index holds (server/controllers/semanticController.js). */
|
|
5
|
+
export declare const SEMANTIC_LANGUAGES: readonly ["en", "fr", "de", "es", "it", "sl", "el", "nl", "pt", "pl"];
|
|
6
|
+
export declare const DOCUMENT_TYPES: readonly ["judgment", "opinion", "order", "regulation", "directive", "decision", "recommendation", "communication", "proposal", "report", "resolution", "declaration", "treaty", "protocol", "agreement", "written-question", "oral-question", "consolidated-text", "guideline", "implementing", "staff-working-document"];
|
|
7
|
+
export declare const AUTHORS: readonly ["commission", "council", "parliament", "court-of-justice", "general-court", "civil-service-tribunal", "ecb", "eca", "eesc", "cor", "ema", "efsa"];
|
|
8
|
+
export declare const PROCEDURES: readonly ["ordinary", "codecision", "consent", "consultation", "budget", "implementing", "delegated", "comitology", "appointment", "non-legislative"];
|
|
9
|
+
/** EUR-Lex subdomain codes plus the friendly aliases the API maps to them. */
|
|
10
|
+
export declare const SUBDOMAINS: readonly ["LEGISLATION", "CONSLEG", "TREATIES", "EU_CASE_LAW", "LEGAL_PROCEDURE", "INTER_AGREE", "PRE_ACTS", "PAR_QUESTION", "NAT_CASE_LAW", "legislation", "consolidated", "treaties", "case-law", "legal-procedure", "international", "preparatory", "questions", "national-case-law"];
|
|
11
|
+
export declare const CITATION_TYPES: readonly ["reference", "amendment", "repeal", "corrigendum", "implementation", "legal-basis", "proposal", "transposition"];
|
|
12
|
+
/** Where an edge comes from (API 2.11.0 CitationProvenance). */
|
|
13
|
+
export declare const CITATION_PROVENANCES: readonly ["notice", "cellar", "notice+cellar", "cellar-nim", "source", "resolver"];
|
|
14
|
+
/** How a national edge's target was identified (API 2.11.0 CitationResolution). */
|
|
15
|
+
export declare const CITATION_RESOLUTIONS: readonly ["id", "key", "abbreviation", "text-pattern"];
|
|
16
|
+
export declare function isApiDate(value: string): boolean;
|
|
17
|
+
export declare function isApiTimestamp(value: string): boolean;
|
|
18
|
+
export declare function normCelex(v: string): string;
|
|
19
|
+
export interface ToolAnnotations {
|
|
4
20
|
readOnlyHint: boolean;
|
|
5
|
-
|
|
21
|
+
destructiveHint?: boolean;
|
|
6
22
|
idempotentHint?: boolean;
|
|
23
|
+
openWorldHint: boolean;
|
|
7
24
|
}
|
|
8
|
-
interface ToolDef {
|
|
25
|
+
export interface ToolDef {
|
|
9
26
|
name: string;
|
|
27
|
+
title: string;
|
|
10
28
|
description: string;
|
|
11
|
-
inputSchema:
|
|
29
|
+
inputSchema: z.ZodRawShape;
|
|
12
30
|
annotations: ToolAnnotations;
|
|
13
|
-
|
|
31
|
+
/** Not read-only (webhooks, citation extraction). Hidden when LEXAPI_MCP_READ_ONLY is set. */
|
|
32
|
+
write?: boolean;
|
|
33
|
+
handler: (args: any, client: LexAPIClient) => Promise<unknown>;
|
|
14
34
|
}
|
|
15
35
|
export declare const tools: ToolDef[];
|
|
16
|
-
export declare
|
|
17
|
-
|
|
36
|
+
export declare function selectTools(opts?: {
|
|
37
|
+
readOnly?: boolean;
|
|
38
|
+
}): ToolDef[];
|