hono-apcore 0.1.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 +190 -0
- package/README.md +426 -0
- package/dist/a2a/apcore-a2a.service.d.ts +44 -0
- package/dist/a2a/apcore-a2a.service.d.ts.map +1 -0
- package/dist/a2a/apcore-a2a.service.js +82 -0
- package/dist/a2a/apcore-a2a.service.js.map +1 -0
- package/dist/a2a/index.d.ts +2 -0
- package/dist/a2a/index.d.ts.map +1 -0
- package/dist/a2a/index.js +2 -0
- package/dist/a2a/index.js.map +1 -0
- package/dist/bridge/binding-loader.d.ts +45 -0
- package/dist/bridge/binding-loader.d.ts.map +1 -0
- package/dist/bridge/binding-loader.js +84 -0
- package/dist/bridge/binding-loader.js.map +1 -0
- package/dist/bridge/index.d.ts +3 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +2 -0
- package/dist/bridge/index.js.map +1 -0
- package/dist/cli/apcore-cli.service.d.ts +50 -0
- package/dist/cli/apcore-cli.service.d.ts.map +1 -0
- package/dist/cli/apcore-cli.service.js +76 -0
- package/dist/cli/apcore-cli.service.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +247 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +55 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +86 -0
- package/dist/config.js.map +1 -0
- package/dist/constants.d.ts +27 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +27 -0
- package/dist/constants.js.map +1 -0
- package/dist/context/hono-context.factory.d.ts +61 -0
- package/dist/context/hono-context.factory.d.ts.map +1 -0
- package/dist/context/hono-context.factory.js +117 -0
- package/dist/context/hono-context.factory.js.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +2 -0
- package/dist/context/index.js.map +1 -0
- package/dist/core/apcore.d.ts +135 -0
- package/dist/core/apcore.d.ts.map +1 -0
- package/dist/core/apcore.js +257 -0
- package/dist/core/apcore.js.map +1 -0
- package/dist/core/executor.d.ts +32 -0
- package/dist/core/executor.d.ts.map +1 -0
- package/dist/core/executor.js +41 -0
- package/dist/core/executor.js.map +1 -0
- package/dist/core/middleware.d.ts +61 -0
- package/dist/core/middleware.d.ts.map +1 -0
- package/dist/core/middleware.js +51 -0
- package/dist/core/middleware.js.map +1 -0
- package/dist/core/registry.d.ts +79 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +218 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/apcore-mcp.service.d.ts +83 -0
- package/dist/mcp/apcore-mcp.service.d.ts.map +1 -0
- package/dist/mcp/apcore-mcp.service.js +189 -0
- package/dist/mcp/apcore-mcp.service.js.map +1 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/mount.d.ts +51 -0
- package/dist/mcp/mount.d.ts.map +1 -0
- package/dist/mcp/mount.js +95 -0
- package/dist/mcp/mount.js.map +1 -0
- package/dist/output/index.d.ts +3 -0
- package/dist/output/index.d.ts.map +1 -0
- package/dist/output/index.js +2 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/yaml-writer.d.ts +31 -0
- package/dist/output/yaml-writer.d.ts.map +1 -0
- package/dist/output/yaml-writer.js +49 -0
- package/dist/output/yaml-writer.js.map +1 -0
- package/dist/scanners/hono-route-scanner.d.ts +60 -0
- package/dist/scanners/hono-route-scanner.d.ts.map +1 -0
- package/dist/scanners/hono-route-scanner.js +217 -0
- package/dist/scanners/hono-route-scanner.js.map +1 -0
- package/dist/scanners/index.d.ts +3 -0
- package/dist/scanners/index.d.ts.map +1 -0
- package/dist/scanners/index.js +2 -0
- package/dist/scanners/index.js.map +1 -0
- package/dist/schema/adapters/json-schema.adapter.d.ts +23 -0
- package/dist/schema/adapters/json-schema.adapter.d.ts.map +1 -0
- package/dist/schema/adapters/json-schema.adapter.js +40 -0
- package/dist/schema/adapters/json-schema.adapter.js.map +1 -0
- package/dist/schema/adapters/schema-adapter.interface.d.ts +24 -0
- package/dist/schema/adapters/schema-adapter.interface.d.ts.map +1 -0
- package/dist/schema/adapters/schema-adapter.interface.js +2 -0
- package/dist/schema/adapters/schema-adapter.interface.js.map +1 -0
- package/dist/schema/adapters/typebox.adapter.d.ts +26 -0
- package/dist/schema/adapters/typebox.adapter.d.ts.map +1 -0
- package/dist/schema/adapters/typebox.adapter.js +39 -0
- package/dist/schema/adapters/typebox.adapter.js.map +1 -0
- package/dist/schema/adapters/zod.adapter.d.ts +17 -0
- package/dist/schema/adapters/zod.adapter.d.ts.map +1 -0
- package/dist/schema/adapters/zod.adapter.js +372 -0
- package/dist/schema/adapters/zod.adapter.js.map +1 -0
- package/dist/schema/index.d.ts +6 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +5 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/schema-extractor.d.ts +51 -0
- package/dist/schema/schema-extractor.d.ts.map +1 -0
- package/dist/schema/schema-extractor.js +89 -0
- package/dist/schema/schema-extractor.js.map +1 -0
- package/dist/tools/define-tool.d.ts +68 -0
- package/dist/tools/define-tool.d.ts.map +1 -0
- package/dist/tools/define-tool.js +122 -0
- package/dist/tools/define-tool.js.map +1 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +2 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/types.d.ts +246 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/id-generator.d.ts +52 -0
- package/dist/utils/id-generator.d.ts.map +1 -0
- package/dist/utils/id-generator.js +87 -0
- package/dist/utils/id-generator.js.map +1 -0
- package/dist/utils/module-factory.d.ts +34 -0
- package/dist/utils/module-factory.d.ts.map +1 -0
- package/dist/utils/module-factory.js +59 -0
- package/dist/utils/module-factory.js.map +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
function hasSafeParse(input) {
|
|
2
|
+
return (input !== null &&
|
|
3
|
+
typeof input === 'object' &&
|
|
4
|
+
'safeParse' in input &&
|
|
5
|
+
typeof input['safeParse'] === 'function');
|
|
6
|
+
}
|
|
7
|
+
function isZodV3(input) {
|
|
8
|
+
if (!hasSafeParse(input))
|
|
9
|
+
return false;
|
|
10
|
+
const def = input['_def'];
|
|
11
|
+
return (def !== null &&
|
|
12
|
+
typeof def === 'object' &&
|
|
13
|
+
typeof def.typeName === 'string');
|
|
14
|
+
}
|
|
15
|
+
function isZodV4(input) {
|
|
16
|
+
if (!hasSafeParse(input))
|
|
17
|
+
return false;
|
|
18
|
+
const internals = input['_zod'];
|
|
19
|
+
if (internals === null || typeof internals !== 'object')
|
|
20
|
+
return false;
|
|
21
|
+
const def = internals['def'];
|
|
22
|
+
return def !== null && typeof def === 'object' && typeof def.type === 'string';
|
|
23
|
+
}
|
|
24
|
+
/** A `.description` set via `.describe()` — available on both Zod 3 and 4. */
|
|
25
|
+
function describedAs(schema) {
|
|
26
|
+
return typeof schema.description === 'string' && schema.description.length > 0
|
|
27
|
+
? schema.description
|
|
28
|
+
: undefined;
|
|
29
|
+
}
|
|
30
|
+
function withDescription(result, schema) {
|
|
31
|
+
const description = describedAs(schema);
|
|
32
|
+
if (description !== undefined && result['description'] === undefined) {
|
|
33
|
+
result['description'] = description;
|
|
34
|
+
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Enum helpers (shared by both major versions)
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
/**
|
|
41
|
+
* Build the JSON Schema fragment for an enum from its entries object.
|
|
42
|
+
*
|
|
43
|
+
* TypeScript numeric enums are emitted with a reverse mapping — `enum Color
|
|
44
|
+
* { Red = 0 }` compiles to `{ 0: 'Red', Red: 0 }` — and only the forward
|
|
45
|
+
* entries are values a caller may actually send. An entry is a reverse
|
|
46
|
+
* mapping when its value is a string that is itself a key holding the number
|
|
47
|
+
* this key spells.
|
|
48
|
+
*
|
|
49
|
+
* `type` is only emitted when every surviving value shares one JSON type;
|
|
50
|
+
* a mixed enum carries `enum` alone.
|
|
51
|
+
*/
|
|
52
|
+
function enumFromEntries(entries) {
|
|
53
|
+
const values = Object.entries(entries)
|
|
54
|
+
.filter(([key, value]) => {
|
|
55
|
+
if (typeof value !== 'string')
|
|
56
|
+
return true;
|
|
57
|
+
const roundTrip = entries[value];
|
|
58
|
+
return typeof roundTrip !== 'number' || String(roundTrip) !== key;
|
|
59
|
+
})
|
|
60
|
+
.map(([, value]) => value);
|
|
61
|
+
const result = { enum: values };
|
|
62
|
+
if (values.length > 0 && values.every((v) => typeof v === 'string')) {
|
|
63
|
+
result['type'] = 'string';
|
|
64
|
+
}
|
|
65
|
+
else if (values.length > 0 && values.every((v) => typeof v === 'number')) {
|
|
66
|
+
result['type'] = 'number';
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
// Zod 3 -> JSON Schema
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
function convertV3(schema) {
|
|
74
|
+
const def = schema._def;
|
|
75
|
+
const typeName = def.typeName ?? '';
|
|
76
|
+
let result;
|
|
77
|
+
switch (typeName) {
|
|
78
|
+
case 'ZodString':
|
|
79
|
+
result = { type: 'string' };
|
|
80
|
+
break;
|
|
81
|
+
case 'ZodNumber':
|
|
82
|
+
result = convertV3Number(def);
|
|
83
|
+
break;
|
|
84
|
+
case 'ZodBoolean':
|
|
85
|
+
result = { type: 'boolean' };
|
|
86
|
+
break;
|
|
87
|
+
case 'ZodObject':
|
|
88
|
+
result = convertV3Object(def);
|
|
89
|
+
break;
|
|
90
|
+
case 'ZodArray':
|
|
91
|
+
result = { type: 'array', items: convertV3(def['type']) };
|
|
92
|
+
break;
|
|
93
|
+
case 'ZodEnum':
|
|
94
|
+
result = { type: 'string', enum: [...def['values']] };
|
|
95
|
+
break;
|
|
96
|
+
case 'ZodNativeEnum':
|
|
97
|
+
result = enumFromEntries(def['values']);
|
|
98
|
+
break;
|
|
99
|
+
case 'ZodOptional':
|
|
100
|
+
result = convertV3(def['innerType']);
|
|
101
|
+
break;
|
|
102
|
+
case 'ZodNullable':
|
|
103
|
+
result = { ...convertV3(def['innerType']), nullable: true };
|
|
104
|
+
break;
|
|
105
|
+
case 'ZodDefault':
|
|
106
|
+
result = {
|
|
107
|
+
...convertV3(def['innerType']),
|
|
108
|
+
default: def['defaultValue'](),
|
|
109
|
+
};
|
|
110
|
+
break;
|
|
111
|
+
case 'ZodLiteral': {
|
|
112
|
+
const value = def['value'];
|
|
113
|
+
result = { type: typeof value, const: value };
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case 'ZodUnion':
|
|
117
|
+
result = { anyOf: def['options'].map(convertV3) };
|
|
118
|
+
break;
|
|
119
|
+
case 'ZodRecord':
|
|
120
|
+
result = {
|
|
121
|
+
type: 'object',
|
|
122
|
+
additionalProperties: convertV3(def['valueType']),
|
|
123
|
+
};
|
|
124
|
+
break;
|
|
125
|
+
case 'ZodEffects':
|
|
126
|
+
result = convertV3(def['schema']);
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
result = {};
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
if (typeof def.description === 'string' && def.description.length > 0) {
|
|
133
|
+
result['description'] = def.description;
|
|
134
|
+
}
|
|
135
|
+
return withDescription(result, schema);
|
|
136
|
+
}
|
|
137
|
+
function convertV3Number(def) {
|
|
138
|
+
const checks = def['checks'] ?? [];
|
|
139
|
+
const result = {};
|
|
140
|
+
let type = 'number';
|
|
141
|
+
for (const check of checks) {
|
|
142
|
+
switch (check.kind) {
|
|
143
|
+
case 'int':
|
|
144
|
+
type = 'integer';
|
|
145
|
+
break;
|
|
146
|
+
case 'min':
|
|
147
|
+
result['minimum'] = check.value;
|
|
148
|
+
break;
|
|
149
|
+
case 'max':
|
|
150
|
+
result['maximum'] = check.value;
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
result['type'] = type;
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
function convertV3Object(def) {
|
|
158
|
+
const shapeFn = def['shape'];
|
|
159
|
+
const shape = typeof shapeFn === 'function' ? shapeFn() : undefined;
|
|
160
|
+
if (!shape)
|
|
161
|
+
return { type: 'object' };
|
|
162
|
+
const properties = {};
|
|
163
|
+
const required = [];
|
|
164
|
+
for (const [key, field] of Object.entries(shape)) {
|
|
165
|
+
properties[key] = convertV3(field);
|
|
166
|
+
const fieldType = field._def.typeName;
|
|
167
|
+
if (fieldType !== 'ZodOptional' && fieldType !== 'ZodDefault') {
|
|
168
|
+
required.push(key);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const result = { type: 'object', properties };
|
|
172
|
+
if (required.length > 0)
|
|
173
|
+
result['required'] = required;
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
// ---------------------------------------------------------------------------
|
|
177
|
+
// Zod 4 -> JSON Schema
|
|
178
|
+
// ---------------------------------------------------------------------------
|
|
179
|
+
/** Type names that make an object property optional in Zod 4. */
|
|
180
|
+
const V4_OPTIONAL_TYPES = new Set(['optional', 'default', 'prefault']);
|
|
181
|
+
function v4Def(schema) {
|
|
182
|
+
return schema._zod.def;
|
|
183
|
+
}
|
|
184
|
+
function convertV4(schema) {
|
|
185
|
+
const def = v4Def(schema);
|
|
186
|
+
let result;
|
|
187
|
+
switch (def.type) {
|
|
188
|
+
case 'string':
|
|
189
|
+
result = convertV4String(def);
|
|
190
|
+
break;
|
|
191
|
+
case 'number':
|
|
192
|
+
case 'int':
|
|
193
|
+
result = convertV4Number(def);
|
|
194
|
+
break;
|
|
195
|
+
case 'bigint':
|
|
196
|
+
result = { type: 'integer' };
|
|
197
|
+
break;
|
|
198
|
+
case 'boolean':
|
|
199
|
+
result = { type: 'boolean' };
|
|
200
|
+
break;
|
|
201
|
+
case 'date':
|
|
202
|
+
result = { type: 'string', format: 'date-time' };
|
|
203
|
+
break;
|
|
204
|
+
case 'null':
|
|
205
|
+
result = { type: 'null' };
|
|
206
|
+
break;
|
|
207
|
+
case 'object':
|
|
208
|
+
result = convertV4Object(def);
|
|
209
|
+
break;
|
|
210
|
+
case 'array':
|
|
211
|
+
result = { type: 'array', items: convertV4(def['element']) };
|
|
212
|
+
break;
|
|
213
|
+
case 'enum':
|
|
214
|
+
result = enumFromEntries(def['entries'] ?? {});
|
|
215
|
+
break;
|
|
216
|
+
case 'literal': {
|
|
217
|
+
const values = def['values'] ?? [];
|
|
218
|
+
result =
|
|
219
|
+
values.length === 1
|
|
220
|
+
? { type: typeof values[0], const: values[0] }
|
|
221
|
+
: { enum: [...values] };
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
case 'optional':
|
|
225
|
+
case 'nonoptional':
|
|
226
|
+
case 'readonly':
|
|
227
|
+
case 'catch':
|
|
228
|
+
result = convertV4(def['innerType']);
|
|
229
|
+
break;
|
|
230
|
+
case 'nullable':
|
|
231
|
+
result = { ...convertV4(def['innerType']), nullable: true };
|
|
232
|
+
break;
|
|
233
|
+
case 'default':
|
|
234
|
+
case 'prefault':
|
|
235
|
+
result = {
|
|
236
|
+
...convertV4(def['innerType']),
|
|
237
|
+
default: def['defaultValue'],
|
|
238
|
+
};
|
|
239
|
+
break;
|
|
240
|
+
case 'union':
|
|
241
|
+
result = { anyOf: def['options'].map(convertV4) };
|
|
242
|
+
break;
|
|
243
|
+
case 'record':
|
|
244
|
+
result = {
|
|
245
|
+
type: 'object',
|
|
246
|
+
additionalProperties: convertV4(def['valueType']),
|
|
247
|
+
};
|
|
248
|
+
break;
|
|
249
|
+
case 'pipe':
|
|
250
|
+
// `.transform()` / `z.coerce.*` wrap the source schema in a pipe; the
|
|
251
|
+
// input side is what a caller must supply.
|
|
252
|
+
result = convertV4(def['in']);
|
|
253
|
+
break;
|
|
254
|
+
default:
|
|
255
|
+
result = {};
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
return withDescription(result, schema);
|
|
259
|
+
}
|
|
260
|
+
/** Read the `_zod.def` of a Zod 4 check object. */
|
|
261
|
+
function v4CheckDef(check) {
|
|
262
|
+
const internals = check?.['_zod'];
|
|
263
|
+
if (internals === null || typeof internals !== 'object')
|
|
264
|
+
return {};
|
|
265
|
+
return internals['def'] ?? {};
|
|
266
|
+
}
|
|
267
|
+
function convertV4String(def) {
|
|
268
|
+
const result = { type: 'string' };
|
|
269
|
+
for (const check of def['checks'] ?? []) {
|
|
270
|
+
const cd = v4CheckDef(check);
|
|
271
|
+
switch (cd['check']) {
|
|
272
|
+
case 'min_length':
|
|
273
|
+
result['minLength'] = cd['minimum'];
|
|
274
|
+
break;
|
|
275
|
+
case 'max_length':
|
|
276
|
+
result['maxLength'] = cd['maximum'];
|
|
277
|
+
break;
|
|
278
|
+
case 'length_equals':
|
|
279
|
+
result['minLength'] = cd['length'];
|
|
280
|
+
result['maxLength'] = cd['length'];
|
|
281
|
+
break;
|
|
282
|
+
case 'string_format':
|
|
283
|
+
if (typeof cd['format'] === 'string' && cd['format'] !== 'regex') {
|
|
284
|
+
result['format'] = cd['format'];
|
|
285
|
+
}
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
// `z.email()` and friends put the format on the def itself, not in checks.
|
|
290
|
+
if (typeof def['format'] === 'string' && result['format'] === undefined) {
|
|
291
|
+
result['format'] = def['format'];
|
|
292
|
+
}
|
|
293
|
+
return result;
|
|
294
|
+
}
|
|
295
|
+
/** Zod 4 numeric formats that map to JSON Schema `integer`. */
|
|
296
|
+
const V4_INT_FORMATS = new Set(['safeint', 'int32', 'uint32', 'int64', 'uint64']);
|
|
297
|
+
function convertV4Number(def) {
|
|
298
|
+
const result = {};
|
|
299
|
+
let type = def.type === 'int' ? 'integer' : 'number';
|
|
300
|
+
for (const check of def['checks'] ?? []) {
|
|
301
|
+
const cd = v4CheckDef(check);
|
|
302
|
+
switch (cd['check']) {
|
|
303
|
+
case 'number_format':
|
|
304
|
+
if (typeof cd['format'] === 'string' && V4_INT_FORMATS.has(cd['format'])) {
|
|
305
|
+
type = 'integer';
|
|
306
|
+
}
|
|
307
|
+
break;
|
|
308
|
+
case 'greater_than':
|
|
309
|
+
if (cd['inclusive'])
|
|
310
|
+
result['minimum'] = cd['value'];
|
|
311
|
+
else
|
|
312
|
+
result['exclusiveMinimum'] = cd['value'];
|
|
313
|
+
break;
|
|
314
|
+
case 'less_than':
|
|
315
|
+
if (cd['inclusive'])
|
|
316
|
+
result['maximum'] = cd['value'];
|
|
317
|
+
else
|
|
318
|
+
result['exclusiveMaximum'] = cd['value'];
|
|
319
|
+
break;
|
|
320
|
+
case 'multiple_of':
|
|
321
|
+
result['multipleOf'] = cd['value'];
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
result['type'] = type;
|
|
326
|
+
return result;
|
|
327
|
+
}
|
|
328
|
+
function convertV4Object(def) {
|
|
329
|
+
const shape = def['shape'];
|
|
330
|
+
if (!shape)
|
|
331
|
+
return { type: 'object' };
|
|
332
|
+
const properties = {};
|
|
333
|
+
const required = [];
|
|
334
|
+
for (const [key, field] of Object.entries(shape)) {
|
|
335
|
+
properties[key] = convertV4(field);
|
|
336
|
+
if (!V4_OPTIONAL_TYPES.has(v4Def(field).type ?? '')) {
|
|
337
|
+
required.push(key);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
const result = { type: 'object', properties };
|
|
341
|
+
if (required.length > 0)
|
|
342
|
+
result['required'] = required;
|
|
343
|
+
return result;
|
|
344
|
+
}
|
|
345
|
+
// ---------------------------------------------------------------------------
|
|
346
|
+
// Adapter
|
|
347
|
+
// ---------------------------------------------------------------------------
|
|
348
|
+
/**
|
|
349
|
+
* Schema adapter for Zod, supporting both Zod 3 and Zod 4.
|
|
350
|
+
*
|
|
351
|
+
* Detection and conversion are structural — Zod is never imported — so the
|
|
352
|
+
* adapter works whichever major version (if any) the host app installs.
|
|
353
|
+
* Zod 3 is recognised by `_def.typeName`, Zod 4 by `_zod.def.type`.
|
|
354
|
+
*/
|
|
355
|
+
export class ZodAdapter {
|
|
356
|
+
name = 'zod';
|
|
357
|
+
priority = 50;
|
|
358
|
+
detect(input) {
|
|
359
|
+
return isZodV3(input) || isZodV4(input);
|
|
360
|
+
}
|
|
361
|
+
extract(input) {
|
|
362
|
+
return this.extractJsonSchema(input);
|
|
363
|
+
}
|
|
364
|
+
extractJsonSchema(input) {
|
|
365
|
+
if (isZodV4(input))
|
|
366
|
+
return convertV4(input);
|
|
367
|
+
if (isZodV3(input))
|
|
368
|
+
return convertV3(input);
|
|
369
|
+
throw new Error('ZodAdapter.extractJsonSchema: input is not a Zod schema');
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
//# sourceMappingURL=zod.adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod.adapter.js","sourceRoot":"","sources":["../../../src/schema/adapters/zod.adapter.ts"],"names":[],"mappings":"AAgCA,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,CACL,KAAK,KAAK,IAAI;QACd,OAAO,KAAK,KAAK,QAAQ;QACzB,WAAW,IAAK,KAAgB;QAChC,OAAQ,KAAiC,CAAC,WAAW,CAAC,KAAK,UAAU,CACtE,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,IAAI,CAAC,YAAY,CAAC,KAAK,C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AAC,CAAC;IAC1C,CAAC;IAED,OAAO,CAAC,KAAc;QACpB,OAAO,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAuB,CAAC;IAC7D,CAAC;IAED,iBAAiB,CAAC,KAAc;QAC9B,IAAI,OAAO,CAAC,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,OAAO,CAAC,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { SchemaExtractor, SchemaExtractionError, defaultSchemaExtractor } from './schema-extractor.js';
|
|
2
|
+
export type { SchemaAdapter } from './adapters/schema-adapter.interface.js';
|
|
3
|
+
export { TypeBoxAdapter } from './adapters/typebox.adapter.js';
|
|
4
|
+
export { ZodAdapter } from './adapters/zod.adapter.js';
|
|
5
|
+
export { JsonSchemaAdapter } from './adapters/json-schema.adapter.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACvG,YAAY,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { SchemaExtractor, SchemaExtractionError, defaultSchemaExtractor } from './schema-extractor.js';
|
|
2
|
+
export { TypeBoxAdapter } from './adapters/typebox.adapter.js';
|
|
3
|
+
export { ZodAdapter } from './adapters/zod.adapter.js';
|
|
4
|
+
export { JsonSchemaAdapter } from './adapters/json-schema.adapter.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schema/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEvG,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TSchema } from '@sinclair/typebox';
|
|
2
|
+
import type { SchemaAdapter } from './adapters/schema-adapter.interface.js';
|
|
3
|
+
/** Thrown when no registered adapter can handle the provided input. */
|
|
4
|
+
export declare class SchemaExtractionError extends Error {
|
|
5
|
+
readonly name = "SchemaExtractionError";
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Delegates schema detection and conversion to a prioritised chain of
|
|
10
|
+
* {@link SchemaAdapter}s.
|
|
11
|
+
*
|
|
12
|
+
* Built-in adapters, tried in descending priority order:
|
|
13
|
+
*
|
|
14
|
+
* | Adapter | Priority |
|
|
15
|
+
* |--------------------|----------|
|
|
16
|
+
* | TypeBoxAdapter | 100 |
|
|
17
|
+
* | ZodAdapter | 50 |
|
|
18
|
+
* | JsonSchemaAdapter | 30 |
|
|
19
|
+
*
|
|
20
|
+
* Register your own with {@link registerAdapter}; it is inserted into the
|
|
21
|
+
* chain according to its `priority`.
|
|
22
|
+
*/
|
|
23
|
+
export declare class SchemaExtractor {
|
|
24
|
+
private adapters;
|
|
25
|
+
constructor(adapters?: SchemaAdapter[]);
|
|
26
|
+
/** Add a custom adapter and re-sort the chain (highest priority first). */
|
|
27
|
+
registerAdapter(adapter: SchemaAdapter): void;
|
|
28
|
+
/** Names of the adapters in the chain, highest priority first. */
|
|
29
|
+
get adapterNames(): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Name of the first adapter that claims `input`, or `null` when none
|
|
32
|
+
* recognises it.
|
|
33
|
+
*/
|
|
34
|
+
detect(input: unknown): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Extract a TypeBox-compatible `TSchema` from `input`.
|
|
37
|
+
*
|
|
38
|
+
* @throws {SchemaExtractionError} When no adapter can handle the input.
|
|
39
|
+
*/
|
|
40
|
+
extract(input: unknown): TSchema;
|
|
41
|
+
/**
|
|
42
|
+
* Extract a plain JSON Schema object from `input`.
|
|
43
|
+
*
|
|
44
|
+
* @throws {SchemaExtractionError} When no adapter can handle the input.
|
|
45
|
+
*/
|
|
46
|
+
extractJsonSchema(input: unknown): Record<string, unknown>;
|
|
47
|
+
private sortAdapters;
|
|
48
|
+
}
|
|
49
|
+
/** Process-wide extractor used by the tool registrar and route scanner. */
|
|
50
|
+
export declare const defaultSchemaExtractor: SchemaExtractor;
|
|
51
|
+
//# sourceMappingURL=schema-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-extractor.d.ts","sourceRoot":"","sources":["../../src/schema/schema-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAK5E,uEAAuE;AACvE,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,SAAkB,IAAI,2BAA2B;gBAErC,OAAO,EAAE,MAAM;CAK5B;AAMD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAkB;gBAEtB,QAAQ,CAAC,EAAE,aAAa,EAAE;IAKtC,2EAA2E;IAC3E,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAK7C,kEAAkE;IAClE,IAAI,YAAY,IAAI,MAAM,EAAE,CAE3B;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;IASrC;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAShC;;;;OAIG;IACH,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAS1D,OAAO,CAAC,YAAY;CAGrB;AAED,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,iBAAwB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { TypeBoxAdapter } from './adapters/typebox.adapter.js';
|
|
2
|
+
import { ZodAdapter } from './adapters/zod.adapter.js';
|
|
3
|
+
import { JsonSchemaAdapter } from './adapters/json-schema.adapter.js';
|
|
4
|
+
/** Thrown when no registered adapter can handle the provided input. */
|
|
5
|
+
export class SchemaExtractionError extends Error {
|
|
6
|
+
name = 'SchemaExtractionError';
|
|
7
|
+
constructor(message) {
|
|
8
|
+
super(message);
|
|
9
|
+
// Restore the prototype chain when down-levelling or extending built-ins.
|
|
10
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const NO_MATCH = 'No adapter matched the provided input. ' +
|
|
14
|
+
'Provide a TypeBox schema, a Zod schema, or a plain JSON Schema object.';
|
|
15
|
+
/**
|
|
16
|
+
* Delegates schema detection and conversion to a prioritised chain of
|
|
17
|
+
* {@link SchemaAdapter}s.
|
|
18
|
+
*
|
|
19
|
+
* Built-in adapters, tried in descending priority order:
|
|
20
|
+
*
|
|
21
|
+
* | Adapter | Priority |
|
|
22
|
+
* |--------------------|----------|
|
|
23
|
+
* | TypeBoxAdapter | 100 |
|
|
24
|
+
* | ZodAdapter | 50 |
|
|
25
|
+
* | JsonSchemaAdapter | 30 |
|
|
26
|
+
*
|
|
27
|
+
* Register your own with {@link registerAdapter}; it is inserted into the
|
|
28
|
+
* chain according to its `priority`.
|
|
29
|
+
*/
|
|
30
|
+
export class SchemaExtractor {
|
|
31
|
+
adapters;
|
|
32
|
+
constructor(adapters) {
|
|
33
|
+
this.adapters = adapters ?? [new TypeBoxAdapter(), new ZodAdapter(), new JsonSchemaAdapter()];
|
|
34
|
+
this.sortAdapters();
|
|
35
|
+
}
|
|
36
|
+
/** Add a custom adapter and re-sort the chain (highest priority first). */
|
|
37
|
+
registerAdapter(adapter) {
|
|
38
|
+
this.adapters.push(adapter);
|
|
39
|
+
this.sortAdapters();
|
|
40
|
+
}
|
|
41
|
+
/** Names of the adapters in the chain, highest priority first. */
|
|
42
|
+
get adapterNames() {
|
|
43
|
+
return this.adapters.map((adapter) => adapter.name);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Name of the first adapter that claims `input`, or `null` when none
|
|
47
|
+
* recognises it.
|
|
48
|
+
*/
|
|
49
|
+
detect(input) {
|
|
50
|
+
for (const adapter of this.adapters) {
|
|
51
|
+
if (adapter.detect(input)) {
|
|
52
|
+
return adapter.name;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Extract a TypeBox-compatible `TSchema` from `input`.
|
|
59
|
+
*
|
|
60
|
+
* @throws {SchemaExtractionError} When no adapter can handle the input.
|
|
61
|
+
*/
|
|
62
|
+
extract(input) {
|
|
63
|
+
for (const adapter of this.adapters) {
|
|
64
|
+
if (adapter.detect(input)) {
|
|
65
|
+
return adapter.extract(input);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
throw new SchemaExtractionError(NO_MATCH);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Extract a plain JSON Schema object from `input`.
|
|
72
|
+
*
|
|
73
|
+
* @throws {SchemaExtractionError} When no adapter can handle the input.
|
|
74
|
+
*/
|
|
75
|
+
extractJsonSchema(input) {
|
|
76
|
+
for (const adapter of this.adapters) {
|
|
77
|
+
if (adapter.detect(input)) {
|
|
78
|
+
return adapter.extractJsonSchema(input);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
throw new SchemaExtractionError(NO_MATCH);
|
|
82
|
+
}
|
|
83
|
+
sortAdapters() {
|
|
84
|
+
this.adapters.sort((a, b) => b.priority - a.priority);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** Process-wide extractor used by the tool registrar and route scanner. */
|
|
88
|
+
export const defaultSchemaExtractor = new SchemaExtractor();
|
|
89
|
+
//# sourceMappingURL=schema-extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-extractor.js","sourceRoot":"","sources":["../../src/schema/schema-extractor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,uEAAuE;AACvE,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC5B,IAAI,GAAG,uBAAuB,CAAC;IAEjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,0EAA0E;QAC1E,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAED,MAAM,QAAQ,GACZ,yCAAyC;IACzC,wEAAwE,CAAC;AAE3E;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,eAAe;IAClB,QAAQ,CAAkB;IAElC,YAAY,QAA0B;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,CAAC,IAAI,cAAc,EAAE,EAAE,IAAI,UAAU,EAAE,EAAE,IAAI,iBAAiB,EAAE,CAAC,CAAC;QAC9F,IAAI,CAAC,YAAY,E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IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AAED,2EAA2E;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ScannedModule } from 'apcore-toolkit';
|
|
2
|
+
import { SchemaExtractor } from '../schema/schema-extractor.js';
|
|
3
|
+
import type { BoundExecuteFn } from '../utils/module-factory.js';
|
|
4
|
+
import type { ApToolDefinition, ApToolsetOptions } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Identity helper that gives a tool literal full type inference and a single
|
|
7
|
+
* obvious place to look for the shape.
|
|
8
|
+
*
|
|
9
|
+
* This is the Hono counterpart to NestJS's `@ApTool` decorator: Hono has no
|
|
10
|
+
* classes or DI container to decorate, so a tool is a plain object carrying
|
|
11
|
+
* its own metadata and handler.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const listTodos = defineTool({
|
|
16
|
+
* namespace: 'todo',
|
|
17
|
+
* name: 'list',
|
|
18
|
+
* description: 'List all todos',
|
|
19
|
+
* inputSchema: Type.Object({ done: Type.Optional(Type.Boolean()) }),
|
|
20
|
+
* annotations: { readonly: true, idempotent: true },
|
|
21
|
+
* handler: (inputs) => ({ todos: store.filter(...) }),
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function defineTool(definition: ApToolDefinition): ApToolDefinition;
|
|
26
|
+
/**
|
|
27
|
+
* Group several tools under one namespace, applying shared tags and
|
|
28
|
+
* annotations to each.
|
|
29
|
+
*
|
|
30
|
+
* The record key becomes the tool's `name` when the entry does not set one,
|
|
31
|
+
* so `{ list: {...} }` under namespace `todo` yields `todo.list`.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const todoTools = defineToolset({
|
|
36
|
+
* namespace: 'todo',
|
|
37
|
+
* tags: ['todo'],
|
|
38
|
+
* tools: {
|
|
39
|
+
* list: { description: 'List todos', handler: list },
|
|
40
|
+
* create: { description: 'Add a todo', handler: create },
|
|
41
|
+
* },
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function defineToolset(options: ApToolsetOptions): ApToolDefinition[];
|
|
46
|
+
/** Resolve the module ID a tool definition will be registered under. */
|
|
47
|
+
export declare function resolveToolId(tool: ApToolDefinition, modulePrefix?: string): string;
|
|
48
|
+
/** Options for {@link toolToScannedModule}. */
|
|
49
|
+
export interface ToolConversionOptions {
|
|
50
|
+
/** Prefix prepended to the generated module ID. */
|
|
51
|
+
modulePrefix?: string;
|
|
52
|
+
/** Extractor used for `inputSchema` / `outputSchema`. */
|
|
53
|
+
schemaExtractor?: SchemaExtractor;
|
|
54
|
+
/** Extra tags merged into the tool's own tags. */
|
|
55
|
+
tags?: string[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Convert a {@link ApToolDefinition} into the toolkit's `ScannedModule`
|
|
59
|
+
* intermediate plus the bound execute function the registry needs.
|
|
60
|
+
*
|
|
61
|
+
* Schemas are normalised to JSON Schema, and JSDoc on the handler fills in
|
|
62
|
+
* missing documentation and per-parameter descriptions.
|
|
63
|
+
*/
|
|
64
|
+
export declare function toolToScannedModule(tool: ApToolDefinition, options?: ToolConversionOptions): {
|
|
65
|
+
module: ScannedModule;
|
|
66
|
+
execute: BoundExecuteFn;
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=define-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-tool.d.ts","sourceRoot":"","sources":["../../src/tools/define-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,eAAe,EAA0B,MAAM,+BAA+B,CAAC;AAOxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,gBAAgB,GAAG,gBAAgB,CAEzE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAW3E;AAED,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,IAAI,EAAE,gBAAgB,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAwBnF;AAED,+CAA+C;AAC/C,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAiBD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,gBAAgB,EACtB,OAAO,GAAE,qBAA0B,GAClC;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,CAkCpD"}
|