@http-forge/core 0.4.7 → 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 +42 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +206 -206
- package/dist/index.mjs +206 -206
- package/dist/infrastructure/auth/oauth2-token-manager.d.ts +1 -1
- 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 +7 -1
- package/dist/infrastructure/script/request-script-session.d.ts +13 -0
- package/dist/infrastructure/script/script-factories.d.ts +57 -6
- package/dist/infrastructure/script/script-utils.d.ts +14 -0
- package/dist/runtime/mcp-tool-name.d.ts +64 -0
- package/dist/runtime/mcp-tool-schemas.d.ts +192 -0
- package/package.json +1 -1
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* is injected via IExternalBrowserService and ISecretStore interfaces.
|
|
15
15
|
*/
|
|
16
16
|
import { IEnvironmentConfigService } from '../../types/environment-config';
|
|
17
|
-
import { IHttpRequestService } from '../http/interfaces';
|
|
18
17
|
import { IExternalBrowserService, ISecretStore } from '../../types/platform';
|
|
19
18
|
import { OAuth2Config } from '../../types/types';
|
|
19
|
+
import { IHttpRequestService } from '../http/interfaces';
|
|
20
20
|
import { IOAuth2TokenManager, TokenCacheKey, TokenInfo } from './interfaces';
|
|
21
21
|
export declare class OAuth2TokenManager implements IOAuth2TokenManager {
|
|
22
22
|
private readonly secretStore;
|
|
@@ -85,6 +85,18 @@ export interface McpCorsConfig {
|
|
|
85
85
|
/** Origins allowed to access the MCP server (defaults to localhost variants) */
|
|
86
86
|
allowedOrigins: string[];
|
|
87
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* How the MCP server shapes its `tools/list` response.
|
|
90
|
+
*
|
|
91
|
+
* - `flat`: one tool per request/folder/collection/suite (most discoverable;
|
|
92
|
+
* best for AI agents, but the list grows with the number of requests).
|
|
93
|
+
* - `drilldown`: a small fixed set of generic tools (`list_collections`,
|
|
94
|
+
* `list_requests`, `run_request`, `run_folder`, `run_collection`, `run_suite`)
|
|
95
|
+
* whose arguments select the target. The list stays tiny regardless of scale.
|
|
96
|
+
* - `auto`: use `flat` until the number of request tools would exceed
|
|
97
|
+
* `drilldownThreshold`, then switch to `drilldown`.
|
|
98
|
+
*/
|
|
99
|
+
export type McpToolMode = 'flat' | 'drilldown' | 'auto';
|
|
88
100
|
/**
|
|
89
101
|
* MCP Server project-level configuration (stored in http-forge.config.json)
|
|
90
102
|
*
|
|
@@ -111,6 +123,16 @@ export interface McpConfig {
|
|
|
111
123
|
* collection or suite call. Prevents accidental runaway executions.
|
|
112
124
|
*/
|
|
113
125
|
maxRequestsPerCall: number;
|
|
126
|
+
/**
|
|
127
|
+
* Tool-list shape. Defaults to `flat`. Use `drilldown` or `auto` for very
|
|
128
|
+
* large workspaces to keep `tools/list` small and AI-friendly.
|
|
129
|
+
*/
|
|
130
|
+
toolMode: McpToolMode;
|
|
131
|
+
/**
|
|
132
|
+
* When `toolMode` is `auto`, switch to drilldown once the number of request
|
|
133
|
+
* tools would exceed this count. Ignored for `flat` and `drilldown`.
|
|
134
|
+
*/
|
|
135
|
+
drilldownThreshold: number;
|
|
114
136
|
/** CORS configuration */
|
|
115
137
|
cors: McpCorsConfig;
|
|
116
138
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Config Services
|
|
3
3
|
*/
|
|
4
|
-
export type { EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, McpCorsConfig, ProxyConfig, RequestConfig, RestClientExportConfig, RunnerConfig, ScriptsConfig, StorageConfig } from './config.interface';
|
|
4
|
+
export type { EnvironmentsConfig, HttpForgeConfig, IConfigService, McpConfig, McpCorsConfig, McpToolMode, 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';
|
|
@@ -49,8 +49,14 @@ export interface ResponseContext {
|
|
|
49
49
|
status: number;
|
|
50
50
|
statusText: string;
|
|
51
51
|
headers: Record<string, string>;
|
|
52
|
+
/** Raw response body string (Postman-compatible). Parse on demand via response.json(). */
|
|
52
53
|
body: any;
|
|
53
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Response cookies parsed from Set-Cookie headers, including metadata such as
|
|
56
|
+
* domain, path, expires, maxAge, httpOnly, secure and sameSite. Exposed to
|
|
57
|
+
* scripts as the Postman-compatible `pm.response.cookies` CookieList.
|
|
58
|
+
*/
|
|
59
|
+
cookies?: Cookie[];
|
|
54
60
|
responseTime?: number;
|
|
55
61
|
responseSize?: number;
|
|
56
62
|
}
|
|
@@ -64,6 +64,19 @@ export declare class RequestScriptSession implements IRequestScriptSession {
|
|
|
64
64
|
* Maps HTTP Forge body types to Postman modes for script API compatibility
|
|
65
65
|
*/
|
|
66
66
|
private createRequestObject;
|
|
67
|
+
/**
|
|
68
|
+
* Inject the legacy (pre-`pm.*`) Postman/Newman sandbox globals into the VM context.
|
|
69
|
+
*
|
|
70
|
+
* Older Postman scripts (and many Newman-exported collections) rely on bare globals
|
|
71
|
+
* that the modern `pm.*` sandbox no longer injects. Evaluating them (e.g. `request.name`,
|
|
72
|
+
* `responseCode.code`, `tv4.validate(...)`) otherwise throws `ReferenceError`.
|
|
73
|
+
*
|
|
74
|
+
* Available in BOTH phases: `request`, `environment`, `globals`, `data`, `iteration`.
|
|
75
|
+
* Available in the TEST phase only: `responseBody`, `responseCode`, `responseHeaders`,
|
|
76
|
+
* `responseTime`, `responseCookies`, `tests`, plus `postman.getResponseHeader()` /
|
|
77
|
+
* `postman.getResponseCookie()`.
|
|
78
|
+
*/
|
|
79
|
+
private injectLegacyGlobals;
|
|
67
80
|
/**
|
|
68
81
|
* Execute pre-request scripts in the shared session
|
|
69
82
|
*/
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Single Responsibility: Create objects used in script execution contexts
|
|
5
5
|
* Open/Closed: New factory methods can be added without modifying existing ones
|
|
6
6
|
*/
|
|
7
|
+
import { Cookie } from '../cookie/interfaces';
|
|
7
8
|
import { ResponseContext } from './interfaces';
|
|
8
9
|
/**
|
|
9
10
|
* Minimal, dependency-free JSON Schema validator.
|
|
@@ -18,21 +19,24 @@ export declare function validateJsonSchema(data: any, schema: any, path?: string
|
|
|
18
19
|
* Response object interface for script context
|
|
19
20
|
*/
|
|
20
21
|
export interface ScriptResponse {
|
|
21
|
-
status
|
|
22
|
+
/** Reason phrase string (Postman parity, e.g. "OK"). Use `code` for the numeric status. */
|
|
23
|
+
status: string;
|
|
22
24
|
code: number;
|
|
23
25
|
statusText: string;
|
|
24
26
|
headers: Record<string, string>;
|
|
27
|
+
/** Raw response body string (Postman-compatible). Use json() to parse, text() for the string. */
|
|
25
28
|
body: any;
|
|
26
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Postman-compatible CookieList. Use `cookies.get(name)` for the value string,
|
|
31
|
+
* `cookies.one(name)` for the full cookie object (domain, path, expires, maxAge,
|
|
32
|
+
* httpOnly, secure, sameSite), `cookies.has(name)`, `cookies.toObject()`, or iterate.
|
|
33
|
+
*/
|
|
34
|
+
cookies: CookieList;
|
|
27
35
|
responseTime?: number;
|
|
28
36
|
responseSize?: number;
|
|
29
|
-
getHeader(name: string): string | undefined;
|
|
30
|
-
getCookie(name: string): string | undefined;
|
|
31
37
|
reason(): string;
|
|
32
38
|
json(): any;
|
|
33
39
|
text(): string;
|
|
34
|
-
cookie(name: string): string | undefined;
|
|
35
|
-
hasCookie(name: string): boolean;
|
|
36
40
|
to: ResponseAssertions;
|
|
37
41
|
}
|
|
38
42
|
/**
|
|
@@ -55,6 +59,53 @@ export interface ResponseAssertions {
|
|
|
55
59
|
readonly serverError: any;
|
|
56
60
|
};
|
|
57
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Postman-compatible Cookie object (a single entry of a CookieList).
|
|
64
|
+
*
|
|
65
|
+
* Coerces to its value string via valueOf()/toString() so `cookie == 'abc'`
|
|
66
|
+
* and template literals work, while still exposing the full metadata.
|
|
67
|
+
*/
|
|
68
|
+
export interface PostmanCookie {
|
|
69
|
+
name: string;
|
|
70
|
+
value: string;
|
|
71
|
+
domain?: string;
|
|
72
|
+
path?: string;
|
|
73
|
+
expires?: string;
|
|
74
|
+
maxAge?: number;
|
|
75
|
+
httpOnly: boolean;
|
|
76
|
+
secure: boolean;
|
|
77
|
+
/** True when the cookie has neither Expires nor Max-Age (cleared at session end). */
|
|
78
|
+
session: boolean;
|
|
79
|
+
hostOnly: boolean;
|
|
80
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
81
|
+
valueOf(): string;
|
|
82
|
+
toString(): string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Postman-compatible CookieList (a PropertyList of cookies).
|
|
86
|
+
*
|
|
87
|
+
* Mirrors the Postman SDK API:
|
|
88
|
+
* - `cookies.get(name)` → the cookie VALUE string (or undefined)
|
|
89
|
+
* - `cookies.one(name)` → the full cookie OBJECT (or undefined)
|
|
90
|
+
* - `cookies.has(name)` → boolean
|
|
91
|
+
* - `cookies.toObject()` → plain `{ name: value }` map
|
|
92
|
+
* It is also a real array, so `forEach`, `map`, `filter`, `find`, numeric
|
|
93
|
+
* indexing and `for...of` iteration all work over the cookie objects.
|
|
94
|
+
*/
|
|
95
|
+
export interface CookieList extends Array<PostmanCookie> {
|
|
96
|
+
get(name: string): string | undefined;
|
|
97
|
+
one(name: string): PostmanCookie | undefined;
|
|
98
|
+
has(name: string): boolean;
|
|
99
|
+
toObject(): Record<string, string>;
|
|
100
|
+
all(): PostmanCookie[];
|
|
101
|
+
each(cb: (cookie: PostmanCookie) => void): void;
|
|
102
|
+
count(): number;
|
|
103
|
+
idx(index: number): PostmanCookie | undefined;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Create a Postman-compatible CookieList from parsed cookies.
|
|
107
|
+
*/
|
|
108
|
+
export declare function createCookieList(cookies: Cookie[]): CookieList;
|
|
58
109
|
/**
|
|
59
110
|
* Create response object with helper methods for script context
|
|
60
111
|
* Provides Postman-compatible response API
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* These are stateless helper functions with no side effects
|
|
6
6
|
*/
|
|
7
7
|
import { TestAssertion } from '../../types/types';
|
|
8
|
+
import { Cookie } from '../cookie/interfaces';
|
|
8
9
|
/**
|
|
9
10
|
* Console message structure for script output
|
|
10
11
|
*/
|
|
@@ -47,3 +48,16 @@ export declare function createTestFunction(assertions: TestAssertion[]): any;
|
|
|
47
48
|
* Converts multi-value headers (string[]) to comma-separated strings
|
|
48
49
|
*/
|
|
49
50
|
export declare function normalizeHeaders(headers: Record<string, string | string[]>): Record<string, string>;
|
|
51
|
+
/**
|
|
52
|
+
* Build rich response cookie metadata for the legacy Postman sandbox.
|
|
53
|
+
*
|
|
54
|
+
* Prefers parsing the raw `Set-Cookie` response headers via CookieUtils, which
|
|
55
|
+
* captures full metadata (domain, path, expires, maxAge, httpOnly, secure,
|
|
56
|
+
* sameSite). Falls back to the HTTP client's already-parsed cookie array when
|
|
57
|
+
* the raw headers are unavailable (e.g. some fetch-based transports).
|
|
58
|
+
*
|
|
59
|
+
* @param headers - Raw response headers (Set-Cookie may be a string[])
|
|
60
|
+
* @param parsedCookies - Cookie objects already parsed by the HTTP client
|
|
61
|
+
* @param requestUrl - URL used to derive the default cookie domain
|
|
62
|
+
*/
|
|
63
|
+
export declare function parseResponseCookieDetails(headers: Record<string, string | string[]> | undefined, parsedCookies: any[] | undefined, requestUrl?: string): Cookie[];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP tool-name encoding / decoding.
|
|
3
|
+
*
|
|
4
|
+
* MCP tool names must stay under Anthropic's 128-character limit. HTTP Forge
|
|
5
|
+
* IDs embed the human-readable entity name (up to ~100 chars each), so a raw
|
|
6
|
+
* tool name like `request__<collectionId>__<requestId>` can exceed 240 chars
|
|
7
|
+
* and be rejected by the model provider.
|
|
8
|
+
*
|
|
9
|
+
* To balance discoverability and the length limit we embed the raw ID verbatim
|
|
10
|
+
* when it is a safe, short segment (so names stay human-readable), and otherwise
|
|
11
|
+
* substitute a deterministic short hash token. A whole-name length guard re-hashes
|
|
12
|
+
* every segment when the assembled name would still be too long. A call resolves
|
|
13
|
+
* back to the real entity by matching the segment against the current
|
|
14
|
+
* collections / requests / folders / suites (raw equality OR hash), so both raw
|
|
15
|
+
* and hashed names — including previously-listed long names — keep working.
|
|
16
|
+
*
|
|
17
|
+
* IDs are NOT changed — they remain the stable external references used by
|
|
18
|
+
* suites, result filenames, and history. Only the tool *name* is shortened.
|
|
19
|
+
*
|
|
20
|
+
* The model selects a tool by its *description* (which still contains the
|
|
21
|
+
* human-readable names), so the exact tool name does not affect tool choice.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Deterministic short token for an ID or folder path (12 hex chars).
|
|
25
|
+
* @param value The value to be hashed.
|
|
26
|
+
* @param maxLen The maximum length of the raw segment before appending the hash.
|
|
27
|
+
* @returns A string combining the truncated value and its hash.
|
|
28
|
+
*/
|
|
29
|
+
export declare function mcpToolToken(value: string, maxLen?: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* Return `value` verbatim when it is a safe, short raw segment (discoverable),
|
|
32
|
+
* otherwise its deterministic hash token. Either way the result never contains
|
|
33
|
+
* `__`, so tool-name parsing by `split('__')` stays unambiguous.
|
|
34
|
+
*
|
|
35
|
+
* @param value The value to be used as a tool segment.
|
|
36
|
+
* @param maxLen The maximum length of the raw segment before falling back to a hash token.
|
|
37
|
+
* @returns A string representing the tool segment, either raw or hashed.
|
|
38
|
+
*/
|
|
39
|
+
export declare function mcpToolSegment(value: string, maxLen?: number): string;
|
|
40
|
+
export type McpToolKind = 'request' | 'collection' | 'folder' | 'suite';
|
|
41
|
+
export declare function buildRequestToolName(prefix: string, collectionId: string, requestId: string): string;
|
|
42
|
+
export declare function buildCollectionToolName(prefix: string, collectionId: string): string;
|
|
43
|
+
export declare function buildFolderToolName(prefix: string, collectionId: string, folderPath: string): string;
|
|
44
|
+
export declare function buildSuiteToolName(prefix: string, suiteId: string): string;
|
|
45
|
+
export interface ParsedMcpToolName {
|
|
46
|
+
kind: McpToolKind;
|
|
47
|
+
tokens: string[];
|
|
48
|
+
}
|
|
49
|
+
/** Parse a tool name (prefix already stripped) into its kind + token segments. */
|
|
50
|
+
export declare function parseMcpToolName(name: string): ParsedMcpToolName;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve a token back to one of `candidates` by matching its hash token, or
|
|
53
|
+
* (legacy fallback) the raw candidate value itself.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveToken(token: string, candidates: readonly string[]): string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Resolve a folder token to a folder path. Adds a base64url legacy fallback for
|
|
58
|
+
* folder tool names emitted before hashing (which embedded base64url(path)).
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveFolderToken(token: string, folderPaths: readonly string[]): string | undefined;
|
|
61
|
+
export declare function buildRequestToolDescription(method: string, requestName: string, collectionName: string, folderPath: string): string;
|
|
62
|
+
export declare function buildCollectionToolDescription(collectionName: string, requestCount: number): string;
|
|
63
|
+
export declare function buildFolderToolDescription(folderPath: string, collectionName: string, requestCount: number): string;
|
|
64
|
+
export declare function buildSuiteToolDescription(suiteName: string, requestCount: number, iterations: number): string;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP tool input schemas.
|
|
3
|
+
*
|
|
4
|
+
* Both MCP server implementations (the embeddable core runtime and the VS Code
|
|
5
|
+
* extension) expose the same tools, so they must advertise identical input
|
|
6
|
+
* schemas. Keeping these in one place prevents the two sides from drifting
|
|
7
|
+
* (e.g. the extension previously omitted `iterations`/`delay`/`include` for
|
|
8
|
+
* collection and folder runs even though its executor supported them).
|
|
9
|
+
*/
|
|
10
|
+
export declare const REQUEST_INPUT_SCHEMA: {
|
|
11
|
+
readonly type: "object";
|
|
12
|
+
readonly properties: {
|
|
13
|
+
readonly environment: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly description: "Environment name to use (defaults to the currently selected environment)";
|
|
16
|
+
};
|
|
17
|
+
readonly variables: {
|
|
18
|
+
readonly type: "object";
|
|
19
|
+
readonly description: "Extra variables to inject — merged with environment variables, {{name}} syntax";
|
|
20
|
+
readonly additionalProperties: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
readonly headers: {
|
|
25
|
+
readonly type: "object";
|
|
26
|
+
readonly description: "Override or add request headers";
|
|
27
|
+
readonly additionalProperties: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
readonly query: {
|
|
32
|
+
readonly type: "object";
|
|
33
|
+
readonly description: "Override query parameters";
|
|
34
|
+
readonly additionalProperties: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly body: {
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
readonly description: "Replace the request body (JSON string). Omit to use the saved body.";
|
|
41
|
+
};
|
|
42
|
+
readonly include: {
|
|
43
|
+
readonly type: "array";
|
|
44
|
+
readonly items: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly enum: readonly ["headers", "cookies", "tests", "consoleOutput", "report"];
|
|
47
|
+
};
|
|
48
|
+
readonly description: "Extra fields to include in the response (default: status, ok, body, allPassed)";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare const COLLECTION_INPUT_SCHEMA: {
|
|
53
|
+
readonly type: "object";
|
|
54
|
+
readonly properties: {
|
|
55
|
+
readonly environment: {
|
|
56
|
+
readonly type: "string";
|
|
57
|
+
readonly description: "Environment name to use";
|
|
58
|
+
};
|
|
59
|
+
readonly variables: {
|
|
60
|
+
readonly type: "object";
|
|
61
|
+
readonly description: "Extra variables injected into every request";
|
|
62
|
+
readonly additionalProperties: {
|
|
63
|
+
readonly type: "string";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly iterations: {
|
|
67
|
+
readonly type: "number";
|
|
68
|
+
readonly description: "Number of iterations (default: 1)";
|
|
69
|
+
};
|
|
70
|
+
readonly stopOnError: {
|
|
71
|
+
readonly type: "boolean";
|
|
72
|
+
readonly description: "Stop on first failure";
|
|
73
|
+
};
|
|
74
|
+
readonly delay: {
|
|
75
|
+
readonly type: "number";
|
|
76
|
+
readonly description: "Delay between requests in ms";
|
|
77
|
+
};
|
|
78
|
+
readonly include: {
|
|
79
|
+
readonly type: "array";
|
|
80
|
+
readonly items: {
|
|
81
|
+
readonly type: "string";
|
|
82
|
+
readonly enum: readonly ["perRequest", "failedOnly", "consoleOutput", "report"];
|
|
83
|
+
};
|
|
84
|
+
readonly description: "Result detail level";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export declare const FOLDER_INPUT_SCHEMA: {
|
|
89
|
+
readonly type: "object";
|
|
90
|
+
readonly properties: {
|
|
91
|
+
readonly environment: {
|
|
92
|
+
readonly type: "string";
|
|
93
|
+
readonly description: "Environment name to use";
|
|
94
|
+
};
|
|
95
|
+
readonly variables: {
|
|
96
|
+
readonly type: "object";
|
|
97
|
+
readonly description: "Extra variables injected into every request";
|
|
98
|
+
readonly additionalProperties: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
readonly iterations: {
|
|
103
|
+
readonly type: "number";
|
|
104
|
+
readonly description: "Number of iterations (default: 1)";
|
|
105
|
+
};
|
|
106
|
+
readonly stopOnError: {
|
|
107
|
+
readonly type: "boolean";
|
|
108
|
+
readonly description: "Stop on first failure";
|
|
109
|
+
};
|
|
110
|
+
readonly delay: {
|
|
111
|
+
readonly type: "number";
|
|
112
|
+
readonly description: "Delay between requests in ms";
|
|
113
|
+
};
|
|
114
|
+
readonly recursive: {
|
|
115
|
+
readonly type: "boolean";
|
|
116
|
+
readonly description: "Include requests in nested subfolders (default: true)";
|
|
117
|
+
};
|
|
118
|
+
readonly include: {
|
|
119
|
+
readonly type: "array";
|
|
120
|
+
readonly items: {
|
|
121
|
+
readonly type: "string";
|
|
122
|
+
readonly enum: readonly ["perRequest", "failedOnly", "consoleOutput", "report"];
|
|
123
|
+
};
|
|
124
|
+
readonly description: "Result detail level";
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
export declare const SUITE_INPUT_SCHEMA: {
|
|
129
|
+
readonly type: "object";
|
|
130
|
+
readonly properties: {
|
|
131
|
+
readonly environment: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
readonly description: "Environment name to use";
|
|
134
|
+
};
|
|
135
|
+
readonly iterations: {
|
|
136
|
+
readonly type: "number";
|
|
137
|
+
readonly description: "Number of iterations (overrides suite default)";
|
|
138
|
+
};
|
|
139
|
+
readonly stopOnError: {
|
|
140
|
+
readonly type: "boolean";
|
|
141
|
+
readonly description: "Stop on first failure";
|
|
142
|
+
};
|
|
143
|
+
readonly delay: {
|
|
144
|
+
readonly type: "number";
|
|
145
|
+
readonly description: "Delay between requests in ms";
|
|
146
|
+
};
|
|
147
|
+
readonly variables: {
|
|
148
|
+
readonly type: "object";
|
|
149
|
+
readonly description: "Extra variables injected into every request";
|
|
150
|
+
readonly additionalProperties: {
|
|
151
|
+
readonly type: "string";
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
readonly requestFilter: {
|
|
155
|
+
readonly type: "array";
|
|
156
|
+
readonly items: {
|
|
157
|
+
readonly type: "string";
|
|
158
|
+
};
|
|
159
|
+
readonly description: "Run only requests whose names match one of these strings (case-insensitive)";
|
|
160
|
+
};
|
|
161
|
+
readonly include: {
|
|
162
|
+
readonly type: "array";
|
|
163
|
+
readonly items: {
|
|
164
|
+
readonly type: "string";
|
|
165
|
+
readonly enum: readonly ["perRequest", "failedOnly", "consoleOutput", "report"];
|
|
166
|
+
};
|
|
167
|
+
readonly description: "Result detail level (default: summary + failedRequests)";
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
/** Stable names of the generic drill-down tools (prefix is added separately). */
|
|
172
|
+
export declare const GENERIC_TOOL_NAMES: {
|
|
173
|
+
readonly listCollections: "list_collections";
|
|
174
|
+
readonly listRequests: "list_requests";
|
|
175
|
+
readonly runRequest: "run_request";
|
|
176
|
+
readonly runFolder: "run_folder";
|
|
177
|
+
readonly runCollection: "run_collection";
|
|
178
|
+
readonly runSuite: "run_suite";
|
|
179
|
+
};
|
|
180
|
+
export type GenericToolName = (typeof GENERIC_TOOL_NAMES)[keyof typeof GENERIC_TOOL_NAMES];
|
|
181
|
+
interface GenericToolDef {
|
|
182
|
+
name: string;
|
|
183
|
+
description: string;
|
|
184
|
+
inputSchema: Record<string, unknown>;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Build the generic drill-down tool definitions. `collectionLabels` and
|
|
188
|
+
* `suiteLabels` are the human-readable names injected as enums so the model can
|
|
189
|
+
* only choose targets that exist.
|
|
190
|
+
*/
|
|
191
|
+
export declare function buildGenericTools(prefix: string, collectionLabels: readonly string[], suiteLabels: readonly string[]): GenericToolDef[];
|
|
192
|
+
export {};
|
package/package.json
CHANGED