hono-apcore 0.1.0 → 0.3.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 +60 -13
- package/dist/a2a/apcore-a2a.service.d.ts.map +1 -1
- package/dist/a2a/apcore-a2a.service.js +3 -0
- package/dist/a2a/apcore-a2a.service.js.map +1 -1
- package/dist/bridge/binding-loader.d.ts.map +1 -1
- package/dist/bridge/binding-loader.js +14 -16
- package/dist/bridge/binding-loader.js.map +1 -1
- package/dist/cli/apcore-cli.service.d.ts +4 -1
- package/dist/cli/apcore-cli.service.d.ts.map +1 -1
- package/dist/cli/apcore-cli.service.js +102 -2
- package/dist/cli/apcore-cli.service.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -1
- package/dist/cli.js.map +1 -1
- package/dist/core/apcore.d.ts +15 -48
- package/dist/core/apcore.d.ts.map +1 -1
- package/dist/core/apcore.js +29 -97
- package/dist/core/apcore.js.map +1 -1
- package/dist/core/apcore.node.d.ts +65 -0
- package/dist/core/apcore.node.d.ts.map +1 -0
- package/dist/core/apcore.node.js +120 -0
- package/dist/core/apcore.node.js.map +1 -0
- package/dist/core/executor.d.ts +10 -2
- package/dist/core/executor.d.ts.map +1 -1
- package/dist/core/executor.js +26 -1
- package/dist/core/executor.js.map +1 -1
- package/dist/core/middleware.d.ts +2 -2
- package/dist/core/middleware.d.ts.map +1 -1
- package/dist/core/middleware.js.map +1 -1
- package/dist/core/registry.d.ts +1 -1
- package/dist/core/registry.d.ts.map +1 -1
- package/dist/core/registry.js +4 -1
- package/dist/core/registry.js.map +1 -1
- package/dist/edge.d.ts +25 -0
- package/dist/edge.d.ts.map +1 -0
- package/dist/edge.js +54 -0
- package/dist/edge.js.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/apcore-mcp.service.d.ts.map +1 -1
- package/dist/mcp/apcore-mcp.service.js +3 -1
- package/dist/mcp/apcore-mcp.service.js.map +1 -1
- package/dist/output/yaml-writer.d.ts +7 -1
- package/dist/output/yaml-writer.d.ts.map +1 -1
- package/dist/output/yaml-writer.js +17 -4
- package/dist/output/yaml-writer.js.map +1 -1
- package/dist/scanners/hono-route-scanner.d.ts +2 -2
- package/dist/scanners/hono-route-scanner.d.ts.map +1 -1
- package/dist/scanners/hono-route-scanner.js +48 -6
- package/dist/scanners/hono-route-scanner.js.map +1 -1
- package/dist/tools/define-tool.d.ts +1 -1
- package/dist/tools/define-tool.d.ts.map +1 -1
- package/dist/tools/define-tool.js +4 -1
- package/dist/tools/define-tool.js.map +1 -1
- package/dist/types.d.ts +38 -21
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/module-factory.d.ts.map +1 -1
- package/dist/utils/module-factory.js +53 -3
- package/dist/utils/module-factory.js.map +1 -1
- package/package.json +45 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apcore.d.ts","sourceRoot":"","sources":["../../src/core/apcore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"apcore.d.ts","sourceRoot":"","sources":["../../src/core/apcore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EACjB,MAA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;IA0BrB;;;;OAIG;cACa,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAEvD;;;;OAIG;cACa,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,qBAA0B,GAAG,UAAU,CAE5E"}
|
package/dist/core/apcore.js
CHANGED
|
@@ -1,35 +1,26 @@
|
|
|
1
1
|
import { Executor, Registry } from 'apcore-js';
|
|
2
2
|
import { ApcoreRegistry } from './registry.js';
|
|
3
3
|
import { ApcoreExecutor } from './executor.js';
|
|
4
|
-
import { ApcoreMcpService } from '../mcp/apcore-mcp.service.js';
|
|
5
|
-
import { ApcoreCliService } from '../cli/apcore-cli.service.js';
|
|
6
|
-
import { ApcoreA2aService } from '../a2a/apcore-a2a.service.js';
|
|
7
4
|
import { HonoContextFactory } from '../context/hono-context.factory.js';
|
|
8
5
|
import { HonoRouteScanner } from '../scanners/hono-route-scanner.js';
|
|
9
|
-
import {
|
|
10
|
-
import { mountMcp as mountMcpEndpoint } from '../mcp/mount.js';
|
|
11
|
-
import { loadSettings, toMcpTransport } from '../config.js';
|
|
6
|
+
import { loadSettings } from '../config.js';
|
|
12
7
|
/**
|
|
13
|
-
*
|
|
8
|
+
* Core entry point for wiring apcore into a Hono app.
|
|
14
9
|
*
|
|
15
10
|
* Owns the apcore `Registry` and `Executor`, the tool/route registration
|
|
16
|
-
* surface, and
|
|
17
|
-
*
|
|
11
|
+
* surface, and route scanning. This is the implementation behind both package
|
|
12
|
+
* entries: the Node subclass adds MCP, CLI, A2A, and YAML bindings, while the
|
|
13
|
+
* edge entry exposes this class directly.
|
|
18
14
|
*
|
|
19
15
|
* @example
|
|
20
16
|
* ```ts
|
|
21
|
-
* const ap = createApcore({
|
|
22
|
-
* tools: [listTodos, addTodo],
|
|
23
|
-
* mcp: { explorer: true, allowExecute: true },
|
|
24
|
-
* });
|
|
17
|
+
* const ap = createApcore({ tools: [listTodos, addTodo] });
|
|
25
18
|
*
|
|
26
19
|
* app.use('*', apcore(ap));
|
|
27
20
|
* await ap.init(app); // register tools, scan routes
|
|
28
|
-
* await ap.mountMcp(app); // serve MCP on the same port
|
|
29
21
|
* ```
|
|
30
22
|
*/
|
|
31
23
|
export class HonoApcore {
|
|
32
|
-
options;
|
|
33
24
|
/** Canonical `APCORE_*` settings, environment merged with `options.settings`. */
|
|
34
25
|
settings;
|
|
35
26
|
/** Registry wrapper — register and inspect modules. */
|
|
@@ -38,39 +29,30 @@ export class HonoApcore {
|
|
|
38
29
|
executor;
|
|
39
30
|
/** Builds per-request apcore `Context` objects from Hono requests. */
|
|
40
31
|
contextFactory;
|
|
41
|
-
|
|
42
|
-
_cli;
|
|
43
|
-
_a2a;
|
|
32
|
+
options;
|
|
44
33
|
scanner = new HonoRouteScanner();
|
|
45
34
|
initPromise = null;
|
|
46
35
|
constructor(options = {}) {
|
|
47
36
|
this.options = options;
|
|
48
37
|
this.settings = loadSettings(undefined, options.settings);
|
|
49
|
-
const registry = new Registry({
|
|
50
|
-
|
|
38
|
+
const registry = new Registry({
|
|
39
|
+
config: options.config,
|
|
40
|
+
extensionsDir: options.extensionsDir ?? null,
|
|
41
|
+
});
|
|
42
|
+
const executorOptions = {
|
|
43
|
+
...options.executorOptions,
|
|
51
44
|
registry,
|
|
45
|
+
config: options.config,
|
|
52
46
|
acl: options.acl ?? null,
|
|
53
47
|
middlewares: options.middleware ?? null,
|
|
54
|
-
}
|
|
48
|
+
};
|
|
49
|
+
const executor = new Executor(executorOptions);
|
|
55
50
|
this.registry = new ApcoreRegistry(registry);
|
|
56
|
-
this.executor = new ApcoreExecutor(executor);
|
|
51
|
+
this.executor = new ApcoreExecutor(executor, executorOptions);
|
|
57
52
|
this.contextFactory = new HonoContextFactory();
|
|
58
|
-
this._mcp = options.mcp
|
|
59
|
-
? new ApcoreMcpService(this.registry, this.executor, {
|
|
60
|
-
...options.mcp,
|
|
61
|
-
// The APCORE_* settings supply the defaults; explicit config wins.
|
|
62
|
-
transport: options.mcp.transport ?? toMcpTransport(this.settings.transport),
|
|
63
|
-
host: options.mcp.host ?? this.settings.host,
|
|
64
|
-
port: options.mcp.port ?? this.settings.port,
|
|
65
|
-
})
|
|
66
|
-
: null;
|
|
67
|
-
this._cli = options.cli ? new ApcoreCliService(this.registry, options.cli) : null;
|
|
68
|
-
this._a2a = options.a2a
|
|
69
|
-
? new ApcoreA2aService(this.registry, this.executor, options.a2a)
|
|
70
|
-
: null;
|
|
71
53
|
}
|
|
72
54
|
// -------------------------------------------------------------------------
|
|
73
|
-
//
|
|
55
|
+
// Options
|
|
74
56
|
// -------------------------------------------------------------------------
|
|
75
57
|
/**
|
|
76
58
|
* The route-scan options this instance would use: the `APCORE_*` settings
|
|
@@ -82,18 +64,6 @@ export class HonoApcore {
|
|
|
82
64
|
get routeOptions() {
|
|
83
65
|
return this.mergeRouteOptions();
|
|
84
66
|
}
|
|
85
|
-
/** The MCP service, or `null` when `options.mcp` was omitted. */
|
|
86
|
-
get mcp() {
|
|
87
|
-
return this._mcp;
|
|
88
|
-
}
|
|
89
|
-
/** The CLI service, or `null` when `options.cli` was omitted. */
|
|
90
|
-
get cli() {
|
|
91
|
-
return this._cli;
|
|
92
|
-
}
|
|
93
|
-
/** The A2A service, or `null` when `options.a2a` was omitted. */
|
|
94
|
-
get a2a() {
|
|
95
|
-
return this._a2a;
|
|
96
|
-
}
|
|
97
67
|
// -------------------------------------------------------------------------
|
|
98
68
|
// Registration
|
|
99
69
|
// -------------------------------------------------------------------------
|
|
@@ -141,18 +111,6 @@ export class HonoApcore {
|
|
|
141
111
|
}
|
|
142
112
|
return ids;
|
|
143
113
|
}
|
|
144
|
-
/**
|
|
145
|
-
* Load a YAML bindings file and register its entries.
|
|
146
|
-
*
|
|
147
|
-
* @param filePath - Path to the YAML file. Defaults to `options.bindings`.
|
|
148
|
-
* @param resolveTarget - Resolves each entry's `target` to a live handler.
|
|
149
|
-
*/
|
|
150
|
-
async loadBindings(filePath, resolveTarget) {
|
|
151
|
-
const path = filePath ?? this.options.bindings;
|
|
152
|
-
if (!path)
|
|
153
|
-
return [];
|
|
154
|
-
return new ApBindingLoader(this.registry, resolveTarget).loadFromFile(path);
|
|
155
|
-
}
|
|
156
114
|
// -------------------------------------------------------------------------
|
|
157
115
|
// Lifecycle
|
|
158
116
|
// -------------------------------------------------------------------------
|
|
@@ -190,60 +148,34 @@ export class HonoApcore {
|
|
|
190
148
|
async runInit(app, routeOptions) {
|
|
191
149
|
if (!this.settings.enabled)
|
|
192
150
|
return;
|
|
193
|
-
if (this.options.extensionsDir
|
|
151
|
+
if (this.options.extensionsDir ||
|
|
152
|
+
this.options.config?.getDeclared('extensions.root') !== undefined ||
|
|
153
|
+
this.options.config?.getDeclared('extensions.roots') !== undefined) {
|
|
194
154
|
await this.registry.discover();
|
|
195
155
|
}
|
|
196
156
|
if (this.options.tools?.length) {
|
|
197
157
|
await this.registerTools(this.options.tools);
|
|
198
158
|
}
|
|
199
|
-
|
|
200
|
-
await this.loadBindings();
|
|
201
|
-
}
|
|
159
|
+
await this.loadConfiguredBindings();
|
|
202
160
|
if (app) {
|
|
203
161
|
await this.scanRoutes(app, routeOptions);
|
|
204
162
|
}
|
|
205
163
|
// Surfaces start last, so every module is registered before a client can
|
|
206
164
|
// list the tools.
|
|
207
|
-
|
|
208
|
-
await this._a2a.start();
|
|
209
|
-
}
|
|
210
|
-
if (this._mcp && this.options.mcp?.transport) {
|
|
211
|
-
await this._mcp.start();
|
|
212
|
-
}
|
|
165
|
+
await this.startSurfaces();
|
|
213
166
|
}
|
|
214
167
|
/**
|
|
215
|
-
*
|
|
216
|
-
* MCP. Node runtime only — see {@link mountMcp}.
|
|
168
|
+
* Register file-backed bindings before routes are scanned.
|
|
217
169
|
*
|
|
218
|
-
*
|
|
170
|
+
* The core entry leaves this empty; the Node entry loads YAML from disk.
|
|
219
171
|
*/
|
|
220
|
-
async
|
|
221
|
-
if (!this._mcp) {
|
|
222
|
-
throw new Error('mountMcp() requires the MCP surface. Pass an `mcp` block to createApcore().');
|
|
223
|
-
}
|
|
224
|
-
return mountMcpEndpoint(app, this._mcp, {
|
|
225
|
-
explorer: this.options.mcp?.explorer,
|
|
226
|
-
explorerPrefix: this.options.mcp?.explorerPrefix,
|
|
227
|
-
allowExecute: this.options.mcp?.allowExecute,
|
|
228
|
-
...options,
|
|
229
|
-
});
|
|
230
|
-
}
|
|
172
|
+
async loadConfiguredBindings() { }
|
|
231
173
|
/**
|
|
232
|
-
*
|
|
174
|
+
* Start configured standalone surfaces after every module is registered.
|
|
233
175
|
*
|
|
234
|
-
*
|
|
176
|
+
* The core entry leaves this empty; the Node entry starts MCP, CLI, and A2A.
|
|
235
177
|
*/
|
|
236
|
-
async
|
|
237
|
-
if (!this._mcp) {
|
|
238
|
-
throw new Error('toOpenaiTools() requires the MCP surface. Pass an `mcp` block to createApcore().');
|
|
239
|
-
}
|
|
240
|
-
return this._mcp.toOpenaiTools(options);
|
|
241
|
-
}
|
|
242
|
-
/** Shut down the MCP and A2A surfaces. */
|
|
243
|
-
async close() {
|
|
244
|
-
await this._mcp?.stop();
|
|
245
|
-
this._a2a?.stop();
|
|
246
|
-
}
|
|
178
|
+
async startSurfaces() { }
|
|
247
179
|
}
|
|
248
180
|
/**
|
|
249
181
|
* Create a {@link HonoApcore} instance.
|
package/dist/core/apcore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apcore.js","sourceRoot":"","sources":["../../src/core/apcore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"apcore.js","sourceRoot":"","sources":["../../src/core/apcore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,Q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;QACtE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,OAAO;QAEnC,IACE,IAAI,CAAC,OAAO,CAAC,aAAa;YAC1B,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAK,SAAS;YACjE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,kBAAkB,CAAC,KAAK,SAAS,EAClE,CAAC;YACD,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACjC,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;YAC/B,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC;QAED,MAAM,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAEpC,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;QAC3C,CAAC;QAED,yEAAyE;QACzE,kBAAkB;QAClB,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,sBAAsB,KAAmB,CAAC;IAE1D;;;;OAIG;IACO,KAAK,CAAC,aAAa,KAAmB,CAAC;CAClD;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,UAAiC,EAAE;IAC9D,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { HonoApcore as HonoApcoreCore } from './apcore.js';
|
|
2
|
+
import { ApcoreMcpService } from '../mcp/apcore-mcp.service.js';
|
|
3
|
+
import { ApcoreCliService } from '../cli/apcore-cli.service.js';
|
|
4
|
+
import { ApcoreA2aService } from '../a2a/apcore-a2a.service.js';
|
|
5
|
+
import type { TargetResolver } from '../bridge/binding-loader.js';
|
|
6
|
+
import type { MountableApp } from '../mcp/mount.js';
|
|
7
|
+
import type { McpApp } from '../mcp/apcore-mcp.service.js';
|
|
8
|
+
import type { HonoApcoreOptions, MountMcpOptions } from '../types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Node entry for {@link HonoApcore}.
|
|
11
|
+
*
|
|
12
|
+
* Adds the optional MCP, CLI, and A2A surfaces plus YAML bindings loaded from
|
|
13
|
+
* disk. The edge entry exposes the same core behaviour without these
|
|
14
|
+
* Node-only dependencies.
|
|
15
|
+
*/
|
|
16
|
+
export declare class HonoApcore extends HonoApcoreCore {
|
|
17
|
+
private readonly _mcp;
|
|
18
|
+
private readonly _cli;
|
|
19
|
+
private readonly _a2a;
|
|
20
|
+
constructor(options?: HonoApcoreOptions);
|
|
21
|
+
private get nodeOptions();
|
|
22
|
+
/** The MCP service, or `null` when `options.mcp` was omitted. */
|
|
23
|
+
get mcp(): ApcoreMcpService | null;
|
|
24
|
+
/** The CLI service, or `null` when `options.cli` was omitted. */
|
|
25
|
+
get cli(): ApcoreCliService | null;
|
|
26
|
+
/** The A2A service, or `null` when `options.a2a` was omitted. */
|
|
27
|
+
get a2a(): ApcoreA2aService | null;
|
|
28
|
+
/**
|
|
29
|
+
* Load a YAML bindings file and register its entries.
|
|
30
|
+
*
|
|
31
|
+
* @param filePath - Path to the YAML file. Defaults to `options.bindings`.
|
|
32
|
+
* @param resolveTarget - Resolves each entry's `target` to a live handler.
|
|
33
|
+
*/
|
|
34
|
+
loadBindings(filePath?: string, resolveTarget?: TargetResolver): Promise<string[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Mount the MCP endpoint into the Hono app so one port serves both HTTP and
|
|
37
|
+
* MCP. Node runtime only — see {@link mountMcpEndpoint}.
|
|
38
|
+
*
|
|
39
|
+
* @throws {Error} When the instance was created without `options.mcp`.
|
|
40
|
+
*/
|
|
41
|
+
mountMcp(app: MountableApp, options?: MountMcpOptions): Promise<McpApp>;
|
|
42
|
+
/**
|
|
43
|
+
* Convert the registered modules to OpenAI-compatible tool definitions.
|
|
44
|
+
*
|
|
45
|
+
* @throws {Error} When the instance was created without `options.mcp`.
|
|
46
|
+
*/
|
|
47
|
+
toOpenaiTools(options?: {
|
|
48
|
+
embedAnnotations?: boolean;
|
|
49
|
+
strict?: boolean;
|
|
50
|
+
tags?: string[];
|
|
51
|
+
prefix?: string;
|
|
52
|
+
}): Promise<unknown[]>;
|
|
53
|
+
/** Shut down the MCP and A2A surfaces. */
|
|
54
|
+
close(): Promise<void>;
|
|
55
|
+
protected loadConfiguredBindings(): Promise<void>;
|
|
56
|
+
protected startSurfaces(): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Create a Node {@link HonoApcore} instance.
|
|
60
|
+
*
|
|
61
|
+
* Sugar for `new HonoApcore(options)`, matching the `createX()` style the
|
|
62
|
+
* Hono ecosystem uses.
|
|
63
|
+
*/
|
|
64
|
+
export declare function createApcore(options?: HonoApcoreOptions): HonoApcore;
|
|
65
|
+
//# sourceMappingURL=apcore.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore.node.d.ts","sourceRoot":"","sources":["../../src/core/apcore.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE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2
|
+
import { ApcoreMcpService } from '../mcp/apcore-mcp.service.js';
|
|
3
|
+
import { ApcoreCliService } from '../cli/apcore-cli.service.js';
|
|
4
|
+
import { ApcoreA2aService } from '../a2a/apcore-a2a.service.js';
|
|
5
|
+
import { ApBindingLoader } from '../bridge/binding-loader.js';
|
|
6
|
+
import { mountMcp as mountMcpEndpoint } from '../mcp/mount.js';
|
|
7
|
+
import { toMcpTransport } from '../config.js';
|
|
8
|
+
/**
|
|
9
|
+
* Node entry for {@link HonoApcore}.
|
|
10
|
+
*
|
|
11
|
+
* Adds the optional MCP, CLI, and A2A surfaces plus YAML bindings loaded from
|
|
12
|
+
* disk. The edge entry exposes the same core behaviour without these
|
|
13
|
+
* Node-only dependencies.
|
|
14
|
+
*/
|
|
15
|
+
export class HonoApcore extends HonoApcoreCore {
|
|
16
|
+
_mcp;
|
|
17
|
+
_cli;
|
|
18
|
+
_a2a;
|
|
19
|
+
constructor(options = {}) {
|
|
20
|
+
super(options);
|
|
21
|
+
this._mcp = options.mcp
|
|
22
|
+
? new ApcoreMcpService(this.registry, this.executor, {
|
|
23
|
+
...options.mcp,
|
|
24
|
+
// The APCORE_* settings supply the defaults; explicit config wins.
|
|
25
|
+
transport: options.mcp.transport ?? toMcpTransport(this.settings.transport),
|
|
26
|
+
host: options.mcp.host ?? this.settings.host,
|
|
27
|
+
port: options.mcp.port ?? this.settings.port,
|
|
28
|
+
})
|
|
29
|
+
: null;
|
|
30
|
+
this._cli = options.cli
|
|
31
|
+
? new ApcoreCliService(this.registry, options.cli, this.executor)
|
|
32
|
+
: null;
|
|
33
|
+
this._a2a = options.a2a
|
|
34
|
+
? new ApcoreA2aService(this.registry, this.executor, options.a2a)
|
|
35
|
+
: null;
|
|
36
|
+
}
|
|
37
|
+
get nodeOptions() {
|
|
38
|
+
return this.options;
|
|
39
|
+
}
|
|
40
|
+
/** The MCP service, or `null` when `options.mcp` was omitted. */
|
|
41
|
+
get mcp() {
|
|
42
|
+
return this._mcp;
|
|
43
|
+
}
|
|
44
|
+
/** The CLI service, or `null` when `options.cli` was omitted. */
|
|
45
|
+
get cli() {
|
|
46
|
+
return this._cli;
|
|
47
|
+
}
|
|
48
|
+
/** The A2A service, or `null` when `options.a2a` was omitted. */
|
|
49
|
+
get a2a() {
|
|
50
|
+
return this._a2a;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Load a YAML bindings file and register its entries.
|
|
54
|
+
*
|
|
55
|
+
* @param filePath - Path to the YAML file. Defaults to `options.bindings`.
|
|
56
|
+
* @param resolveTarget - Resolves each entry's `target` to a live handler.
|
|
57
|
+
*/
|
|
58
|
+
async loadBindings(filePath, resolveTarget) {
|
|
59
|
+
const path = filePath ?? this.nodeOptions.bindings;
|
|
60
|
+
if (!path)
|
|
61
|
+
return [];
|
|
62
|
+
return new ApBindingLoader(this.registry, resolveTarget).loadFromFile(path);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Mount the MCP endpoint into the Hono app so one port serves both HTTP and
|
|
66
|
+
* MCP. Node runtime only — see {@link mountMcpEndpoint}.
|
|
67
|
+
*
|
|
68
|
+
* @throws {Error} When the instance was created without `options.mcp`.
|
|
69
|
+
*/
|
|
70
|
+
async mountMcp(app, options = {}) {
|
|
71
|
+
if (!this._mcp) {
|
|
72
|
+
throw new Error('mountMcp() requires the MCP surface. Pass an `mcp` block to createApcore().');
|
|
73
|
+
}
|
|
74
|
+
return mountMcpEndpoint(app, this._mcp, {
|
|
75
|
+
explorer: this.nodeOptions.mcp?.explorer,
|
|
76
|
+
explorerPrefix: this.nodeOptions.mcp?.explorerPrefix,
|
|
77
|
+
allowExecute: this.nodeOptions.mcp?.allowExecute,
|
|
78
|
+
...options,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Convert the registered modules to OpenAI-compatible tool definitions.
|
|
83
|
+
*
|
|
84
|
+
* @throws {Error} When the instance was created without `options.mcp`.
|
|
85
|
+
*/
|
|
86
|
+
async toOpenaiTools(options) {
|
|
87
|
+
if (!this._mcp) {
|
|
88
|
+
throw new Error('toOpenaiTools() requires the MCP surface. Pass an `mcp` block to createApcore().');
|
|
89
|
+
}
|
|
90
|
+
return this._mcp.toOpenaiTools(options);
|
|
91
|
+
}
|
|
92
|
+
/** Shut down the MCP and A2A surfaces. */
|
|
93
|
+
async close() {
|
|
94
|
+
await this._mcp?.stop();
|
|
95
|
+
this._a2a?.stop();
|
|
96
|
+
}
|
|
97
|
+
async loadConfiguredBindings() {
|
|
98
|
+
if (this.nodeOptions.bindings) {
|
|
99
|
+
await this.loadBindings();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
async startSurfaces() {
|
|
103
|
+
if (this._a2a && this.nodeOptions.a2a?.port !== undefined) {
|
|
104
|
+
await this._a2a.start();
|
|
105
|
+
}
|
|
106
|
+
if (this._mcp && this.nodeOptions.mcp?.transport) {
|
|
107
|
+
await this._mcp.start();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Create a Node {@link HonoApcore} instance.
|
|
113
|
+
*
|
|
114
|
+
* Sugar for `new HonoApcore(options)`, matching the `createX()` style the
|
|
115
|
+
* Hono ecosystem uses.
|
|
116
|
+
*/
|
|
117
|
+
export function createApcore(options = {}) {
|
|
118
|
+
return new HonoApcore(options);
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=apcore.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore.node.js","sourceRoot":"","sources":["../../src/core/apcore.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAA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;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,0CAA0C;IAC1C,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;IACpB,CAAC;IAEkB,KAAK,CAAC,sBAAsB;QAC7C,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;YAC9B,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;IAEkB,KAAK,CAAC,aAAa;QACpC,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;YAC1D,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1B,CAAC;QAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC;YACjD,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,UAA6B,EAAE;IAC1D,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/core/executor.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Executor } from 'apcore-js';
|
|
2
|
+
import type { Context, ExecutionStrategy, PreflightResult, StepMiddleware } from 'apcore-js';
|
|
2
3
|
/**
|
|
3
4
|
* Thin wrapper around the upstream apcore-js `Executor`.
|
|
4
5
|
*
|
|
@@ -7,9 +8,16 @@ import type { Context, Executor, PreflightResult } from 'apcore-js';
|
|
|
7
8
|
*/
|
|
8
9
|
export declare class ApcoreExecutor {
|
|
9
10
|
private readonly executor;
|
|
10
|
-
|
|
11
|
+
private readonly executorOptions?;
|
|
12
|
+
constructor(executor: Executor, executorOptions?: Omit<ConstructorParameters<typeof Executor>[0], "strategy"> | undefined);
|
|
11
13
|
/** The underlying apcore-js `Executor`. */
|
|
12
14
|
get raw(): Executor;
|
|
15
|
+
/** Observe pipeline steps using the SDK's step middleware hooks. */
|
|
16
|
+
addStepMiddleware(middleware: StepMiddleware): this;
|
|
17
|
+
/** Execute with an SDK pipeline trace, optionally selecting a per-call strategy. */
|
|
18
|
+
callWithTrace(moduleId: string, inputs?: Record<string, unknown> | null, context?: Context | null, options?: {
|
|
19
|
+
strategy?: ExecutionStrategy | string | null;
|
|
20
|
+
} | null): ReturnType<Executor['callWithTrace']>;
|
|
13
21
|
/**
|
|
14
22
|
* Execute a module by ID.
|
|
15
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/core/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/core/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE7F;;;;;GAKG;AACH,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;gBADhB,QAAQ,EAAE,QAAQ,EAClB,eAAe,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,YAAA;IAGhG,2CAA2C;IAC3C,IAAI,GAAG,IAAI,QAAQ,CAElB;IAED,oEAAoE;IACpE,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;IAKnD,oFAAoF;IACpF,aAAa,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACvC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,EACxB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,GAChE,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IAiBxC;;;;;;OAMG;IACG,IAAI,CACR,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACvC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,GACvB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAInC;;;OAGG;IACI,MAAM,CACX,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACvC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,GACvB,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAI1C;;;OAGG;IACH,QAAQ,CACN,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACvC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,GACvB,OAAO,CAAC,eAAe,CAAC;CAG5B"}
|
package/dist/core/executor.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Executor } from 'apcore-js';
|
|
1
2
|
/**
|
|
2
3
|
* Thin wrapper around the upstream apcore-js `Executor`.
|
|
3
4
|
*
|
|
@@ -6,13 +7,37 @@
|
|
|
6
7
|
*/
|
|
7
8
|
export class ApcoreExecutor {
|
|
8
9
|
executor;
|
|
9
|
-
|
|
10
|
+
executorOptions;
|
|
11
|
+
constructor(executor, executorOptions) {
|
|
10
12
|
this.executor = executor;
|
|
13
|
+
this.executorOptions = executorOptions;
|
|
11
14
|
}
|
|
12
15
|
/** The underlying apcore-js `Executor`. */
|
|
13
16
|
get raw() {
|
|
14
17
|
return this.executor;
|
|
15
18
|
}
|
|
19
|
+
/** Observe pipeline steps using the SDK's step middleware hooks. */
|
|
20
|
+
addStepMiddleware(middleware) {
|
|
21
|
+
this.executor.addStepMiddleware(middleware);
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
/** Execute with an SDK pipeline trace, optionally selecting a per-call strategy. */
|
|
25
|
+
callWithTrace(moduleId, inputs, context, options) {
|
|
26
|
+
const strategy = typeof options?.strategy === 'string'
|
|
27
|
+
? new Executor({
|
|
28
|
+
...this.executorOptions,
|
|
29
|
+
registry: this.executor.registry,
|
|
30
|
+
middlewares: this.executor.middlewares,
|
|
31
|
+
// The running executor binds its current providers to these gates.
|
|
32
|
+
// Seeding startup providers here would revive a cleared policy.
|
|
33
|
+
acl: null,
|
|
34
|
+
approvalHandler: null,
|
|
35
|
+
policy: null,
|
|
36
|
+
strategy: options.strategy,
|
|
37
|
+
}).currentStrategy
|
|
38
|
+
: options?.strategy;
|
|
39
|
+
return this.executor.callWithTrace(moduleId, inputs ?? {}, context, { strategy });
|
|
40
|
+
}
|
|
16
41
|
/**
|
|
17
42
|
* Execute a module by ID.
|
|
18
43
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/core/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/core/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC;;;;;GAKG;AACH,MAAM,OAAO,cAAc;IAEN;IACA;IAFnB,YACmB,QAAkB,EAClB,eAA6E;QAD7E,aAAQ,G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B;QAExB,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACH,QAAQ,CACN,QAAgB,EAChB,MAAuC,EACvC,OAAwB;QAExB,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;CACF"}
|
|
@@ -2,7 +2,7 @@ import type { Context as HonoContext, MiddlewareHandler } from 'hono';
|
|
|
2
2
|
import type { Context as ApcoreContext } from 'apcore-js';
|
|
3
3
|
import { HonoContextFactory } from '../context/hono-context.factory.js';
|
|
4
4
|
import type { HonoApcore } from './apcore.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { HonoApcoreCoreOptions } from '../types.js';
|
|
6
6
|
declare module 'hono' {
|
|
7
7
|
interface ContextVariableMap {
|
|
8
8
|
/** The {@link HonoApcore} instance installed by the `apcore()` middleware. */
|
|
@@ -45,7 +45,7 @@ export interface ApcoreMiddlewareOptions {
|
|
|
45
45
|
* instance when you need to register tools or mount MCP.
|
|
46
46
|
*/
|
|
47
47
|
export declare function apcore(instance: HonoApcore, options?: ApcoreMiddlewareOptions): MiddlewareHandler;
|
|
48
|
-
export declare function apcore(options?:
|
|
48
|
+
export declare function apcore(options?: HonoApcoreCoreOptions & ApcoreMiddlewareOptions): MiddlewareHandler;
|
|
49
49
|
/**
|
|
50
50
|
* Read the {@link HonoApcore} instance the `apcore()` middleware installed.
|
|
51
51
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/core/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,WAAW,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,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a,CAQ9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/core/middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAsDxE,MAAM,UAAU,MAAM,CACpB,
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/core/middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAsDxE,MAAM,UAAU,MAAM,CACpB,iBAAkF,EAClF,YAAsC;IAEtC,wEAAwE;IACxE,8DAA8D;IAC9D,MAAM,UAAU,GACd,iBAAiB,KAAK,SAAS;QAC/B,OAAQ,iBAAgC,CAAC,YAAY,KAAK,UAAU,CAAC;IAEvE,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAE,iBAAgC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5E,MAAM,OAAO,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAEjD,CAAC;IAEd,IAAI,QAAQ,GAA2B,QAAQ,CAAC;IAChD,MAAM,cAAc,GAAG,OAAO,EAAE,cAAc,IAAI,IAAI,kBAAkB,EAAE,CAAC;IAC3E,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,KAAK,CAAC;IAElD,OAAO,KAAK,UAAU,gBAAgB,CAAC,CAAC,EAAE,IAAI;QAC5C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;YACzD,QAAQ,GAAG,IAAI,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YACnC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;QAED,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;QAEvB,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAC5B,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,CAAC,CAAC,GAAG,CAAC,kBAAkB,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,CAAC;QAED,MAAM,IAAI,EAAE,CAAC;IACf,CAAC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,CAAc;IACtC,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACnC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CACb,4FAA4F,CAC7F,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAc;IAC7C,MAAM,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/core/registry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModuleDescriptor, Registry } from 'apcore-js';
|
|
2
|
-
import type { ScannedModule } from 'apcore-toolkit';
|
|
2
|
+
import type { ScannedModule } from 'apcore-toolkit/browser';
|
|
3
3
|
import type { ApToolDefinition, RegisterMethodOptions, RegisterObjectOptions } from '../types.js';
|
|
4
4
|
import type { BoundExecuteFn } from '../utils/module-factory.js';
|
|
5
5
|
import type { ToolConversionOptions } from '../tools/define-tool.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/core/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/core/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAQrB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AA+BrE;;;;;;GAMG;AACH,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,QAAQ;IAM/C,2CAA2C;IAC3C,IAAI,GAAG,IAAI,QAAQ,CAElB;IAMK,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIrC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;IAIrC,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI9B,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,EAAE;IAI9D,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IA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|
1
|
+
import { createScannedModule, moduleToDict, modulesToDicts } from 'apcore-toolkit/browser';
|
|
2
2
|
import { generateModuleId, normalizeName, normalizeMethodName } from '../utils/id-generator.js';
|
|
3
3
|
import { EMPTY_OBJECT_SCHEMA, normalizeResult, scannedModuleToFunctionModule, toModuleAnnotations, } from '../utils/module-factory.js';
|
|
4
4
|
import { toolToScannedModule } from '../tools/define-tool.js';
|
|
@@ -101,6 +101,9 @@ export class ApcoreRegistry {
|
|
|
101
101
|
documentation: def.documentation ?? null,
|
|
102
102
|
examples: (def.examples ?? []),
|
|
103
103
|
metadata: def.metadata ?? {},
|
|
104
|
+
version: def.version,
|
|
105
|
+
display: this.registry.get(moduleId)
|
|
106
|
+
?.display ?? null,
|
|
104
107
|
});
|
|
105
108
|
}
|
|
106
109
|
/**
|