@braynexservices/nigeria-mcp-core 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/http.js +1 -1
- package/dist/lib/cache.d.ts +1 -1
- package/dist/lib/errors.d.ts +1 -1
- package/dist/providers/types.d.ts +2 -19
- package/dist/schemas.d.ts +10 -236
- package/dist/schemas.js +2 -62
- package/dist/schemas.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ shared/src/
|
|
|
10
10
|
├── http.ts # Express + stateless StreamableHTTPServerTransport + API-key auth + /health
|
|
11
11
|
├── config.ts # env parsing, provider selection, key list
|
|
12
12
|
├── schemas.ts # shared Zod base types + Normalized* contracts
|
|
13
|
-
├── providers/types.ts #
|
|
13
|
+
├── providers/types.ts # typed provider interfaces per shipped lane (the seam)
|
|
14
14
|
└── lib/
|
|
15
15
|
├── normalize.ts # raw → normalized helpers
|
|
16
16
|
├── errors.ts # actionable MCP error helpers
|
|
@@ -18,7 +18,6 @@ shared/src/
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Design rules
|
|
21
|
-
- The **provider seam** (typed interfaces) is the
|
|
21
|
+
- The **provider seam** (typed interfaces) is the core idea — tools depend on interfaces, never concrete providers.
|
|
22
22
|
- Normalized schema stability > provider breadth.
|
|
23
23
|
|
|
24
|
-
> 🧠 Source of truth: `brain/05-plans/v1-plan.md` and `brain/08-tech-stack/core-stack.md`.
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Environment configuration for the Nigeria MCP core.
|
|
3
|
-
* No hardcoded secrets — everything comes from process.env.
|
|
3
|
+
* No hardcoded secrets — everything comes from process.env.
|
|
4
4
|
*/
|
|
5
5
|
export interface Config {
|
|
6
6
|
cacProvider: string;
|
package/dist/config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Environment configuration for the Nigeria MCP core.
|
|
3
|
-
* No hardcoded secrets — everything comes from process.env.
|
|
3
|
+
* No hardcoded secrets — everything comes from process.env.
|
|
4
4
|
*/
|
|
5
5
|
function num(value, fallback) {
|
|
6
6
|
const n = Number(value);
|
package/dist/http.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Streamable-HTTP entrypoint — stateless, deployable. API-key auth + /health.
|
|
3
3
|
* Stateless mode (sessionIdGenerator: undefined) is simpler to scale. A fresh server +
|
|
4
|
-
* transport is created per request.
|
|
4
|
+
* transport is created per request.
|
|
5
5
|
*/
|
|
6
6
|
import express from "express";
|
|
7
7
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
package/dist/lib/cache.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* In-memory TTL cache. Same get/set surface a Redis-backed cache will implement later,
|
|
3
|
-
* so lanes can stay cache-agnostic.
|
|
3
|
+
* so lanes can stay cache-agnostic.
|
|
4
4
|
*/
|
|
5
5
|
export interface Cache {
|
|
6
6
|
get<T>(key: string): T | undefined;
|
package/dist/lib/errors.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Actionable errors. Tool handlers throw ToolError with a hint; buildServer converts any
|
|
3
|
-
* throw into a clean, agent-readable tool result.
|
|
3
|
+
* throw into a clean, agent-readable tool result.
|
|
4
4
|
*/
|
|
5
5
|
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
6
6
|
export declare class ToolError extends Error {
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The provider seam — the moat. Tools depend on these interfaces, never on a concrete
|
|
3
3
|
* provider. Selecting/swapping a provider is one env var; adding one is one new file.
|
|
4
|
-
*
|
|
4
|
+
* Only SHIPPED lanes' provider interfaces live here (this package is published publicly).
|
|
5
5
|
*/
|
|
6
|
-
import type {
|
|
6
|
+
import type { NormalizedBankAccount, FxRate, NormalizedMeter, NormalizedTradeFlow, NormalizedHsCode } from "../schemas.js";
|
|
7
7
|
export interface BankRef {
|
|
8
8
|
name: string;
|
|
9
9
|
code: string;
|
|
10
10
|
}
|
|
11
|
-
export interface CacProvider {
|
|
12
|
-
readonly name: string;
|
|
13
|
-
verify(rcOrName: string): Promise<NormalizedCompany>;
|
|
14
|
-
search(query: string): Promise<SearchHit[]>;
|
|
15
|
-
profile(rc: string): Promise<CompanyProfile>;
|
|
16
|
-
}
|
|
17
11
|
export interface BankProvider {
|
|
18
12
|
readonly name: string;
|
|
19
13
|
resolve(accountNumber: string, bankCode: string): Promise<NormalizedBankAccount>;
|
|
@@ -23,11 +17,6 @@ export interface FxProvider {
|
|
|
23
17
|
readonly name: string;
|
|
24
18
|
rates(base?: string, quote?: string): Promise<FxRate[]>;
|
|
25
19
|
}
|
|
26
|
-
export interface DriversProvider {
|
|
27
|
-
readonly name: string;
|
|
28
|
-
verifyLicense(licenseNumber: string, dob?: string): Promise<NormalizedDriversLicense>;
|
|
29
|
-
verifyPlate(plateNumber: string): Promise<NormalizedVehicle>;
|
|
30
|
-
}
|
|
31
20
|
export interface Disco {
|
|
32
21
|
code: string;
|
|
33
22
|
name: string;
|
|
@@ -38,12 +27,6 @@ export interface MeterProvider {
|
|
|
38
27
|
validate(meterNumber: string, disco: string, meterType: string): Promise<NormalizedMeter>;
|
|
39
28
|
listDiscos(): Promise<Disco[]>;
|
|
40
29
|
}
|
|
41
|
-
/** Credential (KYE) provider. Wrap licensed aggregators (NDPR) — never scrape WAEC/JAMB. */
|
|
42
|
-
export interface CredentialProvider {
|
|
43
|
-
readonly name: string;
|
|
44
|
-
verify(type: string, candidateName: string, identifier: string): Promise<NormalizedCredential>;
|
|
45
|
-
verifyTeacher(trcnNumber: string): Promise<NormalizedCredential>;
|
|
46
|
-
}
|
|
47
30
|
/** Query for trade statistics. `commodity` is an HS code OR an aggregation level keyword. */
|
|
48
31
|
export interface TradeStatsQuery {
|
|
49
32
|
flow: string;
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Normalized, agent-facing data contracts. The SAME shape is returned regardless of
|
|
3
3
|
* which upstream provider served the request — this stability is the product.
|
|
4
|
-
*
|
|
4
|
+
* Only SHIPPED lanes' contracts live here (this package is published publicly).
|
|
5
|
+
* An unreleased lane keeps its schemas lane-local until it ships.
|
|
5
6
|
*/
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
/** Provenance fields stamped onto every normalized record. */
|
|
@@ -9,146 +10,6 @@ export declare const Provenance: {
|
|
|
9
10
|
source: z.ZodString;
|
|
10
11
|
retrievedAt: z.ZodString;
|
|
11
12
|
};
|
|
12
|
-
export declare const NormalizedCompany: z.ZodObject<{
|
|
13
|
-
source: z.ZodString;
|
|
14
|
-
retrievedAt: z.ZodString;
|
|
15
|
-
rcNumber: z.ZodString;
|
|
16
|
-
name: z.ZodString;
|
|
17
|
-
status: z.ZodString;
|
|
18
|
-
address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
-
registrationDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
-
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
-
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
name: string;
|
|
23
|
-
status: string;
|
|
24
|
-
rcNumber: string;
|
|
25
|
-
source: string;
|
|
26
|
-
retrievedAt: string;
|
|
27
|
-
type?: string | null | undefined;
|
|
28
|
-
address?: string | null | undefined;
|
|
29
|
-
registrationDate?: string | null | undefined;
|
|
30
|
-
}, {
|
|
31
|
-
name: string;
|
|
32
|
-
status: string;
|
|
33
|
-
rcNumber: string;
|
|
34
|
-
source: string;
|
|
35
|
-
retrievedAt: string;
|
|
36
|
-
type?: string | null | undefined;
|
|
37
|
-
address?: string | null | undefined;
|
|
38
|
-
registrationDate?: string | null | undefined;
|
|
39
|
-
}>;
|
|
40
|
-
export type NormalizedCompany = z.infer<typeof NormalizedCompany>;
|
|
41
|
-
export declare const Director: z.ZodObject<{
|
|
42
|
-
name: z.ZodString;
|
|
43
|
-
role: z.ZodOptional<z.ZodString>;
|
|
44
|
-
}, "strip", z.ZodTypeAny, {
|
|
45
|
-
name: string;
|
|
46
|
-
role?: string | undefined;
|
|
47
|
-
}, {
|
|
48
|
-
name: string;
|
|
49
|
-
role?: string | undefined;
|
|
50
|
-
}>;
|
|
51
|
-
export type Director = z.infer<typeof Director>;
|
|
52
|
-
export declare const Shareholder: z.ZodObject<{
|
|
53
|
-
name: z.ZodString;
|
|
54
|
-
shares: z.ZodOptional<z.ZodNumber>;
|
|
55
|
-
}, "strip", z.ZodTypeAny, {
|
|
56
|
-
name: string;
|
|
57
|
-
shares?: number | undefined;
|
|
58
|
-
}, {
|
|
59
|
-
name: string;
|
|
60
|
-
shares?: number | undefined;
|
|
61
|
-
}>;
|
|
62
|
-
export type Shareholder = z.infer<typeof Shareholder>;
|
|
63
|
-
export declare const CompanyProfile: z.ZodObject<{
|
|
64
|
-
source: z.ZodString;
|
|
65
|
-
retrievedAt: z.ZodString;
|
|
66
|
-
rcNumber: z.ZodString;
|
|
67
|
-
name: z.ZodString;
|
|
68
|
-
status: z.ZodString;
|
|
69
|
-
address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
-
registrationDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
-
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
-
} & {
|
|
73
|
-
classification: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
-
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
-
directors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
76
|
-
name: z.ZodString;
|
|
77
|
-
role: z.ZodOptional<z.ZodString>;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
name: string;
|
|
80
|
-
role?: string | undefined;
|
|
81
|
-
}, {
|
|
82
|
-
name: string;
|
|
83
|
-
role?: string | undefined;
|
|
84
|
-
}>, "many">>;
|
|
85
|
-
shareholders: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
86
|
-
name: z.ZodString;
|
|
87
|
-
shares: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
}, "strip", z.ZodTypeAny, {
|
|
89
|
-
name: string;
|
|
90
|
-
shares?: number | undefined;
|
|
91
|
-
}, {
|
|
92
|
-
name: string;
|
|
93
|
-
shares?: number | undefined;
|
|
94
|
-
}>, "many">>;
|
|
95
|
-
}, "strip", z.ZodTypeAny, {
|
|
96
|
-
name: string;
|
|
97
|
-
status: string;
|
|
98
|
-
rcNumber: string;
|
|
99
|
-
source: string;
|
|
100
|
-
retrievedAt: string;
|
|
101
|
-
email?: string | null | undefined;
|
|
102
|
-
type?: string | null | undefined;
|
|
103
|
-
address?: string | null | undefined;
|
|
104
|
-
registrationDate?: string | null | undefined;
|
|
105
|
-
classification?: string | null | undefined;
|
|
106
|
-
directors?: {
|
|
107
|
-
name: string;
|
|
108
|
-
role?: string | undefined;
|
|
109
|
-
}[] | undefined;
|
|
110
|
-
shareholders?: {
|
|
111
|
-
name: string;
|
|
112
|
-
shares?: number | undefined;
|
|
113
|
-
}[] | undefined;
|
|
114
|
-
}, {
|
|
115
|
-
name: string;
|
|
116
|
-
status: string;
|
|
117
|
-
rcNumber: string;
|
|
118
|
-
source: string;
|
|
119
|
-
retrievedAt: string;
|
|
120
|
-
email?: string | null | undefined;
|
|
121
|
-
type?: string | null | undefined;
|
|
122
|
-
address?: string | null | undefined;
|
|
123
|
-
registrationDate?: string | null | undefined;
|
|
124
|
-
classification?: string | null | undefined;
|
|
125
|
-
directors?: {
|
|
126
|
-
name: string;
|
|
127
|
-
role?: string | undefined;
|
|
128
|
-
}[] | undefined;
|
|
129
|
-
shareholders?: {
|
|
130
|
-
name: string;
|
|
131
|
-
shares?: number | undefined;
|
|
132
|
-
}[] | undefined;
|
|
133
|
-
}>;
|
|
134
|
-
export type CompanyProfile = z.infer<typeof CompanyProfile>;
|
|
135
|
-
export declare const SearchHit: z.ZodObject<{
|
|
136
|
-
rcNumber: z.ZodString;
|
|
137
|
-
name: z.ZodString;
|
|
138
|
-
status: z.ZodString;
|
|
139
|
-
registrationDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
140
|
-
}, "strip", z.ZodTypeAny, {
|
|
141
|
-
name: string;
|
|
142
|
-
status: string;
|
|
143
|
-
rcNumber: string;
|
|
144
|
-
registrationDate?: string | null | undefined;
|
|
145
|
-
}, {
|
|
146
|
-
name: string;
|
|
147
|
-
status: string;
|
|
148
|
-
rcNumber: string;
|
|
149
|
-
registrationDate?: string | null | undefined;
|
|
150
|
-
}>;
|
|
151
|
-
export type SearchHit = z.infer<typeof SearchHit>;
|
|
152
13
|
export declare const NormalizedBankAccount: z.ZodObject<{
|
|
153
14
|
source: z.ZodString;
|
|
154
15
|
retrievedAt: z.ZodString;
|
|
@@ -157,18 +18,18 @@ export declare const NormalizedBankAccount: z.ZodObject<{
|
|
|
157
18
|
bankCode: z.ZodString;
|
|
158
19
|
bankName: z.ZodOptional<z.ZodString>;
|
|
159
20
|
}, "strip", z.ZodTypeAny, {
|
|
160
|
-
source: string;
|
|
161
|
-
retrievedAt: string;
|
|
162
21
|
accountNumber: string;
|
|
163
22
|
accountName: string;
|
|
164
23
|
bankCode: string;
|
|
165
|
-
bankName?: string | undefined;
|
|
166
|
-
}, {
|
|
167
24
|
source: string;
|
|
168
25
|
retrievedAt: string;
|
|
26
|
+
bankName?: string | undefined;
|
|
27
|
+
}, {
|
|
169
28
|
accountNumber: string;
|
|
170
29
|
accountName: string;
|
|
171
30
|
bankCode: string;
|
|
31
|
+
source: string;
|
|
32
|
+
retrievedAt: string;
|
|
172
33
|
bankName?: string | undefined;
|
|
173
34
|
}>;
|
|
174
35
|
export type NormalizedBankAccount = z.infer<typeof NormalizedBankAccount>;
|
|
@@ -195,67 +56,6 @@ export declare const FxRate: z.ZodObject<{
|
|
|
195
56
|
market: "official" | "parallel";
|
|
196
57
|
}>;
|
|
197
58
|
export type FxRate = z.infer<typeof FxRate>;
|
|
198
|
-
export declare const NormalizedDriversLicense: z.ZodObject<{
|
|
199
|
-
source: z.ZodString;
|
|
200
|
-
retrievedAt: z.ZodString;
|
|
201
|
-
licenseNumber: z.ZodString;
|
|
202
|
-
holderName: z.ZodString;
|
|
203
|
-
status: z.ZodString;
|
|
204
|
-
issueDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
-
expiryDate: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
-
class: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
207
|
-
}, "strip", z.ZodTypeAny, {
|
|
208
|
-
status: string;
|
|
209
|
-
source: string;
|
|
210
|
-
retrievedAt: string;
|
|
211
|
-
licenseNumber: string;
|
|
212
|
-
holderName: string;
|
|
213
|
-
issueDate?: string | null | undefined;
|
|
214
|
-
expiryDate?: string | null | undefined;
|
|
215
|
-
class?: string | null | undefined;
|
|
216
|
-
}, {
|
|
217
|
-
status: string;
|
|
218
|
-
source: string;
|
|
219
|
-
retrievedAt: string;
|
|
220
|
-
licenseNumber: string;
|
|
221
|
-
holderName: string;
|
|
222
|
-
issueDate?: string | null | undefined;
|
|
223
|
-
expiryDate?: string | null | undefined;
|
|
224
|
-
class?: string | null | undefined;
|
|
225
|
-
}>;
|
|
226
|
-
export type NormalizedDriversLicense = z.infer<typeof NormalizedDriversLicense>;
|
|
227
|
-
export declare const NormalizedVehicle: z.ZodObject<{
|
|
228
|
-
source: z.ZodString;
|
|
229
|
-
retrievedAt: z.ZodString;
|
|
230
|
-
plateNumber: z.ZodString;
|
|
231
|
-
make: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
232
|
-
model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
233
|
-
year: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
234
|
-
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
235
|
-
fuel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
-
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
237
|
-
}, "strip", z.ZodTypeAny, {
|
|
238
|
-
source: string;
|
|
239
|
-
retrievedAt: string;
|
|
240
|
-
plateNumber: string;
|
|
241
|
-
status?: string | null | undefined;
|
|
242
|
-
make?: string | null | undefined;
|
|
243
|
-
model?: string | null | undefined;
|
|
244
|
-
year?: number | null | undefined;
|
|
245
|
-
color?: string | null | undefined;
|
|
246
|
-
fuel?: string | null | undefined;
|
|
247
|
-
}, {
|
|
248
|
-
source: string;
|
|
249
|
-
retrievedAt: string;
|
|
250
|
-
plateNumber: string;
|
|
251
|
-
status?: string | null | undefined;
|
|
252
|
-
make?: string | null | undefined;
|
|
253
|
-
model?: string | null | undefined;
|
|
254
|
-
year?: number | null | undefined;
|
|
255
|
-
color?: string | null | undefined;
|
|
256
|
-
fuel?: string | null | undefined;
|
|
257
|
-
}>;
|
|
258
|
-
export type NormalizedVehicle = z.infer<typeof NormalizedVehicle>;
|
|
259
59
|
export declare const NormalizedMeter: z.ZodObject<{
|
|
260
60
|
source: z.ZodString;
|
|
261
61
|
retrievedAt: z.ZodString;
|
|
@@ -270,44 +70,18 @@ export declare const NormalizedMeter: z.ZodObject<{
|
|
|
270
70
|
meterNumber: string;
|
|
271
71
|
disco: string;
|
|
272
72
|
meterType: string;
|
|
273
|
-
address?: string | null | undefined;
|
|
274
73
|
customerName?: string | null | undefined;
|
|
74
|
+
address?: string | null | undefined;
|
|
275
75
|
}, {
|
|
276
76
|
source: string;
|
|
277
77
|
retrievedAt: string;
|
|
278
78
|
meterNumber: string;
|
|
279
79
|
disco: string;
|
|
280
80
|
meterType: string;
|
|
281
|
-
address?: string | null | undefined;
|
|
282
81
|
customerName?: string | null | undefined;
|
|
82
|
+
address?: string | null | undefined;
|
|
283
83
|
}>;
|
|
284
84
|
export type NormalizedMeter = z.infer<typeof NormalizedMeter>;
|
|
285
|
-
export declare const NormalizedCredential: z.ZodObject<{
|
|
286
|
-
source: z.ZodString;
|
|
287
|
-
retrievedAt: z.ZodString;
|
|
288
|
-
type: z.ZodString;
|
|
289
|
-
holderName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
290
|
-
institution: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
291
|
-
status: z.ZodString;
|
|
292
|
-
identifier: z.ZodString;
|
|
293
|
-
}, "strip", z.ZodTypeAny, {
|
|
294
|
-
type: string;
|
|
295
|
-
status: string;
|
|
296
|
-
source: string;
|
|
297
|
-
retrievedAt: string;
|
|
298
|
-
identifier: string;
|
|
299
|
-
holderName?: string | null | undefined;
|
|
300
|
-
institution?: string | null | undefined;
|
|
301
|
-
}, {
|
|
302
|
-
type: string;
|
|
303
|
-
status: string;
|
|
304
|
-
source: string;
|
|
305
|
-
retrievedAt: string;
|
|
306
|
-
identifier: string;
|
|
307
|
-
holderName?: string | null | undefined;
|
|
308
|
-
institution?: string | null | undefined;
|
|
309
|
-
}>;
|
|
310
|
-
export type NormalizedCredential = z.infer<typeof NormalizedCredential>;
|
|
311
85
|
export declare const NormalizedTradeFlow: z.ZodObject<{
|
|
312
86
|
source: z.ZodString;
|
|
313
87
|
retrievedAt: z.ZodString;
|
|
@@ -327,13 +101,13 @@ export declare const NormalizedTradeFlow: z.ZodObject<{
|
|
|
327
101
|
}, "strip", z.ZodTypeAny, {
|
|
328
102
|
source: string;
|
|
329
103
|
retrievedAt: string;
|
|
330
|
-
year: number;
|
|
331
104
|
reporter: string;
|
|
332
105
|
partner: string;
|
|
333
106
|
hsCode: string;
|
|
334
107
|
commodity: string;
|
|
335
108
|
flow: "import" | "export";
|
|
336
109
|
period: string;
|
|
110
|
+
year: number;
|
|
337
111
|
valueUsd: number;
|
|
338
112
|
cifValueUsd?: number | null | undefined;
|
|
339
113
|
fobValueUsd?: number | null | undefined;
|
|
@@ -343,13 +117,13 @@ export declare const NormalizedTradeFlow: z.ZodObject<{
|
|
|
343
117
|
}, {
|
|
344
118
|
source: string;
|
|
345
119
|
retrievedAt: string;
|
|
346
|
-
year: number;
|
|
347
120
|
reporter: string;
|
|
348
121
|
partner: string;
|
|
349
122
|
hsCode: string;
|
|
350
123
|
commodity: string;
|
|
351
124
|
flow: "import" | "export";
|
|
352
125
|
period: string;
|
|
126
|
+
year: number;
|
|
353
127
|
valueUsd: number;
|
|
354
128
|
cifValueUsd?: number | null | undefined;
|
|
355
129
|
fobValueUsd?: number | null | undefined;
|
package/dist/schemas.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Normalized, agent-facing data contracts. The SAME shape is returned regardless of
|
|
3
3
|
* which upstream provider served the request — this stability is the product.
|
|
4
|
-
*
|
|
4
|
+
* Only SHIPPED lanes' contracts live here (this package is published publicly).
|
|
5
|
+
* An unreleased lane keeps its schemas lane-local until it ships.
|
|
5
6
|
*/
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
/** Provenance fields stamped onto every normalized record. */
|
|
@@ -9,36 +10,6 @@ export const Provenance = {
|
|
|
9
10
|
source: z.string().describe("Which provider/source served this record (e.g. 'mock', 'public', 'mono')"),
|
|
10
11
|
retrievedAt: z.string().describe("ISO-8601 timestamp when the record was fetched"),
|
|
11
12
|
};
|
|
12
|
-
// ---------- CAC / KYB ----------
|
|
13
|
-
export const NormalizedCompany = z.object({
|
|
14
|
-
rcNumber: z.string().describe("CAC registration (RC) number"),
|
|
15
|
-
name: z.string().describe("Registered company name"),
|
|
16
|
-
status: z.string().describe("Registration status, e.g. ACTIVE / INACTIVE"),
|
|
17
|
-
address: z.string().nullable().optional().describe("Registered address"),
|
|
18
|
-
registrationDate: z.string().nullable().optional().describe("Date of incorporation (ISO date)"),
|
|
19
|
-
type: z.string().nullable().optional().describe("Entity type, e.g. LTD / BN / IT"),
|
|
20
|
-
...Provenance,
|
|
21
|
-
});
|
|
22
|
-
export const Director = z.object({
|
|
23
|
-
name: z.string(),
|
|
24
|
-
role: z.string().optional(),
|
|
25
|
-
});
|
|
26
|
-
export const Shareholder = z.object({
|
|
27
|
-
name: z.string(),
|
|
28
|
-
shares: z.number().optional(),
|
|
29
|
-
});
|
|
30
|
-
export const CompanyProfile = NormalizedCompany.extend({
|
|
31
|
-
classification: z.string().nullable().optional(),
|
|
32
|
-
email: z.string().nullable().optional(),
|
|
33
|
-
directors: z.array(Director).optional(),
|
|
34
|
-
shareholders: z.array(Shareholder).optional(),
|
|
35
|
-
});
|
|
36
|
-
export const SearchHit = z.object({
|
|
37
|
-
rcNumber: z.string(),
|
|
38
|
-
name: z.string(),
|
|
39
|
-
status: z.string(),
|
|
40
|
-
registrationDate: z.string().nullable().optional(),
|
|
41
|
-
});
|
|
42
13
|
// ---------- Bank ----------
|
|
43
14
|
export const NormalizedBankAccount = z.object({
|
|
44
15
|
accountNumber: z.string().describe("10-digit NUBAN"),
|
|
@@ -55,27 +26,6 @@ export const FxRate = z.object({
|
|
|
55
26
|
market: z.enum(["official", "parallel"]).describe("Official (CBN) or parallel ('aboki') market"),
|
|
56
27
|
...Provenance,
|
|
57
28
|
});
|
|
58
|
-
// ---------- Driver's licence + vehicle (FRSC) ----------
|
|
59
|
-
// PII pass-through only — never persisted/cached (NDPA). Optional fields are provider-dependent.
|
|
60
|
-
export const NormalizedDriversLicense = z.object({
|
|
61
|
-
licenseNumber: z.string().describe("Driver's licence number"),
|
|
62
|
-
holderName: z.string().describe("Licence holder's full name"),
|
|
63
|
-
status: z.string().describe("Validity status, e.g. VALID / EXPIRED"),
|
|
64
|
-
issueDate: z.string().nullable().optional().describe("Issue date (ISO)"),
|
|
65
|
-
expiryDate: z.string().nullable().optional().describe("Expiry date (ISO)"),
|
|
66
|
-
class: z.string().nullable().optional().describe("Licence class, e.g. A / B / C"),
|
|
67
|
-
...Provenance,
|
|
68
|
-
});
|
|
69
|
-
export const NormalizedVehicle = z.object({
|
|
70
|
-
plateNumber: z.string().describe("Vehicle plate number (normalized, uppercase)"),
|
|
71
|
-
make: z.string().nullable().optional(),
|
|
72
|
-
model: z.string().nullable().optional(),
|
|
73
|
-
year: z.number().nullable().optional(),
|
|
74
|
-
color: z.string().nullable().optional(),
|
|
75
|
-
fuel: z.string().nullable().optional(),
|
|
76
|
-
status: z.string().nullable().optional().describe("Registration status, e.g. REGISTERED / EXPIRED"),
|
|
77
|
-
...Provenance,
|
|
78
|
-
});
|
|
79
29
|
// ---------- Electricity / meter validation (READ-ONLY) ----------
|
|
80
30
|
// Validation/info only — never payment execution (NERC/CBN/AML). Customer PII not persisted.
|
|
81
31
|
export const NormalizedMeter = z.object({
|
|
@@ -86,16 +36,6 @@ export const NormalizedMeter = z.object({
|
|
|
86
36
|
meterType: z.string().describe("prepaid | postpaid"),
|
|
87
37
|
...Provenance,
|
|
88
38
|
});
|
|
89
|
-
// ---------- Education / credential verification (KYE) ----------
|
|
90
|
-
// Verify via licensed aggregators (they carry NDPR) — never scrape WAEC/JAMB. PII pass-through.
|
|
91
|
-
export const NormalizedCredential = z.object({
|
|
92
|
-
type: z.string().describe("Credential type, e.g. WAEC / NECO / NYSC / DEGREE / TRCN"),
|
|
93
|
-
holderName: z.string().nullable().optional().describe("Credential holder name (PII — pass-through)"),
|
|
94
|
-
institution: z.string().nullable().optional().describe("Issuing institution / body"),
|
|
95
|
-
status: z.string().describe("Verification status, e.g. VERIFIED / REGISTERED / NOT_FOUND"),
|
|
96
|
-
identifier: z.string().describe("The certificate / exam / registration number verified"),
|
|
97
|
-
...Provenance,
|
|
98
|
-
});
|
|
99
39
|
// ---------- Trade intelligence (public macro data, no PII) ----------
|
|
100
40
|
export const NormalizedTradeFlow = z.object({
|
|
101
41
|
reporter: z.string().describe("Reporting country, e.g. Nigeria"),
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8DAA8D;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0EAA0E,CAAC;IACvG,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;CACnF,CAAC;AAEF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACpD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAClE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,GAAG,UAAU;CACd,CAAC,CAAC;AAGH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACtD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IAChG,GAAG,UAAU;CACd,CAAC,CAAC;AAGH,mEAAmE;AACnE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IAC5D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+CAA+C,CAAC;IACxG,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IAC1F,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6DAA6D,CAAC;IACzF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IACpD,GAAG,UAAU;CACd,CAAC,CAAC;AAGH,uEAAuE;AACvE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;IAChE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACrD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IAC3E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACvD,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;IACpF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC3C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAC3D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IACpG,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IACpG,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;IACjG,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IACrG,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;IACnH,GAAG,UAAU;CACd,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IACzE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IACjD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;IACxD,GAAG,UAAU;CACd,CAAC,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Transport-agnostic MCP server builder. Lanes hand buildServer() an array of ToolDefs;
|
|
3
|
-
* stdio.ts and http.ts wrap the result in a transport.
|
|
3
|
+
* stdio.ts and http.ts wrap the result in a transport.
|
|
4
4
|
*/
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
6
|
import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
package/dist/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Transport-agnostic MCP server builder. Lanes hand buildServer() an array of ToolDefs;
|
|
3
|
-
* stdio.ts and http.ts wrap the result in a transport.
|
|
3
|
+
* stdio.ts and http.ts wrap the result in a transport.
|
|
4
4
|
*/
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
6
|
import { z } from "zod";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@braynexservices/nigeria-mcp-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Core runtime for the Nigeria MCP data-lane servers: MCP server builder, normalized Zod schemas, typed provider seam, and shared fetch/cache/error helpers.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|