@http-forge/core 0.4.8 → 0.5.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 +14 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +174 -174
- package/dist/index.mjs +175 -175
- package/dist/infrastructure/config/config.interface.d.ts +22 -0
- package/dist/infrastructure/config/index.d.ts +1 -1
- package/dist/infrastructure/script/interfaces.d.ts +6 -1
- package/dist/infrastructure/script/script-factories.d.ts +56 -6
- package/dist/infrastructure/script/script-utils.d.ts +14 -0
- package/dist/runtime/mcp-tool-name.d.ts +25 -7
- package/dist/runtime/mcp-tool-schemas.d.ts +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -270,7 +270,7 @@ Older Postman scripts and many Newman-exported collections rely on bare globals
|
|
|
270
270
|
|
|
271
271
|
Available in **both** pre-request and test scripts: `request` (`{ id, name, description, url, method, headers, data }`), `environment` (read snapshot), `globals` (read snapshot), `data` (iteration row), `iteration` (index), and `tv4` (`tv4.validate(data, schema)` — when the optional `tv4` module is installed).
|
|
272
272
|
|
|
273
|
-
Available in **test** scripts only: `responseBody` (raw string), `responseCode` (`{ code, name, detail }`), `responseHeaders`, `responseTime`, `responseCookies` (`
|
|
273
|
+
Available in **test** scripts only: `responseBody` (raw string), `responseCode` (`{ code, name, detail }`), `responseHeaders`, `responseTime`, `responseCookies` (cookie objects with `name`, `value`, `domain`, `path`, `expires`, `maxAge`, `httpOnly`, `secure`, `sameSite`), `tests` (`tests['name'] = boolean`), plus `postman.getResponseHeader(name)` and `postman.getResponseCookie(name)` (case-insensitive; `getResponseCookie` returns the full cookie object, both return `null` if absent).
|
|
274
274
|
|
|
275
275
|
```javascript
|
|
276
276
|
// Legacy-style test script — runs unmodified
|
|
@@ -429,6 +429,11 @@ pm.response.cookies.forEach(cookie => {
|
|
|
429
429
|
pm.cookies.set(cookie.name, cookie.value);
|
|
430
430
|
});
|
|
431
431
|
|
|
432
|
+
// Read a response cookie (Postman-compatible CookieList)
|
|
433
|
+
const sid = pm.response.cookies.get('sessionId'); // value string
|
|
434
|
+
const sidCookie = pm.response.cookies.one('sessionId'); // full object
|
|
435
|
+
if (sidCookie?.secure && sidCookie.maxAge > 0) { /* ... */ }
|
|
436
|
+
|
|
432
437
|
// List all active cookies
|
|
433
438
|
const allCookies = pm.cookies.list(); // [{name, value}, ...]
|
|
434
439
|
|
|
@@ -684,12 +689,20 @@ interface McpConfig {
|
|
|
684
689
|
excludedSuites: string[]; // IDs or names to hide (default: [] = expose all)
|
|
685
690
|
toolPrefix: string; // Prefix for every tool name (default: "")
|
|
686
691
|
maxRequestsPerCall: number; // Safety cap per collection/suite call (default: 50)
|
|
692
|
+
toolMode: 'flat' | 'drilldown' | 'auto'; // How tools are exposed (default: 'flat')
|
|
693
|
+
drilldownThreshold: number; // 'auto' switches to drill-down above this request-tool count (default: 200)
|
|
687
694
|
cors: {
|
|
688
695
|
allowedOrigins: string[]; // CORS origins (default: ["http://localhost","http://127.0.0.1"])
|
|
689
696
|
};
|
|
690
697
|
}
|
|
691
698
|
```
|
|
692
699
|
|
|
700
|
+
**`toolMode`** controls how collections/requests are surfaced as MCP tools:
|
|
701
|
+
|
|
702
|
+
- `flat` (default) — one tool per request, folder, collection, and suite. Richest discoverability; best for normal workspaces.
|
|
703
|
+
- `drilldown` — a small fixed set of generic tools (`list_collections`, `list_requests`, `run_request`, `run_folder`, `run_collection`, `run_suite`) whose arguments select the target. Collection/suite names are advertised as JSON-schema `enum`s so agents pick real values. Keeps the tool list tiny for very large workspaces.
|
|
704
|
+
- `auto` — stays `flat` until the per-request tool count would exceed `drilldownThreshold`, then switches to `drilldown`.
|
|
705
|
+
|
|
693
706
|
Use `IConfigService.getMcpConfig()` to read the resolved config with all defaults applied.
|
|
694
707
|
|
|
695
708
|
---
|
package/dist/index.d.ts
CHANGED
|
@@ -20,9 +20,10 @@ export { ForgeContainer } from './container';
|
|
|
20
20
|
export type { ForgeContainerOptions, StorageFormat } from './container';
|
|
21
21
|
export { getServiceContainer, registerCoreServices, ServiceContainer, ServiceIdentifiers } from './di';
|
|
22
22
|
export type { PlatformAdapters, ServiceIdentifier } from './di';
|
|
23
|
-
export { buildCollectionToolDescription, buildCollectionToolName, buildFolderToolDescription, buildFolderToolName, buildRequestToolDescription, buildRequestToolName, buildSuiteToolDescription, buildSuiteToolName, mcpToolToken, parseMcpToolName, resolveFolderToken, resolveToken } from './runtime/mcp-tool-name';
|
|
23
|
+
export { buildCollectionToolDescription, buildCollectionToolName, buildFolderToolDescription, buildFolderToolName, buildRequestToolDescription, buildRequestToolName, buildSuiteToolDescription, buildSuiteToolName, mcpToolSegment, mcpToolToken, parseMcpToolName, resolveFolderToken, resolveToken } from './runtime/mcp-tool-name';
|
|
24
24
|
export type { McpToolKind, ParsedMcpToolName } from './runtime/mcp-tool-name';
|
|
25
|
-
export { COLLECTION_INPUT_SCHEMA, FOLDER_INPUT_SCHEMA, REQUEST_INPUT_SCHEMA, SUITE_INPUT_SCHEMA } from './runtime/mcp-tool-schemas';
|
|
25
|
+
export { buildGenericTools, COLLECTION_INPUT_SCHEMA, FOLDER_INPUT_SCHEMA, GENERIC_TOOL_NAMES, REQUEST_INPUT_SCHEMA, SUITE_INPUT_SCHEMA } from './runtime/mcp-tool-schemas';
|
|
26
|
+
export type { GenericToolName } from './runtime/mcp-tool-schemas';
|
|
26
27
|
export { createMcpRuntime, runCollection, runFolder, runRequest, runSuite } from './runtime/runtime-contracts';
|
|
27
28
|
export type { McpRuntimeHandle, McpRuntimeOptions, RunCollectionOptions, RunRequestOptions, RunSuiteOptions } from './runtime/runtime-contracts';
|
|
28
29
|
export { bootstrapNodeRuntime, createNodeContainer } from './runtime/node-bootstrap';
|
|
@@ -102,7 +103,7 @@ export { ExampleGenerator, HistoryAnalyzer, OpenApiExporter, OpenApiImporter, Re
|
|
|
102
103
|
export type { OpenApiExportOptions, OpenApiImportOptions, ScriptAnalysisResult } from './infrastructure/openapi';
|
|
103
104
|
export * from './infrastructure/openapi/interfaces';
|
|
104
105
|
export { CONFIG_FILES, ConfigService, DEFAULT_CONFIG, ROOT_DIRECTORIES } from './infrastructure/config';
|
|
105
|
-
export type { EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, McpCorsConfig, ProxyConfig, RequestConfig, RestClientExportConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './infrastructure/config';
|
|
106
|
+
export type { EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, McpCorsConfig, McpToolMode, ProxyConfig, RequestConfig, RestClientExportConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './infrastructure/config';
|
|
106
107
|
export { HtmlReportGenerator } from './infrastructure/test-suite/html-report-generator';
|
|
107
108
|
export { DEFAULT_SUITE_CONFIG } from './infrastructure/test-suite/interfaces';
|
|
108
109
|
export type { ErrorSummary, IStatisticsService, ITestSuiteService, RequestStatistics, RunStatistics, RunSummary, SuiteConfig, SuiteRequest, TestSuite } from './infrastructure/test-suite/interfaces';
|