@lushly-dev/afd-server 1.0.0 → 2.0.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/README.md +297 -14
- package/dist/bootstrap/afd-context.d.ts +11 -2
- package/dist/bootstrap/afd-context.d.ts.map +1 -1
- package/dist/bootstrap/afd-context.js +56 -11
- package/dist/bootstrap/afd-context.js.map +1 -1
- package/dist/bootstrap/afd-docs.d.ts +6 -3
- package/dist/bootstrap/afd-docs.d.ts.map +1 -1
- package/dist/bootstrap/afd-docs.js +14 -9
- package/dist/bootstrap/afd-docs.js.map +1 -1
- package/dist/bootstrap/afd-help.d.ts +6 -3
- package/dist/bootstrap/afd-help.d.ts.map +1 -1
- package/dist/bootstrap/afd-help.js +10 -8
- package/dist/bootstrap/afd-help.js.map +1 -1
- package/dist/bootstrap/afd-schema.d.ts +8 -4
- package/dist/bootstrap/afd-schema.d.ts.map +1 -1
- package/dist/bootstrap/afd-schema.js +55 -42
- package/dist/bootstrap/afd-schema.js.map +1 -1
- package/dist/bootstrap/described-command.d.ts +32 -0
- package/dist/bootstrap/described-command.d.ts.map +1 -0
- package/dist/bootstrap/described-command.js +12 -0
- package/dist/bootstrap/described-command.js.map +1 -0
- package/dist/bootstrap/index.d.ts +1 -0
- package/dist/bootstrap/index.d.ts.map +1 -1
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/bootstrap/json-schema-to-ts.d.ts +27 -0
- package/dist/bootstrap/json-schema-to-ts.d.ts.map +1 -0
- package/dist/bootstrap/json-schema-to-ts.js +154 -0
- package/dist/bootstrap/json-schema-to-ts.js.map +1 -0
- package/dist/bootstrap/registry.d.ts +17 -6
- package/dist/bootstrap/registry.d.ts.map +1 -1
- package/dist/bootstrap/registry.js +32 -5
- package/dist/bootstrap/registry.js.map +1 -1
- package/dist/command-names.d.ts +19 -0
- package/dist/command-names.d.ts.map +1 -0
- package/dist/command-names.js +33 -0
- package/dist/command-names.js.map +1 -0
- package/dist/command-routing.d.ts +47 -0
- package/dist/command-routing.d.ts.map +1 -0
- package/dist/command-routing.js +75 -0
- package/dist/command-routing.js.map +1 -0
- package/dist/context-scope.d.ts +26 -0
- package/dist/context-scope.d.ts.map +1 -0
- package/dist/context-scope.js +31 -0
- package/dist/context-scope.js.map +1 -0
- package/dist/define.d.ts +42 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +41 -0
- package/dist/define.js.map +1 -0
- package/dist/direct-registry.d.ts +103 -0
- package/dist/direct-registry.d.ts.map +1 -0
- package/dist/direct-registry.js +102 -0
- package/dist/direct-registry.js.map +1 -0
- package/dist/execution.d.ts +9 -0
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +105 -321
- package/dist/execution.js.map +1 -1
- package/dist/http-handler.d.ts +24 -17
- package/dist/http-handler.d.ts.map +1 -1
- package/dist/http-handler.js +282 -253
- package/dist/http-handler.js.map +1 -1
- package/dist/http-security.d.ts +23 -0
- package/dist/http-security.d.ts.map +1 -0
- package/dist/http-security.js +101 -0
- package/dist/http-security.js.map +1 -0
- package/dist/http-sessions.d.ts +33 -0
- package/dist/http-sessions.d.ts.map +1 -0
- package/dist/http-sessions.js +65 -0
- package/dist/http-sessions.js.map +1 -0
- package/dist/http-sse.d.ts +30 -0
- package/dist/http-sse.d.ts.map +1 -0
- package/dist/http-sse.js +70 -0
- package/dist/http-sse.js.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/json-rpc.d.ts +56 -0
- package/dist/json-rpc.d.ts.map +1 -0
- package/dist/json-rpc.js +73 -0
- package/dist/json-rpc.js.map +1 -0
- package/dist/lazy-tools.d.ts +2 -12
- package/dist/lazy-tools.d.ts.map +1 -1
- package/dist/lazy-tools.js +9 -14
- package/dist/lazy-tools.js.map +1 -1
- package/dist/meta-tools.d.ts +122 -0
- package/dist/meta-tools.d.ts.map +1 -0
- package/dist/meta-tools.js +156 -0
- package/dist/meta-tools.js.map +1 -0
- package/dist/middleware.d.ts +34 -7
- package/dist/middleware.d.ts.map +1 -1
- package/dist/middleware.js +82 -40
- package/dist/middleware.js.map +1 -1
- package/dist/schema.d.ts +27 -6
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +17 -12
- package/dist/schema.js.map +1 -1
- package/dist/server-types.d.ts +90 -14
- package/dist/server-types.d.ts.map +1 -1
- package/dist/server-types.js.map +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +103 -21
- package/dist/server.js.map +1 -1
- package/dist/tool-router.d.ts +6 -5
- package/dist/tool-router.d.ts.map +1 -1
- package/dist/tool-router.js +104 -120
- package/dist/tool-router.js.map +1 -1
- package/dist/tools.d.ts +10 -420
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +99 -208
- package/dist/tools.js.map +1 -1
- package/package.json +13 -8
package/dist/tools.js
CHANGED
|
@@ -1,244 +1,135 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview MCP tool list generation — individual, grouped, and lazy strategies.
|
|
3
3
|
*/
|
|
4
|
+
import { isMcpExposed } from '@lushly-dev/afd-core';
|
|
5
|
+
import { commandAction, commandGroup, filterByContext } from './command-routing.js';
|
|
6
|
+
import { batchTool, callTool, detailTool, discoverTool, pipeTool, } from './meta-tools.js';
|
|
7
|
+
/**
|
|
8
|
+
* Largest serialized size (in characters) of a grouped tool's per-action parameter
|
|
9
|
+
* schemas that is inlined into `inputSchema.properties.params.anyOf`. Larger groups
|
|
10
|
+
* advertise only the generic `params` object; their schemas stay in `_meta.actions`
|
|
11
|
+
* and `afd-detail`, which keeps `tools/list` small.
|
|
12
|
+
*/
|
|
13
|
+
export const GROUPED_PARAMS_SCHEMA_BUDGET = 8_192;
|
|
4
14
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
5
|
-
//
|
|
15
|
+
// PER-COMMAND METADATA
|
|
6
16
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
/**
|
|
18
|
+
* The `_meta` fields of a command (category, requires, mutation, destructive,
|
|
19
|
+
* examples, outputSchema, contexts). Empty fields are omitted; returns undefined
|
|
20
|
+
* when none is set.
|
|
21
|
+
*/
|
|
22
|
+
function commandMeta(cmd) {
|
|
23
|
+
const meta = {
|
|
24
|
+
...(cmd.category != null && { category: cmd.category }),
|
|
25
|
+
...(cmd.requires?.length && { requires: cmd.requires }),
|
|
26
|
+
...(cmd.mutation != null && { mutation: cmd.mutation }),
|
|
27
|
+
...(cmd.destructive != null && { destructive: cmd.destructive }),
|
|
28
|
+
...(cmd.examples?.length && { examples: cmd.examples }),
|
|
29
|
+
...(cmd.outputJsonSchema && { outputSchema: cmd.outputJsonSchema }),
|
|
30
|
+
...(cmd.contexts?.length && { contexts: cmd.contexts }),
|
|
31
|
+
};
|
|
32
|
+
return Object.keys(meta).length > 0 ? meta : undefined;
|
|
33
|
+
}
|
|
34
|
+
function commandInputSchema(cmd) {
|
|
35
|
+
const { type: _type, ...restSchema } = cmd.jsonSchema;
|
|
36
|
+
return { type: 'object', ...restSchema };
|
|
37
|
+
}
|
|
38
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
39
|
+
// GROUPED STRATEGY
|
|
40
|
+
// ═══════════════════════════════════════════════════════════════════════════════
|
|
41
|
+
/**
|
|
42
|
+
* One consolidated tool for a group of commands.
|
|
43
|
+
*
|
|
44
|
+
* `_meta.actions` lists, for every action, the full command name, its input schema
|
|
45
|
+
* and its metadata, so agents can build `params` without trial and error. When the
|
|
46
|
+
* schemas are small, `params` also carries them as `anyOf` branches (one per action,
|
|
47
|
+
* titled with the action). Branches sit under `params` rather than at the top level
|
|
48
|
+
* because some MCP hosts reject top-level `oneOf`/`anyOf`/`allOf`, and `anyOf` is used
|
|
49
|
+
* rather than `oneOf` because actions often share a params shape (a `oneOf` would then
|
|
50
|
+
* reject valid calls).
|
|
51
|
+
*/
|
|
52
|
+
function groupedTool(groupName, groupCmds) {
|
|
53
|
+
const actions = [...new Set(groupCmds.map(commandAction))];
|
|
54
|
+
const actionEntries = groupCmds.map((cmd) => ({
|
|
55
|
+
action: commandAction(cmd),
|
|
56
|
+
command: cmd.name,
|
|
57
|
+
description: cmd.description,
|
|
58
|
+
inputSchema: commandInputSchema(cmd),
|
|
59
|
+
...commandMeta(cmd),
|
|
60
|
+
}));
|
|
61
|
+
const branches = groupCmds.map((cmd) => ({
|
|
62
|
+
...commandInputSchema(cmd),
|
|
63
|
+
title: commandAction(cmd),
|
|
64
|
+
description: `Parameters for action '${commandAction(cmd)}' (${cmd.name})`,
|
|
65
|
+
}));
|
|
66
|
+
const serialized = JSON.stringify(branches);
|
|
67
|
+
const inlineBranches = serialized.length <= GROUPED_PARAMS_SCHEMA_BUDGET && !serialized.includes('"$ref"');
|
|
68
|
+
return {
|
|
69
|
+
name: groupName,
|
|
70
|
+
description: `${groupName} operations: ${actions.join(', ')}`,
|
|
71
|
+
inputSchema: {
|
|
72
|
+
type: 'object',
|
|
73
|
+
properties: {
|
|
74
|
+
action: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
enum: actions,
|
|
77
|
+
description: `Action to perform: ${actions.join(' | ')}`,
|
|
38
78
|
},
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
required: ['commands'],
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
const pipeToolSchema = {
|
|
45
|
-
name: 'afd-pipe',
|
|
46
|
-
description: 'Execute a pipeline of chained commands where the output of one becomes the input of the next',
|
|
47
|
-
inputSchema: {
|
|
48
|
-
type: 'object',
|
|
49
|
-
properties: {
|
|
50
|
-
steps: {
|
|
51
|
-
type: 'array',
|
|
52
|
-
description: 'Ordered list of pipeline steps to execute',
|
|
53
|
-
items: {
|
|
79
|
+
params: {
|
|
54
80
|
type: 'object',
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
description: 'Input parameters, can reference $prev, $first, $steps[n], or $steps.alias',
|
|
60
|
-
},
|
|
61
|
-
as: {
|
|
62
|
-
type: 'string',
|
|
63
|
-
description: "Optional alias for referencing this step's output",
|
|
64
|
-
},
|
|
65
|
-
when: {
|
|
66
|
-
type: 'object',
|
|
67
|
-
description: "Optional condition for running this step (e.g., { $exists: '$prev.id' })",
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
required: ['command'],
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
options: {
|
|
74
|
-
type: 'object',
|
|
75
|
-
description: 'Pipeline execution options',
|
|
76
|
-
properties: {
|
|
77
|
-
continueOnFailure: {
|
|
78
|
-
type: 'boolean',
|
|
79
|
-
description: 'Continue on failure or stop immediately',
|
|
80
|
-
},
|
|
81
|
-
timeoutMs: {
|
|
82
|
-
type: 'number',
|
|
83
|
-
description: 'Timeout for entire pipeline in milliseconds',
|
|
84
|
-
},
|
|
81
|
+
description: inlineBranches
|
|
82
|
+
? 'Parameters for the action: the anyOf branch titled with the action'
|
|
83
|
+
: "Parameters for the action: see _meta.actions[].inputSchema, or call afd-detail with the action's command name",
|
|
84
|
+
...(inlineBranches && { anyOf: branches }),
|
|
85
85
|
},
|
|
86
86
|
},
|
|
87
|
+
required: ['action'],
|
|
87
88
|
},
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
const callToolSchema = {
|
|
92
|
-
name: 'afd-call',
|
|
93
|
-
description: 'Invoke any command by name with runtime input validation. Works in all server strategies.',
|
|
94
|
-
inputSchema: {
|
|
95
|
-
type: 'object',
|
|
96
|
-
properties: {
|
|
97
|
-
command: { type: 'string', description: 'Command name to invoke' },
|
|
98
|
-
input: {
|
|
99
|
-
type: 'object',
|
|
100
|
-
description: "Command input (validated against the command's own schema at runtime)",
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
required: ['command'],
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
const discoverToolSchema = {
|
|
107
|
-
name: 'afd-discover',
|
|
108
|
-
description: 'List available commands with optional filtering by category, tag, or search text. Returns compact summaries.',
|
|
109
|
-
inputSchema: {
|
|
110
|
-
type: 'object',
|
|
111
|
-
properties: {
|
|
112
|
-
category: { type: 'string', description: 'Filter commands by category' },
|
|
113
|
-
tag: {
|
|
114
|
-
type: 'string',
|
|
115
|
-
description: 'Filter by tag(s). String for single, array for multiple.',
|
|
116
|
-
},
|
|
117
|
-
tagMode: {
|
|
118
|
-
type: 'string',
|
|
119
|
-
enum: ['all', 'any'],
|
|
120
|
-
description: 'Tag matching mode (default: any)',
|
|
121
|
-
},
|
|
122
|
-
search: { type: 'string', description: 'Text search across names and descriptions' },
|
|
123
|
-
includeMutation: { type: 'boolean', description: 'Include mutation classification' },
|
|
124
|
-
limit: { type: 'number', description: 'Max results (1-200, default 50)' },
|
|
125
|
-
offset: { type: 'number', description: 'Results to skip for pagination' },
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
const detailToolSchema = {
|
|
130
|
-
name: 'afd-detail',
|
|
131
|
-
description: 'Get the full input schema and metadata for one or more commands by name.',
|
|
132
|
-
inputSchema: {
|
|
133
|
-
type: 'object',
|
|
134
|
-
properties: {
|
|
135
|
-
command: {
|
|
136
|
-
type: 'string',
|
|
137
|
-
description: 'Command name or names (exact match, kebab-case). String or array of strings (max 10).',
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
required: ['command'],
|
|
141
|
-
},
|
|
142
|
-
};
|
|
89
|
+
_meta: { actions: actionEntries },
|
|
90
|
+
};
|
|
91
|
+
}
|
|
143
92
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
144
93
|
// TOOLS LIST
|
|
145
94
|
// ═══════════════════════════════════════════════════════════════════════════════
|
|
146
|
-
/**
|
|
147
|
-
* Filter commands by active context.
|
|
148
|
-
* Includes commands whose `contexts` array includes the active context,
|
|
149
|
-
* plus commands with no `contexts` array (universal / backward compat).
|
|
150
|
-
*/
|
|
151
|
-
function filterByContext(commands, activeContext) {
|
|
152
|
-
if (!activeContext)
|
|
153
|
-
return commands;
|
|
154
|
-
return commands.filter((cmd) => !cmd.contexts?.length || cmd.contexts.includes(activeContext));
|
|
155
|
-
}
|
|
156
95
|
/**
|
|
157
96
|
* Get the tools list based on toolStrategy.
|
|
158
97
|
*/
|
|
159
98
|
export function getToolsList(commands, toolStrategy, groupByFn, activeContext) {
|
|
160
|
-
const builtInTools = [
|
|
161
|
-
// Filter by active context before strategy-specific generation
|
|
162
|
-
const filtered = filterByContext(commands, activeContext);
|
|
99
|
+
const builtInTools = [batchTool, pipeTool, callTool];
|
|
163
100
|
// Lazy strategy: meta-tools + built-ins only
|
|
164
101
|
if (toolStrategy === 'lazy') {
|
|
165
|
-
return [
|
|
102
|
+
return [discoverTool, detailTool, ...builtInTools];
|
|
166
103
|
}
|
|
104
|
+
// Filter by active context before strategy-specific generation
|
|
105
|
+
const filtered = filterByContext(commands.filter((cmd) => isMcpExposed(cmd)), activeContext);
|
|
167
106
|
// Individual strategy: each command is its own tool + built-ins
|
|
168
107
|
if (toolStrategy === 'individual') {
|
|
169
108
|
return [
|
|
170
109
|
...builtInTools,
|
|
171
110
|
...filtered.map((cmd) => {
|
|
172
|
-
const
|
|
173
|
-
const hasMeta = (cmd.requires && cmd.requires.length > 0) ||
|
|
174
|
-
cmd.mutation != null ||
|
|
175
|
-
(cmd.examples && cmd.examples.length > 0) ||
|
|
176
|
-
cmd.outputJsonSchema != null ||
|
|
177
|
-
(cmd.contexts && cmd.contexts.length > 0);
|
|
111
|
+
const meta = commandMeta(cmd);
|
|
178
112
|
return {
|
|
179
113
|
name: cmd.name,
|
|
180
114
|
description: cmd.description,
|
|
181
|
-
inputSchema:
|
|
182
|
-
|
|
183
|
-
...restSchema,
|
|
184
|
-
},
|
|
185
|
-
...(hasMeta && {
|
|
186
|
-
_meta: {
|
|
187
|
-
...(cmd.requires?.length && { requires: cmd.requires }),
|
|
188
|
-
...(cmd.mutation != null && { mutation: cmd.mutation }),
|
|
189
|
-
...(cmd.examples?.length && { examples: cmd.examples }),
|
|
190
|
-
...(cmd.outputJsonSchema && { outputSchema: cmd.outputJsonSchema }),
|
|
191
|
-
...(cmd.contexts?.length && { contexts: cmd.contexts }),
|
|
192
|
-
},
|
|
193
|
-
}),
|
|
115
|
+
inputSchema: commandInputSchema(cmd),
|
|
116
|
+
...(meta && { _meta: meta }),
|
|
194
117
|
};
|
|
195
118
|
}),
|
|
196
119
|
];
|
|
197
120
|
}
|
|
198
|
-
// Grouped strategy: commands grouped by category/entity
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
};
|
|
202
|
-
const getGroup = groupByFn || defaultGroupFn;
|
|
203
|
-
// Group commands by their group key
|
|
204
|
-
const groups = {};
|
|
121
|
+
// Grouped strategy: commands grouped by category/entity. afd-detail is listed
|
|
122
|
+
// because grouped tools only carry per-action schemas in _meta (or inline when small).
|
|
123
|
+
const groups = new Map();
|
|
205
124
|
for (const cmd of filtered) {
|
|
206
|
-
const group =
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
125
|
+
const group = commandGroup(cmd, groupByFn);
|
|
126
|
+
const members = groups.get(group);
|
|
127
|
+
if (members)
|
|
128
|
+
members.push(cmd);
|
|
129
|
+
else
|
|
130
|
+
groups.set(group, [cmd]);
|
|
211
131
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
// Build action enum from command names
|
|
215
|
-
const actions = groupCmds.map((cmd) => {
|
|
216
|
-
// Extract action from command name (e.g., "todo-create" -> "create")
|
|
217
|
-
const parts = cmd.name.split('-');
|
|
218
|
-
return parts.length > 1 ? parts.slice(1).join('-') : cmd.name;
|
|
219
|
-
});
|
|
220
|
-
return {
|
|
221
|
-
name: groupName,
|
|
222
|
-
description: `${groupName} operations: ${actions.join(', ')}`,
|
|
223
|
-
inputSchema: {
|
|
224
|
-
type: 'object',
|
|
225
|
-
properties: {
|
|
226
|
-
action: {
|
|
227
|
-
type: 'string',
|
|
228
|
-
enum: actions,
|
|
229
|
-
description: `Action to perform: ${actions.join(' | ')}`,
|
|
230
|
-
},
|
|
231
|
-
// Note: Full discriminated union would require merging all command schemas
|
|
232
|
-
// For now, we use a generic "params" object
|
|
233
|
-
params: {
|
|
234
|
-
type: 'object',
|
|
235
|
-
description: 'Parameters for the action (varies by action)',
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
required: ['action'],
|
|
239
|
-
},
|
|
240
|
-
};
|
|
241
|
-
});
|
|
242
|
-
return [...builtInTools, ...groupedTools];
|
|
132
|
+
const groupedTools = Array.from(groups, ([groupName, groupCmds]) => groupedTool(groupName, groupCmds));
|
|
133
|
+
return [...builtInTools, detailTool, ...groupedTools];
|
|
243
134
|
}
|
|
244
135
|
//# sourceMappingURL=tools.js.map
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AACpG,OAAO,EACN,SAAS,EAET,QAAQ,EACR,UAAU,EACV,YAAY,EAG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,CAAC,WAAW;oBAC5B,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC;oBACpC,GAAG,CAAC,IAAI,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;iBAC5B,CAAC;YACH,CAAC,CAAC;SACF,CAAC;IACH,CAAC;IAED,8EAA8E;IAC9E,uFAAuF;IACvF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkC,CAAC;IACzD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,OAAO;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;;YAC1B,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,EAAE,CAClE,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC,CACjC,CAAC;IAEF,OAAO,CAAC,GAAG,YAAY,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC,CAAC;AACvD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lushly-dev/afd-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Server-side utilities for building AFD-compliant MCP servers with Zod validation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./define": {
|
|
14
|
+
"types": "./dist/define.d.ts",
|
|
15
|
+
"import": "./dist/define.js"
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
18
|
"files": [
|
|
@@ -16,15 +20,15 @@
|
|
|
16
20
|
"README.md"
|
|
17
21
|
],
|
|
18
22
|
"dependencies": {
|
|
19
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
20
|
-
"zod": "^4.
|
|
21
|
-
"@lushly-dev/afd-core": "
|
|
23
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
24
|
+
"zod": "^4.5.4",
|
|
25
|
+
"@lushly-dev/afd-core": "2.0.0"
|
|
22
26
|
},
|
|
23
27
|
"devDependencies": {
|
|
24
|
-
"@vitest/coverage-v8": "^4.1.
|
|
28
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
25
29
|
"typescript": "^5.9.3",
|
|
26
|
-
"vitest": "^4.1.
|
|
27
|
-
"@lushly-dev/afd-client": "
|
|
30
|
+
"vitest": "^4.1.11",
|
|
31
|
+
"@lushly-dev/afd-client": "2.0.0"
|
|
28
32
|
},
|
|
29
33
|
"keywords": [
|
|
30
34
|
"afd",
|
|
@@ -46,7 +50,7 @@
|
|
|
46
50
|
"directory": "packages/server"
|
|
47
51
|
},
|
|
48
52
|
"engines": {
|
|
49
|
-
"node": ">=22.
|
|
53
|
+
"node": ">=22.12.0"
|
|
50
54
|
},
|
|
51
55
|
"sideEffects": false,
|
|
52
56
|
"publishConfig": {
|
|
@@ -54,6 +58,7 @@
|
|
|
54
58
|
},
|
|
55
59
|
"scripts": {
|
|
56
60
|
"build": "tsc",
|
|
61
|
+
"typecheck": "tsc -p tsconfig.typecheck.json",
|
|
57
62
|
"dev": "tsc --watch",
|
|
58
63
|
"test": "vitest run",
|
|
59
64
|
"test:watch": "vitest",
|