@http-forge/core 0.2.18 → 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 +36 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +370 -141
- package/dist/index.mjs +367 -138
- package/dist/infrastructure/config/config-service.d.ts +2 -1
- package/dist/infrastructure/config/config.interface.d.ts +40 -0
- package/dist/infrastructure/config/index.d.ts +1 -1
- package/dist/infrastructure/test-suite/html-report-generator.d.ts +20 -0
- package/dist/infrastructure/test-suite/result-storage-service.d.ts +2 -1
- package/dist/infrastructure/test-suite/result-storage.d.ts +2 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* instead of VS Code APIs.
|
|
9
9
|
*/
|
|
10
10
|
import { IFileWatcherFactory, INotificationService } from '../../types/platform';
|
|
11
|
-
import type { EnvironmentsConfig, HttpForgeConfig, IConfigService, ProxyConfig, RequestConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config.interface';
|
|
11
|
+
import type { EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, ProxyConfig, RequestConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config.interface';
|
|
12
12
|
/**
|
|
13
13
|
* Configuration Service Implementation
|
|
14
14
|
*
|
|
@@ -52,6 +52,7 @@ export declare class ConfigService implements IConfigService {
|
|
|
52
52
|
*/
|
|
53
53
|
getRestClientMergeGlobals(): boolean;
|
|
54
54
|
getProxyConfig(): ProxyConfig | null;
|
|
55
|
+
getMcpConfig(): McpConfig;
|
|
55
56
|
/**
|
|
56
57
|
* Resolve a path relative to workspace
|
|
57
58
|
*/
|
|
@@ -63,6 +63,42 @@ export interface RestClientExportConfig {
|
|
|
63
63
|
/** When exporting environments, merge global variables into each environment file */
|
|
64
64
|
mergeGlobals?: boolean;
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* MCP Server CORS configuration
|
|
68
|
+
*/
|
|
69
|
+
export interface McpCorsConfig {
|
|
70
|
+
/** Origins allowed to access the MCP server (defaults to localhost variants) */
|
|
71
|
+
allowedOrigins: string[];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* MCP Server project-level configuration (stored in http-forge.config.json)
|
|
75
|
+
*
|
|
76
|
+
* Machine-specific settings (port, autoStart) remain in VS Code settings.
|
|
77
|
+
*/
|
|
78
|
+
export interface McpConfig {
|
|
79
|
+
/**
|
|
80
|
+
* Collection IDs or names to hide from MCP tools.
|
|
81
|
+
* Empty array (default) = expose all collections.
|
|
82
|
+
*/
|
|
83
|
+
excludedCollections: string[];
|
|
84
|
+
/**
|
|
85
|
+
* Suite IDs or names to hide from MCP tools.
|
|
86
|
+
* Empty array (default) = expose all suites.
|
|
87
|
+
*/
|
|
88
|
+
excludedSuites: string[];
|
|
89
|
+
/**
|
|
90
|
+
* Optional prefix added to every tool name, e.g. "acme_" → "acme_request__colId__reqId".
|
|
91
|
+
* Useful when multiple projects share the same AI agent.
|
|
92
|
+
*/
|
|
93
|
+
toolPrefix: string;
|
|
94
|
+
/**
|
|
95
|
+
* Maximum number of requests the MCP server will execute in a single
|
|
96
|
+
* collection or suite call. Prevents accidental runaway executions.
|
|
97
|
+
*/
|
|
98
|
+
maxRequestsPerCall: number;
|
|
99
|
+
/** CORS configuration */
|
|
100
|
+
cors: McpCorsConfig;
|
|
101
|
+
}
|
|
66
102
|
/**
|
|
67
103
|
* Proxy configuration
|
|
68
104
|
*/
|
|
@@ -92,6 +128,8 @@ export interface HttpForgeConfig {
|
|
|
92
128
|
environments: EnvironmentsConfig;
|
|
93
129
|
/** REST-Client export preferences */
|
|
94
130
|
restClientExport?: RestClientExportConfig;
|
|
131
|
+
/** MCP server project-level configuration */
|
|
132
|
+
mcp?: McpConfig;
|
|
95
133
|
/** Proxy configuration (optional) */
|
|
96
134
|
proxy?: ProxyConfig | null;
|
|
97
135
|
}
|
|
@@ -113,6 +151,8 @@ export interface IConfigService {
|
|
|
113
151
|
getEnvironmentsConfig(): EnvironmentsConfig;
|
|
114
152
|
/** Get proxy configuration */
|
|
115
153
|
getProxyConfig(): ProxyConfig | null;
|
|
154
|
+
/** Get MCP server project-level configuration (always returns resolved defaults) */
|
|
155
|
+
getMcpConfig(): McpConfig;
|
|
116
156
|
/** Get the resolved root path for HTTP Forge data */
|
|
117
157
|
getRootPath(): string;
|
|
118
158
|
/** Get the resolved collections path */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Config Services
|
|
3
3
|
*/
|
|
4
|
-
export type { EnvironmentsConfig, HttpForgeConfig, IConfigService, ProxyConfig, RequestConfig, RestClientExportConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config.interface';
|
|
4
|
+
export type { EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, McpCorsConfig, ProxyConfig, RequestConfig, RestClientExportConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config.interface';
|
|
5
5
|
export { CONFIG_FILES, DEFAULT_CONFIG, ROOT_DIRECTORIES } from './default-config';
|
|
6
6
|
export { ConfigService } from './config-service';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML Report Generator for Test Suite Results
|
|
3
|
+
*
|
|
4
|
+
* Reads the existing JSON result files produced by ResultStorageService and
|
|
5
|
+
* generates a self-contained single-file HTML report (no external dependencies).
|
|
6
|
+
*
|
|
7
|
+
* Output: {basePath}/{suiteId}/{runId}/report.html
|
|
8
|
+
*/
|
|
9
|
+
export declare class HtmlReportGenerator {
|
|
10
|
+
private readonly basePath;
|
|
11
|
+
constructor(basePath: string);
|
|
12
|
+
/**
|
|
13
|
+
* Generate an HTML report for the given run.
|
|
14
|
+
* @returns absolute path to the written report.html
|
|
15
|
+
*/
|
|
16
|
+
generate(suiteId: string, runId: string): Promise<string>;
|
|
17
|
+
private loadAllSummaries;
|
|
18
|
+
private loadFailedDetails;
|
|
19
|
+
private buildHtml;
|
|
20
|
+
}
|
|
@@ -43,8 +43,9 @@ export declare class ResultStorageService implements IResultStorageService {
|
|
|
43
43
|
saveResult(iteration: number, result: ExecutionResult): Promise<ResultSummary>;
|
|
44
44
|
/**
|
|
45
45
|
* Finalize run
|
|
46
|
+
* @returns path to the generated HTML report, or null if generation failed
|
|
46
47
|
*/
|
|
47
|
-
finalizeRun(status?: 'completed' | 'aborted' | 'error'): Promise<
|
|
48
|
+
finalizeRun(status?: 'completed' | 'aborted' | 'error'): Promise<string | null>;
|
|
48
49
|
getCurrentStats(): {
|
|
49
50
|
stats: RunStats;
|
|
50
51
|
requestStats: Record<string, RequestStats>;
|
|
@@ -248,8 +248,9 @@ export interface IResultStorageService {
|
|
|
248
248
|
saveResult(iteration: number, result: ExecutionResult): Promise<ResultSummary>;
|
|
249
249
|
/**
|
|
250
250
|
* Finalize run
|
|
251
|
+
* @returns path to the generated HTML report, or null if generation failed
|
|
251
252
|
*/
|
|
252
|
-
finalizeRun(status: 'completed' | 'aborted' | 'error'): Promise<
|
|
253
|
+
finalizeRun(status: 'completed' | 'aborted' | 'error'): Promise<string | null>;
|
|
253
254
|
/**
|
|
254
255
|
* Get current run stats
|
|
255
256
|
*/
|
package/package.json
CHANGED