@boolesai/tspec-cli 0.0.3 → 0.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boolesai/tspec-cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "CLI for @boolesai/tspec testing framework",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,7 +22,8 @@
22
22
  "prepublishOnly": "npm run build"
23
23
  },
24
24
  "dependencies": {
25
- "@boolesai/tspec": "^0.0.2",
25
+ "@boolesai/tspec": "^0.0.3",
26
+ "@modelcontextprotocol/sdk": "^1.0.0",
26
27
  "chalk": "^5.0.0",
27
28
  "commander": "^12.0.0",
28
29
  "glob": "^11.0.0",
@@ -1,2 +1,17 @@
1
1
  import { Command } from 'commander';
2
+ import type { OutputFormat } from '../utils/formatter.js';
3
+ export interface ListParams {
4
+ output?: OutputFormat;
5
+ }
6
+ export interface ListExecutionResult {
7
+ success: boolean;
8
+ output: string;
9
+ data: {
10
+ protocols: string[];
11
+ };
12
+ }
13
+ /**
14
+ * List protocols - core logic extracted for MCP integration
15
+ */
16
+ export declare function executeList(params: ListParams): Promise<ListExecutionResult>;
2
17
  export declare const listCommand: Command;
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare const mcpCommand: Command;
@@ -1,2 +1,30 @@
1
1
  import { Command } from 'commander';
2
+ import type { OutputFormat } from '../utils/formatter.js';
3
+ export interface ParseParams {
4
+ files: string[];
5
+ output?: OutputFormat;
6
+ verbose?: boolean;
7
+ env?: Record<string, string>;
8
+ params?: Record<string, string>;
9
+ }
10
+ export interface ParseExecutionResult {
11
+ success: boolean;
12
+ output: string;
13
+ data: {
14
+ testCases: unknown[];
15
+ parseErrors: Array<{
16
+ file: string;
17
+ error: string;
18
+ }>;
19
+ summary: {
20
+ totalFiles: number;
21
+ totalTestCases: number;
22
+ parseErrors: number;
23
+ };
24
+ };
25
+ }
26
+ /**
27
+ * Parse test cases - core logic extracted for MCP integration
28
+ */
29
+ export declare function executeParse(params: ParseParams): Promise<ParseExecutionResult>;
2
30
  export declare const parseCommand: Command;
@@ -1,2 +1,30 @@
1
1
  import { Command } from 'commander';
2
+ import { type FormattedTestResult, type TestResultSummary } from '../utils/formatter.js';
3
+ import type { OutputFormat } from '../utils/formatter.js';
4
+ export interface RunParams {
5
+ files: string[];
6
+ output?: OutputFormat;
7
+ concurrency?: number;
8
+ verbose?: boolean;
9
+ quiet?: boolean;
10
+ failFast?: boolean;
11
+ env?: Record<string, string>;
12
+ params?: Record<string, string>;
13
+ }
14
+ export interface RunExecutionResult {
15
+ success: boolean;
16
+ output: string;
17
+ data: {
18
+ results: FormattedTestResult[];
19
+ summary: TestResultSummary;
20
+ parseErrors: Array<{
21
+ file: string;
22
+ error: string;
23
+ }>;
24
+ };
25
+ }
26
+ /**
27
+ * Execute test cases - core logic extracted for MCP integration
28
+ */
29
+ export declare function executeRun(params: RunParams): Promise<RunExecutionResult>;
2
30
  export declare const runCommand: Command;
@@ -1,2 +1,22 @@
1
1
  import { Command } from 'commander';
2
+ import type { OutputFormat } from '../utils/formatter.js';
3
+ export interface ValidateParams {
4
+ files: string[];
5
+ output?: OutputFormat;
6
+ }
7
+ export interface ValidateExecutionResult {
8
+ success: boolean;
9
+ output: string;
10
+ data: {
11
+ results: Array<{
12
+ file: string;
13
+ valid: boolean;
14
+ errors: string[];
15
+ }>;
16
+ };
17
+ }
18
+ /**
19
+ * Validate test cases - core logic extracted for MCP integration
20
+ */
21
+ export declare function executeValidate(params: ValidateParams): Promise<ValidateExecutionResult>;
2
22
  export declare const validateCommand: Command;
@@ -0,0 +1 @@
1
+ export declare function startMcpServer(): Promise<void>;
@@ -1,3 +1,4 @@
1
+ export type ProtocolType = 'http' | 'grpc' | 'graphql' | 'websocket';
1
2
  export interface FileResolutionResult {
2
3
  files: string[];
3
4
  errors: string[];
@@ -13,6 +14,8 @@ export interface TSpecFileDescriptor {
13
14
  relativePath: string;
14
15
  /** Base filename (e.g., "login.http.tspec") */
15
16
  fileName: string;
17
+ /** Protocol type extracted from filename (e.g., "http" from "login.http.tspec") */
18
+ protocol: ProtocolType | null;
16
19
  }
17
20
  export interface DiscoveryResult {
18
21
  files: TSpecFileDescriptor[];