nestjs-apcore 0.3.2 → 0.4.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/dist/a2a/apcore-a2a.module.d.ts +19 -0
- package/dist/a2a/apcore-a2a.module.d.ts.map +1 -0
- package/dist/a2a/apcore-a2a.module.js +68 -0
- package/dist/a2a/apcore-a2a.module.js.map +1 -0
- package/dist/a2a/apcore-a2a.service.d.ts +58 -0
- package/dist/a2a/apcore-a2a.service.d.ts.map +1 -0
- package/dist/a2a/apcore-a2a.service.js +145 -0
- package/dist/a2a/apcore-a2a.service.js.map +1 -0
- package/dist/cli/apcore-cli.module.d.ts +18 -0
- package/dist/cli/apcore-cli.module.d.ts.map +1 -0
- package/dist/cli/apcore-cli.module.js +62 -0
- package/dist/cli/apcore-cli.module.js.map +1 -0
- package/dist/cli/apcore-cli.service.d.ts +61 -0
- package/dist/cli/apcore-cli.service.d.ts.map +1 -0
- package/dist/cli/apcore-cli.service.js +114 -0
- package/dist/cli/apcore-cli.service.js.map +1 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -1
- package/dist/core/apcore.module.d.ts.map +1 -1
- package/dist/core/apcore.module.js +14 -0
- package/dist/core/apcore.module.js.map +1 -1
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +81 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -5
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import type { ApcoreA2aModuleOptions, ApcoreA2aModuleAsyncOptions } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* NestJS dynamic module for A2A (Agent-to-Agent) server integration.
|
|
5
|
+
*
|
|
6
|
+
* Provides {@link ApcoreA2aService} for serving the registered apcore modules
|
|
7
|
+
* as A2A skills. Supports both a standalone HTTP server (set `port` in options)
|
|
8
|
+
* and an embedded Express app (via `service.asyncServe()`).
|
|
9
|
+
*
|
|
10
|
+
* Requires {@link ApcoreRegistryService} and {@link ApcoreExecutorService} in
|
|
11
|
+
* the injection context (typically via importing `ApcoreModule`).
|
|
12
|
+
*/
|
|
13
|
+
export declare class ApcoreA2aModule {
|
|
14
|
+
/** Synchronous configuration. */
|
|
15
|
+
static forRoot(options?: ApcoreA2aModuleOptions): DynamicModule;
|
|
16
|
+
/** Asynchronous configuration using `useFactory` / `inject`. */
|
|
17
|
+
static forRootAsync(options: ApcoreA2aModuleAsyncOptions): DynamicModule;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=apcore-a2a.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore-a2a.module.d.ts","sourceRoot":"","sources":["../../src/a2a/apcore-a2a.module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,gBAAgB,CAAC;AAKpE,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AAErB;;;;;;;;;GASG;AACH,qBACa,eAAe;IAC1B,iCAAiC;IACjC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,sBAA2B,GAAG,aAAa;IAkBnE,gEAAgE;IAChE,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,2BAA2B,GAAG,aAAa;CA2BzE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var ApcoreA2aModule_1;
|
|
8
|
+
import { Module } from '@nestjs/common';
|
|
9
|
+
import { ApcoreRegistryService } from '../core/apcore-registry.service.js';
|
|
10
|
+
import { ApcoreExecutorService } from '../core/apcore-executor.service.js';
|
|
11
|
+
import { ApcoreA2aService } from './apcore-a2a.service.js';
|
|
12
|
+
import { APCORE_A2A_MODULE_OPTIONS } from '../constants.js';
|
|
13
|
+
/**
|
|
14
|
+
* NestJS dynamic module for A2A (Agent-to-Agent) server integration.
|
|
15
|
+
*
|
|
16
|
+
* Provides {@link ApcoreA2aService} for serving the registered apcore modules
|
|
17
|
+
* as A2A skills. Supports both a standalone HTTP server (set `port` in options)
|
|
18
|
+
* and an embedded Express app (via `service.asyncServe()`).
|
|
19
|
+
*
|
|
20
|
+
* Requires {@link ApcoreRegistryService} and {@link ApcoreExecutorService} in
|
|
21
|
+
* the injection context (typically via importing `ApcoreModule`).
|
|
22
|
+
*/
|
|
23
|
+
let ApcoreA2aModule = ApcoreA2aModule_1 = class ApcoreA2aModule {
|
|
24
|
+
/** Synchronous configuration. */
|
|
25
|
+
static forRoot(options = {}) {
|
|
26
|
+
return {
|
|
27
|
+
module: ApcoreA2aModule_1,
|
|
28
|
+
providers: [
|
|
29
|
+
{ provide: APCORE_A2A_MODULE_OPTIONS, useValue: options },
|
|
30
|
+
{
|
|
31
|
+
provide: ApcoreA2aService,
|
|
32
|
+
useFactory: (registry, executor) => new ApcoreA2aService(registry, executor, options),
|
|
33
|
+
inject: [ApcoreRegistryService, ApcoreExecutorService],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
exports: [ApcoreA2aService, APCORE_A2A_MODULE_OPTIONS],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Asynchronous configuration using `useFactory` / `inject`. */
|
|
40
|
+
static forRootAsync(options) {
|
|
41
|
+
return {
|
|
42
|
+
module: ApcoreA2aModule_1,
|
|
43
|
+
imports: (options.imports ?? []),
|
|
44
|
+
providers: [
|
|
45
|
+
{
|
|
46
|
+
provide: APCORE_A2A_MODULE_OPTIONS,
|
|
47
|
+
useFactory: options.useFactory,
|
|
48
|
+
inject: (options.inject ?? []),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
provide: ApcoreA2aService,
|
|
52
|
+
useFactory: (opts, registry, executor) => new ApcoreA2aService(registry, executor, opts),
|
|
53
|
+
inject: [
|
|
54
|
+
APCORE_A2A_MODULE_OPTIONS,
|
|
55
|
+
ApcoreRegistryService,
|
|
56
|
+
ApcoreExecutorService,
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
exports: [ApcoreA2aService, APCORE_A2A_MODULE_OPTIONS],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
ApcoreA2aModule = ApcoreA2aModule_1 = __decorate([
|
|
65
|
+
Module({})
|
|
66
|
+
], ApcoreA2aModule);
|
|
67
|
+
export { ApcoreA2aModule };
|
|
68
|
+
//# sourceMappingURL=apcore-a2a.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore-a2a.module.js","sourceRoot":"","sources":["../../src/a2a/apcore-a2a.module.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAM5D;;;;;;;;;GASG;AAEI,IAAM,eAAe,uBAArB,MAAM,eAAe;IAC1B,iCAAiC;IACjC,MAAM,CAAC,OA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common';
|
|
2
|
+
import { ApcoreRegistryService } from '../core/apcore-registry.service.js';
|
|
3
|
+
import { ApcoreExecutorService } from '../core/apcore-executor.service.js';
|
|
4
|
+
import type { ApcoreA2aModuleOptions } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* NestJS service that manages the A2A (Agent-to-Agent) server lifecycle.
|
|
7
|
+
*
|
|
8
|
+
* Wraps `serve()` and `asyncServe()` from `apcore-a2a`, integrating them with
|
|
9
|
+
* NestJS lifecycle hooks for automatic startup/shutdown.
|
|
10
|
+
*
|
|
11
|
+
* **Standalone HTTP server** — set `port` in module options. The server starts
|
|
12
|
+
* automatically on `onApplicationBootstrap`.
|
|
13
|
+
*
|
|
14
|
+
* **Embedded Express app** — call `asyncServe()` to get an Express application
|
|
15
|
+
* and mount it in your NestJS HTTP server:
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // In a NestJS bootstrap file:
|
|
20
|
+
* const a2aApp = await a2aService.asyncServe();
|
|
21
|
+
* app.use('/a2a', a2aApp);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class ApcoreA2aService implements OnApplicationBootstrap, OnModuleDestroy {
|
|
25
|
+
private readonly registry;
|
|
26
|
+
private readonly executor;
|
|
27
|
+
private readonly options;
|
|
28
|
+
private _isRunning;
|
|
29
|
+
constructor(registry: ApcoreRegistryService, executor: ApcoreExecutorService, options: ApcoreA2aModuleOptions);
|
|
30
|
+
/** Whether the standalone A2A HTTP server is currently running. */
|
|
31
|
+
get isRunning(): boolean;
|
|
32
|
+
/** Number of skills (modules) exposed to A2A clients. */
|
|
33
|
+
get skillCount(): number;
|
|
34
|
+
/**
|
|
35
|
+
* Start a standalone A2A HTTP server with the configured options.
|
|
36
|
+
*
|
|
37
|
+
* Automatically called on `onApplicationBootstrap` when `port` is set.
|
|
38
|
+
*/
|
|
39
|
+
start(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Build an embeddable Express application without starting a standalone server.
|
|
42
|
+
*
|
|
43
|
+
* Mount the returned app in your NestJS HTTP server or Express middleware chain.
|
|
44
|
+
*/
|
|
45
|
+
asyncServe(overrides?: Partial<ApcoreA2aModuleOptions>): Promise<unknown>;
|
|
46
|
+
/** Stop tracking the running state (the underlying HTTP server manages its own lifecycle). */
|
|
47
|
+
stop(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Auto-starts the standalone A2A server when `port` is configured.
|
|
50
|
+
*
|
|
51
|
+
* Uses `OnApplicationBootstrap` so all modules registered during
|
|
52
|
+
* `onModuleInit` are available before the server starts.
|
|
53
|
+
*/
|
|
54
|
+
onApplicationBootstrap(): void;
|
|
55
|
+
/** Marks the service as stopped on module destruction. */
|
|
56
|
+
onModuleDestroy(): void;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=apcore-a2a.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore-a2a.service.d.ts","sourceRoot":"","sources":["../../src/a2a/apcore-a2a.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBACa,gBAAiB,YAAW,sBAAsB,EAAE,eAAe;IAK5E,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAR1B,OAAO,CAAC,UAAU,CAAS;gBAIR,QAAQ,EAAE,qBAAqB,EAE/B,QAAQ,EAAE,qBAAqB,EAE/B,OAAO,EAAE,sBAAsB;IAOlD,mEAAmE;IACnE,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,yDAAyD;IACzD,IAAI,UAAU,IAAI,MAAM,CAEvB;IAMD;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAwBb;;;;OAIG;IACG,UAAU,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAoB/E,8FAA8F;IAC9F,IAAI,IAAI,IAAI;IAQZ;;;;;OAKG;IACH,sBAAsB,IAAI,IAAI;IAM9B,0DAA0D;IAC1D,eAAe,IAAI,IAAI;CAKxB"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Injectable, Inject } from '@nestjs/common';
|
|
14
|
+
import { serve, asyncServe } from 'apcore-a2a';
|
|
15
|
+
import { ApcoreRegistryService } from '../core/apcore-registry.service.js';
|
|
16
|
+
import { ApcoreExecutorService } from '../core/apcore-executor.service.js';
|
|
17
|
+
import { APCORE_A2A_MODULE_OPTIONS } from '../constants.js';
|
|
18
|
+
/**
|
|
19
|
+
* NestJS service that manages the A2A (Agent-to-Agent) server lifecycle.
|
|
20
|
+
*
|
|
21
|
+
* Wraps `serve()` and `asyncServe()` from `apcore-a2a`, integrating them with
|
|
22
|
+
* NestJS lifecycle hooks for automatic startup/shutdown.
|
|
23
|
+
*
|
|
24
|
+
* **Standalone HTTP server** — set `port` in module options. The server starts
|
|
25
|
+
* automatically on `onApplicationBootstrap`.
|
|
26
|
+
*
|
|
27
|
+
* **Embedded Express app** — call `asyncServe()` to get an Express application
|
|
28
|
+
* and mount it in your NestJS HTTP server:
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* // In a NestJS bootstrap file:
|
|
33
|
+
* const a2aApp = await a2aService.asyncServe();
|
|
34
|
+
* app.use('/a2a', a2aApp);
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
let ApcoreA2aService = class ApcoreA2aService {
|
|
38
|
+
registry;
|
|
39
|
+
executor;
|
|
40
|
+
options;
|
|
41
|
+
_isRunning = false;
|
|
42
|
+
constructor(registry, executor, options) {
|
|
43
|
+
this.registry = registry;
|
|
44
|
+
this.executor = executor;
|
|
45
|
+
this.options = options;
|
|
46
|
+
}
|
|
47
|
+
// -------------------------------------------------------------------------
|
|
48
|
+
// Properties
|
|
49
|
+
// -------------------------------------------------------------------------
|
|
50
|
+
/** Whether the standalone A2A HTTP server is currently running. */
|
|
51
|
+
get isRunning() {
|
|
52
|
+
return this._isRunning;
|
|
53
|
+
}
|
|
54
|
+
/** Number of skills (modules) exposed to A2A clients. */
|
|
55
|
+
get skillCount() {
|
|
56
|
+
return this.registry.list().length;
|
|
57
|
+
}
|
|
58
|
+
// -------------------------------------------------------------------------
|
|
59
|
+
// Lifecycle
|
|
60
|
+
// -------------------------------------------------------------------------
|
|
61
|
+
/**
|
|
62
|
+
* Start a standalone A2A HTTP server with the configured options.
|
|
63
|
+
*
|
|
64
|
+
* Automatically called on `onApplicationBootstrap` when `port` is set.
|
|
65
|
+
*/
|
|
66
|
+
start() {
|
|
67
|
+
this._isRunning = true;
|
|
68
|
+
serve(this.executor.raw, {
|
|
69
|
+
name: this.options.name,
|
|
70
|
+
description: this.options.description,
|
|
71
|
+
version: this.options.version,
|
|
72
|
+
url: this.options.url,
|
|
73
|
+
host: this.options.host,
|
|
74
|
+
port: this.options.port,
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
auth: this.options.auth,
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
|
+
taskStore: this.options.taskStore,
|
|
79
|
+
corsOrigins: this.options.corsOrigins,
|
|
80
|
+
explorer: this.options.explorer,
|
|
81
|
+
explorerPrefix: this.options.explorerPrefix,
|
|
82
|
+
executionTimeout: this.options.executionTimeout,
|
|
83
|
+
metrics: this.options.metrics,
|
|
84
|
+
logLevel: this.options.logLevel,
|
|
85
|
+
shutdownTimeout: this.options.shutdownTimeout,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Build an embeddable Express application without starting a standalone server.
|
|
90
|
+
*
|
|
91
|
+
* Mount the returned app in your NestJS HTTP server or Express middleware chain.
|
|
92
|
+
*/
|
|
93
|
+
async asyncServe(overrides) {
|
|
94
|
+
const opts = { ...this.options, ...overrides };
|
|
95
|
+
return asyncServe(this.executor.raw, {
|
|
96
|
+
name: opts.name,
|
|
97
|
+
description: opts.description,
|
|
98
|
+
version: opts.version,
|
|
99
|
+
url: opts.url,
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101
|
+
auth: opts.auth,
|
|
102
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
103
|
+
taskStore: opts.taskStore,
|
|
104
|
+
corsOrigins: opts.corsOrigins,
|
|
105
|
+
explorer: opts.explorer,
|
|
106
|
+
explorerPrefix: opts.explorerPrefix,
|
|
107
|
+
executionTimeout: opts.executionTimeout,
|
|
108
|
+
metrics: opts.metrics,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/** Stop tracking the running state (the underlying HTTP server manages its own lifecycle). */
|
|
112
|
+
stop() {
|
|
113
|
+
this._isRunning = false;
|
|
114
|
+
}
|
|
115
|
+
// -------------------------------------------------------------------------
|
|
116
|
+
// NestJS lifecycle hooks
|
|
117
|
+
// -------------------------------------------------------------------------
|
|
118
|
+
/**
|
|
119
|
+
* Auto-starts the standalone A2A server when `port` is configured.
|
|
120
|
+
*
|
|
121
|
+
* Uses `OnApplicationBootstrap` so all modules registered during
|
|
122
|
+
* `onModuleInit` are available before the server starts.
|
|
123
|
+
*/
|
|
124
|
+
onApplicationBootstrap() {
|
|
125
|
+
if (this.options.port !== undefined) {
|
|
126
|
+
this.start();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/** Marks the service as stopped on module destruction. */
|
|
130
|
+
onModuleDestroy() {
|
|
131
|
+
if (this._isRunning) {
|
|
132
|
+
this.stop();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
ApcoreA2aService = __decorate([
|
|
137
|
+
Injectable(),
|
|
138
|
+
__param(0, Inject(ApcoreRegistryService)),
|
|
139
|
+
__param(1, Inject(ApcoreExecutorService)),
|
|
140
|
+
__param(2, Inject(APCORE_A2A_MODULE_OPTIONS)),
|
|
141
|
+
__metadata("design:paramtypes", [ApcoreRegistryService,
|
|
142
|
+
ApcoreExecutorService, Object])
|
|
143
|
+
], ApcoreA2aService);
|
|
144
|
+
export { ApcoreA2aService };
|
|
145
|
+
//# sourceMappingURL=apcore-a2a.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore-a2a.service.js","sourceRoot":"","sources":["../../src/a2a/apcore-a2a.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CA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;IACH,sBAAsB;QACpB,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED,0DAA0D;IAC1D,eAAe;QACb,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AA/GY,gBAAgB;IAD5B,UAAU,EAAE;IAKR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAE7B,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAE7B,WAAA,MAAM,CAAC,yBAAyB,CAAC,CAAA;qCAHP,qBAAqB;QAErB,qBAAqB;GAPvC,gBAAgB,CA+G5B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DynamicModule } from '@nestjs/common';
|
|
2
|
+
import type { ApcoreCliModuleOptions, ApcoreCliModuleAsyncOptions } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* NestJS dynamic module for apcore-cli integration.
|
|
5
|
+
*
|
|
6
|
+
* Provides {@link ApcoreCliService} for building Commander programs, generating
|
|
7
|
+
* man pages, and configuring `--help --man` / `--help --verbose` support.
|
|
8
|
+
*
|
|
9
|
+
* Requires {@link ApcoreRegistryService} in the injection context
|
|
10
|
+
* (typically via importing `ApcoreModule`).
|
|
11
|
+
*/
|
|
12
|
+
export declare class ApcoreCliModule {
|
|
13
|
+
/** Synchronous configuration. */
|
|
14
|
+
static forRoot(options?: ApcoreCliModuleOptions): DynamicModule;
|
|
15
|
+
/** Asynchronous configuration using `useFactory` / `inject`. */
|
|
16
|
+
static forRootAsync(options: ApcoreCliModuleAsyncOptions): DynamicModule;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=apcore-cli.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore-cli.module.d.ts","sourceRoot":"","sources":["../../src/cli/apcore-cli.module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,gBAAgB,CAAC;AAIpE,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AAErB;;;;;;;;GAQG;AACH,qBACa,eAAe;IAC1B,iCAAiC;IACjC,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,sBAA2B,GAAG,aAAa;IAgBnE,gEAAgE;IAChE,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,2BAA2B,GAAG,aAAa;CAsBzE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var ApcoreCliModule_1;
|
|
8
|
+
import { Module } from '@nestjs/common';
|
|
9
|
+
import { ApcoreRegistryService } from '../core/apcore-registry.service.js';
|
|
10
|
+
import { ApcoreCliService } from './apcore-cli.service.js';
|
|
11
|
+
import { APCORE_CLI_MODULE_OPTIONS } from '../constants.js';
|
|
12
|
+
/**
|
|
13
|
+
* NestJS dynamic module for apcore-cli integration.
|
|
14
|
+
*
|
|
15
|
+
* Provides {@link ApcoreCliService} for building Commander programs, generating
|
|
16
|
+
* man pages, and configuring `--help --man` / `--help --verbose` support.
|
|
17
|
+
*
|
|
18
|
+
* Requires {@link ApcoreRegistryService} in the injection context
|
|
19
|
+
* (typically via importing `ApcoreModule`).
|
|
20
|
+
*/
|
|
21
|
+
let ApcoreCliModule = ApcoreCliModule_1 = class ApcoreCliModule {
|
|
22
|
+
/** Synchronous configuration. */
|
|
23
|
+
static forRoot(options = {}) {
|
|
24
|
+
return {
|
|
25
|
+
module: ApcoreCliModule_1,
|
|
26
|
+
providers: [
|
|
27
|
+
{ provide: APCORE_CLI_MODULE_OPTIONS, useValue: options },
|
|
28
|
+
{
|
|
29
|
+
provide: ApcoreCliService,
|
|
30
|
+
useFactory: (registry) => new ApcoreCliService(registry, options),
|
|
31
|
+
inject: [ApcoreRegistryService],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
exports: [ApcoreCliService, APCORE_CLI_MODULE_OPTIONS],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Asynchronous configuration using `useFactory` / `inject`. */
|
|
38
|
+
static forRootAsync(options) {
|
|
39
|
+
return {
|
|
40
|
+
module: ApcoreCliModule_1,
|
|
41
|
+
imports: (options.imports ?? []),
|
|
42
|
+
providers: [
|
|
43
|
+
{
|
|
44
|
+
provide: APCORE_CLI_MODULE_OPTIONS,
|
|
45
|
+
useFactory: options.useFactory,
|
|
46
|
+
inject: (options.inject ?? []),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
provide: ApcoreCliService,
|
|
50
|
+
useFactory: (opts, registry) => new ApcoreCliService(registry, opts),
|
|
51
|
+
inject: [APCORE_CLI_MODULE_OPTIONS, ApcoreRegistryService],
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
exports: [ApcoreCliService, APCORE_CLI_MODULE_OPTIONS],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
ApcoreCliModule = ApcoreCliModule_1 = __decorate([
|
|
59
|
+
Module({})
|
|
60
|
+
], ApcoreCliModule);
|
|
61
|
+
export { ApcoreCliModule };
|
|
62
|
+
//# sourceMappingURL=apcore-cli.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore-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MAAM,EAAE,CAAC,yBAAyB,EAAE,qBAAqB,CAAC;iBAC3D;aACF;YACD,OAAO,EAAE,CAAC,gBAAgB,EAAE,yBAAyB,CAAC;SACvD,CAAC;IACJ,CAAC;CACF,CAAA;AAzCY,eAAe;IAD3B,MAAM,CAAC,EAAE,CAAC;GACE,eAAe,CAyC3B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createCli, buildProgramManPage, configureManHelp } from 'apcore-cli';
|
|
2
|
+
import { ApcoreRegistryService } from '../core/apcore-registry.service.js';
|
|
3
|
+
import type { ApcoreCliModuleOptions } from '../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* NestJS-injectable service that exposes apcore-cli utilities.
|
|
6
|
+
*
|
|
7
|
+
* Wraps `createCli`, `buildProgramManPage`, and `configureManHelp` from
|
|
8
|
+
* `apcore-cli`, applying module-level defaults (docsUrl, verboseHelp) on
|
|
9
|
+
* construction so that injected consumers get a pre-configured CLI builder.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const program = cliService.createProgram();
|
|
14
|
+
* cliService.configureManHelp(program, 'my-tool', '1.0.0', 'My Tool');
|
|
15
|
+
* program.parse();
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class ApcoreCliService {
|
|
19
|
+
private readonly registry;
|
|
20
|
+
private readonly options;
|
|
21
|
+
constructor(registry: ApcoreRegistryService, options: ApcoreCliModuleOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Build and return a Commander program.
|
|
24
|
+
*
|
|
25
|
+
* Built-in apcore options (`--input`, `--yes`, `--large-input`, `--format`)
|
|
26
|
+
* are hidden by default; pass `--help --verbose` at runtime (or set
|
|
27
|
+
* `verboseHelp: true` in module options) to show them.
|
|
28
|
+
*
|
|
29
|
+
* @param extensionsDir Override the extensions directory (default: value from options).
|
|
30
|
+
*/
|
|
31
|
+
createProgram(extensionsDir?: string): ReturnType<typeof createCli>;
|
|
32
|
+
/**
|
|
33
|
+
* Generate a complete roff man page string for the given Commander program.
|
|
34
|
+
*
|
|
35
|
+
* Enabled by `apcore-cli` 0.4.0's `buildProgramManPage()`.
|
|
36
|
+
*/
|
|
37
|
+
buildManPage(program: Parameters<typeof buildProgramManPage>[0], progName: string, version: string, description?: string, docsUrl?: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Add `--help --man` support to an existing Commander program.
|
|
40
|
+
*
|
|
41
|
+
* When the user runs `<prog> --help --man`, the full man page is written to
|
|
42
|
+
* stdout. Enabled by `apcore-cli` 0.4.0's `configureManHelp()`.
|
|
43
|
+
*/
|
|
44
|
+
configureManHelp(program: Parameters<typeof configureManHelp>[0], progName: string, version: string, description?: string, docsUrl?: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Update the docs URL used by man pages and per-command help output.
|
|
47
|
+
*
|
|
48
|
+
* Delegates to `apcore-cli`'s module-level `setDocsUrl()`.
|
|
49
|
+
*/
|
|
50
|
+
setDocsUrl(url: string | null): void;
|
|
51
|
+
/**
|
|
52
|
+
* Toggle verbose help mode.
|
|
53
|
+
*
|
|
54
|
+
* When `true`, `--help` shows all options including built-in apcore options.
|
|
55
|
+
* Delegates to `apcore-cli`'s module-level `setVerboseHelp()`.
|
|
56
|
+
*/
|
|
57
|
+
setVerboseHelp(verbose: boolean): void;
|
|
58
|
+
/** Number of modules currently in the registry. */
|
|
59
|
+
get moduleCount(): number;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=apcore-cli.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore-cli.service.d.ts","sourceRoot":"","sources":["../../src/cli/apcore-cli.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAGT,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,qBACa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAFP,QAAQ,EAAE,qBAAqB,EAE/B,OAAO,EAAE,sBAAsB;IAclD;;;;;;;;OAQG;IACH,aAAa,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC;IAYnE;;;;OAIG;IACH,YAAY,CACV,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAClD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM;IAUT;;;;;OAKG;IACH,gBAAgB,CACd,OAAO,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAC/C,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,GACf,IAAI;IAcP;;;;OAIG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIpC;;;;;OAKG;IACH,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAQtC,mDAAmD;IACnD,IAAI,WAAW,IAAI,MAAM,CAExB;CACF"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Injectable, Inject } from '@nestjs/common';
|
|
14
|
+
import { createCli, setDocsUrl, setVerboseHelp, buildProgramManPage, configureManHelp, } from 'apcore-cli';
|
|
15
|
+
import { ApcoreRegistryService } from '../core/apcore-registry.service.js';
|
|
16
|
+
import { APCORE_CLI_MODULE_OPTIONS } from '../constants.js';
|
|
17
|
+
/**
|
|
18
|
+
* NestJS-injectable service that exposes apcore-cli utilities.
|
|
19
|
+
*
|
|
20
|
+
* Wraps `createCli`, `buildProgramManPage`, and `configureManHelp` from
|
|
21
|
+
* `apcore-cli`, applying module-level defaults (docsUrl, verboseHelp) on
|
|
22
|
+
* construction so that injected consumers get a pre-configured CLI builder.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const program = cliService.createProgram();
|
|
27
|
+
* cliService.configureManHelp(program, 'my-tool', '1.0.0', 'My Tool');
|
|
28
|
+
* program.parse();
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
let ApcoreCliService = class ApcoreCliService {
|
|
32
|
+
registry;
|
|
33
|
+
options;
|
|
34
|
+
constructor(registry, options) {
|
|
35
|
+
this.registry = registry;
|
|
36
|
+
this.options = options;
|
|
37
|
+
if (options.docsUrl !== undefined) {
|
|
38
|
+
setDocsUrl(options.docsUrl);
|
|
39
|
+
}
|
|
40
|
+
if (options.verboseHelp !== undefined) {
|
|
41
|
+
setVerboseHelp(options.verboseHelp);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// -------------------------------------------------------------------------
|
|
45
|
+
// Program builder
|
|
46
|
+
// -------------------------------------------------------------------------
|
|
47
|
+
/**
|
|
48
|
+
* Build and return a Commander program.
|
|
49
|
+
*
|
|
50
|
+
* Built-in apcore options (`--input`, `--yes`, `--large-input`, `--format`)
|
|
51
|
+
* are hidden by default; pass `--help --verbose` at runtime (or set
|
|
52
|
+
* `verboseHelp: true` in module options) to show them.
|
|
53
|
+
*
|
|
54
|
+
* @param extensionsDir Override the extensions directory (default: value from options).
|
|
55
|
+
*/
|
|
56
|
+
createProgram(extensionsDir) {
|
|
57
|
+
return createCli(extensionsDir ?? this.options.extensionsDir, this.options.progName, this.options.verboseHelp ?? false);
|
|
58
|
+
}
|
|
59
|
+
// -------------------------------------------------------------------------
|
|
60
|
+
// Man page / help
|
|
61
|
+
// -------------------------------------------------------------------------
|
|
62
|
+
/**
|
|
63
|
+
* Generate a complete roff man page string for the given Commander program.
|
|
64
|
+
*
|
|
65
|
+
* Enabled by `apcore-cli` 0.4.0's `buildProgramManPage()`.
|
|
66
|
+
*/
|
|
67
|
+
buildManPage(program, progName, version, description, docsUrl) {
|
|
68
|
+
return buildProgramManPage(program, progName, version, description, docsUrl ?? this.options.docsUrl ?? undefined);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Add `--help --man` support to an existing Commander program.
|
|
72
|
+
*
|
|
73
|
+
* When the user runs `<prog> --help --man`, the full man page is written to
|
|
74
|
+
* stdout. Enabled by `apcore-cli` 0.4.0's `configureManHelp()`.
|
|
75
|
+
*/
|
|
76
|
+
configureManHelp(program, progName, version, description, docsUrl) {
|
|
77
|
+
configureManHelp(program, progName, version, description, docsUrl ?? this.options.docsUrl ?? undefined);
|
|
78
|
+
}
|
|
79
|
+
// -------------------------------------------------------------------------
|
|
80
|
+
// Runtime configuration
|
|
81
|
+
// -------------------------------------------------------------------------
|
|
82
|
+
/**
|
|
83
|
+
* Update the docs URL used by man pages and per-command help output.
|
|
84
|
+
*
|
|
85
|
+
* Delegates to `apcore-cli`'s module-level `setDocsUrl()`.
|
|
86
|
+
*/
|
|
87
|
+
setDocsUrl(url) {
|
|
88
|
+
setDocsUrl(url);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Toggle verbose help mode.
|
|
92
|
+
*
|
|
93
|
+
* When `true`, `--help` shows all options including built-in apcore options.
|
|
94
|
+
* Delegates to `apcore-cli`'s module-level `setVerboseHelp()`.
|
|
95
|
+
*/
|
|
96
|
+
setVerboseHelp(verbose) {
|
|
97
|
+
setVerboseHelp(verbose);
|
|
98
|
+
}
|
|
99
|
+
// -------------------------------------------------------------------------
|
|
100
|
+
// Registry accessors
|
|
101
|
+
// -------------------------------------------------------------------------
|
|
102
|
+
/** Number of modules currently in the registry. */
|
|
103
|
+
get moduleCount() {
|
|
104
|
+
return this.registry.count;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
ApcoreCliService = __decorate([
|
|
108
|
+
Injectable(),
|
|
109
|
+
__param(0, Inject(ApcoreRegistryService)),
|
|
110
|
+
__param(1, Inject(APCORE_CLI_MODULE_OPTIONS)),
|
|
111
|
+
__metadata("design:paramtypes", [ApcoreRegistryService, Object])
|
|
112
|
+
], ApcoreCliService);
|
|
113
|
+
export { ApcoreCliService };
|
|
114
|
+
//# sourceMappingURL=apcore-cli.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apcore-cli.service.js","sourceRoot":"","sources":["../../src/cli/apcore-cli.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,SAAS,EACT,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,C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AC5E,wBAAwB;IACxB,4EAA4E;IAE5E;;;;OAIG;IACH,UAAU,CAAC,GAAkB;QAC3B,UAAU,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC;IAED;;;;;OAKG;IACH,cAAc,CAAC,OAAgB;QAC7B,cAAc,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAED,4EAA4E;IAC5E,qBAAqB;IACrB,4EAA4E;IAE5E,mDAAmD;IACnD,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC7B,CAAC;CACF,CAAA;AAlHY,gBAAgB;IAD5B,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAE7B,WAAA,MAAM,CAAC,yBAAyB,CAAC,CAAA;qCADP,qBAAqB;GAHvC,gBAAgB,CAkH5B"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const APCORE_MODULE_OPTIONS: "APCORE_MODULE_OPTIONS";
|
|
2
2
|
export declare const APCORE_MCP_MODULE_OPTIONS: "APCORE_MCP_MODULE_OPTIONS";
|
|
3
|
+
export declare const APCORE_CLI_MODULE_OPTIONS: "APCORE_CLI_MODULE_OPTIONS";
|
|
4
|
+
export declare const APCORE_A2A_MODULE_OPTIONS: "APCORE_A2A_MODULE_OPTIONS";
|
|
3
5
|
export declare const AP_TOOL_METADATA_KEY: "apcore:tool";
|
|
4
6
|
export declare const AP_MODULE_METADATA_KEY: "apcore:module";
|
|
5
7
|
export declare const AP_CONTEXT_METADATA_KEY: "apcore:context";
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,EAAG,uBAAgC,CAAC;AACtE,eAAO,MAAM,yBAAyB,EAAG,2BAAoC,CAAC;AAG9E,eAAO,MAAM,oBAAoB,EAAG,aAAsB,CAAC;AAC3D,eAAO,MAAM,sBAAsB,EAAG,eAAwB,CAAC;AAC/D,eAAO,MAAM,uBAAuB,EAAG,gBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,EAAG,uBAAgC,CAAC;AACtE,eAAO,MAAM,yBAAyB,EAAG,2BAAoC,CAAC;AAC9E,eAAO,MAAM,yBAAyB,EAAG,2BAAoC,CAAC;AAC9E,eAAO,MAAM,yBAAyB,EAAG,2BAAoC,CAAC;AAG9E,eAAO,MAAM,oBAAoB,EAAG,aAAsB,CAAC;AAC3D,eAAO,MAAM,sBAAsB,EAAG,eAAwB,CAAC;AAC/D,eAAO,MAAM,uBAAuB,EAAG,gBAAyB,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// NestJS dependency-injection tokens
|
|
2
2
|
export const APCORE_MODULE_OPTIONS = 'APCORE_MODULE_OPTIONS';
|
|
3
3
|
export const APCORE_MCP_MODULE_OPTIONS = 'APCORE_MCP_MODULE_OPTIONS';
|
|
4
|
+
export const APCORE_CLI_MODULE_OPTIONS = 'APCORE_CLI_MODULE_OPTIONS';
|
|
5
|
+
export const APCORE_A2A_MODULE_OPTIONS = 'APCORE_A2A_MODULE_OPTIONS';
|
|
4
6
|
// Reflect metadata keys used by decorators
|
|
5
7
|
export const AP_TOOL_METADATA_KEY = 'apcore:tool';
|
|
6
8
|
export const AP_MODULE_METADATA_KEY = 'apcore:module';
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAgC,CAAC;AACtE,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAAoC,CAAC;AAE9E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,gBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAgC,CAAC;AACtE,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAAoC,CAAC;AAC9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAAoC,CAAC;AAC9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAAoC,CAAC;AAE9E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,uBAAuB,GAAG,gBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apcore.module.d.ts","sourceRoot":"","sources":["../../src/core/apcore.module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"apcore.module.d.ts","sourceRoot":"","sources":["../../src/core/apcore.module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,gBAAgB,CAAC;AAUpE,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;GASG;AACH,qBAEa,YAAY;IACvB;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,GAAE,mBAAwB,GAAG,aAAa;IA2ChE;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,wBAAwB,GAAG,aAAa;CAwDtE"}
|
|
@@ -11,6 +11,8 @@ import { ApcoreRegistryService } from './apcore-registry.service.js';
|
|
|
11
11
|
import { ApcoreExecutorService } from './apcore-executor.service.js';
|
|
12
12
|
import { ApToolScannerService } from '../decorators/ap-tool-scanner.service.js';
|
|
13
13
|
import { ApcoreMcpModule } from '../mcp/apcore-mcp.module.js';
|
|
14
|
+
import { ApcoreCliModule } from '../cli/apcore-cli.module.js';
|
|
15
|
+
import { ApcoreA2aModule } from '../a2a/apcore-a2a.module.js';
|
|
14
16
|
import { APCORE_MODULE_OPTIONS } from '../constants.js';
|
|
15
17
|
/**
|
|
16
18
|
* Main NestJS dynamic module for the apcore ecosystem.
|
|
@@ -45,6 +47,12 @@ let ApcoreModule = ApcoreModule_1 = class ApcoreModule {
|
|
|
45
47
|
if (options.mcp) {
|
|
46
48
|
imports.push(ApcoreMcpModule.forRoot(options.mcp));
|
|
47
49
|
}
|
|
50
|
+
if (options.cli) {
|
|
51
|
+
imports.push(ApcoreCliModule.forRoot(options.cli));
|
|
52
|
+
}
|
|
53
|
+
if (options.a2a) {
|
|
54
|
+
imports.push(ApcoreA2aModule.forRoot(options.a2a));
|
|
55
|
+
}
|
|
48
56
|
return {
|
|
49
57
|
module: ApcoreModule_1,
|
|
50
58
|
imports,
|
|
@@ -73,6 +81,12 @@ let ApcoreModule = ApcoreModule_1 = class ApcoreModule {
|
|
|
73
81
|
if (options.mcp) {
|
|
74
82
|
imports.push(ApcoreMcpModule.forRoot(options.mcp));
|
|
75
83
|
}
|
|
84
|
+
if (options.cli) {
|
|
85
|
+
imports.push(ApcoreCliModule.forRoot(options.cli));
|
|
86
|
+
}
|
|
87
|
+
if (options.a2a) {
|
|
88
|
+
imports.push(ApcoreA2aModule.forRoot(options.a2a));
|
|
89
|
+
}
|
|
76
90
|
return {
|
|
77
91
|
module: ApcoreModule_1,
|
|
78
92
|
imports,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apcore.module.js","sourceRoot":"","sources":["../../src/core/ap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,GAAkB,IAAI,IAAI;4BACrC,WAAW,EAAG,IAAI,CAAC,UAA2B,IAAI,IAAI;yBACvD,CAAC,CAAC;wBACH,OAAO,IAAI,qBAAqB,CAAC,QAAQ,CAAC,CAAC;oBAC7C,CAAC;oBACD,MAAM,EAAE,CAAC,qBAAqB,EAAE,qBAAqB,CAAC;iBACvD;gBACD,oBAAoB;aACrB;YACD,OAAO,EAAE;gBACP,qBAAqB;gBACrB,qBAAqB;gBACrB,qBAAqB;gBACrB,oBAAoB;aACrB;SACF,CAAC;IACJ,CAAC;CACF,CAAA;AAjHY,YAAY;IAFxB,MAAM,EAAE;IACR,MAAM,CAAC,EAAE,CAAC;GACE,YAAY,CAiHxB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,12 +3,21 @@ export { ApcoreRegistryService } from './core/apcore-registry.service.js';
|
|
|
3
3
|
export { ApcoreExecutorService } from './core/apcore-executor.service.js';
|
|
4
4
|
export { ApcoreMcpModule } from './mcp/apcore-mcp.module.js';
|
|
5
5
|
export { ApcoreMcpService } from './mcp/apcore-mcp.service.js';
|
|
6
|
+
export { ApcoreCliModule } from './cli/apcore-cli.module.js';
|
|
7
|
+
export { ApcoreCliService } from './cli/apcore-cli.service.js';
|
|
8
|
+
export { ApcoreA2aModule } from './a2a/apcore-a2a.module.js';
|
|
9
|
+
export { ApcoreA2aService } from './a2a/apcore-a2a.service.js';
|
|
6
10
|
export { reportProgress, elicit, createBridgeContext, asyncServe, APCoreMCP } from 'apcore-mcp';
|
|
7
11
|
export type { BridgeContext, OpenAIToolDef, ServeOptions, AsyncServeOptions, AsyncServeApp, MetricsExporter, ElicitResult, APCoreMCPOptions, APCoreMCPServeOptions, APCoreMCPAsyncServeOptions, ToOpenaiToolsOptions, } from 'apcore-mcp';
|
|
8
12
|
export { JWTAuthenticator, getCurrentIdentity, identityStorage } from 'apcore-mcp';
|
|
9
13
|
export type { Authenticator, ClaimMapping, JWTAuthenticatorOptions } from 'apcore-mcp';
|
|
10
|
-
export { BaseScanner, createScannedModule, cloneModule, extractInputSchema, extractOutputSchema, resolveRef, resolveSchema, enrichSchemaDescriptions, YAMLWriter, TypeScriptWriter, RegistryWriter, getWriter, moduleToDict, modulesToDicts, annotationsToDict, resolveTarget, flattenParams, toMarkdown, } from 'apcore-toolkit';
|
|
11
|
-
export type { ScannedModule } from 'apcore-toolkit';
|
|
14
|
+
export { BaseScanner, createScannedModule, cloneModule, extractInputSchema, extractOutputSchema, resolveRef, resolveSchema, deepResolveRefs, enrichSchemaDescriptions, YAMLWriter, TypeScriptWriter, RegistryWriter, getWriter, moduleToDict, modulesToDicts, annotationsToDict, resolveTarget, flattenParams, toMarkdown, AIEnhancer, DisplayResolver, createWriteResult, WriteError, YAMLVerifier, SyntaxVerifier, RegistryVerifier, MagicBytesVerifier, JSONVerifier, runVerifierChain, } from 'apcore-toolkit';
|
|
15
|
+
export type { ScannedModule, AIEnhancerOptions, Enhancer, DisplayResolveOptions, DisplayMetadata, SurfaceDisplay, WriteResult, VerifyResult, Verifier, } from 'apcore-toolkit';
|
|
16
|
+
export { createCli, buildModuleCommand, LazyModuleGroup, GroupedModuleGroup, BUILTIN_COMMANDS, setDocsUrl, setVerboseHelp, buildProgramManPage, configureManHelp, registerShellCommands, registerDiscoveryCommands, getDisplay, getCliDisplayFields, ConfigResolver, DEFAULTS, checkApproval, formatExecResult, resolveFormat, formatModuleList, formatModuleDetail, validateModuleId, collectInput, reconvertEnumValues, schemaToCliOptions, mapType, extractHelp, AuditLogger, setAuditLogger, getAuditLogger, AuthProvider, ConfigEncryptor, Sandbox, ApprovalTimeoutError, ApprovalDeniedError, AuthenticationError, ConfigDecryptionError, ModuleExecutionError, ModuleNotFoundError, SchemaValidationError, EXIT_CODES, exitCodeForError, } from 'apcore-cli';
|
|
17
|
+
export type { OptionConfig, ExitCode } from 'apcore-cli';
|
|
18
|
+
export { serve as serveA2A, asyncServe as asyncServeA2A } from 'apcore-a2a';
|
|
19
|
+
export { JWTAuthenticator as A2AJWTAuthenticator } from 'apcore-a2a';
|
|
20
|
+
export type { Authenticator as A2AAuthenticator, ClaimMapping as A2AClaimMapping } from 'apcore-a2a';
|
|
12
21
|
export { ApTool, ApModule, ApContext } from './decorators/index.js';
|
|
13
22
|
export { ApToolScannerService } from './decorators/ap-tool-scanner.service.js';
|
|
14
23
|
export type { ScanOptions } from './decorators/ap-tool-scanner.service.js';
|
|
@@ -23,6 +32,6 @@ export type { InstanceProvider } from './bridge/index.js';
|
|
|
23
32
|
export { normalizeClassName, normalizeMethodName, generateModuleId, } from './utils/id-generator.js';
|
|
24
33
|
export { scannedModuleToFunctionModule, toModuleAnnotations } from './utils/module-factory.js';
|
|
25
34
|
export type { BoundExecuteFn } from './utils/module-factory.js';
|
|
26
|
-
export { APCORE_MODULE_OPTIONS, APCORE_MCP_MODULE_OPTIONS, AP_TOOL_METADATA_KEY, AP_MODULE_METADATA_KEY, AP_CONTEXT_METADATA_KEY, } from './constants.js';
|
|
27
|
-
export type { ModuleAnnotations, ModuleExample, Module, Context, Identity, ModuleDescriptor, PreflightResult, PreflightCheckResult, ValidationResult, ApToolAnnotations, ApToolExample, ApToolOptions, ApModuleOptions, ApcoreModuleOptions, ApcoreModuleAsyncOptions, ApcoreMcpModuleOptions, ApcoreMcpModuleAsyncOptions, RegisterMethodOptions, RegisterServiceOptions, } from './types.js';
|
|
35
|
+
export { APCORE_MODULE_OPTIONS, APCORE_MCP_MODULE_OPTIONS, APCORE_CLI_MODULE_OPTIONS, APCORE_A2A_MODULE_OPTIONS, AP_TOOL_METADATA_KEY, AP_MODULE_METADATA_KEY, AP_CONTEXT_METADATA_KEY, } from './constants.js';
|
|
36
|
+
export type { ModuleAnnotations, ModuleExample, Module, Context, Identity, ModuleDescriptor, PreflightResult, PreflightCheckResult, ValidationResult, ApToolAnnotations, ApToolExample, ApToolOptions, ApModuleOptions, ApcoreModuleOptions, ApcoreModuleAsyncOptions, ApcoreMcpModuleOptions, ApcoreMcpModuleAsyncOptions, ApcoreCliModuleOptions, ApcoreCliModuleAsyncOptions, ApcoreA2aModuleOptions, ApcoreA2aModuleAsyncOptions, RegisterMethodOptions, RegisterServiceOptions, } from './types.js';
|
|
28
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAK1E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAChG,YAAY,EACV,aAAa,EACb,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACnF,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAKvF,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index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service.js';
|
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
10
|
export { ApcoreMcpModule } from './mcp/apcore-mcp.module.js';
|
|
11
11
|
export { ApcoreMcpService } from './mcp/apcore-mcp.service.js';
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// CLI
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
export { ApcoreCliModule } from './cli/apcore-cli.module.js';
|
|
16
|
+
export { ApcoreCliService } from './cli/apcore-cli.service.js';
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// A2A
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
export { ApcoreA2aModule } from './a2a/apcore-a2a.module.js';
|
|
21
|
+
export { ApcoreA2aService } from './a2a/apcore-a2a.service.js';
|
|
12
22
|
// Re-export apcore-mcp helpers and types for convenience
|
|
13
23
|
export { reportProgress, elicit, createBridgeContext, asyncServe, APCoreMCP } from 'apcore-mcp';
|
|
14
24
|
// Re-export apcore-mcp auth utilities
|
|
@@ -16,7 +26,16 @@ export { JWTAuthenticator, getCurrentIdentity, identityStorage } from 'apcore-mc
|
|
|
16
26
|
// ---------------------------------------------------------------------------
|
|
17
27
|
// Toolkit (scanner & schema extraction from apcore-toolkit)
|
|
18
28
|
// ---------------------------------------------------------------------------
|
|
19
|
-
export { BaseScanner, createScannedModule, cloneModule, extractInputSchema, extractOutputSchema, resolveRef, resolveSchema, enrichSchemaDescriptions, YAMLWriter, TypeScriptWriter, RegistryWriter, getWriter, moduleToDict, modulesToDicts, annotationsToDict, resolveTarget, flattenParams, toMarkdown, } from 'apcore-toolkit';
|
|
29
|
+
export { BaseScanner, createScannedModule, cloneModule, extractInputSchema, extractOutputSchema, resolveRef, resolveSchema, deepResolveRefs, enrichSchemaDescriptions, YAMLWriter, TypeScriptWriter, RegistryWriter, getWriter, moduleToDict, modulesToDicts, annotationsToDict, resolveTarget, flattenParams, toMarkdown, AIEnhancer, DisplayResolver, createWriteResult, WriteError, YAMLVerifier, SyntaxVerifier, RegistryVerifier, MagicBytesVerifier, JSONVerifier, runVerifierChain, } from 'apcore-toolkit';
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// CLI utilities (from apcore-cli)
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
export { createCli, buildModuleCommand, LazyModuleGroup, GroupedModuleGroup, BUILTIN_COMMANDS, setDocsUrl, setVerboseHelp, buildProgramManPage, configureManHelp, registerShellCommands, registerDiscoveryCommands, getDisplay, getCliDisplayFields, ConfigResolver, DEFAULTS, checkApproval, formatExecResult, resolveFormat, formatModuleList, formatModuleDetail, validateModuleId, collectInput, reconvertEnumValues, schemaToCliOptions, mapType, extractHelp, AuditLogger, setAuditLogger, getAuditLogger, AuthProvider, ConfigEncryptor, Sandbox, ApprovalTimeoutError, ApprovalDeniedError, AuthenticationError, ConfigDecryptionError, ModuleExecutionError, ModuleNotFoundError, SchemaValidationError, EXIT_CODES, exitCodeForError, } from 'apcore-cli';
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// A2A utilities (from apcore-a2a)
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
export { serve as serveA2A, asyncServe as asyncServeA2A } from 'apcore-a2a';
|
|
38
|
+
export { JWTAuthenticator as A2AJWTAuthenticator } from 'apcore-a2a';
|
|
20
39
|
// ---------------------------------------------------------------------------
|
|
21
40
|
// Decorators
|
|
22
41
|
// ---------------------------------------------------------------------------
|
|
@@ -42,5 +61,5 @@ export { scannedModuleToFunctionModule, toModuleAnnotations } from './utils/modu
|
|
|
42
61
|
// ---------------------------------------------------------------------------
|
|
43
62
|
// Constants
|
|
44
63
|
// ---------------------------------------------------------------------------
|
|
45
|
-
export { APCORE_MODULE_OPTIONS, APCORE_MCP_MODULE_OPTIONS, AP_TOOL_METADATA_KEY, AP_MODULE_METADATA_KEY, AP_CONTEXT_METADATA_KEY, } from './constants.js';
|
|
64
|
+
export { APCORE_MODULE_OPTIONS, APCORE_MCP_MODULE_OPTIONS, APCORE_CLI_MODULE_OPTIONS, APCORE_A2A_MODULE_OPTIONS, AP_TOOL_METADATA_KEY, AP_MODULE_METADATA_KEY, AP_CONTEXT_METADATA_KEY, } from './constants.js';
|
|
46
65
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO;AACP,8EAA8E;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,8EAA8E;AAC9E,MAAM;AACN,8EAA8E;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,yDAAyD;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAehG,sCAAsC;AACtC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGnF,8EAA8E;AAC9E,4DAA4D;AAC5D,8EAA8E;AAC9E,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO;AACP,8EA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AU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAC9E,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAG/F,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAC9E,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -44,8 +44,12 @@ export interface ApcoreModuleOptions {
|
|
|
44
44
|
acl?: unknown | null;
|
|
45
45
|
middleware?: unknown[];
|
|
46
46
|
bindings?: string | null;
|
|
47
|
-
/** Optional
|
|
47
|
+
/** Optional MCP server configuration. If provided, ApcoreMcpModule is automatically imported. */
|
|
48
48
|
mcp?: ApcoreMcpModuleOptions;
|
|
49
|
+
/** Optional CLI configuration. If provided, ApcoreCliModule is automatically imported. */
|
|
50
|
+
cli?: ApcoreCliModuleOptions;
|
|
51
|
+
/** Optional A2A server configuration. If provided, ApcoreA2aModule is automatically imported. */
|
|
52
|
+
a2a?: ApcoreA2aModuleOptions;
|
|
49
53
|
schema?: {
|
|
50
54
|
adapters?: string[];
|
|
51
55
|
strictOutput?: boolean;
|
|
@@ -57,13 +61,15 @@ export interface ApcoreModuleAsyncOptions {
|
|
|
57
61
|
useFactory: (...args: unknown[]) => Promise<ApcoreModuleOptions> | ApcoreModuleOptions;
|
|
58
62
|
inject?: unknown[];
|
|
59
63
|
/**
|
|
60
|
-
* Static
|
|
64
|
+
* Static surface configurations — evaluated at module-definition time.
|
|
61
65
|
*
|
|
62
66
|
* Because `useFactory` resolves asynchronously, dynamic-module imports
|
|
63
|
-
*
|
|
64
|
-
*
|
|
67
|
+
* must be decided statically. Provide surface config here rather than
|
|
68
|
+
* returning it from the factory.
|
|
65
69
|
*/
|
|
66
70
|
mcp?: ApcoreMcpModuleOptions;
|
|
71
|
+
cli?: ApcoreCliModuleOptions;
|
|
72
|
+
a2a?: ApcoreA2aModuleOptions;
|
|
67
73
|
}
|
|
68
74
|
/** Options for ApcoreMcpModule.forRoot(). */
|
|
69
75
|
export interface ApcoreMcpModuleOptions {
|
|
@@ -98,6 +104,77 @@ export interface ApcoreMcpModuleAsyncOptions {
|
|
|
98
104
|
useFactory: (...args: unknown[]) => Promise<ApcoreMcpModuleOptions> | ApcoreMcpModuleOptions;
|
|
99
105
|
inject?: unknown[];
|
|
100
106
|
}
|
|
107
|
+
/** Options for ApcoreCliModule.forRoot(). */
|
|
108
|
+
export interface ApcoreCliModuleOptions {
|
|
109
|
+
/** Path to the extensions directory (default: ./extensions). */
|
|
110
|
+
extensionsDir?: string;
|
|
111
|
+
/** Program name shown in help output (default: inferred from argv). */
|
|
112
|
+
progName?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Show all options in `--help` output, including built-in apcore options.
|
|
115
|
+
* Users can also toggle this at runtime with `--help --verbose`.
|
|
116
|
+
* Default: false.
|
|
117
|
+
*/
|
|
118
|
+
verboseHelp?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Base URL for online documentation.
|
|
121
|
+
*
|
|
122
|
+
* Per-command help shows `Docs: {url}/commands/{name}`.
|
|
123
|
+
* Man page SEE ALSO includes `Full documentation at {url}`.
|
|
124
|
+
* No default — disabled when not set.
|
|
125
|
+
*/
|
|
126
|
+
docsUrl?: string | null;
|
|
127
|
+
}
|
|
128
|
+
/** Async options for ApcoreCliModule.forRootAsync(). */
|
|
129
|
+
export interface ApcoreCliModuleAsyncOptions {
|
|
130
|
+
imports?: unknown[];
|
|
131
|
+
useFactory: (...args: unknown[]) => Promise<ApcoreCliModuleOptions> | ApcoreCliModuleOptions;
|
|
132
|
+
inject?: unknown[];
|
|
133
|
+
}
|
|
134
|
+
/** Options for ApcoreA2aModule.forRoot(). */
|
|
135
|
+
export interface ApcoreA2aModuleOptions {
|
|
136
|
+
/** Agent card name (default: inferred from registry config). */
|
|
137
|
+
name?: string;
|
|
138
|
+
/** Agent card description (default: inferred from registry config). */
|
|
139
|
+
description?: string;
|
|
140
|
+
/** Agent card version (default: inferred from registry config). */
|
|
141
|
+
version?: string;
|
|
142
|
+
/** Public URL of this A2A server (used in the agent card). */
|
|
143
|
+
url?: string;
|
|
144
|
+
/** Host address for the standalone HTTP server. Default: "0.0.0.0". */
|
|
145
|
+
host?: string;
|
|
146
|
+
/**
|
|
147
|
+
* Port for the standalone HTTP server.
|
|
148
|
+
*
|
|
149
|
+
* When set, `ApcoreA2aService` starts a standalone server on
|
|
150
|
+
* `onApplicationBootstrap`. Omit to use `asyncServe()` for embedding.
|
|
151
|
+
*/
|
|
152
|
+
port?: number;
|
|
153
|
+
/** Optional Authenticator for request auth. */
|
|
154
|
+
auth?: unknown;
|
|
155
|
+
/** Optional task store for A2A task persistence. */
|
|
156
|
+
taskStore?: unknown;
|
|
157
|
+
/** CORS allowed origins. */
|
|
158
|
+
corsOrigins?: string[];
|
|
159
|
+
/** Enable the A2A explorer UI. Default: false. */
|
|
160
|
+
explorer?: boolean;
|
|
161
|
+
/** URL prefix for the explorer. Default: "/explorer". */
|
|
162
|
+
explorerPrefix?: string;
|
|
163
|
+
/** Execution timeout in milliseconds. Default: 300000 (5 minutes). */
|
|
164
|
+
executionTimeout?: number;
|
|
165
|
+
/** Enable Prometheus /metrics endpoint. Default: false. */
|
|
166
|
+
metrics?: boolean;
|
|
167
|
+
/** Log level for the standalone server. */
|
|
168
|
+
logLevel?: string;
|
|
169
|
+
/** Graceful shutdown timeout in seconds. Default: 30. */
|
|
170
|
+
shutdownTimeout?: number;
|
|
171
|
+
}
|
|
172
|
+
/** Async options for ApcoreA2aModule.forRootAsync(). */
|
|
173
|
+
export interface ApcoreA2aModuleAsyncOptions {
|
|
174
|
+
imports?: unknown[];
|
|
175
|
+
useFactory: (...args: unknown[]) => Promise<ApcoreA2aModuleOptions> | ApcoreA2aModuleOptions;
|
|
176
|
+
inject?: unknown[];
|
|
177
|
+
}
|
|
101
178
|
/** Options for registering a single method as an apcore module. */
|
|
102
179
|
export interface RegisterMethodOptions {
|
|
103
180
|
instance: object;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAMnB,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;CAChD;AAED,2CAA2C;AAC3C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA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": "NestJS adapter for the apcore AI-Perceivable module ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@nestjs/common": ">=10.0.0",
|
|
34
34
|
"@nestjs/core": ">=10.0.0",
|
|
35
|
-
"apcore-mcp": "
|
|
35
|
+
"apcore-mcp": ">=0.11.0",
|
|
36
|
+
"apcore-cli": ">=0.4.0",
|
|
37
|
+
"apcore-a2a": ">=0.3.0",
|
|
36
38
|
"reflect-metadata": ">=0.1.13",
|
|
37
39
|
"rxjs": ">=7.0.0"
|
|
38
40
|
},
|
|
@@ -48,12 +50,18 @@
|
|
|
48
50
|
},
|
|
49
51
|
"apcore-mcp": {
|
|
50
52
|
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"apcore-cli": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"apcore-a2a": {
|
|
58
|
+
"optional": true
|
|
51
59
|
}
|
|
52
60
|
},
|
|
53
61
|
"dependencies": {
|
|
54
62
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
55
|
-
"apcore-js": "
|
|
56
|
-
"apcore-toolkit": "^0.
|
|
63
|
+
"apcore-js": ">=0.14.0",
|
|
64
|
+
"apcore-toolkit": "^0.4.0",
|
|
57
65
|
"js-yaml": "^4.1.0"
|
|
58
66
|
},
|
|
59
67
|
"devDependencies": {
|
|
@@ -65,7 +73,9 @@
|
|
|
65
73
|
"@types/js-yaml": "^4.0.0",
|
|
66
74
|
"@types/node": "^20.0.0",
|
|
67
75
|
"@vitest/coverage-v8": "^3.0.0",
|
|
68
|
-
"apcore-mcp": "^0.
|
|
76
|
+
"apcore-mcp": "^0.11.0",
|
|
77
|
+
"apcore-cli": "^0.4.0",
|
|
78
|
+
"apcore-a2a": "^0.3.0",
|
|
69
79
|
"apdev-js": "^0.2.0",
|
|
70
80
|
"class-transformer": "^0.5.0",
|
|
71
81
|
"class-validator": "^0.14.0",
|