@http-forge/core 0.5.1 → 0.5.3

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.
@@ -88,13 +88,14 @@ export interface McpCorsConfig {
88
88
  /**
89
89
  * How the MCP server shapes its `tools/list` response.
90
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`.
91
+ * - `auto` (**recommended default**): uses `flat` below `drilldownThreshold`,
92
+ * then switches to `drilldown`. Adapts automatically as the workspace grows.
93
+ * - `drilldown`: always uses the small fixed generic tool set regardless of
94
+ * collection size. Best for large workspaces or context-budget-constrained clients.
95
+ * - `flat`: always emits one tool per request/folder/collection/suite. Only
96
+ * useful for tiny, stable collections or external automation that relies on
97
+ * exact generated tool names. **Avoid for workspaces with >100 requests** —
98
+ * the tool list will bloat the AI context window and degrade tool-selection accuracy.
98
99
  */
99
100
  export type McpToolMode = 'flat' | 'drilldown' | 'auto';
100
101
  /**
@@ -124,8 +125,8 @@ export interface McpConfig {
124
125
  */
125
126
  maxRequestsPerCall: number;
126
127
  /**
127
- * Tool-list shape. Defaults to `flat`. Use `drilldown` or `auto` for very
128
- * large workspaces to keep `tools/list` small and AI-friendly.
128
+ * Tool-list shape. Defaults to `auto`. Use `drilldown` to always use generic
129
+ * tools, or `flat` to always emit one tool per request.
129
130
  */
130
131
  toolMode: McpToolMode;
131
132
  /**
@@ -133,6 +134,13 @@ export interface McpConfig {
133
134
  * tools would exceed this count. Ignored for `flat` and `drilldown`.
134
135
  */
135
136
  drilldownThreshold: number;
137
+ /**
138
+ * Maximum number of tools returned per `tools/list` page in flat mode.
139
+ * The client passes the returned `nextCursor` to fetch the next page.
140
+ * Set to `0` to disable pagination and return all tools in one response.
141
+ * Defaults to `150`. Ignored in drilldown / auto-drilldown mode.
142
+ */
143
+ toolPageSize: number;
136
144
  /** CORS configuration */
137
145
  cors: McpCorsConfig;
138
146
  }
@@ -99,6 +99,13 @@ export interface PreRequestScriptResult {
99
99
  query?: Record<string, string>;
100
100
  };
101
101
  modifiedVariables?: Record<string, string>;
102
+ /**
103
+ * All scopes EXCEPT globals — safe to pass as extraVariables for body resolution.
104
+ * = collectionVariables + environmentVariables + iterationData + local pm.variables.set() writes.
105
+ * Globals are excluded because they are tracked separately via runtimeGlobals in createResolver,
106
+ * and including the session snapshot would risk shadowing a fresh value from a previous request.
107
+ */
108
+ localVariables?: Record<string, string>;
102
109
  modifiedCollectionVariables?: Record<string, string>;
103
110
  modifiedGlobals?: Record<string, string>;
104
111
  modifiedEnvironmentVariables?: Record<string, string>;
@@ -24,7 +24,7 @@ export declare class TestSuiteService implements ITestSuiteService {
24
24
  /** Debounce timer for coalescing rapid change events */
25
25
  private debounceTimer;
26
26
  /** External listener notified after suites are reloaded */
27
- private onSuitesChanged?;
27
+ onSuitesChanged?: SuitesChangedCallback;
28
28
  constructor(collectionService: ICollectionService, configService: IConfigService, options?: {
29
29
  watch?: boolean;
30
30
  onSuitesChanged?: SuitesChangedCallback;
@@ -83,6 +83,10 @@ export declare const COLLECTION_INPUT_SCHEMA: {
83
83
  };
84
84
  readonly description: "Result detail level";
85
85
  };
86
+ readonly async: {
87
+ readonly type: "boolean";
88
+ readonly description: "When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests.";
89
+ };
86
90
  };
87
91
  };
88
92
  export declare const FOLDER_INPUT_SCHEMA: {
@@ -123,6 +127,10 @@ export declare const FOLDER_INPUT_SCHEMA: {
123
127
  };
124
128
  readonly description: "Result detail level";
125
129
  };
130
+ readonly async: {
131
+ readonly type: "boolean";
132
+ readonly description: "When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results. Recommended for folders with many requests.";
133
+ };
126
134
  };
127
135
  };
128
136
  export declare const SUITE_INPUT_SCHEMA: {
@@ -151,6 +159,10 @@ export declare const SUITE_INPUT_SCHEMA: {
151
159
  readonly type: "string";
152
160
  };
153
161
  };
162
+ readonly async: {
163
+ readonly type: "boolean";
164
+ readonly description: "When true, start the run in the background and return a runId immediately. Use get_run_status / get_failed_requests to poll results.";
165
+ };
154
166
  readonly requestFilter: {
155
167
  readonly type: "array";
156
168
  readonly items: {
@@ -171,11 +183,19 @@ export declare const SUITE_INPUT_SCHEMA: {
171
183
  /** Stable names of the generic drill-down tools (prefix is added separately). */
172
184
  export declare const GENERIC_TOOL_NAMES: {
173
185
  readonly listCollections: "list_collections";
186
+ readonly listFolders: "list_folders";
174
187
  readonly listRequests: "list_requests";
188
+ readonly searchRequests: "search_requests";
189
+ readonly getEnvironment: "get_environment";
175
190
  readonly runRequest: "run_request";
176
191
  readonly runFolder: "run_folder";
177
192
  readonly runCollection: "run_collection";
178
193
  readonly runSuite: "run_suite";
194
+ readonly getRunStatus: "get_run_status";
195
+ readonly getRunSummary: "get_run_summary";
196
+ readonly getFailedRequests: "get_failed_requests";
197
+ readonly getRequestResult: "get_request_result";
198
+ readonly setVariable: "set_variable";
179
199
  };
180
200
  export type GenericToolName = (typeof GENERIC_TOOL_NAMES)[keyof typeof GENERIC_TOOL_NAMES];
181
201
  interface GenericToolDef {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@http-forge/core",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Headless HTTP testing engine with Postman collection support, dynamic variables, and script-based automation.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",