@didit-protocol/mcp-server 5.1.51 → 5.1.53
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 +156 -14
- package/dist/account-session.d.ts +46 -0
- package/dist/account-session.d.ts.map +1 -0
- package/dist/account-session.js +262 -0
- package/dist/account-session.js.map +1 -0
- package/dist/api-key-connection.d.ts +77 -0
- package/dist/api-key-connection.d.ts.map +1 -0
- package/dist/api-key-connection.js +170 -0
- package/dist/api-key-connection.js.map +1 -0
- package/dist/app-api-key.d.ts.map +1 -1
- package/dist/app-api-key.js +4 -0
- package/dist/app-api-key.js.map +1 -1
- package/dist/audit-log.d.ts +2 -0
- package/dist/audit-log.d.ts.map +1 -1
- package/dist/audit-log.js +13 -0
- package/dist/audit-log.js.map +1 -1
- package/dist/auth/introspection-verifier.d.ts.map +1 -1
- package/dist/auth/introspection-verifier.js +10 -0
- package/dist/auth/introspection-verifier.js.map +1 -1
- package/dist/compress.d.ts +8 -0
- package/dist/compress.d.ts.map +1 -0
- package/dist/compress.js +90 -0
- package/dist/compress.js.map +1 -0
- package/dist/config.d.ts +12 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +33 -6
- package/dist/config.js.map +1 -1
- package/dist/device-login.d.ts +5 -0
- package/dist/device-login.d.ts.map +1 -1
- package/dist/device-login.js +2 -0
- package/dist/device-login.js.map +1 -1
- package/dist/guidance.d.ts +53 -0
- package/dist/guidance.d.ts.map +1 -0
- package/dist/guidance.js +183 -0
- package/dist/guidance.js.map +1 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +43 -5
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +529 -121
- package/dist/index.js.map +1 -1
- package/dist/internal-tools.d.ts +6 -1
- package/dist/internal-tools.d.ts.map +1 -1
- package/dist/internal-tools.js +3 -2
- package/dist/internal-tools.js.map +1 -1
- package/dist/login-cli.d.ts.map +1 -1
- package/dist/login-cli.js +8 -0
- package/dist/login-cli.js.map +1 -1
- package/dist/mcp-modern.d.ts +9 -5
- package/dist/mcp-modern.d.ts.map +1 -1
- package/dist/mcp-modern.js +31 -8
- package/dist/mcp-modern.js.map +1 -1
- package/dist/orgapp.d.ts.map +1 -1
- package/dist/orgapp.js +14 -1
- package/dist/orgapp.js.map +1 -1
- package/dist/paging.d.ts +43 -0
- package/dist/paging.d.ts.map +1 -0
- package/dist/paging.js +98 -0
- package/dist/paging.js.map +1 -0
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +1 -0
- package/dist/permissions.js.map +1 -1
- package/dist/privileged-tools.d.ts +5 -1
- package/dist/privileged-tools.d.ts.map +1 -1
- package/dist/privileged-tools.js +2 -2
- package/dist/privileged-tools.js.map +1 -1
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +11 -4
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/billing.d.ts.map +1 -1
- package/dist/tools/billing.js +29 -0
- package/dist/tools/billing.js.map +1 -1
- package/dist/tools/blocklist.d.ts.map +1 -1
- package/dist/tools/blocklist.js +21 -0
- package/dist/tools/blocklist.js.map +1 -1
- package/dist/tools/cases.d.ts.map +1 -1
- package/dist/tools/cases.js +12 -0
- package/dist/tools/cases.js.map +1 -1
- package/dist/tools/context.d.ts.map +1 -1
- package/dist/tools/context.js +16 -0
- package/dist/tools/context.js.map +1 -1
- package/dist/tools/discovery.d.ts +50 -0
- package/dist/tools/discovery.d.ts.map +1 -0
- package/dist/tools/discovery.js +522 -0
- package/dist/tools/discovery.js.map +1 -0
- package/dist/tools/docs.d.ts +10 -0
- package/dist/tools/docs.d.ts.map +1 -0
- package/dist/tools/docs.js +137 -0
- package/dist/tools/docs.js.map +1 -0
- package/dist/tools/investigator.d.ts.map +1 -1
- package/dist/tools/investigator.js +4 -3
- package/dist/tools/investigator.js.map +1 -1
- package/dist/tools/questionnaires.d.ts +2 -1
- package/dist/tools/questionnaires.d.ts.map +1 -1
- package/dist/tools/questionnaires.js +3 -2
- package/dist/tools/questionnaires.js.map +1 -1
- package/dist/tools/search.d.ts +3 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +20 -6
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/sessions.d.ts +2 -1
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +3 -2
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/settings.d.ts +4 -0
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +7 -0
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +21 -0
- package/dist/tools/transactions.js.map +1 -1
- package/dist/toolsets.d.ts +87 -0
- package/dist/toolsets.d.ts.map +1 -0
- package/dist/toolsets.js +345 -0
- package/dist/toolsets.js.map +1 -0
- package/package.json +8 -3
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_CALL_WRITE = exports.TOOL_CALL_READ = exports.TOOL_DESCRIBE = exports.TOOL_SEARCH = void 0;
|
|
4
|
+
exports.isDiscoveryToolName = isDiscoveryToolName;
|
|
5
|
+
exports.isToolCallProxy = isToolCallProxy;
|
|
6
|
+
exports.discoveryToolDefs = discoveryToolDefs;
|
|
7
|
+
exports.searchTools = searchTools;
|
|
8
|
+
exports.describeTools = describeTools;
|
|
9
|
+
exports.unwrapToolCall = unwrapToolCall;
|
|
10
|
+
/**
|
|
11
|
+
* Discovery tools: how a connection reaches the part of the catalog it did not load.
|
|
12
|
+
*
|
|
13
|
+
* A connection lists a small default (toolsets.ts). These four tools keep everything else one
|
|
14
|
+
* step away, so a short catalog never costs a capability:
|
|
15
|
+
*
|
|
16
|
+
* didit_tool_search find tools by what they do, or list one toolset
|
|
17
|
+
* didit_tool_describe the full description and input schema of named tools
|
|
18
|
+
* didit_tool_call_read run a read-only tool that is not listed
|
|
19
|
+
* didit_tool_call_write run a tool that changes data and is not listed
|
|
20
|
+
*
|
|
21
|
+
* Two call tools rather than one, so a client's approval screen can tell a lookup from a
|
|
22
|
+
* change: the read tool is annotated read-only and refuses anything else, the write tool is
|
|
23
|
+
* annotated destructive. A call through either one is unwrapped at the very top of the
|
|
24
|
+
* dispatcher (index.ts) and then runs through exactly the same checks as a direct call: the
|
|
25
|
+
* hosted exclusions, the permission pre-check, read-only mode, confirm guards, the audit line.
|
|
26
|
+
* Nothing is reachable through them that the caller could not reach by naming the tool.
|
|
27
|
+
*
|
|
28
|
+
* They are listed only when the connection's catalog is a strict subset of what the caller
|
|
29
|
+
* may use. With `toolsets=all` there is nothing left to discover, so they are not offered.
|
|
30
|
+
*
|
|
31
|
+
* Search is lexical on purpose: no embeddings, no model call, no dependency, the same answer
|
|
32
|
+
* every time. The catalog is a few hundred short documents whose names already say
|
|
33
|
+
* `<domain>_<action>`, which is the case where weighted keyword matching is enough.
|
|
34
|
+
*/
|
|
35
|
+
const toolsets_1 = require("../toolsets");
|
|
36
|
+
exports.TOOL_SEARCH = "didit_tool_search";
|
|
37
|
+
exports.TOOL_DESCRIBE = "didit_tool_describe";
|
|
38
|
+
exports.TOOL_CALL_READ = "didit_tool_call_read";
|
|
39
|
+
exports.TOOL_CALL_WRITE = "didit_tool_call_write";
|
|
40
|
+
const DISCOVERY_TOOL_NAMES = new Set([exports.TOOL_SEARCH, exports.TOOL_DESCRIBE, exports.TOOL_CALL_READ, exports.TOOL_CALL_WRITE]);
|
|
41
|
+
function isDiscoveryToolName(name) {
|
|
42
|
+
return DISCOVERY_TOOL_NAMES.has(name);
|
|
43
|
+
}
|
|
44
|
+
/** The two tools that run another tool. */
|
|
45
|
+
function isToolCallProxy(name) {
|
|
46
|
+
return name === exports.TOOL_CALL_READ || name === exports.TOOL_CALL_WRITE;
|
|
47
|
+
}
|
|
48
|
+
const DEFAULT_LIMIT = 8;
|
|
49
|
+
const MAX_LIMIT = 25;
|
|
50
|
+
const MAX_DESCRIBE = 5;
|
|
51
|
+
const SUMMARY_CHARS = 280;
|
|
52
|
+
function unloadedSummary(tools) {
|
|
53
|
+
const counts = new Map();
|
|
54
|
+
for (const tool of tools) {
|
|
55
|
+
if (tool.listed)
|
|
56
|
+
continue;
|
|
57
|
+
const id = (0, toolsets_1.toolsetOf)(tool.name);
|
|
58
|
+
if (id)
|
|
59
|
+
counts.set(id, (counts.get(id) ?? 0) + 1);
|
|
60
|
+
}
|
|
61
|
+
return toolsets_1.TOOLSETS.filter((toolset) => counts.has(toolset.id))
|
|
62
|
+
.map((toolset) => `${toolset.id} (${counts.get(toolset.id)})`)
|
|
63
|
+
.join(", ");
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The discovery tools for one connection. Their descriptions name what is not loaded, because
|
|
67
|
+
* that is the only place every client shows a model what else exists (not every client passes
|
|
68
|
+
* server instructions on).
|
|
69
|
+
*/
|
|
70
|
+
function discoveryToolDefs(tools, options) {
|
|
71
|
+
const unloaded = tools.filter((tool) => !tool.listed).length;
|
|
72
|
+
const callArgs = {
|
|
73
|
+
type: "object",
|
|
74
|
+
properties: {
|
|
75
|
+
name: { type: "string", description: "The tool's exact name, as didit_tool_search returned it." },
|
|
76
|
+
arguments: {
|
|
77
|
+
type: "object",
|
|
78
|
+
description: "The tool's own arguments, exactly as you would pass them when calling it directly.",
|
|
79
|
+
additionalProperties: true,
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
required: ["name"],
|
|
83
|
+
additionalProperties: false,
|
|
84
|
+
};
|
|
85
|
+
const defs = [
|
|
86
|
+
{
|
|
87
|
+
name: exports.TOOL_SEARCH,
|
|
88
|
+
description: `Find Didit tools that are not in your tool list. This connection loads part of the Didit catalog; ` +
|
|
89
|
+
`${unloaded} more ${options.readOnly ? "read-only " : ""}tools are available, by toolset: ${unloadedSummary(tools)}. ` +
|
|
90
|
+
"Search by what you want to do (\"export sessions to CSV\", \"add a face to the blocklist\"), pass `toolset` " +
|
|
91
|
+
"to list one area, or pass nothing to see what each toolset covers. Each match gives the tool's name, what it " +
|
|
92
|
+
"does, its parameters and whether it reads, writes or is destructive. Run a match with " +
|
|
93
|
+
`${exports.TOOL_CALL_READ}${options.readOnly ? "" : ` or ${exports.TOOL_CALL_WRITE}`}; a match marked loaded is already in ` +
|
|
94
|
+
"your tool list, so call it directly.",
|
|
95
|
+
inputSchema: {
|
|
96
|
+
type: "object",
|
|
97
|
+
properties: {
|
|
98
|
+
query: { type: "string", description: "What you want to do, in a few words." },
|
|
99
|
+
toolset: {
|
|
100
|
+
type: "string",
|
|
101
|
+
enum: toolsets_1.TOOLSETS.map((toolset) => toolset.id),
|
|
102
|
+
description: "List the tools of one toolset. Combine with query to search inside it.",
|
|
103
|
+
},
|
|
104
|
+
limit: { type: "integer", minimum: 1, maximum: MAX_LIMIT, description: `Maximum matches (default ${DEFAULT_LIMIT}).` },
|
|
105
|
+
},
|
|
106
|
+
additionalProperties: false,
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: exports.TOOL_DESCRIBE,
|
|
111
|
+
description: `Get the full description and input schema of up to ${MAX_DESCRIBE} Didit tools by name. Use it when the ` +
|
|
112
|
+
`one-line parameter summary from ${exports.TOOL_SEARCH} is not enough, for example for nested objects.`,
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: "object",
|
|
115
|
+
properties: {
|
|
116
|
+
names: {
|
|
117
|
+
type: "array",
|
|
118
|
+
items: { type: "string" },
|
|
119
|
+
minItems: 1,
|
|
120
|
+
maxItems: MAX_DESCRIBE,
|
|
121
|
+
description: "Exact tool names.",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
required: ["names"],
|
|
125
|
+
additionalProperties: false,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: exports.TOOL_CALL_READ,
|
|
130
|
+
description: `Run a read-only Didit tool that is not in your tool list (find it with ${exports.TOOL_SEARCH}). Pass its \`name\` and ` +
|
|
131
|
+
"its own `arguments`. It never changes data: a tool that writes is refused here.",
|
|
132
|
+
inputSchema: callArgs,
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
if (!options.readOnly) {
|
|
136
|
+
defs.push({
|
|
137
|
+
name: exports.TOOL_CALL_WRITE,
|
|
138
|
+
description: `Run a Didit tool that creates, changes or deletes data and is not in your tool list (find it with ${exports.TOOL_SEARCH}). ` +
|
|
139
|
+
"Pass its `name` and its own `arguments`. The tool's own rules still apply: one that needs `confirm: true` " +
|
|
140
|
+
"needs it inside `arguments`, and only after the person has agreed to that exact action.",
|
|
141
|
+
inputSchema: callArgs,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return defs;
|
|
145
|
+
}
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
// Search
|
|
148
|
+
// ---------------------------------------------------------------------------
|
|
149
|
+
const STOPWORDS = new Set([
|
|
150
|
+
"a", "an", "the", "to", "of", "for", "in", "on", "at", "by", "my", "me", "i", "we", "our", "and", "or", "with",
|
|
151
|
+
"how", "do", "does", "can", "is", "are", "what", "which", "that", "this", "it", "from", "into", "please",
|
|
152
|
+
"didit", "tool", "tools",
|
|
153
|
+
]);
|
|
154
|
+
/** Words people say for a thing the catalog names differently. Kept short: it is a hint, not a thesaurus. */
|
|
155
|
+
const SYNONYM_LIST = {
|
|
156
|
+
// Verbs: the catalog says create / get / update / delete / search / list.
|
|
157
|
+
change: ["update"],
|
|
158
|
+
modify: ["update"],
|
|
159
|
+
edit: ["update"],
|
|
160
|
+
set: ["update"],
|
|
161
|
+
rename: ["update"],
|
|
162
|
+
remove: ["delete"],
|
|
163
|
+
erase: ["delete"],
|
|
164
|
+
add: ["create"],
|
|
165
|
+
make: ["create"],
|
|
166
|
+
new: ["create"],
|
|
167
|
+
start: ["create"],
|
|
168
|
+
show: ["get", "list"],
|
|
169
|
+
view: ["get"],
|
|
170
|
+
read: ["get"],
|
|
171
|
+
fetch: ["get"],
|
|
172
|
+
see: ["get", "list"],
|
|
173
|
+
find: ["search"],
|
|
174
|
+
lookup: ["search"],
|
|
175
|
+
look: ["search"],
|
|
176
|
+
// Things
|
|
177
|
+
kyb: ["business"],
|
|
178
|
+
company: ["business", "kyb"],
|
|
179
|
+
registry: ["kyb"],
|
|
180
|
+
kyc: ["session", "verify"],
|
|
181
|
+
verification: ["session", "verify"],
|
|
182
|
+
customer: ["vendor", "user"],
|
|
183
|
+
csv: ["export"],
|
|
184
|
+
download: ["export", "pdf"],
|
|
185
|
+
approve: ["accept"],
|
|
186
|
+
reject: ["override"],
|
|
187
|
+
team: ["member"],
|
|
188
|
+
invite: ["member"],
|
|
189
|
+
teammate: ["member"],
|
|
190
|
+
price: ["billing", "balance"],
|
|
191
|
+
cost: ["billing", "balance"],
|
|
192
|
+
credit: ["balance"],
|
|
193
|
+
invoice: ["receipt", "billing"],
|
|
194
|
+
sanction: ["aml"],
|
|
195
|
+
sanctioned: ["aml"],
|
|
196
|
+
pep: ["aml"],
|
|
197
|
+
watchlist: ["aml"],
|
|
198
|
+
screening: ["aml"],
|
|
199
|
+
adverse: ["aml"],
|
|
200
|
+
selfie: ["face", "liveness"],
|
|
201
|
+
biometric: ["face", "liveness"],
|
|
202
|
+
passport: ["id"],
|
|
203
|
+
document: ["id"],
|
|
204
|
+
proof: ["poa"],
|
|
205
|
+
utility: ["poa"],
|
|
206
|
+
sms: ["phone"],
|
|
207
|
+
otp: ["phone", "email"],
|
|
208
|
+
logo: ["branding"],
|
|
209
|
+
color: ["branding"],
|
|
210
|
+
colour: ["branding"],
|
|
211
|
+
theme: ["branding"],
|
|
212
|
+
wallet: ["screen"],
|
|
213
|
+
crypto: ["wallet", "transaction"],
|
|
214
|
+
rule: ["transaction"],
|
|
215
|
+
age: ["verify"],
|
|
216
|
+
role: ["member"],
|
|
217
|
+
permission: ["role", "member"],
|
|
218
|
+
key: ["api"],
|
|
219
|
+
usage: ["analytics", "billing"],
|
|
220
|
+
plan: ["billing"],
|
|
221
|
+
payment: ["billing"],
|
|
222
|
+
receipt: ["billing"],
|
|
223
|
+
form: ["questionnaire"],
|
|
224
|
+
survey: ["questionnaire"],
|
|
225
|
+
notification: ["webhook", "alert"],
|
|
226
|
+
callback: ["webhook"],
|
|
227
|
+
ban: ["blocklist"],
|
|
228
|
+
block: ["blocklist"],
|
|
229
|
+
fraud: ["blocklist", "aml"],
|
|
230
|
+
log: ["audit"],
|
|
231
|
+
history: ["audit", "review"],
|
|
232
|
+
stats: ["analytics", "statistics"],
|
|
233
|
+
metric: ["analytics"],
|
|
234
|
+
dashboard: ["analytics"],
|
|
235
|
+
many: ["analytics"],
|
|
236
|
+
count: ["analytics", "statistics"],
|
|
237
|
+
volume: ["analytics"],
|
|
238
|
+
conversion: ["analytics"],
|
|
239
|
+
who: ["list"],
|
|
240
|
+
};
|
|
241
|
+
function singular(word) {
|
|
242
|
+
if (word.length > 4 && word.endsWith("ies"))
|
|
243
|
+
return `${word.slice(0, -3)}y`;
|
|
244
|
+
if (word.length > 3 && word.endsWith("s") && !word.endsWith("ss"))
|
|
245
|
+
return word.slice(0, -1);
|
|
246
|
+
return word;
|
|
247
|
+
}
|
|
248
|
+
function tokenize(text) {
|
|
249
|
+
return text
|
|
250
|
+
.toLowerCase()
|
|
251
|
+
.split(/[^a-z0-9]+/)
|
|
252
|
+
.filter((word) => word.length > 1 && !STOPWORDS.has(word))
|
|
253
|
+
.map(singular);
|
|
254
|
+
}
|
|
255
|
+
/** The synonyms in the same form as the words they are compared with (lowercase, singular). */
|
|
256
|
+
const SYNONYMS = new Map(Object.entries(SYNONYM_LIST).map(([word, related]) => [singular(word), related.map(singular)]));
|
|
257
|
+
/** 1 for the same word, 0.5 for words that share a long stem ("verify" / "verification"), else 0. */
|
|
258
|
+
function similarity(a, b) {
|
|
259
|
+
if (a === b)
|
|
260
|
+
return 1;
|
|
261
|
+
const shorter = Math.min(a.length, b.length);
|
|
262
|
+
if (shorter < 4)
|
|
263
|
+
return 0;
|
|
264
|
+
let common = 0;
|
|
265
|
+
while (common < shorter && a[common] === b[common])
|
|
266
|
+
common++;
|
|
267
|
+
return common >= 4 && common >= shorter * 0.7 ? 0.5 : 0;
|
|
268
|
+
}
|
|
269
|
+
function best(word, bag) {
|
|
270
|
+
let score = 0;
|
|
271
|
+
for (const candidate of bag) {
|
|
272
|
+
score = Math.max(score, similarity(word, candidate));
|
|
273
|
+
if (score === 1)
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
return score;
|
|
277
|
+
}
|
|
278
|
+
/** Lowercase words separated by single spaces, so "proof-of-address" and "Proof of Address" read alike. */
|
|
279
|
+
function plainText(text) {
|
|
280
|
+
return ` ${text.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim()} `;
|
|
281
|
+
}
|
|
282
|
+
function indexTool(tool) {
|
|
283
|
+
const toolset = (0, toolsets_1.toolsetOf)(tool.name) ?? "";
|
|
284
|
+
const definition = toolsets_1.TOOLSETS.find((candidate) => candidate.id === toolset);
|
|
285
|
+
return {
|
|
286
|
+
tool,
|
|
287
|
+
toolset,
|
|
288
|
+
nameWords: tokenize(tool.name),
|
|
289
|
+
areaWords: tokenize(`${toolset} ${definition?.groups.map(([, label]) => label).join(" ") ?? ""}`),
|
|
290
|
+
paramWords: tokenize(Object.keys(tool.inputSchema.properties ?? {}).join(" ")),
|
|
291
|
+
descriptionWords: tokenize(tool.description),
|
|
292
|
+
text: plainText(`${tool.name} ${tool.description}`),
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
const WEIGHT = { name: 8, area: 4, param: 2, description: 1.5, phrase: 6, complete: 3, coverage: 3 };
|
|
296
|
+
/** A synonym is a slightly weaker signal than the word the person actually used. */
|
|
297
|
+
const SYNONYM_WEIGHT = 0.9;
|
|
298
|
+
/**
|
|
299
|
+
* How much a word narrows the catalog down, from 1 (found in one tool) towards 0 (found in
|
|
300
|
+
* most of them). "session" and "list" appear in dozens of names and say little; "export" or
|
|
301
|
+
* "aml" appear in one or two and say nearly everything. Without this a request such as "export
|
|
302
|
+
* sessions to CSV" is answered with every tool that has "session" in its name, and a common
|
|
303
|
+
* word in a long description ("list", "check") counts as much as the one word that matters.
|
|
304
|
+
*/
|
|
305
|
+
function rarity(index, wordsOf) {
|
|
306
|
+
const frequency = new Map();
|
|
307
|
+
for (const entry of index) {
|
|
308
|
+
for (const word of new Set(wordsOf(entry)))
|
|
309
|
+
frequency.set(word, (frequency.get(word) ?? 0) + 1);
|
|
310
|
+
}
|
|
311
|
+
const total = Math.max(index.length, 2);
|
|
312
|
+
const cache = new Map();
|
|
313
|
+
return (word) => {
|
|
314
|
+
const cached = cache.get(word);
|
|
315
|
+
if (cached !== undefined)
|
|
316
|
+
return cached;
|
|
317
|
+
// The best partial match decides how common the word is, as it decides the score.
|
|
318
|
+
let count = 0;
|
|
319
|
+
for (const [candidate, hits] of frequency)
|
|
320
|
+
if (similarity(word, candidate) > 0)
|
|
321
|
+
count = Math.max(count, hits);
|
|
322
|
+
const value = count === 0 ? 1 : Math.log(1 + total / count) / Math.log(1 + total);
|
|
323
|
+
cache.set(word, value);
|
|
324
|
+
return value;
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function wordScore(entry, word, rare) {
|
|
328
|
+
return (rare.name(word) * (WEIGHT.name * best(word, entry.nameWords) + WEIGHT.area * best(word, entry.areaWords)) +
|
|
329
|
+
rare.text(word) * (WEIGHT.param * best(word, entry.paramWords) + WEIGHT.description * best(word, entry.descriptionWords)));
|
|
330
|
+
}
|
|
331
|
+
/** A word counts as answered by a tool only when it matched with some weight, not in passing. */
|
|
332
|
+
const ANSWERED = 1;
|
|
333
|
+
function scoreTool(entry, words, phrase, rare) {
|
|
334
|
+
let score = 0;
|
|
335
|
+
let answered = 0;
|
|
336
|
+
const named = new Set();
|
|
337
|
+
for (const word of words) {
|
|
338
|
+
// The word itself, plus the best of its synonyms: a group of synonyms counts once.
|
|
339
|
+
const forms = [word, ...(SYNONYMS.get(word) ?? [])];
|
|
340
|
+
const direct = wordScore(entry, word, rare);
|
|
341
|
+
const related = Math.max(0, ...forms.slice(1).map((synonym) => wordScore(entry, synonym, rare)));
|
|
342
|
+
const hit = direct + SYNONYM_WEIGHT * related;
|
|
343
|
+
score += hit;
|
|
344
|
+
if (hit >= ANSWERED)
|
|
345
|
+
answered++;
|
|
346
|
+
for (const nameWord of entry.nameWords) {
|
|
347
|
+
if (forms.some((form) => similarity(form, nameWord) > 0))
|
|
348
|
+
named.add(nameWord);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (score === 0)
|
|
352
|
+
return 0;
|
|
353
|
+
// A tool that answers every word of the request outranks one that answers a single word well.
|
|
354
|
+
if (words.length > 1 && answered === words.length)
|
|
355
|
+
score += WEIGHT.complete;
|
|
356
|
+
// The request, word for word, in the tool's own text ("proof of address").
|
|
357
|
+
if (words.length > 1 && entry.text.includes(phrase))
|
|
358
|
+
score += WEIGHT.phrase;
|
|
359
|
+
// How much of the tool's NAME the request explains: "delete a session" is didit_session_delete
|
|
360
|
+
// before it is didit_session_batch_delete, whose name says more than was asked.
|
|
361
|
+
score += WEIGHT.coverage * (named.size / Math.max(entry.nameWords.length, 1));
|
|
362
|
+
return score;
|
|
363
|
+
}
|
|
364
|
+
function firstSentences(text, limit) {
|
|
365
|
+
if (text.length <= limit)
|
|
366
|
+
return text;
|
|
367
|
+
const cut = text.slice(0, limit);
|
|
368
|
+
const end = Math.max(cut.lastIndexOf(". "), cut.lastIndexOf(".\n"));
|
|
369
|
+
return end > limit * 0.4 ? cut.slice(0, end + 1) : `${cut.slice(0, cut.lastIndexOf(" "))}...`;
|
|
370
|
+
}
|
|
371
|
+
/** `session_id*: string, status: Approved|Declined, limit: number` - top-level arguments, required ones starred. */
|
|
372
|
+
function parameterSummary(tool) {
|
|
373
|
+
const required = new Set(tool.inputSchema.required ?? []);
|
|
374
|
+
return Object.entries(tool.inputSchema.properties ?? {})
|
|
375
|
+
.map(([name, raw]) => {
|
|
376
|
+
const schema = (raw ?? {});
|
|
377
|
+
const values = Array.isArray(schema.enum) ? schema.enum : undefined;
|
|
378
|
+
const type = values && values.length <= 8
|
|
379
|
+
? values.join("|")
|
|
380
|
+
: Array.isArray(schema.type)
|
|
381
|
+
? schema.type.join("|")
|
|
382
|
+
: typeof schema.type === "string"
|
|
383
|
+
? schema.type
|
|
384
|
+
: "any";
|
|
385
|
+
return `${name}${required.has(name) ? "*" : ""}: ${type}`;
|
|
386
|
+
})
|
|
387
|
+
.join(", ");
|
|
388
|
+
}
|
|
389
|
+
function summarize(tool) {
|
|
390
|
+
return {
|
|
391
|
+
name: tool.name,
|
|
392
|
+
toolset: (0, toolsets_1.toolsetOf)(tool.name) ?? null,
|
|
393
|
+
access: tool.access,
|
|
394
|
+
loaded: tool.listed,
|
|
395
|
+
description: firstSentences(tool.description, SUMMARY_CHARS),
|
|
396
|
+
parameters: parameterSummary(tool),
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
function toolsetOverview(tools) {
|
|
400
|
+
return toolsets_1.TOOLSETS.map((toolset) => {
|
|
401
|
+
const members = tools.filter((tool) => (0, toolsets_1.toolsetOf)(tool.name) === toolset.id);
|
|
402
|
+
return {
|
|
403
|
+
id: toolset.id,
|
|
404
|
+
description: toolset.description,
|
|
405
|
+
tools: members.length,
|
|
406
|
+
loaded: members.filter((tool) => tool.listed).length,
|
|
407
|
+
};
|
|
408
|
+
}).filter((row) => row.tools > 0);
|
|
409
|
+
}
|
|
410
|
+
/** didit_tool_search. `tools` is everything this caller may run on this connection. */
|
|
411
|
+
function searchTools(tools, args) {
|
|
412
|
+
const query = typeof args?.query === "string" ? args.query.trim() : "";
|
|
413
|
+
const toolset = typeof args?.toolset === "string" ? args.toolset.trim().toLowerCase().replace(/-/g, "_") : "";
|
|
414
|
+
const limit = Math.min(MAX_LIMIT, Math.max(1, Number.isInteger(args?.limit) ? args.limit : DEFAULT_LIMIT));
|
|
415
|
+
if (!query && !toolset) {
|
|
416
|
+
return {
|
|
417
|
+
toolsets: toolsetOverview(tools),
|
|
418
|
+
next_step: "Pass `query` to search by what you want to do, or `toolset` to list one of these areas.",
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
const scoped = toolset ? tools.filter((tool) => (0, toolsets_1.toolsetOf)(tool.name) === toolset) : tools;
|
|
422
|
+
if (toolset && scoped.length === 0) {
|
|
423
|
+
return {
|
|
424
|
+
matches: [],
|
|
425
|
+
total: 0,
|
|
426
|
+
next_step: `No toolset '${toolset}' on this connection. Available: ${toolsetOverview(tools).map((row) => row.id).join(", ")}.`,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
if (!query) {
|
|
430
|
+
// Listing a toolset is a request for all of it: the caller's limit applies only when sent.
|
|
431
|
+
const cap = Number.isInteger(args?.limit) ? limit : MAX_LIMIT;
|
|
432
|
+
return {
|
|
433
|
+
matches: scoped.slice(0, cap).map(summarize),
|
|
434
|
+
total: scoped.length,
|
|
435
|
+
...(scoped.length > cap ? { next_step: `Showing ${cap} of ${scoped.length}. Add a query to narrow it.` } : {}),
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
const exact = scoped.find((tool) => tool.name === query || tool.name === `didit_${query}`);
|
|
439
|
+
const words = [...new Set(tokenize(query))];
|
|
440
|
+
const phrase = plainText(query);
|
|
441
|
+
const index = scoped.map(indexTool);
|
|
442
|
+
const rare = {
|
|
443
|
+
name: rarity(index, (entry) => [...entry.nameWords, ...entry.areaWords]),
|
|
444
|
+
text: rarity(index, (entry) => [...entry.descriptionWords, ...entry.paramWords]),
|
|
445
|
+
};
|
|
446
|
+
const ranked = index
|
|
447
|
+
.map((entry, position) => ({
|
|
448
|
+
tool: entry.tool,
|
|
449
|
+
position,
|
|
450
|
+
score: entry.tool === exact ? Number.MAX_SAFE_INTEGER : scoreTool(entry, words, phrase, rare),
|
|
451
|
+
}))
|
|
452
|
+
.filter((row) => row.score > 0)
|
|
453
|
+
.sort((a, b) => b.score - a.score || a.position - b.position);
|
|
454
|
+
if (ranked.length === 0) {
|
|
455
|
+
return {
|
|
456
|
+
matches: [],
|
|
457
|
+
total: 0,
|
|
458
|
+
next_step: `Nothing matched '${query}'. Try other words, or list an area with \`toolset\`: ${toolsetOverview(tools).map((row) => row.id).join(", ")}.`,
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
return { matches: ranked.slice(0, limit).map((row) => summarize(row.tool)), total: ranked.length };
|
|
462
|
+
}
|
|
463
|
+
/** didit_tool_describe. Unknown names come back with the closest real names, never as an error. */
|
|
464
|
+
function describeTools(tools, args) {
|
|
465
|
+
const names = (Array.isArray(args?.names) ? args.names : [args?.names])
|
|
466
|
+
.filter((name) => typeof name === "string" && name.trim() !== "")
|
|
467
|
+
.map((name) => name.trim())
|
|
468
|
+
.slice(0, MAX_DESCRIBE);
|
|
469
|
+
const byName = new Map(tools.map((tool) => [tool.name, tool]));
|
|
470
|
+
const found = [];
|
|
471
|
+
const notFound = [];
|
|
472
|
+
for (const name of names) {
|
|
473
|
+
const tool = byName.get(name) ?? byName.get(`didit_${name}`);
|
|
474
|
+
if (tool) {
|
|
475
|
+
found.push({
|
|
476
|
+
name: tool.name,
|
|
477
|
+
toolset: (0, toolsets_1.toolsetOf)(tool.name) ?? null,
|
|
478
|
+
access: tool.access,
|
|
479
|
+
loaded: tool.listed,
|
|
480
|
+
description: tool.description,
|
|
481
|
+
inputSchema: tool.inputSchema,
|
|
482
|
+
});
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
const close = searchTools(tools, { query: name.replace(/^didit_/, "").replace(/_/g, " "), limit: 3 });
|
|
486
|
+
notFound.push({
|
|
487
|
+
name,
|
|
488
|
+
did_you_mean: (close.matches ?? []).map((match) => match.name),
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
return {
|
|
492
|
+
tools: found,
|
|
493
|
+
...(notFound.length > 0 ? { not_found: notFound } : {}),
|
|
494
|
+
...(names.length === 0 ? { next_step: "Pass `names`: an array of exact tool names from didit_tool_search." } : {}),
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* The tool a didit_tool_call_* request names, with its own arguments. A model sometimes sends
|
|
499
|
+
* the nested arguments as a JSON string; that is accepted, since the intent is unambiguous.
|
|
500
|
+
* Returns a message instead when the request cannot be read.
|
|
501
|
+
*/
|
|
502
|
+
function unwrapToolCall(args) {
|
|
503
|
+
const name = typeof args?.name === "string" ? args.name.trim() : "";
|
|
504
|
+
if (!name)
|
|
505
|
+
return "Pass `name`: the exact name of the tool to run, as didit_tool_search returned it.";
|
|
506
|
+
if (isDiscoveryToolName(name))
|
|
507
|
+
return `'${name}' is a discovery tool: call it directly, not through another one.`;
|
|
508
|
+
let inner = args?.arguments ?? {};
|
|
509
|
+
if (typeof inner === "string") {
|
|
510
|
+
try {
|
|
511
|
+
inner = inner.trim() === "" ? {} : JSON.parse(inner);
|
|
512
|
+
}
|
|
513
|
+
catch {
|
|
514
|
+
return "`arguments` must be an object holding the tool's own arguments.";
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if (!inner || typeof inner !== "object" || Array.isArray(inner)) {
|
|
518
|
+
return "`arguments` must be an object holding the tool's own arguments.";
|
|
519
|
+
}
|
|
520
|
+
return { name, arguments: inner };
|
|
521
|
+
}
|
|
522
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/tools/discovery.ts"],"names":[],"mappings":";;;AAkCA,kDAEC;AAGD,0CAEC;AAuCD,8CAgFC;AAkTD,kCAyDC;AAGD,sCAkCC;AAgBD,wCAkBC;AAllBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,0CAAkD;AAErC,QAAA,WAAW,GAAG,mBAAmB,CAAC;AAClC,QAAA,aAAa,GAAG,qBAAqB,CAAC;AACtC,QAAA,cAAc,GAAG,sBAAsB,CAAC;AACxC,QAAA,eAAe,GAAG,uBAA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M,IAAI,GAAG,OAAO,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACpE,IAAI,CAAC,IAAI;QAAE,OAAO,mFAAmF,CAAC;IACtG,IAAI,mBAAmB,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,IAAI,mEAAmE,CAAC;IAElH,IAAI,KAAK,GAAY,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,iEAAiE,CAAC;QAC3E,CAAC;IACH,CAAC;IACD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,OAAO,iEAAiE,CAAC;IAC3E,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAgC,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const DOCS_SEARCH_TOOL = "didit_docs_search";
|
|
2
|
+
/** DIDIT_DOCS_MCP_URL: unset means the public documentation; set but empty switches the tool off. */
|
|
3
|
+
export declare function docsMcpUrl(env?: Record<string, string | undefined>): string | null;
|
|
4
|
+
export declare function docsSearchToolDef(): {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: Record<string, unknown>;
|
|
8
|
+
};
|
|
9
|
+
export declare function searchDocs(args: Record<string, unknown> | undefined): Promise<Record<string, unknown>>;
|
|
10
|
+
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/tools/docs.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AAWpD,qGAAqG;AACrG,wBAAgB,UAAU,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,MAAM,GAAG,IAAI,CAK/F;AAED,wBAAgB,iBAAiB,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAkB/G;AAmCD,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAkD5G"}
|